Translation updated by Ivar Smolin.
[atk.git] / atk / atknoopobjectfactory.c
blob951332f72fe8b332ed5175597ad83259ce1d9f49
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"
24 static void atk_no_op_object_factory_class_init (
25 AtkNoOpObjectFactoryClass *klass);
27 static AtkObject* atk_no_op_object_factory_create_accessible (
28 GObject *obj);
29 static GType atk_no_op_object_factory_get_accessible_type (void);
31 static gpointer parent_class = NULL;
33 GType
34 atk_no_op_object_factory_get_type (void)
36 static GType type = 0;
38 if (!type)
40 static const GTypeInfo tinfo =
42 sizeof (AtkNoOpObjectFactoryClass),
43 (GBaseInitFunc) NULL, /* base init */
44 (GBaseFinalizeFunc) NULL, /* base finalize */
45 (GClassInitFunc) atk_no_op_object_factory_class_init, /* class init */
46 (GClassFinalizeFunc) NULL, /* class finalize */
47 NULL, /* class data */
48 sizeof (AtkNoOpObjectFactory), /* instance size */
49 0, /* nb preallocs */
50 (GInstanceInitFunc) NULL, /* instance init */
51 NULL /* value table */
53 type = g_type_register_static (
54 ATK_TYPE_OBJECT_FACTORY,
55 "AtkNoOpObjectFactory" , &tinfo, 0);
58 return type;
61 static void
62 atk_no_op_object_factory_class_init (AtkNoOpObjectFactoryClass *klass)
64 AtkObjectFactoryClass *class = ATK_OBJECT_FACTORY_CLASS (klass);
66 parent_class = g_type_class_peek_parent (klass);
68 class->create_accessible = atk_no_op_object_factory_create_accessible;
69 class->get_accessible_type = atk_no_op_object_factory_get_accessible_type;
72 /**
73 * atk_no_op_object_factory_new:
75 * Creates an instance of an #AtkObjectFactory which generates primitive
76 * (non-functioning) #AtkObjects.
78 * Returns: an instance of an #AtkObjectFactory
79 **/
80 AtkObjectFactory*
81 atk_no_op_object_factory_new (void)
83 GObject *factory;
85 factory = g_object_new (ATK_TYPE_NO_OP_OBJECT_FACTORY, NULL);
87 g_return_val_if_fail (factory != NULL, NULL);
88 return ATK_OBJECT_FACTORY (factory);
91 static AtkObject*
92 atk_no_op_object_factory_create_accessible (GObject *obj)
94 AtkObject *accessible;
96 accessible = atk_no_op_object_new (obj);
98 return accessible;
101 static GType
102 atk_no_op_object_factory_get_accessible_type (void)
104 return ATK_TYPE_NO_OP_OBJECT;