From 90b4c191ef8eb28244ea405669a3671f0e5060c5 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 16 Sep 2010 15:56:50 -0500 Subject: Adding a function to push activate back down. --- libindicator/indicator-object.c | 19 +++++++++++++++++++ libindicator/indicator-object.h | 1 + 2 files changed, 20 insertions(+) diff --git a/libindicator/indicator-object.c b/libindicator/indicator-object.c index a5fd740..63eed05 100644 --- a/libindicator/indicator-object.c +++ b/libindicator/indicator-object.c @@ -432,3 +432,22 @@ indicator_object_get_location (IndicatorObject * io, IndicatorObjectEntry * entr return 0; } + +/** + indicator_object_entry_activate: + @io: #IndicatorObject to query + @entry: The #IndicatorObjectEntry whose entry was shown + + Used to signal to the indicator that the menu on an entry has + been clicked on. This can either be an activate or a showing + of the menu. Note, this does not actually show the menu that's + left up to the reader. +*/ +void +indicator_object_entry_activate (IndicatorObject * io, IndicatorObjectEntry * entry) +{ + + + + return; +} diff --git a/libindicator/indicator-object.h b/libindicator/indicator-object.h index 32a35f9..8714093 100644 --- a/libindicator/indicator-object.h +++ b/libindicator/indicator-object.h @@ -132,6 +132,7 @@ IndicatorObject * indicator_object_new_from_file (const gchar * file); GList * indicator_object_get_entries (IndicatorObject * io); guint indicator_object_get_location (IndicatorObject * io, IndicatorObjectEntry * entry); +void indicator_object_entry_activate (IndicatorObject * io, IndicatorObjectEntry * entry); G_END_DECLS -- cgit v1.2.3 From 64db4d0d0dd0eb801b0dd2214d7723ba10f4ba81 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 16 Sep 2010 16:06:41 -0500 Subject: Breaking the ABI and adding a subclassable function. --- libindicator/indicator-object.c | 3 ++- libindicator/indicator-object.h | 10 +++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/libindicator/indicator-object.c b/libindicator/indicator-object.c index 63eed05..ecd0966 100644 --- a/libindicator/indicator-object.c +++ b/libindicator/indicator-object.c @@ -437,6 +437,7 @@ indicator_object_get_location (IndicatorObject * io, IndicatorObjectEntry * entr indicator_object_entry_activate: @io: #IndicatorObject to query @entry: The #IndicatorObjectEntry whose entry was shown + @timestamp: The X11 timestamp of the event Used to signal to the indicator that the menu on an entry has been clicked on. This can either be an activate or a showing @@ -444,7 +445,7 @@ indicator_object_get_location (IndicatorObject * io, IndicatorObjectEntry * entr left up to the reader. */ void -indicator_object_entry_activate (IndicatorObject * io, IndicatorObjectEntry * entry) +indicator_object_entry_activate (IndicatorObject * io, IndicatorObjectEntry * entry, guint timestamp) { diff --git a/libindicator/indicator-object.h b/libindicator/indicator-object.h index 8714093..79f4757 100644 --- a/libindicator/indicator-object.h +++ b/libindicator/indicator-object.h @@ -94,6 +94,8 @@ struct _IndicatorObjectClass { GList * (*get_entries) (IndicatorObject * io); guint (*get_location) (IndicatorObject * io, IndicatorObjectEntry * entry); + void (*entry_activate) (IndicatorObject * io, IndicatorObjectEntry * entry, guint timestamp); + /* Signals */ void (*entry_added) (IndicatorObject * io, IndicatorObjectEntry * entry, gpointer user_data); void (*entry_removed) (IndicatorObject * io, IndicatorObjectEntry * entry, gpointer user_data); @@ -102,6 +104,12 @@ struct _IndicatorObjectClass { void (*menu_show) (IndicatorObject * io, IndicatorObjectEntry * entry, guint timestamp, gpointer user_data); /* Reserved */ + void (*reserved1) (void); + void (*reserved2) (void); + void (*reserved3) (void); + void (*reserved4) (void); + void (*reserved5) (void); + void (*reserved6) (void); }; /** @@ -132,7 +140,7 @@ IndicatorObject * indicator_object_new_from_file (const gchar * file); GList * indicator_object_get_entries (IndicatorObject * io); guint indicator_object_get_location (IndicatorObject * io, IndicatorObjectEntry * entry); -void indicator_object_entry_activate (IndicatorObject * io, IndicatorObjectEntry * entry); +void indicator_object_entry_activate (IndicatorObject * io, IndicatorObjectEntry * entry, guint timestamp); G_END_DECLS -- cgit v1.2.3 From daffbe647964a04f1f8da94f12cfd9746ad7483b Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 16 Sep 2010 16:09:26 -0500 Subject: Fleshing out the entry activate function --- libindicator/indicator-object.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libindicator/indicator-object.c b/libindicator/indicator-object.c index ecd0966..41484a6 100644 --- a/libindicator/indicator-object.c +++ b/libindicator/indicator-object.c @@ -447,8 +447,13 @@ indicator_object_get_location (IndicatorObject * io, IndicatorObjectEntry * entr void indicator_object_entry_activate (IndicatorObject * io, IndicatorObjectEntry * entry, guint timestamp) { + g_return_if_fail(INDICATOR_IS_OBJECT(io)); + IndicatorObjectClass * class = INDICATOR_OBJECT_GET_CLASS(io); - + if (class->entry_activate != NULL) { + return class->entry_activate(io, entry, timestamp); + } return; } + -- cgit v1.2.3 From 6269aec66333ed1e308ebc22182ceaa57217ad36 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 16 Sep 2010 16:15:31 -0500 Subject: Creating a callback on the loader to signal the event press down to the entry. --- tools/indicator-loader.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tools/indicator-loader.c b/tools/indicator-loader.c index 747b216..03614aa 100644 --- a/tools/indicator-loader.c +++ b/tools/indicator-loader.c @@ -27,6 +27,17 @@ License along with this library. If not, see #define ENTRY_DATA_NAME "indicator-custom-entry-data" +static void +activate_entry (GtkWidget * widget, gpointer user_data) +{ + g_return_if_fail(INDICATOR_IS_OBJECT(user_data)); + gpointer entry = g_object_get_data(G_OBJECT(widget), ENTRY_DATA_NAME); + g_return_if_fail(entry == NULL); + + indicator_object_entry_activate(INDICATOR_OBJECT(user_data), (IndicatorObjectEntry *)entry, gtk_get_current_event_time()); + return; +} + static void entry_added (IndicatorObject * io, IndicatorObjectEntry * entry, gpointer user_data) { @@ -48,6 +59,8 @@ entry_added (IndicatorObject * io, IndicatorObjectEntry * entry, gpointer user_d gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), GTK_WIDGET(entry->menu)); } + g_signal_connect(G_OBJECT(menuitem), "activate", G_CALLBACK(activate_entry), io); + gtk_menu_shell_append(GTK_MENU_SHELL(user_data), menuitem); gtk_widget_show(menuitem); -- cgit v1.2.3 From 99dc263ab476e69931cff4bf06d9ae0cba3ce4ff Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 16 Sep 2010 16:37:08 -0500 Subject: Changing indicator directory to '4' --- libindicator/indicator.pc.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libindicator/indicator.pc.in b/libindicator/indicator.pc.in index 91b70b1..abc5590 100644 --- a/libindicator/indicator.pc.in +++ b/libindicator/indicator.pc.in @@ -4,7 +4,7 @@ libdir=@libdir@ bindir=@bindir@ includedir=@includedir@ -indicatordir=${libdir}/indicators/3/ +indicatordir=${libdir}/indicators/4/ iconsdir=@datarootdir@/@PACKAGE@/icons/ Cflags: -I${includedir}/libindicator-0.3 -- cgit v1.2.3 From 03641dce0d1c38ef5fb2447b33f88e9d66c6aecf Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 17 Sep 2010 09:16:17 -0500 Subject: Adding some version information so we don't need a conflicts --- libindicator/Makefile.am | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libindicator/Makefile.am b/libindicator/Makefile.am index 983a6a5..f942f0d 100644 --- a/libindicator/Makefile.am +++ b/libindicator/Makefile.am @@ -42,6 +42,11 @@ libindicator_la_CFLAGS = \ libindicator_la_LIBADD = \ $(LIBINDICATOR_LIBS) +libindicator_la_LDFLAGS = \ + -version-info 1:0:0 \ + -no-undefined \ + -export-symbols-regex "^[^_].*" + pkgconfig_DATA = indicator.pc pkgconfigdir = $(libdir)/pkgconfig -- cgit v1.2.3