aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libindicator/indicator-object.c40
-rw-r--r--libindicator/indicator-object.h3
2 files changed, 43 insertions, 0 deletions
diff --git a/libindicator/indicator-object.c b/libindicator/indicator-object.c
index 108fecb..2ab0f84 100644
--- a/libindicator/indicator-object.c
+++ b/libindicator/indicator-object.c
@@ -50,6 +50,16 @@ struct _IndicatorObjectPrivate {
#define INDICATOR_OBJECT_GET_PRIVATE(o) (INDICATOR_OBJECT(o)->priv)
+/* Signals Stuff */
+enum {
+ ENTRY_ADDED,
+ ENTRY_REMOVED,
+ LAST_SIGNAL
+};
+
+static guint signals[LAST_SIGNAL] = { 0 };
+
+/* GObject stuff */
static void indicator_object_class_init (IndicatorObjectClass *klass);
static void indicator_object_init (IndicatorObject *self);
static void indicator_object_dispose (GObject *object);
@@ -77,6 +87,36 @@ indicator_object_class_init (IndicatorObjectClass *klass)
klass->get_entries = get_entries_default;
+ /**
+ IndicatorObject::entry-added:
+ @arg0: The #IndicatorObject object
+
+ Signaled when a new entry is added and should
+ be shown by the person using this object.
+ */
+ signals[ENTRY_ADDED] = g_signal_new (INDICATOR_OBJECT_SIGNAL_ENTRY_ADDED,
+ G_TYPE_FROM_CLASS(klass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (IndicatorObjectClass, entry_added),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__POINTER,
+ G_TYPE_NONE, 1, G_TYPE_POINTER, G_TYPE_NONE);
+
+ /**
+ IndicatorObject::entry-removed:
+ @arg0: The #IndicatorObject object
+
+ Signaled when an entry is removed and should
+ be removed by the person using this object.
+ */
+ signals[ENTRY_REMOVED] = g_signal_new (INDICATOR_OBJECT_SIGNAL_ENTRY_REMOVED,
+ G_TYPE_FROM_CLASS(klass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (IndicatorObjectClass, entry_removed),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__POINTER,
+ G_TYPE_NONE, 1, G_TYPE_POINTER, G_TYPE_NONE);
+
return;
}
diff --git a/libindicator/indicator-object.h b/libindicator/indicator-object.h
index c2d1944..1ac39b0 100644
--- a/libindicator/indicator-object.h
+++ b/libindicator/indicator-object.h
@@ -36,6 +36,9 @@ G_BEGIN_DECLS
#define INDICATOR_IS_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), INDICATOR_OBJECT_TYPE))
#define INDICATOR_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), INDICATOR_OBJECT_TYPE, IndicatorObjectClass))
+#define INDICATOR_OBJECT_SIGNAL_ENTRY_ADDED "entry-added"
+#define INDICATOR_OBJECT_SIGNAL_ENTRY_REMOVED "entry-removed"
+
typedef struct _IndicatorObject IndicatorObject;
typedef struct _IndicatorObjectClass IndicatorObjectClass;
typedef struct _IndicatorObjectPrivate IndicatorObjectPrivate;