Merge lp:~agateau/libdbusmenu/interop into lp:libdbusmenu/0.5
- interop
- Merge into trunk
Proposed by
Aurélien Gâteau
Status: | Merged |
---|---|
Merged at revision: | not available |
Proposed branch: | lp:~agateau/libdbusmenu/interop |
Merge into: | lp:libdbusmenu/0.5 |
Diff against target: |
1679 lines (+691/-326) 11 files modified
libdbusmenu-glib/Doxyfile (+257/-0) libdbusmenu-glib/client.c (+22/-21) libdbusmenu-glib/client.h (+2/-2) libdbusmenu-glib/dbus-menu.xml (+231/-121) libdbusmenu-glib/menuitem.c (+12/-15) libdbusmenu-glib/menuitem.h (+9/-9) libdbusmenu-glib/server-marshal.list (+1/-1) libdbusmenu-glib/server.c (+17/-17) libdbusmenu-glib/server.h (+2/-2) libdbusmenu-gtk/client.c (+17/-17) tests/test-gtk-label.json (+121/-121) |
To merge this branch: | bzr merge lp:~agateau/libdbusmenu/interop |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ted Gould (community) | Needs Information | ||
Review via email: mp+18493@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
Aurélien Gâteau (agateau) wrote : | # |
lp:~agateau/libdbusmenu/interop
updated
- 67. By Aurélien Gâteau
-
Turn parent parameter of get_layout to an int as well
- 68. By Aurélien Gâteau
-
- Allow id to be 0.
- Fix default item type. - 69. By Aurélien Gâteau
-
Root id should be 0
Revision history for this message
Ted Gould (ted) wrote : | # |
On Wed, 2010-02-03 at 01:09 +0000, Aurélien Gâteau wrote:
> Implement the agreed property changes.
Code looks good, but you need to update the test suite also to match the
property changes. It gets very confused right now :)
review needs-information
review:
Needs Information
lp:~agateau/libdbusmenu/interop
updated
- 70. By Aurélien Gâteau
-
Use new property names
- 71. By Aurélien Gâteau
-
Fix types of signal params
Revision history for this message
Aurélien Gâteau (agateau) wrote : | # |
> On Wed, 2010-02-03 at 01:09 +0000, Aurélien Gâteau wrote:
> > Implement the agreed property changes.
>
> Code looks good, but you need to update the test suite also to match the
> property changes. It gets very confused right now :)
Done!
lp:~agateau/libdbusmenu/interop
updated
- 72. By Aurélien Gâteau
-
Add timestamp to activate prototype.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === added file 'libdbusmenu-glib/Doxyfile' |
2 | --- libdbusmenu-glib/Doxyfile 1970-01-01 00:00:00 +0000 |
3 | +++ libdbusmenu-glib/Doxyfile 2010-02-04 01:26:14 +0000 |
4 | @@ -0,0 +1,257 @@ |
5 | +# Doxyfile 1.6.1 |
6 | + |
7 | +#--------------------------------------------------------------------------- |
8 | +# Project related configuration options |
9 | +#--------------------------------------------------------------------------- |
10 | +DOXYFILE_ENCODING = UTF-8 |
11 | +PROJECT_NAME = DBusMenu |
12 | +PROJECT_NUMBER = |
13 | +OUTPUT_DIRECTORY = |
14 | +CREATE_SUBDIRS = NO |
15 | +OUTPUT_LANGUAGE = English |
16 | +BRIEF_MEMBER_DESC = YES |
17 | +REPEAT_BRIEF = YES |
18 | +ABBREVIATE_BRIEF = |
19 | +ALWAYS_DETAILED_SEC = NO |
20 | +INLINE_INHERITED_MEMB = NO |
21 | +FULL_PATH_NAMES = YES |
22 | +STRIP_FROM_PATH = |
23 | +STRIP_FROM_INC_PATH = |
24 | +SHORT_NAMES = NO |
25 | +JAVADOC_AUTOBRIEF = NO |
26 | +QT_AUTOBRIEF = NO |
27 | +MULTILINE_CPP_IS_BRIEF = NO |
28 | +INHERIT_DOCS = YES |
29 | +SEPARATE_MEMBER_PAGES = NO |
30 | +TAB_SIZE = 8 |
31 | +ALIASES = |
32 | +OPTIMIZE_OUTPUT_FOR_C = NO |
33 | +OPTIMIZE_OUTPUT_JAVA = NO |
34 | +OPTIMIZE_FOR_FORTRAN = NO |
35 | +OPTIMIZE_OUTPUT_VHDL = NO |
36 | +EXTENSION_MAPPING = |
37 | +BUILTIN_STL_SUPPORT = NO |
38 | +CPP_CLI_SUPPORT = NO |
39 | +SIP_SUPPORT = NO |
40 | +IDL_PROPERTY_SUPPORT = YES |
41 | +DISTRIBUTE_GROUP_DOC = NO |
42 | +SUBGROUPING = YES |
43 | +TYPEDEF_HIDES_STRUCT = NO |
44 | +SYMBOL_CACHE_SIZE = 0 |
45 | +#--------------------------------------------------------------------------- |
46 | +# Build related configuration options |
47 | +#--------------------------------------------------------------------------- |
48 | +EXTRACT_ALL = NO |
49 | +EXTRACT_PRIVATE = NO |
50 | +EXTRACT_STATIC = NO |
51 | +EXTRACT_LOCAL_CLASSES = YES |
52 | +EXTRACT_LOCAL_METHODS = NO |
53 | +EXTRACT_ANON_NSPACES = NO |
54 | +HIDE_UNDOC_MEMBERS = NO |
55 | +HIDE_UNDOC_CLASSES = NO |
56 | +HIDE_FRIEND_COMPOUNDS = NO |
57 | +HIDE_IN_BODY_DOCS = NO |
58 | +INTERNAL_DOCS = NO |
59 | +CASE_SENSE_NAMES = YES |
60 | +HIDE_SCOPE_NAMES = NO |
61 | +SHOW_INCLUDE_FILES = YES |
62 | +INLINE_INFO = YES |
63 | +SORT_MEMBER_DOCS = YES |
64 | +SORT_BRIEF_DOCS = NO |
65 | +SORT_MEMBERS_CTORS_1ST = NO |
66 | +SORT_GROUP_NAMES = NO |
67 | +SORT_BY_SCOPE_NAME = NO |
68 | +GENERATE_TODOLIST = YES |
69 | +GENERATE_TESTLIST = YES |
70 | +GENERATE_BUGLIST = YES |
71 | +GENERATE_DEPRECATEDLIST= YES |
72 | +ENABLED_SECTIONS = |
73 | +MAX_INITIALIZER_LINES = 30 |
74 | +SHOW_USED_FILES = YES |
75 | +SHOW_DIRECTORIES = NO |
76 | +SHOW_FILES = YES |
77 | +SHOW_NAMESPACES = YES |
78 | +FILE_VERSION_FILTER = |
79 | +LAYOUT_FILE = |
80 | +#--------------------------------------------------------------------------- |
81 | +# configuration options related to warning and progress messages |
82 | +#--------------------------------------------------------------------------- |
83 | +QUIET = NO |
84 | +WARNINGS = YES |
85 | +WARN_IF_UNDOCUMENTED = YES |
86 | +WARN_IF_DOC_ERROR = YES |
87 | +WARN_NO_PARAMDOC = NO |
88 | +WARN_FORMAT = "$file:$line: $text" |
89 | +WARN_LOGFILE = |
90 | +#--------------------------------------------------------------------------- |
91 | +# configuration options related to the input files |
92 | +#--------------------------------------------------------------------------- |
93 | +INPUT = . |
94 | +INPUT_ENCODING = UTF-8 |
95 | +FILE_PATTERNS = *.xml |
96 | +RECURSIVE = NO |
97 | +EXCLUDE = |
98 | +EXCLUDE_SYMLINKS = NO |
99 | +EXCLUDE_PATTERNS = |
100 | +EXCLUDE_SYMBOLS = |
101 | +EXAMPLE_PATH = |
102 | +EXAMPLE_PATTERNS = |
103 | +EXAMPLE_RECURSIVE = NO |
104 | +IMAGE_PATH = |
105 | +INPUT_FILTER = doxymel |
106 | +FILTER_PATTERNS = *.xml=doxymel |
107 | +FILTER_SOURCE_FILES = NO |
108 | +#--------------------------------------------------------------------------- |
109 | +# configuration options related to source browsing |
110 | +#--------------------------------------------------------------------------- |
111 | +SOURCE_BROWSER = NO |
112 | +INLINE_SOURCES = NO |
113 | +STRIP_CODE_COMMENTS = YES |
114 | +REFERENCED_BY_RELATION = NO |
115 | +REFERENCES_RELATION = NO |
116 | +REFERENCES_LINK_SOURCE = YES |
117 | +USE_HTAGS = NO |
118 | +VERBATIM_HEADERS = YES |
119 | +#--------------------------------------------------------------------------- |
120 | +# configuration options related to the alphabetical class index |
121 | +#--------------------------------------------------------------------------- |
122 | +ALPHABETICAL_INDEX = NO |
123 | +COLS_IN_ALPHA_INDEX = 5 |
124 | +IGNORE_PREFIX = |
125 | +#--------------------------------------------------------------------------- |
126 | +# configuration options related to the HTML output |
127 | +#--------------------------------------------------------------------------- |
128 | +GENERATE_HTML = YES |
129 | +HTML_OUTPUT = html |
130 | +HTML_FILE_EXTENSION = .html |
131 | +HTML_HEADER = |
132 | +HTML_FOOTER = |
133 | +HTML_STYLESHEET = |
134 | +HTML_ALIGN_MEMBERS = YES |
135 | +HTML_DYNAMIC_SECTIONS = NO |
136 | +GENERATE_DOCSET = NO |
137 | +DOCSET_FEEDNAME = "Doxygen generated docs" |
138 | +DOCSET_BUNDLE_ID = org.doxygen.Project |
139 | +GENERATE_HTMLHELP = NO |
140 | +CHM_FILE = |
141 | +HHC_LOCATION = |
142 | +GENERATE_CHI = NO |
143 | +CHM_INDEX_ENCODING = |
144 | +BINARY_TOC = NO |
145 | +TOC_EXPAND = NO |
146 | +GENERATE_QHP = NO |
147 | +QCH_FILE = |
148 | +QHP_NAMESPACE = |
149 | +QHP_VIRTUAL_FOLDER = doc |
150 | +QHP_CUST_FILTER_NAME = |
151 | +QHP_CUST_FILTER_ATTRS = |
152 | +QHP_SECT_FILTER_ATTRS = |
153 | +QHG_LOCATION = |
154 | +DISABLE_INDEX = NO |
155 | +ENUM_VALUES_PER_LINE = 4 |
156 | +GENERATE_TREEVIEW = NO |
157 | +USE_INLINE_TREES = NO |
158 | +TREEVIEW_WIDTH = 250 |
159 | +FORMULA_FONTSIZE = 10 |
160 | +SEARCHENGINE = YES |
161 | +#--------------------------------------------------------------------------- |
162 | +# configuration options related to the LaTeX output |
163 | +#--------------------------------------------------------------------------- |
164 | +GENERATE_LATEX = NO |
165 | +LATEX_OUTPUT = latex |
166 | +LATEX_CMD_NAME = latex |
167 | +MAKEINDEX_CMD_NAME = makeindex |
168 | +COMPACT_LATEX = NO |
169 | +PAPER_TYPE = a4wide |
170 | +EXTRA_PACKAGES = |
171 | +LATEX_HEADER = |
172 | +PDF_HYPERLINKS = YES |
173 | +USE_PDFLATEX = YES |
174 | +LATEX_BATCHMODE = NO |
175 | +LATEX_HIDE_INDICES = NO |
176 | +LATEX_SOURCE_CODE = NO |
177 | +#--------------------------------------------------------------------------- |
178 | +# configuration options related to the RTF output |
179 | +#--------------------------------------------------------------------------- |
180 | +GENERATE_RTF = NO |
181 | +RTF_OUTPUT = rtf |
182 | +COMPACT_RTF = NO |
183 | +RTF_HYPERLINKS = NO |
184 | +RTF_STYLESHEET_FILE = |
185 | +RTF_EXTENSIONS_FILE = |
186 | +#--------------------------------------------------------------------------- |
187 | +# configuration options related to the man page output |
188 | +#--------------------------------------------------------------------------- |
189 | +GENERATE_MAN = NO |
190 | +MAN_OUTPUT = man |
191 | +MAN_EXTENSION = .3 |
192 | +MAN_LINKS = NO |
193 | +#--------------------------------------------------------------------------- |
194 | +# configuration options related to the XML output |
195 | +#--------------------------------------------------------------------------- |
196 | +GENERATE_XML = NO |
197 | +XML_OUTPUT = xml |
198 | +XML_SCHEMA = |
199 | +XML_DTD = |
200 | +XML_PROGRAMLISTING = YES |
201 | +#--------------------------------------------------------------------------- |
202 | +# configuration options for the AutoGen Definitions output |
203 | +#--------------------------------------------------------------------------- |
204 | +GENERATE_AUTOGEN_DEF = NO |
205 | +#--------------------------------------------------------------------------- |
206 | +# configuration options related to the Perl module output |
207 | +#--------------------------------------------------------------------------- |
208 | +GENERATE_PERLMOD = NO |
209 | +PERLMOD_LATEX = NO |
210 | +PERLMOD_PRETTY = YES |
211 | +PERLMOD_MAKEVAR_PREFIX = |
212 | +#--------------------------------------------------------------------------- |
213 | +# Configuration options related to the preprocessor |
214 | +#--------------------------------------------------------------------------- |
215 | +ENABLE_PREPROCESSING = YES |
216 | +MACRO_EXPANSION = NO |
217 | +EXPAND_ONLY_PREDEF = NO |
218 | +SEARCH_INCLUDES = YES |
219 | +INCLUDE_PATH = |
220 | +INCLUDE_FILE_PATTERNS = |
221 | +PREDEFINED = |
222 | +EXPAND_AS_DEFINED = |
223 | +SKIP_FUNCTION_MACROS = YES |
224 | +#--------------------------------------------------------------------------- |
225 | +# Configuration::additions related to external references |
226 | +#--------------------------------------------------------------------------- |
227 | +TAGFILES = |
228 | +GENERATE_TAGFILE = |
229 | +ALLEXTERNALS = NO |
230 | +EXTERNAL_GROUPS = YES |
231 | +PERL_PATH = /usr/bin/perl |
232 | +#--------------------------------------------------------------------------- |
233 | +# Configuration options related to the dot tool |
234 | +#--------------------------------------------------------------------------- |
235 | +CLASS_DIAGRAMS = YES |
236 | +MSCGEN_PATH = |
237 | +HIDE_UNDOC_RELATIONS = YES |
238 | +HAVE_DOT = NO |
239 | +DOT_FONTNAME = FreeSans |
240 | +DOT_FONTSIZE = 10 |
241 | +DOT_FONTPATH = |
242 | +CLASS_GRAPH = YES |
243 | +COLLABORATION_GRAPH = YES |
244 | +GROUP_GRAPHS = YES |
245 | +UML_LOOK = NO |
246 | +TEMPLATE_RELATIONS = NO |
247 | +INCLUDE_GRAPH = YES |
248 | +INCLUDED_BY_GRAPH = YES |
249 | +CALL_GRAPH = NO |
250 | +CALLER_GRAPH = NO |
251 | +GRAPHICAL_HIERARCHY = YES |
252 | +DIRECTORY_GRAPH = YES |
253 | +DOT_IMAGE_FORMAT = png |
254 | +DOT_PATH = |
255 | +DOTFILE_DIRS = |
256 | +DOT_GRAPH_MAX_NODES = 50 |
257 | +MAX_DOT_GRAPH_DEPTH = 0 |
258 | +DOT_TRANSPARENT = NO |
259 | +DOT_MULTI_TARGETS = YES |
260 | +GENERATE_LEGEND = YES |
261 | +DOT_CLEANUP = YES |
262 | |
263 | === modified file 'libdbusmenu-glib/client.c' |
264 | --- libdbusmenu-glib/client.c 2010-01-24 20:08:51 +0000 |
265 | +++ libdbusmenu-glib/client.c 2010-02-04 01:26:14 +0000 |
266 | @@ -96,10 +96,10 @@ |
267 | static void get_property (GObject * obj, guint id, GValue * value, GParamSpec * pspec); |
268 | /* Private Funcs */ |
269 | static void layout_update (DBusGProxy * proxy, gint revision, guint parent, DbusmenuClient * client); |
270 | -static void id_prop_update (DBusGProxy * proxy, guint id, gchar * property, GValue * value, DbusmenuClient * client); |
271 | -static void id_update (DBusGProxy * proxy, guint id, DbusmenuClient * client); |
272 | +static void id_prop_update (DBusGProxy * proxy, gint id, gchar * property, GValue * value, DbusmenuClient * client); |
273 | +static void id_update (DBusGProxy * proxy, gint id, DbusmenuClient * client); |
274 | static void build_proxies (DbusmenuClient * client); |
275 | -static guint parse_node_get_id (xmlNodePtr node); |
276 | +static gint parse_node_get_id (xmlNodePtr node); |
277 | static DbusmenuMenuitem * parse_layout_xml(DbusmenuClient * client, xmlNodePtr node, DbusmenuMenuitem * item, DbusmenuMenuitem * parent, DBusGProxy * proxy); |
278 | static gint parse_layout (DbusmenuClient * client, const gchar * layout); |
279 | static void update_layout_cb (DBusGProxy * proxy, guint rev, gchar * xml, GError * in_error, void * data); |
280 | @@ -321,7 +321,7 @@ |
281 | /* Signal from the server that a property has changed |
282 | on one of our menuitems */ |
283 | static void |
284 | -id_prop_update (DBusGProxy * proxy, guint id, gchar * property, GValue * value, DbusmenuClient * client) |
285 | +id_prop_update (DBusGProxy * proxy, gint id, gchar * property, GValue * value, DbusmenuClient * client) |
286 | { |
287 | #ifdef MASSIVEDEBUGGING |
288 | GValue valstr = {0}; |
289 | @@ -344,7 +344,7 @@ |
290 | /* Oh, lots of updates now. That silly server, they want |
291 | to change all kinds of stuff! */ |
292 | static void |
293 | -id_update (DBusGProxy * proxy, guint id, DbusmenuClient * client) |
294 | +id_update (DBusGProxy * proxy, gint id, DbusmenuClient * client) |
295 | { |
296 | #ifdef MASSIVEDEBUGGING |
297 | g_debug("Client side ID update: %d", id); |
298 | @@ -498,15 +498,15 @@ |
299 | priv->dbusproxy = NULL; |
300 | } |
301 | |
302 | - dbus_g_object_register_marshaller(_dbusmenu_server_marshal_VOID__INT_UINT, G_TYPE_NONE, G_TYPE_INT, G_TYPE_UINT, G_TYPE_INVALID); |
303 | - dbus_g_proxy_add_signal(priv->menuproxy, "LayoutUpdated", G_TYPE_INT, G_TYPE_UINT, G_TYPE_INVALID); |
304 | + dbus_g_object_register_marshaller(_dbusmenu_server_marshal_VOID__UINT_INT, G_TYPE_NONE, G_TYPE_UINT, G_TYPE_INT, G_TYPE_INVALID); |
305 | + dbus_g_proxy_add_signal(priv->menuproxy, "LayoutUpdated", G_TYPE_UINT, G_TYPE_INT, G_TYPE_INVALID); |
306 | dbus_g_proxy_connect_signal(priv->menuproxy, "LayoutUpdated", G_CALLBACK(layout_update), client, NULL); |
307 | |
308 | dbus_g_object_register_marshaller(_dbusmenu_server_marshal_VOID__UINT_STRING_POINTER, G_TYPE_NONE, G_TYPE_UINT, G_TYPE_STRING, G_TYPE_VALUE, G_TYPE_INVALID); |
309 | dbus_g_proxy_add_signal(priv->menuproxy, "ItemPropertyUpdated", G_TYPE_UINT, G_TYPE_STRING, G_TYPE_VALUE, G_TYPE_INVALID); |
310 | dbus_g_proxy_connect_signal(priv->menuproxy, "ItemPropertyUpdated", G_CALLBACK(id_prop_update), client, NULL); |
311 | |
312 | - dbus_g_proxy_add_signal(priv->menuproxy, "ItemUpdated", G_TYPE_UINT, G_TYPE_INVALID); |
313 | + dbus_g_proxy_add_signal(priv->menuproxy, "ItemUpdated", G_TYPE_INT, G_TYPE_INVALID); |
314 | dbus_g_proxy_connect_signal(priv->menuproxy, "ItemUpdated", G_CALLBACK(id_update), client, NULL); |
315 | |
316 | update_layout(client); |
317 | @@ -517,20 +517,20 @@ |
318 | /* Get the ID attribute of the node, parse it and |
319 | return it. Also we're checking to ensure the node |
320 | is a 'menu' here. */ |
321 | -static guint |
322 | +static gint |
323 | parse_node_get_id (xmlNodePtr node) |
324 | { |
325 | if (g_strcmp0((gchar *)node->name, "menu") != 0) { |
326 | /* This kills some nodes early */ |
327 | g_warning("XML Node is not 'menu' it is '%s'", node->name); |
328 | - return 0; |
329 | + return -1; |
330 | } |
331 | |
332 | xmlAttrPtr attrib; |
333 | for (attrib = node->properties; attrib != NULL; attrib = attrib->next) { |
334 | if (g_strcmp0((gchar *)attrib->name, "id") == 0) { |
335 | if (attrib->children != NULL) { |
336 | - guint id = (guint)g_ascii_strtoull((gchar *)attrib->children->content, NULL, 10); |
337 | + gint id = (guint)g_ascii_strtoll((gchar *)attrib->children->content, NULL, 10); |
338 | /* g_debug ("Found ID: %d", id); */ |
339 | return id; |
340 | } |
341 | @@ -539,7 +539,7 @@ |
342 | } |
343 | |
344 | g_warning("Unable to find an ID on the node"); |
345 | - return 0; |
346 | + return -1; |
347 | } |
348 | |
349 | /* A small helper that calls _property_set on each hash table |
350 | @@ -627,7 +627,7 @@ |
351 | } |
352 | |
353 | static void |
354 | -menuitem_activate (DbusmenuMenuitem * mi, DbusmenuClient * client) |
355 | +menuitem_activate (DbusmenuMenuitem * mi, uint timestamp, DbusmenuClient * client) |
356 | { |
357 | DbusmenuClientPrivate * priv = DBUSMENU_CLIENT_GET_PRIVATE(client); |
358 | GValue value = {0}; |
359 | @@ -642,11 +642,14 @@ |
360 | static DbusmenuMenuitem * |
361 | parse_layout_xml(DbusmenuClient * client, xmlNodePtr node, DbusmenuMenuitem * item, DbusmenuMenuitem * parent, DBusGProxy * proxy) |
362 | { |
363 | - guint id = parse_node_get_id(node); |
364 | + gint id = parse_node_get_id(node); |
365 | + if (id < 0) { |
366 | + return NULL; |
367 | + } |
368 | #ifdef MASSIVEDEBUGGING |
369 | g_debug("Client looking at node with id: %d", id); |
370 | #endif |
371 | - if (item == NULL || dbusmenu_menuitem_get_id(item) != id || id == 0) { |
372 | + if (item == NULL || dbusmenu_menuitem_get_id(item) != id) { |
373 | if (item != NULL) { |
374 | if (parent != NULL) { |
375 | dbusmenu_menuitem_child_delete(parent, item); |
376 | @@ -655,11 +658,6 @@ |
377 | item = NULL; |
378 | } |
379 | |
380 | - if (id == 0) { |
381 | - g_warning("ID from XML file is zero"); |
382 | - return NULL; |
383 | - } |
384 | - |
385 | /* Build a new item */ |
386 | item = dbusmenu_menuitem_new_with_id(id); |
387 | if (parent == NULL) { |
388 | @@ -689,7 +687,10 @@ |
389 | |
390 | for (children = node->children, position = 0; children != NULL; children = children->next, position++) { |
391 | /* g_debug("Looking at child: %d", position); */ |
392 | - guint childid = parse_node_get_id(children); |
393 | + gint childid = parse_node_get_id(children); |
394 | + if (childid < 0) { |
395 | + continue; |
396 | + } |
397 | DbusmenuMenuitem * childmi = NULL; |
398 | |
399 | GList * childsearch = NULL; |
400 | |
401 | === modified file 'libdbusmenu-glib/client.h' |
402 | --- libdbusmenu-glib/client.h 2009-12-10 04:57:31 +0000 |
403 | +++ libdbusmenu-glib/client.h 2010-02-04 01:26:14 +0000 |
404 | @@ -50,9 +50,9 @@ |
405 | #define DBUSMENU_CLIENT_PROP_DBUS_NAME "dbus-name" |
406 | #define DBUSMENU_CLIENT_PROP_DBUS_OBJECT "dbus-object" |
407 | |
408 | -#define DBUSMENU_CLIENT_TYPES_DEFAULT "menuitem" |
409 | +#define DBUSMENU_CLIENT_TYPES_DEFAULT "standard" |
410 | #define DBUSMENU_CLIENT_TYPES_SEPARATOR "separator" |
411 | -#define DBUSMENU_CLIENT_TYPES_IMAGE "menuitem" |
412 | +#define DBUSMENU_CLIENT_TYPES_IMAGE "standard" |
413 | |
414 | /** |
415 | DbusmenuClientClass: |
416 | |
417 | === modified file 'libdbusmenu-glib/dbus-menu.xml' |
418 | --- libdbusmenu-glib/dbus-menu.xml 2010-01-24 20:08:51 +0000 |
419 | +++ libdbusmenu-glib/dbus-menu.xml 2010-02-04 01:26:14 +0000 |
420 | @@ -8,6 +8,7 @@ |
421 | |
422 | Authors: |
423 | Ted Gould <ted@canonical.com> |
424 | + Aurelien Gateau <ted@canonical.com> |
425 | |
426 | This program is free software: you can redistribute it and/or modify it |
427 | under the terms of either or both of the following licenses: |
428 | @@ -27,166 +28,275 @@ |
429 | License version 3 and version 2.1 along with this program. If not, see |
430 | <http://www.gnu.org/licenses/> |
431 | --> |
432 | -<node name="/"> |
433 | +<node name="/" xmlns:dox="http://www.ayatana.org/dbus/dox.dtd"> |
434 | <interface name="org.ayatana.dbusmenu"> |
435 | + <dox:d><![CDATA[ |
436 | + The goal of this DBus interface is to be able to pass menu items |
437 | + through DBus. |
438 | + |
439 | + Items are represented with a unique numeric id and a dictionary of |
440 | + properties. |
441 | + |
442 | + Available properties are: |
443 | + |
444 | + <table> |
445 | + <tr> |
446 | + <th>Name</th> |
447 | + <th>Type</th> |
448 | + <th>Description</th> |
449 | + <th>Default Value</th> |
450 | + </tr> |
451 | + <tr> |
452 | + <td>type</td> |
453 | + <td>String</td> |
454 | + <td>Can be one of: |
455 | + - "standard": an item which can be clicked to trigger an action or |
456 | + show another menu |
457 | + - "separator": a separator |
458 | + |
459 | + Vendor specific types can be added by prefixing them with |
460 | + "x-<vendor>-". |
461 | + </td> |
462 | + <td>"standard"</td> |
463 | + </tr> |
464 | + <tr> |
465 | + <td>label</td> |
466 | + <td>string</td> |
467 | + <td>Text of the item, except that: |
468 | + -# two consecutive underscore characters "__" are displayed as a |
469 | + single underscore, |
470 | + -# any remaining underscore characters are not displayed at all, |
471 | + -# the first of those remaining underscore characters (unless it is |
472 | + the last character in the string) indicates that the following |
473 | + character is the access key. |
474 | + </td> |
475 | + <td>""</td> |
476 | + </tr> |
477 | + <tr> |
478 | + <td>enabled</td> |
479 | + <td>boolean</td> |
480 | + <td>Whether the item can be activated or not.</td> |
481 | + <td>true</td> |
482 | + </tr> |
483 | + <tr> |
484 | + <td>icon-name</td> |
485 | + <td>string</td> |
486 | + <td>Icon name of the item, following the freedesktop.org icon spec.</td> |
487 | + <td>""</td> |
488 | + </tr> |
489 | + <tr> |
490 | + <td>icon-data</td> |
491 | + <td>binary</td> |
492 | + <td>PNG data of the icon.</td> |
493 | + <td>Empty</td> |
494 | + </tr> |
495 | + <tr> |
496 | + <td>toggle-type</td> |
497 | + <td>string</td> |
498 | + <td> |
499 | + If the item can be toggled, this property should be set to: |
500 | + - "checkmark": Item is an independent togglable item |
501 | + - "radio": Item is part of a group where only one item can be |
502 | + toggled at a time |
503 | + - "": Item cannot be toggled |
504 | + </td> |
505 | + <td>""</td> |
506 | + </tr> |
507 | + <tr> |
508 | + <td>toggle-state</td> |
509 | + <td>int</td> |
510 | + <td> |
511 | + Describe the current state of a "togglable" item. Can be one of: |
512 | + - 0 = off |
513 | + - 1 = on |
514 | + - anything else = indeterminate |
515 | + |
516 | + Note: |
517 | + The implementation does not itself handle ensuring that only one |
518 | + item in a radio group is set to "on", or that a group does not have |
519 | + "on" and "indeterminate" items simultaneously; maintaining this |
520 | + policy is up to the toolkit wrappers. |
521 | + </td> |
522 | + <td>0</td> |
523 | + </tr> |
524 | + <tr> |
525 | + <td>children-display</td> |
526 | + <td>string</td> |
527 | + <td> |
528 | + If the menu item has children this property should be set to |
529 | + "submenu". |
530 | + </td> |
531 | + <td>""</td> |
532 | + </tr> |
533 | + </table> |
534 | + |
535 | + Vendor specific properties can be added by prefixing them with |
536 | + "x-<vendor>-". |
537 | + ]]></dox:d> |
538 | |
539 | <!-- Properties --> |
540 | -<!-- |
541 | -Provides the version of the DBusmenu API that this API is |
542 | -implementing. |
543 | ---> |
544 | - <property name="version" type="u" access="read"/> |
545 | + <property name="version" type="u" access="read"> |
546 | + <dox:d> |
547 | + Provides the version of the DBusmenu API that this API is |
548 | + implementing. |
549 | + </dox:d> |
550 | + </property> |
551 | |
552 | <!-- Functions --> |
553 | |
554 | -<!-- |
555 | -Provides an XML representation of the menu hierarchy |
556 | - |
557 | -@param parentId The ID of the parent node for the layout. For |
558 | - grabbing the layout from the root node use zero. |
559 | -@param revision The revision number of the layout. For matching |
560 | - with layoutUpdated signals. |
561 | -@param layout The layout as an XML string of IDs. |
562 | - |
563 | -XML syntax: |
564 | - |
565 | -<menu id="1"> # Root container |
566 | - <menu id="2"> # First level menu, for example "File" |
567 | - <menu id="3"/> ~ Second level menu, for example "Open" |
568 | - <menu id="4"/> |
569 | - ... |
570 | - </menu> |
571 | - <menu id="5"> # Another first level menu, say "Edit" |
572 | - ... |
573 | - </menu> |
574 | - ... |
575 | + <method name="GetLayout"> |
576 | + <dox:d><![CDATA[ |
577 | + Provides an XML representation of the menu hierarchy |
578 | + |
579 | + XML syntax: |
580 | + |
581 | + @verbatim |
582 | +<menu id="1" revision="2"> # Root container |
583 | + <menu id="2" revision="2"> # First level menu, for example "File" |
584 | + <menu id="3" revision="2"/> ~ Second level menu, for example "Open" |
585 | + <menu id="4" revision="3"/> |
586 | + ... |
587 | + </menu> |
588 | + <menu id="5" revision="2"> # Another first level menu, say "Edit" |
589 | + ... |
590 | + </menu> |
591 | + ... |
592 | </menu> |
593 | ---> |
594 | - <method name="GetLayout"> |
595 | - <arg type="u" name="parentId" direction="in" /> |
596 | - <arg type="u" name="revision" direction="out" /> |
597 | - <arg type="s" name="layout" direction="out" /> |
598 | + @endverbatim |
599 | + ]]></dox:d> |
600 | + <arg type="i" name="parentId" direction="in"> |
601 | + <dox:d>The ID of the parent node for the layout. For |
602 | + grabbing the layout from the root node use zero.</dox:d> |
603 | + </arg> |
604 | + <arg type="u" name="revision" direction="out"> |
605 | + <dox:d>The revision number of the layout. For matching |
606 | + with layoutUpdated signals.</dox:d> |
607 | + </arg> |
608 | + <arg type="s" name="layout" direction="out"> |
609 | + <dox:d>The layout as an XML string of IDs.</dox:d> |
610 | + </arg> |
611 | </method> |
612 | |
613 | -<!-- |
614 | -Returns the list of items which are children of @a parentId. |
615 | - |
616 | -@param Ids A list of ids that we should be finding the properties |
617 | - on. If the list is empty, all menu items should be sent. |
618 | -@param propertyNames list of string the list of item properties we |
619 | - are interested in. If there are no entries in the list all of |
620 | - the properties will be sent. |
621 | - |
622 | -An item is represented as a struct following this format: |
623 | -@li id unsigned the item id |
624 | -@li properties map(string => variant) the requested item properties |
625 | - |
626 | ---> |
627 | <method name="GetGroupProperties"> |
628 | - <arg type="au" name="Ids" direction="in" /> |
629 | - <arg type="as" name="propertyNames" direction="in" /> |
630 | - <arg type="a(ua{sv})" name="properties" direction="out" /> |
631 | + <annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="QVariantList"/> |
632 | + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="DBusMenuItemList"/> |
633 | + <dox:d> |
634 | + Returns the list of items which are children of @a parentId. |
635 | + </dox:d> |
636 | + <arg type="ai" name="ids" direction="in" > |
637 | + <dox:d> |
638 | + A list of ids that we should be finding the properties |
639 | + on. If the list is empty, all menu items should be sent. |
640 | + </dox:d> |
641 | + </arg> |
642 | + <arg type="as" name="propertyNames" direction="in" > |
643 | + <dox:d> |
644 | + The list of item properties we are |
645 | + interested in. If there are no entries in the list all of |
646 | + the properties will be sent. |
647 | + </dox:d> |
648 | + </arg> |
649 | + <arg type="a(ia{sv})" name="properties" direction="out" > |
650 | + <dox:d> |
651 | + An array of property values. |
652 | + An item in this area is represented as a struct following |
653 | + this format: |
654 | + @li id unsigned the item id |
655 | + @li properties map(string => variant) the requested item properties |
656 | + </dox:d> |
657 | + </arg> |
658 | </method> |
659 | |
660 | <method name="GetChildren"> |
661 | - <arg type="u" name="id" direction="in" /> |
662 | + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="DBusMenuItemList"/> |
663 | + <arg type="i" name="id" direction="in" /> |
664 | <arg type="as" name="propertyNames" direction="in" /> |
665 | - <arg type="a(ua{sv})" name="properties" direction="out" /> |
666 | + <arg type="a(ia{sv})" name="properties" direction="out" /> |
667 | </method> |
668 | |
669 | -<!-- |
670 | -Each menu item has a set of properties. Property keys are in menuitem.h: |
671 | - |
672 | -@li type string Type of the item (see below) |
673 | -@li label string Text of the item |
674 | -@li icon-data binary Raw data of the icon (TODO: define format) |
675 | -@li icon string Icon name of the item, following icon spec |
676 | -@li sensitive boolean Whether the item can be activated or not |
677 | -@li visible boolean Whether the item is visible or not (XXX: Is this necessary?) |
678 | -@li checked boolean Whether a checkbox or radio item is checked |
679 | -@li shortcut string The keyboard shortcut |
680 | - |
681 | -@c type property is an enum which can take the following values (client.h): |
682 | - |
683 | -@li action An item which can be clicked to trigger an action |
684 | -@li checkbox An item which can be checked or unchecked |
685 | -@li radio An item which can be checked or unchecked as part of a group |
686 | -@li separator A separator |
687 | -@li menu An item which contains more items |
688 | ---> |
689 | <method name="GetProperty"> |
690 | - <arg type="u" name="id" direction="in" /> |
691 | + <arg type="i" name="id" direction="in" /> |
692 | <arg type="s" name="name" direction="in" /> |
693 | <arg type="v" name="value" direction="out" /> |
694 | </method> |
695 | |
696 | -<!-- |
697 | -Returns multiple properties in one call. This is more efficient than |
698 | -GetProperty. |
699 | - |
700 | -@param id unsigned the item whose properties we want to retrieve. |
701 | -@param propertyNames list of string name of the properties we want. If the list contains no entries, all properties are sent. |
702 | ---> |
703 | <method name="GetProperties"> |
704 | + <dox:d> |
705 | + Returns multiple properties in one call. This is more efficient than |
706 | + GetProperty. |
707 | + |
708 | + </dox:d> |
709 | <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="QVariantMap"/> |
710 | - <arg type="u" name="id" direction="in" /> |
711 | - <arg type="as" name="propertyNames" direction="in" /> |
712 | + <arg type="i" name="id" direction="in" > |
713 | + <dox:d>The item whose properties we want to retrieve.</dox:d> |
714 | + </arg> |
715 | + <arg type="as" name="propertyNames" direction="in" > |
716 | + <dox:d>List of string name of the properties we want. If the list contains no entries, all properties are sent.</dox:d> |
717 | + </arg> |
718 | <arg type="a{sv}" name="properties" direction="out" /> |
719 | </method> |
720 | |
721 | -<!-- |
722 | -This is called by the applet to notify the application an event happened on a |
723 | -menu item. |
724 | - |
725 | -@param id the id of the item which received the event |
726 | -@param type the type of event |
727 | -@param data event-specific data |
728 | -@param timestamp The time that the event occured if available or the time the message was sent if not. |
729 | - |
730 | -@a type can be one of the following: |
731 | - |
732 | -@li "clicked" |
733 | -@li "hovered" |
734 | - |
735 | -Vendor specific events can be added by prefixing them with "x-<vendor>-" |
736 | ---> |
737 | <method name="Event"> |
738 | - <arg type="u" name="id" direction="in" /> |
739 | - <arg type="s" name="eventId" direction="in" /> |
740 | - <arg type="v" name="data" direction="in" /> |
741 | - <arg type="u" name="timestamp" direction="in" /> |
742 | + <dox:d><![CDATA[ |
743 | + This is called by the applet to notify the application an event happened on a |
744 | + menu item. |
745 | + |
746 | + @a type can be one of the following: |
747 | + |
748 | + @li "clicked" |
749 | + @li "hovered" |
750 | + |
751 | + Vendor specific events can be added by prefixing them with "x-<vendor>-" |
752 | + ]]></dox:d> |
753 | + <arg type="i" name="id" direction="in" > |
754 | + <dox:d>the id of the item which received the event</dox:d> |
755 | + </arg> |
756 | + <arg type="s" name="eventId" direction="in" > |
757 | + <dox:d>the type of event</dox:d> |
758 | + </arg> |
759 | + <arg type="v" name="data" direction="in" > |
760 | + <dox:d>event-specific data</dox:d> |
761 | + </arg> |
762 | + <arg type="u" name="timestamp" direction="in" > |
763 | + <dox:d>The time that the event occured if available or the time the message was sent if not</dox:d> |
764 | + </arg> |
765 | </method> |
766 | |
767 | <!-- Signals --> |
768 | -<!-- |
769 | -Triggered by the application to notify the applet that the property @a property |
770 | -from item @a id has changed to @a value. |
771 | ---> |
772 | <signal name="ItemPropertyUpdated"> |
773 | - <arg type="u" name="id" direction="out" /> |
774 | + <dox:d> |
775 | + Triggered by the application to notify the applet that the property @a property |
776 | + from item @a id has changed to @a value. |
777 | + </dox:d> |
778 | + <arg type="i" name="id" direction="out" /> |
779 | <arg type="s" name="prop" direction="out" /> |
780 | <arg type="v" name="value" direction="out" /> |
781 | </signal> |
782 | |
783 | -<!-- |
784 | -Triggered by the application to notify the applet that all properties of item |
785 | -@a id should be considered outdated |
786 | ---> |
787 | <signal name="ItemUpdated"> |
788 | - <arg type="u" name="id" direction="out" /> |
789 | + <dox:d> |
790 | + Triggered by the application to notify the applet that all properties of item |
791 | + </dox:d> |
792 | + <arg type="i" name="id" direction="out" > |
793 | + <dox:d>id which should be considered outdated</dox:d> |
794 | + </arg> |
795 | </signal> |
796 | |
797 | -<!-- |
798 | -Triggered by the application to notify display of a layout update, up to |
799 | -revision |
800 | -@param revsion The revision of the layout that we're currently on |
801 | -@param parent If the layout update is only of a subtree, this is the parent |
802 | - item for the entries that have changed. It is zero if the |
803 | - whole layout should be considered invalid. |
804 | ---> |
805 | <signal name="LayoutUpdated"> |
806 | - <arg type="i" name="revision" direction="out" /> |
807 | - <arg type="u" name="parent" direction="out" /> |
808 | + <dox:d> |
809 | + Triggered by the application to notify display of a layout update, up to |
810 | + revision |
811 | + </dox:d> |
812 | + <arg type="u" name="revision" direction="out" > |
813 | + <dox:d>The revision of the layout that we're currently on</dox:d> |
814 | + </arg> |
815 | + <arg type="i" name="parent" direction="out" > |
816 | + <dox:d> |
817 | + If the layout update is only of a subtree, this is the |
818 | + parent item for the entries that have changed. It is zero if |
819 | + the whole layout should be considered invalid. |
820 | + </dox:d> |
821 | + </arg> |
822 | </signal> |
823 | |
824 | <!-- End of interesting stuff --> |
825 | |
826 | === modified file 'libdbusmenu-glib/menuitem.c' |
827 | --- libdbusmenu-glib/menuitem.c 2010-01-22 20:53:39 +0000 |
828 | +++ libdbusmenu-glib/menuitem.c 2010-02-04 01:26:14 +0000 |
829 | @@ -55,7 +55,7 @@ |
830 | typedef struct _DbusmenuMenuitemPrivate DbusmenuMenuitemPrivate; |
831 | struct _DbusmenuMenuitemPrivate |
832 | { |
833 | - guint id; |
834 | + gint id; |
835 | GList * children; |
836 | GHashTable * properties; |
837 | gboolean root; |
838 | @@ -207,7 +207,7 @@ |
839 | G_TYPE_NONE, 0, G_TYPE_NONE); |
840 | |
841 | g_object_class_install_property (object_class, PROP_ID, |
842 | - g_param_spec_uint("id", "ID for the menu item", |
843 | + g_param_spec_int("id", "ID for the menu item", |
844 | "This is a unique indentifier for the menu item.", |
845 | 0, 30000, 0, |
846 | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); |
847 | @@ -246,7 +246,7 @@ |
848 | return; |
849 | } |
850 | |
851 | -static guint menuitem_next_id = 1; |
852 | +static gint menuitem_next_id = 0; |
853 | |
854 | /* A small little function to both clear the insides of a |
855 | value as well as the memory it itself uses. */ |
856 | @@ -315,9 +315,9 @@ |
857 | |
858 | switch (id) { |
859 | case PROP_ID: |
860 | - priv->id = g_value_get_uint(value); |
861 | + priv->id = g_value_get_int(value); |
862 | if (priv->id > menuitem_next_id) { |
863 | - menuitem_next_id = priv->id; |
864 | + menuitem_next_id = priv->id + 1; |
865 | } |
866 | break; |
867 | } |
868 | @@ -332,10 +332,7 @@ |
869 | |
870 | switch (id) { |
871 | case PROP_ID: |
872 | - if (priv->id == 0) { |
873 | - priv->id = menuitem_next_id++; |
874 | - } |
875 | - g_value_set_uint(value, priv->id); |
876 | + g_value_set_int(value, priv->id); |
877 | break; |
878 | } |
879 | |
880 | @@ -355,7 +352,7 @@ |
881 | DbusmenuMenuitem * |
882 | dbusmenu_menuitem_new (void) |
883 | { |
884 | - return g_object_new(DBUSMENU_TYPE_MENUITEM, NULL); |
885 | + return g_object_new(DBUSMENU_TYPE_MENUITEM, "id", menuitem_next_id++, NULL); |
886 | } |
887 | |
888 | /** |
889 | @@ -367,7 +364,7 @@ |
890 | Return value: A newly allocated #DbusmenuMenuitem. |
891 | */ |
892 | DbusmenuMenuitem * |
893 | -dbusmenu_menuitem_new_with_id (guint id) |
894 | +dbusmenu_menuitem_new_with_id (gint id) |
895 | { |
896 | DbusmenuMenuitem * mi = g_object_new(DBUSMENU_TYPE_MENUITEM, "id", id, NULL); |
897 | /* g_debug("New Menuitem id %d goal id %d", dbusmenu_menuitem_get_id(mi), id); */ |
898 | @@ -642,7 +639,7 @@ |
899 | can't be found. |
900 | */ |
901 | DbusmenuMenuitem * |
902 | -dbusmenu_menuitem_child_find (DbusmenuMenuitem * mi, guint id) |
903 | +dbusmenu_menuitem_child_find (DbusmenuMenuitem * mi, gint id) |
904 | { |
905 | g_return_val_if_fail(DBUSMENU_IS_MENUITEM(mi), NULL); |
906 | |
907 | @@ -661,7 +658,7 @@ |
908 | |
909 | typedef struct { |
910 | DbusmenuMenuitem * mi; |
911 | - guint id; |
912 | + gint id; |
913 | } find_id_t; |
914 | |
915 | /* Basically the heart of the find_id that matches the |
916 | @@ -697,7 +694,7 @@ |
917 | represented by @mi. |
918 | */ |
919 | DbusmenuMenuitem * |
920 | -dbusmenu_menuitem_find_id (DbusmenuMenuitem * mi, guint id) |
921 | +dbusmenu_menuitem_find_id (DbusmenuMenuitem * mi, gint id) |
922 | { |
923 | g_return_val_if_fail(DBUSMENU_IS_MENUITEM(mi), NULL); |
924 | find_id_t find_id = {mi: NULL, id: id}; |
925 | @@ -1060,7 +1057,7 @@ |
926 | { |
927 | g_return_if_fail(DBUSMENU_IS_MENUITEM(mi)); |
928 | |
929 | - guint id = 0; |
930 | + gint id = 0; |
931 | if (!dbusmenu_menuitem_get_root(mi)) { |
932 | id = dbusmenu_menuitem_get_id(mi); |
933 | } |
934 | |
935 | === modified file 'libdbusmenu-glib/menuitem.h' |
936 | --- libdbusmenu-glib/menuitem.h 2010-01-22 20:10:27 +0000 |
937 | +++ libdbusmenu-glib/menuitem.h 2010-02-04 01:26:14 +0000 |
938 | @@ -52,19 +52,19 @@ |
939 | |
940 | #define DBUSMENU_MENUITEM_PROP_TYPE "type" |
941 | #define DBUSMENU_MENUITEM_PROP_VISIBLE "visible" |
942 | -#define DBUSMENU_MENUITEM_PROP_SENSITIVE "sensitive" |
943 | +#define DBUSMENU_MENUITEM_PROP_ENABLED "enabled" |
944 | #define DBUSMENU_MENUITEM_PROP_LABEL "label" |
945 | -#define DBUSMENU_MENUITEM_PROP_ICON "icon" |
946 | +#define DBUSMENU_MENUITEM_PROP_ICON_NAME "icon-name" |
947 | #define DBUSMENU_MENUITEM_PROP_ICON_DATA "icon-data" |
948 | #define DBUSMENU_MENUITEM_PROP_TOGGLE_TYPE "toggle-type" |
949 | -#define DBUSMENU_MENUITEM_PROP_TOGGLE_CHECKED "toggle-checked" |
950 | +#define DBUSMENU_MENUITEM_PROP_TOGGLE_STATE "toggle-state" |
951 | |
952 | #define DBUSMENU_MENUITEM_TOGGLE_CHECK "checkmark" |
953 | #define DBUSMENU_MENUITEM_TOGGLE_RADIO "radio" |
954 | |
955 | -#define DBUSMENU_MENUITEM_TOGGLE_STATE_UNCHECKED "unchecked" |
956 | -#define DBUSMENU_MENUITEM_TOGGLE_STATE_CHECKED "checked" |
957 | -#define DBUSMENU_MENUITEM_TOGGLE_STATE_UNKNOWN "indeterminate" |
958 | +#define DBUSMENU_MENUITEM_TOGGLE_STATE_UNCHECKED 0 |
959 | +#define DBUSMENU_MENUITEM_TOGGLE_STATE_CHECKED 1 |
960 | +#define DBUSMENU_MENUITEM_TOGGLE_STATE_UNKNOWN -1 |
961 | |
962 | /** |
963 | DbusmenuMenuitem: |
964 | @@ -122,7 +122,7 @@ |
965 | GType dbusmenu_menuitem_get_type (void); |
966 | |
967 | DbusmenuMenuitem * dbusmenu_menuitem_new (void) G_GNUC_WARN_UNUSED_RESULT; |
968 | -DbusmenuMenuitem * dbusmenu_menuitem_new_with_id (guint id) G_GNUC_WARN_UNUSED_RESULT; |
969 | +DbusmenuMenuitem * dbusmenu_menuitem_new_with_id (gint id) G_GNUC_WARN_UNUSED_RESULT; |
970 | guint dbusmenu_menuitem_get_id (DbusmenuMenuitem * mi); |
971 | |
972 | GList * dbusmenu_menuitem_get_children (DbusmenuMenuitem * mi); |
973 | @@ -134,8 +134,8 @@ |
974 | gboolean dbusmenu_menuitem_child_delete (DbusmenuMenuitem * mi, DbusmenuMenuitem * child); |
975 | gboolean dbusmenu_menuitem_child_add_position (DbusmenuMenuitem * mi, DbusmenuMenuitem * child, guint position); |
976 | gboolean dbusmenu_menuitem_child_reorder (DbusmenuMenuitem * mi, DbusmenuMenuitem * child, guint position); |
977 | -DbusmenuMenuitem * dbusmenu_menuitem_child_find (DbusmenuMenuitem * mi, guint id); |
978 | -DbusmenuMenuitem * dbusmenu_menuitem_find_id (DbusmenuMenuitem * mi, guint id); |
979 | +DbusmenuMenuitem * dbusmenu_menuitem_child_find (DbusmenuMenuitem * mi, gint id); |
980 | +DbusmenuMenuitem * dbusmenu_menuitem_find_id (DbusmenuMenuitem * mi, gint id); |
981 | |
982 | gboolean dbusmenu_menuitem_property_set (DbusmenuMenuitem * mi, const gchar * property, const gchar * value); |
983 | gboolean dbusmenu_menuitem_property_set_value (DbusmenuMenuitem * mi, const gchar * property, const GValue * value); |
984 | |
985 | === modified file 'libdbusmenu-glib/server-marshal.list' |
986 | --- libdbusmenu-glib/server-marshal.list 2009-12-09 17:17:32 +0000 |
987 | +++ libdbusmenu-glib/server-marshal.list 2010-02-04 01:26:14 +0000 |
988 | @@ -1,2 +1,2 @@ |
989 | VOID: UINT, STRING, POINTER |
990 | -VOID: INT, UINT |
991 | +VOID: UINT, INT |
992 | |
993 | === modified file 'libdbusmenu-glib/server.c' |
994 | --- libdbusmenu-glib/server.c 2010-01-24 20:08:51 +0000 |
995 | +++ libdbusmenu-glib/server.c 2010-02-04 01:26:14 +0000 |
996 | @@ -35,12 +35,12 @@ |
997 | #include "server-marshal.h" |
998 | |
999 | /* DBus Prototypes */ |
1000 | -static gboolean _dbusmenu_server_get_layout (DbusmenuServer * server, guint parent, guint * revision, gchar ** layout, GError ** error); |
1001 | -static gboolean _dbusmenu_server_get_property (DbusmenuServer * server, guint id, gchar * property, gchar ** value, GError ** error); |
1002 | -static gboolean _dbusmenu_server_get_properties (DbusmenuServer * server, guint id, GPtrArray * properties, GHashTable ** dict, GError ** error); |
1003 | +static gboolean _dbusmenu_server_get_layout (DbusmenuServer * server, gint parent, guint * revision, gchar ** layout, GError ** error); |
1004 | +static gboolean _dbusmenu_server_get_property (DbusmenuServer * server, gint id, gchar * property, gchar ** value, GError ** error); |
1005 | +static gboolean _dbusmenu_server_get_properties (DbusmenuServer * server, gint id, GPtrArray * properties, GHashTable ** dict, GError ** error); |
1006 | static gboolean _dbusmenu_server_get_group_properties (DbusmenuServer * server, GArray * ids, GArray * properties, GHashTable ** values, GError ** error); |
1007 | -static gboolean _dbusmenu_server_event (DbusmenuServer * server, guint id, gchar * eventid, GValue * data, guint timestamp, GError ** error); |
1008 | -static gboolean _dbusmenu_server_get_children (DbusmenuServer * server, guint id, GPtrArray * properties, GPtrArray ** output, GError ** error); |
1009 | +static gboolean _dbusmenu_server_event (DbusmenuServer * server, gint id, gchar * eventid, GValue * data, guint timestamp, GError ** error); |
1010 | +static gboolean _dbusmenu_server_get_children (DbusmenuServer * server, gint id, GPtrArray * properties, GPtrArray ** output, GError ** error); |
1011 | |
1012 | #include "dbusmenu-server.h" |
1013 | |
1014 | @@ -162,8 +162,8 @@ |
1015 | G_SIGNAL_RUN_LAST, |
1016 | G_STRUCT_OFFSET(DbusmenuServerClass, layout_updated), |
1017 | NULL, NULL, |
1018 | - _dbusmenu_server_marshal_VOID__INT_UINT, |
1019 | - G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_UINT); |
1020 | + _dbusmenu_server_marshal_VOID__UINT_INT, |
1021 | + G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_INT); |
1022 | |
1023 | |
1024 | g_object_class_install_property (object_class, PROP_DBUS_OBJECT, |
1025 | @@ -366,7 +366,7 @@ |
1026 | |
1027 | /* DBus interface */ |
1028 | static gboolean |
1029 | -_dbusmenu_server_get_layout (DbusmenuServer * server, guint parent, guint * revision, gchar ** layout, GError ** error) |
1030 | +_dbusmenu_server_get_layout (DbusmenuServer * server, gint parent, guint * revision, gchar ** layout, GError ** error) |
1031 | { |
1032 | DbusmenuServerPrivate * priv = DBUSMENU_SERVER_GET_PRIVATE(server); |
1033 | |
1034 | @@ -396,7 +396,7 @@ |
1035 | } |
1036 | |
1037 | static gboolean |
1038 | -_dbusmenu_server_get_property (DbusmenuServer * server, guint id, gchar * property, gchar ** value, GError ** error) |
1039 | +_dbusmenu_server_get_property (DbusmenuServer * server, gint id, gchar * property, gchar ** value, GError ** error) |
1040 | { |
1041 | DbusmenuServerPrivate * priv = DBUSMENU_SERVER_GET_PRIVATE(server); |
1042 | DbusmenuMenuitem * mi = dbusmenu_menuitem_find_id(priv->root, id); |
1043 | @@ -441,7 +441,7 @@ |
1044 | } |
1045 | |
1046 | static gboolean |
1047 | -_dbusmenu_server_get_properties (DbusmenuServer * server, guint id, GPtrArray * properties, GHashTable ** dict, GError ** error) |
1048 | +_dbusmenu_server_get_properties (DbusmenuServer * server, gint id, GPtrArray * properties, GHashTable ** dict, GError ** error) |
1049 | { |
1050 | DbusmenuServerPrivate * priv = DBUSMENU_SERVER_GET_PRIVATE(server); |
1051 | DbusmenuMenuitem * mi = dbusmenu_menuitem_find_id(priv->root, id); |
1052 | @@ -475,12 +475,12 @@ |
1053 | } |
1054 | |
1055 | static void |
1056 | -_gvalue_array_append_uint(GValueArray *array, guint i) |
1057 | +_gvalue_array_append_int(GValueArray *array, gint i) |
1058 | { |
1059 | GValue value = {0}; |
1060 | |
1061 | - g_value_init(&value, G_TYPE_UINT); |
1062 | - g_value_set_uint(&value, i); |
1063 | + g_value_init(&value, G_TYPE_INT); |
1064 | + g_value_set_int(&value, i); |
1065 | g_value_array_append(array, &value); |
1066 | g_value_unset(&value); |
1067 | } |
1068 | @@ -502,18 +502,18 @@ |
1069 | DbusmenuMenuitem * mi = DBUSMENU_MENUITEM(data); |
1070 | GPtrArray * output = (GPtrArray *)(user_data); |
1071 | |
1072 | - guint id = dbusmenu_menuitem_get_id(mi); |
1073 | + gint id = dbusmenu_menuitem_get_id(mi); |
1074 | GHashTable * dict = dbusmenu_menuitem_properties_copy(mi); |
1075 | |
1076 | GValueArray * item = g_value_array_new(1); |
1077 | - _gvalue_array_append_uint(item, id); |
1078 | + _gvalue_array_append_int(item, id); |
1079 | _gvalue_array_append_hashtable(item, dict); |
1080 | |
1081 | g_ptr_array_add(output, item); |
1082 | } |
1083 | |
1084 | static gboolean |
1085 | -_dbusmenu_server_get_children (DbusmenuServer * server, guint id, GPtrArray * properties, GPtrArray ** output, GError ** error) |
1086 | +_dbusmenu_server_get_children (DbusmenuServer * server, gint id, GPtrArray * properties, GPtrArray ** output, GError ** error) |
1087 | { |
1088 | DbusmenuServerPrivate * priv = DBUSMENU_SERVER_GET_PRIVATE(server); |
1089 | DbusmenuMenuitem * mi = id == 0 ? priv->root : dbusmenu_menuitem_find_id(priv->root, id); |
1090 | @@ -537,7 +537,7 @@ |
1091 | } |
1092 | |
1093 | static gboolean |
1094 | -_dbusmenu_server_event (DbusmenuServer * server, guint id, gchar * eventid, GValue * data, guint timestamp, GError ** error) |
1095 | +_dbusmenu_server_event (DbusmenuServer * server, gint id, gchar * eventid, GValue * data, guint timestamp, GError ** error) |
1096 | { |
1097 | DbusmenuServerPrivate * priv = DBUSMENU_SERVER_GET_PRIVATE(server); |
1098 | DbusmenuMenuitem * mi = dbusmenu_menuitem_find_id(priv->root, id); |
1099 | |
1100 | === modified file 'libdbusmenu-glib/server.h' |
1101 | --- libdbusmenu-glib/server.h 2010-01-22 21:22:54 +0000 |
1102 | +++ libdbusmenu-glib/server.h 2010-02-04 01:26:14 +0000 |
1103 | @@ -70,8 +70,8 @@ |
1104 | GObjectClass parent_class; |
1105 | |
1106 | /* Signals */ |
1107 | - void (*id_prop_update)(guint id, gchar * property, gchar * value); |
1108 | - void (*id_update)(guint id); |
1109 | + void (*id_prop_update)(gint id, gchar * property, gchar * value); |
1110 | + void (*id_update)(gint id); |
1111 | void (*layout_updated)(gint revision); |
1112 | |
1113 | /* Reserved */ |
1114 | |
1115 | === modified file 'libdbusmenu-gtk/client.c' |
1116 | --- libdbusmenu-gtk/client.c 2010-01-24 20:09:10 +0000 |
1117 | +++ libdbusmenu-gtk/client.c 2010-02-04 01:26:14 +0000 |
1118 | @@ -136,7 +136,7 @@ |
1119 | { |
1120 | gboolean val = TRUE; |
1121 | if (value != NULL) { |
1122 | - val = dbusmenu_menuitem_property_get_bool(mi, DBUSMENU_MENUITEM_PROP_SENSITIVE); |
1123 | + val = dbusmenu_menuitem_property_get_bool(mi, DBUSMENU_MENUITEM_PROP_ENABLED); |
1124 | } |
1125 | gtk_widget_set_sensitive(GTK_WIDGET(gmi), val); |
1126 | return; |
1127 | @@ -167,18 +167,18 @@ |
1128 | |
1129 | /* Process the sensitive property */ |
1130 | static void |
1131 | -process_toggle_checked (DbusmenuMenuitem * mi, GtkMenuItem * gmi, const GValue * value) |
1132 | +process_toggle_state (DbusmenuMenuitem * mi, GtkMenuItem * gmi, const GValue * value) |
1133 | { |
1134 | if (!IS_GENERICMENUITEM(gmi)) return; |
1135 | |
1136 | GenericmenuitemState state = GENERICMENUITEM_STATE_UNCHECKED; |
1137 | |
1138 | - if (value != NULL && G_VALUE_TYPE(value) == G_TYPE_STRING) { |
1139 | - const gchar * strval = g_value_get_string(value); |
1140 | + if (value != NULL && G_VALUE_TYPE(value) == G_TYPE_INT) { |
1141 | + int val = g_value_get_int(value); |
1142 | |
1143 | - if (!g_strcmp0(strval, DBUSMENU_MENUITEM_TOGGLE_STATE_CHECKED)) { |
1144 | + if (val == DBUSMENU_MENUITEM_TOGGLE_STATE_CHECKED) { |
1145 | state = GENERICMENUITEM_STATE_CHECKED; |
1146 | - } else if (!g_strcmp0(strval, DBUSMENU_MENUITEM_TOGGLE_STATE_UNKNOWN)) { |
1147 | + } else if (val == DBUSMENU_MENUITEM_TOGGLE_STATE_UNKNOWN) { |
1148 | state = GENERICMENUITEM_STATE_INDETERMINATE; |
1149 | } |
1150 | } |
1151 | @@ -196,12 +196,12 @@ |
1152 | gtk_menu_item_set_label(gmi, g_value_get_string(value)); |
1153 | } else if (!g_strcmp0(prop, DBUSMENU_MENUITEM_PROP_VISIBLE)) { |
1154 | process_visible(mi, gmi, value); |
1155 | - } else if (!g_strcmp0(prop, DBUSMENU_MENUITEM_PROP_SENSITIVE)) { |
1156 | + } else if (!g_strcmp0(prop, DBUSMENU_MENUITEM_PROP_ENABLED)) { |
1157 | process_sensitive(mi, gmi, value); |
1158 | } else if (!g_strcmp0(prop, DBUSMENU_MENUITEM_PROP_TOGGLE_TYPE)) { |
1159 | process_toggle_type(mi, gmi, value); |
1160 | - } else if (!g_strcmp0(prop, DBUSMENU_MENUITEM_PROP_TOGGLE_CHECKED)) { |
1161 | - process_toggle_checked(mi, gmi, value); |
1162 | + } else if (!g_strcmp0(prop, DBUSMENU_MENUITEM_PROP_TOGGLE_STATE)) { |
1163 | + process_toggle_state(mi, gmi, value); |
1164 | } |
1165 | |
1166 | return; |
1167 | @@ -284,9 +284,9 @@ |
1168 | |
1169 | /* Check our set of props to see if any are set already */ |
1170 | process_visible(item, gmi, dbusmenu_menuitem_property_get_value(item, DBUSMENU_MENUITEM_PROP_VISIBLE)); |
1171 | - process_sensitive(item, gmi, dbusmenu_menuitem_property_get_value(item, DBUSMENU_MENUITEM_PROP_SENSITIVE)); |
1172 | + process_sensitive(item, gmi, dbusmenu_menuitem_property_get_value(item, DBUSMENU_MENUITEM_PROP_ENABLED)); |
1173 | process_toggle_type(item, gmi, dbusmenu_menuitem_property_get_value(item, DBUSMENU_MENUITEM_PROP_TOGGLE_TYPE)); |
1174 | - process_toggle_checked(item, gmi, dbusmenu_menuitem_property_get_value(item, DBUSMENU_MENUITEM_PROP_TOGGLE_CHECKED)); |
1175 | + process_toggle_state(item, gmi, dbusmenu_menuitem_property_get_value(item, DBUSMENU_MENUITEM_PROP_TOGGLE_STATE)); |
1176 | |
1177 | /* Oh, we're a child, let's deal with that */ |
1178 | if (parent != NULL) { |
1179 | @@ -426,8 +426,8 @@ |
1180 | } |
1181 | |
1182 | image_property_handle(newitem, |
1183 | - DBUSMENU_MENUITEM_PROP_ICON, |
1184 | - dbusmenu_menuitem_property_get_value(newitem, DBUSMENU_MENUITEM_PROP_ICON), |
1185 | + DBUSMENU_MENUITEM_PROP_ICON_NAME, |
1186 | + dbusmenu_menuitem_property_get_value(newitem, DBUSMENU_MENUITEM_PROP_ICON_NAME), |
1187 | client); |
1188 | image_property_handle(newitem, |
1189 | DBUSMENU_MENUITEM_PROP_ICON_DATA, |
1190 | @@ -468,7 +468,7 @@ |
1191 | image_property_handle (DbusmenuMenuitem * item, const gchar * property, const GValue * invalue, gpointer userdata) |
1192 | { |
1193 | /* We're only looking at these two properties here */ |
1194 | - if (g_strcmp0(property, DBUSMENU_MENUITEM_PROP_ICON) != 0 && |
1195 | + if (g_strcmp0(property, DBUSMENU_MENUITEM_PROP_ICON_NAME) != 0 && |
1196 | g_strcmp0(property, DBUSMENU_MENUITEM_PROP_ICON_DATA) != 0) { |
1197 | return; |
1198 | } |
1199 | @@ -482,10 +482,10 @@ |
1200 | if (value == NULL || value[0] == '\0') { |
1201 | /* This means that we're unsetting a value. */ |
1202 | /* Try to use the other one */ |
1203 | - if (g_strcmp0(property, DBUSMENU_MENUITEM_PROP_ICON)) { |
1204 | + if (g_strcmp0(property, DBUSMENU_MENUITEM_PROP_ICON_NAME)) { |
1205 | property = DBUSMENU_MENUITEM_PROP_ICON_DATA; |
1206 | } else { |
1207 | - property = DBUSMENU_MENUITEM_PROP_ICON; |
1208 | + property = DBUSMENU_MENUITEM_PROP_ICON_NAME; |
1209 | } |
1210 | } |
1211 | |
1212 | @@ -507,7 +507,7 @@ |
1213 | } |
1214 | |
1215 | /* Now figure out what to change */ |
1216 | - if (!g_strcmp0(property, DBUSMENU_MENUITEM_PROP_ICON)) { |
1217 | + if (!g_strcmp0(property, DBUSMENU_MENUITEM_PROP_ICON_NAME)) { |
1218 | const gchar * iconname = dbusmenu_menuitem_property_get(item, property); |
1219 | if (iconname == NULL) { |
1220 | /* If there is no name, by golly we want no |
1221 | |
1222 | === modified file 'tests/test-gtk-label.json' |
1223 | --- tests/test-gtk-label.json 2010-01-07 16:40:45 +0000 |
1224 | +++ tests/test-gtk-label.json 2010-02-04 01:26:14 +0000 |
1225 | @@ -1,256 +1,256 @@ |
1226 | [ |
1227 | - {"id": 1, "type": "menuitem", |
1228 | + {"id": 1, "type": "standard", |
1229 | "label": "value1", |
1230 | "submenu": [ |
1231 | - {"id": 30, "type": "menuitem", |
1232 | + {"id": 30, "type": "standard", |
1233 | "label": "value30"}, |
1234 | - {"id": 31, "type": "menuitem", |
1235 | + {"id": 31, "type": "standard", |
1236 | "label": "value31"}, |
1237 | - {"id": 32, "type": "menuitem", |
1238 | + {"id": 32, "type": "standard", |
1239 | "label": "value32"}, |
1240 | - {"id": 33, "type": "menuitem", |
1241 | + {"id": 33, "type": "standard", |
1242 | "label": "value33"}, |
1243 | - {"id": 34, "type": "menuitem", |
1244 | + {"id": 34, "type": "standard", |
1245 | "label": "value34"}, |
1246 | - {"id": 35, "type": "menuitem", |
1247 | + {"id": 35, "type": "standard", |
1248 | "label": "value35"}, |
1249 | - {"id": 36, "type": "menuitem", |
1250 | + {"id": 36, "type": "standard", |
1251 | "label": "value36"}, |
1252 | - {"id": 37, "type": "menuitem", |
1253 | + {"id": 37, "type": "standard", |
1254 | "label": "value37"}, |
1255 | - {"id": 38, "type": "menuitem", |
1256 | + {"id": 38, "type": "standard", |
1257 | "label": "value38"}, |
1258 | - {"id": 39, "type": "menuitem", |
1259 | + {"id": 39, "type": "standard", |
1260 | "label": "value39"} |
1261 | ] |
1262 | }, |
1263 | - {"id": 2, "type": "menuitem", |
1264 | + {"id": 2, "type": "standard", |
1265 | "label": "value2", |
1266 | "submenu": [ |
1267 | - {"id": 20, "type": "menuitem", |
1268 | + {"id": 20, "type": "standard", |
1269 | "label": "value20"}, |
1270 | {"id": 21, "type": "separator", |
1271 | "label": "value21"}, |
1272 | - {"id": 22, "type": "menuitem", |
1273 | + {"id": 22, "type": "standard", |
1274 | "label": "value22"}, |
1275 | {"id": 23, "type": "separator", |
1276 | "label": "value23"}, |
1277 | - {"id": 24, "type": "menuitem", |
1278 | + {"id": 24, "type": "standard", |
1279 | "label": "value24"}, |
1280 | {"id": 25, "type": "separator", |
1281 | "label": "value25"}, |
1282 | - {"id": 26, "type": "menuitem", |
1283 | + {"id": 26, "type": "standard", |
1284 | "label": "value26"}, |
1285 | {"id": 27, "type": "separator", |
1286 | "label": "value27"}, |
1287 | - {"id": 28, "type": "menuitem", |
1288 | + {"id": 28, "type": "standard", |
1289 | "label": "value28"}, |
1290 | - {"id": 29, "type": "menuitem", "visible": "false", |
1291 | + {"id": 29, "type": "standard", "visible": "false", |
1292 | "label": "value29"} |
1293 | ] |
1294 | }, |
1295 | - {"id": 4, "type": "menuitem", |
1296 | + {"id": 4, "type": "standard", |
1297 | "label": "value4", |
1298 | "submenu": [ |
1299 | {"id": 40, |
1300 | - "type": "menuitem", |
1301 | - "sensitive": "true", |
1302 | + "type": "standard", |
1303 | + "enabled": "true", |
1304 | "label": "value40"}, |
1305 | {"id": 41, |
1306 | - "type": "menuitem", |
1307 | - "sensitive": "false", |
1308 | + "type": "standard", |
1309 | + "enabled": "false", |
1310 | "label": "value41"}, |
1311 | {"id": 42, |
1312 | - "type": "menuitem", |
1313 | - "sensitive": "true", |
1314 | + "type": "standard", |
1315 | + "enabled": "true", |
1316 | "label": "value42"}, |
1317 | {"id": 43, |
1318 | - "type": "menuitem", |
1319 | - "sensitive": "false", |
1320 | + "type": "standard", |
1321 | + "enabled": "false", |
1322 | "label": "value43"}, |
1323 | {"id": 44, |
1324 | - "type": "menuitem", |
1325 | - "sensitive": "true", |
1326 | + "type": "standard", |
1327 | + "enabled": "true", |
1328 | "label": "value44"}, |
1329 | {"id": 45, |
1330 | - "type": "menuitem", |
1331 | - "sensitive": "false", |
1332 | + "type": "standard", |
1333 | + "enabled": "false", |
1334 | "label": "value45"}, |
1335 | {"id": 46, |
1336 | - "type": "menuitem", |
1337 | - "sensitive": "true", |
1338 | + "type": "standard", |
1339 | + "enabled": "true", |
1340 | "label": "value46"}, |
1341 | {"id": 47, |
1342 | - "type": "menuitem", |
1343 | - "sensitive": "false", |
1344 | + "type": "standard", |
1345 | + "enabled": "false", |
1346 | "label": "value47"}, |
1347 | {"id": 48, |
1348 | - "type": "menuitem", |
1349 | - "sensitive": "true", |
1350 | + "type": "standard", |
1351 | + "enabled": "true", |
1352 | "label": "value48"}, |
1353 | {"id": 49, |
1354 | - "type": "menuitem", |
1355 | + "type": "standard", |
1356 | "visible": "false", |
1357 | - "sensitive": "false", |
1358 | + "enabled": "false", |
1359 | "label": "value49"} |
1360 | ] |
1361 | }, |
1362 | - {"id": 3, "type": "menuitem", |
1363 | + {"id": 3, "type": "standard", |
1364 | "label": "a super long label that is really of unreasonable length but we should make sure it makes it across the bus", |
1365 | "not.a.value": "A useless value", |
1366 | "submenu": [ |
1367 | - {"id": 10, "type": "menuitem", |
1368 | + {"id": 10, "type": "standard", |
1369 | "label": "value10"}, |
1370 | - {"id": 11, "type": "menuitem", |
1371 | + {"id": 11, "type": "standard", |
1372 | "label": "value11"}, |
1373 | - {"id": 12, "type": "menuitem", |
1374 | + {"id": 12, "type": "standard", |
1375 | "label": "value12"}, |
1376 | - {"id": 13, "type": "menuitem", |
1377 | + {"id": 13, "type": "standard", |
1378 | "label": "value13"}, |
1379 | - {"id": 14, "type": "menuitem", |
1380 | + {"id": 14, "type": "standard", |
1381 | "label": "value14"}, |
1382 | - {"id": 15, "type": "menuitem", |
1383 | + {"id": 15, "type": "standard", |
1384 | "label": "value15"}, |
1385 | - {"id": 16, "type": "menuitem", |
1386 | + {"id": 16, "type": "standard", |
1387 | "label": "value16"}, |
1388 | - {"id": 17, "type": "menuitem", |
1389 | + {"id": 17, "type": "standard", |
1390 | "label": "value17"}, |
1391 | - {"id": 18, "type": "menuitem", |
1392 | + {"id": 18, "type": "standard", |
1393 | "label": "value18"}, |
1394 | - {"id": 19, "type": "menuitem", |
1395 | + {"id": 19, "type": "standard", |
1396 | "label": "value19"} |
1397 | ] |
1398 | }, |
1399 | - {"id": 4, "type": "menuitem", |
1400 | + {"id": 4, "type": "standard", |
1401 | "label": "value2", |
1402 | "submenu": [ |
1403 | - {"id": 5, "type": "menuitem", |
1404 | + {"id": 5, "type": "standard", |
1405 | "label": "value5", |
1406 | "submenu": [ |
1407 | - {"id": 10, "type": "menuitem", |
1408 | + {"id": 10, "type": "standard", |
1409 | "label": "value10"}, |
1410 | - {"id": 11, "type": "menuitem", |
1411 | + {"id": 11, "type": "standard", |
1412 | "label": "value11"}, |
1413 | - {"id": 12, "type": "menuitem", |
1414 | + {"id": 12, "type": "standard", |
1415 | "label": "value12"}, |
1416 | - {"id": 13, "type": "menuitem", |
1417 | + {"id": 13, "type": "standard", |
1418 | "label": "value13"}, |
1419 | - {"id": 14, "type": "menuitem", |
1420 | + {"id": 14, "type": "standard", |
1421 | "label": "value14"}, |
1422 | - {"id": 15, "type": "menuitem", |
1423 | + {"id": 15, "type": "standard", |
1424 | "label": "value15"}, |
1425 | - {"id": 16, "type": "menuitem", |
1426 | + {"id": 16, "type": "standard", |
1427 | "label": "value16"}, |
1428 | - {"id": 17, "type": "menuitem", |
1429 | + {"id": 17, "type": "standard", |
1430 | "label": "value17"}, |
1431 | - {"id": 18, "type": "menuitem", |
1432 | + {"id": 18, "type": "standard", |
1433 | "label": "value18"}, |
1434 | - {"id": 19, "type": "menuitem", |
1435 | + {"id": 19, "type": "standard", |
1436 | "label": "value19"} |
1437 | ] |
1438 | }, |
1439 | - {"id": 6, "type": "menuitem", |
1440 | + {"id": 6, "type": "standard", |
1441 | "label": "value6", |
1442 | "submenu": [ |
1443 | - {"id": 20, "type": "menuitem", |
1444 | + {"id": 20, "type": "standard", |
1445 | "label": "value20"}, |
1446 | - {"id": 21, "type": "menuitem", |
1447 | + {"id": 21, "type": "standard", |
1448 | "label": "value21"}, |
1449 | - {"id": 22, "type": "menuitem", |
1450 | + {"id": 22, "type": "standard", |
1451 | "label": "value22"}, |
1452 | - {"id": 23, "type": "menuitem", |
1453 | + {"id": 23, "type": "standard", |
1454 | "label": "value23"}, |
1455 | - {"id": 24, "type": "menuitem", |
1456 | + {"id": 24, "type": "standard", |
1457 | "label": "value24"}, |
1458 | - {"id": 25, "type": "menuitem", |
1459 | + {"id": 25, "type": "standard", |
1460 | "label": "value25"}, |
1461 | - {"id": 26, "type": "menuitem", |
1462 | + {"id": 26, "type": "standard", |
1463 | "label": "value26"}, |
1464 | - {"id": 27, "type": "menuitem", |
1465 | + {"id": 27, "type": "standard", |
1466 | "label": "value27"}, |
1467 | - {"id": 28, "type": "menuitem", |
1468 | + {"id": 28, "type": "standard", |
1469 | "label": "value28"}, |
1470 | - {"id": 29, "type": "menuitem", |
1471 | + {"id": 29, "type": "standard", |
1472 | "label": "value29"} |
1473 | ] |
1474 | }, |
1475 | - {"id": 7, "type": "menuitem", |
1476 | + {"id": 7, "type": "standard", |
1477 | "label": "value7", |
1478 | "submenu": [ |
1479 | - {"id": 30, "type": "menuitem", |
1480 | + {"id": 30, "type": "standard", |
1481 | "label": "value30"}, |
1482 | - {"id": 31, "type": "menuitem", |
1483 | + {"id": 31, "type": "standard", |
1484 | "label": "value31"}, |
1485 | - {"id": 32, "type": "menuitem", |
1486 | + {"id": 32, "type": "standard", |
1487 | "label": "value32"}, |
1488 | - {"id": 33, "type": "menuitem", |
1489 | + {"id": 33, "type": "standard", |
1490 | "label": "value33"}, |
1491 | - {"id": 34, "type": "menuitem", |
1492 | + {"id": 34, "type": "standard", |
1493 | "label": "value34"}, |
1494 | - {"id": 35, "type": "menuitem", |
1495 | + {"id": 35, "type": "standard", |
1496 | "label": "value35"}, |
1497 | - {"id": 36, "type": "menuitem", |
1498 | + {"id": 36, "type": "standard", |
1499 | "label": "value36"}, |
1500 | - {"id": 37, "type": "menuitem", |
1501 | + {"id": 37, "type": "standard", |
1502 | "label": "value37"}, |
1503 | - {"id": 38, "type": "menuitem", |
1504 | + {"id": 38, "type": "standard", |
1505 | "label": "value38"}, |
1506 | - {"id": 39, "type": "menuitem", |
1507 | + {"id": 39, "type": "standard", |
1508 | "label": "value39"} |
1509 | ] |
1510 | }, |
1511 | ] |
1512 | }, |
1513 | - {"id": 8, "type": "menuitem", |
1514 | + {"id": 8, "type": "standard", |
1515 | "label": "value1", |
1516 | "submenu": [ |
1517 | {"id": 80, |
1518 | - "type": "menuitem", |
1519 | - "icon": "face-angel", |
1520 | + "type": "standard", |
1521 | + "icon-name": "face-angel", |
1522 | "label": "angel"}, |
1523 | {"id": 81, |
1524 | - "type": "menuitem", |
1525 | - "icon": "face-angry", |
1526 | + "type": "standard", |
1527 | + "icon-name": "face-angry", |
1528 | "label": "angry"}, |
1529 | {"id": 82, |
1530 | - "type": "menuitem", |
1531 | - "icon": "face-cool", |
1532 | + "type": "standard", |
1533 | + "icon-name": "face-cool", |
1534 | "label": "cool"}, |
1535 | {"id": 83, |
1536 | - "type":"menuitem", |
1537 | - "icon": "face-devilish", |
1538 | + "type":"standard", |
1539 | + "icon-name": "face-devilish", |
1540 | "label": "devilish"}, |
1541 | {"id": 84, |
1542 | - "type": "menuitem", |
1543 | - "icon": "face-embarrassed", |
1544 | + "type": "standard", |
1545 | + "icon-name": "face-embarrassed", |
1546 | "label": "embarrassed"}, |
1547 | {"id": 85, |
1548 | - "type": "menuitem", |
1549 | - "icon": "face-kiss", |
1550 | + "type": "standard", |
1551 | + "icon-name": "face-kiss", |
1552 | "label": "kiss"}, |
1553 | {"id": 86, |
1554 | - "type": "menuitem", |
1555 | - "icon": "face-laugh", |
1556 | + "type": "standard", |
1557 | + "icon-name": "face-laugh", |
1558 | "label": "laugh"}, |
1559 | {"id": 87, |
1560 | - "type": "menuitem", |
1561 | - "icon": "face-monkey", |
1562 | + "type": "standard", |
1563 | + "icon-name": "face-monkey", |
1564 | "label": "monkey"}, |
1565 | {"id": 88, |
1566 | - "type": "menuitem", |
1567 | - "icon": "face-sad", |
1568 | + "type": "standard", |
1569 | + "icon-name": "face-sad", |
1570 | "label": "sad"}, |
1571 | {"id": 89, |
1572 | - "type": "menuitem", |
1573 | - "icon": "face-sick", |
1574 | + "type": "standard", |
1575 | + "icon-name": "face-sick", |
1576 | "label": "sick"} |
1577 | ] |
1578 | }, |
1579 | - {"id": 9, "type": "menuitem", |
1580 | + {"id": 9, "type": "standard", |
1581 | "label": "value1", |
1582 | "submenu": [ |
1583 | {"id": 90, |
1584 | - "type": "menuitem", |
1585 | + "type": "standard", |
1586 | "icon-data": |
1587 | "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACPUlEQVR4nGJgoBAAAAAA///Ch1gW |
1588 | BzK0LQ5iaGNgYGDBpQgAAAD//8KpeY4/Q9+DCV7/H/S4/p8byDABlyEAAAAA///CqnluAMOEx5O8 |
1589 | @@ -266,7 +266,7 @@ |
1590 | QmCC", |
1591 | "label": "up"}, |
1592 | {"id": 91, |
1593 | - "type": "menuitem", |
1594 | + "type": "standard", |
1595 | "icon-data": |
1596 | "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACl0lEQVR4nGJgoBAAAAAA//9ixCLG |
1597 | sSWS4bs0B1QWip/+YGDwWcLAycDA8ANZMQAAAP//YsFigIA0JwODdvIsBob/fxgY/vxk+P/7OwPD |
1598 | @@ -283,8 +283,8 @@ |
1599 | +ys2zQwMDAwAAAAA//8DAAF5nhyE7tENAAAAAElFTkSuQmCC", |
1600 | "label": "down"}, |
1601 | {"id": 92, |
1602 | - "type": "menuitem", |
1603 | - "icon": "up", |
1604 | + "type": "standard", |
1605 | + "icon-name": "up", |
1606 | "icon-data": |
1607 | "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACl0lEQVR4nGJgoBAAAAAA//9ixCLG |
1608 | sSWS4bs0B1QWip/+YGDwWcLAycDA8ANZMQAAAP//YsFigIA0JwODdvIsBob/fxgY/vxk+P/7OwPD |
1609 | @@ -301,8 +301,8 @@ |
1610 | +ys2zQwMDAwAAAAA//8DAAF5nhyE7tENAAAAAElFTkSuQmCC", |
1611 | "label": "up"}, |
1612 | {"id": 93, |
1613 | - "type": "menuitem", |
1614 | - "icon": "down", |
1615 | + "type": "standard", |
1616 | + "icon-name": "down", |
1617 | "icon-data": |
1618 | "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACPUlEQVR4nGJgoBAAAAAA///Ch1gW |
1619 | BzK0LQ5iaGNgYGDBpQgAAAD//8KpeY4/Q9+DCV7/H/S4/p8byDABlyEAAAAA///CqnluAMOEx5O8 |
1620 | @@ -319,7 +319,7 @@ |
1621 | "label": "down"} |
1622 | ] |
1623 | }, |
1624 | - {"id": 1, "type": "menuitem", |
1625 | + {"id": 1, "type": "standard", |
1626 | "label": "value1", |
1627 | "submenu": [ |
1628 | {"id": 30, |
1629 | @@ -329,42 +329,42 @@ |
1630 | {"id": 31, |
1631 | "label": "No check (checked)", |
1632 | "toggle-type": "none", |
1633 | - "toggle-checked": "checked" |
1634 | + "toggle-state": 1 |
1635 | }, |
1636 | {"id": 32, |
1637 | "label": "No check (????)", |
1638 | "toggle-type": "none", |
1639 | - "toggle-checked": "indeterminate" |
1640 | + "toggle-state": -1 |
1641 | }, |
1642 | {"id": 33, |
1643 | "label": "Check (empty)", |
1644 | "toggle-type": "checkmark", |
1645 | - "toggle-checked": "unchecked" |
1646 | + "toggle-state": 0 |
1647 | }, |
1648 | {"id": 34, |
1649 | "label": "Check (checked)", |
1650 | "toggle-type": "checkmark", |
1651 | - "toggle-checked": "checked" |
1652 | + "toggle-state": 1 |
1653 | }, |
1654 | {"id": 35, |
1655 | "label": "Check (?????)", |
1656 | "toggle-type": "checkmark", |
1657 | - "toggle-checked": "indeterminate" |
1658 | + "toggle-state": -1 |
1659 | }, |
1660 | {"id": 36, |
1661 | "label": "Radio (empty)", |
1662 | "toggle-type": "radio", |
1663 | - "toggle-checked": "unchecked" |
1664 | + "toggle-state": 0 |
1665 | }, |
1666 | {"id": 37, |
1667 | "label": "Radio (checked)", |
1668 | "toggle-type": "radio", |
1669 | - "toggle-checked": "checked" |
1670 | + "toggle-state": 1 |
1671 | }, |
1672 | {"id": 38, |
1673 | "label": "Radio (?????)", |
1674 | "toggle-type": "radio", |
1675 | - "toggle-checked": "indeterminate" |
1676 | + "toggle-state": -1 |
1677 | } |
1678 | ] |
1679 | }, |
Turns id into ints.
Implement the agreed property changes.