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