diff options
author | raveit65 <[email protected]> | 2016-06-17 18:10:34 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2016-07-02 12:31:11 +0200 |
commit | cd3114cbfab295c38fe629a3f6688645b3f60015 (patch) | |
tree | 560914556c6e527a4728f5df76e3a6ca9255ce9c /capplets | |
parent | 7c6ca27018bfd41a82c0732e9a371c3e6112b55d (diff) | |
download | mate-control-center-cd3114cbfab295c38fe629a3f6688645b3f60015.tar.bz2 mate-control-center-cd3114cbfab295c38fe629a3f6688645b3f60015.tar.xz |
GTK+-3 mate-theme-info: port GdkColor to GdkRGBA
Diffstat (limited to 'capplets')
-rw-r--r-- | capplets/common/mate-theme-info.c | 30 | ||||
-rw-r--r-- | capplets/common/mate-theme-info.h | 6 |
2 files changed, 36 insertions, 0 deletions
diff --git a/capplets/common/mate-theme-info.c b/capplets/common/mate-theme-info.c index 2e58b6d7..964d45c0 100644 --- a/capplets/common/mate-theme-info.c +++ b/capplets/common/mate-theme-info.c @@ -1822,7 +1822,11 @@ mate_theme_info_register_theme_change (ThemeChangedCallback func, } gboolean +#if GTK_CHECK_VERSION (3, 0, 0) +mate_theme_color_scheme_parse (const gchar *scheme, GdkRGBA *colors) +#else mate_theme_color_scheme_parse (const gchar *scheme, GdkColor *colors) +#endif { gchar **color_scheme_strings, **color_scheme_pair, *current_string; gint i; @@ -1849,6 +1853,23 @@ mate_theme_color_scheme_parse (const gchar *scheme, GdkColor *colors) g_strstrip (color_scheme_pair[1]); if (!strcmp ("fg_color", color_scheme_pair[0])) +#if GTK_CHECK_VERSION (3, 0, 0) + gdk_rgba_parse (&colors[COLOR_FG], color_scheme_pair[1]); + else if (!strcmp ("bg_color", color_scheme_pair[0])) + gdk_rgba_parse (&colors[COLOR_BG], color_scheme_pair[1]); + else if (!strcmp ("text_color", color_scheme_pair[0])) + gdk_rgba_parse (&colors[COLOR_TEXT], color_scheme_pair[1]); + else if (!strcmp ("base_color", color_scheme_pair[0])) + gdk_rgba_parse (&colors[COLOR_BASE], color_scheme_pair[1]); + else if (!strcmp ("selected_fg_color", color_scheme_pair[0])) + gdk_rgba_parse (&colors[COLOR_SELECTED_FG], color_scheme_pair[1]); + else if (!strcmp ("selected_bg_color", color_scheme_pair[0])) + gdk_rgba_parse ( &colors[COLOR_SELECTED_BG], color_scheme_pair[1]); + else if (!strcmp ("tooltip_fg_color", color_scheme_pair[0])) + gdk_rgba_parse (&colors[COLOR_TOOLTIP_FG], color_scheme_pair[1]); + else if (!strcmp ("tooltip_bg_color", color_scheme_pair[0])) + gdk_rgba_parse (&colors[COLOR_TOOLTIP_BG], color_scheme_pair[1]); +#else gdk_color_parse (color_scheme_pair[1], &colors[COLOR_FG]); else if (!strcmp ("bg_color", color_scheme_pair[0])) gdk_color_parse (color_scheme_pair[1], &colors[COLOR_BG]); @@ -1864,6 +1885,7 @@ mate_theme_color_scheme_parse (const gchar *scheme, GdkColor *colors) gdk_color_parse (color_scheme_pair[1], &colors[COLOR_TOOLTIP_FG]); else if (!strcmp ("tooltip_bg_color", color_scheme_pair[0])) gdk_color_parse (color_scheme_pair[1], &colors[COLOR_TOOLTIP_BG]); +#endif } g_strfreev (color_scheme_pair); @@ -1877,7 +1899,11 @@ mate_theme_color_scheme_parse (const gchar *scheme, GdkColor *colors) gboolean mate_theme_color_scheme_equal (const gchar *s1, const gchar *s2) { +#if GTK_CHECK_VERSION (3, 0, 0) + GdkRGBA c1[NUM_SYMBOLIC_COLORS], c2[NUM_SYMBOLIC_COLORS]; +#else GdkColor c1[NUM_SYMBOLIC_COLORS], c2[NUM_SYMBOLIC_COLORS]; +#endif int i; if (!mate_theme_color_scheme_parse (s1, c1) || @@ -1885,7 +1911,11 @@ mate_theme_color_scheme_equal (const gchar *s1, const gchar *s2) return FALSE; for (i = 0; i < NUM_SYMBOLIC_COLORS; ++i) { +#if GTK_CHECK_VERSION (3, 0, 0) + if (!gdk_rgba_equal (&c1[i], &c2[i])) +#else if (!gdk_color_equal (&c1[i], &c2[i])) +#endif return FALSE; } diff --git a/capplets/common/mate-theme-info.h b/capplets/common/mate-theme-info.h index ee2222cd..9b45951c 100644 --- a/capplets/common/mate-theme-info.h +++ b/capplets/common/mate-theme-info.h @@ -25,6 +25,7 @@ #include <glib.h> #include <gio/gio.h> +#include <gtk/gtk.h> #include <gdk-pixbuf/gdk-pixbuf.h> #include <gdk/gdk.h> @@ -182,8 +183,13 @@ void mate_theme_init (void); void mate_theme_info_register_theme_change (ThemeChangedCallback func, gpointer data); +#if GTK_CHECK_VERSION (3, 0, 0) +gboolean mate_theme_color_scheme_parse (const gchar *scheme, + GdkRGBA *colors); +#else gboolean mate_theme_color_scheme_parse (const gchar *scheme, GdkColor *colors); +#endif gboolean mate_theme_color_scheme_equal (const gchar *s1, const gchar *s2); |