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, see <http://www.gnu.org/licenses/>.
18 #include "atkobject.h"
19 #include "atknoopobject.h"
20 #include "atknoopobjectfactory.h"
23 * SECTION:atknoopobjectfactory
24 * @Short_description: The AtkObjectFactory which creates an AtkNoOpObject.
25 * @Title:AtkNoOpObjectFactory
27 * The AtkObjectFactory which creates an AtkNoOpObject. An instance of
28 * this is created by an AtkRegistry if no factory type has not been
29 * specified to create an accessible object of a particular type.
31 static void atk_no_op_object_factory_class_init (
32 AtkNoOpObjectFactoryClass *klass);
34 static AtkObject* atk_no_op_object_factory_create_accessible (
36 static GType atk_no_op_object_factory_get_accessible_type (void);
38 static gpointer parent_class = NULL;
41 atk_no_op_object_factory_get_type (void)
43 static GType type = 0;
47 static const GTypeInfo tinfo =
49 sizeof (AtkNoOpObjectFactoryClass),
50 (GBaseInitFunc) NULL, /* base init */
51 (GBaseFinalizeFunc) NULL, /* base finalize */
52 (GClassInitFunc) atk_no_op_object_factory_class_init, /* class init */
53 (GClassFinalizeFunc) NULL, /* class finalize */
54 NULL, /* class data */
55 sizeof (AtkNoOpObjectFactory), /* instance size */
57 (GInstanceInitFunc) NULL, /* instance init */
58 NULL /* value table */
60 type = g_type_register_static (
61 ATK_TYPE_OBJECT_FACTORY,
62 "AtkNoOpObjectFactory" , &tinfo, 0);
69 atk_no_op_object_factory_class_init (AtkNoOpObjectFactoryClass *klass)
71 AtkObjectFactoryClass *class = ATK_OBJECT_FACTORY_CLASS (klass);
73 parent_class = g_type_class_peek_parent (klass);
75 class->create_accessible = atk_no_op_object_factory_create_accessible;
76 class->get_accessible_type = atk_no_op_object_factory_get_accessible_type;
80 * atk_no_op_object_factory_new:
82 * Creates an instance of an #AtkObjectFactory which generates primitive
83 * (non-functioning) #AtkObjects.
85 * Returns: an instance of an #AtkObjectFactory
88 atk_no_op_object_factory_new (void)
92 factory = g_object_new (ATK_TYPE_NO_OP_OBJECT_FACTORY, NULL);
94 g_return_val_if_fail (factory != NULL, NULL);
95 return ATK_OBJECT_FACTORY (factory);
99 atk_no_op_object_factory_create_accessible (GObject *obj)
101 AtkObject *accessible;
103 accessible = atk_no_op_object_new (obj);
109 atk_no_op_object_factory_get_accessible_type (void)
111 return ATK_TYPE_NO_OP_OBJECT;