Initial revision
[platform/upstream/atk.git] / atk / atknoopobjectfactory.c
1 /* ATK - Accessibility Toolkit
2  * Copyright 2001 Sun Microsystems Inc.
3  *
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.
8  *
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.
13  *
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.
18  */
19
20 #include "atkobject.h"
21 #include "atknoopobject.h"
22 #include "atknoopobjectfactory.h"
23
24 static void atk_no_op_object_factory_class_init (
25                               AtkNoOpObjectFactoryClass        *klass);
26
27 static AtkObject* atk_no_op_object_factory_create_accessible (
28                               GObject                          *obj);
29
30 static AtkNoOpObjectFactoryClass    *parent_class = NULL;
31
32 GType
33 atk_no_op_object_factory_get_type ()
34 {
35   static GType type = 0;
36
37   if (!type) 
38   {
39     static const GTypeInfo tinfo =
40     {
41       sizeof (AtkNoOpObjectFactoryClass),
42       (GBaseInitFunc) NULL, /* base init */
43       (GBaseFinalizeFunc) NULL, /* base finalize */
44       (GClassInitFunc) atk_no_op_object_factory_class_init, /* class init */
45       (GClassFinalizeFunc) NULL, /* class finalize */
46       NULL, /* class data */
47       sizeof (AtkNoOpObjectFactory), /* instance size */
48       0, /* nb preallocs */
49       (GInstanceInitFunc) NULL, /* instance init */
50       NULL /* value table */
51     };
52     type = g_type_register_static (
53                            ATK_TYPE_OBJECT_FACTORY, 
54                            "AtkNoOpObjectFactory" , &tinfo, 0);
55   }
56
57   return type;
58 }
59
60 static void 
61 atk_no_op_object_factory_class_init (AtkNoOpObjectFactoryClass *klass)
62 {
63   AtkObjectFactoryClass *class = ATK_OBJECT_FACTORY_CLASS (klass);
64
65   parent_class = g_type_class_ref (ATK_TYPE_OBJECT_FACTORY);
66
67   class->create_accessible = atk_no_op_object_factory_create_accessible;
68 }
69
70 AtkObjectFactory* 
71 atk_no_op_object_factory_new ()
72 {
73   GObject *factory;
74
75   factory = g_object_new (ATK_TYPE_NO_OP_OBJECT_FACTORY, NULL);
76
77   g_return_val_if_fail (factory != NULL, NULL);
78   return ATK_OBJECT_FACTORY (factory);
79
80
81 static AtkObject* 
82 atk_no_op_object_factory_create_accessible (GObject   *obj)
83 {
84   AtkObject     *accessible;
85
86   accessible = atk_no_op_object_new (obj);
87
88   return accessible;
89 }