cssstyleproperty: Add _gtk_css_style_property_is_animated()
This commit is contained in:
@ -36,6 +36,7 @@
|
|||||||
|
|
||||||
enum {
|
enum {
|
||||||
PROP_0,
|
PROP_0,
|
||||||
|
PROP_ANIMATED,
|
||||||
PROP_ID,
|
PROP_ID,
|
||||||
PROP_INHERIT,
|
PROP_INHERIT,
|
||||||
PROP_INITIAL
|
PROP_INITIAL
|
||||||
@ -65,6 +66,9 @@ gtk_css_style_property_set_property (GObject *object,
|
|||||||
|
|
||||||
switch (prop_id)
|
switch (prop_id)
|
||||||
{
|
{
|
||||||
|
case PROP_ANIMATED:
|
||||||
|
property->animated = g_value_get_boolean (value);
|
||||||
|
break;
|
||||||
case PROP_INHERIT:
|
case PROP_INHERIT:
|
||||||
property->inherit = g_value_get_boolean (value);
|
property->inherit = g_value_get_boolean (value);
|
||||||
break;
|
break;
|
||||||
@ -88,6 +92,9 @@ gtk_css_style_property_get_property (GObject *object,
|
|||||||
|
|
||||||
switch (prop_id)
|
switch (prop_id)
|
||||||
{
|
{
|
||||||
|
case PROP_ANIMATED:
|
||||||
|
g_value_set_boolean (value, property->animated);
|
||||||
|
break;
|
||||||
case PROP_ID:
|
case PROP_ID:
|
||||||
g_value_set_boolean (value, property->id);
|
g_value_set_boolean (value, property->id);
|
||||||
break;
|
break;
|
||||||
@ -176,6 +183,13 @@ _gtk_css_style_property_class_init (GtkCssStylePropertyClass *klass)
|
|||||||
object_class->set_property = gtk_css_style_property_set_property;
|
object_class->set_property = gtk_css_style_property_set_property;
|
||||||
object_class->get_property = gtk_css_style_property_get_property;
|
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,
|
g_object_class_install_property (object_class,
|
||||||
PROP_ID,
|
PROP_ID,
|
||||||
g_param_spec_uint ("id",
|
g_param_spec_uint ("id",
|
||||||
@ -311,11 +325,29 @@ _gtk_css_style_property_lookup_by_id (guint id)
|
|||||||
gboolean
|
gboolean
|
||||||
_gtk_css_style_property_is_inherit (GtkCssStyleProperty *property)
|
_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;
|
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:
|
* _gtk_css_style_property_get_id:
|
||||||
* @property: the property
|
* @property: the property
|
||||||
|
@ -58,7 +58,8 @@
|
|||||||
/*** REGISTRATION ***/
|
/*** REGISTRATION ***/
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
GTK_STYLE_PROPERTY_INHERIT = (1 << 0)
|
GTK_STYLE_PROPERTY_INHERIT = (1 << 0),
|
||||||
|
GTK_STYLE_PROPERTY_ANIMATED = (1 << 1)
|
||||||
} GtkStylePropertyFlags;
|
} GtkStylePropertyFlags;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -83,6 +84,7 @@ gtk_css_style_property_register (const char * name,
|
|||||||
|
|
||||||
node = g_object_new (GTK_TYPE_CSS_STYLE_PROPERTY,
|
node = g_object_new (GTK_TYPE_CSS_STYLE_PROPERTY,
|
||||||
"value-type", value_type,
|
"value-type", value_type,
|
||||||
|
"animated", (flags & GTK_STYLE_PROPERTY_ANIMATED) ? TRUE : FALSE,
|
||||||
"inherit", (flags & GTK_STYLE_PROPERTY_INHERIT) ? TRUE : FALSE,
|
"inherit", (flags & GTK_STYLE_PROPERTY_INHERIT) ? TRUE : FALSE,
|
||||||
"initial-value", initial_value,
|
"initial-value", initial_value,
|
||||||
"name", name,
|
"name", name,
|
||||||
|
@ -58,6 +58,7 @@ struct _GtkCssStyleProperty
|
|||||||
GtkCssValue *initial_value;
|
GtkCssValue *initial_value;
|
||||||
guint id;
|
guint id;
|
||||||
guint inherit :1;
|
guint inherit :1;
|
||||||
|
guint animated :1;
|
||||||
|
|
||||||
GtkCssStylePropertyParseFunc parse_value;
|
GtkCssStylePropertyParseFunc parse_value;
|
||||||
GtkCssStylePropertyPrintFunc print_value;
|
GtkCssStylePropertyPrintFunc print_value;
|
||||||
@ -82,6 +83,7 @@ guint _gtk_css_style_property_get_n_properties(void);
|
|||||||
GtkCssStyleProperty * _gtk_css_style_property_lookup_by_id (guint id);
|
GtkCssStyleProperty * _gtk_css_style_property_lookup_by_id (guint id);
|
||||||
|
|
||||||
gboolean _gtk_css_style_property_is_inherit (GtkCssStyleProperty *property);
|
gboolean _gtk_css_style_property_is_inherit (GtkCssStyleProperty *property);
|
||||||
|
gboolean _gtk_css_style_property_is_animated (GtkCssStyleProperty *property);
|
||||||
guint _gtk_css_style_property_get_id (GtkCssStyleProperty *property);
|
guint _gtk_css_style_property_get_id (GtkCssStyleProperty *property);
|
||||||
GtkCssValue * _gtk_css_style_property_get_initial_value
|
GtkCssValue * _gtk_css_style_property_get_initial_value
|
||||||
(GtkCssStyleProperty *property);
|
(GtkCssStyleProperty *property);
|
||||||
|
Reference in New Issue
Block a user