Merge lp:~ted/libindicator/about-to-show-root into lp:libindicator/0.4

Proposed by Ted Gould
Status: Merged
Merged at revision: 378
Proposed branch: lp:~ted/libindicator/about-to-show-root
Merge into: lp:libindicator/0.4
Diff against target: 125 lines (+53/-1)
5 files modified
libindicator/Makefile.am (+5/-0)
libindicator/indicator-object.c (+25/-0)
libindicator/indicator-object.h (+9/-0)
libindicator/indicator.pc.in (+1/-1)
tools/indicator-loader.c (+13/-0)
To merge this branch: bzr merge lp:~ted/libindicator/about-to-show-root
Reviewer Review Type Date Requested Status
Neil J. Patel (community) Approve
Review via email: mp+35891@code.launchpad.net

Description of the change

Adding a way to signal down into the entries that a high level item has been clicked on. NOTE: Breaks ABI

To post a comment you must log in.
Revision history for this message
Neil J. Patel (njpatel) wrote :

Looks good, approved!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'libindicator/Makefile.am'
--- libindicator/Makefile.am 2010-04-09 17:51:25 +0000
+++ libindicator/Makefile.am 2010-09-17 21:19:22 +0000
@@ -42,6 +42,11 @@
42libindicator_la_LIBADD = \42libindicator_la_LIBADD = \
43 $(LIBINDICATOR_LIBS)43 $(LIBINDICATOR_LIBS)
4444
45libindicator_la_LDFLAGS = \
46 -version-info 1:0:0 \
47 -no-undefined \
48 -export-symbols-regex "^[^_].*"
49
45pkgconfig_DATA = indicator.pc50pkgconfig_DATA = indicator.pc
46pkgconfigdir = $(libdir)/pkgconfig51pkgconfigdir = $(libdir)/pkgconfig
4752
4853
=== modified file 'libindicator/indicator-object.c'
--- libindicator/indicator-object.c 2010-09-14 14:55:16 +0000
+++ libindicator/indicator-object.c 2010-09-17 21:19:22 +0000
@@ -432,3 +432,28 @@
432432
433 return 0;433 return 0;
434}434}
435
436/**
437 indicator_object_entry_activate:
438 @io: #IndicatorObject to query
439 @entry: The #IndicatorObjectEntry whose entry was shown
440 @timestamp: The X11 timestamp of the event
441
442 Used to signal to the indicator that the menu on an entry has
443 been clicked on. This can either be an activate or a showing
444 of the menu. Note, this does not actually show the menu that's
445 left up to the reader.
446*/
447void
448indicator_object_entry_activate (IndicatorObject * io, IndicatorObjectEntry * entry, guint timestamp)
449{
450 g_return_if_fail(INDICATOR_IS_OBJECT(io));
451 IndicatorObjectClass * class = INDICATOR_OBJECT_GET_CLASS(io);
452
453 if (class->entry_activate != NULL) {
454 return class->entry_activate(io, entry, timestamp);
455 }
456
457 return;
458}
459
435460
=== modified file 'libindicator/indicator-object.h'
--- libindicator/indicator-object.h 2010-09-14 14:51:06 +0000
+++ libindicator/indicator-object.h 2010-09-17 21:19:22 +0000
@@ -94,6 +94,8 @@
94 GList * (*get_entries) (IndicatorObject * io);94 GList * (*get_entries) (IndicatorObject * io);
95 guint (*get_location) (IndicatorObject * io, IndicatorObjectEntry * entry);95 guint (*get_location) (IndicatorObject * io, IndicatorObjectEntry * entry);
9696
97 void (*entry_activate) (IndicatorObject * io, IndicatorObjectEntry * entry, guint timestamp);
98
97 /* Signals */99 /* Signals */
98 void (*entry_added) (IndicatorObject * io, IndicatorObjectEntry * entry, gpointer user_data);100 void (*entry_added) (IndicatorObject * io, IndicatorObjectEntry * entry, gpointer user_data);
99 void (*entry_removed) (IndicatorObject * io, IndicatorObjectEntry * entry, gpointer user_data);101 void (*entry_removed) (IndicatorObject * io, IndicatorObjectEntry * entry, gpointer user_data);
@@ -102,6 +104,12 @@
102 void (*menu_show) (IndicatorObject * io, IndicatorObjectEntry * entry, guint timestamp, gpointer user_data);104 void (*menu_show) (IndicatorObject * io, IndicatorObjectEntry * entry, guint timestamp, gpointer user_data);
103105
104 /* Reserved */106 /* Reserved */
107 void (*reserved1) (void);
108 void (*reserved2) (void);
109 void (*reserved3) (void);
110 void (*reserved4) (void);
111 void (*reserved5) (void);
112 void (*reserved6) (void);
105};113};
106114
107/**115/**
@@ -132,6 +140,7 @@
132140
133GList * indicator_object_get_entries (IndicatorObject * io);141GList * indicator_object_get_entries (IndicatorObject * io);
134guint indicator_object_get_location (IndicatorObject * io, IndicatorObjectEntry * entry);142guint indicator_object_get_location (IndicatorObject * io, IndicatorObjectEntry * entry);
143void indicator_object_entry_activate (IndicatorObject * io, IndicatorObjectEntry * entry, guint timestamp);
135144
136G_END_DECLS145G_END_DECLS
137146
138147
=== modified file 'libindicator/indicator.pc.in'
--- libindicator/indicator.pc.in 2009-11-04 17:34:44 +0000
+++ libindicator/indicator.pc.in 2010-09-17 21:19:22 +0000
@@ -4,7 +4,7 @@
4bindir=@bindir@4bindir=@bindir@
5includedir=@includedir@5includedir=@includedir@
66
7indicatordir=${libdir}/indicators/3/7indicatordir=${libdir}/indicators/4/
8iconsdir=@datarootdir@/@PACKAGE@/icons/8iconsdir=@datarootdir@/@PACKAGE@/icons/
99
10Cflags: -I${includedir}/libindicator-0.310Cflags: -I${includedir}/libindicator-0.3
1111
=== modified file 'tools/indicator-loader.c'
--- tools/indicator-loader.c 2010-09-15 13:58:07 +0000
+++ tools/indicator-loader.c 2010-09-17 21:19:22 +0000
@@ -28,6 +28,17 @@
28#define ENTRY_DATA_NAME "indicator-custom-entry-data"28#define ENTRY_DATA_NAME "indicator-custom-entry-data"
2929
30static void30static void
31activate_entry (GtkWidget * widget, gpointer user_data)
32{
33 g_return_if_fail(INDICATOR_IS_OBJECT(user_data));
34 gpointer entry = g_object_get_data(G_OBJECT(widget), ENTRY_DATA_NAME);
35 g_return_if_fail(entry == NULL);
36
37 indicator_object_entry_activate(INDICATOR_OBJECT(user_data), (IndicatorObjectEntry *)entry, gtk_get_current_event_time());
38 return;
39}
40
41static void
31entry_added (IndicatorObject * io, IndicatorObjectEntry * entry, gpointer user_data)42entry_added (IndicatorObject * io, IndicatorObjectEntry * entry, gpointer user_data)
32{43{
33 g_debug("Signal: Entry Added");44 g_debug("Signal: Entry Added");
@@ -48,6 +59,8 @@
48 gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), GTK_WIDGET(entry->menu));59 gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), GTK_WIDGET(entry->menu));
49 }60 }
5061
62 g_signal_connect(G_OBJECT(menuitem), "activate", G_CALLBACK(activate_entry), io);
63
51 gtk_menu_shell_append(GTK_MENU_SHELL(user_data), menuitem);64 gtk_menu_shell_append(GTK_MENU_SHELL(user_data), menuitem);
52 gtk_widget_show(menuitem);65 gtk_widget_show(menuitem);
5366

Subscribers

People subscribed via source and target branches