Fixed string handling for NULL strings in libspi.
[platform/core/uifw/at-spi2-atk.git] / cspi / spi_table.c
1 int
2 AccessibleTable_ref (AccessibleTable *obj)
3 {
4   Accessibility_Table_ref (*obj, &ev);
5   return 0;
6 }
7
8
9
10 int
11 AccessibleTable_unref (AccessibleTable *obj)
12 {
13   Accessibility_Table_unref (*obj, &ev);
14   return 0;
15 }
16
17
18
19 Accessible *
20 AccessibleTable_getCaption (AccessibleTable *obj)
21 {
22   return (Accessible *)
23     Accessibility_Table__get_caption (*obj, &ev);
24 }
25
26
27
28 Accessible *
29 AccessibleTable_getSummary (AccessibleTable *obj)
30 {
31   return (Accessible *)
32     Accessibility_Table__get_summary (*obj, &ev);
33 }
34
35
36
37 long
38 AccessibleTable_getNRows (AccessibleTable *obj)
39 {
40   return (long)
41     Accessibility_Table__get_nRows (*obj, &ev);
42 }
43
44
45
46 long
47 AccessibleTable_getNColumns (AccessibleTable *obj)
48 {
49   return (long)
50     Accessibility_Table__get_nColumns (*obj, &ev);
51 }
52
53
54 Accessible *
55 AccessibleTable_getAccessibleAt (AccessibleTable *obj,
56                                  long row,
57                                  long column)
58 {
59   return (Accessible *)
60     Accessibility_Table_getAccessibleAt (*obj,
61                                (CORBA_long) row, (CORBA_long) column, &ev);
62 }
63
64
65 long
66 AccessibleTable_getIndexAt (AccessibleTable *obj,
67                             long row,
68                             long column)
69 {
70   return (long)
71     Accessibility_Table_getIndexAt (*obj,
72                                     (CORBA_long) row, (CORBA_long) column, &ev);
73 }
74
75
76
77 long
78 AccessibleTable_getRowAtIndex (AccessibleTable *obj,
79                                long index)
80 {
81   return (long)
82     Accessibility_Table_getRowAtIndex (*obj,
83                                        (CORBA_long) index, &ev);
84 }
85
86
87
88 long
89 AccessibleTable_getColumnAtIndex (AccessibleTable *obj,
90                                   long index)
91 {
92   return (long)
93     Accessibility_Table_getColumnAtIndex (*obj,
94                                           (CORBA_long) index, &ev);
95 }
96
97
98
99 char *
100 AccessibleTable_getRowDescription (AccessibleTable *obj,
101                                    long row)
102 {
103   return (char *)
104     Accessibility_Table_getRowDescription (*obj,
105                                            (CORBA_long) row, &ev);
106 }
107
108
109
110 char *
111 AccessibleTable_getColumnDescription (AccessibleTable *obj,
112                                       long column)
113 {
114   return (char *)
115     Accessibility_Table_getColumnDescription (*obj,
116                                               (CORBA_long) column, &ev);
117 }
118
119
120
121 long
122 AccessibleTable_getRowExtentAt (AccessibleTable *obj,
123                                 long row,
124                                 long column)
125 {
126   return (long)
127     Accessibility_Table_getRowExtentAt (*obj,
128                                         (CORBA_long) row, (CORBA_long) column, &ev);
129 }
130
131
132
133 long
134 AccessibleTable_getColumnExtentAt (AccessibleTable *obj,
135                                    long row,
136                                    long column)
137 {
138   return (long)
139     Accessibility_Table_getColumnExtentAt (*obj,
140                                         (CORBA_long) row, (CORBA_long) column, &ev);
141 }
142
143
144
145 Accessible *
146 AccessibleTable_getRowHeader (AccessibleTable *obj,
147                               long row)
148 {
149   return (Accessible *)
150     Accessibility_Table_getRowHeader (*obj,
151                                       (CORBA_long) row, &ev);
152 }
153
154
155
156 Accessible *
157 AccessibleTable_getColumnHeader (AccessibleTable *obj,
158                                  long column)
159 {
160   return (Accessible *)
161     Accessibility_Table_getColumnHeader (*obj,
162                                       (CORBA_long) column, &ev);
163 }
164
165
166
167 long
168 AccessibleTable_getNSelectedRows (AccessibleTable *obj)
169 {
170   return (long)
171     Accessibility_Table__get_nSelectedRows (*obj, &ev);
172 }
173
174
175
176 long
177 AccessibleTable_getSelectedRows (AccessibleTable *obj,
178                                  long **selectedRows)
179 {
180   Accessibility_LongSeq *rows = Accessibility_Table_getSelectedRows (*obj, &ev);
181   CORBA_long *i;
182   long *j;
183   long length;
184
185   i = rows->_buffer;
186   length = (long) rows->_length;
187   j = *selectedRows = malloc (sizeof(long)*length);
188   
189   while (length--)
190     *j++ = (CORBA_long) (*i++);
191
192   length = rows->_length;
193   CORBA_free (rows);
194   return length;
195 }
196
197
198
199 long
200 AccessibleTable_getNSelectedColumns (AccessibleTable *obj)
201 {
202   return (long)
203     Accessibility_Table__get_nSelectedColumns (*obj, &ev);
204 }
205
206
207 long
208 AccessibleTable_getSelectedColumns (AccessibleTable *obj,
209                                     long **selectedColumns)
210 {
211   Accessibility_LongSeq *columns = Accessibility_Table_getSelectedColumns (*obj, &ev);
212   CORBA_long *i;
213   long *j;
214   long length;
215
216   i = columns->_buffer;
217   length = (long) columns->_length;
218   j = *selectedColumns = malloc (sizeof(long)*length);
219   
220   while (length--)
221     *j++ = (CORBA_long) (*i++);
222
223   length = columns->_length;
224   CORBA_free (columns);
225   return length;
226 }
227
228
229 boolean
230 AccessibleTable_isRowSelected (AccessibleTable *obj,
231                                long row)
232 {
233   return (boolean)
234     Accessibility_Table_isRowSelected (*obj,
235                                        (CORBA_long) row, &ev);
236 }
237
238
239
240 boolean
241 AccessibleTable_isColumnSelected (AccessibleTable *obj,
242                                   long column)
243 {
244   return (boolean)
245     Accessibility_Table_isColumnSelected (*obj,
246                                        (CORBA_long) column, &ev);
247 }
248
249
250
251 boolean
252 AccessibleTable_isSelected (AccessibleTable *obj,
253                             long row,
254                             long column)
255 {
256 return (boolean)
257   Accessibility_Table_isSelected (*obj,
258                                   (CORBA_long) row, (CORBA_long) column, &ev);
259 }
260