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