aboutsummaryrefslogtreecommitdiff
path: root/libindicate/server.c
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-02-15 21:53:55 -0600
committerTed Gould <ted@canonical.com>2009-02-15 21:53:55 -0600
commit3a3a6e58cfddaa0f72f71e7a01d76ac24f5e854d (patch)
treed61739eb602a33335466643a5a20f29cfb908815 /libindicate/server.c
parent0e0780f55ad2814ca7d96446fa0489e259b87e13 (diff)
downloadlibayatana-indicator-3a3a6e58cfddaa0f72f71e7a01d76ac24f5e854d.tar.gz
libayatana-indicator-3a3a6e58cfddaa0f72f71e7a01d76ac24f5e854d.tar.bz2
libayatana-indicator-3a3a6e58cfddaa0f72f71e7a01d76ac24f5e854d.zip
Adding a new signal in that handles the ID of zero, or null, comming
back from a listener and uses that to show the server. Or atleast signal it to figure out how to do that. Also cleaning up the signals a little to use defines.
Diffstat (limited to 'libindicate/server.c')
-rw-r--r--libindicate/server.c31
1 files changed, 26 insertions, 5 deletions
diff --git a/libindicate/server.c b/libindicate/server.c
index ee20321..8a35906 100644
--- a/libindicate/server.c
+++ b/libindicate/server.c
@@ -52,6 +52,7 @@ enum {
INDICATOR_MODIFIED,
SERVER_SHOW,
SERVER_HIDE,
+ SERVER_DISPLAY,
LAST_SIGNAL
};
@@ -116,41 +117,48 @@ indicate_server_class_init (IndicateServerClass * class)
gobj->set_property = set_property;
gobj->get_property = get_property;
- signals[INDICATOR_ADDED] = g_signal_new("indicator-added",
+ signals[INDICATOR_ADDED] = g_signal_new(INDICATE_SERVER_SIGNAL_INDICATOR_ADDED,
G_TYPE_FROM_CLASS (class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (IndicateServerClass, indicator_added),
NULL, NULL,
g_cclosure_marshal_VOID__UINT_POINTER,
G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_STRING);
- signals[INDICATOR_REMOVED] = g_signal_new("indicator-removed",
+ signals[INDICATOR_REMOVED] = g_signal_new(INDICATE_SERVER_SIGNAL_INDICATOR_REMOVED,
G_TYPE_FROM_CLASS (class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (IndicateServerClass, indicator_removed),
NULL, NULL,
g_cclosure_marshal_VOID__UINT_POINTER,
G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_STRING);
- signals[INDICATOR_MODIFIED] = g_signal_new("indicator-modified",
+ signals[INDICATOR_MODIFIED] = g_signal_new(INDICATE_SERVER_SIGNAL_INDICATOR_MODIFIED,
G_TYPE_FROM_CLASS (class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (IndicateServerClass, indicator_modified),
NULL, NULL,
g_cclosure_marshal_VOID__UINT_POINTER,
G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_STRING);
- signals[SERVER_SHOW] = g_signal_new("server-show",
+ signals[SERVER_SHOW] = g_signal_new(INDICATE_SERVER_SIGNAL_SERVER_SHOW,
G_TYPE_FROM_CLASS (class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (IndicateServerClass, server_show),
NULL, NULL,
g_cclosure_marshal_VOID__POINTER,
G_TYPE_NONE, 1, G_TYPE_STRING);
- signals[SERVER_HIDE] = g_signal_new("server-hide",
+ signals[SERVER_HIDE] = g_signal_new(INDICATE_SERVER_SIGNAL_SERVER_HIDE,
G_TYPE_FROM_CLASS (class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (IndicateServerClass, server_hide),
NULL, NULL,
g_cclosure_marshal_VOID__POINTER,
G_TYPE_NONE, 1, G_TYPE_STRING);
+ signals[SERVER_DISPLAY] = g_signal_new(INDICATE_SERVER_SIGNAL_SERVER_DISPLAY,
+ G_TYPE_FROM_CLASS (class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (IndicateServerClass, server_display),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
g_object_class_install_property (gobj, PROP_DESKTOP,
g_param_spec_string("desktop", "Desktop File",
@@ -661,6 +669,11 @@ get_indicator_properties (IndicateServer * server, guint id, gchar *** propertie
static gboolean
show_indicator_to_user (IndicateServer * server, guint id, GError ** error)
{
+ if (id == INDICATE_SERVER_INDICATOR_NULL) {
+ g_signal_emit(server, signals[SERVER_DISPLAY], 0, TRUE);
+ return TRUE;
+ }
+
IndicateIndicator * indicator = get_indicator(server, id, error);
if (indicator == NULL) {
return FALSE;
@@ -879,3 +892,11 @@ indicate_server_emit_indicator_modified (IndicateServer *server, guint id, const
g_signal_emit(server, signals[INDICATOR_MODIFIED], 0, id, property);
}
+
+void
+indicate_server_emit_server_display (IndicateServer *server)
+{
+ g_return_if_fail (INDICATE_IS_SERVER (server));
+
+ g_signal_emit(server, signals[SERVER_DISPLAY], 0, TRUE);
+}