diff options
author | nijtmans <nijtmans> | 2010-02-16 21:12:56 (GMT) |
---|---|---|
committer | nijtmans <nijtmans> | 2010-02-16 21:12:56 (GMT) |
commit | 98ad94bf967f4567ae47c4b74ffe11cc12f7d22f (patch) | |
tree | b566e3894b84ff71cec41746404929097ffb61c6 | |
parent | 759424b1be09259bf20d269efd93af21c5150a01 (diff) | |
download | tk-98ad94bf967f4567ae47c4b74ffe11cc12f7d22f.zip tk-98ad94bf967f4567ae47c4b74ffe11cc12f7d22f.tar.gz tk-98ad94bf967f4567ae47c4b74ffe11cc12f7d22f.tar.bz2 |
tkWindow.c/tkStubInit.c adapted from stub changes in Tcl
tkArgv.c make defaultTable const
tkScrollbar.c Store default for "-with" in static non-const memory
tkWinInt.h make tkWinProcs const, and 5
tkWinX.c procs MODULE_SCOPE
tkWinColor.c make sysColors const
tkWinKey.c make keymap const
tkWinScrlbr.c Simplify copying of "-with" default value.
tkUnixWm.c make TkSetTransientFor static
tests/textImage.test textImage-1.13 depends on hash-order
-rw-r--r-- | ChangeLog | 14 | ||||
-rw-r--r-- | generic/tkArgv.c | 4 | ||||
-rw-r--r-- | generic/tkScrollbar.c | 7 | ||||
-rw-r--r-- | generic/tkStubInit.c | 22 | ||||
-rw-r--r-- | generic/tkWindow.c | 6 | ||||
-rw-r--r-- | tests/textImage.test | 8 | ||||
-rw-r--r-- | unix/tkUnixWm.c | 4 | ||||
-rw-r--r-- | win/tkWinColor.c | 45 | ||||
-rw-r--r-- | win/tkWinInt.h | 39 | ||||
-rw-r--r-- | win/tkWinKey.c | 4 | ||||
-rw-r--r-- | win/tkWinScrlbr.c | 22 | ||||
-rw-r--r-- | win/tkWinX.c | 62 |
12 files changed, 109 insertions, 128 deletions
@@ -1,3 +1,17 @@ +2010-02-16 Jan Nijtmans <nijtmans@users.sf.net> + + * generic/tkWindow.c Reverted rename from tkStubs to tkConstStubs + * generic/tkStubInit.c (regenerated) + * generic/tkArgv.c make defaultTable const + * generic/tkScrollbar.c Store default for "-with" in static non-const space + * win/tkWinInt.h make tkWinProcs const, and 5 + * win/tkWinX.c procs MODULE_SCOPE + * win/tkWinColor.c make sysColors const + * win/tkWinKey.c make keymap const + * win/tkWinScrlbr.c Simplify copying of "-with" default value. + * unix/tkUnixWm.c make TkSetTransientFor static + * tests/textImage.test textImage-1.13 depends on hash-order + 2010-02-12 Jan Nijtmans <nijtmans@users.sf.net> * win/tcl.m4 use -pipe for gcc on win32 diff --git a/generic/tkArgv.c b/generic/tkArgv.c index 8ad8331..a69e3e3 100644 --- a/generic/tkArgv.c +++ b/generic/tkArgv.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkArgv.c,v 1.17 2008/11/08 18:44:39 dkf Exp $ + * RCS: @(#) $Id: tkArgv.c,v 1.18 2010/02/16 21:12:56 nijtmans Exp $ */ #include "tkInt.h" @@ -20,7 +20,7 @@ * every application. */ -static Tk_ArgvInfo defaultTable[] = { +static const Tk_ArgvInfo defaultTable[] = { {"-help", TK_ARGV_HELP, NULL, NULL, "Print summary of command-line options and abort"}, {NULL, TK_ARGV_END, NULL, NULL, NULL} diff --git a/generic/tkScrollbar.c b/generic/tkScrollbar.c index 983f73a..04e3333 100644 --- a/generic/tkScrollbar.c +++ b/generic/tkScrollbar.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkScrollbar.c,v 1.18 2010/01/18 20:43:38 nijtmans Exp $ + * RCS: @(#) $Id: tkScrollbar.c,v 1.19 2010/02/16 21:12:56 nijtmans Exp $ */ #include "tkInt.h" @@ -26,6 +26,9 @@ static const Tk_CustomOption orientOption = { TkOrientParseProc, TkOrientPrintProc, (ClientData) NULL }; +/* static space for "-width" default value */ +static char defScrollbarWidth[TCL_INTEGER_SPACE] = DEF_SCROLLBAR_WIDTH; + /* * Information used for argv parsing. */ @@ -87,7 +90,7 @@ Tk_ConfigSpec tkpScrollbarConfigSpecs[] = { DEF_SCROLLBAR_TROUGH_MONO, Tk_Offset(TkScrollbar, troughColorPtr), TK_CONFIG_MONO_ONLY, NULL}, {TK_CONFIG_PIXELS, "-width", "width", "Width", - DEF_SCROLLBAR_WIDTH, Tk_Offset(TkScrollbar, width), 0, NULL}, + defScrollbarWidth, Tk_Offset(TkScrollbar, width), 0, NULL}, {TK_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0, NULL} }; diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c index dae166d..92925c2 100644 --- a/generic/tkStubInit.c +++ b/generic/tkStubInit.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkStubInit.c,v 1.72 2010/02/05 22:45:03 nijtmans Exp $ + * RCS: @(#) $Id: tkStubInit.c,v 1.73 2010/02/16 21:12:56 nijtmans Exp $ */ #include "tkInt.h" @@ -47,11 +47,11 @@ * below should be made in the generic/tk.decls script. */ -MODULE_SCOPE const TkStubs tkConstStubs; +MODULE_SCOPE const TkStubs tkStubs; /* !BEGIN!: Do not edit below this line. */ -static const TkIntStubs tkIntConstStubs = { +static const TkIntStubs tkIntStubs = { TCL_STUB_MAGIC, NULL, TkAllocWindow, /* 0 */ @@ -336,7 +336,7 @@ static const TkIntStubs tkIntConstStubs = { TkSmoothPrintProc, /* 180 */ }; -static const TkIntPlatStubs tkIntPlatConstStubs = { +static const TkIntPlatStubs tkIntPlatStubs = { TCL_STUB_MAGIC, NULL, #ifdef __WIN32__ /* WIN */ @@ -452,7 +452,7 @@ static const TkIntPlatStubs tkIntPlatConstStubs = { #endif /* X11 */ }; -static const TkIntXlibStubs tkIntXlibConstStubs = { +static const TkIntXlibStubs tkIntXlibStubs = { TCL_STUB_MAGIC, NULL, #ifdef __WIN32__ /* WIN */ @@ -660,7 +660,7 @@ static const TkIntXlibStubs tkIntXlibConstStubs = { #endif /* AQUA */ }; -static const TkPlatStubs tkPlatConstStubs = { +static const TkPlatStubs tkPlatStubs = { TCL_STUB_MAGIC, NULL, #ifdef __WIN32__ /* WIN */ @@ -687,13 +687,13 @@ static const TkPlatStubs tkPlatConstStubs = { }; static const TkStubHooks tkStubHooks = { - &tkPlatConstStubs, - &tkIntConstStubs, - &tkIntPlatConstStubs, - &tkIntXlibConstStubs + &tkPlatStubs, + &tkIntStubs, + &tkIntPlatStubs, + &tkIntXlibStubs }; -const TkStubs tkConstStubs = { +const TkStubs tkStubs = { TCL_STUB_MAGIC, &tkStubHooks, Tk_MainLoop, /* 0 */ diff --git a/generic/tkWindow.c b/generic/tkWindow.c index 877a667..2c9f0e3 100644 --- a/generic/tkWindow.c +++ b/generic/tkWindow.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWindow.c,v 1.110 2010/02/13 13:47:49 nijtmans Exp $ + * RCS: @(#) $Id: tkWindow.c,v 1.111 2010/02/16 21:12:56 nijtmans Exp $ */ #include "tkInt.h" @@ -2923,7 +2923,7 @@ Tk_SafeInit( return Initialize(interp); } -MODULE_SCOPE const TkStubs tkConstStubs; +MODULE_SCOPE const TkStubs tkStubs; /* *---------------------------------------------------------------------- @@ -3200,7 +3200,7 @@ Initialize( */ code = Tcl_PkgProvideEx(interp, "Tk", TK_PATCH_LEVEL, - (ClientData) &tkConstStubs); + (ClientData) &tkStubs); if (code != TCL_OK) { goto done; } diff --git a/tests/textImage.test b/tests/textImage.test index 8cb717b..5127b49 100644 --- a/tests/textImage.test +++ b/tests/textImage.test @@ -7,7 +7,7 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: textImage.test,v 1.13 2009/01/13 01:46:06 patthoyts Exp $ +# RCS: @(#) $Id: textImage.test,v 1.14 2010/02/16 21:12:57 nijtmans Exp $ package require tcltest 2.2 namespace import ::tcltest::* @@ -161,13 +161,13 @@ test textImage-1.13 {names argument checking} -setup { .t image create insert -image small lappend result [.t image names] .t image create insert -image small - lappend result [.t image names] + lappend result [lsort [.t image names]] .t image create insert -image small -name little - lappend result [.t image names] + lappend result [lsort [.t image names]] } -cleanup { destroy .t image delete small -} -result {{} small {small#1 small} {small#1 small little}} +} -result {{} small {small small#1} {little small small#1}} test textImage-1.14 {basic argument checking} -setup { destroy .t diff --git a/unix/tkUnixWm.c b/unix/tkUnixWm.c index 9539fbc..109afc5 100644 --- a/unix/tkUnixWm.c +++ b/unix/tkUnixWm.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkUnixWm.c,v 1.80 2010/02/05 22:45:03 nijtmans Exp $ + * RCS: @(#) $Id: tkUnixWm.c,v 1.81 2010/02/16 21:12:57 nijtmans Exp $ */ #include "tkUnixInt.h" @@ -6757,7 +6757,7 @@ GetMaxSize( *---------------------------------------------------------------------- */ -void +static void TkSetTransientFor(Tk_Window tkwin, Tk_Window parent) { if (parent == None) { diff --git a/win/tkWinColor.c b/win/tkWinColor.c index e0d763f..1b75a94 100644 --- a/win/tkWinColor.c +++ b/win/tkWinColor.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinColor.c,v 1.13 2009/01/28 20:47:49 nijtmans Exp $ + * RCS: @(#) $Id: tkWinColor.c,v 1.14 2010/02/16 21:12:56 nijtmans Exp $ */ #include "tkWinInt.h" @@ -37,7 +37,7 @@ typedef struct { int index; } SystemColorEntry; -static SystemColorEntry sysColors[] = { +static const SystemColorEntry sysColors[] = { {"3dDarkShadow", COLOR_3DDKSHADOW}, {"3dLight", COLOR_3DLIGHT}, {"ActiveBorder", COLOR_ACTIVEBORDER}, @@ -64,7 +64,6 @@ static SystemColorEntry sysColors[] = { {"Window", COLOR_WINDOW}, {"WindowFrame", COLOR_WINDOWFRAME}, {"WindowText", COLOR_WINDOWTEXT}, - {NULL, 0} }; typedef struct ThreadSpecificData { @@ -104,37 +103,15 @@ FindSystemColor( int *indexPtr) /* Out parameter to store color index. */ { int l, u, r, i; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) - Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); - - /* - * Count the number of elements in the color array if we haven't done so - * yet. - */ - - if (tsdPtr->ncolors == 0) { - SystemColorEntry *ePtr; - int version; - - version = LOBYTE(LOWORD(GetVersion())); - for (ePtr = sysColors; ePtr->name != NULL; ePtr++) { - if (version < 4) { - if (ePtr->index == COLOR_3DDKSHADOW) { - ePtr->index = COLOR_BTNSHADOW; - } else if (ePtr->index == COLOR_3DLIGHT) { - ePtr->index = COLOR_BTNHIGHLIGHT; - } - } - tsdPtr->ncolors++; - } - } + int index; + int version = LOBYTE(LOWORD(GetVersion())); /* * Perform a binary search on the sorted array of colors. */ l = 0; - u = tsdPtr->ncolors - 1; + u = (sizeof(sysColors) / sizeof(sysColors[0])) - 1; while (l <= u) { i = (l + u) / 2; r = strcasecmp(name, sysColors[i].name); @@ -150,8 +127,16 @@ FindSystemColor( return 0; } - *indexPtr = sysColors[i].index; - colorPtr->pixel = GetSysColor(sysColors[i].index); + index = sysColors[i].index; + if (version < 4) { + if (index == COLOR_3DDKSHADOW) { + index = COLOR_BTNSHADOW; + } else if (index == COLOR_3DLIGHT) { + index = COLOR_BTNHIGHLIGHT; + } + } + *indexPtr = index; + colorPtr->pixel = GetSysColor(index); /* * x257 is (value<<8 + value) to get the properly bit shifted and padded diff --git a/win/tkWinInt.h b/win/tkWinInt.h index 90d68bb..b0fd454 100644 --- a/win/tkWinInt.h +++ b/win/tkWinInt.h @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinInt.h,v 1.34 2010/01/14 22:05:54 nijtmans Exp $ + * RCS: @(#) $Id: tkWinInt.h,v 1.35 2010/02/16 21:12:56 nijtmans Exp $ */ #ifndef _TKWININT @@ -158,28 +158,28 @@ MODULE_SCOPE int tkpWinBltModes[]; * tkWinX.c:GenerateXEvent and tkWinClipboard.c:UpdateClipboard */ -EXTERN void TkWinUpdatingClipboard(int mode); +MODULE_SCOPE void TkWinUpdatingClipboard(int mode); /* * Used by tkWinDialog.c to associate the right icon with tk_messageBox */ -EXTERN HICON TkWinGetIcon(Tk_Window tkw, DWORD iconsize); +MODULE_SCOPE HICON TkWinGetIcon(Tk_Window tkw, DWORD iconsize); /* * Used by tkWinX.c on for certain system display change messages and cleanup * up containers */ -EXTERN void TkWinDisplayChanged(Display *display); +MODULE_SCOPE void TkWinDisplayChanged(Display *display); MODULE_SCOPE void TkWinCleanupContainerList(void); /* * Used by tkWinWm.c for embedded menu handling. May become public. */ -EXTERN HWND Tk_GetMenuHWND(Tk_Window tkwin); -EXTERN HWND Tk_GetEmbeddedMenuHWND(Tk_Window tkwin); +MODULE_SCOPE HWND Tk_GetMenuHWND(Tk_Window tkwin); +MODULE_SCOPE HWND Tk_GetEmbeddedMenuHWND(Tk_Window tkwin); /* * The following structure keeps track of whether we are using the multi-byte @@ -193,24 +193,19 @@ EXTERN HWND Tk_GetEmbeddedMenuHWND(Tk_Window tkwin); typedef struct TkWinProcs { int useWide; - LRESULT (WINAPI *callWindowProc)(WNDPROC lpPrevWndFunc, HWND hWnd, - UINT Msg, WPARAM wParam, LPARAM lParam); - LRESULT (WINAPI *defWindowProc)(HWND hWnd, UINT Msg, WPARAM wParam, - LPARAM lParam); - ATOM (WINAPI *registerClass)(const WNDCLASS *lpWndClass); - BOOL (WINAPI *setWindowText)(HWND hWnd, LPCTSTR lpString); - HWND (WINAPI *createWindowEx)(DWORD dwExStyle, LPCTSTR lpClassName, - LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, - int nWidth, int nHeight, HWND hWndParent, HMENU hMenu, - HINSTANCE hInstance, LPVOID lpParam); - BOOL (WINAPI *insertMenu)(HMENU hMenu, UINT uPosition, UINT uFlags, - UINT uIDNewItem, LPCTSTR lpNewItem); - int (WINAPI *getWindowText)(HWND hWnd, LPCTSTR lpString, int nMaxCount); - HWND (WINAPI *findWindow)(LPCTSTR lpClassName, LPCTSTR lpWindowName); - int (WINAPI *getClassName)(HWND hwnd, LPTSTR lpClassName, int nMaxCount); + LRESULT (WINAPI *callWindowProc)(WNDPROC, HWND, UINT, WPARAM, LPARAM); + LRESULT (WINAPI *defWindowProc)(HWND, UINT, WPARAM, LPARAM); + ATOM (WINAPI *registerClass)(const WNDCLASS *); + BOOL (WINAPI *setWindowText)(HWND, LPCTSTR); + HWND (WINAPI *createWindowEx)(DWORD, LPCTSTR, LPCTSTR, DWORD, int, int, + int, int, HWND, HMENU, HINSTANCE, LPVOID); + BOOL (WINAPI *insertMenu)(HMENU, UINT, UINT, UINT, LPCTSTR); + int (WINAPI *getWindowText)(HWND, LPCTSTR, int); + HWND (WINAPI *findWindow)(LPCTSTR, LPCTSTR); + int (WINAPI *getClassName)(HWND, LPTSTR, int); } TkWinProcs; -MODULE_SCOPE TkWinProcs *tkWinProcs; +MODULE_SCOPE const TkWinProcs *tkWinProcs; #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLIMPORT diff --git a/win/tkWinKey.c b/win/tkWinKey.c index 8536f9f..b537114 100644 --- a/win/tkWinKey.c +++ b/win/tkWinKey.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinKey.c,v 1.21 2010/01/13 23:08:11 nijtmans Exp $ + * RCS: @(#) $Id: tkWinKey.c,v 1.22 2010/02/16 21:12:56 nijtmans Exp $ */ #include "tkWinInt.h" @@ -25,7 +25,7 @@ #define MAX_KEYCODE 145 /* VK_SCROLL is the last entry in our table below */ -static KeySym keymap[] = { +static const KeySym keymap[] = { NoSymbol, NoSymbol, NoSymbol, XK_Cancel, NoSymbol, NoSymbol, NoSymbol, NoSymbol, XK_BackSpace, XK_Tab, NoSymbol, NoSymbol, XK_Clear, XK_Return, NoSymbol, diff --git a/win/tkWinScrlbr.c b/win/tkWinScrlbr.c index b87731c..9e848c7 100644 --- a/win/tkWinScrlbr.c +++ b/win/tkWinScrlbr.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinScrlbr.c,v 1.18 2010/01/13 23:08:11 nijtmans Exp $ + * RCS: @(#) $Id: tkWinScrlbr.c,v 1.19 2010/02/16 21:12:56 nijtmans Exp $ */ #include "tkWinInt.h" @@ -54,18 +54,11 @@ typedef struct WinScrollbar { static int initialized = 0; static int hArrowWidth, hThumb; /* Horizontal control metrics. */ -static int vArrowWidth, vArrowHeight, vThumb; /* Vertical control metrics. */ +static int vArrowHeight, vThumb; /* Vertical control metrics. */ TCL_DECLARE_MUTEX(winScrlbrMutex) /* - * This variable holds the default width for a scrollbar in string form for - * use in a Tk_ConfigSpec. - */ - -static char defWidth[TCL_INTEGER_SPACE]; - -/* * Declarations for functions defined in this file. */ @@ -363,19 +356,22 @@ TkpDestroyScrollbar( void UpdateScrollbarMetrics(void) { - Tk_ConfigSpec *specPtr; + int arrowWidth = GetSystemMetrics(SM_CXVSCROLL); + const Tk_ConfigSpec *specPtr; hArrowWidth = GetSystemMetrics(SM_CXHSCROLL); hThumb = GetSystemMetrics(SM_CXHTHUMB); - vArrowWidth = GetSystemMetrics(SM_CXVSCROLL); vArrowHeight = GetSystemMetrics(SM_CYVSCROLL); vThumb = GetSystemMetrics(SM_CYVTHUMB); - sprintf(defWidth, "%d", vArrowWidth); for (specPtr = tkpScrollbarConfigSpecs; specPtr->type != TK_CONFIG_END; specPtr++) { + /* Make sure that the default value belonging to the "-width" + * option of TkScrollbar points to static non-const space, + * otherwise the following sprintf results in a crash! + */ if (specPtr->offset == Tk_Offset(TkScrollbar, width)) { - specPtr->defValue = defWidth; + sprintf((char *)specPtr->defValue, "%d", arrowWidth); } } } diff --git a/win/tkWinX.c b/win/tkWinX.c index 8b27b1e..312bab0 100644 --- a/win/tkWinX.c +++ b/win/tkWinX.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinX.c,v 1.62 2010/01/02 11:07:56 dkf Exp $ + * RCS: @(#) $Id: tkWinX.c,v 1.63 2010/02/16 21:12:56 nijtmans Exp $ */ /* @@ -63,53 +63,41 @@ #define UNICODE_NOCHAR 0xFFFF #endif -static TkWinProcs asciiProcs = { +static const TkWinProcs asciiProcs = { 0, - - (LRESULT (WINAPI *)(WNDPROC lpPrevWndFunc, HWND hWnd, UINT Msg, - WPARAM wParam, LPARAM lParam)) CallWindowProcA, - (LRESULT (WINAPI *)(HWND hWnd, UINT Msg, WPARAM wParam, - LPARAM lParam)) DefWindowProcA, - (ATOM (WINAPI *)(const WNDCLASS *lpWndClass)) RegisterClassA, - (BOOL (WINAPI *)(HWND hWnd, LPCTSTR lpString)) SetWindowTextA, - (HWND (WINAPI *)(DWORD dwExStyle, LPCTSTR lpClassName, - LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, - int nWidth, int nHeight, HWND hWndParent, HMENU hMenu, - HINSTANCE hInstance, LPVOID lpParam)) CreateWindowExA, - (BOOL (WINAPI *)(HMENU hMenu, UINT uPosition, UINT uFlags, - UINT uIDNewItem, LPCTSTR lpNewItem)) InsertMenuA, - (int (WINAPI *)(HWND hWnd, LPCTSTR lpString, int nMaxCount)) GetWindowTextA, - (HWND (WINAPI *)(LPCTSTR lpClassName, LPCTSTR lpWindowName)) FindWindowA, - (int (WINAPI *)(HWND hwnd, LPTSTR lpClassName, int nMaxCount)) GetClassNameA, + (LRESULT (WINAPI *)(WNDPROC, HWND, UINT, WPARAM, LPARAM)) CallWindowProcA, + (LRESULT (WINAPI *)(HWND, UINT, WPARAM, LPARAM)) DefWindowProcA, + (ATOM (WINAPI *)(const WNDCLASS *)) RegisterClassA, + (BOOL (WINAPI *)(HWND, LPCTSTR)) SetWindowTextA, + (HWND (WINAPI *)(DWORD, LPCTSTR, LPCTSTR, DWORD, int, int, + int, int, HWND, HMENU, HINSTANCE, LPVOID)) CreateWindowExA, + (BOOL (WINAPI *)(HMENU, UINT, UINT, UINT, LPCTSTR)) InsertMenuA, + (int (WINAPI *)(HWND, LPCTSTR, int)) GetWindowTextA, + (HWND (WINAPI *)(LPCTSTR, LPCTSTR)) FindWindowA, + (int (WINAPI *)(HWND, LPTSTR, int)) GetClassNameA, }; -static TkWinProcs unicodeProcs = { +static const TkWinProcs unicodeProcs = { 1, - - (LRESULT (WINAPI *)(WNDPROC lpPrevWndFunc, HWND hWnd, UINT Msg, - WPARAM wParam, LPARAM lParam)) CallWindowProcW, - (LRESULT (WINAPI *)(HWND hWnd, UINT Msg, WPARAM wParam, - LPARAM lParam)) DefWindowProcW, - (ATOM (WINAPI *)(const WNDCLASS *lpWndClass)) RegisterClassW, - (BOOL (WINAPI *)(HWND hWnd, LPCTSTR lpString)) SetWindowTextW, - (HWND (WINAPI *)(DWORD dwExStyle, LPCTSTR lpClassName, - LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, - int nWidth, int nHeight, HWND hWndParent, HMENU hMenu, - HINSTANCE hInstance, LPVOID lpParam)) CreateWindowExW, - (BOOL (WINAPI *)(HMENU hMenu, UINT uPosition, UINT uFlags, - UINT uIDNewItem, LPCTSTR lpNewItem)) InsertMenuW, - (int (WINAPI *)(HWND hWnd, LPCTSTR lpString, int nMaxCount)) GetWindowTextW, - (HWND (WINAPI *)(LPCTSTR lpClassName, LPCTSTR lpWindowName)) FindWindowW, - (int (WINAPI *)(HWND hwnd, LPTSTR lpClassName, int nMaxCount)) GetClassNameW, + (LRESULT (WINAPI *)(WNDPROC, HWND, UINT, WPARAM, LPARAM)) CallWindowProcW, + (LRESULT (WINAPI *)(HWND, UINT, WPARAM, LPARAM)) DefWindowProcW, + (ATOM (WINAPI *)(const WNDCLASS *)) RegisterClassW, + (BOOL (WINAPI *)(HWND, LPCTSTR)) SetWindowTextW, + (HWND (WINAPI *)(DWORD, LPCTSTR, LPCTSTR, DWORD, int, int, + int, int, HWND, HMENU, HINSTANCE, LPVOID)) CreateWindowExW, + (BOOL (WINAPI *)(HMENU, UINT, UINT, UINT, LPCTSTR)) InsertMenuW, + (int (WINAPI *)(HWND, LPCTSTR, int)) GetWindowTextW, + (HWND (WINAPI *)(LPCTSTR, LPCTSTR)) FindWindowW, + (int (WINAPI *)(HWND, LPTSTR, int)) GetClassNameW, }; -TkWinProcs *tkWinProcs; +const TkWinProcs *tkWinProcs; /* * Declarations of static variables used in this file. */ -static char winScreenName[] = ":0"; /* Default name of windows display. */ +static const char winScreenName[] = ":0"; /* Default name of windows display. */ static HINSTANCE tkInstance = NULL; /* Application instance handle. */ static int childClassInitialized; /* Registered child class? */ static WNDCLASS childClass; /* Window class for child windows. */ |