diff options
author | Benjamin Otte <otte@redhat.com> | 2017-10-31 02:35:21 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2017-10-31 03:05:54 +0100 |
commit | 9151e0b9f521060a7792a0e73ea0a8f3e77a0f89 (patch) | |
tree | 3ed40b25b874495b5f31ecfa91bb0859ff168a97 | |
parent | a2e625692e25aa97277dd05670a2e9c49c07b3ee (diff) | |
download | gtk+-9151e0b9f521060a7792a0e73ea0a8f3e77a0f89.tar.gz |
stylecontext: Port to use display instead of screen
33 files changed, 222 insertions, 227 deletions
diff --git a/demos/gtk-demo/css_blendmodes.c b/demos/gtk-demo/css_blendmodes.c index ecc7da8cdd..f93f0336f8 100644 --- a/demos/gtk-demo/css_blendmodes.c +++ b/demos/gtk-demo/css_blendmodes.c @@ -130,9 +130,9 @@ do_css_blendmodes (GtkWidget *do_widget) /* Setup the CSS provider for window */ provider = GTK_STYLE_PROVIDER (gtk_css_provider_new ()); - gtk_style_context_add_provider_for_screen (gdk_screen_get_default (), - provider, - GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); + gtk_style_context_add_provider_for_display (gdk_display_get_default (), + provider, + GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); setup_listbox (builder, provider); } diff --git a/demos/widget-factory/widget-factory.c b/demos/widget-factory/widget-factory.c index 5c80cab635..64823443f9 100644 --- a/demos/widget-factory/widget-factory.c +++ b/demos/widget-factory/widget-factory.c @@ -1661,9 +1661,9 @@ activate (GApplication *app) provider = gtk_css_provider_new (); gtk_css_provider_load_from_resource (provider, "/org/gtk/WidgetFactory/widget-factory.css"); - gtk_style_context_add_provider_for_screen (gdk_screen_get_default (), - GTK_STYLE_PROVIDER (provider), - GTK_STYLE_PROVIDER_PRIORITY_USER); + gtk_style_context_add_provider_for_display (gdk_display_get_default (), + GTK_STYLE_PROVIDER (provider), + GTK_STYLE_PROVIDER_PRIORITY_USER); g_object_unref (provider); builder = gtk_builder_new_from_resource ("/org/gtk/WidgetFactory/widget-factory.ui"); diff --git a/docs/reference/gtk/gtk4-sections.txt b/docs/reference/gtk/gtk4-sections.txt index d3ee848d94..dae5d44acc 100644 --- a/docs/reference/gtk/gtk4-sections.txt +++ b/docs/reference/gtk/gtk4-sections.txt @@ -2643,7 +2643,6 @@ GtkSettingsValue gtk_settings_get_default gtk_settings_get_for_display gtk_settings_get_for_screen -gtk_settings_get_for_display gtk_rc_property_parse_color gtk_rc_property_parse_enum gtk_rc_property_parse_flags @@ -5093,12 +5092,12 @@ GTK_STYLE_CLASS_WIDE GtkStyleContext gtk_style_context_new gtk_style_context_add_provider -gtk_style_context_add_provider_for_screen +gtk_style_context_add_provider_for_display gtk_style_context_get gtk_style_context_get_parent gtk_style_context_get_path gtk_style_context_get_property -gtk_style_context_get_screen +gtk_style_context_get_display gtk_style_context_get_frame_clock gtk_style_context_get_state gtk_style_context_get_valist @@ -5111,7 +5110,7 @@ gtk_style_context_get_padding gtk_style_context_get_margin gtk_style_context_lookup_color gtk_style_context_remove_provider -gtk_style_context_remove_provider_for_screen +gtk_style_context_remove_provider_for_display gtk_style_context_reset_widgets gtk_style_context_restore gtk_style_context_save @@ -5121,7 +5120,7 @@ gtk_style_context_add_class gtk_style_context_remove_class gtk_style_context_has_class gtk_style_context_list_classes -gtk_style_context_set_screen +gtk_style_context_set_display gtk_style_context_set_frame_clock gtk_style_context_set_state gtk_style_context_set_scale diff --git a/docs/reference/gtk/question_index.sgml b/docs/reference/gtk/question_index.sgml index c1093ec79f..4f1bf02e2d 100644 --- a/docs/reference/gtk/question_index.sgml +++ b/docs/reference/gtk/question_index.sgml @@ -692,7 +692,7 @@ You can also change the font of a widget by putting } </programlisting> in a CSS file, loading it with gtk_css_provider_load_from_file(), and -adding the provider with gtk_style_context_add_provider_for_screen(). +adding the provider with gtk_style_context_add_provider_for_display(). To associate this style information with your widget, set a style class on its #GtkStyleContext using gtk_style_context_add_class(). The advantage of this approach is that users can then override the font diff --git a/examples/plugman.c b/examples/plugman.c index e7a5272a91..5f70dbb287 100644 --- a/examples/plugman.c +++ b/examples/plugman.c @@ -226,9 +226,9 @@ plugin_action (GAction *action, css_provider = gtk_css_provider_new (); gtk_css_provider_load_from_data (css_provider, css_to_load, -1); - gtk_style_context_add_provider_for_screen (gdk_screen_get_default (), - GTK_STYLE_PROVIDER (css_provider), - GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); + gtk_style_context_add_provider_for_display (gdk_display_get_default (), + GTK_STYLE_PROVIDER (css_provider), + GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); } static void diff --git a/gtk/gtk-builder-tool.c b/gtk/gtk-builder-tool.c index d75d766031..8ed47edd02 100644 --- a/gtk/gtk-builder-tool.c +++ b/gtk/gtk-builder-tool.c @@ -912,9 +912,9 @@ preview_file (const char *filename, provider = gtk_css_provider_new (); gtk_css_provider_load_from_path (provider, cssfile); - gtk_style_context_add_provider_for_screen (gdk_screen_get_default (), - GTK_STYLE_PROVIDER (provider), - GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); + gtk_style_context_add_provider_for_display (gdk_display_get_default (), + GTK_STYLE_PROVIDER (provider), + GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); } builder = gtk_builder_new (); diff --git a/gtk/gtkcssiconthemevalue.c b/gtk/gtkcssiconthemevalue.c index e6633c589a..6c4a303a21 100644 --- a/gtk/gtkcssiconthemevalue.c +++ b/gtk/gtkcssiconthemevalue.c @@ -81,7 +81,7 @@ gtk_css_value_icon_theme_compute (GtkCssValue *icon_theme, if (icon_theme->icontheme) icontheme = icon_theme->icontheme; else - icontheme = gtk_icon_theme_get_for_screen (_gtk_settings_get_screen (_gtk_style_provider_private_get_settings (provider))); + icontheme = gtk_icon_theme_get_for_screen (gdk_display_get_default_screen (_gtk_settings_get_display (_gtk_style_provider_private_get_settings (provider)))); return gtk_css_icon_theme_value_new (icontheme); } diff --git a/gtk/gtkcssinitialvalue.c b/gtk/gtkcssinitialvalue.c index a21bb4f7d2..3b326db83e 100644 --- a/gtk/gtkcssinitialvalue.c +++ b/gtk/gtkcssinitialvalue.c @@ -52,7 +52,7 @@ gtk_css_value_initial_compute (GtkCssValue *value, settings = _gtk_style_provider_private_get_settings (provider); if (settings) { - GdkScreen *screen = _gtk_settings_get_screen (settings); + GdkScreen *screen = gdk_display_get_default_screen (_gtk_settings_get_display (settings)); double resolution = gdk_screen_get_resolution (screen); if (resolution > 0.0) diff --git a/gtk/gtkcssprovider.c b/gtk/gtkcssprovider.c index 422abf9f6c..06457b5423 100644 --- a/gtk/gtkcssprovider.c +++ b/gtk/gtkcssprovider.c @@ -58,7 +58,7 @@ * An application can make GTK+ parse a specific CSS style sheet by calling * gtk_css_provider_load_from_file() or gtk_css_provider_load_from_resource() * and adding the provider with gtk_style_context_add_provider() or - * gtk_style_context_add_provider_for_screen(). + * gtk_style_context_add_provider_for_display(). * In addition, certain files will be read when GTK+ is initialized. First, the * file `$XDG_CONFIG_HOME/gtk-4.0/gtk.css` is loaded if it exists. Then, GTK+ diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c index 10217b1f64..fd7f949f0a 100644 --- a/gtk/gtkicontheme.c +++ b/gtk/gtkicontheme.c @@ -738,7 +738,7 @@ theme_changed_idle (gpointer user_data) g_signal_emit (icon_theme, signal_changed, 0); if (priv->screen && priv->is_screen_singleton) - gtk_style_context_reset_widgets (priv->screen); + gtk_style_context_reset_widgets (gdk_screen_get_display (priv->screen)); priv->theme_changed_idle = 0; diff --git a/gtk/gtksettings.c b/gtk/gtksettings.c index 67827d34d9..61bf3a2cf1 100644 --- a/gtk/gtksettings.c +++ b/gtk/gtksettings.c @@ -1395,7 +1395,7 @@ gtk_settings_notify (GObject *object, case PROP_FONT_NAME: settings_update_font_values (settings); settings_invalidate_style (settings); - gtk_style_context_reset_widgets (gdk_display_get_default_screen (priv->display)); + gtk_style_context_reset_widgets (priv->display); break; case PROP_KEY_THEME_NAME: settings_update_key_theme (settings); @@ -1410,21 +1410,21 @@ gtk_settings_notify (GObject *object, * widgets with gtk_widget_style_set(), and also causes more * recomputation than necessary. */ - gtk_style_context_reset_widgets (gdk_display_get_default_screen (priv->display)); + gtk_style_context_reset_widgets (priv->display); break; case PROP_XFT_ANTIALIAS: case PROP_XFT_HINTING: case PROP_XFT_HINTSTYLE: case PROP_XFT_RGBA: settings_update_font_options (settings); - gtk_style_context_reset_widgets (gdk_display_get_default_screen (priv->display)); + gtk_style_context_reset_widgets (priv->display); break; case PROP_FONTCONFIG_TIMESTAMP: if (settings_update_fontconfig (settings)) - gtk_style_context_reset_widgets (gdk_display_get_default_screen (priv->display)); + gtk_style_context_reset_widgets (priv->display); break; case PROP_ENABLE_ANIMATIONS: - gtk_style_context_reset_widgets (gdk_display_get_default_screen (priv->display)); + gtk_style_context_reset_widgets (priv->display); break; case PROP_CURSOR_THEME_NAME: case PROP_CURSOR_THEME_SIZE: @@ -2321,21 +2321,19 @@ settings_update_provider (GdkDisplay *display, { if (display != NULL && *old != new) { - GdkScreen *screen = gdk_display_get_default_screen (display); - if (*old) { - gtk_style_context_remove_provider_for_screen (screen, - GTK_STYLE_PROVIDER (*old)); + gtk_style_context_remove_provider_for_display (display, + GTK_STYLE_PROVIDER (*old)); g_object_unref (*old); *old = NULL; } if (new) { - gtk_style_context_add_provider_for_screen (screen, - GTK_STYLE_PROVIDER (new), - GTK_STYLE_PROVIDER_PRIORITY_THEME); + gtk_style_context_add_provider_for_display (display, + GTK_STYLE_PROVIDER (new), + GTK_STYLE_PROVIDER_PRIORITY_THEME); *old = g_object_ref (new); } } @@ -2436,10 +2434,10 @@ gtk_settings_get_font_options (GtkSettings *settings) return settings->priv->font_options; } -GdkScreen * -_gtk_settings_get_screen (GtkSettings *settings) +GdkDisplay * +_gtk_settings_get_display (GtkSettings *settings) { - return gdk_display_get_default_screen (settings->priv->display); + return settings->priv->display; } static void diff --git a/gtk/gtksettingsprivate.h b/gtk/gtksettingsprivate.h index df70babf83..98232a215d 100644 --- a/gtk/gtksettingsprivate.h +++ b/gtk/gtksettingsprivate.h @@ -38,7 +38,7 @@ gboolean _gtk_settings_parse_convert (GtkRcPropertyParse GValue *dest_value); const cairo_font_options_t * gtk_settings_get_font_options (GtkSettings *settings); -GdkScreen *_gtk_settings_get_screen (GtkSettings *settings); +GdkDisplay *_gtk_settings_get_display (GtkSettings *settings); GtkStyleCascade *_gtk_settings_get_style_cascade (GtkSettings *settings, gint scale); diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c index 5f5637d8f4..24d35e0561 100644 --- a/gtk/gtkstylecontext.c +++ b/gtk/gtkstylecontext.c @@ -62,18 +62,18 @@ * In order to construct the final style information, #GtkStyleContext * queries information from all attached #GtkStyleProviders. Style providers * can be either attached explicitly to the context through - * gtk_style_context_add_provider(), or to the screen through - * gtk_style_context_add_provider_for_screen(). The resulting style is a + * gtk_style_context_add_provider(), or to the display through + * gtk_style_context_add_provider_for_display(). The resulting style is a * combination of all providers’ information in priority order. * * For GTK+ widgets, any #GtkStyleContext returned by * gtk_widget_get_style_context() will already have a #GtkWidgetPath, a - * #GdkScreen and RTL/LTR information set. The style context will also be + * #GdkDisplay and RTL/LTR information set. The style context will also be * updated automatically if any of these settings change on the widget. * * If you are using the theming layer standalone, you will need to set a - * widget path and a screen yourself to the created style context through - * gtk_style_context_set_path() and gtk_style_context_set_screen(), as well + * widget path and a display yourself to the created style context through + * gtk_style_context_set_path() and gtk_style_context_set_display(), as well * as updating the context yourself using gtk_style_context_invalidate() * whenever any of the conditions change, such as a change in the * #GtkSettings:gtk-theme-name setting or a hierarchy change in the rendered @@ -118,7 +118,7 @@ struct PropertyValue struct _GtkStyleContextPrivate { - GdkScreen *screen; + GdkDisplay *display; guint cascade_changed_id; GtkStyleCascade *cascade; @@ -134,7 +134,7 @@ typedef struct _GtkStyleContextPrivate GtkStyleContextPrivate; enum { PROP_0, - PROP_SCREEN, + PROP_DISPLAY, PROP_FRAME_CLOCK, PROP_PARENT, LAST_PROP @@ -206,10 +206,10 @@ gtk_style_context_class_init (GtkStyleContextClass *klass) g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); - properties[PROP_SCREEN] = - g_param_spec_object ("screen", - P_("Screen"), - P_("The associated GdkScreen"), + properties[PROP_DISPLAY] = + g_param_spec_object ("display", + P_("Display"), + P_("The associated GdkDisplay"), GDK_TYPE_SCREEN, GTK_PARAM_READWRITE); @@ -295,13 +295,13 @@ gtk_style_context_init (GtkStyleContext *context) { GtkStyleContextPrivate *priv = gtk_style_context_get_instance_private (context); - priv->screen = gdk_screen_get_default (); + priv->display = gdk_display_get_default (); - if (priv->screen == NULL) + if (priv->display == NULL) g_error ("Can't create a GtkStyleContext without a display connection"); gtk_style_context_set_cascade (context, - _gtk_settings_get_style_cascade (gtk_settings_get_for_screen (priv->screen), 1)); + _gtk_settings_get_style_cascade (gtk_settings_get_for_display (priv->display), 1)); } static void @@ -344,8 +344,8 @@ gtk_style_context_impl_set_property (GObject *object, switch (prop_id) { - case PROP_SCREEN: - gtk_style_context_set_screen (context, g_value_get_object (value)); + case PROP_DISPLAY: + gtk_style_context_set_display (context, g_value_get_object (value)); break; case PROP_FRAME_CLOCK: gtk_style_context_set_frame_clock (context, g_value_get_object (value)); @@ -370,8 +370,8 @@ gtk_style_context_impl_get_property (GObject *object, switch (prop_id) { - case PROP_SCREEN: - g_value_set_object (value, priv->screen); + case PROP_DISPLAY: + g_value_set_object (value, priv->display); break; case PROP_FRAME_CLOCK: g_value_set_object (value, priv->frame_clock); @@ -421,7 +421,7 @@ static gboolean gtk_style_context_has_custom_cascade (GtkStyleContext *context) { GtkStyleContextPrivate *priv = gtk_style_context_get_instance_private (context); - GtkSettings *settings = gtk_settings_get_for_screen (priv->screen); + GtkSettings *settings = gtk_settings_get_for_display (priv->display); return priv->cascade != _gtk_settings_get_style_cascade (settings, _gtk_style_cascade_get_scale (priv->cascade)); } @@ -500,11 +500,11 @@ gtk_style_context_new_for_node (GtkCssNode *node) * Note that a style provider added by this function only affects * the style of the widget to which @context belongs. If you want * to affect the style of all widgets, use - * gtk_style_context_add_provider_for_screen(). + * gtk_style_context_add_provider_for_display(). * * Note: If both priorities are the same, a #GtkStyleProvider * added through this function takes precedence over another added - * through gtk_style_context_add_provider_for_screen(). + * through gtk_style_context_add_provider_for_display(). * * Since: 3.0 **/ @@ -525,7 +525,7 @@ gtk_style_context_add_provider (GtkStyleContext *context, new_cascade = _gtk_style_cascade_new (); _gtk_style_cascade_set_scale (new_cascade, _gtk_style_cascade_get_scale (priv->cascade)); _gtk_style_cascade_set_parent (new_cascade, - _gtk_settings_get_style_cascade (gtk_settings_get_for_screen (priv->screen), 1)); + _gtk_settings_get_style_cascade (gtk_settings_get_for_display (priv->display), 1)); _gtk_style_cascade_add_provider (new_cascade, provider, priority); gtk_style_context_set_cascade (context, new_cascade); g_object_unref (new_cascade); @@ -562,7 +562,7 @@ gtk_style_context_remove_provider (GtkStyleContext *context, /** * gtk_style_context_reset_widgets: - * @screen: a #GdkScreen + * @display: a #GdkScreen * * This function recomputes the styles for all widgets under a particular * #GdkScreen. This is useful when some global parameter has changed that @@ -574,7 +574,7 @@ gtk_style_context_remove_provider (GtkStyleContext *context, * Since: 3.0 **/ void -gtk_style_context_reset_widgets (GdkScreen *screen) +gtk_style_context_reset_widgets (GdkDisplay *display) { GList *list, *toplevels; @@ -583,7 +583,7 @@ gtk_style_context_reset_widgets (GdkScreen *screen) for (list = toplevels; list; list = list->next) { - if (gtk_widget_get_screen (list->data) == screen) + if (gtk_widget_get_display (list->data) == display) gtk_widget_reset_style (list->data); g_object_unref (list->data); @@ -593,8 +593,8 @@ gtk_style_context_reset_widgets (GdkScreen *screen) } /** - * gtk_style_context_add_provider_for_screen: - * @screen: a #GdkScreen + * gtk_style_context_add_provider_for_display: + * @display: a #GdkDisplay * @provider: a #GtkStyleProvider * @priority: the priority of the style provider. The lower * it is, the earlier it will be used in the style @@ -602,8 +602,8 @@ gtk_style_context_reset_widgets (GdkScreen *screen) * between %GTK_STYLE_PROVIDER_PRIORITY_FALLBACK and * %GTK_STYLE_PROVIDER_PRIORITY_USER * - * Adds a global style provider to @screen, which will be used - * in style construction for all #GtkStyleContexts under @screen. + * Adds a global style provider to @display, which will be used + * in style construction for all #GtkStyleContexts under @display. * * GTK+ uses this to make styling information from #GtkSettings * available. @@ -612,43 +612,43 @@ gtk_style_context_reset_widgets (GdkScreen *screen) * added through gtk_style_context_add_provider() takes precedence * over another added through this function. * - * Since: 3.0 + * Since: 3.94 **/ void -gtk_style_context_add_provider_for_screen (GdkScreen *screen, - GtkStyleProvider *provider, - guint priority) +gtk_style_context_add_provider_for_display (GdkDisplay *display, + GtkStyleProvider *provider, + guint priority) { GtkStyleCascade *cascade; - g_return_if_fail (GDK_IS_SCREEN (screen)); + g_return_if_fail (GDK_IS_DISPLAY (display)); g_return_if_fail (GTK_IS_STYLE_PROVIDER (provider)); - g_return_if_fail (!GTK_IS_SETTINGS (provider) || _gtk_settings_get_screen (GTK_SETTINGS (provider)) == screen); + g_return_if_fail (!GTK_IS_SETTINGS (provider) || _gtk_settings_get_display (GTK_SETTINGS (provider)) == display); - cascade = _gtk_settings_get_style_cascade (gtk_settings_get_for_screen (screen), 1); + cascade = _gtk_settings_get_style_cascade (gtk_settings_get_for_display (display), 1); _gtk_style_cascade_add_provider (cascade, provider, priority); } /** - * gtk_style_context_remove_provider_for_screen: - * @screen: a #GdkScreen + * gtk_style_context_remove_provider_for_display: + * @display: a #GdkScreen * @provider: a #GtkStyleProvider * - * Removes @provider from the global style providers list in @screen. + * Removes @provider from the global style providers list in @display. * - * Since: 3.0 + * Since: 3.94 **/ void -gtk_style_context_remove_provider_for_screen (GdkScreen *screen, - GtkStyleProvider *provider) +gtk_style_context_remove_provider_for_display (GdkDisplay *display, + GtkStyleProvider *provider) { GtkStyleCascade *cascade; - g_return_if_fail (GDK_IS_SCREEN (screen)); + g_return_if_fail (GDK_IS_DISPLAY (display)); g_return_if_fail (GTK_IS_STYLE_PROVIDER (provider)); g_return_if_fail (!GTK_IS_SETTINGS (provider)); - cascade = _gtk_settings_get_style_cascade (gtk_settings_get_for_screen (screen), 1); + cascade = _gtk_settings_get_style_cascade (gtk_settings_get_for_display (display), 1); _gtk_style_cascade_remove_provider (cascade, provider); } @@ -936,7 +936,7 @@ gtk_style_context_set_scale (GtkStyleContext *context, { GtkStyleCascade *new_cascade; - new_cascade = _gtk_settings_get_style_cascade (gtk_settings_get_for_screen (priv->screen), + new_cascade = _gtk_settings_get_style_cascade (gtk_settings_get_for_display (priv->display), scale); gtk_style_context_set_cascade (context, new_cascade); } @@ -1324,67 +1324,69 @@ _gtk_style_context_peek_property (GtkStyleContext *context, } /** - * gtk_style_context_set_screen: + * gtk_style_context_set_display: * @context: a #GtkStyleContext - * @screen: a #GdkScreen + * @display: a #GdkDisplay * - * Attaches @context to the given screen. + * Attaches @context to the given display. * - * The screen is used to add style information from “global” style - * providers, such as the screens #GtkSettings instance. + * The display is used to add style information from “global” style + * providers, such as the display's #GtkSettings instance. * * If you are using a #GtkStyleContext returned from * gtk_widget_get_style_context(), you do not need to * call this yourself. * - * Since: 3.0 + * Since: 3.94 **/ void -gtk_style_context_set_screen (GtkStyleContext *context, - GdkScreen *screen) +gtk_style_context_set_display (GtkStyleContext *context, + GdkDisplay *display) { GtkStyleContextPrivate *priv = gtk_style_context_get_instance_private (context); - GtkStyleCascade *screen_cascade; + GtkStyleCascade *display_cascade; g_return_if_fail (GTK_IS_STYLE_CONTEXT (context)); - g_return_if_fail (GDK_IS_SCREEN (screen)); + g_return_if_fail (GDK_IS_DISPLAY (display)); - if (priv->screen == screen) + if (priv->display == display) return; if (gtk_style_context_has_custom_cascade (context)) { - screen_cascade = _gtk_settings_get_style_cascade (gtk_settings_get_for_screen (screen), 1); - _gtk_style_cascade_set_parent (priv->cascade, screen_cascade); + display_cascade = _gtk_settings_get_style_cascade (gtk_settings_get_for_display (display), 1); + _gtk_style_cascade_set_parent (priv->cascade, display_cascade); } else { - screen_cascade = _gtk_settings_get_style_cascade (gtk_settings_get_for_screen (screen), + display_cascade = _gtk_settings_get_style_cascade (gtk_settings_get_for_display (display), _gtk_style_cascade_get_scale (priv->cascade)); - gtk_style_context_set_cascade (context, screen_cascade); + gtk_style_context_set_cascade (context, display_cascade); } - priv->screen = screen; + priv->display = display; - g_object_notify_by_pspec (G_OBJECT (context), properties[PROP_SCREEN]); + g_object_notify_by_pspec (G_OBJECT (context), properties[PROP_DISPLAY]); } /** - * gtk_style_context_get_screen: + * gtk_style_context_get_display: * @context: a #GtkStyleContext * - * Returns the #GdkScreen to which @context is attached. + * Returns the #GdkDisplay to which @context is attached. + * + * Returns: (transfer none): a #GdkDisplay. * - * Returns: (transfer none): a #GdkScreen. + * Since: 3.94 **/ -GdkScreen * -gtk_style_context_get_screen (GtkStyleContext *context) +GdkDisplay * +gtk_style_context_get_display (GtkStyleContext *context) { GtkStyleContextPrivate *priv = gtk_style_context_get_instance_private (context); g_return_val_if_fail (GTK_IS_STYLE_CONTEXT (context), NULL); - return priv->screen; + return priv->display; } /** @@ -1895,11 +1897,11 @@ gtk_render_insertion_cursor (GtkStyleContext *context, g_return_if_fail (PANGO_IS_LAYOUT (layout)); g_return_if_fail (index >= 0); - g_object_get (gtk_settings_get_for_screen (priv->screen), + g_object_get (gtk_settings_get_for_display (priv->display), "gtk-split-cursor", &split_cursor, NULL); - keymap_direction = gdk_keymap_get_direction (gdk_keymap_get_for_display (gdk_screen_get_display (priv->screen))); + keymap_direction = gdk_keymap_get_direction (gdk_keymap_get_for_display (priv->display)); pango_layout_get_cursor_pos (layout, index, &strong_pos, &weak_pos); @@ -1980,11 +1982,11 @@ gtk_snapshot_render_insertion_cursor (GtkSnapshot *snapshot, g_return_if_fail (PANGO_IS_LAYOUT (layout)); g_return_if_fail (index >= 0); - g_object_get (gtk_settings_get_for_screen (priv->screen), + g_object_get (gtk_settings_get_for_display (priv->display), "gtk-split-cursor", &split_cursor, NULL); - keymap_direction = gdk_keymap_get_direction (gdk_keymap_get_for_display (gdk_screen_get_display (priv->screen))); + keymap_direction = gdk_keymap_get_direction (gdk_keymap_get_for_display (priv->display)); pango_layout_get_cursor_pos (layout, index, &strong_pos, &weak_pos); diff --git a/gtk/gtkstylecontext.h b/gtk/gtkstylecontext.h index d50cdf36be..58da54d132 100644 --- a/gtk/gtkstylecontext.h +++ b/gtk/gtkstylecontext.h @@ -974,13 +974,13 @@ GType gtk_style_context_get_type (void) G_GNUC_CONST; GDK_AVAILABLE_IN_ALL GtkStyleContext * gtk_style_context_new (void); -GDK_AVAILABLE_IN_ALL -void gtk_style_context_add_provider_for_screen (GdkScreen *screen, - GtkStyleProvider *provider, - guint priority); -GDK_AVAILABLE_IN_ALL -void gtk_style_context_remove_provider_for_screen (GdkScreen *screen, - GtkStyleProvider *provider); +GDK_AVAILABLE_IN_3_94 +void gtk_style_context_add_provider_for_display (GdkDisplay *display, + GtkStyleProvider *provider, + guint priority); +GDK_AVAILABLE_IN_3_94 +void gtk_style_context_remove_provider_for_display (GdkDisplay *display, + GtkStyleProvider *provider); GDK_AVAILABLE_IN_ALL void gtk_style_context_add_provider (GtkStyleContext *context, @@ -1047,10 +1047,10 @@ gboolean gtk_style_context_has_class (GtkStyleContext *context, const gchar *class_name); GDK_AVAILABLE_IN_ALL -void gtk_style_context_set_screen (GtkStyleContext *context, - GdkScreen *screen); +void gtk_style_context_set_display (GtkStyleContext *context, + GdkDisplay *display); GDK_AVAILABLE_IN_ALL -GdkScreen * gtk_style_context_get_screen (GtkStyleContext *context); +GdkDisplay *gtk_style_context_get_display (GtkStyleContext *context); GDK_AVAILABLE_IN_3_8 void gtk_style_context_set_frame_clock (GtkStyleContext *context, @@ -1085,7 +1085,7 @@ void gtk_style_context_get_margin (GtkStyleContext *context, GtkBorder *margin); GDK_AVAILABLE_IN_ALL -void gtk_style_context_reset_widgets (GdkScreen *screen); +void gtk_style_context_reset_widgets (GdkDisplay *display); GDK_AVAILABLE_IN_3_4 void gtk_render_insertion_cursor diff --git a/gtk/gtkstyleprovider.c b/gtk/gtkstyleprovider.c index 2f5dddaf31..9eb735d4de 100644 --- a/gtk/gtkstyleprovider.c +++ b/gtk/gtkstyleprovider.c @@ -30,7 +30,7 @@ * @See_also: #GtkStyleContext, #GtkCssProvider * * GtkStyleProvider is an interface used to provide style information to a #GtkStyleContext. - * See gtk_style_context_add_provider() and gtk_style_context_add_provider_for_screen(). + * See gtk_style_context_add_provider() and gtk_style_context_add_provider_for_display(). */ static void gtk_style_provider_iface_init (gpointer g_iface); diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index da453e73ca..5522b380c6 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -8469,7 +8469,7 @@ do_display_change (GtkWidget *widget, _gtk_tooltip_hide (widget); if (new_display && priv->context) - gtk_style_context_set_screen (priv->context, gdk_display_get_default_screen (new_display)); + gtk_style_context_set_display (priv->context, new_display); g_signal_emit (widget, widget_signals[DISPLAY_CHANGED], 0, old_display); } @@ -14002,7 +14002,7 @@ gtk_widget_get_style_context (GtkWidget *widget) if (G_UNLIKELY (priv->context == NULL)) { - GdkScreen *screen; + GdkDisplay *display; GdkFrameClock *frame_clock; priv->context = gtk_style_context_new_for_node (priv->cssnode); @@ -14011,9 +14011,9 @@ gtk_widget_get_style_context (GtkWidget *widget) gtk_style_context_set_state (priv->context, priv->state_flags); gtk_style_context_set_scale (priv->context, gtk_widget_get_scale_factor (widget)); - screen = gtk_widget_get_screen (widget); - if (screen) - gtk_style_context_set_screen (priv->context, screen); + display = gtk_widget_get_display (widget); + if (display) + gtk_style_context_set_display (priv->context, display); frame_clock = gtk_widget_get_frame_clock (widget); if (frame_clock) diff --git a/gtk/gtkwin32theme.c b/gtk/gtkwin32theme.c index faedfbcfd1..5b5014ada5 100644 --- a/gtk/gtkwin32theme.c +++ b/gtk/gtkwin32theme.c @@ -170,7 +170,7 @@ invalidate_win32_themes (GdkXEvent *xevent, theme_was_open |= gtk_win32_theme_close (theme); } if (theme_was_open) - gtk_style_context_reset_widgets (gdk_display_get_default_screen (gdk_window_get_display (event->any.window))); + gtk_style_context_reset_widgets (gdk_window_get_display (event->any.window)); return GDK_FILTER_CONTINUE; } diff --git a/gtk/inspector/css-editor.c b/gtk/inspector/css-editor.c index 52417be1ab..4ec4e71cf9 100644 --- a/gtk/inspector/css-editor.c +++ b/gtk/inspector/css-editor.c @@ -122,12 +122,12 @@ disable_toggled (GtkToggleButton *button, GtkInspectorCssEditor *ce) { if (gtk_toggle_button_get_active (button)) - gtk_style_context_remove_provider_for_screen (gdk_screen_get_default (), - GTK_STYLE_PROVIDER (ce->priv->provider)); + gtk_style_context_remove_provider_for_display (gdk_display_get_default (), + GTK_STYLE_PROVIDER (ce->priv->provider)); else - gtk_style_context_add_provider_for_screen (gdk_screen_get_default (), - GTK_STYLE_PROVIDER (ce->priv->provider), - GTK_STYLE_PROVIDER_PRIORITY_USER); + gtk_style_context_add_provider_for_display (gdk_display_get_default (), + GTK_STYLE_PROVIDER (ce->priv->provider), + GTK_STYLE_PROVIDER_PRIORITY_USER); } static gchar * @@ -286,9 +286,9 @@ static void create_provider (GtkInspectorCssEditor *ce) { ce->priv->provider = gtk_css_provider_new (); - gtk_style_context_add_provider_for_screen (gdk_screen_get_default (), - GTK_STYLE_PROVIDER (ce->priv->provider), - GTK_STYLE_PROVIDER_PRIORITY_USER); + gtk_style_context_add_provider_for_display (gdk_display_get_default (), + GTK_STYLE_PROVIDER (ce->priv->provider), + GTK_STYLE_PROVIDER_PRIORITY_USER); g_signal_connect (ce->priv->provider, "parsing-error", G_CALLBACK (show_parsing_error), ce); @@ -297,8 +297,8 @@ create_provider (GtkInspectorCssEditor *ce) static void destroy_provider (GtkInspectorCssEditor *ce) { - gtk_style_context_remove_provider_for_screen (gdk_screen_get_default (), - GTK_STYLE_PROVIDER (ce->priv->provider)); + gtk_style_context_remove_provider_for_display (gdk_display_get_default (), + GTK_STYLE_PROVIDER (ce->priv->provider)); g_clear_object (&ce->priv->provider); } diff --git a/tests/testadjustsize.c b/tests/testadjustsize.c index 1f099d858f..1048697e2a 100644 --- a/tests/testadjustsize.c +++ b/tests/testadjustsize.c @@ -364,9 +364,9 @@ main (int argc, char *argv[]) ".black-bg { background-color: black; }" ".red-bg { background-color: red; }" ".blue-bg { background-color: blue; }", -1); - gtk_style_context_add_provider_for_screen (gdk_screen_get_default (), - GTK_STYLE_PROVIDER (provider), - GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); + gtk_style_context_add_provider_for_display (gdk_display_get_default (), + GTK_STYLE_PROVIDER (provider), + GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); g_object_unref (provider); if (g_getenv ("RTL")) diff --git a/tests/testbaseline.c b/tests/testbaseline.c index 62a663f370..61e197a0a3 100644 --- a/tests/testbaseline.c +++ b/tests/testbaseline.c @@ -83,9 +83,9 @@ main (int argc, ".small-font { font-size: 5px; }" ".medium-font { font-size: 10px; }" ".large-font { font-size: 15px; }", -1); - gtk_style_context_add_provider_for_screen (gdk_screen_get_default (), - GTK_STYLE_PROVIDER (provider), - GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); + gtk_style_context_add_provider_for_display (gdk_display_get_default (), + GTK_STYLE_PROVIDER (provider), + GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); g_object_unref (provider); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); g_signal_connect (G_OBJECT (window), "delete-event", G_CALLBACK (gtk_main_quit), NULL); diff --git a/tests/testboxcss.c b/tests/testboxcss.c index e4309aca73..3d7db8c700 100644 --- a/tests/testboxcss.c +++ b/tests/testboxcss.c @@ -156,9 +156,9 @@ main (gint argc, gchar **argv) NULL); provider = GTK_STYLE_PROVIDER (gtk_css_provider_new ()); - 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); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); diff --git a/tests/testgtk.c b/tests/testgtk.c index 4bcc9ace50..66cc0b3e17 100644 --- a/tests/testgtk.c +++ b/tests/testgtk.c @@ -8311,7 +8311,6 @@ main (int argc, char *argv[]) { GtkCssProvider *provider, *memory_provider; GdkDisplay *display; - GdkScreen *screen; GtkBindingSet *binding_set; int i; gboolean done_benchmarks = FALSE; @@ -8341,10 +8340,9 @@ main (int argc, char *argv[]) g_warning ("Couldn't find file \"testgtk.css\"."); display = gdk_display_get_default (); - screen = gdk_display_get_default_screen (display); - gtk_style_context_add_provider_for_screen (screen, GTK_STYLE_PROVIDER (provider), - GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); + gtk_style_context_add_provider_for_display (display, GTK_STYLE_PROVIDER (provider), + GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); g_object_unref (provider); gtk_accelerator_set_default_mod_mask (GDK_SHIFT_MASK | @@ -8414,8 +8412,8 @@ main (int argc, char *argv[]) " font-size: 18px;\n" "}", -1); - gtk_style_context_add_provider_for_screen (screen, GTK_STYLE_PROVIDER (memory_provider), - GTK_STYLE_PROVIDER_PRIORITY_APPLICATION + 1); + gtk_style_context_add_provider_for_display (display, GTK_STYLE_PROVIDER (memory_provider), + GTK_STYLE_PROVIDER_PRIORITY_APPLICATION + 1); create_main_window (); diff --git a/tests/testheaderbar.c b/tests/testheaderbar.c index 0165ca7d89..7735c1b638 100644 --- a/tests/testheaderbar.c +++ b/tests/testheaderbar.c @@ -136,9 +136,9 @@ main (int argc, char *argv[]) provider = gtk_css_provider_new (); gtk_css_provider_load_from_data (provider, css, -1); - gtk_style_context_add_provider_for_screen (gtk_widget_get_screen (window), - GTK_STYLE_PROVIDER (provider), - GTK_STYLE_PROVIDER_PRIORITY_USER); + gtk_style_context_add_provider_for_display (gtk_widget_get_display (window), + GTK_STYLE_PROVIDER (provider), + GTK_STYLE_PROVIDER_PRIORITY_USER); change_header (NULL, window); diff --git a/tests/testiconview-keynav.c b/tests/testiconview-keynav.c index b33a051a63..4fb3272477 100644 --- a/tests/testiconview-keynav.c +++ b/tests/testiconview-keynav.c @@ -216,16 +216,14 @@ static void set_styles (void) { GtkCssProvider *provider; - GdkScreen *screen; provider = gtk_css_provider_new (); gtk_css_provider_load_from_data (provider, CSS, -1); - screen = gdk_display_get_default_screen (gdk_display_get_default ()); - - gtk_style_context_add_provider_for_screen (screen, GTK_STYLE_PROVIDER (provider), - GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); + gtk_style_context_add_provider_for_display (gdk_display_get_default (), + GTK_STYLE_PROVIDER (provider), + GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); } int diff --git a/tests/testlevelbar.c b/tests/testlevelbar.c index 7de4d73709..9f21e99cfc 100644 --- a/tests/testlevelbar.c +++ b/tests/testlevelbar.c @@ -35,9 +35,9 @@ add_custom_css (void) provider = gtk_css_provider_new (); gtk_css_provider_load_from_data (provider, data, -1); - gtk_style_context_add_provider_for_screen (gdk_screen_get_default (), - GTK_STYLE_PROVIDER (provider), - GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); + gtk_style_context_add_provider_for_display (gdk_display_get_default (), + GTK_STYLE_PROVIDER (provider), + GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); } static gboolean diff --git a/tests/testlist.c b/tests/testlist.c index d5f495b212..8e3f8b9007 100644 --- a/tests/testlist.c +++ b/tests/testlist.c @@ -262,9 +262,9 @@ main (int argc, char *argv[]) provider = gtk_css_provider_new (); gtk_css_provider_load_from_data (provider, css, -1); - gtk_style_context_add_provider_for_screen (gtk_widget_get_screen (window), - GTK_STYLE_PROVIDER (provider), - GTK_STYLE_PROVIDER_PRIORITY_USER); + gtk_style_context_add_provider_for_display (gtk_widget_get_display (window), + GTK_STYLE_PROVIDER (provider), + GTK_STYLE_PROVIDER_PRIORITY_USER); list = gtk_list_box_new (); diff --git a/tests/testlist3.c b/tests/testlist3.c index 2c216b36ab..68bf67761c 100644 --- a/tests/testlist3.c +++ b/tests/testlist3.c @@ -152,7 +152,7 @@ main (int argc, char *argv[]) provider = gtk_css_provider_new (); gtk_css_provider_load_from_data (provider, css, -1); - gtk_style_context_add_provider_for_screen (gdk_screen_get_default (), GTK_STYLE_PROVIDER (provider), 800); + gtk_style_context_add_provider_for_display (gdk_display_get_default (), GTK_STYLE_PROVIDER (provider), 800); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW (window), -1, 300); diff --git a/tests/testoverlay.c b/tests/testoverlay.c index b153415fb1..ac5cc4d11d 100644 --- a/tests/testoverlay.c +++ b/tests/testoverlay.c @@ -615,9 +615,9 @@ main (int argc, char *argv[]) css_provider = gtk_css_provider_new (); gtk_css_provider_load_from_data (css_provider, css, -1); - gtk_style_context_add_provider_for_screen (gdk_screen_get_default (), - GTK_STYLE_PROVIDER (css_provider), - GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); + gtk_style_context_add_provider_for_display (gdk_display_get_default (), + GTK_STYLE_PROVIDER (css_provider), + GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); win1 = test_nonzerox (); gtk_widget_show (win1); diff --git a/tests/testoverlaystyleclass.c b/tests/testoverlaystyleclass.c index 2ceeac9189..6ed24b11d6 100644 --- a/tests/testoverlaystyleclass.c +++ b/tests/testoverlaystyleclass.c @@ -55,9 +55,9 @@ main (int argc, char *argv[]) ".left { border-left-style: none; border-top-left-radius: 0px; border-bottom-left-radius: 0px; }" ".right { border-right-style: none; border-top-right-radius: 0px; border-bottom-right-radius: 0px; }", -1); - gtk_style_context_add_provider_for_screen (gdk_screen_get_default (), - GTK_STYLE_PROVIDER (provider), - GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); + gtk_style_context_add_provider_for_display (gdk_display_get_default (), + GTK_STYLE_PROVIDER (provider), + GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); win = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW (win), 600, 600); diff --git a/tests/testwidgetfocus.c b/tests/testwidgetfocus.c index 3524bb990e..8164759323 100644 --- a/tests/testwidgetfocus.c +++ b/tests/testwidgetfocus.c @@ -273,9 +273,9 @@ main() provider = gtk_css_provider_new (); gtk_css_provider_load_from_data (provider, css, -1); - gtk_style_context_add_provider_for_screen (gdk_screen_get_default (), - GTK_STYLE_PROVIDER (provider), - GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); + gtk_style_context_add_provider_for_display (gdk_display_get_default (), + GTK_STYLE_PROVIDER (provider), + GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); widget = g_object_new (GTK_TYPE_FOCUS_WIDGET, NULL); 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 |