No issues found
1 /*
2 * This program is free software; you can redistribute it and/or
3 * modify it under the terms of the GNU Lesser General Public
4 * License as published by the Free Software Foundation; either
5 * version 2 of the License, or (at your option) version 3.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10 * Lesser General Public License for more details.
11 *
12 * You should have received a copy of the GNU Lesser General Public
13 * License along with the program; if not, see <http://www.gnu.org/licenses/>
14 *
15 *
16 * Authors:
17 * Christopher James Lahey <clahey@ximian.com>
18 *
19 * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
20 *
21 */
22
23 #ifdef HAVE_CONFIG_H
24 #include <config.h>
25 #endif
26
27 #include "text/e-text.h"
28 #include "gal-a11y-e-text-factory.h"
29 #include "gal-a11y-e-text.h"
30
31 static AtkObjectFactoryClass *parent_class;
32 #define PARENT_TYPE (ATK_TYPE_OBJECT_FACTORY)
33
34 /* Static functions */
35
36 static GType
37 gal_a11y_e_text_factory_get_accessible_type (void)
38 {
39 return GAL_A11Y_TYPE_E_TEXT;
40 }
41
42 static AtkObject *
43 gal_a11y_e_text_factory_create_accessible (GObject *obj)
44 {
45 AtkObject *atk_object;
46
47 g_return_val_if_fail (E_IS_TEXT (obj), NULL);
48
49 atk_object = g_object_new (GAL_A11Y_TYPE_E_TEXT, NULL);
50 atk_object_initialize (atk_object, obj);
51
52 return atk_object;
53 }
54
55 static void
56 gal_a11y_e_text_factory_class_init (GalA11yETextFactoryClass *class)
57 {
58 AtkObjectFactoryClass *factory_class = ATK_OBJECT_FACTORY_CLASS (class);
59
60 parent_class = g_type_class_ref (PARENT_TYPE);
61
62 factory_class->create_accessible = gal_a11y_e_text_factory_create_accessible;
63 factory_class->get_accessible_type = gal_a11y_e_text_factory_get_accessible_type;
64 }
65
66 static void
67 gal_a11y_e_text_factory_init (GalA11yETextFactory *factory)
68 {
69 }
70
71 /**
72 * gal_a11y_e_text_factory_get_type:
73 * @void:
74 *
75 * Registers the &GalA11yETextFactory class if necessary, and returns the type ID
76 * associated to it.
77 *
78 * Return value: The type ID of the &GalA11yETextFactory class.
79 **/
80 GType
81 gal_a11y_e_text_factory_get_type (void)
82 {
83 static GType type = 0;
84
85 if (!type) {
86 GTypeInfo info = {
87 sizeof (GalA11yETextFactoryClass),
88 (GBaseInitFunc) NULL,
89 (GBaseFinalizeFunc) NULL,
90 (GClassInitFunc) gal_a11y_e_text_factory_class_init,
91 (GClassFinalizeFunc) NULL,
92 NULL, /* class_data */
93 sizeof (GalA11yETextFactory),
94 0,
95 (GInstanceInitFunc) gal_a11y_e_text_factory_init,
96 NULL /* value_text */
97 };
98
99 type = g_type_register_static (PARENT_TYPE, "GalA11yETextFactory", &info, 0);
100 }
101
102 return type;
103 }