Docs tweaking.
[platform/core/uifw/at-spi2-atk.git] / cspi / spi_main.c
1 #include <libbonobo.h>
2 #include <stdio.h>
3 #include "spi.h"
4
5 static CORBA_Environment ev;
6 static AccessibilityRegistry registry;
7
8 static Accessible *
9 Obj_Add (Accessible object)
10 {
11   /* TODO: keep list of live object refs */
12   Accessible *oref = g_malloc (sizeof (Accessible));
13   *oref = object;
14   return oref;
15 }
16
17 /*
18  *
19  * Basic SPI initialization and event loop function prototypes
20  *
21  */
22
23 /**
24  * SPI_init:
25  *
26  * Connects to the accessibility registry and initializes the SPI.
27  *
28  * Returns: 0 on success, otherwise an integer error code.
29  **/
30 int
31 SPI_init (void)
32 {
33   int argc = 0;
34   CORBA_Object oclient;
35   char *obj_id;
36
37   CORBA_exception_init(&ev);
38
39   if (!bonobo_init (&argc, NULL))
40     {
41       g_error ("Could not initialize Bonobo");
42     }
43
44   obj_id = "OAFIID:Accessibility_Registry:proto0.1";
45
46   oclient = bonobo_activation_activate_from_id (obj_id, 0, NULL, &ev);
47   if (ev._major != CORBA_NO_EXCEPTION) {
48     fprintf (stderr,
49             ("AT-SPI error: during registry activation: %s\n"),
50             CORBA_exception_id(&ev));
51     CORBA_exception_free(&ev);
52     exit(-1);
53   }
54
55   if (CORBA_Object_is_nil (oclient, &ev))
56     {
57       g_error ("Could not locate registry");
58       exit(-1);
59     }
60
61   registry = (Accessibility_Registry) oclient;
62
63   bonobo_activate ();
64
65   return 0;
66 }
67
68 /**
69  * SPI_event_main:
70  * @isGNOMEApp: a #boolean indicating whether the client of the SPI
71  *              will use the Gnome event loop or not.
72  *
73  * Starts/enters the main event loop for the SPI services.
74  *
75  * (NOTE: This method does not return control, it is exited via a call to exit()
76  * from within an event handler).
77  *
78  **/
79 void
80 SPI_event_main (boolean isGNOMEApp)
81 {
82   if (isGNOMEApp) bonobo_main();
83   else CORBA_ORB_run (bonobo_orb(), &ev);
84 }
85
86 /**
87  * SPI_event_is_ready:
88  *
89  * Checks to see if an SPI event is waiting in the event queue.
90  * Used by clients that don't wish to use SPI_event_main().
91  * Not Yet Implemented.
92  *
93  * Returns: #TRUE if an event is waiting, otherwise #FALSE.
94  *
95  **/
96 boolean
97 SPI_eventIsReady ()
98 {
99   return FALSE;
100 }
101
102 /**
103  * SPI_nextEvent:
104  *
105  * Gets the next event in the SPI event queue; blocks if no event
106  * is pending.
107  * Used by clients that don't wish to use SPI_event_main().
108  * Not Yet Implemented.
109  *
110  * Returns: the next #AccessibleEvent in the SPI event queue.
111  *
112  **/
113 AccessibleEvent *
114 SPI_nextEvent (boolean waitForEvent)
115 {
116   return NULL;
117 }
118
119 /**
120  * SPI_exit:
121  *
122  * Disconnects from the Accessibility Registry and releases resources.
123  * Not Yet Implemented.
124  *
125  **/
126 void
127 SPI_exit (void)
128 {
129   exit(0);
130 }
131
132 /**
133  * createEventListener:
134  * @callback : an #AccessibleEventListenerCB callback function, or NULL.
135  *
136  * Create a new #AccessibleEventListener with a specified callback function.
137  *
138  * Returns: a pointer to a newly-created #AccessibleEventListener.
139  *
140  **/
141 AccessibleEventListener *
142 createEventListener (AccessibleEventListenerCB callback)
143 {
144   AccessibleEventListener *listener = accessible_event_listener_new ();
145   if (callback)
146     {
147       accessible_event_listener_add_callback (listener, callback);
148     }
149   return listener;
150 }
151
152 /**
153  * EventListener_addCallback:
154  * @listener: the #AccessibleEventListener instance to modify.
155  * @callback: an #AccessibleEventListenerCB function pointer.
156  *
157  * Add an in-process callback function to an existing AccessibleEventListener.
158  *
159  * Returns: #TRUE if successful, otherwise #FALSE.
160  *
161  **/
162 boolean
163 EventListener_addCallback (AccessibleEventListener *listener,
164                            AccessibleEventListenerCB callback)
165 {
166   accessible_event_listener_add_callback (listener, callback);
167   return TRUE;
168 }
169
170 /**
171  * EventListener_removeCallback:
172  * @listener: the #AccessibleEventListener instance to modify.
173  * @callback: an #AccessibleEventListenerCB function pointer.
174  *
175  * Remove an in-process callback function from an existing AccessibleEventListener.
176  *
177  * Returns: #TRUE if successful, otherwise #FALSE.
178  *
179  **/
180 boolean
181 EventListener_removeCallback (AccessibleEventListener *listener,
182                            AccessibleEventListenerCB callback)
183 {
184   accessible_event_listener_remove_callback (listener, callback);
185   return TRUE;
186 }
187
188 /*
189  *
190  * Global functions serviced by the registry
191  *
192  */
193
194 /**
195  * registerGlobalEventListener:
196  * @listener: the #AccessibleEventListener to be registered against an event type.
197  * @callback: a character string indicating the type of events for which
198  *            notification is requested.  Format is
199  *            EventClass:major_type:minor_type:detail
200  *            where all subfields other than EventClass are optional.
201  *            EventClasses include "Focus", "Window", "Mouse",
202  *            and toolkit events (e.g. "Gtk", "AWT").
203  *            Examples: "focus:", "Gtk:GtkWidget:button_press_event".
204  *
205  * NOTE: this string may be UTF-8, but should not contain byte value 56 (ascii ':'),
206  *            except as a delimiter, since non-UTF-8 string delimiting
207  *            functions are used internally.  In general, listening to
208  *            toolkit-specific events is not recommended.
209  *
210  * Add an in-process callback function to an existing AccessibleEventListener.
211  *
212  * Returns: #TRUE if successful, otherwise #FALSE.
213  *
214  **/
215 boolean
216 registerGlobalEventListener (AccessibleEventListener *listener,
217                              char *eventType)
218 {
219   Accessibility_Registry_registerGlobalEventListener (
220                          registry,
221                          (Accessibility_EventListener)
222                             bonobo_object_corba_objref (bonobo_object (listener)),
223                          eventType,
224                          &ev);
225
226   if (ev._major != CORBA_NO_EXCEPTION)
227     {
228     return FALSE;
229     }
230   else
231     {
232       return TRUE;
233     }
234 }
235
236 /**
237  * getDesktopCount:
238  *
239  * Get the number of virtual desktops.
240  * NOTE: currently multiple virtual desktops are not implemented, this
241  *       function always returns '1'.
242  *
243  * Returns: an integer indicating the number of active virtual desktops.
244  *
245  **/
246 int
247 getDesktopCount ()
248 {
249   return Accessibility_Registry_getDesktopCount (registry, &ev);
250 }
251
252 /**
253  * getDesktop:
254  * @i: an integer indicating which of the accessible desktops is to be returned.
255  *
256  * Get the virtual desktop indicated by index @i.
257  * NOTE: currently multiple virtual desktops are not implemented, this
258  *       function always returns '1'.
259  *
260  * Returns: a pointer to the 'i-th' virtual desktop's #Accessible representation.
261  *
262  **/
263 Accessible*
264 getDesktop (int n)
265 {
266   return Obj_Add (Accessibility_Registry_getDesktop (registry, (CORBA_short) n, &ev));
267 }
268
269 /**
270  * getDesktopList:
271  * @list: a pointer to an array of #Accessible objects.
272  *
273  * Get the list of virtual desktops.  On return, @list will point
274  *     to a newly-created array of virtual desktop pointers.
275  *     It is the responsibility of the caller to free this array when
276  *     it is no longer needed.
277  *
278  * Not Yet Implemented.
279  *
280  * Returns: an integer indicating how many virtual desktops have been
281  *          placed in the list pointed to by parameter @list.
282  **/
283 int
284 getDesktopList (Accessible **list)
285 {
286   *list = NULL;
287   return 0;
288 }
289
290 /**
291  * registerKeystrokeListener:
292  * @listener: a pointer to the #KeystrokeListener for which
293  *            keystroke events are requested.
294  *
295  * Not Yet Implemented.
296  *
297  **/
298 void
299 registerKeystrokeListener (KeystrokeListener *listener)
300 {
301   ;
302 }
303
304 /**
305  * generateKeyEvent:
306  * @keycode: a #long indicating the keycode of the key event
307  *           being synthesized.
308  * @meta: a #long indicating the key modifiers to be sent
309  *        with the event, if any.
310  *
311  * Synthesize a keyboard event (as if a hardware keyboard event occurred in the
312  * current UI context).
313  * Not Yet Implemented.
314  *
315  **/
316 void
317 generateKeyEvent (long keyCode, long meta)
318 {
319   ;
320 }
321
322 /**
323  * generateMouseEvent:
324  * @x: a #long indicating the screen x coordinate of the mouse event.
325  * @y: a #long indicating the screen y coordinate of the mouse event.
326  * @name: a string indicating which mouse event to be synthesized
327  *        (e.g. "button1", "button2", "mousemove").
328  *
329  * Synthesize a mouse event at a specific screen coordinate.
330  * Not Yet Implemented.
331  *
332  **/
333 void
334 generateMouseEvent (long x, long y, char *name)
335 {
336   ;
337 }
338
339 /*
340  *
341  * Accessible function prototypes
342  *
343  */
344
345 /**
346  * Accessible_ref:
347  * @obj: a pointer to the #Accessible object on which to operate.
348  *
349  * Increment the reference count for an #Accessible object.
350  *
351  * Returns: (no return code implemented yet).
352  *
353  **/
354 int
355 Accessible_ref (Accessible *obj)
356 {
357   Accessibility_Accessible_ref (*obj, &ev);
358   return 0;
359 }
360
361
362 /**
363  * Accessible_unref:
364  * @obj: a pointer to the #Accessible object on which to operate.
365  *
366  * Decrement the reference count for an #Accessible object.
367  *
368  * Returns: (no return code implemented yet).
369  *
370  **/
371 int
372 Accessible_unref (Accessible *obj)
373 {
374   Accessibility_Accessible_unref (*obj, &ev);
375   return 0;
376 }
377
378 /**
379  * Accessible_getName:
380  * @obj: a pointer to the #Accessible object on which to operate.
381  *
382  * Get the name of an #Accessible object.
383  *
384  * Returns: a UTF-8 string indicating the name of the #Accessible object.
385  *
386  **/
387 char *
388 Accessible_getName (Accessible *obj)
389 {
390   return Accessibility_Accessible__get_name (*obj, &ev);
391 }
392
393 /**
394  * Accessible_getDescription:
395  * @obj: a pointer to the #Accessible object on which to operate.
396  *
397  * Get the description of an #Accessible object.
398  *
399  * Returns: a UTF-8 string describing the #Accessible object.
400  *
401  **/
402 char *
403 Accessible_getDescription (Accessible *obj)
404 {
405   return Accessibility_Accessible__get_description (*obj, &ev);
406 }
407
408 /**
409  * Accessible_getParent:
410  * @obj: a pointer to the #Accessible object to query.
411  *
412  * Get an #Accessible object's parent container.
413  *
414  * Returns: a pointer to the #Accessible object which contains the given
415  *          #Accessible instance, or NULL if the @obj has no parent container.
416  *
417  **/
418 Accessible *
419 Accessible_getParent (Accessible *obj)
420 {
421   return Obj_Add (Accessibility_Accessible__get_parent (*obj, &ev));
422 }
423
424 /**
425  * Accessible_getChildCount:
426  *
427  * @obj: a pointer to the #Accessible object on which to operate.
428  *
429  * Get the number of children contained by an #Accessible object.
430  *
431  * Returns: a #long indicating the number of #Accessible children
432  *          contained by an #Accessible object.
433  *
434  **/
435 long
436 Accessible_getChildCount (Accessible *obj)
437 {
438   return Accessibility_Accessible__get_childCount (*obj, &ev);
439 }
440
441 /**
442  * Accessible_getChildAtIndex:
443  *
444  * @obj: a pointer to the #Accessible object on which to operate.
445  * @childIndex: a #long indicating which child is specified.
446  *
447  * Get the #Accessible child of an #Accessible object at a given index.
448  *
449  * Returns: a pointer to the #Accessible child object at index
450  *          @childIndex.
451  *
452  **/
453 Accessible *
454 Accessible_getChildAtIndex (Accessible *obj,
455                             long childIndex)
456 {
457   return Obj_Add (Accessibility_Accessible_getChildAtIndex (*obj, childIndex, &ev));
458 }
459
460 /**
461  * Accessible_getIndexInParent:
462  *
463  * @obj: a pointer to the #Accessible object on which to operate.
464  *
465  * Get the index of an #Accessible object in its containing #Accessible.
466  *
467  * Returns: a #long indicating the index of the #Accessible object
468  *          in its parent (i.e. containing) #Accessible instance,
469  *          or -1 if @obj has no containing parent.
470  *
471  **/
472 long
473 Accessible_getIndexInParent (Accessible *obj)
474 {
475   return Accessibility_Accessible_getIndexInParent (*obj, &ev);
476 }
477
478 /**
479  * Accessible_getRelationSet:
480  *
481  * Not Yet Implemented.
482  *
483  * Returns: a pointer to an array of #AccessibleRelations.
484  *
485  **/
486 AccessibleRelation **
487 Accessible_getRelationSet (Accessible *obj)
488 {
489   return NULL;
490 }
491
492 /**
493  * Accessible_getRole:
494  * @obj: a pointer to the #Accessible object on which to operate.
495  *
496  * Get the UI role of an #Accessible object.
497  *
498  * Returns: a UTF-8 string indicating the UI role of the #Accessible object.
499  *
500  **/
501 char *
502 Accessible_getRole (Accessible *obj)
503 {
504   return "";
505 }
506
507 /**
508  * Accessible_getStateSet:
509  *
510  * Not Yet Implemented.
511  *
512  * Returns: a pointer to an #AccessibleStateSet representing the object's current state.
513  **/
514 AccessibleStateSet *
515 Accessible_getStateSet (Accessible *obj)
516 {
517   return NULL;
518 }
519
520 /* Interface query methods */
521
522 /**
523  * Accessible_isAction:
524  * @obj: a pointer to the #Accessible instance to query.
525  *
526  * Query whether the specified #Accessible implements #AccessibleAction.
527  * Not Yet Implemented.
528  *
529  * Returns: #TRUE if @obj implements the #AccessibleAction interface,
530  *          #FALSE otherwise.
531  **/
532 boolean
533 Accessible_isAction (Accessible *obj)
534 {
535   return FALSE;
536 }
537
538 /**
539  * Accessible_isComponent:
540  * @obj: a pointer to the #Accessible instance to query.
541  *
542  * Query whether the specified #Accessible implements #AccessibleComponent.
543  *
544  * Returns: #TRUE if @obj implements the #AccessibleComponent interface,
545  *          #FALSE otherwise.
546  **/
547 boolean
548 Accessible_isComponent (Accessible *obj)
549 {
550   Bonobo_Unknown iface =
551     Accessibility_Accessible_queryInterface (*obj,
552                                              "IDL:Accessibility/Component:1.0",
553                                              &ev);
554   return (iface != NULL) ? TRUE : FALSE;
555 }
556
557 /**
558  * Accessible_isEditableText:
559  * @obj: a pointer to the #Accessible instance to query.
560  *
561  * Query whether the specified #Accessible implements #AccessibleEditableText.
562  * Not Yet Implemented.
563  *
564  * Returns: #TRUE if @obj implements the #AccessibleEditableText interface,
565  *          #FALSE otherwise.
566  **/
567 boolean
568 Accessible_isEditableText (Accessible *obj)
569 {
570   return FALSE;
571 }
572
573 /**
574  * Accessible_isHypertext:
575  * @obj: a pointer to the #Accessible instance to query.
576  *
577  * Query whether the specified #Accessible implements #AccessibleHypertext.
578  * Not Yet Implemented.
579  *
580  * Returns: #TRUE if @obj implements the #AccessibleHypertext interface,
581  *          #FALSE otherwise.
582  **/
583 boolean
584 Accessible_isHypertext (Accessible *obj)
585 {
586   return FALSE;
587 }
588
589 /**
590  * Accessible_isImage:
591  * @obj: a pointer to the #Accessible instance to query.
592  *
593  * Query whether the specified #Accessible implements #AccessibleImage.
594  * Not Yet Implemented.
595  *
596  * Returns: #TRUE if @obj implements the #AccessibleImage interface,
597  *          #FALSE otherwise.
598 **/
599 boolean
600 Accessible_isImage (Accessible *obj)
601 {
602   return FALSE;
603 }
604
605 /**
606   * Accessible_isSelection:
607  * @obj: a pointer to the #Accessible instance to query.
608  *
609  * Query whether the specified #Accessible implements #AccessibleSelection.
610  * Not Yet Implemented.
611  *
612  * Returns: #TRUE if @obj implements the #AccessibleSelection interface,
613  *          #FALSE otherwise.
614 **/
615 boolean
616 Accessible_isSelection (Accessible *obj)
617 {
618   return FALSE;
619 }
620
621 /**
622  * Accessible_isTable:
623  * @obj: a pointer to the #Accessible instance to query.
624  *
625  * Query whether the specified #Accessible implements #AccessibleTable.
626  * Not Yet Implemented.
627  *
628  * Returns: #TRUE if @obj implements the #AccessibleTable interface,
629  *          #FALSE otherwise.
630 **/
631 boolean
632 Accessible_isTable (Accessible *obj)
633 {
634   return FALSE;
635 }
636
637 /**
638  * Accessible_isText:
639  * @obj: a pointer to the #Accessible instance to query.
640  *
641  * Query whether the specified #Accessible implements #AccessibleText.
642  * Not Yet Implemented.
643  *
644  * Returns: #TRUE if @obj implements the #AccessibleText interface,
645  *          #FALSE otherwise.
646 **/
647 boolean
648 Accessible_isText (Accessible *obj)
649 {
650   return FALSE;
651 }
652
653 /**
654  * Accessible_getAction:
655  *
656  * Not Yet Implemented.
657  *
658  **/
659 AccessibleAction *
660 Accessible_getAction (Accessible *obj)
661 {
662   return NULL;
663 }
664
665 /**
666  * Accessible_getComponent:
667  * @obj: a pointer to the #Accessible instance to query.
668  *
669  * Get the #AccessibleComponent interface for an #Accessible.
670  *
671  * Returns: a pointer to an #AccessibleComponent interface instance, or
672  *          NULL if @obj does not implement #AccessibleComponent.
673  **/
674 AccessibleComponent *
675 Accessible_getComponent (Accessible *obj)
676 {
677   AccessibleComponent iface =
678     Accessibility_Accessible_queryInterface (*obj,
679                                              "IDL:Accessibility/Component:1.0",
680                                              &ev);
681   return Obj_Add (iface);
682 }
683
684 /**
685  * Accessible_queryInterface:
686  * @obj: a pointer to the #Accessible instance to query.
687  * @interface_name: a UTF-8 character string specifiying the requested interface.
688  *
689  * Query an #Accessible object to for a named interface.
690  *
691  * Returns: an instance of the named interface object, if it is implemented
692  *          by @obj, or NULL otherwise.
693  *
694  **/
695 GenericInterface *
696 Accessible_queryInterface (Accessible *obj, char *interface_name)
697 {
698   GenericInterface iface;
699   iface = Accessibility_Accessible_queryInterface (*obj,
700                                                     interface_name,
701                                                     &ev);
702   return (iface != NULL) ? Obj_Add (iface) : NULL;
703 }
704
705 /*
706  *
707  * AccessibleApplication function prototypes
708  *
709  */
710
711 /**
712  * AccessibleApplication_ref:
713  * @obj: a pointer to the #AccessibleApplication on which to operate.
714  *
715  * Increment the reference count for an #AccessibleApplication.
716  *
717  * Returns: (no return code implemented yet).
718  *
719  **/
720 int
721 AccessibleApplication_ref (AccessibleApplication *obj)
722 {
723   Accessibility_Application_ref (*obj, &ev);
724   return 0;
725 }
726
727 /**
728  * AccessibleApplication_unref:
729  * @obj: a pointer to the #AccessibleApplication object on which to operate.
730  *
731  * Decrement the reference count for an #AccessibleApplication.
732  *
733  * Returns: (no return code implemented yet).
734  *
735  **/
736 int
737 AccessibleApplication_unref (AccessibleApplication *obj)
738 {
739   Accessibility_Application_unref (*obj, &ev);
740   return 0;
741 }
742
743 /**
744  * AccessibleApplication_getToolkitName:
745  * @obj: a pointer to the #AccessibleApplication to query.
746  *
747  * Get the name of the UI toolkit used by an #AccessibleApplication.
748  *
749  * Returns: a UTF-8 string indicating which UI toolkit is
750  *          used by an application.
751  *
752  **/
753 char *
754 AccessibleApplication_getToolkitName (AccessibleApplication *obj)
755 {
756   return Accessibility_Application__get_toolkitName (*obj, &ev);
757 }
758
759 /**
760  * AccessibleApplication_getVersion:
761  * @obj: a pointer to the #AccessibleApplication being queried.
762  *
763  * Get the version of the at-spi bridge exported by an
764  *      #AccessibleApplication instance.
765  *
766  * Returns: a UTF-8 string indicating the application's
767  *          at-spi version.
768  *
769  **/
770 char *
771 AccessibleApplication_getVersion (AccessibleApplication *obj)
772 {
773   return Accessibility_Application__get_version (*obj, &ev);
774 }
775
776 /**
777  * AccessibleApplication_getID:
778  * @obj: a pointer to the #AccessibleApplication being queried.
779  *
780  * Get the unique ID assigned by the Registry to an
781  *      #AccessibleApplication instance.
782  * (Not Yet Implemented by the registry).
783  *
784  * Returns: a unique #long integer associated with the application
785  *          by the Registry, or 0 if the application is not registered.
786 long
787 AccessibleApplication_getID (AccessibleApplication *obj)
788 {
789   return Accessibility_Application__get_id (*obj, &ev);
790 }
791
792 /**
793  * AccessibleApplication_pause:
794  *
795  * Attempt to pause the application (used when client event queue is
796  *  over-full).
797  * Not Yet Implemented.
798  *
799  * Returns: #TRUE if the application was paused successfully, #FALSE otherwise.
800  *
801  **/
802 boolean
803 AccessibleApplication_pause (AccessibleApplication *obj)
804 {
805   return FALSE;
806 }
807
808 /**
809  * AccessibleApplication_resume:
810  *
811  * Attempt to resume the application (used after #AccessibleApplication_pause).
812  * Not Yet Implemented.
813  *
814  * Returns: #TRUE if application processing resumed successfully, #FALSE otherwise.
815  *
816  **/
817 boolean
818 AccessibleApplication_resume (AccessibleApplication *obj)
819 {
820   return FALSE;
821 }
822
823 /*
824  *
825  * AccessibleComponent function implementations
826  *
827  */
828
829 /**
830  * AccessibleComponent_ref:
831  * @obj: a pointer to an object implementing #AccessibleComponent on which to operate.
832  *
833  * Increment the reference count for an #AccessibleComponent.
834  *
835  * Returns: (no return code implemented yet).
836  *
837  **/
838 int
839 AccessibleComponent_ref (AccessibleComponent *obj)
840 {
841   Accessibility_Component_ref (*obj, &ev);
842   return 0;
843 }
844
845 /**
846  * AccessibleComponent_unref:
847  * @obj: a pointer to the object implementing #AccessibleComponent on which to operate.
848  *
849  * Decrement the reference count for an #AccessibleComponent.
850  *
851  * Returns: (no return code implemented yet).
852  *
853  **/
854 int
855 AccessibleComponent_unref (AccessibleComponent *obj)
856 {
857   Accessibility_Component_unref (*obj, &ev);
858   return 0;
859 }
860
861 /**
862  * AccessibleComponent_contains:
863  * @obj: a pointer to the #AccessibleComponent to query.
864  * @x: a #long specifying the x coordinate in question.
865  * @y: a #long specifying the y coordinate in question.
866  * @ctype: the desired coordinate system of the point (@x, @y)
867  *         (e.g. COORD_TYPE_WINDOW, COORD_TYPE_SCREEN).
868  *
869  * Query whether a given #AccessibleComponent contains a particular point.
870  *
871  **/
872 boolean
873 AccessibleComponent_contains (AccessibleComponent *obj,
874                               long x,
875                               long y,
876                               AccessibleCoordType ctype)
877 {
878   return Accessibility_Component_contains (*obj,
879                                            (CORBA_long) x,
880                                            (CORBA_long) y,
881                                            ctype,
882                                            &ev);
883 }
884
885 /**
886  * AccessibleComponent_getAccessibleAtPoint:
887  * @obj: a pointer to the #AccessibleComponent to query.
888  * @x: a #long specifying the x coordinate of the point in question.
889  * @y: a #long specifying the y coordinate of the point in question.
890  * @ctype: the coordinate system of the point (@x, @y)
891  *         (e.g. COORD_TYPE_WINDOW, COORD_TYPE_SCREEN).
892  *
893  * Get the accessible child at a given coordinate within an #AccessibleComponent.
894  *
895  * Returns: a pointer to an #Accessible child of the specified component which
896  *          contains the point (@x, @y), or NULL of no child contains the point.
897  **/
898 Accessible *
899 AccessibleComponent_getAccessibleAtPoint (AccessibleComponent *obj,
900                                           long x,
901                                           long y,
902                                           AccessibleCoordType ctype)
903 {
904   Accessible child;
905   child = Accessibility_Component_getAccessibleAtPoint(*obj,
906                                                        (CORBA_long) x,
907                                                        (CORBA_long) y,
908                                                        ctype,
909                                                        &ev);
910   return (child != NULL) ? Obj_Add (child) : NULL;
911 }
912
913 /**
914  * AccessibleComponent_getExtents:
915  * @obj: a pointer to the #AccessibleComponent to query.
916  * @x: a pointer to a #long into which the minimum x coordinate will be returned.
917  * @y: a pointer to a #long into which the minimum y coordinate will be returned.
918  * @width: a pointer to a #long into which the x extents (width) will be returned.
919  * @height: a pointer to a #long into which the y extents (height) will be returned.
920  * @ctype: the desired coordinate system into which to return the results,
921  *         (e.g. COORD_TYPE_WINDOW, COORD_TYPE_SCREEN).
922  *
923  * Get the bounding box of the specified #AccessibleComponent.
924  *
925  **/
926 void
927 AccessibleComponent_getExtents (AccessibleComponent *obj,
928                                 long *x,
929                                 long *y,
930                                 long *width,
931                                 long *height,
932                                 AccessibleCoordType ctype)
933 {
934   /* TODO: remove assumption that CORBA_long == long in typecast */
935   Accessibility_Component_getExtents (*obj,
936                                      (CORBA_long *) x,
937                                      (CORBA_long *) y,
938                                      (CORBA_long *) width,
939                                      (CORBA_long *) height,
940                                      ctype,
941                                      &ev);
942 }
943
944 /**
945  * AccessibleComponent_getPosition:
946  * @obj: a pointer to the #AccessibleComponent to query.
947  * @x: a pointer to a #long into which the minimum x coordinate will be returned.
948  * @y: a pointer to a #long into which the minimum y coordinate will be returned.
949  * @ctype: the desired coordinate system into which to return the results,
950  *         (e.g. COORD_TYPE_WINDOW, COORD_TYPE_SCREEN).
951  *
952  * Get the minimum x and y coordinates of the specified #AccessibleComponent.
953  *
954  **/
955 void
956 AccessibleComponent_getPosition (AccessibleComponent *obj,
957                                  long *x,
958                                  long *y,
959                                  AccessibleCoordType ctype)
960 {
961   Accessibility_Component_getPosition (*obj,
962                                        (CORBA_long *) x,
963                                        (CORBA_long *) y,
964                                        ctype,
965                                        &ev);
966 }
967
968 /**
969  * AccessibleComponent_getSize:
970  * @obj: a pointer to the #AccessibleComponent to query.
971  * @width: a pointer to a #long into which the x extents (width) will be returned.
972  * @height: a pointer to a #long into which the y extents (height) will be returned.
973  *
974  * Get the size of the specified #AccessibleComponent.
975  *
976  **/
977 void
978 AccessibleComponent_getSize (AccessibleComponent *obj,
979                              long *width,
980                              long *height)
981 {
982   Accessibility_Component_getSize (*obj,
983                                    (CORBA_long *) width,
984                                    (CORBA_long *) height,
985                                    &ev);
986 }
987
988 /* Not Yet Implemented */
989 void
990 AccessibleComponent_grabFocus (AccessibleComponent *obj)
991 {
992   ;
993 }