Fix introspection for atk_text_get_bounded_ranges
[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 static GType      atk_no_op_object_factory_get_accessible_type (void);
30
31 static gpointer    parent_class = NULL;
32
33 GType
34 atk_no_op_object_factory_get_type (void)
35 {
36   static GType type = 0;
37
38   if (!type) 
39   {
40     static const GTypeInfo tinfo =
41     {
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 */
52     };
53     type = g_type_register_static (
54                            ATK_TYPE_OBJECT_FACTORY, 
55                            "AtkNoOpObjectFactory" , &tinfo, 0);
56   }
57
58   return type;
59 }
60
61 static void 
62 atk_no_op_object_factory_class_init (AtkNoOpObjectFactoryClass *klass)
63 {
64   AtkObjectFactoryClass *class = ATK_OBJECT_FACTORY_CLASS (klass);
65
66   parent_class = g_type_class_peek_parent (klass);
67
68   class->create_accessible = atk_no_op_object_factory_create_accessible;
69   class->get_accessible_type = atk_no_op_object_factory_get_accessible_type;
70 }
71
72 /**
73  * atk_no_op_object_factory_new:
74  *
75  * Creates an instance of an #AtkObjectFactory which generates primitive
76  * (non-functioning) #AtkObjects. 
77  *
78  * Returns: an instance of an #AtkObjectFactory
79  **/
80 AtkObjectFactory* 
81 atk_no_op_object_factory_new (void)
82 {
83   GObject *factory;
84
85   factory = g_object_new (ATK_TYPE_NO_OP_OBJECT_FACTORY, NULL);
86
87   g_return_val_if_fail (factory != NULL, NULL);
88   return ATK_OBJECT_FACTORY (factory);
89
90
91 static AtkObject* 
92 atk_no_op_object_factory_create_accessible (GObject   *obj)
93 {
94   AtkObject     *accessible;
95
96   accessible = atk_no_op_object_new (obj);
97
98   return accessible;
99 }
100
101 static GType
102 atk_no_op_object_factory_get_accessible_type (void)
103 {
104   return ATK_TYPE_NO_OP_OBJECT;
105 }