summaryrefslogtreecommitdiff
path: root/gtk/gtkmodifierstyle.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2011-12-28 22:59:55 +0100
committerBenjamin Otte <otte@redhat.com>2012-01-09 18:37:50 +0100
commitba5e7012b1c4cec7f3cfcee662273d4b960e497d (patch)
tree1b7b5829f2b5711a7c1dd657fcc530c2122a8e6a /gtk/gtkmodifierstyle.c
parent38a9b28a0edfdf8fd6749815bfc3c8edf457e3ec (diff)
downloadgtk+-ba5e7012b1c4cec7f3cfcee662273d4b960e497d.tar.gz
css: Redo StyleProvider interface
We now use the GtkStleProviderPrivate interface, which hopefully is faster and more conformant to CSS. Long term, it definitely should be both. I would have liked to split this up into multiple commits, but couldn't find a way.
Diffstat (limited to 'gtk/gtkmodifierstyle.c')
-rw-r--r--gtk/gtkmodifierstyle.c40
1 files changed, 37 insertions, 3 deletions
diff --git a/gtk/gtkmodifierstyle.c b/gtk/gtkmodifierstyle.c
index d81b9bcb06..efb1008111 100644
--- a/gtk/gtkmodifierstyle.c
+++ b/gtk/gtkmodifierstyle.c
@@ -19,6 +19,7 @@
#include "config.h"
#include "gtkmodifierstyle.h"
+#include "gtkstyleproviderprivate.h"
#include "gtkintl.h"
typedef struct StylePropertyValue StylePropertyValue;
@@ -36,12 +37,15 @@ enum {
static guint signals [LAST_SIGNAL] = { 0 };
-static void gtk_modifier_style_provider_init (GtkStyleProviderIface *iface);
-static void gtk_modifier_style_finalize (GObject *object);
+static void gtk_modifier_style_provider_init (GtkStyleProviderIface *iface);
+static void gtk_modifier_style_provider_private_init (GtkStyleProviderPrivateInterface *iface);
+static void gtk_modifier_style_finalize (GObject *object);
G_DEFINE_TYPE_EXTENDED (GtkModifierStyle, _gtk_modifier_style, G_TYPE_OBJECT, 0,
G_IMPLEMENT_INTERFACE (GTK_TYPE_STYLE_PROVIDER,
- gtk_modifier_style_provider_init));
+ gtk_modifier_style_provider_init)
+ G_IMPLEMENT_INTERFACE (GTK_TYPE_STYLE_PROVIDER_PRIVATE,
+ gtk_modifier_style_provider_private_init));
static void
_gtk_modifier_style_class_init (GtkModifierStyleClass *klass)
@@ -131,6 +135,36 @@ gtk_modifier_style_provider_init (GtkStyleProviderIface *iface)
iface->get_style_property = gtk_modifier_style_get_style_property;
}
+static GtkSymbolicColor *
+gtk_modifier_style_provider_get_color (GtkStyleProviderPrivate *provider,
+ const char *name)
+{
+ GtkModifierStyle *style = GTK_MODIFIER_STYLE (provider);
+
+ return _gtk_style_provider_private_get_color (GTK_STYLE_PROVIDER_PRIVATE (style->priv->style), name);
+}
+
+static void
+gtk_modifier_style_provider_lookup (GtkStyleProviderPrivate *provider,
+ GtkWidgetPath *path,
+ GtkStateFlags state,
+ GtkCssLookup *lookup)
+{
+ GtkModifierStyle *style = GTK_MODIFIER_STYLE (provider);
+
+ _gtk_style_provider_private_lookup (GTK_STYLE_PROVIDER_PRIVATE (style->priv->style),
+ path,
+ state,
+ lookup);
+}
+
+static void
+gtk_modifier_style_provider_private_init (GtkStyleProviderPrivateInterface *iface)
+{
+ iface->get_color = gtk_modifier_style_provider_get_color;
+ iface->lookup = gtk_modifier_style_provider_lookup;
+}
+
static void
gtk_modifier_style_finalize (GObject *object)
{