summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjenglish <jenglish@flightlab.com>2007-04-10 18:14:24 (GMT)
committerjenglish <jenglish@flightlab.com>2007-04-10 18:14:24 (GMT)
commit61bd267e4576d68219584d4fed309983cd80a773 (patch)
tree6cbb64dd22d025e8ed46d33f6d6c96dadd07b8cd
parent3176b2f07414a59ba25f79a33186cd04f4e86b8a (diff)
downloadtk-61bd267e4576d68219584d4fed309983cd80a773.zip
tk-61bd267e4576d68219584d4fed309983cd80a773.tar.gz
tk-61bd267e4576d68219584d4fed309983cd80a773.tar.bz2
Skip OS version test, should work on Vista/Aero now as well as XP
[Fixes #1687299, thanks to George Petasis for tracking this down].
-rw-r--r--ChangeLog8
-rw-r--r--win/ttkWinXPTheme.c61
2 files changed, 32 insertions, 37 deletions
diff --git a/ChangeLog b/ChangeLog
index 1daab62..ee48f99 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2007-04-10 Joe English <jenglish@users.sourceforge.net>
+
+ * win/ttkWinMonitor.c, win/ttkWinXPTheme.c: Re-sync
+ with Tile codebase so patches can flow back and forth.
+ * win/ttkWinXPTheme.c: Skip OS version test, should work on
+ Vista/Aero now as well as XP [Fixes #1687299, thanks
+ to George Petasis for tracking this down].
+
2007-03-21 Joe English <jenglish@users.sourceforge.net>
* generic/ttk/ttkLayout.c(Ttk_BuildLayoutTemplate): BUGFIX:
diff --git a/win/ttkWinXPTheme.c b/win/ttkWinXPTheme.c
index 6e4ebe9..c10e964 100644
--- a/win/ttkWinXPTheme.c
+++ b/win/ttkWinXPTheme.c
@@ -1,5 +1,5 @@
/*
- * $Id: ttkWinXPTheme.c,v 1.10 2007/04/10 18:05:48 jenglish Exp $
+ * $Id: ttkWinXPTheme.c,v 1.11 2007/04/10 18:14:24 jenglish Exp $
*
* Tk theme engine which uses the Windows XP "Visual Styles" API
* Adapted from Georgios Petasis' XP theme patch.
@@ -90,50 +90,37 @@ typedef struct
static XPThemeProcs *
LoadXPThemeProcs(HINSTANCE *phlib)
{
- OSVERSIONINFO os;
-
/*
- * We have to check whether we are running at least on Windows XP.
- * In order to determine this we call GetVersionEx directly, although
- * it would be a good idea to wrap it inside a function similar to
- * TkWinGetPlatformId...
+ * Load the library "uxtheme.dll", where the native widget
+ * drawing routines are implemented. This will only succeed
+ * if we are running at least on Windows XP.
*/
- ZeroMemory(&os, sizeof(os));
- os.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
- GetVersionEx(&os);
- if (os.dwMajorVersion >= 5 && os.dwMinorVersion >= 1) {
+ HINSTANCE handle;
+ *phlib = handle = LoadLibrary("uxtheme.dll");
+ if (handle != 0)
+ {
/*
- * We are running under Windows XP or a newer version.
- * Load the library "uxtheme.dll", where the native widget
- * drawing routines are implemented.
+ * We have successfully loaded the library. Proceed in storing the
+ * addresses of the functions we want to use.
*/
- HINSTANCE handle;
- *phlib = handle = LoadLibrary("uxtheme.dll");
- if (handle != 0)
- {
- /*
- * We have successfully loaded the library. Proceed in storing the
- * addresses of the functions we want to use.
- */
- XPThemeProcs *procs = (XPThemeProcs*)ckalloc(sizeof(XPThemeProcs));
+ XPThemeProcs *procs = (XPThemeProcs*)ckalloc(sizeof(XPThemeProcs));
#define LOADPROC(name) \
(0 != (procs->name = (name ## Proc *)GetProcAddress(handle, #name) ))
- if ( LOADPROC(OpenThemeData)
- && LOADPROC(CloseThemeData)
- && LOADPROC(GetThemePartSize)
- && LOADPROC(DrawThemeBackground)
- && LOADPROC(GetThemeTextExtent)
- && LOADPROC(DrawThemeText)
- && LOADPROC(IsThemeActive)
- && LOADPROC(IsAppThemed)
- )
- {
- return procs;
- }
-#undef LOADPROC
- ckfree((char*)procs);
+ if ( LOADPROC(OpenThemeData)
+ && LOADPROC(CloseThemeData)
+ && LOADPROC(GetThemePartSize)
+ && LOADPROC(DrawThemeBackground)
+ && LOADPROC(GetThemeTextExtent)
+ && LOADPROC(DrawThemeText)
+ && LOADPROC(IsThemeActive)
+ && LOADPROC(IsAppThemed)
+ )
+ {
+ return procs;
}
+#undef LOADPROC
+ ckfree((char*)procs);
}
return 0;
}