aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-01-07 14:22:21 -0600
committerTed Gould <ted@canonical.com>2009-01-07 14:22:21 -0600
commit98bb1516347d67d94074ba2b07c9ba9d19c3a798 (patch)
treefb880071f30a43c7bf87f360a09bf79ecedd5845
parent8e913de4c33af10f9d37a0994bbe0f13e93528b4 (diff)
downloadlibayatana-indicator-98bb1516347d67d94074ba2b07c9ba9d19c3a798.tar.gz
libayatana-indicator-98bb1516347d67d94074ba2b07c9ba9d19c3a798.tar.bz2
libayatana-indicator-98bb1516347d67d94074ba2b07c9ba9d19c3a798.zip
Dropping in more code to make these real GObjects and such
-rw-r--r--libindicate/indicator.c49
-rw-r--r--libindicate/indicator.h17
2 files changed, 66 insertions, 0 deletions
diff --git a/libindicate/indicator.c b/libindicate/indicator.c
index f98c368..e2455a2 100644
--- a/libindicate/indicator.c
+++ b/libindicate/indicator.c
@@ -3,5 +3,54 @@
#include "indicator.h"
#include "indicate.h"
+/* Signals */
+enum {
+ USER_DISPLAY,
+ LAST_SIGNAL
+};
+guint signals[LAST_SIGNAL] = { 0 };
+
+G_DEFINE_TYPE (IndicateIndicator, indicate_indicator, G_TYPE_OBJECT);
+
+static void indicate_indicator_finalize (GObject * object);
+
+
+/* Functions */
+static void
+indicate_indicator_class_init (IndicateIndicatorClass * class)
+{
+ GObjectClass * gobj;
+ gobj = G_OBJECT_CLASS(class);
+
+ gobj->finalize = indicate_indicator_finalize;
+
+ signals[USER_DISPLAY] = g_signal_new(INDICATE_INDICATOR_SIGNAL_DISPLAY,
+ G_TYPE_FROM_CLASS(class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET(IndicateIndicatorClass, user_display),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ return;
+}
+
+static void
+indicate_indicator_init (IndicateIndicator * indicator)
+{
+ id = 0;
+
+ /* TODO: Need to connect to a server here */
+
+ return;
+}
+
+static void
+indicate_indicator_finalize (GObject * obj)
+{
+ /* TODO: Need to disconnect from server here */
+
+ return;
+}
diff --git a/libindicate/indicator.h b/libindicate/indicator.h
index d9b8075..93f551c 100644
--- a/libindicate/indicator.h
+++ b/libindicate/indicator.h
@@ -6,6 +6,9 @@
#define INDICATE_TYPE_INDICATOR (indicate_indicator_get_type ())
#define INDICATE_INDICATOR(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), INDICATE_TYPE_INDICATOR, IndicateIndicator))
#define INDICATE_IS_INDICATOR(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), INDICATE_TYPE_INDICATOR))
+#define INDICATE_INDICATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INDICATE_TYPE_INDICATOR, IndicateIndicatorClass))
+#define INDICATE_IS_INDICATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INDICATE_TYPE_INDICATOR))
+#define INDICATE_INDICATOR_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS((object), INDICATE_TYPE_INDICATOR, IndicateIndicatorCLass))
/* This is a signal that signals to the indicator that the user
* has done an action where they'd like this indicator to be
@@ -13,6 +16,20 @@
#define INDICATE_INDICATOR_SIGNAL_DISPLAY "user-display"
typedef struct _IndicateIndicator IndicateIndicator;
+struct _IndicateIndicator {
+ GObject parent;
+
+ guint id;
+};
+
+typedef struct _IndicateIndicatorClass IndicateIndicatorClass;
+struct _IndicateIndicatorClass {
+ GObjectClass parent_class;
+
+ void (*user_display) (IndicateIndicator * indicator, gpointer data);
+
+ gchar * (*get_type) (IndicateIndicator * indicator);
+};
IndicateIndicator * indicate_indicator_new (void);