2 * AT-SPI - Assistive Technology Service Provider Interface
3 * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
5 * Copyright 2001 Ximian 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 /* base.c: the base object managing an AtkObject proxy */
27 #include <libspi/libspi.h>
29 /* Our parent Gtk object type */
30 #define PARENT_TYPE BONOBO_TYPE_OBJECT
32 /* A pointer to our parent object class */
33 static GObjectClass *spi_base_parent_class;
36 * Implemented GObject::dispose
39 spi_base_object_dispose (GObject *gobject)
41 SpiBase *object = SPI_BASE (gobject);
45 g_assert (ATK_IS_OBJECT (object->atko));
46 g_object_unref (G_OBJECT (object->atko));
50 spi_base_parent_class->dispose (gobject);
54 spi_base_class_init (SpiBaseClass *klass)
56 GObjectClass * object_class = (GObjectClass *) klass;
58 spi_base_parent_class = g_type_class_peek_parent (klass);
60 object_class->dispose = spi_base_object_dispose;
64 spi_base_init (SpiBase *object)
68 BONOBO_TYPE_FUNC (SpiBase, PARENT_TYPE, spi_base);
71 spi_base_construct (SpiBase *object, AtkObject *aobject)
73 object->atko = g_object_ref (G_OBJECT (aobject));
77 spi_base_construct_default (SpiBase *object)
79 object->atko = g_object_new (ATK_TYPE_OBJECT, NULL);
83 spi_base_get_atkobject (SpiBase *object)
85 g_return_val_if_fail (ATK_IS_OBJECT (object), NULL);