summaryrefslogtreecommitdiff
path: root/gtk/gtkcssstylepropertyimpl.c
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@gnome.org>2013-08-04 11:38:56 +0200
committerCosimo Cecchi <cosimoc@gnome.org>2013-08-20 02:50:40 +0200
commit736b350d7a42d01520a8e73c403763765d7fc867 (patch)
treea4bf3506da9683517653439becf1a6fd5f4586ee /gtk/gtkcssstylepropertyimpl.c
parent723a589bddc635816556f1e2fddc5700f4cb9288 (diff)
downloadgtk+-736b350d7a42d01520a8e73c403763765d7fc867.tar.gz
css: Add a GtkCssValue for GtkCssImageEffect
This will allow us to use the CSS machinery to apply a highlight or dim effect when images are prelit or insensitive. https://bugzilla.gnome.org/show_bug.cgi?id=705443
Diffstat (limited to 'gtk/gtkcssstylepropertyimpl.c')
-rw-r--r--gtk/gtkcssstylepropertyimpl.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gtk/gtkcssstylepropertyimpl.c b/gtk/gtkcssstylepropertyimpl.c
index c189ea691c..3ff3d76692 100644
--- a/gtk/gtkcssstylepropertyimpl.c
+++ b/gtk/gtkcssstylepropertyimpl.c
@@ -465,6 +465,18 @@ parse_css_fill_mode (GtkCssStyleProperty *property,
}
static GtkCssValue *
+image_effect_parse (GtkCssStyleProperty *property,
+ GtkCssParser *parser)
+{
+ GtkCssValue *value = _gtk_css_image_effect_value_try_parse (parser);
+
+ if (value == NULL)
+ _gtk_css_parser_error (parser, "unknown value for property");
+
+ return value;
+}
+
+static GtkCssValue *
bindings_value_parse_one (GtkCssParser *parser)
{
char *name;
@@ -1398,6 +1410,14 @@ _gtk_css_style_property_init_properties (void)
NULL,
NULL,
_gtk_css_number_value_new (1, GTK_CSS_NUMBER));
+ gtk_css_style_property_register ("-gtk-image-effect",
+ GTK_CSS_PROPERTY_GTK_IMAGE_EFFECT,
+ G_TYPE_NONE,
+ GTK_STYLE_PROPERTY_INHERIT | GTK_STYLE_PROPERTY_NO_RESIZE,
+ image_effect_parse,
+ NULL,
+ NULL,
+ _gtk_css_image_effect_value_new (GTK_CSS_IMAGE_EFFECT_NONE));
gtk_css_style_property_register ("engine",
GTK_CSS_PROPERTY_ENGINE,