Wrote the README_GIT file to be a proper tutorial on git, repo.or.cz and gtkD.
[gtkD.git] / gtkD / src / atk / Text.d
blobb146d5903469eac55d68beaa8d5b9b48bfca576e
1 /*
2 * This file is part of gtkD.
4 * gtkD is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * gtkD is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with gtkD; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile = AtkText.html
26 * outPack = atk
27 * outFile = Text
28 * strct = AtkText
29 * realStrct=
30 * ctorStrct=
31 * clss = Text
32 * interf =
33 * class Code: No
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - atk_text_
40 * omit structs:
41 * omit prefixes:
42 * omit code:
43 * imports:
44 * - glib.Str
45 * structWrap:
46 * module aliases:
47 * local aliases:
50 module atk.Text;
52 version(noAssert)
54 version(Tango)
56 import tango.io.Stdout; // use the tango loging?
60 private import gtkc.atktypes;
62 private import gtkc.atk;
65 private import glib.Str;
70 /**
71 * Description
72 * AtkText should be implemented by AtkObjects on behalf of widgets that
73 * have text content which is either attributed or otherwise non-trivial.
74 * AtkObjects whose text content is simple, unattributed, and very brief
75 * may expose that content via atk_object_get_name instead; however if the
76 * text is editable, multi-line, typically longer than three or four words,
77 * attributed, selectable, or if the object already uses the 'name' ATK
78 * property for other information, the AtkText interface should be used
79 * to expose the text content. In the case of editable text content,
80 * AtkEditableText (a subtype of the AtkText interface) should be
81 * implemented instead.
82 * AtkText provides not only traversal facilities and change notification
83 * for text content, but also caret tracking and glyph bounding box
84 * calculations. Note that the text strings are exposed as UTF-8, and are
85 * therefore potentially multi-byte, and caret-to-byte offset mapping makes
86 * no assumptions about the character length; also bounding box
87 * glyph-to-offset mapping may be complex for languages which use ligatures.
89 public class Text
92 /** the main Gtk struct */
93 protected AtkText* atkText;
96 public AtkText* getTextStruct()
98 return atkText;
102 /** the main Gtk struct as a void* */
103 protected void* getStruct()
105 return cast(void*)atkText;
109 * Sets our main struct and passes it to the parent class
111 public this (AtkText* atkText)
113 version(noAssert)
115 if ( atkText is null )
117 int zero = 0;
118 version(Tango)
120 Stdout("struct atkText is null on constructor").newline;
122 else
124 printf("struct atkText is null on constructor");
126 zero = zero / zero;
129 else
131 assert(atkText !is null, "struct atkText is null on constructor");
133 this.atkText = atkText;
139 // imports for the signal processing
140 private import gobject.Signals;
141 private import gtkc.gdktypes;
142 int[char[]] connectedSignals;
144 void delegate(Text)[] onTextAttributesChangedListeners;
145 void addOnTextAttributesChanged(void delegate(Text) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
147 if ( !("text-attributes-changed" in connectedSignals) )
149 Signals.connectData(
150 getStruct(),
151 "text-attributes-changed",
152 cast(GCallback)&callBackTextAttributesChanged,
153 cast(void*)this,
154 null,
155 connectFlags);
156 connectedSignals["text-attributes-changed"] = 1;
158 onTextAttributesChangedListeners ~= dlg;
160 extern(C) static void callBackTextAttributesChanged(AtkText* atktextStruct, Text text)
162 bool consumed = false;
164 foreach ( void delegate(Text) dlg ; text.onTextAttributesChangedListeners )
166 dlg(text);
169 return consumed;
172 void delegate(gint, Text)[] onTextCaretMovedListeners;
173 void addOnTextCaretMoved(void delegate(gint, Text) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
175 if ( !("text-caret-moved" in connectedSignals) )
177 Signals.connectData(
178 getStruct(),
179 "text-caret-moved",
180 cast(GCallback)&callBackTextCaretMoved,
181 cast(void*)this,
182 null,
183 connectFlags);
184 connectedSignals["text-caret-moved"] = 1;
186 onTextCaretMovedListeners ~= dlg;
188 extern(C) static void callBackTextCaretMoved(AtkText* atktextStruct, gint arg1, Text text)
190 bool consumed = false;
192 foreach ( void delegate(gint, Text) dlg ; text.onTextCaretMovedListeners )
194 dlg(arg1, text);
197 return consumed;
200 void delegate(gint, gint, Text)[] onTextChangedListeners;
201 void addOnTextChanged(void delegate(gint, gint, Text) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
203 if ( !("text-changed" in connectedSignals) )
205 Signals.connectData(
206 getStruct(),
207 "text-changed",
208 cast(GCallback)&callBackTextChanged,
209 cast(void*)this,
210 null,
211 connectFlags);
212 connectedSignals["text-changed"] = 1;
214 onTextChangedListeners ~= dlg;
216 extern(C) static void callBackTextChanged(AtkText* atktextStruct, gint arg1, gint arg2, Text text)
218 bool consumed = false;
220 foreach ( void delegate(gint, gint, Text) dlg ; text.onTextChangedListeners )
222 dlg(arg1, arg2, text);
225 return consumed;
228 void delegate(Text)[] onTextSelectionChangedListeners;
229 void addOnTextSelectionChanged(void delegate(Text) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
231 if ( !("text-selection-changed" in connectedSignals) )
233 Signals.connectData(
234 getStruct(),
235 "text-selection-changed",
236 cast(GCallback)&callBackTextSelectionChanged,
237 cast(void*)this,
238 null,
239 connectFlags);
240 connectedSignals["text-selection-changed"] = 1;
242 onTextSelectionChangedListeners ~= dlg;
244 extern(C) static void callBackTextSelectionChanged(AtkText* atktextStruct, Text text)
246 bool consumed = false;
248 foreach ( void delegate(Text) dlg ; text.onTextSelectionChangedListeners )
250 dlg(text);
253 return consumed;
266 * Gets the specified text.
267 * text:
268 * an AtkText
269 * start_offset:
270 * start position
271 * end_offset:
272 * end position
273 * Returns:
274 * the text from start_offset up to, but not including end_offset.
276 public char[] getText(int startOffset, int endOffset)
278 // gchar* atk_text_get_text (AtkText *text, gint start_offset, gint end_offset);
279 return Str.toString(atk_text_get_text(atkText, startOffset, endOffset) );
283 * Gets the specified text.
284 * text:
285 * an AtkText
286 * offset:
287 * position
288 * Returns:
289 * the character at offset.
291 public gunichar getCharacterAtOffset(int offset)
293 // gunichar atk_text_get_character_at_offset (AtkText *text, gint offset);
294 return atk_text_get_character_at_offset(atkText, offset);
298 * Gets the specified text.
299 * If the boundary_type if ATK_TEXT_BOUNDARY_CHAR the character after the
300 * offset is returned.
301 * If the boundary_type is ATK_TEXT_BOUNDARY_WORD_START the returned string
302 * is from the word start after the offset to the next word start.
303 * The returned string will contain the word after the offset if the offset
304 * is inside a word or if the offset is not inside a word.
305 * If the boundary_type is ATK_TEXT_BOUNDARY_WORD_END the returned string
306 * is from the word end at or after the offset to the next work end.
307 * The returned string will contain the word after the offset if the offset
308 * is inside a word and will contain the word after the word after the offset
309 * if the offset is not inside a word.
310 * If the boundary type is ATK_TEXT_BOUNDARY_SENTENCE_START the returned
311 * string is from the sentence start after the offset to the next sentence
312 * start.
313 * The returned string will contain the sentence after the offset if the offset
314 * is inside a sentence or if the offset is not inside a sentence.
315 * If the boundary_type is ATK_TEXT_BOUNDARY_SENTENCE_END the returned string
316 * is from the sentence end at or after the offset to the next sentence end.
317 * The returned string will contain the sentence after the offset if the offset
318 * is inside a sentence and will contain the sentence after the sentence
319 * after the offset if the offset is not inside a sentence.
320 * If the boundary type is ATK_TEXT_BOUNDARY_LINE_START the returned
321 * string is from the line start after the offset to the next line start.
322 * If the boundary_type is ATK_TEXT_BOUNDARY_LINE_END the returned string
323 * is from the line end at or after the offset to the next line start.
324 * text:
325 * an AtkText
326 * offset:
327 * position
328 * boundary_type:
329 * An AtkTextBoundary
330 * start_offset:
331 * the start offset of the returned string
332 * end_offset:
333 * the offset of the first character after the
334 * returned substring
335 * Returns:
336 * the text after offset bounded by the specified boundary_type.
338 public char[] getTextAfterOffset(int offset, AtkTextBoundary boundaryType, int* startOffset, int* endOffset)
340 // gchar* atk_text_get_text_after_offset (AtkText *text, gint offset, AtkTextBoundary boundary_type, gint *start_offset, gint *end_offset);
341 return Str.toString(atk_text_get_text_after_offset(atkText, offset, boundaryType, startOffset, endOffset) );
345 * Gets the specified text.
346 * If the boundary_type if ATK_TEXT_BOUNDARY_CHAR the character at the
347 * offset is returned.
348 * If the boundary_type is ATK_TEXT_BOUNDARY_WORD_START the returned string
349 * is from the word start at or before the offset to the word start after
350 * the offset.
351 * The returned string will contain the word at the offset if the offset
352 * is inside a word and will contain the word before the offset if the
353 * offset is not inside a word.
354 * If the boundary_type is ATK_TEXT_BOUNDARY_WORD_END the returned string
355 * is from the word end before the offset to the word end at or after the
356 * offset.
357 * The returned string will contain the word at the offset if the offset
358 * is inside a word and will contain the word after to the offset if the
359 * offset is not inside a word.
360 * If the boundary type is ATK_TEXT_BOUNDARY_SENTENCE_START the returned
361 * string is from the sentence start at or before the offset to the sentence
362 * start after the offset.
363 * The returned string will contain the sentence at the offset if the offset
364 * is inside a sentence and will contain the sentence before the offset
365 * if the offset is not inside a sentence.
366 * If the boundary_type is ATK_TEXT_BOUNDARY_SENTENCE_END the returned string
367 * is from the sentence end before the offset to the sentence end at or
368 * after the offset.
369 * The returned string will contain the sentence at the offset if the offset
370 * is inside a sentence and will contain the sentence after the offset
371 * if the offset is not inside a sentence.
372 * If the boundary type is ATK_TEXT_BOUNDARY_LINE_START the returned
373 * string is from the line start at or before the offset to the line
374 * start after the offset.
375 * If the boundary_type is ATK_TEXT_BOUNDARY_LINE_END the returned string
376 * is from the line end before the offset to the line end at or after
377 * the offset.
378 * text:
379 * an AtkText
380 * offset:
381 * position
382 * boundary_type:
383 * An AtkTextBoundary
384 * start_offset:
385 * the start offset of the returned string
386 * end_offset:
387 * the offset of the first character after the
388 * returned substring
389 * Returns:
390 * the text at offset bounded by the specified boundary_type.
392 public char[] getTextAtOffset(int offset, AtkTextBoundary boundaryType, int* startOffset, int* endOffset)
394 // gchar* atk_text_get_text_at_offset (AtkText *text, gint offset, AtkTextBoundary boundary_type, gint *start_offset, gint *end_offset);
395 return Str.toString(atk_text_get_text_at_offset(atkText, offset, boundaryType, startOffset, endOffset) );
399 * Gets the specified text.
400 * If the boundary_type if ATK_TEXT_BOUNDARY_CHAR the character before the
401 * offset is returned.
402 * If the boundary_type is ATK_TEXT_BOUNDARY_WORD_START the returned string
403 * is from the word start before the word start before the offset to
404 * the word start before the offset.
405 * The returned string will contain the word before the offset if the offset
406 * is inside a word and will contain the word before the word before the
407 * offset if the offset is not inside a word.
408 * If the boundary_type is ATK_TEXT_BOUNDARY_WORD_END the returned string
409 * is from the word end before the word end at or before the offset to the
410 * word end at or before the offset.
411 * The returned string will contain the word before the offset if the offset
412 * is inside a word or if the offset is not inside a word.
413 * If the boundary type is ATK_TEXT_BOUNDARY_SENTENCE_START the returned
414 * string is from the sentence start before the sentence start before
415 * the offset to the sentence start before the offset.
416 * The returned string will contain the sentence before the offset if the
417 * offset is inside a sentence and will contain the sentence before the
418 * sentence before the offset if the offset is not inside a sentence.
419 * If the boundary_type is ATK_TEXT_BOUNDARY_SENTENCE_END the returned string
420 * is from the sentence end before the sentence end at or before the offset to
421 * the sentence end at or before the offset.
422 * The returned string will contain the sentence before the offset if the
423 * offset is inside a sentence or if the offset is not inside a sentence.
424 * If the boundary type is ATK_TEXT_BOUNDARY_LINE_START the returned
425 * string is from the line start before the line start ar or before the offset
426 * to the line start ar or before the offset.
427 * If the boundary_type is ATK_TEXT_BOUNDARY_LINE_END the returned string
428 * is from the line end before the line end before the offset to the
429 * line end before the offset.
430 * text:
431 * an AtkText
432 * offset:
433 * position
434 * boundary_type:
435 * An AtkTextBoundary
436 * start_offset:
437 * the start offset of the returned string
438 * end_offset:
439 * the offset of the first character after the
440 * returned substring
441 * Returns:
442 * the text before offset bounded by the specified boundary_type.
444 public char[] getTextBeforeOffset(int offset, AtkTextBoundary boundaryType, int* startOffset, int* endOffset)
446 // gchar* atk_text_get_text_before_offset (AtkText *text, gint offset, AtkTextBoundary boundary_type, gint *start_offset, gint *end_offset);
447 return Str.toString(atk_text_get_text_before_offset(atkText, offset, boundaryType, startOffset, endOffset) );
451 * Gets the offset position of the caret (cursor).
452 * text:
453 * an AtkText
454 * Returns:
455 * the offset position of the caret (cursor).
457 public int getCaretOffset()
459 // gint atk_text_get_caret_offset (AtkText *text);
460 return atk_text_get_caret_offset(atkText);
464 * Get the bounding box containing the glyph representing the character at
465 * a particular text offset.
466 * text:
467 * an AtkText
468 * offset:
469 * The offset of the text character for which bounding information is required.
470 * x:
471 * Pointer for the x cordinate of the bounding box
472 * y:
473 * Pointer for the y cordinate of the bounding box
474 * width:
475 * Pointer for the width of the bounding box
476 * height:
477 * Pointer for the height of the bounding box
478 * coords:
479 * specify whether coordinates are relative to the screen or widget window
481 public void getCharacterExtents(int offset, int* x, int* y, int* width, int* height, AtkCoordType coords)
483 // void atk_text_get_character_extents (AtkText *text, gint offset, gint *x, gint *y, gint *width, gint *height, AtkCoordType coords);
484 atk_text_get_character_extents(atkText, offset, x, y, width, height, coords);
488 * Creates an AtkAttributeSet which consists of the attributes explicitly
489 * set at the position offset in the text. start_offset and end_offset are
490 * set to the start and end of the range around offset where the attributes are
491 * invariant. Note that end_offset is the offset of the first character
492 * after the range. See the enum AtkTextAttribute for types of text
493 * attributes that can be returned. Note that other attributes may also be
494 * returned.
495 * text:
496 * an AtkText
497 * offset:
498 * the offset at which to get the attributes
499 * start_offset:
500 * the address to put the start offset of the range
501 * end_offset:
502 * the address to put the end offset of the range
503 * Returns:
504 * an AtkAttributeSet which contains the attributes explicitly set
505 * at offset. This AtkAttributeSet should be freed by a call to
506 * atk_attribute_set_free().
508 public AtkAttributeSet* getRunAttributes(int offset, int* startOffset, int* endOffset)
510 // AtkAttributeSet* atk_text_get_run_attributes (AtkText *text, gint offset, gint *start_offset, gint *end_offset);
511 return atk_text_get_run_attributes(atkText, offset, startOffset, endOffset);
515 * Creates an AtkAttributeSet which consists of the default values of
516 * attributes for the text. See the enum AtkTextAttribute for types of text
517 * attributes that can be returned. Note that other attributes may also be
518 * returned.
519 * text:
520 * an AtkText
521 * Returns:
522 * an AtkAttributeSet which contains the default values of attributes.
523 * at offset. This AtkAttributeSet should be freed by a call to
524 * atk_attribute_set_free().
526 public AtkAttributeSet* getDefaultAttributes()
528 // AtkAttributeSet* atk_text_get_default_attributes (AtkText *text);
529 return atk_text_get_default_attributes(atkText);
533 * Gets the character count.
534 * text:
535 * an AtkText
536 * Returns:
537 * the number of characters.
539 public int getCharacterCount()
541 // gint atk_text_get_character_count (AtkText *text);
542 return atk_text_get_character_count(atkText);
546 * Gets the offset of the character located at coordinates x and y. x and y
547 * are interpreted as being relative to the screen or this widget's window
548 * depending on coords.
549 * text:
550 * an AtkText
551 * x:
552 * screen x-position of character
553 * y:
554 * screen y-position of character
555 * coords:
556 * specify whether coordinates are relative to the screen or
557 * widget window
558 * Returns:
559 * the offset to the character which is located at
560 * the specified x and y coordinates.
562 public int getOffsetAtPoint(int x, int y, AtkCoordType coords)
564 // gint atk_text_get_offset_at_point (AtkText *text, gint x, gint y, AtkCoordType coords);
565 return atk_text_get_offset_at_point(atkText, x, y, coords);
569 * Get the ranges of text in the specified bounding box.
570 * Returns:
571 * text:
572 * an AtkText
573 * rect:
574 * An AtkTextRectagle giving the dimensions of the bounding box.
575 * coord_type:
576 * Specify whether coordinates are relative to the screen or widget window.
577 * x_clip_type:
578 * Specify the horizontal clip type.
579 * y_clip_type:
580 * Specify the vertical clip type.
581 * Returns:
582 * Array of AtkTextRange. The last element of the array returned
583 * by this function will be NULL.
584 * Since ATK 1.3
586 public AtkTextRange** getBoundedRanges(AtkTextRectangle* rect, AtkCoordType coordType, AtkTextClipType xClipType, AtkTextClipType yClipType)
588 // AtkTextRange** atk_text_get_bounded_ranges (AtkText *text, AtkTextRectangle *rect, AtkCoordType coord_type, AtkTextClipType x_clip_type, AtkTextClipType y_clip_type);
589 return atk_text_get_bounded_ranges(atkText, rect, coordType, xClipType, yClipType);
593 * Get the bounding box for text within the specified range.
594 * text:
595 * an AtkText
596 * start_offset:
597 * The offset of the first text character for which boundary
598 * information is required.
599 * end_offset:
600 * The offset of the text character after the last character
601 * for which boundary information is required.
602 * coord_type:
603 * Specify whether coordinates are relative to the screen or widget window.
604 * rect:
605 * A pointer to a AtkTextRectangle which is filled in by this function.
606 * Since ATK 1.3
608 public void getRangeExtents(int startOffset, int endOffset, AtkCoordType coordType, AtkTextRectangle* rect)
610 // void atk_text_get_range_extents (AtkText *text, gint start_offset, gint end_offset, AtkCoordType coord_type, AtkTextRectangle *rect);
611 atk_text_get_range_extents(atkText, startOffset, endOffset, coordType, rect);
615 * Frees the memory associated with an array of AtkTextRange. It is assumed
616 * that the array was returned by the function atk_text_get_bounded_ranges
617 * and is NULL terminated.
618 * ranges:
619 * A pointer to an array of AtkTextRange which is to be freed.
620 * Since ATK 1.3
622 public static void freeRanges(AtkTextRange** ranges)
624 // void atk_text_free_ranges (AtkTextRange **ranges);
625 atk_text_free_ranges(ranges);
629 * Gets the number of selected regions.
630 * text:
631 * an AtkText
632 * Returns:
633 * The number of selected regions, or -1 if a failure
634 * occurred.
636 public int getNSelections()
638 // gint atk_text_get_n_selections (AtkText *text);
639 return atk_text_get_n_selections(atkText);
643 * Gets the text from the specified selection.
644 * text:
645 * an AtkText
646 * selection_num:
647 * The selection number. The selected regions are
648 * assigned numbers that correspond to how far the region is from the
649 * start of the text. The selected region closest to the beginning
650 * of the text region is assigned the number 0, etc. Note that adding,
651 * moving or deleting a selected region can change the numbering.
652 * start_offset:
653 * passes back the start position of the selected region
654 * end_offset:
655 * passes back the end position of (e.g. offset immediately past)
656 * the selected region
657 * Returns:
658 * the selected text.
660 public char[] getSelection(int selectionNum, int* startOffset, int* endOffset)
662 // gchar* atk_text_get_selection (AtkText *text, gint selection_num, gint *start_offset, gint *end_offset);
663 return Str.toString(atk_text_get_selection(atkText, selectionNum, startOffset, endOffset) );
667 * Adds a selection bounded by the specified offsets.
668 * text:
669 * an AtkText
670 * start_offset:
671 * the start position of the selected region
672 * end_offset:
673 * the offset of the first character after the selected region.
674 * Returns:
675 * TRUE if success, FALSE otherwise
677 public int addSelection(int startOffset, int endOffset)
679 // gboolean atk_text_add_selection (AtkText *text, gint start_offset, gint end_offset);
680 return atk_text_add_selection(atkText, startOffset, endOffset);
684 * Removes the specified selection.
685 * text:
686 * an AtkText
687 * selection_num:
688 * The selection number. The selected regions are
689 * assigned numbers that correspond to how far the region is from the
690 * start of the text. The selected region closest to the beginning
691 * of the text region is assigned the number 0, etc. Note that adding,
692 * moving or deleting a selected region can change the numbering.
693 * Returns:
694 * TRUE if success, FALSE otherwise
696 public int removeSelection(int selectionNum)
698 // gboolean atk_text_remove_selection (AtkText *text, gint selection_num);
699 return atk_text_remove_selection(atkText, selectionNum);
703 * Changes the start and end offset of the specified selection.
704 * text:
705 * an AtkText
706 * selection_num:
707 * The selection number. The selected regions are
708 * assigned numbers that correspond to how far the region is from the
709 * start of the text. The selected region closest to the beginning
710 * of the text region is assigned the number 0, etc. Note that adding,
711 * moving or deleting a selected region can change the numbering.
712 * start_offset:
713 * the new start position of the selection
714 * end_offset:
715 * the new end position of (e.g. offset immediately past)
716 * the selection
717 * Returns:
718 * TRUE if success, FALSE otherwise
720 public int setSelection(int selectionNum, int startOffset, int endOffset)
722 // gboolean atk_text_set_selection (AtkText *text, gint selection_num, gint start_offset, gint end_offset);
723 return atk_text_set_selection(atkText, selectionNum, startOffset, endOffset);
727 * Sets the caret (cursor) position to the specified offset.
728 * text:
729 * an AtkText
730 * offset:
731 * position
732 * Returns:
733 * TRUE if success, FALSE otherwise.
735 public int setCaretOffset(int offset)
737 // gboolean atk_text_set_caret_offset (AtkText *text, gint offset);
738 return atk_text_set_caret_offset(atkText, offset);
742 * Frees the memory used by an AtkAttributeSet, including all its
743 * AtkAttributes.
744 * attrib_set:
745 * The AtkAttributeSet to free
747 public static void atkAttributeSetFree(AtkAttributeSet* attribSet)
749 // void atk_attribute_set_free (AtkAttributeSet *attrib_set);
750 atk_attribute_set_free(attribSet);
754 * Associate name with a new AtkTextAttribute
755 * name:
756 * a name string
757 * Returns:
758 * an AtkTextAttribute associated with name
760 public static AtkTextAttribute attributeRegister(char[] name)
762 // AtkTextAttribute atk_text_attribute_register (const gchar *name);
763 return atk_text_attribute_register(Str.toStringz(name));
767 * Gets the name corresponding to the AtkTextAttribute
768 * attr:
769 * The AtkTextAttribute whose name is required
770 * Returns:
771 * a string containing the name; this string should not be freed
773 public static char[] attributeGetName(AtkTextAttribute attr)
775 // const gchar* atk_text_attribute_get_name (AtkTextAttribute attr);
776 return Str.toString(atk_text_attribute_get_name(attr) );
780 * Get the AtkTextAttribute type corresponding to a text attribute name.
781 * name:
782 * a string which is the (non-localized) name of an ATK text attribute.
783 * Returns:
784 * the AtkTextAttribute enumerated type corresponding to the specified
785 * name,
786 * or ATK_TEXT_ATTRIBUTE_INVALID if no matching text attribute is found.
788 public static AtkTextAttribute attributeForName(char[] name)
790 // AtkTextAttribute atk_text_attribute_for_name (const gchar *name);
791 return atk_text_attribute_for_name(Str.toStringz(name));
795 * Gets the value for the index of the AtkTextAttribute
796 * attr:
797 * The AtkTextAttribute for which a value is required
798 * index_:
799 * The index of the required value
800 * Returns:
801 * a string containing the value; this string should not be freed;
802 * NULL is returned if there are no values maintained for the attr value.
803 * Signal Details
804 * The "text-attributes-changed" signal
805 * void user_function (AtkText *atktext,
806 * gpointer user_data) : Run Last
807 * The "text-attributes-changed" signal is emitted when the text attributes of
808 * the text of an object which implements AtkText changes.
809 * atktext:
810 * the object which received the signal.
811 * user_data:
812 * user data set when the signal handler was connected.
814 public static char[] attributeGetValue(AtkTextAttribute attr, int index)
816 // const gchar* atk_text_attribute_get_value (AtkTextAttribute attr, gint index_);
817 return Str.toString(atk_text_attribute_get_value(attr, index) );