00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef COSXSCREENSAVER_H
00016 #define COSXSCREENSAVER_H
00017
00018 #include "IScreenSaver.h"
00019 #include <Carbon/Carbon.h>
00020
00022 class COSXScreenSaver : public IScreenSaver {
00023 public:
00024 COSXScreenSaver(void* eventTarget);
00025 virtual ~COSXScreenSaver();
00026
00027
00028 virtual void enable();
00029 virtual void disable();
00030 virtual void activate();
00031 virtual void deactivate();
00032 virtual bool isActive() const;
00033
00034 private:
00035 void processLaunched(ProcessSerialNumber psn);
00036 void processTerminated(ProcessSerialNumber psn);
00037
00038 static pascal OSStatus
00039 launchTerminationCallback(
00040 EventHandlerCallRef nextHandler,
00041 EventRef theEvent, void* userData);
00042
00043 private:
00044
00045 void* m_eventTarget;
00046
00047 bool m_enabled;
00048 void* m_screenSaverController;
00049 void* m_autoReleasePool;
00050 EventHandlerRef m_launchTerminationEventHandlerRef;
00051 ProcessSerialNumber m_screenSaverPSN;
00052 };
00053
00054 #endif