summaryrefslogtreecommitdiffstats
path: root/generic/tkStubInit.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tkStubInit.c')
-rw-r--r--generic/tkStubInit.c278
1 files changed, 123 insertions, 155 deletions
diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c
index 3573db0..9411c26 100644
--- a/generic/tkStubInit.c
+++ b/generic/tkStubInit.c
@@ -11,13 +11,13 @@
#include "tkInt.h"
-#if !(defined(__WIN32__) || defined(MAC_OSX_TK))
+#if !(defined(_WIN32) || defined(MAC_OSX_TK))
/* UNIX */
#define UNIX_TK
#include "tkUnixInt.h"
#endif
-#ifdef __WIN32__
+#ifdef _WIN32
#include "tkWinInt.h"
#endif
@@ -30,71 +30,46 @@
#include "tkPlatDecls.h"
#include "tkIntXlibDecls.h"
-#define TkUnusedStubEntry NULL
+static const TkIntStubs tkIntStubs;
+MODULE_SCOPE const TkStubs tkStubs;
-#ifdef __WIN32__
+/*
+ * Remove macro that might interfere with the definition below.
+ */
+
+#undef Tk_MainEx
-static int
-doNothing(void)
+#ifdef _WIN32
+
+int
+TkpCmapStressed(Tk_Window tkwin, Colormap colormap)
{
/* dummy implementation, no need to do anything */
return 0;
}
-
-#define TkCreateXEventSource TkPlatCreateXEventSource
-static void
-TkCreateXEventSource(void)
-{
- TkWinXInit(Tk_GetHINSTANCE());
-}
-
-#undef XFree
-#define XFree TkPlatXFree
-static int
-XFree(void *data)
+void
+TkpSync(Display *display)
{
- if (data != NULL) {
- ckfree((char *) data);
- }
- return 0;
+ /* dummy implementation, no need to do anything */
}
-#undef XVisualIDFromVisual
-#define XVisualIDFromVisual TkPlatXVisualIDFromVisual
-static VisualID
-XVisualIDFromVisual(Visual *visual)
+void
+TkCreateXEventSource(void)
{
- return visual->visualid;
+ TkWinXInit(Tk_GetHINSTANCE());
}
-/*
- * Remove macros that will interfere with the definitions below.
- */
-# undef TkpCmapStressed
-# undef TkpSync
-# undef XFlush
-# undef XGrabServer
-# undef XUngrabServer
-# undef XNoOp
-# undef XSynchronize
-# undef XSync
-
-# 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 XCreateWindow 0
+# define XOffsetRegion 0
+# define XUnionRegion 0
+# define TkWmCleanup (void (*)(TkDisplay *)) TkpSync
+# define TkSendCleanup (void (*)(TkDisplay *)) TkpSync
# define TkpTestsendCmd 0
-# define XFlush (int (*) (Display *)) doNothing
-# define XGrabServer (int (*) (Display *)) doNothing
-# define XUngrabServer (int (*) (Display *)) doNothing
-# define XNoOp (int (*) (Display *)) doNothing
-# define XSynchronize (XAfterFunction (*) (Display *, Bool)) doNothing
-# define XSync (int (*) (Display *, Bool)) doNothing
-#else /* !__WIN32__ */
+#else /* !_WIN32 */
/*
* Make sure that extensions which call XParseColor through the stub
@@ -104,8 +79,6 @@ XVisualIDFromVisual(Visual *visual)
# ifdef __CYGWIN__
- TkIntStubs tkIntStubs;
-
/*
* Trick, so we don't have to include <windows.h> here, which in any
* case lacks this function anyway.
@@ -136,7 +109,7 @@ TkpPrintWindowId(
* the hex representation of a pointer. */
Window window) /* Window to be printed into buffer. */
{
- sprintf(buf, "%#08lx", (unsigned long) (window));
+ sprintf(buf, "%#08lx", (unsigned long) (window));
}
int
@@ -235,8 +208,6 @@ void TkSubtractRegion (TkRegion a, TkRegion b, TkRegion c)
# define TkWinGetPlatformTheme 0
# define TkWinChildProc 0
-# define TkBindDeadWindow 0 /* On purpose not in Cygwin's stub table */
-
# elif !defined(MAC_OSX_TK) /* UNIX */
# undef TkClipBox
@@ -257,7 +228,7 @@ void TkSubtractRegion (TkRegion a, TkRegion b, TkRegion c)
# define TkUnionRectWithRegion (void (*) (XRectangle *, TkRegion, TkRegion)) XUnionRectWithRegion
# define TkSubtractRegion (void (*) (TkRegion, TkRegion, TkRegion)) XSubtractRegion
# endif
-#endif /* !__WIN32__ */
+#endif /* !_WIN32 */
/*
* WARNING: The contents of this file is automatically generated by the
@@ -267,21 +238,21 @@ void TkSubtractRegion (TkRegion a, TkRegion b, TkRegion c)
/* !BEGIN!: Do not edit below this line. */
-TkIntStubs tkIntStubs = {
+static const TkIntStubs tkIntStubs = {
TCL_STUB_MAGIC,
- NULL,
+ 0,
TkAllocWindow, /* 0 */
TkBezierPoints, /* 1 */
TkBezierScreenPoints, /* 2 */
- TkBindDeadWindow, /* 3 */
+ 0, /* 3 */
TkBindEventProc, /* 4 */
TkBindFree, /* 5 */
TkBindInit, /* 6 */
TkChangeEventWindow, /* 7 */
TkClipInit, /* 8 */
TkComputeAnchor, /* 9 */
- TkCopyAndGlobalEval, /* 10 */
- TkCreateBindingProcedure, /* 11 */
+ 0, /* 10 */
+ 0, /* 11 */
TkCreateCursorFromData, /* 12 */
TkCreateFrame, /* 13 */
TkCreateMainWindow, /* 14 */
@@ -346,7 +317,7 @@ TkIntStubs tkIntStubs = {
TkpRedirectKeyEvent, /* 73 */
TkpSetMainMenubar, /* 74 */
TkpUseWindow, /* 75 */
- TkpWindowWasRecentlyDeleted, /* 76 */
+ 0, /* 76 */
TkQueueEventForAllChildren, /* 77 */
TkReadBitmapFile, /* 78 */
TkScrollWindow, /* 79 */
@@ -354,7 +325,7 @@ TkIntStubs tkIntStubs = {
TkSelEventProc, /* 81 */
TkSelInit, /* 82 */
TkSelPropProc, /* 83 */
- NULL, /* 84 */
+ 0, /* 84 */
TkSetWindowMenuBar, /* 85 */
TkStringToKeysym, /* 86 */
TkThickPolyLineToArea, /* 87 */
@@ -390,48 +361,48 @@ TkIntStubs tkIntStubs = {
TkRectInRegion, /* 117 */
TkSetRegion, /* 118 */
TkUnionRectWithRegion, /* 119 */
- NULL, /* 120 */
-#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
- NULL, /* 121 */
+ 0, /* 120 */
+#if !(defined(_WIN32) || defined(MAC_OSX_TK)) /* X11 */
+ 0, /* 121 */
#endif /* X11 */
-#if defined(__WIN32__) /* WIN */
- NULL, /* 121 */
+#if defined(_WIN32) /* WIN */
+ 0, /* 121 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
- NULL, /* 121 */ /* Dummy entry for stubs table backwards compatibility */
+ 0, /* 121 */ /* Dummy entry for stubs table backwards compatibility */
TkpCreateNativeBitmap, /* 121 */
#endif /* AQUA */
-#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
- NULL, /* 122 */
+#if !(defined(_WIN32) || defined(MAC_OSX_TK)) /* X11 */
+ 0, /* 122 */
#endif /* X11 */
-#if defined(__WIN32__) /* WIN */
- NULL, /* 122 */
+#if defined(_WIN32) /* WIN */
+ 0, /* 122 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
- NULL, /* 122 */ /* Dummy entry for stubs table backwards compatibility */
+ 0, /* 122 */ /* Dummy entry for stubs table backwards compatibility */
TkpDefineNativeBitmaps, /* 122 */
#endif /* AQUA */
- NULL, /* 123 */
-#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
- NULL, /* 124 */
+ 0, /* 123 */
+#if !(defined(_WIN32) || defined(MAC_OSX_TK)) /* X11 */
+ 0, /* 124 */
#endif /* X11 */
-#if defined(__WIN32__) /* WIN */
- NULL, /* 124 */
+#if defined(_WIN32) /* WIN */
+ 0, /* 124 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
- NULL, /* 124 */ /* Dummy entry for stubs table backwards compatibility */
+ 0, /* 124 */ /* Dummy entry for stubs table backwards compatibility */
TkpGetNativeAppBitmap, /* 124 */
#endif /* AQUA */
- NULL, /* 125 */
- NULL, /* 126 */
- NULL, /* 127 */
- NULL, /* 128 */
- NULL, /* 129 */
- NULL, /* 130 */
- NULL, /* 131 */
- NULL, /* 132 */
- NULL, /* 133 */
- NULL, /* 134 */
+ 0, /* 125 */
+ 0, /* 126 */
+ 0, /* 127 */
+ 0, /* 128 */
+ 0, /* 129 */
+ 0, /* 130 */
+ 0, /* 131 */
+ 0, /* 132 */
+ 0, /* 133 */
+ 0, /* 134 */
TkpDrawHighlightBorder, /* 135 */
TkSetFocusWin, /* 136 */
TkpSetKeycodeAndState, /* 137 */
@@ -452,20 +423,20 @@ TkIntStubs tkIntStubs = {
TkpDrawFrame, /* 152 */
TkCreateThreadExitHandler, /* 153 */
TkDeleteThreadExitHandler, /* 154 */
- NULL, /* 155 */
+ 0, /* 155 */
TkpTestembedCmd, /* 156 */
TkpTesttextCmd, /* 157 */
- NULL, /* 158 */
- NULL, /* 159 */
- NULL, /* 160 */
- NULL, /* 161 */
- NULL, /* 162 */
- NULL, /* 163 */
- NULL, /* 164 */
- NULL, /* 165 */
- NULL, /* 166 */
- NULL, /* 167 */
- NULL, /* 168 */
+ TkSelGetSelection, /* 158 */
+ TkTextGetIndex, /* 159 */
+ TkTextIndexBackBytes, /* 160 */
+ TkTextIndexForwBytes, /* 161 */
+ TkTextMakeByteIndex, /* 162 */
+ TkTextPrintIndex, /* 163 */
+ TkTextSetMark, /* 164 */
+ TkTextXviewCmd, /* 165 */
+ TkTextChanged, /* 166 */
+ TkBTreeNumLines, /* 167 */
+ TkTextInsertDisplayProc, /* 168 */
TkStateParseProc, /* 169 */
TkStatePrintProc, /* 170 */
TkCanvasDashParseProc, /* 171 */
@@ -478,18 +449,18 @@ TkIntStubs tkIntStubs = {
TkOrientPrintProc, /* 178 */
TkSmoothParseProc, /* 179 */
TkSmoothPrintProc, /* 180 */
- NULL, /* 181 */
- NULL, /* 182 */
- NULL, /* 183 */
- TkUnusedStubEntry, /* 184 */
+ TkDrawAngledTextLayout, /* 181 */
+ TkUnderlineAngledTextLayout, /* 182 */
+ TkIntersectAngledTextLayout, /* 183 */
+ TkDrawAngledChars, /* 184 */
};
-TkIntPlatStubs tkIntPlatStubs = {
+static const TkIntPlatStubs tkIntPlatStubs = {
TCL_STUB_MAGIC,
- NULL,
-#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */
+ 0,
+#if defined(_WIN32) || defined(__CYGWIN__) /* WIN */
TkAlignImageData, /* 0 */
- NULL, /* 1 */
+ 0, /* 1 */
TkGenerateActivateEvents, /* 2 */
TkpGetMS, /* 3 */
TkPointerDeadWindow, /* 4 */
@@ -537,8 +508,8 @@ TkIntPlatStubs tkIntPlatStubs = {
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
TkGenerateActivateEvents, /* 0 */
- NULL, /* 1 */
- NULL, /* 2 */
+ 0, /* 1 */
+ 0, /* 2 */
TkPointerDeadWindow, /* 3 */
TkpSetCapture, /* 4 */
TkpSetCursor, /* 5 */
@@ -549,14 +520,14 @@ TkIntPlatStubs tkIntPlatStubs = {
TkMacOSXDispatchMenuEvent, /* 10 */
TkMacOSXInstallCursor, /* 11 */
TkMacOSXHandleTearoffMenu, /* 12 */
- NULL, /* 13 */
+ 0, /* 13 */
TkMacOSXDoHLEvent, /* 14 */
- NULL, /* 15 */
+ 0, /* 15 */
TkMacOSXGetXWindow, /* 16 */
TkMacOSXGrowToplevel, /* 17 */
TkMacOSXHandleMenuSelect, /* 18 */
- NULL, /* 19 */
- NULL, /* 20 */
+ 0, /* 19 */
+ 0, /* 20 */
TkMacOSXInvalidateWindow, /* 21 */
TkMacOSXIsCharacterMissing, /* 22 */
TkMacOSXMakeRealWindowExist, /* 23 */
@@ -584,7 +555,7 @@ TkIntPlatStubs tkIntPlatStubs = {
TkMacOSXPreprocessMenu, /* 45 */
TkpIsWindowFloating, /* 46 */
TkMacOSXGetCapture, /* 47 */
- NULL, /* 48 */
+ 0, /* 48 */
TkGetTransientMaster, /* 49 */
TkGenerateButtonEvent, /* 50 */
TkGenWMDestroyEvent, /* 51 */
@@ -593,10 +564,10 @@ TkIntPlatStubs tkIntPlatStubs = {
TkMacOSXDrawable, /* 54 */
TkpScanWindowId, /* 55 */
#endif /* AQUA */
-#if !(defined(__WIN32__) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */
+#if !(defined(_WIN32) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */
TkCreateXEventSource, /* 0 */
- TkFreeWindowId, /* 1 */
- TkInitXId, /* 2 */
+ 0, /* 1 */
+ 0, /* 2 */
TkpCmapStressed, /* 3 */
TkpSync, /* 4 */
TkUnixContainerId, /* 5 */
@@ -605,16 +576,16 @@ TkIntPlatStubs tkIntPlatStubs = {
TkpScanWindowId, /* 8 */
TkWmCleanup, /* 9 */
TkSendCleanup, /* 10 */
- TkFreeXId, /* 11 */
+ 0, /* 11 */
TkpWmSetState, /* 12 */
TkpTestsendCmd, /* 13 */
#endif /* X11 */
};
-TkIntXlibStubs tkIntXlibStubs = {
+static const TkIntXlibStubs tkIntXlibStubs = {
TCL_STUB_MAGIC,
- NULL,
-#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */
+ 0,
+#if defined(_WIN32) || defined(__CYGWIN__) /* WIN */
XSetDashes, /* 0 */
XGetModifierMapping, /* 1 */
XCreateImage, /* 2 */
@@ -696,7 +667,7 @@ TkIntXlibStubs tkIntXlibStubs = {
XFilterEvent, /* 78 */
XmbLookupString, /* 79 */
TkPutImage, /* 80 */
- NULL, /* 81 */
+ 0, /* 81 */
XParseColor, /* 82 */
XCreateGC, /* 83 */
XFreeGC, /* 84 */
@@ -730,27 +701,29 @@ TkIntXlibStubs tkIntXlibStubs = {
XSynchronize, /* 112 */
XSync, /* 113 */
XVisualIDFromVisual, /* 114 */
- NULL, /* 115 */
- NULL, /* 116 */
- NULL, /* 117 */
- NULL, /* 118 */
- NULL, /* 119 */
- NULL, /* 120 */
- NULL, /* 121 */
- NULL, /* 122 */
- NULL, /* 123 */
- NULL, /* 124 */
- NULL, /* 125 */
- NULL, /* 126 */
- NULL, /* 127 */
- NULL, /* 128 */
- NULL, /* 129 */
- NULL, /* 130 */
- NULL, /* 131 */
- NULL, /* 132 */
+ 0, /* 115 */
+ 0, /* 116 */
+ 0, /* 117 */
+ 0, /* 118 */
+ 0, /* 119 */
+ XOffsetRegion, /* 120 */
+ XUnionRegion, /* 121 */
+ XCreateWindow, /* 122 */
+ 0, /* 123 */
+ 0, /* 124 */
+ 0, /* 125 */
+ 0, /* 126 */
+ 0, /* 127 */
+ 0, /* 128 */
+ XLowerWindow, /* 129 */
+ XFillArcs, /* 130 */
+ XDrawArcs, /* 131 */
+ XDrawRectangles, /* 132 */
XDrawSegments, /* 133 */
XDrawPoint, /* 134 */
XDrawPoints, /* 135 */
+ XReparentWindow, /* 136 */
+ XPutImage, /* 137 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
XSetDashes, /* 0 */
@@ -848,10 +821,10 @@ TkIntXlibStubs tkIntXlibStubs = {
#endif /* AQUA */
};
-TkPlatStubs tkPlatStubs = {
+static const TkPlatStubs tkPlatStubs = {
TCL_STUB_MAGIC,
- NULL,
-#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */
+ 0,
+#if defined(_WIN32) || defined(__CYGWIN__) /* WIN */
Tk_AttachHWND, /* 0 */
Tk_GetHINSTANCE, /* 1 */
Tk_GetHWND, /* 2 */
@@ -874,14 +847,14 @@ TkPlatStubs tkPlatStubs = {
#endif /* AQUA */
};
-static TkStubHooks tkStubHooks = {
+static const TkStubHooks tkStubHooks = {
&tkPlatStubs,
&tkIntStubs,
&tkIntPlatStubs,
&tkIntXlibStubs
};
-TkStubs tkStubs = {
+const TkStubs tkStubs = {
TCL_STUB_MAGIC,
&tkStubHooks,
Tk_MainLoop, /* 0 */
@@ -1102,8 +1075,8 @@ TkStubs tkStubs = {
Tk_InitConsoleChannels, /* 215 */
Tk_CreateConsoleWindow, /* 216 */
Tk_CreateSmoothMethod, /* 217 */
- NULL, /* 218 */
- NULL, /* 219 */
+ 0, /* 218 */
+ 0, /* 219 */
Tk_GetDash, /* 220 */
Tk_CreateOutline, /* 221 */
Tk_DeleteOutline, /* 222 */
@@ -1158,11 +1131,6 @@ TkStubs tkStubs = {
Tk_Interp, /* 271 */
Tk_CreateOldImageType, /* 272 */
Tk_CreateOldPhotoImageFormat, /* 273 */
- NULL, /* 274 */
- TkUnusedStubEntry, /* 275 */
};
/* !END!: Do not edit above this line. */
-
-#undef UNIX_TK
-#undef MAC_OSX_TK