summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornijtmans <nijtmans>2010-04-29 15:28:04 (GMT)
committernijtmans <nijtmans>2010-04-29 15:28:04 (GMT)
commitb36ef0e6d25a1a247dab7d8d39cc8f4242df1450 (patch)
tree82bad50df8f16a12bb06512831f4ee71e21981ce
parentbcca65eae4c1a94002d5f9aa9bd7fb75dc48b0fa (diff)
downloadtk-b36ef0e6d25a1a247dab7d8d39cc8f4242df1450.zip
tk-b36ef0e6d25a1a247dab7d8d39cc8f4242df1450.tar.gz
tk-b36ef0e6d25a1a247dab7d8d39cc8f4242df1450.tar.bz2
Unnessarary TCL_STORAGE_CLASS re-definitions
Make various functions MODULE_SCOPE TCHAR-related fixes, making al those files compile fine when TCHAR != char.
-rw-r--r--ChangeLog13
-rw-r--r--win/tkWin.h10
-rw-r--r--win/tkWinButton.c10
-rw-r--r--win/tkWinFont.c10
-rw-r--r--win/tkWinInt.h34
-rw-r--r--win/tkWinScrlbr.c4
-rw-r--r--win/tkWinWindow.c3
-rw-r--r--win/tkWinWm.c8
-rw-r--r--win/tkWinX.c6
-rw-r--r--win/ttkWinMonitor.c6
-rw-r--r--win/ttkWinXPTheme.c4
11 files changed, 50 insertions, 58 deletions
diff --git a/ChangeLog b/ChangeLog
index e1fe1b9..eb2688c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2010-04-29 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * win/tkWin.h Unnessarary TCL_STORAGE_CLASS re-definition
+ * win/tkWinInt.h Make various functions MODULE_SCOPE
+ * win/tkWinButton.c TCHAR-related fixes, making al those
+ * win/tkWinFont.c files compile fine when TCHAR != char.
+ * win/tkWinScrlbr.c
+ * win/tkWinWindow.c
+ * win/tkWinWm.c
+ * win/tkWinX.c
+ * win/ttkWinMonitor.c
+ * win/ttkWinXPTheme.c
+
2010-04-25 Donal K. Fellows <dkf@users.sf.net>
* generic/tkImgPNG.c (ReadIDAT, DecodePNG): Move the check for overall
diff --git a/win/tkWin.h b/win/tkWin.h
index f58c97f..ae03a93 100644
--- a/win/tkWin.h
+++ b/win/tkWin.h
@@ -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: tkWin.h,v 1.15 2007/12/13 15:28:52 dgp Exp $
+ * RCS: @(#) $Id: tkWin.h,v 1.16 2010/04/29 15:28:04 nijtmans Exp $
*/
#ifndef _TKWIN
@@ -38,11 +38,6 @@
#include <windows.h>
#undef WIN32_LEAN_AND_MEAN
-#ifdef BUILD_tk
-# undef TCL_STORAGE_CLASS
-# define TCL_STORAGE_CLASS DLLEXPORT
-#endif
-
/*
* The following messages are used to communicate between a Tk toplevel
* and its container window. A Tk container may not be able to provide
@@ -85,7 +80,4 @@
#include "tkPlatDecls.h"
-# undef TCL_STORAGE_CLASS
-# define TCL_STORAGE_CLASS DLLIMPORT
-
#endif /* _TKWIN */
diff --git a/win/tkWinButton.c b/win/tkWinButton.c
index 1a89abf..3c89ebc 100644
--- a/win/tkWinButton.c
+++ b/win/tkWinButton.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: tkWinButton.c,v 1.40 2010/02/18 22:31:31 nijtmans Exp $
+ * RCS: @(#) $Id: tkWinButton.c,v 1.41 2010/04/29 15:28:04 nijtmans Exp $
*/
#define OEMRESOURCE
@@ -133,7 +133,7 @@ InitBoxes(void)
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
- hrsrc = FindResource(module, "buttons", RT_BITMAP);
+ hrsrc = FindResource(module, TEXT("buttons"), RT_BITMAP);
if (hrsrc == NULL) {
Tcl_Panic("FindResource() failed for buttons bitmap resource, "
"resources in tk_base.rc must be linked into Tk dll or static executable");
@@ -243,15 +243,15 @@ CreateProc(
{
Window window;
HWND parent;
- const char *class;
+ const TCHAR *class;
WinButton *butPtr = (WinButton *)instanceData;
parent = Tk_GetHWND(parentWin);
if (butPtr->info.type == TYPE_LABEL) {
- class = "STATIC";
+ class = TEXT("STATIC");
butPtr->style = SS_OWNERDRAW | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS;
} else {
- class = "BUTTON";
+ class = TEXT("BUTTON");
butPtr->style = BS_OWNERDRAW | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS;
}
butPtr->hwnd = CreateWindow(class, NULL, butPtr->style,
diff --git a/win/tkWinFont.c b/win/tkWinFont.c
index e5d7b82..1914a92 100644
--- a/win/tkWinFont.c
+++ b/win/tkWinFont.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: tkWinFont.c,v 1.49 2010/01/13 23:08:12 nijtmans Exp $
+ * RCS: @(#) $Id: tkWinFont.c,v 1.50 2010/04/29 15:28:04 nijtmans Exp $
*/
#include "tkWinInt.h"
@@ -342,7 +342,7 @@ CreateNamedSystemLogFont(
Tcl_Interp *interp,
Tk_Window tkwin,
const char* name,
- LOGFONTA* logFontPtr)
+ LOGFONT* logFontPtr)
{
HFONT hFont;
int r;
@@ -455,9 +455,9 @@ TkWinSetupSystemFonts(
*/
{
- LOGFONTA lfFixed = {
+ LOGFONT lfFixed = {
0, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, DEFAULT_CHARSET,
- 0, 0, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN, ""
+ 0, 0, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN, TEXT("")
};
long pointSize, dpi;
HDC hdc = GetDC(NULL);
@@ -680,7 +680,7 @@ WinFontFamilyEnumProc(
int fontType, /* Type of font (not used). */
LPARAM lParam) /* Result object to hold result. */
{
- char *faceName = lfPtr->elfLogFont.lfFaceName;
+ TCHAR *faceName = lfPtr->elfLogFont.lfFaceName;
Tcl_Obj *resultObj = (Tcl_Obj *) lParam;
Tcl_DString faceString;
diff --git a/win/tkWinInt.h b/win/tkWinInt.h
index b0fd454..559d528 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.35 2010/02/16 21:12:56 nijtmans Exp $
+ * RCS: @(#) $Id: tkWinInt.h,v 1.36 2010/04/29 15:28:04 nijtmans Exp $
*/
#ifndef _TKWININT
@@ -28,10 +28,6 @@
#include "tkWin.h"
#endif
-#ifndef _TKPORT
-#include "tkPort.h"
-#endif
-
/*
* Define constants missing from older Win32 SDK header files.
*/
@@ -123,8 +119,8 @@ typedef struct {
* The following macros define the class names for Tk Window types.
*/
-#define TK_WIN_TOPLEVEL_CLASS_NAME "TkTopLevel"
-#define TK_WIN_CHILD_CLASS_NAME "TkChild"
+#define TK_WIN_TOPLEVEL_CLASS_NAME TEXT("TkTopLevel")
+#define TK_WIN_CHILD_CLASS_NAME TEXT("TkChild")
/*
* The following variable is a translation table between X gc functions and
@@ -148,11 +144,6 @@ MODULE_SCOPE int tkpWinBltModes[];
#include "tkIntPlatDecls.h"
-#ifdef BUILD_tk
-#undef TCL_STORAGE_CLASS
-#define TCL_STORAGE_CLASS DLLEXPORT
-#endif
-
/*
* Special proc needed as tsd accessor function between
* tkWinX.c:GenerateXEvent and tkWinClipboard.c:UpdateClipboard
@@ -207,9 +198,6 @@ typedef struct TkWinProcs {
MODULE_SCOPE const TkWinProcs *tkWinProcs;
-#undef TCL_STORAGE_CLASS
-#define TCL_STORAGE_CLASS DLLIMPORT
-
/*
* The following allows us to cache these encoding for multiple functions.
*/
@@ -230,15 +218,15 @@ MODULE_SCOPE void TkWinSetupSystemFonts(TkMainInfo *mainPtr);
* The following is implemented in tkWinWm and used by tkWinEmbed.c
*/
-void TkpWinToplevelWithDraw(TkWindow *winPtr);
-void TkpWinToplevelIconify(TkWindow *winPtr);
-void TkpWinToplevelDeiconify(TkWindow *winPtr);
-long TkpWinToplevelIsControlledByWm(TkWindow *winPtr);
-long TkpWinToplevelMove(TkWindow *winPtr, int x, int y);
-long TkpWinToplevelOverrideRedirect(TkWindow *winPtr,
+MODULE_SCOPE void TkpWinToplevelWithDraw(TkWindow *winPtr);
+MODULE_SCOPE void TkpWinToplevelIconify(TkWindow *winPtr);
+MODULE_SCOPE void TkpWinToplevelDeiconify(TkWindow *winPtr);
+MODULE_SCOPE long TkpWinToplevelIsControlledByWm(TkWindow *winPtr);
+MODULE_SCOPE long TkpWinToplevelMove(TkWindow *winPtr, int x, int y);
+MODULE_SCOPE long TkpWinToplevelOverrideRedirect(TkWindow *winPtr,
int reqValue);
-void TkpWinToplevelDetachWindow(TkWindow *winPtr);
-int TkpWmGetState(TkWindow *winPtr);
+MODULE_SCOPE void TkpWinToplevelDetachWindow(TkWindow *winPtr);
+MODULE_SCOPE int TkpWmGetState(TkWindow *winPtr);
/*
* The following functions are not present in old versions of Windows
diff --git a/win/tkWinScrlbr.c b/win/tkWinScrlbr.c
index b4f8259..98a4178 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.20 2010/02/17 19:21:17 nijtmans Exp $
+ * RCS: @(#) $Id: tkWinScrlbr.c,v 1.21 2010/04/29 15:28:04 nijtmans Exp $
*/
#include "tkWinInt.h"
@@ -226,7 +226,7 @@ CreateProc(
| SBS_HORZ | SBS_BOTTOMALIGN;
}
- scrollPtr->hwnd = CreateWindow("SCROLLBAR", NULL, style,
+ scrollPtr->hwnd = CreateWindow(TEXT("SCROLLBAR"), NULL, style,
Tk_X(tkwin), Tk_Y(tkwin), Tk_Width(tkwin), Tk_Height(tkwin),
parent, NULL, Tk_GetHINSTANCE(), NULL);
diff --git a/win/tkWinWindow.c b/win/tkWinWindow.c
index ab335a8..ea80937 100644
--- a/win/tkWinWindow.c
+++ b/win/tkWinWindow.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: tkWinWindow.c,v 1.20 2009/01/28 20:47:49 nijtmans Exp $
+ * RCS: @(#) $Id: tkWinWindow.c,v 1.21 2010/04/29 15:28:04 nijtmans Exp $
*/
#include "tkWinInt.h"
@@ -903,7 +903,6 @@ TkpMakeTransparentWindowExist(
int style = WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS;
DWORD exStyle = WS_EX_TRANSPARENT | WS_EX_TOPMOST;
-#define TK_WIN_CHILD_CLASS_NAME "TkChild"
hWnd = CreateWindowEx(exStyle, TK_WIN_CHILD_CLASS_NAME, NULL, style,
Tk_X(tkwin), Tk_Y(tkwin), Tk_Width(tkwin), Tk_Height(tkwin),
hParent, NULL, Tk_GetHINSTANCE(), NULL);
diff --git a/win/tkWinWm.c b/win/tkWinWm.c
index 26d9d55..ce9b618 100644
--- a/win/tkWinWm.c
+++ b/win/tkWinWm.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: tkWinWm.c,v 1.142 2009/11/22 23:49:26 patthoyts Exp $
+ * RCS: @(#) $Id: tkWinWm.c,v 1.143 2010/04/29 15:28:04 nijtmans Exp $
*/
#include "tkWinInt.h"
@@ -908,7 +908,7 @@ InitWindowClass(
initialized = 1;
if (shgetfileinfoProc == NULL) {
- HINSTANCE hInstance = LoadLibraryA("shell32");
+ HINSTANCE hInstance = LoadLibrary(TEXT("shell32"));
if (hInstance != NULL) {
shgetfileinfoProc = (DWORD* (WINAPI *) (LPCTSTR pszPath,
@@ -919,7 +919,7 @@ InitWindowClass(
}
}
if (setLayeredWindowAttributesProc == NULL) {
- HINSTANCE hInstance = LoadLibraryA("user32");
+ HINSTANCE hInstance = LoadLibrary(TEXT("user32"));
if (hInstance != NULL) {
setLayeredWindowAttributesProc = (BOOL (WINAPI*)(HWND hwnd,
@@ -942,7 +942,7 @@ InitWindowClass(
class.lpszClassName = (LPCTSTR) Tcl_DStringValue(&classString);
class.lpfnWndProc = WmProc;
if (titlebaricon == NULL) {
- class.hIcon = LoadIcon(Tk_GetHINSTANCE(), "tk");
+ class.hIcon = LoadIcon(Tk_GetHINSTANCE(), TEXT("tk"));
} else {
class.hIcon = GetIcon(titlebaricon, ICON_BIG);
if (class.hIcon == NULL) {
diff --git a/win/tkWinX.c b/win/tkWinX.c
index 312bab0..a0f69ab 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.63 2010/02/16 21:12:56 nijtmans Exp $
+ * RCS: @(#) $Id: tkWinX.c,v 1.64 2010/04/29 15:28:04 nijtmans Exp $
*/
/*
@@ -389,8 +389,8 @@ TkWinGetPlatformId(void)
if ((os.dwPlatformId == VER_PLATFORM_WIN32_NT) &&
(os.dwMajorVersion == 5 && os.dwMinorVersion == 1)) {
HKEY hKey;
- LPCSTR szSubKey = TEXT("Control Panel\\Appearance");
- LPCSTR szCurrent = TEXT("Current");
+ LPCTSTR szSubKey = TEXT("Control Panel\\Appearance");
+ LPCTSTR szCurrent = TEXT("Current");
DWORD dwSize = 200;
char pBuffer[200];
diff --git a/win/ttkWinMonitor.c b/win/ttkWinMonitor.c
index 2753518..c208245 100644
--- a/win/ttkWinMonitor.c
+++ b/win/ttkWinMonitor.c
@@ -1,4 +1,4 @@
-/* $Id: ttkWinMonitor.c,v 1.16 2007/12/13 15:28:56 dgp Exp $
+/* $Id: ttkWinMonitor.c,v 1.17 2010/04/29 15:28:04 nijtmans Exp $
*/
#ifdef _MSC_VER
@@ -75,8 +75,8 @@ CreateThemeMonitorWindow(HINSTANCE hinst, Tcl_Interp *interp)
{
WNDCLASSEX wc;
HWND hwnd = NULL;
- CHAR title[32] = "TtkMonitorWindow";
- CHAR name[32] = "TtkMonitorClass";
+ TCHAR title[32] = TEXT("TtkMonitorWindow");
+ TCHAR name[32] = TEXT("TtkMonitorClass");
wc.cbSize = sizeof(WNDCLASSEX);
wc.style = CS_HREDRAW | CS_VREDRAW;
diff --git a/win/ttkWinXPTheme.c b/win/ttkWinXPTheme.c
index 42e1e0e..1aa6393 100644
--- a/win/ttkWinXPTheme.c
+++ b/win/ttkWinXPTheme.c
@@ -1,5 +1,5 @@
/*
- * $Id: ttkWinXPTheme.c,v 1.26 2009/08/09 21:20:34 nijtmans Exp $
+ * $Id: ttkWinXPTheme.c,v 1.27 2010/04/29 15:28:04 nijtmans Exp $
*
* Tk theme engine which uses the Windows XP "Visual Styles" API
* Adapted from Georgios Petasis' XP theme patch.
@@ -101,7 +101,7 @@ LoadXPThemeProcs(HINSTANCE *phlib)
* if we are running at least on Windows XP.
*/
HINSTANCE handle;
- *phlib = handle = LoadLibrary("uxtheme.dll");
+ *phlib = handle = LoadLibrary(TEXT("uxtheme.dll"));
if (handle != 0)
{
/*