]> Pileus Git - ~andy/gtk/blob - modules/other/gail/gailcellparent.c
883b7194ac2a40a1c0bfdc29a633d53659ae925a
[~andy/gtk] / modules / other / gail / gailcellparent.c
1 /* GAIL - The GNOME Accessibility Implementation Library
2
3  * Copyright 2001 Sun Microsystems Inc.
4  *
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.
9  *
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.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18  * Boston, MA 02111-1307, USA.
19  */
20
21 #include "config.h"
22
23 #include <gtk/gtk.h>
24 #include "gailcellparent.h"
25
26 GType
27 gail_cell_parent_get_type (void)
28 {
29   static volatile gsize g_define_type_id__volatile = 0;
30
31   if (g_once_init_enter (&g_define_type_id__volatile))
32     {
33       GType g_define_type_id =
34         g_type_register_static_simple (G_TYPE_INTERFACE,
35                                        "GailCellParent",
36                                        sizeof (GailCellParentIface),
37                                        NULL,
38                                        0,
39                                        NULL,
40                                        0);
41
42       g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
43     }
44
45   return g_define_type_id__volatile;
46 }
47
48 /**
49  * gail_cell_parent_get_cell_extents:
50  * @parent: a #GObject instance that implements GailCellParentIface
51  * @cell: a #GailCell whose extents is required
52  * @x: address of #gint to put x coordinate
53  * @y: address of #gint to put y coordinate
54  * @width: address of #gint to put width
55  * @height: address of #gint to put height
56  * @coord_type: specifies whether the coordinates are relative to the screen
57  * or to the components top level window
58  *
59  * Gets the rectangle which gives the extent of the @cell.
60  *
61  **/
62 void
63 gail_cell_parent_get_cell_extents (GailCellParent *parent,
64                                    GailCell       *cell,
65                                    gint           *x,
66                                    gint           *y,
67                                    gint           *width,
68                                    gint           *height,
69                                    AtkCoordType   coord_type)
70 {
71   GailCellParentIface *iface;
72
73   g_return_if_fail (GAIL_IS_CELL_PARENT (parent));
74
75   iface = GAIL_CELL_PARENT_GET_IFACE (parent);
76
77   if (iface->get_cell_extents)
78     (iface->get_cell_extents) (parent, cell, x, y, width, height, coord_type);
79 }
80
81 /**
82  * gail_cell_parent_get_cell_area:
83  * @parent: a #GObject instance that implements GailCellParentIface
84  * @cell: a #GailCell whose area is required
85  * @cell_rect: address of #GdkRectangle to put the cell area
86  *
87  * Gets the cell area of the @cell.
88  *
89  **/
90 void
91 gail_cell_parent_get_cell_area (GailCellParent *parent,
92                                 GailCell       *cell,
93                                 GdkRectangle   *cell_rect)
94 {
95   GailCellParentIface *iface;
96
97   g_return_if_fail (GAIL_IS_CELL_PARENT (parent));
98   g_return_if_fail (cell_rect);
99
100   iface = GAIL_CELL_PARENT_GET_IFACE (parent);
101
102   if (iface->get_cell_area)
103     (iface->get_cell_area) (parent, cell, cell_rect);
104 }
105 /**
106  * gail_cell_parent_grab_focus:
107  * @parent: a #GObject instance that implements GailCellParentIface
108  * @cell: a #GailCell whose area is required
109  *
110  * Puts focus in the specified cell.
111  *
112  **/
113 gboolean
114 gail_cell_parent_grab_focus (GailCellParent *parent,
115                              GailCell       *cell)
116 {
117   GailCellParentIface *iface;
118
119   g_return_val_if_fail (GAIL_IS_CELL_PARENT (parent), FALSE);
120
121   iface = GAIL_CELL_PARENT_GET_IFACE (parent);
122
123   if (iface->grab_focus)
124     return (iface->grab_focus) (parent, cell);
125   else
126     return FALSE;
127 }