1 | /* GAIL - The GNOME Accessibility Implementation Library |
---|
2 | * Copyright 2003 Sun Microsystems Inc. |
---|
3 | * |
---|
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. |
---|
8 | * |
---|
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. |
---|
13 | * |
---|
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. |
---|
18 | */ |
---|
19 | |
---|
20 | #include <gtk/gtk.h> |
---|
21 | #include "gailobjectfactory.h" |
---|
22 | #include "gailobject.h" |
---|
23 | |
---|
24 | static void gail_object_factory_class_init (GailObjectFactoryClass *klass); |
---|
25 | |
---|
26 | static AtkObject* gail_object_factory_create_accessible (GObject *obj); |
---|
27 | |
---|
28 | static GType gail_object_factory_get_accessible_type (void); |
---|
29 | |
---|
30 | GType |
---|
31 | gail_object_factory_get_type (void) |
---|
32 | { |
---|
33 | static GType type = 0; |
---|
34 | |
---|
35 | if (!type) |
---|
36 | { |
---|
37 | static const GTypeInfo tinfo = |
---|
38 | { |
---|
39 | sizeof (GailObjectFactoryClass), |
---|
40 | (GBaseInitFunc) NULL, /* base init */ |
---|
41 | (GBaseFinalizeFunc) NULL, /* base finalize */ |
---|
42 | (GClassInitFunc) gail_object_factory_class_init, /* class init */ |
---|
43 | (GClassFinalizeFunc) NULL, /* class finalize */ |
---|
44 | NULL, /* class data */ |
---|
45 | sizeof (GailObjectFactory), /* instance size */ |
---|
46 | 0, /* nb preallocs */ |
---|
47 | (GInstanceInitFunc) NULL, /* instance init */ |
---|
48 | NULL /* value table */ |
---|
49 | }; |
---|
50 | type = g_type_register_static ( |
---|
51 | ATK_TYPE_OBJECT_FACTORY, |
---|
52 | "GailObjectFactory" , &tinfo, 0); |
---|
53 | } |
---|
54 | |
---|
55 | return type; |
---|
56 | } |
---|
57 | |
---|
58 | static void |
---|
59 | gail_object_factory_class_init (GailObjectFactoryClass *klass) |
---|
60 | { |
---|
61 | AtkObjectFactoryClass *class = ATK_OBJECT_FACTORY_CLASS (klass); |
---|
62 | |
---|
63 | class->create_accessible = gail_object_factory_create_accessible; |
---|
64 | class->get_accessible_type = gail_object_factory_get_accessible_type; |
---|
65 | } |
---|
66 | |
---|
67 | static AtkObject* |
---|
68 | gail_object_factory_create_accessible (GObject *obj) |
---|
69 | { |
---|
70 | return gail_object_new (obj); |
---|
71 | } |
---|
72 | |
---|
73 | static GType |
---|
74 | gail_object_factory_get_accessible_type (void) |
---|
75 | { |
---|
76 | return GAIL_TYPE_OBJECT; |
---|
77 | } |
---|