fix inkscape's toolbar buttons, disable application theming if asked nicely, downgrade gtk+ requirements
This commit is contained in:
@ -1,3 +1,12 @@
|
|||||||
|
2004-06-02 Dom Lachowicz <cinamod@hotmail.com>
|
||||||
|
|
||||||
|
* configure.in: Bump version number (0.6.1)
|
||||||
|
* src/msw_theme_main.c: Lower GTK+ requirements. We'll work fine on 2.0.x or better
|
||||||
|
* src/xp_theme_defs.h: Remove HAVE_LINES junk
|
||||||
|
* src/xp_theme.c: Disable application theming if XP asks us to
|
||||||
|
* src/msw_style.c: Return true for 'is_toolbar()' check if our parent
|
||||||
|
is a GtkHandleBox. This fixes Inkscape's toolbar icons.
|
||||||
|
|
||||||
2004-05-21 Raymond Penners <raymond@dotsphinx.com>
|
2004-05-21 Raymond Penners <raymond@dotsphinx.com>
|
||||||
|
|
||||||
* === Released 0.6.0 ===
|
* === Released 0.6.0 ===
|
||||||
|
|||||||
@ -1335,7 +1335,7 @@ static gboolean is_toolbar_child(GtkWidget * wid)
|
|||||||
{
|
{
|
||||||
while(wid)
|
while(wid)
|
||||||
{
|
{
|
||||||
if(GTK_IS_TOOLBAR(wid))
|
if(GTK_IS_TOOLBAR(wid) || GTK_IS_HANDLE_BOX(wid))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
else
|
else
|
||||||
wid = wid->parent;
|
wid = wid->parent;
|
||||||
|
|||||||
@ -113,7 +113,5 @@ G_MODULE_EXPORT const gchar* g_module_check_init (GModule *module);
|
|||||||
const gchar*
|
const gchar*
|
||||||
g_module_check_init (GModule *module)
|
g_module_check_init (GModule *module)
|
||||||
{
|
{
|
||||||
return gtk_check_version (GTK_MAJOR_VERSION,
|
return gtk_check_version (2,0,0);
|
||||||
GTK_MINOR_VERSION,
|
|
||||||
GTK_MICRO_VERSION - GTK_INTERFACE_AGE);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -115,6 +115,7 @@ typedef HRESULT (FAR PASCAL *DrawThemeBackgroundFunc)
|
|||||||
const RECT *pRect, const RECT *pClipRect);
|
const RECT *pRect, const RECT *pClipRect);
|
||||||
typedef HRESULT (FAR PASCAL *EnableThemeDialogTextureFunc)(HWND hwnd, DWORD dwFlags);
|
typedef HRESULT (FAR PASCAL *EnableThemeDialogTextureFunc)(HWND hwnd, DWORD dwFlags);
|
||||||
typedef BOOL (FAR PASCAL *IsThemeActiveFunc)(VOID);
|
typedef BOOL (FAR PASCAL *IsThemeActiveFunc)(VOID);
|
||||||
|
typedef BOOL (FAR PASCAL *IsAppThemedFunc)(VOID);
|
||||||
|
|
||||||
static GetThemeSysFontFunc get_theme_sys_font_func = NULL;
|
static GetThemeSysFontFunc get_theme_sys_font_func = NULL;
|
||||||
static GetThemeSysColorFunc get_theme_sys_color_func = NULL;
|
static GetThemeSysColorFunc get_theme_sys_color_func = NULL;
|
||||||
@ -124,8 +125,7 @@ static CloseThemeDataFunc close_theme_data_func = NULL;
|
|||||||
static DrawThemeBackgroundFunc draw_theme_background_func = NULL;
|
static DrawThemeBackgroundFunc draw_theme_background_func = NULL;
|
||||||
static EnableThemeDialogTextureFunc enable_theme_dialog_texture_func = NULL;
|
static EnableThemeDialogTextureFunc enable_theme_dialog_texture_func = NULL;
|
||||||
static IsThemeActiveFunc is_theme_active_func = NULL;
|
static IsThemeActiveFunc is_theme_active_func = NULL;
|
||||||
|
static IsAppThemedFunc is_app_themed_func = NULL;
|
||||||
static gboolean was_theming_active = FALSE;
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
xp_theme_close_open_handles (void)
|
xp_theme_close_open_handles (void)
|
||||||
@ -152,31 +152,27 @@ xp_theme_init (void)
|
|||||||
|
|
||||||
uxtheme_dll = LoadLibrary("uxtheme.dll");
|
uxtheme_dll = LoadLibrary("uxtheme.dll");
|
||||||
if (!uxtheme_dll) {
|
if (!uxtheme_dll) {
|
||||||
was_theming_active = FALSE;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
is_theme_active_func = (IsThemeActiveFunc) GetProcAddress(uxtheme_dll, "IsThemeActive");
|
is_app_themed_func = (IsAppThemedFunc) GetProcAddress(uxtheme_dll, "IsAppThemed");
|
||||||
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");
|
|
||||||
|
|
||||||
if (is_theme_active_func)
|
if(is_app_themed_func) {
|
||||||
{
|
is_theme_active_func = (IsThemeActiveFunc) GetProcAddress(uxtheme_dll, "IsThemeActive");
|
||||||
was_theming_active = (*is_theme_active_func) ();
|
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");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
xp_theme_reset (void)
|
xp_theme_reset (void)
|
||||||
{
|
{
|
||||||
xp_theme_close_open_handles ();
|
xp_theme_close_open_handles ();
|
||||||
was_theming_active = is_theme_active_func
|
|
||||||
? (*is_theme_active_func) () : FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -190,6 +186,7 @@ xp_theme_exit (void)
|
|||||||
FreeLibrary (uxtheme_dll);
|
FreeLibrary (uxtheme_dll);
|
||||||
uxtheme_dll = NULL;
|
uxtheme_dll = NULL;
|
||||||
|
|
||||||
|
is_app_themed_func = NULL;
|
||||||
is_theme_active_func = NULL;
|
is_theme_active_func = NULL;
|
||||||
open_theme_data_func = NULL;
|
open_theme_data_func = NULL;
|
||||||
close_theme_data_func = NULL;
|
close_theme_data_func = NULL;
|
||||||
@ -705,26 +702,29 @@ xp_theme_draw (GdkWindow *win, XpThemeElement element, GtkStyle *style,
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
xp_theme_is_active (void)
|
||||||
|
{
|
||||||
|
gboolean active = FALSE;
|
||||||
|
|
||||||
|
if (is_app_themed_func)
|
||||||
|
{
|
||||||
|
active = (*is_app_themed_func) ();
|
||||||
|
|
||||||
|
if (active && is_theme_active_func)
|
||||||
|
{
|
||||||
|
active = (*is_theme_active_func) ();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return active;
|
||||||
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
xp_theme_is_drawable (XpThemeElement element)
|
xp_theme_is_drawable (XpThemeElement element)
|
||||||
{
|
{
|
||||||
if (is_theme_active_func)
|
if (xp_theme_is_active ())
|
||||||
{
|
return (xp_theme_get_handle_by_element (element) != NULL);
|
||||||
gboolean active = (*is_theme_active_func) ();
|
|
||||||
/* A bit of a hack, but it at least detects theme
|
|
||||||
switches between XP and classic looks on systems
|
|
||||||
using older GTK+ version (2.2.0-?) that do not
|
|
||||||
support theme switch detection (gdk_window_add_filter). */
|
|
||||||
if (active != was_theming_active)
|
|
||||||
{
|
|
||||||
xp_theme_reset ();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (active)
|
|
||||||
{
|
|
||||||
return (xp_theme_get_handle_by_element (element) != NULL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -159,19 +159,4 @@ typedef HANDLE HTHEME;
|
|||||||
#define TMT_STATUSFONT 804
|
#define TMT_STATUSFONT 804
|
||||||
#define TMT_MSGBOXFONT 805
|
#define TMT_MSGBOXFONT 805
|
||||||
|
|
||||||
#if UXTHEME_HAS_LINES
|
|
||||||
|
|
||||||
#error unknown/undocumented uxtheme values
|
|
||||||
|
|
||||||
/* #define GP_LINEHORZ */
|
|
||||||
/* #define GP_LINEVERT */
|
|
||||||
/* #define LHS_RAISED */
|
|
||||||
/* #define LHS_SUNKEN */
|
|
||||||
/* #define LHS_FLAT */
|
|
||||||
/* #define LVS_RAISED */
|
|
||||||
/* #define LVS_SUNKEN */
|
|
||||||
/* #define LHS_FLAT */
|
|
||||||
|
|
||||||
#endif /* UXTHEME_HAS_LINES */
|
|
||||||
|
|
||||||
#endif /* XP_THEME_DFNS_H */
|
#endif /* XP_THEME_DFNS_H */
|
||||||
|
|||||||
Reference in New Issue
Block a user