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.
21 #include "atknoopobject.h"
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;
42 atk_no_op_object_get_type (void)
44 static GType type = 0;
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 */
58 (GInstanceInitFunc) NULL, /* instance init */
59 NULL /* value table */
62 static const GInterfaceInfo atk_component_info =
64 (GInterfaceInitFunc) NULL,
65 (GInterfaceFinalizeFunc) NULL,
69 static const GInterfaceInfo atk_action_info =
71 (GInterfaceInitFunc) NULL,
72 (GInterfaceFinalizeFunc) NULL,
76 static const GInterfaceInfo atk_editable_text_info =
78 (GInterfaceInitFunc) NULL,
79 (GInterfaceFinalizeFunc) NULL,
83 static const GInterfaceInfo atk_image_info =
85 (GInterfaceInitFunc) NULL,
86 (GInterfaceFinalizeFunc) NULL,
90 static const GInterfaceInfo atk_selection_info =
92 (GInterfaceInitFunc) NULL,
93 (GInterfaceFinalizeFunc) NULL,
97 static const GInterfaceInfo atk_table_info =
99 (GInterfaceInitFunc) NULL,
100 (GInterfaceFinalizeFunc) NULL,
104 static const GInterfaceInfo atk_table_cell_info =
106 (GInterfaceInitFunc) NULL,
107 (GInterfaceFinalizeFunc) NULL,
111 static const GInterfaceInfo atk_text_info =
113 (GInterfaceInitFunc) NULL,
114 (GInterfaceFinalizeFunc) NULL,
118 static const GInterfaceInfo atk_hypertext_info =
120 (GInterfaceInitFunc) NULL,
121 (GInterfaceFinalizeFunc) NULL,
125 static const GInterfaceInfo atk_value_info =
127 (GInterfaceInitFunc) NULL,
128 (GInterfaceFinalizeFunc) NULL,
132 static const GInterfaceInfo atk_document_info =
134 (GInterfaceInitFunc) NULL,
135 (GInterfaceFinalizeFunc) NULL,
139 static const GInterfaceInfo atk_window_info =
141 (GInterfaceInitFunc) NULL,
142 (GInterfaceFinalizeFunc) NULL,
146 type = g_type_register_static (ATK_TYPE_OBJECT,
147 "AtkNoOpObject", &tinfo, 0);
148 g_type_add_interface_static (type, ATK_TYPE_COMPONENT,
149 &atk_component_info);
150 g_type_add_interface_static (type, ATK_TYPE_ACTION,
152 g_type_add_interface_static (type, ATK_TYPE_EDITABLE_TEXT,
153 &atk_editable_text_info);
154 g_type_add_interface_static (type, ATK_TYPE_IMAGE,
156 g_type_add_interface_static (type, ATK_TYPE_SELECTION,
157 &atk_selection_info);
158 g_type_add_interface_static (type, ATK_TYPE_TABLE,
160 g_type_add_interface_static (type, ATK_TYPE_TABLE_CELL,
161 &atk_table_cell_info);
162 g_type_add_interface_static (type, ATK_TYPE_TEXT,
164 g_type_add_interface_static (type, ATK_TYPE_HYPERTEXT,
165 &atk_hypertext_info);
166 g_type_add_interface_static (type, ATK_TYPE_VALUE,
168 g_type_add_interface_static (type, ATK_TYPE_DOCUMENT,
170 g_type_add_interface_static (type, ATK_TYPE_WINDOW,
177 atk_no_op_object_class_init (AtkNoOpObjectClass *klass)
179 parent_class = g_type_class_peek_parent (klass);
183 * atk_no_op_object_new:
186 * Provides a default (non-functioning stub) #AtkObject.
187 * Application maintainers should not use this method.
189 * Returns: a default (non-functioning stub) #AtkObject
192 atk_no_op_object_new (GObject *obj)
194 AtkObject *accessible;
196 g_return_val_if_fail (obj != NULL, NULL);
198 accessible = g_object_new (ATK_TYPE_NO_OP_OBJECT, NULL);
199 g_return_val_if_fail (accessible != NULL, NULL);
201 accessible->role = ATK_ROLE_INVALID;
202 accessible->layer = ATK_LAYER_INVALID;