forked from AuroraMiddleware/gtk
styleprovider: Add a private signal for when things change
This commit is contained in:
parent
29fbfcb8f5
commit
74f4c6f6bd
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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__ */
|
||||
|
Loading…
Reference in New Issue
Block a user