Changes to support generation of C bindings docs.
[platform/core/uifw/at-spi2-atk.git] / cspi / spi_component.c
1 /*
2  *
3  * AccessibleComponent function implementations
4  *
5  */
6
7 /**
8  * AccessibleComponent_ref:
9  * @obj: a pointer to an object implementing #AccessibleComponent on which to operate.
10  *
11  * Increment the reference count for an #AccessibleComponent.
12  *
13  * Returns: (no return code implemented yet).
14  *
15  **/
16 int
17 AccessibleComponent_ref (AccessibleComponent *obj)
18 {
19   Accessibility_Component_ref (*obj, &ev);
20   return 0;
21 }
22
23 /**
24  * AccessibleComponent_unref:
25  * @obj: a pointer to the object implementing #AccessibleComponent on which to operate.
26  *
27  * Decrement the reference count for an #AccessibleComponent.
28  *
29  * Returns: (no return code implemented yet).
30  *
31  **/
32 int
33 AccessibleComponent_unref (AccessibleComponent *obj)
34 {
35   Accessibility_Component_unref (*obj, &ev);
36   return 0;
37 }
38
39 /**
40  * AccessibleComponent_contains:
41  * @obj: a pointer to the #AccessibleComponent to query.
42  * @x: a #long specifying the x coordinate in question.
43  * @y: a #long specifying the y coordinate in question.
44  * @ctype: the desired coordinate system of the point (@x, @y)
45  *         (e.g. COORD_TYPE_WINDOW, COORD_TYPE_SCREEN).
46  *
47  * Query whether a given #AccessibleComponent contains a particular point.
48  *
49  **/
50 boolean
51 AccessibleComponent_contains (AccessibleComponent *obj,
52                               long x,
53                               long y,
54                               AccessibleCoordType ctype)
55 {
56   return Accessibility_Component_contains (*obj,
57                                            (CORBA_long) x,
58                                            (CORBA_long) y,
59                                            ctype,
60                                            &ev);
61 }
62
63 /**
64  * AccessibleComponent_getAccessibleAtPoint:
65  * @obj: a pointer to the #AccessibleComponent to query.
66  * @x: a #long specifying the x coordinate of the point in question.
67  * @y: a #long specifying the y coordinate of the point in question.
68  * @ctype: the coordinate system of the point (@x, @y)
69  *         (e.g. COORD_TYPE_WINDOW, COORD_TYPE_SCREEN).
70  *
71  * Get the accessible child at a given coordinate within an #AccessibleComponent.
72  *
73  * Returns: a pointer to an #Accessible child of the specified component which
74  *          contains the point (@x, @y), or NULL of no child contains the point.
75  **/
76 Accessible *
77 AccessibleComponent_getAccessibleAtPoint (AccessibleComponent *obj,
78                                           long x,
79                                           long y,
80                                           AccessibleCoordType ctype)
81 {
82   Accessible child;
83   child = Accessibility_Component_getAccessibleAtPoint(*obj,
84                                                        (CORBA_long) x,
85                                                        (CORBA_long) y,
86                                                        ctype,
87                                                        &ev);
88   return (child != NULL) ? Obj_Add (child) : NULL;
89 }
90
91 /**
92  * AccessibleComponent_getExtents:
93  * @obj: a pointer to the #AccessibleComponent to query.
94  * @x: a pointer to a #long into which the minimum x coordinate will be returned.
95  * @y: a pointer to a #long into which the minimum y coordinate will be returned.
96  * @width: a pointer to a #long into which the x extents (width) will be returned.
97  * @height: a pointer to a #long into which the y extents (height) will be returned.
98  * @ctype: the desired coordinate system into which to return the results,
99  *         (e.g. COORD_TYPE_WINDOW, COORD_TYPE_SCREEN).
100  *
101  * Get the bounding box of the specified #AccessibleComponent.
102  *
103  **/
104 void
105 AccessibleComponent_getExtents (AccessibleComponent *obj,
106                                 long *x,
107                                 long *y,
108                                 long *width,
109                                 long *height,
110                                 AccessibleCoordType ctype)
111 {
112   /* TODO: remove assumption that CORBA_long == long in typecast */
113   Accessibility_Component_getExtents (*obj,
114                                      (CORBA_long *) x,
115                                      (CORBA_long *) y,
116                                      (CORBA_long *) width,
117                                      (CORBA_long *) height,
118                                      ctype,
119                                      &ev);
120 }
121
122 /**
123  * AccessibleComponent_getPosition:
124  * @obj: a pointer to the #AccessibleComponent to query.
125  * @x: a pointer to a #long into which the minimum x coordinate will be returned.
126  * @y: a pointer to a #long into which the minimum y coordinate will be returned.
127  * @ctype: the desired coordinate system into which to return the results,
128  *         (e.g. COORD_TYPE_WINDOW, COORD_TYPE_SCREEN).
129  *
130  * Get the minimum x and y coordinates of the specified #AccessibleComponent.
131  *
132  **/
133 void
134 AccessibleComponent_getPosition (AccessibleComponent *obj,
135                                  long *x,
136                                  long *y,
137                                  AccessibleCoordType ctype)
138 {
139   Accessibility_Component_getPosition (*obj,
140                                        (CORBA_long *) x,
141                                        (CORBA_long *) y,
142                                        ctype,
143                                        &ev);
144 }
145
146 /**
147  * AccessibleComponent_getSize:
148  * @obj: a pointer to the #AccessibleComponent to query.
149  * @width: a pointer to a #long into which the x extents (width) will be returned.
150  * @height: a pointer to a #long into which the y extents (height) will be returned.
151  *
152  * Get the size of the specified #AccessibleComponent.
153  *
154  **/
155 void
156 AccessibleComponent_getSize (AccessibleComponent *obj,
157                              long *width,
158                              long *height)
159 {
160   Accessibility_Component_getSize (*obj,
161                                    (CORBA_long *) width,
162                                    (CORBA_long *) height,
163                                    &ev);
164 }
165
166 /* Not Yet Implemented */
167 void
168 AccessibleComponent_grabFocus (AccessibleComponent *obj)
169 {
170   ;
171 }