diff --git a/GUSI/include/GUSIBasics.h b/GUSI/include/GUSIBasics.h index 370769b..a26170e 100755 --- a/GUSI/include/GUSIBasics.h +++ b/GUSI/include/GUSIBasics.h @@ -170,4 +170,8 @@ int GUSI_sprintf(char * s, const char * format, ...); #endif /* GUSI_SOURCE */ +#if TARGET_API_MAC_CARBON +# define LMGetTicks() TickCount() +#endif + #endif /* _GUSIBasics_ */ diff --git a/GUSI/src/tangled/GUSIBasics.cp b/GUSI/src/tangled/GUSIBasics.cp index 95349a3..7eb6380 100755 --- a/GUSI/src/tangled/GUSIBasics.cp +++ b/GUSI/src/tangled/GUSIBasics.cp @@ -347,6 +347,7 @@ void GUSIHandleNextEvent(long sleepTime) if (WaitNextEvent(gGUSIEventMask|1, &event, sleepTime, nil)) switch (event.what) { +#if !TARGET_API_MAC_CARBON case mouseDown: if (!gGUSIEventHook[mouseDown]) { WindowPtr win; @@ -355,6 +356,7 @@ void GUSIHandleNextEvent(long sleepTime) return; } break; +#endif case kHighLevelEvent: AEProcessAppleEvent(&event); // Ignore errors diff --git a/GUSI/src/tangled/GUSIConfig.cp b/GUSI/src/tangled/GUSIConfig.cp index 6b0c408..fbfd240 100755 --- a/GUSI/src/tangled/GUSIConfig.cp +++ b/GUSI/src/tangled/GUSIConfig.cp @@ -200,6 +200,7 @@ void GUSIConfiguration::DoAutoSpin() const // = void GUSIConfiguration::DoAutoInitGraf() { +#if !TARGET_API_MAC_CARBON Ptr curA5 = LMGetCurrentA5(); if (!(reinterpret_cast(curA5) & 1) @@ -208,6 +209,7 @@ void GUSIConfiguration::DoAutoInitGraf() ) if (*reinterpret_cast(curA5) != &qd.thePort) InitGraf(&qd.thePort); +#endif fAutoInitGraf = false; } // [[BrokenPipe]] raises a [[SIGPIPE]] signal if desired. @@ -222,6 +224,7 @@ void GUSIConfiguration::BrokenPipe() void GUSIConfiguration::CheckInterrupt() { if (fSigInt) { +#if !TARGET_API_MAC_CARBON EvQElPtr eventQ; for (eventQ = (EvQElPtr) LMGetEventQueue()->qHead; eventQ; ) @@ -231,6 +234,12 @@ void GUSIConfiguration::CheckInterrupt() break; } else eventQ = (EvQElPtr)eventQ->qLink; +#else + if ( CheckEventQueueForUserCancel() ) { + raise(SIGINT); + FlushEvents(-1, 0); + } +#endif } } // Checking for the Command-Period key combination is rather complex. Our technique is copied