[gtk/wip/baedert/for-master: 3/5] stylecontext: Remove get_pango_attributes



commit f5c60e87328d565e58e5cc1eb44159e923504f36
Author: Timm Bäder <mail baedert org>
Date:   Sun Apr 12 09:46:03 2020 +0200

    stylecontext: Remove get_pango_attributes
    
    Make the only caller use GtkCssNode API.

 gtk/gtkstylecontext.c        | 6 ------
 gtk/gtkstylecontextprivate.h | 2 --
 gtk/gtktext.c                | 5 +----
 3 files changed, 1 insertion(+), 12 deletions(-)
---
diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c
index ab087433e1..80e7440491 100644
--- a/gtk/gtkstylecontext.c
+++ b/gtk/gtkstylecontext.c
@@ -1406,12 +1406,6 @@ gtk_snapshot_render_insertion_cursor (GtkSnapshot     *snapshot,
     }
 }
 
-PangoAttrList *
-_gtk_style_context_get_pango_attributes (GtkStyleContext *context)
-{
-  return gtk_css_style_get_pango_attributes (gtk_style_context_lookup_style (context));
-}
-
 static AtkAttributeSet *
 add_attribute (AtkAttributeSet  *attributes,
                AtkTextAttribute  attr,
diff --git a/gtk/gtkstylecontextprivate.h b/gtk/gtkstylecontextprivate.h
index f01adc5edb..b0e675d807 100644
--- a/gtk/gtkstylecontextprivate.h
+++ b/gtk/gtkstylecontextprivate.h
@@ -53,8 +53,6 @@ void           _gtk_style_context_get_cursor_color           (GtkStyleContext
                                                               GdkRGBA            *primary_color,
                                                               GdkRGBA            *secondary_color);
 
-PangoAttrList *_gtk_style_context_get_pango_attributes       (GtkStyleContext *context);
-
 /* Accessibility support */
 AtkAttributeSet *_gtk_style_context_get_attributes           (AtkAttributeSet    *attributes,
                                                               GtkStyleContext    *context);
diff --git a/gtk/gtktext.c b/gtk/gtktext.c
index 1d56e7ea1f..38817a598e 100644
--- a/gtk/gtktext.c
+++ b/gtk/gtktext.c
@@ -4331,7 +4331,6 @@ gtk_text_create_layout (GtkText  *self,
 {
   GtkTextPrivate *priv = gtk_text_get_instance_private (self);
   GtkWidget *widget = GTK_WIDGET (self);
-  GtkStyleContext *context;
   PangoLayout *layout;
   PangoAttrList *tmp_attrs;
   char *preedit_string = NULL;
@@ -4340,12 +4339,10 @@ gtk_text_create_layout (GtkText  *self,
   char *display_text;
   guint n_bytes;
 
-  context = gtk_widget_get_style_context (widget);
-
   layout = gtk_widget_create_pango_layout (widget, NULL);
   pango_layout_set_single_paragraph_mode (layout, TRUE);
 
-  tmp_attrs = _gtk_style_context_get_pango_attributes (context);
+  tmp_attrs = gtk_css_style_get_pango_attributes (gtk_css_node_get_style (gtk_widget_get_css_node (widget)));
   tmp_attrs = _gtk_pango_attr_list_merge (tmp_attrs, priv->attrs);
   if (!tmp_attrs)
     tmp_attrs = pango_attr_list_new ();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]