aboutsummaryrefslogtreecommitdiff
path: root/libindicate/server.c
diff options
context:
space:
mode:
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;
+}
+