Gconf-less
[gtkhtml/pkgcrosswire.git] / a11y / cell.c
blob4593ee8575015adc27aaab506d303b90e03565af
1 /* This file is part of the GtkHTML library.
3 * Copyright 2002 Ximian, Inc.
5 * Author: Radek Doulik
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Library General Public License for more details.
18 * You should have received a copy of the GNU Library General Public License
19 * along with this library; see the file COPYING.LIB. If not, write to
20 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301, USA.
24 #include <config.h>
26 #include "htmltablecell.h"
28 #include "html.h"
29 #include "cell.h"
31 static void html_a11y_cell_class_init (HTMLA11YCellClass *klass);
32 static void html_a11y_cell_init (HTMLA11YCell *a11y_cell);
34 static AtkObjectClass *parent_class = NULL;
36 GType
37 html_a11y_cell_get_type (void)
39 static GType type = 0;
41 if (!type) {
42 static const GTypeInfo tinfo = {
43 sizeof (HTMLA11YCellClass),
44 NULL, /* base init */
45 NULL, /* base finalize */
46 (GClassInitFunc) html_a11y_cell_class_init, /* class init */
47 NULL, /* class finalize */
48 NULL, /* class data */
49 sizeof (HTMLA11YCell), /* instance size */
50 0, /* nb preallocs */
51 (GInstanceInitFunc) html_a11y_cell_init, /* instance init */
52 NULL /* value cell */
55 type = g_type_register_static (G_TYPE_HTML_A11Y, "HTMLA11YCell", &tinfo, 0);
58 return type;
61 static void
62 html_a11y_cell_finalize (GObject *obj)
64 G_OBJECT_CLASS (parent_class)->finalize (obj);
67 static void
68 html_a11y_cell_initialize (AtkObject *obj, gpointer data)
70 /* printf ("html_a11y_cell_initialize\n"); */
72 if (ATK_OBJECT_CLASS (parent_class)->initialize)
73 ATK_OBJECT_CLASS (parent_class)->initialize (obj, data);
76 static void
77 html_a11y_cell_class_init (HTMLA11YCellClass *klass)
79 GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
80 AtkObjectClass *atk_class = ATK_OBJECT_CLASS (klass);
82 parent_class = g_type_class_peek_parent (klass);
84 atk_class->initialize = html_a11y_cell_initialize;
85 gobject_class->finalize = html_a11y_cell_finalize;
88 static void
89 html_a11y_cell_init (HTMLA11YCell *a11y_cell)
93 AtkObject*
94 html_a11y_cell_new (HTMLObject *html_obj)
96 GObject *object;
97 AtkObject *accessible;
99 g_return_val_if_fail (HTML_IS_TABLE_CELL (html_obj), NULL);
101 object = g_object_new (G_TYPE_HTML_A11Y_CELL, NULL);
103 accessible = ATK_OBJECT (object);
104 atk_object_initialize (accessible, html_obj);
106 accessible->role = ATK_ROLE_TABLE_CELL;
108 /* printf ("created new html accessible table cell object\n"); */
110 return accessible;