diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-08-26 07:39:41 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-08-26 07:39:41 (GMT) |
commit | 219216c26fe5f38d29a865b7df2a5f816d20fffa (patch) | |
tree | 335e3e75ab1ecb713d53f7086c056f8b66b5f51a | |
parent | 4cb9d608b9e906a7ff8a3a67df94551dd0ce79ff (diff) | |
download | tk-219216c26fe5f38d29a865b7df2a5f816d20fffa.zip tk-219216c26fe5f38d29a865b7df2a5f816d20fffa.tar.gz tk-219216c26fe5f38d29a865b7df2a5f816d20fffa.tar.bz2 |
Put back a dummy Tk_MacOSXTkOwnsCursor(), just because it's in the public stub table. Can be removed fully in Tk 8.7.
More simplifications
-rw-r--r-- | generic/tk.decls | 26 | ||||
-rw-r--r-- | generic/tkPlatDecls.h | 42 | ||||
-rw-r--r-- | generic/tkStubInit.c | 13 | ||||
-rw-r--r-- | macosx/tkMacOSXCursor.c | 22 | ||||
-rw-r--r-- | macosx/tkMacOSXMenu.c | 8 | ||||
-rw-r--r-- | macosx/tkMacOSXScale.c | 28 |
6 files changed, 44 insertions, 95 deletions
diff --git a/generic/tk.decls b/generic/tk.decls index 4261dec..d4a07eb 100644 --- a/generic/tk.decls +++ b/generic/tk.decls @@ -1111,10 +1111,9 @@ declare 0 aqua { declare 1 aqua { void Tk_MacOSXTurnOffMenus(void) } -# Does not exist anymore. -#declare 2 aqua { -# void Tk_MacOSXTkOwnsCursor(int tkOwnsIt) -#} +declare 2 aqua { + void Tk_MacOSXTkOwnsCursor(int tkOwnsIt) +} declare 3 aqua { void TkMacOSXInitMenus(Tcl_Interp *interp) } @@ -1141,27 +1140,12 @@ declare 10 aqua { int Tk_MacOSXIsAppInFront(void) } declare 11 aqua { - void Tk_MacOSXSetEmbedHandler_( - Tk_MacOSXEmbedRegisterWinProc *registerWinProcPtr, - Tk_MacOSXEmbedGetGrafPortProc *getPortProcPtr, - Tk_MacOSXEmbedMakeContainerExistProc *containerExistProcPtr, - Tk_MacOSXEmbedGetClipProc *getClipProc, - Tk_MacOSXEmbedGetOffsetInParentProc *getOffsetProc) -} -declare 12 aqua { - void Tk_MacOSXTurnOffMenus_(void) -} -# Does not exist anymore -#declare 13 aqua { -# void Tk_MacOSXTkOwnsCursor_(int tkOwnsIt) -#} -declare 14 aqua { void TkMacOSXInitMenus_(Tcl_Interp *interp) } -declare 15 aqua { +declare 12 aqua { void TkMacOSXInitAppleEvents_(Tcl_Interp *interp) } -declare 16 aqua { +declare 13 aqua { void TkGenWMConfigureEvent_(Tk_Window tkwin, int x, int y, int width, int height, int flags) } diff --git a/generic/tkPlatDecls.h b/generic/tkPlatDecls.h index 70b3239..ce3e43a 100644 --- a/generic/tkPlatDecls.h +++ b/generic/tkPlatDecls.h @@ -63,7 +63,8 @@ EXTERN void Tk_MacOSXSetEmbedHandler( Tk_MacOSXEmbedGetOffsetInParentProc *getOffsetProc); /* 1 */ EXTERN void Tk_MacOSXTurnOffMenus(void); -/* Slot 2 is reserved */ +/* 2 */ +EXTERN void Tk_MacOSXTkOwnsCursor(int tkOwnsIt); /* 3 */ EXTERN void TkMacOSXInitMenus(Tcl_Interp *interp); /* 4 */ @@ -82,20 +83,10 @@ EXTERN void Tk_MacOSXSetupTkNotifier(void); /* 10 */ EXTERN int Tk_MacOSXIsAppInFront(void); /* 11 */ -EXTERN void Tk_MacOSXSetEmbedHandler_( - Tk_MacOSXEmbedRegisterWinProc *registerWinProcPtr, - Tk_MacOSXEmbedGetGrafPortProc *getPortProcPtr, - Tk_MacOSXEmbedMakeContainerExistProc *containerExistProcPtr, - Tk_MacOSXEmbedGetClipProc *getClipProc, - Tk_MacOSXEmbedGetOffsetInParentProc *getOffsetProc); -/* 12 */ -EXTERN void Tk_MacOSXTurnOffMenus_(void); -/* Slot 13 is reserved */ -/* 14 */ EXTERN void TkMacOSXInitMenus_(Tcl_Interp *interp); -/* 15 */ +/* 12 */ EXTERN void TkMacOSXInitAppleEvents_(Tcl_Interp *interp); -/* 16 */ +/* 13 */ EXTERN void TkGenWMConfigureEvent_(Tk_Window tkwin, int x, int y, int width, int height, int flags); #endif /* AQUA */ @@ -115,7 +106,7 @@ typedef struct TkPlatStubs { #ifdef MAC_OSX_TK /* AQUA */ void (*tk_MacOSXSetEmbedHandler) (Tk_MacOSXEmbedRegisterWinProc *registerWinProcPtr, Tk_MacOSXEmbedGetGrafPortProc *getPortProcPtr, Tk_MacOSXEmbedMakeContainerExistProc *containerExistProcPtr, Tk_MacOSXEmbedGetClipProc *getClipProc, Tk_MacOSXEmbedGetOffsetInParentProc *getOffsetProc); /* 0 */ void (*tk_MacOSXTurnOffMenus) (void); /* 1 */ - void (*reserved2)(void); + void (*tk_MacOSXTkOwnsCursor) (int tkOwnsIt); /* 2 */ void (*tkMacOSXInitMenus) (Tcl_Interp *interp); /* 3 */ void (*tkMacOSXInitAppleEvents) (Tcl_Interp *interp); /* 4 */ void (*tkGenWMConfigureEvent) (Tk_Window tkwin, int x, int y, int width, int height, int flags); /* 5 */ @@ -124,12 +115,9 @@ typedef struct TkPlatStubs { void * (*tkMacOSXGetRootControl) (Drawable drawable); /* 8 */ void (*tk_MacOSXSetupTkNotifier) (void); /* 9 */ int (*tk_MacOSXIsAppInFront) (void); /* 10 */ - void (*tk_MacOSXSetEmbedHandler_) (Tk_MacOSXEmbedRegisterWinProc *registerWinProcPtr, Tk_MacOSXEmbedGetGrafPortProc *getPortProcPtr, Tk_MacOSXEmbedMakeContainerExistProc *containerExistProcPtr, Tk_MacOSXEmbedGetClipProc *getClipProc, Tk_MacOSXEmbedGetOffsetInParentProc *getOffsetProc); /* 11 */ - void (*tk_MacOSXTurnOffMenus_) (void); /* 12 */ - void (*reserved13)(void); - void (*tkMacOSXInitMenus_) (Tcl_Interp *interp); /* 14 */ - void (*tkMacOSXInitAppleEvents_) (Tcl_Interp *interp); /* 15 */ - void (*tkGenWMConfigureEvent_) (Tk_Window tkwin, int x, int y, int width, int height, int flags); /* 16 */ + void (*tkMacOSXInitMenus_) (Tcl_Interp *interp); /* 11 */ + void (*tkMacOSXInitAppleEvents_) (Tcl_Interp *interp); /* 12 */ + void (*tkGenWMConfigureEvent_) (Tk_Window tkwin, int x, int y, int width, int height, int flags); /* 13 */ #endif /* AQUA */ } TkPlatStubs; @@ -164,7 +152,8 @@ extern const TkPlatStubs *tkPlatStubsPtr; (tkPlatStubsPtr->tk_MacOSXSetEmbedHandler) /* 0 */ #define Tk_MacOSXTurnOffMenus \ (tkPlatStubsPtr->tk_MacOSXTurnOffMenus) /* 1 */ -/* Slot 2 is reserved */ +#define Tk_MacOSXTkOwnsCursor \ + (tkPlatStubsPtr->tk_MacOSXTkOwnsCursor) /* 2 */ #define TkMacOSXInitMenus \ (tkPlatStubsPtr->tkMacOSXInitMenus) /* 3 */ #define TkMacOSXInitAppleEvents \ @@ -181,17 +170,12 @@ extern const TkPlatStubs *tkPlatStubsPtr; (tkPlatStubsPtr->tk_MacOSXSetupTkNotifier) /* 9 */ #define Tk_MacOSXIsAppInFront \ (tkPlatStubsPtr->tk_MacOSXIsAppInFront) /* 10 */ -#define Tk_MacOSXSetEmbedHandler_ \ - (tkPlatStubsPtr->tk_MacOSXSetEmbedHandler_) /* 11 */ -#define Tk_MacOSXTurnOffMenus_ \ - (tkPlatStubsPtr->tk_MacOSXTurnOffMenus_) /* 12 */ -/* Slot 13 is reserved */ #define TkMacOSXInitMenus_ \ - (tkPlatStubsPtr->tkMacOSXInitMenus_) /* 14 */ + (tkPlatStubsPtr->tkMacOSXInitMenus_) /* 11 */ #define TkMacOSXInitAppleEvents_ \ - (tkPlatStubsPtr->tkMacOSXInitAppleEvents_) /* 15 */ + (tkPlatStubsPtr->tkMacOSXInitAppleEvents_) /* 12 */ #define TkGenWMConfigureEvent_ \ - (tkPlatStubsPtr->tkGenWMConfigureEvent_) /* 16 */ + (tkPlatStubsPtr->tkGenWMConfigureEvent_) /* 13 */ #endif /* AQUA */ #endif /* defined(USE_TK_STUBS) */ diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c index 443d91a..17a0746 100644 --- a/generic/tkStubInit.c +++ b/generic/tkStubInit.c @@ -56,8 +56,6 @@ MODULE_SCOPE const TkStubs tkStubs; #define TkSendCleanup_ TkSendCleanup #define TkpTestsendCmd_ TkpTestsendCmd #define Tk_MacOSXSetEmbedHandler_ Tk_MacOSXSetEmbedHandler -#define Tk_MacOSXTurnOffMenus_ Tk_MacOSXTurnOffMenus -#define Tk_MacOSXTkOwnsCursor_ Tk_MacOSXTkOwnsCursor #define TkMacOSXInitMenus_ TkMacOSXInitMenus #define TkMacOSXInitAppleEvents_ TkMacOSXInitAppleEvents #define TkGenWMConfigureEvent_ TkGenWMConfigureEvent @@ -1009,7 +1007,7 @@ static const TkPlatStubs tkPlatStubs = { #ifdef MAC_OSX_TK /* AQUA */ Tk_MacOSXSetEmbedHandler, /* 0 */ Tk_MacOSXTurnOffMenus, /* 1 */ - 0, /* 2 */ + Tk_MacOSXTkOwnsCursor, /* 2 */ TkMacOSXInitMenus, /* 3 */ TkMacOSXInitAppleEvents, /* 4 */ TkGenWMConfigureEvent, /* 5 */ @@ -1018,12 +1016,9 @@ static const TkPlatStubs tkPlatStubs = { TkMacOSXGetRootControl, /* 8 */ Tk_MacOSXSetupTkNotifier, /* 9 */ Tk_MacOSXIsAppInFront, /* 10 */ - Tk_MacOSXSetEmbedHandler_, /* 11 */ - Tk_MacOSXTurnOffMenus_, /* 12 */ - 0, /* 13 */ - TkMacOSXInitMenus_, /* 14 */ - TkMacOSXInitAppleEvents_, /* 15 */ - TkGenWMConfigureEvent_, /* 16 */ + TkMacOSXInitMenus_, /* 11 */ + TkMacOSXInitAppleEvents_, /* 12 */ + TkGenWMConfigureEvent_, /* 13 */ #endif /* AQUA */ }; diff --git a/macosx/tkMacOSXCursor.c b/macosx/tkMacOSXCursor.c index 49caf37..140dffe 100644 --- a/macosx/tkMacOSXCursor.c +++ b/macosx/tkMacOSXCursor.c @@ -557,6 +557,28 @@ TkpSetCursor( } /* + *---------------------------------------------------------------------- + * + * Tk_MacOSXTkOwnsCursor -- + * + * Sets whether Tk has the right to adjust the cursor. + * + * Results: + * None. + * + * Side effects: + * May keep Tk from changing the cursor. + * + *---------------------------------------------------------------------- + */ + +void +Tk_MacOSXTkOwnsCursor( + int tkOwnsIt) +{ +} + +/* * Local Variables: * mode: objc * c-basic-offset: 4 diff --git a/macosx/tkMacOSXMenu.c b/macosx/tkMacOSXMenu.c index 321b4f8..3b7099d 100644 --- a/macosx/tkMacOSXMenu.c +++ b/macosx/tkMacOSXMenu.c @@ -91,9 +91,6 @@ static const struct { #undef ACCEL #undef sl -static int gNoTkMenus = 0; /* This is used by Tk_MacOSXTurnOffMenus as - * the flag that Tk is not to draw any - * menus. */ static int inPostMenu = 0; static unsigned long defaultBg = 0, defaultFg = 0; static SInt32 menuMarkColumnWidth = 0, menuIconTrailingEdgeMargin = 0; @@ -483,10 +480,6 @@ TKBackgroundLoop *backgroundLoop = nil; - (void) tkSetMainMenu: (TKMenu *) menu { - if (gNoTkMenus) { - return; - } - TKMenu *applicationMenu = nil; if (menu) { @@ -1663,7 +1656,6 @@ TkMacOSXClearMenubarActive(void) void Tk_MacOSXTurnOffMenus(void) { - gNoTkMenus = 1; } /* diff --git a/macosx/tkMacOSXScale.c b/macosx/tkMacOSXScale.c index 80b1bda..28b192d 100644 --- a/macosx/tkMacOSXScale.c +++ b/macosx/tkMacOSXScale.c @@ -149,8 +149,6 @@ TkpDisplayScale( MacScale *macScalePtr = clientData; Rect r; WindowRef windowRef; - CGrafPtr destPort, savePort; - Boolean portChanged; MacDrawable *macDraw; SInt32 initialValue, minValue, maxValue; UInt16 numTicks; @@ -216,9 +214,7 @@ TkpDisplayScale( */ macDraw = (MacDrawable *) Tk_WindowId(tkwin); - destPort = TkMacOSXGetDrawablePort(Tk_WindowId(tkwin)); windowRef = TkMacOSXDrawableWindow(Tk_WindowId(tkwin)); - portChanged = QDSwapPort(destPort, &savePort); /* * Create Macintosh control. @@ -292,9 +288,6 @@ TkpDisplayScale( HiliteControl(macScalePtr->scaleHandle, 0); Draw1Control(macScalePtr->scaleHandle); - if (portChanged) { - QDSwapPort(savePort, NULL); - } done: scalePtr->flags &= ~REDRAW_ALL; } @@ -326,14 +319,10 @@ TkpScaleElement( ControlPartCode part; Point where; Rect bounds; - CGrafPtr destPort, savePort; - Boolean portChanged; #ifdef TK_MAC_DEBUG_SCALE TkMacOSXDbgMsg("TkpScaleElement"); #endif - destPort = TkMacOSXGetDrawablePort(Tk_WindowId(scalePtr->tkwin)); - portChanged = QDSwapPort(destPort, &savePort); /* * All of the calculations in this procedure mirror those in @@ -345,10 +334,6 @@ TkpScaleElement( where.v = y + bounds.top; part = TestControl(macScalePtr->scaleHandle, where); - if (portChanged) { - QDSwapPort(savePort, NULL); - } - #ifdef TK_MAC_DEBUG_SCALE fprintf (stderr,"ScalePart %d, pos ( %d %d )\n", part, where.h, where.v ); #endif @@ -400,8 +385,6 @@ MacScaleEventProc( Point where; Rect bounds; int part; - CGrafPtr destPort, savePort; - Boolean portChanged; #ifdef TK_MAC_DEBUG_SCALE fprintf(stderr,"MacScaleEventProc\n" ); @@ -413,13 +396,6 @@ MacScaleEventProc( * control was hit and act accordingly. */ - destPort = TkMacOSXGetDrawablePort(Tk_WindowId(macScalePtr->info.tkwin)); - portChanged = QDSwapPort(destPort, &savePort); - - TkMacOSXWinBounds((TkWindow *) macScalePtr->info.tkwin, &bounds); - where.h = eventPtr->xbutton.x + bounds.left; - where.v = eventPtr->xbutton.y + bounds.top; -#ifdef TK_MAC_DEBUG_SCALE TkMacOSXDbgMsg("calling TestControl"); #endif part = TestControl(macScalePtr->scaleHandle, where); @@ -445,10 +421,6 @@ MacScaleEventProc( */ TkGenerateButtonEventForXPointer(Tk_WindowId(macScalePtr->info.tkwin)); - - if (portChanged) { - QDSwapPort(savePort, NULL); - } } /* |