[gtk+] styleprovider: Add a private signal for when things change



commit 74f4c6f6bd755967b68bac3e551f6fff2dde6a24
Author: Benjamin Otte <otte redhat com>
Date:   Sun Apr 8 17:33:22 2012 +0200

    styleprovider: Add a private signal for when things change

 gtk/gtkstyleproviderprivate.c |   26 ++++++++++++++++++++++++++
 gtk/gtkstyleproviderprivate.h |    5 +++++
 2 files changed, 31 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkstyleproviderprivate.c b/gtk/gtkstyleproviderprivate.c
index fc7e298..a646201 100644
--- a/gtk/gtkstyleproviderprivate.c
+++ b/gtk/gtkstyleproviderprivate.c
@@ -18,13 +18,30 @@
 #include "config.h"
 
 #include "gtkstyleproviderprivate.h"
+
+#include "gtkintl.h"
 #include "gtkstyleprovider.h"
 
+enum {
+  CHANGED,
+  LAST_SIGNAL
+};
+
 G_DEFINE_INTERFACE (GtkStyleProviderPrivate, _gtk_style_provider_private, GTK_TYPE_STYLE_PROVIDER)
 
+guint signals[LAST_SIGNAL];
+
 static void
 _gtk_style_provider_private_default_init (GtkStyleProviderPrivateInterface *iface)
 {
+  signals[CHANGED] = g_signal_new (I_("-gtk-private-changed"),
+                                   G_TYPE_FROM_INTERFACE (iface),
+                                   G_SIGNAL_RUN_LAST,
+                                   G_STRUCT_OFFSET (GtkStyleProviderPrivateInterface, changed),
+                                   NULL, NULL,
+                                   g_cclosure_marshal_VOID__VOID,
+                                   G_TYPE_NONE, 0);
+
 }
 
 GtkSymbolicColor *
@@ -78,3 +95,12 @@ _gtk_style_provider_private_get_change (GtkStyleProviderPrivate *provider,
 
   return iface->get_change (provider, matcher);
 }
+
+void
+_gtk_style_provider_private_changed (GtkStyleProviderPrivate *provider)
+{
+  g_return_if_fail (GTK_IS_STYLE_PROVIDER_PRIVATE (provider));
+
+  g_signal_emit (provider, signals[CHANGED], 0);
+}
+
diff --git a/gtk/gtkstyleproviderprivate.h b/gtk/gtkstyleproviderprivate.h
index 88b64a0..0a66a8e 100644
--- a/gtk/gtkstyleproviderprivate.h
+++ b/gtk/gtkstyleproviderprivate.h
@@ -46,6 +46,9 @@ struct _GtkStyleProviderPrivateInterface
                                                  GtkCssLookup            *lookup);
   GtkCssChange          (* get_change)          (GtkStyleProviderPrivate *provider,
                                                  const GtkCssMatcher     *matcher);
+
+  /* signal */
+  void                  (* changed)             (GtkStyleProviderPrivate *provider);
 };
 
 GType                   _gtk_style_provider_private_get_type     (void) G_GNUC_CONST;
@@ -58,6 +61,8 @@ void                    _gtk_style_provider_private_lookup       (GtkStyleProvid
 GtkCssChange            _gtk_style_provider_private_get_change   (GtkStyleProviderPrivate *provider,
                                                                   const GtkCssMatcher     *matcher);
 
+void                    _gtk_style_provider_private_changed      (GtkStyleProviderPrivate *provider);
+
 G_END_DECLS
 
 #endif /* __GTK_STYLE_PROVIDER_PRIVATE_H__ */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]