home *** CD-ROM | disk | FTP | other *** search
- #include <iostream>
- #include "SIOUX.h"
- #include "CDTrayControl.h"
- #include "CDTrayServer.h"
- #include "PO_Globals.h"
-
- using namespace std;
-
- static bool gRunningQ = true;
-
- static pascal OSErr _Quit(const AppleEvent* inEvent,AppleEvent* outReply,UInt32 refCon)
- {
- PO_EnterCallback();
- gRunningQ = false;
- PO_ExitCallback();
- return noErr;
- }
-
- void main()
- {
- InitGraf(&qd.thePort);
-
- PO_PrepareCallback();
-
- AEInstallEventHandler(kCoreEventClass,kAEQuitApplication,_Quit,0,false);
-
- OSStatus err = noErr;
- CDTrayServer server(err);
-
- if(not err){
- while(gRunningQ){
- EventRecord e;
-
- WaitNextEvent(everyEvent,&e,5,NULL);
- if(e.what == keyDown){
- break;
- }
-
- server.Idle();
- }
- }
-
- }