aboutsummaryrefslogtreecommitdiffstats
path: root/a11y/ea-factory.h
diff options
context:
space:
mode:
authorBolian Yin <bolian.yin@sun.com>2003-08-27 11:36:42 +0800
committerBolian Yin <byin@src.gnome.org>2003-08-27 11:36:42 +0800
commite8fc140c7030594e556b56242afd2b52abc61634 (patch)
tree876546f299eef99a70b4c31868d83f6a903604bd /a11y/ea-factory.h
parent7e3eb5f87d84f5c7e7c945bb971367861928a9a0 (diff)
downloadgsoc2013-evolution-e8fc140c7030594e556b56242afd2b52abc61634.tar.gz
gsoc2013-evolution-e8fc140c7030594e556b56242afd2b52abc61634.tar.zst
gsoc2013-evolution-e8fc140c7030594e556b56242afd2b52abc61634.zip
add widgets directory; move calendar idl stuff to calendar directory; stop
2003-08-27 Bolian Yin <bolian.yin@sun.com> * Makefile.am: add widgets directory; move calendar idl stuff to calendar directory; stop make a single shared lib for whole a11y stuff. * ea-factory.h: make factory macros available to GOBJECT * calendar/Makefile.am: add calendar idl stuff * calendar/ea-cal-view-event.c: add atkcomponent interface. * calendar/ea-gnome-calendar.c (ea_gcal_switch_view_cb): add details for "children_changed". * new widgets directory for widgets a11y stuff, new files are: widgets/Makefile.am, widgets/ea-calendar-item.c, widgets/ea-calendar-item.h, widgets/ea-widgets.c, widgets/ea-widgets.h svn path=/trunk/; revision=22384
Diffstat (limited to 'a11y/ea-factory.h')
-rw-r--r--a11y/ea-factory.h49
1 files changed, 34 insertions, 15 deletions
diff --git a/a11y/ea-factory.h b/a11y/ea-factory.h
index 07d91271be..06ae612d6f 100644
--- a/a11y/ea-factory.h
+++ b/a11y/ea-factory.h
@@ -32,29 +32,40 @@
#include <glib-object.h>
#include <atk/atkobject.h>
-#define EA_FACTORY(type, type_as_function, opt_create_accessible) \
- \
-static GType \
-type_as_function ## _factory_get_accessible_type (void) \
-{ \
- return type; \
-} \
- \
+#define EA_FACTORY_PARTA_GOBJECT(type, type_as_function, opt_create_accessible) \
static AtkObject* \
type_as_function ## _factory_create_accessible (GObject *obj) \
-{ \
+{ \
+ AtkObject *accessible; \
+ g_return_val_if_fail (G_IS_OBJECT (obj), NULL); \
+ accessible = opt_create_accessible (G_OBJECT (obj)); \
+ return accessible; \
+}
+
+#define EA_FACTORY_PARTA(type, type_as_function, opt_create_accessible) \
+static AtkObject* \
+type_as_function ## _factory_create_accessible (GObject *obj) \
+{ \
GtkWidget *widget; \
AtkObject *accessible; \
- \
+ \
g_return_val_if_fail (GTK_IS_WIDGET (obj), NULL); \
\
widget = GTK_WIDGET (obj); \
\
accessible = opt_create_accessible (widget); \
+ return accessible; \
+}
+
+#define EA_FACTORY_PARTB(type, type_as_function, opt_create_accessible) \
\
- return accessible; \
+static GType \
+type_as_function ## _factory_get_accessible_type (void) \
+{ \
+ return type; \
} \
\
+ \
static void \
type_as_function ## _factory_class_init (AtkObjectFactoryClass *klass) \
{ \
@@ -72,8 +83,8 @@ type_as_function ## _factory_get_type (void) \
char *name; \
static const GTypeInfo tinfo = \
{ \
- sizeof (AtkObjectFactoryClass), \
- NULL, NULL, (GClassInitFunc) type_as_function ## _factory_class_init, \
+ sizeof (AtkObjectFactoryClass), \
+ NULL, NULL, (GClassInitFunc) type_as_function ## _factory_class_init, \
NULL, NULL, sizeof (AtkObjectFactory), 0, NULL, NULL \
}; \
\
@@ -86,9 +97,17 @@ type_as_function ## _factory_get_type (void) \
return t; \
}
-#define EA_SET_FACTORY(widget_type, type_as_function) \
+#define EA_FACTORY(type, type_as_function, opt_create_accessible) \
+ EA_FACTORY_PARTA(type, type_as_function, opt_create_accessible) \
+ EA_FACTORY_PARTB(type, type_as_function, opt_create_accessible)
+
+#define EA_FACTORY_GOBJECT(type, type_as_function, opt_create_accessible) \
+ EA_FACTORY_PARTA_GOBJECT(type, type_as_function, opt_create_accessible) \
+ EA_FACTORY_PARTB(type, type_as_function, opt_create_accessible)
+
+#define EA_SET_FACTORY(obj_type, type_as_function) \
atk_registry_set_factory_type (atk_get_default_registry (), \
- widget_type, \
+ obj_type, \
type_as_function ## _factory_get_type ())
#endif /* _EA_FACTORY_H__ */