2012-10-30 14:21:44 +00:00
|
|
|
/* GTK+ - accessibility implementations
|
2007-12-18 13:51:12 +00:00
|
|
|
* 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
|
2012-02-27 13:01:10 +00:00
|
|
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
2007-12-18 13:51:12 +00:00
|
|
|
*/
|
|
|
|
|
2008-06-22 14:28:52 +00:00
|
|
|
#include "config.h"
|
2007-12-23 12:27:33 +00:00
|
|
|
|
2008-05-28 12:59:48 +00:00
|
|
|
#include <gtk/gtk.h>
|
2011-07-10 03:56:42 +00:00
|
|
|
#include "gtkcellaccessibleparent.h"
|
2007-12-18 13:51:12 +00:00
|
|
|
|
|
|
|
GType
|
2012-12-27 06:04:46 +00:00
|
|
|
gtk_cell_accessible_parent_get_type (void)
|
2007-12-18 13:51:12 +00:00
|
|
|
{
|
2007-12-23 12:24:59 +00:00
|
|
|
static volatile gsize g_define_type_id__volatile = 0;
|
2007-12-18 13:51:12 +00:00
|
|
|
|
2007-12-23 12:24:59 +00:00
|
|
|
if (g_once_init_enter (&g_define_type_id__volatile))
|
2007-12-18 13:51:12 +00:00
|
|
|
{
|
2007-12-23 12:24:59 +00:00
|
|
|
GType g_define_type_id =
|
|
|
|
g_type_register_static_simple (G_TYPE_INTERFACE,
|
2017-11-18 04:25:45 +00:00
|
|
|
g_intern_static_string ("GtkCellAccessibleParent"),
|
2011-07-10 03:56:42 +00:00
|
|
|
sizeof (GtkCellAccessibleParentIface),
|
2007-12-23 12:24:59 +00:00
|
|
|
NULL,
|
|
|
|
0,
|
|
|
|
NULL,
|
|
|
|
0);
|
|
|
|
|
|
|
|
g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
|
2007-12-18 13:51:12 +00:00
|
|
|
}
|
|
|
|
|
2007-12-23 12:24:59 +00:00
|
|
|
return g_define_type_id__volatile;
|
2007-12-18 13:51:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2012-12-27 06:04:46 +00:00
|
|
|
gtk_cell_accessible_parent_get_cell_extents (GtkCellAccessibleParent *parent,
|
|
|
|
GtkCellAccessible *cell,
|
|
|
|
gint *x,
|
|
|
|
gint *y,
|
|
|
|
gint *width,
|
|
|
|
gint *height,
|
|
|
|
AtkCoordType coord_type)
|
2007-12-18 13:51:12 +00:00
|
|
|
{
|
2011-07-10 03:56:42 +00:00
|
|
|
GtkCellAccessibleParentIface *iface;
|
2007-12-18 13:51:12 +00:00
|
|
|
|
2011-07-10 03:56:42 +00:00
|
|
|
g_return_if_fail (GTK_IS_CELL_ACCESSIBLE_PARENT (parent));
|
2007-12-18 13:51:12 +00:00
|
|
|
|
2011-07-10 03:56:42 +00:00
|
|
|
iface = GTK_CELL_ACCESSIBLE_PARENT_GET_IFACE (parent);
|
2007-12-18 13:51:12 +00:00
|
|
|
|
|
|
|
if (iface->get_cell_extents)
|
|
|
|
(iface->get_cell_extents) (parent, cell, x, y, width, height, coord_type);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2012-12-27 06:04:46 +00:00
|
|
|
gtk_cell_accessible_parent_get_cell_area (GtkCellAccessibleParent *parent,
|
|
|
|
GtkCellAccessible *cell,
|
|
|
|
GdkRectangle *cell_rect)
|
2007-12-18 13:51:12 +00:00
|
|
|
{
|
2011-07-10 03:56:42 +00:00
|
|
|
GtkCellAccessibleParentIface *iface;
|
2007-12-18 13:51:12 +00:00
|
|
|
|
2011-07-10 03:56:42 +00:00
|
|
|
g_return_if_fail (GTK_IS_CELL_ACCESSIBLE_PARENT (parent));
|
2007-12-18 13:51:12 +00:00
|
|
|
g_return_if_fail (cell_rect);
|
|
|
|
|
2011-07-10 03:56:42 +00:00
|
|
|
iface = GTK_CELL_ACCESSIBLE_PARENT_GET_IFACE (parent);
|
2007-12-18 13:51:12 +00:00
|
|
|
|
|
|
|
if (iface->get_cell_area)
|
|
|
|
(iface->get_cell_area) (parent, cell, cell_rect);
|
|
|
|
}
|
2011-07-09 22:30:59 +00:00
|
|
|
|
2007-12-18 13:51:12 +00:00
|
|
|
gboolean
|
2012-12-27 06:04:46 +00:00
|
|
|
gtk_cell_accessible_parent_grab_focus (GtkCellAccessibleParent *parent,
|
|
|
|
GtkCellAccessible *cell)
|
2007-12-18 13:51:12 +00:00
|
|
|
{
|
2011-07-10 03:56:42 +00:00
|
|
|
GtkCellAccessibleParentIface *iface;
|
2007-12-18 13:51:12 +00:00
|
|
|
|
2011-07-10 03:56:42 +00:00
|
|
|
g_return_val_if_fail (GTK_IS_CELL_ACCESSIBLE_PARENT (parent), FALSE);
|
2007-12-18 13:51:12 +00:00
|
|
|
|
2011-07-10 03:56:42 +00:00
|
|
|
iface = GTK_CELL_ACCESSIBLE_PARENT_GET_IFACE (parent);
|
2007-12-18 13:51:12 +00:00
|
|
|
|
|
|
|
if (iface->grab_focus)
|
|
|
|
return (iface->grab_focus) (parent, cell);
|
|
|
|
else
|
|
|
|
return FALSE;
|
|
|
|
}
|
2011-11-10 21:07:19 +00:00
|
|
|
|
|
|
|
int
|
2012-12-27 06:04:46 +00:00
|
|
|
gtk_cell_accessible_parent_get_child_index (GtkCellAccessibleParent *parent,
|
|
|
|
GtkCellAccessible *cell)
|
2011-11-10 21:07:19 +00:00
|
|
|
{
|
|
|
|
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;
|
|
|
|
}
|
2011-11-23 16:35:00 +00:00
|
|
|
|
2011-11-24 00:55:38 +00:00
|
|
|
GtkCellRendererState
|
2012-12-27 06:04:46 +00:00
|
|
|
gtk_cell_accessible_parent_get_renderer_state (GtkCellAccessibleParent *parent,
|
|
|
|
GtkCellAccessible *cell)
|
2011-11-24 00:55:38 +00:00
|
|
|
{
|
|
|
|
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)
|
2011-12-11 02:02:12 +00:00
|
|
|
return (iface->get_renderer_state) (parent, cell);
|
2011-11-24 00:55:38 +00:00
|
|
|
else
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2011-12-12 14:18:54 +00:00
|
|
|
void
|
2012-12-27 06:04:46 +00:00
|
|
|
gtk_cell_accessible_parent_expand_collapse (GtkCellAccessibleParent *parent,
|
|
|
|
GtkCellAccessible *cell)
|
2011-12-12 14:18:54 +00:00
|
|
|
{
|
|
|
|
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
|
2012-12-27 06:04:46 +00:00
|
|
|
gtk_cell_accessible_parent_activate (GtkCellAccessibleParent *parent,
|
|
|
|
GtkCellAccessible *cell)
|
2011-12-12 14:18:54 +00:00
|
|
|
{
|
|
|
|
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
|
2012-12-27 06:04:46 +00:00
|
|
|
gtk_cell_accessible_parent_edit (GtkCellAccessibleParent *parent,
|
|
|
|
GtkCellAccessible *cell)
|
2011-12-12 14:18:54 +00:00
|
|
|
{
|
|
|
|
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);
|
|
|
|
}
|
2014-03-24 14:51:38 +00:00
|
|
|
|
|
|
|
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);
|
|
|
|
}
|