Change the signature of gtk_css_style_get_static_style

It is clearer if this function returns a GtkCssStaticStyle.
This commit is contained in:
Matthias Clasen 2020-01-16 13:56:07 -05:00
parent 3182063ffe
commit 3c50e5324f
6 changed files with 9 additions and 9 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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