From c42644884af2bc9639c7a0273d8856d1a21d04bb Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 16 Nov 2023 15:53:21 +0000 Subject: Get rid of the "Dummy entry for stubs table backwards compatibility" --- generic/tkInt.decls | 72 +++++++++--------------- generic/tkIntDecls.h | 45 ++------------- generic/tkIntPlatDecls.h | 143 +++++++++++++++++++++++------------------------ generic/tkStubInit.c | 70 ++++++++--------------- macosx/tkMacOSXWm.c | 6 +- unix/tkUnixPort.h | 9 --- win/tkWinPort.h | 9 --- 7 files changed, 129 insertions(+), 225 deletions(-) diff --git a/generic/tkInt.decls b/generic/tkInt.decls index e056e3f..bf5e4ed 100644 --- a/generic/tkInt.decls +++ b/generic/tkInt.decls @@ -392,13 +392,13 @@ declare 119 { int XUnionRectWithRegion(XRectangle *rect, Region src, Region dr_return) } -declare 121 aqua { +declare 121 { Pixmap TkpCreateNativeBitmap(Display *display, const void *source) } -declare 122 aqua { +declare 122 { void TkpDefineNativeBitmaps(void) } -declare 124 aqua { +declare 124 { Pixmap TkpGetNativeAppBitmap(Display *display, const char *name, int *width, int *height) } @@ -624,20 +624,20 @@ interface tkIntPlat ################################ # Unix specific functions -declare 0 x11 { - void TkCreateXEventSource(void) -} declare 2 x11 { void TkGenerateActivateEvents(TkWindow *winPtr, int active) } -declare 8 x11 { +declare 6 x11 { int TkpScanWindowId(Tcl_Interp *interp, const char *string, Window *idPtr) } +declare 7 x11 { + int TkpWmSetState(TkWindow *winPtr, int state) +} declare 9 x11 { void TkWmCleanup(TkDisplay *dispPtr) } -declare 12 x11 { - int TkpWmSetState(TkWindow *winPtr, int state) +declare 37 x11 { + void TkCreateXEventSource(void) } # only needed by tktest: declare 38 x11 { @@ -673,6 +673,9 @@ declare 45 x11 { declare 0 win { char *TkAlignImageData(XImage *image, int alignment, int bitOrder) } +declare 1 win { + void TkWinCancelMouseTimer(void) +} declare 2 win { void TkGenerateActivateEvents(TkWindow *winPtr, int active) } @@ -689,20 +692,17 @@ declare 6 win { int TkpScanWindowId(Tcl_Interp *interp, const char *string, Window *idPtr) } declare 7 win { - void TkpSetCapture(TkWindow *winPtr) + int TkpWmSetState(TkWindow *winPtr, int state) } declare 8 win { void TkpSetCursor(TkpCursor cursor) } declare 9 win { - int TkpWmSetState(TkWindow *winPtr, int state) + void TkpSetCapture(TkWindow *winPtr) } declare 10 win { void TkSetPixmapColormap(Pixmap pixmap, Colormap colormap) } -declare 11 win { - void TkWinCancelMouseTimer(void) -} declare 12 win { void TkWinClipboardRender(TkDisplay *dispPtr, UINT format) } @@ -827,37 +827,39 @@ declare 47 win { ################################ # Aqua specific functions +declare 1 aqua { + void TkAboutDlg(void) +} declare 2 aqua { void TkGenerateActivateEvents(TkWindow *winPtr, int active) } declare 3 aqua { - void TkPointerDeadWindow(TkWindow *winPtr) + unsigned long TkpGetMS(void) } declare 4 aqua { - void TkpSetCapture(TkWindow *winPtr) + void TkPointerDeadWindow(TkWindow *winPtr) } declare 5 aqua { void TkpSetCursor(TkpCursor cursor) } declare 6 aqua { - void TkpWmSetState(TkWindow *winPtr, int state) + int TkpScanWindowId(Tcl_Interp *interp, const char *string, Window *idPtr) } declare 7 aqua { - void TkAboutDlg(void) + int TkpWmSetState(TkWindow *winPtr, int state) } declare 8 aqua { unsigned int TkMacOSXButtonKeyState(void) } declare 9 aqua { - void TkMacOSXClearMenubarActive(void) + void TkpSetCapture(TkWindow *winPtr) } declare 10 aqua { int TkMacOSXDispatchMenuEvent(int menuID, int index) } -# Now a static function -# declare 11 aqua { -# void TkMacOSXInstallCursor(int resizeOverride) -# } +declare 11 aqua { + void TkMacOSXClearMenubarActive(void) +} declare 12 aqua { void TkMacOSXHandleTearoffMenu(void) } @@ -874,16 +876,6 @@ declare 18 aqua { void TkMacOSXHandleMenuSelect(short theMenu, unsigned short theItem, int optionKeyPressed) } - -# removed duplicates from tkPlat table(tk.decls) -#declare 19 aqua { -# void TkMacOSXInitAppleEvents(Tcl_Interp *interp) -#} -# -#declare 20 aqua { -# void TkMacOSXInitMenus(Tcl_Interp *interp) -#} - declare 21 aqua { void TkMacOSXInvalidateWindow(MacDrawable *macWin, int flag) } @@ -896,10 +888,6 @@ declare 24 aqua { declare 25 aqua { void TkMacOSXMenuClick(void) } -# The corresponding Unregister was not a stub, and this should be static. -#declare 26 aqua { -# void TkMacOSXRegisterOffScreenWindow(Window window, void *portPtr) -#} declare 27 aqua { int TkMacOSXResizable(TkWindow *winPtr) } @@ -915,10 +903,6 @@ declare 31 aqua { declare 32 aqua { void TkMacOSXUpdateClipRgn(TkWindow *winPtr) } -# This was not implemented. Perhaps meant to be OffScreen ? -#declare 33 aqua { -# void TkMacOSXUnregisterMacWindow(void *portPtr) -#} declare 34 aqua { int TkMacOSXUseMenuID(short macID) } @@ -971,16 +955,10 @@ declare 51 aqua { declare 52 aqua { void TkMacOSXSetDrawingEnabled(TkWindow *winPtr, int flag) } -declare 53 aqua { - unsigned long TkpGetMS(void) -} # For Canvas3d, requested by Sean Woods declare 54 aqua { void *TkMacOSXDrawable(Drawable drawable) } -declare 55 aqua { - int TkpScanWindowId(Tcl_Interp *interp, const char *string, Window *idPtr) -} ############################################################################## diff --git a/generic/tkIntDecls.h b/generic/tkIntDecls.h index b6c2543..c1ec37f 100644 --- a/generic/tkIntDecls.h +++ b/generic/tkIntDecls.h @@ -340,21 +340,15 @@ EXTERN int XSetRegion(Display *display, GC gc, Region rgn); EXTERN int XUnionRectWithRegion(XRectangle *rect, Region src, Region dr_return); /* Slot 120 is reserved */ -#ifdef MAC_OSX_TK /* AQUA */ /* 121 */ EXTERN Pixmap TkpCreateNativeBitmap(Display *display, const void *source); -#endif /* AQUA */ -#ifdef MAC_OSX_TK /* AQUA */ /* 122 */ EXTERN void TkpDefineNativeBitmaps(void); -#endif /* AQUA */ /* Slot 123 is reserved */ -#ifdef MAC_OSX_TK /* AQUA */ /* 124 */ EXTERN Pixmap TkpGetNativeAppBitmap(Display *display, const char *name, int *width, int *height); -#endif /* AQUA */ /* Slot 125 is reserved */ /* Slot 126 is reserved */ /* Slot 127 is reserved */ @@ -675,37 +669,10 @@ typedef struct TkIntStubs { int (*xSetRegion) (Display *display, GC gc, Region rgn); /* 118 */ int (*xUnionRectWithRegion) (XRectangle *rect, Region src, Region dr_return); /* 119 */ void (*reserved120)(void); -#if !(defined(_WIN32) || defined(MAC_OSX_TK)) /* X11 */ - void (*reserved121)(void); -#endif /* X11 */ -#if defined(_WIN32) /* WIN */ - void (*reserved121)(void); -#endif /* WIN */ -#ifdef MAC_OSX_TK /* AQUA */ - void (*reserved121)(void); /* Dummy entry for stubs table backwards compatibility */ Pixmap (*tkpCreateNativeBitmap) (Display *display, const void *source); /* 121 */ -#endif /* AQUA */ -#if !(defined(_WIN32) || defined(MAC_OSX_TK)) /* X11 */ - void (*reserved122)(void); -#endif /* X11 */ -#if defined(_WIN32) /* WIN */ - void (*reserved122)(void); -#endif /* WIN */ -#ifdef MAC_OSX_TK /* AQUA */ - void (*reserved122)(void); /* Dummy entry for stubs table backwards compatibility */ void (*tkpDefineNativeBitmaps) (void); /* 122 */ -#endif /* AQUA */ void (*reserved123)(void); -#if !(defined(_WIN32) || defined(MAC_OSX_TK)) /* X11 */ - void (*reserved124)(void); -#endif /* X11 */ -#if defined(_WIN32) /* WIN */ - void (*reserved124)(void); -#endif /* WIN */ -#ifdef MAC_OSX_TK /* AQUA */ - void (*reserved124)(void); /* Dummy entry for stubs table backwards compatibility */ Pixmap (*tkpGetNativeAppBitmap) (Display *display, const char *name, int *width, int *height); /* 124 */ -#endif /* AQUA */ void (*reserved125)(void); void (*reserved126)(void); void (*reserved127)(void); @@ -1012,19 +979,13 @@ extern const TkIntStubs *tkIntStubsPtr; #define XUnionRectWithRegion \ (tkIntStubsPtr->xUnionRectWithRegion) /* 119 */ /* Slot 120 is reserved */ -#ifdef MAC_OSX_TK /* AQUA */ #define TkpCreateNativeBitmap \ (tkIntStubsPtr->tkpCreateNativeBitmap) /* 121 */ -#endif /* AQUA */ -#ifdef MAC_OSX_TK /* AQUA */ #define TkpDefineNativeBitmaps \ (tkIntStubsPtr->tkpDefineNativeBitmaps) /* 122 */ -#endif /* AQUA */ /* Slot 123 is reserved */ -#ifdef MAC_OSX_TK /* AQUA */ #define TkpGetNativeAppBitmap \ (tkIntStubsPtr->tkpGetNativeAppBitmap) /* 124 */ -#endif /* AQUA */ /* Slot 125 is reserved */ /* Slot 126 is reserved */ /* Slot 127 is reserved */ @@ -1150,8 +1111,14 @@ extern const TkIntStubs *tkIntStubsPtr; #if !defined(MAC_OSX_TK) && !defined(USE_TK_STUBS) # undef TkpWillDrawWidget # undef TkpRedrawWidget +# undef TkpDefineNativeBitmaps +# undef TkpCreateNativeBitmap +# undef TkpGetNativeAppBitmap # define TkpWillDrawWidget(w) 0 # define TkpRedrawWidget(w) +# define TkpDefineNativeBitmaps() +# define TkpCreateNativeBitmap(display, source) None +# define TkpGetNativeAppBitmap(display, name, w, h) None #endif #endif /* _TKINTDECLS */ diff --git a/generic/tkIntPlatDecls.h b/generic/tkIntPlatDecls.h index aedad62..7a0cc65 100644 --- a/generic/tkIntPlatDecls.h +++ b/generic/tkIntPlatDecls.h @@ -38,7 +38,8 @@ extern "C" { /* 0 */ EXTERN char * TkAlignImageData(XImage *image, int alignment, int bitOrder); -/* Slot 1 is reserved */ +/* 1 */ +EXTERN void TkWinCancelMouseTimer(void); /* 2 */ EXTERN void TkGenerateActivateEvents(TkWindow *winPtr, int active); @@ -52,15 +53,14 @@ EXTERN void TkpPrintWindowId(char *buf, Window window); EXTERN int TkpScanWindowId(Tcl_Interp *interp, const char *string, Window *idPtr); /* 7 */ -EXTERN void TkpSetCapture(TkWindow *winPtr); +EXTERN int TkpWmSetState(TkWindow *winPtr, int state); /* 8 */ EXTERN void TkpSetCursor(TkpCursor cursor); /* 9 */ -EXTERN int TkpWmSetState(TkWindow *winPtr, int state); +EXTERN void TkpSetCapture(TkWindow *winPtr); /* 10 */ EXTERN void TkSetPixmapColormap(Pixmap pixmap, Colormap colormap); -/* 11 */ -EXTERN void TkWinCancelMouseTimer(void); +/* Slot 11 is reserved */ /* 12 */ EXTERN void TkWinClipboardRender(TkDisplay *dispPtr, UINT format); /* 13 */ @@ -146,27 +146,30 @@ EXTERN Tk_Window TkpGetCapture(void); #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ /* Slot 0 is reserved */ -/* Slot 1 is reserved */ +/* 1 */ +EXTERN void TkAboutDlg(void); /* 2 */ EXTERN void TkGenerateActivateEvents(TkWindow *winPtr, int active); /* 3 */ -EXTERN void TkPointerDeadWindow(TkWindow *winPtr); +EXTERN unsigned long TkpGetMS(void); /* 4 */ -EXTERN void TkpSetCapture(TkWindow *winPtr); +EXTERN void TkPointerDeadWindow(TkWindow *winPtr); /* 5 */ EXTERN void TkpSetCursor(TkpCursor cursor); /* 6 */ -EXTERN void TkpWmSetState(TkWindow *winPtr, int state); +EXTERN int TkpScanWindowId(Tcl_Interp *interp, + const char *string, Window *idPtr); /* 7 */ -EXTERN void TkAboutDlg(void); +EXTERN int TkpWmSetState(TkWindow *winPtr, int state); /* 8 */ EXTERN unsigned int TkMacOSXButtonKeyState(void); /* 9 */ -EXTERN void TkMacOSXClearMenubarActive(void); +EXTERN void TkpSetCapture(TkWindow *winPtr); /* 10 */ EXTERN int TkMacOSXDispatchMenuEvent(int menuID, int index); -/* Slot 11 is reserved */ +/* 11 */ +EXTERN void TkMacOSXClearMenubarActive(void); /* 12 */ EXTERN void TkMacOSXHandleTearoffMenu(void); /* Slot 13 is reserved */ @@ -245,17 +248,12 @@ EXTERN int TkGenerateButtonEvent(int x, int y, Window window, EXTERN void TkGenWMDestroyEvent(Tk_Window tkwin); /* 52 */ EXTERN void TkMacOSXSetDrawingEnabled(TkWindow *winPtr, int flag); -/* 53 */ -EXTERN unsigned long TkpGetMS(void); +/* Slot 53 is reserved */ /* 54 */ EXTERN void * TkMacOSXDrawable(Drawable drawable); -/* 55 */ -EXTERN int TkpScanWindowId(Tcl_Interp *interp, - const char *string, Window *idPtr); #endif /* AQUA */ #if !(defined(_WIN32) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */ -/* 0 */ -EXTERN void TkCreateXEventSource(void); +/* Slot 0 is reserved */ /* Slot 1 is reserved */ /* 2 */ EXTERN void TkGenerateActivateEvents(TkWindow *winPtr, @@ -263,17 +261,17 @@ EXTERN void TkGenerateActivateEvents(TkWindow *winPtr, /* Slot 3 is reserved */ /* Slot 4 is reserved */ /* Slot 5 is reserved */ -/* Slot 6 is reserved */ -/* Slot 7 is reserved */ -/* 8 */ +/* 6 */ EXTERN int TkpScanWindowId(Tcl_Interp *interp, const char *string, Window *idPtr); +/* 7 */ +EXTERN int TkpWmSetState(TkWindow *winPtr, int state); +/* Slot 8 is reserved */ /* 9 */ EXTERN void TkWmCleanup(TkDisplay *dispPtr); /* Slot 10 is reserved */ /* Slot 11 is reserved */ -/* 12 */ -EXTERN int TkpWmSetState(TkWindow *winPtr, int state); +/* Slot 12 is reserved */ /* Slot 13 is reserved */ /* Slot 14 is reserved */ /* Slot 15 is reserved */ @@ -298,7 +296,8 @@ EXTERN int TkpWmSetState(TkWindow *winPtr, int state); /* Slot 34 is reserved */ /* Slot 35 is reserved */ /* Slot 36 is reserved */ -/* Slot 37 is reserved */ +/* 37 */ +EXTERN void TkCreateXEventSource(void); /* 38 */ EXTERN int TkpCmapStressed(Tk_Window tkwin, Colormap colormap); /* 39 */ @@ -324,17 +323,17 @@ typedef struct TkIntPlatStubs { #if defined(_WIN32) || defined(__CYGWIN__) /* WIN */ char * (*tkAlignImageData) (XImage *image, int alignment, int bitOrder); /* 0 */ - void (*reserved1)(void); + void (*tkWinCancelMouseTimer) (void); /* 1 */ void (*tkGenerateActivateEvents) (TkWindow *winPtr, int active); /* 2 */ unsigned long (*tkpGetMS) (void); /* 3 */ void (*tkPointerDeadWindow) (TkWindow *winPtr); /* 4 */ void (*tkpPrintWindowId) (char *buf, Window window); /* 5 */ int (*tkpScanWindowId) (Tcl_Interp *interp, const char *string, Window *idPtr); /* 6 */ - void (*tkpSetCapture) (TkWindow *winPtr); /* 7 */ + int (*tkpWmSetState) (TkWindow *winPtr, int state); /* 7 */ void (*tkpSetCursor) (TkpCursor cursor); /* 8 */ - int (*tkpWmSetState) (TkWindow *winPtr, int state); /* 9 */ + void (*tkpSetCapture) (TkWindow *winPtr); /* 9 */ void (*tkSetPixmapColormap) (Pixmap pixmap, Colormap colormap); /* 10 */ - void (*tkWinCancelMouseTimer) (void); /* 11 */ + void (*reserved11)(void); void (*tkWinClipboardRender) (TkDisplay *dispPtr, UINT format); /* 12 */ LRESULT (*tkWinEmbeddedEventProc) (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); /* 13 */ void (*tkWinFillRect) (HDC dc, int x, int y, int width, int height, int pixel); /* 14 */ @@ -374,17 +373,17 @@ typedef struct TkIntPlatStubs { #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ void (*reserved0)(void); - void (*reserved1)(void); + void (*tkAboutDlg) (void); /* 1 */ void (*tkGenerateActivateEvents) (TkWindow *winPtr, int active); /* 2 */ - void (*tkPointerDeadWindow) (TkWindow *winPtr); /* 3 */ - void (*tkpSetCapture) (TkWindow *winPtr); /* 4 */ + unsigned long (*tkpGetMS) (void); /* 3 */ + void (*tkPointerDeadWindow) (TkWindow *winPtr); /* 4 */ void (*tkpSetCursor) (TkpCursor cursor); /* 5 */ - void (*tkpWmSetState) (TkWindow *winPtr, int state); /* 6 */ - void (*tkAboutDlg) (void); /* 7 */ + int (*tkpScanWindowId) (Tcl_Interp *interp, const char *string, Window *idPtr); /* 6 */ + int (*tkpWmSetState) (TkWindow *winPtr, int state); /* 7 */ unsigned int (*tkMacOSXButtonKeyState) (void); /* 8 */ - void (*tkMacOSXClearMenubarActive) (void); /* 9 */ + void (*tkpSetCapture) (TkWindow *winPtr); /* 9 */ int (*tkMacOSXDispatchMenuEvent) (int menuID, int index); /* 10 */ - void (*reserved11)(void); + void (*tkMacOSXClearMenubarActive) (void); /* 11 */ void (*tkMacOSXHandleTearoffMenu) (void); /* 12 */ void (*reserved13)(void); int (*tkMacOSXDoHLEvent) (void *theEvent); /* 14 */ @@ -426,24 +425,23 @@ typedef struct TkIntPlatStubs { int (*tkGenerateButtonEvent) (int x, int y, Window window, unsigned int state); /* 50 */ void (*tkGenWMDestroyEvent) (Tk_Window tkwin); /* 51 */ void (*tkMacOSXSetDrawingEnabled) (TkWindow *winPtr, int flag); /* 52 */ - unsigned long (*tkpGetMS) (void); /* 53 */ + void (*reserved53)(void); void * (*tkMacOSXDrawable) (Drawable drawable); /* 54 */ - int (*tkpScanWindowId) (Tcl_Interp *interp, const char *string, Window *idPtr); /* 55 */ #endif /* AQUA */ #if !(defined(_WIN32) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */ - void (*tkCreateXEventSource) (void); /* 0 */ + void (*reserved0)(void); void (*reserved1)(void); void (*tkGenerateActivateEvents) (TkWindow *winPtr, int active); /* 2 */ void (*reserved3)(void); void (*reserved4)(void); void (*reserved5)(void); - void (*reserved6)(void); - void (*reserved7)(void); - int (*tkpScanWindowId) (Tcl_Interp *interp, const char *string, Window *idPtr); /* 8 */ + int (*tkpScanWindowId) (Tcl_Interp *interp, const char *string, Window *idPtr); /* 6 */ + int (*tkpWmSetState) (TkWindow *winPtr, int state); /* 7 */ + void (*reserved8)(void); void (*tkWmCleanup) (TkDisplay *dispPtr); /* 9 */ void (*reserved10)(void); void (*reserved11)(void); - int (*tkpWmSetState) (TkWindow *winPtr, int state); /* 12 */ + void (*reserved12)(void); void (*reserved13)(void); void (*reserved14)(void); void (*reserved15)(void); @@ -468,7 +466,7 @@ typedef struct TkIntPlatStubs { void (*reserved34)(void); void (*reserved35)(void); void (*reserved36)(void); - void (*reserved37)(void); + void (*tkCreateXEventSource) (void); /* 37 */ int (*tkpCmapStressed) (Tk_Window tkwin, Colormap colormap); /* 38 */ void (*tkpSync) (Display *display); /* 39 */ Window (*tkUnixContainerId) (TkWindow *winPtr); /* 40 */ @@ -495,7 +493,8 @@ extern const TkIntPlatStubs *tkIntPlatStubsPtr; #if defined(_WIN32) || defined(__CYGWIN__) /* WIN */ #define TkAlignImageData \ (tkIntPlatStubsPtr->tkAlignImageData) /* 0 */ -/* Slot 1 is reserved */ +#define TkWinCancelMouseTimer \ + (tkIntPlatStubsPtr->tkWinCancelMouseTimer) /* 1 */ #define TkGenerateActivateEvents \ (tkIntPlatStubsPtr->tkGenerateActivateEvents) /* 2 */ #define TkpGetMS \ @@ -506,16 +505,15 @@ extern const TkIntPlatStubs *tkIntPlatStubsPtr; (tkIntPlatStubsPtr->tkpPrintWindowId) /* 5 */ #define TkpScanWindowId \ (tkIntPlatStubsPtr->tkpScanWindowId) /* 6 */ -#define TkpSetCapture \ - (tkIntPlatStubsPtr->tkpSetCapture) /* 7 */ +#define TkpWmSetState \ + (tkIntPlatStubsPtr->tkpWmSetState) /* 7 */ #define TkpSetCursor \ (tkIntPlatStubsPtr->tkpSetCursor) /* 8 */ -#define TkpWmSetState \ - (tkIntPlatStubsPtr->tkpWmSetState) /* 9 */ +#define TkpSetCapture \ + (tkIntPlatStubsPtr->tkpSetCapture) /* 9 */ #define TkSetPixmapColormap \ (tkIntPlatStubsPtr->tkSetPixmapColormap) /* 10 */ -#define TkWinCancelMouseTimer \ - (tkIntPlatStubsPtr->tkWinCancelMouseTimer) /* 11 */ +/* Slot 11 is reserved */ #define TkWinClipboardRender \ (tkIntPlatStubsPtr->tkWinClipboardRender) /* 12 */ #define TkWinEmbeddedEventProc \ @@ -589,26 +587,28 @@ extern const TkIntPlatStubs *tkIntPlatStubsPtr; #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ /* Slot 0 is reserved */ -/* Slot 1 is reserved */ +#define TkAboutDlg \ + (tkIntPlatStubsPtr->tkAboutDlg) /* 1 */ #define TkGenerateActivateEvents \ (tkIntPlatStubsPtr->tkGenerateActivateEvents) /* 2 */ +#define TkpGetMS \ + (tkIntPlatStubsPtr->tkpGetMS) /* 3 */ #define TkPointerDeadWindow \ - (tkIntPlatStubsPtr->tkPointerDeadWindow) /* 3 */ -#define TkpSetCapture \ - (tkIntPlatStubsPtr->tkpSetCapture) /* 4 */ + (tkIntPlatStubsPtr->tkPointerDeadWindow) /* 4 */ #define TkpSetCursor \ (tkIntPlatStubsPtr->tkpSetCursor) /* 5 */ +#define TkpScanWindowId \ + (tkIntPlatStubsPtr->tkpScanWindowId) /* 6 */ #define TkpWmSetState \ - (tkIntPlatStubsPtr->tkpWmSetState) /* 6 */ -#define TkAboutDlg \ - (tkIntPlatStubsPtr->tkAboutDlg) /* 7 */ + (tkIntPlatStubsPtr->tkpWmSetState) /* 7 */ #define TkMacOSXButtonKeyState \ (tkIntPlatStubsPtr->tkMacOSXButtonKeyState) /* 8 */ -#define TkMacOSXClearMenubarActive \ - (tkIntPlatStubsPtr->tkMacOSXClearMenubarActive) /* 9 */ +#define TkpSetCapture \ + (tkIntPlatStubsPtr->tkpSetCapture) /* 9 */ #define TkMacOSXDispatchMenuEvent \ (tkIntPlatStubsPtr->tkMacOSXDispatchMenuEvent) /* 10 */ -/* Slot 11 is reserved */ +#define TkMacOSXClearMenubarActive \ + (tkIntPlatStubsPtr->tkMacOSXClearMenubarActive) /* 11 */ #define TkMacOSXHandleTearoffMenu \ (tkIntPlatStubsPtr->tkMacOSXHandleTearoffMenu) /* 12 */ /* Slot 13 is reserved */ @@ -681,32 +681,28 @@ extern const TkIntPlatStubs *tkIntPlatStubsPtr; (tkIntPlatStubsPtr->tkGenWMDestroyEvent) /* 51 */ #define TkMacOSXSetDrawingEnabled \ (tkIntPlatStubsPtr->tkMacOSXSetDrawingEnabled) /* 52 */ -#define TkpGetMS \ - (tkIntPlatStubsPtr->tkpGetMS) /* 53 */ +/* Slot 53 is reserved */ #define TkMacOSXDrawable \ (tkIntPlatStubsPtr->tkMacOSXDrawable) /* 54 */ -#define TkpScanWindowId \ - (tkIntPlatStubsPtr->tkpScanWindowId) /* 55 */ #endif /* AQUA */ #if !(defined(_WIN32) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */ -#define TkCreateXEventSource \ - (tkIntPlatStubsPtr->tkCreateXEventSource) /* 0 */ +/* Slot 0 is reserved */ /* Slot 1 is reserved */ #define TkGenerateActivateEvents \ (tkIntPlatStubsPtr->tkGenerateActivateEvents) /* 2 */ /* Slot 3 is reserved */ /* Slot 4 is reserved */ /* Slot 5 is reserved */ -/* Slot 6 is reserved */ -/* Slot 7 is reserved */ #define TkpScanWindowId \ - (tkIntPlatStubsPtr->tkpScanWindowId) /* 8 */ + (tkIntPlatStubsPtr->tkpScanWindowId) /* 6 */ +#define TkpWmSetState \ + (tkIntPlatStubsPtr->tkpWmSetState) /* 7 */ +/* Slot 8 is reserved */ #define TkWmCleanup \ (tkIntPlatStubsPtr->tkWmCleanup) /* 9 */ /* Slot 10 is reserved */ /* Slot 11 is reserved */ -#define TkpWmSetState \ - (tkIntPlatStubsPtr->tkpWmSetState) /* 12 */ +/* Slot 12 is reserved */ /* Slot 13 is reserved */ /* Slot 14 is reserved */ /* Slot 15 is reserved */ @@ -731,7 +727,8 @@ extern const TkIntPlatStubs *tkIntPlatStubsPtr; /* Slot 34 is reserved */ /* Slot 35 is reserved */ /* Slot 36 is reserved */ -/* Slot 37 is reserved */ +#define TkCreateXEventSource \ + (tkIntPlatStubsPtr->tkCreateXEventSource) /* 37 */ #define TkpCmapStressed \ (tkIntPlatStubsPtr->tkpCmapStressed) /* 38 */ #define TkpSync \ diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c index ff2cc1c..e32ea2c 100644 --- a/generic/tkStubInit.c +++ b/generic/tkStubInit.c @@ -53,8 +53,14 @@ doNothing(void) } # undef TkpWillDrawWidget # undef TkpRedrawWidget +# undef TkpDefineNativeBitmaps +# undef TkpCreateNativeBitmap +# undef TkpGetNativeAppBitmap # define TkpWillDrawWidget ((int (*)(Tk_Window))(void *)doNothing) # define TkpRedrawWidget ((void (*)(Tk_Window))(void *)doNothing) +# define TkpDefineNativeBitmaps ((void (*)())(void *)doNothing) +# define TkpCreateNativeBitmap ((Pixmap (*)(Display *, const void *))(void *)doNothing) +# define TkpGetNativeAppBitmap ((Pixmap (*)(Display *, const char*, int *, int *))(void *)doNothing) #endif #ifdef _WIN32 @@ -353,37 +359,10 @@ static const TkIntStubs tkIntStubs = { XSetRegion, /* 118 */ XUnionRectWithRegion, /* 119 */ 0, /* 120 */ -#if !(defined(_WIN32) || defined(MAC_OSX_TK)) /* X11 */ - 0, /* 121 */ -#endif /* X11 */ -#if defined(_WIN32) /* WIN */ - 0, /* 121 */ -#endif /* WIN */ -#ifdef MAC_OSX_TK /* AQUA */ - 0, /* 121 */ /* Dummy entry for stubs table backwards compatibility */ TkpCreateNativeBitmap, /* 121 */ -#endif /* AQUA */ -#if !(defined(_WIN32) || defined(MAC_OSX_TK)) /* X11 */ - 0, /* 122 */ -#endif /* X11 */ -#if defined(_WIN32) /* WIN */ - 0, /* 122 */ -#endif /* WIN */ -#ifdef MAC_OSX_TK /* AQUA */ - 0, /* 122 */ /* Dummy entry for stubs table backwards compatibility */ TkpDefineNativeBitmaps, /* 122 */ -#endif /* AQUA */ 0, /* 123 */ -#if !(defined(_WIN32) || defined(MAC_OSX_TK)) /* X11 */ - 0, /* 124 */ -#endif /* X11 */ -#if defined(_WIN32) /* WIN */ - 0, /* 124 */ -#endif /* WIN */ -#ifdef MAC_OSX_TK /* AQUA */ - 0, /* 124 */ /* Dummy entry for stubs table backwards compatibility */ TkpGetNativeAppBitmap, /* 124 */ -#endif /* AQUA */ 0, /* 125 */ 0, /* 126 */ 0, /* 127 */ @@ -454,17 +433,17 @@ static const TkIntPlatStubs tkIntPlatStubs = { 0, #if defined(_WIN32) || defined(__CYGWIN__) /* WIN */ TkAlignImageData, /* 0 */ - 0, /* 1 */ + TkWinCancelMouseTimer, /* 1 */ TkGenerateActivateEvents, /* 2 */ TkpGetMS, /* 3 */ TkPointerDeadWindow, /* 4 */ TkpPrintWindowId, /* 5 */ TkpScanWindowId, /* 6 */ - TkpSetCapture, /* 7 */ + TkpWmSetState, /* 7 */ TkpSetCursor, /* 8 */ - TkpWmSetState, /* 9 */ + TkpSetCapture, /* 9 */ TkSetPixmapColormap, /* 10 */ - TkWinCancelMouseTimer, /* 11 */ + 0, /* 11 */ TkWinClipboardRender, /* 12 */ TkWinEmbeddedEventProc, /* 13 */ TkWinFillRect, /* 14 */ @@ -504,17 +483,17 @@ static const TkIntPlatStubs tkIntPlatStubs = { #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ 0, /* 0 */ - 0, /* 1 */ + TkAboutDlg, /* 1 */ TkGenerateActivateEvents, /* 2 */ - TkPointerDeadWindow, /* 3 */ - TkpSetCapture, /* 4 */ + TkpGetMS, /* 3 */ + TkPointerDeadWindow, /* 4 */ TkpSetCursor, /* 5 */ - TkpWmSetState, /* 6 */ - TkAboutDlg, /* 7 */ + TkpScanWindowId, /* 6 */ + TkpWmSetState, /* 7 */ TkMacOSXButtonKeyState, /* 8 */ - TkMacOSXClearMenubarActive, /* 9 */ + TkpSetCapture, /* 9 */ TkMacOSXDispatchMenuEvent, /* 10 */ - 0, /* 11 */ + TkMacOSXClearMenubarActive, /* 11 */ TkMacOSXHandleTearoffMenu, /* 12 */ 0, /* 13 */ TkMacOSXDoHLEvent, /* 14 */ @@ -556,24 +535,23 @@ static const TkIntPlatStubs tkIntPlatStubs = { TkGenerateButtonEvent, /* 50 */ TkGenWMDestroyEvent, /* 51 */ TkMacOSXSetDrawingEnabled, /* 52 */ - TkpGetMS, /* 53 */ + 0, /* 53 */ TkMacOSXDrawable, /* 54 */ - TkpScanWindowId, /* 55 */ #endif /* AQUA */ #if !(defined(_WIN32) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */ - TkCreateXEventSource, /* 0 */ + 0, /* 0 */ 0, /* 1 */ TkGenerateActivateEvents, /* 2 */ 0, /* 3 */ 0, /* 4 */ 0, /* 5 */ - 0, /* 6 */ - 0, /* 7 */ - TkpScanWindowId, /* 8 */ + TkpScanWindowId, /* 6 */ + TkpWmSetState, /* 7 */ + 0, /* 8 */ TkWmCleanup, /* 9 */ 0, /* 10 */ 0, /* 11 */ - TkpWmSetState, /* 12 */ + 0, /* 12 */ 0, /* 13 */ 0, /* 14 */ 0, /* 15 */ @@ -598,7 +576,7 @@ static const TkIntPlatStubs tkIntPlatStubs = { 0, /* 34 */ 0, /* 35 */ 0, /* 36 */ - 0, /* 37 */ + TkCreateXEventSource, /* 37 */ TkpCmapStressed, /* 38 */ TkpSync, /* 39 */ TkUnixContainerId, /* 40 */ diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index 547657b..cc8bcd2 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -6978,7 +6978,7 @@ TkpGetWrapperWindow( *---------------------------------------------------------------------- */ -void +int TkpWmSetState( TkWindow *winPtr, /* Toplevel window to operate on. */ int state) /* One of IconicState, ZoomState, NormalState, @@ -6989,7 +6989,7 @@ TkpWmSetState( wmPtr->hints.initial_state = state; if (wmPtr->flags & WM_NEVER_MAPPED) { - return; + goto setStateEnd; } macWin = TkMacOSXGetNSWindowForDrawable(winPtr->window); @@ -7033,6 +7033,8 @@ TkpWmSetState( */ while (Tcl_DoOneEvent(TCL_IDLE_EVENTS)){} +setStateEnd: + return 1; } /* diff --git a/unix/tkUnixPort.h b/unix/tkUnixPort.h index 1cd2e8a..097c7b8 100644 --- a/unix/tkUnixPort.h +++ b/unix/tkUnixPort.h @@ -146,15 +146,6 @@ #endif /* - * These calls implement native bitmaps which are not supported under - * UNIX. The macros eliminate the calls. - */ - -#define TkpDefineNativeBitmaps() -#define TkpCreateNativeBitmap(display, source) None -#define TkpGetNativeAppBitmap(display, name, w, h) None - -/* * This macro stores a representation of the window handle in a string. * This should perhaps use the real size of an XID. */ diff --git a/win/tkWinPort.h b/win/tkWinPort.h index d3471ca..fd43335 100644 --- a/win/tkWinPort.h +++ b/win/tkWinPort.h @@ -124,13 +124,4 @@ #define TkpGetPixel(p) (((((p)->red >> 8) & 0xff) \ | ((p)->green & 0xff00) | (((p)->blue << 8) & 0xff0000)) | 0x20000000) -/* - * These calls implement native bitmaps which are not currently - * supported under Windows. The macros eliminate the calls. - */ - -#define TkpDefineNativeBitmaps() -#define TkpCreateNativeBitmap(display, source) None -#define TkpGetNativeAppBitmap(display, name, w, h) None - #endif /* _WINPORT */ -- cgit v0.12