summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2016-06-17 11:11:21 +0200
committerraveit65 <[email protected]>2016-07-02 12:31:11 +0200
commit42d3d76f542ef4d401284d4b616ed8b4f55b9bed (patch)
tree832c9ad7633d2a9cb71c421fbeef406dabd8aee2
parentc771b2c0a4cf30b55dfe0d7c6b38abc6bfc854d2 (diff)
downloadmate-control-center-42d3d76f542ef4d401284d4b616ed8b4f55b9bed.tar.bz2
mate-control-center-42d3d76f542ef4d401284d4b616ed8b4f55b9bed.tar.xz
GTK+-3 mate-wp-xml: port GdkColor to GdkRGBA
-rw-r--r--capplets/appearance/mate-wp-xml.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/capplets/appearance/mate-wp-xml.c b/capplets/appearance/mate-wp-xml.c
index 273c6e83..2ef58fa0 100644
--- a/capplets/appearance/mate-wp-xml.c
+++ b/capplets/appearance/mate-wp-xml.c
@@ -124,8 +124,13 @@ static void mate_wp_xml_load_xml(AppearanceData* data, const char* filename)
xmlNode* wpa;
xmlChar* nodelang;
const char* const* syslangs;
+#if GTK_CHECK_VERSION (3, 0, 0)
+ GdkRGBA color1;
+ GdkRGBA color2;
+#else
GdkColor color1;
GdkColor color2;
+#endif
gint i;
wplist = xmlParseFile(filename);
@@ -270,7 +275,11 @@ static void mate_wp_xml_load_xml(AppearanceData* data, const char* filename)
continue;
}
+#if GTK_CHECK_VERSION (3, 0, 0)
+ /* Verify the colors and alloc some GdkRGBA here */
+#else
/* Verify the colors and alloc some GdkColors here */
+#endif
if (!have_scale)
{
wp->options = g_settings_get_enum(data->wp_settings, WP_OPTIONS_KEY);
@@ -296,6 +305,15 @@ static void mate_wp_xml_load_xml(AppearanceData* data, const char* filename)
wp->artist = g_strdup ("(none)");
}
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gdk_rgba_parse(&color1, pcolor);
+ gdk_rgba_parse(&color2, scolor);
+ g_free(pcolor);
+ g_free(scolor);
+
+ wp->pcolor = gdk_rgba_copy(&color1);
+ wp->scolor = gdk_rgba_copy(&color2);
+#else
gdk_color_parse(pcolor, &color1);
gdk_color_parse(scolor, &color2);
g_free(pcolor);
@@ -303,6 +321,7 @@ static void mate_wp_xml_load_xml(AppearanceData* data, const char* filename)
wp->pcolor = gdk_color_copy(&color1);
wp->scolor = gdk_color_copy(&color2);
+#endif
if ((wp->filename != NULL && g_file_test (wp->filename, G_FILE_TEST_EXISTS)) || !strcmp (wp->filename, "(none)"))
{
@@ -504,8 +523,13 @@ void mate_wp_xml_save_list(AppearanceData* data)
filename = g_filename_to_utf8(wpitem->filename, -1, NULL, NULL, NULL);
}
+#if GTK_CHECK_VERSION (3, 0, 0)
+ pcolor = gdk_rgba_to_string(wpitem->pcolor);
+ scolor = gdk_rgba_to_string(wpitem->scolor);
+#else
pcolor = gdk_color_to_string(wpitem->pcolor);
scolor = gdk_color_to_string(wpitem->scolor);
+#endif
scale = wp_item_option_to_string(wpitem->options);
shade = wp_item_shading_to_string(wpitem->shade_type);