Kaydet (Commit) bb6d83a8 authored tarafından Jack Jansen's avatar Jack Jansen

Removed (within an #ifdef) Carbon-incompatabilities:

- Use TickCount() in stead of LMGetTicks()
- Don't use xxxGetFile event filter
- Don't call SystemTask or HandleSysWindowEvent (is this also automatically handled under os9??)
- Don't scan event queue for cmd-. (to be fixed at some point).
üst 14cd7500
...@@ -32,6 +32,11 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ...@@ -32,6 +32,11 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <Events.h> #include <Events.h>
#ifdef TARGET_API_MAC_CARBON
/* Unfortunately this call is probably slower... */
#define LMGetTicks() TickCount()
#endif
#ifdef __CFM68K__ #ifdef __CFM68K__
#undef GetEventQueue #undef GetEventQueue
#endif /* __CFM68K__ */ #endif /* __CFM68K__ */
...@@ -147,8 +152,15 @@ struct hook_args { ...@@ -147,8 +152,15 @@ struct hook_args {
int selectcur_hit; /* Set to true when "select current" selected */ int selectcur_hit; /* Set to true when "select current" selected */
char *prompt; /* The prompt */ char *prompt; /* The prompt */
}; };
#ifdef TARGET_API_MAC_CARBON
/* The StandardFile hooks don't exist in Carbon. This breaks GetDirectory,
** but the macfsn code will replace it by a NavServices version anyway.
*/
#define myhook_upp NULL
#else
static DlgHookYDUPP myhook_upp; static DlgHookYDUPP myhook_upp;
static int upp_inited = 0; static int upp_inited = 0;
#endif
/* /*
** The python-code event handler ** The python-code event handler
...@@ -400,6 +412,10 @@ static void ...@@ -400,6 +412,10 @@ static void
scan_event_queue(flush) scan_event_queue(flush)
int flush; int flush;
{ {
#ifdef TARGET_API_MAC_CARBON
/* CARBONXXXX To be implemented */
return;
#else
register EvQElPtr q; register EvQElPtr q;
q = (EvQElPtr) LMGetEventQueue()->qHead; q = (EvQElPtr) LMGetEventQueue()->qHead;
...@@ -414,6 +430,7 @@ scan_event_queue(flush) ...@@ -414,6 +430,7 @@ scan_event_queue(flush)
break; break;
} }
} }
#endif
} }
int int
...@@ -486,6 +503,7 @@ void ...@@ -486,6 +503,7 @@ void
PyMac_HandleEventIntern(evp) PyMac_HandleEventIntern(evp)
EventRecord *evp; EventRecord *evp;
{ {
#ifndef TARGET_API_MAC_CARBON
if ( evp->what == mouseDown ) { if ( evp->what == mouseDown ) {
WindowPtr wp; WindowPtr wp;
...@@ -494,6 +512,7 @@ PyMac_HandleEventIntern(evp) ...@@ -494,6 +512,7 @@ PyMac_HandleEventIntern(evp)
return; return;
} }
} }
#endif
#ifdef __MWERKS__ #ifdef __MWERKS__
{ {
int siouxdidit; int siouxdidit;
...@@ -561,9 +580,11 @@ PyMac_DoYield(int maxsleep, int maycallpython) ...@@ -561,9 +580,11 @@ PyMac_DoYield(int maxsleep, int maycallpython)
*/ */
if( in_here > 1 || !schedparams.process_events || if( in_here > 1 || !schedparams.process_events ||
(python_event_handler && !maycallpython) ) { (python_event_handler && !maycallpython) ) {
#ifndef TARGET_API_MAC_CARBON
if ( maxsleep >= 0 ) { if ( maxsleep >= 0 ) {
SystemTask(); SystemTask();
} }
#endif
} else { } else {
latest_time_ready = LMGetTicks() + maxsleep; latest_time_ready = LMGetTicks() + maxsleep;
do { do {
...@@ -743,10 +764,12 @@ PyMac_GetDirectory(dirfss, prompt) ...@@ -743,10 +764,12 @@ PyMac_GetDirectory(dirfss, prompt)
StandardFileReply reply; StandardFileReply reply;
struct hook_args hook_args; struct hook_args hook_args;
#ifndef TARGET_API_MAC_CARBON
if ( !upp_inited ) { if ( !upp_inited ) {
myhook_upp = NewDlgHookYDProc(myhook_proc); myhook_upp = NewDlgHookYDProc(myhook_proc);
upp_inited = 1; upp_inited = 1;
} }
#endif
if ( prompt && *prompt ) if ( prompt && *prompt )
hook_args.prompt = (char *)Pstring(prompt); hook_args.prompt = (char *)Pstring(prompt);
else else
...@@ -769,10 +792,12 @@ void PyMac_PromptGetFile(short numTypes, ConstSFTypeListPtr typeList, ...@@ -769,10 +792,12 @@ void PyMac_PromptGetFile(short numTypes, ConstSFTypeListPtr typeList,
static Point where = {-1, -1}; static Point where = {-1, -1};
struct hook_args hook_args; struct hook_args hook_args;
#ifndef TARGET_API_MAC_CARBON
if ( !upp_inited ) { if ( !upp_inited ) {
myhook_upp = NewDlgHookYDProc(myhook_proc); myhook_upp = NewDlgHookYDProc(myhook_proc);
upp_inited = 1; upp_inited = 1;
} }
#endif
if ( prompt && *prompt ) if ( prompt && *prompt )
hook_args.prompt = (char *)Pstring(prompt); hook_args.prompt = (char *)Pstring(prompt);
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment