From 4cb9d608b9e906a7ff8a3a67df94551dd0ce79ff Mon Sep 17 00:00:00 2001 From: culler Date: Tue, 25 Aug 2020 16:16:43 +0000 Subject: Fix [08eb057dea]: remove two unused stub functions related to cursors and dating back to Carbon. --- generic/tk.decls | 14 ++++++++------ generic/tkInt.decls | 7 ++++--- generic/tkIntPlatDecls.h | 8 +++----- generic/tkPlatDecls.h | 16 ++++++---------- generic/tkStubInit.c | 6 +++--- macosx/tkMacOSXCursor.c | 46 ++++------------------------------------------ 6 files changed, 28 insertions(+), 69 deletions(-) diff --git a/generic/tk.decls b/generic/tk.decls index ee1d97b..4261dec 100644 --- a/generic/tk.decls +++ b/generic/tk.decls @@ -1111,9 +1111,10 @@ declare 0 aqua { declare 1 aqua { void Tk_MacOSXTurnOffMenus(void) } -declare 2 aqua { - void Tk_MacOSXTkOwnsCursor(int tkOwnsIt) -} +# Does not exist anymore. +#declare 2 aqua { +# void Tk_MacOSXTkOwnsCursor(int tkOwnsIt) +#} declare 3 aqua { void TkMacOSXInitMenus(Tcl_Interp *interp) } @@ -1150,9 +1151,10 @@ declare 11 aqua { declare 12 aqua { void Tk_MacOSXTurnOffMenus_(void) } -declare 13 aqua { - void Tk_MacOSXTkOwnsCursor_(int tkOwnsIt) -} +# Does not exist anymore +#declare 13 aqua { +# void Tk_MacOSXTkOwnsCursor_(int tkOwnsIt) +#} declare 14 aqua { void TkMacOSXInitMenus_(Tcl_Interp *interp) } diff --git a/generic/tkInt.decls b/generic/tkInt.decls index a160541..82e4f2e 100644 --- a/generic/tkInt.decls +++ b/generic/tkInt.decls @@ -912,9 +912,10 @@ declare 9 aqua { declare 10 aqua { int TkMacOSXDispatchMenuEvent(int menuID, int index) } -declare 11 aqua { - void TkMacOSXInstallCursor(int resizeOverride) -} +# Now a static function +# declare 11 aqua { +# void TkMacOSXInstallCursor(int resizeOverride) +# } declare 12 aqua { void TkMacOSXHandleTearoffMenu(void) } diff --git a/generic/tkIntPlatDecls.h b/generic/tkIntPlatDecls.h index 8221d7a..f80a0c0 100644 --- a/generic/tkIntPlatDecls.h +++ b/generic/tkIntPlatDecls.h @@ -170,8 +170,7 @@ EXTERN unsigned int TkMacOSXButtonKeyState(void); EXTERN void TkMacOSXClearMenubarActive(void); /* 10 */ EXTERN int TkMacOSXDispatchMenuEvent(int menuID, int index); -/* 11 */ -EXTERN void TkMacOSXInstallCursor(int resizeOverride); +/* Slot 11 is reserved */ /* 12 */ EXTERN void TkMacOSXHandleTearoffMenu(void); /* Slot 13 is reserved */ @@ -405,7 +404,7 @@ typedef struct TkIntPlatStubs { unsigned int (*tkMacOSXButtonKeyState) (void); /* 8 */ void (*tkMacOSXClearMenubarActive) (void); /* 9 */ int (*tkMacOSXDispatchMenuEvent) (int menuID, int index); /* 10 */ - void (*tkMacOSXInstallCursor) (int resizeOverride); /* 11 */ + void (*reserved11)(void); void (*tkMacOSXHandleTearoffMenu) (void); /* 12 */ void (*reserved13)(void); int (*tkMacOSXDoHLEvent) (void *theEvent); /* 14 */ @@ -631,8 +630,7 @@ extern const TkIntPlatStubs *tkIntPlatStubsPtr; (tkIntPlatStubsPtr->tkMacOSXClearMenubarActive) /* 9 */ #define TkMacOSXDispatchMenuEvent \ (tkIntPlatStubsPtr->tkMacOSXDispatchMenuEvent) /* 10 */ -#define TkMacOSXInstallCursor \ - (tkIntPlatStubsPtr->tkMacOSXInstallCursor) /* 11 */ +/* Slot 11 is reserved */ #define TkMacOSXHandleTearoffMenu \ (tkIntPlatStubsPtr->tkMacOSXHandleTearoffMenu) /* 12 */ /* Slot 13 is reserved */ diff --git a/generic/tkPlatDecls.h b/generic/tkPlatDecls.h index db9141c..70b3239 100644 --- a/generic/tkPlatDecls.h +++ b/generic/tkPlatDecls.h @@ -63,8 +63,7 @@ EXTERN void Tk_MacOSXSetEmbedHandler( Tk_MacOSXEmbedGetOffsetInParentProc *getOffsetProc); /* 1 */ EXTERN void Tk_MacOSXTurnOffMenus(void); -/* 2 */ -EXTERN void Tk_MacOSXTkOwnsCursor(int tkOwnsIt); +/* Slot 2 is reserved */ /* 3 */ EXTERN void TkMacOSXInitMenus(Tcl_Interp *interp); /* 4 */ @@ -91,8 +90,7 @@ EXTERN void Tk_MacOSXSetEmbedHandler_( Tk_MacOSXEmbedGetOffsetInParentProc *getOffsetProc); /* 12 */ EXTERN void Tk_MacOSXTurnOffMenus_(void); -/* 13 */ -EXTERN void Tk_MacOSXTkOwnsCursor_(int tkOwnsIt); +/* Slot 13 is reserved */ /* 14 */ EXTERN void TkMacOSXInitMenus_(Tcl_Interp *interp); /* 15 */ @@ -117,7 +115,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 (*tk_MacOSXTkOwnsCursor) (int tkOwnsIt); /* 2 */ + void (*reserved2)(void); 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 */ @@ -128,7 +126,7 @@ typedef struct TkPlatStubs { 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 (*tk_MacOSXTkOwnsCursor_) (int tkOwnsIt); /* 13 */ + 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 */ @@ -166,8 +164,7 @@ extern const TkPlatStubs *tkPlatStubsPtr; (tkPlatStubsPtr->tk_MacOSXSetEmbedHandler) /* 0 */ #define Tk_MacOSXTurnOffMenus \ (tkPlatStubsPtr->tk_MacOSXTurnOffMenus) /* 1 */ -#define Tk_MacOSXTkOwnsCursor \ - (tkPlatStubsPtr->tk_MacOSXTkOwnsCursor) /* 2 */ +/* Slot 2 is reserved */ #define TkMacOSXInitMenus \ (tkPlatStubsPtr->tkMacOSXInitMenus) /* 3 */ #define TkMacOSXInitAppleEvents \ @@ -188,8 +185,7 @@ extern const TkPlatStubs *tkPlatStubsPtr; (tkPlatStubsPtr->tk_MacOSXSetEmbedHandler_) /* 11 */ #define Tk_MacOSXTurnOffMenus_ \ (tkPlatStubsPtr->tk_MacOSXTurnOffMenus_) /* 12 */ -#define Tk_MacOSXTkOwnsCursor_ \ - (tkPlatStubsPtr->tk_MacOSXTkOwnsCursor_) /* 13 */ +/* Slot 13 is reserved */ #define TkMacOSXInitMenus_ \ (tkPlatStubsPtr->tkMacOSXInitMenus_) /* 14 */ #define TkMacOSXInitAppleEvents_ \ diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c index 0020fac..443d91a 100644 --- a/generic/tkStubInit.c +++ b/generic/tkStubInit.c @@ -572,7 +572,7 @@ static const TkIntPlatStubs tkIntPlatStubs = { TkMacOSXButtonKeyState, /* 8 */ TkMacOSXClearMenubarActive, /* 9 */ TkMacOSXDispatchMenuEvent, /* 10 */ - TkMacOSXInstallCursor, /* 11 */ + 0, /* 11 */ TkMacOSXHandleTearoffMenu, /* 12 */ 0, /* 13 */ TkMacOSXDoHLEvent, /* 14 */ @@ -1009,7 +1009,7 @@ static const TkPlatStubs tkPlatStubs = { #ifdef MAC_OSX_TK /* AQUA */ Tk_MacOSXSetEmbedHandler, /* 0 */ Tk_MacOSXTurnOffMenus, /* 1 */ - Tk_MacOSXTkOwnsCursor, /* 2 */ + 0, /* 2 */ TkMacOSXInitMenus, /* 3 */ TkMacOSXInitAppleEvents, /* 4 */ TkGenWMConfigureEvent, /* 5 */ @@ -1020,7 +1020,7 @@ static const TkPlatStubs tkPlatStubs = { Tk_MacOSXIsAppInFront, /* 10 */ Tk_MacOSXSetEmbedHandler_, /* 11 */ Tk_MacOSXTurnOffMenus_, /* 12 */ - Tk_MacOSXTkOwnsCursor_, /* 13 */ + 0, /* 13 */ TkMacOSXInitMenus_, /* 14 */ TkMacOSXInitAppleEvents_, /* 15 */ TkGenWMConfigureEvent_, /* 16 */ diff --git a/macosx/tkMacOSXCursor.c b/macosx/tkMacOSXCursor.c index 894a44d..49caf37 100644 --- a/macosx/tkMacOSXCursor.c +++ b/macosx/tkMacOSXCursor.c @@ -187,15 +187,6 @@ static const struct CursorName cursorNames[] = { static TkMacOSXCursor *gCurrentCursor = NULL; /* A pointer to the current cursor. */ -static int gResizeOverride = false; - /* A boolean indicating whether we should use - * the resize cursor during installations. */ -static int gTkOwnsCursor = true;/* A boolean indicating whether Tk owns the - * cursor. If not (for instance, in the case - * where a Tk window is embedded in another - * app's window, and the cursor is out of the - * Tk window, we will not attempt to adjust - * the cursor. */ /* * Declarations of procedures local to this file @@ -487,17 +478,15 @@ TkpFreeCursor( *---------------------------------------------------------------------- */ -void +static void TkMacOSXInstallCursor( - int resizeOverride) + void) { TkMacOSXCursor *macCursorPtr = gCurrentCursor; static int cursorHidden = 0; int cursorNone = 0; - gResizeOverride = resizeOverride; - - if (resizeOverride || !macCursorPtr) { + if (!macCursorPtr) { [[NSCursor arrowCursor] set]; } else { switch (macCursorPtr->type) { @@ -545,10 +534,6 @@ TkpSetCursor( { int cursorChanged = 1; - if (!gTkOwnsCursor) { - return; - } - if (cursor == None) { /* * This is a little tricky. We can't really tell whether @@ -567,34 +552,11 @@ TkpSetCursor( } if (Tk_MacOSXIsAppInFront() && cursorChanged) { - TkMacOSXInstallCursor(gResizeOverride); + TkMacOSXInstallCursor(); } } /* - *---------------------------------------------------------------------- - * - * 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) -{ - gTkOwnsCursor = tkOwnsIt; -} - -/* * Local Variables: * mode: objc * c-basic-offset: 4 -- cgit v0.12 From 219216c26fe5f38d29a865b7df2a5f816d20fffa Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 26 Aug 2020 07:39:41 +0000 Subject: 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 --- generic/tk.decls | 26 +++++--------------------- generic/tkPlatDecls.h | 42 +++++++++++++----------------------------- generic/tkStubInit.c | 13 ++++--------- macosx/tkMacOSXCursor.c | 22 ++++++++++++++++++++++ macosx/tkMacOSXMenu.c | 8 -------- 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); - } } /* -- cgit v0.12