summaryrefslogtreecommitdiff
path: root/testsuite/gtk
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2015-11-14 19:03:57 -0500
committerMatthias Clasen <mclasen@redhat.com>2015-11-14 19:03:57 -0500
commit2d054fa6aed349c15eb98e94e80120c2cf1d46ae (patch)
treeb76ebf49cc7a5ad5f916dbe1b15bd5db3d123b70 /testsuite/gtk
parentdedab98bbb94d86f4713098a41eb1db281d72c47 (diff)
downloadgtk+-2d054fa6aed349c15eb98e94e80120c2cf1d46ae.tar.gz
Always pass the right state in style context getters
Otherwise, we are causing warnings that break make check.
Diffstat (limited to 'testsuite/gtk')
-rw-r--r--testsuite/gtk/firefox-stylecontext.c4
-rw-r--r--testsuite/gtk/stylecontext.c24
2 files changed, 14 insertions, 14 deletions
diff --git a/testsuite/gtk/firefox-stylecontext.c b/testsuite/gtk/firefox-stylecontext.c
index 0e5ce78f88..3f0bd69d21 100644
--- a/testsuite/gtk/firefox-stylecontext.c
+++ b/testsuite/gtk/firefox-stylecontext.c
@@ -26,7 +26,7 @@ test_init_of_theme (void)
/* Get the color. This should be initialized by the theme and not be
* the default. */
- gtk_style_context_get_color (context, 0, &before);
+ gtk_style_context_get_color (context, gtk_style_context_get_state (context), &before);
/* Add a style that sets a different color for this widget.
* This style has a higher priority than fallback, but a lower
@@ -41,7 +41,7 @@ test_init_of_theme (void)
g_object_unref (provider);
/* Get the color again. */
- gtk_style_context_get_color (context, 0, &after);
+ gtk_style_context_get_color (context, gtk_style_context_get_state (context), &after);
/* Because the style we added does not influence the color,
* the before and after colors should be identical. */
diff --git a/testsuite/gtk/stylecontext.c b/testsuite/gtk/stylecontext.c
index f0381bb5d2..25c3881eec 100644
--- a/testsuite/gtk/stylecontext.c
+++ b/testsuite/gtk/stylecontext.c
@@ -173,14 +173,14 @@ test_match (void)
data = "* { color: #fff }";
gtk_css_provider_load_from_data (provider, data, -1, &error);
g_assert_no_error (error);
- gtk_style_context_get_color (context, GTK_STATE_FLAG_NORMAL, &color);
+ gtk_style_context_get_color (context, gtk_style_context_get_state (context), &color);
g_assert (gdk_rgba_equal (&color, &expected));
data = "* { color: #f00 }\n"
"GtkButton { color: #fff }";
gtk_css_provider_load_from_data (provider, data, -1, &error);
g_assert_no_error (error);
- gtk_style_context_get_color (context, GTK_STATE_FLAG_NORMAL, &color);
+ gtk_style_context_get_color (context, gtk_style_context_get_state (context), &color);
g_assert (gdk_rgba_equal (&color, &expected));
data = "* { color: #f00 }\n"
@@ -188,14 +188,14 @@ test_match (void)
"GtkWindow > GtkButton { color: #000 }";
gtk_css_provider_load_from_data (provider, data, -1, &error);
g_assert_no_error (error);
- gtk_style_context_get_color (context, GTK_STATE_FLAG_NORMAL, &color);
+ gtk_style_context_get_color (context, gtk_style_context_get_state (context), &color);
g_assert (gdk_rgba_equal (&color, &expected));
data = "* { color: #f00 }\n"
".button { color: #fff }";
gtk_css_provider_load_from_data (provider, data, -1, &error);
g_assert_no_error (error);
- gtk_style_context_get_color (context, GTK_STATE_FLAG_NORMAL, &color);
+ gtk_style_context_get_color (context, gtk_style_context_get_state (context), &color);
g_assert (gdk_rgba_equal (&color, &expected));
data = "* { color: #f00 }\n"
@@ -203,7 +203,7 @@ test_match (void)
".button { color: #fff }";
gtk_css_provider_load_from_data (provider, data, -1, &error);
g_assert_no_error (error);
- gtk_style_context_get_color (context, GTK_STATE_FLAG_NORMAL, &color);
+ gtk_style_context_get_color (context, gtk_style_context_get_state (context), &color);
g_assert (gdk_rgba_equal (&color, &expected));
data = "* { color: #f00 }\n"
@@ -211,7 +211,7 @@ test_match (void)
"GtkWindow GtkButton { color: #fff }";
gtk_css_provider_load_from_data (provider, data, -1, &error);
g_assert_no_error (error);
- gtk_style_context_get_color (context, GTK_STATE_FLAG_NORMAL, &color);
+ gtk_style_context_get_color (context, gtk_style_context_get_state (context), &color);
g_assert (gdk_rgba_equal (&color, &expected));
data = "* { color: #f00 }\n"
@@ -219,7 +219,7 @@ test_match (void)
"GtkWindow .button { color: #fff }";
gtk_css_provider_load_from_data (provider, data, -1, &error);
g_assert_no_error (error);
- gtk_style_context_get_color (context, GTK_STATE_FLAG_NORMAL, &color);
+ gtk_style_context_get_color (context, gtk_style_context_get_state (context), &color);
g_assert (gdk_rgba_equal (&color, &expected));
data = "* { color: #f00 }\n"
@@ -227,7 +227,7 @@ test_match (void)
"#mywindow .button { color: #fff }";
gtk_css_provider_load_from_data (provider, data, -1, &error);
g_assert_no_error (error);
- gtk_style_context_get_color (context, GTK_STATE_FLAG_NORMAL, &color);
+ gtk_style_context_get_color (context, gtk_style_context_get_state (context), &color);
g_assert (gdk_rgba_equal (&color, &expected));
data = "* { color: #f00 }\n"
@@ -235,7 +235,7 @@ test_match (void)
"GtkWindow#mywindow .button { color: #fff }";
gtk_css_provider_load_from_data (provider, data, -1, &error);
g_assert_no_error (error);
- gtk_style_context_get_color (context, GTK_STATE_FLAG_NORMAL, &color);
+ gtk_style_context_get_color (context, gtk_style_context_get_state (context), &color);
g_assert (gdk_rgba_equal (&color, &expected));
data = "* { color: #f00 }\n"
@@ -243,7 +243,7 @@ test_match (void)
"GObject .button { color: #fff }";
gtk_css_provider_load_from_data (provider, data, -1, &error);
g_assert_no_error (error);
- gtk_style_context_get_color (context, GTK_STATE_FLAG_NORMAL, &color);
+ gtk_style_context_get_color (context, gtk_style_context_get_state (context), &color);
g_assert (gdk_rgba_equal (&color, &expected));
data = "* { color: #f00 }\n"
@@ -252,7 +252,7 @@ test_match (void)
"GtkWindow:active .button { color: #fff }";
gtk_css_provider_load_from_data (provider, data, -1, &error);
g_assert_no_error (error);
- gtk_style_context_get_color (context, GTK_STATE_FLAG_NORMAL, &color);
+ gtk_style_context_get_color (context, gtk_style_context_get_state (context), &color);
g_assert (gdk_rgba_equal (&color, &expected));
g_object_unref (provider);
@@ -273,7 +273,7 @@ test_basic_properties (void)
gtk_style_context_set_path (context, path);
gtk_widget_path_free (path);
- gtk_style_context_get (context, 0,
+ gtk_style_context_get (context, gtk_style_context_get_state (context),
"color", &color,
"background-color", &bg_color,
"font", &font,