aboutsummaryrefslogtreecommitdiff
path: root/libindicate/server.c
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-01-13 14:18:47 -0600
committerTed Gould <ted@canonical.com>2009-01-13 14:18:47 -0600
commit82dee9414fc6ae41006f1664c1be0636a15ca4dd (patch)
tree45661b6ba97d84d773577539373956c61cd41ca7 /libindicate/server.c
parentf64b5d9528ff05508224d48652edbfde1d497243 (diff)
downloadlibayatana-indicator-82dee9414fc6ae41006f1664c1be0636a15ca4dd.tar.gz
libayatana-indicator-82dee9414fc6ae41006f1664c1be0636a15ca4dd.tar.bz2
libayatana-indicator-82dee9414fc6ae41006f1664c1be0636a15ca4dd.zip
Making it so that the indicators all have unique IDs
Diffstat (limited to 'libindicate/server.c')
-rw-r--r--libindicate/server.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/libindicate/server.c b/libindicate/server.c
index 8878f69..8c0f956 100644
--- a/libindicate/server.c
+++ b/libindicate/server.c
@@ -39,6 +39,7 @@ static gboolean get_indicator_property (IndicateServer * server, guint id, gchar
static gboolean get_indicator_property_group (IndicateServer * server, guint id, gchar ** properties, gchar *** value, GError **error);
static gboolean get_indicator_properties (IndicateServer * server, guint id, gchar *** properties, GError **error);
static gboolean show_indicator_to_user (IndicateServer * server, guint id, GError ** error);
+static guint get_next_id (IndicateServer * server);
/* Code */
static void
@@ -84,6 +85,7 @@ indicate_server_class_init (IndicateServerClass * class)
class->get_indicator_property_group = get_indicator_property_group;
class->get_indicator_properties = get_indicator_properties;
class->show_indicator_to_user = show_indicator_to_user;
+ class->get_next_id = get_next_id;
return;
}
@@ -97,6 +99,7 @@ indicate_server_init (IndicateServer * server)
server->indicators = NULL;
server->num_hidden = 0;
server->visible = FALSE;
+ server->current_id = 0;
return;
}
@@ -144,6 +147,13 @@ indicate_server_show (IndicateServer * server)
return;
}
+static guint
+get_next_id (IndicateServer * server)
+{
+ server->current_id++;
+ return server->current_id;
+}
+
static void
indicator_show_cb (IndicateIndicator * indicator, IndicateServer * server)
{
@@ -542,3 +552,15 @@ indicate_server_show_indicator_to_user (IndicateServer * server, guint id, GErro
return TRUE;
}
+guint
+indicate_server_get_next_id (IndicateServer * server)
+{
+ IndicateServerClass * class = INDICATE_SERVER_GET_CLASS(server);
+
+ if (class != NULL) {
+ return class->get_next_id (server);
+ }
+
+ return 0;
+}
+