2 * AT-SPI - Assistive Technology Service Provider Interface
3 * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
5 * Copyright 2001, 2002 Sun Microsystems Inc.,
6 * Copyright 2001, 2002 Ximian, Inc.
7 * Copyright 2010, 2011 Novell, Inc.
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public
11 * License as published by the Free Software Foundation; either
12 * version 2 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Library General Public License for more details.
19 * You should have received a copy of the GNU Library General Public
20 * License along with this library; if not, write to the
21 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22 * Boston, MA 02111-1307, USA.
25 #include "atspi-private.h"
28 * @src: a pointer to the source #AtspiRange object that will be copied.
30 * Gets a copy of an #AtspiRange object.
32 * Returns: the #AtspiRange copy of an #AtspiRange object.
35 atspi_range_copy (AtspiRange *src)
37 AtspiRange *dst = g_new (AtspiRange, 1);
39 dst->start_offset = src->start_offset;
40 dst->end_offset = src->end_offset;
44 G_DEFINE_BOXED_TYPE (AtspiRange, atspi_range, atspi_range_copy, g_free)
46 static AtspiTextRange *
47 atspi_text_range_copy (AtspiTextRange *src)
49 AtspiTextRange *dst = g_new (AtspiTextRange, 1);
51 dst->content = g_strdup (src->content);
52 dst->start_offset = src->start_offset;
53 dst->end_offset = src->end_offset;
58 atspi_text_range_free (AtspiTextRange *range)
60 g_free (range->content);
64 G_DEFINE_BOXED_TYPE (AtspiTextRange, atspi_text_range, atspi_text_range_copy,
65 atspi_text_range_free)
68 * atspi_text_get_character_count:
69 * @obj: a pointer to the #AtspiText object to query.
71 * Gets the character count of an #AccessibleText object.
73 * Returns: a #gint indicating the total number of
74 * characters in the #AccessibleText object.
77 atspi_text_get_character_count (AtspiText *obj, GError **error)
79 dbus_int32_t retval = 0;
81 g_return_val_if_fail (obj != NULL, -1);
83 _atspi_dbus_get_property (obj, atspi_interface_text, "CharacterCount", error, "i", &retval);
89 * atspi_text_get_text:
90 * @obj: a pointer to the #AtspiText object to query.
91 * @start_offset: a #gint indicating the start of the desired text range.
92 * @end_offset: a #gint indicating the first character past the desired range.
94 * Gets a range of text from an #AtspiText object. The number of bytes
95 * in the returned string may exceed either end_offset or start_offset, since
96 * UTF-8 is a variable-width encoding.
98 * Returns: a text string containing characters from @start_offset
99 * to @end_offset-1, inclusive, encoded as UTF-8.
102 atspi_text_get_text (AtspiText *obj,
107 gchar *retval = NULL;
108 dbus_int32_t d_start_offset = start_offset, d_end_offset = end_offset;
110 g_return_val_if_fail (obj != NULL, g_strdup (""));
112 _atspi_dbus_call (obj, atspi_interface_text, "GetText", error, "ii=>s", d_start_offset, d_end_offset, &retval);
115 retval = g_strdup ("");
121 * atspi_text_get_caret_offset:
122 * @obj: a pointer to the #AtspiText object to query.
124 * Gets the current offset of the text caret in an #AtspiText object.
126 * Returns: a #gint indicating the current position of the text caret.
129 atspi_text_get_caret_offset (AtspiText *obj, GError **error)
131 dbus_int32_t retval = -1;
133 g_return_val_if_fail (obj != NULL, -1);
135 _atspi_dbus_get_property (obj, atspi_interface_text, "CaretOffset", error, "i", &retval);
141 * atspi_text_get_attributes:
142 * @obj: a pointer to the #AtspiText object to query.
143 * @offset: a #gint indicating the offset from which the attribute
145 * @start_offset: (out): a #gint pointer indicating the start of the desired text
147 * @end_offset: (out): a #gint pointer indicating the first character past the desired
150 * Gets the attributes applied to a range of text from an #AtspiText
151 * object. The text attributes correspond to CSS attributes
153 * <em>DEPRECATED</em>
155 * Returns: (element-type gchar* gchar*) (transfer full): a #GHashTable
156 * describing the attributes at the given character offset.
158 * Deprecated: 2.10: Use atspi_text_get_text_attributes instead.
159 * Rename to: atspi_text_get_text_attributes
162 atspi_text_get_attributes (AtspiText *obj,
168 return atspi_text_get_text_attributes (obj, offset, start_offset, end_offset, error);
172 * atspi_text_get_text_attributes:
173 * @obj: a pointer to the #AtspiText object to query.
174 * @offset: a #gint indicating the offset from which the attribute
176 * @start_offset: (out): a #gint pointer indicating the start of the desired text
178 * @end_offset: (out): a #gint pointer indicating the first character past the desired
181 * Gets the attributes applied to a range of text from an #AtspiText
182 * object. The text attributes correspond to CSS attributes
184 * <em>DEPRECATED</em>
186 * Returns: (element-type gchar* gchar*) (transfer full): a #GHashTable
187 * describing the attributes at the given character offset.
190 atspi_text_get_text_attributes (AtspiText *obj,
196 dbus_int32_t d_offset = offset;
197 dbus_int32_t d_start_offset, d_end_offset;
199 DBusMessageIter iter;
200 GHashTable *ret = NULL;
205 reply = _atspi_dbus_call_partial (obj, atspi_interface_text, "GetAttributes", error, "i", d_offset);
206 _ATSPI_DBUS_CHECK_SIG (reply, "a{ss}ii", error, ret)
208 dbus_message_iter_init (reply, &iter);
209 ret = _atspi_dbus_hash_from_iter (&iter);
210 dbus_message_iter_next (&iter);
212 dbus_message_iter_get_basic (&iter, &d_start_offset);
214 *start_offset = d_start_offset;
215 dbus_message_iter_next (&iter);
216 dbus_message_iter_get_basic (&iter, &d_end_offset);
218 *end_offset = d_end_offset;
220 dbus_message_unref (reply);
225 * atspi_text_get_attribute_run:
226 * @obj: a pointer to the #AtspiText object to query.
227 * @offset: a #gint indicating the offset from which the attribute
229 * @include_defaults: a #bool that, when set as #FALSE, indicates the call
230 * should only return those attributes which are explicitly set on the current
231 * attribute run, omitting any attributes which are inherited from the
233 * @start_offset: (out): a #gint pointer indicating the start of the desired text
235 * @end_offset: (out): a #gint pointer indicating the first character past the desired
238 * Gets a set of attributes applied to a range of text from an #AtspiText object, optionally
239 * including its 'default' attributes.
241 * Returns: (element-type gchar* gchar*) (transfer full): a #GHashTable with attributes
242 * defined at the indicated offset, optionally including the 'default' ones.
245 atspi_text_get_attribute_run (AtspiText *obj,
247 gboolean include_defaults,
252 dbus_int32_t d_offset = offset;
253 dbus_int32_t d_start_offset, d_end_offset;
255 DBusMessageIter iter;
256 GHashTable *ret = NULL;
261 reply = _atspi_dbus_call_partial (obj, atspi_interface_text,
262 "GetAttributeRun", error, "ib", d_offset,
264 _ATSPI_DBUS_CHECK_SIG (reply, "a{ss}ii", error, ret)
266 dbus_message_iter_init (reply, &iter);
267 ret = _atspi_dbus_hash_from_iter (&iter);
268 dbus_message_iter_next (&iter);
270 dbus_message_iter_get_basic (&iter, &d_start_offset);
272 *start_offset = d_start_offset;
273 dbus_message_iter_next (&iter);
274 dbus_message_iter_get_basic (&iter, &d_end_offset);
276 *end_offset = d_end_offset;
278 dbus_message_unref (reply);
283 * atspi_text_get_attribute_value:
284 * @obj: a pointer to the #AtspiText object to query.
285 * @offset: The character offset at which to query the attribute.
286 * @attribute_name: The attribute to query.
288 * Gets the value of a named attribute at a given offset.
290 * Returns: the value of a given attribute at the given offset, or NULL if
293 * Deprecated: 2.10: Use atspi_text_get_text_attribute_value instead.
294 * Rename to: atspi_text_get_text_attribute_value
297 atspi_text_get_attribute_value (AtspiText *obj,
299 gchar *attribute_value,
302 return atspi_text_get_text_attribute_value (obj, offset, attribute_value,
307 * atspi_text_get_text_attribute_value:
308 * @obj: a pointer to the #AtspiText object to query.
309 * @offset: The character offset at which to query the attribute.
310 * @attribute_name: The attribute to query.
312 * Gets the value of a named attribute at a given offset.
314 * Returns: the value of a given attribute at the given offset, or NULL if
318 atspi_text_get_text_attribute_value (AtspiText *obj,
320 gchar *attribute_value,
323 gchar *retval = NULL;
325 g_return_val_if_fail (obj != NULL, NULL);
327 _atspi_dbus_call (obj, atspi_interface_text, "GetAttributeValue", error, "i=>s", offset, &retval);
333 * atspi_text_get_default_attributes:
334 * @obj: a pointer to the #AtspiText object to query.
336 * Gets the default attributes applied to an #AtspiText
337 * object. The text attributes correspond to CSS attributes
338 * where possible. The combination of this attribute set and
339 * the attributes reported by #atspi_text_get_attributes
340 * describes the entire set of text attributes over a range.
342 * Returns: (element-type gchar* gchar*) (transfer full): a #GHashTable
343 * containing the default attributes applied to a text object,
344 * (exclusive of explicitly-set attributes), encoded as UTF-8.
347 atspi_text_get_default_attributes (AtspiText *obj, GError **error)
351 g_return_val_if_fail (obj != NULL, NULL);
353 reply = _atspi_dbus_call_partial (obj, atspi_interface_text, "GetDefaultAttributes", error, "");
354 return _atspi_dbus_return_hash_from_message (reply);
359 * atspi_text_set_caret_offset:
360 * @obj: a pointer to the #AtspiText object on which to operate.
361 * @new_offset: the offset to which the text caret is to be moved.
363 * Moves the text caret to a given position.
365 * Returns: #TRUE if successful, #FALSE otherwise.
368 atspi_text_set_caret_offset (AtspiText *obj,
372 dbus_int32_t d_new_offset = new_offset;
373 dbus_bool_t retval = FALSE;
375 g_return_val_if_fail (obj != NULL, FALSE);
377 _atspi_dbus_call (obj, atspi_interface_text, "SetCaretOffset", error, "i=>b", d_new_offset, &retval);
383 * atspi_text_get_text_before_offset:
384 * @obj: a pointer to the #AtspiText object on which to operate.
385 * @offset: a #gint indicating the offset from which the delimiter
387 * @type: an #AtspiTextBoundaryType indicating whether the desired
388 * text string is a word, sentence, line, or attribute run.
390 * Gets delimited text from an #AtspiText object which precedes a given
393 * Returns: an #AtspiTextRange containing a UTF-8 string representing the
394 * delimited text, both of whose delimiting boundaries are before the
395 * current offset, or an empty string if no such text exists.
398 atspi_text_get_text_before_offset (AtspiText *obj,
400 AtspiTextBoundaryType type,
403 dbus_int32_t d_offset = offset;
404 dbus_uint32_t d_type = type;
405 dbus_int32_t d_start_offset = -1, d_end_offset = -1;
406 AtspiTextRange *range = g_new0 (AtspiTextRange, 1);
408 range->start_offset = range->end_offset = -1;
412 _atspi_dbus_call (obj, atspi_interface_text, "GetTextBeforeOffset", error,
413 "iu=>sii", d_offset, d_type, &range->content,
414 &d_start_offset, &d_end_offset);
416 range->start_offset = d_start_offset;
417 range->end_offset = d_end_offset;
419 range->content = g_strdup ("");
425 * atspi_text_get_string_at_offset:
426 * @text: an #AtspiText
428 * @granularity: An #AtspiTextGranularity
429 * @start_offset: (out): the start offset of the returned string, or -1
430 * if an error has occurred (e.g. invalid offset, not implemented)
431 * @end_offset: (out): the offset of the first character after the returned string,
432 * or -1 if an error has occurred (e.g. invalid offset, not implemented)
434 * Gets a portion of the text exposed through an #AtspiText according to a given @offset
435 * and a specific @granularity, along with the start and end offsets defining the
436 * boundaries of such a portion of text.
438 * If @granularity is ATSPI_TEXT_GRANULARITY_CHAR the character at the
439 * offset is returned.
441 * If @granularity is ATSPI_TEXT_GRANULARITY_WORD the returned string
442 * is from the word start at or before the offset to the word start after
445 * The returned string will contain the word at the offset if the offset
446 * is inside a word and will contain the word before the offset if the
447 * offset is not inside a word.
449 * If @granularity is ATSPI_TEXT_GRANULARITY_SENTENCE the returned string
450 * is from the sentence start at or before the offset to the sentence
451 * start after the offset.
453 * The returned string will contain the sentence at the offset if the offset
454 * is inside a sentence and will contain the sentence before the offset
455 * if the offset is not inside a sentence.
457 * If @granularity is ATSPI_TEXT_GRANULARITY_LINE the returned string
458 * is from the line start at or before the offset to the line
459 * start after the offset.
461 * If @granularity is ATSPI_TEXT_GRANULARITY_PARAGRAPH the returned string
462 * is from the start of the paragraph at or before the offset to the start
463 * of the following paragraph after the offset.
467 * Returns: a newly allocated string containing the text at the @offset bounded
468 * by the specified @granularity. Use g_free() to free the returned string.
469 * Returns %NULL if the offset is invalid or no implementation is available.
472 atspi_text_get_string_at_offset (AtspiText *obj,
474 AtspiTextGranularity granularity,
477 dbus_int32_t d_offset = offset;
478 dbus_uint32_t d_granularity = granularity;
479 dbus_int32_t d_start_offset = -1, d_end_offset = -1;
480 AtspiTextRange *range = g_new0 (AtspiTextRange, 1);
482 range->start_offset = range->end_offset = -1;
486 _atspi_dbus_call (obj, atspi_interface_text, "GetStringAtOffset", error,
487 "iu=>sii", d_offset, d_granularity, &range->content,
488 &d_start_offset, &d_end_offset);
490 range->start_offset = d_start_offset;
491 range->end_offset = d_end_offset;
493 range->content = g_strdup ("");
499 * atspi_text_get_text_at_offset:
500 * @obj: a pointer to the #AtspiText object on which to operate.
501 * @offset: a #gint indicating the offset from which the delimiter
503 * @type: an #AtspiTextBoundaryType indicating whether the desired
504 * text string is a word, sentence, line, or attribute run.
506 * Gets delimited text from an #AtspiText object which includes a given
509 * Returns: an #AtspiTextRange containing a UTF-8 string representing the
510 * delimited text, whose delimiting boundaries bracket the
511 * current offset, or an empty string if no such text exists.
513 * Deprecated: 2.10: Use atspi_text_get_string_at_offset.
516 atspi_text_get_text_at_offset (AtspiText *obj,
518 AtspiTextBoundaryType type,
521 dbus_int32_t d_offset = offset;
522 dbus_uint32_t d_type = type;
523 dbus_int32_t d_start_offset = -1, d_end_offset = -1;
524 AtspiTextRange *range = g_new0 (AtspiTextRange, 1);
526 range->start_offset = range->end_offset = -1;
530 _atspi_dbus_call (obj, atspi_interface_text, "GetTextAtOffset", error,
531 "iu=>sii", d_offset, d_type, &range->content,
532 &d_start_offset, &d_end_offset);
534 range->start_offset = d_start_offset;
535 range->end_offset = d_end_offset;
537 range->content = g_strdup ("");
543 * atspi_text_get_text_after_offset:
544 * @obj: a pointer to the #AtspiText object on which to operate.
545 * @offset: a #gint indicating the offset from which the delimiter
547 * @type: an #AtspiTextBoundaryType indicating whether the desired
548 * text string is a word, sentence, line, or attribute run.
550 * Gets delimited text from an #AtspiText object which follows a given
553 * Returns: an #AtspiTextRange containing a UTF-8 string representing the
554 * delimited text, both of whose delimiting boundaries are after or
555 * inclusive of the current offset, or an empty string if no such
559 atspi_text_get_text_after_offset (AtspiText *obj,
561 AtspiTextBoundaryType type,
564 dbus_int32_t d_offset = offset;
565 dbus_uint32_t d_type = type;
566 dbus_int32_t d_start_offset = -1, d_end_offset = -1;
567 AtspiTextRange *range = g_new0 (AtspiTextRange, 1);
569 range->start_offset = range->end_offset = -1;
573 _atspi_dbus_call (obj, atspi_interface_text, "GetTextAfterOffset", error,
574 "iu=>sii", d_offset, d_type, &range->content,
575 &d_start_offset, &d_end_offset);
577 range->start_offset = d_start_offset;
578 range->end_offset = d_end_offset;
580 range->content = g_strdup ("");
586 * atspi_text_get_character_at_offset:
587 * @obj: a pointer to the #AtspiText object on which to operate.
588 * @offset: a #gint indicating the text offset where the desired
589 * character is located.
591 * Gets the character at a given offset for an #AtspiText object.
593 * Returns: a #guint representing the
594 * UCS-4 unicode code point of the given character, or
595 * 0xFFFFFFFF if the character in question cannot be represented
596 * in the UCS-4 encoding.
599 atspi_text_get_character_at_offset (AtspiText *obj,
603 dbus_int32_t d_offset = offset;
604 dbus_int32_t retval = -1;
606 g_return_val_if_fail (obj != NULL, -1);
608 _atspi_dbus_call (obj, atspi_interface_text, "GetCharacterAtOffset", error, "i=>i", d_offset, &retval);
614 * atspi_text_get_character_extents:
615 * @obj: a pointer to the #AtspiText object on which to operate.
616 * @offset: a #gint indicating the offset of the text character for
617 * whom boundary information is requested.
618 * @type: an #AccessibleCoordType indicating the coordinate system to use
619 * for the returned values.
621 * Gets a bounding box containing the glyph representing
622 * the character at a particular text offset.
624 * Returns: An #AtspiRect specifying the position and size of the character.
628 atspi_text_get_character_extents (AtspiText *obj,
633 dbus_int32_t d_offset = offset;
634 dbus_uint32_t d_type = type;
635 dbus_int32_t d_x, d_y, d_width, d_height;
638 ret.x = ret.y = ret.width = ret.height = -1;
641 return atspi_rect_copy (&ret);
643 _atspi_dbus_call (obj, atspi_interface_text, "GetCharacterExtents", error, "iu=>iiii", d_offset, d_type, &d_x, &d_y, &d_width, &d_height);
648 ret.height = d_height;
649 return atspi_rect_copy (&ret);
653 * atspi_text_get_offset_at_point:
654 * @obj: a pointer to the #AtspiText object on which to operate.
655 * @x: the x coordinate of the point to be queried.
656 * @y: the y coordinate of the point to be queried.
657 * @type: an #AtspiCoordType indicating the coordinate system in which
658 * the values should be returned.
660 * Gets the character offset into the text at a given point.
662 * Returns: the offset (as a #gint) at the point (@x, @y)
663 * in the specified coordinate system.
667 atspi_text_get_offset_at_point (AtspiText *obj,
673 dbus_int32_t d_x = x, d_y = y;
674 dbus_uint32_t d_type = type;
675 dbus_int32_t retval = -1;
677 g_return_val_if_fail (obj != NULL, -1);
679 _atspi_dbus_call (obj, atspi_interface_text, "GetOffsetAtPoint", error, "iiu=>i", d_x, d_y, d_type, &retval);
685 * atspi_text_get_range_extents:
686 * @obj: a pointer to the #AtspiText object on which to operate.
687 * @start_offset: a #gint indicating the offset of the first text character for
688 * whom boundary information is requested.
689 * @end_offset: a #gint indicating the offset of the text character
690 * after the last character for whom boundary information is requested.
691 * @type: an #AtspiCoordType indicating the coordinate system to use
692 * for the returned values.
694 * Gets the bounding box for text within a range in an #AtspiText object.
696 * Returns: An #AtspiRect giving the position and size of the specified range
701 atspi_text_get_range_extents (AtspiText *obj,
707 dbus_int32_t d_start_offset = start_offset, d_end_offset = end_offset;
708 dbus_uint32_t d_type = type;
709 dbus_int32_t d_x, d_y, d_width, d_height;
712 ret.x = ret.y = ret.width = ret.height = -1;
715 return atspi_rect_copy (&ret);
717 _atspi_dbus_call (obj, atspi_interface_text, "GetRangeExtents", error, "iiu=>iiii", d_start_offset, d_end_offset, d_type, &d_x, &d_y, &d_width, &d_height);
722 ret.height = d_height;
723 return atspi_rect_copy (&ret);
727 * atspi_text_get_bounded_ranges:
728 * @obj: a pointer to the #AtspiText object on which to operate.
729 * @x: the 'starting' x coordinate of the bounding box.
730 * @y: the 'starting' y coordinate of the bounding box.
731 * @width: the x extent of the bounding box.
732 * @height: the y extent of the bounding box.
733 * @type: an #AccessibleCoordType indicating the coordinate system to use
734 * for the returned values.
735 * @clipTypeX: an #AtspiTextClipType indicating how to treat characters that
736 * intersect the bounding box's x extents.
737 * @clipTypeY: an #AtspiTextClipType indicating how to treat characters that
738 * intersect the bounding box's y extents.
740 * Gets the ranges of text from an #AtspiText object which lie within the
741 * bounds defined by (@x, @y) and (@x+@width, @y+@height).
743 * Returns: (transfer full) (element-type AtspiTextRange*): a null-terminated list of
744 * pointers to #AtspiTextRange structs detailing the bounded text.
747 atspi_text_get_bounded_ranges (AtspiText *obj,
753 AtspiTextClipType clipTypeX,
754 AtspiTextClipType clipTypeY,
757 dbus_int32_t d_x = x, d_y = y, d_width = width, d_height = height;
758 dbus_uint32_t d_type = type;
759 dbus_uint32_t d_clipTypeX = clipTypeX, d_clipTypeY = clipTypeY;
762 g_return_val_if_fail (obj != NULL, NULL);
764 _atspi_dbus_call (obj, atspi_interface_text, "GetBoundedRanges", error, "iiiiuuu=>a(iisv)", d_x, d_y, d_width, d_height, d_type, d_clipTypeX, d_clipTypeY, &range_seq);
770 * atspi_text_get_n_selections:
771 * @obj: a pointer to the #AtspiText object on which to operate.
773 * Gets the number of active non-contiguous selections for an
776 * Returns: a #gint indicating the current
777 * number of non-contiguous text selections active
778 * within an #AtspiText object.
781 atspi_text_get_n_selections (AtspiText *obj, GError **error)
783 dbus_int32_t retval = 0;
785 g_return_val_if_fail (obj != NULL, -1);
787 _atspi_dbus_call (obj, atspi_interface_text, "GetNSelections", error, "=>i", &retval);
793 * atspi_text_get_selection:
794 * @obj: a pointer to the #AtspiText object on which to operate.
795 * @selection_num: a #gint indicating which selection to query.
797 * Gets the bounds of the @selection_num-th active text selection for an
801 atspi_text_get_selection (AtspiText *obj,
805 dbus_int32_t d_selection_num = selection_num;
806 dbus_int32_t d_start_offset, d_end_offset;
807 AtspiRange *ret = g_new (AtspiRange, 1);
809 ret->start_offset = ret->end_offset = -1;
814 _atspi_dbus_call (obj, atspi_interface_text, "GetSelection", error, "i=>ii", d_selection_num, &d_start_offset, &d_end_offset);
816 ret->start_offset = d_start_offset;
817 ret->end_offset = d_end_offset;
822 * atspi_text_add_selection:
823 * @obj: a pointer to the #AtspiText object on which to operate.
824 * @start_offset: the starting offset of the desired new selection.
825 * @end_offset: the offset of the first character after the new selection.
827 * Selects some text (adds a text selection) in an #AtspiText object.
829 * Returns: #TRUE if successful, #FALSE otherwise.
832 atspi_text_add_selection (AtspiText *obj,
833 gint start_offset, gint end_offset,
836 dbus_int32_t d_start_offset = start_offset, d_end_offset = end_offset;
837 dbus_bool_t retval = FALSE;
839 _atspi_dbus_call (obj, atspi_interface_text, "AddSelection", error, "ii=>b", d_start_offset, d_end_offset, &retval);
845 * atspi_text_remove_selection:
846 * @obj: a pointer to the #AtspiText object on which to operate.
847 * @selection_num: a #gint indicating which text selection to remove.
849 * De-selects a text selection.
851 * Returns: #TRUE if successful, #FALSE otherwise.
854 atspi_text_remove_selection (AtspiText *obj,
858 dbus_int32_t d_selection_num = selection_num;
859 dbus_bool_t retval = FALSE;
861 g_return_val_if_fail (obj != NULL, FALSE);
863 _atspi_dbus_call (obj, atspi_interface_text, "RemoveSelection", error, "i=>b", d_selection_num, &retval);
869 * atspi_text_set_selection:
870 * @obj: a pointer to the #AtspiText object on which to operate.
871 * @selection_num: a zero-offset index indicating which text selection to modify.
872 * @start_offset: a #gint indicating the new starting offset for the selection.
873 * @end_offset: a #gint indicating the desired new offset of the first character
874 * after the selection.
876 * Changes the bounds of an existing #AtspiText text selection.
878 * Returns: #TRUE if successful, #FALSE otherwise.
881 atspi_text_set_selection (AtspiText *obj,
887 dbus_int32_t d_selection_num = selection_num, d_start_offset = start_offset, d_end_offset = end_offset;
888 dbus_bool_t retval = FALSE;
890 g_return_val_if_fail (obj != NULL, FALSE);
892 _atspi_dbus_call (obj, atspi_interface_text, "SetSelection", error, "iii=>b", d_selection_num, d_start_offset, d_end_offset, &retval);
898 atspi_text_base_init (AtspiText *klass)
903 atspi_text_get_type (void)
905 static GType type = 0;
908 static const GTypeInfo tinfo =
911 (GBaseInitFunc) atspi_text_base_init,
912 (GBaseFinalizeFunc) NULL,
915 type = g_type_register_static (G_TYPE_INTERFACE, "AtspiText", &tinfo, 0);