+2002-04-15 Bill Haneman <bill.haneman@sun.com>
+
+ * configure.in:
+ Revved version to 0.11.
+
+ * libspi/component.c:
+ Added implementation for grabFocus.
+
+ * idl/Accessibility_Component.idl
+ (Accessibility_Component_grabFocus):
+ Made this method return boolean to indicate success or failure, to
+ be consistent with cspi and the corresponding ATK method.
+
+ * idl/Accessibility_Selection.idl
+ (Accessibility_Selection_selectAll) :
+ Made these methods return boolean to indicate success or
+ failure, to be consistent with cspi and the corresponding ATK methods.
+
+ * idl/Accessibility_EditableText.idl
+ (Accessibility_EditableText_setTextContents,
+ Accessibility_EditableText_insertText,
+ Accessibility_EditableText_cutText,
+ Accessibility_EditableText_deleteText,
+ Accessibility_EditableText_pasteText):
+ Made these methods return boolean to indicate
+ success or failure.
+
+ * cspi/spi_editabletext.c:
+ Made these methods return booleans.
+
+ * libspi/selection.c:
+ * libspi/component.c:
+ * libspi/editabletext.c:
+ Connected the boolean returns from ATK
+ to the server-side code referenced above.
+
2002-04-14 Bill Haneman <bill.haneman@sun.com>
* idl/Accessibility_Table.idl: Added missing methods,
AC_INIT(idl/Accessibility.idl)
AT_SPI_MAJOR_VERSION=0
-AT_SPI_MINOR_VERSION=10
+AT_SPI_MINOR_VERSION=11
AT_SPI_MICRO_VERSION=0
AT_SPI_INTERFACE_AGE=0
AT_SPI_BINARY_AGE=0
long int *height);
AccessibleComponentLayer
AccessibleComponent_getLayer (AccessibleComponent *obj);
-void AccessibleComponent_grabFocus (AccessibleComponent *obj);
+SPIBoolean AccessibleComponent_grabFocus (AccessibleComponent *obj);
short AccessibleComponent_getMDIZOrder(AccessibleComponent *obj);
/* AccessibleEditableText function prototypes */
SPIBoolean
AccessibleSelection_selectAll (AccessibleSelection *obj);
-void
+SPIBoolean
AccessibleSelection_clearSelection (AccessibleSelection *obj);
*
* Attempt to set the keyboard input focus to the specified
* #AccessibleComponent.
+ *
+ * Returns: #TRUE if successful, #FALSE otherwise.
+ *
**/
-void
+SPIBoolean
AccessibleComponent_grabFocus (AccessibleComponent *obj)
{
+ short retval;
+
+ cspi_return_val_if_fail (obj != NULL, FALSE);
+
+ retval = Accessibility_Component_grabFocus (CSPI_OBJREF (obj),
+ cspi_ev ());
+
+ cspi_return_val_if_ev ("grabFocus", FALSE);
+
+ return retval;
}
+
AccessibleEditableText_setTextContents (AccessibleEditableText *obj,
const char *newContents)
{
+ SPIBoolean retval;
+
cspi_return_val_if_fail (obj != NULL, FALSE);
- Accessibility_EditableText_setTextContents (CSPI_OBJREF (obj),
- (CORBA_char *) newContents, cspi_ev ());
+ retval = Accessibility_EditableText_setTextContents (CSPI_OBJREF (obj),
+ (CORBA_char *) newContents, cspi_ev ());
cspi_return_val_if_ev ("setTextContents", FALSE);
- return TRUE;
+ return retval;
}
/**
const char *text,
long int length)
{
+ SPIBoolean retval;
+
cspi_return_val_if_fail (obj != NULL, FALSE);
- Accessibility_EditableText_insertText (CSPI_OBJREF (obj),
+ retval = Accessibility_EditableText_insertText (CSPI_OBJREF (obj),
(CORBA_long) position, (const CORBA_char *) text,
(CORBA_long) length, cspi_ev ());
cspi_return_val_if_ev ("insertText", FALSE);
- return TRUE;
+ return retval;
}
/**
long int startPos,
long int endPos)
{
+ SPIBoolean retval;
+
cspi_return_val_if_fail (obj != NULL, FALSE);
- Accessibility_EditableText_cutText (
+ retval = Accessibility_EditableText_cutText (
CSPI_OBJREF (obj),
(CORBA_long) startPos, (CORBA_long) endPos, cspi_ev ());
cspi_return_val_if_ev ("cutText", FALSE);
- return TRUE;
+ return retval;
}
/**
long startPos,
long endPos)
{
+ SPIBoolean retval;
+
cspi_return_val_if_fail (obj != NULL, FALSE);
- Accessibility_EditableText_deleteText (
+ retval = Accessibility_EditableText_deleteText (
CSPI_OBJREF (obj),
(CORBA_long) startPos, (CORBA_long) endPos, cspi_ev ());
cspi_return_val_if_ev ("deleteText", FALSE);
- return TRUE;
+ return retval;
}
/**
AccessibleEditableText_pasteText (AccessibleEditableText *obj,
long int position)
{
+ SPIBoolean retval;
+
cspi_return_val_if_fail (obj != NULL, FALSE);
- Accessibility_EditableText_pasteText (
+ retval = Accessibility_EditableText_pasteText (
CSPI_OBJREF (obj), (CORBA_long) position, cspi_ev ());
cspi_return_val_if_ev ("pasteText", FALSE);
- return TRUE;
+ return retval;
}
SPIBoolean
AccessibleSelection_selectAll (AccessibleSelection *obj)
{
+ SPIBoolean retval;
+
cspi_return_val_if_fail (obj != NULL, FALSE);
- Accessibility_Selection_selectAll (CSPI_OBJREF (obj), cspi_ev ());
+ retval = Accessibility_Selection_selectAll (CSPI_OBJREF (obj), cspi_ev ());
- cspi_check_ev ("selectAll");
+ cspi_return_val_if_ev ("selectAll", FALSE);
- return TRUE; /* TODO: change the CORBA method to return SPIBoolean */
+ return retval;
}
/**
*
* Clear the current selection, removing all selected children from the
* specified #AccessibleSelection implementor's selection list.
+ *
+ * Returns: #TRUE if successful, #FALSE otherwise.
+ *
**/
-void
+SPIBoolean
AccessibleSelection_clearSelection (AccessibleSelection *obj)
{
- cspi_return_if_fail (obj != NULL);
+ SPIBoolean retval;
+
+ cspi_return_val_if_fail (obj != NULL, FALSE);
+
+ retval = Accessibility_Selection_clearSelection (CSPI_OBJREF (obj), cspi_ev ());
+ cspi_return_val_if_ev ("clearSelection", FALSE);
- Accessibility_Selection_clearSelection (CSPI_OBJREF (obj), cspi_ev ());
- cspi_check_ev ("clearSelection");
+ return retval;
}
</para>
@obj:
+@Returns:
<!-- ##### FUNCTION AccessibleSelection_selectAll ##### -->
void getSize (out long width, out long height);
ComponentLayer getLayer ();
short getMDIZOrder ();
- void grabFocus ();
+ boolean grabFocus ();
void registerFocusHandler (in EventListener handler);
void deregisterFocusHandler (in EventListener handler);
interface EditableText : Text {
- void setTextContents (in string newContents);
- void insertText (in long position, in string text, in long length);
+ boolean setTextContents (in string newContents);
+ boolean insertText (in long position, in string text, in long length);
boolean setAttributes (in string attributes, in long startPos, in long endPos);
void copyText (in long startPos, in long endPos);
- void cutText (in long startPos, in long endPos);
- void deleteText (in long startPos, in long endPos);
- void pasteText (in long position);
+ boolean cutText (in long startPos, in long endPos);
+ boolean deleteText (in long startPos, in long endPos);
+ boolean pasteText (in long position);
/**
* unImplemented5:
*
boolean selectChild (in long childIndex);
boolean deselectSelectedChild (in long selectedChildIndex);
boolean isChildSelected (in long childIndex);
- void selectAll ();
- void clearSelection ();
+ boolean selectAll ();
+ boolean clearSelection ();
/**
* unImplemented:
return (CORBA_short) atk_component_get_mdi_zorder (component);
}
+static CORBA_boolean
+impl_accessibility_component_grab_focus (PortableServer_Servant servant,
+ CORBA_Environment *ev)
+{
+ AtkComponent *component = get_component_from_servant (servant);
+
+ g_return_val_if_fail (component != NULL, FALSE);
+
+ return atk_component_grab_focus (component);
+}
+
static void
spi_component_class_init (SpiComponentClass *klass)
{
epv->getSize = impl_accessibility_component_get_size;
epv->getLayer = impl_accessibility_component_get_layer;
epv->getMDIZOrder = impl_accessibility_component_get_mdi_z_order;
+ epv->grabFocus = impl_accessibility_component_grab_focus;
}
static void
const CORBA_long startPos,
const CORBA_long endPos,
CORBA_Environment *ev);
-static void
+static CORBA_boolean
impl_setTextContents (PortableServer_Servant servant,
const CORBA_char * newContents,
CORBA_Environment *ev);
-static void
+static CORBA_boolean
impl_insertText (PortableServer_Servant servant,
const CORBA_long position,
const CORBA_char * text,
impl_copyText (PortableServer_Servant servant,
const CORBA_long startPos, const CORBA_long endPos,
CORBA_Environment *ev);
-static void
+static CORBA_boolean
impl_cutText (PortableServer_Servant servant,
const CORBA_long startPos, const CORBA_long endPos,
CORBA_Environment *ev);
-static void
+static CORBA_boolean
impl_deleteText (PortableServer_Servant servant,
const CORBA_long startPos, const CORBA_long endPos,
CORBA_Environment *ev);
-static void
+static CORBA_boolean
impl_pasteText (PortableServer_Servant servant,
const CORBA_long position, CORBA_Environment *ev);
}
-static void
+static CORBA_boolean
impl_setTextContents (PortableServer_Servant servant,
const CORBA_char *newContents,
CORBA_Environment *ev)
{
AtkEditableText *editable = get_editable_text_from_servant (servant);
- g_return_if_fail (editable != NULL);
+ g_return_val_if_fail (editable != NULL, FALSE);
atk_editable_text_set_text_contents (editable, (gchar *) newContents);
+
+ return TRUE;
}
-static void
+static CORBA_boolean
impl_insertText (PortableServer_Servant servant,
const CORBA_long position,
const CORBA_char *text,
{
AtkEditableText *editable = get_editable_text_from_servant (servant);
- g_return_if_fail (editable != NULL);
+ g_return_val_if_fail (editable != NULL, FALSE);
atk_editable_text_insert_text (editable,
(gchar *) text,
(gint) length,
(gint *) &position);
+ return TRUE;
}
g_return_if_fail (editable != NULL);
atk_editable_text_copy_text (editable, (gint) startPos, (gint) endPos);
+
}
-static void
+static CORBA_boolean
impl_cutText (PortableServer_Servant servant,
const CORBA_long startPos, const CORBA_long endPos,
CORBA_Environment *ev)
{
AtkEditableText *editable = get_editable_text_from_servant (servant);
- g_return_if_fail (editable != NULL);
+ g_return_val_if_fail (editable != NULL, FALSE);
+
+ atk_editable_text_cut_text (editable, startPos, endPos);
- atk_editable_text_cut_text (editable, (gint) startPos, (gint) endPos);
+ return TRUE;
}
-static void
+static CORBA_boolean
impl_deleteText (PortableServer_Servant servant,
const CORBA_long startPos, const CORBA_long endPos,
CORBA_Environment *ev)
{
AtkEditableText *editable = get_editable_text_from_servant (servant);
- g_return_if_fail (editable != NULL);
+ g_return_val_if_fail (editable != NULL, FALSE);
- atk_editable_text_delete_text (editable, (gint) startPos, (gint) endPos);
+ atk_editable_text_delete_text (editable, startPos, endPos);
+
+ return TRUE;
}
-static void
+static CORBA_boolean
impl_pasteText (PortableServer_Servant servant,
const CORBA_long position, CORBA_Environment *ev)
{
AtkEditableText *editable = get_editable_text_from_servant (servant);
- g_return_if_fail (editable != NULL);
+ g_return_val_if_fail (editable != NULL, FALSE);
atk_editable_text_paste_text (editable, position);
+
+ return TRUE;
}
g_return_val_if_fail (selection != NULL, FALSE);
- return (CORBA_boolean)
- atk_selection_add_selection (selection, (gint) childIndex);
+ return atk_selection_add_selection (selection, childIndex);
}
g_return_val_if_fail (selection != NULL, FALSE);
- return (CORBA_boolean)
- atk_selection_is_child_selected (selection, (gint) childIndex);
+ return atk_selection_is_child_selected (selection, childIndex);
}
-static void
+static CORBA_boolean
impl_selectAll (PortableServer_Servant servant,
CORBA_Environment *ev)
{
AtkSelection *selection = get_selection_from_servant (servant);
- g_return_if_fail (selection != NULL);
+ g_return_val_if_fail (selection != NULL, FALSE);
+
+ return atk_selection_select_all_selection (selection);
- atk_selection_select_all_selection (selection);
}
-static void
+static CORBA_boolean
impl_clearSelection (PortableServer_Servant servant,
CORBA_Environment *ev)
{
AtkSelection *selection = get_selection_from_servant (servant);
- g_return_if_fail (selection != NULL);
+ g_return_val_if_fail (selection != NULL, FALSE);
- atk_selection_clear_selection (selection);
+ return atk_selection_clear_selection (selection);
}
g_return_val_if_fail (table != NULL, CORBA_OBJECT_NIL);
- atk_object = atk_table_ref_at (table,
- (gint) row, (gint) column);
+ atk_object = atk_table_ref_at (table, row, column);
return spi_accessible_new_return (atk_object, TRUE, ev);
}
g_return_val_if_fail (table != NULL, 0);
- return (CORBA_long)
- atk_table_get_index_at (table, (gint) row, (gint) column);
+ return atk_table_get_index_at (table, row, column);
}
g_return_val_if_fail (table != NULL, 0);
- return (CORBA_long)
- atk_table_get_row_at_index (table, (gint) index);
+ return atk_table_get_row_at_index (table, index);
}
g_return_val_if_fail (table != NULL, 0);
- return (CORBA_long)
- atk_table_get_column_at_index (table, (gint) index);
+ return atk_table_get_column_at_index (table, index);
}
g_return_val_if_fail (table != NULL, -1);
- return (CORBA_long)
- atk_table_get_row_extent_at (table,
- (gint) row, (gint) column);
+ return atk_table_get_row_extent_at (table, row, column);
}
g_return_val_if_fail (table != NULL, -1);
- return (CORBA_long)
- atk_table_get_column_extent_at (table,
- (gint) row, (gint) column);
+ return atk_table_get_column_extent_at (table, row, column);
}
g_return_val_if_fail (table != NULL, CORBA_OBJECT_NIL);
- header = atk_table_get_row_header (table, (gint) row);
+ header = atk_table_get_row_header (table, row);
return spi_accessible_new_return (header, FALSE, ev);
}
g_return_val_if_fail (table != NULL, CORBA_OBJECT_NIL);
- header = atk_table_get_column_header (table, (gint) column);
+ header = atk_table_get_column_header (table, column);
return spi_accessible_new_return (header, FALSE, ev);
}
g_return_val_if_fail (table != NULL, FALSE);
- return (CORBA_boolean) atk_table_is_row_selected (table, (gint) row);
+ return atk_table_is_row_selected (table, row);
}
g_return_val_if_fail (table != NULL, FALSE);
- return (CORBA_boolean) atk_table_is_column_selected (table, (gint) column);
+ return atk_table_is_column_selected (table, column);
+}
+
+static CORBA_boolean
+impl_addRowSelection (PortableServer_Servant servant,
+ const CORBA_long row,
+ CORBA_Environment *ev)
+{
+ AtkTable *table = get_table_from_servant (servant);
+
+ g_return_val_if_fail (table != NULL, FALSE);
+
+ return atk_table_add_row_selection (table, row);
+}
+
+
+static CORBA_boolean
+impl_addColumnSelection (PortableServer_Servant servant,
+ const CORBA_long column,
+ CORBA_Environment *ev)
+{
+ AtkTable *table = get_table_from_servant (servant);
+
+ g_return_val_if_fail (table != NULL, FALSE);
+
+ return atk_table_add_column_selection (table, column);
+}
+
+
+static CORBA_boolean
+impl_removeRowSelection (PortableServer_Servant servant,
+ const CORBA_long row,
+ CORBA_Environment *ev)
+{
+ AtkTable *table = get_table_from_servant (servant);
+
+ g_return_val_if_fail (table != NULL, FALSE);
+
+ return atk_table_remove_row_selection (table, row);
+}
+
+
+static CORBA_boolean
+impl_removeColumnSelection (PortableServer_Servant servant,
+ const CORBA_long column,
+ CORBA_Environment *ev)
+{
+ AtkTable *table = get_table_from_servant (servant);
+
+ g_return_val_if_fail (table != NULL, FALSE);
+
+ return atk_table_remove_column_selection (table, column);
}
g_return_val_if_fail (table != NULL, FALSE);
- return (CORBA_boolean) atk_table_is_selected (table,
- (gint) row, (gint) column);
+ return atk_table_is_selected (table,
+ row, column);
}
epv->getSelectedColumns = impl_getSelectedColumns;
epv->isRowSelected = impl_isRowSelected;
epv->isColumnSelected = impl_isColumnSelected;
+ epv->addRowSelection = impl_addRowSelection;
+ epv->addColumnSelection = impl_addColumnSelection;
+ epv->removeRowSelection = impl_removeRowSelection;
+ epv->removeColumnSelection = impl_removeColumnSelection;
epv->isSelected = impl_isSelected;
}
#include <config.h>
-#undef SPI_DEBUG
+#define SPI_DEBUG
#include <string.h>
#include <ctype.h>
while (!(stroke.type & SPI_KEY_PRESSED))
g_main_context_iteration (NULL, TRUE);
fprintf (stderr, "p");
+ g_assert (!strcmp (stroke.keystring, "="));
while (!(stroke.type & SPI_KEY_RELEASED))
g_main_context_iteration (NULL, TRUE);
fprintf (stderr, "r ");
g_assert (SPI_deregisterAccessibleKeystrokeListener (key_listener, 0));
SPI_freeAccessibleKeySet (test_keyset);
- g_assert (!strcmp (stroke.keystring, "="));
fprintf (stderr, "\n");
AccessibleKeystrokeListener_unref (key_listener);