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 * component.c : bonobo wrapper for accessible component 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 image bonobo object
43 * Static function declarations
47 image_class_init (ImageClass *klass);
49 image_init (Image *image);
51 image_finalize (GObject *obj);
53 impl_getImagePosition (PortableServer_Servant _servant,
54 CORBA_long * x, CORBA_long * y,
55 const CORBA_short coordType,
56 CORBA_Environment * ev);
58 impl_getImageSize (PortableServer_Servant _servant,
59 CORBA_long * width, CORBA_long * height,
60 CORBA_Environment * ev);
62 impl__get_imageDescription (PortableServer_Servant _servant,
63 CORBA_Environment * ev);
66 static GObjectClass *parent_class;
71 static GType type = 0;
74 static const GTypeInfo tinfo = {
77 (GBaseFinalizeFunc) NULL,
78 (GClassInitFunc) image_class_init,
79 (GClassFinalizeFunc) NULL,
80 NULL, /* class data */
83 (GInstanceInitFunc) image_init,
84 NULL /* value table */
88 * Bonobo_type_unique auto-generates a load of
89 * CORBA structures for us. All derived types must
90 * use bonobo_type_unique.
92 type = bonobo_type_unique (
94 POA_Accessibility_Image__init,
96 G_STRUCT_OFFSET (ImageClass, epv),
105 image_class_init (ImageClass *klass)
107 GObjectClass * object_class = (GObjectClass *) klass;
108 POA_Accessibility_Image__epv *epv = &klass->epv;
109 parent_class = g_type_class_peek_parent (klass);
111 object_class->finalize = image_finalize;
114 /* Initialize epv table */
116 epv->getImagePosition = impl_getImagePosition;
117 epv->getImageSize = impl_getImageSize;
118 epv->_get_imageDescription = impl__get_imageDescription;
122 image_init (Image *image)
127 image_finalize (GObject *obj)
129 Image *image = IMAGE (obj);
130 image->atk_image = NULL;
131 parent_class->finalize (obj);
135 image_new (AtkImage *image)
138 IMAGE(g_object_new (IMAGE_TYPE, NULL));
139 new_image->atk_image = image;
146 impl_getImagePosition (PortableServer_Servant _servant,
147 CORBA_long * x, CORBA_long * y,
148 const CORBA_short coordType,
149 CORBA_Environment * ev)
151 Image *image = IMAGE (bonobo_object_from_servant(_servant));
152 atk_image_get_image_position (image->atk_image,
153 (gint *) x, (gint *) y,
154 (AtkCoordType) coordType);
160 impl_getImageSize (PortableServer_Servant _servant,
161 CORBA_long * width, CORBA_long * height,
162 CORBA_Environment * ev)
164 Image *image = IMAGE (bonobo_object_from_servant(_servant));
165 atk_image_get_image_size (image->atk_image,
166 (gint *) width, (gint *) height);
172 impl__get_imageDescription (PortableServer_Servant _servant,
173 CORBA_Environment * ev)
175 Image *image = IMAGE (bonobo_object_from_servant(_servant));
176 return CORBA_string_dup (
177 atk_image_get_image_description (image->atk_image));