1
/*
2
 * AT-SPI - Assistive Technology Service Provider Interface
3
 * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
4
 *
5
 * Copyright 2008 Novell, Inc.
6
 * Copyright 2001, 2002 Sun Microsystems Inc.,
7
 * Copyright 2001, 2002 Ximian, Inc.
8
 *
9
 * This library is free software; you can redistribute it and/or
10
 * modify it under the terms of the GNU Lesser General Public
11
 * License as published by the Free Software Foundation; either
12
 * version 2.1 of the License, or (at your option) any later version.
13
 *
14
 * This library is distributed in the hope that it will be useful,
15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17
 * Lesser General Public License for more details.
18
 *
19
 * You should have received a copy of the GNU Lesser General Public
20
 * License along with this library; if not, write to the
21
 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22
 * Boston, MA 02110-1301, USA.
23
 */
24

            
25
#define ATK_DISABLE_DEPRECATION_WARNINGS
26
#include "bridge.h"
27
#include <atk/atk.h>
28
#include <droute/droute.h>
29

            
30
#include "spi-dbus.h"
31

            
32
#include "introspection.h"
33
#include "object.h"
34

            
35
static dbus_bool_t
36
1
impl_get_NRows (DBusMessageIter *iter, void *user_data)
37
{
38
1
  AtkTable *table = (AtkTable *) user_data;
39
1
  g_return_val_if_fail (ATK_IS_TABLE (user_data), FALSE);
40
1
  return droute_return_v_int32 (iter, atk_table_get_n_rows (table));
41
}
42

            
43
static dbus_bool_t
44
1
impl_get_NColumns (DBusMessageIter *iter, void *user_data)
45
{
46
1
  AtkTable *table = (AtkTable *) user_data;
47
1
  g_return_val_if_fail (ATK_IS_TABLE (user_data), FALSE);
48
1
  return droute_return_v_int32 (iter, atk_table_get_n_columns (table));
49
}
50

            
51
static dbus_bool_t
52
1
impl_get_Caption (DBusMessageIter *iter, void *user_data)
53
{
54
1
  AtkTable *table = (AtkTable *) user_data;
55
1
  g_return_val_if_fail (ATK_IS_TABLE (user_data), FALSE);
56
1
  spi_object_append_v_reference (iter, atk_table_get_caption (table));
57
1
  return TRUE;
58
}
59

            
60
static dbus_bool_t
61
1
impl_get_Summary (DBusMessageIter *iter, void *user_data)
62
{
63
1
  AtkTable *table = (AtkTable *) user_data;
64
1
  g_return_val_if_fail (ATK_IS_TABLE (user_data), FALSE);
65
1
  spi_object_append_v_reference (iter, atk_table_get_summary (table));
66
1
  return TRUE;
67
}
68

            
69
static dbus_bool_t
70
1
impl_get_NSelectedRows (DBusMessageIter *iter, void *user_data)
71
{
72
1
  AtkTable *table = (AtkTable *) user_data;
73
1
  gint *selected_rows = NULL;
74
  int count;
75
1
  g_return_val_if_fail (ATK_IS_TABLE (user_data), FALSE);
76
1
  count = atk_table_get_selected_rows (table, &selected_rows);
77
1
  if (selected_rows)
78
1
    g_free (selected_rows);
79
1
  return droute_return_v_int32 (iter, count);
80
}
81

            
82
static dbus_bool_t
83
1
impl_get_NSelectedColumns (DBusMessageIter *iter, void *user_data)
84
{
85
1
  AtkTable *table = (AtkTable *) user_data;
86
1
  gint *selected_columns = NULL;
87
  int count;
88
1
  g_return_val_if_fail (ATK_IS_TABLE (user_data), FALSE);
89
1
  count = atk_table_get_selected_columns (table, &selected_columns);
90
1
  if (selected_columns)
91
1
    g_free (selected_columns);
92
1
  return droute_return_v_int32 (iter, count);
93
}
94

            
95
static DBusMessage *
96
2
impl_GetAccessibleAt (DBusConnection *bus, DBusMessage *message, void *user_data)
97
{
98
2
  AtkTable *table = (AtkTable *) user_data;
99
  dbus_int32_t row, column;
100
  DBusMessage *reply;
101
  AtkObject *obj;
102

            
103
2
  g_return_val_if_fail (ATK_IS_TABLE (user_data),
104
                        droute_not_yet_handled_error (message));
105
2
  if (!dbus_message_get_args (message, NULL, DBUS_TYPE_INT32, &row, DBUS_TYPE_INT32, &column,
106
                              DBUS_TYPE_INVALID))
107
    {
108
      return droute_invalid_arguments_error (message);
109
    }
110
2
  obj = atk_table_ref_at (table, row, column);
111
2
  reply = spi_object_return_reference (message, obj);
112
2
  if (obj)
113
2
    g_object_unref (obj);
114

            
115
2
  return reply;
116
}
117

            
118
static DBusMessage *
119
3
impl_GetIndexAt (DBusConnection *bus, DBusMessage *message, void *user_data)
120
{
121
3
  AtkTable *table = (AtkTable *) user_data;
122
  dbus_int32_t row, column;
123
  dbus_int32_t index;
124
  DBusMessage *reply;
125

            
126
3
  g_return_val_if_fail (ATK_IS_TABLE (user_data),
127
                        droute_not_yet_handled_error (message));
128
3
  if (!dbus_message_get_args (message, NULL, DBUS_TYPE_INT32, &row, DBUS_TYPE_INT32, &column,
129
                              DBUS_TYPE_INVALID))
130
    {
131
      return droute_invalid_arguments_error (message);
132
    }
133
3
  index = atk_table_get_index_at (table, row, column);
134
3
  reply = dbus_message_new_method_return (message);
135
3
  if (reply)
136
    {
137
3
      dbus_message_append_args (reply, DBUS_TYPE_INT32, &index,
138
                                DBUS_TYPE_INVALID);
139
    }
140
3
  return reply;
141
}
142

            
143
static DBusMessage *
144
4
impl_GetRowAtIndex (DBusConnection *bus, DBusMessage *message, void *user_data)
145
{
146
4
  AtkTable *table = (AtkTable *) user_data;
147
  dbus_int32_t index;
148
  dbus_int32_t row;
149
  DBusMessage *reply;
150

            
151
4
  g_return_val_if_fail (ATK_IS_TABLE (user_data),
152
                        droute_not_yet_handled_error (message));
153
4
  if (!dbus_message_get_args (message, NULL, DBUS_TYPE_INT32, &index, DBUS_TYPE_INVALID))
154
    {
155
      return droute_invalid_arguments_error (message);
156
    }
157
4
  row = atk_table_get_row_at_index (table, index);
158
4
  reply = dbus_message_new_method_return (message);
159
4
  if (reply)
160
    {
161
4
      dbus_message_append_args (reply, DBUS_TYPE_INT32, &row,
162
                                DBUS_TYPE_INVALID);
163
    }
164
4
  return reply;
165
}
166

            
167
static DBusMessage *
168
3
impl_GetColumnAtIndex (DBusConnection *bus, DBusMessage *message, void *user_data)
169
{
170
3
  AtkTable *table = (AtkTable *) user_data;
171
  dbus_int32_t index;
172
  dbus_int32_t column;
173
  DBusMessage *reply;
174

            
175
3
  g_return_val_if_fail (ATK_IS_TABLE (user_data),
176
                        droute_not_yet_handled_error (message));
177
3
  if (!dbus_message_get_args (message, NULL, DBUS_TYPE_INT32, &index, DBUS_TYPE_INVALID))
178
    {
179
      return droute_invalid_arguments_error (message);
180
    }
181
3
  column = atk_table_get_column_at_index (table, index);
182
3
  reply = dbus_message_new_method_return (message);
183
3
  if (reply)
184
    {
185
3
      dbus_message_append_args (reply, DBUS_TYPE_INT32, &column,
186
                                DBUS_TYPE_INVALID);
187
    }
188
3
  return reply;
189
}
190

            
191
static const gchar *
192
4
validate_unallocated_string (const gchar *str)
193
{
194
4
  if (!str)
195
    return "";
196
4
  if (!g_utf8_validate (str, -1, NULL))
197
    {
198
      g_warning ("atk-bridge: received bad UTF-8 string from a table function");
199
      return "";
200
    }
201
4
  return str;
202
}
203

            
204
static DBusMessage *
205
2
impl_GetRowDescription (DBusConnection *bus, DBusMessage *message, void *user_data)
206
{
207
  dbus_int32_t row;
208
2
  AtkTable *table = (AtkTable *) user_data;
209
  const gchar *description;
210
  DBusMessage *reply;
211

            
212
2
  g_return_val_if_fail (ATK_IS_TABLE (user_data),
213
                        droute_not_yet_handled_error (message));
214
2
  if (!dbus_message_get_args (message, NULL, DBUS_TYPE_INT32, &row, DBUS_TYPE_INVALID))
215
    {
216
      return droute_invalid_arguments_error (message);
217
    }
218
2
  description = atk_table_get_row_description (table, row);
219
2
  description = validate_unallocated_string (description);
220
2
  reply = dbus_message_new_method_return (message);
221
2
  if (reply)
222
    {
223
2
      dbus_message_append_args (reply, DBUS_TYPE_STRING, &description,
224
                                DBUS_TYPE_INVALID);
225
    }
226
2
  return reply;
227
}
228

            
229
static DBusMessage *
230
2
impl_GetColumnDescription (DBusConnection *bus, DBusMessage *message, void *user_data)
231
{
232
2
  AtkTable *table = (AtkTable *) user_data;
233
  dbus_int32_t column;
234
  const char *description;
235
  DBusMessage *reply;
236

            
237
2
  g_return_val_if_fail (ATK_IS_TABLE (user_data),
238
                        droute_not_yet_handled_error (message));
239
2
  if (!dbus_message_get_args (message, NULL, DBUS_TYPE_INT32, &column, DBUS_TYPE_INVALID))
240
    {
241
      return droute_invalid_arguments_error (message);
242
    }
243
2
  description = atk_table_get_column_description (table, column);
244
2
  description = validate_unallocated_string (description);
245
2
  reply = dbus_message_new_method_return (message);
246
2
  if (reply)
247
    {
248
2
      dbus_message_append_args (reply, DBUS_TYPE_STRING, &description,
249
                                DBUS_TYPE_INVALID);
250
    }
251
2
  return reply;
252
}
253

            
254
static DBusMessage *
255
1
impl_GetRowExtentAt (DBusConnection *bus, DBusMessage *message, void *user_data)
256
{
257
1
  AtkTable *table = (AtkTable *) user_data;
258
  dbus_int32_t row, column;
259
  dbus_int32_t extent;
260
  DBusMessage *reply;
261

            
262
1
  g_return_val_if_fail (ATK_IS_TABLE (user_data),
263
                        droute_not_yet_handled_error (message));
264
1
  if (!dbus_message_get_args (message, NULL, DBUS_TYPE_INT32, &row, DBUS_TYPE_INT32, &column,
265
                              DBUS_TYPE_INVALID))
266
    {
267
      return droute_invalid_arguments_error (message);
268
    }
269
1
  extent = atk_table_get_row_extent_at (table, row, column);
270
1
  reply = dbus_message_new_method_return (message);
271
1
  if (reply)
272
    {
273
1
      dbus_message_append_args (reply, DBUS_TYPE_INT32, &extent,
274
                                DBUS_TYPE_INVALID);
275
    }
276
1
  return reply;
277
}
278

            
279
static DBusMessage *
280
1
impl_GetColumnExtentAt (DBusConnection *bus, DBusMessage *message, void *user_data)
281
{
282
1
  AtkTable *table = (AtkTable *) user_data;
283
  dbus_int32_t row, column;
284
  dbus_int32_t extent;
285
  DBusMessage *reply;
286

            
287
1
  g_return_val_if_fail (ATK_IS_TABLE (user_data),
288
                        droute_not_yet_handled_error (message));
289
1
  if (!dbus_message_get_args (message, NULL, DBUS_TYPE_INT32, &row, DBUS_TYPE_INT32, &column,
290
                              DBUS_TYPE_INVALID))
291
    {
292
      return droute_invalid_arguments_error (message);
293
    }
294
1
  extent = atk_table_get_column_extent_at (table, row, column);
295
1
  reply = dbus_message_new_method_return (message);
296
1
  if (reply)
297
    {
298
1
      dbus_message_append_args (reply, DBUS_TYPE_INT32, &extent,
299
                                DBUS_TYPE_INVALID);
300
    }
301
1
  return reply;
302
}
303

            
304
static DBusMessage *
305
2
impl_GetRowHeader (DBusConnection *bus, DBusMessage *message, void *user_data)
306
{
307
2
  AtkTable *table = (AtkTable *) user_data;
308
  dbus_int32_t row;
309
2
  AtkObject *obj = NULL;
310

            
311
2
  g_return_val_if_fail (ATK_IS_TABLE (user_data),
312
                        droute_not_yet_handled_error (message));
313
2
  if (!dbus_message_get_args (message, NULL, DBUS_TYPE_INT32, &row, DBUS_TYPE_INVALID))
314
    {
315
      return droute_invalid_arguments_error (message);
316
    }
317
2
  obj = atk_table_get_row_header (table, row);
318
2
  return spi_object_return_reference (message, obj);
319
}
320

            
321
static DBusMessage *
322
3
impl_GetColumnHeader (DBusConnection *bus, DBusMessage *message, void *user_data)
323
{
324
3
  AtkTable *table = (AtkTable *) user_data;
325
  dbus_int32_t column;
326
  AtkObject *obj;
327

            
328
3
  g_return_val_if_fail (ATK_IS_TABLE (user_data),
329
                        droute_not_yet_handled_error (message));
330
3
  if (!dbus_message_get_args (message, NULL, DBUS_TYPE_INT32, &column, DBUS_TYPE_INVALID))
331
    {
332
      return droute_invalid_arguments_error (message);
333
    }
334
3
  obj = atk_table_get_column_header (table, column);
335
3
  return spi_object_return_reference (message, obj);
336
}
337

            
338
static DBusMessage *
339
1
impl_GetSelectedRows (DBusConnection *bus, DBusMessage *message, void *user_data)
340
{
341
1
  AtkTable *table = (AtkTable *) user_data;
342
1
  gint *selected_rows = NULL;
343
  gint count;
344
  DBusMessage *reply;
345

            
346
1
  g_return_val_if_fail (ATK_IS_TABLE (user_data),
347
                        droute_not_yet_handled_error (message));
348
1
  count = atk_table_get_selected_rows (table, &selected_rows);
349
1
  if (!selected_rows)
350
    count = 0;
351
1
  reply = dbus_message_new_method_return (message);
352
1
  if (reply)
353
    {
354
      /* tbd - figure out if this is safe for a 0-length array */
355
1
      dbus_message_append_args (reply, DBUS_TYPE_ARRAY, DBUS_TYPE_INT32,
356
                                &selected_rows, count, DBUS_TYPE_INVALID);
357
    }
358
1
  if (selected_rows)
359
1
    g_free (selected_rows);
360
1
  return reply;
361
}
362

            
363
static DBusMessage *
364
1
impl_GetSelectedColumns (DBusConnection *bus, DBusMessage *message, void *user_data)
365
{
366
1
  AtkTable *table = (AtkTable *) user_data;
367
1
  gint *selected_columns = NULL;
368
  gint count;
369
  DBusMessage *reply;
370

            
371
1
  g_return_val_if_fail (ATK_IS_TABLE (user_data),
372
                        droute_not_yet_handled_error (message));
373
1
  count = atk_table_get_selected_columns (table, &selected_columns);
374
1
  if (!selected_columns)
375
    count = 0;
376
1
  reply = dbus_message_new_method_return (message);
377
1
  if (reply)
378
    {
379
      /* tbd - figure out if this is safe for a 0-length array */
380
1
      dbus_message_append_args (reply, DBUS_TYPE_ARRAY, DBUS_TYPE_INT32,
381
                                &selected_columns, count, DBUS_TYPE_INVALID);
382
    }
383
1
  if (selected_columns)
384
1
    g_free (selected_columns);
385
1
  return reply;
386
}
387

            
388
static DBusMessage *
389
6
impl_IsRowSelected (DBusConnection *bus, DBusMessage *message, void *user_data)
390
{
391
6
  AtkTable *table = (AtkTable *) user_data;
392
  dbus_int32_t row;
393
  DBusMessage *reply;
394
  dbus_bool_t ret;
395

            
396
6
  g_return_val_if_fail (ATK_IS_TABLE (user_data),
397
                        droute_not_yet_handled_error (message));
398
6
  if (!dbus_message_get_args (message, NULL, DBUS_TYPE_INT32, &row, DBUS_TYPE_INVALID))
399
    {
400
      return droute_invalid_arguments_error (message);
401
    }
402
6
  ret = atk_table_is_row_selected (table, row);
403
6
  reply = dbus_message_new_method_return (message);
404
6
  if (reply)
405
    {
406
6
      dbus_message_append_args (reply, DBUS_TYPE_BOOLEAN, &ret,
407
                                DBUS_TYPE_INVALID);
408
    }
409
6
  return reply;
410
}
411

            
412
static DBusMessage *
413
6
impl_IsColumnSelected (DBusConnection *bus, DBusMessage *message, void *user_data)
414
{
415
6
  AtkTable *table = (AtkTable *) user_data;
416
  dbus_int32_t column;
417
  DBusMessage *reply;
418
  dbus_bool_t ret;
419

            
420
6
  g_return_val_if_fail (ATK_IS_TABLE (user_data),
421
                        droute_not_yet_handled_error (message));
422
6
  if (!dbus_message_get_args (message, NULL, DBUS_TYPE_INT32, &column, DBUS_TYPE_INVALID))
423
    {
424
      return droute_invalid_arguments_error (message);
425
    }
426
6
  ret = atk_table_is_column_selected (table, column);
427
6
  reply = dbus_message_new_method_return (message);
428
6
  if (reply)
429
    {
430
6
      dbus_message_append_args (reply, DBUS_TYPE_BOOLEAN, &ret,
431
                                DBUS_TYPE_INVALID);
432
    }
433
6
  return reply;
434
}
435

            
436
static DBusMessage *
437
2
impl_IsSelected (DBusConnection *bus, DBusMessage *message, void *user_data)
438
{
439
2
  AtkTable *table = (AtkTable *) user_data;
440
  dbus_int32_t row, column;
441
  DBusMessage *reply;
442
  dbus_bool_t ret;
443

            
444
2
  g_return_val_if_fail (ATK_IS_TABLE (user_data),
445
                        droute_not_yet_handled_error (message));
446
2
  if (!dbus_message_get_args (message, NULL, DBUS_TYPE_INT32, &row, DBUS_TYPE_INT32, &column,
447
                              DBUS_TYPE_INVALID))
448
    {
449
      return droute_invalid_arguments_error (message);
450
    }
451
2
  ret = atk_table_is_selected (table, row, column);
452
2
  reply = dbus_message_new_method_return (message);
453
2
  if (reply)
454
    {
455
2
      dbus_message_append_args (reply, DBUS_TYPE_BOOLEAN, &ret,
456
                                DBUS_TYPE_INVALID);
457
    }
458
2
  return reply;
459
}
460

            
461
static DBusMessage *
462
1
impl_AddRowSelection (DBusConnection *bus, DBusMessage *message, void *user_data)
463
{
464
1
  AtkTable *table = (AtkTable *) user_data;
465
  dbus_int32_t row;
466
  DBusMessage *reply;
467
  dbus_bool_t ret;
468

            
469
1
  g_return_val_if_fail (ATK_IS_TABLE (user_data),
470
                        droute_not_yet_handled_error (message));
471
1
  if (!dbus_message_get_args (message, NULL, DBUS_TYPE_INT32, &row, DBUS_TYPE_INVALID))
472
    {
473
      return droute_invalid_arguments_error (message);
474
    }
475
1
  ret = atk_table_add_row_selection (table, row);
476
1
  reply = dbus_message_new_method_return (message);
477
1
  if (reply)
478
    {
479
1
      dbus_message_append_args (reply, DBUS_TYPE_BOOLEAN, &ret,
480
                                DBUS_TYPE_INVALID);
481
    }
482
1
  return reply;
483
}
484

            
485
static DBusMessage *
486
1
impl_AddColumnSelection (DBusConnection *bus, DBusMessage *message, void *user_data)
487
{
488
1
  AtkTable *table = (AtkTable *) user_data;
489
  dbus_int32_t column;
490
  DBusMessage *reply;
491
  dbus_bool_t ret;
492

            
493
1
  g_return_val_if_fail (ATK_IS_TABLE (user_data),
494
                        droute_not_yet_handled_error (message));
495
1
  if (!dbus_message_get_args (message, NULL, DBUS_TYPE_INT32, &column, DBUS_TYPE_INVALID))
496
    {
497
      return droute_invalid_arguments_error (message);
498
    }
499
1
  ret = atk_table_add_column_selection (table, column);
500
1
  reply = dbus_message_new_method_return (message);
501
1
  if (reply)
502
    {
503
1
      dbus_message_append_args (reply, DBUS_TYPE_BOOLEAN, &ret,
504
                                DBUS_TYPE_INVALID);
505
    }
506
1
  return reply;
507
}
508

            
509
static DBusMessage *
510
1
impl_RemoveRowSelection (DBusConnection *bus, DBusMessage *message, void *user_data)
511
{
512
1
  AtkTable *table = (AtkTable *) user_data;
513
  dbus_int32_t row;
514
  DBusMessage *reply;
515
  dbus_bool_t ret;
516

            
517
1
  g_return_val_if_fail (ATK_IS_TABLE (user_data),
518
                        droute_not_yet_handled_error (message));
519
1
  if (!dbus_message_get_args (message, NULL, DBUS_TYPE_INT32, &row, DBUS_TYPE_INVALID))
520
    {
521
      return droute_invalid_arguments_error (message);
522
    }
523
1
  ret = atk_table_remove_row_selection (table, row);
524
1
  reply = dbus_message_new_method_return (message);
525
1
  if (reply)
526
    {
527
1
      dbus_message_append_args (reply, DBUS_TYPE_BOOLEAN, &ret,
528
                                DBUS_TYPE_INVALID);
529
    }
530
1
  return reply;
531
}
532

            
533
static DBusMessage *
534
1
impl_RemoveColumnSelection (DBusConnection *bus, DBusMessage *message, void *user_data)
535
{
536
1
  AtkTable *table = (AtkTable *) user_data;
537
  dbus_int32_t column;
538
  DBusMessage *reply;
539
  dbus_bool_t ret;
540

            
541
1
  g_return_val_if_fail (ATK_IS_TABLE (user_data),
542
                        droute_not_yet_handled_error (message));
543
1
  if (!dbus_message_get_args (message, NULL, DBUS_TYPE_INT32, &column, DBUS_TYPE_INVALID))
544
    {
545
      return droute_invalid_arguments_error (message);
546
    }
547
1
  ret = atk_table_remove_column_selection (table, column);
548
1
  reply = dbus_message_new_method_return (message);
549
1
  if (reply)
550
    {
551
1
      dbus_message_append_args (reply, DBUS_TYPE_BOOLEAN, &ret,
552
                                DBUS_TYPE_INVALID);
553
    }
554
1
  return reply;
555
}
556

            
557
static DBusMessage *
558
1
impl_GetRowColumnExtentsAtIndex (DBusConnection *bus, DBusMessage *message, void *user_data)
559
{
560
1
  AtkTable *table = (AtkTable *) user_data;
561
  dbus_int32_t index;
562
  dbus_int32_t row, column, row_extents, col_extents;
563
  dbus_bool_t is_selected;
564
  dbus_bool_t ret;
565
  DBusMessage *reply;
566
  AtkObject *cell;
567
1
  AtkRole role = ATK_ROLE_INVALID;
568

            
569
1
  g_return_val_if_fail (ATK_IS_TABLE (user_data),
570
                        droute_not_yet_handled_error (message));
571
1
  if (!dbus_message_get_args (message, NULL, DBUS_TYPE_INT32, &index, DBUS_TYPE_INVALID))
572
    {
573
      return droute_invalid_arguments_error (message);
574
    }
575
1
  column = atk_table_get_column_at_index (table, index);
576
1
  row = atk_table_get_row_at_index (table, index);
577
1
  row_extents = atk_table_get_row_extent_at (table, row, column);
578
1
  col_extents = atk_table_get_column_extent_at (table, row, column);
579
1
  is_selected = atk_table_is_selected (table, row, column);
580
1
  cell = atk_table_ref_at (table, row, column);
581
1
  if (cell)
582
    {
583
1
      role = atk_object_get_role (cell);
584
1
      g_object_unref (cell);
585
    }
586
1
  ret = (role == ATK_ROLE_TABLE_CELL ? TRUE : FALSE);
587
1
  reply = dbus_message_new_method_return (message);
588
1
  if (reply)
589
    {
590
1
      dbus_message_append_args (reply, DBUS_TYPE_BOOLEAN, &ret,
591
                                DBUS_TYPE_INT32, &row, DBUS_TYPE_INT32,
592
                                &column, DBUS_TYPE_INT32, &row_extents,
593
                                DBUS_TYPE_INT32, &col_extents,
594
                                DBUS_TYPE_BOOLEAN, &is_selected,
595
                                DBUS_TYPE_INVALID);
596
    }
597
1
  return reply;
598
}
599

            
600
static DRouteMethod methods[] = {
601
  { impl_GetAccessibleAt, "GetAccessibleAt" },
602
  { impl_GetIndexAt, "GetIndexAt" },
603
  { impl_GetRowAtIndex, "GetRowAtIndex" },
604
  { impl_GetColumnAtIndex, "GetColumnAtIndex" },
605
  { impl_GetRowDescription, "GetRowDescription" },
606
  { impl_GetColumnDescription, "GetColumnDescription" },
607
  { impl_GetRowExtentAt, "GetRowExtentAt" },
608
  { impl_GetColumnExtentAt, "GetColumnExtentAt" },
609
  { impl_GetRowHeader, "GetRowHeader" },
610
  { impl_GetColumnHeader, "GetColumnHeader" },
611
  { impl_GetSelectedRows, "GetSelectedRows" },
612
  { impl_GetSelectedColumns, "GetSelectedColumns" },
613
  { impl_IsRowSelected, "IsRowSelected" },
614
  { impl_IsColumnSelected, "IsColumnSelected" },
615
  { impl_IsSelected, "IsSelected" },
616
  { impl_AddRowSelection, "AddRowSelection" },
617
  { impl_AddColumnSelection, "AddColumnSelection" },
618
  { impl_RemoveRowSelection, "RemoveRowSelection" },
619
  { impl_RemoveColumnSelection, "RemoveColumnSelection" },
620
  { impl_GetRowColumnExtentsAtIndex, "GetRowColumnExtentsAtIndex" },
621
  { NULL, NULL }
622
};
623

            
624
static DRouteProperty properties[] = {
625
  { impl_get_NRows, NULL, "NRows" },
626
  { impl_get_NColumns, NULL, "NColumns" },
627
  { impl_get_Caption, NULL, "Caption" },
628
  { impl_get_Summary, NULL, "Summary" },
629
  { impl_get_NSelectedRows, NULL, "NSelectedRows" },
630
  { impl_get_NSelectedColumns, NULL, "NSelectedColumns" },
631
  { NULL, NULL, NULL }
632
};
633

            
634
void
635
161
spi_initialize_table (DRoutePath *path)
636
{
637
161
  spi_atk_add_interface (path,
638
                         ATSPI_DBUS_INTERFACE_TABLE, spi_org_a11y_atspi_Table, methods, properties);
639
161
};