+/*
+ * AT-SPI - Assistive Technology Service Provider Interface
+ * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
+ *
+ * Copyright 2001, 2002 Sun Microsystems Inc.,
+ * Copyright 2001, 2002 Ximian, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
#include <stdlib.h> /* for malloc */
#include <cspi/spi-private.h>
Accessible *
AccessibleTable_getCaption (AccessibleTable *obj)
{
- return cspi_object_add (
- Accessibility_Table__get_caption (CSPI_OBJREF (obj), cspi_ev ()));
+ Accessible *retval;
+
+ cspi_return_val_if_fail (obj != NULL, NULL);
+
+ retval = cspi_object_add (
+ Accessibility_Table__get_caption (CSPI_OBJREF (obj), cspi_ev ()));
+ cspi_return_val_if_ev ("getCaption", NULL);
+ return retval;
}
/**
Accessible *
AccessibleTable_getSummary (AccessibleTable *obj)
{
- return cspi_object_add (
- Accessibility_Table__get_summary (CSPI_OBJREF (obj), cspi_ev ()));
+ Accessible *retval;
+
+ cspi_return_val_if_fail (obj != NULL, NULL);
+
+retval = cspi_object_add (
+ Accessibility_Table__get_summary (CSPI_OBJREF (obj), cspi_ev ()));
+ cspi_return_val_if_ev ("getSummary", NULL);
+ return retval;
}
/**
retval =
Accessibility_Table__get_nColumns (CSPI_OBJREF (obj), cspi_ev ());
- cspi_return_val_if_ev ("", -1);
+ cspi_return_val_if_ev ("getNColumns", -1);
return retval;
}
long int row,
long int column)
{
- return cspi_object_add (
- Accessibility_Table_getAccessibleAt (
- CSPI_OBJREF (obj), (CORBA_long) row,
- (CORBA_long) column, cspi_ev ()));
+ Accessible *retval;
+
+ cspi_return_val_if_fail (obj != NULL, NULL);
+
+ retval = cspi_object_add (
+ Accessibility_Table_getAccessibleAt (
+ CSPI_OBJREF (obj), row,
+ column, cspi_ev ()));
+ cspi_return_val_if_ev ("getAccessibleAt", NULL);
+ return retval;
}
/**
retval =
Accessibility_Table_getIndexAt (
- CSPI_OBJREF (obj), (CORBA_long) row,
- (CORBA_long) column, cspi_ev ());
+ CSPI_OBJREF (obj), row,
+ column, cspi_ev ());
cspi_return_val_if_ev ("getIndexAt", -1);
retval =
Accessibility_Table_getRowAtIndex (CSPI_OBJREF (obj),
- (CORBA_long) index, cspi_ev ());
+ index, cspi_ev ());
- cspi_return_val_if_ev ("", -1);
+ cspi_return_val_if_ev ("getRowAtIndex", -1);
return retval;
}
retval =
Accessibility_Table_getColumnAtIndex (CSPI_OBJREF (obj),
- (CORBA_long) index, cspi_ev ());
+ index, cspi_ev ());
cspi_return_val_if_ev ("getColumnAtIndex", -1);
retval =
Accessibility_Table_getRowDescription (CSPI_OBJREF (obj),
- (CORBA_long) row, cspi_ev ());
+ row, cspi_ev ());
cspi_return_val_if_ev ("getRowDescription", NULL);
retval =
Accessibility_Table_getColumnDescription (CSPI_OBJREF (obj),
- (CORBA_long) column, cspi_ev ());
+ column, cspi_ev ());
cspi_return_val_if_ev ("getColumnDescription", NULL);
retval =
Accessibility_Table_getRowExtentAt (
- CSPI_OBJREF (obj), (CORBA_long) row,
- (CORBA_long) column, cspi_ev ());
+ CSPI_OBJREF (obj), row,
+ column, cspi_ev ());
cspi_return_val_if_ev ("getRowExtentAt", -1);
retval =
Accessibility_Table_getColumnExtentAt (
- CSPI_OBJREF (obj), (CORBA_long) row,
- (CORBA_long) column, cspi_ev ());
+ CSPI_OBJREF (obj), row,
+ column, cspi_ev ());
cspi_return_val_if_ev ("getColumnExtentAt", -1);
AccessibleTable_getRowHeader (AccessibleTable *obj,
long int row)
{
- return cspi_object_add (
- Accessibility_Table_getRowHeader (CSPI_OBJREF (obj),
- (CORBA_long) row, cspi_ev ()));
+ Accessible *retval;
+
+ cspi_return_val_if_fail (obj != NULL, NULL);
+
+ retval = cspi_object_add (
+ Accessibility_Table_getRowHeader (CSPI_OBJREF (obj),
+ row, cspi_ev ()));
+ cspi_return_val_if_ev ("getRowHeader", NULL);
+
+ return retval;
}
/**
AccessibleTable_getColumnHeader (AccessibleTable *obj,
long int column)
{
- return cspi_object_add (
- Accessibility_Table_getColumnHeader (CSPI_OBJREF (obj),
- (CORBA_long) column, cspi_ev ()));
+ Accessible *retval;
+
+ cspi_return_val_if_fail (obj != NULL, NULL);
+
+ retval = cspi_object_add (
+ Accessibility_Table_getColumnHeader (CSPI_OBJREF (obj),
+ column, cspi_ev ()));
+ cspi_return_val_if_ev ("getColumnHeader", NULL);
+
+ return retval;
}
/**
static long
cspi_long_seq_to_array (Accessibility_LongSeq *seq, long int **array)
{
- long *j, length, i;
+ long *j;
+ long length, i;
if (!cspi_check_ev ("getSelectionItems"))
{
rows = Accessibility_Table_getSelectedRows (CSPI_OBJREF (obj), cspi_ev ());
+ cspi_return_val_if_ev ("getSelectedRows", -1);
+
return cspi_long_seq_to_array (rows, selectedRows);
}
* AccessibleTable_getNSelectedColumns:
* @obj: a pointer to the #AccessibleTable implementor on which to operate.
*
- * Query a table to find out how many columnss are currently selected. Not all tables
+ * Query a table to find out how many columns are currently selected. Not all tables
* support column selection.
*
* Returns: a long integer indicating the number of columns currently selected.
columns = Accessibility_Table_getSelectedColumns (CSPI_OBJREF (obj), cspi_ev ());
+ cspi_return_val_if_ev ("getSelectedColumns", -1);
return cspi_long_seq_to_array (columns, selectedColumns);
}
retval =
Accessibility_Table_isRowSelected (CSPI_OBJREF (obj),
- (CORBA_long) row, cspi_ev ());
+ row, cspi_ev ());
cspi_return_val_if_ev ("isRowSelected", FALSE);
retval =
Accessibility_Table_isColumnSelected (CSPI_OBJREF (obj),
- (CORBA_long) column, cspi_ev ());
+ column, cspi_ev ());
cspi_return_val_if_ev ("isColumnSelected", FALSE);
}
/**
+ * AccessibleTable_addRowSelection:
+ * @obj: a pointer to the #AccessibleTable implementor on which to operate.
+ * @row:
+ *
+ * Select the specified row, adding it to the current row selection.
+ * Not all tables support row selection.
+ *
+ * Returns: #TRUE if the specified row was successfully selected, #FALSE if not.
+ **/
+SPIBoolean
+AccessibleTable_addRowSelection (AccessibleTable *obj,
+ long int row)
+{
+ SPIBoolean retval;
+
+ cspi_return_val_if_fail (obj != NULL, FALSE);
+
+ retval =
+ Accessibility_Table_addRowSelection (CSPI_OBJREF (obj),
+ row, cspi_ev ());
+
+ cspi_return_val_if_ev ("addRowSelection", FALSE);
+
+ return retval;
+}
+
+/**
+ * AccessibleTable_addColumnSelection:
+ * @obj: a pointer to the #AccessibleTable implementor on which to operate.
+ * @column:
+ *
+ * Select the specified column, adding it to the current column selection.
+ * Not all tables support column selection.
+ *
+ * Returns: #TRUE if the specified column was successfully selected, #FALSE if not.
+ **/
+SPIBoolean
+AccessibleTable_addColumnSelection (AccessibleTable *obj,
+ long int column)
+{
+ SPIBoolean retval;
+
+ cspi_return_val_if_fail (obj != NULL, FALSE);
+
+ retval =
+ Accessibility_Table_addColumnSelection (CSPI_OBJREF (obj),
+ column, cspi_ev ());
+
+ cspi_return_val_if_ev ("addColumnSelection", FALSE);
+
+ return retval;
+}
+
+/**
+ * AccessibleTable_removeRowSelection:
+ * @obj: a pointer to the #AccessibleTable implementor on which to operate.
+ * @row:
+ *
+ * De-select the specified row, removing it to the current row selection.
+ * Not all tables support row selection.
+ *
+ * Returns: #TRUE if the specified row was successfully de-selected, #FALSE if not.
+ **/
+SPIBoolean
+AccessibleTable_removeRowSelection (AccessibleTable *obj,
+ long int row)
+{
+ SPIBoolean retval;
+
+ cspi_return_val_if_fail (obj != NULL, FALSE);
+
+ retval =
+ Accessibility_Table_removeRowSelection (CSPI_OBJREF (obj),
+ row, cspi_ev ());
+
+ cspi_return_val_if_ev ("removeRowSelection", FALSE);
+
+ return retval;
+}
+
+/**
+ * AccessibleTable_removeColumnSelection:
+ * @obj: a pointer to the #AccessibleTable implementor on which to operate.
+ * @column:
+ *
+ * De-select the specified column, removing it to the current column selection.
+ * Not all tables support column selection.
+ *
+ * Returns: #TRUE if the specified column was successfully de-selected, #FALSE if not.
+ **/
+SPIBoolean
+AccessibleTable_removeColumnSelection (AccessibleTable *obj,
+ long int column)
+{
+ SPIBoolean retval;
+
+ cspi_return_val_if_fail (obj != NULL, FALSE);
+
+ retval =
+ Accessibility_Table_removeColumnSelection (CSPI_OBJREF (obj),
+ column, cspi_ev ());
+
+ cspi_return_val_if_ev ("removeColumnSelection", FALSE);
+
+ return retval;
+}
+
+/**
* AccessibleTable_isSelected:
* @obj: a pointer to the #AccessibleTable implementor on which to operate.
* @row:
retval =
Accessibility_Table_isSelected (CSPI_OBJREF (obj),
- (CORBA_long) row,
- (CORBA_long) column, cspi_ev ());
+ row,
+ column, cspi_ev ());
cspi_return_val_if_ev ("isSelected", FALSE);