Adding AtkWindow to atk.symbols and to AtkNoOpObject
[platform/upstream/atk.git] / atk / atknoopobject.c
1 /* ATK -  Accessibility Toolkit
2  * Copyright 2001, 2002, 2003 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 "atk.h"
21 #include "atknoopobject.h"
22
23 static void atk_no_op_object_class_init (AtkNoOpObjectClass *klass);
24
25 static gpointer parent_class = NULL;
26
27
28 GType
29 atk_no_op_object_get_type (void)
30 {
31   static GType type = 0;
32
33   if (!type)
34   {
35     static const GTypeInfo tinfo =
36     {
37       sizeof (AtkObjectClass),
38       (GBaseInitFunc) NULL, /* base init */
39       (GBaseFinalizeFunc) NULL, /* base finalize */
40       (GClassInitFunc) atk_no_op_object_class_init, /* class init */
41       (GClassFinalizeFunc) NULL, /* class finalize */
42       NULL, /* class data */
43       sizeof (AtkNoOpObject), /* instance size */
44       0, /* nb preallocs */
45       (GInstanceInitFunc) NULL, /* instance init */
46       NULL /* value table */
47     };
48
49     static const GInterfaceInfo atk_component_info =
50     {
51         (GInterfaceInitFunc) NULL,
52         (GInterfaceFinalizeFunc) NULL,
53         NULL
54     };
55
56     static const GInterfaceInfo atk_action_info =
57     {
58         (GInterfaceInitFunc) NULL,
59         (GInterfaceFinalizeFunc) NULL,
60         NULL
61     };
62
63     static const GInterfaceInfo atk_editable_text_info =
64     {
65         (GInterfaceInitFunc) NULL,
66         (GInterfaceFinalizeFunc) NULL,
67         NULL
68     };
69
70     static const GInterfaceInfo atk_image_info =
71     {
72         (GInterfaceInitFunc) NULL,
73         (GInterfaceFinalizeFunc) NULL,
74         NULL
75     };
76
77     static const GInterfaceInfo atk_selection_info =
78     {
79         (GInterfaceInitFunc) NULL,
80         (GInterfaceFinalizeFunc) NULL,
81         NULL
82     };
83
84     static const GInterfaceInfo atk_table_info =
85     {
86         (GInterfaceInitFunc) NULL,
87         (GInterfaceFinalizeFunc) NULL,
88         NULL
89     };
90
91     static const GInterfaceInfo atk_text_info =
92     {
93         (GInterfaceInitFunc) NULL,
94         (GInterfaceFinalizeFunc) NULL,
95         NULL
96     };
97
98     static const GInterfaceInfo atk_hypertext_info =
99     {
100         (GInterfaceInitFunc) NULL,
101         (GInterfaceFinalizeFunc) NULL,
102         NULL
103     };
104
105     static const GInterfaceInfo atk_value_info =
106     {
107         (GInterfaceInitFunc) NULL,
108         (GInterfaceFinalizeFunc) NULL,
109         NULL
110     };
111
112     static const GInterfaceInfo atk_document_info =
113     {
114         (GInterfaceInitFunc) NULL,
115         (GInterfaceFinalizeFunc) NULL,
116         NULL
117     };
118
119     static const GInterfaceInfo atk_window_info =
120     {
121         (GInterfaceInitFunc) NULL,
122         (GInterfaceFinalizeFunc) NULL,
123         NULL
124     };
125
126     type = g_type_register_static (ATK_TYPE_OBJECT,
127                                     "AtkNoOpObject", &tinfo, 0);
128     g_type_add_interface_static (type, ATK_TYPE_COMPONENT,
129                                  &atk_component_info);
130     g_type_add_interface_static (type, ATK_TYPE_ACTION,
131                                  &atk_action_info);
132     g_type_add_interface_static (type, ATK_TYPE_EDITABLE_TEXT,
133                                  &atk_editable_text_info);
134     g_type_add_interface_static (type, ATK_TYPE_IMAGE,
135                                  &atk_image_info);
136     g_type_add_interface_static (type, ATK_TYPE_SELECTION,
137                                  &atk_selection_info);
138     g_type_add_interface_static (type, ATK_TYPE_TABLE,
139                                  &atk_table_info);
140     g_type_add_interface_static (type, ATK_TYPE_TEXT,
141                                  &atk_text_info);
142     g_type_add_interface_static (type, ATK_TYPE_HYPERTEXT,
143                                  &atk_hypertext_info);
144     g_type_add_interface_static (type, ATK_TYPE_VALUE,
145                                  &atk_value_info);
146     g_type_add_interface_static (type, ATK_TYPE_DOCUMENT,
147                                  &atk_document_info);
148     g_type_add_interface_static (type, ATK_TYPE_WINDOW,
149                                  &atk_window_info);
150   }
151   return type;
152 }
153
154 static void
155 atk_no_op_object_class_init (AtkNoOpObjectClass *klass)
156 {
157   parent_class = g_type_class_peek_parent (klass);
158 }
159
160 /**
161  * atk_no_op_object_new:
162  * @obj: a #GObject
163  *
164  * Provides a default (non-functioning stub) #AtkObject.
165  * Application maintainers should not use this method. 
166  *
167  * Returns: a default (non-functioning stub) #AtkObject
168  **/
169 AtkObject*
170 atk_no_op_object_new (GObject *obj)
171 {
172   AtkObject *accessible;
173
174   g_return_val_if_fail (obj != NULL, NULL);
175
176   accessible = g_object_new (ATK_TYPE_NO_OP_OBJECT, NULL);
177   g_return_val_if_fail (accessible != NULL, NULL);
178
179   accessible->role = ATK_ROLE_INVALID;
180   accessible->layer = ATK_LAYER_INVALID;
181
182   return accessible;
183 }
184