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);
19 * AccessibleText_unref:
20 * @obj: a pointer to the #Accessible object on which to operate.
22 * Decrement the reference count for an #AccessibleText object.
24 * Returns: (no return code implemented yet).
28 AccessibleText_unref (AccessibleText *obj)
30 cspi_object_unref (obj);
34 * AccessibleText_getCharacterCount:
35 * @obj: a pointer to the #AccessibleText object to query.
37 * Get the character count of an #AccessibleText object.
39 * Returns: a long integer indicating the total number of
40 * characters in the #AccessibleText object.
44 AccessibleText_getCharacterCount (AccessibleText *obj)
48 cspi_return_val_if_fail (obj != NULL, -1);
51 Accessibility_Text__get_characterCount (CSPI_OBJREF (obj), cspi_ev ());
53 cspi_return_val_if_ev ("_getCharacterCount", -1);
59 * AccessibleText_getText:
60 * @obj: a pointer to the #AccessibleText object to query.
61 * @startOffset: a #long indicating the start of the desired text range.
62 * @endOffset: a #long indicating the first character past the desired range.
64 * Get a range of text from an #AccessibleText object. The number of bytes
65 * in the returned string may exceed endOffset-startOffset, since
66 * UTF-8 is a variable-width encoding.
68 * Returns: a text string containing characters from @startOffset
69 * to @endOffset-1, inclusive, encoded as UTF-8.
73 AccessibleText_getText (AccessibleText *obj,
78 Accessibility_Text_getText (CSPI_OBJREF (obj),
79 (CORBA_long) startOffset, (CORBA_long) endOffset, cspi_ev ());
83 * AccessibleText_getCaretOffset:
84 * @obj: a pointer to the #AccessibleText object to query.
86 * Get the current offset of the text caret in an #AccessibleText object.
88 * Returns: a long integer indicating the current position of the text caret.
92 AccessibleText_getCaretOffset (AccessibleText *obj)
95 Accessibility_Text__get_caretOffset (CSPI_OBJREF (obj), cspi_ev ());
100 * AccessibleText_getAttributes:
101 * @obj: a pointer to the #AccessibleText object to query.
102 * @offset: a long integer indicating the offset from which the attribute
104 * @startOffset: a #long indicating the start of the desired text range.
105 * @endOffset: a #long indicating the first character past the desired range.
107 * Get the attributes applied to a range of text from an #AccessibleText
108 * object, and the bounds of the range.
110 * Returns: a text string describing the attributes occurring within the
111 * attribute run containing @offset, encoded as UTF-8 and
116 AccessibleText_getAttributes (AccessibleText *obj,
118 long int *startOffset,
121 CORBA_long retStartOffset, retEndOffset;
124 Accessibility_Text_getAttributes (CSPI_OBJREF (obj),
129 *startOffset = (long) retStartOffset;
130 *endOffset = (long) retEndOffset;
137 * AccessibleText_setCaretOffset:
138 * @obj: a pointer to the #AccessibleText object on which to operate.
139 * @newOffset: the offset to which the text caret is to be moved.
141 * Set the text caret position for an #AccessibleText object.
143 * Returns: #TRUE if successful, #FALSE otherwise.
147 AccessibleText_setCaretOffset (AccessibleText *obj,
151 Accessibility_Text_setCaretOffset (CSPI_OBJREF (obj),
152 (CORBA_long) newOffset, cspi_ev ());
156 * AccessibleText_getTextBeforeOffset:
157 * @obj: a pointer to the #AccessibleText object on which to operate.
158 * @offset: a long integer indicating the offset from which the delimiter
160 * @type: an #AccessibleTextBoundaryType indicating whether the desired
161 * text string is a word, sentence, line, or attribute run.
162 * @startOffset: a pointer to a long integer which is assigned the
163 * starting offset of the returned string, relative to the
164 * original #AccessibleText.
165 * @endOffset: a pointer to a long integer which is assigned the
166 * ending offset of the returned string, relative to the original
169 * Get delimited text from an #AccessibleText object which precedes a given
172 * Returns: a UTF-8 string representing the delimited text, both of whose
173 * delimiting boundaries are before the current offset, or
174 * an empty string if no such text exists.
178 AccessibleText_getTextBeforeOffset (AccessibleText *obj,
180 AccessibleTextBoundaryType type,
181 long int *startOffset,
185 CORBA_long retStartOffset, retEndOffset;
187 Accessibility_Text_getTextBeforeOffset (CSPI_OBJREF (obj),
188 (CORBA_long) offset, (Accessibility_TEXT_BOUNDARY_TYPE) type,
189 &retStartOffset, &retEndOffset,
191 *startOffset = (long) retStartOffset;
192 *endOffset = (long) retEndOffset;
197 * AccessibleText_getTextAtOffset:
198 * @obj: a pointer to the #AccessibleText object on which to operate.
199 * @offset: a long integer indicating the offset from which the delimiter
201 * @type: an #AccessibleTextBoundaryType indicating whether the desired
202 * text string is a word, sentence, line, or attribute run.
203 * @startOffset: a pointer to a long integer which is assigned the
204 * starting offset of the returned string, relative to the
205 * original #AccessibleText.
206 * @endOffset: a pointer to a long integer which is assigned the
207 * ending offset of the returned string, relative to the original
210 * Get delimited text from an #AccessibleText object which includes a given
213 * Returns: a UTF-8 string representing the delimited text, whose
214 * delimiting boundaries bracket the current offset, or
215 * an empty string if no such text exists.
219 AccessibleText_getTextAtOffset (AccessibleText *obj,
221 AccessibleTextBoundaryType type,
222 long int *startOffset, long int *endOffset)
224 CORBA_long corbaStartOffset;
225 CORBA_long corbaEndOffset;
227 retval = Accessibility_Text_getTextAtOffset (CSPI_OBJREF (obj),
229 (Accessibility_TEXT_BOUNDARY_TYPE) type,
233 *startOffset = (long) corbaStartOffset;
234 *endOffset = (long) corbaEndOffset;
236 fprintf (stderr, "text offsets %ld to %ld\n", *startOffset, *endOffset);
243 * AccessibleText_getTextAfterOffset:
244 * @obj: a pointer to the #AccessibleText object on which to operate.
245 * @offset: a long integer indicating the offset from which the delimiter
247 * @type: an #AccessibleTextBoundaryType indicating whether the desired
248 * text string is a word, sentence, line, or attribute run.
249 * @startOffset: a pointer to a long integer which is assigned the
250 * starting offset of the returned string, relative to the
251 * original #AccessibleText.
252 * @endOffset: a pointer to a long integer which is assigned the
253 * ending offset of the returned string, relative to the original
256 * Get delimited text from an #AccessibleText object which follows a given
259 * Returns: a UTF-8 string representing the delimited text, both of whose
260 * delimiting boundaries are after or inclusive of the current
261 * offset, or an empty string if no such text exists.
265 AccessibleText_getTextAfterOffset (AccessibleText *obj,
267 AccessibleTextBoundaryType type,
268 long int *startOffset, long int *endOffset)
271 CORBA_long retStartOffset, retEndOffset;
273 Accessibility_Text_getTextAfterOffset (CSPI_OBJREF (obj),
274 (CORBA_long) offset, (Accessibility_TEXT_BOUNDARY_TYPE) type,
275 &retStartOffset, &retEndOffset,
277 *startOffset = (long) retStartOffset;
278 *endOffset = (long) retEndOffset;
285 * AccessibleText_getCharacterAtOffset:
286 * @obj: a pointer to the #AccessibleText object on which to operate.
287 * @offset: a long integer indicating the text offset where the desired
288 * character is located.
290 * Get the character at a given offset for an #AccessibleText object.
292 * Returns: an #unsigned long integer which represents the
293 * UCS-4 unicode code point of the given character, or
294 * 0xFFFFFFFF if the character in question cannot be represented
295 * in the UCS-4 encoding.
299 AccessibleText_getCharacterAtOffset (AccessibleText *obj,
302 return (unsigned long)
303 Accessibility_Text_getCharacterAtOffset (CSPI_OBJREF (obj),
304 (CORBA_long) offset, cspi_ev ());
308 * AccessibleText_getCharacterExtents:
309 * @obj: a pointer to the #AccessibleText object on which to operate.
310 * @offset: an integer indicating the offset of the text character for
311 * whom boundary information is requested.
312 * @x: a pointer to a long integer into which the nominal x coordinate
313 * of the corresponding glyph will be returned.
314 * @y:a pointer to a long integer into which the nominal y coordinate
315 * of the corresponding glyph will be returned.
316 * @width:a pointer to a long integer into which the width
317 * of the corresponding glyph will be returned.
318 * @height: a pointer to a long integer into which the height
319 * of the corresponding glyph will be returned.
320 * @type: an #AccessibleCoordType indicating the coordinate system to use
321 * for the returned values.
323 * Get the bounding box containing the glyph representing
324 * the character at a particular text offset.
328 AccessibleText_getCharacterExtents (AccessibleText *obj,
334 AccessibleCoordType type)
336 CORBA_long retX, retY, retWidth, retHeight;
337 Accessibility_Text_getCharacterExtents (CSPI_OBJREF (obj),
343 (CORBA_short) type, cspi_ev ());
346 *width = (long) retWidth;
347 *height = (long) retHeight;
352 * AccessibleText_getOffsetAtPoint:
353 * @obj: a pointer to the #AccessibleText object on which to operate.
354 * @x: the x coordinate of the point to be queried.
355 * @y: the y coordinate of the point to be queried.
356 * @type: an #AccessibleCoordType indicating the coordinate system in which
357 * the values should be returned.
359 * Get the bounding box for a glyph at a certain #AccessibleText offset.
361 * Returns: the offset (as a long integer) at the point (@x, @y)
362 * in the specified coordinate system.
366 AccessibleText_getOffsetAtPoint (AccessibleText *obj,
369 AccessibleCoordType type)
372 Accessibility_Text_getOffsetAtPoint (CSPI_OBJREF (obj),
373 (CORBA_long) x, (CORBA_long) y, (CORBA_short) type, cspi_ev ());
378 * AccessibleText_getNSelections:
379 * @obj: a pointer to the #AccessibleText object on which to operate.
381 * Get the number of active non-contiguous selections for an
382 * #AccessibleText object.
384 * Returns: a long integer indicating the current
385 * number of non-contiguous text selections active
386 * within an #AccessibleText object.
390 AccessibleText_getNSelections (AccessibleText *obj)
393 Accessibility_Text_getNSelections (CSPI_OBJREF (obj), cspi_ev ());
399 * AccessibleText_getSelection:
400 * @obj: a pointer to the #AccessibleText object on which to operate.
401 * @selectionNum: an integer indicating which selection to query.
402 * @startOffset: a pointer to a long integer into which the start offset
403 * of the selection will be returned.
404 * @endOffset: a pointer to a long integer into which the start offset
405 * of the selection will be returned.
407 * Get the bounds of the @selectionNum-th active text selection for an
408 * #AccessibleText object.
412 AccessibleText_getSelection (AccessibleText *obj,
413 long int selectionNum,
414 long int *startOffset,
417 CORBA_long retStartOffset, retEndOffset;
418 Accessibility_Text_getSelection (CSPI_OBJREF (obj),
419 (CORBA_long) selectionNum,
420 &retStartOffset, &retEndOffset, cspi_ev ());
422 *startOffset = (long) retStartOffset;
423 *endOffset = (long) retEndOffset;
429 * AccessibleText_addSelection:
430 * @obj: a pointer to the #AccessibleText object on which to operate.
431 * @startOffset: the starting offset of the desired new selection.
432 * @endOffset: the offset of the first character after the new selection.
434 * Select some text (add a text selection) in an #AccessibleText object.
436 * Returns: #TRUE if successful, #FALSE otherwise.
440 AccessibleText_addSelection (AccessibleText *obj,
441 long int startOffset, long int endOffset)
444 Accessibility_Text_addSelection (CSPI_OBJREF (obj),
445 (CORBA_long) startOffset, (CORBA_long) endOffset,
451 * AccessibleText_removeSelection:
452 * @obj: a pointer to the #AccessibleText object on which to operate.
453 * @selectionNum: an integer indicating which (possibly of several)
454 * text selection to remove.
456 * De-select a text selection.
458 * Returns: #TRUE if successful, #FALSE otherwise.
462 AccessibleText_removeSelection (AccessibleText *obj,
463 long int selectionNum)
466 Accessibility_Text_removeSelection (CSPI_OBJREF (obj),
467 (CORBA_long) selectionNum, cspi_ev ());
471 * AccessibleText_setSelection:
472 * @obj: a pointer to the #AccessibleText object on which to operate.
473 * @selectionNum: a zero-offset index indicating which text selection to modify.
474 * @startOffset: a long int, the new starting offset for the selection.
475 * @endOffset: a long int, the desired new offset of the first character
476 * after the selection.
478 * Change the bounds of an existing #AccessibleText text selection.
480 * Returns: #TRUE if successful, #FALSE otherwise.
484 AccessibleText_setSelection (AccessibleText *obj,
485 long int selectionNum,
486 long int startOffset,
490 Accessibility_Text_setSelection (CSPI_OBJREF (obj),
491 (CORBA_long) selectionNum,
492 (CORBA_long) startOffset,
493 (CORBA_long) endOffset, cspi_ev ());