1 /* GAIL - The GNOME Accessibility Implementation Library
2 * Copyright 2001 Sun Microsystems Inc.
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.
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.
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.
22 #include <libgtkhtml/gtkhtml.h>
23 #include "gailhtmlboxblock.h"
25 static void gail_html_box_block_class_init (GailHtmlBoxBlockClass *klass);
26 static gint gail_html_box_block_get_n_children (AtkObject *obj);
27 static AtkObject* gail_html_box_block_ref_child (AtkObject *obj,
30 G_DEFINE_TYPE (GailHtmlBoxBlock, gail_html_box_block, GAIL_TYPE_HTML_BOX)
33 gail_html_box_block_new (GObject *obj)
36 AtkObject *atk_object;
38 g_return_val_if_fail (HTML_IS_BOX_BLOCK (obj), NULL);
39 object = g_object_new (GAIL_TYPE_HTML_BOX_BLOCK, NULL);
40 atk_object = ATK_OBJECT (object);
41 atk_object_initialize (atk_object, obj);
42 atk_object->role = ATK_ROLE_PANEL;
47 gail_html_box_block_class_init (GailHtmlBoxBlockClass *klass)
49 AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
51 class->get_n_children = gail_html_box_block_get_n_children;
52 class->ref_child = gail_html_box_block_ref_child;
56 gail_html_box_block_get_n_children (AtkObject *obj)
58 AtkGObject *atk_gobject;
63 g_return_val_if_fail (GAIL_IS_HTML_BOX_BLOCK (obj), 0);
64 atk_gobject = ATK_GOBJECT (obj);
65 g_obj = atk_gobject_get_object (atk_gobject);
69 g_return_val_if_fail (HTML_IS_BOX (g_obj), 0);
70 box = HTML_BOX (g_obj);
76 child = box->children;
88 gail_html_box_block_ref_child (AtkObject *obj,
91 AtkGObject *atk_gobject;
94 AtkObject *atk_child = NULL;
97 g_return_val_if_fail (GAIL_IS_HTML_BOX_BLOCK (obj), NULL);
98 atk_gobject = ATK_GOBJECT (obj);
99 g_obj = atk_gobject_get_object (atk_gobject);
103 g_return_val_if_fail (HTML_IS_BOX (g_obj), NULL);
104 box = HTML_BOX (g_obj);
110 child = box->children;
116 atk_child = atk_gobject_get_accessible (G_OBJECT (child));
117 g_object_ref (atk_child);