summaryrefslogtreecommitdiff
path: root/gtk/gtkcssstyle.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2015-02-27 18:41:13 +0100
committerBenjamin Otte <otte@redhat.com>2015-03-18 15:23:33 +0100
commit759d8dafd99d47466aaffc355906955a0c658005 (patch)
tree781142ba7869980fb06e15fb8691a14a01b0c1fe /gtk/gtkcssstyle.c
parentd9727290cfcbf68fe55bb29156a312b20ab9e615 (diff)
downloadgtk+-759d8dafd99d47466aaffc355906955a0c658005.tar.gz
cssstyle: Add gtk_css_style_is_static()
Gets rid of the need to do if (ANIMATED_STYLE() && animated_style_is_static(ANIMATED_STYLE(style))
Diffstat (limited to 'gtk/gtkcssstyle.c')
-rw-r--r--gtk/gtkcssstyle.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gtk/gtkcssstyle.c b/gtk/gtkcssstyle.c
index 084919159e..c4afe13468 100644
--- a/gtk/gtkcssstyle.c
+++ b/gtk/gtkcssstyle.c
@@ -46,10 +46,17 @@ gtk_css_style_real_get_section (GtkCssStyle *style,
return NULL;
}
+static gboolean
+gtk_css_style_real_is_static (GtkCssStyle *style)
+{
+ return TRUE;
+}
+
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;
}
static void
@@ -97,6 +104,15 @@ gtk_css_style_get_difference (GtkCssStyle *style,
return result;
}
+gboolean
+gtk_css_style_is_static (GtkCssStyle *style)
+{
+ gtk_internal_return_val_if_fail (GTK_IS_CSS_STYLE (style), TRUE);
+
+ return GTK_CSS_STYLE_GET_CLASS (style)->is_static (style);
+}
+
+
void
gtk_css_style_print (GtkCssStyle *style,
GString *string)