summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-09-08 08:28:09 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-09-08 08:28:09 (GMT)
commitc2a305b8ed5e188557828ca1fc623f00f180e534 (patch)
treedced14253389ad0646efbf5714ab32540393d7c2 /generic
parent3b31d9630f305b2f6b73e57e147541bc13aa1057 (diff)
parent9d1abea3325f5bcc2d822d4b23d742e517855593 (diff)
downloadtk-c2a305b8ed5e188557828ca1fc623f00f180e534.zip
tk-c2a305b8ed5e188557828ca1fc623f00f180e534.tar.gz
tk-c2a305b8ed5e188557828ca1fc623f00f180e534.tar.bz2
3 new MacOS-specific stub functions: Tk_MacOSXGetTkWindow()/Tk_MacOSXGetCGContextForDrawable()/Tk_MacOSXGetNSWindowForDrawable(), so they can be used by extensions
Diffstat (limited to 'generic')
-rw-r--r--generic/tk.decls10
-rw-r--r--generic/tkPlatDecls.h29
-rw-r--r--generic/tkStubInit.c15
3 files changed, 40 insertions, 14 deletions
diff --git a/generic/tk.decls b/generic/tk.decls
index 1a26d27..49acd5f 100644
--- a/generic/tk.decls
+++ b/generic/tk.decls
@@ -1139,6 +1139,16 @@ 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 ed8b1f5..bad633f 100644
--- a/generic/tkPlatDecls.h
+++ b/generic/tkPlatDecls.h
@@ -82,9 +82,12 @@ EXTERN void * TkMacOSXGetRootControl(Drawable drawable);
EXTERN void Tk_MacOSXSetupTkNotifier(void);
/* 10 */
EXTERN int Tk_MacOSXIsAppInFront(void);
-/* Slot 11 is reserved */
-/* Slot 12 is reserved */
-/* Slot 13 is reserved */
+/* 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 */
@@ -116,9 +119,9 @@ typedef struct TkPlatStubs {
void * (*tkMacOSXGetRootControl) (Drawable drawable); /* 8 */
void (*tk_MacOSXSetupTkNotifier) (void); /* 9 */
int (*tk_MacOSXIsAppInFront) (void); /* 10 */
- void (*reserved11)(void);
- void (*reserved12)(void);
- void (*reserved13)(void);
+ 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 */
@@ -174,9 +177,12 @@ extern const TkPlatStubs *tkPlatStubsPtr;
(tkPlatStubsPtr->tk_MacOSXSetupTkNotifier) /* 9 */
#define Tk_MacOSXIsAppInFront \
(tkPlatStubsPtr->tk_MacOSXIsAppInFront) /* 10 */
-/* Slot 11 is reserved */
-/* Slot 12 is reserved */
-/* Slot 13 is reserved */
+#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_ \
@@ -187,8 +193,6 @@ extern const TkPlatStubs *tkPlatStubsPtr;
/* !END!: Do not edit above this line. */
-#undef TkGenWMConfigureEvent_
-
#ifdef __cplusplus
}
#endif
@@ -196,4 +200,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 546b2e4..17331e9 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 */
@@ -58,6 +59,14 @@ MODULE_SCOPE const TkStubs tkStubs;
#define TkGenWMConfigureEvent_ TkGenWMConfigureEvent
#define TkGenerateActivateEvents_ TkGenerateActivateEvents
+#if defined(MAC_OSX_TK)
+# define Tk_MacOSXGetNSWindowForDrawable TkMacOSXDrawable
+# define Tk_MacOSXGetCGContextForDrawable GetCGContextForDrawable
+static void *GetCGContextForDrawable(Drawable d) {
+ return TkMacOSXGetCGContextForDrawable(d);
+}
+#endif
+
#ifdef _WIN32
int
@@ -1013,9 +1022,9 @@ static const TkPlatStubs tkPlatStubs = {
TkMacOSXGetRootControl, /* 8 */
Tk_MacOSXSetupTkNotifier, /* 9 */
Tk_MacOSXIsAppInFront, /* 10 */
- 0, /* 11 */
- 0, /* 12 */
- 0, /* 13 */
+ Tk_MacOSXGetTkWindow, /* 11 */
+ Tk_MacOSXGetCGContextForDrawable, /* 12 */
+ Tk_MacOSXGetNSWindowForDrawable, /* 13 */
0, /* 14 */
0, /* 15 */
TkGenWMConfigureEvent_, /* 16 */