aboutsummaryrefslogtreecommitdiff
path: root/libdbusmenu-glib
diff options
context:
space:
mode:
authorAurelien Gateau <aurelien.gateau@canonical.com>2010-02-02 16:32:49 -0800
committerAurelien Gateau <aurelien.gateau@canonical.com>2010-02-02 16:32:49 -0800
commit1604731c2d68d1a56a4ab87d08ee1867a25eb25a (patch)
treea7e33833d38016eb9ff1b5877e962fc8a45218ae /libdbusmenu-glib
parent83f5fe3159641096711337b3d903e80e83b7f547 (diff)
downloadlibdbusmenu-1604731c2d68d1a56a4ab87d08ee1867a25eb25a.tar.gz
libdbusmenu-1604731c2d68d1a56a4ab87d08ee1867a25eb25a.tar.bz2
libdbusmenu-1604731c2d68d1a56a4ab87d08ee1867a25eb25a.zip
Turn id into an int
Diffstat (limited to 'libdbusmenu-glib')
-rw-r--r--libdbusmenu-glib/client.c12
-rw-r--r--libdbusmenu-glib/menuitem.c12
-rw-r--r--libdbusmenu-glib/menuitem.h6
-rw-r--r--libdbusmenu-glib/server.c26
-rw-r--r--libdbusmenu-glib/server.h4
5 files changed, 30 insertions, 30 deletions
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 */