From 61bd267e4576d68219584d4fed309983cd80a773 Mon Sep 17 00:00:00 2001 From: jenglish Date: Tue, 10 Apr 2007 18:14:24 +0000 Subject: Skip OS version test, should work on Vista/Aero now as well as XP [Fixes #1687299, thanks to George Petasis for tracking this down]. --- ChangeLog | 8 +++++++ win/ttkWinXPTheme.c | 61 +++++++++++++++++++++-------------------------------- 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 + + * 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 * 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; } -- cgit v0.12