]> Pileus Git - ~andy/gtk/commitdiff
fix inkscape's toolbar buttons, disable application theming if asked nicely, downgrad...
authorcinamod <cinamod>
Wed, 2 Jun 2004 19:53:55 +0000 (19:53 +0000)
committercinamod <cinamod>
Wed, 2 Jun 2004 19:53:55 +0000 (19:53 +0000)
modules/engines/ms-windows/ChangeLog.old
modules/engines/ms-windows/msw_style.c
modules/engines/ms-windows/msw_theme_main.c
modules/engines/ms-windows/xp_theme.c
modules/engines/ms-windows/xp_theme_defs.h

index 9f0eadec9ef8dd9a330c7c9d583630098d3e3e93..6639cd26654aca4b8823d0ac3a1d9abbbbbb6b1a 100755 (executable)
@@ -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>
 
        * === Released 0.6.0 ===
index cbb0ce91544809a5b939816e3aeb394c6a0a872e..6ffa0c0a093bef3b8b22f8205ce8a52be4bb8f44 100755 (executable)
@@ -1335,7 +1335,7 @@ static gboolean is_toolbar_child(GtkWidget * wid)
 {
        while(wid)
        {
-               if(GTK_IS_TOOLBAR(wid))
+               if(GTK_IS_TOOLBAR(wid) || GTK_IS_HANDLE_BOX(wid))
                        return TRUE;
                else
                        wid = wid->parent;
index da268e09e617bbaae11916569031e6de23918f8a..ea399bec9985a008433c5325d95e0d5bebfeef44 100755 (executable)
@@ -46,15 +46,15 @@ global_filter_func (void     *xevent,
       /* catch theme changes */\r
     case WM_THEMECHANGED:\r
     case WM_SYSCOLORCHANGE:\r
-      \r
+\r
       if(msw_reset_rc_styles != NULL) {\r
        xp_theme_reset ();\r
        msw_style_init ();\r
-       \r
+\r
        /* force all gtkwidgets to redraw */\r
        (*msw_reset_rc_styles) (gtk_settings_get_default());\r
       }\r
-      \r
+\r
       return GDK_FILTER_REMOVE;\r
 \r
     case WM_SETTINGCHANGE:\r
@@ -78,12 +78,12 @@ theme_init (GTypeModule *module)
      on any GTK 2.x.x platform. */\r
   if(gtk_check_version(2,4,0) == NULL) {\r
     this_module = g_module_open(NULL, 0);\r
-    \r
+\r
     if(this_module)\r
       g_module_symbol (this_module, "gtk_rc_reset_styles",\r
                       (gpointer *)(&msw_reset_rc_styles));\r
   }\r
-  \r
+\r
   msw_style_init ();\r
   gdk_window_add_filter (NULL, global_filter_func, NULL);\r
 }\r
@@ -113,7 +113,5 @@ G_MODULE_EXPORT const gchar* g_module_check_init (GModule *module);
 const gchar*\r
 g_module_check_init (GModule *module)\r
 {\r
-  return gtk_check_version (GTK_MAJOR_VERSION,\r
-                           GTK_MINOR_VERSION,\r
-                           GTK_MICRO_VERSION - GTK_INTERFACE_AGE);\r
+  return gtk_check_version (2,0,0);\r
 }\r
index ce0f0915d720592e6cf0d120c3bd64c748eda998..3c27f236c366205f2f5621b7569126c366dfaa0a 100755 (executable)
@@ -115,6 +115,7 @@ typedef HRESULT (FAR PASCAL *DrawThemeBackgroundFunc)
       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);
 
 static GetThemeSysFontFunc get_theme_sys_font_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 EnableThemeDialogTextureFunc enable_theme_dialog_texture_func = NULL;
 static IsThemeActiveFunc is_theme_active_func = NULL;
-
-static gboolean was_theming_active = FALSE;
+static IsAppThemedFunc is_app_themed_func = NULL;
 
 static void
 xp_theme_close_open_handles (void)
@@ -152,31 +152,27 @@ xp_theme_init (void)
 
   uxtheme_dll = LoadLibrary("uxtheme.dll");
   if (!uxtheme_dll) {
-         was_theming_active = FALSE;
          return;
   }
 
-  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");
-
-  if (is_theme_active_func)
-    {
-      was_theming_active = (*is_theme_active_func) ();
-    }
+  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");
+  }
 }
 
 void
 xp_theme_reset (void)
 {
   xp_theme_close_open_handles ();
-  was_theming_active = is_theme_active_func
-    ? (*is_theme_active_func) () : FALSE;
 }
 
 void
@@ -190,6 +186,7 @@ xp_theme_exit (void)
   FreeLibrary (uxtheme_dll);
   uxtheme_dll = NULL;
 
+  is_app_themed_func = NULL;
   is_theme_active_func = NULL;
   open_theme_data_func = NULL;
   close_theme_data_func = NULL;
@@ -705,26 +702,29 @@ xp_theme_draw (GdkWindow *win, XpThemeElement element, GtkStyle *style,
   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
 xp_theme_is_drawable (XpThemeElement element)
 {
-  if (is_theme_active_func)
-    {
-      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);
-        }
-    }
+ if (xp_theme_is_active ())
+  return (xp_theme_get_handle_by_element (element) != NULL);
 
   return FALSE;
 }
index c6d4473897ce62e899dbc4a151aaa183165335cb..9b40b5fd4045e1e45f5073aed8ac37c34d010a12 100644 (file)
@@ -159,19 +159,4 @@ typedef HANDLE HTHEME;
 #define TMT_STATUSFONT 804
 #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 */