From 04eb7eef29e1ce1891164ad1c3c70bd9a82e5d56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Sun, 15 Jul 2018 18:52:48 +0200 Subject: [PATCH] Remove icon extents API --- gtk/gtkrendericon.c | 39 --------------------------------------- gtk/gtkstylecontext.c | 22 ---------------------- 2 files changed, 61 deletions(-) diff --git a/gtk/gtkrendericon.c b/gtk/gtkrendericon.c index 3ebb941008..afed8b613d 100644 --- a/gtk/gtkrendericon.c +++ b/gtk/gtkrendericon.c @@ -229,45 +229,6 @@ gtk_css_style_render_icon_surface (GtkCssStyle *style, cairo_set_matrix (cr, &saved_matrix); } -void -gtk_css_style_render_icon_get_extents (GtkCssStyle *style, - GdkRectangle *extents, - gint x, - gint y, - gint width, - gint height) -{ - graphene_matrix_t transform_matrix, translate_matrix, matrix; - graphene_rect_t bounds; - GtkBorder border; - - g_return_if_fail (GTK_IS_CSS_STYLE (style)); - g_return_if_fail (extents != NULL); - - extents->x = x; - extents->y = y; - extents->width = width; - extents->height = height; - - if (!gtk_css_transform_value_get_matrix (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_ICON_TRANSFORM), &transform_matrix)) - return; - - graphene_matrix_init_translate (&translate_matrix, &GRAPHENE_POINT3D_INIT(x + width / 2.0, y + height / 2.0, 0)); - graphene_matrix_multiply (&transform_matrix, &translate_matrix, &matrix); - graphene_rect_init (&bounds, - - width / 2.0, - height / 2.0, - width, height); - /* need to round to full pixels */ - graphene_matrix_transform_bounds (&matrix, &bounds, &bounds); - - _gtk_css_shadows_value_get_extents (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_ICON_SHADOW), &border); - - extents->x = floorf (bounds.origin.x) - border.left; - extents->y = floorf (bounds.origin.y) - border.top; - extents->width = ceilf (bounds.origin.x + bounds.size.width) - extents->x + border.right; - extents->height = ceilf (bounds.origin.y + bounds.size.height) - extents->y + border.bottom; -} - void gtk_css_style_snapshot_icon_paintable (GtkCssStyle *style, GtkSnapshot *snapshot, diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c index e9df80529c..d5d738aa47 100644 --- a/gtk/gtkstylecontext.c +++ b/gtk/gtkstylecontext.c @@ -1950,28 +1950,6 @@ gtk_style_context_get_change (GtkStyleContext *context) return priv->invalidating_context; } -void -_gtk_style_context_get_icon_extents (GtkStyleContext *context, - GdkRectangle *extents, - gint x, - gint y, - gint width, - gint height) -{ - g_return_if_fail (GTK_IS_STYLE_CONTEXT (context)); - g_return_if_fail (extents != NULL); - - if (_gtk_css_image_value_get_image (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_ICON_SOURCE)) == NULL) - { - extents->x = extents->y = extents->width = extents->height = 0; - return; - } - - gtk_css_style_render_icon_get_extents (gtk_style_context_lookup_style (context), - extents, - x, y, width, height); -} - PangoAttrList * _gtk_style_context_get_pango_attributes (GtkStyleContext *context) {