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.
23 /* image.c : implements the Image interface */
27 #include <libspi/image.h>
29 /* A pointer to our parent object class */
30 static GObjectClass *parent_class;
33 spi_image_finalize (GObject *obj)
35 SpiImage *image = SPI_IMAGE (obj);
36 g_object_unref (image->atko);
38 parent_class->finalize (obj);
42 spi_image_interface_new (AtkObject *obj)
44 SpiImage *new_image = g_object_new (SPI_IMAGE_TYPE, NULL);
45 new_image->atko = obj;
53 impl_getImagePosition (PortableServer_Servant _servant,
54 CORBA_long * x, CORBA_long * y,
55 const CORBA_short coordType,
56 CORBA_Environment * ev)
58 SpiImage *image = SPI_IMAGE (bonobo_object_from_servant(_servant));
59 atk_image_get_image_position (ATK_IMAGE(image->atko),
60 (gint *) x, (gint *) y,
61 (AtkCoordType) coordType);
67 impl_getImageSize (PortableServer_Servant _servant,
68 CORBA_long * width, CORBA_long * height,
69 CORBA_Environment * ev)
71 SpiImage *image = SPI_IMAGE (bonobo_object_from_servant(_servant));
72 atk_image_get_image_size (ATK_IMAGE(image->atko),
73 (gint *) width, (gint *) height);
79 impl__get_imageDescription (PortableServer_Servant servant,
80 CORBA_Environment *ev)
85 image = SPI_IMAGE (bonobo_object_from_servant (servant));
87 rv = atk_image_get_image_description (ATK_IMAGE (image->atko));
89 return CORBA_string_dup (rv);
91 return CORBA_string_dup ("");
96 spi_image_class_init (SpiImageClass *klass)
98 GObjectClass * object_class = (GObjectClass *) klass;
99 POA_Accessibility_Image__epv *epv = &klass->epv;
100 parent_class = g_type_class_peek_parent (klass);
102 object_class->finalize = spi_image_finalize;
105 /* Initialize epv table */
107 epv->getImagePosition = impl_getImagePosition;
108 epv->getImageSize = impl_getImageSize;
109 epv->_get_imageDescription = impl__get_imageDescription;
113 spi_image_init (SpiImage *image)
117 BONOBO_TYPE_FUNC_FULL (SpiImage,