Added partial implementation of AccessibleComponent to libspi and
authorbillh <billh@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Mon, 20 Aug 2001 13:03:22 +0000 (13:03 +0000)
committerbillh <billh@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Mon, 20 Aug 2001 13:03:22 +0000 (13:03 +0000)
C bindings.
Added interface query support to IDL and C bindings for Accessible.
Changed "ID" attribute for AccessibleApplication to a long.
Added Component query to simple-at test, demonstrating Component
interface and also interface queries.

git-svn-id: http://svn.gnome.org/svn/at-spi/trunk@41 e2bd861d-eb25-0410-b326-f6ed22b6b98c

ChangeLog
cspi/spi-impl.h
cspi/spi.h
cspi/spi_main.c

index 9cecceb..830cee9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+2001-08-20  Bill Haneman <bill.haneman@sun.com>
+       
+       * cspi/spi.h:
+       * cspi/spi.c:
+       Added (missing) interface query methods to Accessible's C binding.
+       * cspi/spi-impl.h:
+       Added GenericInterface type definition.
+       * test/simple-at.c:
+       Added query for AccessibleComponent interface to focus event handler.
+       Added printout of bounding box for focussed component.
+       * libspi/component.c:
+       Added partial implementation for AccessibleComponent to C binding.
+       * idl/Application.idl:
+       * libspi/registry.c:
+       * libspi/listener.c:
+       * libspi/application.c:
+       * libspi/application.h:
+       Changed "ID" attribute type from string to long.
+
 2001-08-19  Bill Haneman <bill.haneman@sun.com>
 
        * cspi/spi.h:
index 82779f2..6f8959f 100644 (file)
@@ -30,5 +30,6 @@ typedef CORBA_Object AccessibleTable;
 typedef CORBA_Object AccessibleText;
 typedef CORBA_Object AccessibleValue;
 typedef CORBA_Object AccessibilityRegistry;
+typedef CORBA_Object GenericInterface;
 
 #endif
index 8775249..9b9ed85 100644 (file)
@@ -426,6 +426,199 @@ Accessible_getRole (Accessible *obj);
 AccessibleStateSet *
 Accessible_getStateSet (Accessible *obj);
 
+/* Interface query methods */
+
+/**
+ * Accessible_isAction:
+ * @obj: a pointer to the #Accessible instance to query.
+ *
+ * Query whether the specified #Accessible implements #AccessibleAction.
+ * Not Yet Implemented.
+ *
+ * Returns: #TRUE if @obj implements the #AccessibleAction interface,
+ *          #FALSE otherwise.
+ **/
+boolean
+Accessible_isAction (Accessible *obj);
+
+/**
+ * Accessible_isComponent:
+ * @obj: a pointer to the #Accessible instance to query.
+ *
+ * Query whether the specified #Accessible implements #AccessibleComponent.
+ *
+ * Returns: #TRUE if @obj implements the #AccessibleComponent interface,
+ *          #FALSE otherwise.
+ **/
+boolean
+Accessible_isComponent (Accessible *obj);
+
+/**
+ * Accessible_isEditableText:
+ * @obj: a pointer to the #Accessible instance to query.
+ *
+ * Query whether the specified #Accessible implements #AccessibleEditableText.
+ * Not Yet Implemented.
+ *
+ * Returns: #TRUE if @obj implements the #AccessibleEditableText interface,
+ *          #FALSE otherwise.
+ **/
+boolean
+Accessible_isEditableText (Accessible *obj);
+
+/**
+ * Accessible_isHypertext:
+ * @obj: a pointer to the #Accessible instance to query.
+ *
+ * Query whether the specified #Accessible implements #AccessibleHypertext.
+ * Not Yet Implemented.
+ *
+ * Returns: #TRUE if @obj implements the #AccessibleHypertext interface,
+ *          #FALSE otherwise.
+ **/
+boolean
+Accessible_isHypertext (Accessible *obj);
+
+/**
+ * Accessible_isImage:
+ * @obj: a pointer to the #Accessible instance to query.
+ *
+ * Query whether the specified #Accessible implements #AccessibleImage.
+ * Not Yet Implemented.
+ *
+ * Returns: #TRUE if @obj implements the #AccessibleImage interface,
+ *          #FALSE otherwise.
+**/
+boolean
+Accessible_isImage (Accessible *obj);
+
+/**
+  * Accessible_isSelection:
+ * @obj: a pointer to the #Accessible instance to query.
+ *
+ * Query whether the specified #Accessible implements #AccessibleSelection.
+ * Not Yet Implemented.
+ *
+ * Returns: #TRUE if @obj implements the #AccessibleSelection interface,
+ *          #FALSE otherwise.
+**/
+boolean
+Accessible_isSelection (Accessible *obj);
+
+/**
+ * Accessible_isTable:
+ * @obj: a pointer to the #Accessible instance to query.
+ *
+ * Query whether the specified #Accessible implements #AccessibleTable.
+ * Not Yet Implemented.
+ *
+ * Returns: #TRUE if @obj implements the #AccessibleTable interface,
+ *          #FALSE otherwise.
+**/
+boolean
+Accessible_isTable (Accessible *obj);
+
+/**
+ * Accessible_isText:
+ * @obj: a pointer to the #Accessible instance to query.
+ *
+ * Query whether the specified #Accessible implements #AccessibleText.
+ * Not Yet Implemented.
+ *
+ * Returns: #TRUE if @obj implements the #AccessibleText interface,
+ *          #FALSE otherwise.
+**/
+boolean
+Accessible_isText (Accessible *obj);
+
+/**
+ * Accessible_getAction:
+ *
+ * Not Yet Implemented.
+ *
+ **/
+AccessibleAction *
+Accessible_getAction (Accessible *obj);
+
+/**
+ * Accessible_getComponent:
+ * @obj: a pointer to the #Accessible instance to query.
+ *
+ * Get the #AccessibleComponent interface for an #Accessible.
+ *
+ * Returns: a pointer to an #AccessibleComponent interface instance, or
+ *          NULL if @obj does not implement #AccessibleComponent.
+ **/
+AccessibleComponent *
+Accessible_getComponent (Accessible *obj);
+
+/**
+ * Accessible_getEditableText:
+ *
+ * Not Yet Implemented.
+ *
+ **/
+AccessibleEditableText *
+Accessible_getEditableText (Accessible *obj);
+
+/**
+ * Accessible_getHypertext:
+ *
+ * Not Yet Implemented.
+ *
+ **/
+AccessibleHypertext *
+Accessible_getHypertext (Accessible *obj);
+
+/**
+ * Accessible_getImage:
+ *
+ * Not Yet Implemented.
+ *
+ **/
+AccessibleImage *
+Accessible_getImage (Accessible *obj);
+
+/**
+ * Accessible_getSelection:
+ *
+ * Not Yet Implemented.
+ *
+ **/
+AccessibleSelection *
+Accessible_getSelection (Accessible *obj);
+
+/**
+ * Accessible_getTable:
+ *
+ * Not Yet Implemented.
+ *
+ **/
+AccessibleTable *
+Accessible_getTable (Accessible *obj);
+
+/**
+ * Accessible_getText:
+ *
+ * Not Yet Implemented.
+ *
+ **/
+AccessibleText *
+Accessible_getText (Accessible *obj);
+
+/**
+ * Accessible_queryInterface:
+ * @obj: a pointer to the #Accessible instance to query.
+ * @interface_name: a UTF-8 character string specifiying the requested interface.
+ *
+ * Query an #Accessible object to for a named interface.
+ *
+ * Returns: an instance of the named interface object, if it is implemented
+ *          by @obj, or NULL otherwise.
+ *
+ **/
+GenericInterface *
+Accessible_queryInterface (Accessible *obj, char *interface_name);
 
 /*
  *
@@ -587,6 +780,19 @@ AccessibleComponent_getAccessibleAtPoint (AccessibleComponent *obj,
                                           long y,
                                           AccessibleCoordType ctype);
 
+/**
+ * AccessibleComponent_getExtents:
+ * @obj: a pointer to the #AccessibleComponent to query.
+ * @x: a pointer to a #long into which the minimum x coordinate will be returned.
+ * @y: a pointer to a #long into which the minimum y coordinate will be returned.
+ * @width: a pointer to a #long into which the x extents (width) will be returned.
+ * @height: a pointer to a #long into which the y extents (height) will be returned.
+ * @ctype: the desired coordinate system into which to return the results,
+ *         (e.g. COORD_TYPE_WINDOW, COORD_TYPE_SCREEN).
+ *
+ * Get the bounding box of the specified #AccessibleComponent.
+ *
+ **/
 void
 AccessibleComponent_getExtents (AccessibleComponent *obj,
                                 long *x,
index 0ba8e69..6018169 100644 (file)
@@ -258,6 +258,37 @@ Accessible_getStateSet (Accessible *obj)
   return NULL;
 }
 
+/* Interface query methods */
+
+boolean
+Accessible_isComponent (Accessible *obj)
+{
+  Bonobo_Unknown iface =
+    Accessibility_Accessible_queryInterface (*obj,
+                                             "IDL:Accessibility/Component:1.0",
+                                             &ev);
+  return (iface != NULL) ? TRUE : FALSE;
+}
+
+AccessibleComponent *
+Accessible_getComponent (Accessible *obj)
+{
+  AccessibleComponent iface =
+    Accessibility_Accessible_queryInterface (*obj,
+                                             "IDL:Accessibility/Component:1.0",
+                                             &ev);
+  return Obj_Add (iface);
+}
+
+GenericInterface *
+Accessible_queryInterface (Accessible *obj, char *interface_name)
+{
+  GenericInterface iface;
+  iface = Accessibility_Accessible_queryInterface (*obj,
+                                                    interface_name,
+                                                    &ev);
+  return (iface != NULL) ? Obj_Add (iface) : NULL;
+}
 
 /*
  *
@@ -311,3 +342,99 @@ AccessibleApplication_resume (AccessibleApplication *obj)
   return FALSE;
 }
 
+/*
+ *
+ * AccessibleComponent function implementations
+ *
+ */
+
+int
+AccessibleComponent_ref (AccessibleComponent *obj)
+{
+  Accessibility_Component_ref (*obj, &ev);
+  return 0;
+}
+
+int
+AccessibleComponent_unref (AccessibleComponent *obj)
+{
+  Accessibility_Component_unref (*obj, &ev);
+  return 0;
+}
+
+boolean
+AccessibleComponent_contains (AccessibleComponent *obj,
+                              long x,
+                              long y,
+                              AccessibleCoordType ctype)
+{
+  return Accessibility_Component_contains (*obj,
+                                           (CORBA_long) x,
+                                           (CORBA_long) y,
+                                           ctype,
+                                           &ev);
+}
+
+Accessible *
+AccessibleComponent_getAccessibleAtPoint (AccessibleComponent *obj,
+                                          long x,
+                                          long y,
+                                          AccessibleCoordType ctype)
+{
+  Accessible child;
+  child = Accessibility_Component_getAccessibleAtPoint(*obj,
+                                                       (CORBA_long) x,
+                                                       (CORBA_long) y,
+                                                       ctype,
+                                                       &ev);
+  return (child != NULL) ? Obj_Add (child) : NULL;
+}
+
+void
+AccessibleComponent_getExtents (AccessibleComponent *obj,
+                                long *x,
+                                long *y,
+                                long *width,
+                                long *height,
+                                AccessibleCoordType ctype)
+{
+  /* TODO: remove assumption that CORBA_long == long in typecast */
+  Accessibility_Component_getExtents (*obj,
+                                     (CORBA_long *) x,
+                                     (CORBA_long *) y,
+                                     (CORBA_long *) width,
+                                     (CORBA_long *) height,
+                                     ctype,
+                                     &ev);
+}
+
+void
+AccessibleComponent_getPosition (AccessibleComponent *obj,
+                                 long *x,
+                                 long *y,
+                                 AccessibleCoordType ctype)
+{
+  Accessibility_Component_getPosition (*obj,
+                                       (CORBA_long *) x,
+                                       (CORBA_long *) y,
+                                       ctype,
+                                       &ev);
+}
+
+void
+AccessibleComponent_getSize (AccessibleComponent *obj,
+                             long *width,
+                             long *height)
+{
+  Accessibility_Component_getSize (*obj,
+                                   (CORBA_long *) width,
+                                   (CORBA_long *) height,
+                                   &ev);
+}
+
+/* Not Yet Implemented */
+void
+AccessibleComponent_grabFocus (AccessibleComponent *obj)
+{
+  ;
+}