diff --git a/docs/reference/gtk/gtk4-sections.txt b/docs/reference/gtk/gtk4-sections.txt index 4e5e6ea044..167a16ee62 100644 --- a/docs/reference/gtk/gtk4-sections.txt +++ b/docs/reference/gtk/gtk4-sections.txt @@ -5055,8 +5055,6 @@ gtk_style_context_get_state gtk_style_context_get_valist gtk_style_context_get_section gtk_style_context_get_color -gtk_style_context_get_background_color -gtk_style_context_get_border_color gtk_style_context_get_border gtk_style_context_get_padding gtk_style_context_get_margin diff --git a/gtk/gtkflowbox.c b/gtk/gtkflowbox.c index 65c491fe4b..015a48e8ab 100644 --- a/gtk/gtkflowbox.c +++ b/gtk/gtkflowbox.c @@ -2382,9 +2382,7 @@ gtk_flow_box_snapshot (GtkWidget *widget, cairo_append_path (cr, path); cairo_path_destroy (path); -G_GNUC_BEGIN_IGNORE_DEPRECATIONS - gtk_style_context_get_border_color (context, &border_color); -G_GNUC_END_IGNORE_DEPRECATIONS + gtk_style_context_get (context, "border-color", &border_color, NULL); gtk_style_context_get_border (context, &border); cairo_set_line_width (cr, border.left); diff --git a/gtk/gtkpopover.c b/gtk/gtkpopover.c index a39270c5a7..dba89e511c 100644 --- a/gtk/gtkpopover.c +++ b/gtk/gtkpopover.c @@ -1310,10 +1310,8 @@ gtk_popover_snapshot (GtkWidget *widget, if (border.bottom > 0) { GdkRGBA border_color; -G_GNUC_BEGIN_IGNORE_DEPRECATIONS - gtk_style_context_get_border_color (context, &border_color); -G_GNUC_END_IGNORE_DEPRECATIONS + gtk_style_context_get (context, "border-color", &border_color, NULL); gtk_popover_apply_tail_path (popover, cr); gdk_cairo_set_source_rgba (cr, &border_color); diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c index e765c852dc..4e0c953e2c 100644 --- a/gtk/gtkstylecontext.c +++ b/gtk/gtkstylecontext.c @@ -1431,67 +1431,6 @@ gtk_style_context_get_color (GtkStyleContext *context, gdk_rgba_free (c); } -/** - * gtk_style_context_get_background_color: - * @context: a #GtkStyleContext - * @color: (out): return value for the background color - * - * Gets the background color for a given state. - * - * This function is far less useful than it seems, and it should not be used in - * newly written code. CSS has no concept of "background color", as a background - * can be an image, or a gradient, or any other pattern including solid colors. - * - * The only reason why you would call gtk_style_context_get_background_color() is - * to use the returned value to draw the background with it; the correct way to - * achieve this result is to use gtk_render_background() instead, along with CSS - * style classes to modify the color to be rendered. - * - * Deprecated: 3.16: Use gtk_render_background() instead. - **/ -void -gtk_style_context_get_background_color (GtkStyleContext *context, - GdkRGBA *color) -{ - GdkRGBA *c; - - g_return_if_fail (color != NULL); - g_return_if_fail (GTK_IS_STYLE_CONTEXT (context)); - - gtk_style_context_get (context, - "background-color", &c, - NULL); - - *color = *c; - gdk_rgba_free (c); -} - -/** - * gtk_style_context_get_border_color: - * @context: a #GtkStyleContext - * @color: (out): return value for the border color - * - * Gets the border color for a given state. - * - * Deprecated: 3.16: Use gtk_render_frame() instead. - **/ -void -gtk_style_context_get_border_color (GtkStyleContext *context, - GdkRGBA *color) -{ - GdkRGBA *c; - - g_return_if_fail (color != NULL); - g_return_if_fail (GTK_IS_STYLE_CONTEXT (context)); - - gtk_style_context_get (context, - "border-color", &c, - NULL); - - *color = *c; - gdk_rgba_free (c); -} - /** * gtk_style_context_get_border: * @context: a #GtkStyleContext @@ -1992,9 +1931,7 @@ _gtk_style_context_get_attributes (AtkAttributeSet *attributes, GdkRGBA color; gchar *value; -G_GNUC_BEGIN_IGNORE_DEPRECATIONS - gtk_style_context_get_background_color (context, &color); -G_GNUC_END_IGNORE_DEPRECATIONS + gtk_style_context_get (context, "background-color", &color, NULL); value = g_strdup_printf ("%u,%u,%u", (guint) ceil (color.red * 65536 - color.red), (guint) ceil (color.green * 65536 - color.green), diff --git a/gtk/gtkstylecontext.h b/gtk/gtkstylecontext.h index 13de1f1035..f489db9152 100644 --- a/gtk/gtkstylecontext.h +++ b/gtk/gtkstylecontext.h @@ -1026,13 +1026,6 @@ gboolean gtk_style_context_lookup_color (GtkStyleContext *context, GDK_AVAILABLE_IN_ALL void gtk_style_context_get_color (GtkStyleContext *context, GdkRGBA *color); -GDK_DEPRECATED_FOR(gtk_render_background) -void gtk_style_context_get_background_color (GtkStyleContext *context, - GdkRGBA *color); -GDK_DEPRECATED_FOR(gtk_render_frame) -void gtk_style_context_get_border_color (GtkStyleContext *context, - GdkRGBA *color); - GDK_AVAILABLE_IN_ALL void gtk_style_context_get_border (GtkStyleContext *context, GtkBorder *border); diff --git a/gtk/gtktextdisplay.c b/gtk/gtktextdisplay.c index 4e6c49fd16..3f38112c88 100644 --- a/gtk/gtktextdisplay.c +++ b/gtk/gtktextdisplay.c @@ -580,11 +580,9 @@ render_para (GtkTextRenderer *text_renderer, selection_node = gtk_text_view_get_selection_node ((GtkTextView*)text_renderer->widget); gtk_style_context_save_to_node (context, selection_node); -G_GNUC_BEGIN_IGNORE_DEPRECATIONS - gtk_style_context_get_background_color (context, &selection); -G_GNUC_END_IGNORE_DEPRECATIONS + gtk_style_context_get (context, "background-color", &selection, NULL); - gtk_style_context_restore (context); + gtk_style_context_restore (context); do { @@ -775,9 +773,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS { GdkRGBA color; -G_GNUC_BEGIN_IGNORE_DEPRECATIONS - gtk_style_context_get_background_color (context, &color); -G_GNUC_END_IGNORE_DEPRECATIONS + gtk_style_context_get (context, "background-color", &color, NULL); gdk_cairo_set_source_rgba (cr, &color); diff --git a/gtk/gtktextutil.c b/gtk/gtktextutil.c index 9858bec5ad..651b92abd9 100644 --- a/gtk/gtktextutil.c +++ b/gtk/gtktextutil.c @@ -250,9 +250,7 @@ set_attributes_from_style (GtkStyleContext *context, if (!values->appearance.fg_rgba) values->appearance.fg_rgba = gdk_rgba_copy (&black); -G_GNUC_BEGIN_IGNORE_DEPRECATIONS - gtk_style_context_get_background_color (context, values->appearance.bg_rgba); -G_GNUC_END_IGNORE_DEPRECATIONS + gtk_style_context_get (context, "background-color", values->appearance.bg_rgba, NULL); gtk_style_context_get_color (context, values->appearance.fg_rgba); if (values->font) diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c index 0f378211e8..00fa5ce0dd 100644 --- a/gtk/gtktextview.c +++ b/gtk/gtktextview.c @@ -7310,9 +7310,7 @@ gtk_text_view_set_attributes_from_style (GtkTextView *text_view, context = gtk_widget_get_style_context (GTK_WIDGET (text_view)); -G_GNUC_BEGIN_IGNORE_DEPRECATIONS - gtk_style_context_get_background_color (context, values->appearance.bg_rgba); -G_GNUC_END_IGNORE_DEPRECATIONS + gtk_style_context_get (context, "background-color", values->appearance.bg_rgba, NULL); gtk_style_context_get_color (context, values->appearance.fg_rgba); if (values->font)