1 /* GAIL - The GNOME Accessibility Implementation Library
3 * Copyright 2001 Sun Microsystems Inc.
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
22 #include "gtkcellaccessibleparent.h"
25 _gtk_cell_accessible_parent_get_type (void)
27 static volatile gsize g_define_type_id__volatile = 0;
29 if (g_once_init_enter (&g_define_type_id__volatile))
31 GType g_define_type_id =
32 g_type_register_static_simple (G_TYPE_INTERFACE,
33 "GtkCellAccessibleParent",
34 sizeof (GtkCellAccessibleParentIface),
40 g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
43 return g_define_type_id__volatile;
47 _gtk_cell_accessible_parent_get_cell_extents (GtkCellAccessibleParent *parent,
48 GtkCellAccessible *cell,
53 AtkCoordType coord_type)
55 GtkCellAccessibleParentIface *iface;
57 g_return_if_fail (GTK_IS_CELL_ACCESSIBLE_PARENT (parent));
59 iface = GTK_CELL_ACCESSIBLE_PARENT_GET_IFACE (parent);
61 if (iface->get_cell_extents)
62 (iface->get_cell_extents) (parent, cell, x, y, width, height, coord_type);
66 _gtk_cell_accessible_parent_get_cell_area (GtkCellAccessibleParent *parent,
67 GtkCellAccessible *cell,
68 GdkRectangle *cell_rect)
70 GtkCellAccessibleParentIface *iface;
72 g_return_if_fail (GTK_IS_CELL_ACCESSIBLE_PARENT (parent));
73 g_return_if_fail (cell_rect);
75 iface = GTK_CELL_ACCESSIBLE_PARENT_GET_IFACE (parent);
77 if (iface->get_cell_area)
78 (iface->get_cell_area) (parent, cell, cell_rect);
82 _gtk_cell_accessible_parent_grab_focus (GtkCellAccessibleParent *parent,
83 GtkCellAccessible *cell)
85 GtkCellAccessibleParentIface *iface;
87 g_return_val_if_fail (GTK_IS_CELL_ACCESSIBLE_PARENT (parent), FALSE);
89 iface = GTK_CELL_ACCESSIBLE_PARENT_GET_IFACE (parent);
91 if (iface->grab_focus)
92 return (iface->grab_focus) (parent, cell);
98 _gtk_cell_accessible_parent_get_child_index (GtkCellAccessibleParent *parent,
99 GtkCellAccessible *cell)
101 GtkCellAccessibleParentIface *iface;
103 g_return_val_if_fail (GTK_IS_CELL_ACCESSIBLE_PARENT (parent), FALSE);
105 iface = GTK_CELL_ACCESSIBLE_PARENT_GET_IFACE (parent);
107 if (iface->get_child_index)
108 return (iface->get_child_index) (parent, cell);
114 _gtk_cell_accessible_parent_get_renderer_state (GtkCellAccessibleParent *parent,
115 GtkCellAccessible *cell)
117 GtkCellAccessibleParentIface *iface;
119 g_return_val_if_fail (GTK_IS_CELL_ACCESSIBLE_PARENT (parent), 0);
120 g_return_val_if_fail (GTK_IS_CELL_ACCESSIBLE (cell), 0);
122 iface = GTK_CELL_ACCESSIBLE_PARENT_GET_IFACE (parent);
124 if (iface->get_renderer_state)
125 return (iface->get_renderer_state) (parent, cell);
131 _gtk_cell_accessible_parent_expand_collapse (GtkCellAccessibleParent *parent,
132 GtkCellAccessible *cell)
134 GtkCellAccessibleParentIface *iface;
136 g_return_if_fail (GTK_IS_CELL_ACCESSIBLE_PARENT (parent));
137 g_return_if_fail (GTK_IS_CELL_ACCESSIBLE (cell));
139 iface = GTK_CELL_ACCESSIBLE_PARENT_GET_IFACE (parent);
141 if (iface->expand_collapse)
142 (iface->expand_collapse) (parent, cell);
146 _gtk_cell_accessible_parent_activate (GtkCellAccessibleParent *parent,
147 GtkCellAccessible *cell)
149 GtkCellAccessibleParentIface *iface;
151 g_return_if_fail (GTK_IS_CELL_ACCESSIBLE_PARENT (parent));
152 g_return_if_fail (GTK_IS_CELL_ACCESSIBLE (cell));
154 iface = GTK_CELL_ACCESSIBLE_PARENT_GET_IFACE (parent);
157 (iface->activate) (parent, cell);
161 _gtk_cell_accessible_parent_edit (GtkCellAccessibleParent *parent,
162 GtkCellAccessible *cell)
164 GtkCellAccessibleParentIface *iface;
166 g_return_if_fail (GTK_IS_CELL_ACCESSIBLE_PARENT (parent));
167 g_return_if_fail (GTK_IS_CELL_ACCESSIBLE (cell));
169 iface = GTK_CELL_ACCESSIBLE_PARENT_GET_IFACE (parent);
172 (iface->edit) (parent, cell);