diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-05-16 04:43:33 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-05-16 04:43:33 (GMT) |
commit | c29a2d58d9c3de29bcd7e88011aea2b9c1bcd92e (patch) | |
tree | 3226d16f16893c081407f46d5428da95599d1df2 | |
parent | 20eb2bdf3b3b8c32a82eded717c2383cf1746e46 (diff) | |
parent | 524f59a75aab742a5ce54b6497bec8e3bda8dced (diff) | |
download | tk-c29a2d58d9c3de29bcd7e88011aea2b9c1bcd92e.zip tk-c29a2d58d9c3de29bcd7e88011aea2b9c1bcd92e.tar.gz tk-c29a2d58d9c3de29bcd7e88011aea2b9c1bcd92e.tar.bz2 |
implement TkSetPixmapColormap and TkpPrintWindowId for cygwin
-rw-r--r-- | generic/tk.decls | 25 | ||||
-rw-r--r-- | generic/tkGrab.c | 4 | ||||
-rw-r--r-- | generic/tkInt.decls | 44 | ||||
-rw-r--r-- | generic/tkIntPlatDecls.h | 149 | ||||
-rw-r--r-- | generic/tkPlatDecls.h | 162 | ||||
-rw-r--r-- | generic/tkStubInit.c | 159 | ||||
-rw-r--r-- | generic/tkWindow.c | 4 | ||||
-rw-r--r-- | generic/ttk/ttkGenStubs.tcl | 1 | ||||
-rw-r--r-- | unix/Makefile.in | 5 | ||||
-rw-r--r-- | unix/tkUnixPort.h | 5 | ||||
-rw-r--r-- | win/tkWinPort.h | 4 |
11 files changed, 367 insertions, 195 deletions
diff --git a/generic/tk.decls b/generic/tk.decls index 7960d0c..f08f2ef 100644 --- a/generic/tk.decls +++ b/generic/tk.decls @@ -1074,31 +1074,6 @@ declare 273 { interface tkPlat ################################ -# Unix specific functions -# - -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 declare 0 win { diff --git a/generic/tkGrab.c b/generic/tkGrab.c index 57f8614..44a4f8c 100644 --- a/generic/tkGrab.c +++ b/generic/tkGrab.c @@ -12,7 +12,9 @@ #include "tkInt.h" -#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) +#ifdef __WIN32__ +#include "tkWinInt.h" +#elif !(defined(__WIN32__) || defined(MAC_OSX_TK)) #include "tkUnixInt.h" #endif diff --git a/generic/tkInt.decls b/generic/tkInt.decls index fc384a1..b18f6f1 100644 --- a/generic/tkInt.decls +++ b/generic/tkInt.decls @@ -743,13 +743,53 @@ declare 35 win { int TkWinGetPlatformTheme(void) } -# Exported through stub table since Tk 8.5.9 +# Exported through stub table since Tk 8.4.20/8.5.9 declare 36 win { - LRESULT CALLBACK TkWinChildProc(HWND hwnd, + LRESULT __stdcall TkWinChildProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) } +# new for 8.4.20+, Cygwin only +declare 37 win { + void TkCreateXEventSource(void) +} +declare 38 win { + void TkFreeWindowId(TkDisplay *dispPtr, Window w) +} +declare 39 win { + void TkInitXId(TkDisplay *dispPtr) +} +declare 40 win { + int TkpCmapStressed(Tk_Window tkwin, Colormap colormap) +} +declare 41 win { + void TkpSync(Display *display) +} +declare 42 win { + Window TkUnixContainerId(TkWindow *winPtr) +} +declare 43 win { + int TkUnixDoOneXEvent(Tcl_Time *timePtr) +} +declare 44 win { + void TkUnixSetMenubar(Tk_Window tkwin, Tk_Window menubar) +} +declare 45 win { + void TkWmCleanup(TkDisplay *dispPtr) +} +declare 46 win { + void TkSendCleanup(TkDisplay *dispPtr) +} +declare 47 win { + void TkFreeXId(TkDisplay *dispPtr) +} +# only needed by tktest: +declare 48 win { + int TkpTestsendCmd(ClientData clientData, Tcl_Interp *interp, int argc, + const char **argv) +} + ################################ # Aqua specific functions diff --git a/generic/tkIntPlatDecls.h b/generic/tkIntPlatDecls.h index cee7450..021be8e 100644 --- a/generic/tkIntPlatDecls.h +++ b/generic/tkIntPlatDecls.h @@ -30,7 +30,7 @@ * Exported function declarations: */ -#ifdef __WIN32__ /* WIN */ +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ #ifndef TkAlignImageData_TCL_DECLARED #define TkAlignImageData_TCL_DECLARED /* 0 */ @@ -223,9 +223,71 @@ EXTERN int TkWinGetPlatformTheme(void); #ifndef TkWinChildProc_TCL_DECLARED #define TkWinChildProc_TCL_DECLARED /* 36 */ -EXTERN LRESULT CALLBACK TkWinChildProc(HWND hwnd, UINT message, +EXTERN LRESULT __stdcall TkWinChildProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); #endif +#ifndef TkCreateXEventSource_TCL_DECLARED +#define TkCreateXEventSource_TCL_DECLARED +/* 37 */ +EXTERN void TkCreateXEventSource(void); +#endif +#ifndef TkFreeWindowId_TCL_DECLARED +#define TkFreeWindowId_TCL_DECLARED +/* 38 */ +EXTERN void TkFreeWindowId(TkDisplay *dispPtr, Window w); +#endif +#ifndef TkInitXId_TCL_DECLARED +#define TkInitXId_TCL_DECLARED +/* 39 */ +EXTERN void TkInitXId(TkDisplay *dispPtr); +#endif +#ifndef TkpCmapStressed_TCL_DECLARED +#define TkpCmapStressed_TCL_DECLARED +/* 40 */ +EXTERN int TkpCmapStressed(Tk_Window tkwin, Colormap colormap); +#endif +#ifndef TkpSync_TCL_DECLARED +#define TkpSync_TCL_DECLARED +/* 41 */ +EXTERN void TkpSync(Display *display); +#endif +#ifndef TkUnixContainerId_TCL_DECLARED +#define TkUnixContainerId_TCL_DECLARED +/* 42 */ +EXTERN Window TkUnixContainerId(TkWindow *winPtr); +#endif +#ifndef TkUnixDoOneXEvent_TCL_DECLARED +#define TkUnixDoOneXEvent_TCL_DECLARED +/* 43 */ +EXTERN int TkUnixDoOneXEvent(Tcl_Time *timePtr); +#endif +#ifndef TkUnixSetMenubar_TCL_DECLARED +#define TkUnixSetMenubar_TCL_DECLARED +/* 44 */ +EXTERN void TkUnixSetMenubar(Tk_Window tkwin, Tk_Window menubar); +#endif +#ifndef TkWmCleanup_TCL_DECLARED +#define TkWmCleanup_TCL_DECLARED +/* 45 */ +EXTERN void TkWmCleanup(TkDisplay *dispPtr); +#endif +#ifndef TkSendCleanup_TCL_DECLARED +#define TkSendCleanup_TCL_DECLARED +/* 46 */ +EXTERN void TkSendCleanup(TkDisplay *dispPtr); +#endif +#ifndef TkFreeXId_TCL_DECLARED +#define TkFreeXId_TCL_DECLARED +/* 47 */ +EXTERN void TkFreeXId(TkDisplay *dispPtr); +#endif +#ifndef TkpTestsendCmd_TCL_DECLARED +#define TkpTestsendCmd_TCL_DECLARED +/* 48 */ +EXTERN int TkpTestsendCmd(ClientData clientData, + Tcl_Interp *interp, int argc, + CONST char **argv); +#endif #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ #ifndef TkGenerateActivateEvents_TCL_DECLARED @@ -478,7 +540,7 @@ EXTERN void TkGenWMDestroyEvent(Tk_Window tkwin); EXTERN unsigned long TkpGetMS(void); #endif #endif /* AQUA */ -#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */ +#if !(defined(__WIN32__) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */ #ifndef TkCreateXEventSource_TCL_DECLARED #define TkCreateXEventSource_TCL_DECLARED /* 0 */ @@ -558,7 +620,7 @@ typedef struct TkIntPlatStubs { int magic; struct TkIntPlatStubHooks *hooks; -#ifdef __WIN32__ /* WIN */ +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ char * (*tkAlignImageData) (XImage *image, int alignment, int bitOrder); /* 0 */ VOID *reserved1; void (*tkGenerateActivateEvents) (TkWindow *winPtr, int active); /* 2 */ @@ -595,7 +657,19 @@ typedef struct TkIntPlatStubs { int (*tkWinGetPlatformId) (void); /* 33 */ void (*tkWinSetHINSTANCE) (HINSTANCE hInstance); /* 34 */ int (*tkWinGetPlatformTheme) (void); /* 35 */ - LRESULT (CALLBACK *tkWinChildProc) (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); /* 36 */ + LRESULT (__stdcall *tkWinChildProc) (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); /* 36 */ + void (*tkCreateXEventSource) (void); /* 37 */ + void (*tkFreeWindowId) (TkDisplay *dispPtr, Window w); /* 38 */ + void (*tkInitXId) (TkDisplay *dispPtr); /* 39 */ + int (*tkpCmapStressed) (Tk_Window tkwin, Colormap colormap); /* 40 */ + void (*tkpSync) (Display *display); /* 41 */ + Window (*tkUnixContainerId) (TkWindow *winPtr); /* 42 */ + int (*tkUnixDoOneXEvent) (Tcl_Time *timePtr); /* 43 */ + void (*tkUnixSetMenubar) (Tk_Window tkwin, Tk_Window menubar); /* 44 */ + void (*tkWmCleanup) (TkDisplay *dispPtr); /* 45 */ + void (*tkSendCleanup) (TkDisplay *dispPtr); /* 46 */ + void (*tkFreeXId) (TkDisplay *dispPtr); /* 47 */ + int (*tkpTestsendCmd) (ClientData clientData, Tcl_Interp *interp, int argc, CONST char **argv); /* 48 */ #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ void (*tkGenerateActivateEvents) (TkWindow *winPtr, int active); /* 0 */ @@ -653,7 +727,7 @@ typedef struct TkIntPlatStubs { VOID *reserved52; unsigned long (*tkpGetMS) (void); /* 53 */ #endif /* AQUA */ -#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */ +#if !(defined(__WIN32__) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */ void (*tkCreateXEventSource) (void); /* 0 */ void (*tkFreeWindowId) (TkDisplay *dispPtr, Window w); /* 1 */ void (*tkInitXId) (TkDisplay *dispPtr); /* 2 */ @@ -685,7 +759,7 @@ extern TkIntPlatStubs *tkIntPlatStubsPtr; * Inline function declarations: */ -#ifdef __WIN32__ /* WIN */ +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ #ifndef TkAlignImageData #define TkAlignImageData \ (tkIntPlatStubsPtr->tkAlignImageData) /* 0 */ @@ -831,6 +905,54 @@ extern TkIntPlatStubs *tkIntPlatStubsPtr; #define TkWinChildProc \ (tkIntPlatStubsPtr->tkWinChildProc) /* 36 */ #endif +#ifndef TkCreateXEventSource +#define TkCreateXEventSource \ + (tkIntPlatStubsPtr->tkCreateXEventSource) /* 37 */ +#endif +#ifndef TkFreeWindowId +#define TkFreeWindowId \ + (tkIntPlatStubsPtr->tkFreeWindowId) /* 38 */ +#endif +#ifndef TkInitXId +#define TkInitXId \ + (tkIntPlatStubsPtr->tkInitXId) /* 39 */ +#endif +#ifndef TkpCmapStressed +#define TkpCmapStressed \ + (tkIntPlatStubsPtr->tkpCmapStressed) /* 40 */ +#endif +#ifndef TkpSync +#define TkpSync \ + (tkIntPlatStubsPtr->tkpSync) /* 41 */ +#endif +#ifndef TkUnixContainerId +#define TkUnixContainerId \ + (tkIntPlatStubsPtr->tkUnixContainerId) /* 42 */ +#endif +#ifndef TkUnixDoOneXEvent +#define TkUnixDoOneXEvent \ + (tkIntPlatStubsPtr->tkUnixDoOneXEvent) /* 43 */ +#endif +#ifndef TkUnixSetMenubar +#define TkUnixSetMenubar \ + (tkIntPlatStubsPtr->tkUnixSetMenubar) /* 44 */ +#endif +#ifndef TkWmCleanup +#define TkWmCleanup \ + (tkIntPlatStubsPtr->tkWmCleanup) /* 45 */ +#endif +#ifndef TkSendCleanup +#define TkSendCleanup \ + (tkIntPlatStubsPtr->tkSendCleanup) /* 46 */ +#endif +#ifndef TkFreeXId +#define TkFreeXId \ + (tkIntPlatStubsPtr->tkFreeXId) /* 47 */ +#endif +#ifndef TkpTestsendCmd +#define TkpTestsendCmd \ + (tkIntPlatStubsPtr->tkpTestsendCmd) /* 48 */ +#endif #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ #ifndef TkGenerateActivateEvents @@ -1026,7 +1148,7 @@ extern TkIntPlatStubs *tkIntPlatStubsPtr; (tkIntPlatStubsPtr->tkpGetMS) /* 53 */ #endif #endif /* AQUA */ -#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */ +#if !(defined(__WIN32__) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */ #ifndef TkCreateXEventSource #define TkCreateXEventSource \ (tkIntPlatStubsPtr->tkCreateXEventSource) /* 0 */ @@ -1092,4 +1214,15 @@ extern TkIntPlatStubs *tkIntPlatStubsPtr; #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLIMPORT +#ifdef __WIN32__ +#undef TkFreeWindowId +#undef TkInitXId +#undef TkpCmapStressed +#undef TkpSync +#define TkFreeWindowId(dispPtr,w) +#define TkInitXId(dispPtr) +#define TkpCmapStressed(tkwin,colormap) (0) +#define TkpSync(display) +#endif + #endif /* _TKINTPLATDECLS */ diff --git a/generic/tkPlatDecls.h b/generic/tkPlatDecls.h index c7584c7..5b386ee 100644 --- a/generic/tkPlatDecls.h +++ b/generic/tkPlatDecls.h @@ -29,40 +29,6 @@ * Exported function declarations: */ -#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */ -#ifndef Tk_AttachHWND_TCL_DECLARED -#define Tk_AttachHWND_TCL_DECLARED -/* 0 */ -EXTERN Window Tk_AttachHWND(Tk_Window tkwin, VOID *hwnd); -#endif -#ifndef Tk_GetHINSTANCE_TCL_DECLARED -#define Tk_GetHINSTANCE_TCL_DECLARED -/* 1 */ -EXTERN VOID * Tk_GetHINSTANCE(void); -#endif -#ifndef Tk_GetHWND_TCL_DECLARED -#define Tk_GetHWND_TCL_DECLARED -/* 2 */ -EXTERN VOID * Tk_GetHWND(Window window); -#endif -#ifndef Tk_HWNDToWindow_TCL_DECLARED -#define Tk_HWNDToWindow_TCL_DECLARED -/* 3 */ -EXTERN Tk_Window Tk_HWNDToWindow(VOID *hwnd); -#endif -#ifndef Tk_PointerEvent_TCL_DECLARED -#define Tk_PointerEvent_TCL_DECLARED -/* 4 */ -EXTERN void Tk_PointerEvent(VOID *hwnd, int x, int y); -#endif -#ifndef Tk_TranslateWinEvent_TCL_DECLARED -#define Tk_TranslateWinEvent_TCL_DECLARED -/* 5 */ -EXTERN int Tk_TranslateWinEvent(VOID *hwnd, - unsigned int message, int wParam, int lParam, - int *result); -#endif -#endif /* UNIX */ #ifdef __WIN32__ /* WIN */ #ifndef Tk_AttachHWND_TCL_DECLARED #define Tk_AttachHWND_TCL_DECLARED @@ -98,37 +64,41 @@ EXTERN int Tk_TranslateWinEvent(HWND hwnd, UINT message, #endif #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ -#ifndef Tk_AttachHWND_TCL_DECLARED -#define Tk_AttachHWND_TCL_DECLARED +#ifndef Tk_MacOSXSetEmbedHandler_TCL_DECLARED +#define Tk_MacOSXSetEmbedHandler_TCL_DECLARED /* 0 */ -EXTERN Window Tk_AttachHWND(Tk_Window tkwin, VOID *hwnd); -#endif -#ifndef Tk_GetHINSTANCE_TCL_DECLARED -#define Tk_GetHINSTANCE_TCL_DECLARED +EXTERN void Tk_MacOSXSetEmbedHandler( + Tk_MacOSXEmbedRegisterWinProc *registerWinProcPtr, + Tk_MacOSXEmbedGetGrafPortProc *getPortProcPtr, + Tk_MacOSXEmbedMakeContainerExistProc *containerExistProcPtr, + Tk_MacOSXEmbedGetClipProc *getClipProc, + Tk_MacOSXEmbedGetOffsetInParentProc *getOffsetProc); +#endif +#ifndef Tk_MacOSXTurnOffMenus_TCL_DECLARED +#define Tk_MacOSXTurnOffMenus_TCL_DECLARED /* 1 */ -EXTERN VOID * Tk_GetHINSTANCE(void); +EXTERN void Tk_MacOSXTurnOffMenus(void); #endif -#ifndef Tk_GetHWND_TCL_DECLARED -#define Tk_GetHWND_TCL_DECLARED +#ifndef Tk_MacOSXTkOwnsCursor_TCL_DECLARED +#define Tk_MacOSXTkOwnsCursor_TCL_DECLARED /* 2 */ -EXTERN VOID * Tk_GetHWND(Window window); +EXTERN void Tk_MacOSXTkOwnsCursor(int tkOwnsIt); #endif -#ifndef Tk_HWNDToWindow_TCL_DECLARED -#define Tk_HWNDToWindow_TCL_DECLARED +#ifndef TkMacOSXInitMenus_TCL_DECLARED +#define TkMacOSXInitMenus_TCL_DECLARED /* 3 */ -EXTERN Tk_Window Tk_HWNDToWindow(VOID *hwnd); +EXTERN void TkMacOSXInitMenus(Tcl_Interp *interp); #endif -#ifndef Tk_PointerEvent_TCL_DECLARED -#define Tk_PointerEvent_TCL_DECLARED +#ifndef TkMacOSXInitAppleEvents_TCL_DECLARED +#define TkMacOSXInitAppleEvents_TCL_DECLARED /* 4 */ -EXTERN void Tk_PointerEvent(VOID *hwnd, int x, int y); +EXTERN void TkMacOSXInitAppleEvents(Tcl_Interp *interp); #endif -#ifndef Tk_TranslateWinEvent_TCL_DECLARED -#define Tk_TranslateWinEvent_TCL_DECLARED +#ifndef TkGenWMConfigureEvent_TCL_DECLARED +#define TkGenWMConfigureEvent_TCL_DECLARED /* 5 */ -EXTERN int Tk_TranslateWinEvent(VOID *hwnd, - unsigned int message, int wParam, int lParam, - int *result); +EXTERN void TkGenWMConfigureEvent(Tk_Window tkwin, int x, int y, + int width, int height, int flags); #endif #ifndef TkMacOSXInvalClipRgns_TCL_DECLARED #define TkMacOSXInvalClipRgns_TCL_DECLARED @@ -161,14 +131,6 @@ typedef struct TkPlatStubs { int magic; struct TkPlatStubHooks *hooks; -#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */ - Window (*tk_AttachHWND) (Tk_Window tkwin, VOID *hwnd); /* 0 */ - VOID * (*tk_GetHINSTANCE) (void); /* 1 */ - VOID * (*tk_GetHWND) (Window window); /* 2 */ - Tk_Window (*tk_HWNDToWindow) (VOID *hwnd); /* 3 */ - void (*tk_PointerEvent) (VOID *hwnd, int x, int y); /* 4 */ - int (*tk_TranslateWinEvent) (VOID *hwnd, unsigned int message, int wParam, int lParam, int *result); /* 5 */ -#endif /* UNIX */ #ifdef __WIN32__ /* WIN */ Window (*tk_AttachHWND) (Tk_Window tkwin, HWND hwnd); /* 0 */ HINSTANCE (*tk_GetHINSTANCE) (void); /* 1 */ @@ -178,12 +140,12 @@ typedef struct TkPlatStubs { int (*tk_TranslateWinEvent) (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, LRESULT *result); /* 5 */ #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ - Window (*tk_AttachHWND) (Tk_Window tkwin, VOID *hwnd); /* 0 */ - VOID * (*tk_GetHINSTANCE) (void); /* 1 */ - VOID * (*tk_GetHWND) (Window window); /* 2 */ - Tk_Window (*tk_HWNDToWindow) (VOID *hwnd); /* 3 */ - void (*tk_PointerEvent) (VOID *hwnd, int x, int y); /* 4 */ - int (*tk_TranslateWinEvent) (VOID *hwnd, unsigned int message, int wParam, int lParam, int *result); /* 5 */ + 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 (*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 */ void (*tkMacOSXInvalClipRgns) (Tk_Window tkwin); /* 6 */ GWorldPtr (*tkMacOSXGetDrawablePort) (Drawable drawable); /* 7 */ ControlRef (*tkMacOSXGetRootControl) (Drawable drawable); /* 8 */ @@ -206,32 +168,6 @@ extern TkPlatStubs *tkPlatStubsPtr; * Inline function declarations: */ -#if !defined(__WIN32__) && !defined(MAC_OSX_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__ /* WIN */ #ifndef Tk_AttachHWND #define Tk_AttachHWND \ @@ -259,29 +195,29 @@ extern TkPlatStubs *tkPlatStubsPtr; #endif #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ -#ifndef Tk_AttachHWND -#define Tk_AttachHWND \ - (tkPlatStubsPtr->tk_AttachHWND) /* 0 */ +#ifndef Tk_MacOSXSetEmbedHandler +#define Tk_MacOSXSetEmbedHandler \ + (tkPlatStubsPtr->tk_MacOSXSetEmbedHandler) /* 0 */ #endif -#ifndef Tk_GetHINSTANCE -#define Tk_GetHINSTANCE \ - (tkPlatStubsPtr->tk_GetHINSTANCE) /* 1 */ +#ifndef Tk_MacOSXTurnOffMenus +#define Tk_MacOSXTurnOffMenus \ + (tkPlatStubsPtr->tk_MacOSXTurnOffMenus) /* 1 */ #endif -#ifndef Tk_GetHWND -#define Tk_GetHWND \ - (tkPlatStubsPtr->tk_GetHWND) /* 2 */ +#ifndef Tk_MacOSXTkOwnsCursor +#define Tk_MacOSXTkOwnsCursor \ + (tkPlatStubsPtr->tk_MacOSXTkOwnsCursor) /* 2 */ #endif -#ifndef Tk_HWNDToWindow -#define Tk_HWNDToWindow \ - (tkPlatStubsPtr->tk_HWNDToWindow) /* 3 */ +#ifndef TkMacOSXInitMenus +#define TkMacOSXInitMenus \ + (tkPlatStubsPtr->tkMacOSXInitMenus) /* 3 */ #endif -#ifndef Tk_PointerEvent -#define Tk_PointerEvent \ - (tkPlatStubsPtr->tk_PointerEvent) /* 4 */ +#ifndef TkMacOSXInitAppleEvents +#define TkMacOSXInitAppleEvents \ + (tkPlatStubsPtr->tkMacOSXInitAppleEvents) /* 4 */ #endif -#ifndef Tk_TranslateWinEvent -#define Tk_TranslateWinEvent \ - (tkPlatStubsPtr->tk_TranslateWinEvent) /* 5 */ +#ifndef TkGenWMConfigureEvent +#define TkGenWMConfigureEvent \ + (tkPlatStubsPtr->tkGenWMConfigureEvent) /* 5 */ #endif #ifndef TkMacOSXInvalClipRgns #define TkMacOSXInvalClipRgns \ diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c index 02038a8..63250c5 100644 --- a/generic/tkStubInit.c +++ b/generic/tkStubInit.c @@ -30,6 +30,37 @@ #include "tkPlatDecls.h" #include "tkIntXlibDecls.h" +#ifdef __WIN32__ + +static int +doNothing(void) +{ + /* dummy implementation, no need to do anything */ + return 0; +} + +/* + * Remove macros that will interfere with the definitions below. + */ +# undef TkFreeWindowId +# undef TkInitXId +# undef TkpCmapStressed +# undef TkpSync + +# define TkCreateXEventSource (void (*) (void)) doNothing +# define TkFreeWindowId (void (*) (TkDisplay *, Window)) doNothing +# define TkInitXId (void (*) (TkDisplay *)) doNothing +# define TkpCmapStressed (int (*) (Tk_Window, Colormap)) doNothing +# define TkpSync (void (*) (Display *)) doNothing +# define TkUnixContainerId 0 +# define TkUnixDoOneXEvent 0 +# define TkUnixSetMenubar 0 +# define TkWmCleanup (void (*) (TkDisplay *)) doNothing +# define TkSendCleanup (void (*) (TkDisplay *)) doNothing +# define TkFreeXId (void (*) (TkDisplay *)) doNothing +# define TkpTestsendCmd 0 + +#else /* * Remove macros that will interfere with the definitions below. */ @@ -40,17 +71,19 @@ MODULE_SCOPE TkIntXlibStubs tkIntXlibStubs; MODULE_SCOPE TkPlatStubs tkPlatStubs; MODULE_SCOPE TkStubs tkStubs; -#undef TkClipBox -#undef TkCreateRegion -#undef TkDestroyRegion -#undef TkIntersectRegion -#undef TkRectInRegion -#undef TkSetRegion -#undef TkUnionRectWithRegion -#undef TkSubtractRegion -#undef TkPutImage - -#ifndef __WIN32__ +# undef TkClipBox +# undef TkCreateRegion +# undef TkDestroyRegion +# undef TkIntersectRegion +# undef TkRectInRegion +# undef TkSetRegion +# undef TkUnionRectWithRegion +# undef TkSubtractRegion +# undef TkPutImage +# undef TkSetPixmapColormap +# undef TkpPrintWindowId +# undef TkWinChildProc + /* * Make sure that extensions which call XParseColor through the stub * table, call TkParseColor instead. [Bug 3486474] @@ -76,14 +109,14 @@ MODULE_SCOPE TkStubs tkStubs; # define TkSubtractRegion (void (*) _ANSI_ARGS_((TkRegion, TkRegion, TkRegion))) XSubtractRegion # ifdef __CYGWIN__ -# define Tk_GetHINSTANCE TkPlatGetHINSTANCE -# define GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS 0x00000004 +# define Tk_GetHINSTANCE TkPlatGetHINSTANCE /* * Trick, so we don't have to include <windows.h> here, which in any * case lacks this function anyway. */ +#define GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS 0x00000004 int __stdcall GetModuleHandleExW(unsigned int, const char *, void *); static void *Tk_GetHINSTANCE() @@ -94,15 +127,61 @@ static void *Tk_GetHINSTANCE() (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 + +void +TkSetPixmapColormap(pixmap, colormap) + Pixmap pixmap; + Colormap colormap; +{ +} + +void +TkpPrintWindowId(buf, window) + char *buf; /* Pointer to string large enough to hold + * the hex representation of a pointer. */ + Window window; /* Window to be printed into buffer. */ +{ + sprintf(buf, "%#08lx", (unsigned long) (window)); +} + + /* 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 +# define TkAlignImageData 0 +# define TkGenerateActivateEvents 0 +# define TkpGetMS 0 +# define TkPointerDeadWindow 0 +# define TkpSetCapture 0 +# define TkpSetCursor 0 +# define TkWinCancelMouseTimer 0 +# define TkWinClipboardRender 0 +# define TkWinEmbeddedEventProc 0 +# define TkWinFillRect 0 +# define TkWinGetBorderPixels 0 +# define TkWinGetDrawableDC 0 +# define TkWinGetModifierState 0 +# define TkWinGetSystemPalette 0 +# define TkWinGetWrapperWindow 0 +# define TkWinHandleMenuEvent 0 +# define TkWinIndexOfColor 0 +# define TkWinReleaseDrawableDC 0 +# define TkWinResendEvent 0 +# define TkWinSelectPalette 0 +# define TkWinSetMenu 0 +# define TkWinSetWindowPos 0 +# define TkWinWmCleanup 0 +# define TkWinXCleanup 0 +# define TkWinXInit 0 +# define TkWinSetForegroundWindow 0 +# define TkWinDialogDebug 0 +# define TkWinGetMenuSystemDefault 0 +# define TkWinGetPlatformId 0 +# define TkWinSetHINSTANCE 0 +# define TkWinGetPlatformTheme 0 +# define TkWinChildProc 0 # endif /* __CYGWIN__ */ # endif /* !MAC_TCL && !MACC_OSX_TCL */ #endif /* !__WIN32__ */ @@ -331,7 +410,7 @@ TkIntStubs tkIntStubs = { TkIntPlatStubs tkIntPlatStubs = { TCL_STUB_MAGIC, NULL, -#ifdef __WIN32__ /* WIN */ +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ TkAlignImageData, /* 0 */ NULL, /* 1 */ TkGenerateActivateEvents, /* 2 */ @@ -369,6 +448,18 @@ TkIntPlatStubs tkIntPlatStubs = { TkWinSetHINSTANCE, /* 34 */ TkWinGetPlatformTheme, /* 35 */ TkWinChildProc, /* 36 */ + TkCreateXEventSource, /* 37 */ + TkFreeWindowId, /* 38 */ + TkInitXId, /* 39 */ + TkpCmapStressed, /* 40 */ + TkpSync, /* 41 */ + TkUnixContainerId, /* 42 */ + TkUnixDoOneXEvent, /* 43 */ + TkUnixSetMenubar, /* 44 */ + TkWmCleanup, /* 45 */ + TkSendCleanup, /* 46 */ + TkFreeXId, /* 47 */ + TkpTestsendCmd, /* 48 */ #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ TkGenerateActivateEvents, /* 0 */ @@ -426,7 +517,7 @@ TkIntPlatStubs tkIntPlatStubs = { NULL, /* 52 */ TkpGetMS, /* 53 */ #endif /* AQUA */ -#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */ +#if !(defined(__WIN32__) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */ TkCreateXEventSource, /* 0 */ TkFreeWindowId, /* 1 */ TkInitXId, /* 2 */ @@ -655,14 +746,6 @@ TkIntXlibStubs tkIntXlibStubs = { TkPlatStubs tkPlatStubs = { TCL_STUB_MAGIC, NULL, -#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */ - Tk_AttachHWND, /* 0 */ - Tk_GetHINSTANCE, /* 1 */ - Tk_GetHWND, /* 2 */ - Tk_HWNDToWindow, /* 3 */ - Tk_PointerEvent, /* 4 */ - Tk_TranslateWinEvent, /* 5 */ -#endif /* UNIX */ #ifdef __WIN32__ /* WIN */ Tk_AttachHWND, /* 0 */ Tk_GetHINSTANCE, /* 1 */ @@ -672,12 +755,12 @@ TkPlatStubs tkPlatStubs = { Tk_TranslateWinEvent, /* 5 */ #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ - Tk_AttachHWND, /* 0 */ - Tk_GetHINSTANCE, /* 1 */ - Tk_GetHWND, /* 2 */ - Tk_HWNDToWindow, /* 3 */ - Tk_PointerEvent, /* 4 */ - Tk_TranslateWinEvent, /* 5 */ + Tk_MacOSXSetEmbedHandler, /* 0 */ + Tk_MacOSXTurnOffMenus, /* 1 */ + Tk_MacOSXTkOwnsCursor, /* 2 */ + TkMacOSXInitMenus, /* 3 */ + TkMacOSXInitAppleEvents, /* 4 */ + TkGenWMConfigureEvent, /* 5 */ TkMacOSXInvalClipRgns, /* 6 */ TkMacOSXGetDrawablePort, /* 7 */ TkMacOSXGetRootControl, /* 8 */ diff --git a/generic/tkWindow.c b/generic/tkWindow.c index 2dadfb7..c432cbf 100644 --- a/generic/tkWindow.c +++ b/generic/tkWindow.c @@ -14,7 +14,9 @@ #include "tkInt.h" -#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) +#ifdef __WIN32__ +#include "tkWinInt.h" +#elif !(defined(__WIN32__) || defined(MAC_OSX_TK)) #include "tkUnixInt.h" #endif diff --git a/generic/ttk/ttkGenStubs.tcl b/generic/ttk/ttkGenStubs.tcl index fb9c018..90dea25 100644 --- a/generic/ttk/ttkGenStubs.tcl +++ b/generic/ttk/ttkGenStubs.tcl @@ -238,6 +238,7 @@ proc genStubs::rewriteFile {file text} { } set in [open ${file} r] set out [open ${file}.new w] + fconfigure $out -translation lf while {![eof $in]} { set line [gets $in] diff --git a/unix/Makefile.in b/unix/Makefile.in index 1a2f6f5..4e83c09 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -57,6 +57,7 @@ BIN_INSTALL_DIR = $(INSTALL_ROOT)$(bindir) # Directory in which to install the .a or .so binary for the Tk library: LIB_INSTALL_DIR = $(INSTALL_ROOT)$(libdir) +DLL_INSTALL_DIR = @DLL_INSTALL_DIR@ # Path name to use when installing library scripts. SCRIPT_INSTALL_DIR = $(INSTALL_ROOT)$(TK_LIBRARY) @@ -727,9 +728,9 @@ install-binaries: $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) wish@EXEEXT@ echo "}";\ ) > "$(PKG_INDEX)"; \ fi - @echo "Installing $(LIB_FILE) to $(LIB_INSTALL_DIR)/" + @echo "Installing $(LIB_FILE) to $(DLL_INSTALL_DIR)/" @@INSTALL_LIB@ - @chmod 555 "$(LIB_INSTALL_DIR)"/$(LIB_FILE) + @chmod 555 "$(DLL_INSTALL_DIR)/$(LIB_FILE)" @echo "Installing wish@EXEEXT@ as $(BIN_INSTALL_DIR)/wish$(VERSION)@EXEEXT@" @$(INSTALL_PROGRAM) wish@EXEEXT@ "$(BIN_INSTALL_DIR)"/wish$(VERSION)@EXEEXT@ @echo "Installing tkConfig.sh to $(CONFIG_INSTALL_DIR)/" diff --git a/unix/tkUnixPort.h b/unix/tkUnixPort.h index 76199a0..8318724 100644 --- a/unix/tkUnixPort.h +++ b/unix/tkUnixPort.h @@ -182,7 +182,9 @@ #define TkpButtonSetDefaults(specPtr) {} #define TkpDestroyButton(butPtr) {} #define TkSelUpdateClipboard(a,b) {} +#ifndef __CYGWIN__ #define TkSetPixmapColormap(p,c) {} +#endif /* * These calls implement native bitmaps which are not supported under @@ -197,9 +199,10 @@ * This macro stores a representation of the window handle in a string. * This should perhaps use the real size of an XID. */ - +#ifndef __CYGWIN__ #define TkpPrintWindowId(buf,w) \ sprintf((buf), "%#08lx", (unsigned long) (w)) +#endif /* * The following declaration is used to get access to a private Tcl interface diff --git a/win/tkWinPort.h b/win/tkWinPort.h index 73a511c..907412b 100644 --- a/win/tkWinPort.h +++ b/win/tkWinPort.h @@ -95,13 +95,9 @@ * under Windows. */ -#define TkFreeWindowId(dispPtr,w) -#define TkInitXId(dispPtr) -#define TkpCmapStressed(tkwin,colormap) (0) #define XFlush(display) #define XGrabServer(display) #define XUngrabServer(display) -#define TkpSync(display) /* * The following functions are implemented as macros under Windows. |