1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189
|
/* GTK+ - accessibility implementations
* Copyright 2001 Sun Microsystems Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include <gtk/gtk.h>
#include "gtkcellaccessibleparent.h"
GType
gtk_cell_accessible_parent_get_type (void)
{
static volatile gsize g_define_type_id__volatile = 0;
if (g_once_init_enter (&g_define_type_id__volatile))
{
GType g_define_type_id =
g_type_register_static_simple (G_TYPE_INTERFACE,
"GtkCellAccessibleParent",
sizeof (GtkCellAccessibleParentIface),
NULL,
0,
NULL,
0);
g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
}
return g_define_type_id__volatile;
}
void
gtk_cell_accessible_parent_get_cell_extents (GtkCellAccessibleParent *parent,
GtkCellAccessible *cell,
gint *x,
gint *y,
gint *width,
gint *height,
AtkCoordType coord_type)
{
GtkCellAccessibleParentIface *iface;
g_return_if_fail (GTK_IS_CELL_ACCESSIBLE_PARENT (parent));
iface = GTK_CELL_ACCESSIBLE_PARENT_GET_IFACE (parent);
if (iface->get_cell_extents)
(iface->get_cell_extents) (parent, cell, x, y, width, height, coord_type);
}
void
gtk_cell_accessible_parent_get_cell_area (GtkCellAccessibleParent *parent,
GtkCellAccessible *cell,
GdkRectangle *cell_rect)
{
GtkCellAccessibleParentIface *iface;
g_return_if_fail (GTK_IS_CELL_ACCESSIBLE_PARENT (parent));
g_return_if_fail (cell_rect);
iface = GTK_CELL_ACCESSIBLE_PARENT_GET_IFACE (parent);
if (iface->get_cell_area)
(iface->get_cell_area) (parent, cell, cell_rect);
}
gboolean
gtk_cell_accessible_parent_grab_focus (GtkCellAccessibleParent *parent,
GtkCellAccessible *cell)
{
GtkCellAccessibleParentIface *iface;
g_return_val_if_fail (GTK_IS_CELL_ACCESSIBLE_PARENT (parent), FALSE);
iface = GTK_CELL_ACCESSIBLE_PARENT_GET_IFACE (parent);
if (iface->grab_focus)
return (iface->grab_focus) (parent, cell);
else
return FALSE;
}
int
gtk_cell_accessible_parent_get_child_index (GtkCellAccessibleParent *parent,
GtkCellAccessible *cell)
{
GtkCellAccessibleParentIface *iface;
g_return_val_if_fail (GTK_IS_CELL_ACCESSIBLE_PARENT (parent), FALSE);
iface = GTK_CELL_ACCESSIBLE_PARENT_GET_IFACE (parent);
if (iface->get_child_index)
return (iface->get_child_index) (parent, cell);
else
return -1;
}
GtkCellRendererState
gtk_cell_accessible_parent_get_renderer_state (GtkCellAccessibleParent *parent,
GtkCellAccessible *cell)
{
GtkCellAccessibleParentIface *iface;
g_return_val_if_fail (GTK_IS_CELL_ACCESSIBLE_PARENT (parent), 0);
g_return_val_if_fail (GTK_IS_CELL_ACCESSIBLE (cell), 0);
iface = GTK_CELL_ACCESSIBLE_PARENT_GET_IFACE (parent);
if (iface->get_renderer_state)
return (iface->get_renderer_state) (parent, cell);
else
return 0;
}
void
gtk_cell_accessible_parent_expand_collapse (GtkCellAccessibleParent *parent,
GtkCellAccessible *cell)
{
GtkCellAccessibleParentIface *iface;
g_return_if_fail (GTK_IS_CELL_ACCESSIBLE_PARENT (parent));
g_return_if_fail (GTK_IS_CELL_ACCESSIBLE (cell));
iface = GTK_CELL_ACCESSIBLE_PARENT_GET_IFACE (parent);
if (iface->expand_collapse)
(iface->expand_collapse) (parent, cell);
}
void
gtk_cell_accessible_parent_activate (GtkCellAccessibleParent *parent,
GtkCellAccessible *cell)
{
GtkCellAccessibleParentIface *iface;
g_return_if_fail (GTK_IS_CELL_ACCESSIBLE_PARENT (parent));
g_return_if_fail (GTK_IS_CELL_ACCESSIBLE (cell));
iface = GTK_CELL_ACCESSIBLE_PARENT_GET_IFACE (parent);
if (iface->activate)
(iface->activate) (parent, cell);
}
void
gtk_cell_accessible_parent_edit (GtkCellAccessibleParent *parent,
GtkCellAccessible *cell)
{
GtkCellAccessibleParentIface *iface;
g_return_if_fail (GTK_IS_CELL_ACCESSIBLE_PARENT (parent));
g_return_if_fail (GTK_IS_CELL_ACCESSIBLE (cell));
iface = GTK_CELL_ACCESSIBLE_PARENT_GET_IFACE (parent);
if (iface->edit)
(iface->edit) (parent, cell);
}
void
gtk_cell_accessible_parent_update_relationset (GtkCellAccessibleParent *parent,
GtkCellAccessible *cell,
AtkRelationSet *relationset)
{
GtkCellAccessibleParentIface *iface;
g_return_if_fail (GTK_IS_CELL_ACCESSIBLE_PARENT (parent));
g_return_if_fail (GTK_IS_CELL_ACCESSIBLE (cell));
g_return_if_fail (ATK_IS_RELATION_SET (relationset));
iface = GTK_CELL_ACCESSIBLE_PARENT_GET_IFACE (parent);
if (iface->update_relationset)
(iface->update_relationset) (parent, cell, relationset);
}
|