Blame modules/other/gail/gailcellparent.c

Packit Service fb6fa5
/* GAIL - The GNOME Accessibility Implementation Library
Packit Service fb6fa5
Packit Service fb6fa5
 * Copyright 2001 Sun Microsystems Inc.
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * This library is free software; you can redistribute it and/or
Packit Service fb6fa5
 * modify it under the terms of the GNU Lesser General Public
Packit Service fb6fa5
 * License as published by the Free Software Foundation; either
Packit Service fb6fa5
 * version 2 of the License, or (at your option) any later version.
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * This library is distributed in the hope that it will be useful,
Packit Service fb6fa5
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service fb6fa5
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit Service fb6fa5
 * Lesser General Public License for more details.
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * You should have received a copy of the GNU Lesser General Public
Packit Service fb6fa5
 * License along with this library; if not, write to the
Packit Service fb6fa5
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Packit Service fb6fa5
 * Boston, MA 02111-1307, USA.
Packit Service fb6fa5
 */
Packit Service fb6fa5
Packit Service fb6fa5
#include "config.h"
Packit Service fb6fa5
Packit Service fb6fa5
#include <gtk/gtk.h>
Packit Service fb6fa5
#include "gailcellparent.h"
Packit Service fb6fa5
Packit Service fb6fa5
GType
Packit Service fb6fa5
gail_cell_parent_get_type (void)
Packit Service fb6fa5
{
Packit Service fb6fa5
  static volatile gsize g_define_type_id__volatile = 0;
Packit Service fb6fa5
Packit Service fb6fa5
  if (g_once_init_enter (&g_define_type_id__volatile))
Packit Service fb6fa5
    {
Packit Service fb6fa5
      GType g_define_type_id =
Packit Service fb6fa5
        g_type_register_static_simple (G_TYPE_INTERFACE,
Packit Service fb6fa5
                                       "GailCellParent",
Packit Service fb6fa5
                                       sizeof (GailCellParentIface),
Packit Service fb6fa5
                                       NULL,
Packit Service fb6fa5
                                       0,
Packit Service fb6fa5
                                       NULL,
Packit Service fb6fa5
                                       0);
Packit Service fb6fa5
Packit Service fb6fa5
      g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
Packit Service fb6fa5
    }
Packit Service fb6fa5
Packit Service fb6fa5
  return g_define_type_id__volatile;
Packit Service fb6fa5
}
Packit Service fb6fa5
Packit Service fb6fa5
/**
Packit Service fb6fa5
 * gail_cell_parent_get_cell_extents:
Packit Service fb6fa5
 * @parent: a #GObject instance that implements GailCellParentIface
Packit Service fb6fa5
 * @cell: a #GailCell whose extents is required
Packit Service fb6fa5
 * @x: address of #gint to put x coordinate
Packit Service fb6fa5
 * @y: address of #gint to put y coordinate
Packit Service fb6fa5
 * @width: address of #gint to put width
Packit Service fb6fa5
 * @height: address of #gint to put height
Packit Service fb6fa5
 * @coord_type: specifies whether the coordinates are relative to the screen
Packit Service fb6fa5
 * or to the components top level window
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * Gets the rectangle which gives the extent of the @cell.
Packit Service fb6fa5
 *
Packit Service fb6fa5
 **/
Packit Service fb6fa5
void
Packit Service fb6fa5
gail_cell_parent_get_cell_extents (GailCellParent *parent,
Packit Service fb6fa5
                                   GailCell       *cell,
Packit Service fb6fa5
                                   gint           *x,
Packit Service fb6fa5
                                   gint           *y,
Packit Service fb6fa5
                                   gint           *width,
Packit Service fb6fa5
                                   gint           *height,
Packit Service fb6fa5
                                   AtkCoordType   coord_type)
Packit Service fb6fa5
{
Packit Service fb6fa5
  GailCellParentIface *iface;
Packit Service fb6fa5
Packit Service fb6fa5
  g_return_if_fail (GAIL_IS_CELL_PARENT (parent));
Packit Service fb6fa5
Packit Service fb6fa5
  iface = GAIL_CELL_PARENT_GET_IFACE (parent);
Packit Service fb6fa5
Packit Service fb6fa5
  if (iface->get_cell_extents)
Packit Service fb6fa5
    (iface->get_cell_extents) (parent, cell, x, y, width, height, coord_type);
Packit Service fb6fa5
}
Packit Service fb6fa5
Packit Service fb6fa5
/**
Packit Service fb6fa5
 * gail_cell_parent_get_cell_area:
Packit Service fb6fa5
 * @parent: a #GObject instance that implements GailCellParentIface
Packit Service fb6fa5
 * @cell: a #GailCell whose area is required
Packit Service fb6fa5
 * @cell_rect: address of #GdkRectangle to put the cell area
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * Gets the cell area of the @cell.
Packit Service fb6fa5
 *
Packit Service fb6fa5
 **/
Packit Service fb6fa5
void
Packit Service fb6fa5
gail_cell_parent_get_cell_area (GailCellParent *parent,
Packit Service fb6fa5
                                GailCell       *cell,
Packit Service fb6fa5
                                GdkRectangle   *cell_rect)
Packit Service fb6fa5
{
Packit Service fb6fa5
  GailCellParentIface *iface;
Packit Service fb6fa5
Packit Service fb6fa5
  g_return_if_fail (GAIL_IS_CELL_PARENT (parent));
Packit Service fb6fa5
  g_return_if_fail (cell_rect);
Packit Service fb6fa5
Packit Service fb6fa5
  iface = GAIL_CELL_PARENT_GET_IFACE (parent);
Packit Service fb6fa5
Packit Service fb6fa5
  if (iface->get_cell_area)
Packit Service fb6fa5
    (iface->get_cell_area) (parent, cell, cell_rect);
Packit Service fb6fa5
}
Packit Service fb6fa5
/**
Packit Service fb6fa5
 * gail_cell_parent_grab_focus:
Packit Service fb6fa5
 * @parent: a #GObject instance that implements GailCellParentIface
Packit Service fb6fa5
 * @cell: a #GailCell whose area is required
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * Puts focus in the specified cell.
Packit Service fb6fa5
 *
Packit Service fb6fa5
 **/
Packit Service fb6fa5
gboolean
Packit Service fb6fa5
gail_cell_parent_grab_focus (GailCellParent *parent,
Packit Service fb6fa5
                             GailCell       *cell)
Packit Service fb6fa5
{
Packit Service fb6fa5
  GailCellParentIface *iface;
Packit Service fb6fa5
Packit Service fb6fa5
  g_return_val_if_fail (GAIL_IS_CELL_PARENT (parent), FALSE);
Packit Service fb6fa5
Packit Service fb6fa5
  iface = GAIL_CELL_PARENT_GET_IFACE (parent);
Packit Service fb6fa5
Packit Service fb6fa5
  if (iface->grab_focus)
Packit Service fb6fa5
    return (iface->grab_focus) (parent, cell);
Packit Service fb6fa5
  else
Packit Service fb6fa5
    return FALSE;
Packit Service fb6fa5
}