summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
Diffstat (limited to 'generic')
-rw-r--r--generic/tk.decls23
-rw-r--r--[-rwxr-xr-x]generic/tkBind.c8
-rw-r--r--generic/tkInt.decls22
-rw-r--r--generic/tkIntDecls.h294
-rw-r--r--generic/tkPlatDecls.h52
-rw-r--r--generic/tkStubInit.c171
6 files changed, 163 insertions, 407 deletions
diff --git a/generic/tk.decls b/generic/tk.decls
index c024cdb..2fae0b8 100644
--- a/generic/tk.decls
+++ b/generic/tk.decls
@@ -1026,7 +1026,28 @@ interface tkPlat
################################
# Unix specific functions
-# (none)
+#
+
+declare 0 unix {
+ Window Tk_AttachHWND(Tk_Window tkwin, void *hwnd)
+}
+declare 1 unix {
+ void *Tk_GetHINSTANCE(void)
+}
+declare 2 unix {
+ void *Tk_GetHWND(Window window)
+}
+declare 3 unix {
+ Tk_Window Tk_HWNDToWindow(void *hwnd)
+}
+declare 4 unix {
+ void Tk_PointerEvent(void *hwnd, int x, int y)
+}
+declare 5 unix {
+ int Tk_TranslateWinEvent(void *hwnd,
+ unsigned int message, int wParam, int lParam, int *result)
+}
+
################################
# Windows specific functions
diff --git a/generic/tkBind.c b/generic/tkBind.c
index 79112a0..fc212cb 100755..100644
--- a/generic/tkBind.c
+++ b/generic/tkBind.c
@@ -2428,7 +2428,7 @@ ExpandPercents(winPtr, before, eventPtr, keySym, dsPtr)
string = numStorage;
goto doString;
case 'k':
- if (flags & KEY) {
+ if ((flags & KEY) && (eventPtr->type != MouseWheelEvent)) {
number = eventPtr->xkey.keycode;
goto doNumber;
}
@@ -2567,7 +2567,7 @@ ExpandPercents(winPtr, before, eventPtr, keySym, dsPtr)
/*
* This is used only by the MouseWheel event.
*/
- if (flags & KEY) {
+ if ((flags & KEY) && (eventPtr->type == MouseWheelEvent)) {
number = eventPtr->xkey.keycode;
goto doNumber;
}
@@ -2576,7 +2576,7 @@ ExpandPercents(winPtr, before, eventPtr, keySym, dsPtr)
number = (int) eventPtr->xany.send_event;
goto doNumber;
case 'K':
- if (flags & KEY) {
+ if ((flags & KEY) && (eventPtr->type != MouseWheelEvent)) {
char *name;
name = TkKeysymToString(keySym);
@@ -2586,7 +2586,7 @@ ExpandPercents(winPtr, before, eventPtr, keySym, dsPtr)
}
goto doString;
case 'N':
- if (flags & KEY) {
+ if ((flags & KEY) && (eventPtr->type != MouseWheelEvent)) {
number = (int) keySym;
goto doNumber;
}
diff --git a/generic/tkInt.decls b/generic/tkInt.decls
index 68b8788..3453f88 100644
--- a/generic/tkInt.decls
+++ b/generic/tkInt.decls
@@ -403,26 +403,26 @@ declare 111 {
declare 112 {
void TkpMenuThreadInit(void)
}
-declare 113 {mac aqua win} {
+declare 113 {
void TkClipBox(TkRegion rgn, XRectangle *rect_return)
}
-declare 114 {mac aqua win} {
+declare 114 {
TkRegion TkCreateRegion(void)
}
-declare 115 {mac aqua win} {
+declare 115 {
void TkDestroyRegion(TkRegion rgn)
}
-declare 116 {mac aqua win} {
+declare 116 {
void TkIntersectRegion(TkRegion sra, TkRegion srcb, TkRegion dr_return)
}
-declare 117 {mac aqua win} {
+declare 117 {
int TkRectInRegion(TkRegion rgn, int x, int y, unsigned int width,
unsigned int height)
}
-declare 118 {mac aqua win} {
+declare 118 {
void TkSetRegion(Display *display, GC gc, TkRegion rgn)
}
-declare 119 {mac aqua win} {
+declare 119 {
void TkUnionRectWithRegion(XRectangle *rect,
TkRegion src, TkRegion dr_return)
}
@@ -468,7 +468,7 @@ declare 143 {
declare 144 {
void TkGCCleanup(TkDisplay *dispPtr)
}
-declare 145 {mac win aqua} {
+declare 145 {
void TkSubtractRegion(TkRegion sra, TkRegion srcb, TkRegion dr_return)
}
declare 146 {
@@ -655,6 +655,9 @@ declare 33 win {
declare 34 win {
void TkWinSetHINSTANCE(HINSTANCE hInstance)
}
+declare 35 win {
+ int TkWinGetPlatformTheme(void)
+}
################################
# Mac specific functions
@@ -836,9 +839,6 @@ declare 65 mac {
declare 66 mac {
int TkpIsWindowFloating(WindowRef window)
}
-declare 35 win {
- int TkWinGetPlatformTheme(void)
-}
################################
# Aqua specific functions
diff --git a/generic/tkIntDecls.h b/generic/tkIntDecls.h
index 3654621..23dcda4 100644
--- a/generic/tkIntDecls.h
+++ b/generic/tkIntDecls.h
@@ -362,108 +362,26 @@ EXTERN Tcl_Obj * TkpGetSystemDefault _ANSI_ARGS_((Tk_Window tkwin,
CONST char *dbName, CONST char *className));
/* 112 */
EXTERN void TkpMenuThreadInit _ANSI_ARGS_((void));
-#ifdef __WIN32__
-/* 113 */
-EXTERN void TkClipBox _ANSI_ARGS_((TkRegion rgn,
- XRectangle *rect_return));
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
-/* 113 */
-EXTERN void TkClipBox _ANSI_ARGS_((TkRegion rgn,
- XRectangle *rect_return));
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
/* 113 */
EXTERN void TkClipBox _ANSI_ARGS_((TkRegion rgn,
XRectangle *rect_return));
-#endif /* MAC_OSX_TK */
-#ifdef __WIN32__
-/* 114 */
-EXTERN TkRegion TkCreateRegion _ANSI_ARGS_((void));
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
-/* 114 */
-EXTERN TkRegion TkCreateRegion _ANSI_ARGS_((void));
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
/* 114 */
EXTERN TkRegion TkCreateRegion _ANSI_ARGS_((void));
-#endif /* MAC_OSX_TK */
-#ifdef __WIN32__
-/* 115 */
-EXTERN void TkDestroyRegion _ANSI_ARGS_((TkRegion rgn));
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
/* 115 */
EXTERN void TkDestroyRegion _ANSI_ARGS_((TkRegion rgn));
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
-/* 115 */
-EXTERN void TkDestroyRegion _ANSI_ARGS_((TkRegion rgn));
-#endif /* MAC_OSX_TK */
-#ifdef __WIN32__
-/* 116 */
-EXTERN void TkIntersectRegion _ANSI_ARGS_((TkRegion sra,
- TkRegion srcb, TkRegion dr_return));
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
/* 116 */
EXTERN void TkIntersectRegion _ANSI_ARGS_((TkRegion sra,
TkRegion srcb, TkRegion dr_return));
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
-/* 116 */
-EXTERN void TkIntersectRegion _ANSI_ARGS_((TkRegion sra,
- TkRegion srcb, TkRegion dr_return));
-#endif /* MAC_OSX_TK */
-#ifdef __WIN32__
-/* 117 */
-EXTERN int TkRectInRegion _ANSI_ARGS_((TkRegion rgn, int x,
- int y, unsigned int width,
- unsigned int height));
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
-/* 117 */
-EXTERN int TkRectInRegion _ANSI_ARGS_((TkRegion rgn, int x,
- int y, unsigned int width,
- unsigned int height));
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
/* 117 */
EXTERN int TkRectInRegion _ANSI_ARGS_((TkRegion rgn, int x,
int y, unsigned int width,
unsigned int height));
-#endif /* MAC_OSX_TK */
-#ifdef __WIN32__
-/* 118 */
-EXTERN void TkSetRegion _ANSI_ARGS_((Display *display, GC gc,
- TkRegion rgn));
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
/* 118 */
EXTERN void TkSetRegion _ANSI_ARGS_((Display *display, GC gc,
TkRegion rgn));
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
-/* 118 */
-EXTERN void TkSetRegion _ANSI_ARGS_((Display *display, GC gc,
- TkRegion rgn));
-#endif /* MAC_OSX_TK */
-#ifdef __WIN32__
/* 119 */
EXTERN void TkUnionRectWithRegion _ANSI_ARGS_((XRectangle *rect,
TkRegion src, TkRegion dr_return));
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
-/* 119 */
-EXTERN void TkUnionRectWithRegion _ANSI_ARGS_((XRectangle *rect,
- TkRegion src, TkRegion dr_return));
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
-/* 119 */
-EXTERN void TkUnionRectWithRegion _ANSI_ARGS_((XRectangle *rect,
- TkRegion src, TkRegion dr_return));
-#endif /* MAC_OSX_TK */
/* Slot 120 is reserved */
#ifdef MAC_TCL
/* 121 */
@@ -531,21 +449,9 @@ EXTERN void TkFocusFree _ANSI_ARGS_((TkMainInfo *mainPtr));
EXTERN void TkClipCleanup _ANSI_ARGS_((TkDisplay *dispPtr));
/* 144 */
EXTERN void TkGCCleanup _ANSI_ARGS_((TkDisplay *dispPtr));
-#ifdef __WIN32__
-/* 145 */
-EXTERN void TkSubtractRegion _ANSI_ARGS_((TkRegion sra,
- TkRegion srcb, TkRegion dr_return));
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
-/* 145 */
-EXTERN void TkSubtractRegion _ANSI_ARGS_((TkRegion sra,
- TkRegion srcb, TkRegion dr_return));
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
/* 145 */
EXTERN void TkSubtractRegion _ANSI_ARGS_((TkRegion sra,
TkRegion srcb, TkRegion dr_return));
-#endif /* MAC_OSX_TK */
/* 146 */
EXTERN void TkStylePkgInit _ANSI_ARGS_((TkMainInfo *mainPtr));
/* 147 */
@@ -680,90 +586,13 @@ typedef struct TkIntStubs {
void (*tkpGetSubFonts) _ANSI_ARGS_((Tcl_Interp *interp, Tk_Font tkfont)); /* 110 */
Tcl_Obj * (*tkpGetSystemDefault) _ANSI_ARGS_((Tk_Window tkwin, CONST char *dbName, CONST char *className)); /* 111 */
void (*tkpMenuThreadInit) _ANSI_ARGS_((void)); /* 112 */
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
- VOID *reserved113;
-#endif /* UNIX */
-#ifdef __WIN32__
- void (*tkClipBox) _ANSI_ARGS_((TkRegion rgn, XRectangle *rect_return)); /* 113 */
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
void (*tkClipBox) _ANSI_ARGS_((TkRegion rgn, XRectangle *rect_return)); /* 113 */
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
- void (*tkClipBox) _ANSI_ARGS_((TkRegion rgn, XRectangle *rect_return)); /* 113 */
-#endif /* MAC_OSX_TK */
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
- VOID *reserved114;
-#endif /* UNIX */
-#ifdef __WIN32__
TkRegion (*tkCreateRegion) _ANSI_ARGS_((void)); /* 114 */
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
- TkRegion (*tkCreateRegion) _ANSI_ARGS_((void)); /* 114 */
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
- TkRegion (*tkCreateRegion) _ANSI_ARGS_((void)); /* 114 */
-#endif /* MAC_OSX_TK */
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
- VOID *reserved115;
-#endif /* UNIX */
-#ifdef __WIN32__
void (*tkDestroyRegion) _ANSI_ARGS_((TkRegion rgn)); /* 115 */
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
- void (*tkDestroyRegion) _ANSI_ARGS_((TkRegion rgn)); /* 115 */
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
- void (*tkDestroyRegion) _ANSI_ARGS_((TkRegion rgn)); /* 115 */
-#endif /* MAC_OSX_TK */
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
- VOID *reserved116;
-#endif /* UNIX */
-#ifdef __WIN32__
void (*tkIntersectRegion) _ANSI_ARGS_((TkRegion sra, TkRegion srcb, TkRegion dr_return)); /* 116 */
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
- void (*tkIntersectRegion) _ANSI_ARGS_((TkRegion sra, TkRegion srcb, TkRegion dr_return)); /* 116 */
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
- void (*tkIntersectRegion) _ANSI_ARGS_((TkRegion sra, TkRegion srcb, TkRegion dr_return)); /* 116 */
-#endif /* MAC_OSX_TK */
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
- VOID *reserved117;
-#endif /* UNIX */
-#ifdef __WIN32__
- int (*tkRectInRegion) _ANSI_ARGS_((TkRegion rgn, int x, int y, unsigned int width, unsigned int height)); /* 117 */
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
- int (*tkRectInRegion) _ANSI_ARGS_((TkRegion rgn, int x, int y, unsigned int width, unsigned int height)); /* 117 */
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
int (*tkRectInRegion) _ANSI_ARGS_((TkRegion rgn, int x, int y, unsigned int width, unsigned int height)); /* 117 */
-#endif /* MAC_OSX_TK */
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
- VOID *reserved118;
-#endif /* UNIX */
-#ifdef __WIN32__
- void (*tkSetRegion) _ANSI_ARGS_((Display *display, GC gc, TkRegion rgn)); /* 118 */
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
- void (*tkSetRegion) _ANSI_ARGS_((Display *display, GC gc, TkRegion rgn)); /* 118 */
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
void (*tkSetRegion) _ANSI_ARGS_((Display *display, GC gc, TkRegion rgn)); /* 118 */
-#endif /* MAC_OSX_TK */
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
- VOID *reserved119;
-#endif /* UNIX */
-#ifdef __WIN32__
- void (*tkUnionRectWithRegion) _ANSI_ARGS_((XRectangle *rect, TkRegion src, TkRegion dr_return)); /* 119 */
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
- void (*tkUnionRectWithRegion) _ANSI_ARGS_((XRectangle *rect, TkRegion src, TkRegion dr_return)); /* 119 */
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
void (*tkUnionRectWithRegion) _ANSI_ARGS_((XRectangle *rect, TkRegion src, TkRegion dr_return)); /* 119 */
-#endif /* MAC_OSX_TK */
VOID *reserved120;
#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
VOID *reserved121;
@@ -822,18 +651,7 @@ typedef struct TkIntStubs {
void (*tkFocusFree) _ANSI_ARGS_((TkMainInfo *mainPtr)); /* 142 */
void (*tkClipCleanup) _ANSI_ARGS_((TkDisplay *dispPtr)); /* 143 */
void (*tkGCCleanup) _ANSI_ARGS_((TkDisplay *dispPtr)); /* 144 */
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
- VOID *reserved145;
-#endif /* UNIX */
-#ifdef __WIN32__
- void (*tkSubtractRegion) _ANSI_ARGS_((TkRegion sra, TkRegion srcb, TkRegion dr_return)); /* 145 */
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
void (*tkSubtractRegion) _ANSI_ARGS_((TkRegion sra, TkRegion srcb, TkRegion dr_return)); /* 145 */
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
- void (*tkSubtractRegion) _ANSI_ARGS_((TkRegion sra, TkRegion srcb, TkRegion dr_return)); /* 145 */
-#endif /* MAC_OSX_TK */
void (*tkStylePkgInit) _ANSI_ARGS_((TkMainInfo *mainPtr)); /* 146 */
void (*tkStylePkgFree) _ANSI_ARGS_((TkMainInfo *mainPtr)); /* 147 */
Tk_Window (*tkToplevelWindowForCommand) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *cmdName)); /* 148 */
@@ -1306,132 +1124,34 @@ extern TkIntStubs *tkIntStubsPtr;
#define TkpMenuThreadInit \
(tkIntStubsPtr->tkpMenuThreadInit) /* 112 */
#endif
-#ifdef __WIN32__
-#ifndef TkClipBox
-#define TkClipBox \
- (tkIntStubsPtr->tkClipBox) /* 113 */
-#endif
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
#ifndef TkClipBox
#define TkClipBox \
(tkIntStubsPtr->tkClipBox) /* 113 */
#endif
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
-#ifndef TkClipBox
-#define TkClipBox \
- (tkIntStubsPtr->tkClipBox) /* 113 */
-#endif
-#endif /* MAC_OSX_TK */
-#ifdef __WIN32__
-#ifndef TkCreateRegion
-#define TkCreateRegion \
- (tkIntStubsPtr->tkCreateRegion) /* 114 */
-#endif
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
-#ifndef TkCreateRegion
-#define TkCreateRegion \
- (tkIntStubsPtr->tkCreateRegion) /* 114 */
-#endif
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
#ifndef TkCreateRegion
#define TkCreateRegion \
(tkIntStubsPtr->tkCreateRegion) /* 114 */
#endif
-#endif /* MAC_OSX_TK */
-#ifdef __WIN32__
-#ifndef TkDestroyRegion
-#define TkDestroyRegion \
- (tkIntStubsPtr->tkDestroyRegion) /* 115 */
-#endif
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
-#ifndef TkDestroyRegion
-#define TkDestroyRegion \
- (tkIntStubsPtr->tkDestroyRegion) /* 115 */
-#endif
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
#ifndef TkDestroyRegion
#define TkDestroyRegion \
(tkIntStubsPtr->tkDestroyRegion) /* 115 */
#endif
-#endif /* MAC_OSX_TK */
-#ifdef __WIN32__
-#ifndef TkIntersectRegion
-#define TkIntersectRegion \
- (tkIntStubsPtr->tkIntersectRegion) /* 116 */
-#endif
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
-#ifndef TkIntersectRegion
-#define TkIntersectRegion \
- (tkIntStubsPtr->tkIntersectRegion) /* 116 */
-#endif
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
#ifndef TkIntersectRegion
#define TkIntersectRegion \
(tkIntStubsPtr->tkIntersectRegion) /* 116 */
#endif
-#endif /* MAC_OSX_TK */
-#ifdef __WIN32__
-#ifndef TkRectInRegion
-#define TkRectInRegion \
- (tkIntStubsPtr->tkRectInRegion) /* 117 */
-#endif
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
-#ifndef TkRectInRegion
-#define TkRectInRegion \
- (tkIntStubsPtr->tkRectInRegion) /* 117 */
-#endif
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
#ifndef TkRectInRegion
#define TkRectInRegion \
(tkIntStubsPtr->tkRectInRegion) /* 117 */
#endif
-#endif /* MAC_OSX_TK */
-#ifdef __WIN32__
-#ifndef TkSetRegion
-#define TkSetRegion \
- (tkIntStubsPtr->tkSetRegion) /* 118 */
-#endif
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
#ifndef TkSetRegion
#define TkSetRegion \
(tkIntStubsPtr->tkSetRegion) /* 118 */
#endif
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
-#ifndef TkSetRegion
-#define TkSetRegion \
- (tkIntStubsPtr->tkSetRegion) /* 118 */
-#endif
-#endif /* MAC_OSX_TK */
-#ifdef __WIN32__
-#ifndef TkUnionRectWithRegion
-#define TkUnionRectWithRegion \
- (tkIntStubsPtr->tkUnionRectWithRegion) /* 119 */
-#endif
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
#ifndef TkUnionRectWithRegion
#define TkUnionRectWithRegion \
(tkIntStubsPtr->tkUnionRectWithRegion) /* 119 */
#endif
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
-#ifndef TkUnionRectWithRegion
-#define TkUnionRectWithRegion \
- (tkIntStubsPtr->tkUnionRectWithRegion) /* 119 */
-#endif
-#endif /* MAC_OSX_TK */
/* Slot 120 is reserved */
#ifdef MAC_TCL
#ifndef TkpCreateNativeBitmap
@@ -1520,24 +1240,10 @@ extern TkIntStubs *tkIntStubsPtr;
#define TkGCCleanup \
(tkIntStubsPtr->tkGCCleanup) /* 144 */
#endif
-#ifdef __WIN32__
#ifndef TkSubtractRegion
#define TkSubtractRegion \
(tkIntStubsPtr->tkSubtractRegion) /* 145 */
#endif
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
-#ifndef TkSubtractRegion
-#define TkSubtractRegion \
- (tkIntStubsPtr->tkSubtractRegion) /* 145 */
-#endif
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
-#ifndef TkSubtractRegion
-#define TkSubtractRegion \
- (tkIntStubsPtr->tkSubtractRegion) /* 145 */
-#endif
-#endif /* MAC_OSX_TK */
#ifndef TkStylePkgInit
#define TkStylePkgInit \
(tkIntStubsPtr->tkStylePkgInit) /* 146 */
diff --git a/generic/tkPlatDecls.h b/generic/tkPlatDecls.h
index ecc5919..f9bce86 100644
--- a/generic/tkPlatDecls.h
+++ b/generic/tkPlatDecls.h
@@ -29,6 +29,24 @@
* Exported function declarations:
*/
+#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
+/* 0 */
+EXTERN Window Tk_AttachHWND _ANSI_ARGS_((Tk_Window tkwin,
+ VOID *hwnd));
+/* 1 */
+EXTERN VOID * Tk_GetHINSTANCE _ANSI_ARGS_((void));
+/* 2 */
+EXTERN VOID * Tk_GetHWND _ANSI_ARGS_((Window window));
+/* 3 */
+EXTERN Tk_Window Tk_HWNDToWindow _ANSI_ARGS_((VOID *hwnd));
+/* 4 */
+EXTERN void Tk_PointerEvent _ANSI_ARGS_((VOID *hwnd, int x,
+ int y));
+/* 5 */
+EXTERN int Tk_TranslateWinEvent _ANSI_ARGS_((VOID *hwnd,
+ unsigned int message, int wParam, int lParam,
+ int *result));
+#endif /* UNIX */
#ifdef __WIN32__
/* 0 */
EXTERN Window Tk_AttachHWND _ANSI_ARGS_((Tk_Window tkwin,
@@ -117,6 +135,14 @@ typedef struct TkPlatStubs {
int magic;
struct TkPlatStubHooks *hooks;
+#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
+ Window (*tk_AttachHWND) _ANSI_ARGS_((Tk_Window tkwin, VOID *hwnd)); /* 0 */
+ VOID * (*tk_GetHINSTANCE) _ANSI_ARGS_((void)); /* 1 */
+ VOID * (*tk_GetHWND) _ANSI_ARGS_((Window window)); /* 2 */
+ Tk_Window (*tk_HWNDToWindow) _ANSI_ARGS_((VOID *hwnd)); /* 3 */
+ void (*tk_PointerEvent) _ANSI_ARGS_((VOID *hwnd, int x, int y)); /* 4 */
+ int (*tk_TranslateWinEvent) _ANSI_ARGS_((VOID *hwnd, unsigned int message, int wParam, int lParam, int *result)); /* 5 */
+#endif /* UNIX */
#ifdef __WIN32__
Window (*tk_AttachHWND) _ANSI_ARGS_((Tk_Window tkwin, HWND hwnd)); /* 0 */
HINSTANCE (*tk_GetHINSTANCE) _ANSI_ARGS_((void)); /* 1 */
@@ -167,6 +193,32 @@ extern TkPlatStubs *tkPlatStubsPtr;
* Inline function declarations:
*/
+#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
+#ifndef Tk_AttachHWND
+#define Tk_AttachHWND \
+ (tkPlatStubsPtr->tk_AttachHWND) /* 0 */
+#endif
+#ifndef Tk_GetHINSTANCE
+#define Tk_GetHINSTANCE \
+ (tkPlatStubsPtr->tk_GetHINSTANCE) /* 1 */
+#endif
+#ifndef Tk_GetHWND
+#define Tk_GetHWND \
+ (tkPlatStubsPtr->tk_GetHWND) /* 2 */
+#endif
+#ifndef Tk_HWNDToWindow
+#define Tk_HWNDToWindow \
+ (tkPlatStubsPtr->tk_HWNDToWindow) /* 3 */
+#endif
+#ifndef Tk_PointerEvent
+#define Tk_PointerEvent \
+ (tkPlatStubsPtr->tk_PointerEvent) /* 4 */
+#endif
+#ifndef Tk_TranslateWinEvent
+#define Tk_TranslateWinEvent \
+ (tkPlatStubsPtr->tk_TranslateWinEvent) /* 5 */
+#endif
+#endif /* UNIX */
#ifdef __WIN32__
#ifndef Tk_AttachHWND
#define Tk_AttachHWND \
diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c
index a82e044..22334bc 100644
--- a/generic/tkStubInit.c
+++ b/generic/tkStubInit.c
@@ -40,17 +40,74 @@
/*
* Remove macros that will interfere with the definitions below.
*/
-
-#define Tk_CreateCanvasVisitor ((void (*) _ANSI_ARGS_((Tcl_Interp * interp, \
- VOID * typePtr))) NULL)
-#define Tk_GetCanvasVisitor ((VOID * (*) _ANSI_ARGS_((Tcl_Interp * interp, \
- CONST char * name))) NULL)
+#undef TkClipBox
+#undef TkCreateRegion
+#undef TkDestroyRegion
+#undef TkIntersectRegion
+#undef TkRectInRegion
+#undef TkSetRegion
+#undef TkUnionRectWithRegion
+#undef TkSubtractRegion
+#undef TkPutImage
#ifndef __WIN32__
-/* Make sure that extensions which call XParseColor through
- * the stub table, call TkParseColor in stead. See bug #3486474 */
-# define XParseColor TkParseColor
-#endif
+/*
+ * Make sure that extensions which call XParseColor through the stub
+ * table, call TkParseColor instead. [Bug 3486474]
+ */
+# define XParseColor TkParseColor
+
+# ifndef __CYGWIN__
+# define Tk_AttachHWND 0
+# define Tk_GetHWND 0
+# define Tk_HWNDToWindow 0
+# define Tk_PointerEvent 0
+# define Tk_TranslateWinEvent 0
+# define Tk_GetHINSTANCE 0
+# endif
+# if !defined(MAC_TCL) && !defined(MAC_OSX_TCL)
+# define TkClipBox (void (*) _ANSI_ARGS_((TkRegion, XRectangle *))) XClipBox
+# define TkCreateRegion (TkRegion (*) ()) XCreateRegion
+# define TkDestroyRegion (void (*) _ANSI_ARGS_((TkRegion))) XDestroyRegion
+# define TkIntersectRegion (void (*) _ANSI_ARGS_((TkRegion, TkRegion, TkRegion))) XIntersectRegion
+# define TkRectInRegion (int (*) _ANSI_ARGS_((TkRegion, int, int, unsigned int, unsigned int))) XRectInRegion
+# define TkSetRegion (void (*) _ANSI_ARGS_((Display *, GC, TkRegion))) XSetRegion
+# define TkUnionRectWithRegion (void (*) _ANSI_ARGS_((XRectangle *, TkRegion, TkRegion))) XUnionRectWithRegion
+# define TkSubtractRegion (void (*) _ANSI_ARGS_((TkRegion, TkRegion, TkRegion))) XSubtractRegion
+
+# ifdef __CYGWIN__
+# define Tk_GetHINSTANCE TkPlatGetHINSTANCE
+# define GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS 0x00000004
+
+/*
+ * Trick, so we don't have to include <windows.h> here, which in any
+ * case lacks this function anyway.
+ */
+
+int __stdcall GetModuleHandleExW(unsigned int, const char *, void *);
+
+TkIntStubs tkIntStubs;
+
+static void *Tk_GetHINSTANCE()
+{
+ void *hInstance = NULL;
+
+ GetModuleHandleExW(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS,
+ (const char *) &tkIntStubs, &hInstance);
+ return hInstance;
+}
+ /* TODO: To be implemented for Cygwin */
+# define Tk_AttachHWND 0
+# define Tk_GetHWND 0
+# define Tk_HWNDToWindow 0
+# define Tk_PointerEvent 0
+# define Tk_TranslateWinEvent 0
+
+# else /* !__CYGWIN__ */
+# define TkPutImage 0
+# endif /* __CYGWIN__ */
+# endif /* !MAC_TCL && !MACC_OSX_TCL */
+#endif /* !__WIN32__ */
/*
* WARNING: The contents of this file is automatically generated by the
@@ -176,90 +233,13 @@ TkIntStubs tkIntStubs = {
TkpGetSubFonts, /* 110 */
TkpGetSystemDefault, /* 111 */
TkpMenuThreadInit, /* 112 */
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
- NULL, /* 113 */
-#endif /* UNIX */
-#ifdef __WIN32__
- TkClipBox, /* 113 */
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
TkClipBox, /* 113 */
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
- TkClipBox, /* 113 */
-#endif /* MAC_OSX_TK */
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
- NULL, /* 114 */
-#endif /* UNIX */
-#ifdef __WIN32__
- TkCreateRegion, /* 114 */
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
- TkCreateRegion, /* 114 */
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
TkCreateRegion, /* 114 */
-#endif /* MAC_OSX_TK */
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
- NULL, /* 115 */
-#endif /* UNIX */
-#ifdef __WIN32__
TkDestroyRegion, /* 115 */
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
- TkDestroyRegion, /* 115 */
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
- TkDestroyRegion, /* 115 */
-#endif /* MAC_OSX_TK */
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
- NULL, /* 116 */
-#endif /* UNIX */
-#ifdef __WIN32__
- TkIntersectRegion, /* 116 */
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
- TkIntersectRegion, /* 116 */
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
TkIntersectRegion, /* 116 */
-#endif /* MAC_OSX_TK */
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
- NULL, /* 117 */
-#endif /* UNIX */
-#ifdef __WIN32__
TkRectInRegion, /* 117 */
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
- TkRectInRegion, /* 117 */
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
- TkRectInRegion, /* 117 */
-#endif /* MAC_OSX_TK */
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
- NULL, /* 118 */
-#endif /* UNIX */
-#ifdef __WIN32__
TkSetRegion, /* 118 */
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
- TkSetRegion, /* 118 */
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
- TkSetRegion, /* 118 */
-#endif /* MAC_OSX_TK */
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
- NULL, /* 119 */
-#endif /* UNIX */
-#ifdef __WIN32__
TkUnionRectWithRegion, /* 119 */
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
- TkUnionRectWithRegion, /* 119 */
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
- TkUnionRectWithRegion, /* 119 */
-#endif /* MAC_OSX_TK */
NULL, /* 120 */
#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
NULL, /* 121 */
@@ -318,18 +298,7 @@ TkIntStubs tkIntStubs = {
TkFocusFree, /* 142 */
TkClipCleanup, /* 143 */
TkGCCleanup, /* 144 */
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
- NULL, /* 145 */
-#endif /* UNIX */
-#ifdef __WIN32__
- TkSubtractRegion, /* 145 */
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
TkSubtractRegion, /* 145 */
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
- TkSubtractRegion, /* 145 */
-#endif /* MAC_OSX_TK */
TkStylePkgInit, /* 146 */
TkStylePkgFree, /* 147 */
TkToplevelWindowForCommand, /* 148 */
@@ -826,6 +795,14 @@ TkIntXlibStubs tkIntXlibStubs = {
TkPlatStubs tkPlatStubs = {
TCL_STUB_MAGIC,
NULL,
+#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
+ Tk_AttachHWND, /* 0 */
+ Tk_GetHINSTANCE, /* 1 */
+ Tk_GetHWND, /* 2 */
+ Tk_HWNDToWindow, /* 3 */
+ Tk_PointerEvent, /* 4 */
+ Tk_TranslateWinEvent, /* 5 */
+#endif /* UNIX */
#ifdef __WIN32__
Tk_AttachHWND, /* 0 */
Tk_GetHINSTANCE, /* 1 */