aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-03-12 14:33:30 -0600
committerTed Gould <ted@gould.cx>2010-03-12 14:33:30 -0600
commit0d2c0778772b92815dd1a773f6a5e10ed3c80869 (patch)
treebb06136c1ae008b56cb7667b08835ed74c1d5a1c
parenta92cec4aa9f3b7a014f9ed0e3dc3b2617e4114be (diff)
downloadayatana-indicator-session-0d2c0778772b92815dd1a773f6a5e10ed3c80869.tar.gz
ayatana-indicator-session-0d2c0778772b92815dd1a773f6a5e10ed3c80869.tar.bz2
ayatana-indicator-session-0d2c0778772b92815dd1a773f6a5e10ed3c80869.zip
Build us a signal
-rw-r--r--src/session-dbus.c17
-rw-r--r--src/session-dbus.h1
2 files changed, 18 insertions, 0 deletions
diff --git a/src/session-dbus.c b/src/session-dbus.c
index cc12311..fd506ad 100644
--- a/src/session-dbus.c
+++ b/src/session-dbus.c
@@ -13,6 +13,14 @@ struct _SessionDbusPrivate {
gchar * name;
};
+/* Signals */
+enum {
+ ICON_UPDATED,
+ LAST_SIGNAL
+};
+
+static guint signals[LAST_SIGNAL] = { 0 };
+
#define SESSION_DBUS_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), SESSION_DBUS_TYPE, SessionDbusPrivate))
@@ -33,6 +41,14 @@ session_dbus_class_init (SessionDbusClass *klass)
object_class->dispose = session_dbus_dispose;
object_class->finalize = session_dbus_finalize;
+ signals[ICON_UPDATED] = g_signal_new ("icon-updated",
+ G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (SessionDbusClass, icon_updated),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__STRING,
+ G_TYPE_NONE, 1, G_TYPE_STRING);
+
dbus_g_object_type_install_info(SESSION_DBUS_TYPE, &dbus_glib__session_dbus_server_object_info);
return;
@@ -90,5 +106,6 @@ session_dbus_set_name (SessionDbus * session, const gchar * name)
priv->name = NULL;
}
priv->name = g_strdup(name);
+ g_signal_emit(G_OBJECT(session), signals[ICON_UPDATED], 0, priv->name, TRUE);
return;
}
diff --git a/src/session-dbus.h b/src/session-dbus.h
index d606378..67c151c 100644
--- a/src/session-dbus.h
+++ b/src/session-dbus.h
@@ -18,6 +18,7 @@ typedef struct _SessionDbusClass SessionDbusClass;
struct _SessionDbusClass {
GObjectClass parent_class;
+ void (*icon_updated) (SessionDbus * session, gchar * icon, gpointer user_data);
};
struct _SessionDbus {