mirror of
https://github.com/tschak909/platotermClassicMac.git
synced 2024-12-28 03:29:20 +00:00
Flesh out apple events, add an update event stub. Hopefully this will make the window behave better in multitasking systems.
This commit is contained in:
parent
227f948745
commit
df05c53db3
43
screen.c
43
screen.c
@ -39,6 +39,31 @@ RGBColor current_foreground;
|
|||||||
RGBColor current_background;
|
RGBColor current_background;
|
||||||
int windowWidth;
|
int windowWidth;
|
||||||
int windowHeight;
|
int windowHeight;
|
||||||
|
static AEEventHandlerUPP oappUPP, odocUPP, pdocUPP, quitUPP;
|
||||||
|
extern unsigned char running;
|
||||||
|
|
||||||
|
/* Apple Event Handler callbacks */
|
||||||
|
|
||||||
|
static pascal OSErr AEOpenApplication(const AppleEvent *theAE, AppleEvent *reply, UInt32 refCon)
|
||||||
|
{
|
||||||
|
return noErr;
|
||||||
|
}
|
||||||
|
|
||||||
|
static pascal OSErr AEOpenDocuments(const AppleEvent *theAE, AppleEvent *reply, UInt32 refCon)
|
||||||
|
{
|
||||||
|
return errAEEventNotHandled;
|
||||||
|
}
|
||||||
|
|
||||||
|
static pascal OSErr AEPrintDocuments(const AppleEvent *theAE, AppleEvent *reply, UInt32 refCon)
|
||||||
|
{
|
||||||
|
return errAEEventNotHandled;
|
||||||
|
}
|
||||||
|
|
||||||
|
static pascal OSErr AEQuitApplication(const AppleEvent *theAE, AppleEvent *reply, UInt32 refCon)
|
||||||
|
{
|
||||||
|
running=false;
|
||||||
|
return noErr;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* screen_init() - Set up the screen
|
* screen_init() - Set up the screen
|
||||||
@ -50,7 +75,20 @@ void screen_init(void)
|
|||||||
InitWindows();
|
InitWindows();
|
||||||
InitMenus();
|
InitMenus();
|
||||||
InitPalettes();
|
InitPalettes();
|
||||||
|
TEInit();
|
||||||
|
InitDialogs(NULL);
|
||||||
|
InitCursor();
|
||||||
|
|
||||||
|
/* Attach Apple Event handler callbacks */
|
||||||
|
oappUPP = NewAEEventHandlerUPP(AEOpenApplication);
|
||||||
|
AEInstallEventHandler(kCoreEventClass, kAEOpenApplication, oappUPP, 0L, false);
|
||||||
|
odocUPP = NewAEEventHandlerUPP(AEOpenDocuments);
|
||||||
|
AEInstallEventHandler(kCoreEventClass, kAEOpenDocuments, odocUPP, 0L, false);
|
||||||
|
pdocUPP = NewAEEventHandlerUPP(AEPrintDocuments);
|
||||||
|
AEInstallEventHandler(kCoreEventClass, kAEPrintDocuments, pdocUPP, 0L, false);
|
||||||
|
quitUPP = NewAEEventHandlerUPP(AEQuitApplication);
|
||||||
|
AEInstallEventHandler(kCoreEventClass, kAEQuitApplication, quitUPP, 0L, false);
|
||||||
|
|
||||||
current_foreground.red=255;
|
current_foreground.red=255;
|
||||||
current_foreground.green=255;
|
current_foreground.green=255;
|
||||||
current_foreground.blue=255;
|
current_foreground.blue=255;
|
||||||
@ -190,7 +228,10 @@ void screen_main(void)
|
|||||||
keyboard_main(&theEvent);
|
keyboard_main(&theEvent);
|
||||||
break;
|
break;
|
||||||
case updateEvt:
|
case updateEvt:
|
||||||
/* To be implemented, somehow... */
|
BeginUpdate((WindowPtr)theEvent.message);
|
||||||
|
EndUpdate((WindowPtr)theEvent.message);
|
||||||
|
case kHighLevelEvent:
|
||||||
|
AEProcessAppleEvent(&theEvent);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user