diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-09-08 09:19:00 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-09-08 09:19:00 (GMT) |
commit | 084797b718b0d03429fabc4997ff3f9695f9bd24 (patch) | |
tree | d2494edb29ebd5494e65b953451dc8d43cd73c43 | |
parent | c1d50f8302f80ab1939467c61bea379dd6035b1d (diff) | |
parent | c2a305b8ed5e188557828ca1fc623f00f180e534 (diff) | |
download | tk-084797b718b0d03429fabc4997ff3f9695f9bd24.zip tk-084797b718b0d03429fabc4997ff3f9695f9bd24.tar.gz tk-084797b718b0d03429fabc4997ff3f9695f9bd24.tar.bz2 |
Merge 8.6. Rename some functions
-rw-r--r-- | generic/tk.decls | 16 | ||||
-rw-r--r-- | generic/tkPlatDecls.h | 44 | ||||
-rw-r--r-- | generic/tkStubInit.c | 11 | ||||
-rw-r--r-- | macosx/tkMacOSXDraw.c | 6 | ||||
-rw-r--r-- | macosx/tkMacOSXPrivate.h | 8 | ||||
-rw-r--r-- | macosx/tkMacOSXSubwindows.c | 2 | ||||
-rw-r--r-- | macosx/tkMacOSXWm.c | 19 |
7 files changed, 78 insertions, 28 deletions
diff --git a/generic/tk.decls b/generic/tk.decls index 3fc5e77..4a4f01d 100644 --- a/generic/tk.decls +++ b/generic/tk.decls @@ -1129,7 +1129,7 @@ declare 4 aqua { void TkMacOSXInitAppleEvents(Tcl_Interp *interp) } declare 5 aqua { - void TkGenWMConfigureEvent(Tk_Window tkwin, int x, int y, int width, + void TkGenWMConfigureEvent_(Tk_Window tkwin, int x, int y, int width, int height, int flags) } declare 6 aqua { @@ -1148,6 +1148,20 @@ declare 9 aqua { declare 10 aqua { int Tk_MacOSXIsAppInFront(void) } +declare 11 aqua { + Tk_Window Tk_MacOSXGetTkWindow(void *w) +} +declare 12 aqua { + void *Tk_MacOSXGetCGContextForDrawable(Drawable drawable) +} +# Replaces TkMacOSXDrawable +declare 13 aqua { + void *Tk_MacOSXGetNSWindowForDrawable(Drawable drawable) +} +declare 16 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 5b71f8b..902e73d 100644 --- a/generic/tkPlatDecls.h +++ b/generic/tkPlatDecls.h @@ -61,7 +61,7 @@ EXTERN int Tk_TranslateWinEvent(HWND hwnd, UINT message, /* 4 */ EXTERN void TkMacOSXInitAppleEvents(Tcl_Interp *interp); /* 5 */ -EXTERN void TkGenWMConfigureEvent(Tk_Window tkwin, int x, int y, +EXTERN void TkGenWMConfigureEvent_(Tk_Window tkwin, int x, int y, int width, int height, int flags); /* 6 */ EXTERN void TkMacOSXInvalClipRgns(Tk_Window tkwin); @@ -72,6 +72,17 @@ EXTERN void * TkMacOSXGetRootControl(Drawable drawable); EXTERN void Tk_MacOSXSetupTkNotifier(void); /* 10 */ EXTERN int Tk_MacOSXIsAppInFront(void); +/* 11 */ +EXTERN Tk_Window Tk_MacOSXGetTkWindow(void *w); +/* 12 */ +EXTERN void * Tk_MacOSXGetCGContextForDrawable(Drawable drawable); +/* 13 */ +EXTERN void * Tk_MacOSXGetNSWindowForDrawable(Drawable drawable); +/* Slot 14 is reserved */ +/* Slot 15 is reserved */ +/* 16 */ +EXTERN void TkGenWMConfigureEvent(Tk_Window tkwin, int x, int y, + int width, int height, int flags); #endif /* AQUA */ typedef struct TkPlatStubs { @@ -92,12 +103,18 @@ typedef struct TkPlatStubs { void (*reserved2)(void); void (*reserved3)(void); void (*tkMacOSXInitAppleEvents) (Tcl_Interp *interp); /* 4 */ - void (*tkGenWMConfigureEvent) (Tk_Window tkwin, int x, int y, int width, int height, int flags); /* 5 */ + void (*tkGenWMConfigureEvent_) (Tk_Window tkwin, int x, int y, int width, int height, int flags); /* 5 */ void (*tkMacOSXInvalClipRgns) (Tk_Window tkwin); /* 6 */ void (*reserved7)(void); void * (*tkMacOSXGetRootControl) (Drawable drawable); /* 8 */ void (*tk_MacOSXSetupTkNotifier) (void); /* 9 */ int (*tk_MacOSXIsAppInFront) (void); /* 10 */ + Tk_Window (*tk_MacOSXGetTkWindow) (void *w); /* 11 */ + void * (*tk_MacOSXGetCGContextForDrawable) (Drawable drawable); /* 12 */ + void * (*tk_MacOSXGetNSWindowForDrawable) (Drawable drawable); /* 13 */ + void (*reserved14)(void); + void (*reserved15)(void); + void (*tkGenWMConfigureEvent) (Tk_Window tkwin, int x, int y, int width, int height, int flags); /* 16 */ #endif /* AQUA */ } TkPlatStubs; @@ -134,8 +151,8 @@ extern const TkPlatStubs *tkPlatStubsPtr; /* Slot 3 is reserved */ #define TkMacOSXInitAppleEvents \ (tkPlatStubsPtr->tkMacOSXInitAppleEvents) /* 4 */ -#define TkGenWMConfigureEvent \ - (tkPlatStubsPtr->tkGenWMConfigureEvent) /* 5 */ +#define TkGenWMConfigureEvent_ \ + (tkPlatStubsPtr->tkGenWMConfigureEvent_) /* 5 */ #define TkMacOSXInvalClipRgns \ (tkPlatStubsPtr->tkMacOSXInvalClipRgns) /* 6 */ /* Slot 7 is reserved */ @@ -145,18 +162,22 @@ extern const TkPlatStubs *tkPlatStubsPtr; (tkPlatStubsPtr->tk_MacOSXSetupTkNotifier) /* 9 */ #define Tk_MacOSXIsAppInFront \ (tkPlatStubsPtr->tk_MacOSXIsAppInFront) /* 10 */ +#define Tk_MacOSXGetTkWindow \ + (tkPlatStubsPtr->tk_MacOSXGetTkWindow) /* 11 */ +#define Tk_MacOSXGetCGContextForDrawable \ + (tkPlatStubsPtr->tk_MacOSXGetCGContextForDrawable) /* 12 */ +#define Tk_MacOSXGetNSWindowForDrawable \ + (tkPlatStubsPtr->tk_MacOSXGetNSWindowForDrawable) /* 13 */ +/* Slot 14 is reserved */ +/* Slot 15 is reserved */ +#define TkGenWMConfigureEvent \ + (tkPlatStubsPtr->tkGenWMConfigureEvent) /* 16 */ #endif /* AQUA */ #endif /* defined(USE_TK_STUBS) */ /* !END!: Do not edit above this line. */ -#undef Tk_MacOSXTurnOffMenus_ -#undef TkMacOSXInitMenus_ -#undef TkGenWMConfigureEvent_ -#undef Tk_MacOSXSetEmbedHandler -#undef Tk_MacOSXTurnOffMenus - #ifdef __cplusplus } #endif @@ -164,4 +185,7 @@ extern const TkPlatStubs *tkPlatStubsPtr; #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLIMPORT +#undef TkGenWMConfigureEvent_ +#define Tk_MacOSXGetNSViewForDrawable TkMacOSXGetRootControl + #endif /* _TKPLATDECLS */ diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c index e0c4c93..686fa80 100644 --- a/generic/tkStubInit.c +++ b/generic/tkStubInit.c @@ -24,6 +24,7 @@ #if defined(MAC_OSX_TK) /* we could have used _TKMACINT */ #include "tkMacOSXInt.h" +#include "tkMacOSXPrivate.h" #endif /* TODO: These ought to come in some other way */ @@ -104,6 +105,7 @@ static Tk_Style Tk_GetStyleFromObj(Tcl_Obj *obj) #define TkpTestsendCmd_ TkpTestsendCmd #define TkGenWMConfigureEvent_ TkGenWMConfigureEvent #define TkGenerateActivateEvents_ TkGenerateActivateEvents +#define TkMacOSXDrawable Tk_MacOSXGetNSWindowForDrawable #define Tk_CanvasTagsParseProc \ (int (*) (void *, Tcl_Interp *,Tk_Window, const char *, char *, \ int offset))(void *)TkCanvasTagsParseProc @@ -111,6 +113,7 @@ static Tk_Style Tk_GetStyleFromObj(Tcl_Obj *obj) (const char *(*) (void *,Tk_Window, char *, int, \ Tcl_FreeProc **))(void *)TkCanvasTagsPrintProc + #ifdef _WIN32 int @@ -1026,12 +1029,18 @@ static const TkPlatStubs tkPlatStubs = { 0, /* 2 */ 0, /* 3 */ TkMacOSXInitAppleEvents, /* 4 */ - TkGenWMConfigureEvent, /* 5 */ + TkGenWMConfigureEvent_, /* 5 */ TkMacOSXInvalClipRgns, /* 6 */ 0, /* 7 */ TkMacOSXGetRootControl, /* 8 */ Tk_MacOSXSetupTkNotifier, /* 9 */ Tk_MacOSXIsAppInFront, /* 10 */ + Tk_MacOSXGetTkWindow, /* 11 */ + Tk_MacOSXGetCGContextForDrawable, /* 12 */ + Tk_MacOSXGetNSWindowForDrawable, /* 13 */ + 0, /* 14 */ + 0, /* 15 */ + TkGenWMConfigureEvent, /* 16 */ #endif /* AQUA */ }; diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c index e3f8055..a7314f1 100644 --- a/macosx/tkMacOSXDraw.c +++ b/macosx/tkMacOSXDraw.c @@ -226,7 +226,7 @@ CreateNSImageFromPixmap( /* *---------------------------------------------------------------------- * - * TkMacOSXGetCGContextForDrawable -- + * Tk_MacOSXGetCGContextForDrawable -- * * Get CGContext for given Drawable, creating one if necessary. * @@ -239,8 +239,8 @@ CreateNSImageFromPixmap( *---------------------------------------------------------------------- */ -CGContextRef -TkMacOSXGetCGContextForDrawable( +void * +Tk_MacOSXGetCGContextForDrawable( Drawable drawable) { MacDrawable *macDraw = (MacDrawable *)drawable; diff --git a/macosx/tkMacOSXPrivate.h b/macosx/tkMacOSXPrivate.h index 987ce03..25ce143 100644 --- a/macosx/tkMacOSXPrivate.h +++ b/macosx/tkMacOSXPrivate.h @@ -258,20 +258,20 @@ MODULE_SCOPE void TkMacOSXRestoreDrawingContext( TkMacOSXDrawingContext *dcPtr); MODULE_SCOPE void TkMacOSXSetColorInContext(GC gc, unsigned long pixel, CGContextRef context); -#define TkMacOSXGetNSWindowForDrawable(drawable) ((NSWindow*)TkMacOSXDrawable(drawable)) -#define TkMacOSXGetNSViewForDrawable(macWin) (NSView *)TkMacOSXGetRootControl((Drawable)(macWin)) +#define TkMacOSXGetTkWindow(window) (TkWindow *)Tk_MacOSXGetTkWindow(window) +#define TkMacOSXGetNSWindowForDrawable(drawable) ((NSWindow *)Tk_MacOSXGetNSWindowForDrawable(drawable)) +#define TkMacOSXGetNSViewForDrawable(macWin) ((NSView *)Tk_MacOSXGetNSViewForDrawable((Drawable)(macWin))) +#define TkMacOSXGetCGContextForDrawable(drawable) ((CGContextRef)Tk_MacOSXGetCGContextForDrawable(drawable)) MODULE_SCOPE void TkMacOSXWinCGBounds(TkWindow *winPtr, CGRect *bounds); MODULE_SCOPE HIShapeRef TkMacOSXGetClipRgn(Drawable drawable); MODULE_SCOPE void TkMacOSXInvalidateViewRegion(NSView *view, HIShapeRef rgn); -MODULE_SCOPE CGContextRef TkMacOSXGetCGContextForDrawable(Drawable drawable); MODULE_SCOPE NSImage* TkMacOSXGetNSImageFromTkImage(Display *display, Tk_Image image, int width, int height); MODULE_SCOPE NSImage* TkMacOSXGetNSImageFromBitmap(Display *display, Pixmap bitmap, GC gc, int width, int height); MODULE_SCOPE CGColorRef TkMacOSXCreateCGColor(GC gc, unsigned long pixel); MODULE_SCOPE NSColor* TkMacOSXGetNSColor(GC gc, unsigned long pixel); -MODULE_SCOPE TkWindow* TkMacOSXGetTkWindow(NSWindow *w); MODULE_SCOPE NSFont* TkMacOSXNSFontForFont(Tk_Font tkfont); MODULE_SCOPE NSDictionary* TkMacOSXNSFontAttributesForFont(Tk_Font tkfont); MODULE_SCOPE NSModalSession TkMacOSXGetModalSession(void); diff --git a/macosx/tkMacOSXSubwindows.c b/macosx/tkMacOSXSubwindows.c index 42b3554..fcd9a4a 100644 --- a/macosx/tkMacOSXSubwindows.c +++ b/macosx/tkMacOSXSubwindows.c @@ -1075,7 +1075,7 @@ TkMacOSXInvalidateWindow( */ void * -TkMacOSXDrawable( +Tk_MacOSXGetNSWindowForDrawable( Drawable drawable) { MacDrawable *macWin = (MacDrawable *)drawable; diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index 14cae08..fba6c63 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -5390,12 +5390,15 @@ TkMacOSXGetXWindow( /* *---------------------------------------------------------------------- * - * TkMacOSXGetTkWindow -- + * Tk_MacOSXGetTkWindow -- * - * Returns the TkWindow* associated with the given NSWindow*. + * Returns the Tk_Window associated with the given NSWindow*. This + * function is a stub, so the NSWindow* parameter must be declared as + * void*. * * Results: - * The TkWindow* returned. NULL is returned if not a Tk window. + * A Tk_Window, or NULL if the NSWindow is not associated with + * any Tk window. * * Side effects: * None. @@ -5403,17 +5406,17 @@ TkMacOSXGetXWindow( *---------------------------------------------------------------------- */ -TkWindow* -TkMacOSXGetTkWindow( - NSWindow *w) +Tk_Window +Tk_MacOSXGetTkWindow( + void *w) { Window window = None; TkDisplay *dispPtr = TkGetDisplayList(); - if ([w respondsToSelector: @selector (tkWindow)]) { + if ([(NSWindow *)w respondsToSelector: @selector (tkWindow)]) { window = [(TKWindow *)w tkWindow]; } return (window != None ? - (TkWindow *)Tk_IdToWindow(dispPtr->display, window) : NULL); + Tk_IdToWindow(dispPtr->display, window) : NULL); } |