From 2b7bd1f817dcff7edea518893e064b90d953f645 Mon Sep 17 00:00:00 2001 From: Raymond Penners Date: Tue, 7 Oct 2003 18:03:34 +0000 Subject: [PATCH] IsThemeActive and dfns->defs --- modules/engines/ms-windows/ChangeLog.old | 29 ++++++++++++++----- modules/engines/ms-windows/xp_theme.c | 10 +++++-- .../{xp_theme_dfns.h => xp_theme_defs.h} | 0 3 files changed, 29 insertions(+), 10 deletions(-) rename modules/engines/ms-windows/{xp_theme_dfns.h => xp_theme_defs.h} (100%) diff --git a/modules/engines/ms-windows/ChangeLog.old b/modules/engines/ms-windows/ChangeLog.old index e89efada69..2d85003f5c 100755 --- a/modules/engines/ms-windows/ChangeLog.old +++ b/modules/engines/ms-windows/ChangeLog.old @@ -1,17 +1,31 @@ +2003-10-07 Raymond Penners + + * src/xp_theme.c: We now properly use IsThemeActive(). + + * src/xp_theme_defs.h: Renamed from xp_theme_dfns.h + 2003-10-06 Dom Lachowicz - * src/wimp_style_main.c: Catch system settings changes, disable theme and color changes as they're too experimental + * src/wimp_style_main.c: Catch system settings changes, disable + theme and color changes as they're too experimental + * src/wimp_style.[ch]: Export some things, make them accept 0 args - * src/xp_theme_dfns.h: New file. WinXP's UXTHEME constants, for building on platforms without them - * src/xp_theme.c: Should be able to build on Win32 != [WinXP,2k3] now + + * src/xp_theme_dfns.h: New file. WinXP's UXTHEME constants, for + building on platforms without them + + * src/xp_theme.c: Should be able to build on Win32 != [WinXP,2k3] + now 2003-10-03 Dom Lachowicz - * src/wimp_style.c wimp_style_main.c: Refactor how we're doing styles. Much faster, lower memory consumption + * src/wimp_style.c wimp_style_main.c: Refactor how we're doing + styles. Much faster, lower memory consumption 2003-10-03 Dom Lachowicz - * src/wimp_style_main.c: Catch theme and color changes. Needs more testing and fine-tuning + * src/wimp_style_main.c: Catch theme and color changes. Needs more + testing and fine-tuning 2003-10-02 Dom Lachowicz @@ -19,8 +33,9 @@ 2003-10-01 Dom Lachowicz - * src/wimp_style.c: Only set the delays if the param is installed. Silly gtk - - installing those 3 params only in the menus... + * src/wimp_style.c: Only set the delays if the param is + installed. Silly gtk - installing those 3 params only in the + menus... 2003-09-25 Dom Lachowicz diff --git a/modules/engines/ms-windows/xp_theme.c b/modules/engines/ms-windows/xp_theme.c index 190a429b55..e4aacf911b 100755 --- a/modules/engines/ms-windows/xp_theme.c +++ b/modules/engines/ms-windows/xp_theme.c @@ -31,7 +31,7 @@ /* MS defines this when it includes its schema definitions */ #ifndef TMSCHEMA_H -#include "xp_theme_dfns.h" +#include "xp_theme_defs.h" #endif static const LPCWSTR class_descriptors[] = @@ -109,12 +109,14 @@ typedef HRESULT (FAR PASCAL *DrawThemeBackgroundFunc) (HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pRect, const RECT *pClipRect); typedef HRESULT (FAR PASCAL *EnableThemeDialogTextureFunc)(HWND hwnd, DWORD dwFlags); +typedef BOOL (FAR PASCAL *IsThemeActiveFunc)(VOID); static GetThemeSysFontFunc get_theme_sys_font_func = NULL; static OpenThemeDataFunc open_theme_data_func = NULL; static CloseThemeDataFunc close_theme_data_func = NULL; static DrawThemeBackgroundFunc draw_theme_background_func = NULL; static EnableThemeDialogTextureFunc enable_theme_dialog_texture_func = NULL; +static IsThemeActiveFunc is_theme_active_func = NULL; void xp_theme_init(void) @@ -125,6 +127,7 @@ xp_theme_init(void) uxtheme_dll = LoadLibrary("uxtheme.dll"); memset(open_themes, 0, sizeof(open_themes)); + is_theme_active_func = (IsThemeActiveFunc) GetProcAddress(uxtheme_dll, "IsThemeActive"); open_theme_data_func = (OpenThemeDataFunc) GetProcAddress(uxtheme_dll, "OpenThemeData"); close_theme_data_func = (CloseThemeDataFunc) GetProcAddress(uxtheme_dll, "CloseThemeData"); draw_theme_background_func = (DrawThemeBackgroundFunc) GetProcAddress(uxtheme_dll, "DrawThemeBackground"); @@ -137,7 +140,7 @@ xp_theme_exit(void) { int i; - if(!uxtheme_dll) + if (! uxtheme_dll) return; for (i=0; i < XP_THEME_CLASS__SIZEOF; i++) @@ -152,6 +155,7 @@ xp_theme_exit(void) FreeLibrary(uxtheme_dll); uxtheme_dll = NULL; + is_theme_active_func = NULL; open_theme_data_func = NULL; close_theme_data_func = NULL; draw_theme_background_func = NULL; @@ -642,7 +646,7 @@ xp_theme_draw(GdkWindow *win, XpThemeElement element, GtkStyle *style, gboolean xp_theme_is_drawable(XpThemeElement element) { - if (uxtheme_dll) + if (is_theme_active_func && (*is_theme_active_func)()) { return (xp_theme_get_handle_by_element(element) != NULL); } diff --git a/modules/engines/ms-windows/xp_theme_dfns.h b/modules/engines/ms-windows/xp_theme_defs.h similarity index 100% rename from modules/engines/ms-windows/xp_theme_dfns.h rename to modules/engines/ms-windows/xp_theme_defs.h