[gtk/matthiasc/for-master] Change the signature of gtk_css_style_get_static_style



commit 3c50e5324f08e41dd9838334a631677684ac7ca1
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Jan 16 13:56:07 2020 -0500

    Change the signature of gtk_css_style_get_static_style
    
    It is clearer if this function returns a GtkCssStaticStyle.

 gtk/gtkcssanimatedstyle.c      | 4 ++--
 gtk/gtkcssnode.c               | 2 +-
 gtk/gtkcssstaticstyleprivate.h | 1 -
 gtk/gtkcssstyle.c              | 6 +++---
 gtk/gtkcssstyleprivate.h       | 4 ++--
 gtk/gtkcsstypesprivate.h       | 1 +
 6 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/gtk/gtkcssanimatedstyle.c b/gtk/gtkcssanimatedstyle.c
index 56a5e7b476..12a1dc79ec 100644
--- a/gtk/gtkcssanimatedstyle.c
+++ b/gtk/gtkcssanimatedstyle.c
@@ -79,13 +79,13 @@ gtk_css_animated_style_is_static (GtkCssStyle *style)
   return TRUE;
 }
 
-static GtkCssStyle *
+static GtkCssStaticStyle *
 gtk_css_animated_style_get_static_style (GtkCssStyle *style)
 {
   /* This is called a lot, so we avoid a dynamic type check here */
   GtkCssAnimatedStyle *animated = (GtkCssAnimatedStyle *) style;
 
-  return animated->style;
+  return (GtkCssStaticStyle *)animated->style;
 }
 
 static void
diff --git a/gtk/gtkcssnode.c b/gtk/gtkcssnode.c
index 3dfb8e5a83..16faabe0df 100644
--- a/gtk/gtkcssnode.c
+++ b/gtk/gtkcssnode.c
@@ -407,7 +407,7 @@ gtk_css_node_real_update_style (GtkCssNode   *cssnode,
 {
   GtkCssStyle *static_style, *new_static_style, *new_style;
 
-  static_style = gtk_css_style_get_static_style (style);
+  static_style = GTK_CSS_STYLE (gtk_css_style_get_static_style (style));
 
   if (gtk_css_style_needs_recreation (static_style, change))
     new_static_style = gtk_css_node_create_style (cssnode);
diff --git a/gtk/gtkcssstaticstyleprivate.h b/gtk/gtkcssstaticstyleprivate.h
index 2a00dd0372..7ef2b67a4d 100644
--- a/gtk/gtkcssstaticstyleprivate.h
+++ b/gtk/gtkcssstaticstyleprivate.h
@@ -32,7 +32,6 @@ G_BEGIN_DECLS
 #define GTK_IS_CSS_STATIC_STYLE_CLASS(obj)  (G_TYPE_CHECK_CLASS_TYPE (obj, GTK_TYPE_CSS_STATIC_STYLE))
 #define GTK_CSS_STATIC_STYLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_CSS_STATIC_STYLE, 
GtkCssStaticStyleClass))
 
-typedef struct _GtkCssStaticStyle           GtkCssStaticStyle;
 typedef struct _GtkCssStaticStyleClass      GtkCssStaticStyleClass;
 
 struct _GtkCssStaticStyle
diff --git a/gtk/gtkcssstyle.c b/gtk/gtkcssstyle.c
index 53561657cb..d9012a1265 100644
--- a/gtk/gtkcssstyle.c
+++ b/gtk/gtkcssstyle.c
@@ -53,10 +53,10 @@ gtk_css_style_real_is_static (GtkCssStyle *style)
   return TRUE;
 }
 
-static GtkCssStyle *
+static GtkCssStaticStyle *
 gtk_css_style_real_get_static_style (GtkCssStyle *style)
 {
-  return style;
+  return (GtkCssStaticStyle *)style;
 }
 
 static void
@@ -96,7 +96,7 @@ gtk_css_style_is_static (GtkCssStyle *style)
   return GTK_CSS_STYLE_GET_CLASS (style)->is_static (style);
 }
 
-GtkCssStyle *
+GtkCssStaticStyle *
 gtk_css_style_get_static_style (GtkCssStyle *style)
 {
   gtk_internal_return_val_if_fail (GTK_IS_CSS_STYLE (style), NULL);
diff --git a/gtk/gtkcssstyleprivate.h b/gtk/gtkcssstyleprivate.h
index 6c4fcd035b..ef54fd9be0 100644
--- a/gtk/gtkcssstyleprivate.h
+++ b/gtk/gtkcssstyleprivate.h
@@ -57,7 +57,7 @@ struct _GtkCssStyleClass
   /* TRUE if this style will require changes based on timestamp */
   gboolean              (* is_static)                           (GtkCssStyle            *style);
 
-  GtkCssStyle *         (* get_static_style)                    (GtkCssStyle            *style);
+  GtkCssStaticStyle *   (* get_static_style)                    (GtkCssStyle            *style);
 };
 
 GType                   gtk_css_style_get_type                  (void) G_GNUC_CONST;
@@ -76,7 +76,7 @@ gboolean                gtk_css_style_print                     (GtkCssStyle
 PangoAttrList *         gtk_css_style_get_pango_attributes      (GtkCssStyle            *style);
 
 PangoFontDescription *  gtk_css_style_get_pango_font            (GtkCssStyle            *style);
-GtkCssStyle *           gtk_css_style_get_static_style          (GtkCssStyle            *style);
+GtkCssStaticStyle *     gtk_css_style_get_static_style          (GtkCssStyle            *style);
 
 G_END_DECLS
 
diff --git a/gtk/gtkcsstypesprivate.h b/gtk/gtkcsstypesprivate.h
index ee1c5b815d..719a743e0c 100644
--- a/gtk/gtkcsstypesprivate.h
+++ b/gtk/gtkcsstypesprivate.h
@@ -27,6 +27,7 @@ typedef union _GtkCssMatcher GtkCssMatcher;
 typedef struct _GtkCssNode GtkCssNode;
 typedef struct _GtkCssNodeDeclaration GtkCssNodeDeclaration;
 typedef struct _GtkCssStyle GtkCssStyle;
+typedef struct _GtkCssStaticStyle GtkCssStaticStyle;
 
 #define GTK_CSS_CHANGE_CLASS                          (1ULL <<  0)
 #define GTK_CSS_CHANGE_NAME                           (1ULL <<  1)


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