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, see <http://www.gnu.org/licenses/>.
19 #include "atknoopobject.h"
22 * SECTION:atknoopobject
23 * @Short_description: An AtkObject which purports to implement all ATK interfaces.
24 * @Title:AtkNoOpObject
26 * An AtkNoOpObject is an AtkObject which purports to implement all
27 * ATK interfaces. It is the type of AtkObject which is created if an
28 * accessible object is requested for an object type for which no
29 * factory type is specified.
34 static void atk_no_op_object_class_init (AtkNoOpObjectClass *klass);
36 static gpointer parent_class = NULL;
40 atk_no_op_object_get_type (void)
42 static GType type = 0;
46 static const GTypeInfo tinfo =
48 sizeof (AtkObjectClass),
49 (GBaseInitFunc) NULL, /* base init */
50 (GBaseFinalizeFunc) NULL, /* base finalize */
51 (GClassInitFunc) atk_no_op_object_class_init, /* class init */
52 (GClassFinalizeFunc) NULL, /* class finalize */
53 NULL, /* class data */
54 sizeof (AtkNoOpObject), /* instance size */
56 (GInstanceInitFunc) NULL, /* instance init */
57 NULL /* value table */
60 static const GInterfaceInfo atk_component_info =
62 (GInterfaceInitFunc) NULL,
63 (GInterfaceFinalizeFunc) NULL,
67 static const GInterfaceInfo atk_action_info =
69 (GInterfaceInitFunc) NULL,
70 (GInterfaceFinalizeFunc) NULL,
74 static const GInterfaceInfo atk_editable_text_info =
76 (GInterfaceInitFunc) NULL,
77 (GInterfaceFinalizeFunc) NULL,
81 static const GInterfaceInfo atk_image_info =
83 (GInterfaceInitFunc) NULL,
84 (GInterfaceFinalizeFunc) NULL,
88 static const GInterfaceInfo atk_selection_info =
90 (GInterfaceInitFunc) NULL,
91 (GInterfaceFinalizeFunc) NULL,
95 static const GInterfaceInfo atk_table_info =
97 (GInterfaceInitFunc) NULL,
98 (GInterfaceFinalizeFunc) NULL,
102 static const GInterfaceInfo atk_text_info =
104 (GInterfaceInitFunc) NULL,
105 (GInterfaceFinalizeFunc) NULL,
109 static const GInterfaceInfo atk_hypertext_info =
111 (GInterfaceInitFunc) NULL,
112 (GInterfaceFinalizeFunc) NULL,
116 static const GInterfaceInfo atk_value_info =
118 (GInterfaceInitFunc) NULL,
119 (GInterfaceFinalizeFunc) NULL,
123 static const GInterfaceInfo atk_document_info =
125 (GInterfaceInitFunc) NULL,
126 (GInterfaceFinalizeFunc) NULL,
130 static const GInterfaceInfo atk_window_info =
132 (GInterfaceInitFunc) NULL,
133 (GInterfaceFinalizeFunc) NULL,
137 type = g_type_register_static (ATK_TYPE_OBJECT,
138 "AtkNoOpObject", &tinfo, 0);
139 g_type_add_interface_static (type, ATK_TYPE_COMPONENT,
140 &atk_component_info);
141 g_type_add_interface_static (type, ATK_TYPE_ACTION,
143 g_type_add_interface_static (type, ATK_TYPE_EDITABLE_TEXT,
144 &atk_editable_text_info);
145 g_type_add_interface_static (type, ATK_TYPE_IMAGE,
147 g_type_add_interface_static (type, ATK_TYPE_SELECTION,
148 &atk_selection_info);
149 g_type_add_interface_static (type, ATK_TYPE_TABLE,
151 g_type_add_interface_static (type, ATK_TYPE_TEXT,
153 g_type_add_interface_static (type, ATK_TYPE_HYPERTEXT,
154 &atk_hypertext_info);
155 g_type_add_interface_static (type, ATK_TYPE_VALUE,
157 g_type_add_interface_static (type, ATK_TYPE_DOCUMENT,
159 g_type_add_interface_static (type, ATK_TYPE_WINDOW,
166 atk_no_op_object_class_init (AtkNoOpObjectClass *klass)
168 parent_class = g_type_class_peek_parent (klass);
172 * atk_no_op_object_new:
175 * Provides a default (non-functioning stub) #AtkObject.
176 * Application maintainers should not use this method.
178 * Returns: a default (non-functioning stub) #AtkObject
181 atk_no_op_object_new (GObject *obj)
183 AtkObject *accessible;
185 g_return_val_if_fail (obj != NULL, NULL);
187 accessible = g_object_new (ATK_TYPE_NO_OP_OBJECT, NULL);
188 g_return_val_if_fail (accessible != NULL, NULL);
190 accessible->role = ATK_ROLE_INVALID;
191 accessible->layer = ATK_LAYER_INVALID;