projects
/
platform
/
core
/
uifw
/
at-spi2-atk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' into mgorse
[platform/core/uifw/at-spi2-atk.git]
/
atk-adaptor
/
document-adaptor.c
diff --git
a/atk-adaptor/document-adaptor.c
b/atk-adaptor/document-adaptor.c
index
91f6313
..
7cf1af7
100644
(file)
--- a/
atk-adaptor/document-adaptor.c
+++ b/
atk-adaptor/document-adaptor.c
@@
-25,10
+25,12
@@
#include <atk/atk.h>
#include <droute/droute.h>
#include <atk/atk.h>
#include <droute/droute.h>
-#include "spi-common/spi-dbus.h"
+#include "common/spi-dbus.h"
+
+#include "accessible-marshaller.h"
static DBusMessage *
static DBusMessage *
-impl_
g
etLocale (DBusConnection *bus,
+impl_
G
etLocale (DBusConnection *bus,
DBusMessage *message,
void *user_data)
{
DBusMessage *message,
void *user_data)
{
@@
-45,14
+47,14
@@
impl_getLocale (DBusConnection *bus,
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_STRING, &lc,
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_STRING, &lc,
- DBUS_TYPE_INVALID);
+
DBUS_TYPE_INVALID);
}
return reply;
}
static DBusMessage *
}
return reply;
}
static DBusMessage *
-impl_
g
etAttributeValue (DBusConnection * bus, DBusMessage * message,
- void *user_data)
+impl_
G
etAttributeValue (DBusConnection * bus, DBusMessage * message,
+
void *user_data)
{
AtkDocument *document = (AtkDocument *) user_data;
DBusError error;
{
AtkDocument *document = (AtkDocument *) user_data;
DBusError error;
@@
-66,7
+68,7
@@
impl_getAttributeValue (DBusConnection * bus, DBusMessage * message,
if (!dbus_message_get_args
(message, &error, DBUS_TYPE_STRING, &attributename, DBUS_TYPE_INVALID))
{
if (!dbus_message_get_args
(message, &error, DBUS_TYPE_STRING, &attributename, DBUS_TYPE_INVALID))
{
- return
SPI_DBUS_RETURN_ERROR (message, &error
);
+ return
droute_invalid_arguments_error (message
);
}
atr = atk_document_get_attribute_value (document, attributename);
if (!atr)
}
atr = atk_document_get_attribute_value (document, attributename);
if (!atr)
@@
-75,55
+77,41
@@
impl_getAttributeValue (DBusConnection * bus, DBusMessage * message,
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_STRING, &atr,
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_STRING, &atr,
- DBUS_TYPE_INVALID);
+
DBUS_TYPE_INVALID);
}
return reply;
}
static DBusMessage *
}
return reply;
}
static DBusMessage *
-impl_
g
etAttributes (DBusConnection * bus, DBusMessage * message,
- void *user_data)
+impl_
G
etAttributes (DBusConnection * bus, DBusMessage * message,
+
void *user_data)
{
AtkDocument *document = (AtkDocument *) user_data;
DBusMessage *reply;
AtkAttributeSet *attributes;
{
AtkDocument *document = (AtkDocument *) user_data;
DBusMessage *reply;
AtkAttributeSet *attributes;
- AtkAttribute *attr = NULL;
- char **retval;
- gint n_attributes = 0;
- gint i;
+ DBusMessageIter iter;
g_return_val_if_fail (ATK_IS_DOCUMENT (user_data),
droute_not_yet_handled_error (message));
attributes = atk_document_get_attributes (document);
g_return_val_if_fail (ATK_IS_DOCUMENT (user_data),
droute_not_yet_handled_error (message));
attributes = atk_document_get_attributes (document);
- if (attributes)
- n_attributes = g_slist_length (attributes);
-
- retval = (char **) g_malloc (n_attributes * sizeof (char *));
- for (i = 0; i < n_attributes; ++i)
- {
- attr = g_slist_nth_data (attributes, i);
- retval[i] = g_strconcat (attr->name, ":", attr->value, NULL);
- }
- if (attributes)
- atk_attribute_set_free (attributes);
reply = dbus_message_new_method_return (message);
if (reply)
{
reply = dbus_message_new_method_return (message);
if (reply)
{
- dbus_message_
append_args (reply, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING,
-
&retval, n_attributes, DBUS_TYPE_INVALID
);
+ dbus_message_
iter_init_append (reply, &iter);
+
spi_atk_append_attribute_set (&iter, attributes
);
}
}
- for (i = 0; i < n_attributes; i++)
- g_free (retval[i]);
-
g_free (retval
);
+
+ if (attributes)
+
atk_attribute_set_free (attributes
);
return reply;
}
static DRouteMethod methods[] = {
return reply;
}
static DRouteMethod methods[] = {
- {impl_
getLocale, "g
etLocale"},
- {impl_
getAttributeValue, "g
etAttributeValue"},
- {impl_
getAttributes, "g
etAttributes"},
+ {impl_
GetLocale, "G
etLocale"},
+ {impl_
GetAttributeValue, "G
etAttributeValue"},
+ {impl_
GetAttributes, "G
etAttributes"},
{NULL, NULL}
};
{NULL, NULL}
};