Merge branch 'deprecations' into 'master'

Drop deprecated style context apis

See merge request GNOME/gtk!691
This commit is contained in:
Matthias Clasen 2019-03-31 19:56:05 +00:00
commit 91bbce3fef
8 changed files with 8 additions and 92 deletions

View File

@ -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

View File

@ -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);

View File

@ -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);

View File

@ -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),

View File

@ -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);

View File

@ -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);

View File

@ -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)

View File

@ -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)