}
static DBusMessage *
+impl_getCharacterAtOffset (DBusConnection * bus, DBusMessage * message,
+ void *user_data)
+{
+ AtkText *text = get_text (message);
+ dbus_int32_t offset;
+ dbus_int32_t ch;
+ DBusError error;
+ DBusMessage *reply;
+
+ if (!text)
+ return spi_dbus_general_error (message);
+ dbus_error_init (&error);
+ if (!dbus_message_get_args
+ (message, &error, DBUS_TYPE_INT32, &offset, DBUS_TYPE_INVALID))
+ {
+ return SPI_DBUS_RETURN_ERROR (message, &error);
+ }
+ ch = atk_text_get_character_at_offset (text, offset);
+ reply = dbus_message_new_method_return (message);
+ if (reply)
+ {
+ dbus_message_append_args (reply, DBUS_TYPE_INT32, &ch, DBUS_TYPE_INVALID);
+ }
+ return reply;
+}
+
+static DBusMessage *
impl_getAttributeValue (DBusConnection * bus, DBusMessage * message,
void *user_data)
{
if (attributes)
n_attributes = g_slist_length (attributes);
- retval = (char **) malloc (n_attributes * sizeof (char *));
+ retval = g_new (char *, n_attributes);
for (i = 0; i < n_attributes; ++i)
{
{impl_getTextBeforeOffset, "getTextBeforeOffset"},
{impl_getTextAtOffset, "getTextAtOffset"},
{impl_getTextAfterOffset, "getTextAfterOffset"},
+ {impl_getCharacterAtOffset, "getCharacterAtOffset"},
{impl_getAttributeValue, "getAttributeValue"},
{impl_getAttributes, "getAttributes"},
{impl_getDefaultAttributes, "getDefaultAttributes"},
</tp:docstring>
</arg>
</method>
+ <method name="getCharacterOffset">
+ <arg name="offset" type="i" direction="in"/>
+ <arg type="i" direction="out">
+ <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
+ an unsigned long integer whose value corresponds to the UCS-4 representation of the
+ character at the specified text offset, or 0 if offset is out of range.
+ long instead of wchar, to allow unicode chars > 16 bits
+ </tp:docstring>
+ </arg>
+ </method>
<method name="getAttributeValue">
<tp:docstring xmlns="http://www.w3.org/1999/xhtml">
- <p>long instead of wchar,
- to allow unicode chars > 16 bits </p>
-
<p>Get the string value of a named attribute at a given offset, if defined.
@param offset the offset of the character for which the attribute run is to be obtained.
@param attributeName the name of the attribute for which the value is to be returned, if defined.