2 * AT-SPI - Assistive Technology Service Provider Interface
3 * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
5 * Copyright 2001 Sun Microsystems Inc.
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
17 * You should have received a copy of the GNU Library General Public
18 * License along with this library; if not, write to the
19 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 * Boston, MA 02111-1307, USA.
24 * relation.c : bonobo wrapper for accessible relation implementation
28 #include <bonobo/Bonobo.h>
33 * This pulls the CORBA definitions for the "Accessibility::Accessible" server
35 #include <libspi/Accessibility.h>
38 * This pulls the definition of the relation bonobo object
43 * Static function declarations
47 spi_relation_class_init (SpiRelationClass *klass);
49 spi_relation_init (SpiRelation *relation);
51 spi_relation_finalize (GObject *obj);
53 impl_getURI (PortableServer_Servant _servant,
54 const CORBA_long i, CORBA_Environment * ev);
56 impl__get_n_anchors (PortableServer_Servant _servant,
57 CORBA_Environment * ev);
59 impl__get_startIndex (PortableServer_Servant _servant,
60 CORBA_Environment * ev);
62 impl__get_endIndex (PortableServer_Servant _servant,
63 CORBA_Environment * ev);
64 static Accessibility_Accessible
65 impl_getObject (PortableServer_Servant _servant,
67 CORBA_Environment * ev);
69 impl_isValid (PortableServer_Servant _servant,
70 CORBA_Environment * ev);
72 static GObjectClass *parent_class;
75 spi_relation_get_type (void)
77 static GType type = 0;
80 static const GTypeInfo tinfo = {
81 sizeof (SpiRelationClass),
83 (GBaseFinalizeFunc) NULL,
84 (GClassInitFunc) spi_relation_class_init,
85 (GClassFinalizeFunc) NULL,
86 NULL, /* class data */
89 (GInstanceInitFunc) spi_relation_init,
90 NULL /* value table */
94 * Bonobo_type_unique auto-generates a load of
95 * CORBA structures for us. All derived types must
96 * use bonobo_type_unique.
98 type = bonobo_type_unique (
100 POA_Accessibility_Relation__init,
102 G_STRUCT_OFFSET (SpiRelationClass, epv),
104 "SpiAccessibleRelation");
111 spi_relation_class_init (SpiRelationClass *klass)
113 GObjectClass * object_class = (GObjectClass *) klass;
114 POA_Accessibility_Relation__epv *epv = &klass->epv;
115 parent_class = g_type_class_peek_parent (klass);
117 object_class->finalize = spi_relation_finalize;
119 epv->getRelationType = NULL; /* TODO: finish me! */
120 epv->getNTargets = NULL;
121 epv->getTarget = NULL;
125 spi_relation_init (SpiRelation *relation)
130 spi_relation_finalize (GObject *obj)
132 SpiRelation *relation = SPI_RELATION(obj);
133 g_object_unref (relation->relation);
134 relation->relation = NULL;
135 parent_class->finalize (obj);
139 spi_relation_new (AtkRelation *obj)
141 SpiRelation *new_relation =
142 SPI_RELATION (g_object_new (SPI_RELATION_TYPE, NULL));
143 new_relation->relation = obj;