summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2017-10-31 02:35:21 +0100
committerBenjamin Otte <otte@redhat.com>2017-10-31 03:05:54 +0100
commit9151e0b9f521060a7792a0e73ea0a8f3e77a0f89 (patch)
tree3ed40b25b874495b5f31ecfa91bb0859ff168a97 /testsuite
parenta2e625692e25aa97277dd05670a2e9c49c07b3ee (diff)
downloadgtk+-9151e0b9f521060a7792a0e73ea0a8f3e77a0f89.tar.gz
stylecontext: Port to use display instead of screen
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/css/style/test-css-style.c10
-rw-r--r--testsuite/gtk/stylecontext.c80
-rw-r--r--testsuite/reftests/gtk-reftest.c10
3 files changed, 50 insertions, 50 deletions
diff --git a/testsuite/css/style/test-css-style.c b/testsuite/css/style/test-css-style.c
index 4555db1926..fd998472bf 100644
--- a/testsuite/css/style/test-css-style.c
+++ b/testsuite/css/style/test-css-style.c
@@ -116,9 +116,9 @@ load_ui_file (GFile *file, gboolean generate)
provider = gtk_css_provider_new ();
gtk_css_provider_load_from_path (provider, css_file);
- gtk_style_context_add_provider_for_screen (gdk_screen_get_default (),
- GTK_STYLE_PROVIDER (provider),
- GTK_STYLE_PROVIDER_PRIORITY_FORCE);
+ gtk_style_context_add_provider_for_display (gdk_display_get_default (),
+ GTK_STYLE_PROVIDER (provider),
+ GTK_STYLE_PROVIDER_PRIORITY_FORCE);
builder = gtk_builder_new_from_file (ui_file);
window = GTK_WIDGET (gtk_builder_get_object (builder, "window1"));
@@ -150,8 +150,8 @@ load_ui_file (GFile *file, gboolean generate)
g_free (diff);
out:
- gtk_style_context_remove_provider_for_screen (gdk_screen_get_default (),
- GTK_STYLE_PROVIDER (provider));
+ gtk_style_context_remove_provider_for_display (gdk_display_get_default (),
+ GTK_STYLE_PROVIDER (provider));
g_object_unref (provider);
g_free (output);
diff --git a/testsuite/gtk/stylecontext.c b/testsuite/gtk/stylecontext.c
index 8610e2d994..4275b31e4a 100644
--- a/testsuite/gtk/stylecontext.c
+++ b/testsuite/gtk/stylecontext.c
@@ -346,13 +346,13 @@ test_style_priorities_equal (PrioritiesFixture *f,
{
GdkRGBA color, ref_color;
- gtk_style_context_add_provider_for_screen (gdk_screen_get_default (),
- GTK_STYLE_PROVIDER (f->blue_provider),
- GTK_STYLE_PROVIDER_PRIORITY_USER);
+ gtk_style_context_add_provider_for_display (gdk_display_get_default (),
+ GTK_STYLE_PROVIDER (f->blue_provider),
+ GTK_STYLE_PROVIDER_PRIORITY_USER);
gtk_style_context_add_provider (f->context, GTK_STYLE_PROVIDER (f->red_provider),
GTK_STYLE_PROVIDER_PRIORITY_USER);
- /* When style providers are added to the screen as well as the style context
+ /* When style providers are added to the display as well as the style context
the one specific to the style context should take priority */
gdk_rgba_parse (&ref_color, "red");
gtk_style_context_get_color (f->context, &color);
@@ -361,14 +361,14 @@ test_style_priorities_equal (PrioritiesFixture *f,
}
static void
-test_style_priorities_screen_only (PrioritiesFixture *f,
- gconstpointer unused)
+test_style_priorities_display_only (PrioritiesFixture *f,
+ gconstpointer unused)
{
GdkRGBA color, ref_color;
- gtk_style_context_add_provider_for_screen (gdk_screen_get_default (),
- GTK_STYLE_PROVIDER (f->blue_provider),
- GTK_STYLE_PROVIDER_PRIORITY_USER);
+ gtk_style_context_add_provider_for_display (gdk_display_get_default (),
+ GTK_STYLE_PROVIDER (f->blue_provider),
+ GTK_STYLE_PROVIDER_PRIORITY_USER);
gdk_rgba_parse (&ref_color, "blue");
gtk_style_context_get_color (f->context, &color);
@@ -392,14 +392,14 @@ test_style_priorities_context_only (PrioritiesFixture *f,
}
static void
-test_style_priorities_screen_higher (PrioritiesFixture *f,
- gconstpointer unused)
+test_style_priorities_display_higher (PrioritiesFixture *f,
+ gconstpointer unused)
{
GdkRGBA color, ref_color;
- gtk_style_context_add_provider_for_screen (gdk_screen_get_default (),
- GTK_STYLE_PROVIDER (f->blue_provider),
- GTK_STYLE_PROVIDER_PRIORITY_USER + 1);
+ gtk_style_context_add_provider_for_display (gdk_display_get_default (),
+ GTK_STYLE_PROVIDER (f->blue_provider),
+ GTK_STYLE_PROVIDER_PRIORITY_USER + 1);
gtk_style_context_add_provider (f->context, GTK_STYLE_PROVIDER (f->red_provider),
GTK_STYLE_PROVIDER_PRIORITY_USER);
@@ -415,9 +415,9 @@ test_style_priorities_context_higher (PrioritiesFixture *f,
{
GdkRGBA color, ref_color;
- gtk_style_context_add_provider_for_screen (gdk_screen_get_default (),
- GTK_STYLE_PROVIDER (f->blue_provider),
- GTK_STYLE_PROVIDER_PRIORITY_USER);
+ gtk_style_context_add_provider_for_display (gdk_display_get_default (),
+ GTK_STYLE_PROVIDER (f->blue_provider),
+ GTK_STYLE_PROVIDER_PRIORITY_USER);
gtk_style_context_add_provider (f->context, GTK_STYLE_PROVIDER (f->red_provider),
GTK_STYLE_PROVIDER_PRIORITY_USER + 1);
@@ -428,17 +428,17 @@ test_style_priorities_context_higher (PrioritiesFixture *f,
}
static void
-test_style_priorities_two_screen (PrioritiesFixture *f,
- gconstpointer unused)
+test_style_priorities_two_display (PrioritiesFixture *f,
+ gconstpointer unused)
{
GdkRGBA color, ref_color;
- gtk_style_context_add_provider_for_screen (gdk_screen_get_default (),
- GTK_STYLE_PROVIDER (f->blue_provider),
- GTK_STYLE_PROVIDER_PRIORITY_USER);
- gtk_style_context_add_provider_for_screen (gdk_screen_get_default (),
- GTK_STYLE_PROVIDER (f->red_provider),
- GTK_STYLE_PROVIDER_PRIORITY_USER + 1);
+ gtk_style_context_add_provider_for_display (gdk_display_get_default (),
+ GTK_STYLE_PROVIDER (f->blue_provider),
+ GTK_STYLE_PROVIDER_PRIORITY_USER);
+ gtk_style_context_add_provider_for_display (gdk_display_get_default (),
+ GTK_STYLE_PROVIDER (f->red_provider),
+ GTK_STYLE_PROVIDER_PRIORITY_USER + 1);
gdk_rgba_parse (&ref_color, "red");
gtk_style_context_get_color (f->context, &color);
@@ -464,17 +464,17 @@ test_style_priorities_two_context (PrioritiesFixture *f,
}
static void
-test_style_priorities_three_screen_higher (PrioritiesFixture *f,
- gconstpointer unused)
+test_style_priorities_three_display_higher (PrioritiesFixture *f,
+ gconstpointer unused)
{
GdkRGBA color, ref_color;
- gtk_style_context_add_provider_for_screen (gdk_screen_get_default (),
- GTK_STYLE_PROVIDER (f->blue_provider),
- GTK_STYLE_PROVIDER_PRIORITY_USER);
- gtk_style_context_add_provider_for_screen (gdk_screen_get_default (),
- GTK_STYLE_PROVIDER (f->green_provider),
- GTK_STYLE_PROVIDER_PRIORITY_USER + 1);
+ gtk_style_context_add_provider_for_display (gdk_display_get_default (),
+ GTK_STYLE_PROVIDER (f->blue_provider),
+ GTK_STYLE_PROVIDER_PRIORITY_USER);
+ gtk_style_context_add_provider_for_display (gdk_display_get_default (),
+ GTK_STYLE_PROVIDER (f->green_provider),
+ GTK_STYLE_PROVIDER_PRIORITY_USER + 1);
gtk_style_context_add_provider (f->context, GTK_STYLE_PROVIDER (f->red_provider),
GTK_STYLE_PROVIDER_PRIORITY_USER);
@@ -490,9 +490,9 @@ test_style_priorities_three_context_higher (PrioritiesFixture *f,
{
GdkRGBA color, ref_color;
- gtk_style_context_add_provider_for_screen (gdk_screen_get_default (),
- GTK_STYLE_PROVIDER (f->blue_provider),
- GTK_STYLE_PROVIDER_PRIORITY_USER);
+ gtk_style_context_add_provider_for_display (gdk_display_get_default (),
+ GTK_STYLE_PROVIDER (f->blue_provider),
+ GTK_STYLE_PROVIDER_PRIORITY_USER);
gtk_style_context_add_provider (f->context, GTK_STYLE_PROVIDER (f->red_provider),
GTK_STYLE_PROVIDER_PRIORITY_USER);
gtk_style_context_add_provider (f->context, GTK_STYLE_PROVIDER (f->green_provider),
@@ -522,13 +522,13 @@ main (int argc, char *argv[])
(func), test_style_priorities_teardown)
ADD_PRIORITIES_TEST ("equal", test_style_priorities_equal);
- ADD_PRIORITIES_TEST ("screen-only", test_style_priorities_screen_only);
+ ADD_PRIORITIES_TEST ("display-only", test_style_priorities_display_only);
ADD_PRIORITIES_TEST ("context-only", test_style_priorities_context_only);
- ADD_PRIORITIES_TEST ("screen-higher", test_style_priorities_screen_higher);
+ ADD_PRIORITIES_TEST ("display-higher", test_style_priorities_display_higher);
ADD_PRIORITIES_TEST ("context-higher", test_style_priorities_context_higher);
- ADD_PRIORITIES_TEST ("two-screen", test_style_priorities_two_screen);
+ ADD_PRIORITIES_TEST ("two-display", test_style_priorities_two_display);
ADD_PRIORITIES_TEST ("two-context", test_style_priorities_two_context);
- ADD_PRIORITIES_TEST ("three-screen-higher", test_style_priorities_three_screen_higher);
+ ADD_PRIORITIES_TEST ("three-display-higher", test_style_priorities_three_display_higher);
ADD_PRIORITIES_TEST ("three-context-higher", test_style_priorities_three_context_higher);
#undef ADD_PRIORITIES_TEST
diff --git a/testsuite/reftests/gtk-reftest.c b/testsuite/reftests/gtk-reftest.c
index 758007a12a..0179e0b344 100644
--- a/testsuite/reftests/gtk-reftest.c
+++ b/testsuite/reftests/gtk-reftest.c
@@ -224,9 +224,9 @@ add_extra_css (const char *testname,
provider = GTK_STYLE_PROVIDER (gtk_css_provider_new ());
gtk_css_provider_load_from_path (GTK_CSS_PROVIDER (provider),
css_file);
- gtk_style_context_add_provider_for_screen (gdk_screen_get_default (),
- provider,
- GTK_STYLE_PROVIDER_PRIORITY_FORCE);
+ gtk_style_context_add_provider_for_display (gdk_display_get_default (),
+ provider,
+ GTK_STYLE_PROVIDER_PRIORITY_FORCE);
g_free (css_file);
@@ -239,8 +239,8 @@ remove_extra_css (GtkStyleProvider *provider)
if (provider == NULL)
return;
- gtk_style_context_remove_provider_for_screen (gdk_screen_get_default (),
- provider);
+ gtk_style_context_remove_provider_for_display (gdk_display_get_default (),
+ provider);
}
static void