summaryrefslogtreecommitdiff
path: root/gtk/gtkcssstyleproperty.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2012-04-02 08:53:51 +0200
committerBenjamin Otte <otte@redhat.com>2012-04-17 08:59:17 +0200
commited45a3c2f0c39c5c63939009ab8d67a6ba55e3c9 (patch)
tree3a4bf4d388982a5212dafcd9feca2e13891715a2 /gtk/gtkcssstyleproperty.c
parent9e4341f730ea0f08416405b2053765360f6d3f89 (diff)
downloadgtk+-ed45a3c2f0c39c5c63939009ab8d67a6ba55e3c9.tar.gz
cssstyleproperty: Add _gtk_css_style_property_is_animated()
Diffstat (limited to 'gtk/gtkcssstyleproperty.c')
-rw-r--r--gtk/gtkcssstyleproperty.c34
1 files changed, 33 insertions, 1 deletions
diff --git a/gtk/gtkcssstyleproperty.c b/gtk/gtkcssstyleproperty.c
index 05a80f08ab..d03fd53bdd 100644
--- a/gtk/gtkcssstyleproperty.c
+++ b/gtk/gtkcssstyleproperty.c
@@ -36,6 +36,7 @@
enum {
PROP_0,
+ PROP_ANIMATED,
PROP_ID,
PROP_INHERIT,
PROP_INITIAL
@@ -65,6 +66,9 @@ gtk_css_style_property_set_property (GObject *object,
switch (prop_id)
{
+ case PROP_ANIMATED:
+ property->animated = g_value_get_boolean (value);
+ break;
case PROP_INHERIT:
property->inherit = g_value_get_boolean (value);
break;
@@ -88,6 +92,9 @@ gtk_css_style_property_get_property (GObject *object,
switch (prop_id)
{
+ case PROP_ANIMATED:
+ g_value_set_boolean (value, property->animated);
+ break;
case PROP_ID:
g_value_set_boolean (value, property->id);
break;
@@ -177,6 +184,13 @@ _gtk_css_style_property_class_init (GtkCssStylePropertyClass *klass)
object_class->get_property = gtk_css_style_property_get_property;
g_object_class_install_property (object_class,
+ PROP_ANIMATED,
+ g_param_spec_boolean ("animated",
+ P_("Animated"),
+ P_("Set if the value can be animated"),
+ FALSE,
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
+ g_object_class_install_property (object_class,
PROP_ID,
g_param_spec_uint ("id",
P_("ID"),
@@ -311,12 +325,30 @@ _gtk_css_style_property_lookup_by_id (guint id)
gboolean
_gtk_css_style_property_is_inherit (GtkCssStyleProperty *property)
{
- g_return_val_if_fail (GTK_IS_CSS_STYLE_PROPERTY (property), 0);
+ g_return_val_if_fail (GTK_IS_CSS_STYLE_PROPERTY (property), FALSE);
return property->inherit;
}
/**
+ * _gtk_css_style_property_is_animated:
+ * @property: the property
+ *
+ * Queries if the given @property can be is animated. See
+ * <ulink url="http://www.w3.org/TR/css3-transitions/#animatable-css>
+ * the CSS documentation</ulink> for animatable properties.
+ *
+ * Returns: %TRUE if the property can be animated.
+ **/
+gboolean
+_gtk_css_style_property_is_animated (GtkCssStyleProperty *property)
+{
+ g_return_val_if_fail (GTK_IS_CSS_STYLE_PROPERTY (property), FALSE);
+
+ return property->animated;
+}
+
+/**
* _gtk_css_style_property_get_id:
* @property: the property
*