Merge lp:~pitti/libdbusmenu/fix-annotations into lp:libdbusmenu/0.5

Proposed by Martin Pitt
Status: Merged
Merged at revision: 216
Proposed branch: lp:~pitti/libdbusmenu/fix-annotations
Merge into: lp:libdbusmenu/0.5
Diff against target: 2031 lines (+757/-656)
17 files modified
libdbusmenu-glib/Makefile.am (+3/-3)
libdbusmenu-glib/client.c (+68/-68)
libdbusmenu-glib/client.h (+1/-1)
libdbusmenu-glib/menuitem-proxy.c (+17/-17)
libdbusmenu-glib/menuitem.c (+363/-360)
libdbusmenu-glib/menuitem.h (+2/-2)
libdbusmenu-gtk/Makefile.am (+3/-3)
libdbusmenu-gtk/client.c (+55/-55)
libdbusmenu-gtk/genericmenuitem.c (+26/-26)
libdbusmenu-gtk/menu.c (+17/-17)
libdbusmenu-gtk/menuitem.c (+60/-60)
libdbusmenu-gtk/menuitem.h (+1/-1)
libdbusmenu-gtk/parser.c (+10/-10)
libdbusmenu-gtk/serializablemenuitem.c (+31/-31)
tests/Makefile.am (+13/-2)
tests/test-glib-simple-items.py (+35/-0)
tests/test-gtk-shortcut-client.py (+52/-0)
To merge this branch: bzr merge lp:~pitti/libdbusmenu/fix-annotations
Reviewer Review Type Date Requested Status
Ted Gould (community) Approve
Review via email: mp+50578@code.launchpad.net

Description of the change

This branch fixes the GI/gtk-doc annotations. They need to be reformatted to be recognized by g-ir-scanner/gtk-doc, I added the necessary annotations, and also added a simple test case (Python port of test-glib-simple-items.c).

Now DbusmenuGtk-0.4.gir is fully introspectable. The two functions in Dbusmenu-0.4.gir which aren't are dbusmenu_client_add_type_handler{,_full}. They take a callback function (which isn't "async" or "call" scope) and a ClientTypeDestroyHandler, but GI can only handle such "notify" scope callbacks if the method takes a standard GDestroyNotify. Thus these two can't be made introspectable without an API/ABI change. Are these vitally important to write clients?

I also started working on a Python port of the "test-gtk-shortcut" test case [1]. This runs, but once the server comes alive, I get an error:

(test-gtk-shortcut-client.py:10192): LIBDBUSMENU-GLIB-WARNING **: Getting layout failed: GDBus.Error:org.freedesktop.DBus.Error.InvalidArgs: Type of message, `(iias)', does not match expected type `(i)'

and the menu with the shortcut isn't visible. I currently have no idea why this happens, this doesn't seem to be immediately related to the Python bits. Does that ring a bell for you?

[1] http://people.canonical.com/~pitti/tmp/dbusmenu-shortcut-python-test.patch

To post a comment you must log in.
217. By Martin Pitt

merge trunk

Revision history for this message
Martin Pitt (pitti) wrote :

I now merged to the new version from trunk. It seems the xml -> variant change magically fixed this, and the test-gtk-shortcut-client.py test case now works perfectly; so I pushed this as well.

218. By Martin Pitt

add test-gtk-shortcut-client.py Python GI test

This replicates tests/test-gtk-shortcut-client.c using Python and GI.

Revision history for this message
Ted Gould (ted) wrote :

In the parser the annotation should be transfer full. I'll fix that and
merge it in. Thanks!

  review approve

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libdbusmenu-glib/Makefile.am'
2--- libdbusmenu-glib/Makefile.am 2011-02-09 17:45:41 +0000
3+++ libdbusmenu-glib/Makefile.am 2011-02-21 13:11:23 +0000
4@@ -122,21 +122,21 @@
5 INTROSPECTION_SCANNER_ARGS = --add-include-path=$(srcdir) \
6 --warn-all \
7 --add-include-path=$(srcdir) \
8- $(addprefix --c-include=libdbusmenu-glib/, $(introspection_sources)) \
9+ $(addprefix --c-include=libdbusmenu-glib/, $(libdbusmenu_glibinclude_HEADERS)) \
10 --symbol-prefix=dbusmenu \
11 --identifier-prefix=Dbusmenu
12 else
13 INTROSPECTION_SCANNER_ARGS = --add-include-path=$(srcdir) \
14 --warn-all \
15 --add-include-path=$(srcdir) \
16- $(addprefix --c-include=libdbusmenu-glib/, $(introspection_sources))
17+ $(addprefix --c-include=libdbusmenu-glib/, $(libdbusmenu_glibinclude_HEADERS))
18 endif
19
20 INTROSPECTION_COMPILER_ARGS = --includedir=$(builddir)
21
22 if HAVE_INTROSPECTION
23
24-introspection_sources = $(libdbusmenu_glibinclude_HEADERS)
25+introspection_sources = $(libdbusmenu_glibinclude_HEADERS) $(libdbusmenu_glib_la_SOURCES)
26
27 Dbusmenu-0.4.gir: libdbusmenu-glib.la
28 Dbusmenu_0_4_gir_INCLUDES = \
29
30=== modified file 'libdbusmenu-glib/client.c'
31--- libdbusmenu-glib/client.c 2011-02-15 17:42:52 +0000
32+++ libdbusmenu-glib/client.c 2011-02-21 13:11:23 +0000
33@@ -1682,17 +1682,17 @@
34
35 /* Public API */
36 /**
37- dbusmenu_client_new:
38- @name: The DBus name for the server to connect to
39- @object: The object on the server to monitor
40-
41- This function creates a new client that connects to a specific
42- server on DBus. That server is at a specific location sharing
43- a known object. The interface is assumed by the code to be
44- the DBus menu interface. The newly created client will start
45- sending out events as it syncs up with the server.
46-
47- Return value: A brand new #DbusmenuClient
48+ * dbusmenu_client_new:
49+ * @name: The DBus name for the server to connect to
50+ * @object: The object on the server to monitor
51+ *
52+ * This function creates a new client that connects to a specific
53+ * server on DBus. That server is at a specific location sharing
54+ * a known object. The interface is assumed by the code to be
55+ * the DBus menu interface. The newly created client will start
56+ * sending out events as it syncs up with the server.
57+ *
58+ * Return value: A brand new #DbusmenuClient
59 */
60 DbusmenuClient *
61 dbusmenu_client_new (const gchar * name, const gchar * object)
62@@ -1706,21 +1706,21 @@
63 }
64
65 /**
66- dbusmenu_client_get_root:
67- @client: The #DbusmenuClient to get the root node from
68-
69- Grabs the root node for the specified client @client. This
70- function may block. It will block if there is currently a
71- call to update the layout, it will block on that layout
72- updated and then return the newly updated layout. Chances
73- are that this update is in the queue for the mainloop as
74- it would have been requested some time ago, but in theory
75- it could block longer.
76-
77- Return value: A #DbusmenuMenuitem representing the root of
78- menu on the server. If there is no server or there is
79- an error receiving its layout it'll return #NULL.
80-*/
81+ * dbusmenu_client_get_root:
82+ * @client: The #DbusmenuClient to get the root node from
83+ *
84+ * Grabs the root node for the specified client @client. This
85+ * function may block. It will block if there is currently a
86+ * call to update the layout, it will block on that layout
87+ * updated and then return the newly updated layout. Chances
88+ * are that this update is in the queue for the mainloop as
89+ * it would have been requested some time ago, but in theory
90+ * it could block longer.
91+ *
92+ * Return value: (transfer none): A #DbusmenuMenuitem representing the root of
93+ * menu on the server. If there is no server or there is
94+ * an error receiving its layout it'll return #NULL.
95+ */
96 DbusmenuMenuitem *
97 dbusmenu_client_get_root (DbusmenuClient * client)
98 {
99@@ -1749,25 +1749,25 @@
100 }
101
102 /**
103- dbusmenu_client_add_type_handler:
104- @client: Client where we're getting types coming in
105- @type: A text string that will be matched with the 'type'
106- property on incoming menu items
107- @newfunc: The function that will be executed with those new
108- items when they come in.
109-
110- This function connects into the type handling of the #DbusmenuClient.
111- Every new menuitem that comes in immediately gets asked for it's
112- properties. When we get those properties we check the 'type'
113- property and look to see if it matches a handler that is known
114- by the client. If so, the @newfunc function is executed on that
115- #DbusmenuMenuitem. If not, then the DbusmenuClient::new-menuitem
116- signal is sent.
117-
118- In the future the known types will be sent to the server so that it
119- can make choices about the menu item types availble.
120-
121- Return value: If registering the new type was successful.
122+ * dbusmenu_client_add_type_handler:
123+ * @client: Client where we're getting types coming in
124+ * @type: A text string that will be matched with the 'type'
125+ * property on incoming menu items
126+ * @newfunc: The function that will be executed with those new
127+ * items when they come in.
128+ *
129+ * This function connects into the type handling of the #DbusmenuClient.
130+ * Every new menuitem that comes in immediately gets asked for it's
131+ * properties. When we get those properties we check the 'type'
132+ * property and look to see if it matches a handler that is known
133+ * by the client. If so, the @newfunc function is executed on that
134+ * #DbusmenuMenuitem. If not, then the DbusmenuClient::new-menuitem
135+ * signal is sent.
136+ *
137+ * In the future the known types will be sent to the server so that it
138+ * can make choices about the menu item types availble.
139+ *
140+ * Return value: If registering the new type was successful.
141 */
142 gboolean
143 dbusmenu_client_add_type_handler (DbusmenuClient * client, const gchar * type, DbusmenuClientTypeHandler newfunc)
144@@ -1776,29 +1776,29 @@
145 }
146
147 /**
148- dbusmenu_client_add_type_handler_full:
149- @client: Client where we're getting types coming in
150- @type: A text string that will be matched with the 'type'
151- property on incoming menu items
152- @newfunc: The function that will be executed with those new
153- items when they come in.
154- @user_data: Data passed to @newfunc when it is called
155- @destroy_func: A function that is called when the type handler is
156- removed (usually on client destruction) which will free
157- the resources in @user_data.
158-
159- This function connects into the type handling of the #DbusmenuClient.
160- Every new menuitem that comes in immediately gets asked for it's
161- properties. When we get those properties we check the 'type'
162- property and look to see if it matches a handler that is known
163- by the client. If so, the @newfunc function is executed on that
164- #DbusmenuMenuitem. If not, then the DbusmenuClient::new-menuitem
165- signal is sent.
166-
167- In the future the known types will be sent to the server so that it
168- can make choices about the menu item types availble.
169-
170- Return value: If registering the new type was successful.
171+ * dbusmenu_client_add_type_handler_full:
172+ * @client: Client where we're getting types coming in
173+ * @type: A text string that will be matched with the 'type'
174+ * property on incoming menu items
175+ * @newfunc: The function that will be executed with those new
176+ * items when they come in.
177+ * @user_data: Data passed to @newfunc when it is called
178+ * @destroy_func: A function that is called when the type handler is
179+ * removed (usually on client destruction) which will free
180+ * the resources in @user_data.
181+ *
182+ * This function connects into the type handling of the #DbusmenuClient.
183+ * Every new menuitem that comes in immediately gets asked for it's
184+ * properties. When we get those properties we check the 'type'
185+ * property and look to see if it matches a handler that is known
186+ * by the client. If so, the @newfunc function is executed on that
187+ * #DbusmenuMenuitem. If not, then the DbusmenuClient::new-menuitem
188+ * signal is sent.
189+ *
190+ * In the future the known types will be sent to the server so that it
191+ * can make choices about the menu item types availble.
192+ *
193+ * Return value: If registering the new type was successful.
194 */
195 gboolean
196 dbusmenu_client_add_type_handler_full (DbusmenuClient * client, const gchar * type, DbusmenuClientTypeHandler newfunc, gpointer user_data, DbusmenuClientTypeDestroyHandler destroy_func)
197
198=== modified file 'libdbusmenu-glib/client.h'
199--- libdbusmenu-glib/client.h 2011-01-27 15:35:14 +0000
200+++ libdbusmenu-glib/client.h 2011-02-21 13:11:23 +0000
201@@ -145,7 +145,7 @@
202 const gchar * type,
203 DbusmenuClientTypeHandler newfunc,
204 gpointer user_data,
205- DbusmenuClientTypeDestroyHandler destory_func);
206+ DbusmenuClientTypeDestroyHandler destroy_func);
207 void dbusmenu_client_send_event (DbusmenuClient * client,
208 gint id,
209 const gchar * name,
210
211=== modified file 'libdbusmenu-glib/menuitem-proxy.c'
212--- libdbusmenu-glib/menuitem-proxy.c 2010-11-18 02:50:45 +0000
213+++ libdbusmenu-glib/menuitem-proxy.c 2011-02-21 13:11:23 +0000
214@@ -325,14 +325,14 @@
215 }
216
217 /**
218- dbusmenu_menuitem_proxy_new:
219- @mi: The #DbusmenuMenuitem to proxy
220-
221- Builds a new #DbusmenuMenuitemProxy object that proxies
222- all of the values for @mi.
223-
224- Return value: A new #DbusmenuMenuitemProxy object.
225-*/
226+ * dbusmenu_menuitem_proxy_new:
227+ * @mi: The #DbusmenuMenuitem to proxy
228+ *
229+ * Builds a new #DbusmenuMenuitemProxy object that proxies
230+ * all of the values for @mi.
231+ *
232+ * Return value: A new #DbusmenuMenuitemProxy object.
233+ */
234 DbusmenuMenuitemProxy *
235 dbusmenu_menuitem_proxy_new (DbusmenuMenuitem * mi)
236 {
237@@ -344,15 +344,15 @@
238 }
239
240 /**
241- dbusmenu_menuitem_proxy_get_wrapped:
242- @pmi: #DbusmenuMenuitemProxy to look into
243-
244- Accesses the private variable of which #DbusmenuMenuitem
245- we are doing the proxying for.
246-
247- Return value: A #DbusmenuMenuitem object or a #NULL if we
248- don't have one or there is an error.
249-*/
250+ * dbusmenu_menuitem_proxy_get_wrapped:
251+ * @pmi: #DbusmenuMenuitemProxy to look into
252+ *
253+ * Accesses the private variable of which #DbusmenuMenuitem
254+ * we are doing the proxying for.
255+ *
256+ * Return value: (transfer none): A #DbusmenuMenuitem object or a #NULL if we
257+ * don't have one or there is an error.
258+ */
259 DbusmenuMenuitem *
260 dbusmenu_menuitem_proxy_get_wrapped (DbusmenuMenuitemProxy * pmi)
261 {
262
263=== modified file 'libdbusmenu-glib/menuitem.c'
264--- libdbusmenu-glib/menuitem.c 2011-02-15 17:42:52 +0000
265+++ libdbusmenu-glib/menuitem.c 2011-02-21 13:11:23 +0000
266@@ -95,7 +95,7 @@
267 static void get_property (GObject * obj, guint id, GValue * value, GParamSpec * pspec);
268 static void g_value_transform_STRING_BOOLEAN (const GValue * in, GValue * out);
269 static void g_value_transform_STRING_INT (const GValue * in, GValue * out);
270-static void handle_event (DbusmenuMenuitem * mi, const gchar * name, GVariant * value, guint timestamp);
271+static void handle_event (DbusmenuMenuitem * mi, const gchar * name, GVariant * variant, guint timestamp);
272 static void send_about_to_show (DbusmenuMenuitem * mi, void (*cb) (DbusmenuMenuitem * mi, gpointer user_data), gpointer cb_data);
273
274 /* GObject stuff */
275@@ -428,12 +428,12 @@
276 /* Public interface */
277
278 /**
279- dbusmenu_menuitem_new:
280-
281- Create a new #DbusmenuMenuitem with all default values.
282-
283- Return value: A newly allocated #DbusmenuMenuitem.
284-*/
285+ * dbusmenu_menuitem_new:
286+ *
287+ * Create a new #DbusmenuMenuitem with all default values.
288+ *
289+ * Return value: A newly allocated #DbusmenuMenuitem.
290+ */
291 DbusmenuMenuitem *
292 dbusmenu_menuitem_new (void)
293 {
294@@ -441,13 +441,13 @@
295 }
296
297 /**
298- dbusmenu_menuitem_new_with_id:
299- @id: ID to use for this menuitem
300-
301- This creates a blank #DbusmenuMenuitem with a specific ID.
302-
303- Return value: A newly allocated #DbusmenuMenuitem.
304-*/
305+ * dbusmenu_menuitem_new_with_id:
306+ * @id: ID to use for this menuitem
307+ *
308+ * This creates a blank #DbusmenuMenuitem with a specific ID.
309+ *
310+ * Return value: A newly allocated #DbusmenuMenuitem.
311+ */
312 DbusmenuMenuitem *
313 dbusmenu_menuitem_new_with_id (gint id)
314 {
315@@ -457,13 +457,13 @@
316 }
317
318 /**
319- dbusmenu_menuitem_get_id:
320- @mi: The #DbusmenuMenuitem to query.
321-
322- Gets the unique ID for @mi.
323-
324- Return value: The ID of the @mi.
325-*/
326+ * dbusmenu_menuitem_get_id:
327+ * @mi: The #DbusmenuMenuitem to query.
328+ *
329+ * Gets the unique ID for @mi.
330+ *
331+ * Return value: The ID of the @mi.
332+ */
333 gint
334 dbusmenu_menuitem_get_id (DbusmenuMenuitem * mi)
335 {
336@@ -480,17 +480,17 @@
337 }
338
339 /**
340- dbusmenu_menuitem_realized:
341- @mi: #DbusmenuMenuitem to check on
342-
343- This function returns whether the menuitem has been realized or
344- not. This is significant mostly in client implementations that
345- can use this additional state to see if the second layers of
346- the implementation have been built yet.
347-
348- Return value: Returns whether or not the menu item has been realized
349- yet or not.
350-*/
351+ * dbusmenu_menuitem_realized:
352+ * @mi: #DbusmenuMenuitem to check on
353+ *
354+ * This function returns whether the menuitem has been realized or
355+ * not. This is significant mostly in client implementations that
356+ * can use this additional state to see if the second layers of
357+ * the implementation have been built yet.
358+ *
359+ * Return value: Returns whether or not the menu item has been realized
360+ * yet or not.
361+ */
362 gboolean
363 dbusmenu_menuitem_realized (DbusmenuMenuitem * mi)
364 {
365@@ -500,12 +500,12 @@
366 }
367
368 /**
369- dbusmenu_menuitem_set_realized:
370- @mi: #DbusmenuMenuitem to realize
371-
372- Sets the internal variable tracking whether it's been realized and
373- signals the DbusmenuMenuitem::realized event.
374-*/
375+ * dbusmenu_menuitem_set_realized:
376+ * @mi: #DbusmenuMenuitem to realize
377+ *
378+ * Sets the internal variable tracking whether it's been realized and
379+ * signals the DbusmenuMenuitem::realized event.
380+ */
381 void
382 dbusmenu_menuitem_set_realized (DbusmenuMenuitem * mi)
383 {
384@@ -520,15 +520,15 @@
385 }
386
387 /**
388- dbusmenu_menuitem_get_children:
389- @mi: The #DbusmenuMenuitem to query.
390-
391- Returns simply the list of children that this menu item
392- has. The list is valid until another child related function
393- is called, where it might be changed.
394-
395- Return value: A #GList of pointers to #DbusmenuMenuitem objects.
396-*/
397+ * dbusmenu_menuitem_get_children:
398+ * @mi: The #DbusmenuMenuitem to query.
399+ *
400+ * Returns simply the list of children that this menu item
401+ * has. The list is valid until another child related function
402+ * is called, where it might be changed.
403+ *
404+ * Return value: (transfer none): A #GList of pointers to #DbusmenuMenuitem objects.
405+ */
406 GList *
407 dbusmenu_menuitem_get_children (DbusmenuMenuitem * mi)
408 {
409@@ -551,18 +551,18 @@
410 }
411
412 /**
413- dbusmenu_menuitem_take_children:
414- @mi: The #DbusmenMenuitem to take the children from.
415-
416- While the name sounds devious that's exactly what this function
417- does. It takes the list of children from the @mi and clears the
418- internal list. The calling function is now in charge of the ref's
419- on the children it has taken. A lot of responsibility involved
420- in taking children.
421-
422- Return value: (transfer full) (array) (element-type Dbusmenu.Menuitem)
423- A #GList of pointers to #DbusmenuMenuitem objects.
424-*/
425+ * dbusmenu_menuitem_take_children:
426+ * @mi: The #DbusmenMenuitem to take the children from.
427+ *
428+ * While the name sounds devious that's exactly what this function
429+ * does. It takes the list of children from the @mi and clears the
430+ * internal list. The calling function is now in charge of the ref's
431+ * on the children it has taken. A lot of responsibility involved
432+ * in taking children.
433+ *
434+ * Return value: (transfer full) (element-type Dbusmenu.Menuitem):
435+ * A #GList of pointers to #DbusmenuMenuitem objects.
436+ */
437 GList *
438 dbusmenu_menuitem_take_children (DbusmenuMenuitem * mi)
439 {
440@@ -579,16 +579,16 @@
441 }
442
443 /**
444- dbusmenu_menuitem_get_position:
445- @mi: The #DbusmenuMenuitem to find the position of
446- @parent: The #DbusmenuMenuitem who's children contain @mi
447-
448- This function returns the position of the menu item @mi
449- in the children of @parent. It will return zero if the
450- menu item can't be found.
451-
452- Return value: The position of @mi in the children of @parent.
453-*/
454+ * dbusmenu_menuitem_get_position:
455+ * @mi: The #DbusmenuMenuitem to find the position of
456+ * @parent: The #DbusmenuMenuitem who's children contain @mi
457+ *
458+ * This function returns the position of the menu item @mi
459+ * in the children of @parent. It will return zero if the
460+ * menu item can't be found.
461+ *
462+ * Return value: The position of @mi in the children of @parent.
463+ */
464 guint
465 dbusmenu_menuitem_get_position (DbusmenuMenuitem * mi, DbusmenuMenuitem * parent)
466 {
467@@ -618,15 +618,15 @@
468 }
469
470 /**
471- dbusmenu_menuitem_get_position_realized:
472- @mi: The #DbusmenuMenuitem to find the position of
473- @parent: The #DbusmenuMenuitem who's children contain @mi
474-
475- This function is very similar to #dbusmenu_menuitem_get_position
476- except that it only counts in the children that have been realized.
477-
478- Return value: The position of @mi in the realized children of @parent.
479-*/
480+ * dbusmenu_menuitem_get_position_realized:
481+ * @mi: The #DbusmenuMenuitem to find the position of
482+ * @parent: The #DbusmenuMenuitem who's children contain @mi
483+ *
484+ * This function is very similar to #dbusmenu_menuitem_get_position
485+ * except that it only counts in the children that have been realized.
486+ *
487+ * Return value: The position of @mi in the realized children of @parent.
488+ */
489 guint
490 dbusmenu_menuitem_get_position_realized (DbusmenuMenuitem * mi, DbusmenuMenuitem * parent)
491 {
492@@ -662,15 +662,15 @@
493 }
494
495 /**
496- dbusmenu_menuitem_child_append:
497- @mi: The #DbusmenuMenuitem which will become a new parent
498- @child: The #DbusmenMenuitem that will be a child
499-
500- This function adds @child to the list of children on @mi at
501- the end of that list.
502-
503- Return value: Whether the child has been added successfully.
504-*/
505+ * dbusmenu_menuitem_child_append:
506+ * @mi: The #DbusmenuMenuitem which will become a new parent
507+ * @child: The #DbusmenMenuitem that will be a child
508+ *
509+ * This function adds @child to the list of children on @mi at
510+ * the end of that list.
511+ *
512+ * Return value: Whether the child has been added successfully.
513+ */
514 gboolean
515 dbusmenu_menuitem_child_append (DbusmenuMenuitem * mi, DbusmenuMenuitem * child)
516 {
517@@ -694,15 +694,15 @@
518 }
519
520 /**
521- dbusmenu_menuitem_child_prepend:
522- @mi: The #DbusmenuMenuitem which will become a new parent
523- @child: The #DbusmenMenuitem that will be a child
524-
525- This function adds @child to the list of children on @mi at
526- the beginning of that list.
527-
528- Return value: Whether the child has been added successfully.
529-*/
530+ * dbusmenu_menuitem_child_prepend:
531+ * @mi: The #DbusmenuMenuitem which will become a new parent
532+ * @child: The #DbusmenMenuitem that will be a child
533+ *
534+ * This function adds @child to the list of children on @mi at
535+ * the beginning of that list.
536+ *
537+ * Return value: Whether the child has been added successfully.
538+ */
539 gboolean
540 dbusmenu_menuitem_child_prepend (DbusmenuMenuitem * mi, DbusmenuMenuitem * child)
541 {
542@@ -726,16 +726,16 @@
543 }
544
545 /**
546- dbusmenu_menuitem_child_delete:
547- @mi: The #DbusmenuMenuitem which has @child as a child
548- @child: The child #DbusmenuMenuitem that you want to no longer
549- be a child of @mi.
550-
551- This function removes @child from the children list of @mi. It does
552- not call #g_object_unref on @child.
553-
554- Return value: If we were able to delete @child.
555-*/
556+ * dbusmenu_menuitem_child_delete:
557+ * @mi: The #DbusmenuMenuitem which has @child as a child
558+ * @child: The child #DbusmenuMenuitem that you want to no longer
559+ * be a child of @mi.
560+ *
561+ * This function removes @child from the children list of @mi. It does
562+ * not call #g_object_unref on @child.
563+ *
564+ * Return value: If we were able to delete @child.
565+ */
566 gboolean
567 dbusmenu_menuitem_child_delete (DbusmenuMenuitem * mi, DbusmenuMenuitem * child)
568 {
569@@ -758,17 +758,17 @@
570 }
571
572 /**
573- dbusmenu_menuitem_child_add_position:
574- @mi: The #DbusmenuMenuitem that we're adding the child @child to.
575- @child: The #DbusmenuMenuitem to make a child of @mi.
576- @position: Where in @mi object's list of chidren @child should be placed.
577-
578- Puts @child in the list of children for @mi at the location
579- specified in @position. If there is not enough entires available
580- then @child will be placed at the end of the list.
581-
582- Return value: Whether @child was added successfully.
583-*/
584+ * dbusmenu_menuitem_child_add_position:
585+ * @mi: The #DbusmenuMenuitem that we're adding the child @child to.
586+ * @child: The #DbusmenuMenuitem to make a child of @mi.
587+ * @position: Where in @mi object's list of chidren @child should be placed.
588+ *
589+ * Puts @child in the list of children for @mi at the location
590+ * specified in @position. If there is not enough entires available
591+ * then @child will be placed at the end of the list.
592+ *
593+ * Return value: Whether @child was added successfully.
594+ */
595 gboolean
596 dbusmenu_menuitem_child_add_position (DbusmenuMenuitem * mi, DbusmenuMenuitem * child, guint position)
597 {
598@@ -792,17 +792,17 @@
599 }
600
601 /**
602- dbusmenu_menuitem_child_reorder:
603- @base: The #DbusmenuMenuitem that has children needing realignment
604- @child: The #DbusmenuMenuitem that is a child needing to be moved
605- @position: The position in the list to place it in
606-
607- This function moves a child on the list of children. It is
608- for a child that is already in the list, but simply needs a
609- new location.
610-
611- Return value: Whether the move was successful.
612-*/
613+ * dbusmenu_menuitem_child_reorder:
614+ * @mi: The #DbusmenuMenuitem that has children needing realignment
615+ * @child: The #DbusmenuMenuitem that is a child needing to be moved
616+ * @position: The position in the list to place it in
617+ *
618+ * This function moves a child on the list of children. It is
619+ * for a child that is already in the list, but simply needs a
620+ * new location.
621+ *
622+ * Return value: Whether the move was successful.
623+ */
624 gboolean
625 dbusmenu_menuitem_child_reorder(DbusmenuMenuitem * mi, DbusmenuMenuitem * child, guint position)
626 {
627@@ -832,16 +832,16 @@
628 }
629
630 /**
631- dbusmenu_menuitem_child_find:
632- @mi: The #DbusmenuMenuitem who's children to look on
633- @id: The ID of the child that we're looking for.
634-
635- Search the children of @mi to find one with the ID of @id.
636- If it doesn't exist then we return #NULL.
637-
638- Return value: The menu item with the ID @id or #NULL if it
639- can't be found.
640-*/
641+ * dbusmenu_menuitem_child_find:
642+ * @mi: The #DbusmenuMenuitem who's children to look on
643+ * @id: The ID of the child that we're looking for.
644+ *
645+ * Search the children of @mi to find one with the ID of @id.
646+ * If it doesn't exist then we return #NULL.
647+ *
648+ * Return value: (transfer none): The menu item with the ID @id or #NULL if it
649+ * can't be found.
650+ */
651 DbusmenuMenuitem *
652 dbusmenu_menuitem_child_find (DbusmenuMenuitem * mi, gint id)
653 {
654@@ -885,18 +885,18 @@
655 }
656
657 /**
658- dbusmenu_menuitem_find_id:
659- @mi: #DbusmenuMenuitem at the top of the tree to search
660- @id: ID of the #DbusmenuMenuitem to search for
661-
662- This function searchs the whole tree of children that
663- are attached to @mi. This could be quite a few nodes, all
664- the way down the tree. It is a depth first search.
665-
666- Return value: The #DbusmenuMenuitem with the ID of @id
667- or #NULL if there isn't such a menu item in the tree
668- represented by @mi.
669-*/
670+ * dbusmenu_menuitem_find_id:
671+ * @mi: #DbusmenuMenuitem at the top of the tree to search
672+ * @id: ID of the #DbusmenuMenuitem to search for
673+ *
674+ * This function searchs the whole tree of children that
675+ * are attached to @mi. This could be quite a few nodes, all
676+ * the way down the tree. It is a depth first search.
677+ *
678+ * Return value: (transfer none): The #DbusmenuMenuitem with the ID of @id
679+ * or #NULL if there isn't such a menu item in the tree
680+ * represented by @mi.
681+ */
682 DbusmenuMenuitem *
683 dbusmenu_menuitem_find_id (DbusmenuMenuitem * mi, gint id)
684 {
685@@ -913,20 +913,20 @@
686 }
687
688 /**
689- dbusmenu_menuitem_property_set:
690- @mi: The #DbusmenuMenuitem to set the property on.
691- @property: Name of the property to set.
692- @value: The value of the property.
693-
694- Takes the pair of @property and @value and places them as a
695- property on @mi. If a property already exists by that name,
696- then the value is set to the new value. If not, the property
697- is added. If the value is changed or the property was previously
698- unset then the signal #DbusmenuMenuitem::prop-changed will be
699- emitted by this function.
700-
701- Return value: A boolean representing if the property value was set.
702-*/
703+ * dbusmenu_menuitem_property_set:
704+ * @mi: The #DbusmenuMenuitem to set the property on.
705+ * @property: Name of the property to set.
706+ * @value: The value of the property.
707+ *
708+ * Takes the pair of @property and @value and places them as a
709+ * property on @mi. If a property already exists by that name,
710+ * then the value is set to the new value. If not, the property
711+ * is added. If the value is changed or the property was previously
712+ * unset then the signal #DbusmenuMenuitem::prop-changed will be
713+ * emitted by this function.
714+ *
715+ * Return value: A boolean representing if the property value was set.
716+ */
717 gboolean
718 dbusmenu_menuitem_property_set (DbusmenuMenuitem * mi, const gchar * property, const gchar * value)
719 {
720@@ -938,20 +938,20 @@
721 }
722
723 /**
724- dbusmenu_menuitem_property_set_bool:
725- @mi: The #DbusmenuMenuitem to set the property on.
726- @property: Name of the property to set.
727- @value: The value of the property.
728-
729- Takes a boolean @value and sets it on @property as a
730- property on @mi. If a property already exists by that name,
731- then the value is set to the new value. If not, the property
732- is added. If the value is changed or the property was previously
733- unset then the signal #DbusmenuMenuitem::prop-changed will be
734- emitted by this function.
735-
736- Return value: A boolean representing if the property value was set.
737-*/
738+ * dbusmenu_menuitem_property_set_bool:
739+ * @mi: The #DbusmenuMenuitem to set the property on.
740+ * @property: Name of the property to set.
741+ * @value: The value of the property.
742+ *
743+ * Takes a boolean @value and sets it on @property as a
744+ * property on @mi. If a property already exists by that name,
745+ * then the value is set to the new value. If not, the property
746+ * is added. If the value is changed or the property was previously
747+ * unset then the signal #DbusmenuMenuitem::prop-changed will be
748+ * emitted by this function.
749+ *
750+ * Return value: A boolean representing if the property value was set.
751+ */
752 gboolean
753 dbusmenu_menuitem_property_set_bool (DbusmenuMenuitem * mi, const gchar * property, const gboolean value)
754 {
755@@ -960,20 +960,20 @@
756 }
757
758 /**
759- dbusmenu_menuitem_property_set_int:
760- @mi: The #DbusmenuMenuitem to set the property on.
761- @property: Name of the property to set.
762- @value: The value of the property.
763-
764- Takes a boolean @value and sets it on @property as a
765- property on @mi. If a property already exists by that name,
766- then the value is set to the new value. If not, the property
767- is added. If the value is changed or the property was previously
768- unset then the signal #DbusmenuMenuitem::prop-changed will be
769- emitted by this function.
770-
771- Return value: A boolean representing if the property value was set.
772-*/
773+ * dbusmenu_menuitem_property_set_int:
774+ * @mi: The #DbusmenuMenuitem to set the property on.
775+ * @property: Name of the property to set.
776+ * @value: The value of the property.
777+ *
778+ * Takes a boolean @value and sets it on @property as a
779+ * property on @mi. If a property already exists by that name,
780+ * then the value is set to the new value. If not, the property
781+ * is added. If the value is changed or the property was previously
782+ * unset then the signal #DbusmenuMenuitem::prop-changed will be
783+ * emitted by this function.
784+ *
785+ * Return value: A boolean representing if the property value was set.
786+ */
787 gboolean
788 dbusmenu_menuitem_property_set_int (DbusmenuMenuitem * mi, const gchar * property, const gint value)
789 {
790@@ -982,20 +982,20 @@
791 }
792
793 /**
794- dbusmenu_menuitem_property_set_variant:
795- @mi: The #DbusmenuMenuitem to set the property on.
796- @property: Name of the property to set.
797- @value: The value of the property.
798-
799- Takes the pair of @property and @value and places them as a
800- property on @mi. If a property already exists by that name,
801- then the value is set to the new value. If not, the property
802- is added. If the value is changed or the property was previously
803- unset then the signal #DbusmenuMenuitem::prop-changed will be
804- emitted by this function.
805-
806- Return value: A boolean representing if the property value was set.
807-*/
808+ * dbusmenu_menuitem_property_set_variant:
809+ * @mi: The #DbusmenuMenuitem to set the property on.
810+ * @property: Name of the property to set.
811+ * @value: The value of the property.
812+ *
813+ * Takes the pair of @property and @value and places them as a
814+ * property on @mi. If a property already exists by that name,
815+ * then the value is set to the new value. If not, the property
816+ * is added. If the value is changed or the property was previously
817+ * unset then the signal #DbusmenuMenuitem::prop-changed will be
818+ * emitted by this function.
819+ *
820+ * Return value: A boolean representing if the property value was set.
821+ */
822 gboolean
823 dbusmenu_menuitem_property_set_variant (DbusmenuMenuitem * mi, const gchar * property, GVariant * value)
824 {
825@@ -1034,18 +1034,18 @@
826 }
827
828 /**
829- dbusmenu_menuitem_property_get:
830- @mi: The #DbusmenuMenuitem to look for the property on.
831- @property: The property to grab.
832-
833- Look up a property on @mi and return the value of it if
834- it exits. #NULL will be returned if the property doesn't
835- exist.
836-
837- Return value: A string with the value of the property
838- that shouldn't be free'd. Or #NULL if the property
839- is not set or is not a string.
840-*/
841+ * dbusmenu_menuitem_property_get:
842+ * @mi: The #DbusmenuMenuitem to look for the property on.
843+ * @property: The property to grab.
844+ *
845+ * Look up a property on @mi and return the value of it if
846+ * it exits. #NULL will be returned if the property doesn't
847+ * exist.
848+ *
849+ * Return value: (transfer none): A string with the value of the property
850+ * that shouldn't be free'd. Or #NULL if the property
851+ * is not set or is not a string.
852+ */
853 const gchar *
854 dbusmenu_menuitem_property_get (DbusmenuMenuitem * mi, const gchar * property)
855 {
856@@ -1056,16 +1056,16 @@
857 }
858
859 /**
860- dbusmenu_menuitem_property_get_variant:
861- @mi: The #DbusmenuMenuitem to look for the property on.
862- @property: The property to grab.
863-
864- Look up a property on @mi and return the value of it if
865- it exits. #NULL will be returned if the property doesn't
866- exist.
867-
868- Return value: A GVariant for the property.
869-*/
870+ * dbusmenu_menuitem_property_get_variant:
871+ * @mi: The #DbusmenuMenuitem to look for the property on.
872+ * @property: The property to grab.
873+ *
874+ * Look up a property on @mi and return the value of it if
875+ * it exits. #NULL will be returned if the property doesn't
876+ * exist.
877+ *
878+ * Return value: (transfer none): A GVariant for the property.
879+ */
880 GVariant *
881 dbusmenu_menuitem_property_get_variant (DbusmenuMenuitem * mi, const gchar * property)
882 {
883@@ -1078,15 +1078,15 @@
884 }
885
886 /**
887- dbusmenu_menuitem_property_get_bool:
888- @mi: The #DbusmenuMenuitem to look for the property on.
889- @property: The property to grab.
890-
891- Look up a property on @mi and return the value of it if
892- it exits. Returns #FALSE if the property doesn't exist.
893-
894- Return value: The value of the property or #FALSE.
895-*/
896+ * dbusmenu_menuitem_property_get_bool:
897+ * @mi: The #DbusmenuMenuitem to look for the property on.
898+ * @property: The property to grab.
899+ *
900+ * Look up a property on @mi and return the value of it if
901+ * it exits. Returns #FALSE if the property doesn't exist.
902+ *
903+ * Return value: The value of the property or #FALSE.
904+ */
905 gboolean
906 dbusmenu_menuitem_property_get_bool (DbusmenuMenuitem * mi, const gchar * property)
907 {
908@@ -1112,15 +1112,15 @@
909 }
910
911 /**
912- dbusmenu_menuitem_property_get_int:
913- @mi: The #DbusmenuMenuitem to look for the property on.
914- @property: The property to grab.
915-
916- Look up a property on @mi and return the value of it if
917- it exits. Returns zero if the property doesn't exist.
918-
919- Return value: The value of the property or zero.
920-*/
921+ * dbusmenu_menuitem_property_get_int:
922+ * @mi: The #DbusmenuMenuitem to look for the property on.
923+ * @property: The property to grab.
924+ *
925+ * Look up a property on @mi and return the value of it if
926+ * it exits. Returns zero if the property doesn't exist.
927+ *
928+ * Return value: The value of the property or zero.
929+ */
930 gint
931 dbusmenu_menuitem_property_get_int (DbusmenuMenuitem * mi, const gchar * property)
932 {
933@@ -1142,15 +1142,15 @@
934
935
936 /**
937- dbusmenu_menuitem_property_exit:
938- @mi: The #DbusmenuMenuitem to look for the property on.
939- @property: The property to look for.
940-
941- Checkes to see if a particular property exists on @mi and
942- returns #TRUE if so.
943-
944- Return value: A boolean checking to see if the property is available
945-*/
946+ * dbusmenu_menuitem_property_exit:
947+ * @mi: The #DbusmenuMenuitem to look for the property on.
948+ * @property: The property to look for.
949+ *
950+ * Checkes to see if a particular property exists on @mi and
951+ * returns #TRUE if so.
952+ *
953+ * Return value: A boolean checking to see if the property is available
954+ */
955 gboolean
956 dbusmenu_menuitem_property_exist (DbusmenuMenuitem * mi, const gchar * property)
957 {
958@@ -1165,12 +1165,12 @@
959 }
960
961 /**
962- dbusmenu_menuitem_property_remove:
963- @mi: The #DbusmenuMenuitem to remove the property on.
964- @property: The property to look for.
965-
966- Removes a property from the menuitem.
967-*/
968+ * dbusmenu_menuitem_property_remove:
969+ * @mi: The #DbusmenuMenuitem to remove the property on.
970+ * @property: The property to look for.
971+ *
972+ * Removes a property from the menuitem.
973+ */
974 void
975 dbusmenu_menuitem_property_remove (DbusmenuMenuitem * mi, const gchar * property)
976 {
977@@ -1185,15 +1185,16 @@
978 }
979
980 /**
981- dbusmenu_menuitem_properties_list:
982- @mi: #DbusmenuMenuitem to list the properties on
983-
984- This functiong gets a list of the names of all the properties
985- that are set on this menu item. This data on the list is owned
986- by the menuitem but the list is not and should be freed using
987- g_list_free() when the calling function is done with it.
988-
989- Return value: A list of strings or NULL if there are none.
990+ * dbusmenu_menuitem_properties_list:
991+ * @mi: #DbusmenuMenuitem to list the properties on
992+ *
993+ * This functiong gets a list of the names of all the properties
994+ * that are set on this menu item. This data on the list is owned
995+ * by the menuitem but the list is not and should be freed using
996+ * g_list_free() when the calling function is done with it.
997+ *
998+ * Return value: (transfer container): A list of strings or NULL if there are
999+ * none.
1000 */
1001 GList *
1002 dbusmenu_menuitem_properties_list (DbusmenuMenuitem * mi)
1003@@ -1219,18 +1220,18 @@
1004 }
1005
1006 /**
1007- dbusmenu_menuitem_properties_copy:
1008- @mi: #DbusmenuMenuitem that we're interested in the properties of
1009-
1010- This function takes the properties of a #DbusmenuMenuitem
1011- and puts them into a #GHashTable that is referenced by the
1012- key of a string and has the value of a string. The hash
1013- table may not have any entries if there aren't any or there
1014- is an error in processing. It is the caller's responsibility
1015- to destroy the created #GHashTable.
1016-
1017- Return value: A brand new #GHashTable that contains all of the
1018- properties that are on this #DbusmenuMenuitem @mi.
1019+ * dbusmenu_menuitem_properties_copy:
1020+ * @mi: #DbusmenuMenuitem that we're interested in the properties of
1021+ *
1022+ * This function takes the properties of a #DbusmenuMenuitem
1023+ * and puts them into a #GHashTable that is referenced by the
1024+ * key of a string and has the value of a string. The hash
1025+ * table may not have any entries if there aren't any or there
1026+ * is an error in processing. It is the caller's responsibility
1027+ * to destroy the created #GHashTable.
1028+ *
1029+ * Return value: (transfer full): A brand new #GHashTable that contains all of
1030+ * theroperties that are on this #DbusmenuMenuitem @mi.
1031 */
1032 GHashTable *
1033 dbusmenu_menuitem_properties_copy (DbusmenuMenuitem * mi)
1034@@ -1257,14 +1258,14 @@
1035 }
1036
1037 /**
1038- dbusmenu_menuitem_properties_variant:
1039- @mi: #DbusmenuMenuitem to get properties from
1040-
1041- Grabs the properties of the menuitem as a GVariant with the
1042- type "a{sv}".
1043-
1044- Return Value: A GVariant of type "a{sv}" or NULL on error.
1045-*/
1046+ * dbusmenu_menuitem_properties_variant:
1047+ * @mi: #DbusmenuMenuitem to get properties from
1048+ *
1049+ * Grabs the properties of the menuitem as a GVariant with the
1050+ * type "a{sv}".
1051+ *
1052+ * Return Value: (transfer full): A GVariant of type "a{sv}" or NULL on error.
1053+ */
1054 GVariant *
1055 dbusmenu_menuitem_properties_variant (DbusmenuMenuitem * mi, const gchar ** properties)
1056 {
1057@@ -1287,15 +1288,15 @@
1058 }
1059
1060 /**
1061- dbusmenu_menuitem_set_root:
1062- @mi: #DbusmenuMenuitem to set whether it's root
1063- @root: Whether @mi is a root node or not
1064-
1065- This function sets the internal value of whether this is a
1066- root node or not.
1067-
1068- Return value: None
1069-*/
1070+ * dbusmenu_menuitem_set_root:
1071+ * @mi: #DbusmenuMenuitem to set whether it's root
1072+ * @root: Whether @mi is a root node or not
1073+ *
1074+ * This function sets the internal value of whether this is a
1075+ * root node or not.
1076+ *
1077+ * Return value: None
1078+ */
1079 void
1080 dbusmenu_menuitem_set_root (DbusmenuMenuitem * mi, gboolean root)
1081 {
1082@@ -1306,14 +1307,14 @@
1083 }
1084
1085 /**
1086- dbusmenu_menuitem_get_root:
1087- @mi: #DbusmenuMenuitem to see whether it's root
1088-
1089- This function returns the internal value of whether this is a
1090- root node or not.
1091-
1092- Return value: #TRUE if this is a root node
1093-*/
1094+ * dbusmenu_menuitem_get_root:
1095+ * @mi: #DbusmenuMenuitem to see whether it's root
1096+ *
1097+ * This function returns the internal value of whether this is a
1098+ * root node or not.
1099+ *
1100+ * Return value: #TRUE if this is a root node
1101+ */
1102 gboolean
1103 dbusmenu_menuitem_get_root (DbusmenuMenuitem * mi)
1104 {
1105@@ -1324,15 +1325,17 @@
1106
1107
1108 /**
1109- dbusmenu_menuitem_buildvariant:
1110- @mi: #DbusmenuMenuitem to represent in XML
1111- @array: (element-type utf8): A list of string that will be turned into an XML file
1112-
1113- This function will add strings to the array @array. It will put
1114- at least one entry if this menu item has no children. If it has
1115- children it will put two for this entry, one representing the
1116- start tag and one that is a closing tag. It will allow it's
1117- children to place their own tags in the array in between those two.
1118+ * dbusmenu_menuitem_buildvariant:
1119+ * @mi: #DbusmenuMenuitem to represent in a variant
1120+ * @properties: (element-type utf8): A list of string that will be put into
1121+ * a variant
1122+ *
1123+ * This function will put at least one entry if this menu item has no children.
1124+ * If it has children it will put two for this entry, one representing the
1125+ * start tag and one that is a closing tag. It will allow it's
1126+ * children to place their own tags in the array in between those two.
1127+ *
1128+ * Return value: (transfer full): Variant representing @properties
1129 */
1130 GVariant *
1131 dbusmenu_menuitem_build_variant (DbusmenuMenuitem * mi, const gchar ** properties, gint recurse)
1132@@ -1393,15 +1396,15 @@
1133 }
1134
1135 /**
1136- dbusmenu_menuitem_foreach:
1137- @mi: The #DbusmenItem to start from
1138- @func: Function to call on every node in the tree
1139- @data: (closure): User data to pass to the function
1140-
1141- This calls the function @func on this menu item and all
1142- of the children of this item. And their children. And
1143- their children. And... you get the point. It will get
1144- called on the whole tree.
1145+ * dbusmenu_menuitem_foreach:
1146+ * @mi: The #DbusmenItem to start from
1147+ * @func: Function to call on every node in the tree
1148+ * @data: (closure): User data to pass to the function
1149+ *
1150+ * This calls the function @func on this menu item and all
1151+ * of the children of this item. And their children. And
1152+ * their children. And... you get the point. It will get
1153+ * called on the whole tree.
1154 */
1155 void
1156 dbusmenu_menuitem_foreach (DbusmenuMenuitem * mi, void (*func) (DbusmenuMenuitem * mi, gpointer data), gpointer data)
1157@@ -1417,23 +1420,23 @@
1158 }
1159
1160 /**
1161- dbusmenu_menuitem_handle_event:
1162- @mi: The #DbusmenuMenuitem to send the signal on.
1163- @name: The name of the signal
1164- @variant: A value that could be set for the event
1165- @timestamp: The timestamp of when the event happened
1166-
1167- This function is called to create an event. It is likely
1168- to be overrided by subclasses. The default menu item
1169- will respond to the activate signal and do:
1170-
1171- Emits the #DbusmenuMenuitem::item-activate signal on this
1172- menu item. Called by server objects when they get the
1173- appropriate DBus signals from the client.
1174-
1175- If you subclass this function you should really think
1176- about calling the parent function unless you have a good
1177- reason not to.
1178+ * dbusmenu_menuitem_handle_event:
1179+ * @mi: The #DbusmenuMenuitem to send the signal on.
1180+ * @name: The name of the signal
1181+ * @variant: A value that could be set for the event
1182+ * @timestamp: The timestamp of when the event happened
1183+ *
1184+ * This function is called to create an event. It is likely
1185+ * to be overrided by subclasses. The default menu item
1186+ * will respond to the activate signal and do:
1187+ *
1188+ * Emits the #DbusmenuMenuitem::item-activate signal on this
1189+ * menu item. Called by server objects when they get the
1190+ * appropriate DBus signals from the client.
1191+ *
1192+ * If you subclass this function you should really think
1193+ * about calling the parent function unless you have a good
1194+ * reason not to.
1195 */
1196 void
1197 dbusmenu_menuitem_handle_event (DbusmenuMenuitem * mi, const gchar * name, GVariant * variant, guint timestamp)
1198@@ -1451,16 +1454,16 @@
1199 }
1200
1201 /**
1202- dbusmenu_menuitem_send_about_to_show:
1203- @mi: The #DbusmenuMenuitem to send the signal on.
1204- @cb: Callback to call when the call has returned.
1205- @cb_data: (closure): Data to pass to the callback.
1206-
1207- This function is used to send the even that the submenu
1208- of this item is about to be shown. Callers to this event
1209- should delay showing the menu until their callback is
1210- called if possible.
1211-*/
1212+ * dbusmenu_menuitem_send_about_to_show:
1213+ * @mi: The #DbusmenuMenuitem to send the signal on.
1214+ * @cb: Callback to call when the call has returned.
1215+ * @cb_data: (closure): Data to pass to the callback.
1216+ *
1217+ * This function is used to send the even that the submenu
1218+ * of this item is about to be shown. Callers to this event
1219+ * should delay showing the menu until their callback is
1220+ * called if possible.
1221+ */
1222 void
1223 dbusmenu_menuitem_send_about_to_show (DbusmenuMenuitem * mi, void (*cb) (DbusmenuMenuitem * mi, gpointer user_data), gpointer cb_data)
1224 {
1225@@ -1480,14 +1483,14 @@
1226 }
1227
1228 /**
1229- dbusmenu_menuitem_show_to_user:
1230- @mi: #DbusmenuMenuitem to show
1231- @timestamp: The time that the user requested it to be shown
1232-
1233- Signals that this menu item should be shown to the user. If this is
1234- server side the server will then take it and send it over the
1235- bus.
1236-*/
1237+ * dbusmenu_menuitem_show_to_user:
1238+ * @mi: #DbusmenuMenuitem to show
1239+ * @timestamp: The time that the user requested it to be shown
1240+ *
1241+ * Signals that this menu item should be shown to the user. If this is
1242+ * server side the server will then take it and send it over the
1243+ * bus.
1244+ */
1245 void
1246 dbusmenu_menuitem_show_to_user (DbusmenuMenuitem * mi, guint timestamp)
1247 {
1248
1249=== modified file 'libdbusmenu-glib/menuitem.h'
1250--- libdbusmenu-glib/menuitem.h 2011-02-14 20:43:27 +0000
1251+++ libdbusmenu-glib/menuitem.h 2011-02-21 13:11:23 +0000
1252@@ -157,7 +157,7 @@
1253
1254 /* Virtual functions */
1255 dbusmenu_menuitem_buildvariant_slot_t buildvariant;
1256- void (*handle_event) (DbusmenuMenuitem * mi, const gchar * name, GVariant * value, guint timestamp);
1257+ void (*handle_event) (DbusmenuMenuitem * mi, const gchar * name, GVariant * variant, guint timestamp);
1258 void (*send_about_to_show) (DbusmenuMenuitem * mi, void (*cb) (DbusmenuMenuitem * mi, gpointer user_data), gpointer cb_data);
1259
1260 void (*show_to_user) (DbusmenuMenuitem * mi, guint timestamp, gpointer cb_data);
1261@@ -208,7 +208,7 @@
1262 gboolean dbusmenu_menuitem_get_root (DbusmenuMenuitem * mi);
1263
1264 void dbusmenu_menuitem_foreach (DbusmenuMenuitem * mi, void (*func) (DbusmenuMenuitem * mi, gpointer data), gpointer data);
1265-void dbusmenu_menuitem_handle_event (DbusmenuMenuitem * mi, const gchar * name, GVariant * value, guint timestamp);
1266+void dbusmenu_menuitem_handle_event (DbusmenuMenuitem * mi, const gchar * name, GVariant * variant, guint timestamp);
1267 void dbusmenu_menuitem_send_about_to_show (DbusmenuMenuitem * mi, void (*cb) (DbusmenuMenuitem * mi, gpointer user_data), gpointer cb_data);
1268
1269 void dbusmenu_menuitem_show_to_user (DbusmenuMenuitem * mi, guint timestamp);
1270
1271=== modified file 'libdbusmenu-gtk/Makefile.am'
1272--- libdbusmenu-gtk/Makefile.am 2011-02-09 17:45:41 +0000
1273+++ libdbusmenu-gtk/Makefile.am 2011-02-21 13:11:23 +0000
1274@@ -78,21 +78,21 @@
1275 INTROSPECTION_SCANNER_ARGS = --add-include-path=$(srcdir) \
1276 --warn-all \
1277 --add-include-path=$(top_builddir)/libdbusmenu-glib \
1278- $(addprefix --c-include=libdbusmenu-gtk/, $(introspection_sources)) \
1279+ $(addprefix --c-include=libdbusmenu-gtk/, $(libdbusmenu_gtkinclude_HEADERS)) \
1280 --symbol-prefix=dbusmenu \
1281 --identifier-prefix=DbusmenuGtk
1282 else
1283 INTROSPECTION_SCANNER_ARGS = --add-include-path=$(srcdir) \
1284 --warn-all \
1285 --add-include-path=$(top_builddir)/libdbusmenu-glib \
1286- $(addprefix --c-include=libdbusmenu-gtk/, $(introspection_sources))
1287+ $(addprefix --c-include=libdbusmenu-gtk/, $(libdbusmenu_gtkinclude_HEADERS))
1288 endif
1289
1290 INTROSPECTION_COMPILER_ARGS = --includedir=$(builddir) --includedir=$(top_builddir)/libdbusmenu-glib
1291
1292 if HAVE_INTROSPECTION
1293
1294-introspection_sources = $(libdbusmenu_gtkinclude_HEADERS)
1295+introspection_sources = $(filter-out genericmenuitem.%, $(libdbusmenu_gtkinclude_HEADERS) $(libdbusmenu_gtk_la_SOURCES))
1296
1297 DbusmenuGtk$(VER)-0.4.gir: libdbusmenu-gtk$(VER).la
1298 DbusmenuGtk_0_4_gir_INCLUDES = \
1299
1300=== modified file 'libdbusmenu-gtk/client.c'
1301--- libdbusmenu-gtk/client.c 2011-01-27 19:49:40 +0000
1302+++ libdbusmenu-gtk/client.c 2011-02-21 13:11:23 +0000
1303@@ -219,13 +219,13 @@
1304
1305
1306 /**
1307- dbusmenu_gtkclient_set_accel_group:
1308- @client: To set the group on
1309- @agroup: The new acceleration group
1310-
1311- Sets the acceleration group for the menu items with accelerators
1312- on this client.
1313-*/
1314+ * dbusmenu_gtkclient_set_accel_group:
1315+ * @client: To set the group on
1316+ * @agroup: The new acceleration group
1317+ *
1318+ * Sets the acceleration group for the menu items with accelerators
1319+ * on this client.
1320+ */
1321 void
1322 dbusmenu_gtkclient_set_accel_group (DbusmenuGtkClient * client, GtkAccelGroup * agroup)
1323 {
1324@@ -256,14 +256,14 @@
1325 }
1326
1327 /**
1328- dbusmenu_gtkclient_get_accel_group:
1329- @client: Client to query for an accelerator group
1330-
1331- Gets the accel group for this client.
1332-
1333- Return value: Either a valid group or #NULL on error or
1334- none set.
1335-*/
1336+ * dbusmenu_gtkclient_get_accel_group:
1337+ * @client: Client to query for an accelerator group
1338+ *
1339+ * Gets the accel group for this client.
1340+ *
1341+ * Return value: (transfer none): Either a valid group or #NULL on error or
1342+ * none set.
1343+ */
1344 GtkAccelGroup *
1345 dbusmenu_gtkclient_get_accel_group (DbusmenuGtkClient * client)
1346 {
1347@@ -493,21 +493,21 @@
1348 #endif
1349
1350 /**
1351- dbusmenu_gtkclient_newitem_base:
1352- @client: The client handling everything on this connection
1353- @item: The #DbusmenuMenuitem to attach the GTK-isms to
1354- @gmi: A #GtkMenuItem representing the GTK world's view of this menuitem
1355- @parent: The parent #DbusmenuMenuitem
1356-
1357- This function provides some of the basic connectivity for being in
1358- the GTK world. Things like visibility and sensitivity of the item are
1359- handled here so that the subclasses don't have to. If you're building
1360- your on GTK menu item you can use this function to apply those basic
1361- attributes so that you don't have to deal with them either.
1362-
1363- This also handles passing the "activate" signal back to the
1364- #DbusmenuMenuitem side of thing.
1365-*/
1366+ * dbusmenu_gtkclient_newitem_base:
1367+ * @client: The client handling everything on this connection
1368+ * @item: The #DbusmenuMenuitem to attach the GTK-isms to
1369+ * @gmi: A #GtkMenuItem representing the GTK world's view of this menuitem
1370+ * @parent: The parent #DbusmenuMenuitem
1371+ *
1372+ * This function provides some of the basic connectivity for being in
1373+ * the GTK world. Things like visibility and sensitivity of the item are
1374+ * handled here so that the subclasses don't have to. If you're building
1375+ * your on GTK menu item you can use this function to apply those basic
1376+ * attributes so that you don't have to deal with them either.
1377+ *
1378+ * This also handles passing the "activate" signal back to the
1379+ * #DbusmenuMenuitem side of thing.
1380+ */
1381 void
1382 dbusmenu_gtkclient_newitem_base (DbusmenuGtkClient * client, DbusmenuMenuitem * item, GtkMenuItem * gmi, DbusmenuMenuitem * parent)
1383 {
1384@@ -617,15 +617,15 @@
1385 /* Public API */
1386
1387 /**
1388- dbusmenu_gtkclient_new:
1389- @dbus_name: Name of the #DbusmenuServer on DBus
1390- @dbus_name: Name of the object on the #DbusmenuServer
1391-
1392- Creates a new #DbusmenuGtkClient object and creates a #DbusmenuClient
1393- that connects across DBus to a #DbusmenuServer.
1394-
1395- Return value: A new #DbusmenuGtkClient sync'd with a server
1396-*/
1397+ * dbusmenu_gtkclient_new:
1398+ * @dbus_name: Name of the #DbusmenuServer on DBus
1399+ * @dbus_name: Name of the object on the #DbusmenuServer
1400+ *
1401+ * Creates a new #DbusmenuGtkClient object and creates a #DbusmenuClient
1402+ * that connects across DBus to a #DbusmenuServer.
1403+ *
1404+ * Return value: A new #DbusmenuGtkClient sync'd with a server
1405+ */
1406 DbusmenuGtkClient *
1407 dbusmenu_gtkclient_new (gchar * dbus_name, gchar * dbus_object)
1408 {
1409@@ -636,15 +636,15 @@
1410 }
1411
1412 /**
1413- dbusmenu_gtkclient_menuitem_get:
1414- @client: A #DbusmenuGtkClient with the item in it.
1415- @item: #DbusmenuMenuitem to get associated #GtkMenuItem on.
1416-
1417- This grabs the #GtkMenuItem that is associated with the
1418- #DbusmenuMenuitem.
1419-
1420- Return value: The #GtkMenuItem that can be played with.
1421-*/
1422+ * dbusmenu_gtkclient_menuitem_get:
1423+ * @client: A #DbusmenuGtkClient with the item in it.
1424+ * @item: #DbusmenuMenuitem to get associated #GtkMenuItem on.
1425+ *
1426+ * This grabs the #GtkMenuItem that is associated with the
1427+ * #DbusmenuMenuitem.
1428+ *
1429+ * Return value: (transfer none): The #GtkMenuItem that can be played with.
1430+ */
1431 GtkMenuItem *
1432 dbusmenu_gtkclient_menuitem_get (DbusmenuGtkClient * client, DbusmenuMenuitem * item)
1433 {
1434@@ -660,13 +660,13 @@
1435 }
1436
1437 /**
1438- dbusmenu_gtkclient_menuitem_get_submenu:
1439- @client: A #DbusmenuGtkClient with the item in it.
1440- @item: #DbusmenuMenuitem to get associated #GtkMenu on.
1441-
1442- This grabs the submenu associated with the menuitem.
1443-
1444- Return value: The #GtkMenu if there is one.
1445+ * dbusmenu_gtkclient_menuitem_get_submenu:
1446+ * @client: A #DbusmenuGtkClient with the item in it.
1447+ * @item: #DbusmenuMenuitem to get associated #GtkMenu on.
1448+ *
1449+ * This grabs the submenu associated with the menuitem.
1450+ *
1451+ * Return value: (transfer none): The #GtkMenu if there is one.
1452 */
1453 GtkMenu *
1454 dbusmenu_gtkclient_menuitem_get_submenu (DbusmenuGtkClient * client, DbusmenuMenuitem * item)
1455
1456=== modified file 'libdbusmenu-gtk/genericmenuitem.c'
1457--- libdbusmenu-gtk/genericmenuitem.c 2010-12-09 22:50:02 +0000
1458+++ libdbusmenu-gtk/genericmenuitem.c 2011-02-21 13:11:23 +0000
1459@@ -278,12 +278,12 @@
1460 }
1461
1462 /**
1463- genericmenuitem_set_check_type:
1464- @item: #Genericmenuitem to set the type on
1465- @check_type: Which type of check should be displayed
1466-
1467- This function changes the type of the checkmark that
1468- appears in the left hand gutter for the menuitem.
1469+ * genericmenuitem_set_check_type:
1470+ * @item: #Genericmenuitem to set the type on
1471+ * @check_type: Which type of check should be displayed
1472+ *
1473+ * This function changes the type of the checkmark that
1474+ * appears in the left hand gutter for the menuitem.
1475 */
1476 void
1477 genericmenuitem_set_check_type (Genericmenuitem * item, GenericmenuitemCheckType check_type)
1478@@ -317,14 +317,14 @@
1479 }
1480
1481 /**
1482- genericmenuitem_set_state:
1483- @item: #Genericmenuitem to set the type on
1484- @check_type: What is the state of the check
1485-
1486- Sets the state of the check in the menu item. It does
1487- not require, but isn't really useful if the type of
1488- check that the menuitem is set to #GENERICMENUITEM_CHECK_TYPE_NONE.
1489-*/
1490+ * genericmenuitem_set_state:
1491+ * @item: #Genericmenuitem to set the type on
1492+ * @check_type: What is the state of the check
1493+ *
1494+ * Sets the state of the check in the menu item. It does
1495+ * not require, but isn't really useful if the type of
1496+ * check that the menuitem is set to #GENERICMENUITEM_CHECK_TYPE_NONE.
1497+ */
1498 void
1499 genericmenuitem_set_state (Genericmenuitem * item, GenericmenuitemState state)
1500 {
1501@@ -377,11 +377,11 @@
1502 }
1503
1504 /**
1505- genericmenuitem_set_image:
1506- @item: A #Genericmenuitem
1507- @image: The image to set as the image of @item
1508-
1509- Sets the image of the menu item.
1510+ * genericmenuitem_set_image:
1511+ * @item: A #Genericmenuitem
1512+ * @image: The image to set as the image of @item
1513+ *
1514+ * Sets the image of the menu item.
1515 */
1516 void
1517 genericmenuitem_set_image (Genericmenuitem * menu_item, GtkWidget * image)
1518@@ -439,13 +439,13 @@
1519 }
1520
1521 /**
1522- genericmenuitem_get_image:
1523- @item: A #Genericmenuitem
1524-
1525- Returns the image if there is one.
1526-
1527- Return value: A pointer to the image of the item or #NULL
1528- if there isn't one.
1529+ * genericmenuitem_get_image:
1530+ * @item: A #Genericmenuitem
1531+ *
1532+ * Returns the image if there is one.
1533+ *
1534+ * Return value: (transfer none): A pointer to the image of the item or #NULL
1535+ * if there isn't one.
1536 */
1537 GtkWidget *
1538 genericmenuitem_get_image (Genericmenuitem * menu_item)
1539
1540=== modified file 'libdbusmenu-gtk/menu.c'
1541--- libdbusmenu-gtk/menu.c 2011-01-31 16:12:20 +0000
1542+++ libdbusmenu-gtk/menu.c 2011-02-21 13:11:23 +0000
1543@@ -398,15 +398,15 @@
1544 /* Public API */
1545
1546 /**
1547- dbusmenu_gtkmenu_new:
1548- @dbus_name: Name of the #DbusmenuServer on DBus
1549- @dbus_name: Name of the object on the #DbusmenuServer
1550-
1551- Creates a new #DbusmenuGtkMenu object and creates a #DbusmenuClient
1552- that connects across DBus to a #DbusmenuServer.
1553-
1554- Return value: A new #DbusmenuGtkMenu sync'd with a server
1555-*/
1556+ * dbusmenu_gtkmenu_new:
1557+ * @dbus_name: Name of the #DbusmenuServer on DBus
1558+ * @dbus_object: Name of the object on the #DbusmenuServer
1559+ *
1560+ * Creates a new #DbusmenuGtkMenu object and creates a #DbusmenuClient
1561+ * that connects across DBus to a #DbusmenuServer.
1562+ *
1563+ * Return value: A new #DbusmenuGtkMenu sync'd with a server
1564+ */
1565 DbusmenuGtkMenu *
1566 dbusmenu_gtkmenu_new (gchar * dbus_name, gchar * dbus_object)
1567 {
1568@@ -417,14 +417,14 @@
1569 }
1570
1571 /**
1572- dbusmenu_gtkmenu_get_client:
1573- @menu: The #DbusmenuGtkMenu to get the client from
1574-
1575- An accessor for the client that this menu is using to
1576- communicate with the server.
1577-
1578- Return value: A valid #DbusmenuGtkClient or NULL on error.
1579-*/
1580+ * dbusmenu_gtkmenu_get_client:
1581+ * @menu: The #DbusmenuGtkMenu to get the client from
1582+ *
1583+ * An accessor for the client that this menu is using to
1584+ * communicate with the server.
1585+ *
1586+ * Return value: (transfer none): A valid #DbusmenuGtkClient or NULL on error.
1587+ */
1588 DbusmenuGtkClient *
1589 dbusmenu_gtkmenu_get_client (DbusmenuGtkMenu * menu)
1590 {
1591
1592=== modified file 'libdbusmenu-gtk/menuitem.c'
1593--- libdbusmenu-gtk/menuitem.c 2010-12-02 02:13:48 +0000
1594+++ libdbusmenu-gtk/menuitem.c 2011-02-21 13:11:23 +0000
1595@@ -31,17 +31,17 @@
1596 #include <gtk/gtk.h>
1597
1598 /**
1599- dbusmenu_menuitem_property_set_image:
1600- @menuitem: The #DbusmenuMenuitem to set the property on.
1601- @property: Name of the property to set.
1602- @data: The image to place on the property.
1603-
1604- This function takes the pixbuf that is stored in @data and
1605- turns it into a base64 encoded PNG so that it can be placed
1606- onto a standard #DbusmenuMenuitem property.
1607-
1608- Return value: Whether the function was able to set the property
1609- or not.
1610+ * dbusmenu_menuitem_property_set_image:
1611+ * @menuitem: The #DbusmenuMenuitem to set the property on.
1612+ * @property: Name of the property to set.
1613+ * @data: The image to place on the property.
1614+ *
1615+ * This function takes the pixbuf that is stored in @data and
1616+ * turns it into a base64 encoded PNG so that it can be placed
1617+ * onto a standard #DbusmenuMenuitem property.
1618+ *
1619+ * Return value: Whether the function was able to set the property
1620+ * or not.
1621 */
1622 gboolean
1623 dbusmenu_menuitem_property_set_image (DbusmenuMenuitem * menuitem, const gchar * property, const GdkPixbuf * data)
1624@@ -77,17 +77,17 @@
1625 }
1626
1627 /**
1628- dbusmenu_menuitem_property_get_image:
1629- @menuitem: The #DbusmenuMenuite to look for the property on
1630- @property: The name of the property to look for.
1631-
1632- This function looks on the menu item for a property by the
1633- name of @property. If one exists it tries to turn it into
1634- a #GdkPixbuf. It assumes that the property is a base64 encoded
1635- PNG file like the one created by #dbusmenu_menuite_property_set_image.
1636-
1637- Return value: A pixbuf or #NULL to signal error.
1638-*/
1639+ * dbusmenu_menuitem_property_get_image:
1640+ * @menuitem: The #DbusmenuMenuite to look for the property on
1641+ * @property: The name of the property to look for.
1642+ *
1643+ * This function looks on the menu item for a property by the
1644+ * name of @property. If one exists it tries to turn it into
1645+ * a #GdkPixbuf. It assumes that the property is a base64 encoded
1646+ * PNG file like the one created by #dbusmenu_menuite_property_set_image.
1647+ *
1648+ * Return value: (transfer full): A pixbuf or #NULL to signal error.
1649+ */
1650 GdkPixbuf *
1651 dbusmenu_menuitem_property_get_image (DbusmenuMenuitem * menuitem, const gchar * property)
1652 {
1653@@ -131,16 +131,16 @@
1654 }
1655
1656 /**
1657- dbusmenu_menuitem_property_set_shortcut_string:
1658- @menuitem: The #DbusmenuMenuitem to set the shortcut on
1659- @shortcut: String describing the shortcut
1660-
1661- This function takes a GTK shortcut string as defined in
1662- #gtk_accelerator_parse and turns that into the information
1663- required to send it over DBusmenu.
1664-
1665- Return value: Whether it was successful at setting the property.
1666-*/
1667+ * dbusmenu_menuitem_property_set_shortcut_string:
1668+ * @menuitem: The #DbusmenuMenuitem to set the shortcut on
1669+ * @shortcut: String describing the shortcut
1670+ *
1671+ * This function takes a GTK shortcut string as defined in
1672+ * #gtk_accelerator_parse and turns that into the information
1673+ * required to send it over DBusmenu.
1674+ *
1675+ * Return value: Whether it was successful at setting the property.
1676+ */
1677 gboolean
1678 dbusmenu_menuitem_property_set_shortcut_string (DbusmenuMenuitem * menuitem, const gchar * shortcut)
1679 {
1680@@ -161,16 +161,16 @@
1681 }
1682
1683 /**
1684- dbusmenu_menuitem_property_set_shortcut:
1685- @menuitem: The #DbusmenuMenuitem to set the shortcut on
1686- @key: The keycode of the key to send
1687- @modifier: A bitmask of modifiers used to activate the item
1688-
1689- Takes the modifer described by @key and @modifier and places that into
1690- the format sending across Dbus for shortcuts.
1691-
1692- Return value: Whether it was successful at setting the property.
1693-*/
1694+ * dbusmenu_menuitem_property_set_shortcut:
1695+ * @menuitem: The #DbusmenuMenuitem to set the shortcut on
1696+ * @key: The keycode of the key to send
1697+ * @modifier: A bitmask of modifiers used to activate the item
1698+ *
1699+ * Takes the modifer described by @key and @modifier and places that into
1700+ * the format sending across Dbus for shortcuts.
1701+ *
1702+ * Return value: Whether it was successful at setting the property.
1703+ */
1704 gboolean
1705 dbusmenu_menuitem_property_set_shortcut (DbusmenuMenuitem * menuitem, guint key, GdkModifierType modifier)
1706 {
1707@@ -213,16 +213,16 @@
1708 }
1709
1710 /**
1711- dbusmenu_menuitem_property_set_shortcut_menuitem:
1712- @menuitem: The #DbusmenuMenuitem to set the shortcut on
1713- @gmi: A menu item to steal the shortcut off of
1714-
1715- Takes the shortcut that is installed on a menu item and calls
1716- #dbusmenu_menuitem_property_set_shortcut with it. It also sets
1717- up listeners to watch it change.
1718-
1719- Return value: Whether it was successful at setting the property.
1720-*/
1721+ * dbusmenu_menuitem_property_set_shortcut_menuitem:
1722+ * @menuitem: The #DbusmenuMenuitem to set the shortcut on
1723+ * @gmi: A menu item to steal the shortcut off of
1724+ *
1725+ * Takes the shortcut that is installed on a menu item and calls
1726+ * #dbusmenu_menuitem_property_set_shortcut with it. It also sets
1727+ * up listeners to watch it change.
1728+ *
1729+ * Return value: Whether it was successful at setting the property.
1730+ */
1731 gboolean
1732 dbusmenu_menuitem_property_set_shortcut_menuitem (DbusmenuMenuitem * menuitem, const GtkMenuItem * gmi)
1733 {
1734@@ -260,14 +260,14 @@
1735 }
1736
1737 /**
1738- dbusmenu_menuitem_property_get_shortcut:
1739- @menuitem: The #DbusmenuMenuitem to get the shortcut off
1740- @key: Location to put the key value
1741- @modifier: Location to put the modifier mask
1742-
1743- This function gets a GTK shortcut as a key and a mask
1744- for use to set the accelerators.
1745-*/
1746+ * dbusmenu_menuitem_property_get_shortcut:
1747+ * @menuitem: The #DbusmenuMenuitem to get the shortcut off
1748+ * @key: (out): Location to put the key value
1749+ * @modifier: (out): Location to put the modifier mask
1750+ *
1751+ * This function gets a GTK shortcut as a key and a mask
1752+ * for use to set the accelerators.
1753+ */
1754 void
1755 dbusmenu_menuitem_property_get_shortcut (DbusmenuMenuitem * menuitem, guint * key, GdkModifierType * modifier)
1756 {
1757
1758=== modified file 'libdbusmenu-gtk/menuitem.h'
1759--- libdbusmenu-gtk/menuitem.h 2011-01-21 22:48:41 +0000
1760+++ libdbusmenu-gtk/menuitem.h 2011-02-21 13:11:23 +0000
1761@@ -43,7 +43,7 @@
1762 gboolean dbusmenu_menuitem_property_set_shortcut (DbusmenuMenuitem * menuitem, guint key, GdkModifierType modifier);
1763 gboolean dbusmenu_menuitem_property_set_shortcut_string (DbusmenuMenuitem * menuitem, const gchar * shortcut);
1764 gboolean dbusmenu_menuitem_property_set_shortcut_menuitem (DbusmenuMenuitem * menuitem, const GtkMenuItem * gmi);
1765-void dbusmenu_menuitem_property_get_shortcut (DbusmenuMenuitem * menuitem, guint * key, GdkModifierType * modifiers);
1766+void dbusmenu_menuitem_property_get_shortcut (DbusmenuMenuitem * menuitem, guint * key, GdkModifierType * modifier);
1767
1768 G_END_DECLS
1769
1770
1771=== modified file 'libdbusmenu-gtk/parser.c'
1772--- libdbusmenu-gtk/parser.c 2011-02-17 12:48:27 +0000
1773+++ libdbusmenu-gtk/parser.c 2011-02-21 13:11:23 +0000
1774@@ -85,16 +85,16 @@
1775 gpointer data);
1776
1777 /**
1778- dbusmenu_gtk_parse_menu_structure:
1779- @widget: A #GtkMenuItem or #GtkMenuShell to turn into a #DbusmenuMenuitem
1780-
1781- Goes through the GTK structures and turns them into the appropraite
1782- Dbusmenu structures along with setting up all the relationships
1783- between the objects. It also stores the dbusmenu items as a cache
1784- on the GTK items so that they'll be reused if necissary.
1785-
1786- Return value: A dbusmenu item representing the menu structure
1787-*/
1788+ * dbusmenu_gtk_parse_menu_structure:
1789+ * @widget: A #GtkMenuItem or #GtkMenuShell to turn into a #DbusmenuMenuitem
1790+ *
1791+ * Goes through the GTK structures and turns them into the appropraite
1792+ * Dbusmenu structures along with setting up all the relationships
1793+ * between the objects. It also stores the dbusmenu items as a cache
1794+ * on the GTK items so that they'll be reused if necissary.
1795+ *
1796+ * Return value: (transfer none): A dbusmenu item representing the menu structure
1797+ */
1798 DbusmenuMenuitem *
1799 dbusmenu_gtk_parse_menu_structure (GtkWidget * widget)
1800 {
1801
1802=== modified file 'libdbusmenu-gtk/serializablemenuitem.c'
1803--- libdbusmenu-gtk/serializablemenuitem.c 2011-01-27 15:28:44 +0000
1804+++ libdbusmenu-gtk/serializablemenuitem.c 2011-02-21 13:11:23 +0000
1805@@ -166,18 +166,18 @@
1806 }
1807
1808 /**
1809- dbusmenu_gtk_serializable_menu_item_build_menuitem:
1810- @smi: #DbusmenuGtkSerializableMenuItem to build a #DbusmenuMenuitem mirroring
1811-
1812- This function is for menu items that are instanciated from
1813- GTK and have their properites set using GTK functions. This
1814- builds a #DbusmenuMenuitem that then has the properties that
1815- should be sent over the bus to create a new item of this
1816- type on the other side.
1817-
1818- Return value: (transfer full) A #DbusmenuMenuitem who's values will be
1819- set by this object.
1820-*/
1821+ * dbusmenu_gtk_serializable_menu_item_build_menuitem:
1822+ * @smi: #DbusmenuGtkSerializableMenuItem to build a #DbusmenuMenuitem mirroring
1823+ *
1824+ * This function is for menu items that are instanciated from
1825+ * GTK and have their properites set using GTK functions. This
1826+ * builds a #DbusmenuMenuitem that then has the properties that
1827+ * should be sent over the bus to create a new item of this
1828+ * type on the other side.
1829+ *
1830+ * Return value: (transfer full): A #DbusmenuMenuitem who's values will be
1831+ * set by this object.
1832+ */
1833 DbusmenuMenuitem *
1834 dbusmenu_gtk_serializable_menu_item_build_menuitem (DbusmenuGtkSerializableMenuItem * smi)
1835 {
1836@@ -225,15 +225,15 @@
1837 }
1838
1839 /**
1840- dbusmenu_gtk_serializable_menu_item_register_to_client:
1841- @client: #DbusmenuClient that we should register a type at.
1842- @item_type: The #GType of a class that is a subclass of #DbusmenuGtkSerializableMenuItem
1843-
1844- Registers a generic handler for dealing with all subclasses of
1845- #DbusmenuGtkSerializableMenuItem. This handler responds to the callback,
1846- creates a new object and attaches it to the appropriate #DbusmenuMenuitem
1847- object.
1848-*/
1849+ * dbusmenu_gtk_serializable_menu_item_register_to_client:
1850+ * @client: #DbusmenuClient that we should register a type at.
1851+ * @item_type: The #GType of a class that is a subclass of #DbusmenuGtkSerializableMenuItem
1852+ *
1853+ * Registers a generic handler for dealing with all subclasses of
1854+ * #DbusmenuGtkSerializableMenuItem. This handler responds to the callback,
1855+ * creates a new object and attaches it to the appropriate #DbusmenuMenuitem
1856+ * object.
1857+ */
1858 void
1859 dbusmenu_gtk_serializable_menu_item_register_to_client (DbusmenuClient * client, GType item_type)
1860 {
1861@@ -265,16 +265,16 @@
1862 }
1863
1864 /**
1865- dbusmenu_gtk_serializable_menu_item_set_menuitem:
1866- @smi: #DbusmenuGtkSerializableMenuItem to set the @DbusmenuGtkSerializableMenuItem::dbusmenu-menuitem of
1867- @mi: Menuitem to get the properties from
1868-
1869- This function is used on the server side to signal to the object
1870- that it should get its' property change events from @mi instead
1871- of expecting calls to its' API. A call to this function sets the
1872- property and subclasses should listen to the notify signal to
1873- pick up this property being set.
1874-*/
1875+ * dbusmenu_gtk_serializable_menu_item_set_menuitem:
1876+ * @smi: #DbusmenuGtkSerializableMenuItem to set the @DbusmenuGtkSerializableMenuItem::dbusmenu-menuitem of
1877+ * @mi: Menuitem to get the properties from
1878+ *
1879+ * This function is used on the server side to signal to the object
1880+ * that it should get its' property change events from @mi instead
1881+ * of expecting calls to its' API. A call to this function sets the
1882+ * property and subclasses should listen to the notify signal to
1883+ * pick up this property being set.
1884+ */
1885 void
1886 dbusmenu_gtk_serializable_menu_item_set_menuitem (DbusmenuGtkSerializableMenuItem * smi, DbusmenuMenuitem * mi)
1887 {
1888
1889=== modified file 'tests/Makefile.am'
1890--- tests/Makefile.am 2011-02-15 21:06:42 +0000
1891+++ tests/Makefile.am 2011-02-21 13:11:23 +0000
1892@@ -16,9 +16,11 @@
1893 test-gtk-objects-test \
1894 test-gtk-label \
1895 test-gtk-shortcut \
1896+ test-gtk-shortcut-python \
1897 test-gtk-reorder \
1898 test-gtk-submenu \
1899- test-gtk-parser-test
1900+ test-gtk-parser-test \
1901+ test-glib-simple-items.py
1902
1903 check_PROGRAMS = \
1904 glib-server-nomenu \
1905@@ -49,6 +51,9 @@
1906
1907 XVFB_RUN=". $(srcdir)/run-xvfb.sh"
1908
1909+# for the GI tests, prefer/use the typelibs from the local build tree
1910+TESTS_ENVIRONMENT = env GI_TYPELIB_PATH=$(top_builddir)/libdbusmenu-glib:$(top_builddir)/libdbusmenu-gtk:$(GI_TYPELIB_PATH)
1911+
1912 ######################
1913 # JSON Loader lib
1914 ######################
1915@@ -472,6 +477,12 @@
1916 @echo $(DBUS_RUNNER) --task ./test-gtk-shortcut-client --task-name Client --task ./test-gtk-shortcut-server --task-name Server --ignore-return >> $@
1917 @chmod +x $@
1918
1919+test-gtk-shortcut-python: test-gtk-shortcut-server Makefile.am
1920+ @echo "#!/bin/bash" > $@
1921+ @echo $(XVFB_RUN) >> $@
1922+ @echo $(DBUS_RUNNER) --task ./test-gtk-shortcut-client.py --task-name Client --task ./test-gtk-shortcut-server --task-name Server --ignore-return >> $@
1923+ @chmod +x $@
1924+
1925 test_gtk_shortcut_server_SOURCES = \
1926 test-gtk-shortcut-server.c
1927
1928@@ -629,5 +640,5 @@
1929 -rm -rf $(builddir)/mago.results
1930
1931 DISTCLEANFILES += \
1932- $(TESTS)
1933+ $(filter-out %.py, $(TESTS))
1934
1935
1936=== added file 'tests/test-glib-simple-items.py'
1937--- tests/test-glib-simple-items.py 1970-01-01 00:00:00 +0000
1938+++ tests/test-glib-simple-items.py 2011-02-21 13:11:23 +0000
1939@@ -0,0 +1,35 @@
1940+#!/usr/bin/python
1941+# This is the Python GI version of test-glib-simple-items.c
1942+
1943+import gobject
1944+from gi.repository import Dbusmenu
1945+
1946+dummies = ['Bob', 'Jim', 'Alvin', 'Mary']
1947+
1948+def dummy_users(root):
1949+ count = 0
1950+ for user in dummies:
1951+ mi = Dbusmenu.Menuitem()
1952+ print 'Creating item: %d %s' % (mi.get_id(), user)
1953+ print '\tRoot ID:', root.get_id()
1954+ mi.property_set('label', user)
1955+ root.child_add_position(mi, count)
1956+ assert mi.property_get('label') == user
1957+ count += 1
1958+
1959+def quititall(mainloop):
1960+ mainloop.quit()
1961+ return False
1962+
1963+# main
1964+
1965+server = Dbusmenu.Server.new('/test/object')
1966+root_menuitem = Dbusmenu.Menuitem()
1967+server.set_root(root_menuitem)
1968+print 'Root ID:', root_menuitem.get_id()
1969+
1970+dummy_users(root_menuitem)
1971+
1972+mainloop = gobject.MainLoop()
1973+gobject.timeout_add_seconds(1, quititall, mainloop)
1974+mainloop.run()
1975
1976=== added file 'tests/test-gtk-shortcut-client.py'
1977--- tests/test-gtk-shortcut-client.py 1970-01-01 00:00:00 +0000
1978+++ tests/test-gtk-shortcut-client.py 2011-02-21 13:11:23 +0000
1979@@ -0,0 +1,52 @@
1980+#!/usr/bin/python
1981+
1982+# A test for libdbusmenu to ensure its quality. This is the Python GI version
1983+# of test-gtk-shortcut-client.c
1984+#
1985+# Copyright 2011 Canonical Ltd.
1986+# Authors:
1987+# Martin Pitt <martin.pitt@ubuntu.com>
1988+
1989+import sys
1990+import gobject
1991+from gi.repository import Gtk, DbusmenuGtk
1992+Gtk.require_version('2.0')
1993+
1994+passed = True
1995+main_loop = gobject.MainLoop()
1996+
1997+def timer_func(data):
1998+ passed = True
1999+ main_loop.quit()
2000+ return False
2001+
2002+# main
2003+print 'Building Window'
2004+window = Gtk.Window(type=Gtk.WindowType.TOPLEVEL)
2005+menubar = Gtk.MenuBar()
2006+menuitem = Gtk.MenuItem(label='Test')
2007+
2008+dmenu = DbusmenuGtk.Menu(dbus_name='glib.label.test', dbus_object='/org/test')
2009+dclient = dmenu.get_client()
2010+agroup = Gtk.AccelGroup()
2011+dclient.set_accel_group(agroup)
2012+
2013+menuitem.set_submenu(dmenu)
2014+menuitem.show()
2015+menubar.append(menuitem)
2016+menubar.show()
2017+window.add(menubar)
2018+window.set_title('libdbusmenu-gtk test')
2019+window.add_accel_group(agroup)
2020+window.show_all()
2021+
2022+gobject.timeout_add_seconds(10, timer_func, window)
2023+
2024+print 'Entering Mainloop'
2025+main_loop.run()
2026+
2027+if passed:
2028+ print 'Quiting'
2029+else:
2030+ print "Quiting as we're a failure"
2031+ sys.exit(1)

Subscribers

People subscribed via source and target branches