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_text_info
=
106 (GInterfaceInitFunc
) NULL
,
107 (GInterfaceFinalizeFunc
) NULL
,
111 static const GInterfaceInfo atk_hypertext_info
=
113 (GInterfaceInitFunc
) NULL
,
114 (GInterfaceFinalizeFunc
) NULL
,
118 static const GInterfaceInfo atk_value_info
=
120 (GInterfaceInitFunc
) NULL
,
121 (GInterfaceFinalizeFunc
) NULL
,
125 static const GInterfaceInfo atk_document_info
=
127 (GInterfaceInitFunc
) NULL
,
128 (GInterfaceFinalizeFunc
) NULL
,
132 static const GInterfaceInfo atk_window_info
=
134 (GInterfaceInitFunc
) NULL
,
135 (GInterfaceFinalizeFunc
) 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
,
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
,
149 g_type_add_interface_static (type
, ATK_TYPE_SELECTION
,
150 &atk_selection_info
);
151 g_type_add_interface_static (type
, ATK_TYPE_TABLE
,
153 g_type_add_interface_static (type
, ATK_TYPE_TEXT
,
155 g_type_add_interface_static (type
, ATK_TYPE_HYPERTEXT
,
156 &atk_hypertext_info
);
157 g_type_add_interface_static (type
, ATK_TYPE_VALUE
,
159 g_type_add_interface_static (type
, ATK_TYPE_DOCUMENT
,
161 g_type_add_interface_static (type
, ATK_TYPE_WINDOW
,
168 atk_no_op_object_class_init (AtkNoOpObjectClass
*klass
)
170 parent_class
= g_type_class_peek_parent (klass
);
174 * atk_no_op_object_new:
177 * Provides a default (non-functioning stub) #AtkObject.
178 * Application maintainers should not use this method.
180 * Returns: a default (non-functioning stub) #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
;