Commit 5411a3a1 authored by Dom Lachowicz's avatar Dom Lachowicz Committed by Dom Lachowicz
Browse files

Bug #313627. Make win32 theme's handling of toolbars, handleboxes, and

2005-11-12  Dom Lachowicz <cinamod@hotmail.com>

	* modules/engines/ms-windows/msw_style.c: Bug #313627. Make win32
	theme's handling of toolbars, handleboxes, and menubars more in-line
	with Microsoft's IE style.
	* modules/engines/ms-windows/*.c: Indentation cleanups
parent 82f12b61
2005-11-12 Dom Lachowicz <cinamod@hotmail.com>
* modules/engines/ms-windows/msw_style.c: Bug #313627. Make win32
theme's handling of toolbars, handleboxes, and menubars more in-line
with Microsoft's IE style.
* modules/engines/ms-windows/*.c: Indentation cleanups
2005-11-12 Matthias Clasen <mclasen@redhat.com>
Make builtin icons work in gtk_window_set_icon_name()
......
2005-11-12 Dom Lachowicz <cinamod@hotmail.com>
* modules/engines/ms-windows/msw_style.c: Bug #313627. Make win32
theme's handling of toolbars, handleboxes, and menubars more in-line
with Microsoft's IE style.
* modules/engines/ms-windows/*.c: Indentation cleanups
2005-11-12 Matthias Clasen <mclasen@redhat.com>
Make builtin icons work in gtk_window_set_icon_name()
......
......@@ -23,19 +23,18 @@
#include "msw_style.h"
#include "msw_rc_style.h"
static void msw_rc_style_init (MswRcStyle *style);
static void msw_rc_style_class_init (MswRcStyleClass *klass);
static GtkStyle *msw_rc_style_create_style (GtkRcStyle *rc_style);
static void msw_rc_style_init (MswRcStyle * style);
static void msw_rc_style_class_init (MswRcStyleClass * klass);
static GtkStyle *msw_rc_style_create_style (GtkRcStyle * rc_style);
static GtkRcStyleClass *parent_class;
GType msw_type_rc_style = 0;
void
msw_rc_style_register_type (GTypeModule *module)
msw_rc_style_register_type (GTypeModule * module)
{
static const GTypeInfo object_info =
{
static const GTypeInfo object_info = {
sizeof (MswRcStyleClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
......@@ -54,12 +53,12 @@ msw_rc_style_register_type (GTypeModule *module)
}
static void
msw_rc_style_init (MswRcStyle *style)
msw_rc_style_init (MswRcStyle * style)
{
}
static void
msw_rc_style_class_init (MswRcStyleClass *klass)
msw_rc_style_class_init (MswRcStyleClass * klass)
{
GtkRcStyleClass *rc_style_class = GTK_RC_STYLE_CLASS (klass);
......@@ -71,8 +70,7 @@ msw_rc_style_class_init (MswRcStyleClass *klass)
/* Create an empty style suitable to this RC style
*/
static GtkStyle *
msw_rc_style_create_style (GtkRcStyle *rc_style)
msw_rc_style_create_style (GtkRcStyle * rc_style)
{
return g_object_new (MSW_TYPE_STYLE, NULL);
}
This diff is collapsed.
......@@ -34,13 +34,11 @@
#define WM_THEMECHANGED 0x031A /* winxp only */
#endif
static GModule * this_module = NULL;
static GModule *this_module = NULL;
static void (*msw_rc_reset_styles) (GtkSettings * settings) = NULL;
static GdkFilterReturn
global_filter_func (void *xevent,
GdkEvent *event,
gpointer data)
global_filter_func (void *xevent, GdkEvent * event, gpointer data)
{
MSG *msg = (MSG *) xevent;
......@@ -50,12 +48,13 @@ global_filter_func (void *xevent,
case WM_THEMECHANGED:
case WM_SYSCOLORCHANGE:
if(msw_rc_reset_styles != NULL) {
if (msw_rc_reset_styles != NULL)
{
xp_theme_reset ();
msw_style_init ();
/* force all gtkwidgets to redraw */
(*msw_rc_reset_styles) (gtk_settings_get_default());
(*msw_rc_reset_styles) (gtk_settings_get_default ());
}
return GDK_FILTER_REMOVE;
......@@ -71,20 +70,21 @@ global_filter_func (void *xevent,
}
G_MODULE_EXPORT void
theme_init (GTypeModule *module)
theme_init (GTypeModule * module)
{
msw_rc_style_register_type (module);
msw_style_register_type (module);
/* this craziness is required because only gtk 2.4.x and later have
gtk_rc_reset_styles(). But we want to be able to run acceptly well
on any GTK 2.x.x platform. */
if(gtk_check_version(2,4,0) == NULL) {
this_module = g_module_open(NULL, 0);
gtk_rc_reset_styles(). But we want to be able to run acceptly well on
any GTK 2.x.x platform. */
if (gtk_check_version (2, 4, 0) == NULL)
{
this_module = g_module_open (NULL, 0);
if(this_module)
if (this_module)
g_module_symbol (this_module, "gtk_rc_reset_styles",
(gpointer *)(&msw_rc_reset_styles));
(gpointer *) (&msw_rc_reset_styles));
}
msw_style_init ();
......@@ -96,8 +96,9 @@ theme_exit (void)
{
gdk_window_remove_filter (NULL, global_filter_func, NULL);
if(this_module) {
g_module_close(this_module);
if (this_module)
{
g_module_close (this_module);
this_module = NULL;
}
}
......@@ -112,8 +113,8 @@ theme_create_rc_style (void)
* is loaded and checks to see if we are compatible with the
* version of GTK+ that loads us.
*/
G_MODULE_EXPORT const gchar*
g_module_check_init (GModule *module)
G_MODULE_EXPORT const gchar *
g_module_check_init (GModule * module)
{
return gtk_check_version (2,0,0);
return gtk_check_version (2, 0, 0);
}
......@@ -42,6 +42,7 @@
#endif
#ifndef TMT_CAPTIONFONT
/* These aren't in mingw's "w32api" headers, nor in the Platform SDK
* headers.
*/
......@@ -80,8 +81,7 @@
#define TRS_NORMAL 1
static const LPCWSTR class_descriptors[] =
{
static const LPCWSTR class_descriptors[] = {
L"Scrollbar", /* XP_THEME_CLASS_SCROLLBAR */
L"Button", /* XP_THEME_CLASS_BUTTON */
L"Header", /* XP_THEME_CLASS_HEADER */
......@@ -101,8 +101,7 @@ static const LPCWSTR class_descriptors[] =
L"Trackbar" /* XP_THEME_CLASS_TRACKBAR */
};
static const short element_part_map[]=
{
static const short element_part_map[] = {
BP_CHECKBOX,
BP_CHECKBOX,
BP_PUSHBUTTON,
......@@ -135,7 +134,7 @@ static const short element_part_map[]=
PP_BAR,
PP_BARVERT,
TTP_STANDARD,
0 /*RP_BAND*/,
0 /* RP_BAND */ ,
RP_GRIPPER,
RP_GRIPPERVERT,
RP_CHEVRON,
......@@ -159,22 +158,28 @@ static const short element_part_map[]=
static HINSTANCE uxtheme_dll = NULL;
static HTHEME open_themes[XP_THEME_CLASS__SIZEOF];
typedef HRESULT (FAR PASCAL *GetThemeSysFontFunc)
(HTHEME hTheme, int iFontID, OUT LOGFONT *plf);
typedef int (FAR PASCAL *GetThemeSysSizeFunc)
(HTHEME hTheme, int iSizeId);
typedef COLORREF (FAR PASCAL *GetThemeSysColorFunc)(HTHEME hTheme, int iColorID);
typedef HTHEME (FAR PASCAL *OpenThemeDataFunc)
(HWND hwnd, LPCWSTR pszClassList);
typedef HRESULT (FAR PASCAL *CloseThemeDataFunc)(HTHEME theme);
typedef HRESULT (FAR PASCAL *DrawThemeBackgroundFunc)
typedef HRESULT (FAR PASCAL * GetThemeSysFontFunc)
(HTHEME hTheme, int iFontID, OUT LOGFONT * plf);
typedef int (FAR PASCAL * GetThemeSysSizeFunc) (HTHEME hTheme, int iSizeId);
typedef COLORREF (FAR PASCAL * GetThemeSysColorFunc) (HTHEME hTheme,
int iColorID);
typedef HTHEME (FAR PASCAL * OpenThemeDataFunc) (HWND hwnd,
LPCWSTR pszClassList);
typedef HRESULT (FAR PASCAL * CloseThemeDataFunc) (HTHEME theme);
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);
typedef BOOL (FAR PASCAL *IsAppThemedFunc)(VOID);
typedef BOOL (FAR PASCAL *IsThemeBackgroundPartiallyTransparentFunc)(HTHEME hTheme, int iPartId, int iStateId);
typedef HRESULT (FAR PASCAL *DrawThemeParentBackgroundFunc)(HWND hwnd, HDC hdc, RECT *prc);
const RECT * pRect, const RECT * pClipRect);
typedef HRESULT (FAR PASCAL * EnableThemeDialogTextureFunc) (HWND hwnd,
DWORD dwFlags);
typedef BOOL (FAR PASCAL * IsThemeActiveFunc) (VOID);
typedef BOOL (FAR PASCAL * IsAppThemedFunc) (VOID);
typedef BOOL (FAR PASCAL *
IsThemeBackgroundPartiallyTransparentFunc) (HTHEME hTheme,
int iPartId,
int iStateId);
typedef HRESULT (FAR PASCAL * DrawThemeParentBackgroundFunc) (HWND hwnd,
HDC hdc,
RECT * prc);
static GetThemeSysFontFunc get_theme_sys_font_func = NULL;
static GetThemeSysColorFunc get_theme_sys_color_func = NULL;
......@@ -185,7 +190,8 @@ static DrawThemeBackgroundFunc draw_theme_background_func = NULL;
static EnableThemeDialogTextureFunc enable_theme_dialog_texture_func = NULL;
static IsThemeActiveFunc is_theme_active_func = NULL;
static IsAppThemedFunc is_app_themed_func = NULL;
static IsThemeBackgroundPartiallyTransparentFunc is_theme_partially_transparent_func = NULL;
static IsThemeBackgroundPartiallyTransparentFunc
is_theme_partially_transparent_func = NULL;
static DrawThemeParentBackgroundFunc draw_theme_parent_background_func = NULL;
static void
......@@ -193,7 +199,7 @@ xp_theme_close_open_handles (void)
{
int i;
for (i=0; i < XP_THEME_CLASS__SIZEOF; i++)
for (i = 0; i < XP_THEME_CLASS__SIZEOF; i++)
{
if (open_themes[i])
{
......@@ -209,25 +215,48 @@ xp_theme_init (void)
if (uxtheme_dll)
return;
memset(open_themes, 0, sizeof(open_themes));
memset (open_themes, 0, sizeof (open_themes));
uxtheme_dll = LoadLibrary("uxtheme.dll");
uxtheme_dll = LoadLibrary ("uxtheme.dll");
if (!uxtheme_dll)
return;
is_app_themed_func = (IsAppThemedFunc) GetProcAddress(uxtheme_dll, "IsAppThemed");
is_app_themed_func =
(IsAppThemedFunc) GetProcAddress (uxtheme_dll, "IsAppThemed");
if(is_app_themed_func) {
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");
enable_theme_dialog_texture_func = (EnableThemeDialogTextureFunc) GetProcAddress(uxtheme_dll, "EnableThemeDialogTexture");
get_theme_sys_font_func = (GetThemeSysFontFunc) GetProcAddress(uxtheme_dll, "GetThemeSysFont");
get_theme_sys_color_func = (GetThemeSysColorFunc) GetProcAddress(uxtheme_dll, "GetThemeSysColor");
get_theme_sys_metric_func = (GetThemeSysSizeFunc) GetProcAddress(uxtheme_dll, "GetThemeSysSize");
is_theme_partially_transparent_func = (IsThemeBackgroundPartiallyTransparentFunc) GetProcAddress(uxtheme_dll, "IsThemeBackgroundPartiallyTransparent");
draw_theme_parent_background_func = (DrawThemeParentBackgroundFunc) GetProcAddress(uxtheme_dll, "DrawThemeParentBackground");
if (is_app_themed_func)
{
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");
enable_theme_dialog_texture_func =
(EnableThemeDialogTextureFunc) GetProcAddress (uxtheme_dll,
"EnableThemeDialogTexture");
get_theme_sys_font_func =
(GetThemeSysFontFunc) GetProcAddress (uxtheme_dll,
"GetThemeSysFont");
get_theme_sys_color_func =
(GetThemeSysColorFunc) GetProcAddress (uxtheme_dll,
"GetThemeSysColor");
get_theme_sys_metric_func =
(GetThemeSysSizeFunc) GetProcAddress (uxtheme_dll,
"GetThemeSysSize");
is_theme_partially_transparent_func =
(IsThemeBackgroundPartiallyTransparentFunc)
GetProcAddress (uxtheme_dll,
"IsThemeBackgroundPartiallyTransparent");
draw_theme_parent_background_func =
(DrawThemeParentBackgroundFunc) GetProcAddress (uxtheme_dll,
"DrawThemeParentBackground");
}
}
......@@ -240,7 +269,7 @@ xp_theme_reset (void)
void
xp_theme_exit (void)
{
if (! uxtheme_dll)
if (!uxtheme_dll)
return;
xp_theme_close_open_handles ();
......@@ -266,7 +295,8 @@ xp_theme_get_handle_by_class (XpThemeClass klazz)
{
if (!open_themes[klazz] && open_theme_data_func)
{
open_themes[klazz] = open_theme_data_func(NULL, class_descriptors[klazz]);
open_themes[klazz] =
open_theme_data_func (NULL, class_descriptors[klazz]);
}
return open_themes[klazz];
}
......@@ -277,7 +307,7 @@ xp_theme_get_handle_by_element (XpThemeElement element)
HTHEME ret = NULL;
XpThemeClass klazz = XP_THEME_CLASS__SIZEOF;
switch(element)
switch (element)
{
case XP_THEME_ELEMENT_TOOLTIP:
klazz = XP_THEME_CLASS_TOOLTIP;
......@@ -394,7 +424,7 @@ xp_theme_map_gtk_state (XpThemeElement element, GtkStateType state)
{
int ret = 0;
switch(element)
switch (element)
{
case XP_THEME_ELEMENT_TOOLTIP:
ret = TTSS_NORMAL;
......@@ -457,7 +487,7 @@ xp_theme_map_gtk_state (XpThemeElement element, GtkStateType state)
case XP_THEME_ELEMENT_TAB_ITEM_LEFT_EDGE:
case XP_THEME_ELEMENT_TAB_ITEM:
switch(state)
switch (state)
{
case GTK_STATE_PRELIGHT:
ret = TIS_HOT;
......@@ -475,7 +505,7 @@ xp_theme_map_gtk_state (XpThemeElement element, GtkStateType state)
break;
case XP_THEME_ELEMENT_EDIT_TEXT:
switch(state)
switch (state)
{
case GTK_STATE_PRELIGHT:
ret = ETS_FOCUSED;
......@@ -497,7 +527,7 @@ xp_theme_map_gtk_state (XpThemeElement element, GtkStateType state)
case XP_THEME_ELEMENT_SCROLLBAR_H:
case XP_THEME_ELEMENT_SCROLLBAR_V:
switch(state)
switch (state)
{
case GTK_STATE_SELECTED:
case GTK_STATE_ACTIVE:
......@@ -515,7 +545,7 @@ xp_theme_map_gtk_state (XpThemeElement element, GtkStateType state)
break;
case XP_THEME_ELEMENT_ARROW_DOWN:
switch(state)
switch (state)
{
case GTK_STATE_ACTIVE:
ret = ABS_DOWNPRESSED;
......@@ -532,7 +562,7 @@ xp_theme_map_gtk_state (XpThemeElement element, GtkStateType state)
break;
case XP_THEME_ELEMENT_ARROW_UP:
switch(state)
switch (state)
{
case GTK_STATE_ACTIVE:
ret = ABS_UPPRESSED;
......@@ -549,7 +579,7 @@ xp_theme_map_gtk_state (XpThemeElement element, GtkStateType state)
break;
case XP_THEME_ELEMENT_ARROW_LEFT:
switch(state)
switch (state)
{
case GTK_STATE_ACTIVE:
ret = ABS_LEFTPRESSED;
......@@ -566,7 +596,7 @@ xp_theme_map_gtk_state (XpThemeElement element, GtkStateType state)
break;
case XP_THEME_ELEMENT_ARROW_RIGHT:
switch(state)
switch (state)
{
case GTK_STATE_ACTIVE:
ret = ABS_RIGHTPRESSED;
......@@ -584,7 +614,7 @@ xp_theme_map_gtk_state (XpThemeElement element, GtkStateType state)
case XP_THEME_ELEMENT_CHECKBOX:
case XP_THEME_ELEMENT_RADIO_BUTTON:
switch(state)
switch (state)
{
case GTK_STATE_SELECTED:
ret = CBS_UNCHECKEDPRESSED;
......@@ -602,7 +632,7 @@ xp_theme_map_gtk_state (XpThemeElement element, GtkStateType state)
case XP_THEME_ELEMENT_PRESSED_CHECKBOX:
case XP_THEME_ELEMENT_PRESSED_RADIO_BUTTON:
switch(state)
switch (state)
{
case GTK_STATE_SELECTED:
ret = CBS_CHECKEDPRESSED;
......@@ -619,7 +649,7 @@ xp_theme_map_gtk_state (XpThemeElement element, GtkStateType state)
break;
case XP_THEME_ELEMENT_DEFAULT_BUTTON:
switch(state)
switch (state)
{
case GTK_STATE_ACTIVE:
ret = PBS_PRESSED;
......@@ -636,7 +666,7 @@ xp_theme_map_gtk_state (XpThemeElement element, GtkStateType state)
break;
case XP_THEME_ELEMENT_SPIN_BUTTON_DOWN:
switch(state)
switch (state)
{
case GTK_STATE_ACTIVE:
ret = DNS_PRESSED;
......@@ -653,7 +683,7 @@ xp_theme_map_gtk_state (XpThemeElement element, GtkStateType state)
break;
case XP_THEME_ELEMENT_SPIN_BUTTON_UP:
switch(state)
switch (state)
{
case GTK_STATE_ACTIVE:
ret = UPS_PRESSED;
......@@ -686,7 +716,8 @@ xp_theme_map_gtk_state (XpThemeElement element, GtkStateType state)
case XP_THEME_ELEMENT_MENU_ITEM:
case XP_THEME_ELEMENT_MENU_SEPARATOR:
switch(state) {
switch (state)
{
case GTK_STATE_SELECTED:
ret = MS_SELECTED;
break;
......@@ -699,7 +730,8 @@ xp_theme_map_gtk_state (XpThemeElement element, GtkStateType state)
break;
case XP_THEME_ELEMENT_LINE_H:
switch(state) {
switch (state)
{
/* LHS_FLAT, LHS_RAISED, LHS_SUNKEN */
ret = LHS_RAISED;
break;
......@@ -707,7 +739,8 @@ xp_theme_map_gtk_state (XpThemeElement element, GtkStateType state)
break;
case XP_THEME_ELEMENT_LINE_V:
switch(state) {
switch (state)
{
/* LVS_FLAT, LVS_RAISED, LVS_SUNKEN */
ret = LVS_RAISED;
break;
......@@ -720,7 +753,7 @@ xp_theme_map_gtk_state (XpThemeElement element, GtkStateType state)
break;
default:
switch(state)
switch (state)
{
case GTK_STATE_ACTIVE:
ret = PBS_PRESSED;
......@@ -739,9 +772,9 @@ xp_theme_map_gtk_state (XpThemeElement element, GtkStateType state)
}
gboolean
xp_theme_draw (GdkWindow *win, XpThemeElement element, GtkStyle *style,
xp_theme_draw (GdkWindow * win, XpThemeElement element, GtkStyle * style,
int x, int y, int width, int height,
GtkStateType state_type, GdkRectangle *area)
GtkStateType state_type, GdkRectangle * area)
{
HTHEME theme;
RECT rect, clip, *pClip;
......@@ -750,17 +783,17 @@ xp_theme_draw (GdkWindow *win, XpThemeElement element, GtkStyle *style,
GdkDrawable *drawable;
int part_state;
if (! xp_theme_is_drawable (element))
if (!xp_theme_is_drawable (element))
return FALSE;
theme = xp_theme_get_handle_by_element(element);
theme = xp_theme_get_handle_by_element (element);
if (!theme)
return FALSE;
/* FIXME: Recheck its function */
enable_theme_dialog_texture_func(GDK_WINDOW_HWND(win), ETDT_ENABLETAB);
enable_theme_dialog_texture_func (GDK_WINDOW_HWND (win), ETDT_ENABLETAB);
if (!GDK_IS_WINDOW(win))
if (!GDK_IS_WINDOW (win))
{
xoff = 0;
yoff = 0;
......@@ -768,7 +801,7 @@ xp_theme_draw (GdkWindow *win, XpThemeElement element, GtkStyle *style,
}
else
{
gdk_window_get_internal_paint_info(win, &drawable, &xoff, &yoff);
gdk_window_get_internal_paint_info (win, &drawable, &xoff, &yoff);
}
rect.left = x - xoff;
......@@ -791,14 +824,15 @@ xp_theme_draw (GdkWindow *win, XpThemeElement element, GtkStyle *style,
}
gdk_gc_set_clip_rectangle (style->dark_gc[state_type], NULL);
dc = gdk_win32_hdc_get(drawable, style->dark_gc[state_type], 0);
dc = gdk_win32_hdc_get (drawable, style->dark_gc[state_type], 0);
if (!dc)
return FALSE;
part_state = xp_theme_map_gtk_state(element, state_type);
part_state = xp_theme_map_gtk_state (element, state_type);
draw_theme_background_func(theme, dc, element_part_map[element], part_state, &rect, pClip);
gdk_win32_hdc_release(drawable, style->dark_gc[state_type], 0);
draw_theme_background_func (theme, dc, element_part_map[element],
part_state, &rect, pClip);
gdk_win32_hdc_release (drawable, style->dark_gc[state_type], 0);
return TRUE;
}
......@@ -831,11 +865,12 @@ xp_theme_is_drawable (XpThemeElement element)
}
gboolean
xp_theme_get_system_font (XpThemeClass klazz, XpThemeFont fontId, OUT LOGFONT *lf)
xp_theme_get_system_font (XpThemeClass klazz, XpThemeFont fontId,
OUT LOGFONT * lf)
{
if (xp_theme_is_active () && get_theme_sys_font_func != NULL)
{
HTHEME theme = xp_theme_get_handle_by_class(klazz);
HTHEME theme = xp_theme_get_handle_by_class (klazz);
int themeFont;
if (!theme)
......@@ -844,45 +879,57 @@ xp_theme_get_system_font (XpThemeClass klazz, XpThemeFont fontId, OUT LOGFONT *l
switch (fontId)
{
case XP_THEME_FONT_CAPTION:
themeFont = TMT_CAPTIONFONT; break;
themeFont = TMT_CAPTIONFONT;
break;
case XP_THEME_FONT_MENU:
themeFont = TMT_MENUFONT; break;
themeFont = TMT_MENUFONT;
break;
case XP_THEME_FONT_STATUS:
themeFont = TMT_STATUSFONT; break;
themeFont = TMT_STATUSFONT;
break;
case XP_THEME_FONT_MESSAGE:
default:
themeFont = TMT_MSGBOXFONT; break;
themeFont = TMT_MSGBOXFONT;
break;
}
/* if theme is NULL, it will just return the GetSystemFont() value */
return ((*get_theme_sys_font_func)(theme, themeFont, lf) == S_OK);
/* if theme is NULL, it will just return the GetSystemFont()
value */
return ((*get_theme_sys_font_func) (theme, themeFont, lf) ==
S_OK);
}
return FALSE;
}
gboolean
xp_theme_get_system_color (XpThemeClass klazz, int colorId, OUT DWORD * pColor)
xp_theme_get_system_color (XpThemeClass klazz, int colorId,
OUT DWORD * pColor)
{
if (xp_theme_is_active () && get_theme_sys_color_func != NULL)
{
HTHEME theme = xp_theme_get_handle_by_class(klazz);
HTHEME theme = xp_theme_get_handle_by_class (klazz);
/* if theme is NULL, it will just return the GetSystemColor() value */
*pColor = (*get_theme_sys_color_func)(theme, colorId);
/* if theme is NULL, it will just return the GetSystemColor()
value */
*pColor = (*get_theme_sys_color_func) (theme, colorId);
return TRUE;
}
return FALSE;
}
gboolean
xp_theme_get_system_metric (XpThemeClass klazz, int metricId, OUT int * pVal)
xp_theme_get_system_metric (XpThemeClass klazz, int metricId, OUT int *pVal)