[gtk+] css: Implement filter
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] css: Implement filter
- Date: Sat, 31 Dec 2016 01:58:04 +0000 (UTC)
commit 959f80e6e9b120ffc905d0f5be7740cc933d055f
Author: Benjamin Otte <otte redhat com>
Date: Sat Dec 31 02:48:25 2016 +0100
css: Implement filter
So far, it's only implemented for widgets, not for gadgets.
Not sure how to do it for gadgets without conflicts for widget gadgets
yet...
gtk/gtkcssstylepropertyimpl.c | 8 ++++++++
gtk/gtkwidget.c | 9 ++++++++-
2 files changed, 16 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkcssstylepropertyimpl.c b/gtk/gtkcssstylepropertyimpl.c
index 15ea1ca..20d2988 100644
--- a/gtk/gtkcssstylepropertyimpl.c
+++ b/gtk/gtkcssstylepropertyimpl.c
@@ -1594,6 +1594,14 @@ _gtk_css_style_property_init_properties (void)
opacity_parse,
opacity_query,
_gtk_css_number_value_new (1, GTK_CSS_NUMBER));
+ gtk_css_style_property_register ("filter",
+ GTK_CSS_PROPERTY_FILTER,
+ G_TYPE_NONE,
+ GTK_STYLE_PROPERTY_ANIMATED,
+ GTK_CSS_AFFECTS_REDRAW,
+ filter_value_parse,
+ NULL,
+ gtk_css_filter_value_new_none ());
/* Private property holding the binding sets */
gtk_css_style_property_register ("-gtk-key-bindings",
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 04dfc04..8b52b6c 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -37,9 +37,10 @@
#include "gtkaccelmapprivate.h"
#include "gtkaccelgroupprivate.h"
#include "gtkclipboard.h"
-#include "gtkcssstylepropertyprivate.h"
+#include "gtkcssfiltervalueprivate.h"
#include "gtkcssnumbervalueprivate.h"
#include "gtkcssshadowsvalueprivate.h"
+#include "gtkcssstylepropertyprivate.h"
#include "gtkintl.h"
#include "gtkmarshalers.h"
#include "gtkselectionprivate.h"
@@ -15534,6 +15535,7 @@ gtk_widget_snapshot (GtkWidget *widget,
{
GtkWidgetClass *klass = GTK_WIDGET_GET_CLASS (widget);
graphene_rect_t bounds;
+ GtkCssValue *filter_value;
GtkAllocation clip;
GtkAllocation alloc;
RenderMode mode;
@@ -15563,6 +15565,9 @@ gtk_widget_snapshot (GtkWidget *widget,
if (GTK_DEBUG_CHECK (SNAPSHOT))
gtk_snapshot_push (snapshot, TRUE, "%s<%p>", gtk_widget_get_name (widget), widget);
+ filter_value = _gtk_style_context_peek_property (gtk_widget_get_style_context (widget),
GTK_CSS_PROPERTY_FILTER);
+ gtk_css_filter_value_push_snapshot (filter_value, snapshot);
+
if (mode == RENDER_DRAW)
{
cairo_t *cr;
@@ -15599,6 +15604,8 @@ gtk_widget_snapshot (GtkWidget *widget,
gtk_snapshot_pop_and_append (snapshot);
}
+ gtk_css_filter_value_pop_snapshot (filter_value, snapshot);
+
if (GTK_DEBUG_CHECK (SNAPSHOT))
gtk_snapshot_pop_and_append (snapshot);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]