2007-04-02 Ariel Rios <ariel@gnu.org>
authorhaip <haip@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Mon, 2 Apr 2007 15:59:36 +0000 (15:59 +0000)
committerhaip <haip@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Mon, 2 Apr 2007 15:59:36 +0000 (15:59 +0000)
        Implement the Matchrule interface required for Collection.
        See bug #405774.

        * cspi/Makefile.am:
        * cspi/spi-impl.h:
        * cspi/spi.h:
        * cspi/spi_accessible.c: (Accessible_isCollection),
        (Accessible_isMatchRule), (Accessible_getCollection),
        (Accessible_getMatchRule):
        * cspi/spi_collection.c:  new file.
        * cspi/spi_matchrule.c:  new file.
        * idl/Accessibility.idl:
        * idl/Accessibility_Collection.idl: new file.
        * idl/Makefile.am:
        * libspi/Makefile.am:
        * libspi/collection.c: new file.
        * libspi/collection.h: new file.
        * libspi/libspi.h:
        * libspi/matchrule.c: new file.
        * libspi/matchrule.h: new file.

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

16 files changed:
ChangeLog
cspi/Makefile.am
cspi/spi-impl.h
cspi/spi.h
cspi/spi_accessible.c
cspi/spi_collection.c [new file with mode: 0644]
cspi/spi_matchrule.c [new file with mode: 0644]
idl/Accessibility.idl
idl/Accessibility_Collection.idl [new file with mode: 0644]
idl/Makefile.am
libspi/Makefile.am
libspi/collection.c [new file with mode: 0644]
libspi/collection.h [new file with mode: 0644]
libspi/libspi.h
libspi/matchrule.c [new file with mode: 0644]
libspi/matchrule.h [new file with mode: 0644]

index ca1002d..a8e2207 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,26 @@
+2007-04-02  Ariel Rios  <ariel@gnu.org>
+
+       Implement the Matchrule interface required for Collection.
+       See bug #405774.
+
+       * cspi/Makefile.am:
+       * cspi/spi-impl.h:
+       * cspi/spi.h:
+       * cspi/spi_accessible.c: (Accessible_isCollection),
+       (Accessible_isMatchRule), (Accessible_getCollection),
+       (Accessible_getMatchRule):
+       * cspi/spi_collection.c:  new file.
+       * cspi/spi_matchrule.c:  new file.
+       * idl/Accessibility.idl:
+       * idl/Accessibility_Collection.idl: new file.
+       * idl/Makefile.am:
+       * libspi/Makefile.am:
+       * libspi/collection.c: new file.
+       * libspi/collection.h: new file.
+       * libspi/libspi.h:
+       * libspi/matchrule.c: new file.
+       * libspi/matchrule.h: new file.
+
 2007-03-29  Ariel Rios  <ariel@gnu.org>
 
        * cspi/spi.h (AccessibleRoleSet): bug #407600. Define RoleSet structure.
index df7c5b5..8f27d02 100644 (file)
@@ -29,6 +29,7 @@ libcspi_la_SOURCES =          \
        spi_accessible.c        \
        spi_action.c            \
        spi_application.c       \
+       spi_collection.c        \
        spi_component.c         \
        spi_document.c          \
        spi_editabletext.c      \
@@ -37,6 +38,7 @@ libcspi_la_SOURCES =          \
        spi_hypertext.c         \
        spi_image.c             \
        spi_main.c              \
+       spi_matchrule.c         \
        spi-private.h           \
        spi_registry.c          \
        spi_selection.c         \
index 96621d5..66e8fd8 100644 (file)
@@ -36,12 +36,14 @@ typedef AccessibleUnknown  Accessible;
 
 typedef Accessible AccessibleAction;
 typedef Accessible AccessibleApplication;
+typedef Accessible AccessibleCollection;
 typedef Accessible AccessibleComponent;
 typedef Accessible AccessibleDocument;
 typedef Accessible AccessibleEditableText;
 typedef Accessible AccessibleHyperlink;
 typedef Accessible AccessibleHypertext;
 typedef Accessible AccessibleImage;
+typedef Accessible AccessibleMatchRule;
 typedef Accessible AccessibleRelation;
 typedef Accessible AccessibleSelection;
 typedef Accessible AccessibleStreamableContent;
index 8849017..ba2d319 100644 (file)
@@ -43,6 +43,29 @@ extern "C" {
 #endif
 
 /**
+ *AccessibleCollectionMatchType:
+ *
+ *@SPI_COLLECTION_MATCH_INVALID        
+ *@SPI_COLLECTION_MATCH_ALL    TRUE if all of the criteria are met
+ *@SPI_COLLECTION_MATCH_ANY    TRUE if any of the criteria are met
+ *@SPI_COLLECTION_MATCH_NONE   TRUE if none of the criteria are met
+ *@SPI_COLLECTION_MATCH_EMPTY  Same as MATCH_ALL if the criteria is non-empty; 
+ * for empty criteria this rule requires returned value to also have empty set.
+ *@SPI_COLLECTION_MATCH_LAST_DEFINED   
+ *
+ **/
+typedef enum
+{
+     SPI_COLLECTION_MATCH_INVALID,
+     SPI_COLLECTION_MATCH_ALL,
+     SPI_COLLECTION_MATCH_ANY,
+     SPI_COLLECTION_MATCH_NONE,
+     SPI_COLLECTION_MATCH_EMPTY,
+     SPI_COLLECTION_MATCH_LAST_DEFINED
+}AccessibleCollectionMatchType;
+
+
+/**
  *AccessibleTextBoundaryType:
  *@SPI_TEXT_BOUNDARY_CHAR: Delimiter is the current character's bounds.
  *@SPI_TEXT_BOUNDARY_CURSOR_POS: Delimiter is the current text caret position.
@@ -408,6 +431,7 @@ typedef struct _AccessibleRoleSet
 } AccessibleRoleSet;
 
 
+
 /* Basic SPI initialization and event loop function prototypes */
 
 int              SPI_init         (void);
@@ -531,11 +555,13 @@ AccessibleApplication *Accessible_getHostApplication (Accessible *obj);
 
 SPIBoolean Accessible_isAction            (Accessible *obj);
 SPIBoolean Accessible_isApplication       (Accessible *obj);
+SPIBoolean Accessible_isCollection        (Accessible *obj);
 SPIBoolean Accessible_isComponent         (Accessible *obj);
 SPIBoolean Accessible_isDocument          (Accessible *obj);
 SPIBoolean Accessible_isEditableText      (Accessible *obj);
 SPIBoolean Accessible_isHypertext         (Accessible *obj);
 SPIBoolean Accessible_isImage             (Accessible *obj);
+SPIBoolean Accessible_isMatchRule         (Accessible *obj);
 SPIBoolean Accessible_isSelection         (Accessible *obj);
 SPIBoolean Accessible_isStreamableContent (Accessible *obj);
 SPIBoolean Accessible_isTable             (Accessible *obj);
@@ -544,11 +570,13 @@ SPIBoolean Accessible_isValue             (Accessible *obj);
 
 AccessibleAction *            Accessible_getAction            (Accessible *obj);
 AccessibleApplication *       Accessible_getApplication       (Accessible *obj);
+AccessibleCollection *        Accessible_getCollection        (Accessible *obj);
 AccessibleComponent *         Accessible_getComponent         (Accessible *obj);
 AccessibleDocument *          Accessible_getDocument          (Accessible *obj);
 AccessibleEditableText *      Accessible_getEditableText      (Accessible *obj);
 AccessibleHypertext *         Accessible_getHypertext         (Accessible *obj);
 AccessibleImage *             Accessible_getImage             (Accessible *obj);
+AccessibleMatchRule *         Accessible_getMatchRule         (Accessible *obj);
 AccessibleSelection *         Accessible_getSelection         (Accessible *obj);
 AccessibleStreamableContent * Accessible_getStreamableContent (Accessible *obj);
 AccessibleTable *             Accessible_getTable             (Accessible *obj);
@@ -582,6 +610,23 @@ char      *AccessibleApplication_getLocale      (AccessibleApplication *obj, int
 SPIBoolean AccessibleApplication_pause          (AccessibleApplication *obj);
 SPIBoolean AccessibleApplication_resume         (AccessibleApplication *obj);
 
+/* AccessibleCollection function prototypes */
+void       AccessibleCollection_ref (AccessibleCollection *obj);
+void       AccessibleCollection_unref (AccessibleCollection *obj);
+AccessibleMatchRule *
+AccessibleCollection_createMatchRule (AccessibleCollection *obj,
+                                     AccessibleStateSet *states,
+                                     AccessibleCollectionMatchType statematchtype,
+                                     AccessibleAttributeSet *attributes,
+                                     AccessibleCollectionMatchType attributematchtype,
+                                     AccessibleRoleSet *roles,
+                                     AccessibleCollectionMatchType rolematchtype,
+                                     char *interfaces,
+                                     AccessibleCollectionMatchType interfacematchtype,
+                                     long int invert);
+void
+AccessibleCollection_freeMatchRule (AccessibleCollection *obj,
+                                   AccessibleMatchRule  *matchrule);
 /* AccessibleComponent function prototypes */
 
 void        AccessibleComponent_ref         (AccessibleComponent *obj);
@@ -756,6 +801,14 @@ AccessibleImage_getImageLocale  (AccessibleImage *obj);
 
 /*
  *
+ * AccessibleMatchRule function prototypes
+ *
+ */
+void       AccessibleMatchRule_ref (AccessibleMatchRule *obj);
+void       AccessibleMatchRule_unref (AccessibleMatchRule *obj);
+
+/*
+ *
  * AccessibleRelation function prototypes
  *
  */
index 2710ef8..c2acdfe 100644 (file)
@@ -690,6 +690,21 @@ Accessible_isApplication (Accessible *obj)
                              "IDL:Accessibility/Application:1.0");
 }
 
+/**                      
+ * Accessible_isCollection:                                                                                                                                                                          * @obj: a pointer to the #Accessible instance to query.                                                                                                                                          
+ *                          
+ * Query whether the specified #Accessible implements #AccessibleCollection.    
+ * Returns: #TRUE if @obj implements the #AccessibleCollection interface,                                                                                                               
+ *          #FALSE otherwise.
+ **/
+
+SPIBoolean
+Accessible_isCollection (Accessible *obj)
+{
+     return cspi_accessible_is_a (obj,
+                                 "IDL:Accessibility/Collection:1.0");
+}
+
 /**
  * Accessible_isComponent:
  * @obj: a pointer to the #Accessible instance to query.
@@ -737,6 +752,22 @@ Accessible_isEditableText (Accessible *obj)
   return cspi_accessible_is_a (obj,
                              "IDL:Accessibility/EditableText:1.0");
 }
+                                                                                                                                                                        
+/**
+ * Accessible_isMatchRule:
+ * @obj: a pointer to the #Accessible instance to query.
+ *
+ * Query whether the specified #Accessible implements #AccessibleMatchRule.
+ *
+ * Returns: #TRUE if @obj implements the #AccessibleMatchRule interface,
+ *          #FALSE otherwise.
+ **/
+SPIBoolean
+Accessible_isMatchRule (Accessible *obj)
+{
+     return cspi_accessible_is_a (obj, 
+                                 "IDL:Accessibility/MatchRule:1.0");
+}
 
 /**
  * Accessible_isHypertext:
@@ -883,6 +914,23 @@ Accessible_getAction (Accessible *obj)
          obj, "IDL:Accessibility/Action:1.0");
 }
 
+
+/**
+ * Accessible_getCollection:
+ * @obj: a pointer to the #Accessible instance to query.
+ *
+ * Get the #AccessibleCollection interface for an #Accessible.
+ *
+ * Returns: a pointer to an #AccessibleCollection interface instance, or
+ *          NULL if @obj does not implement #AccessibleCollection.
+ **/
+AccessibleCollection *
+Accessible_getCollection (Accessible *obj)
+{
+  return (AccessibleCollection *) Accessible_queryInterface (
+         obj, "IDL:Accessibility/Collection:1.0");
+}
+
 /**
  * Accessible_getComponent:
  * @obj: a pointer to the #Accessible instance to query.
@@ -966,7 +1014,21 @@ Accessible_getImage (Accessible *obj)
          obj, "IDL:Accessibility/Image:1.0");
 }
 
-
+/**
+ * Accessible_getMatchRule:
+ * @obj: a pointer to the #Accessible instance to query.
+ *
+ * Get the #AccessibleMatchRule interface for an #Accessible.
+ *
+ * Returns: a pointer to an #AccessibleMatchRule interface instance, or
+ *          NULL if @obj does not implement #AccessibleMatchRule.
+ **/
+AccessibleMatchRule *
+Accessible_getMatchRule (Accessible *obj)
+{
+  return (AccessibleMatchRule *) Accessible_queryInterface (
+         obj, "IDL:Accessibility/MatchRule:1.0");
+}
 
 /**
  * Accessible_getSelection:
diff --git a/cspi/spi_collection.c b/cspi/spi_collection.c
new file mode 100644 (file)
index 0000000..9fbcdb3
--- /dev/null
@@ -0,0 +1,145 @@
+/*
+ * AT-SPI - Assistive Technology Service Provider Interface
+ * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
+ *
+ * Copyright 2007 IBM Corp.
+ *
+ * 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 <cspi/spi.h>
+#include <cspi/spi-private.h>
+
+/**
+ * AccessibleCollection_ref:
+ * @obj: a pointer to the #AccessibleCollection object on which to operate.
+ *
+ * Increment the reference count for an #AccessibleCollection object.
+ **/
+
+void
+AccessibleCollection_ref (AccessibleCollection *obj)
+{
+  cspi_object_ref (obj);
+}
+
+/**
+ * AccessibleCollection_unref:
+ * @obj: a pointer to the #Accessible object on which to operate.
+ *
+ * Decrement the reference count for an #AccessibleCollection object.
+ **/
+
+void
+AccessibleCollection_unref (AccessibleCollection *obj)
+{
+  cspi_object_unref (obj);
+}
+
+/**
+ * AccessibleCollection_createMatchRule:
+ * @obj: a pointer to the #Accessible object on which to operate.
+ * @states: An #AccessibleStateSet whose states are to be compared with the objects in the collection.
+ * @statematchtype A MatchType which determines the match requirements for the 'states' criterion.
+ * @attributes: An #AccessibleAttributeSet of attributes which should present 
+ * in members of a matching set. 
+ * @attributematchtype: A MatchType which determines the match requirements for the 'attributes' criterion.
+ * @roles: An #AcceessibleRoleSet specifying the #AccessibleRole values which are to be considered among the match criteria.
+ * @rolematchtype: A MatchType which determines the match requirements for the 'roles' criterion.
+ * @interfaces: A string which represents one or more IDL interface definitions which should be implemented by matching objects.
+ * @interfacematchtype: A MatchType which determines the match requirements for the 'interfaces' criterion.
+ * @invert: If TRUE, the resulting MatchRule will return objects which do NOT match the specified criteria, 
+ * instead of those which do; i.e. this parameter "inverts" the sense of the resulting query.
+ *
+ * Returns an #AccesibleMatchRule object which encapsulates the specified criteria.
+ **/
+
+AccessibleMatchRule *
+AccessibleCollection_createMatchRule (AccessibleCollection *obj,
+                                     AccessibleStateSet *states,
+                                     AccessibleCollectionMatchType statematchtype,
+                                     AccessibleAttributeSet *attributes,
+                                     AccessibleCollectionMatchType attributematchtype,
+                                     AccessibleRoleSet *roles,
+                                     AccessibleCollectionMatchType rolematchtype,
+                                     char *interfaces,
+                                     AccessibleCollectionMatchType interfacematchtype,
+                                     long int invert)
+{
+
+     Accessibility_AttributeSet *attributeset;
+     Accessibility_RoleSet *roleset;
+     Accessibility_MatchRule retval;
+     int i;
+
+     cspi_return_val_if_fail (obj != NULL, NULL);
+
+     attributeset = CORBA_sequence_CORBA_string__alloc ();
+     attributeset->_length = attributes->len;
+     attributeset->_buffer = CORBA_sequence_CORBA_string_allocbuf (attributeset->_length);
+
+     for (i = 0; i < attributeset->_length; i++)
+         attributeset->_buffer [i] =  CORBA_string_dup (attributes->attributes [i]);
+
+     CORBA_sequence_set_release (attributeset, TRUE);
+
+     roleset =  Accessibility_RoleSet__alloc ();
+     roleset->_length = roles->len;
+     roleset->_buffer =  Accessibility_RoleSet_allocbuf (roleset->_length);
+                                       
+     for (i = 0; i < roleset->_length; i++)
+           roleset->_buffer [i] = roles->roles [i];
+
+     retval =  Accessibility_Collection_createMatchRule (CSPI_OBJREF (obj),
+                                                        states,
+                                                        statematchtype,
+                                                        attributeset, 
+                                                        attributematchtype,
+                                                        roleset, 
+                                                        rolematchtype,
+                                                        interfaces,
+                                                        interfacematchtype,
+                                                        invert,
+                                                        cspi_ev ());
+
+     cspi_return_val_if_ev ("createMatchRule", NULL);
+
+     return cspi_object_add (retval);
+    
+
+}
+
+/**
+ * AccessibleCollection_freeMatchRule:
+ * @obj: a pointer to the #Accessible object on which to operate.
+ * @matchrule: a pointer to the #AccessibleMatchRule to free
+ *
+ * Frees the resources associated with the specified #AccessibleMatchRule
+ **/
+
+void
+AccessibleCollection_freeMatchRule (AccessibleCollection *obj,
+                                   AccessibleMatchRule  *matchrule)
+{
+
+     cspi_return_if_fail (obj != NULL);
+     
+     Accessibility_Collection_freeMatchRule (CSPI_OBJREF (obj),
+                                            CSPI_OBJREF (matchrule),
+                                            cspi_ev ());
+
+      cspi_return_if_ev ("freeMatchRule");
+}
diff --git a/cspi/spi_matchrule.c b/cspi/spi_matchrule.c
new file mode 100644 (file)
index 0000000..199ea7f
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * AT-SPI - Assistive Technology Service Provider Interface
+ * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap) 
+ *
+ * Copyright 2007 IBM Corp.
+ *
+ * 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 <cspi/spi.h>
+#include <cspi/spi-private.h>
+
+/**
+ * AccessibleMatchrule_ref:
+ * @obj: a pointer to the #AccessibleMatchrule object on which to operate.
+ *
+ * Increment the reference count for an #AccessibleMatchrule object.
+ **/
+void
+AccessibleMatchRule_ref (AccessibleMatchRule *obj)
+{
+  cspi_object_ref (obj);
+}
+
+/**
+ * AccessibleMatchrule_unref:
+ * @obj: a pointer to the #AccessibleMatchrule object on which to operate.
+ *
+ * Decrement the reference count for an #AccessibleMatchrule object.
+ **/
+
+void
+AccessibleMatchRule_unref (AccessibleMatchRule *obj)
+{
+  cspi_object_unref (obj);
+}
index c5be877..2b9b08e 100644 (file)
  */
 #include <Accessibility_Accessible.idl>
 #include <Accessibility_Action.idl>
+#include <Accessibility_Collection.idl>
 #include <Accessibility_Component.idl>
 #include <Accessibility_Document.idl>
 #include <Accessibility_Hyperlink.idl>
diff --git a/idl/Accessibility_Collection.idl b/idl/Accessibility_Collection.idl
new file mode 100644 (file)
index 0000000..738755e
--- /dev/null
@@ -0,0 +1,104 @@
+ /* 
+  * AT-SPI - Assistive Technology Service Provider Interface 
+  * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
+  *
+  * Copyright 2005 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 __ACCESSIBILITY_COLLECTION_DEFINED__
+#define __ACCESSIBILITY_COLLECTION_DEFINED__
+module Accessibility {
+
+struct AccessibleSetEntry {
+         Accessible accessible;
+         string     name;
+         Role       role;
+};
+
+typedef sequence<AccessibleSetEntry> AccessibleSet;
+     interface MatchRule {
+     };
+
+
+     interface Collection : Bonobo::Unknown {
+       enum SortOrder {
+           SORT_ORDER_INVALID,
+           SORT_ORDER_CANONICAL, 
+           SORT_ORDER_FLOW, 
+           SORT_ORDER_TAB, 
+           SORT_ORDER_REVERSE_CANONICAL, 
+           SORT_ORDER_REVERSE_FLOW, 
+           SORT_ORDER_REVERSE_TAB, 
+           SORT_ORDER_LAST_DEFINED
+       };
+   
+       enum MatchType {
+           MATCH_INVALID, 
+           MATCH_ALL, 
+           MATCH_ANY, 
+          MATCH_NONE,
+          MATCH_EMPTY,
+           MATCH_LAST_DEFINED
+          };
+
+
+       boolean isAncestorOf (in Accessible object); 
+  
+       MatchRule        createMatchRule (in StateSet states,
+                                         in MatchType statematchtype,
+                                          in AttributeSet attributes,
+                                          in MatchType attributematchtype,
+                                          in RoleSet roles,
+                                         in MatchType rolematchtype,
+                                          in string interfaces,
+                                          in MatchType interfacematchtype,
+                                          in boolean invert);
+
+       void             freeMatchRule (in MatchRule rule);
+
+       AccessibleSet getChildren (in MatchRule rule,
+                                   in SortOrder sortby,
+                                  in boolean recurse,
+                                   inout long count); /* inOut not accepted */
+
+       AccessibleSet getPreviousChildren (in Accessible current_object,
+                                           in MatchRule rule, 
+                                           in SortOrder sortby, 
+                                           in boolean recurse,
+                                           inout long count);
+
+
+        AccessibleSet getNextChildren (in Accessible current_object,
+                                      in MatchRule rule, 
+                                       in SortOrder sortby, 
+                                       in boolean recurse,
+                                       inout long count);
+
+        Accessible getActiveDescendant ();
+        
+       void unImplemented ();
+       void unImplemented2 ();
+        void unImplemented3 ();
+        void unImplemented4 ();        
+   };
+};
+
+#endif
index 261f4e6..e7fa5ce 100644 (file)
@@ -5,6 +5,7 @@ idl_DATA =                                      \
        Accessibility_Accessible.idl            \
        Accessibility_Action.idl                \
        Accessibility_Application.idl           \
+       Accessibility_Collection.idl            \
        Accessibility_Component.idl             \
        Accessibility_Desktop.idl               \
        Accessibility_Document.idl              \
index 55e9f58..ea5459d 100644 (file)
@@ -20,6 +20,7 @@ libspiinclude_HEADERS =               \
        action.h                \
        application.h           \
        base.h                  \
+       collection.h            \
        component.h             \
        document.h              \
        editabletext.h          \
@@ -31,6 +32,7 @@ libspiinclude_HEADERS =               \
        keymasks.h              \
        libspi.h                \
        listener.h              \
+       matchrule.h             \
        relation.h              \
        remoteobject.h          \
        selection.h             \
@@ -47,6 +49,7 @@ IDL_DEPS = \
        $(top_srcdir)/idl/Accessibility_Accessible.idl          \
        $(top_srcdir)/idl/Accessibility_Action.idl              \
        $(top_srcdir)/idl/Accessibility_Application.idl         \
+       $(top_srcdir)/idl/Accessibility_Collection.idl          \
        $(top_srcdir)/idl/Accessibility_Component.idl           \
        $(top_srcdir)/idl/Accessibility_Desktop.idl             \
        $(top_srcdir)/idl/Accessibility_EditableText.idl        \
@@ -74,6 +77,7 @@ libspi_la_SOURCES =           \
        action.c                \
        application.c           \
        base.c                  \
+       collection.c            \
        component.c             \
        document.c              \
        editabletext.c          \
@@ -81,6 +85,7 @@ libspi_la_SOURCES =           \
        hypertext.c             \
        image.c                 \
        devicelistener.c        \
+       matchrule.c             \
        relation.c              \
        remoteobject.c          \
        selection.c             \
diff --git a/libspi/collection.c b/libspi/collection.c
new file mode 100644 (file)
index 0000000..3123890
--- /dev/null
@@ -0,0 +1,187 @@
+/*
+ * AT-SPI - Assistive Technology Service Provider Interface
+ * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
+ *
+ * Copyright 2007 IBM Corp.
+ *
+ * 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.
+ */
+
+/* collection.c: implements the Collection interface */
+
+#include <config.h>
+#include <stdio.h>
+#include <bonobo/bonobo-exception.h>
+#include <libspi/collection.h>
+#include <libspi/matchrule.h> 
+#include <libspi/spi-private.h>
+
+typedef struct _MatchRulePrivate MatchRulePrivate;
+
+struct _MatchRulePrivate {
+
+     Accessibility_StateSet states;
+     Accessibility_Collection_MatchType statematchtype;
+     Accessibility_AttributeSet  *attributes;
+     Accessibility_Collection_MatchType attributematchtype;
+     Accessibility_RoleSet *roles;
+     Accessibility_Collection_MatchType rolematchtype;
+     CORBA_char *interfaces;
+     Accessibility_Collection_MatchType interfacematchtype;
+     gboolean invert;
+
+};
+
+#define MATCH_RULE_PRIVATE(o)\
+     G_TYPE_INSTANCE_GET_PRIVATE((o), SPI_MATCHRULE_TYPE, MatchRulePrivate)
+
+
+SpiCollection *
+spi_collection_interface_new ()
+{
+
+     SpiCollection *new_collection = g_object_new (SPI_COLLECTION_TYPE, NULL);
+
+     spi_base_construct_default (SPI_BASE (new_collection));
+
+     return new_collection;
+
+}
+
+/*
+static SpiCollection *
+get_collection_from_servant (PortableServer_Servant servant)
+{
+     SpiBase *object = SPI_BASE (bonobo_object_from_servant (servant));
+
+     g_return_val_if_fail (object, NULL);
+     
+     return SPI_COLLECTION (object->gobj);
+                               
+}
+*/
+
+static Accessibility_MatchRule 
+impl_createMatchRule (PortableServer_Servant servant,
+                     const Accessibility_StateSet states,
+                     const Accessibility_Collection_MatchType statematchtype,
+                     const Accessibility_AttributeSet *attributes,
+                     const Accessibility_Collection_MatchType attributematchtype,
+                     const Accessibility_RoleSet *roles,
+                     const Accessibility_Collection_MatchType rolematchtype,
+                     const CORBA_char *interfaces,
+                     const Accessibility_Collection_MatchType interfacematchtype,
+                     const CORBA_boolean invert,
+                     CORBA_Environment *ev){
+
+     Accessibility_MatchRule  retval = NULL;
+
+     SpiMatchrule *matchrule = spi_matchrule_interface_new ();
+     MatchRulePrivate *mrp   = MATCH_RULE_PRIVATE (matchrule);
+     int i;
+
+     mrp->states  = states;
+     mrp->statematchtype = statematchtype;
+
+/* attributes */
+
+     mrp->attributes = CORBA_sequence_CORBA_string__alloc ();
+     mrp->attributes->_maximum = attributes->_maximum;
+     mrp->attributes->_length = attributes->_length;
+     mrp->attributes->_buffer = CORBA_sequence_CORBA_string_allocbuf (attributes->_length);
+
+     for (i = 0; i < mrp->attributes->_length; i++)
+         mrp->attributes->_buffer [i]= CORBA_string_dup (attributes->_buffer [i]);
+    
+     CORBA_sequence_set_release (mrp->attributes, TRUE);
+     mrp->attributematchtype = attributematchtype;
+
+/* roles */
+
+     mrp->roles = Accessibility_RoleSet__alloc ();
+     mrp->roles->_maximum = roles->_maximum;
+     mrp->roles->_length = roles->_length;
+     mrp->roles->_buffer = Accessibility_RoleSet_allocbuf (roles->_length);
+
+     for (i = 0; i < roles->_length; i++)
+         mrp->roles->_buffer [i] = roles->_buffer [i];
+     
+     CORBA_sequence_set_release (mrp->roles, TRUE);
+     mrp->rolematchtype = rolematchtype;
+
+/* interfaces */
+     
+     mrp->interfaces = CORBA_string_dup (interfaces);
+     mrp->interfacematchtype = interfacematchtype;
+
+     mrp->invert = invert;
+     
+     retval = CORBA_Object_duplicate (BONOBO_OBJREF (matchrule), ev);
+
+     return retval;
+
+}
+
+static void impl_freeMatchRule (PortableServer_Servant servant,
+                               Accessibility_MatchRule matchrule,     
+                               CORBA_Environment *ev){
+
+     SpiBase *object = SPI_BASE (bonobo_object_from_servant (servant));
+     SpiMatchrule *spimatchrule;
+
+     MatchRulePrivate *mrp;  
+
+     spimatchrule = SPI_MATCHRULE (object->gobj);
+     mrp =  MATCH_RULE_PRIVATE (spimatchrule);;
+     
+     CORBA_free (mrp->attributes);
+     CORBA_free (mrp->roles);
+     CORBA_free (mrp->interfaces);     
+     
+     g_free (spimatchrule);
+
+}
+static void
+spi_collection_class_init (SpiCollectionClass *klass)
+{
+
+    POA_Accessibility_Collection__epv *epv  = &klass->epv;
+
+    /*    epv->isAncestorOf = impl_isAncestorOf; */
+    
+   epv->createMatchRule =  impl_createMatchRule;
+   epv->freeMatchRule = impl_freeMatchRule;
+   
+   /*
+     epv->getChildren = impl_getChildren;
+     epv->getPreviousChildren = impl_getPreviousChildren;
+     epv->getNextChildren = impl_getNextChildren;
+     epv->getActiveDescendant = impl_getActiveDescendant;
+   */
+
+   g_type_class_add_private (klass, sizeof (MatchRulePrivate));
+}
+
+static void
+spi_collection_init (SpiCollection *collection)
+{
+}
+
+BONOBO_TYPE_FUNC_FULL (SpiCollection,
+                      Accessibility_Collection,
+                      SPI_TYPE_BASE,
+                      spi_collection)
+
diff --git a/libspi/collection.h b/libspi/collection.h
new file mode 100644 (file)
index 0000000..d4b6393
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * AT-SPI - Assistive Technology Service Provider Interface
+ * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
+ *
+ * Copyright 2007 IBM Corp.
+ *
+ * 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_COLLECTION_H_
+#define SPI_COLLECTION_H_
+
+#include <libspi/base.h>
+
+G_BEGIN_DECLS
+
+#define SPI_COLLECTION_TYPE         (spi_collection_get_type ())
+#define SPI_COLLECTION(obj)         (G_TYPE_CHECK_INSTANCE_CAST ((obj), SPI_COLLECTION_TYPE, SpiCollection))
+#define SPI_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), SPI_COLLECTION_TYPE, SpiCollectionClass))
+#define IS_COLLECTION(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj, SPI_COLLECTION_TYPE))
+#define IS_COLLECTION_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), SPI_COLLECTION_TYPE))
+
+typedef struct _SpiCollection SpiCollection;
+typedef struct _SpiCollectionClass SpiCollectionClass;
+
+struct _SpiCollection {
+  SpiBase parent;
+
+
+};
+
+struct _SpiCollectionClass {
+  SpiBaseClass parent_class;
+  POA_Accessibility_Collection__epv epv;
+};
+
+GType        spi_collection_get_type       (void);
+
+void         spi_collection_construct      (SpiCollection *collection);
+                                           
+SpiCollection *spi_collection_interface_new  (void);
+
+G_END_DECLS
+
+#endif /* SPI_COLLECTION_H_ */
+
+
index cc34cd7..55732e8 100644 (file)
@@ -28,6 +28,7 @@
 #include <libspi/accessible.h>
 #include <libspi/action.h>
 #include <libspi/application.h>
+#include <libspi/collection.h>
 #include <libspi/component.h>
 #include <libspi/document.h>
 #include <libspi/editabletext.h>
diff --git a/libspi/matchrule.c b/libspi/matchrule.c
new file mode 100644 (file)
index 0000000..c62b8bd
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * AT-SPI - Assistive Technology Service Provider Interface
+ * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
+ *
+ * Copyright 2007 IBM Corp.
+ *
+ * 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.
+ */
+
+/* matchrule.c: implements the Matchrule interface */
+
+
+#include <config.h>
+#include <stdio.h>
+#include <bonobo/bonobo-exception.h>
+#include <libspi/matchrule.h> 
+#include <libspi/spi-private.h>
+
+SpiMatchrule *
+spi_matchrule_interface_new ()
+{
+
+     SpiMatchrule *new_matchrule = g_object_new (SPI_MATCHRULE_TYPE, NULL);
+
+     spi_base_construct_default (SPI_BASE (new_matchrule));
+
+     return new_matchrule;
+
+}
+
+static void
+spi_matchrule_class_init (SpiMatchruleClass *klass)
+{
+}
+
+static void
+spi_matchrule_init (SpiMatchrule *matchrule)
+{
+}
+
+BONOBO_TYPE_FUNC_FULL (SpiMatchrule,
+                     Accessibility_MatchRule,
+                     SPI_TYPE_BASE,
+                     spi_matchrule)
+
+
diff --git a/libspi/matchrule.h b/libspi/matchrule.h
new file mode 100644 (file)
index 0000000..26125fa
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+ * AT-SPI - Assistive Technology Service Provider Interface
+ * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
+ *
+ * Copyright 2007 IBM Corp.
+ *
+ * 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_MATCHRULE_H_
+#define SPI_MATCHRULE_H_
+
+#include <libspi/base.h>
+
+G_BEGIN_DECLS
+
+#define SPI_MATCHRULE_TYPE         (spi_matchrule_get_type ())
+#define SPI_MATCHRULE(obj)         (G_TYPE_CHECK_INSTANCE_CAST ((obj), SPI_MATCHRULE_TYPE, SpiMatchrule))
+#define SPI_MATCHRULE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), SPI_MATCHRULE_TYPE, SpiMatchruleClass))
+#define IS_MATCHRULE(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj, SPI_MATCHRULE_TYPE))
+#define IS_MATCHRULE_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), SPI_MATCHRULE_TYPE))
+
+typedef struct _SpiMatchrule SpiMatchrule;
+typedef struct _SpiMatchruleClass SpiMatchruleClass;
+
+struct _SpiMatchrule {
+     SpiBase parent;
+
+};
+
+struct _SpiMatchruleClass {
+  SpiBaseClass parent_class;
+  POA_Accessibility_MatchRule__epv epv;
+};
+
+GType        spi_matchrule_get_type       (void);
+void         spi_matchrule_construct      (SpiMatchrule *matchrule);
+                                           
+SpiMatchrule *spi_matchrule_interface_new  (void);
+
+G_END_DECLS
+
+#endif /* SPI_MATCHRULE_H_ */