role: fix name for ATK_ROLE_EDITBAR
[atk.git] / atk / atknoopobject.c
blob6e670ff5c4afc5a0fa29f029b8d5ff7549b45856
1 /* ATK - Accessibility Toolkit
2 * Copyright 2001, 2002, 2003 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 "atk.h"
21 #include "atknoopobject.h"
23 /**
24 * SECTION:atknoopobject
25 * @Short_description: An AtkObject which purports to implement all ATK interfaces.
26 * @Title:AtkNoOpObject
28 * An AtkNoOpObject is an AtkObject which purports to implement all
29 * ATK interfaces. It is the type of AtkObject which is created if an
30 * accessible object is requested for an object type for which no
31 * factory type is specified.
36 static void atk_no_op_object_class_init (AtkNoOpObjectClass *klass);
38 static gpointer parent_class = NULL;
41 GType
42 atk_no_op_object_get_type (void)
44 static GType type = 0;
46 if (!type)
48 static const GTypeInfo tinfo =
50 sizeof (AtkObjectClass),
51 (GBaseInitFunc) NULL, /* base init */
52 (GBaseFinalizeFunc) NULL, /* base finalize */
53 (GClassInitFunc) atk_no_op_object_class_init, /* class init */
54 (GClassFinalizeFunc) NULL, /* class finalize */
55 NULL, /* class data */
56 sizeof (AtkNoOpObject), /* instance size */
57 0, /* nb preallocs */
58 (GInstanceInitFunc) NULL, /* instance init */
59 NULL /* value table */
62 static const GInterfaceInfo atk_component_info =
64 (GInterfaceInitFunc) NULL,
65 (GInterfaceFinalizeFunc) NULL,
66 NULL
69 static const GInterfaceInfo atk_action_info =
71 (GInterfaceInitFunc) NULL,
72 (GInterfaceFinalizeFunc) NULL,
73 NULL
76 static const GInterfaceInfo atk_editable_text_info =
78 (GInterfaceInitFunc) NULL,
79 (GInterfaceFinalizeFunc) NULL,
80 NULL
83 static const GInterfaceInfo atk_image_info =
85 (GInterfaceInitFunc) NULL,
86 (GInterfaceFinalizeFunc) NULL,
87 NULL
90 static const GInterfaceInfo atk_selection_info =
92 (GInterfaceInitFunc) NULL,
93 (GInterfaceFinalizeFunc) NULL,
94 NULL
97 static const GInterfaceInfo atk_table_info =
99 (GInterfaceInitFunc) NULL,
100 (GInterfaceFinalizeFunc) NULL,
101 NULL
104 static const GInterfaceInfo atk_text_info =
106 (GInterfaceInitFunc) NULL,
107 (GInterfaceFinalizeFunc) NULL,
108 NULL
111 static const GInterfaceInfo atk_hypertext_info =
113 (GInterfaceInitFunc) NULL,
114 (GInterfaceFinalizeFunc) NULL,
115 NULL
118 static const GInterfaceInfo atk_value_info =
120 (GInterfaceInitFunc) NULL,
121 (GInterfaceFinalizeFunc) NULL,
122 NULL
125 static const GInterfaceInfo atk_document_info =
127 (GInterfaceInitFunc) NULL,
128 (GInterfaceFinalizeFunc) NULL,
129 NULL
132 static const GInterfaceInfo atk_window_info =
134 (GInterfaceInitFunc) NULL,
135 (GInterfaceFinalizeFunc) NULL,
136 NULL
139 type = g_type_register_static (ATK_TYPE_OBJECT,
140 "AtkNoOpObject", &tinfo, 0);
141 g_type_add_interface_static (type, ATK_TYPE_COMPONENT,
142 &atk_component_info);
143 g_type_add_interface_static (type, ATK_TYPE_ACTION,
144 &atk_action_info);
145 g_type_add_interface_static (type, ATK_TYPE_EDITABLE_TEXT,
146 &atk_editable_text_info);
147 g_type_add_interface_static (type, ATK_TYPE_IMAGE,
148 &atk_image_info);
149 g_type_add_interface_static (type, ATK_TYPE_SELECTION,
150 &atk_selection_info);
151 g_type_add_interface_static (type, ATK_TYPE_TABLE,
152 &atk_table_info);
153 g_type_add_interface_static (type, ATK_TYPE_TEXT,
154 &atk_text_info);
155 g_type_add_interface_static (type, ATK_TYPE_HYPERTEXT,
156 &atk_hypertext_info);
157 g_type_add_interface_static (type, ATK_TYPE_VALUE,
158 &atk_value_info);
159 g_type_add_interface_static (type, ATK_TYPE_DOCUMENT,
160 &atk_document_info);
161 g_type_add_interface_static (type, ATK_TYPE_WINDOW,
162 &atk_window_info);
164 return type;
167 static void
168 atk_no_op_object_class_init (AtkNoOpObjectClass *klass)
170 parent_class = g_type_class_peek_parent (klass);
174 * atk_no_op_object_new:
175 * @obj: a #GObject
177 * Provides a default (non-functioning stub) #AtkObject.
178 * Application maintainers should not use this method.
180 * Returns: a default (non-functioning stub) #AtkObject
182 AtkObject*
183 atk_no_op_object_new (GObject *obj)
185 AtkObject *accessible;
187 g_return_val_if_fail (obj != NULL, NULL);
189 accessible = g_object_new (ATK_TYPE_NO_OP_OBJECT, NULL);
190 g_return_val_if_fail (accessible != NULL, NULL);
192 accessible->role = ATK_ROLE_INVALID;
193 accessible->layer = ATK_LAYER_INVALID;
195 return accessible;