COSXScreenSaver.h

00001 /*
00002  * synergy -- mouse and keyboard sharing utility
00003  * Copyright (C) 2002 Chris Schoeneman
00004  * 
00005  * This package is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU General Public License
00007  * found in the file COPYING that should have accompanied this file.
00008  * 
00009  * This package is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
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     // IScreenSaver overrides
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     // the target for the events we generate
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

Generated on Fri Nov 6 00:18:45 2009 for synergy-plus by  doxygen 1.4.7