summaryrefslogtreecommitdiff
path: root/gtk/gtkcssstyle.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-01-12 22:44:58 -0500
committerMatthias Clasen <mclasen@redhat.com>2020-01-16 12:02:44 -0500
commitb2b89f6c5765bc3731b83b4951b4603a70689437 (patch)
tree4d882cc45cbc1b164e27f5bc22ee3ee5fd3fa249 /gtk/gtkcssstyle.c
parent5ac24db04961c5d139c72027008bba475c9113a3 (diff)
downloadgtk+-b2b89f6c5765bc3731b83b4951b4603a70689437.tar.gz
css: Add gtk_css_style_get_static_style
This lets us avoid poking directly at the GtkCssAnimatedStyle struct in gtkcssnode.c.
Diffstat (limited to 'gtk/gtkcssstyle.c')
-rw-r--r--gtk/gtkcssstyle.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/gtk/gtkcssstyle.c b/gtk/gtkcssstyle.c
index 835a2b4213..53561657cb 100644
--- a/gtk/gtkcssstyle.c
+++ b/gtk/gtkcssstyle.c
@@ -53,11 +53,18 @@ gtk_css_style_real_is_static (GtkCssStyle *style)
return TRUE;
}
+static GtkCssStyle *
+gtk_css_style_real_get_static_style (GtkCssStyle *style)
+{
+ return style;
+}
+
static void
gtk_css_style_class_init (GtkCssStyleClass *klass)
{
klass->get_section = gtk_css_style_real_get_section;
klass->is_static = gtk_css_style_real_is_static;
+ klass->get_static_style = gtk_css_style_real_get_static_style;
}
static void
@@ -89,6 +96,14 @@ gtk_css_style_is_static (GtkCssStyle *style)
return GTK_CSS_STYLE_GET_CLASS (style)->is_static (style);
}
+GtkCssStyle *
+gtk_css_style_get_static_style (GtkCssStyle *style)
+{
+ gtk_internal_return_val_if_fail (GTK_IS_CSS_STYLE (style), NULL);
+
+ return GTK_CSS_STYLE_GET_CLASS (style)->get_static_style (style);
+}
+
/*
* gtk_css_style_print:
* @style: a #GtkCssStyle