aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2011-01-10 10:21:35 -0600
committerTed Gould <ted@gould.cx>2011-01-10 10:21:35 -0600
commit38af4e8e52874d435eb9596f6b8d7fe79e71fe49 (patch)
tree1e727a3e4bfe37321b49d48cbdcd636770e810d7
parent48db67a55cf6d79ccc99a41cd512d5455f5d1925 (diff)
parent2b6655fef97e8d37f0d29b668fdd382692cdaca8 (diff)
downloadlibayatana-indicator-38af4e8e52874d435eb9596f6b8d7fe79e71fe49.tar.gz
libayatana-indicator-38af4e8e52874d435eb9596f6b8d7fe79e71fe49.tar.bz2
libayatana-indicator-38af4e8e52874d435eb9596f6b8d7fe79e71fe49.zip
Adding a signal for the menu being closed.
-rw-r--r--libindicator/indicator-object.c21
-rw-r--r--libindicator/indicator-object.h5
2 files changed, 26 insertions, 0 deletions
diff --git a/libindicator/indicator-object.c b/libindicator/indicator-object.c
index 7469cb9..988a8ae 100644
--- a/libindicator/indicator-object.c
+++ b/libindicator/indicator-object.c
@@ -500,3 +500,24 @@ indicator_object_entry_activate (IndicatorObject * io, IndicatorObjectEntry * en
return;
}
+/**
+ indicator_object_entry_close:
+ @io: #IndicatorObject to query
+ @entry: The #IndicatorObjectEntry whose menu was closed
+ @timestamp: The X11 timestamp of the event
+
+ Used to tell the indicator that a menu has been closed for the
+ entry that is specified.
+*/
+void
+indicator_object_entry_close (IndicatorObject * io, IndicatorObjectEntry * entry, guint timestamp)
+{
+ g_return_if_fail(INDICATOR_IS_OBJECT(io));
+ IndicatorObjectClass * class = INDICATOR_OBJECT_GET_CLASS(io);
+
+ if (class->entry_close != NULL) {
+ return class->entry_close(io, entry, timestamp);
+ }
+
+ return;
+}
diff --git a/libindicator/indicator-object.h b/libindicator/indicator-object.h
index 6072f4f..9ad1366 100644
--- a/libindicator/indicator-object.h
+++ b/libindicator/indicator-object.h
@@ -83,6 +83,9 @@ typedef struct _IndicatorObjectEntry IndicatorObjectEntry;
@get_show_now: Returns whether the entry is requesting to
be shown "right now" in that it has something important
to tell the user.
+ @entry_activate: Should be called when the menus for a given
+ entry are shown to the user.
+ @entry_close: Called when the menu is closed.
@entry_added: Slot for #IndicatorObject::entry-added
@entry_removed: Slot for #IndicatorObject::entry-removed
@entry_moved: Slot for #IndicatorObject::entry-moved
@@ -102,6 +105,7 @@ struct _IndicatorObjectClass {
gboolean (*get_show_now) (IndicatorObject * io, IndicatorObjectEntry * entry);
void (*entry_activate) (IndicatorObject * io, IndicatorObjectEntry * entry, guint timestamp);
+ void (*entry_close) (IndicatorObject * io, IndicatorObjectEntry * entry, guint timestamp);
/* Signals */
void (*entry_added) (IndicatorObject * io, IndicatorObjectEntry * entry, gpointer user_data);
@@ -150,6 +154,7 @@ GList * indicator_object_get_entries (IndicatorObject * io);
guint indicator_object_get_location (IndicatorObject * io, IndicatorObjectEntry * entry);
guint indicator_object_get_show_now (IndicatorObject * io, IndicatorObjectEntry * entry);
void indicator_object_entry_activate (IndicatorObject * io, IndicatorObjectEntry * entry, guint timestamp);
+void indicator_object_entry_close (IndicatorObject * io, IndicatorObjectEntry * entry, guint timestamp);
G_END_DECLS