2 * This program is free software; you can redistribute it and/or modify it
3 * under the terms of the GNU Lesser General Public License as published by
4 * the Free Software Foundation.
6 * This program is distributed in the hope that it will be useful, but
7 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
8 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11 * You should have received a copy of the GNU Lesser General Public License
12 * along with this program; if not, see <http://www.gnu.org/licenses/>.
16 * Gilbert Fang <gilbert.fang@sun.com>
18 * This file is mainly from the gailfactory.h of GAIL.
20 * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
24 #if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION)
25 #error "Only <e-util/e-util.h> should be included directly."
28 #ifndef _GAL_A11Y_FACTORY_H__
29 #define _GAL_A11Y_FACTORY_H__
31 #include <atk/atkobject.h>
32 #include <atk/atkobjectfactory.h>
34 #define GAL_A11Y_FACTORY(type, type_as_function, opt_create_accessible) \
37 type_as_function ## _factory_get_accessible_type (void) \
43 type_as_function ## _factory_create_accessible (GObject *obj) \
46 AtkObject *accessible; \
48 g_return_val_if_fail (GTK_IS_WIDGET (obj), NULL); \
50 widget = GTK_WIDGET (obj); \
52 accessible = opt_create_accessible (widget); \
58 type_as_function ## _factory_class_init (AtkObjectFactoryClass *klass) \
60 klass->create_accessible = type_as_function ## _factory_create_accessible; \
61 klass->get_accessible_type = type_as_function ## _factory_get_accessible_type;\
65 type_as_function ## _factory_get_type (void) \
72 static const GTypeInfo tinfo = \
74 sizeof (AtkObjectFactoryClass), \
75 NULL, NULL, (GClassInitFunc) type_as_function ## _factory_class_init, \
76 NULL, NULL, sizeof (AtkObjectFactory), 0, NULL, NULL \
79 name = g_strconcat (g_type_name (type), "Factory", NULL); \
80 t = g_type_register_static ( \
81 ATK_TYPE_OBJECT_FACTORY, name, &tinfo, 0); \
88 #endif /* _GAL_A11Y_FACTORY_H__ */