ayatana-commits team mailing list archive
-
ayatana-commits team
-
Mailing list archive
-
Message #00798
[Merge] lp:~agateau/dbusmenu/interop into lp:dbusmenu
Aurélien Gâteau has proposed merging lp:~agateau/dbusmenu/interop into lp:dbusmenu.
Requested reviews:
DBus Menu Team (dbusmenu-team)
Turns id into ints.
Implement the agreed property changes.
--
https://code.launchpad.net/~agateau/dbusmenu/interop/+merge/18493
Your team ayatana-commits is subscribed to branch lp:dbusmenu.
=== added file 'libdbusmenu-glib/Doxyfile'
--- libdbusmenu-glib/Doxyfile 1970-01-01 00:00:00 +0000
+++ libdbusmenu-glib/Doxyfile 2010-02-03 01:09:13 +0000
@@ -0,0 +1,257 @@
+# Doxyfile 1.6.1
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+DOXYFILE_ENCODING = UTF-8
+PROJECT_NAME = DBusMenu
+PROJECT_NUMBER =
+OUTPUT_DIRECTORY =
+CREATE_SUBDIRS = NO
+OUTPUT_LANGUAGE = English
+BRIEF_MEMBER_DESC = YES
+REPEAT_BRIEF = YES
+ABBREVIATE_BRIEF =
+ALWAYS_DETAILED_SEC = NO
+INLINE_INHERITED_MEMB = NO
+FULL_PATH_NAMES = YES
+STRIP_FROM_PATH =
+STRIP_FROM_INC_PATH =
+SHORT_NAMES = NO
+JAVADOC_AUTOBRIEF = NO
+QT_AUTOBRIEF = NO
+MULTILINE_CPP_IS_BRIEF = NO
+INHERIT_DOCS = YES
+SEPARATE_MEMBER_PAGES = NO
+TAB_SIZE = 8
+ALIASES =
+OPTIMIZE_OUTPUT_FOR_C = NO
+OPTIMIZE_OUTPUT_JAVA = NO
+OPTIMIZE_FOR_FORTRAN = NO
+OPTIMIZE_OUTPUT_VHDL = NO
+EXTENSION_MAPPING =
+BUILTIN_STL_SUPPORT = NO
+CPP_CLI_SUPPORT = NO
+SIP_SUPPORT = NO
+IDL_PROPERTY_SUPPORT = YES
+DISTRIBUTE_GROUP_DOC = NO
+SUBGROUPING = YES
+TYPEDEF_HIDES_STRUCT = NO
+SYMBOL_CACHE_SIZE = 0
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+EXTRACT_ALL = NO
+EXTRACT_PRIVATE = NO
+EXTRACT_STATIC = NO
+EXTRACT_LOCAL_CLASSES = YES
+EXTRACT_LOCAL_METHODS = NO
+EXTRACT_ANON_NSPACES = NO
+HIDE_UNDOC_MEMBERS = NO
+HIDE_UNDOC_CLASSES = NO
+HIDE_FRIEND_COMPOUNDS = NO
+HIDE_IN_BODY_DOCS = NO
+INTERNAL_DOCS = NO
+CASE_SENSE_NAMES = YES
+HIDE_SCOPE_NAMES = NO
+SHOW_INCLUDE_FILES = YES
+INLINE_INFO = YES
+SORT_MEMBER_DOCS = YES
+SORT_BRIEF_DOCS = NO
+SORT_MEMBERS_CTORS_1ST = NO
+SORT_GROUP_NAMES = NO
+SORT_BY_SCOPE_NAME = NO
+GENERATE_TODOLIST = YES
+GENERATE_TESTLIST = YES
+GENERATE_BUGLIST = YES
+GENERATE_DEPRECATEDLIST= YES
+ENABLED_SECTIONS =
+MAX_INITIALIZER_LINES = 30
+SHOW_USED_FILES = YES
+SHOW_DIRECTORIES = NO
+SHOW_FILES = YES
+SHOW_NAMESPACES = YES
+FILE_VERSION_FILTER =
+LAYOUT_FILE =
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+QUIET = NO
+WARNINGS = YES
+WARN_IF_UNDOCUMENTED = YES
+WARN_IF_DOC_ERROR = YES
+WARN_NO_PARAMDOC = NO
+WARN_FORMAT = "$file:$line: $text"
+WARN_LOGFILE =
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+INPUT = .
+INPUT_ENCODING = UTF-8
+FILE_PATTERNS = *.xml
+RECURSIVE = NO
+EXCLUDE =
+EXCLUDE_SYMLINKS = NO
+EXCLUDE_PATTERNS =
+EXCLUDE_SYMBOLS =
+EXAMPLE_PATH =
+EXAMPLE_PATTERNS =
+EXAMPLE_RECURSIVE = NO
+IMAGE_PATH =
+INPUT_FILTER = doxymel
+FILTER_PATTERNS = *.xml=doxymel
+FILTER_SOURCE_FILES = NO
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+SOURCE_BROWSER = NO
+INLINE_SOURCES = NO
+STRIP_CODE_COMMENTS = YES
+REFERENCED_BY_RELATION = NO
+REFERENCES_RELATION = NO
+REFERENCES_LINK_SOURCE = YES
+USE_HTAGS = NO
+VERBATIM_HEADERS = YES
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+ALPHABETICAL_INDEX = NO
+COLS_IN_ALPHA_INDEX = 5
+IGNORE_PREFIX =
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+GENERATE_HTML = YES
+HTML_OUTPUT = html
+HTML_FILE_EXTENSION = .html
+HTML_HEADER =
+HTML_FOOTER =
+HTML_STYLESHEET =
+HTML_ALIGN_MEMBERS = YES
+HTML_DYNAMIC_SECTIONS = NO
+GENERATE_DOCSET = NO
+DOCSET_FEEDNAME = "Doxygen generated docs"
+DOCSET_BUNDLE_ID = org.doxygen.Project
+GENERATE_HTMLHELP = NO
+CHM_FILE =
+HHC_LOCATION =
+GENERATE_CHI = NO
+CHM_INDEX_ENCODING =
+BINARY_TOC = NO
+TOC_EXPAND = NO
+GENERATE_QHP = NO
+QCH_FILE =
+QHP_NAMESPACE =
+QHP_VIRTUAL_FOLDER = doc
+QHP_CUST_FILTER_NAME =
+QHP_CUST_FILTER_ATTRS =
+QHP_SECT_FILTER_ATTRS =
+QHG_LOCATION =
+DISABLE_INDEX = NO
+ENUM_VALUES_PER_LINE = 4
+GENERATE_TREEVIEW = NO
+USE_INLINE_TREES = NO
+TREEVIEW_WIDTH = 250
+FORMULA_FONTSIZE = 10
+SEARCHENGINE = YES
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+GENERATE_LATEX = NO
+LATEX_OUTPUT = latex
+LATEX_CMD_NAME = latex
+MAKEINDEX_CMD_NAME = makeindex
+COMPACT_LATEX = NO
+PAPER_TYPE = a4wide
+EXTRA_PACKAGES =
+LATEX_HEADER =
+PDF_HYPERLINKS = YES
+USE_PDFLATEX = YES
+LATEX_BATCHMODE = NO
+LATEX_HIDE_INDICES = NO
+LATEX_SOURCE_CODE = NO
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+GENERATE_RTF = NO
+RTF_OUTPUT = rtf
+COMPACT_RTF = NO
+RTF_HYPERLINKS = NO
+RTF_STYLESHEET_FILE =
+RTF_EXTENSIONS_FILE =
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+GENERATE_MAN = NO
+MAN_OUTPUT = man
+MAN_EXTENSION = .3
+MAN_LINKS = NO
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+GENERATE_XML = NO
+XML_OUTPUT = xml
+XML_SCHEMA =
+XML_DTD =
+XML_PROGRAMLISTING = YES
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+GENERATE_AUTOGEN_DEF = NO
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+GENERATE_PERLMOD = NO
+PERLMOD_LATEX = NO
+PERLMOD_PRETTY = YES
+PERLMOD_MAKEVAR_PREFIX =
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+ENABLE_PREPROCESSING = YES
+MACRO_EXPANSION = NO
+EXPAND_ONLY_PREDEF = NO
+SEARCH_INCLUDES = YES
+INCLUDE_PATH =
+INCLUDE_FILE_PATTERNS =
+PREDEFINED =
+EXPAND_AS_DEFINED =
+SKIP_FUNCTION_MACROS = YES
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+TAGFILES =
+GENERATE_TAGFILE =
+ALLEXTERNALS = NO
+EXTERNAL_GROUPS = YES
+PERL_PATH = /usr/bin/perl
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+CLASS_DIAGRAMS = YES
+MSCGEN_PATH =
+HIDE_UNDOC_RELATIONS = YES
+HAVE_DOT = NO
+DOT_FONTNAME = FreeSans
+DOT_FONTSIZE = 10
+DOT_FONTPATH =
+CLASS_GRAPH = YES
+COLLABORATION_GRAPH = YES
+GROUP_GRAPHS = YES
+UML_LOOK = NO
+TEMPLATE_RELATIONS = NO
+INCLUDE_GRAPH = YES
+INCLUDED_BY_GRAPH = YES
+CALL_GRAPH = NO
+CALLER_GRAPH = NO
+GRAPHICAL_HIERARCHY = YES
+DIRECTORY_GRAPH = YES
+DOT_IMAGE_FORMAT = png
+DOT_PATH =
+DOTFILE_DIRS =
+DOT_GRAPH_MAX_NODES = 50
+MAX_DOT_GRAPH_DEPTH = 0
+DOT_TRANSPARENT = NO
+DOT_MULTI_TARGETS = YES
+GENERATE_LEGEND = YES
+DOT_CLEANUP = YES
=== modified file 'libdbusmenu-glib/client.c'
--- libdbusmenu-glib/client.c 2010-01-24 20:08:51 +0000
+++ libdbusmenu-glib/client.c 2010-02-03 01:09:13 +0000
@@ -96,8 +96,8 @@
static void get_property (GObject * obj, guint id, GValue * value, GParamSpec * pspec);
/* Private Funcs */
static void layout_update (DBusGProxy * proxy, gint revision, guint parent, DbusmenuClient * client);
-static void id_prop_update (DBusGProxy * proxy, guint id, gchar * property, GValue * value, DbusmenuClient * client);
-static void id_update (DBusGProxy * proxy, guint id, DbusmenuClient * client);
+static void id_prop_update (DBusGProxy * proxy, gint id, gchar * property, GValue * value, DbusmenuClient * client);
+static void id_update (DBusGProxy * proxy, gint id, DbusmenuClient * client);
static void build_proxies (DbusmenuClient * client);
static guint parse_node_get_id (xmlNodePtr node);
static DbusmenuMenuitem * parse_layout_xml(DbusmenuClient * client, xmlNodePtr node, DbusmenuMenuitem * item, DbusmenuMenuitem * parent, DBusGProxy * proxy);
@@ -321,7 +321,7 @@
/* Signal from the server that a property has changed
on one of our menuitems */
static void
-id_prop_update (DBusGProxy * proxy, guint id, gchar * property, GValue * value, DbusmenuClient * client)
+id_prop_update (DBusGProxy * proxy, gint id, gchar * property, GValue * value, DbusmenuClient * client)
{
#ifdef MASSIVEDEBUGGING
GValue valstr = {0};
@@ -344,7 +344,7 @@
/* Oh, lots of updates now. That silly server, they want
to change all kinds of stuff! */
static void
-id_update (DBusGProxy * proxy, guint id, DbusmenuClient * client)
+id_update (DBusGProxy * proxy, gint id, DbusmenuClient * client)
{
#ifdef MASSIVEDEBUGGING
g_debug("Client side ID update: %d", id);
@@ -530,7 +530,7 @@
for (attrib = node->properties; attrib != NULL; attrib = attrib->next) {
if (g_strcmp0((gchar *)attrib->name, "id") == 0) {
if (attrib->children != NULL) {
- guint id = (guint)g_ascii_strtoull((gchar *)attrib->children->content, NULL, 10);
+ gint id = (guint)g_ascii_strtoull((gchar *)attrib->children->content, NULL, 10);
/* g_debug ("Found ID: %d", id); */
return id;
}
@@ -642,7 +642,7 @@
static DbusmenuMenuitem *
parse_layout_xml(DbusmenuClient * client, xmlNodePtr node, DbusmenuMenuitem * item, DbusmenuMenuitem * parent, DBusGProxy * proxy)
{
- guint id = parse_node_get_id(node);
+ gint id = parse_node_get_id(node);
#ifdef MASSIVEDEBUGGING
g_debug("Client looking at node with id: %d", id);
#endif
=== modified file 'libdbusmenu-glib/dbus-menu.xml'
--- libdbusmenu-glib/dbus-menu.xml 2010-01-24 20:08:51 +0000
+++ libdbusmenu-glib/dbus-menu.xml 2010-02-03 01:09:13 +0000
@@ -8,6 +8,7 @@
Authors:
Ted Gould <ted@xxxxxxxxxxxxx>
+ Aurelien Gateau <ted@xxxxxxxxxxxxx>
This program is free software: you can redistribute it and/or modify it
under the terms of either or both of the following licenses:
@@ -27,166 +28,275 @@
License version 3 and version 2.1 along with this program. If not, see
<http://www.gnu.org/licenses/>
-->
-<node name="/">
+<node name="/" xmlns:dox="http://www.ayatana.org/dbus/dox.dtd">
<interface name="org.ayatana.dbusmenu">
+ <dox:d><![CDATA[
+ The goal of this DBus interface is to be able to pass menu items
+ through DBus.
+
+ Items are represented with a unique numeric id and a dictionary of
+ properties.
+
+ Available properties are:
+
+ <table>
+ <tr>
+ <th>Name</th>
+ <th>Type</th>
+ <th>Description</th>
+ <th>Default Value</th>
+ </tr>
+ <tr>
+ <td>type</td>
+ <td>String</td>
+ <td>Can be one of:
+ - "standard": an item which can be clicked to trigger an action or
+ show another menu
+ - "separator": a separator
+
+ Vendor specific types can be added by prefixing them with
+ "x-<vendor>-".
+ </td>
+ <td>"standard"</td>
+ </tr>
+ <tr>
+ <td>label</td>
+ <td>string</td>
+ <td>Text of the item, except that:
+ -# two consecutive underscore characters "__" are displayed as a
+ single underscore,
+ -# any remaining underscore characters are not displayed at all,
+ -# the first of those remaining underscore characters (unless it is
+ the last character in the string) indicates that the following
+ character is the access key.
+ </td>
+ <td>""</td>
+ </tr>
+ <tr>
+ <td>enabled</td>
+ <td>boolean</td>
+ <td>Whether the item can be activated or not.</td>
+ <td>true</td>
+ </tr>
+ <tr>
+ <td>icon-name</td>
+ <td>string</td>
+ <td>Icon name of the item, following the freedesktop.org icon spec.</td>
+ <td>""</td>
+ </tr>
+ <tr>
+ <td>icon-data</td>
+ <td>binary</td>
+ <td>PNG data of the icon.</td>
+ <td>Empty</td>
+ </tr>
+ <tr>
+ <td>toggle-type</td>
+ <td>string</td>
+ <td>
+ If the item can be toggled, this property should be set to:
+ - "checkmark": Item is an independent togglable item
+ - "radio": Item is part of a group where only one item can be
+ toggled at a time
+ - "": Item cannot be toggled
+ </td>
+ <td>""</td>
+ </tr>
+ <tr>
+ <td>toggle-state</td>
+ <td>int</td>
+ <td>
+ Describe the current state of a "togglable" item. Can be one of:
+ - 0 = off
+ - 1 = on
+ - anything else = indeterminate
+
+ Note:
+ The implementation does not itself handle ensuring that only one
+ item in a radio group is set to "on", or that a group does not have
+ "on" and "indeterminate" items simultaneously; maintaining this
+ policy is up to the toolkit wrappers.
+ </td>
+ <td>0</td>
+ </tr>
+ <tr>
+ <td>children-display</td>
+ <td>string</td>
+ <td>
+ If the menu item has children this property should be set to
+ "submenu".
+ </td>
+ <td>""</td>
+ </tr>
+ </table>
+
+ Vendor specific properties can be added by prefixing them with
+ "x-<vendor>-".
+ ]]></dox:d>
<!-- Properties -->
-<!--
-Provides the version of the DBusmenu API that this API is
-implementing.
--->
- <property name="version" type="u" access="read"/>
+ <property name="version" type="u" access="read">
+ <dox:d>
+ Provides the version of the DBusmenu API that this API is
+ implementing.
+ </dox:d>
+ </property>
<!-- Functions -->
-<!--
-Provides an XML representation of the menu hierarchy
-
-@param parentId The ID of the parent node for the layout. For
- grabbing the layout from the root node use zero.
-@param revision The revision number of the layout. For matching
- with layoutUpdated signals.
-@param layout The layout as an XML string of IDs.
-
-XML syntax:
-
-<menu id="1"> # Root container
- <menu id="2"> # First level menu, for example "File"
- <menu id="3"/> ~ Second level menu, for example "Open"
- <menu id="4"/>
- ...
- </menu>
- <menu id="5"> # Another first level menu, say "Edit"
- ...
- </menu>
- ...
+ <method name="GetLayout">
+ <dox:d><![CDATA[
+ Provides an XML representation of the menu hierarchy
+
+ XML syntax:
+
+ @verbatim
+<menu id="1" revision="2"> # Root container
+ <menu id="2" revision="2"> # First level menu, for example "File"
+ <menu id="3" revision="2"/> ~ Second level menu, for example "Open"
+ <menu id="4" revision="3"/>
+ ...
+ </menu>
+ <menu id="5" revision="2"> # Another first level menu, say "Edit"
+ ...
+ </menu>
+ ...
</menu>
--->
- <method name="GetLayout">
- <arg type="u" name="parentId" direction="in" />
- <arg type="u" name="revision" direction="out" />
- <arg type="s" name="layout" direction="out" />
+ @endverbatim
+ ]]></dox:d>
+ <arg type="i" name="parentId" direction="in">
+ <dox:d>The ID of the parent node for the layout. For
+ grabbing the layout from the root node use zero.</dox:d>
+ </arg>
+ <arg type="u" name="revision" direction="out">
+ <dox:d>The revision number of the layout. For matching
+ with layoutUpdated signals.</dox:d>
+ </arg>
+ <arg type="s" name="layout" direction="out">
+ <dox:d>The layout as an XML string of IDs.</dox:d>
+ </arg>
</method>
-<!--
-Returns the list of items which are children of @a parentId.
-
-@param Ids A list of ids that we should be finding the properties
- on. If the list is empty, all menu items should be sent.
-@param propertyNames list of string the list of item properties we
- are interested in. If there are no entries in the list all of
- the properties will be sent.
-
-An item is represented as a struct following this format:
-@li id unsigned the item id
-@li properties map(string => variant) the requested item properties
-
--->
<method name="GetGroupProperties">
- <arg type="au" name="Ids" direction="in" />
- <arg type="as" name="propertyNames" direction="in" />
- <arg type="a(ua{sv})" name="properties" direction="out" />
+ <annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="QVariantList"/>
+ <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="DBusMenuItemList"/>
+ <dox:d>
+ Returns the list of items which are children of @a parentId.
+ </dox:d>
+ <arg type="ai" name="ids" direction="in" >
+ <dox:d>
+ A list of ids that we should be finding the properties
+ on. If the list is empty, all menu items should be sent.
+ </dox:d>
+ </arg>
+ <arg type="as" name="propertyNames" direction="in" >
+ <dox:d>
+ The list of item properties we are
+ interested in. If there are no entries in the list all of
+ the properties will be sent.
+ </dox:d>
+ </arg>
+ <arg type="a(ia{sv})" name="properties" direction="out" >
+ <dox:d>
+ An array of property values.
+ An item in this area is represented as a struct following
+ this format:
+ @li id unsigned the item id
+ @li properties map(string => variant) the requested item properties
+ </dox:d>
+ </arg>
</method>
<method name="GetChildren">
- <arg type="u" name="id" direction="in" />
+ <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="DBusMenuItemList"/>
+ <arg type="i" name="id" direction="in" />
<arg type="as" name="propertyNames" direction="in" />
- <arg type="a(ua{sv})" name="properties" direction="out" />
+ <arg type="a(ia{sv})" name="properties" direction="out" />
</method>
-<!--
-Each menu item has a set of properties. Property keys are in menuitem.h:
-
-@li type string Type of the item (see below)
-@li label string Text of the item
-@li icon-data binary Raw data of the icon (TODO: define format)
-@li icon string Icon name of the item, following icon spec
-@li sensitive boolean Whether the item can be activated or not
-@li visible boolean Whether the item is visible or not (XXX: Is this necessary?)
-@li checked boolean Whether a checkbox or radio item is checked
-@li shortcut string The keyboard shortcut
-
-@c type property is an enum which can take the following values (client.h):
-
-@li action An item which can be clicked to trigger an action
-@li checkbox An item which can be checked or unchecked
-@li radio An item which can be checked or unchecked as part of a group
-@li separator A separator
-@li menu An item which contains more items
--->
<method name="GetProperty">
- <arg type="u" name="id" direction="in" />
+ <arg type="i" name="id" direction="in" />
<arg type="s" name="name" direction="in" />
<arg type="v" name="value" direction="out" />
</method>
-<!--
-Returns multiple properties in one call. This is more efficient than
-GetProperty.
-
-@param id unsigned the item whose properties we want to retrieve.
-@param propertyNames list of string name of the properties we want. If the list contains no entries, all properties are sent.
--->
<method name="GetProperties">
+ <dox:d>
+ Returns multiple properties in one call. This is more efficient than
+ GetProperty.
+
+ </dox:d>
<annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="QVariantMap"/>
- <arg type="u" name="id" direction="in" />
- <arg type="as" name="propertyNames" direction="in" />
+ <arg type="i" name="id" direction="in" >
+ <dox:d>The item whose properties we want to retrieve.</dox:d>
+ </arg>
+ <arg type="as" name="propertyNames" direction="in" >
+ <dox:d>List of string name of the properties we want. If the list contains no entries, all properties are sent.</dox:d>
+ </arg>
<arg type="a{sv}" name="properties" direction="out" />
</method>
-<!--
-This is called by the applet to notify the application an event happened on a
-menu item.
-
-@param id the id of the item which received the event
-@param type the type of event
-@param data event-specific data
-@param timestamp The time that the event occured if available or the time the message was sent if not.
-
-@a type can be one of the following:
-
-@li "clicked"
-@li "hovered"
-
-Vendor specific events can be added by prefixing them with "x-<vendor>-"
--->
<method name="Event">
- <arg type="u" name="id" direction="in" />
- <arg type="s" name="eventId" direction="in" />
- <arg type="v" name="data" direction="in" />
- <arg type="u" name="timestamp" direction="in" />
+ <dox:d><![CDATA[
+ This is called by the applet to notify the application an event happened on a
+ menu item.
+
+ @a type can be one of the following:
+
+ @li "clicked"
+ @li "hovered"
+
+ Vendor specific events can be added by prefixing them with "x-<vendor>-"
+ ]]></dox:d>
+ <arg type="i" name="id" direction="in" >
+ <dox:d>the id of the item which received the event</dox:d>
+ </arg>
+ <arg type="s" name="eventId" direction="in" >
+ <dox:d>the type of event</dox:d>
+ </arg>
+ <arg type="v" name="data" direction="in" >
+ <dox:d>event-specific data</dox:d>
+ </arg>
+ <arg type="u" name="timestamp" direction="in" >
+ <dox:d>The time that the event occured if available or the time the message was sent if not</dox:d>
+ </arg>
</method>
<!-- Signals -->
-<!--
-Triggered by the application to notify the applet that the property @a property
-from item @a id has changed to @a value.
--->
<signal name="ItemPropertyUpdated">
- <arg type="u" name="id" direction="out" />
+ <dox:d>
+ Triggered by the application to notify the applet that the property @a property
+ from item @a id has changed to @a value.
+ </dox:d>
+ <arg type="i" name="id" direction="out" />
<arg type="s" name="prop" direction="out" />
<arg type="v" name="value" direction="out" />
</signal>
-<!--
-Triggered by the application to notify the applet that all properties of item
-@a id should be considered outdated
--->
<signal name="ItemUpdated">
- <arg type="u" name="id" direction="out" />
+ <dox:d>
+ Triggered by the application to notify the applet that all properties of item
+ </dox:d>
+ <arg type="i" name="id" direction="out" >
+ <dox:d>id which should be considered outdated</dox:d>
+ </arg>
</signal>
-<!--
-Triggered by the application to notify display of a layout update, up to
-revision
-@param revsion The revision of the layout that we're currently on
-@param parent If the layout update is only of a subtree, this is the parent
- item for the entries that have changed. It is zero if the
- whole layout should be considered invalid.
--->
<signal name="LayoutUpdated">
- <arg type="i" name="revision" direction="out" />
- <arg type="u" name="parent" direction="out" />
+ <dox:d>
+ Triggered by the application to notify display of a layout update, up to
+ revision
+ </dox:d>
+ <arg type="u" name="revision" direction="out" >
+ <dox:d>The revision of the layout that we're currently on</dox:d>
+ </arg>
+ <arg type="i" name="parent" direction="out" >
+ <dox:d>
+ If the layout update is only of a subtree, this is the
+ parent item for the entries that have changed. It is zero if
+ the whole layout should be considered invalid.
+ </dox:d>
+ </arg>
</signal>
<!-- End of interesting stuff -->
=== modified file 'libdbusmenu-glib/menuitem.c'
--- libdbusmenu-glib/menuitem.c 2010-01-22 20:53:39 +0000
+++ libdbusmenu-glib/menuitem.c 2010-02-03 01:09:13 +0000
@@ -55,7 +55,7 @@
typedef struct _DbusmenuMenuitemPrivate DbusmenuMenuitemPrivate;
struct _DbusmenuMenuitemPrivate
{
- guint id;
+ gint id;
GList * children;
GHashTable * properties;
gboolean root;
@@ -367,7 +367,7 @@
Return value: A newly allocated #DbusmenuMenuitem.
*/
DbusmenuMenuitem *
-dbusmenu_menuitem_new_with_id (guint id)
+dbusmenu_menuitem_new_with_id (gint id)
{
DbusmenuMenuitem * mi = g_object_new(DBUSMENU_TYPE_MENUITEM, "id", id, NULL);
/* g_debug("New Menuitem id %d goal id %d", dbusmenu_menuitem_get_id(mi), id); */
@@ -642,7 +642,7 @@
can't be found.
*/
DbusmenuMenuitem *
-dbusmenu_menuitem_child_find (DbusmenuMenuitem * mi, guint id)
+dbusmenu_menuitem_child_find (DbusmenuMenuitem * mi, gint id)
{
g_return_val_if_fail(DBUSMENU_IS_MENUITEM(mi), NULL);
@@ -661,7 +661,7 @@
typedef struct {
DbusmenuMenuitem * mi;
- guint id;
+ gint id;
} find_id_t;
/* Basically the heart of the find_id that matches the
@@ -697,7 +697,7 @@
represented by @mi.
*/
DbusmenuMenuitem *
-dbusmenu_menuitem_find_id (DbusmenuMenuitem * mi, guint id)
+dbusmenu_menuitem_find_id (DbusmenuMenuitem * mi, gint id)
{
g_return_val_if_fail(DBUSMENU_IS_MENUITEM(mi), NULL);
find_id_t find_id = {mi: NULL, id: id};
@@ -1060,7 +1060,7 @@
{
g_return_if_fail(DBUSMENU_IS_MENUITEM(mi));
- guint id = 0;
+ gint id = 0;
if (!dbusmenu_menuitem_get_root(mi)) {
id = dbusmenu_menuitem_get_id(mi);
}
=== modified file 'libdbusmenu-glib/menuitem.h'
--- libdbusmenu-glib/menuitem.h 2010-01-22 20:10:27 +0000
+++ libdbusmenu-glib/menuitem.h 2010-02-03 01:09:13 +0000
@@ -52,19 +52,19 @@
#define DBUSMENU_MENUITEM_PROP_TYPE "type"
#define DBUSMENU_MENUITEM_PROP_VISIBLE "visible"
-#define DBUSMENU_MENUITEM_PROP_SENSITIVE "sensitive"
+#define DBUSMENU_MENUITEM_PROP_ENABLED "enabled"
#define DBUSMENU_MENUITEM_PROP_LABEL "label"
-#define DBUSMENU_MENUITEM_PROP_ICON "icon"
+#define DBUSMENU_MENUITEM_PROP_ICON_NAME "icon-name"
#define DBUSMENU_MENUITEM_PROP_ICON_DATA "icon-data"
#define DBUSMENU_MENUITEM_PROP_TOGGLE_TYPE "toggle-type"
-#define DBUSMENU_MENUITEM_PROP_TOGGLE_CHECKED "toggle-checked"
+#define DBUSMENU_MENUITEM_PROP_TOGGLE_STATE "toggle-state"
#define DBUSMENU_MENUITEM_TOGGLE_CHECK "checkmark"
#define DBUSMENU_MENUITEM_TOGGLE_RADIO "radio"
-#define DBUSMENU_MENUITEM_TOGGLE_STATE_UNCHECKED "unchecked"
-#define DBUSMENU_MENUITEM_TOGGLE_STATE_CHECKED "checked"
-#define DBUSMENU_MENUITEM_TOGGLE_STATE_UNKNOWN "indeterminate"
+#define DBUSMENU_MENUITEM_TOGGLE_STATE_UNCHECKED 0
+#define DBUSMENU_MENUITEM_TOGGLE_STATE_CHECKED 1
+#define DBUSMENU_MENUITEM_TOGGLE_STATE_UNKNOWN -1
/**
DbusmenuMenuitem:
@@ -122,7 +122,7 @@
GType dbusmenu_menuitem_get_type (void);
DbusmenuMenuitem * dbusmenu_menuitem_new (void) G_GNUC_WARN_UNUSED_RESULT;
-DbusmenuMenuitem * dbusmenu_menuitem_new_with_id (guint id) G_GNUC_WARN_UNUSED_RESULT;
+DbusmenuMenuitem * dbusmenu_menuitem_new_with_id (gint id) G_GNUC_WARN_UNUSED_RESULT;
guint dbusmenu_menuitem_get_id (DbusmenuMenuitem * mi);
GList * dbusmenu_menuitem_get_children (DbusmenuMenuitem * mi);
@@ -134,8 +134,8 @@
gboolean dbusmenu_menuitem_child_delete (DbusmenuMenuitem * mi, DbusmenuMenuitem * child);
gboolean dbusmenu_menuitem_child_add_position (DbusmenuMenuitem * mi, DbusmenuMenuitem * child, guint position);
gboolean dbusmenu_menuitem_child_reorder (DbusmenuMenuitem * mi, DbusmenuMenuitem * child, guint position);
-DbusmenuMenuitem * dbusmenu_menuitem_child_find (DbusmenuMenuitem * mi, guint id);
-DbusmenuMenuitem * dbusmenu_menuitem_find_id (DbusmenuMenuitem * mi, guint id);
+DbusmenuMenuitem * dbusmenu_menuitem_child_find (DbusmenuMenuitem * mi, gint id);
+DbusmenuMenuitem * dbusmenu_menuitem_find_id (DbusmenuMenuitem * mi, gint id);
gboolean dbusmenu_menuitem_property_set (DbusmenuMenuitem * mi, const gchar * property, const gchar * value);
gboolean dbusmenu_menuitem_property_set_value (DbusmenuMenuitem * mi, const gchar * property, const GValue * value);
=== modified file 'libdbusmenu-glib/server.c'
--- libdbusmenu-glib/server.c 2010-01-24 20:08:51 +0000
+++ libdbusmenu-glib/server.c 2010-02-03 01:09:13 +0000
@@ -36,11 +36,11 @@
/* DBus Prototypes */
static gboolean _dbusmenu_server_get_layout (DbusmenuServer * server, guint parent, guint * revision, gchar ** layout, GError ** error);
-static gboolean _dbusmenu_server_get_property (DbusmenuServer * server, guint id, gchar * property, gchar ** value, GError ** error);
-static gboolean _dbusmenu_server_get_properties (DbusmenuServer * server, guint id, GPtrArray * properties, GHashTable ** dict, GError ** error);
+static gboolean _dbusmenu_server_get_property (DbusmenuServer * server, gint id, gchar * property, gchar ** value, GError ** error);
+static gboolean _dbusmenu_server_get_properties (DbusmenuServer * server, gint id, GPtrArray * properties, GHashTable ** dict, GError ** error);
static gboolean _dbusmenu_server_get_group_properties (DbusmenuServer * server, GArray * ids, GArray * properties, GHashTable ** values, GError ** error);
-static gboolean _dbusmenu_server_event (DbusmenuServer * server, guint id, gchar * eventid, GValue * data, guint timestamp, GError ** error);
-static gboolean _dbusmenu_server_get_children (DbusmenuServer * server, guint id, GPtrArray * properties, GPtrArray ** output, GError ** error);
+static gboolean _dbusmenu_server_event (DbusmenuServer * server, gint id, gchar * eventid, GValue * data, guint timestamp, GError ** error);
+static gboolean _dbusmenu_server_get_children (DbusmenuServer * server, gint id, GPtrArray * properties, GPtrArray ** output, GError ** error);
#include "dbusmenu-server.h"
@@ -396,7 +396,7 @@
}
static gboolean
-_dbusmenu_server_get_property (DbusmenuServer * server, guint id, gchar * property, gchar ** value, GError ** error)
+_dbusmenu_server_get_property (DbusmenuServer * server, gint id, gchar * property, gchar ** value, GError ** error)
{
DbusmenuServerPrivate * priv = DBUSMENU_SERVER_GET_PRIVATE(server);
DbusmenuMenuitem * mi = dbusmenu_menuitem_find_id(priv->root, id);
@@ -441,7 +441,7 @@
}
static gboolean
-_dbusmenu_server_get_properties (DbusmenuServer * server, guint id, GPtrArray * properties, GHashTable ** dict, GError ** error)
+_dbusmenu_server_get_properties (DbusmenuServer * server, gint id, GPtrArray * properties, GHashTable ** dict, GError ** error)
{
DbusmenuServerPrivate * priv = DBUSMENU_SERVER_GET_PRIVATE(server);
DbusmenuMenuitem * mi = dbusmenu_menuitem_find_id(priv->root, id);
@@ -475,12 +475,12 @@
}
static void
-_gvalue_array_append_uint(GValueArray *array, guint i)
+_gvalue_array_append_int(GValueArray *array, gint i)
{
GValue value = {0};
- g_value_init(&value, G_TYPE_UINT);
- g_value_set_uint(&value, i);
+ g_value_init(&value, G_TYPE_INT);
+ g_value_set_int(&value, i);
g_value_array_append(array, &value);
g_value_unset(&value);
}
@@ -502,18 +502,18 @@
DbusmenuMenuitem * mi = DBUSMENU_MENUITEM(data);
GPtrArray * output = (GPtrArray *)(user_data);
- guint id = dbusmenu_menuitem_get_id(mi);
+ gint id = dbusmenu_menuitem_get_id(mi);
GHashTable * dict = dbusmenu_menuitem_properties_copy(mi);
GValueArray * item = g_value_array_new(1);
- _gvalue_array_append_uint(item, id);
+ _gvalue_array_append_int(item, id);
_gvalue_array_append_hashtable(item, dict);
g_ptr_array_add(output, item);
}
static gboolean
-_dbusmenu_server_get_children (DbusmenuServer * server, guint id, GPtrArray * properties, GPtrArray ** output, GError ** error)
+_dbusmenu_server_get_children (DbusmenuServer * server, gint id, GPtrArray * properties, GPtrArray ** output, GError ** error)
{
DbusmenuServerPrivate * priv = DBUSMENU_SERVER_GET_PRIVATE(server);
DbusmenuMenuitem * mi = id == 0 ? priv->root : dbusmenu_menuitem_find_id(priv->root, id);
@@ -537,7 +537,7 @@
}
static gboolean
-_dbusmenu_server_event (DbusmenuServer * server, guint id, gchar * eventid, GValue * data, guint timestamp, GError ** error)
+_dbusmenu_server_event (DbusmenuServer * server, gint id, gchar * eventid, GValue * data, guint timestamp, GError ** error)
{
DbusmenuServerPrivate * priv = DBUSMENU_SERVER_GET_PRIVATE(server);
DbusmenuMenuitem * mi = dbusmenu_menuitem_find_id(priv->root, id);
=== modified file 'libdbusmenu-glib/server.h'
--- libdbusmenu-glib/server.h 2010-01-22 21:22:54 +0000
+++ libdbusmenu-glib/server.h 2010-02-03 01:09:13 +0000
@@ -70,8 +70,8 @@
GObjectClass parent_class;
/* Signals */
- void (*id_prop_update)(guint id, gchar * property, gchar * value);
- void (*id_update)(guint id);
+ void (*id_prop_update)(gint id, gchar * property, gchar * value);
+ void (*id_update)(gint id);
void (*layout_updated)(gint revision);
/* Reserved */
=== modified file 'libdbusmenu-gtk/client.c'
--- libdbusmenu-gtk/client.c 2010-01-24 20:09:10 +0000
+++ libdbusmenu-gtk/client.c 2010-02-03 01:09:13 +0000
@@ -136,7 +136,7 @@
{
gboolean val = TRUE;
if (value != NULL) {
- val = dbusmenu_menuitem_property_get_bool(mi, DBUSMENU_MENUITEM_PROP_SENSITIVE);
+ val = dbusmenu_menuitem_property_get_bool(mi, DBUSMENU_MENUITEM_PROP_ENABLED);
}
gtk_widget_set_sensitive(GTK_WIDGET(gmi), val);
return;
@@ -167,18 +167,18 @@
/* Process the sensitive property */
static void
-process_toggle_checked (DbusmenuMenuitem * mi, GtkMenuItem * gmi, const GValue * value)
+process_toggle_state (DbusmenuMenuitem * mi, GtkMenuItem * gmi, const GValue * value)
{
if (!IS_GENERICMENUITEM(gmi)) return;
GenericmenuitemState state = GENERICMENUITEM_STATE_UNCHECKED;
- if (value != NULL && G_VALUE_TYPE(value) == G_TYPE_STRING) {
- const gchar * strval = g_value_get_string(value);
+ if (value != NULL && G_VALUE_TYPE(value) == G_TYPE_INT) {
+ int val = g_value_get_int(value);
- if (!g_strcmp0(strval, DBUSMENU_MENUITEM_TOGGLE_STATE_CHECKED)) {
+ if (val == DBUSMENU_MENUITEM_TOGGLE_STATE_CHECKED) {
state = GENERICMENUITEM_STATE_CHECKED;
- } else if (!g_strcmp0(strval, DBUSMENU_MENUITEM_TOGGLE_STATE_UNKNOWN)) {
+ } else if (val == DBUSMENU_MENUITEM_TOGGLE_STATE_UNKNOWN) {
state = GENERICMENUITEM_STATE_INDETERMINATE;
}
}
@@ -196,12 +196,12 @@
gtk_menu_item_set_label(gmi, g_value_get_string(value));
} else if (!g_strcmp0(prop, DBUSMENU_MENUITEM_PROP_VISIBLE)) {
process_visible(mi, gmi, value);
- } else if (!g_strcmp0(prop, DBUSMENU_MENUITEM_PROP_SENSITIVE)) {
+ } else if (!g_strcmp0(prop, DBUSMENU_MENUITEM_PROP_ENABLED)) {
process_sensitive(mi, gmi, value);
} else if (!g_strcmp0(prop, DBUSMENU_MENUITEM_PROP_TOGGLE_TYPE)) {
process_toggle_type(mi, gmi, value);
- } else if (!g_strcmp0(prop, DBUSMENU_MENUITEM_PROP_TOGGLE_CHECKED)) {
- process_toggle_checked(mi, gmi, value);
+ } else if (!g_strcmp0(prop, DBUSMENU_MENUITEM_PROP_TOGGLE_STATE)) {
+ process_toggle_state(mi, gmi, value);
}
return;
@@ -284,9 +284,9 @@
/* Check our set of props to see if any are set already */
process_visible(item, gmi, dbusmenu_menuitem_property_get_value(item, DBUSMENU_MENUITEM_PROP_VISIBLE));
- process_sensitive(item, gmi, dbusmenu_menuitem_property_get_value(item, DBUSMENU_MENUITEM_PROP_SENSITIVE));
+ process_sensitive(item, gmi, dbusmenu_menuitem_property_get_value(item, DBUSMENU_MENUITEM_PROP_ENABLED));
process_toggle_type(item, gmi, dbusmenu_menuitem_property_get_value(item, DBUSMENU_MENUITEM_PROP_TOGGLE_TYPE));
- process_toggle_checked(item, gmi, dbusmenu_menuitem_property_get_value(item, DBUSMENU_MENUITEM_PROP_TOGGLE_CHECKED));
+ process_toggle_state(item, gmi, dbusmenu_menuitem_property_get_value(item, DBUSMENU_MENUITEM_PROP_TOGGLE_STATE));
/* Oh, we're a child, let's deal with that */
if (parent != NULL) {
@@ -426,8 +426,8 @@
}
image_property_handle(newitem,
- DBUSMENU_MENUITEM_PROP_ICON,
- dbusmenu_menuitem_property_get_value(newitem, DBUSMENU_MENUITEM_PROP_ICON),
+ DBUSMENU_MENUITEM_PROP_ICON_NAME,
+ dbusmenu_menuitem_property_get_value(newitem, DBUSMENU_MENUITEM_PROP_ICON_NAME),
client);
image_property_handle(newitem,
DBUSMENU_MENUITEM_PROP_ICON_DATA,
@@ -468,7 +468,7 @@
image_property_handle (DbusmenuMenuitem * item, const gchar * property, const GValue * invalue, gpointer userdata)
{
/* We're only looking at these two properties here */
- if (g_strcmp0(property, DBUSMENU_MENUITEM_PROP_ICON) != 0 &&
+ if (g_strcmp0(property, DBUSMENU_MENUITEM_PROP_ICON_NAME) != 0 &&
g_strcmp0(property, DBUSMENU_MENUITEM_PROP_ICON_DATA) != 0) {
return;
}
@@ -482,10 +482,10 @@
if (value == NULL || value[0] == '\0') {
/* This means that we're unsetting a value. */
/* Try to use the other one */
- if (g_strcmp0(property, DBUSMENU_MENUITEM_PROP_ICON)) {
+ if (g_strcmp0(property, DBUSMENU_MENUITEM_PROP_ICON_NAME)) {
property = DBUSMENU_MENUITEM_PROP_ICON_DATA;
} else {
- property = DBUSMENU_MENUITEM_PROP_ICON;
+ property = DBUSMENU_MENUITEM_PROP_ICON_NAME;
}
}
@@ -507,7 +507,7 @@
}
/* Now figure out what to change */
- if (!g_strcmp0(property, DBUSMENU_MENUITEM_PROP_ICON)) {
+ if (!g_strcmp0(property, DBUSMENU_MENUITEM_PROP_ICON_NAME)) {
const gchar * iconname = dbusmenu_menuitem_property_get(item, property);
if (iconname == NULL) {
/* If there is no name, by golly we want no
Follow ups