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.
23 #include "atknoopobject.h"
26 * SECTION:atknoopobject
27 * @Short_description: An AtkObject which purports to implement all ATK interfaces.
28 * @Title:AtkNoOpObject
30 * An AtkNoOpObject is an AtkObject which purports to implement all
31 * ATK interfaces. It is the type of AtkObject which is created if an
32 * accessible object is requested for an object type for which no
33 * factory type is specified.
38 static void atk_no_op_object_class_init (AtkNoOpObjectClass *klass);
40 static gpointer parent_class = NULL;
44 atk_no_op_object_get_type (void)
46 static GType type = 0;
50 static const GTypeInfo tinfo =
52 sizeof (AtkObjectClass),
53 (GBaseInitFunc) NULL, /* base init */
54 (GBaseFinalizeFunc) NULL, /* base finalize */
55 (GClassInitFunc) atk_no_op_object_class_init, /* class init */
56 (GClassFinalizeFunc) NULL, /* class finalize */
57 NULL, /* class data */
58 sizeof (AtkNoOpObject), /* instance size */
60 (GInstanceInitFunc) NULL, /* instance init */
61 NULL /* value table */
64 static const GInterfaceInfo atk_component_info =
66 (GInterfaceInitFunc) NULL,
67 (GInterfaceFinalizeFunc) NULL,
71 static const GInterfaceInfo atk_action_info =
73 (GInterfaceInitFunc) NULL,
74 (GInterfaceFinalizeFunc) NULL,
78 static const GInterfaceInfo atk_editable_text_info =
80 (GInterfaceInitFunc) NULL,
81 (GInterfaceFinalizeFunc) NULL,
85 static const GInterfaceInfo atk_image_info =
87 (GInterfaceInitFunc) NULL,
88 (GInterfaceFinalizeFunc) NULL,
92 static const GInterfaceInfo atk_selection_info =
94 (GInterfaceInitFunc) NULL,
95 (GInterfaceFinalizeFunc) NULL,
99 static const GInterfaceInfo atk_table_info =
101 (GInterfaceInitFunc) NULL,
102 (GInterfaceFinalizeFunc) NULL,
106 static const GInterfaceInfo atk_table_cell_info =
108 (GInterfaceInitFunc) NULL,
109 (GInterfaceFinalizeFunc) NULL,
113 static const GInterfaceInfo atk_text_info =
115 (GInterfaceInitFunc) NULL,
116 (GInterfaceFinalizeFunc) NULL,
120 static const GInterfaceInfo atk_hypertext_info =
122 (GInterfaceInitFunc) NULL,
123 (GInterfaceFinalizeFunc) NULL,
127 static const GInterfaceInfo atk_value_info =
129 (GInterfaceInitFunc) NULL,
130 (GInterfaceFinalizeFunc) NULL,
134 static const GInterfaceInfo atk_document_info =
136 (GInterfaceInitFunc) NULL,
137 (GInterfaceFinalizeFunc) NULL,
141 static const GInterfaceInfo atk_window_info =
143 (GInterfaceInitFunc) NULL,
144 (GInterfaceFinalizeFunc) NULL,
148 type = g_type_register_static (ATK_TYPE_OBJECT,
149 "AtkNoOpObject", &tinfo, 0);
150 g_type_add_interface_static (type, ATK_TYPE_COMPONENT,
151 &atk_component_info);
152 g_type_add_interface_static (type, ATK_TYPE_ACTION,
154 g_type_add_interface_static (type, ATK_TYPE_EDITABLE_TEXT,
155 &atk_editable_text_info);
156 g_type_add_interface_static (type, ATK_TYPE_IMAGE,
158 g_type_add_interface_static (type, ATK_TYPE_SELECTION,
159 &atk_selection_info);
160 g_type_add_interface_static (type, ATK_TYPE_TABLE,
162 g_type_add_interface_static (type, ATK_TYPE_TABLE_CELL,
163 &atk_table_cell_info);
164 g_type_add_interface_static (type, ATK_TYPE_TEXT,
166 g_type_add_interface_static (type, ATK_TYPE_HYPERTEXT,
167 &atk_hypertext_info);
168 g_type_add_interface_static (type, ATK_TYPE_VALUE,
170 g_type_add_interface_static (type, ATK_TYPE_DOCUMENT,
172 g_type_add_interface_static (type, ATK_TYPE_WINDOW,
179 atk_no_op_object_class_init (AtkNoOpObjectClass *klass)
181 parent_class = g_type_class_peek_parent (klass);
185 * atk_no_op_object_new:
188 * Provides a default (non-functioning stub) #AtkObject.
189 * Application maintainers should not use this method.
191 * Returns: a default (non-functioning stub) #AtkObject
194 atk_no_op_object_new (GObject *obj)
196 AtkObject *accessible;
198 g_return_val_if_fail (obj != NULL, NULL);
200 accessible = g_object_new (ATK_TYPE_NO_OP_OBJECT, NULL);
201 g_return_val_if_fail (accessible != NULL, NULL);
203 accessible->role = ATK_ROLE_INVALID;
204 accessible->layer = ATK_LAYER_INVALID;