+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.
spi_accessible.c \
spi_action.c \
spi_application.c \
+ spi_collection.c \
spi_component.c \
spi_document.c \
spi_editabletext.c \
spi_hypertext.c \
spi_image.c \
spi_main.c \
+ spi_matchrule.c \
spi-private.h \
spi_registry.c \
spi_selection.c \
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;
#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.
} AccessibleRoleSet;
+
/* Basic SPI initialization and event loop function prototypes */
int SPI_init (void);
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);
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);
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);
/*
*
+ * AccessibleMatchRule function prototypes
+ *
+ */
+void AccessibleMatchRule_ref (AccessibleMatchRule *obj);
+void AccessibleMatchRule_unref (AccessibleMatchRule *obj);
+
+/*
+ *
* AccessibleRelation function prototypes
*
*/
"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.
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:
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.
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:
--- /dev/null
+/*
+ * 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");
+}
--- /dev/null
+/*
+ * 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);
+}
*/
#include <Accessibility_Accessible.idl>
#include <Accessibility_Action.idl>
+#include <Accessibility_Collection.idl>
#include <Accessibility_Component.idl>
#include <Accessibility_Document.idl>
#include <Accessibility_Hyperlink.idl>
--- /dev/null
+ /*
+ * 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
Accessibility_Accessible.idl \
Accessibility_Action.idl \
Accessibility_Application.idl \
+ Accessibility_Collection.idl \
Accessibility_Component.idl \
Accessibility_Desktop.idl \
Accessibility_Document.idl \
action.h \
application.h \
base.h \
+ collection.h \
component.h \
document.h \
editabletext.h \
keymasks.h \
libspi.h \
listener.h \
+ matchrule.h \
relation.h \
remoteobject.h \
selection.h \
$(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 \
action.c \
application.c \
base.c \
+ collection.c \
component.c \
document.c \
editabletext.c \
hypertext.c \
image.c \
devicelistener.c \
+ matchrule.c \
relation.c \
remoteobject.c \
selection.c \
--- /dev/null
+/*
+ * 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)
+
--- /dev/null
+/*
+ * 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_ */
+
+
#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>
--- /dev/null
+/*
+ * 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)
+
+
--- /dev/null
+/*
+ * 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_ */