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.
11 AccessibleText_ref (AccessibleText *obj)
13 cspi_object_ref (obj);
17 * AccessibleText_unref:
18 * @obj: a pointer to the #Accessible object on which to operate.
20 * Decrement the reference count for an #AccessibleText object.
24 AccessibleText_unref (AccessibleText *obj)
26 cspi_object_unref (obj);
30 * AccessibleText_getCharacterCount:
31 * @obj: a pointer to the #AccessibleText object to query.
33 * Get the character count of an #AccessibleText object.
35 * Returns: a long integer indicating the total number of
36 * characters in the #AccessibleText object.
40 AccessibleText_getCharacterCount (AccessibleText *obj)
44 cspi_return_val_if_fail (obj != NULL, -1);
47 Accessibility_Text__get_characterCount (CSPI_OBJREF (obj), cspi_ev ());
49 cspi_return_val_if_ev ("_getCharacterCount", -1);
55 * AccessibleText_getText:
56 * @obj: a pointer to the #AccessibleText object to query.
57 * @startOffset: a #long indicating the start of the desired text range.
58 * @endOffset: a #long indicating the first character past the desired range.
60 * Get a range of text from an #AccessibleText object. The number of bytes
61 * in the returned string may exceed endOffset-startOffset, since
62 * UTF-8 is a variable-width encoding.
64 * Returns: a text string containing characters from @startOffset
65 * to @endOffset-1, inclusive, encoded as UTF-8.
69 AccessibleText_getText (AccessibleText *obj,
74 Accessibility_Text_getText (CSPI_OBJREF (obj),
75 (CORBA_long) startOffset, (CORBA_long) endOffset, cspi_ev ());
79 * AccessibleText_getCaretOffset:
80 * @obj: a pointer to the #AccessibleText object to query.
82 * Get the current offset of the text caret in an #AccessibleText object.
84 * Returns: a long integer indicating the current position of the text caret.
88 AccessibleText_getCaretOffset (AccessibleText *obj)
91 Accessibility_Text__get_caretOffset (CSPI_OBJREF (obj), cspi_ev ());
96 * AccessibleText_getAttributes:
97 * @obj: a pointer to the #AccessibleText object to query.
98 * @offset: a long integer indicating the offset from which the attribute
100 * @startOffset: a #long indicating the start of the desired text range.
101 * @endOffset: a #long indicating the first character past the desired range.
103 * Get the attributes applied to a range of text from an #AccessibleText
104 * object, and the bounds of the range.
106 * Returns: a text string describing the attributes occurring within the
107 * attribute run containing @offset, encoded as UTF-8 and
112 AccessibleText_getAttributes (AccessibleText *obj,
114 long int *startOffset,
117 CORBA_long retStartOffset, retEndOffset;
120 Accessibility_Text_getAttributes (CSPI_OBJREF (obj),
125 *startOffset = (long) retStartOffset;
126 *endOffset = (long) retEndOffset;
133 * AccessibleText_setCaretOffset:
134 * @obj: a pointer to the #AccessibleText object on which to operate.
135 * @newOffset: the offset to which the text caret is to be moved.
137 * Set the text caret position for an #AccessibleText object.
139 * Returns: #TRUE if successful, #FALSE otherwise.
143 AccessibleText_setCaretOffset (AccessibleText *obj,
147 Accessibility_Text_setCaretOffset (CSPI_OBJREF (obj),
148 (CORBA_long) newOffset, cspi_ev ());
152 * AccessibleText_getTextBeforeOffset:
153 * @obj: a pointer to the #AccessibleText object on which to operate.
154 * @offset: a long integer indicating the offset from which the delimiter
156 * @type: an #AccessibleTextBoundaryType indicating whether the desired
157 * text string is a word, sentence, line, or attribute run.
158 * @startOffset: a pointer to a long integer which is assigned the
159 * starting offset of the returned string, relative to the
160 * original #AccessibleText.
161 * @endOffset: a pointer to a long integer which is assigned the
162 * ending offset of the returned string, relative to the original
165 * Get delimited text from an #AccessibleText object which precedes a given
168 * Returns: a UTF-8 string representing the delimited text, both of whose
169 * delimiting boundaries are before the current offset, or
170 * an empty string if no such text exists.
174 AccessibleText_getTextBeforeOffset (AccessibleText *obj,
176 AccessibleTextBoundaryType type,
177 long int *startOffset,
181 CORBA_long retStartOffset, retEndOffset;
183 Accessibility_Text_getTextBeforeOffset (CSPI_OBJREF (obj),
184 (CORBA_long) offset, (Accessibility_TEXT_BOUNDARY_TYPE) type,
185 &retStartOffset, &retEndOffset,
187 *startOffset = (long) retStartOffset;
188 *endOffset = (long) retEndOffset;
193 * AccessibleText_getTextAtOffset:
194 * @obj: a pointer to the #AccessibleText object on which to operate.
195 * @offset: a long integer indicating the offset from which the delimiter
197 * @type: an #AccessibleTextBoundaryType indicating whether the desired
198 * text string is a word, sentence, line, or attribute run.
199 * @startOffset: a pointer to a long integer which is assigned the
200 * starting offset of the returned string, relative to the
201 * original #AccessibleText.
202 * @endOffset: a pointer to a long integer which is assigned the
203 * ending offset of the returned string, relative to the original
206 * Get delimited text from an #AccessibleText object which includes a given
209 * Returns: a UTF-8 string representing the delimited text, whose
210 * delimiting boundaries bracket the current offset, or
211 * an empty string if no such text exists.
215 AccessibleText_getTextAtOffset (AccessibleText *obj,
217 AccessibleTextBoundaryType type,
218 long int *startOffset, long int *endOffset)
220 CORBA_long corbaStartOffset;
221 CORBA_long corbaEndOffset;
223 retval = Accessibility_Text_getTextAtOffset (CSPI_OBJREF (obj),
225 (Accessibility_TEXT_BOUNDARY_TYPE) type,
229 *startOffset = (long) corbaStartOffset;
230 *endOffset = (long) corbaEndOffset;
232 fprintf (stderr, "text offsets %ld to %ld\n", *startOffset, *endOffset);
239 * AccessibleText_getTextAfterOffset:
240 * @obj: a pointer to the #AccessibleText object on which to operate.
241 * @offset: a long integer indicating the offset from which the delimiter
243 * @type: an #AccessibleTextBoundaryType indicating whether the desired
244 * text string is a word, sentence, line, or attribute run.
245 * @startOffset: a pointer to a long integer which is assigned the
246 * starting offset of the returned string, relative to the
247 * original #AccessibleText.
248 * @endOffset: a pointer to a long integer which is assigned the
249 * ending offset of the returned string, relative to the original
252 * Get delimited text from an #AccessibleText object which follows a given
255 * Returns: a UTF-8 string representing the delimited text, both of whose
256 * delimiting boundaries are after or inclusive of the current
257 * offset, or an empty string if no such text exists.
261 AccessibleText_getTextAfterOffset (AccessibleText *obj,
263 AccessibleTextBoundaryType type,
264 long int *startOffset, long int *endOffset)
267 CORBA_long retStartOffset, retEndOffset;
269 Accessibility_Text_getTextAfterOffset (CSPI_OBJREF (obj),
270 (CORBA_long) offset, (Accessibility_TEXT_BOUNDARY_TYPE) type,
271 &retStartOffset, &retEndOffset,
273 *startOffset = (long) retStartOffset;
274 *endOffset = (long) retEndOffset;
281 * AccessibleText_getCharacterAtOffset:
282 * @obj: a pointer to the #AccessibleText object on which to operate.
283 * @offset: a long integer indicating the text offset where the desired
284 * character is located.
286 * Get the character at a given offset for an #AccessibleText object.
288 * Returns: an #unsigned long integer which represents the
289 * UCS-4 unicode code point of the given character, or
290 * 0xFFFFFFFF if the character in question cannot be represented
291 * in the UCS-4 encoding.
295 AccessibleText_getCharacterAtOffset (AccessibleText *obj,
298 return (unsigned long)
299 Accessibility_Text_getCharacterAtOffset (CSPI_OBJREF (obj),
300 (CORBA_long) offset, cspi_ev ());
304 * AccessibleText_getCharacterExtents:
305 * @obj: a pointer to the #AccessibleText object on which to operate.
306 * @offset: an integer indicating the offset of the text character for
307 * whom boundary information is requested.
308 * @x: a pointer to a long integer into which the nominal x coordinate
309 * of the corresponding glyph will be returned.
310 * @y:a pointer to a long integer into which the nominal y coordinate
311 * of the corresponding glyph will be returned.
312 * @width:a pointer to a long integer into which the width
313 * of the corresponding glyph will be returned.
314 * @height: a pointer to a long integer into which the height
315 * of the corresponding glyph will be returned.
316 * @type: an #AccessibleCoordType indicating the coordinate system to use
317 * for the returned values.
319 * Get the bounding box containing the glyph representing
320 * the character at a particular text offset.
324 AccessibleText_getCharacterExtents (AccessibleText *obj,
330 AccessibleCoordType type)
332 CORBA_long retX, retY, retWidth, retHeight;
333 Accessibility_Text_getCharacterExtents (CSPI_OBJREF (obj),
339 (CORBA_short) type, cspi_ev ());
342 *width = (long) retWidth;
343 *height = (long) retHeight;
348 * AccessibleText_getOffsetAtPoint:
349 * @obj: a pointer to the #AccessibleText object on which to operate.
350 * @x: the x coordinate of the point to be queried.
351 * @y: the y coordinate of the point to be queried.
352 * @type: an #AccessibleCoordType indicating the coordinate system in which
353 * the values should be returned.
355 * Get the bounding box for a glyph at a certain #AccessibleText offset.
357 * Returns: the offset (as a long integer) at the point (@x, @y)
358 * in the specified coordinate system.
362 AccessibleText_getOffsetAtPoint (AccessibleText *obj,
365 AccessibleCoordType type)
368 Accessibility_Text_getOffsetAtPoint (CSPI_OBJREF (obj),
369 (CORBA_long) x, (CORBA_long) y, (CORBA_short) type, cspi_ev ());
374 * AccessibleText_getNSelections:
375 * @obj: a pointer to the #AccessibleText object on which to operate.
377 * Get the number of active non-contiguous selections for an
378 * #AccessibleText object.
380 * Returns: a long integer indicating the current
381 * number of non-contiguous text selections active
382 * within an #AccessibleText object.
386 AccessibleText_getNSelections (AccessibleText *obj)
389 Accessibility_Text_getNSelections (CSPI_OBJREF (obj), cspi_ev ());
395 * AccessibleText_getSelection:
396 * @obj: a pointer to the #AccessibleText object on which to operate.
397 * @selectionNum: an integer indicating which selection to query.
398 * @startOffset: a pointer to a long integer into which the start offset
399 * of the selection will be returned.
400 * @endOffset: a pointer to a long integer into which the start offset
401 * of the selection will be returned.
403 * Get the bounds of the @selectionNum-th active text selection for an
404 * #AccessibleText object.
408 AccessibleText_getSelection (AccessibleText *obj,
409 long int selectionNum,
410 long int *startOffset,
413 CORBA_long retStartOffset, retEndOffset;
414 Accessibility_Text_getSelection (CSPI_OBJREF (obj),
415 (CORBA_long) selectionNum,
416 &retStartOffset, &retEndOffset, cspi_ev ());
418 *startOffset = (long) retStartOffset;
419 *endOffset = (long) retEndOffset;
425 * AccessibleText_addSelection:
426 * @obj: a pointer to the #AccessibleText object on which to operate.
427 * @startOffset: the starting offset of the desired new selection.
428 * @endOffset: the offset of the first character after the new selection.
430 * Select some text (add a text selection) in an #AccessibleText object.
432 * Returns: #TRUE if successful, #FALSE otherwise.
436 AccessibleText_addSelection (AccessibleText *obj,
437 long int startOffset, long int endOffset)
440 Accessibility_Text_addSelection (CSPI_OBJREF (obj),
441 (CORBA_long) startOffset, (CORBA_long) endOffset,
447 * AccessibleText_removeSelection:
448 * @obj: a pointer to the #AccessibleText object on which to operate.
449 * @selectionNum: an integer indicating which (possibly of several)
450 * text selection to remove.
452 * De-select a text selection.
454 * Returns: #TRUE if successful, #FALSE otherwise.
458 AccessibleText_removeSelection (AccessibleText *obj,
459 long int selectionNum)
462 Accessibility_Text_removeSelection (CSPI_OBJREF (obj),
463 (CORBA_long) selectionNum, cspi_ev ());
467 * AccessibleText_setSelection:
468 * @obj: a pointer to the #AccessibleText object on which to operate.
469 * @selectionNum: a zero-offset index indicating which text selection to modify.
470 * @startOffset: a long int, the new starting offset for the selection.
471 * @endOffset: a long int, the desired new offset of the first character
472 * after the selection.
474 * Change the bounds of an existing #AccessibleText text selection.
476 * Returns: #TRUE if successful, #FALSE otherwise.
480 AccessibleText_setSelection (AccessibleText *obj,
481 long int selectionNum,
482 long int startOffset,
486 Accessibility_Text_setSelection (CSPI_OBJREF (obj),
487 (CORBA_long) selectionNum,
488 (CORBA_long) startOffset,
489 (CORBA_long) endOffset, cspi_ev ());