00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef MACSYSTEM_H
00024 #define MACSYSTEM_H
00025
00026 #include <AppleEvents.h>
00027 #include <Events.h>
00028 #include <Files.h>
00029 #include "cssys/system.h"
00030
00031 #define MAX_ARGS 25
00032
00033 class iMacGraphics;
00034 struct iObjectRegistry;
00035
00036 class SysSystemDriver : public csSystemDriver, public iEventPlug
00037 {
00038 public:
00039 SysSystemDriver(iObjectRegistry* object_reg);
00040 virtual ~SysSystemDriver();
00041
00042 virtual void Close();
00043
00044 virtual bool Initialize ();
00045
00046 virtual void Alert( const char* s );
00047 virtual void Warn( const char* s );
00048
00049 OSErr HandleAppleEvent( const AppleEvent *theEvent );
00050
00051 SCF_DECLARE_IBASE_EXT (csSystemDriver);
00052
00053
00054
00055 virtual unsigned GetPotentiallyConflictingEvents ()
00056 { return CSEVTYPE_Keyboard | CSEVTYPE_Mouse; }
00057 virtual unsigned QueryEventPriority (unsigned )
00058 { return 100; }
00059
00060 private:
00061 void DispatchEvent( EventRecord *theEvent, iMacGraphics* piG2D );
00062 void HandleMouseEvent( EventRecord *theEvent, iMacGraphics* piG2D );
00063 void HandleMenuUpdate( void );
00064 void HandleMenuSelection( const short menuNum, const short itemNum );
00065 void HandleKey( const unsigned char key, const char keycode, const short modifiers, bool down );
00066 void HandleHLEvent( EventRecord *theEvent );
00067 void HandleOSEvent( EventRecord *theEvent, iMacGraphics* piG2D );
00068 void ScanKeyboard( );
00069 int GetCommandLine( char ***arg );
00070 int ParseCommandLine( char *s );
00071
00072 void DoAboutDialog( void);
00073
00074 Str255 mAppName;
00075 FSSpec mAppLocation;
00076
00077 bool mInputSprocketsAvailable;
00078 bool mInputSprocketsRunning;
00079
00080 bool mDriverNeedsEvent;
00081 iGraphics2D* mG2D;
00082 iMacGraphics* mIG2D;
00083
00084 char CommandLine[256];
00085 char argStr[256];
00086 char *argv[MAX_ARGS + 1];
00087
00088 long mKeyboardState[4];
00089
00090 iEventOutlet *EventOutlet;
00091 };
00092
00093 #endif