1 #include <cspi/spi-private.h>
5 * @obj: a pointer to the #AccessibleText object on which to operate.
7 * Increment the reference count for an #AccessibleText object.
9 * Returns: (no return code implemented yet).
13 AccessibleText_ref (AccessibleText *obj)
15 cspi_object_ref (obj);
22 * AccessibleText_unref:
23 * @obj: a pointer to the #Accessible object on which to operate.
25 * Decrement the reference count for an #AccessibleText object.
27 * Returns: (no return code implemented yet).
31 AccessibleText_unref (AccessibleText *obj)
33 cspi_object_unref (obj);
39 * AccessibleText_getCharacterCount:
40 * @obj: a pointer to the #AccessibleText object to query.
42 * Get the character count of an #AccessibleText object.
44 * Returns: a long integer indicating the total number of
45 * characters in the #AccessibleText object.
49 AccessibleText_getCharacterCount (AccessibleText *obj)
53 CORBA_exception_init (cspi_ev ());
55 Accessibility_Text__get_characterCount (CSPI_OBJREF (obj), cspi_ev ());
57 cspi_check_ev (cspi_ev (), "SpiAccessibleText_getCharacterCount");
65 * AccessibleText_getText:
66 * @obj: a pointer to the #AccessibleText object to query.
67 * @startOffset: a #long indicating the start of the desired text range.
68 * @endOffset: a #long indicating the first character past the desired range.
70 * Get a range of text from an #AccessibleText object. The number of bytes
71 * in the returned string may exceed endOffset-startOffset, since
72 * UTF-8 is a variable-width encoding.
74 * Returns: a text string containing characters from @startOffset
75 * to @endOffset-1, inclusive, encoded as UTF-8.
79 AccessibleText_getText (AccessibleText *obj,
84 Accessibility_Text_getText (CSPI_OBJREF (obj),
85 (CORBA_long) startOffset, (CORBA_long) endOffset, cspi_ev ());
89 * AccessibleText_getCaretOffset:
90 * @obj: a pointer to the #AccessibleText object to query.
92 * Get the current offset of the text caret in an #AccessibleText object.
94 * Returns: a long integer indicating the current position of the text caret.
98 AccessibleText_getCaretOffset (AccessibleText *obj)
101 Accessibility_Text__get_caretOffset (CSPI_OBJREF (obj), cspi_ev ());
106 * AccessibleText_getAttributes:
107 * @obj: a pointer to the #AccessibleText object to query.
108 * @offset: a long integer indicating the offset from which the attribute
110 * @startOffset: a #long indicating the start of the desired text range.
111 * @endOffset: a #long indicating the first character past the desired range.
113 * Get the attributes applied to a range of text from an #AccessibleText
114 * object, and the bounds of the range.
116 * Returns: a text string describing the attributes occurring within the
117 * attribute run containing @offset, encoded as UTF-8 and
122 AccessibleText_getAttributes (AccessibleText *obj,
124 long int *startOffset,
127 CORBA_long retStartOffset, retEndOffset;
130 Accessibility_Text_getAttributes (CSPI_OBJREF (obj),
135 *startOffset = (long) retStartOffset;
136 *endOffset = (long) retEndOffset;
143 * AccessibleText_setCaretOffset:
144 * @obj: a pointer to the #AccessibleText object on which to operate.
145 * @newOffset: the offset to which the text caret is to be moved.
147 * Set the text caret position for an #AccessibleText object.
149 * Returns: #TRUE if successful, #FALSE otherwise.
153 AccessibleText_setCaretOffset (AccessibleText *obj,
157 Accessibility_Text_setCaretOffset (CSPI_OBJREF (obj),
158 (CORBA_long) newOffset, cspi_ev ());
162 * AccessibleText_getTextBeforeOffset:
163 * @obj: a pointer to the #AccessibleText object on which to operate.
164 * @offset: a long integer indicating the offset from which the delimiter
166 * @type: an #AccessibleTextBoundaryType indicating whether the desired
167 * text string is a word, sentence, line, or attribute run.
168 * @startOffset: a pointer to a long integer which is assigned the
169 * starting offset of the returned string, relative to the
170 * original #AccessibleText.
171 * @endOffset: a pointer to a long integer which is assigned the
172 * ending offset of the returned string, relative to the original
175 * Get delimited text from an #AccessibleText object which precedes a given
178 * Returns: a UTF-8 string representing the delimited text, both of whose
179 * delimiting boundaries are before the current offset, or
180 * an empty string if no such text exists.
184 AccessibleText_getTextBeforeOffset (AccessibleText *obj,
186 AccessibleTextBoundaryType type,
187 long int *startOffset,
191 CORBA_long retStartOffset, retEndOffset;
193 Accessibility_Text_getTextBeforeOffset (CSPI_OBJREF (obj),
194 (CORBA_long) offset, (Accessibility_TEXT_BOUNDARY_TYPE) type,
195 &retStartOffset, &retEndOffset,
197 *startOffset = (long) retStartOffset;
198 *endOffset = (long) retEndOffset;
203 * AccessibleText_getTextAtOffset:
204 * @obj: a pointer to the #AccessibleText object on which to operate.
205 * @offset: a long integer indicating the offset from which the delimiter
207 * @type: an #AccessibleTextBoundaryType indicating whether the desired
208 * text string is a word, sentence, line, or attribute run.
209 * @startOffset: a pointer to a long integer which is assigned the
210 * starting offset of the returned string, relative to the
211 * original #AccessibleText.
212 * @endOffset: a pointer to a long integer which is assigned the
213 * ending offset of the returned string, relative to the original
216 * Get delimited text from an #AccessibleText object which includes a given
219 * Returns: a UTF-8 string representing the delimited text, whose
220 * delimiting boundaries bracket the current offset, or
221 * an empty string if no such text exists.
225 AccessibleText_getTextAtOffset (AccessibleText *obj,
227 AccessibleTextBoundaryType type,
228 long int *startOffset, long int *endOffset)
230 CORBA_long corbaStartOffset;
231 CORBA_long corbaEndOffset;
233 retval = Accessibility_Text_getTextAtOffset (CSPI_OBJREF (obj),
235 (Accessibility_TEXT_BOUNDARY_TYPE) type,
239 *startOffset = (long) corbaStartOffset;
240 *endOffset = (long) corbaEndOffset;
242 fprintf (stderr, "text offsets %ld to %ld\n", *startOffset, *endOffset);
249 * AccessibleText_getTextAfterOffset:
250 * @obj: a pointer to the #AccessibleText object on which to operate.
251 * @offset: a long integer indicating the offset from which the delimiter
253 * @type: an #AccessibleTextBoundaryType indicating whether the desired
254 * text string is a word, sentence, line, or attribute run.
255 * @startOffset: a pointer to a long integer which is assigned the
256 * starting offset of the returned string, relative to the
257 * original #AccessibleText.
258 * @endOffset: a pointer to a long integer which is assigned the
259 * ending offset of the returned string, relative to the original
262 * Get delimited text from an #AccessibleText object which follows a given
265 * Returns: a UTF-8 string representing the delimited text, both of whose
266 * delimiting boundaries are after or inclusive of the current
267 * offset, or an empty string if no such text exists.
271 AccessibleText_getTextAfterOffset (AccessibleText *obj,
273 AccessibleTextBoundaryType type,
274 long int *startOffset, long int *endOffset)
277 CORBA_long retStartOffset, retEndOffset;
279 Accessibility_Text_getTextAfterOffset (CSPI_OBJREF (obj),
280 (CORBA_long) offset, (Accessibility_TEXT_BOUNDARY_TYPE) type,
281 &retStartOffset, &retEndOffset,
283 *startOffset = (long) retStartOffset;
284 *endOffset = (long) retEndOffset;
291 * AccessibleText_getCharacterAtOffset:
292 * @obj: a pointer to the #AccessibleText object on which to operate.
293 * @offset: a long integer indicating the text offset where the desired
294 * character is located.
296 * Get the character at a given offset for an #AccessibleText object.
298 * Returns: an #unsigned long integer which represents the
299 * UCS-4 unicode code point of the given character, or
300 * 0xFFFFFFFF if the character in question cannot be represented
301 * in the UCS-4 encoding.
305 AccessibleText_getCharacterAtOffset (AccessibleText *obj,
308 return (unsigned long)
309 Accessibility_Text_getCharacterAtOffset (CSPI_OBJREF (obj),
310 (CORBA_long) offset, cspi_ev ());
314 * AccessibleText_getCharacterExtents:
315 * @obj: a pointer to the #AccessibleText object on which to operate.
316 * @offset: an integer indicating the offset of the text character for
317 * whom boundary information is requested.
318 * @x: a pointer to a long integer into which the nominal x coordinate
319 * of the corresponding glyph will be returned.
320 * @y:a pointer to a long integer into which the nominal y coordinate
321 * of the corresponding glyph will be returned.
322 * @width:a pointer to a long integer into which the width
323 * of the corresponding glyph will be returned.
324 * @height: a pointer to a long integer into which the height
325 * of the corresponding glyph will be returned.
326 * @type: an #AccessibleCoordType indicating the coordinate system to use
327 * for the returned values.
329 * Get the bounding box containing the glyph representing
330 * the character at a particular text offset.
334 AccessibleText_getCharacterExtents (AccessibleText *obj,
340 AccessibleCoordType type)
342 CORBA_long retX, retY, retWidth, retHeight;
343 Accessibility_Text_getCharacterExtents (CSPI_OBJREF (obj),
349 (CORBA_short) type, cspi_ev ());
352 *width = (long) retWidth;
353 *height = (long) retHeight;
358 * AccessibleText_getOffsetAtPoint:
359 * @obj: a pointer to the #AccessibleText object on which to operate.
360 * @x: the x coordinate of the point to be queried.
361 * @y: the y coordinate of the point to be queried.
362 * @type: an #AccessibleCoordType indicating the coordinate system in which
363 * the values should be returned.
365 * Get the bounding box for a glyph at a certain #AccessibleText offset.
367 * Returns: the offset (as a long integer) at the point (@x, @y)
368 * in the specified coordinate system.
372 AccessibleText_getOffsetAtPoint (AccessibleText *obj,
375 AccessibleCoordType type)
378 Accessibility_Text_getOffsetAtPoint (CSPI_OBJREF (obj),
379 (CORBA_long) x, (CORBA_long) y, (CORBA_short) type, cspi_ev ());
384 * AccessibleText_getNSelections:
385 * @obj: a pointer to the #AccessibleText object on which to operate.
387 * Get the number of active non-contiguous selections for an
388 * #AccessibleText object.
390 * Returns: a long integer indicating the current
391 * number of non-contiguous text selections active
392 * within an #AccessibleText object.
396 AccessibleText_getNSelections (AccessibleText *obj)
399 Accessibility_Text_getNSelections (CSPI_OBJREF (obj), cspi_ev ());
405 * AccessibleText_getSelection:
406 * @obj: a pointer to the #AccessibleText object on which to operate.
407 * @selectionNum: an integer indicating which selection to query.
408 * @startOffset: a pointer to a long integer into which the start offset
409 * of the selection will be returned.
410 * @endOffset: a pointer to a long integer into which the start offset
411 * of the selection will be returned.
413 * Get the bounds of the @selectionNum-th active text selection for an
414 * #AccessibleText object.
418 AccessibleText_getSelection (AccessibleText *obj,
419 long int selectionNum,
420 long int *startOffset,
423 CORBA_long retStartOffset, retEndOffset;
424 Accessibility_Text_getSelection (CSPI_OBJREF (obj),
425 (CORBA_long) selectionNum,
426 &retStartOffset, &retEndOffset, cspi_ev ());
428 *startOffset = (long) retStartOffset;
429 *endOffset = (long) retEndOffset;
435 * AccessibleText_addSelection:
436 * @obj: a pointer to the #AccessibleText object on which to operate.
437 * @startOffset: the starting offset of the desired new selection.
438 * @endOffset: the offset of the first character after the new selection.
440 * Select some text (add a text selection) in an #AccessibleText object.
442 * Returns: #TRUE if successful, #FALSE otherwise.
446 AccessibleText_addSelection (AccessibleText *obj,
447 long int startOffset, long int endOffset)
450 Accessibility_Text_addSelection (CSPI_OBJREF (obj),
451 (CORBA_long) startOffset, (CORBA_long) endOffset,
457 * AccessibleText_removeSelection:
458 * @obj: a pointer to the #AccessibleText object on which to operate.
459 * @selectionNum: an integer indicating which (possibly of several)
460 * text selection to remove.
462 * De-select a text selection.
464 * Returns: #TRUE if successful, #FALSE otherwise.
468 AccessibleText_removeSelection (AccessibleText *obj,
469 long int selectionNum)
472 Accessibility_Text_removeSelection (CSPI_OBJREF (obj),
473 (CORBA_long) selectionNum, cspi_ev ());
477 * AccessibleText_setSelection:
478 * @obj: a pointer to the #AccessibleText object on which to operate.
479 * @selectionNum: a zero-offset index indicating which text selection to modify.
480 * @startOffset: a long int, the new starting offset for the selection.
481 * @endOffset: a long int, the desired new offset of the first character
482 * after the selection.
484 * Change the bounds of an existing #AccessibleText text selection.
486 * Returns: #TRUE if successful, #FALSE otherwise.
490 AccessibleText_setSelection (AccessibleText *obj,
491 long int selectionNum,
492 long int startOffset,
496 Accessibility_Text_setSelection (CSPI_OBJREF (obj),
497 (CORBA_long) selectionNum,
498 (CORBA_long) startOffset,
499 (CORBA_long) endOffset, cspi_ev ());