From 74ba76b61acb398d6f10065e3166b5e6f50a3bc0 Mon Sep 17 00:00:00 2001 From: billh Date: Wed, 12 Jul 2006 14:59:47 +0000 Subject: [PATCH] Added new method to Accessibility::Table; see RFE #326536. git-svn-id: http://svn.gnome.org/svn/at-spi/trunk@835 e2bd861d-eb25-0410-b326-f6ed22b6b98c --- ChangeLog | 20 +++++++++++++++++++ cspi/spi.h | 6 ++++++ cspi/spi_table.c | 41 ++++++++++++++++++++++++++++++++++++++ idl/Accessibility_Table.idl | 48 +++++++++++++++++++++++++++++++++++++++++++-- libspi/table.c | 42 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 155 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index c05db52..98c600f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,26 @@ 2006-07-12 Bill Haneman modifications to patch from 2006-07-12 Ariel Rios + See RFE #326536. + + * idl/Accessibility_Table.idl: + (getRowColumnExtentsAtIndex): New method for getting + selection status and extents in one API call. + + * libspi/table.c: + (impl_getRowColumnExtentsAtIndex): Implementation of + new method above. + (spi_table_class_init): Add above to epv. + + * cspi/spi.h: + * cspi/spi_table.c: + (AccessibleTable_getRowColumnExtentsAtIndex): New + method, retrieves selection status and row/col extents + for a table cell in a single API call. + +2006-07-12 Bill Haneman modifications to patch from +2006-07-12 Ariel Rios + * cspi/bonobo/cspi-bonobo.c: Remove warning adding * cspi/spi_text.c: diff --git a/cspi/spi.h b/cspi/spi.h index 0eb4821..71d3d51 100644 --- a/cspi/spi.h +++ b/cspi/spi.h @@ -908,6 +908,12 @@ AccessibleTable_getColumnExtentAt (AccessibleTable *obj, long int row, long int column); +SPIBoolean +AccessibleTable_getRowColumnExtentsAtIndex (AccessibleTable *obj, + long int index, long int *row, long int *col, + long int *row_extents, long int *col_extents, + long int *is_selected); + Accessible * AccessibleTable_getRowHeader (AccessibleTable *obj, long int row); diff --git a/cspi/spi_table.c b/cspi/spi_table.c index da083db..a42f4bc 100644 --- a/cspi/spi_table.c +++ b/cspi/spi_table.c @@ -717,6 +717,47 @@ AccessibleTable_removeColumnSelection (AccessibleTable *obj, return retval; } + +SPIBoolean +AccessibleTable_getRowColumnExtentsAtIndex (AccessibleTable *obj, + long int index, long int *row, long int *col, + long int *row_extents, long int *col_extents, + long int *is_selected){ + SPIBoolean retval; + CORBA_long cRow, cCol, cRow_extents, cCol_extents; + CORBA_boolean cIs_selected; + + cspi_return_val_if_fail (obj != NULL, FALSE); + + retval = Accessibility_Table_getRowColumnExtentsAtIndex (CSPI_OBJREF (obj), + index, &cRow, &cCol, + &cRow_extents, &cCol_extents, + &cIs_selected, + cspi_ev ()); + + if (!cspi_check_ev ("getRowColumnExtentsAtIndex")){ + + *row = 0; + *col = 0; + *row_extents = 0; + *col_extents = 0; + *is_selected = FALSE; + retval = FALSE; + } + + else { + *row = cRow; + *col = cCol; + *row_extents = cRow_extents;; + *col_extents = cCol_extents; + *is_selected = cIs_selected;; + } + + return retval; + +} + + /** * AccessibleTable_isSelected: * @obj: a pointer to the #AccessibleTable implementor on which to operate. diff --git a/idl/Accessibility_Table.idl b/idl/Accessibility_Table.idl index 0e2ee67..a995ba3 100644 --- a/idl/Accessibility_Table.idl +++ b/idl/Accessibility_Table.idl @@ -291,7 +291,52 @@ typedef sequence LongSeq; * \c False if not. **/ boolean removeColumnSelection (in long column); - + /** + * Given a child index, determine the row and column indices and + * extents, and whether the cell is currently selected. If + * the child at \c index is not a cell (for instance, if it is + * a summary, caption, etc.), \c False is returned. + * + * @param index the index of the Table child whose row/column + * extents are requested. + * @param row back-filled with the first table row associated with + * the cell with child index \c index. + * @param col back-filled with the first table column associated + * with the cell with child index \c index. + * @param row_extents back-filled with the number of table rows + * across which child \c i extends. + * @param col_extents back-filled with the number of table columns + * across which child \c i extends. + * @param is_selected a boolean which is back-filled with \c True + * if the child at index \c i corresponds to a selected table cell, + * \c False otherwise. + * + * Example: + * If the Table child at index '6' extends across columns 5 and 6 of + * row 2 of a Table instance, and is currently selected, then + * \code + * retval = table::getRowColumnExtentsAtIndex (6, row, col, + * row_extents, + * col_extents, + * is_selected); + * \endcode + * will return True, and after the call + * \c row, \c col, \c row_extents, \c col_extents, + * and \c is_selected will contain \c 2, \c 5, \c 1, \c 2, and + * \c True, respectively. + * + * @returns \c True if the index is associated with a valid table + * cell, \c False if the index does not correspond to a cell. If + * \c False is returned, the values of the out parameters are + * undefined. + * + * @since AT-SPI 1.7.0 + **/ + boolean getRowColumnExtentsAtIndex (in long index, out long row, + out long col, + out long row_extents, + out long col_extents, + out boolean is_selected); /** \cond * unImplemented: * @@ -304,7 +349,6 @@ typedef sequence LongSeq; void unImplemented5 (); void unImplemented6 (); void unImplemented7 (); - void unImplemented8 (); /** \endcond */ }; }; diff --git a/libspi/table.c b/libspi/table.c index 2c834cb..33290dd 100644 --- a/libspi/table.c +++ b/libspi/table.c @@ -438,6 +438,47 @@ impl_removeColumnSelection (PortableServer_Servant servant, static CORBA_boolean +impl_getRowColumnExtentsAtIndex (PortableServer_Servant servant, + const CORBA_long index, + CORBA_long *row, + CORBA_long *column, + CORBA_long *row_extents, + CORBA_long *col_extents, + CORBA_boolean *is_selected, + CORBA_Environment *ev) +{ + + AtkObject *cell; + AtkRole role; + AtkTable *table = get_table_from_servant (servant); + gint intColumn, intRow, intRow_extents, intCol_extents; + gboolean boolIs_selected; + + g_return_val_if_fail (table != NULL, FALSE); + + intColumn = atk_table_get_column_at_index (table, index); + intRow = atk_table_get_row_at_index (table, index); + intRow_extents = atk_table_get_row_extent_at (table, intRow, intColumn); + intCol_extents = atk_table_get_column_extent_at (table, intRow, intColumn); + boolIs_selected = atk_table_is_selected (table, intRow, intColumn); + + *column = intColumn; + *row = intRow; + *row_extents = intRow_extents; + *col_extents = intCol_extents; + *is_selected = boolIs_selected; + + cell = atk_table_ref_at (table, intRow, intColumn); + role = atk_object_get_role (cell); + + if (role == ATK_ROLE_TABLE_CELL) + return TRUE; + + return FALSE; + +} + +static CORBA_boolean impl_isSelected (PortableServer_Servant servant, const CORBA_long row, const CORBA_long column, @@ -484,6 +525,7 @@ spi_table_class_init (SpiTableClass *klass) epv->removeRowSelection = impl_removeRowSelection; epv->removeColumnSelection = impl_removeColumnSelection; epv->isSelected = impl_isSelected; + epv->getRowColumnExtentsAtIndex = impl_getRowColumnExtentsAtIndex; } static void -- 2.7.4