Attempt to reduce the size of the spi-common library.
Move some of the error functions out to droute library.
droute_not_yet_handled_error (message));
if (!dbus_message_get_args (message, &error, DBUS_TYPE_INT32, &index, DBUS_TYPE_INVALID))
{
- return spi_dbus_general_error (message);
+ return droute_invalid_arguments_error (message);
}
desc = atk_action_get_description(action, index);
if (!desc) desc = "";
droute_not_yet_handled_error (message));
if (!dbus_message_get_args (message, &error, DBUS_TYPE_INT32, &index, DBUS_TYPE_INVALID))
{
- return spi_dbus_general_error (message);
+ return droute_invalid_arguments_error (message);
}
name = atk_action_get_name(action, index);
if (!name) name = "";
droute_not_yet_handled_error (message));
if (!dbus_message_get_args (message, &error, DBUS_TYPE_INT32, &index, DBUS_TYPE_INVALID))
{
- return spi_dbus_general_error (message);
+ return droute_invalid_arguments_error (message);
}
kb = atk_action_get_keybinding(action, index);
if (!kb) kb = "";
if (!dbus_message_get_args
(message, &error, DBUS_TYPE_INT32, &index, DBUS_TYPE_INVALID))
{
- return SPI_DBUS_RETURN_ERROR (message, &error);
+ return droute_invalid_arguments_error (message);
}
rv = atk_action_do_action(action, index);
reply = dbus_message_new_method_return (message);
(message, &error, DBUS_TYPE_INT32, &x, DBUS_TYPE_INT32, &y,
DBUS_TYPE_INT16, &coord_type, DBUS_TYPE_INVALID))
{
- return SPI_DBUS_RETURN_ERROR (message, &error);
+ return droute_invalid_arguments_error (message);
}
retval =
atk_component_contains (component, x, y, (AtkCoordType) coord_type);
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_BOOLEAN, &retval,
- DBUS_TYPE_INVALID);
+ DBUS_TYPE_INVALID);
}
return reply;
}
static DBusMessage *
impl_getAccessibleAtPoint (DBusConnection * bus, DBusMessage * message,
- void *user_data)
+ void *user_data)
{
AtkComponent *component = (AtkComponent *) user_data;
dbus_int32_t x, y;
(message, &error, DBUS_TYPE_INT32, &x, DBUS_TYPE_INT32, &y,
DBUS_TYPE_INT16, &coord_type, DBUS_TYPE_INVALID))
{
- return SPI_DBUS_RETURN_ERROR (message, &error);
+ return droute_invalid_arguments_error (message);
}
child =
atk_component_ref_accessible_at_point (component, x, y,
- (AtkCoordType) coord_type);
+ (AtkCoordType) coord_type);
return spi_dbus_return_object (message, child, TRUE);
}
if (!dbus_message_get_args
(message, &error, DBUS_TYPE_INT16, &coord_type, DBUS_TYPE_INVALID))
{
- return SPI_DBUS_RETURN_ERROR (message, &error);
+ return droute_invalid_arguments_error (message);
}
atk_component_get_extents (component, &ix, &iy, &iwidth, &iheight,
- (AtkCoordType) coord_type);
+ (AtkCoordType) coord_type);
return spi_dbus_return_rect (message, ix, iy, iwidth, iheight);
}
static DBusMessage *
impl_getPosition (DBusConnection * bus, DBusMessage * message,
- void *user_data)
+ void *user_data)
{
AtkComponent *component = (AtkComponent *) user_data;
DBusError error;
if (!dbus_message_get_args
(message, &error, DBUS_TYPE_INT16, &coord_type, DBUS_TYPE_INVALID))
{
- return SPI_DBUS_RETURN_ERROR (message, &error);
+ return droute_invalid_arguments_error (message);
}
atk_component_get_position (component, &ix, &iy, (AtkCoordType) coord_type);
x = ix;
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_INT32, &x, DBUS_TYPE_INT32,
- &y, DBUS_TYPE_INVALID);
+ &y, DBUS_TYPE_INVALID);
}
return reply;
}
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_INT32, &width,
- DBUS_TYPE_INT32, &height, DBUS_TYPE_INVALID);
+ DBUS_TYPE_INT32, &height, DBUS_TYPE_INVALID);
}
return reply;
}
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_UINT32, &rv,
- DBUS_TYPE_INVALID);
+ DBUS_TYPE_INVALID);
}
return reply;
}
static DBusMessage *
impl_getMDIZOrder (DBusConnection * bus, DBusMessage * message,
- void *user_data)
+ void *user_data)
{
AtkComponent *component = (AtkComponent *) user_data;
dbus_int16_t rv;
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_UINT32, &rv,
- DBUS_TYPE_INVALID);
+ DBUS_TYPE_INVALID);
}
return reply;
}
#if 0
static DBusMessage *
impl_registerFocusHandler (DBusConnection * bus, DBusMessage * message,
- void *user_data)
+ void *user_data)
{
}
static DBusMessage *
impl_deregisterFocusHandler (DBusConnection * bus, DBusMessage * message,
- void *user_data)
+ void *user_data)
{
}
#endif
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_DOUBLE, &rv,
- DBUS_TYPE_INVALID);
+ DBUS_TYPE_INVALID);
}
return reply;
}
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_STRING, &lc,
- DBUS_TYPE_INVALID);
+ DBUS_TYPE_INVALID);
}
return reply;
}
static DBusMessage *
impl_getAttributeValue (DBusConnection * bus, DBusMessage * message,
- void *user_data)
+ void *user_data)
{
AtkDocument *document = (AtkDocument *) user_data;
DBusError error;
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)
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_STRING, &atr,
- DBUS_TYPE_INVALID);
+ DBUS_TYPE_INVALID);
}
return reply;
}
static DBusMessage *
impl_getAttributes (DBusConnection * bus, DBusMessage * message,
- void *user_data)
+ void *user_data)
{
AtkDocument *document = (AtkDocument *) user_data;
DBusMessage *reply;
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING,
- &retval, n_attributes, DBUS_TYPE_INVALID);
+ &retval, n_attributes, DBUS_TYPE_INVALID);
}
for (i = 0; i < n_attributes; i++)
g_free (retval[i]);
static DBusMessage *
impl_setTextContents (DBusConnection * bus, DBusMessage * message,
- void *user_data)
+ void *user_data)
{
AtkEditableText *editable = (AtkEditableText *) user_data;
const char *newContents;
if (!dbus_message_get_args
(message, &error, DBUS_TYPE_STRING, &newContents, DBUS_TYPE_INVALID))
{
- return SPI_DBUS_RETURN_ERROR (message, &error);
+ return droute_invalid_arguments_error (message);
}
atk_editable_text_set_text_contents (editable, newContents);
rv = TRUE;
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_BOOLEAN, &rv,
- DBUS_TYPE_INVALID);
+ DBUS_TYPE_INVALID);
}
return reply;
}
(message, &error, DBUS_TYPE_INT32, &position, DBUS_TYPE_STRING, &text,
DBUS_TYPE_INT32, &length, DBUS_TYPE_INVALID))
{
- return SPI_DBUS_RETURN_ERROR (message, &error);
+ return droute_invalid_arguments_error (message);
}
ip = position;
atk_editable_text_insert_text (editable, text, length, &ip);
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_BOOLEAN, &rv,
- DBUS_TYPE_INVALID);
+ DBUS_TYPE_INVALID);
}
return reply;
}
static DBusMessage *
impl_setAttributes (DBusConnection * bus, DBusMessage * message,
- void *user_data)
+ void *user_data)
{
AtkEditableText *editable = (AtkEditableText *) user_data;
const char *attributes;
(message, &error, DBUS_TYPE_STRING, &attributes, DBUS_TYPE_INT32,
&startPos, DBUS_TYPE_INT32, &endPos, DBUS_TYPE_INVALID))
{
- return SPI_DBUS_RETURN_ERROR (message, &error);
+ return droute_invalid_arguments_error (message);
}
// TODO implement
rv = FALSE;
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_BOOLEAN, &rv,
- DBUS_TYPE_INVALID);
+ DBUS_TYPE_INVALID);
}
return reply;
}
(message, &error, DBUS_TYPE_INT32, &startPos, DBUS_TYPE_INT32, &endPos,
DBUS_TYPE_INVALID))
{
- return SPI_DBUS_RETURN_ERROR (message, &error);
+ return droute_invalid_arguments_error (message);
}
atk_editable_text_copy_text (editable, startPos, endPos);
return NULL;
(message, &error, DBUS_TYPE_INT32, &startPos, DBUS_TYPE_INT32, &endPos,
DBUS_TYPE_INVALID))
{
- return SPI_DBUS_RETURN_ERROR (message, &error);
+ return droute_invalid_arguments_error (message);
}
atk_editable_text_cut_text (editable, startPos, endPos);
rv = TRUE;
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_BOOLEAN, &rv,
- DBUS_TYPE_INVALID);
+ DBUS_TYPE_INVALID);
}
return reply;
}
(message, &error, DBUS_TYPE_INT32, &startPos, DBUS_TYPE_INT32, &endPos,
DBUS_TYPE_INVALID))
{
- return SPI_DBUS_RETURN_ERROR (message, &error);
+ return droute_invalid_arguments_error (message);
}
atk_editable_text_delete_text (editable, startPos, endPos);
rv = TRUE;
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_BOOLEAN, &rv,
- DBUS_TYPE_INVALID);
+ DBUS_TYPE_INVALID);
}
return reply;
}
if (!dbus_message_get_args
(message, &error, DBUS_TYPE_INT32, &position, DBUS_TYPE_INVALID))
{
- return SPI_DBUS_RETURN_ERROR (message, &error);
+ return droute_invalid_arguments_error (message);
}
atk_editable_text_paste_text (editable, position);
rv = TRUE;
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_BOOLEAN, &rv,
- DBUS_TYPE_INVALID);
+ DBUS_TYPE_INVALID);
}
return reply;
}
static dbus_bool_t
impl_get_startIndex (DBusMessageIter * iter,
- void *user_data)
+ void *user_data)
{
AtkHyperlink *link = (AtkHyperlink *) user_data;
g_return_val_if_fail (ATK_IS_HYPERLINK (user_data), FALSE);
if (!dbus_message_get_args
(message, &error, DBUS_TYPE_INT32, &i, DBUS_TYPE_INVALID))
{
- return SPI_DBUS_RETURN_ERROR (message, &error);
+ return droute_invalid_arguments_error (message);
}
atk_object = atk_hyperlink_get_object (link, i);
return spi_dbus_return_object (message, atk_object, FALSE);
(message, &error, DBUS_TYPE_INT32, &i, DBUS_TYPE_INT32, &i,
DBUS_TYPE_INVALID))
{
- return SPI_DBUS_RETURN_ERROR (message, &error);
+ return droute_invalid_arguments_error (message);
}
rv = atk_hyperlink_get_uri (link, i);
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_STRING, &rv,
- DBUS_TYPE_INVALID);
+ DBUS_TYPE_INVALID);
}
g_free (rv);
return reply;
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_BOOLEAN, &rv,
- DBUS_TYPE_INVALID);
+ DBUS_TYPE_INVALID);
}
return reply;
}
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_INT32, &rv,
- DBUS_TYPE_INVALID);
+ DBUS_TYPE_INVALID);
}
return reply;
}
if (!dbus_message_get_args
(message, &error, DBUS_TYPE_INT32, &linkIndex, DBUS_TYPE_INVALID))
{
- return SPI_DBUS_RETURN_ERROR (message, &error);
+ return droute_invalid_arguments_error (message);
}
link = atk_hypertext_get_link (hypertext, linkIndex);
return spi_dbus_return_object (message, ATK_OBJECT (link), FALSE);
static DBusMessage *
impl_getLinkIndex (DBusConnection * bus, DBusMessage * message,
- void *user_data)
+ void *user_data)
{
AtkHypertext *hypertext = (AtkHypertext *) user_data;
DBusError error;
if (!dbus_message_get_args
(message, &error, DBUS_TYPE_INT32, &characterIndex, DBUS_TYPE_INVALID))
{
- return SPI_DBUS_RETURN_ERROR (message, &error);
+ return droute_invalid_arguments_error (message);
}
rv = atk_hypertext_get_link_index (hypertext, characterIndex);
reply = dbus_message_new_method_return (message);
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_INT32, &rv,
- DBUS_TYPE_INVALID);
+ DBUS_TYPE_INVALID);
}
return reply;
}
static dbus_bool_t
impl_get_imageDescription (DBusMessageIter * iter,
- void *user_data)
+ void *user_data)
{
AtkImage *image = (AtkImage *) user_data;
g_return_val_if_fail (ATK_IS_IMAGE (user_data), FALSE);
return droute_return_v_string (iter,
- atk_image_get_image_description (image));
+ atk_image_get_image_description (image));
}
static dbus_bool_t
impl_get_imageLocale (DBusMessageIter * iter,
- void *user_data)
+ void *user_data)
{
AtkImage *image = (AtkImage *) user_data;
g_return_val_if_fail (ATK_IS_IMAGE (user_data), FALSE);
static DBusMessage *
impl_getImageExtents (DBusConnection * bus, DBusMessage * message,
- void *user_data)
+ void *user_data)
{
AtkImage *image = (AtkImage *) user_data;
DBusError error;
if (!dbus_message_get_args
(message, &error, DBUS_TYPE_INT16, &coordType, DBUS_TYPE_INVALID))
{
- return SPI_DBUS_RETURN_ERROR (message, &error);
+ return droute_invalid_arguments_error (message);
}
atk_image_get_image_size (image, &iwidth, &iheight);
atk_image_get_image_position (image, &ix, &iy, (AtkCoordType) coordType);
static DBusMessage *
impl_getImagePosition (DBusConnection * bus, DBusMessage * message,
- void *user_data)
+ void *user_data)
{
AtkImage *image = (AtkImage *) user_data;
DBusError error;
if (!dbus_message_get_args
(message, &error, DBUS_TYPE_INT16, &coord_type, DBUS_TYPE_INVALID))
{
- return SPI_DBUS_RETURN_ERROR (message, &error);
+ return droute_invalid_arguments_error (message);
}
atk_image_get_image_position (image, &ix, &iy, (AtkCoordType) coord_type);
x = ix;
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_INT32, &x, DBUS_TYPE_INT32,
- &y, DBUS_TYPE_INVALID);
+ &y, DBUS_TYPE_INVALID);
}
return reply;
}
static DBusMessage *
impl_getImageSize (DBusConnection * bus, DBusMessage * message,
- void *user_data)
+ void *user_data)
{
AtkImage *image = (AtkImage *) user_data;
gint iwidth = 0, iheight = 0;
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_INT32, &width,
- DBUS_TYPE_INT32, &height, DBUS_TYPE_INVALID);
+ DBUS_TYPE_INT32, &height, DBUS_TYPE_INVALID);
}
return reply;
}
static dbus_bool_t
impl_get_nSelectedChildren (DBusMessageIter * iter,
- void *user_data)
+ void *user_data)
{
AtkSelection *selection = (AtkSelection *) user_data;
g_return_val_if_fail (ATK_IS_SELECTION (user_data), FALSE);
return droute_return_v_int32 (iter,
- atk_selection_get_selection_count
- (selection));
+ atk_selection_get_selection_count
+ (selection));
}
/*static char *
{
g_assert (ATK_IS_HYPERLINK (datum));
return g_strdup_printf ("%d",
- atk_selection_get_selection_count ((AtkSelection *)
- datum));
+ atk_selection_get_selection_count ((AtkSelection *)
+ datum));
}*/
static DBusMessage *
impl_getSelectedChild (DBusConnection * bus, DBusMessage * message,
- void *user_data)
+ void *user_data)
{
AtkSelection *selection = (AtkSelection *) user_data;
DBusError error;
(message, &error, DBUS_TYPE_INT32, &selectedChildIndex,
DBUS_TYPE_INVALID))
{
- return SPI_DBUS_RETURN_ERROR (message, &error);
+ return droute_invalid_arguments_error (message);
}
atk_object = atk_selection_ref_selection (selection, selectedChildIndex);
return spi_dbus_return_object (message, atk_object, TRUE);
static DBusMessage *
impl_selectChild (DBusConnection * bus, DBusMessage * message,
- void *user_data)
+ void *user_data)
{
AtkSelection *selection = (AtkSelection *) user_data;
DBusError error;
if (!dbus_message_get_args
(message, &error, DBUS_TYPE_INT32, &childIndex, DBUS_TYPE_INVALID))
{
- return SPI_DBUS_RETURN_ERROR (message, &error);
+ return droute_invalid_arguments_error (message);
}
rv = atk_selection_add_selection (selection, childIndex);
reply = dbus_message_new_method_return (message);
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_BOOLEAN, &rv,
- DBUS_TYPE_INVALID);
+ DBUS_TYPE_INVALID);
}
return reply;
}
static DBusMessage *
impl_deselectSelectedChild (DBusConnection * bus, DBusMessage * message,
- void *user_data)
+ void *user_data)
{
AtkSelection *selection = (AtkSelection *) user_data;
DBusError error;
(message, &error, DBUS_TYPE_INT32, &selectedChildIndex,
DBUS_TYPE_INVALID))
{
- return SPI_DBUS_RETURN_ERROR (message, &error);
+ return droute_invalid_arguments_error (message);
}
rv = atk_selection_remove_selection (selection, selectedChildIndex);
reply = dbus_message_new_method_return (message);
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_BOOLEAN, &rv,
- DBUS_TYPE_INVALID);
+ DBUS_TYPE_INVALID);
}
return reply;
}
static DBusMessage *
impl_isChildSelected (DBusConnection * bus, DBusMessage * message,
- void *user_data)
+ void *user_data)
{
AtkSelection *selection = (AtkSelection *) user_data;
DBusError error;
if (!dbus_message_get_args
(message, &error, DBUS_TYPE_INT32, &childIndex, DBUS_TYPE_INVALID))
{
- return SPI_DBUS_RETURN_ERROR (message, &error);
+ return droute_invalid_arguments_error (message);
}
rv = atk_selection_is_child_selected (selection, childIndex);
reply = dbus_message_new_method_return (message);
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_BOOLEAN, &rv,
- DBUS_TYPE_INVALID);
+ DBUS_TYPE_INVALID);
}
return reply;
}
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_BOOLEAN, &rv,
- DBUS_TYPE_INVALID);
+ DBUS_TYPE_INVALID);
}
return reply;
}
static DBusMessage *
impl_clearSelection (DBusConnection * bus, DBusMessage * message,
- void *user_data)
+ void *user_data)
{
AtkSelection *selection = (AtkSelection *) user_data;
dbus_bool_t rv;
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_BOOLEAN, &rv,
- DBUS_TYPE_INVALID);
+ DBUS_TYPE_INVALID);
}
return reply;
}
static DBusMessage *
impl_deselectChild (DBusConnection * bus, DBusMessage * message,
- void *user_data)
+ void *user_data)
{
AtkSelection *selection = (AtkSelection *) user_data;
DBusError error;
(message, &error, DBUS_TYPE_INT32, &selectedChildIndex,
DBUS_TYPE_INVALID))
{
- return SPI_DBUS_RETURN_ERROR (message, &error);
+ return droute_invalid_arguments_error (message);
}
nselected = atk_selection_get_selection_count (selection);
for (i = 0; i < nselected; ++i)
{
AtkObject *selected_obj = atk_selection_ref_selection (selection, i);
if (atk_object_get_index_in_parent (selected_obj) == selectedChildIndex)
- {
- g_object_unref (G_OBJECT (selected_obj));
- rv = atk_selection_remove_selection (selection, i);
- break;
- }
+ {
+ g_object_unref (G_OBJECT (selected_obj));
+ rv = atk_selection_remove_selection (selection, i);
+ break;
+ }
g_object_unref (G_OBJECT (selected_obj));
}
reply = dbus_message_new_method_return (message);
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_BOOLEAN, &rv,
- DBUS_TYPE_INVALID);
+ DBUS_TYPE_INVALID);
}
return reply;
}
AtkTable *table = (AtkTable *) user_data;
g_return_val_if_fail (ATK_IS_TABLE (user_data), FALSE);
return spi_dbus_return_v_object (iter, atk_table_get_caption (table),
- FALSE);
+ FALSE);
}
static dbus_bool_t
AtkTable *table = (AtkTable *) user_data;
g_return_val_if_fail (ATK_IS_TABLE (user_data), FALSE);
return spi_dbus_return_v_object (iter, atk_table_get_summary (table),
- FALSE);
+ FALSE);
}
static dbus_bool_t
impl_get_nSelectedRows (DBusMessageIter * iter,
- void *user_data)
+ void *user_data)
{
AtkTable *table = (AtkTable *) user_data;
gint *selected_rows = NULL;
static dbus_bool_t
impl_get_nSelectedColumns (DBusMessageIter * iter,
- void *user_data)
+ void *user_data)
{
AtkTable *table = (AtkTable *) user_data;
gint *selected_columns = NULL;
static DBusMessage *
impl_getAccessibleAt (DBusConnection * bus, DBusMessage * message,
- void *user_data)
+ void *user_data)
{
AtkTable *table = (AtkTable *) user_data;
dbus_int32_t row, column;
(message, &error, DBUS_TYPE_INT32, &row, DBUS_TYPE_INT32, &column,
DBUS_TYPE_INVALID))
{
- return SPI_DBUS_RETURN_ERROR (message, &error);
+ return droute_invalid_arguments_error (message);
}
obj = atk_table_ref_at (table, row, column);
return spi_dbus_return_object (message, obj, TRUE);
(message, &error, DBUS_TYPE_INT32, &row, DBUS_TYPE_INT32, &column,
DBUS_TYPE_INVALID))
{
- return SPI_DBUS_RETURN_ERROR (message, &error);
+ return droute_invalid_arguments_error (message);
}
index = atk_table_get_index_at (table, row, column);
reply = dbus_message_new_method_return (message);
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_INT32, &index,
- DBUS_TYPE_INVALID);
+ DBUS_TYPE_INVALID);
}
return reply;
}
static DBusMessage *
impl_getRowAtIndex (DBusConnection * bus, DBusMessage * message,
- void *user_data)
+ void *user_data)
{
AtkTable *table = (AtkTable *) user_data;
dbus_int32_t index;
if (!dbus_message_get_args
(message, &error, DBUS_TYPE_INT32, &index, DBUS_TYPE_INVALID))
{
- return SPI_DBUS_RETURN_ERROR (message, &error);
+ return droute_invalid_arguments_error (message);
}
row = atk_table_get_row_at_index (table, index);
reply = dbus_message_new_method_return (message);
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_INT32, &row,
- DBUS_TYPE_INVALID);
+ DBUS_TYPE_INVALID);
}
return reply;
}
static DBusMessage *
impl_getColumnAtIndex (DBusConnection * bus, DBusMessage * message,
- void *user_data)
+ void *user_data)
{
AtkTable *table = (AtkTable *) user_data;
dbus_int32_t index;
if (!dbus_message_get_args
(message, &error, DBUS_TYPE_INT32, &index, DBUS_TYPE_INVALID))
{
- return SPI_DBUS_RETURN_ERROR (message, &error);
+ return droute_invalid_arguments_error (message);
}
column = atk_table_get_column_at_index (table, index);
reply = dbus_message_new_method_return (message);
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_INT32, &column,
- DBUS_TYPE_INVALID);
+ DBUS_TYPE_INVALID);
}
return reply;
}
static DBusMessage *
impl_getRowDescription (DBusConnection * bus, DBusMessage * message,
- void *user_data)
+ void *user_data)
{
dbus_int32_t row;
AtkTable *table = (AtkTable *) user_data;
if (!dbus_message_get_args
(message, &error, DBUS_TYPE_INT32, &row, DBUS_TYPE_INVALID))
{
- return SPI_DBUS_RETURN_ERROR (message, &error);
+ return droute_invalid_arguments_error (message);
}
description = atk_table_get_row_description (table, row);
if (!description)
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_STRING, &description,
- DBUS_TYPE_INVALID);
+ DBUS_TYPE_INVALID);
}
return reply;
}
static DBusMessage *
impl_getColumnDescription (DBusConnection * bus, DBusMessage * message,
- void *user_data)
+ void *user_data)
{
AtkTable *table = (AtkTable *) user_data;
dbus_int32_t column;
if (!dbus_message_get_args
(message, &error, DBUS_TYPE_INT32, &column, DBUS_TYPE_INVALID))
{
- return SPI_DBUS_RETURN_ERROR (message, &error);
+ return droute_invalid_arguments_error (message);
}
description = atk_table_get_column_description (table, column);
if (!description)
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_STRING, &description,
- DBUS_TYPE_INVALID);
+ DBUS_TYPE_INVALID);
}
return reply;
}
static DBusMessage *
impl_getRowExtentAt (DBusConnection * bus, DBusMessage * message,
- void *user_data)
+ void *user_data)
{
AtkTable *table = (AtkTable *) user_data;
dbus_int32_t row, column;
(message, &error, DBUS_TYPE_INT32, &row, DBUS_TYPE_INT32, &column,
DBUS_TYPE_INVALID))
{
- return SPI_DBUS_RETURN_ERROR (message, &error);
+ return droute_invalid_arguments_error (message);
}
extent = atk_table_get_row_extent_at (table, row, column);
reply = dbus_message_new_method_return (message);
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_INT32, &extent,
- DBUS_TYPE_INVALID);
+ DBUS_TYPE_INVALID);
}
return reply;
}
static DBusMessage *
impl_getColumnExtentAt (DBusConnection * bus, DBusMessage * message,
- void *user_data)
+ void *user_data)
{
AtkTable *table = (AtkTable *) user_data;
dbus_int32_t row, column;
(message, &error, DBUS_TYPE_INT32, &row, DBUS_TYPE_INT32, &column,
DBUS_TYPE_INVALID))
{
- return SPI_DBUS_RETURN_ERROR (message, &error);
+ return droute_invalid_arguments_error (message);
}
extent = atk_table_get_column_extent_at (table, row, column);
reply = dbus_message_new_method_return (message);
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_INT32, &extent,
- DBUS_TYPE_INVALID);
+ DBUS_TYPE_INVALID);
}
return reply;
}
static DBusMessage *
impl_getRowHeader (DBusConnection * bus, DBusMessage * message,
- void *user_data)
+ void *user_data)
{
AtkTable *table = (AtkTable *) user_data;
dbus_int32_t row;
if (!dbus_message_get_args
(message, &error, DBUS_TYPE_INT32, &row, DBUS_TYPE_INVALID))
{
- return SPI_DBUS_RETURN_ERROR (message, &error);
+ return droute_invalid_arguments_error (message);
}
obj = atk_table_get_row_header (table, row);
return spi_dbus_return_object (message, obj, FALSE);
static DBusMessage *
impl_getColumnHeader (DBusConnection * bus, DBusMessage * message,
- void *user_data)
+ void *user_data)
{
AtkTable *table = (AtkTable *) user_data;
dbus_int32_t column;
if (!dbus_message_get_args
(message, &error, DBUS_TYPE_INT32, &column, DBUS_TYPE_INVALID))
{
- return SPI_DBUS_RETURN_ERROR (message, &error);
+ return droute_invalid_arguments_error (message);
}
obj = atk_table_get_column_header (table, column);
return spi_dbus_return_object (message, obj, FALSE);
static DBusMessage *
impl_getSelectedRows (DBusConnection * bus, DBusMessage * message,
- void *user_data)
+ void *user_data)
{
AtkTable *table = (AtkTable *) user_data;
gint *selected_rows = NULL;
{
/* tbd - figure out if this is safe for a 0-length array */
dbus_message_append_args (reply, DBUS_TYPE_ARRAY, DBUS_TYPE_INT32,
- &selected_rows, count, DBUS_TYPE_INVALID);
+ &selected_rows, count, DBUS_TYPE_INVALID);
}
if (selected_rows)
g_free (selected_rows);
static DBusMessage *
impl_getSelectedColumns (DBusConnection * bus, DBusMessage * message,
- void *user_data)
+ void *user_data)
{
AtkTable *table = (AtkTable *) user_data;
gint *selected_columns = NULL;
{
/* tbd - figure out if this is safe for a 0-length array */
dbus_message_append_args (reply, DBUS_TYPE_ARRAY, DBUS_TYPE_INT32,
- &selected_columns, count, DBUS_TYPE_INVALID);
+ &selected_columns, count, DBUS_TYPE_INVALID);
}
if (selected_columns)
g_free (selected_columns);
static DBusMessage *
impl_isRowSelected (DBusConnection * bus, DBusMessage * message,
- void *user_data)
+ void *user_data)
{
AtkTable *table = (AtkTable *) user_data;
dbus_int32_t row;
if (!dbus_message_get_args
(message, &error, DBUS_TYPE_INT32, &row, DBUS_TYPE_INVALID))
{
- return SPI_DBUS_RETURN_ERROR (message, &error);
+ return droute_invalid_arguments_error (message);
}
ret = atk_table_is_row_selected (table, row);
reply = dbus_message_new_method_return (message);
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_BOOLEAN, &ret,
- DBUS_TYPE_INVALID);
+ DBUS_TYPE_INVALID);
}
return reply;
}
static DBusMessage *
impl_isColumnSelected (DBusConnection * bus, DBusMessage * message,
- void *user_data)
+ void *user_data)
{
AtkTable *table = (AtkTable *) user_data;
dbus_int32_t column;
if (!dbus_message_get_args
(message, &error, DBUS_TYPE_INT32, &column, DBUS_TYPE_INVALID))
{
- return SPI_DBUS_RETURN_ERROR (message, &error);
+ return droute_invalid_arguments_error (message);
}
ret = atk_table_is_column_selected (table, column);
reply = dbus_message_new_method_return (message);
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_BOOLEAN, &ret,
- DBUS_TYPE_INVALID);
+ DBUS_TYPE_INVALID);
}
return reply;
}
(message, &error, DBUS_TYPE_INT32, &row, DBUS_TYPE_INT32, &column,
DBUS_TYPE_INVALID))
{
- return SPI_DBUS_RETURN_ERROR (message, &error);
+ return droute_invalid_arguments_error (message);
}
ret = atk_table_is_selected (table, row, column);
reply = dbus_message_new_method_return (message);
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_BOOLEAN, &ret,
- DBUS_TYPE_INVALID);
+ DBUS_TYPE_INVALID);
}
return reply;
}
static DBusMessage *
impl_addRowSelection (DBusConnection * bus, DBusMessage * message,
- void *user_data)
+ void *user_data)
{
AtkTable *table = (AtkTable *) user_data;
dbus_int32_t row;
if (!dbus_message_get_args
(message, &error, DBUS_TYPE_INT32, &row, DBUS_TYPE_INVALID))
{
- return SPI_DBUS_RETURN_ERROR (message, &error);
+ return droute_invalid_arguments_error (message);
}
ret = atk_table_add_row_selection (table, row);
reply = dbus_message_new_method_return (message);
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_BOOLEAN, &ret,
- DBUS_TYPE_INVALID);
+ DBUS_TYPE_INVALID);
}
return reply;
}
static DBusMessage *
impl_addColumnSelection (DBusConnection * bus, DBusMessage * message,
- void *user_data)
+ void *user_data)
{
AtkTable *table = (AtkTable *) user_data;
dbus_int32_t column;
if (!dbus_message_get_args
(message, &error, DBUS_TYPE_INT32, &column, DBUS_TYPE_INVALID))
{
- return SPI_DBUS_RETURN_ERROR (message, &error);
+ return droute_invalid_arguments_error (message);
}
ret = atk_table_add_column_selection (table, column);
reply = dbus_message_new_method_return (message);
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_BOOLEAN, &ret,
- DBUS_TYPE_INVALID);
+ DBUS_TYPE_INVALID);
}
return reply;
}
static DBusMessage *
impl_removeRowSelection (DBusConnection * bus, DBusMessage * message,
- void *user_data)
+ void *user_data)
{
AtkTable *table = (AtkTable *) user_data;
dbus_int32_t row;
if (!dbus_message_get_args
(message, &error, DBUS_TYPE_INT32, &row, DBUS_TYPE_INVALID))
{
- return SPI_DBUS_RETURN_ERROR (message, &error);
+ return droute_invalid_arguments_error (message);
}
ret = atk_table_remove_row_selection (table, row);
reply = dbus_message_new_method_return (message);
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_BOOLEAN, &ret,
- DBUS_TYPE_INVALID);
+ DBUS_TYPE_INVALID);
}
return reply;
}
static DBusMessage *
impl_removeColumnSelection (DBusConnection * bus, DBusMessage * message,
- void *user_data)
+ void *user_data)
{
AtkTable *table = (AtkTable *) user_data;
dbus_int32_t column;
if (!dbus_message_get_args
(message, &error, DBUS_TYPE_INT32, &column, DBUS_TYPE_INVALID))
{
- return SPI_DBUS_RETURN_ERROR (message, &error);
+ return droute_invalid_arguments_error (message);
}
ret = atk_table_remove_column_selection (table, column);
reply = dbus_message_new_method_return (message);
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_BOOLEAN, &ret,
- DBUS_TYPE_INVALID);
+ DBUS_TYPE_INVALID);
}
return reply;
}
static DBusMessage *
impl_getRowColumnExtentsAtIndex (DBusConnection * bus, DBusMessage * message,
- void *user_data)
+ void *user_data)
{
AtkTable *table = (AtkTable *) user_data;
dbus_int32_t index;
if (!dbus_message_get_args
(message, &error, DBUS_TYPE_INT32, &index, DBUS_TYPE_INVALID))
{
- return SPI_DBUS_RETURN_ERROR (message, &error);
+ return droute_invalid_arguments_error (message);
}
column = atk_table_get_column_at_index (table, index);
row = atk_table_get_row_at_index (table, index);
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_INT32, row, DBUS_TYPE_INT32,
- column, DBUS_TYPE_INT32, row_extents,
- DBUS_TYPE_INT32, col_extents,
- DBUS_TYPE_BOOLEAN, is_selected,
- DBUS_TYPE_BOOLEAN, &ret, DBUS_TYPE_INVALID);
+ column, DBUS_TYPE_INT32, row_extents,
+ DBUS_TYPE_INT32, col_extents,
+ DBUS_TYPE_BOOLEAN, is_selected,
+ DBUS_TYPE_BOOLEAN, &ret, DBUS_TYPE_INVALID);
}
return reply;
}
static dbus_bool_t
impl_get_characterCount (DBusMessageIter * iter,
- void *user_data)
+ void *user_data)
{
AtkText *text = (AtkText *) user_data;
g_return_val_if_fail (ATK_IS_TEXT (user_data), FALSE);
static dbus_bool_t
impl_get_caretOffset (DBusMessageIter * iter,
- void *user_data)
+ void *user_data)
{
AtkText *text = (AtkText *) user_data;
g_return_val_if_fail (ATK_IS_TEXT (user_data), FALSE);
(message, &error, DBUS_TYPE_INT32, &startOffset, DBUS_TYPE_INT32,
&endOffset, DBUS_TYPE_INVALID))
{
- return SPI_DBUS_RETURN_ERROR (message, &error);
+ return droute_invalid_arguments_error (message);
}
txt = atk_text_get_text (text, startOffset, endOffset);
if (!txt)
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_STRING, &txt,
- DBUS_TYPE_INVALID);
+ DBUS_TYPE_INVALID);
}
g_free (txt);
return reply;
static DBusMessage *
impl_setCaretOffset (DBusConnection * bus, DBusMessage * message,
- void *user_data)
+ void *user_data)
{
AtkText *text = (AtkText *) user_data;
dbus_int32_t offset;
if (!dbus_message_get_args
(message, &error, DBUS_TYPE_INT32, &offset, DBUS_TYPE_INVALID))
{
- return SPI_DBUS_RETURN_ERROR (message, &error);
+ return droute_invalid_arguments_error (message);
}
rv = atk_text_set_caret_offset (text, offset);
reply = dbus_message_new_method_return (message);
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_BOOLEAN, &rv,
- DBUS_TYPE_INVALID);
+ DBUS_TYPE_INVALID);
}
return reply;
}
static DBusMessage *
impl_getTextBeforeOffset (DBusConnection * bus, DBusMessage * message,
- void *user_data)
+ void *user_data)
{
AtkText *text = (AtkText *) user_data;
dbus_int32_t offset;
(message, &error, DBUS_TYPE_INT32, &offset, DBUS_TYPE_UINT32, &type,
DBUS_TYPE_INVALID))
{
- return SPI_DBUS_RETURN_ERROR (message, &error);
+ return droute_invalid_arguments_error (message);
}
txt =
atk_text_get_text_before_offset (text, offset, (AtkTextBoundary) type,
- &intstart_offset, &intend_offset);
+ &intstart_offset, &intend_offset);
startOffset = intstart_offset;
endOffset = intend_offset;
if (!txt)
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_INT32, &startOffset,
- DBUS_TYPE_INT32, &endOffset, DBUS_TYPE_STRING,
- &txt, DBUS_TYPE_INVALID);
+ DBUS_TYPE_INT32, &endOffset, DBUS_TYPE_STRING,
+ &txt, DBUS_TYPE_INVALID);
}
g_free (txt);
return reply;
static DBusMessage *
impl_getTextAtOffset (DBusConnection * bus, DBusMessage * message,
- void *user_data)
+ void *user_data)
{
AtkText *text = (AtkText *) user_data;
dbus_int32_t offset, type;
(message, &error, DBUS_TYPE_INT32, &offset, DBUS_TYPE_UINT32, &type,
DBUS_TYPE_INVALID))
{
- return SPI_DBUS_RETURN_ERROR (message, &error);
+ return droute_invalid_arguments_error (message);
}
txt =
atk_text_get_text_at_offset (text, offset, (AtkTextBoundary) type,
- &intstart_offset, &intend_offset);
+ &intstart_offset, &intend_offset);
startOffset = intstart_offset;
endOffset = intend_offset;
if (!txt)
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_INT32, &startOffset,
- DBUS_TYPE_INT32, &endOffset, DBUS_TYPE_STRING,
- &txt, DBUS_TYPE_INVALID);
+ DBUS_TYPE_INT32, &endOffset, DBUS_TYPE_STRING,
+ &txt, DBUS_TYPE_INVALID);
}
g_free (txt);
return reply;
static DBusMessage *
impl_getTextAfterOffset (DBusConnection * bus, DBusMessage * message,
- void *user_data)
+ void *user_data)
{
AtkText *text = (AtkText *) user_data;
dbus_int32_t offset;
(message, &error, DBUS_TYPE_INT32, &offset, DBUS_TYPE_UINT32, &type,
DBUS_TYPE_INVALID))
{
- return SPI_DBUS_RETURN_ERROR (message, &error);
+ return droute_invalid_arguments_error (message);
}
txt =
atk_text_get_text_after_offset (text, offset, (AtkTextBoundary) type,
- &intstart_offset, &intend_offset);
+ &intstart_offset, &intend_offset);
startOffset = intstart_offset;
endOffset = intend_offset;
if (!txt)
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_INT32, &startOffset,
- DBUS_TYPE_INT32, &endOffset, DBUS_TYPE_STRING,
- &txt, DBUS_TYPE_INVALID);
+ DBUS_TYPE_INT32, &endOffset, DBUS_TYPE_STRING,
+ &txt, DBUS_TYPE_INVALID);
}
g_free (txt);
return reply;
static DBusMessage *
impl_getCharacterAtOffset (DBusConnection * bus, DBusMessage * message,
- void *user_data)
+ void *user_data)
{
AtkText *text = (AtkText *) user_data;
dbus_int32_t offset;
if (!dbus_message_get_args
(message, &error, DBUS_TYPE_INT32, &offset, DBUS_TYPE_INVALID))
{
- return SPI_DBUS_RETURN_ERROR (message, &error);
+ return droute_invalid_arguments_error (message);
}
ch = atk_text_get_character_at_offset (text, offset);
reply = dbus_message_new_method_return (message);
static DBusMessage *
impl_getAttributeValue (DBusConnection * bus, DBusMessage * message,
- void *user_data)
+ void *user_data)
{
AtkText *text = (AtkText *) user_data;
dbus_int32_t offset;
(message, &error, DBUS_TYPE_INT32, &offset, DBUS_TYPE_STRING,
&attributeName, DBUS_TYPE_INVALID))
{
- return SPI_DBUS_RETURN_ERROR (message, &error);
+ return droute_invalid_arguments_error (message);
}
set = atk_text_get_run_attributes (text, offset,
- &intstart_offset, &intend_offset);
+ &intstart_offset, &intend_offset);
startOffset = intstart_offset;
endOffset = intend_offset;
defined = FALSE;
{
at = (AtkAttribute *) cur_attr->data;
if (!strcmp (at->name, attributeName))
- {
- rv = at->value;
- defined = TRUE;
- break;
- }
+ {
+ rv = at->value;
+ defined = TRUE;
+ break;
+ }
cur_attr = cur_attr->next;
}
if (!rv)
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_INT32, &startOffset,
- DBUS_TYPE_INT32, &endOffset,
- DBUS_TYPE_BOOLEAN, &defined, DBUS_TYPE_STRING,
- &rv, DBUS_TYPE_INVALID);
+ DBUS_TYPE_INT32, &endOffset,
+ DBUS_TYPE_BOOLEAN, &defined, DBUS_TYPE_STRING,
+ &rv, DBUS_TYPE_INVALID);
}
atk_attribute_set_free (set);
return reply;
{
at = (AtkAttribute *) cur_attr->data;
tmp = g_strdup_printf ("%s%s:%s%s",
- ((GSList *) (set) == cur_attr) ? "" : " ",
- at->name, at->value,
- (cur_attr->next) ? ";" : "");
+ ((GSList *) (set) == cur_attr) ? "" : " ",
+ at->name, at->value,
+ (cur_attr->next) ? ";" : "");
tmp2 = g_strconcat (attributes, tmp, NULL);
g_free (tmp);
g_free (attributes);
static DBusMessage *
impl_getAttributes (DBusConnection * bus, DBusMessage * message,
- void *user_data)
+ void *user_data)
{
AtkText *text = (AtkText *) user_data;
dbus_int32_t offset;
if (!dbus_message_get_args
(message, &error, DBUS_TYPE_INT32, &offset, DBUS_TYPE_INVALID))
{
- return SPI_DBUS_RETURN_ERROR (message, &error);
+ return droute_invalid_arguments_error (message);
}
set = atk_text_get_run_attributes (text, offset,
- &intstart_offset, &intend_offset);
+ &intstart_offset, &intend_offset);
rv = _string_from_attribute_set (set);
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_STRING, &rv, DBUS_TYPE_INT32, &startOffset,
- DBUS_TYPE_INT32, &endOffset, DBUS_TYPE_INVALID);
+ DBUS_TYPE_INT32, &endOffset, DBUS_TYPE_INVALID);
}
atk_attribute_set_free (set);
g_free(rv);
static DBusMessage *
impl_getDefaultAttributes (DBusConnection * bus, DBusMessage * message,
- void *user_data)
+ void *user_data)
{
AtkText *text = (AtkText *) user_data;
char *rv;
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_STRING, &rv,
- DBUS_TYPE_INVALID);
+ DBUS_TYPE_INVALID);
}
g_free (rv);
atk_attribute_set_free (set);
static DBusMessage *
impl_getCharacterExtents (DBusConnection * bus, DBusMessage * message,
- void *user_data)
+ void *user_data)
{
AtkText *text = (AtkText *) user_data;
dbus_int32_t offset;
(message, &error, DBUS_TYPE_INT32, &offset, DBUS_TYPE_INT16, &coordType,
DBUS_TYPE_INVALID))
{
- return SPI_DBUS_RETURN_ERROR (message, &error);
+ return droute_invalid_arguments_error (message);
}
atk_text_get_character_extents (text, offset, &ix, &iy, &iw, &ih,
- (AtkCoordType) coordType);
+ (AtkCoordType) coordType);
x = ix;
y = iy;
width = iw;
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_INT32, &x, DBUS_TYPE_INT32,
- &y, DBUS_TYPE_INT32, &width, DBUS_TYPE_INT32,
- &height, DBUS_TYPE_INVALID);
+ &y, DBUS_TYPE_INT32, &width, DBUS_TYPE_INT32,
+ &height, DBUS_TYPE_INVALID);
}
return reply;
}
static DBusMessage *
impl_getOffsetAtPoint (DBusConnection * bus, DBusMessage * message,
- void *user_data)
+ void *user_data)
{
AtkText *text = (AtkText *) user_data;
dbus_int32_t x, y;
(message, &error, DBUS_TYPE_INT32, &x, DBUS_TYPE_INT32, &y,
DBUS_TYPE_INT16, &coordType, DBUS_TYPE_INVALID))
{
- return SPI_DBUS_RETURN_ERROR (message, &error);
+ return droute_invalid_arguments_error (message);
}
rv = atk_text_get_offset_at_point (text, x, y, coordType);
reply = dbus_message_new_method_return (message);
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_INT32, &rv,
- DBUS_TYPE_INVALID);
+ DBUS_TYPE_INVALID);
}
return reply;
}
static DBusMessage *
impl_getNSelections (DBusConnection * bus, DBusMessage * message,
- void *user_data)
+ void *user_data)
{
AtkText *text = (AtkText *) user_data;
dbus_int32_t rv;
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_INT32, &rv,
- DBUS_TYPE_INVALID);
+ DBUS_TYPE_INVALID);
}
return reply;
}
static DBusMessage *
impl_getSelection (DBusConnection * bus, DBusMessage * message,
- void *user_data)
+ void *user_data)
{
AtkText *text = (AtkText *) user_data;
dbus_int32_t selectionNum;
if (!dbus_message_get_args
(message, &error, DBUS_TYPE_INT32, &selectionNum, DBUS_TYPE_INVALID))
{
- return SPI_DBUS_RETURN_ERROR (message, &error);
+ return droute_invalid_arguments_error (message);
}
/* atk_text_get_selection returns gchar * which we discard */
g_free (atk_text_get_selection
- (text, selectionNum, &intstart_offset, &intend_offset));
+ (text, selectionNum, &intstart_offset, &intend_offset));
startOffset = intstart_offset;
endOffset = intend_offset;
reply = dbus_message_new_method_return (message);
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_INT32, &startOffset,
- DBUS_TYPE_INT32, &endOffset,
- DBUS_TYPE_INVALID);
+ DBUS_TYPE_INT32, &endOffset,
+ DBUS_TYPE_INVALID);
}
return reply;
}
static DBusMessage *
impl_addSelection (DBusConnection * bus, DBusMessage * message,
- void *user_data)
+ void *user_data)
{
AtkText *text = (AtkText *) user_data;
dbus_int32_t startOffset, endOffset;
(message, &error, DBUS_TYPE_INT32, &startOffset, DBUS_TYPE_INT32,
&endOffset, DBUS_TYPE_INVALID))
{
- return SPI_DBUS_RETURN_ERROR (message, &error);
+ return droute_invalid_arguments_error (message);
}
rv = atk_text_add_selection (text, startOffset, endOffset);
reply = dbus_message_new_method_return (message);
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_BOOLEAN, &rv,
- DBUS_TYPE_INVALID);
+ DBUS_TYPE_INVALID);
}
return reply;
}
static DBusMessage *
impl_removeSelection (DBusConnection * bus, DBusMessage * message,
- void *user_data)
+ void *user_data)
{
AtkText *text = (AtkText *) user_data;
dbus_int32_t selectionNum;
if (!dbus_message_get_args
(message, &error, DBUS_TYPE_INT32, &selectionNum, DBUS_TYPE_INVALID))
{
- return SPI_DBUS_RETURN_ERROR (message, &error);
+ return droute_invalid_arguments_error (message);
}
rv = atk_text_remove_selection (text, selectionNum);
reply = dbus_message_new_method_return (message);
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_BOOLEAN, &rv,
- DBUS_TYPE_INVALID);
+ DBUS_TYPE_INVALID);
}
return reply;
}
static DBusMessage *
impl_setSelection (DBusConnection * bus, DBusMessage * message,
- void *user_data)
+ void *user_data)
{
AtkText *text = (AtkText *) user_data;
dbus_int32_t selectionNum, startOffset, endOffset;
(message, &error, DBUS_TYPE_INT32, &selectionNum, DBUS_TYPE_INT32,
&startOffset, DBUS_TYPE_INT32, &endOffset, DBUS_TYPE_INVALID))
{
- return SPI_DBUS_RETURN_ERROR (message, &error);
+ return droute_invalid_arguments_error (message);
}
rv = atk_text_set_selection (text, selectionNum, startOffset, endOffset);
reply = dbus_message_new_method_return (message);
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_BOOLEAN, &rv,
- DBUS_TYPE_INVALID);
+ DBUS_TYPE_INVALID);
}
return reply;
}
static DBusMessage *
impl_getRangeExtents (DBusConnection * bus, DBusMessage * message,
- void *user_data)
+ void *user_data)
{
AtkText *text = (AtkText *) user_data;
dbus_int32_t startOffset, endOffset;
(message, &error, DBUS_TYPE_INT32, &startOffset, DBUS_TYPE_INT32,
&endOffset, DBUS_TYPE_INT16, &coordType, DBUS_TYPE_INVALID))
{
- return SPI_DBUS_RETURN_ERROR (message, &error);
+ return droute_invalid_arguments_error (message);
}
memset (&rect, 0, sizeof (rect));
atk_text_get_range_extents (text, startOffset, endOffset,
- (AtkCoordType) coordType, &rect);
+ (AtkCoordType) coordType, &rect);
x = rect.x;
y = rect.y;
width = rect.width;
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_INT32, &x, DBUS_TYPE_INT32,
- &y, DBUS_TYPE_INT32, &width, DBUS_TYPE_INT32,
- &height, DBUS_TYPE_INVALID);
+ &y, DBUS_TYPE_INT32, &width, DBUS_TYPE_INT32,
+ &height, DBUS_TYPE_INVALID);
}
return reply;
}
static DBusMessage *
impl_getBoundedRanges (DBusConnection * bus, DBusMessage * message,
- void *user_data)
+ void *user_data)
{
AtkText *text = (AtkText *) user_data;
dbus_int32_t x, y, width, height;
&coordType, DBUS_TYPE_INT32, &xClipType, DBUS_TYPE_INT32, &yClipType,
DBUS_TYPE_INVALID))
{
- return SPI_DBUS_RETURN_ERROR (message, &error);
+ return droute_invalid_arguments_error (message);
}
rect.x = x;
rect.y = y;
range_list =
atk_text_get_bounded_ranges (text, &rect, (AtkCoordType) coordType,
- (AtkTextClipType) xClipType,
- (AtkTextClipType) yClipType);
+ (AtkTextClipType) xClipType,
+ (AtkTextClipType) yClipType);
reply = dbus_message_new_method_return (message);
if (!reply)
return NULL;
{
int len;
for (len = 0; len < MAXRANGELEN && range_list[len]; ++len)
- {
- if (dbus_message_iter_open_container
- (&array, DBUS_TYPE_STRUCT, NULL, &struc))
- {
- dbus_int32_t val;
- val = range_list[len]->start_offset;
- dbus_message_iter_append_basic (&struc, DBUS_TYPE_INT32, &val);
- val = range_list[len]->end_offset;
- dbus_message_iter_append_basic (&struc, DBUS_TYPE_INT32, &val);
- dbus_message_iter_append_basic (&struc, DBUS_TYPE_STRING,
- &range_list[len]->content);
- /* The variant is unimplemented in atk, but I don't want to
- * unilaterally muck with the spec and remove it, so I'll just
- * throw in a dummy value */
- if (dbus_message_iter_open_container
- (&array, DBUS_TYPE_VARIANT, "i", &variant))
- {
- dbus_uint32_t dummy = 0;
- dbus_message_iter_append_basic (&variant, DBUS_TYPE_INT32,
- &dummy);
- dbus_message_iter_close_container (&struc, &variant);
- }
- dbus_message_iter_close_container (&array, &struc);
- }
- }
+ {
+ if (dbus_message_iter_open_container
+ (&array, DBUS_TYPE_STRUCT, NULL, &struc))
+ {
+ dbus_int32_t val;
+ val = range_list[len]->start_offset;
+ dbus_message_iter_append_basic (&struc, DBUS_TYPE_INT32, &val);
+ val = range_list[len]->end_offset;
+ dbus_message_iter_append_basic (&struc, DBUS_TYPE_INT32, &val);
+ dbus_message_iter_append_basic (&struc, DBUS_TYPE_STRING,
+ &range_list[len]->content);
+ /* The variant is unimplemented in atk, but I don't want to
+ * unilaterally muck with the spec and remove it, so I'll just
+ * throw in a dummy value */
+ if (dbus_message_iter_open_container
+ (&array, DBUS_TYPE_VARIANT, "i", &variant))
+ {
+ dbus_uint32_t dummy = 0;
+ dbus_message_iter_append_basic (&variant, DBUS_TYPE_INT32,
+ &dummy);
+ dbus_message_iter_close_container (&struc, &variant);
+ }
+ dbus_message_iter_close_container (&array, &struc);
+ }
+ }
dbus_message_iter_close_container (&iter, &array);
}
return reply;
static DBusMessage *
impl_getAttributeRun (DBusConnection * bus, DBusMessage * message,
- void *user_data)
+ void *user_data)
{
DBusError error;
AtkText *text = (AtkText *) user_data;
(message, &error, DBUS_TYPE_INT32, &offset, DBUS_TYPE_BOOLEAN,
&includeDefaults, DBUS_TYPE_INVALID))
{
- return SPI_DBUS_RETURN_ERROR (message, &error);
+ return droute_invalid_arguments_error (message);
}
attributes =
atk_text_get_run_attributes (text, offset, &intstart_offset,
- &intend_offset);
+ &intend_offset);
if (attributes)
total_attributes = n_attributes = g_slist_length (attributes);
{
default_attributes = atk_text_get_default_attributes (text);
if (default_attributes)
- n_default_attributes = g_slist_length (default_attributes);
+ n_default_attributes = g_slist_length (default_attributes);
total_attributes += n_default_attributes;
}
if (total_attributes)
{
for (i = 0; i < n_attributes; ++i)
- {
- attr = g_slist_nth_data (attributes, i);
- retval[i] = g_strconcat (attr->name, ":", attr->value, NULL);
- }
+ {
+ attr = g_slist_nth_data (attributes, i);
+ retval[i] = g_strconcat (attr->name, ":", attr->value, NULL);
+ }
for (j = 0; j < n_default_attributes; ++i, ++j)
- {
- attr = g_slist_nth_data (default_attributes, j);
- retval[i] = g_strconcat (attr->name, ":", attr->value, NULL);
- }
+ {
+ attr = g_slist_nth_data (default_attributes, j);
+ retval[i] = g_strconcat (attr->name, ":", attr->value, NULL);
+ }
atk_attribute_set_free (attributes);
if (default_attributes)
- atk_attribute_set_free (default_attributes);
+ atk_attribute_set_free (default_attributes);
}
reply = dbus_message_new_method_return (message);
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_INT32, &startOffset,
- DBUS_TYPE_INT32, &endOffset, DBUS_TYPE_ARRAY,
- DBUS_TYPE_STRING, &retval, total_attributes,
- DBUS_TYPE_INVALID);
+ DBUS_TYPE_INT32, &endOffset, DBUS_TYPE_ARRAY,
+ DBUS_TYPE_STRING, &retval, total_attributes,
+ DBUS_TYPE_INVALID);
}
for (i = 0; i < total_attributes; i++)
g_free (retval[i]);
static DBusMessage *
impl_getDefaultAttributeSet (DBusConnection * bus, DBusMessage * message,
- void *user_data)
+ void *user_data)
{
AtkText *text = (AtkText *) user_data;
DBusMessage *reply;
if (reply)
{
dbus_message_append_args (reply, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING,
- &retval, n_attributes, DBUS_TYPE_INVALID);
+ &retval, n_attributes, DBUS_TYPE_INVALID);
}
for (i = 0; i < n_attributes; i++)
g_free (retval[i]);
AtkObject *root = atk_get_root();
char *path;
DBusMessage *reply;
+ gchar *errmsg;
if (!root)
- return spi_dbus_general_error (message);
+ {
+ reply = dbus_message_new_error (message,
+ DBUS_ERROR_FAILED,
+ "No root accessible available");
+ }
path = atk_dbus_object_to_path (root);
if (!path)
- return spi_dbus_general_error (message);
+ {
+ reply = dbus_message_new_error (message,
+ DBUS_ERROR_FAILED,
+ "No root accessible available");
+ }
reply = dbus_message_new_method_return (message);
dbus_message_append_args (reply, DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_INVALID);
g_free (path);
login_helper_set_safe (LoginHelper *helper, gboolean safe)
{
LoginHelperClass *klass = LOGIN_HELPER_GET_CLASS (helper);
-
+
if (klass->set_safe)
return (* klass->set_safe)(helper, safe);
else
if (!dbus_message_get_args
(message, &error, DBUS_TYPE_BOOLEAN, &safe, DBUS_TYPE_INVALID))
{
- return SPI_DBUS_RETURN_ERROR (message, &error);
+ return droute_invalid_arguments_error (message);
}
rv = login_helper_set_safe (helper, safe);
reply = dbus_message_new_method_return (message);
login_helper_get_device_reqs (LoginHelper *helper)
{
LoginHelperClass *klass = LOGIN_HELPER_GET_CLASS (helper);
-
+
if (klass->get_device_reqs)
return (* klass->get_device_reqs)(helper);
else
g_object_parent_class = g_type_class_peek_parent (klass);
object_class->finalize = login_helper_finalize;
-
}
static void
{
}
-G_DEFINE_TYPE (LoginHelper,
- login_helper,
- PARENT_TYPE)
-
+G_DEFINE_TYPE (LoginHelper, login_helper, PARENT_TYPE)
G_DEFINE_TYPE(SpiDEController, spi_device_event_controller, G_TYPE_OBJECT)
/* Private methods */
+static dbus_bool_t
+spi_dbus_add_disconnect_match (DBusConnection *bus, const char *name)
+{
+ char *match = g_strdup_printf ("interface=%s,member=NameOwnerChanged,arg0=%s", DBUS_INTERFACE_DBUS, name);
+ if (match)
+ {
+ DBusError error;
+ dbus_error_init (&error);
+ dbus_bus_add_match (bus, match, &error);
+ g_free (match);
+ return !dbus_error_is_set (&error);
+ }
+ else return FALSE;
+}
+
+static dbus_bool_t
+spi_dbus_remove_disconnect_match (DBusConnection *bus, const char *name)
+{
+ char *match = g_strdup_printf ("interface=%s,member=NameOwnerChanged,arg0=%s", DBUS_INTERFACE_DBUS, name);
+ if (match)
+ {
+ DBusError error;
+ dbus_error_init (&error);
+ dbus_bus_remove_match (bus, match, &error);
+ g_free (match);
+ return !dbus_error_is_set (&error);
+ }
+ else return FALSE;
+}
static unsigned int
keysym_mod_mask (KeySym keysym, KeyCode keycode)
dbus_error_init(&error);
if (!dbus_message_get_args(message, &error, DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_UINT32, &event_types, DBUS_TYPE_INVALID))
{
- return spi_dbus_general_error (message);
+ return droute_invalid_arguments_error (message);
}
dec_listener = spi_dec_listener_new (dbus_message_get_sender(message), path, event_types);
ret = spi_controller_register_device_listener (
dbus_error_init(&error);
if (!dbus_message_get_args(message, &error, DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_UINT32, &event_types, DBUS_TYPE_INVALID))
{
- return spi_dbus_general_error (message);
+ return droute_invalid_arguments_error (message);
}
listener = spi_dec_listener_new (dbus_message_get_sender(message), path, event_types);
spi_controller_deregister_device_listener (
dbus_error_init(&error);
if (!dbus_message_get_args(message, &error, DBUS_TYPE_INT32, &keycode, DBUS_TYPE_STRING, &keystring, DBUS_TYPE_UINT32, &synth_type, DBUS_TYPE_INVALID))
{
- return spi_dbus_general_error (message);
+ return droute_invalid_arguments_error (message);
}
#ifdef SPI_DEBUG
if (!dbus_message_get_args(message, &error, DBUS_TYPE_INT32, &x, DBUS_TYPE_INT32, &y, DBUS_TYPE_STRING, &eventName, DBUS_TYPE_INVALID))
{
- return spi_dbus_general_error (message);
+ return droute_invalid_arguments_error (message);
}
#ifdef SPI_DEBUG
if (!spi_dbus_demarshal_deviceEvent(message, &event))
{
- return spi_dbus_general_error (message);
+ return droute_invalid_arguments_error (message);
}
#ifdef SPI_DEBUG
g_print ("notifylistening listeners synchronously: controller %p, event id %d\n",
if (!spi_dbus_demarshal_deviceEvent(message, &event))
{
- return spi_dbus_general_error (message);
+ return droute_invalid_arguments_error (message);
}
#ifdef SPI_DEBUG
g_print ("notifylistening listeners asynchronously: controller %p, event id %d\n",
#include "spi-types.h"
+/*
DBusMessage *
spi_dbus_general_error (DBusMessage * message)
{
"org.freedesktop.atspi.GeneralError",
"General error");
}
+*/
DBusMessage *
return spi_dbus_message_iter_get_struct(&iter, DBUS_TYPE_UINT32, &e->type, DBUS_TYPE_INT32, &e->id, DBUS_TYPE_INT16, &e->hw_code, DBUS_TYPE_INT16, &e->modifiers, DBUS_TYPE_INT32, &e->timestamp, DBUS_TYPE_STRING, &e->event_string, DBUS_TYPE_BOOLEAN, &e->is_text, DBUS_TYPE_INVALID);
}
+/*
dbus_bool_t spi_dbus_get_simple_property (DBusConnection *bus, const char *dest, const char *path, const char *interface, const char *prop, int *type, void *ptr, DBusError *error)
{
DBusMessage *message, *reply;
dbus_message_unref (reply);
return TRUE;
}
-
-dbus_bool_t
-spi_dbus_add_disconnect_match (DBusConnection *bus, const char *name)
-{
- char *match = g_strdup_printf ("interface=%s,member=NameOwnerChanged,arg0=%s", DBUS_INTERFACE_DBUS, name);
- if (match)
- {
- DBusError error;
- dbus_error_init (&error);
- dbus_bus_add_match (bus, match, &error);
- g_free (match);
- return !dbus_error_is_set (&error);
- }
- else return FALSE;
-}
-
-dbus_bool_t
-spi_dbus_remove_disconnect_match (DBusConnection *bus, const char *name)
-{
- char *match = g_strdup_printf ("interface=%s,member=NameOwnerChanged,arg0=%s", DBUS_INTERFACE_DBUS, name);
- if (match)
- {
- DBusError error;
- dbus_error_init (&error);
- dbus_bus_remove_match (bus, match, &error);
- g_free (match);
- return !dbus_error_is_set (&error);
- }
- else return FALSE;
-}
+*/
DBusMessage *spi_dbus_general_error(DBusMessage *message);
DBusMessage *spi_dbus_return_rect(DBusMessage *message, gint ix, gint iy, gint iwidth, gint iheight);
-#define SPI_DBUS_RETURN_ERROR(m, e) dbus_message_new_error(m, (e)->name, (e)->message)
-
void spi_dbus_emit_valist(DBusConnection *bus, const char *path, const char *interface, const char *name, int first_arg_type, va_list args);
dbus_bool_t spi_dbus_message_iter_get_struct(DBusMessageIter *iter, ...);
dbus_bool_t spi_dbus_message_iter_append_struct(DBusMessageIter *iter, ...);
dbus_bool_t spi_dbus_marshall_deviceEvent(DBusMessage *message, const Accessibility_DeviceEvent *e);
dbus_bool_t spi_dbus_demarshall_deviceEvent(DBusMessage *message, Accessibility_DeviceEvent *e);
dbus_bool_t spi_dbus_get_simple_property (DBusConnection *bus, const char *dest, const char *path, const char *interface, const char *prop, int *type, void *ptr, DBusError *error);
+/*
void spi_dbus_add_disconnect_match (DBusConnection *bus, const char *name);
void spi_dbus_remove_disconnect_match (DBusConnection *bus, const char *name);
+*/
#endif /* SPI_DBUS_H_ */