From 5f42d1712e443df0032f3313e647753d4fcddbfc Mon Sep 17 00:00:00 2001 From: Aurelien Gateau Date: Mon, 1 Feb 2010 14:51:30 -0800 Subject: Use doxymel for documentation. --- libdbusmenu-glib/Doxyfile | 257 +++++++++++++++++++++++++++++++++++++++ libdbusmenu-glib/dbus-menu.xml | 268 +++++++++++++++++++++++------------------ 2 files changed, 407 insertions(+), 118 deletions(-) create mode 100644 libdbusmenu-glib/Doxyfile (limited to 'libdbusmenu-glib') diff --git a/libdbusmenu-glib/Doxyfile b/libdbusmenu-glib/Doxyfile new file mode 100644 index 0000000..78e8666 --- /dev/null +++ b/libdbusmenu-glib/Doxyfile @@ -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 diff --git a/libdbusmenu-glib/dbus-menu.xml b/libdbusmenu-glib/dbus-menu.xml index 866969e..692158e 100644 --- a/libdbusmenu-glib/dbus-menu.xml +++ b/libdbusmenu-glib/dbus-menu.xml @@ -27,65 +27,107 @@ You should have received a copy of both the GNU Lesser General Public License version 3 and version 2.1 along with this program. If not, see --> - + + -" + + @c type property is an enum which can take the following values: + + - @c action: An item which can be clicked to trigger an action + - @c checkbox: An item which can be checked or unchecked + - @c radio: An item which can be checked or unchecked as part of a group + - @c separator: A separator + - @c menu: An item which contains more items + + Vendor specific types can be added by prefixing them with "x--" + ]]> - - + + + Provides the version of the DBusmenu API that this API is + implementing. + + - - - - + # Root container + # First level menu, for example "File" + ~ Second level menu, for example "Open" + + ... + + # Another first level menu, say "Edit" + ... + + ... + + @endverbatim + ]]> + + The ID of the parent node for the layout. For + grabbing the layout from the root node use zero. + + + The revision number of the layout. For matching + with layoutUpdated signals. + + + The layout as an XML string of IDs. + - - - - + + Returns the list of items which are children of @a parentId. + + + + A list of ids that we should be finding the properties + on. If the list is empty, all menu items should be sent. + + + + + 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 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 + + @@ -94,99 +136,89 @@ An item is represented as a struct following this format: - - + + Returns multiple properties in one call. This is more efficient than + GetProperty. + + - - + + The item whose properties we want to retrieve. + + + List of string name of the properties we want. If the list contains no entries, all properties are sent. + - - - - - + -" + ]]> + + the id of the item which received the event + + + the type of event + + + event-specific data + + + The time that the event occured if available or the time the message was sent if not + - + + Triggered by the application to notify the applet that the property @a property + from item @a id has changed to @a value. + - - + + Triggered by the application to notify the applet that all properties of item + + + id which should be considered outdated + - - - - + + + Triggered by the application to notify display of a layout update, up to + revision + + + The revision of the layout that we're currently on + + + + 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. + + -- cgit v1.2.3 From 8ed4357299fc74f5299d6fb74d2d8439f6ac4b0a Mon Sep 17 00:00:00 2001 From: Aurelien Gateau Date: Mon, 1 Feb 2010 15:15:28 -0800 Subject: Nicer verbatim output --- libdbusmenu-glib/dbus-menu.xml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'libdbusmenu-glib') diff --git a/libdbusmenu-glib/dbus-menu.xml b/libdbusmenu-glib/dbus-menu.xml index 692158e..07a3827 100644 --- a/libdbusmenu-glib/dbus-menu.xml +++ b/libdbusmenu-glib/dbus-menu.xml @@ -76,17 +76,17 @@ License version 3 and version 2.1 along with this program. If not, see XML syntax: @verbatim - # Root container - # First level menu, for example "File" - ~ Second level menu, for example "Open" - - ... - - # Another first level menu, say "Edit" - ... - - ... - + # Root container + # First level menu, for example "File" + ~ Second level menu, for example "Open" + + ... + + # Another first level menu, say "Edit" + ... + + ... + @endverbatim ]]> -- cgit v1.2.3 From e69b32de65e1ff5ce0ac8b43c1f22dec909ea9b7 Mon Sep 17 00:00:00 2001 From: Aurelien Gateau Date: Mon, 1 Feb 2010 16:03:31 -0800 Subject: - Make menu item id an integer (useful to indicate bad id as -1) - Merged with the other spec --- libdbusmenu-glib/dbus-menu.xml | 46 ++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 22 deletions(-) (limited to 'libdbusmenu-glib') diff --git a/libdbusmenu-glib/dbus-menu.xml b/libdbusmenu-glib/dbus-menu.xml index 07a3827..77374eb 100644 --- a/libdbusmenu-glib/dbus-menu.xml +++ b/libdbusmenu-glib/dbus-menu.xml @@ -39,22 +39,24 @@ License version 3 and version 2.1 along with this program. If not, see Available properties are: - @c type (string): Type of the item (see below) - - @c label (string): Text of the item - - @c icon-data (binary): Raw data of the icon (TODO: define format) - - @c icon (string): Icon name of the item, following icon spec - - @c sensitive (boolean): Whether the item can be activated or not - - @c checked (boolean): Whether a checkbox or radio item is checked - - @c shortcut (string): The keyboard shortcut + - @c label (string): Text of the item, except that (a) two consecutive + underscore characters "__" are displayed as a single underscore, (b) + any remaining underscore characters are not displayed at all, and (c) + 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. + - @c icon-name (string): Icon name of the item, following icon spec + - @c icon-data (binary): PNG data of the icon + - @c enabled (boolean): Whether the item can be activated or not + - @c toggle-type (string): none, checkmark, switch, radio + - @c toggle-state (int): 0 = off, 1 = on, anything else = indeterminate Vendor specific properties can be added by prefixing them with "x--" @c type property is an enum which can take the following values: - - @c action: An item which can be clicked to trigger an action - - @c checkbox: An item which can be checked or unchecked - - @c radio: An item which can be checked or unchecked as part of a group + - @c standard: An item which can be clicked to trigger an action - @c separator: A separator - - @c menu: An item which contains more items Vendor specific types can be added by prefixing them with "x--" ]]> @@ -89,7 +91,7 @@ License version 3 and version 2.1 along with this program. If not, see @endverbatim ]]> - + The ID of the parent node for the layout. For grabbing the layout from the root node use zero. @@ -106,7 +108,7 @@ License version 3 and version 2.1 along with this program. If not, see Returns the list of items which are children of @a parentId. - + A list of ids that we should be finding the properties on. If the list is empty, all menu items should be sent. @@ -119,7 +121,7 @@ License version 3 and version 2.1 along with this program. If not, see the properties will be sent. - + An array of property values. An item in this area is represented as a struct following @@ -131,13 +133,13 @@ License version 3 and version 2.1 along with this program. If not, see - + - + - + @@ -149,7 +151,7 @@ License version 3 and version 2.1 along with this program. If not, see - + The item whose properties we want to retrieve. @@ -170,7 +172,7 @@ License version 3 and version 2.1 along with this program. If not, see Vendor specific events can be added by prefixing them with "x--" ]]> - + the id of the item which received the event @@ -190,7 +192,7 @@ License version 3 and version 2.1 along with this program. If not, see Triggered by the application to notify the applet that the property @a property from item @a id has changed to @a value. - + @@ -199,7 +201,7 @@ License version 3 and version 2.1 along with this program. If not, see Triggered by the application to notify the applet that all properties of item - + id which should be considered outdated @@ -209,10 +211,10 @@ License version 3 and version 2.1 along with this program. If not, see Triggered by the application to notify display of a layout update, up to revision - + The revision of the layout that we're currently on - + If the layout update is only of a subtree, this is the parent item for the entries that have changed. It is zero if -- cgit v1.2.3 From 3230218b3f812495f6b81d6aaa741f41aacf8c25 Mon Sep 17 00:00:00 2001 From: Aurelien Gateau Date: Mon, 1 Feb 2010 16:47:25 -0800 Subject: Turn property descriptions into a table. --- libdbusmenu-glib/dbus-menu.xml | 114 +++++++++++++++++++++++++++++++++-------- 1 file changed, 93 insertions(+), 21 deletions(-) (limited to 'libdbusmenu-glib') diff --git a/libdbusmenu-glib/dbus-menu.xml b/libdbusmenu-glib/dbus-menu.xml index 77374eb..b795f9c 100644 --- a/libdbusmenu-glib/dbus-menu.xml +++ b/libdbusmenu-glib/dbus-menu.xml @@ -38,27 +38,99 @@ License version 3 and version 2.1 along with this program. If not, see Available properties are: - - @c type (string): Type of the item (see below) - - @c label (string): Text of the item, except that (a) two consecutive - underscore characters "__" are displayed as a single underscore, (b) - any remaining underscore characters are not displayed at all, and (c) - 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. - - @c icon-name (string): Icon name of the item, following icon spec - - @c icon-data (binary): PNG data of the icon - - @c enabled (boolean): Whether the item can be activated or not - - @c toggle-type (string): none, checkmark, switch, radio - - @c toggle-state (int): 0 = off, 1 = on, anything else = indeterminate - - Vendor specific properties can be added by prefixing them with "x--" - - @c type property is an enum which can take the following values: - - - @c standard: An item which can be clicked to trigger an action - - @c separator: A separator - - Vendor specific types can be added by prefixing them with "x--" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault Value
typeStringCan 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--". + "standard"
labelstringText 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. + ""
enabledbooleanWhether the item can be activated or not.true
icon-namestringIcon name of the item, following the freedesktop.org icon spec.""
icon-databinaryPNG data of the icon.Empty
toggle-typestring + 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 + ""
toggle-stateint + 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. + 0
children-displaystring + If the menu item has children this property should be set to + "submenu". + ""
+ + Vendor specific properties can be added by prefixing them with + "x--". ]]>
-- cgit v1.2.3 From 8939f05fde72c41d8f65c09a423702245c8c77a4 Mon Sep 17 00:00:00 2001 From: Aurelien Gateau Date: Mon, 1 Feb 2010 16:49:47 -0800 Subject: Misc fixes --- libdbusmenu-glib/dbus-menu.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libdbusmenu-glib') diff --git a/libdbusmenu-glib/dbus-menu.xml b/libdbusmenu-glib/dbus-menu.xml index b795f9c..53b0d4c 100644 --- a/libdbusmenu-glib/dbus-menu.xml +++ b/libdbusmenu-glib/dbus-menu.xml @@ -188,7 +188,7 @@ License version 3 and version 2.1 along with this program. If not, see
- list of string the list of item properties we are + The list of item properties we are interested in. If there are no entries in the list all of the properties will be sent. @@ -278,7 +278,7 @@ License version 3 and version 2.1 along with this program. If not, see - + Triggered by the application to notify display of a layout update, up to revision -- cgit v1.2.3 From 83f5fe3159641096711337b3d903e80e83b7f547 Mon Sep 17 00:00:00 2001 From: Aurelien Gateau Date: Mon, 1 Feb 2010 17:44:14 -0800 Subject: - Annotations necessary for the Qt side. - Other minor tweaks. --- libdbusmenu-glib/dbus-menu.xml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'libdbusmenu-glib') diff --git a/libdbusmenu-glib/dbus-menu.xml b/libdbusmenu-glib/dbus-menu.xml index 53b0d4c..121725e 100644 --- a/libdbusmenu-glib/dbus-menu.xml +++ b/libdbusmenu-glib/dbus-menu.xml @@ -8,6 +8,7 @@ Copyright 2009 Canonical Ltd. Authors: Ted Gould + Aurelien Gateau This program is free software: you can redistribute it and/or modify it under the terms of either or both of the following licenses: @@ -177,10 +178,12 @@ License version 3 and version 2.1 along with this program. If not, see + + Returns the list of items which are children of @a parentId. - + A list of ids that we should be finding the properties on. If the list is empty, all menu items should be sent. @@ -205,6 +208,7 @@ License version 3 and version 2.1 along with this program. If not, see + -- cgit v1.2.3 From 1604731c2d68d1a56a4ab87d08ee1867a25eb25a Mon Sep 17 00:00:00 2001 From: Aurelien Gateau Date: Tue, 2 Feb 2010 16:32:49 -0800 Subject: Turn id into an int --- libdbusmenu-glib/client.c | 12 ++++++------ libdbusmenu-glib/menuitem.c | 12 ++++++------ libdbusmenu-glib/menuitem.h | 6 +++--- libdbusmenu-glib/server.c | 26 +++++++++++++------------- libdbusmenu-glib/server.h | 4 ++-- 5 files changed, 30 insertions(+), 30 deletions(-) (limited to 'libdbusmenu-glib') diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c index 720c8e2..5d07fc6 100644 --- a/libdbusmenu-glib/client.c +++ b/libdbusmenu-glib/client.c @@ -96,8 +96,8 @@ static void set_property (GObject * obj, guint id, const GValue * value, GParamS 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 @@ layout_update (DBusGProxy * proxy, gint revision, guint parent, DbusmenuClient * /* 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 @@ id_prop_update (DBusGProxy * proxy, guint id, gchar * property, GValue * value, /* 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 @@ parse_node_get_id (xmlNodePtr node) 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 @@ menuitem_activate (DbusmenuMenuitem * mi, DbusmenuClient * client) 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 diff --git a/libdbusmenu-glib/menuitem.c b/libdbusmenu-glib/menuitem.c index 06d6200..08cc27b 100644 --- a/libdbusmenu-glib/menuitem.c +++ b/libdbusmenu-glib/menuitem.c @@ -55,7 +55,7 @@ License version 3 and version 2.1 along with this program. If not, see typedef struct _DbusmenuMenuitemPrivate DbusmenuMenuitemPrivate; struct _DbusmenuMenuitemPrivate { - guint id; + gint id; GList * children; GHashTable * properties; gboolean root; @@ -367,7 +367,7 @@ dbusmenu_menuitem_new (void) 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 @@ dbusmenu_menuitem_child_reorder(DbusmenuMenuitem * mi, DbusmenuMenuitem * child, 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 @@ dbusmenu_menuitem_child_find (DbusmenuMenuitem * mi, guint id) 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 @@ find_id_helper (gpointer in_mi, gpointer in_find_id) 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 @@ dbusmenu_menuitem_buildxml (DbusmenuMenuitem * mi, GPtrArray * array) { 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); } diff --git a/libdbusmenu-glib/menuitem.h b/libdbusmenu-glib/menuitem.h index 238b7d9..547b357 100644 --- a/libdbusmenu-glib/menuitem.h +++ b/libdbusmenu-glib/menuitem.h @@ -122,7 +122,7 @@ struct _DbusmenuMenuitemClass 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_prepend (DbusmenuMenuitem * mi, DbusmenuMenuite 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); diff --git a/libdbusmenu-glib/server.c b/libdbusmenu-glib/server.c index afcbfd3..af45ffc 100644 --- a/libdbusmenu-glib/server.c +++ b/libdbusmenu-glib/server.c @@ -36,11 +36,11 @@ License version 3 and version 2.1 along with this program. If not, see /* 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 @@ _dbusmenu_server_get_layout (DbusmenuServer * server, guint parent, guint * revi } 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 @@ _dbusmenu_server_get_property (DbusmenuServer * server, guint id, gchar * proper } 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 @@ _dbusmenu_server_get_group_properties (DbusmenuServer * server, GArray * ids, GA } 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 @@ serialize_menuitem(gpointer data, gpointer user_data) 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 @@ _dbusmenu_server_get_children (DbusmenuServer * server, guint id, GPtrArray * pr } 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); diff --git a/libdbusmenu-glib/server.h b/libdbusmenu-glib/server.h index e4d6dc7..f4e3527 100644 --- a/libdbusmenu-glib/server.h +++ b/libdbusmenu-glib/server.h @@ -70,8 +70,8 @@ struct _DbusmenuServerClass { 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 */ -- cgit v1.2.3 From 141060ba0a68af200973b91d7ca7e8e01fd7e79d Mon Sep 17 00:00:00 2001 From: Aurelien Gateau Date: Tue, 2 Feb 2010 16:57:41 -0800 Subject: icon -> icon-name sensitive -> enabled toggle-checked -> toggle-state toggle-state is now an int --- libdbusmenu-glib/menuitem.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'libdbusmenu-glib') diff --git a/libdbusmenu-glib/menuitem.h b/libdbusmenu-glib/menuitem.h index 547b357..45445c6 100644 --- a/libdbusmenu-glib/menuitem.h +++ b/libdbusmenu-glib/menuitem.h @@ -52,19 +52,19 @@ G_BEGIN_DECLS #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: -- cgit v1.2.3 From 29d3e5fa54df93e5a139ecd34f1d51cb28dcb6b2 Mon Sep 17 00:00:00 2001 From: Aurelien Gateau Date: Tue, 2 Feb 2010 17:42:14 -0800 Subject: Turn parent parameter of get_layout to an int as well --- libdbusmenu-glib/server.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libdbusmenu-glib') diff --git a/libdbusmenu-glib/server.c b/libdbusmenu-glib/server.c index af45ffc..6e7ee7d 100644 --- a/libdbusmenu-glib/server.c +++ b/libdbusmenu-glib/server.c @@ -35,7 +35,7 @@ License version 3 and version 2.1 along with this program. If not, see #include "server-marshal.h" /* DBus Prototypes */ -static gboolean _dbusmenu_server_get_layout (DbusmenuServer * server, guint parent, guint * revision, gchar ** layout, GError ** error); +static gboolean _dbusmenu_server_get_layout (DbusmenuServer * server, gint parent, guint * revision, gchar ** layout, 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); @@ -366,7 +366,7 @@ error_quark (void) /* DBus interface */ static gboolean -_dbusmenu_server_get_layout (DbusmenuServer * server, guint parent, guint * revision, gchar ** layout, GError ** error) +_dbusmenu_server_get_layout (DbusmenuServer * server, gint parent, guint * revision, gchar ** layout, GError ** error) { DbusmenuServerPrivate * priv = DBUSMENU_SERVER_GET_PRIVATE(server); -- cgit v1.2.3 From 96512c9c06438eb32d8af0e29229f84455fffc64 Mon Sep 17 00:00:00 2001 From: Aurelien Gateau Date: Tue, 2 Feb 2010 19:02:34 -0800 Subject: - Allow id to be 0. - Fix default item type. --- libdbusmenu-glib/client.c | 25 +++++++++++++------------ libdbusmenu-glib/client.h | 4 ++-- libdbusmenu-glib/menuitem.c | 15 ++++++--------- 3 files changed, 21 insertions(+), 23 deletions(-) (limited to 'libdbusmenu-glib') diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c index 5d07fc6..66984e2 100644 --- a/libdbusmenu-glib/client.c +++ b/libdbusmenu-glib/client.c @@ -99,7 +99,7 @@ static void layout_update (DBusGProxy * proxy, gint revision, guint parent, Dbus 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 gint parse_node_get_id (xmlNodePtr node); static DbusmenuMenuitem * parse_layout_xml(DbusmenuClient * client, xmlNodePtr node, DbusmenuMenuitem * item, DbusmenuMenuitem * parent, DBusGProxy * proxy); static gint parse_layout (DbusmenuClient * client, const gchar * layout); static void update_layout_cb (DBusGProxy * proxy, guint rev, gchar * xml, GError * in_error, void * data); @@ -517,20 +517,20 @@ build_proxies (DbusmenuClient * client) /* Get the ID attribute of the node, parse it and return it. Also we're checking to ensure the node is a 'menu' here. */ -static guint +static gint parse_node_get_id (xmlNodePtr node) { if (g_strcmp0((gchar *)node->name, "menu") != 0) { /* This kills some nodes early */ g_warning("XML Node is not 'menu' it is '%s'", node->name); - return 0; + return -1; } xmlAttrPtr attrib; for (attrib = node->properties; attrib != NULL; attrib = attrib->next) { if (g_strcmp0((gchar *)attrib->name, "id") == 0) { if (attrib->children != NULL) { - gint id = (guint)g_ascii_strtoull((gchar *)attrib->children->content, NULL, 10); + gint id = (guint)g_ascii_strtoll((gchar *)attrib->children->content, NULL, 10); /* g_debug ("Found ID: %d", id); */ return id; } @@ -539,7 +539,7 @@ parse_node_get_id (xmlNodePtr node) } g_warning("Unable to find an ID on the node"); - return 0; + return -1; } /* A small helper that calls _property_set on each hash table @@ -643,10 +643,13 @@ static DbusmenuMenuitem * parse_layout_xml(DbusmenuClient * client, xmlNodePtr node, DbusmenuMenuitem * item, DbusmenuMenuitem * parent, DBusGProxy * proxy) { gint id = parse_node_get_id(node); + if (id < 0) { + return NULL; + } #ifdef MASSIVEDEBUGGING g_debug("Client looking at node with id: %d", id); #endif - if (item == NULL || dbusmenu_menuitem_get_id(item) != id || id == 0) { + if (item == NULL || dbusmenu_menuitem_get_id(item) != id) { if (item != NULL) { if (parent != NULL) { dbusmenu_menuitem_child_delete(parent, item); @@ -655,11 +658,6 @@ parse_layout_xml(DbusmenuClient * client, xmlNodePtr node, DbusmenuMenuitem * it item = NULL; } - if (id == 0) { - g_warning("ID from XML file is zero"); - return NULL; - } - /* Build a new item */ item = dbusmenu_menuitem_new_with_id(id); if (parent == NULL) { @@ -689,7 +687,10 @@ parse_layout_xml(DbusmenuClient * client, xmlNodePtr node, DbusmenuMenuitem * it for (children = node->children, position = 0; children != NULL; children = children->next, position++) { /* g_debug("Looking at child: %d", position); */ - guint childid = parse_node_get_id(children); + gint childid = parse_node_get_id(children); + if (childid < 0) { + continue; + } DbusmenuMenuitem * childmi = NULL; GList * childsearch = NULL; diff --git a/libdbusmenu-glib/client.h b/libdbusmenu-glib/client.h index b42bc83..15192f4 100644 --- a/libdbusmenu-glib/client.h +++ b/libdbusmenu-glib/client.h @@ -50,9 +50,9 @@ G_BEGIN_DECLS #define DBUSMENU_CLIENT_PROP_DBUS_NAME "dbus-name" #define DBUSMENU_CLIENT_PROP_DBUS_OBJECT "dbus-object" -#define DBUSMENU_CLIENT_TYPES_DEFAULT "menuitem" +#define DBUSMENU_CLIENT_TYPES_DEFAULT "standard" #define DBUSMENU_CLIENT_TYPES_SEPARATOR "separator" -#define DBUSMENU_CLIENT_TYPES_IMAGE "menuitem" +#define DBUSMENU_CLIENT_TYPES_IMAGE "standard" /** DbusmenuClientClass: diff --git a/libdbusmenu-glib/menuitem.c b/libdbusmenu-glib/menuitem.c index 08cc27b..7e1e1ac 100644 --- a/libdbusmenu-glib/menuitem.c +++ b/libdbusmenu-glib/menuitem.c @@ -207,7 +207,7 @@ dbusmenu_menuitem_class_init (DbusmenuMenuitemClass *klass) G_TYPE_NONE, 0, G_TYPE_NONE); g_object_class_install_property (object_class, PROP_ID, - g_param_spec_uint("id", "ID for the menu item", + g_param_spec_int("id", "ID for the menu item", "This is a unique indentifier for the menu item.", 0, 30000, 0, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); @@ -246,7 +246,7 @@ g_value_transform_STRING_INT (const GValue * in, GValue * out) return; } -static guint menuitem_next_id = 1; +static gint menuitem_next_id = 1; /* A small little function to both clear the insides of a value as well as the memory it itself uses. */ @@ -315,9 +315,9 @@ set_property (GObject * obj, guint id, const GValue * value, GParamSpec * pspec) switch (id) { case PROP_ID: - priv->id = g_value_get_uint(value); + priv->id = g_value_get_int(value); if (priv->id > menuitem_next_id) { - menuitem_next_id = priv->id; + menuitem_next_id = priv->id + 1; } break; } @@ -332,10 +332,7 @@ get_property (GObject * obj, guint id, GValue * value, GParamSpec * pspec) switch (id) { case PROP_ID: - if (priv->id == 0) { - priv->id = menuitem_next_id++; - } - g_value_set_uint(value, priv->id); + g_value_set_int(value, priv->id); break; } @@ -355,7 +352,7 @@ get_property (GObject * obj, guint id, GValue * value, GParamSpec * pspec) DbusmenuMenuitem * dbusmenu_menuitem_new (void) { - return g_object_new(DBUSMENU_TYPE_MENUITEM, NULL); + return g_object_new(DBUSMENU_TYPE_MENUITEM, "id", menuitem_next_id++, NULL); } /** -- cgit v1.2.3 From f62b7b881e204847691a409f81714626f6806df4 Mon Sep 17 00:00:00 2001 From: Aurelien Gateau Date: Tue, 2 Feb 2010 19:07:19 -0800 Subject: Root id should be 0 --- libdbusmenu-glib/menuitem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libdbusmenu-glib') diff --git a/libdbusmenu-glib/menuitem.c b/libdbusmenu-glib/menuitem.c index 7e1e1ac..8198929 100644 --- a/libdbusmenu-glib/menuitem.c +++ b/libdbusmenu-glib/menuitem.c @@ -246,7 +246,7 @@ g_value_transform_STRING_INT (const GValue * in, GValue * out) return; } -static gint menuitem_next_id = 1; +static gint menuitem_next_id = 0; /* A small little function to both clear the insides of a value as well as the memory it itself uses. */ -- cgit v1.2.3 From dce7fafe92e88badb2d43ac8bca80f176073767a Mon Sep 17 00:00:00 2001 From: Aurelien Gateau Date: Wed, 3 Feb 2010 10:33:58 -0800 Subject: Fix types of signal params --- libdbusmenu-glib/client.c | 6 +++--- libdbusmenu-glib/server-marshal.list | 2 +- libdbusmenu-glib/server.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'libdbusmenu-glib') diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c index 66984e2..9eb684f 100644 --- a/libdbusmenu-glib/client.c +++ b/libdbusmenu-glib/client.c @@ -498,15 +498,15 @@ build_proxies (DbusmenuClient * client) priv->dbusproxy = NULL; } - dbus_g_object_register_marshaller(_dbusmenu_server_marshal_VOID__INT_UINT, G_TYPE_NONE, G_TYPE_INT, G_TYPE_UINT, G_TYPE_INVALID); - dbus_g_proxy_add_signal(priv->menuproxy, "LayoutUpdated", G_TYPE_INT, G_TYPE_UINT, G_TYPE_INVALID); + dbus_g_object_register_marshaller(_dbusmenu_server_marshal_VOID__UINT_INT, G_TYPE_NONE, G_TYPE_UINT, G_TYPE_INT, G_TYPE_INVALID); + dbus_g_proxy_add_signal(priv->menuproxy, "LayoutUpdated", G_TYPE_UINT, G_TYPE_INT, G_TYPE_INVALID); dbus_g_proxy_connect_signal(priv->menuproxy, "LayoutUpdated", G_CALLBACK(layout_update), client, NULL); 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); dbus_g_proxy_add_signal(priv->menuproxy, "ItemPropertyUpdated", G_TYPE_UINT, G_TYPE_STRING, G_TYPE_VALUE, G_TYPE_INVALID); dbus_g_proxy_connect_signal(priv->menuproxy, "ItemPropertyUpdated", G_CALLBACK(id_prop_update), client, NULL); - dbus_g_proxy_add_signal(priv->menuproxy, "ItemUpdated", G_TYPE_UINT, G_TYPE_INVALID); + dbus_g_proxy_add_signal(priv->menuproxy, "ItemUpdated", G_TYPE_INT, G_TYPE_INVALID); dbus_g_proxy_connect_signal(priv->menuproxy, "ItemUpdated", G_CALLBACK(id_update), client, NULL); update_layout(client); diff --git a/libdbusmenu-glib/server-marshal.list b/libdbusmenu-glib/server-marshal.list index 044c64d..c5ec641 100644 --- a/libdbusmenu-glib/server-marshal.list +++ b/libdbusmenu-glib/server-marshal.list @@ -1,2 +1,2 @@ VOID: UINT, STRING, POINTER -VOID: INT, UINT +VOID: UINT, INT diff --git a/libdbusmenu-glib/server.c b/libdbusmenu-glib/server.c index 6e7ee7d..b6eb7aa 100644 --- a/libdbusmenu-glib/server.c +++ b/libdbusmenu-glib/server.c @@ -162,8 +162,8 @@ dbusmenu_server_class_init (DbusmenuServerClass *class) G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(DbusmenuServerClass, layout_updated), NULL, NULL, - _dbusmenu_server_marshal_VOID__INT_UINT, - G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_UINT); + _dbusmenu_server_marshal_VOID__UINT_INT, + G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_INT); g_object_class_install_property (object_class, PROP_DBUS_OBJECT, -- cgit v1.2.3 From 20416aa05b0ddcf0a6077ec6049a39c1cefea7b9 Mon Sep 17 00:00:00 2001 From: Aurelien Gateau Date: Wed, 3 Feb 2010 17:24:07 -0800 Subject: Add timestamp to activate prototype. --- libdbusmenu-glib/client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libdbusmenu-glib') diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c index 9eb684f..dbe7b3c 100644 --- a/libdbusmenu-glib/client.c +++ b/libdbusmenu-glib/client.c @@ -627,7 +627,7 @@ menuitem_call_cb (DBusGProxy * proxy, GError * error, gpointer userdata) } static void -menuitem_activate (DbusmenuMenuitem * mi, DbusmenuClient * client) +menuitem_activate (DbusmenuMenuitem * mi, uint timestamp, DbusmenuClient * client) { DbusmenuClientPrivate * priv = DBUSMENU_CLIENT_GET_PRIVATE(client); GValue value = {0}; -- cgit v1.2.3