Merge lp:~dbusmenu-team/libdbusmenu/ubuntu into lp:~ubuntu-desktop/libdbusmenu/ubuntu

Proposed by Ted Gould
Status: Merged
Merged at revision: 93
Proposed branch: lp:~dbusmenu-team/libdbusmenu/ubuntu
Merge into: lp:~ubuntu-desktop/libdbusmenu/ubuntu
Diff against target: 1260 lines (+492/-59)
31 files modified
configure (+11/-11)
configure.ac (+3/-3)
debian/changelog (+9/-0)
debian/control (+4/-1)
debian/rules (+1/-0)
docs/libdbusmenu-glib/reference/html/ch01.html (+1/-1)
docs/libdbusmenu-glib/reference/html/libdbusmenu-glib-DbusmenuClient.html (+8/-6)
docs/libdbusmenu-glib/reference/html/libdbusmenu-glib-DbusmenuMenuitem.html (+4/-3)
docs/libdbusmenu-glib/reference/tmpl/client.sgml (+2/-1)
docs/libdbusmenu-glib/reference/tmpl/menuitem.sgml (+2/-1)
docs/libdbusmenu-glib/reference/version.xml (+1/-1)
docs/libdbusmenu-glib/reference/xml/client.xml (+7/-5)
docs/libdbusmenu-glib/reference/xml/menuitem.xml (+4/-3)
docs/libdbusmenu-gtk/reference/html/ch01.html (+1/-1)
docs/libdbusmenu-gtk/reference/version.xml (+1/-1)
libdbusmenu-glib/Makefile.am (+15/-0)
libdbusmenu-glib/Makefile.in (+25/-0)
libdbusmenu-glib/client-marshal.c (+131/-0)
libdbusmenu-glib/client-marshal.h (+28/-0)
libdbusmenu-glib/client-marshal.list (+2/-0)
libdbusmenu-glib/client.c (+105/-3)
libdbusmenu-glib/client.h (+8/-4)
libdbusmenu-glib/dbusmenu-server.h (+2/-3)
libdbusmenu-glib/menuitem-marshal.c (+2/-0)
libdbusmenu-glib/menuitem.c (+36/-0)
libdbusmenu-glib/menuitem.h (+6/-5)
libdbusmenu-glib/server.c (+2/-2)
libdbusmenu-gtk/client.c (+47/-0)
tests/test-gtk-label-client.c (+0/-2)
tests/test-gtk-submenu-client.c (+8/-1)
tests/test-gtk-submenu-server.c (+16/-1)
To merge this branch: bzr merge lp:~dbusmenu-team/libdbusmenu/ubuntu
Reviewer Review Type Date Requested Status
Ken VanDine Pending
Review via email: mp+33837@code.launchpad.net

Description of the change

0.3.12

To post a comment you must log in.
lp:~dbusmenu-team/libdbusmenu/ubuntu updated
93. By Sebastien Bacher

releasing version 0.3.12-0ubuntu1

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'configure'
2--- configure 2010-08-19 18:41:19 +0000
3+++ configure 2010-08-26 20:37:39 +0000
4@@ -1,6 +1,6 @@
5 #! /bin/sh
6 # Guess values for system-dependent variables and create Makefiles.
7-# Generated by GNU Autoconf 2.67 for libdbusmenu 0.3.11.
8+# Generated by GNU Autoconf 2.67 for libdbusmenu 0.3.12.
9 #
10 # Report bugs to <ted@canonical.com>.
11 #
12@@ -703,8 +703,8 @@
13 # Identity of this package.
14 PACKAGE_NAME='libdbusmenu'
15 PACKAGE_TARNAME='libdbusmenu'
16-PACKAGE_VERSION='0.3.11'
17-PACKAGE_STRING='libdbusmenu 0.3.11'
18+PACKAGE_VERSION='0.3.12'
19+PACKAGE_STRING='libdbusmenu 0.3.12'
20 PACKAGE_BUGREPORT='ted@canonical.com'
21 PACKAGE_URL=''
22
23@@ -1533,7 +1533,7 @@
24 # Omit some internal or obsolete options to make the list less imposing.
25 # This message is too long to be a string in the A/UX 3.1 sh.
26 cat <<_ACEOF
27-\`configure' configures libdbusmenu 0.3.11 to adapt to many kinds of systems.
28+\`configure' configures libdbusmenu 0.3.12 to adapt to many kinds of systems.
29
30 Usage: $0 [OPTION]... [VAR=VALUE]...
31
32@@ -1603,7 +1603,7 @@
33
34 if test -n "$ac_init_help"; then
35 case $ac_init_help in
36- short | recursive ) echo "Configuration of libdbusmenu 0.3.11:";;
37+ short | recursive ) echo "Configuration of libdbusmenu 0.3.12:";;
38 esac
39 cat <<\_ACEOF
40
41@@ -1741,7 +1741,7 @@
42 test -n "$ac_init_help" && exit $ac_status
43 if $ac_init_version; then
44 cat <<\_ACEOF
45-libdbusmenu configure 0.3.11
46+libdbusmenu configure 0.3.12
47 generated by GNU Autoconf 2.67
48
49 Copyright (C) 2010 Free Software Foundation, Inc.
50@@ -2112,7 +2112,7 @@
51 This file contains any messages produced by compilers while
52 running configure, to aid debugging if configure makes a mistake.
53
54-It was created by libdbusmenu $as_me 0.3.11, which was
55+It was created by libdbusmenu $as_me 0.3.12, which was
56 generated by GNU Autoconf 2.67. Invocation command line was
57
58 $ $0 $@
59@@ -2933,7 +2933,7 @@
60
61 # Define the identity of the package.
62 PACKAGE=libdbusmenu
63- VERSION=0.3.11
64+ VERSION=0.3.12
65
66
67 # Some tools Automake needs.
68@@ -13065,7 +13065,7 @@
69 ###########################
70
71 LIBDBUSMENU_CURRENT=1
72-LIBDBUSMENU_REVISION=13
73+LIBDBUSMENU_REVISION=14
74 LIBDBUSMENU_AGE=0
75
76
77@@ -14379,7 +14379,7 @@
78 # report actual input values of CONFIG_FILES etc. instead of their
79 # values after options handling.
80 ac_log="
81-This file was extended by libdbusmenu $as_me 0.3.11, which was
82+This file was extended by libdbusmenu $as_me 0.3.12, which was
83 generated by GNU Autoconf 2.67. Invocation command line was
84
85 CONFIG_FILES = $CONFIG_FILES
86@@ -14445,7 +14445,7 @@
87 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
88 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
89 ac_cs_version="\\
90-libdbusmenu config.status 0.3.11
91+libdbusmenu config.status 0.3.12
92 configured by $0, generated by GNU Autoconf 2.67,
93 with options \\"\$ac_cs_config\\"
94
95
96=== modified file 'configure.ac'
97--- configure.ac 2010-08-19 18:41:19 +0000
98+++ configure.ac 2010-08-26 20:37:39 +0000
99@@ -1,11 +1,11 @@
100
101-AC_INIT(libdbusmenu, 0.3.11, ted@canonical.com)
102+AC_INIT(libdbusmenu, 0.3.12, ted@canonical.com)
103 AC_COPYRIGHT([Copyright 2009,2010 Canonical])
104
105 AC_PREREQ(2.62)
106
107 AM_CONFIG_HEADER(config.h)
108-AM_INIT_AUTOMAKE(libdbusmenu, 0.3.11, [-Wno-portability])
109+AM_INIT_AUTOMAKE(libdbusmenu, 0.3.12, [-Wno-portability])
110
111 AM_MAINTAINER_MODE
112
113@@ -99,7 +99,7 @@
114 ###########################
115
116 LIBDBUSMENU_CURRENT=1
117-LIBDBUSMENU_REVISION=13
118+LIBDBUSMENU_REVISION=14
119 LIBDBUSMENU_AGE=0
120
121 AC_SUBST(LIBDBUSMENU_CURRENT)
122
123=== modified file 'debian/changelog'
124--- debian/changelog 2010-08-19 20:18:01 +0000
125+++ debian/changelog 2010-08-26 20:37:39 +0000
126@@ -1,3 +1,12 @@
127+libdbusmenu (0.3.12-0ubuntu1~ppa1) maverick; urgency=low
128+
129+ * New upstream release.
130+ * Support activation of menus client side
131+ * Increase layout XML size (LP: #621238)
132+ * Display an event for the status of the signal to the server
133+
134+ -- Ted Gould <ted@ubuntu.com> Thu, 26 Aug 2010 15:35:19 -0500
135+
136 libdbusmenu (0.3.11-0ubuntu1) maverick; urgency=low
137
138 * New upstream release.
139
140=== modified file 'debian/control'
141--- debian/control 2010-08-19 19:40:46 +0000
142+++ debian/control 2010-08-26 20:37:39 +0000
143@@ -20,7 +20,10 @@
144 gir1.0-glib-2.0,
145 gir1.0-gtk-2.0,
146 libx11-dev (>= 1.3),
147- valac
148+ valac,
149+# Check dependencies
150+ xvfb,
151+ dbus-test-runner
152 Standards-Version: 3.9.1
153 Homepage: https://launchpad.net/dbusmenu
154 Vcs-Bzr: https://code.launchpad.net/~dbusmenu-team/dbusmenu/ubuntu
155
156=== modified file 'debian/rules'
157--- debian/rules 2010-08-19 20:18:01 +0000
158+++ debian/rules 2010-08-26 20:37:39 +0000
159@@ -3,6 +3,7 @@
160 include /usr/share/cdbs/1/rules/debhelper.mk
161 include /usr/share/cdbs/1/class/gnome.mk
162
163+DEB_MAKE_CHECK_TARGET := check
164 DEB_CONFIGURE_EXTRA_FLAGS += --disable-scrollkeeper --enable-gtk-doc
165 LDFLAGS += -Wl,-z,defs -Wl,--as-needed
166
167
168=== modified file 'docs/libdbusmenu-glib/reference/html/ch01.html'
169--- docs/libdbusmenu-glib/reference/html/ch01.html 2010-08-12 16:22:27 +0000
170+++ docs/libdbusmenu-glib/reference/html/ch01.html 2010-08-26 20:37:39 +0000
171@@ -21,7 +21,7 @@
172 </tr></table>
173 <div class="chapter" title="API">
174 <div class="titlepage"><div><div><h2 class="title">
175-<a name="id404092"></a>API</h2></div></div></div>
176+<a name="id579504"></a>API</h2></div></div></div>
177 <div class="toc"><dl>
178 <dt>
179 <span class="refentrytitle"><a href="libdbusmenu-glib-DbusmenuServer.html">DbusmenuServer</a></span><span class="refpurpose"></span>
180
181=== modified file 'docs/libdbusmenu-glib/reference/html/libdbusmenu-glib-DbusmenuClient.html'
182--- docs/libdbusmenu-glib/reference/html/libdbusmenu-glib-DbusmenuClient.html 2010-08-12 16:22:27 +0000
183+++ docs/libdbusmenu-glib/reference/html/libdbusmenu-glib-DbusmenuClient.html 2010-08-26 20:37:39 +0000
184@@ -188,12 +188,13 @@
185 void (*layout_updated)(void);
186 void (*root_changed) (DbusmenuMenuitem * newroot);
187 void (*new_menuitem) (DbusmenuMenuitem * newitem);
188+ void (*item_activate) (DbusmenuMenuitem * item, guint timestamp);
189
190 /* Reserved for future use */
191 void (*reserved1) (void);
192 void (*reserved2) (void);
193 void (*reserved3) (void);
194- void (*reserved4) (void);
195+ /* void (*reserved4) (void); */
196 } DbusmenuClientClass;
197 </pre>
198 <p>
199@@ -226,6 +227,11 @@
200 </td>
201 </tr>
202 <tr>
203+<td><p><span class="term"><em class="structfield"><code><a name="DbusmenuClientClass.item-activate"></a>item_activate</code></em> ()</span></p></td>
204+<td>Slote for <span class="type">"item-activate"</span>.
205+</td>
206+</tr>
207+<tr>
208 <td><p><span class="term"><em class="structfield"><code><a name="DbusmenuClientClass.reserved1"></a>reserved1</code></em> ()</span></p></td>
209 <td>Reserved for future use.
210 </td>
211@@ -240,11 +246,6 @@
212 <td>Reserved for future use.
213 </td>
214 </tr>
215-<tr>
216-<td><p><span class="term"><em class="structfield"><code><a name="DbusmenuClientClass.reserved4"></a>reserved4</code></em> ()</span></p></td>
217-<td>Reserved for future use.
218-</td>
219-</tr>
220 </tbody>
221 </table></div>
222 </div>
223@@ -457,6 +458,7 @@
224 <em class="parameter"><code>gpointer</code></em> user_data:
225 <em class="parameter"><code>gpointer</code></em> user_data:
226 <em class="parameter"><code>gpointer</code></em> user_data:
227+<em class="parameter"><code>gpointer</code></em> user_data:
228 </td>
229 </tr>
230 <tr>
231
232=== modified file 'docs/libdbusmenu-glib/reference/html/libdbusmenu-glib-DbusmenuMenuitem.html'
233--- docs/libdbusmenu-glib/reference/html/libdbusmenu-glib-DbusmenuMenuitem.html 2010-08-12 16:21:29 +0000
234+++ docs/libdbusmenu-glib/reference/html/libdbusmenu-glib-DbusmenuMenuitem.html 2010-08-26 20:37:39 +0000
235@@ -435,7 +435,8 @@
236 void (*handle_event) (DbusmenuMenuitem * mi, const gchar * name, const GValue * value, guint timestamp);
237 void (*send_about_to_show) (DbusmenuMenuitem * mi, dbusmenu_menuitem_about_to_show_cb cb, gpointer cb_data);
238
239- void (*reserved1) (void);
240+ void (*show_to_user) (DbusmenuMenuitem * mi, guint timestamp, gpointer cb_data);
241+ /* void (*reserved1) (void); */
242 /* void (*reserved2) (void); */
243 /* void (*reserved3) (void); */
244 /* void (*reserved4) (void); -- realized, realloc when bumping lib version */
245@@ -495,8 +496,8 @@
246 </td>
247 </tr>
248 <tr>
249-<td><p><span class="term"><em class="structfield"><code><a name="DbusmenuMenuitemClass.reserved1"></a>reserved1</code></em> ()</span></p></td>
250-<td>Reserved for future use.
251+<td><p><span class="term"><em class="structfield"><code><a name="DbusmenuMenuitemClass.show-to-user"></a>show_to_user</code></em> ()</span></p></td>
252+<td>Slot for <span class="type">"show-to-user"</span>.
253 </td>
254 </tr>
255 </tbody>
256
257=== modified file 'docs/libdbusmenu-glib/reference/tmpl/client.sgml'
258--- docs/libdbusmenu-glib/reference/tmpl/client.sgml 2010-08-12 16:22:27 +0000
259+++ docs/libdbusmenu-glib/reference/tmpl/client.sgml 2010-08-26 20:37:39 +0000
260@@ -92,10 +92,10 @@
261 @layout_updated:
262 @root_changed:
263 @new_menuitem:
264+@item_activate:
265 @reserved1:
266 @reserved2:
267 @reserved3:
268-@reserved4:
269
270 <!-- ##### USER_FUNCTION DbusmenuClientTypeHandler ##### -->
271 <para>
272@@ -159,6 +159,7 @@
273 @id:
274 @gpointer user_data:
275 @gpointer user_data:
276+@gpointer user_data:
277 @gpointer user_data:
278 @cb_data:
279
280
281=== modified file 'docs/libdbusmenu-glib/reference/tmpl/menuitem.sgml'
282--- docs/libdbusmenu-glib/reference/tmpl/menuitem.sgml 2010-08-12 16:22:27 +0000
283+++ docs/libdbusmenu-glib/reference/tmpl/menuitem.sgml 2010-08-26 20:37:39 +0000
284@@ -221,7 +221,7 @@
285 @buildxml:
286 @handle_event:
287 @send_about_to_show:
288-@reserved1:
289+@show_to_user:
290
291 <!-- ##### FUNCTION dbusmenu_menuitem_new ##### -->
292 <para>
293@@ -507,6 +507,7 @@
294 @mi:
295 @DbusmenuMenuitem * mi, gpointer data:
296 @DbusmenuMenuitem * mi, gpointer data:
297+@DbusmenuMenuitem * mi, gpointer data:
298 @DbusmenuMenuitem * mi, gpointer data:
299 @data:
300
301
302=== modified file 'docs/libdbusmenu-glib/reference/version.xml'
303--- docs/libdbusmenu-glib/reference/version.xml 2010-08-19 18:41:19 +0000
304+++ docs/libdbusmenu-glib/reference/version.xml 2010-08-26 20:37:39 +0000
305@@ -1,1 +1,1 @@
306-0.3.11
307+0.3.12
308
309=== modified file 'docs/libdbusmenu-glib/reference/xml/client.xml'
310--- docs/libdbusmenu-glib/reference/xml/client.xml 2010-08-12 16:22:27 +0000
311+++ docs/libdbusmenu-glib/reference/xml/client.xml 2010-08-26 20:37:39 +0000
312@@ -160,12 +160,13 @@
313 void (*layout_updated)(void);
314 void (*root_changed) (DbusmenuMenuitem * newroot);
315 void (*new_menuitem) (DbusmenuMenuitem * newitem);
316+ void (*item_activate) (DbusmenuMenuitem * item, guint timestamp);
317
318 /* Reserved for future use */
319 void (*reserved1) (void);
320 void (*reserved2) (void);
321 void (*reserved3) (void);
322- void (*reserved4) (void);
323+ /* void (*reserved4) (void); */
324 } DbusmenuClientClass;
325 </programlisting>
326 <para>
327@@ -189,6 +190,10 @@
328 <listitem><simpara>Slot for <link linkend="DbusmenuClient-new-menuitem"><type>"new-menuitem"</type></link>.
329 </simpara></listitem>
330 </varlistentry>
331+<varlistentry><term><structfield id="DbusmenuClientClass.item-activate">item_activate</structfield>&#160;()</term>
332+<listitem><simpara>Slote for <link linkend="DbusmenuClient-item-activate"><type>"item-activate"</type></link>.
333+</simpara></listitem>
334+</varlistentry>
335 <varlistentry><term><structfield id="DbusmenuClientClass.reserved1">reserved1</structfield>&#160;()</term>
336 <listitem><simpara>Reserved for future use.
337 </simpara></listitem>
338@@ -201,10 +206,6 @@
339 <listitem><simpara>Reserved for future use.
340 </simpara></listitem>
341 </varlistentry>
342-<varlistentry><term><structfield id="DbusmenuClientClass.reserved4">reserved4</structfield>&#160;()</term>
343-<listitem><simpara>Reserved for future use.
344-</simpara></listitem>
345-</varlistentry>
346 </variablelist></refsect2>
347 <refsect2 id="DbusmenuClientTypeHandler" role="function">
348 <title>DbusmenuClientTypeHandler ()</title>
349@@ -344,6 +345,7 @@
350 <parameter>gpointer</parameter> user_data:
351 <parameter>gpointer</parameter> user_data:
352 <parameter>gpointer</parameter> user_data:
353+<parameter>gpointer</parameter> user_data:
354 </simpara></listitem></varlistentry>
355 <varlistentry><term><parameter>cb_data</parameter>&#160;:</term>
356 <listitem><simpara>
357
358=== modified file 'docs/libdbusmenu-glib/reference/xml/menuitem.xml'
359--- docs/libdbusmenu-glib/reference/xml/menuitem.xml 2010-08-12 16:22:27 +0000
360+++ docs/libdbusmenu-glib/reference/xml/menuitem.xml 2010-08-26 20:37:39 +0000
361@@ -375,7 +375,8 @@
362 void (*handle_event) (DbusmenuMenuitem * mi, const gchar * name, const GValue * value, guint timestamp);
363 void (*send_about_to_show) (DbusmenuMenuitem * mi, dbusmenu_menuitem_about_to_show_cb cb, gpointer cb_data);
364
365- void (*reserved1) (void);
366+ void (*show_to_user) (DbusmenuMenuitem * mi, guint timestamp, gpointer cb_data);
367+ /* void (*reserved1) (void); */
368 /* void (*reserved2) (void); */
369 /* void (*reserved3) (void); */
370 /* void (*reserved4) (void); -- realized, realloc when bumping lib version */
371@@ -422,8 +423,8 @@
372 <listitem><simpara>Virtual function that notifies server that the client is about to show a menu.
373 </simpara></listitem>
374 </varlistentry>
375-<varlistentry><term><structfield id="DbusmenuMenuitemClass.reserved1">reserved1</structfield>&#160;()</term>
376-<listitem><simpara>Reserved for future use.
377+<varlistentry><term><structfield id="DbusmenuMenuitemClass.show-to-user">show_to_user</structfield>&#160;()</term>
378+<listitem><simpara>Slot for <link linkend="DbusmenuMenuitem-show-to-user"><type>"show-to-user"</type></link>.
379 </simpara></listitem>
380 </varlistentry>
381 </variablelist></refsect2>
382
383=== modified file 'docs/libdbusmenu-gtk/reference/html/ch01.html'
384--- docs/libdbusmenu-gtk/reference/html/ch01.html 2010-08-12 16:22:27 +0000
385+++ docs/libdbusmenu-gtk/reference/html/ch01.html 2010-08-26 20:37:39 +0000
386@@ -21,7 +21,7 @@
387 </tr></table>
388 <div class="chapter" title="API">
389 <div class="titlepage"><div><div><h2 class="title">
390-<a name="id373680"></a>API</h2></div></div></div>
391+<a name="id453927"></a>API</h2></div></div></div>
392 <div class="toc"><dl>
393 <dt>
394 <span class="refentrytitle"><a href="libdbusmenu-gtk-DbusmenuGtkMenu.html">DbusmenuGtkMenu</a></span><span class="refpurpose"></span>
395
396=== modified file 'docs/libdbusmenu-gtk/reference/version.xml'
397--- docs/libdbusmenu-gtk/reference/version.xml 2010-08-19 18:41:19 +0000
398+++ docs/libdbusmenu-gtk/reference/version.xml 2010-08-26 20:37:39 +0000
399@@ -1,1 +1,1 @@
400-0.3.11
401+0.3.12
402
403=== modified file 'libdbusmenu-glib/Makefile.am'
404--- libdbusmenu-glib/Makefile.am 2010-05-21 18:37:36 +0000
405+++ libdbusmenu-glib/Makefile.am 2010-08-26 20:37:39 +0000
406@@ -4,6 +4,7 @@
407 EXTRA_DIST = \
408 dbusmenu-glib.pc.in \
409 dbus-menu.xml \
410+ client-marshal.list \
411 menuitem-marshal.list \
412 server-marshal.list
413
414@@ -32,6 +33,8 @@
415 server.c \
416 server-marshal.h \
417 server-marshal.c \
418+ client-marshal.h \
419+ client-marshal.c \
420 client-menuitem.h \
421 client-menuitem.c \
422 client.h \
423@@ -54,6 +57,8 @@
424 BUILT_SOURCES = \
425 dbusmenu-client.h \
426 dbusmenu-server.h \
427+ client-marshal.h \
428+ client-marshal.c \
429 menuitem-marshal.h \
430 menuitem-marshal.c \
431 server-marshal.h \
432@@ -73,6 +78,16 @@
433 --output=dbusmenu-client.h \
434 $(srcdir)/dbus-menu.xml
435
436+client-marshal.h: $(srcdir)/client-marshal.list
437+ glib-genmarshal --header \
438+ --prefix=_dbusmenu_client_marshal $(srcdir)/client-marshal.list \
439+ > client-marshal.h
440+
441+client-marshal.c: $(srcdir)/client-marshal.list
442+ glib-genmarshal --body \
443+ --prefix=_dbusmenu_client_marshal $(srcdir)/client-marshal.list \
444+ > client-marshal.c
445+
446 server-marshal.h: $(srcdir)/server-marshal.list
447 glib-genmarshal --header \
448 --prefix=_dbusmenu_server_marshal $(srcdir)/server-marshal.list \
449
450=== modified file 'libdbusmenu-glib/Makefile.in'
451--- libdbusmenu-glib/Makefile.in 2010-08-12 16:22:27 +0000
452+++ libdbusmenu-glib/Makefile.in 2010-08-26 20:37:39 +0000
453@@ -83,6 +83,7 @@
454 libdbusmenu_glib_la-menuitem-proxy.lo \
455 libdbusmenu_glib_la-server.lo \
456 libdbusmenu_glib_la-server-marshal.lo \
457+ libdbusmenu_glib_la-client-marshal.lo \
458 libdbusmenu_glib_la-client-menuitem.lo \
459 libdbusmenu_glib_la-client.lo
460 libdbusmenu_glib_la_OBJECTS = $(am_libdbusmenu_glib_la_OBJECTS)
461@@ -297,6 +298,7 @@
462 EXTRA_DIST = \
463 dbusmenu-glib.pc.in \
464 dbus-menu.xml \
465+ client-marshal.list \
466 menuitem-marshal.list \
467 server-marshal.list
468
469@@ -324,6 +326,8 @@
470 server.c \
471 server-marshal.h \
472 server-marshal.c \
473+ client-marshal.h \
474+ client-marshal.c \
475 client-menuitem.h \
476 client-menuitem.c \
477 client.h \
478@@ -345,6 +349,8 @@
479 BUILT_SOURCES = \
480 dbusmenu-client.h \
481 dbusmenu-server.h \
482+ client-marshal.h \
483+ client-marshal.c \
484 menuitem-marshal.h \
485 menuitem-marshal.c \
486 server-marshal.h \
487@@ -452,6 +458,7 @@
488 distclean-compile:
489 -rm -f *.tab.c
490
491+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbusmenu_glib_la-client-marshal.Plo@am__quote@
492 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbusmenu_glib_la-client-menuitem.Plo@am__quote@
493 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbusmenu_glib_la-client.Plo@am__quote@
494 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbusmenu_glib_la-menuitem-marshal.Plo@am__quote@
495@@ -524,6 +531,14 @@
496 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
497 @am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdbusmenu_glib_la_CFLAGS) $(CFLAGS) -c -o libdbusmenu_glib_la-server-marshal.lo `test -f 'server-marshal.c' || echo '$(srcdir)/'`server-marshal.c
498
499+libdbusmenu_glib_la-client-marshal.lo: client-marshal.c
500+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdbusmenu_glib_la_CFLAGS) $(CFLAGS) -MT libdbusmenu_glib_la-client-marshal.lo -MD -MP -MF $(DEPDIR)/libdbusmenu_glib_la-client-marshal.Tpo -c -o libdbusmenu_glib_la-client-marshal.lo `test -f 'client-marshal.c' || echo '$(srcdir)/'`client-marshal.c
501+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbusmenu_glib_la-client-marshal.Tpo $(DEPDIR)/libdbusmenu_glib_la-client-marshal.Plo
502+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
503+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='client-marshal.c' object='libdbusmenu_glib_la-client-marshal.lo' libtool=yes @AMDEPBACKSLASH@
504+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
505+@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdbusmenu_glib_la_CFLAGS) $(CFLAGS) -c -o libdbusmenu_glib_la-client-marshal.lo `test -f 'client-marshal.c' || echo '$(srcdir)/'`client-marshal.c
506+
507 libdbusmenu_glib_la-client-menuitem.lo: client-menuitem.c
508 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdbusmenu_glib_la_CFLAGS) $(CFLAGS) -MT libdbusmenu_glib_la-client-menuitem.lo -MD -MP -MF $(DEPDIR)/libdbusmenu_glib_la-client-menuitem.Tpo -c -o libdbusmenu_glib_la-client-menuitem.lo `test -f 'client-menuitem.c' || echo '$(srcdir)/'`client-menuitem.c
509 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbusmenu_glib_la-client-menuitem.Tpo $(DEPDIR)/libdbusmenu_glib_la-client-menuitem.Plo
510@@ -876,6 +891,16 @@
511 --output=dbusmenu-client.h \
512 $(srcdir)/dbus-menu.xml
513
514+client-marshal.h: $(srcdir)/client-marshal.list
515+ glib-genmarshal --header \
516+ --prefix=_dbusmenu_client_marshal $(srcdir)/client-marshal.list \
517+ > client-marshal.h
518+
519+client-marshal.c: $(srcdir)/client-marshal.list
520+ glib-genmarshal --body \
521+ --prefix=_dbusmenu_client_marshal $(srcdir)/client-marshal.list \
522+ > client-marshal.c
523+
524 server-marshal.h: $(srcdir)/server-marshal.list
525 glib-genmarshal --header \
526 --prefix=_dbusmenu_server_marshal $(srcdir)/server-marshal.list \
527
528=== added file 'libdbusmenu-glib/client-marshal.c'
529--- libdbusmenu-glib/client-marshal.c 1970-01-01 00:00:00 +0000
530+++ libdbusmenu-glib/client-marshal.c 2010-08-26 20:37:39 +0000
531@@ -0,0 +1,131 @@
532+
533+#include <glib-object.h>
534+
535+
536+#ifdef G_ENABLE_DEBUG
537+#define g_marshal_value_peek_boolean(v) g_value_get_boolean (v)
538+#define g_marshal_value_peek_char(v) g_value_get_char (v)
539+#define g_marshal_value_peek_uchar(v) g_value_get_uchar (v)
540+#define g_marshal_value_peek_int(v) g_value_get_int (v)
541+#define g_marshal_value_peek_uint(v) g_value_get_uint (v)
542+#define g_marshal_value_peek_long(v) g_value_get_long (v)
543+#define g_marshal_value_peek_ulong(v) g_value_get_ulong (v)
544+#define g_marshal_value_peek_int64(v) g_value_get_int64 (v)
545+#define g_marshal_value_peek_uint64(v) g_value_get_uint64 (v)
546+#define g_marshal_value_peek_enum(v) g_value_get_enum (v)
547+#define g_marshal_value_peek_flags(v) g_value_get_flags (v)
548+#define g_marshal_value_peek_float(v) g_value_get_float (v)
549+#define g_marshal_value_peek_double(v) g_value_get_double (v)
550+#define g_marshal_value_peek_string(v) (char*) g_value_get_string (v)
551+#define g_marshal_value_peek_param(v) g_value_get_param (v)
552+#define g_marshal_value_peek_boxed(v) g_value_get_boxed (v)
553+#define g_marshal_value_peek_pointer(v) g_value_get_pointer (v)
554+#define g_marshal_value_peek_object(v) g_value_get_object (v)
555+#define g_marshal_value_peek_variant(v) g_value_get_variant (v)
556+#else /* !G_ENABLE_DEBUG */
557+/* WARNING: This code accesses GValues directly, which is UNSUPPORTED API.
558+ * Do not access GValues directly in your code. Instead, use the
559+ * g_value_get_*() functions
560+ */
561+#define g_marshal_value_peek_boolean(v) (v)->data[0].v_int
562+#define g_marshal_value_peek_char(v) (v)->data[0].v_int
563+#define g_marshal_value_peek_uchar(v) (v)->data[0].v_uint
564+#define g_marshal_value_peek_int(v) (v)->data[0].v_int
565+#define g_marshal_value_peek_uint(v) (v)->data[0].v_uint
566+#define g_marshal_value_peek_long(v) (v)->data[0].v_long
567+#define g_marshal_value_peek_ulong(v) (v)->data[0].v_ulong
568+#define g_marshal_value_peek_int64(v) (v)->data[0].v_int64
569+#define g_marshal_value_peek_uint64(v) (v)->data[0].v_uint64
570+#define g_marshal_value_peek_enum(v) (v)->data[0].v_long
571+#define g_marshal_value_peek_flags(v) (v)->data[0].v_ulong
572+#define g_marshal_value_peek_float(v) (v)->data[0].v_float
573+#define g_marshal_value_peek_double(v) (v)->data[0].v_double
574+#define g_marshal_value_peek_string(v) (v)->data[0].v_pointer
575+#define g_marshal_value_peek_param(v) (v)->data[0].v_pointer
576+#define g_marshal_value_peek_boxed(v) (v)->data[0].v_pointer
577+#define g_marshal_value_peek_pointer(v) (v)->data[0].v_pointer
578+#define g_marshal_value_peek_object(v) (v)->data[0].v_pointer
579+#define g_marshal_value_peek_variant(v) (v)->data[0].v_pointer
580+#endif /* !G_ENABLE_DEBUG */
581+
582+
583+/* VOID:OBJECT,UINT (./client-marshal.list:1) */
584+void
585+_dbusmenu_client_marshal_VOID__OBJECT_UINT (GClosure *closure,
586+ GValue *return_value G_GNUC_UNUSED,
587+ guint n_param_values,
588+ const GValue *param_values,
589+ gpointer invocation_hint G_GNUC_UNUSED,
590+ gpointer marshal_data)
591+{
592+ typedef void (*GMarshalFunc_VOID__OBJECT_UINT) (gpointer data1,
593+ gpointer arg_1,
594+ guint arg_2,
595+ gpointer data2);
596+ register GMarshalFunc_VOID__OBJECT_UINT callback;
597+ register GCClosure *cc = (GCClosure*) closure;
598+ register gpointer data1, data2;
599+
600+ g_return_if_fail (n_param_values == 3);
601+
602+ if (G_CCLOSURE_SWAP_DATA (closure))
603+ {
604+ data1 = closure->data;
605+ data2 = g_value_peek_pointer (param_values + 0);
606+ }
607+ else
608+ {
609+ data1 = g_value_peek_pointer (param_values + 0);
610+ data2 = closure->data;
611+ }
612+ callback = (GMarshalFunc_VOID__OBJECT_UINT) (marshal_data ? marshal_data : cc->callback);
613+
614+ callback (data1,
615+ g_marshal_value_peek_object (param_values + 1),
616+ g_marshal_value_peek_uint (param_values + 2),
617+ data2);
618+}
619+
620+/* VOID:OBJECT,STRING,POINTER,UINT,POINTER (./client-marshal.list:2) */
621+void
622+_dbusmenu_client_marshal_VOID__OBJECT_STRING_POINTER_UINT_POINTER (GClosure *closure,
623+ GValue *return_value G_GNUC_UNUSED,
624+ guint n_param_values,
625+ const GValue *param_values,
626+ gpointer invocation_hint G_GNUC_UNUSED,
627+ gpointer marshal_data)
628+{
629+ typedef void (*GMarshalFunc_VOID__OBJECT_STRING_POINTER_UINT_POINTER) (gpointer data1,
630+ gpointer arg_1,
631+ gpointer arg_2,
632+ gpointer arg_3,
633+ guint arg_4,
634+ gpointer arg_5,
635+ gpointer data2);
636+ register GMarshalFunc_VOID__OBJECT_STRING_POINTER_UINT_POINTER callback;
637+ register GCClosure *cc = (GCClosure*) closure;
638+ register gpointer data1, data2;
639+
640+ g_return_if_fail (n_param_values == 6);
641+
642+ if (G_CCLOSURE_SWAP_DATA (closure))
643+ {
644+ data1 = closure->data;
645+ data2 = g_value_peek_pointer (param_values + 0);
646+ }
647+ else
648+ {
649+ data1 = g_value_peek_pointer (param_values + 0);
650+ data2 = closure->data;
651+ }
652+ callback = (GMarshalFunc_VOID__OBJECT_STRING_POINTER_UINT_POINTER) (marshal_data ? marshal_data : cc->callback);
653+
654+ callback (data1,
655+ g_marshal_value_peek_object (param_values + 1),
656+ g_marshal_value_peek_string (param_values + 2),
657+ g_marshal_value_peek_pointer (param_values + 3),
658+ g_marshal_value_peek_uint (param_values + 4),
659+ g_marshal_value_peek_pointer (param_values + 5),
660+ data2);
661+}
662+
663
664=== added file 'libdbusmenu-glib/client-marshal.h'
665--- libdbusmenu-glib/client-marshal.h 1970-01-01 00:00:00 +0000
666+++ libdbusmenu-glib/client-marshal.h 2010-08-26 20:37:39 +0000
667@@ -0,0 +1,28 @@
668+
669+#ifndef ___dbusmenu_client_marshal_MARSHAL_H__
670+#define ___dbusmenu_client_marshal_MARSHAL_H__
671+
672+#include <glib-object.h>
673+
674+G_BEGIN_DECLS
675+
676+/* VOID:OBJECT,UINT (./client-marshal.list:1) */
677+extern void _dbusmenu_client_marshal_VOID__OBJECT_UINT (GClosure *closure,
678+ GValue *return_value,
679+ guint n_param_values,
680+ const GValue *param_values,
681+ gpointer invocation_hint,
682+ gpointer marshal_data);
683+
684+/* VOID:OBJECT,STRING,POINTER,UINT,POINTER (./client-marshal.list:2) */
685+extern void _dbusmenu_client_marshal_VOID__OBJECT_STRING_POINTER_UINT_POINTER (GClosure *closure,
686+ GValue *return_value,
687+ guint n_param_values,
688+ const GValue *param_values,
689+ gpointer invocation_hint,
690+ gpointer marshal_data);
691+
692+G_END_DECLS
693+
694+#endif /* ___dbusmenu_client_marshal_MARSHAL_H__ */
695+
696
697=== added file 'libdbusmenu-glib/client-marshal.list'
698--- libdbusmenu-glib/client-marshal.list 1970-01-01 00:00:00 +0000
699+++ libdbusmenu-glib/client-marshal.list 2010-08-26 20:37:39 +0000
700@@ -0,0 +1,2 @@
701+VOID: OBJECT, UINT
702+VOID: OBJECT, STRING, POINTER, UINT, POINTER
703
704=== modified file 'libdbusmenu-glib/client.c'
705--- libdbusmenu-glib/client.c 2010-08-19 18:41:19 +0000
706+++ libdbusmenu-glib/client.c 2010-08-26 20:37:39 +0000
707@@ -41,6 +41,7 @@
708 #include "client-menuitem.h"
709 #include "dbusmenu-client.h"
710 #include "server-marshal.h"
711+#include "client-marshal.h"
712
713 /* Properties */
714 enum {
715@@ -54,6 +55,8 @@
716 LAYOUT_UPDATED,
717 ROOT_CHANGED,
718 NEW_MENUITEM,
719+ ITEM_ACTIVATE,
720+ EVENT_RESULT,
721 LAST_SIGNAL
722 };
723
724@@ -100,6 +103,16 @@
725 gboolean replied;
726 };
727
728+typedef struct _event_data_t event_data_t;
729+struct _event_data_t {
730+ DbusmenuClient * client;
731+ DbusmenuMenuitem * menuitem;
732+ gchar * event;
733+ GValue data;
734+ guint timestamp;
735+};
736+
737+
738 #define DBUSMENU_CLIENT_GET_PRIVATE(o) \
739 (G_TYPE_INSTANCE_GET_PRIVATE ((o), DBUSMENU_TYPE_CLIENT, DbusmenuClientPrivate))
740
741@@ -123,6 +136,7 @@
742 static void menuitem_get_properties_cb (DBusGProxy * proxy, GHashTable * properties, GError * error, gpointer data);
743 static void get_properties_globber (DbusmenuClient * client, gint id, const gchar ** properties, org_ayatana_dbusmenu_get_properties_reply callback, gpointer user_data);
744 static GQuark error_domain (void);
745+static void item_activated (DBusGProxy * proxy, gint id, guint timestamp, DbusmenuClient * client);
746
747 /* Build a type */
748 G_DEFINE_TYPE (DbusmenuClient, dbusmenu_client, G_TYPE_OBJECT);
749@@ -187,6 +201,41 @@
750 NULL, NULL,
751 g_cclosure_marshal_VOID__OBJECT,
752 G_TYPE_NONE, 1, G_TYPE_OBJECT);
753+ /**
754+ DbusmenuClient::item-activate:
755+ @arg0: The #DbusmenuClient object
756+ @arg1: The #DbusmenuMenuitem activated
757+ @arg2: A timestamp that the event happened at
758+
759+ Signaled when the server wants to activate an item in
760+ order to display the menu.
761+ */
762+ signals[ITEM_ACTIVATE] = g_signal_new(DBUSMENU_CLIENT_SIGNAL_ITEM_ACTIVATE,
763+ G_TYPE_FROM_CLASS (klass),
764+ G_SIGNAL_RUN_LAST,
765+ G_STRUCT_OFFSET (DbusmenuClientClass, item_activate),
766+ NULL, NULL,
767+ _dbusmenu_client_marshal_VOID__OBJECT_UINT,
768+ G_TYPE_NONE, 2, G_TYPE_OBJECT, G_TYPE_UINT);
769+ /**
770+ DbusmenuClient::event-error:
771+ @arg0: The #DbusmenuClient object
772+ @arg1: The #DbusmenuMenuitem sent an event
773+ @arg2: The ID of the event sent
774+ @arg3: The data sent along with the event
775+ @arg4: A timestamp that the event happened at
776+ @arg5: Possibly the error in sending the event (or NULL)
777+
778+ Signal sent to show that there was an error in sending the event
779+ to the server.
780+ */
781+ signals[EVENT_RESULT] = g_signal_new(DBUSMENU_CLIENT_SIGNAL_EVENT_RESULT,
782+ G_TYPE_FROM_CLASS (klass),
783+ G_SIGNAL_RUN_LAST,
784+ G_STRUCT_OFFSET (DbusmenuClientClass, event_result),
785+ NULL, NULL,
786+ _dbusmenu_client_marshal_VOID__OBJECT_STRING_POINTER_UINT_POINTER,
787+ G_TYPE_NONE, 5, G_TYPE_OBJECT, G_TYPE_STRING, G_TYPE_POINTER, G_TYPE_UINT, G_TYPE_POINTER);
788
789 g_object_class_install_property (object_class, PROP_DBUSOBJECT,
790 g_param_spec_string(DBUSMENU_CLIENT_PROP_DBUS_OBJECT, "DBus Object we represent",
791@@ -582,6 +631,30 @@
792 return;
793 }
794
795+/* Called when a server item wants to activate the menu */
796+static void
797+item_activated (DBusGProxy * proxy, gint id, guint timestamp, DbusmenuClient * client)
798+{
799+ g_return_if_fail(DBUSMENU_IS_CLIENT(client));
800+
801+ DbusmenuClientPrivate * priv = DBUSMENU_CLIENT_GET_PRIVATE(client);
802+
803+ if (priv->root == NULL) {
804+ g_warning("Asked to activate item %d when we don't have a menu structure.", id);
805+ return;
806+ }
807+
808+ DbusmenuMenuitem * menuitem = dbusmenu_menuitem_find_id(priv->root, id);
809+ if (menuitem == NULL) {
810+ g_warning("Unable to find menu item %d to activate.", id);
811+ return;
812+ }
813+
814+ g_signal_emit(G_OBJECT(client), signals[ITEM_ACTIVATE], 0, menuitem, timestamp, TRUE);
815+
816+ return;
817+}
818+
819 /* Annoying little wrapper to make the right function update */
820 static void
821 layout_update (DBusGProxy * proxy, guint revision, gint parent, DbusmenuClient * client)
822@@ -821,6 +894,10 @@
823 dbus_g_proxy_add_signal(priv->menuproxy, "ItemUpdated", G_TYPE_INT, G_TYPE_INVALID);
824 dbus_g_proxy_connect_signal(priv->menuproxy, "ItemUpdated", G_CALLBACK(id_update), client, NULL);
825
826+ dbus_g_object_register_marshaller(_dbusmenu_server_marshal_VOID__INT_UINT, G_TYPE_NONE, G_TYPE_INT, G_TYPE_UINT, G_TYPE_INVALID);
827+ dbus_g_proxy_add_signal(priv->menuproxy, "ItemActivationRequested", G_TYPE_INT, G_TYPE_UINT, G_TYPE_INVALID);
828+ dbus_g_proxy_connect_signal(priv->menuproxy, "ItemActivationRequested", G_CALLBACK(item_activated), client, NULL);
829+
830 update_layout(client);
831
832 return;
833@@ -978,10 +1055,19 @@
834 static void
835 menuitem_call_cb (DBusGProxy * proxy, GError * error, gpointer userdata)
836 {
837+ event_data_t * edata = (event_data_t *)userdata;
838+
839 if (error != NULL) {
840 g_warning("Unable to call menu item %d: %s", GPOINTER_TO_INT(userdata), error->message);
841 }
842
843+ g_signal_emit(edata->client, signals[EVENT_RESULT], 0, edata->menuitem, edata->event, edata->data, edata->timestamp, error, TRUE);
844+
845+ g_value_unset(&edata->data);
846+ g_free(edata->event);
847+ g_object_unref(edata->menuitem);
848+ g_free(edata);
849+
850 return;
851 }
852
853@@ -994,6 +1080,13 @@
854 g_return_if_fail(id >= 0);
855 g_return_if_fail(name != NULL);
856
857+ DbusmenuClientPrivate * priv = DBUSMENU_CLIENT_GET_PRIVATE(client);
858+ DbusmenuMenuitem * mi = dbusmenu_menuitem_find_id(priv->root, id);
859+ if (mi == NULL) {
860+ g_warning("Asked to activate a menuitem %d that we don't know about", id);
861+ return;
862+ }
863+
864 if (value == NULL) {
865 GValue internalval = {0};
866 g_value_init(&internalval, G_TYPE_INT);
867@@ -1001,8 +1094,16 @@
868 value = &internalval;
869 }
870
871- DbusmenuClientPrivate * priv = DBUSMENU_CLIENT_GET_PRIVATE(client);
872- org_ayatana_dbusmenu_event_async (priv->menuproxy, id, name, value, timestamp, menuitem_call_cb, GINT_TO_POINTER(id));
873+ event_data_t * edata = g_new0(event_data_t, 1);
874+ edata->client = client;
875+ edata->menuitem = mi;
876+ g_object_ref(edata->menuitem);
877+ edata->event = g_strdup(name);
878+ g_value_init(&edata->data, G_VALUE_TYPE(value));
879+ g_value_copy(value, &edata->data);
880+ edata->timestamp = timestamp;
881+
882+ org_ayatana_dbusmenu_event_async (priv->menuproxy, id, name, value, timestamp, menuitem_call_cb, edata);
883 return;
884 }
885
886@@ -1225,7 +1326,8 @@
887
888 xmlDocPtr xmldoc;
889
890- xmldoc = xmlReadMemory(layout, g_utf8_strlen(layout, 16*1024), "dbusmenu.xml", NULL, 0);
891+ /* No one should need more characters than this! */
892+ xmldoc = xmlReadMemory(layout, g_utf8_strlen(layout, 1024*1024), "dbusmenu.xml", NULL, 0);
893
894 xmlNodePtr root = xmlDocGetRootElement(xmldoc);
895
896
897=== modified file 'libdbusmenu-glib/client.h'
898--- libdbusmenu-glib/client.h 2010-03-31 18:47:27 +0000
899+++ libdbusmenu-glib/client.h 2010-08-26 20:37:39 +0000
900@@ -46,6 +46,8 @@
901 #define DBUSMENU_CLIENT_SIGNAL_LAYOUT_UPDATED "layout-updated"
902 #define DBUSMENU_CLIENT_SIGNAL_ROOT_CHANGED "root-changed"
903 #define DBUSMENU_CLIENT_SIGNAL_NEW_MENUITEM "new-menuitem"
904+#define DBUSMENU_CLIENT_SIGNAL_ITEM_ACTIVATE "item-activate"
905+#define DBUSMENU_CLIENT_SIGNAL_EVENT_RESULT "event-result"
906
907 #define DBUSMENU_CLIENT_PROP_DBUS_NAME "dbus-name"
908 #define DBUSMENU_CLIENT_PROP_DBUS_OBJECT "dbus-object"
909@@ -59,10 +61,10 @@
910 @parent_class: #GObjectClass
911 @layout_updated: Slot for #DbusmenuClient::layout-updated.
912 @new_menuitem: Slot for #DbusmenuClient::new-menuitem.
913+ @item_activate: Slot for #DbusmenuClient::item-activate.
914+ @event_result: Slot for #DbusmenuClient::event-error.
915 @reserved1: Reserved for future use.
916 @reserved2: Reserved for future use.
917- @reserved3: Reserved for future use.
918- @reserved4: Reserved for future use.
919
920 A simple class that takes all of the information from a
921 #DbusmenuServer over DBus and makes the same set of
922@@ -75,12 +77,14 @@
923 void (*layout_updated)(void);
924 void (*root_changed) (DbusmenuMenuitem * newroot);
925 void (*new_menuitem) (DbusmenuMenuitem * newitem);
926+ void (*item_activate) (DbusmenuMenuitem * item, guint timestamp);
927+ void (*event_result) (DbusmenuMenuitem * item, gchar * event, GValue * data, guint timestamp, GError * error);
928
929 /* Reserved for future use */
930 void (*reserved1) (void);
931 void (*reserved2) (void);
932- void (*reserved3) (void);
933- void (*reserved4) (void);
934+ /* void (*reserved3) (void); */
935+ /* void (*reserved4) (void); */
936 };
937
938 /**
939
940=== modified file 'libdbusmenu-glib/dbusmenu-server.h'
941--- libdbusmenu-glib/dbusmenu-server.h 2010-07-30 17:44:33 +0000
942+++ libdbusmenu-glib/dbusmenu-server.h 2010-08-26 20:37:39 +0000
943@@ -376,12 +376,11 @@
944 { (GCallback) _dbusmenu_server_about_to_show, dbus_glib_marshal__dbusmenu_server_BOOLEAN__INT_POINTER_POINTER, 491 },
945 };
946
947-const DBusGObjectInfo dbus_glib__dbusmenu_server_object_info = {
948- 0,
949+const DBusGObjectInfo dbus_glib__dbusmenu_server_object_info = { 1,
950 dbus_glib__dbusmenu_server_methods,
951 7,
952 "org.ayatana.dbusmenu\0GetLayout\0S\0parentId\0I\0i\0revision\0O\0F\0N\0u\0layout\0O\0F\0N\0s\0\0org.ayatana.dbusmenu\0GetGroupProperties\0S\0ids\0I\0ai\0propertyNames\0I\0as\0properties\0O\0F\0N\0a(ia{sv})\0\0org.ayatana.dbusmenu\0GetChildren\0S\0id\0I\0i\0propertyNames\0I\0as\0properties\0O\0F\0N\0a(ia{sv})\0\0org.ayatana.dbusmenu\0GetProperty\0S\0id\0I\0i\0name\0I\0s\0value\0O\0F\0N\0v\0\0org.ayatana.dbusmenu\0GetProperties\0S\0id\0I\0i\0propertyNames\0I\0as\0properties\0O\0F\0N\0a{sv}\0\0org.ayatana.dbusmenu\0Event\0S\0id\0I\0i\0eventId\0I\0s\0data\0I\0v\0timestamp\0I\0u\0\0org.ayatana.dbusmenu\0AboutToShow\0S\0id\0I\0i\0needUpdate\0O\0F\0N\0b\0\0\0",
953 "org.ayatana.dbusmenu\0ItemPropertyUpdated\0org.ayatana.dbusmenu\0ItemUpdated\0org.ayatana.dbusmenu\0LayoutUpdated\0org.ayatana.dbusmenu\0ItemActivationRequested\0\0",
954-"org.ayatana.dbusmenu\0version\0\0"
955+"org.ayatana.dbusmenu\0version\0version\0read\0\0"
956 };
957
958
959=== modified file 'libdbusmenu-glib/menuitem-marshal.c'
960--- libdbusmenu-glib/menuitem-marshal.c 2010-08-03 01:24:55 +0000
961+++ libdbusmenu-glib/menuitem-marshal.c 2010-08-26 20:37:39 +0000
962@@ -21,6 +21,7 @@
963 #define g_marshal_value_peek_boxed(v) g_value_get_boxed (v)
964 #define g_marshal_value_peek_pointer(v) g_value_get_pointer (v)
965 #define g_marshal_value_peek_object(v) g_value_get_object (v)
966+#define g_marshal_value_peek_variant(v) g_value_get_variant (v)
967 #else /* !G_ENABLE_DEBUG */
968 /* WARNING: This code accesses GValues directly, which is UNSUPPORTED API.
969 * Do not access GValues directly in your code. Instead, use the
970@@ -44,6 +45,7 @@
971 #define g_marshal_value_peek_boxed(v) (v)->data[0].v_pointer
972 #define g_marshal_value_peek_pointer(v) (v)->data[0].v_pointer
973 #define g_marshal_value_peek_object(v) (v)->data[0].v_pointer
974+#define g_marshal_value_peek_variant(v) (v)->data[0].v_pointer
975 #endif /* !G_ENABLE_DEBUG */
976
977
978
979=== modified file 'libdbusmenu-glib/menuitem.c'
980--- libdbusmenu-glib/menuitem.c 2010-06-08 04:00:17 +0000
981+++ libdbusmenu-glib/menuitem.c 2010-08-26 20:37:39 +0000
982@@ -70,6 +70,7 @@
983 CHILD_REMOVED,
984 CHILD_MOVED,
985 REALIZED,
986+ SHOW_TO_USER,
987 LAST_SIGNAL
988 };
989
990@@ -211,6 +212,22 @@
991 NULL, NULL,
992 _dbusmenu_menuitem_marshal_VOID__VOID,
993 G_TYPE_NONE, 0, G_TYPE_NONE);
994+ /**
995+ DbusmenuMenuitem::show-to-user:
996+ @arg0: The #DbusmenuMenuitem which should be shown.
997+ @arg1: Timestamp the event happened at
998+
999+ Signaled when the application would like the visualization
1000+ of this menu item shown to the user. This usually requires
1001+ going over the bus to get it done.
1002+ */
1003+ signals[SHOW_TO_USER] = g_signal_new(DBUSMENU_MENUITEM_SIGNAL_SHOW_TO_USER,
1004+ G_TYPE_FROM_CLASS(klass),
1005+ G_SIGNAL_RUN_LAST,
1006+ G_STRUCT_OFFSET(DbusmenuMenuitemClass, show_to_user),
1007+ NULL, NULL,
1008+ g_cclosure_marshal_VOID__UINT,
1009+ G_TYPE_NONE, 1, G_TYPE_UINT, G_TYPE_NONE);
1010
1011 g_object_class_install_property (object_class, PROP_ID,
1012 g_param_spec_int(PROP_ID_S, "ID for the menu item",
1013@@ -1349,3 +1366,22 @@
1014
1015 return;
1016 }
1017+
1018+/**
1019+ dbusmenu_menuitem_show_to_user:
1020+ @mi: #DbusmenuMenuitem to show
1021+ @timestamp: The time that the user requested it to be shown
1022+
1023+ Signals that this menu item should be shown to the user. If this is
1024+ server side the server will then take it and send it over the
1025+ bus.
1026+*/
1027+void
1028+dbusmenu_menuitem_show_to_user (DbusmenuMenuitem * mi, guint timestamp)
1029+{
1030+ g_return_if_fail(DBUSMENU_IS_MENUITEM(mi));
1031+
1032+ g_signal_emit(G_OBJECT(mi), signals[SHOW_TO_USER], 0, timestamp, TRUE);
1033+
1034+ return;
1035+}
1036
1037=== modified file 'libdbusmenu-glib/menuitem.h'
1038--- libdbusmenu-glib/menuitem.h 2010-06-21 19:47:08 +0000
1039+++ libdbusmenu-glib/menuitem.h 2010-08-26 20:37:39 +0000
1040@@ -49,6 +49,7 @@
1041 #define DBUSMENU_MENUITEM_SIGNAL_CHILD_MOVED "child-moved"
1042 #define DBUSMENU_MENUITEM_SIGNAL_REALIZED "realized"
1043 #define DBUSMENU_MENUITEM_SIGNAL_REALIZED_ID (g_signal_lookup(DBUSMENU_MENUITEM_SIGNAL_REALIZED, DBUSMENU_TYPE_MENUITEM))
1044+#define DBUSMENU_MENUITEM_SIGNAL_SHOW_TO_USER "show-to-user"
1045
1046 #define DBUSMENU_MENUITEM_PROP_TYPE "type"
1047 #define DBUSMENU_MENUITEM_PROP_VISIBLE "visible"
1048@@ -124,10 +125,7 @@
1049 * @buildxml: Virtual function that appends the strings required to represent this menu item in the menu XML file.
1050 * @handle_event: This function is to override how events are handled by subclasses. Look at #dbusmenu_menuitem_handle_event for lots of good information.
1051 * @send_about_to_show: Virtual function that notifies server that the client is about to show a menu.
1052- * @reserved1: Reserved for future use.
1053- * @reserved2: Reserved for future use.
1054- * @reserved3: Reserved for future use.
1055- * @reserved4: Reserved for future use.
1056+ * @show_to_user: Slot for #DbusmenuMenuitem::show-to-user.
1057 */
1058 typedef struct _DbusmenuMenuitemClass DbusmenuMenuitemClass;
1059 struct _DbusmenuMenuitemClass
1060@@ -147,7 +145,8 @@
1061 void (*handle_event) (DbusmenuMenuitem * mi, const gchar * name, const GValue * value, guint timestamp);
1062 void (*send_about_to_show) (DbusmenuMenuitem * mi, dbusmenu_menuitem_about_to_show_cb cb, gpointer cb_data);
1063
1064- void (*reserved1) (void);
1065+ void (*show_to_user) (DbusmenuMenuitem * mi, guint timestamp, gpointer cb_data);
1066+ /* void (*reserved1) (void); */
1067 /* void (*reserved2) (void); */
1068 /* void (*reserved3) (void); */
1069 /* void (*reserved4) (void); -- realized, realloc when bumping lib version */
1070@@ -192,6 +191,8 @@
1071 void dbusmenu_menuitem_handle_event (DbusmenuMenuitem * mi, const gchar * name, const GValue * value, guint timestamp);
1072 void dbusmenu_menuitem_send_about_to_show (DbusmenuMenuitem * mi, dbusmenu_menuitem_about_to_show_cb cb, gpointer cb_data);
1073
1074+void dbusmenu_menuitem_show_to_user (DbusmenuMenuitem * mi, guint timestamp);
1075+
1076 /**
1077 * SECTION:menuitem
1078 * @short_description: A lowlevel represenation of a menuitem
1079
1080=== modified file 'libdbusmenu-glib/server.c'
1081--- libdbusmenu-glib/server.c 2010-08-02 22:07:49 +0000
1082+++ libdbusmenu-glib/server.c 2010-08-26 20:37:39 +0000
1083@@ -410,7 +410,7 @@
1084 /* Called when a menu item emits its activated signal so it
1085 gets passed across the bus. */
1086 static void
1087-menuitem_activated (DbusmenuMenuitem * mi, guint timestamp, DbusmenuServer * server)
1088+menuitem_shown (DbusmenuMenuitem * mi, guint timestamp, DbusmenuServer * server)
1089 {
1090 g_signal_emit(G_OBJECT(server), signals[ITEM_ACTIVATION], 0, dbusmenu_menuitem_get_id(mi), timestamp, TRUE);
1091 return;
1092@@ -425,7 +425,7 @@
1093 g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_CHILD_REMOVED, G_CALLBACK(menuitem_child_removed), data);
1094 g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_CHILD_MOVED, G_CALLBACK(menuitem_child_moved), data);
1095 g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_PROPERTY_CHANGED, G_CALLBACK(menuitem_property_changed), data);
1096- g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(menuitem_activated), data);
1097+ g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_SHOW_TO_USER, G_CALLBACK(menuitem_shown), data);
1098 return;
1099 }
1100
1101
1102=== modified file 'libdbusmenu-gtk/client.c'
1103--- libdbusmenu-gtk/client.c 2010-07-22 08:44:33 +0000
1104+++ libdbusmenu-gtk/client.c 2010-08-26 20:37:39 +0000
1105@@ -54,6 +54,7 @@
1106 static void new_child (DbusmenuMenuitem * mi, DbusmenuMenuitem * child, guint position, DbusmenuGtkClient * gtkclient);
1107 static void delete_child (DbusmenuMenuitem * mi, DbusmenuMenuitem * child, DbusmenuGtkClient * gtkclient);
1108 static void move_child (DbusmenuMenuitem * mi, DbusmenuMenuitem * child, guint new, guint old, DbusmenuGtkClient * gtkclient);
1109+static void item_activate (DbusmenuClient * client, DbusmenuMenuitem * mi, guint timestamp, gpointer userdata);
1110
1111 static gboolean new_item_normal (DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, DbusmenuClient * client);
1112 static gboolean new_item_seperator (DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, DbusmenuClient * client);
1113@@ -91,7 +92,9 @@
1114 dbusmenu_client_add_type_handler(DBUSMENU_CLIENT(self), DBUSMENU_CLIENT_TYPES_DEFAULT, new_item_normal);
1115 dbusmenu_client_add_type_handler(DBUSMENU_CLIENT(self), DBUSMENU_CLIENT_TYPES_SEPARATOR, new_item_seperator);
1116
1117+ /* TODO: I think these can be handled in the class... */
1118 g_signal_connect(G_OBJECT(self), DBUSMENU_CLIENT_SIGNAL_NEW_MENUITEM, G_CALLBACK(new_menuitem), NULL);
1119+ g_signal_connect(G_OBJECT(self), DBUSMENU_CLIENT_SIGNAL_ITEM_ACTIVATE, G_CALLBACK(item_activate), NULL);
1120
1121 return;
1122 }
1123@@ -431,6 +434,50 @@
1124 return;
1125 }
1126
1127+/* Goes through the tree of items and ensure's that all the items
1128+ above us are also displayed. */
1129+static void
1130+activate_helper (GtkMenuShell * shell)
1131+{
1132+ if (shell == NULL) {
1133+ return;
1134+ }
1135+
1136+ if (GTK_IS_MENU(shell)) {
1137+ GtkWidget * attach = gtk_menu_get_attach_widget(GTK_MENU(shell));
1138+
1139+ if (attach != NULL) {
1140+ GtkWidget * parent = gtk_widget_get_parent(GTK_WIDGET(attach));
1141+
1142+ if (parent != NULL) {
1143+ if (GTK_IS_MENU(parent)) {
1144+ activate_helper(GTK_MENU_SHELL(parent));
1145+ }
1146+ gtk_menu_shell_select_item(GTK_MENU_SHELL(parent), attach);
1147+ }
1148+ }
1149+ }
1150+
1151+ return;
1152+}
1153+
1154+/* Signaled when we should show a menuitem at request of the application
1155+ that it is in. */
1156+static void
1157+item_activate (DbusmenuClient * client, DbusmenuMenuitem * mi, guint timestamp, gpointer userdata)
1158+{
1159+ gpointer pmenu = g_object_get_data(G_OBJECT(mi), data_menu);
1160+ if (pmenu == NULL) {
1161+ g_warning("Activated menu item doesn't have a menu? ID: %d", dbusmenu_menuitem_get_id(mi));
1162+ return;
1163+ }
1164+
1165+ activate_helper(GTK_MENU_SHELL(pmenu));
1166+ gtk_menu_shell_select_first(GTK_MENU_SHELL(pmenu), FALSE);
1167+
1168+ return;
1169+}
1170+
1171 #ifdef MASSIVEDEBUGGING
1172 static void
1173 destroy_gmi (GtkMenuItem * gmi, DbusmenuMenuitem * mi)
1174
1175=== modified file 'tests/test-gtk-label-client.c'
1176--- tests/test-gtk-label-client.c 2009-12-17 22:41:01 +0000
1177+++ tests/test-gtk-label-client.c 2010-08-26 20:37:39 +0000
1178@@ -22,7 +22,6 @@
1179 #include <gtk/gtk.h>
1180 #include <libdbusmenu-gtk/menu.h>
1181
1182-static guint layouton = 0;
1183 static GMainLoop * mainloop = NULL;
1184 static gboolean passed = TRUE;
1185 static guint death_timer = 0;
1186@@ -105,7 +104,6 @@
1187 static gboolean
1188 timer_func (gpointer data)
1189 {
1190- g_debug("Death timer. Oops. Got to: %d", layouton);
1191 passed = TRUE;
1192 g_main_loop_quit(mainloop);
1193 return FALSE;
1194
1195=== modified file 'tests/test-gtk-submenu-client.c'
1196--- tests/test-gtk-submenu-client.c 2010-07-22 08:44:33 +0000
1197+++ tests/test-gtk-submenu-client.c 2010-08-26 20:37:39 +0000
1198@@ -102,6 +102,12 @@
1199 }
1200
1201 passed = TRUE;
1202+ return FALSE;
1203+}
1204+
1205+gboolean
1206+finished_func (gpointer user_data)
1207+{
1208 g_main_loop_quit(mainloop);
1209 return FALSE;
1210 }
1211@@ -127,7 +133,8 @@
1212 gtk_window_set_title(GTK_WINDOW(window), "libdbusmenu-gtk test");
1213 gtk_widget_show(window);
1214
1215- g_timeout_add_seconds(1, timer_func, menuitem);
1216+ g_timeout_add_seconds(2, timer_func, menuitem);
1217+ g_timeout_add_seconds(6, finished_func, menuitem);
1218
1219 g_debug("Entering Mainloop");
1220 mainloop = g_main_loop_new(NULL, FALSE);
1221
1222=== modified file 'tests/test-gtk-submenu-server.c'
1223--- tests/test-gtk-submenu-server.c 2010-07-22 19:05:53 +0000
1224+++ tests/test-gtk-submenu-server.c 2010-08-26 20:37:39 +0000
1225@@ -39,6 +39,17 @@
1226 return FALSE;
1227 }
1228
1229+static gboolean
1230+show_item (gpointer pmi)
1231+{
1232+ DbusmenuMenuitem * mi = DBUSMENU_MENUITEM(pmi);
1233+ g_debug("Showing item");
1234+
1235+ dbusmenu_menuitem_show_to_user(mi, 0);
1236+
1237+ return FALSE;
1238+}
1239+
1240 DbusmenuMenuitem *
1241 add_item(DbusmenuMenuitem * parent, const char * label)
1242 {
1243@@ -81,12 +92,16 @@
1244 add_item(item, "1.2");
1245 add_item(item, "1.3");
1246
1247+ g_timeout_add_seconds(2, show_item, item);
1248+
1249 item = add_item(root, "Folder 2");
1250 add_item(item, "2.1");
1251 add_item(item, "2.2");
1252 add_item(item, "2.3");
1253
1254- g_timeout_add_seconds(3, timer_func, NULL);
1255+ g_timeout_add_seconds(4, show_item, item);
1256+
1257+ g_timeout_add_seconds(6, timer_func, NULL);
1258
1259 mainloop = g_main_loop_new(NULL, FALSE);
1260 g_main_loop_run(mainloop);

Subscribers

People subscribed via source and target branches

to all changes: