From f455ef8e42e36f66bfe6be6788ec07acd3bb9d59 Mon Sep 17 00:00:00 2001 From: billh Date: Fri, 22 Nov 2002 14:54:59 +0000 Subject: [PATCH] Added accessor API for events. API frozen (really ;-) for GNOME 2.2. Revved to release 1.1.5. git-svn-id: http://svn.gnome.org/svn/at-spi/trunk@371 e2bd861d-eb25-0410-b326-f6ed22b6b98c --- configure.in | 4 +-- cspi/spi.h | 22 ++++++++++++ cspi/spi_event.c | 108 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 131 insertions(+), 3 deletions(-) diff --git a/configure.in b/configure.in index 6bff4cd..4a1dd4e 100644 --- a/configure.in +++ b/configure.in @@ -2,9 +2,9 @@ AC_INIT(idl/Accessibility.idl) AT_SPI_MAJOR_VERSION=1 AT_SPI_MINOR_VERSION=1 -AT_SPI_MICRO_VERSION=4 +AT_SPI_MICRO_VERSION=5 AT_SPI_INTERFACE_AGE=0 -AT_SPI_BINARY_AGE=4 +AT_SPI_BINARY_AGE=5 AT_SPI_VERSION="$AT_SPI_MAJOR_VERSION.$AT_SPI_MINOR_VERSION.$AT_SPI_MICRO_VERSION" AM_INIT_AUTOMAKE(at-spi, $AT_SPI_VERSION) AC_SUBST(AT_SPI_MAJOR_VERSION) diff --git a/cspi/spi.h b/cspi/spi.h index 7850532..a9ce4b0 100644 --- a/cspi/spi.h +++ b/cspi/spi.h @@ -801,6 +801,28 @@ SPIBoolean AccessibleValue_setCurrentValue (AccessibleValue *obj, char* AccessibleTextChangedEvent_getChangeString (const AccessibleEvent *e); Accessible * AccessibleChildChangedEvent_getChildAccessible (const AccessibleEvent *e); +Accessible * AccessibleParentChangedEvent_getParentAccessible (const AccessibleEvent *e); + +char* AccessibleTextSelectionChangedEvent_getSelectionString (const AccessibleEvent *e); + +char* AccessibleWindowEvent_getTitleString (const AccessibleEvent *e); + +Accessible * AccessibleActiveDescendantChangedEvent_getActiveDescendant (const AccessibleEvent *e); + +Accessible * AccessibleTableSummaryChangedEvent_getSummaryAccessible (const AccessibleEvent *e); + +Accessible * AccessibleTableHeaderChangedEvent_getHeaderAccessible (const AccessibleEvent *e); + +char * AccessibleTableCaptionChangedEvent_getCaptionString (const AccessibleEvent *e); + +char * AccessibleTableRowDescriptionChangedEvent_getDescriptionString (const AccessibleEvent *e); + +char * AccessibleTableColumnDescriptionChangedEvent_getDescriptionString (const AccessibleEvent *e); + +char * AccessibleDescriptionChangedEvent_getDescriptionString (const AccessibleEvent *e); + +char * AccessibleNameChangedEvent_getNameString (const AccessibleEvent *e); + /* Misc methods */ void SPI_freeString (char *s); diff --git a/cspi/spi_event.c b/cspi/spi_event.c index f8a93be..a819941 100644 --- a/cspi/spi_event.c +++ b/cspi/spi_event.c @@ -361,7 +361,6 @@ cspi_internal_event_get_object (const InternalEvent *e) return NULL; } - /** * AccessibleTextChangedEvent_getChangeString: * @event: a pointer to the #AccessibleEvent being queried. @@ -381,6 +380,41 @@ AccessibleTextChangedEvent_getChangeString (const AccessibleEvent *e) } /** + * AccessibleTextSelectionChangedEvent_getSelectionString: + * @event: a pointer to the #AccessibleEvent being queried. + * + * Queries an #AccessibleEvent of type "object:text-selection-changed", + * returning the newly added, removed, or modified selection string. + * + * Returns: a UTF-8 text string indicating the recently changed selection. + **/ +char * +AccessibleTextSelectionChangedEvent_getSelectionString (const AccessibleEvent *e) +{ + const InternalEvent *foo = (InternalEvent *) e; + /* TODO: check the event type? expensive... */ + return cspi_internal_event_get_text (foo); +} + +/** + * AccessibleWindowEvent_getTitleString: + * @event: a pointer to the #AccessibleEvent being queried. + * + * Queries an #AccessibleEvent of type "window:", + * returning the window title. + * + * Returns: a UTF-8 text string representing the title of the + * recently changed window. + **/ +char * +AccessibleWindowEvent_getTitleString (const AccessibleEvent *e) +{ + const InternalEvent *foo = (InternalEvent *) e; + /* TODO: check the event type? expensive... */ + return cspi_internal_event_get_text (foo); +} + +/** * AccessibleChildChangedEvent_getChildAccessible: * @event: a pointer to the #AccessibleEvent being queried. * @@ -401,3 +435,75 @@ AccessibleChildChangedEvent_getChildAccessible (const AccessibleEvent *e) return (Accessible *) cspi_internal_event_get_object (foo); } +/** + * AccessibleParentChangedEvent_getParentAccessible: + * @event: a pointer to the #AccessibleEvent being queried. + * + * Queries an #AccessibleEvent of type "object:parent_changed" + * to get a reference to the changed #Accessible. + * Note that context #Accessibles are not guaranteed to outlive + * event delivery, in which case this call may return %NULL + * even if the object existed at the time of dispatch. + * + * Returns: an #Accessible pointer representing the new parent object. + **/ +Accessible * +AccessibleParentChangedEvent_getParentAccessible (const AccessibleEvent *e) +{ + const InternalEvent *foo = (InternalEvent *) e; + return (Accessible *) cspi_internal_event_get_object (foo); +} + +/** NEED TO DOCUMENT THESE **/ + +Accessible * +AccessibleActiveDescendantChangedEvent_getActiveDescendant (const AccessibleEvent *e) +{ + const InternalEvent *foo = (InternalEvent *) e; + return (Accessible *) cspi_internal_event_get_object (foo); +} + +Accessible * +AccessibleTableSummaryChangedEvent_getSummaryAccessible (const AccessibleEvent *e) +{ + const InternalEvent *foo = (InternalEvent *) e; + return (Accessible *) cspi_internal_event_get_object (foo); +} + +Accessible * +AccessibleTableHeaderChangedEvent_getHeaderAccessible (const AccessibleEvent *e) +{ + return NULL; +} + + +char * +AccessibleTableCaptionChangedEvent_getCaptionString (const AccessibleEvent *e) +{ + return NULL; +} + +char * +AccessibleTableRowDescriptionChangedEvent_getDescriptionString (const AccessibleEvent *e) +{ + return NULL; +} + +char * +AccessibleTableColumnDescriptionChangedEvent_getDescriptionString (const AccessibleEvent *e) +{ + return NULL; +} + +char * +AccessibleDescriptionChangedEvent_getDescriptionString (const AccessibleEvent *e) +{ + return NULL; +} + +char * +AccessibleNameChangedEvent_getNameString (const AccessibleEvent *e) +{ + return NULL; +} + -- 2.7.4