1 /* ATK - Accessibility Toolkit
2 * Copyright 2001 Sun Microsystems Inc.
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
20 #include "atkobject.h"
21 #include "atknoopobject.h"
22 #include "atknoopobjectfactory.h"
25 * SECTION:atknoopobjectfactory
26 * @Short_description: The AtkObjectFactory which creates an AtkNoOpObject.
27 * @Title:AtkNoOpObjectFactory
29 * The AtkObjectFactory which creates an AtkNoOpObject. An instance of
30 * this is created by an AtkRegistry if no factory type has not been
31 * specified to create an accessible object of a particular type.
33 static void atk_no_op_object_factory_class_init (
34 AtkNoOpObjectFactoryClass *klass);
36 static AtkObject* atk_no_op_object_factory_create_accessible (
38 static GType atk_no_op_object_factory_get_accessible_type (void);
40 static gpointer parent_class = NULL;
43 atk_no_op_object_factory_get_type (void)
45 static GType type = 0;
49 static const GTypeInfo tinfo =
51 sizeof (AtkNoOpObjectFactoryClass),
52 (GBaseInitFunc) NULL, /* base init */
53 (GBaseFinalizeFunc) NULL, /* base finalize */
54 (GClassInitFunc) atk_no_op_object_factory_class_init, /* class init */
55 (GClassFinalizeFunc) NULL, /* class finalize */
56 NULL, /* class data */
57 sizeof (AtkNoOpObjectFactory), /* instance size */
59 (GInstanceInitFunc) NULL, /* instance init */
60 NULL /* value table */
62 type = g_type_register_static (
63 ATK_TYPE_OBJECT_FACTORY,
64 "AtkNoOpObjectFactory" , &tinfo, 0);
71 atk_no_op_object_factory_class_init (AtkNoOpObjectFactoryClass *klass)
73 AtkObjectFactoryClass *class = ATK_OBJECT_FACTORY_CLASS (klass);
75 parent_class = g_type_class_peek_parent (klass);
77 class->create_accessible = atk_no_op_object_factory_create_accessible;
78 class->get_accessible_type = atk_no_op_object_factory_get_accessible_type;
82 * atk_no_op_object_factory_new:
84 * Creates an instance of an #AtkObjectFactory which generates primitive
85 * (non-functioning) #AtkObjects.
87 * Returns: an instance of an #AtkObjectFactory
90 atk_no_op_object_factory_new (void)
94 factory = g_object_new (ATK_TYPE_NO_OP_OBJECT_FACTORY, NULL);
96 g_return_val_if_fail (factory != NULL, NULL);
97 return ATK_OBJECT_FACTORY (factory);
101 atk_no_op_object_factory_create_accessible (GObject *obj)
103 AtkObject *accessible;
105 accessible = atk_no_op_object_new (obj);
111 atk_no_op_object_factory_get_accessible_type (void)
113 return ATK_TYPE_NO_OP_OBJECT;