SPI_STATE_CHECKED,
/* Indicates this object is collapsed */
SPI_STATE_COLLAPSED,
+ /* Indicates the user interface object corresponding to this object no longer exists */
+ SPI_STATE_DEFUNCT,
/* Indicates the user can change the contents of this object */
SPI_STATE_EDITABLE,
+ /* Indicates that this object is enabled */
+ SPI_STATE_ENABLED,
/* Indicates this object allows progressive disclosure of its children */
SPI_STATE_EXPANDABLE,
/* Indicates this object its expanded */
* Indicates this object allows more than one of its children to be
* selected at the same time
*/
- SPI_STATE_MULTISELECSPI_TABLE,
+ SPI_STATE_MULTISELECTABLE,
/* Indicates this object paints every pixel within its rectangular region. */
SPI_STATE_OPAQUE,
/* Indicates this object is currently pressed */
* children to be selected and that this child is one of those children
* that can be selected.
*/
- SPI_STATE_SELECSPI_TABLE,
+ SPI_STATE_SELECTABLE,
/*
* Indicates this object is the child of an object that allows its
* children to be selected and that this child is one of those children
SPI_STATE_SHOWING,
/* Indicates this (text) object can contain only a single line of text */
SPI_STATE_SINGLE_LINE,
+ /* Indicates that the index associated with this object has changed since the user accessed the object. */
+ SPI_STATE_STALE,
/* Indicates this object is transient */
SPI_STATE_TRANSIENT,
/* Indicates the orientation of this object is vertical */
return cspi_role;
}
+static SPIBoolean
+init_state_table (Accessibility_StateType *state_table)
+{
+ int i;
+
+ for (i = 0; i < Accessibility_STATE_LAST_DEFINED; i++)
+ state_table[i] = SPI_STATE_INVALID;
+
+ state_table[SPI_STATE_ACTIVE] = Accessibility_STATE_ACTIVE;
+ state_table[SPI_STATE_ARMED] = Accessibility_STATE_ARMED;
+ state_table[SPI_STATE_BUSY] = Accessibility_STATE_BUSY;
+ state_table[SPI_STATE_CHECKED] = Accessibility_STATE_CHECKED;
+ state_table[SPI_STATE_DEFUNCT] = Accessibility_STATE_DEFUNCT;
+ state_table[SPI_STATE_EDITABLE] = Accessibility_STATE_EDITABLE;
+ state_table[SPI_STATE_ENABLED] = Accessibility_STATE_ENABLED;
+ state_table[SPI_STATE_EXPANDABLE] = Accessibility_STATE_EXPANDABLE;
+ state_table[SPI_STATE_EXPANDED] = Accessibility_STATE_EXPANDED;
+ state_table[SPI_STATE_FOCUSABLE] = Accessibility_STATE_FOCUSABLE;
+ state_table[SPI_STATE_FOCUSED] = Accessibility_STATE_FOCUSED;
+ state_table[SPI_STATE_HORIZONTAL] = Accessibility_STATE_HORIZONTAL;
+ state_table[SPI_STATE_ICONIFIED] = Accessibility_STATE_ICONIFIED;
+ state_table[SPI_STATE_MODAL] = Accessibility_STATE_MODAL;
+ state_table[SPI_STATE_MULTI_LINE] = Accessibility_STATE_MULTI_LINE;
+ state_table[SPI_STATE_MULTISELECTABLE] = Accessibility_STATE_MULTISELECTABLE;
+ state_table[SPI_STATE_OPAQUE] = Accessibility_STATE_OPAQUE;
+ state_table[SPI_STATE_PRESSED] = Accessibility_STATE_PRESSED;
+ state_table[SPI_STATE_RESIZABLE] = Accessibility_STATE_RESIZABLE;
+ state_table[SPI_STATE_SELECTABLE] = Accessibility_STATE_SELECTABLE;
+ state_table[SPI_STATE_SELECTED] = Accessibility_STATE_SELECTED;
+ state_table[SPI_STATE_SENSITIVE] = Accessibility_STATE_SENSITIVE;
+ state_table[SPI_STATE_SHOWING] = Accessibility_STATE_SHOWING;
+ state_table[SPI_STATE_SINGLE_LINE] = Accessibility_STATE_SINGLE_LINE;
+ state_table[SPI_STATE_STALE] = Accessibility_STATE_STALE;
+ state_table[SPI_STATE_TRANSIENT] = Accessibility_STATE_TRANSIENT;
+ state_table[SPI_STATE_VERTICAL] = Accessibility_STATE_VERTICAL;
+ state_table[SPI_STATE_VISIBLE] = Accessibility_STATE_VISIBLE;
+
+ return TRUE;
+}
+
+
+
+static Accessibility_StateType
+spi_state_type_from_accessible_state (AccessibleState type)
+{
+ static Accessibility_StateType state_table[Accessibility_STATE_LAST_DEFINED];
+ static SPIBoolean table_initialized = FALSE;
+ Accessibility_StateType rv;
+
+ if (!table_initialized)
+ table_initialized = init_state_table (state_table);
+ if (type > SPI_STATE_INVALID && type < SPI_STATE_LAST_DEFINED)
+ rv = state_table[type];
+ else
+ rv = Accessibility_STATE_INVALID;
+ return rv;
+}
+
+
+
+
/**
* AccessibleRole_getName:
* @role: an #AccessibleRole object to query.
AccessibleStateSet *
Accessible_getStateSet (Accessible *obj)
{
- return NULL;
+ AccessibleStateSet *retval;
+
+ cspi_return_val_if_fail (obj != NULL, NULL);
+
+ retval = cspi_object_add (
+ Accessibility_Accessible_getState (CSPI_OBJREF (obj),
+ cspi_ev ()));
+
+ return retval;
}
/* Interface query methods */
AccessibleState state)
{
CORBA_boolean retval;
-
+ Accessibility_StateType spi_state;
+
cspi_return_val_if_fail (obj != NULL, FALSE);
+ spi_state = spi_state_type_from_accessible_state (state);
retval = Accessibility_StateSet_contains (CSPI_OBJREF (obj),
- state, cspi_ev ());
+ spi_state, cspi_ev ());
cspi_return_val_if_ev ("contains", FALSE);
AccessibleStateSet_add (AccessibleStateSet *obj,
AccessibleState state)
{
+ Accessibility_StateType spi_state;
+
cspi_return_if_fail (obj != NULL);
- Accessibility_StateSet_add (CSPI_OBJREF (obj), state, cspi_ev ());
+ spi_state = spi_state_type_from_accessible_state (state);
+ Accessibility_StateSet_add (CSPI_OBJREF (obj), spi_state, cspi_ev ());
cspi_check_ev ("add");
}
AccessibleStateSet_remove (AccessibleStateSet *obj,
AccessibleState state)
{
+ Accessibility_StateType spi_state;
+
cspi_return_if_fail (obj != NULL);
- Accessibility_StateSet_remove (CSPI_OBJREF (obj), state, cspi_ev ());
+ spi_state = spi_state_type_from_accessible_state (state);
+ Accessibility_StateSet_remove (CSPI_OBJREF (obj), spi_state, cspi_ev ());
cspi_check_ev ("remove");
}
AccessibleStateSet_compare (AccessibleStateSet *obj,
AccessibleStateSet *obj2)
{
+ Accessibility_StateSet retval;
+
cspi_return_val_if_fail (obj != NULL, NULL);
cspi_return_val_if_fail (obj2 != NULL, NULL);
+ retval = Accessibility_StateSet_compare (CSPI_OBJREF(obj), CSPI_OBJREF(obj2), cspi_ev ());
return NULL;
}
SPIBoolean
AccessibleStateSet_isEmpty (AccessibleStateSet *obj)
{
+ CORBA_boolean retval;
+
cspi_return_val_if_fail (obj != NULL, FALSE);
- return TRUE;
- /* return Accessibility_StateSet_isEmpty (CSPI_OBJREF (obj), cspi_ev ());*/
+ retval = Accessibility_StateSet_isEmpty (CSPI_OBJREF (obj), cspi_ev ());
+ return (SPIBoolean) retval;
}
accessible_state_types[i] = Accessibility_STATE_INVALID;
}
- accessible_state_types[ATK_STATE_INVALID] = Accessibility_STATE_INVALID;
- atk_state_types [Accessibility_STATE_INVALID] = ATK_STATE_INVALID;
accessible_state_types[ATK_STATE_ACTIVE] = Accessibility_STATE_ACTIVE;
atk_state_types[Accessibility_STATE_ACTIVE] = ATK_STATE_ACTIVE;
accessible_state_types[ATK_STATE_ARMED] = Accessibility_STATE_ARMED;
atk_state_types[Accessibility_STATE_BUSY] = ATK_STATE_BUSY;
accessible_state_types[ATK_STATE_CHECKED] = Accessibility_STATE_CHECKED;
atk_state_types[Accessibility_STATE_CHECKED] = ATK_STATE_CHECKED;
- /*
- types[ATK_STATE_DEFUNCT] = Accessibility_STATE_DEFUNCT;
- */
+ accessible_state_types[ATK_STATE_DEFUNCT] = Accessibility_STATE_DEFUNCT;
+ atk_state_types[Accessibility_STATE_DEFUNCT] = ATK_STATE_DEFUNCT;
accessible_state_types[ATK_STATE_EDITABLE] = Accessibility_STATE_EDITABLE;
atk_state_types[Accessibility_STATE_EDITABLE] = ATK_STATE_EDITABLE;
- /*
- types[ATK_STATE_ENABLED] = Accessibility_STATE_ENABLED;
- */
+ accessible_state_types[ATK_STATE_ENABLED] = Accessibility_STATE_ENABLED;
+ atk_state_types[Accessibility_STATE_ENABLED] = ATK_STATE_ENABLED;
accessible_state_types[ATK_STATE_EXPANDABLE] = Accessibility_STATE_EXPANDABLE;
atk_state_types[Accessibility_STATE_EXPANDABLE] = ATK_STATE_EXPANDABLE;
accessible_state_types[ATK_STATE_EXPANDED] = Accessibility_STATE_EXPANDED;
atk_state_types[Accessibility_STATE_SHOWING] = ATK_STATE_SHOWING;
accessible_state_types[ATK_STATE_SINGLE_LINE] = Accessibility_STATE_SINGLE_LINE;
atk_state_types[Accessibility_STATE_SINGLE_LINE] = ATK_STATE_SINGLE_LINE;
- /*
- types[ATK_STATE_STALE] = Accessibility_STATE_STALE;
- */
+ accessible_state_types[ATK_STATE_STALE] = Accessibility_STATE_STALE;
+ atk_state_types[Accessibility_STATE_STALE] = ATK_STATE_STALE;
accessible_state_types[ATK_STATE_TRANSIENT] = Accessibility_STATE_TRANSIENT;
atk_state_types[Accessibility_STATE_TRANSIENT] = ATK_STATE_TRANSIENT;
accessible_state_types[ATK_STATE_VERTICAL] = Accessibility_STATE_VERTICAL;
{
rv = (CORBA_boolean)
atk_state_set_is_empty (return_set);
- g_object_unref (return_set);
+ g_object_unref (G_OBJECT(return_set));
}
else
rv = FALSE;
static Accessibility_StateSet
impl_compare (PortableServer_Servant servant,
- const Accessibility_StateSet
- compareState,
+ const Accessibility_StateSet compareState,
CORBA_Environment * ev)
{
AtkStateSet *set = atk_state_set_from_servant (servant);
+ AtkStateSet *set2, *return_set;
+ SpiStateSet *spi_set;
+
+ g_return_val_if_fail (set, FALSE);
- g_return_val_if_fail (set, CORBA_OBJECT_NIL);
+ set2 = atk_state_set_from_accessibility_state_set (compareState, ev);
+ g_return_val_if_fail (set2, CORBA_OBJECT_NIL);
+ return_set = atk_state_set_xor_sets (set, set2);
+ g_object_unref (G_OBJECT(set2));
+ spi_set = spi_state_set_new (return_set);
+ return bonobo_object_corba_objref (BONOBO_OBJECT(spi_set));
}