+2002-05-09 Marc Mulcahy <marc.mulcahy@sun.com>
+
+ * cspi/spi_accessible.c: Added exception checks. Fixed completely
+ busted AccessibleStateSet_compare. Removed redundant casts.
+
+ * cspi/spi-action.c: Removed redundant casts.
+
+ * cspi/spi_application.c: Fixed typo in AccessibleApplication_getVersion.
+
+ * cspi/spi_component.c: Fixed typos and casting error.
+
+ * cspi/spi_editabletext.c: Removed redundant casts.
+
+ * cspi/spi_hyperlink.c: Fixed casting and exception checking.
+
+ * cspi/spi_hypertext.c: Eliminated redundant casts.
+
+ * cspi/spi_image.c: Eliminated redundant casts.
+
+ * cspi/spi_registry.c: Eliminated redundant casts.
+ SPI_deregisterGlobalEventListenerAll () removed retval variable.
+ * cspi/spi_selection.c: Removed redundant casts.
+ * cspi/spi_text.c: Eliminated redundant casts. Fixed exception
+ handling. Screen geometry and text offsets were being returned as 0
+ on error which is technically valid-- changed these to return -1.
+ Added marshaller for text boundary types to fix bug with boundary
+ types being passed incorrectly to atk.
+
+
+2002-05-03 Marc Mulcahy <marc.mulcahy@sun.com>
+
+ * cspi/bonobo/cspi-bonobo.c cspi/bonobo/cspi-bonobo-listener.c
+ cspi/bonobo/cspi-bonobo-listener.h: Added copyright notice.
+
2002-05-10 Bill Haneman <bill.haneman@sun.com>
* registryd/deviceeventcontroller.c:
* NEWS:
updated NEWS file to reflect recent spin-off of gnome-mag.
+
2002-05-09 Bill Haneman <bill.haneman@sun.com>
* cspi/spi_registry.c:
+/*
+ * AT-SPI - Assistive Technology Service Provider Interface
+ * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
+ *
+ * Copyright 2001 Sun Microsystems 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 <libbonobo.h>
#include "../spi-private.h"
#include "cspi-bonobo-listener.h"
+/*
+ * AT-SPI - Assistive Technology Service Provider Interface
+ * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
+ *
+ * Copyright 2001 Sun Microsystems 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.
+ */
+
#ifndef __SPI_LISTENER_IMPL_H__
#define __SPI_LISTENER_IMP_H__
+/*
+ * AT-SPI - Assistive Technology Service Provider Interface
+ * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
+ *
+ * Copyright 2001 Sun Microsystems 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 <string.h>
#include <libbonobo.h>
#include "../cspi-lowlevel.h"
cspi_return_val_if_fail (obj != NULL, NULL);
- retval = (char *)
- Accessibility_Accessible__get_name (CSPI_OBJREF (obj), cspi_ev ());
+ retval = Accessibility_Accessible__get_name (CSPI_OBJREF (obj), cspi_ev ());
cspi_return_val_if_ev ("getName", NULL);
cspi_return_val_if_fail (obj != NULL, NULL);
- retval = (char *)
- Accessibility_Accessible__get_description (CSPI_OBJREF (obj),
+ retval = Accessibility_Accessible__get_description (CSPI_OBJREF (obj),
cspi_ev ());
cspi_return_val_if_ev ("getDescription", NULL);
cspi_return_val_if_fail (obj != NULL, -1);
- retval = (long)
- Accessibility_Accessible__get_childCount (CSPI_OBJREF (obj),
+ retval = Accessibility_Accessible__get_childCount (CSPI_OBJREF (obj),
cspi_ev ());
cspi_return_val_if_ev ("getChildCount", -1);
Accessibility_Accessible_getChildAtIndex (CSPI_OBJREF (obj),
childIndex, cspi_ev ()));
+ cspi_return_val_if_ev ("getChildAtIndex", NULL);
return retval;
}
cspi_return_val_if_fail (obj != NULL, -1);
- retval = (long)
- Accessibility_Accessible_getIndexInParent (CSPI_OBJREF (obj), cspi_ev ());
+ retval = Accessibility_Accessible_getIndexInParent (CSPI_OBJREF (obj), cspi_ev ());
cspi_return_val_if_ev ("getIndexInparent", -1);
return retval;
Accessibility_Accessible_getState (CSPI_OBJREF (obj),
cspi_ev ()));
+ cspi_return_val_if_ev ("getState", NULL);
return retval;
}
int retval;
cspi_return_val_if_fail (obj, -1);
- retval = (int)
- Accessibility_Relation_getNTargets (CSPI_OBJREF (obj), cspi_ev());
+ retval = Accessibility_Relation_getNTargets (CSPI_OBJREF (obj), cspi_ev());
cspi_return_val_if_ev ("getNTargets", -1);
return retval;
}
retval = cspi_object_add (
Accessibility_Relation_getTarget (CSPI_OBJREF(obj),
- (CORBA_short) i, cspi_ev()));
+ i, cspi_ev()));
cspi_return_val_if_ev ("getTarget", NULL);
return retval;
}
cspi_return_val_if_ev ("contains", FALSE);
- return (SPIBoolean) retval;
+ return retval;
}
/**
AccessibleStateSet_compare (AccessibleStateSet *obj,
AccessibleStateSet *obj2)
{
- Accessibility_StateSet retval;
+ AccessibleStateSet *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;
+ retval = cspi_object_add (
+ Accessibility_StateSet_compare (CSPI_OBJREF(obj), CSPI_OBJREF(obj2), cspi_ev ()));
+
+ cspi_return_val_if_ev ("compare", NULL);
+ return retval;
}
/**
cspi_return_val_if_fail (obj != NULL, FALSE);
retval = Accessibility_StateSet_isEmpty (CSPI_OBJREF (obj), cspi_ev ());
- return (SPIBoolean) retval;
+
+ cspi_return_val_if_ev ("isEmpty", TRUE);
+ return retval;
}
retval =
Accessibility_Action_getDescription (CSPI_OBJREF (obj),
- (CORBA_long) i,
+ i,
cspi_ev ());
cspi_return_val_if_ev ("getDescription", NULL);
retval =
Accessibility_Action_getKeyBinding (CSPI_OBJREF (obj),
- (CORBA_long) i,
+ i,
cspi_ev ());
cspi_return_val_if_ev ("getKeyBinding", NULL);
retval =
Accessibility_Action_getName (CSPI_OBJREF (obj),
- (CORBA_long) i,
+ i,
cspi_ev ());
cspi_return_val_if_ev ("getName", NULL);
cspi_return_val_if_fail (obj != NULL, FALSE);
- retval = (SPIBoolean)
- Accessibility_Action_doAction (CSPI_OBJREF (obj),
- (CORBA_long) i,
+ retval = Accessibility_Action_doAction (CSPI_OBJREF (obj),
+ i,
cspi_ev ());
cspi_return_val_if_ev ("doAction", FALSE);
Accessibility_Application__get_version (CSPI_OBJREF (obj),
cspi_ev ());
- cspi_return_val_if_ev ("getVersion", NULL);
+ cspi_return_val_if_ev ("version", NULL);
return retval;
}
retval = Accessibility_Application__get_id (CSPI_OBJREF (obj),
cspi_ev ());
- cspi_return_val_if_ev ("get_id", 0);
+ cspi_return_val_if_ev ("id", 0);
return retval;
}
cspi_return_val_if_fail (obj != NULL, FALSE);
retval = Accessibility_Component_contains (CSPI_OBJREF (obj),
- (CORBA_long) x,
- (CORBA_long) y,
+ x,
+ y,
ctype,
cspi_ev ());
cspi_return_val_if_ev ("contains", FALSE);
cspi_return_val_if_fail (obj != NULL, NULL);
child = Accessibility_Component_getAccessibleAtPoint (CSPI_OBJREF (obj),
- (CORBA_long) x,
- (CORBA_long) y,
+ x,
+ y,
ctype,
cspi_ev ());
return cspi_object_add (child);
bbox = Accessibility_Component_getExtents (CSPI_OBJREF (obj),
ctype,
cspi_ev ());
- if (!cspi_check_ev ("AccessibleComponent_getExtents"))
+ if (!cspi_check_ev ("getExtents"))
{
*x = *y = *width = *height = 0;
}
long int *width,
long int *height)
{
+ CORBA_long cw, ch;
+
cspi_return_if_fail (obj != NULL);
Accessibility_Component_getSize (CSPI_OBJREF (obj),
- (CORBA_long *) width,
- (CORBA_long *) height,
+ &cw,
+ &ch,
cspi_ev ());
+ if (cspi_check_ev ("getSize"))
+ {
+ *width = *height = 0;
+ }
+ else
+ {
+ *width = cw;
+ *height = ch;
+ }
}
/**
SPIBoolean
AccessibleComponent_grabFocus (AccessibleComponent *obj)
{
- short retval;
+ SPIBoolean retval;
cspi_return_val_if_fail (obj != NULL, FALSE);
retval =
Accessibility_EditableText_setAttributes (CSPI_OBJREF (obj),
- (CORBA_char *) attributes,
- (CORBA_long) startPos,
- (CORBA_long) endPos, cspi_ev ());
+ attributes,
+ startPos,
+ endPos, cspi_ev ());
cspi_return_val_if_ev ("setAttributes", FALSE);
cspi_return_val_if_fail (obj != NULL, FALSE);
retval = Accessibility_EditableText_setTextContents (CSPI_OBJREF (obj),
- (CORBA_char *) newContents, cspi_ev ());
+ newContents, cspi_ev ());
cspi_return_val_if_ev ("setTextContents", FALSE);
cspi_return_val_if_fail (obj != NULL, FALSE);
retval = Accessibility_EditableText_insertText (CSPI_OBJREF (obj),
- (CORBA_long) position, (const CORBA_char *) text,
- (CORBA_long) length, cspi_ev ());
+ position, text,
+ length, cspi_ev ());
cspi_return_val_if_ev ("insertText", FALSE);
cspi_return_val_if_fail (obj != NULL, FALSE);
Accessibility_EditableText_copyText (
- CSPI_OBJREF (obj), (CORBA_long) startPos,
- (CORBA_long) endPos, cspi_ev ());
+ CSPI_OBJREF (obj), startPos,
+ endPos, cspi_ev ());
cspi_return_val_if_ev ("copyText", FALSE);
retval = Accessibility_EditableText_cutText (
CSPI_OBJREF (obj),
- (CORBA_long) startPos, (CORBA_long) endPos, cspi_ev ());
+ startPos, endPos, cspi_ev ());
cspi_return_val_if_ev ("cutText", FALSE);
retval = Accessibility_EditableText_deleteText (
CSPI_OBJREF (obj),
- (CORBA_long) startPos, (CORBA_long) endPos, cspi_ev ());
+ startPos, endPos, cspi_ev ());
cspi_return_val_if_ev ("deleteText", FALSE);
cspi_return_val_if_fail (obj != NULL, FALSE);
retval = Accessibility_EditableText_pasteText (
- CSPI_OBJREF (obj), (CORBA_long) position, cspi_ev ());
+ CSPI_OBJREF (obj), position, cspi_ev ());
cspi_return_val_if_ev ("pasteText", FALSE);
retval =
Accessibility_Hyperlink_getURI (CSPI_OBJREF (obj),
- (CORBA_long) i, cspi_ev ());
+ i, cspi_ev ());
cspi_return_val_if_ev ("getURI", NULL);
return cspi_object_add (
Accessibility_Hyperlink_getObject (CSPI_OBJREF (obj),
- (CORBA_long) i, cspi_ev ()));
+ i, cspi_ev ()));
}
/**
long int *startIndex,
long int *endIndex)
{
+ CORBA_long si, ei;
+
cspi_return_if_fail (obj != NULL);
- *startIndex = (long)
- Accessibility_Hyperlink__get_startIndex (CSPI_OBJREF (obj), cspi_ev ());
- *endIndex = (long)
- Accessibility_Hyperlink__get_endIndex (CSPI_OBJREF (obj), cspi_ev ());
+si = Accessibility_Hyperlink__get_startIndex (CSPI_OBJREF (obj), cspi_ev ());
+ cspi_return_if_ev ("startIndex");
+ ei = Accessibility_Hyperlink__get_endIndex (CSPI_OBJREF (obj), cspi_ev ());
- cspi_return_if_ev ("getIndexRange");
+ cspi_return_if_ev ("endIndex");
+ *startIndex = si;
+ *endIndex = ei;
}
/**
retval = cspi_object_add (
Accessibility_Hypertext_getLink (CSPI_OBJREF (obj),
- (CORBA_long) linkIndex,
+ linkIndex,
cspi_ev ()));
cspi_return_val_if_ev ("getLink", NULL);
retval =
Accessibility_Hypertext_getLinkIndex (CSPI_OBJREF (obj),
- (CORBA_long) characterOffset,
+ characterOffset,
cspi_ev ());
cspi_return_val_if_ev ("getLinkIndex", -1);
cspi_return_if_fail (obj != NULL);
bbox = Accessibility_Image_getImageExtents (CSPI_OBJREF (obj),
- (CORBA_short) ctype,
+ ctype,
cspi_ev ());
if (!cspi_check_ev ("getImageExtents"))
SPI_registerGlobalEventListener (AccessibleEventListener *listener,
const char *eventType)
{
- SPIBoolean retval;
-
if (!listener)
{
return FALSE;
cspi_event_listener_get_corba (listener),
eventType, cspi_ev ());
- retval = !cspi_exception ();
-
- return retval;
+ return !cspi_exception ();
}
/**
Accessibility_Registry_deregisterGlobalEventListener (
cspi_registry (),
cspi_event_listener_get_corba (listener),
- (CORBA_char *) eventType, cspi_ev ());
+ eventType, cspi_ev ());
return !cspi_exception ();
}
{
return cspi_object_add (
Accessibility_Registry_getDesktop (
- cspi_registry (), (CORBA_short) i, cspi_ev ()));
+ cspi_registry (), i, cspi_ev ()));
}
/**
desktops = Accessibility_Registry_getDesktopList (cspi_registry (),
cspi_ev ());
- cspi_return_val_if_ev ("getting desktop list", 0);
+ cspi_return_val_if_ev ("getDesktopList", 0);
list = g_new0 (Accessible *, desktops->_length + 1);
child = Accessibility_Selection_getSelectedChild (
CSPI_OBJREF (obj),
- (CORBA_long) selectedChildIndex, cspi_ev ());
+ selectedChildIndex, cspi_ev ());
- return (Accessible *) cspi_object_add (child);
+ return cspi_object_add (child);
}
/**
retval =
Accessibility_Selection_selectChild (CSPI_OBJREF (obj),
- (CORBA_long) childIndex, cspi_ev ());
+ childIndex, cspi_ev ());
cspi_return_val_if_ev ("selectChild", FALSE);
cspi_return_val_if_fail (obj != NULL, FALSE);
retval = Accessibility_Selection_deselectSelectedChild (
- CSPI_OBJREF (obj), (CORBA_long) selectedChildIndex, cspi_ev ());
+ CSPI_OBJREF (obj), selectedChildIndex, cspi_ev ());
cspi_return_val_if_ev ("deselectSelectedChild", FALSE);
retval = Accessibility_Selection_isChildSelected (
CSPI_OBJREF (obj),
- (CORBA_long) childIndex, cspi_ev ());
+ childIndex, cspi_ev ());
cspi_return_val_if_ev ("isChildSelected", FALSE);
- return (SPIBoolean) retval;
+ return retval;
}
/**
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);
}
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);
retval =
Accessibility_Table_addRowSelection (CSPI_OBJREF (obj),
- (CORBA_long) row, cspi_ev ());
+ row, cspi_ev ());
cspi_return_val_if_ev ("addRowSelection", FALSE);
retval =
Accessibility_Table_addColumnSelection (CSPI_OBJREF (obj),
- (CORBA_long) column, cspi_ev ());
+ column, cspi_ev ());
cspi_return_val_if_ev ("addColumnSelection", FALSE);
retval =
Accessibility_Table_removeRowSelection (CSPI_OBJREF (obj),
- (CORBA_long) row, cspi_ev ());
+ row, cspi_ev ());
cspi_return_val_if_ev ("removeRowSelection", FALSE);
retval =
Accessibility_Table_removeColumnSelection (CSPI_OBJREF (obj),
- (CORBA_long) column, cspi_ev ());
+ column, cspi_ev ());
cspi_return_val_if_ev ("removeColumnSelection", FALSE);
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);
#include <cspi/spi-private.h>
+static Accessibility_TEXT_BOUNDARY_TYPE
+get_accessible_text_boundary_type (
+ AccessibleTextBoundaryType type)
+{
+ switch (type)
+ {
+ case SPI_TEXT_BOUNDARY_CHAR:
+ return Accessibility_TEXT_BOUNDARY_CHAR;
+ break;
+ case SPI_TEXT_BOUNDARY_CURSOR_POS:
+ /* FixME */
+ return Accessibility_TEXT_BOUNDARY_CHAR;
+ break;
+ case SPI_TEXT_BOUNDARY_WORD_START:
+ return Accessibility_TEXT_BOUNDARY_WORD_START;
+ break;
+ case SPI_TEXT_BOUNDARY_WORD_END:
+ return Accessibility_TEXT_BOUNDARY_WORD_END;
+ break;
+ case SPI_TEXT_BOUNDARY_SENTENCE_START:
+ return Accessibility_TEXT_BOUNDARY_SENTENCE_START;
+ break;
+ case SPI_TEXT_BOUNDARY_SENTENCE_END:
+ return Accessibility_TEXT_BOUNDARY_SENTENCE_END;
+ break;
+ case SPI_TEXT_BOUNDARY_LINE_START:
+ return Accessibility_TEXT_BOUNDARY_LINE_START;
+ break;
+ case SPI_TEXT_BOUNDARY_LINE_END:
+ return Accessibility_TEXT_BOUNDARY_LINE_END;
+ break;
+ case SPI_TEXT_BOUNDARY_ATTRIBUTE_RANGE:
+ /* Fixme */
+ return Accessibility_TEXT_BOUNDARY_CHAR;
+ break;
+ }
+}
+
+
/**
* AccessibleText_ref:
* @obj: a pointer to the #AccessibleText object on which to operate.
cspi_return_val_if_fail (obj != NULL, -1);
- retval = (long)
- Accessibility_Text__get_characterCount (CSPI_OBJREF (obj), cspi_ev ());
+ retval = Accessibility_Text__get_characterCount (CSPI_OBJREF (obj), cspi_ev ());
cspi_return_val_if_ev ("getCharacterCount", -1);
retval =
Accessibility_Text_getText (CSPI_OBJREF (obj),
- (CORBA_long) startOffset,
- (CORBA_long) endOffset,
+ startOffset,
+ endOffset,
cspi_ev ());
cspi_return_val_if_ev ("getText", NULL);
if (obj == NULL)
{
- *startOffset = *endOffset = 0;
+ *startOffset = *endOffset = -1;
return NULL;
}
- retval = (char *)
- Accessibility_Text_getAttributes (CSPI_OBJREF (obj),
- (CORBA_long) offset,
+ retval = Accessibility_Text_getAttributes (CSPI_OBJREF (obj),
+ offset,
&retStartOffset,
&retEndOffset,
cspi_ev ());
if (!cspi_check_ev ("getAttributes"))
{
- *startOffset = *endOffset = 0;
+ *startOffset = *endOffset = -1;
+ retval = NULL;
}
else
{
retval =
Accessibility_Text_setCaretOffset (CSPI_OBJREF (obj),
- (CORBA_long) newOffset, cspi_ev ());
+ newOffset, cspi_ev ());
cspi_return_val_if_ev ("setCaretOffset", FALSE);
{
char *retval;
CORBA_long retStartOffset, retEndOffset;
- retval = (char *)
- Accessibility_Text_getTextBeforeOffset (CSPI_OBJREF (obj),
- (CORBA_long) offset, (Accessibility_TEXT_BOUNDARY_TYPE) type,
+
+ if (obj == NULL)
+ {
+ *startOffset = *endOffset = -1;
+ return NULL;
+ }
+
+ retval = Accessibility_Text_getTextBeforeOffset (CSPI_OBJREF (obj),
+ offset,
+ get_accessible_text_boundary_type (type),
&retStartOffset, &retEndOffset,
cspi_ev ());
- *startOffset = (long) retStartOffset;
- *endOffset = (long) retEndOffset;
+ if (!cspi_check_ev ("getTextBeforeOffset"))
+ {
+ *startOffset = *endOffset = -1;
+ retval = NULL;
+ }
+ else
+ {
+ *startOffset = retStartOffset;
+ *endOffset = retEndOffset;
+ }
return retval;
}
if (obj == NULL)
{
- *startOffset = *endOffset = 0;
+ *startOffset = *endOffset = -1;
return NULL;
}
retval = Accessibility_Text_getTextAtOffset (CSPI_OBJREF (obj),
- (CORBA_long) offset,
- (Accessibility_TEXT_BOUNDARY_TYPE) type,
+ offset,
+ get_accessible_text_boundary_type (type),
&corbaStartOffset,
&corbaEndOffset,
cspi_ev ());
if (!cspi_check_ev ("getTextAtOffset"))
{
- *startOffset = *endOffset = 0;
+ *startOffset = *endOffset = -1;
retval = NULL;
}
else
*startOffset = corbaStartOffset;
*endOffset = corbaEndOffset;
}
-#ifdef CSPI_DEBUG
- fprintf (stderr, "text offsets %ld to %ld\n", *startOffset, *endOffset);
-#endif
return retval;
}
if (obj == NULL)
{
- *startOffset = *endOffset = 0;
+ *startOffset = *endOffset = -1;
return NULL;
}
- retval = (char *)
- Accessibility_Text_getTextAfterOffset (CSPI_OBJREF (obj),
- (CORBA_long) offset, (Accessibility_TEXT_BOUNDARY_TYPE) type,
+ retval = Accessibility_Text_getTextAfterOffset (CSPI_OBJREF (obj),
+ offset,
+ get_accessible_text_boundary_type (type),
&retStartOffset, &retEndOffset,
cspi_ev ());
if (!cspi_check_ev ("getTextAfterOffset"))
{
- *startOffset = *endOffset = 0;
+ *startOffset = *endOffset = -1;
+ retval = NULL;
}
else
{
*startOffset = retStartOffset;
*endOffset = retEndOffset;
}
-
return retval;
}
retval =
Accessibility_Text_getCharacterAtOffset (CSPI_OBJREF (obj),
- (CORBA_long) offset,
+ offset,
cspi_ev ());
cspi_return_val_if_ev ("getCharacterAtOffset", -1);
if (obj == NULL)
{
- *x = *y = 0;
- *width = *height = 0;
+ *x = *y = -1;
+ *width = *height = -1;
return;
}
Accessibility_Text_getCharacterExtents (CSPI_OBJREF (obj),
- (CORBA_long) offset,
+ offset,
&retX,
&retY,
&retWidth,
&retHeight,
- (CORBA_short) type, cspi_ev ());
+ type, cspi_ev ());
if (!cspi_check_ev ("getCharacterExtents"))
{
- *x = *y = 0;
- *width = *height = 0;
+ *x = *y = -1;
+ *width = *height = -1;
}
else
{
retval =
Accessibility_Text_getOffsetAtPoint (CSPI_OBJREF (obj),
- (CORBA_long) x,
- (CORBA_long) y,
- (CORBA_short) type, cspi_ev ());
+ x,
+ y,
+ type, cspi_ev ());
cspi_return_val_if_ev ("getOffsetAtPoint", -1);
}
Accessibility_Text_getSelection (CSPI_OBJREF (obj),
- (CORBA_long) selectionNum,
+ selectionNum,
&retStartOffset, &retEndOffset,
cspi_ev ());
if (!cspi_check_ev ("getSelection"))
{
- *startOffset = *endOffset = 0;
+ *startOffset = *endOffset = -1;
}
else
{
retval =
Accessibility_Text_addSelection (
- CSPI_OBJREF (obj), (CORBA_long) startOffset,
- (CORBA_long) endOffset, cspi_ev ());
+ CSPI_OBJREF (obj), startOffset,
+ endOffset, cspi_ev ());
cspi_return_val_if_ev ("addSelection", FALSE);
retval =
Accessibility_Text_removeSelection (
- CSPI_OBJREF (obj), (CORBA_long) selectionNum, cspi_ev ());
+ CSPI_OBJREF (obj), selectionNum, cspi_ev ());
cspi_return_val_if_ev ("removeSelection", FALSE);
long int startOffset,
long int endOffset)
{
+ SPIBoolean retval;
+
cspi_return_val_if_fail (obj != NULL, FALSE);
- Accessibility_Text_setSelection (CSPI_OBJREF (obj),
- (CORBA_long) selectionNum,
- (CORBA_long) startOffset,
- (CORBA_long) endOffset, cspi_ev ());
+ retval = Accessibility_Text_setSelection (CSPI_OBJREF (obj),
+ selectionNum,
+ startOffset,
+ endOffset, cspi_ev ());
cspi_return_val_if_ev ("setSelection", FALSE);
- return TRUE;
+ return retval;
}