summaryrefslogtreecommitdiff
path: root/docs/reference/pygtk-atktext.xml
blob: fe69057ea685936c857856c1c2780c41605ff972 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
<?xml version="1.0" standalone="no"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
    "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">

<refentry id="class-atktext">

  <refnamediv>
    <refname>atk.Text</refname>
      <refpurpose>the ATK interface implemented by components with text
      content.</refpurpose>
  </refnamediv>

  <refsect1>
    <title>Synopsis</title>

    <classsynopsis language="python">
      <ooclass><classname>atk.Text</classname></ooclass>
      <ooclass><classname>gobject.GInterface</classname></ooclass>
      <methodsynopsis language="python">
        <methodname><link linkend="method-atktext--get-text">get_text</link></methodname>
        <methodparam><parameter role="keyword">start_offset</parameter></methodparam>
        <methodparam><parameter role="keyword">end_offset</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-atktext--get-character-at-offset">get_character_at_offset</link></methodname>
        <methodparam><parameter role="keyword">offset</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-atktext--get-text-after-offset">get_text_after_offset</link></methodname>
        <methodparam><parameter role="keyword">offset</parameter></methodparam>
        <methodparam><parameter role="keyword">boundary_type</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-atktext--get-text-at-offset">get_text_at_offset</link></methodname>
        <methodparam><parameter role="keyword">offset</parameter></methodparam>
        <methodparam><parameter role="keyword">boundary_type</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-atktext--get-text-before-offset">get_text_before_offset</link></methodname>
        <methodparam><parameter role="keyword">offset</parameter></methodparam>
        <methodparam><parameter role="keyword">boundary_type</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-atktext--get-caret-offset">get_caret_offset</link></methodname>
        <methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-atktext--get-character-extents">get_character_extents</link></methodname>
        <methodparam><parameter role="keyword">offset</parameter></methodparam>
        <methodparam><parameter role="keyword">coords</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-atktext--get-run-attributes">get_run_attributes</link></methodname>
        <methodparam><parameter role="keyword">offset</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-atktext--get-default-attributes">get_default_attributes</link></methodname>
        <methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-atktext--get-character-count">get_character_count</link></methodname>
        <methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-atktext--get-offset-at-point">get_offset_at_point</link></methodname>
        <methodparam><parameter role="keyword">x</parameter></methodparam>
        <methodparam><parameter role="keyword">y</parameter></methodparam>
        <methodparam><parameter role="keyword">coords</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-atktext--get-n-selections">get_n_selections</link></methodname>
        <methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-atktext--get-selection">get_selection</link></methodname>
        <methodparam><parameter role="keyword">selection_num</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-atktext--add-selection">add_selection</link></methodname>
        <methodparam><parameter role="keyword">start_offset</parameter></methodparam>
        <methodparam><parameter role="keyword">end_offset</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-atktext--remove-selection">remove_selection</link></methodname>
        <methodparam><parameter role="keyword">selection_num</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-atktext--set-selection">set_selection</link></methodname>
        <methodparam><parameter role="keyword">selection_num</parameter></methodparam>
        <methodparam><parameter role="keyword">start_offset</parameter></methodparam>
        <methodparam><parameter role="keyword">end_offset</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-atktext--set-caret-offset">set_caret_offset</link></methodname>
        <methodparam><parameter role="keyword">offset</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-atktext--get-range-extents">get_range_extents</link></methodname>
        <methodparam><parameter role="keyword">start_offset</parameter></methodparam>
        <methodparam><parameter role="keyword">end_offset</parameter></methodparam>
        <methodparam><parameter role="keyword">coord_type</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-atktext--get-bounded-ranges">get_bounded_ranges</link></methodname>
        <methodparam><parameter role="keyword">rect</parameter></methodparam>
        <methodparam><parameter role="keyword">coord_type</parameter></methodparam>
        <methodparam><parameter role="keyword">x_clip_type</parameter></methodparam>
        <methodparam><parameter role="keyword">y_clip_type</parameter></methodparam>
      </methodsynopsis>
</classsynopsis>

<programlisting>
<emphasis role="bold">Functions</emphasis>

<methodsynopsis language="python">
    <methodname><link linkend="function-atk--text-attribute-get-name">atk.text_attribute_get_name</link></methodname>
    <methodparam><parameter role="keyword">attr</parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
    <methodname><link linkend="function-atk--text-attribute-get-value">atk.text_attribute_get_value</link></methodname>
    <methodparam><parameter role="keyword">attr</parameter></methodparam>
    <methodparam><parameter role="keyword">index</parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
    <methodname><link linkend="function-atk--text-attribute-register">atk.text_attribute_register</link></methodname>
    <methodparam><parameter role="keyword">name</parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
    <methodname><link linkend="function-atk--text-attribute-for-name">atk.text_attribute_for_name</link></methodname>
    <methodparam><parameter role="keyword">name</parameter></methodparam>
  </methodsynopsis></programlisting>

  </refsect1>

  <refsect1 id="signal-prototypes-atktext">
    <title>atk.Text Signal Prototypes</title>


      <variablelist>
      <varlistentry>
        <term>"<link linkend="signal-atktext--text-attributes-changed">text-attributes-changed</link>"</term>
        <listitem>
          <methodsynopsis language="python"><methodname>callback</methodname>
            <methodparam><parameter>atktext</parameter></methodparam>
            <methodparam><parameter>user_param1</parameter></methodparam>
            <methodparam><parameter>...</parameter></methodparam>
          </methodsynopsis>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>"<link linkend="signal-atktext--text-caret-moved">text-caret-moved</link>"</term>
        <listitem>
          <methodsynopsis language="python"><methodname>callback</methodname>
            <methodparam><parameter>atktext</parameter></methodparam>
            <methodparam><parameter>position</parameter></methodparam>
            <methodparam><parameter>user_param1</parameter></methodparam>
            <methodparam><parameter>...</parameter></methodparam>
          </methodsynopsis>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>"<link linkend="signal-atktext--text-changed">text-changed</link>"</term>
        <listitem>
          <methodsynopsis language="python"><methodname>callback</methodname>
            <methodparam><parameter>atktext</parameter></methodparam>
            <methodparam><parameter>position</parameter></methodparam>
            <methodparam><parameter>length</parameter></methodparam>
            <methodparam><parameter>user_param1</parameter></methodparam>
            <methodparam><parameter>...</parameter></methodparam>
          </methodsynopsis>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>"<link linkend="signal-atktext--text-selection-changed">text-selection-changed</link>"</term>
        <listitem>
          <methodsynopsis language="python"><methodname>callback</methodname>
            <methodparam><parameter>atktext</parameter></methodparam>
            <methodparam><parameter>user_param1</parameter></methodparam>
            <methodparam><parameter>...</parameter></methodparam>
          </methodsynopsis>
        </listitem>
      </varlistentry>
    </variablelist>

  </refsect1>

  <refsect1>
    <title>Description</title>

    <para><link
    linkend="class-atktext"><classname>atk.Text</classname></link> should be
    implemented by <link
    linkend="class-atkobject"><classname>atk.Object</classname></link>
    objects on behalf of widgets that have text content which is either
    attributed or otherwise non-trivial.  <link
    linkend="class-atkobject"><classname>atk.Object</classname></link>
    objects whose text content is simple, unattributed, and very brief may
    expose that content via <link
    linkend="method-atkobject--get-name"><methodname>atk.Object.get_name</methodname></link>
    instead; however if the text is editable, multi-line, typically longer
    than three or four words, attributed, selectable, or if the object
    already uses the 'name' ATK property for other information, the <link
    linkend="class-atktext"><classname>atk.Text</classname></link> interface
    should be used to expose the text content.  In the case of editable text
    content, <link
    linkend="class-atkeditabletext"><classname>atk.EditableText</classname></link>
    (a subtype of the <link
    linkend="class-atktext"><classname>atk.Text</classname></link>
    interface) should be implemented instead.</para>

    <para><link
    linkend="class-atktext"><classname>atk.Text</classname></link> provides
    not only traversal facilities and change notification for text content,
    but also caret tracking and glyph bounding box calculations.  Note that
    the text strings are exposed as UTF-8, and are therefore potentially
    multi-byte, and caret-to-byte offset mapping makes no assumptions about
    the character length; also bounding box glyph-to-offset mapping may be
    complex for languages which use ligatures.</para>

  </refsect1>

  <refsect1>
    <title>Methods</title>

    <refsect2 id="method-atktext--get-text">
      <title>atk.Text.get_text</title>

      <programlisting><methodsynopsis language="python">
        <methodname>get_text</methodname>
        <methodparam><parameter role="keyword">start_offset</parameter></methodparam>
        <methodparam><parameter role="keyword">end_offset</parameter></methodparam>
      </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><parameter role="keyword">start_offset</parameter>&nbsp;:</term>
          <listitem><simpara>start position</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter role="keyword">end_offset</parameter>&nbsp;:</term>
          <listitem><simpara>end position</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><emphasis>Returns</emphasis>&nbsp;:</term>
          <listitem><simpara>the text from
          <parameter>start_offset</parameter> up to, but not including
          <parameter>end_offset</parameter>.</simpara></listitem>
        </varlistentry>
      </variablelist>

      <para>Gets the specified text.</para>

    </refsect2>

    <refsect2 id="method-atktext--get-character-at-offset">
      <title>atk.Text.get_character_at_offset</title>

      <programlisting><methodsynopsis language="python">
        <methodname>get_character_at_offset</methodname>
        <methodparam><parameter role="keyword">offset</parameter></methodparam>
      </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><parameter role="keyword">offset</parameter>&nbsp;:</term>
          <listitem><simpara>position</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><emphasis>Returns</emphasis>&nbsp;:</term>
          <listitem><simpara>the character at
          <parameter>offset</parameter>.</simpara></listitem>
        </varlistentry>
      </variablelist>

      <para>Gets the specified text.</para>

    </refsect2>

    <refsect2 id="method-atktext--get-text-after-offset">
      <title>atk.Text.get_text_after_offset</title>

      <programlisting><methodsynopsis language="python">
        <methodname>get_text_after_offset</methodname>
        <methodparam><parameter role="keyword">offset</parameter></methodparam>
        <methodparam><parameter role="keyword">boundary_type</parameter></methodparam>
      </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><parameter role="keyword">offset</parameter>&nbsp;:</term>
          <listitem><simpara>position</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter role="keyword">boundary_type</parameter>&nbsp;:</term>
          <listitem><simpara>one of the <xref
          linkend="atk-text-boundary-constants"
          endterm="atk-text-boundary-constants-title"></xref></simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><emphasis>Returns</emphasis>&nbsp;:</term>
          <listitem><simpara>a 3-tuple containing the text after
          <parameter>offset</parameter> bounded by the specified
          <parameter>boundary_type</parameter>, the start offset of the
          returned string and the offset of the first character after the
          returned substring.</simpara></listitem>
        </varlistentry>
      </variablelist>

      <para>Gets the specified text.</para>
      
      <para>If the <parameter>boundary_type</parameter> is
      <literal>atk.TEXT_BOUNDARY_CHAR</literal> the character after the
      offset is returned.</para>
      
      <para>If the <parameter>boundary_type</parameter> is
      <literal>atk.TEXT_BOUNDARY_WORD_START</literal> the returned string is
      from the word start after the offset to the next word start.</para>
      
      <para>The returned string will contain the word after the offset if
      the offset is inside a word or if the offset is not inside a
      word.</para>
      
      <para>If the <parameter>boundary_type</parameter> is
      <literal>atk.TEXT_BOUNDARY_WORD_END</literal> the returned string is
      from the word end at or after the offset to the next work end.</para>
      
      <para>The returned string will contain the word after the offset if
      the offset is inside a word and will contain the word after the word
      after the offset if the offset is not inside a word.</para>
      
      <para>If the <parameter>boundary_type</parameter> is
      <literal>atk.TEXT_BOUNDARY_SENTENCE_START</literal> the returned
      string is from the sentence start after the offset to the next
      sentence start.</para>
      
      <para>The returned string will contain the sentence after the offset
      if the offset is inside a sentence or if the offset is not inside a
      sentence.</para>
      
      <para>If the <parameter>boundary_type</parameter> is atk.TEXT_BOUNDARY_SENTENCE_END the
      returned string is from the sentence end at or after the offset to the
      next sentence end.</para>
      
      <para>The returned string will contain the sentence after the offset
      if the offset is inside a sentence and will contain the sentence after
      the sentence after the offset if the offset is not inside a
      sentence.</para>
      
      <para>If the <parameter>boundary_type</parameter> is
      <literal>atk.TEXT_BOUNDARY_LINE_START</literal> the returned string is
      from the line start after the offset to the next line start.</para>
      
      <para>If the <parameter>boundary_type</parameter> is
      <literal>atk.TEXT_BOUNDARY_LINE_END</literal> the returned string is
      from the line end at or after the offset to the next line
      start.</para>

    </refsect2>

    <refsect2 id="method-atktext--get-text-at-offset">
      <title>atk.Text.get_text_at_offset</title>

      <programlisting><methodsynopsis language="python">
        <methodname>get_text_at_offset</methodname>
        <methodparam><parameter role="keyword">offset</parameter></methodparam>
        <methodparam><parameter role="keyword">boundary_type</parameter></methodparam>
      </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><parameter role="keyword">offset</parameter>&nbsp;:</term>
          <listitem><simpara>position</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter role="keyword">boundary_type</parameter>&nbsp;:</term>
          <listitem><simpara>one of the <xref
          linkend="atk-text-boundary-constants"
          endterm="atk-text-boundary-constants-title"></xref></simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><emphasis>Returns</emphasis>&nbsp;:</term>
          <listitem><simpara>a 3-tuple containing the text at
          <parameter>offset</parameter> bounded by the specified
          <parameter>boundary_type</parameter>, the start offset of the
          returned string and the offset of the first character after the
          returned substring.</simpara></listitem>
        </varlistentry>
      </variablelist>

      <para>Gets the specified text.</para>
      
      <para>If the <parameter>boundary_type</parameter> if
      <literal>atk.TEXT_BOUNDARY_CHAR</literal> the character at the offset
      is returned.</para>
      
      <para>If the <parameter>boundary_type</parameter> is
      <literal>atk.TEXT_BOUNDARY_WORD_START</literal> the returned string is
      from the word start at or before the offset to the word start after
      the offset.</para>
      
      <para>The returned string will contain the word at the offset if the
      offset is inside a word and will contain the word before the offset if
      the offset is not inside a word.</para>
      
      <para>If the <parameter>boundary_type</parameter> is
      <literal>atk.TEXT_BOUNDARY_WORD_END</literal> the returned string is
      from the word end before the offset to the word end at or after the
      offset.</para>

      <para>The returned string will contain the word at the offset if the
      offset is inside a word and will contain the word after to the offset
      if the offset is not inside a word.</para>
      
      <para>If the <parameter>boundary_type</parameter> is
      <literal>atk.TEXT_BOUNDARY_SENTENCE_START</literal> the returned
      string is from the sentence start at or before the offset to the
      sentence start after the offset.</para>
      
      <para>The returned string will contain the sentence at the offset if
      the offset is inside a sentence and will contain the sentence before
      the offset if the offset is not inside a sentence.</para>
      
      <para>If the <parameter>boundary_type</parameter> is
      <literal>atk.TEXT_BOUNDARY_SENTENCE_END</literal> the returned string
      is from the sentence end before the offset to the sentence end at or
      after the offset.</para>
      
      <para>The returned string will contain the sentence at the offset if
      the offset is inside a sentence and will contain the sentence after
      the offset if the offset is not inside a sentence.</para>
      
      <para>If the <parameter>boundary_type</parameter> is
      <literal>atk.TEXT_BOUNDARY_LINE_START</literal> the returned string is
      from the line start at or before the offset to the line start after
      the offset.</para>
      
      <para>If the <parameter>boundary_type</parameter> is
      <literal>atk.TEXT_BOUNDARY_LINE_END</literal> the returned string is
      from the line end before the offset to the line end at or after the
      offset.</para>

    </refsect2>

    <refsect2 id="method-atktext--get-text-before-offset">
      <title>atk.Text.get_text_before_offset</title>

      <programlisting><methodsynopsis language="python">
        <methodname>get_text_before_offset</methodname>
        <methodparam><parameter role="keyword">offset</parameter></methodparam>
        <methodparam><parameter role="keyword">boundary_type</parameter></methodparam>
      </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><parameter role="keyword">offset</parameter>&nbsp;:</term>
          <listitem><simpara>position</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter role="keyword">boundary_type</parameter>&nbsp;:</term>
          <listitem><simpara>one of the <xref
          linkend="atk-text-boundary-constants"
          endterm="atk-text-boundary-constants-title"></xref></simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><emphasis>Returns</emphasis>&nbsp;:</term>
          <listitem><simpara>a 3-tuple containing the text before
          <parameter>offset</parameter> bounded by the specified
          <parameter>boundary_type</parameter>, the start offset of the
          returned string and the offset of the first character after the
          returned substring.</simpara></listitem>
        </varlistentry>
      </variablelist>

      <para>Gets the specified text.</para>
      
      <para>If the <parameter>boundary_type</parameter> if
      <literal>atk.TEXT_BOUNDARY_CHAR</literal> the character before the
      offset is returned.</para>
      
      <para>If the <parameter>boundary_type</parameter> is
      <literal>atk.TEXT_BOUNDARY_WORD_START</literal> the returned string is
      from the word start before the word start before the offset to the
      word start before the offset.</para>
      
      <para>The returned string will contain the word before the offset if
      the offset is inside a word and will contain the word before the word
      before the offset if the offset is not inside a word.</para>
      
      <para>If the <parameter>boundary_type</parameter> is
      <literal>atk.TEXT_BOUNDARY_WORD_END</literal> the returned string is
      from the word end before the word end at or before the offset to the
      word end at or before the offset.</para>
      
      <para>The returned string will contain the word before the offset if
      the offset is inside a word or if the offset is not inside a
      word.</para>
      
      <para>If the <parameter>boundary_type</parameter> is
      <literal>atk.TEXT_BOUNDARY_SENTENCE_START</literal> the returned
      string is from the sentence start before the sentence start before the
      offset to the sentence start before the offset.</para>
      
      <para>The returned string will contain the sentence before the offset
      if the offset is inside a sentence and will contain the sentence
      before the sentence before the offset if the offset is not inside a
      sentence.</para>
      
      <para>If the <parameter>boundary_type</parameter> is
      <literal>atk.TEXT_BOUNDARY_SENTENCE_END</literal> the returned string
      is from the sentence end before the sentence end at or before the
      offset to the sentence end at or before the offset.</para>
      
      <para>The returned string will contain the sentence before the offset
      if the offset is inside a sentence or if the offset is not inside a
      sentence.</para>
      
      <para>If the <parameter>boundary_type</parameter> is
      <literal>atk.TEXT_BOUNDARY_LINE_START</literal> the returned string is
      from the line start before the line start ar or before the offset to
      the line start ar or before the offset.</para>
      
      <para>If the <parameter>boundary_type</parameter> is
      <literal>atk.TEXT_BOUNDARY_LINE_END</literal> the returned string is
      from the line end before the line end before the offset to the line
      end before the offset.</para>

    </refsect2>

    <refsect2 id="method-atktext--get-caret-offset">
      <title>atk.Text.get_caret_offset</title>

      <programlisting><methodsynopsis language="python">
        <methodname>get_caret_offset</methodname>
        <methodparam></methodparam>
      </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><emphasis>Returns</emphasis>&nbsp;:</term>
          <listitem><simpara>the offset position of the caret
          (cursor).</simpara></listitem>
        </varlistentry>
      </variablelist>

      <para>Gets the offset position of the caret (cursor).</para>

    </refsect2>

    <refsect2 id="method-atktext--get-character-extents">
      <title>atk.Text.get_character_extents</title>

      <programlisting><methodsynopsis language="python">
        <methodname>get_character_extents</methodname>
        <methodparam><parameter role="keyword">offset</parameter></methodparam>
        <methodparam><parameter role="keyword">coords</parameter></methodparam>
      </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><parameter role="keyword">offset</parameter>&nbsp;:</term>
          <listitem><simpara>The offset of the text character for which
          bounding information is required.</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter role="keyword">coords</parameter>&nbsp;:</term>
          <listitem><simpara>specify whether coordinates are relative to the
          screen or widget window - one of the <xref
          linkend="atk-coord-type-constants"
          endterm="atk-coord-type-constants-title"></xref></simpara></listitem>
        </varlistentry>
         <varlistentry>
          <term><emphasis>Returns</emphasis>&nbsp;:</term>
          <listitem><simpara>a 4-tuple containing the x, y position and
          width and height of the bounding box.</simpara></listitem>
        </varlistentry>
     </variablelist>

      <para>Get the bounding box containing the glyph representing the
      character at a particular text offset.</para>

    </refsect2>

    <refsect2 id="method-atktext--get-run-attributes">
      <title>atk.Text.get_run_attributes</title>

      <programlisting><methodsynopsis language="python">
        <methodname>get_run_attributes</methodname>
        <methodparam><parameter role="keyword">offset</parameter></methodparam>
      </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><parameter role="keyword">offset</parameter>&nbsp;:</term>
          <listitem><simpara>the offset at which to get the attributes</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter role="keyword">start_offset</parameter>&nbsp;:</term>
          <listitem><simpara>the address to put </simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter role="keyword">end_offset</parameter>&nbsp;:</term>
          <listitem><simpara>the address to put </simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><emphasis>Returns</emphasis>&nbsp;:</term>
          <listitem><simpara>a 3-tuple containing an attribute set tuple,
          the start offset of the range and the end offset of the range. The
          attribute set tuple contains a 2-tuple of (name, value) strings
          for each attribute explicitly set at
          <parameter>offset</parameter>.</simpara></listitem>
        </varlistentry>
      </variablelist>

      <para>Creates a 3=tuple containing an attribute set (which consists of
      the attributes explicitly set at the position
      <parameter>offset</parameter> in the text), the start and end of the
      range around <parameter>offset</parameter> where the attributes are
      invariant. Note that the end offset is the offset of the first
      character after the range. See the <xref
      linkend="atk-text-attr-constants"
      endterm="atk-text-attr-constants-title"></xref> for types of text
      attributes that can be returned. Note that other attributes may also
      be returned.</para>

    </refsect2>

    <refsect2 id="method-atktext--get-default-attributes">
      <title>atk.Text.get_default_attributes</title>

      <programlisting><methodsynopsis language="python">
        <methodname>get_default_attributes</methodname>
        <methodparam></methodparam>
      </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><emphasis>Returns</emphasis>&nbsp;:</term>
          <listitem><simpara>a tuple containing the attribute set which
          contains the default values of attributes. The attribute set tuple
          contains a 2-tuple of (name, value) strings for each
          attribute.</simpara></listitem>
        </varlistentry>
      </variablelist>

      <para>Creates a tuple containing an attribute set which consists of
      the default values of attributes for the text.  The attribute set
      tuple contains a 2-tuple of (name, value) strings for each attribute
      See the <xref linkend="atk-text-attr-constants"
      endterm="atk-text-attr-constants-title"></xref> for types of text
      attributes that can be returned. Note that other attributes may also
      be returned.</para>

    </refsect2>

    <refsect2 id="method-atktext--get-character-count">
      <title>atk.Text.get_character_count</title>

      <programlisting><methodsynopsis language="python">
        <methodname>get_character_count</methodname>
        <methodparam></methodparam>
      </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><emphasis>Returns</emphasis>&nbsp;:</term>
          <listitem><simpara>the number of characters.</simpara></listitem>
        </varlistentry>
      </variablelist>

      <para>Gets the character count.</para>

    </refsect2>

    <refsect2 id="method-atktext--get-offset-at-point">
      <title>atk.Text.get_offset_at_point</title>

      <programlisting><methodsynopsis language="python">
        <methodname>get_offset_at_point</methodname>
        <methodparam><parameter role="keyword">x</parameter></methodparam>
        <methodparam><parameter role="keyword">y</parameter></methodparam>
        <methodparam><parameter role="keyword">coords</parameter></methodparam>
      </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><parameter role="keyword">x</parameter>&nbsp;:</term>
          <listitem><simpara>screen x-position of
          character</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter role="keyword">y</parameter>&nbsp;:</term>
          <listitem><simpara>screen y-position of
          character</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter role="keyword">coords</parameter>&nbsp;:</term>
          <listitem><simpara>specify whether coordinates are relative to the
          screen or widget window - one of the <xref
          linkend="atk-coord-type-constants"
          endterm="atk-coord-type-constants-title"></xref></simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><emphasis>Returns</emphasis>&nbsp;:</term>
          <listitem><simpara>the offset to the character which is located at
          the specified <parameter>x</parameter> and
          <parameter>y</parameter> coordinates.</simpara></listitem>
        </varlistentry>
      </variablelist>

      <para>Gets the offset of the character located at coordinates
      <parameter>x</parameter> and
      <parameter>y</parameter>. <parameter>x</parameter> and
      <parameter>y</parameter> are interpreted as being relative to the
      screen or this widget's window depending on
      <parameter>coords</parameter>.</para>

    </refsect2>

    <refsect2 id="method-atktext--get-n-selections">
      <title>atk.Text.get_n_selections</title>

      <programlisting><methodsynopsis language="python">
        <methodname>get_n_selections</methodname>
        <methodparam></methodparam>
      </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><emphasis>Returns</emphasis>&nbsp;:</term>
          <listitem><simpara>The number of selected regions, or -1 if a
          failure occurred.</simpara></listitem>
        </varlistentry>
      </variablelist>

      <para>Gets the number of selected regions.</para>

    </refsect2>

    <refsect2 id="method-atktext--get-selection">
      <title>atk.Text.get_selection</title>

      <programlisting><methodsynopsis language="python">
        <methodname>get_selection</methodname>
        <methodparam><parameter role="keyword">selection_num</parameter></methodparam>
      </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><parameter role="keyword">selection_num</parameter>&nbsp;:</term>
          <listitem><simpara>The selection number.  The selected regions are
          assigned numbers that correspond to how far the region is from the
          start of the text.  The selected region closest to the beginning
          of the text region is assigned the number 0, etc.  Note that
          adding, moving or deleting a selected region can change the
          numbering.</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><emphasis>Returns</emphasis>&nbsp;:</term>
          <listitem><simpara>a 3-tuple containing the selected text, the
          start position of the selected region and the end position of
          (e.g. offset immediately past) the selected
          region.</simpara></listitem>
        </varlistentry>
      </variablelist>

      <para>Gets the text from the specified selection.</para>

    </refsect2>

    <refsect2 id="method-atktext--add-selection">
      <title>atk.Text.add_selection</title>

      <programlisting><methodsynopsis language="python">
        <methodname>add_selection</methodname>
        <methodparam><parameter role="keyword">start_offset</parameter></methodparam>
        <methodparam><parameter role="keyword">end_offset</parameter></methodparam>
      </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><parameter role="keyword">start_offset</parameter>&nbsp;:</term>
          <listitem><simpara>the start position of the selected
          region</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter role="keyword">end_offset</parameter>&nbsp;:</term>
          <listitem><simpara>the offset of the first character after the
          selected region.</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><emphasis>Returns</emphasis>&nbsp;:</term>
          <listitem><simpara><literal>True</literal> if success,
          <literal>False</literal> otherwise</simpara></listitem>
        </varlistentry>
      </variablelist>

      <para>Adds a selection bounded by the specified offsets.</para>

    </refsect2>

    <refsect2 id="method-atktext--remove-selection">
      <title>atk.Text.remove_selection</title>

      <programlisting><methodsynopsis language="python">
        <methodname>remove_selection</methodname>
        <methodparam><parameter role="keyword">selection_num</parameter></methodparam>
      </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><parameter role="keyword">selection_num</parameter>&nbsp;:</term>
          <listitem><simpara>The selection number.  The selected regions are
          assigned numbers that correspond to how far the region is from the
          start of the text.  The selected region closest to the beginning
          of the text region is assigned the number 0, etc.  Note that
          adding, moving or deleting a selected region can change the
          numbering.</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><emphasis>Returns</emphasis>&nbsp;:</term>
          <listitem><simpara><literal>True</literal> if success,
          <literal>False</literal> otherwise</simpara></listitem>
        </varlistentry>
      </variablelist>

      <para>Removes the specified selection.</para>

    </refsect2>

    <refsect2 id="method-atktext--set-selection">
      <title>atk.Text.set_selection</title>

      <programlisting><methodsynopsis language="python">
        <methodname>set_selection</methodname>
        <methodparam><parameter role="keyword">selection_num</parameter></methodparam>
        <methodparam><parameter role="keyword">start_offset</parameter></methodparam>
        <methodparam><parameter role="keyword">end_offset</parameter></methodparam>
      </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><parameter role="keyword">selection_num</parameter>&nbsp;:</term>
          <listitem><simpara>The selection number.  The selected regions are
          assigned numbers that correspond to how far the region is from the
          start of the text.  The selected region closest to the beginning
          of the text region is assigned the number 0, etc.  Note that
          adding, moving or deleting a selected region can change the
          numbering.</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter role="keyword">start_offset</parameter>&nbsp;:</term>
          <listitem><simpara>the new start position of the
          selection</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter role="keyword">end_offset</parameter>&nbsp;:</term>
          <listitem><simpara>the new end position of (e.g. offset
          immediately past) the selection</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><emphasis>Returns</emphasis>&nbsp;:</term>
          <listitem><simpara><literal>True</literal> if success,
          <literal>False</literal> otherwise</simpara></listitem>
        </varlistentry>
      </variablelist>

      <para>Changes the start and end offset of the specified
      selection.</para>

    </refsect2>

    <refsect2 id="method-atktext--set-caret-offset">
      <title>atk.Text.set_caret_offset</title>

      <programlisting><methodsynopsis language="python">
        <methodname>set_caret_offset</methodname>
        <methodparam><parameter role="keyword">offset</parameter></methodparam>
      </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><parameter role="keyword">offset</parameter>&nbsp;:</term>
          <listitem><simpara>position</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><emphasis>Returns</emphasis>&nbsp;:</term>
          <listitem><simpara><literal>True</literal> if success,
          <literal>False</literal> otherwise.</simpara></listitem>
        </varlistentry>
      </variablelist>

      <para>Sets the caret (cursor) position to the specified
      <parameter>offset</parameter>.</para>

    </refsect2>

    <refsect2 id="method-atktext--get-range-extents">
      <title>atk.Text.get_range_extents</title>

      <programlisting><methodsynopsis language="python">
        <methodname>get_range_extents</methodname>
        <methodparam><parameter role="keyword">start_offset</parameter></methodparam>
        <methodparam><parameter role="keyword">end_offset</parameter></methodparam>
        <methodparam><parameter role="keyword">coord_type</parameter></methodparam>
      </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><parameter role="keyword">start_offset</parameter>&nbsp;:</term>
          <listitem><simpara>The offset of the first text character for
          which boundary information is required.</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter role="keyword">end_offset</parameter>&nbsp;:</term>
          <listitem><simpara>The offset of the text character after the last
          character for which boundary information is
          required.</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter role="keyword">coord_type</parameter>&nbsp;:</term>
          <listitem><simpara>Specify whether coordinates are relative to the
          screen or widget window - one of the <xref
          linkend="atk-coord-type-constants"
          endterm="atk-coord-type-constants-title"></xref>.</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><emphasis>Returns</emphasis>&nbsp;:</term>
          <listitem><simpara>a <link
          linkend="class-atkrectangle"><classname>atk.Rectangle</classname></link>
          containing the extents of the range.</simpara></listitem>
        </varlistentry>
      </variablelist>

      <para>Get the bounding box for text within the specified range.</para>

    </refsect2>

    <refsect2 id="method-atktext--get-bounded-ranges">
      <title>atk.Text.get_bounded_ranges</title>

      <programlisting><methodsynopsis language="python">
        <methodname>get_bounded_ranges</methodname>
        <methodparam><parameter role="keyword">rect</parameter></methodparam>
        <methodparam><parameter role="keyword">coord_type</parameter></methodparam>
        <methodparam><parameter role="keyword">x_clip_type</parameter></methodparam>
        <methodparam><parameter role="keyword">y_clip_type</parameter></methodparam>
      </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><parameter role="keyword">rect</parameter>&nbsp;:</term>
          <listitem><simpara>An <link
          linkend="class-atkrectangle"><classname>atk.Rectangle</classname></link>
          giving the dimensions of the bounding box.</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter role="keyword">coord_type</parameter>&nbsp;:</term>
          <listitem><simpara>Specify whether coordinates are relative to the
          screen or widget window - one of the <xref
          linkend="atk-coord-type-constants"
          endterm="atk-coord-type-constants-title"></xref>.</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter role="keyword">x_clip_type</parameter>&nbsp;:</term>
          <listitem><simpara>Specify the horizontal clip type - one of the
          <xref linkend="atk-text-clip-type-constants"
          endterm="atk-text-clip-type-constants-title"></xref>.</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter role="keyword">y_clip_type</parameter>&nbsp;:</term>
          <listitem><simpara>Specify the vertical clip type - one of the
          <xref linkend="atk-text-clip-type-constants"
          endterm="atk-text-clip-type-constants-title"></xref>.</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><emphasis>Returns</emphasis>&nbsp;:</term>
          <listitem><simpara>a list of text ranges. The list contains a
          4-tuple for each text range. The 4-tuple contains a <link
          linkend="class-atkrectangle"><classname>atk.Rectangle</classname></link>
          bounding the text range, the start and end offsets of the range
          and the text in the range.</simpara></listitem>
        </varlistentry>
      </variablelist>

      <para>Get the ranges of text in the specified bounding box.</para>

    </refsect2>

  </refsect1>

  <refsect1>
    <title>Functions</title>

    <refsect2 id="function-atk--text-attribute-get-name">
      <title>atk.text_attribute_get_name</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>atk.text_attribute_get_name</methodname>
	  <methodparam><parameter
			 role="keyword">attr</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">attr</parameter>&nbsp;:</term>
	  <listitem><simpara>a text attribute (one of the <xref
	  linkend="atk-text-attr-constants"
	  endterm="atk-text-attr-constants-title"></xref>) whose name is
	  required</simpara></listitem>
	</varlistentry>
	<varlistentry>
	<term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a string containing the name</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>Gets the name corresponding to
      <parameter>attr</parameter>.</para>

    </refsect2>

    <refsect2 id="function-atk--text-attribute-get-value">
      <title>atk.text_attribute_get_value</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>atk.text_attribute_get_value</methodname>
	  <methodparam><parameter
			 role="keyword">attr</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">index</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">attr</parameter>&nbsp;:</term>
	  <listitem><simpara>a text attribute (one of the <xref
	  linkend="atk-text-attr-constants"
	  endterm="atk-text-attr-constants-title"></xref>) whose name is
	  required</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">index</parameter>&nbsp;:</term>
	  <listitem><simpara>The index of the required
	  value</simpara></listitem>
	</varlistentry>
	<varlistentry>
	<term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a string containing the
	  value. <literal>None</literal> is returned if there are no values
	  maintained for the <parameter>attr</parameter>
	  value.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>Gets the value for the <parameter>index</parameter> of the text
      attribute specified by <parameter>attr</parameter>.</para>

    </refsect2>

    <refsect2 id="function-atk--text-attribute-register">
      <title>atk.text_attribute_register</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>atk.text_attribute_register</methodname>
	  <methodparam><parameter
			 role="keyword">name</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">name</parameter>&nbsp;:</term>
	  <listitem><simpara>a name string</simpara></listitem>
	</varlistentry>
	<varlistentry>
	<term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a new one of the <xref
	  linkend="atk-text-attr-constants"
	  endterm="atk-text-attr-constants-title"></xref> that is associated
	  with name</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>Associate <parameter>name</parameter> with a new text
      attribute.</para>

    </refsect2>

    <refsect2 id="function-atk--text-attribute-for-name">
      <title>atk.text_attribute_for_name</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>atk.text_attribute_for_name</methodname>
	  <methodparam><parameter
			 role="keyword">name</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">name</parameter>&nbsp;:</term>
	  <listitem><simpara>a string which is the (non-localized) name of
	  an ATK text attribute.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	<term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the text attribute (one of the <xref
	  linkend="atk-text-attr-constants"
	  endterm="atk-text-attr-constants-title"></xref>) corresponding to
	  the specified name, or
	  <literal>atk.TEXT_ATTRIBUTE_INVALID</literal> if no matching text
	  attribute is found.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>Get the text attribute type corresponding to a text attribute
      name specified by <parameter>name</parameter>.</para>

    </refsect2>

  </refsect1>

  <refsect1>
    <title>Signals</title>

    <refsect2 id="signal-atktext--text-attributes-changed">
      <title>The "text-attributes-changed" atk.Text Signal</title>

      <programlisting><methodsynopsis language="python"><methodname>callback</methodname>
            <methodparam><parameter>atktext</parameter></methodparam>
            <methodparam><parameter>user_param1</parameter></methodparam>
            <methodparam><parameter>...</parameter></methodparam>
          </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><parameter>atktext</parameter>&nbsp;:</term>
          <listitem><simpara>the object which received the
          signal.</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter>user_param1</parameter>&nbsp;:</term>
          <listitem><simpara>the first user parameter (if any) specified
          with the <link
          linkend="method-gobject--connect"><methodname>connect</methodname>()</link>
          method</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter>...</parameter>&nbsp;:</term>
          <listitem><simpara>additional user parameters (if any)</simpara></listitem>
        </varlistentry>
      </variablelist>

      <para>The "text-attributes-changed" signal is emitted when the text
      attributes of the text of an object which implements <link
      linkend="class-atktext"><classname>atk.Text</classname></link>
      changes.</para>

    </refsect2>

    <refsect2 id="signal-atktext--text-caret-moved">
      <title>The "text-caret-moved" atk.Text Signal</title>

      <programlisting><methodsynopsis language="python"><methodname>callback</methodname>
            <methodparam><parameter>atktext</parameter></methodparam>
            <methodparam><parameter>position</parameter></methodparam>
            <methodparam><parameter>user_param1</parameter></methodparam>
            <methodparam><parameter>...</parameter></methodparam>
          </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><parameter>atktext</parameter>&nbsp;:</term>
          <listitem><simpara>the object which received the
          signal.</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter>position</parameter>&nbsp;:</term>
          <listitem><simpara>The new position of the text
          caret.</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter>user_param1</parameter>&nbsp;:</term>
          <listitem><simpara>the first user parameter (if any) specified
          with the <link
          linkend="method-gobject--connect"><methodname>connect</methodname>()</link>
          method</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter>...</parameter>&nbsp;:</term>
          <listitem><simpara>additional user parameters (if any)</simpara></listitem>
        </varlistentry>
      </variablelist>

      <para>The "text-caret-moved" signal is emitted when the caret position
      of the text of an object which implements <link
      linkend="class-atktext"><classname>atk.Text</classname></link>
      changes.</para>

    </refsect2>

    <refsect2 id="signal-atktext--text-changed">
      <title>The "text-changed" atk.Text Signal</title>

      <programlisting><methodsynopsis language="python"><methodname>callback</methodname>
            <methodparam><parameter>atktext</parameter></methodparam>
            <methodparam><parameter>position</parameter></methodparam>
            <methodparam><parameter>length</parameter></methodparam>
            <methodparam><parameter>user_param1</parameter></methodparam>
            <methodparam><parameter>...</parameter></methodparam>
          </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><parameter>atktext</parameter>&nbsp;:</term>
          <listitem><simpara>the object which received the signal.</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter>position</parameter>&nbsp;:</term>
          <listitem><simpara>The position of the insertion or deletion.</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter>length</parameter>&nbsp;:</term>
          <listitem><simpara>The length of text inserted or deleted.</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter>user_param1</parameter>&nbsp;:</term>
          <listitem><simpara>the first user parameter (if any) specified
          with the <link
          linkend="method-gobject--connect"><methodname>connect</methodname>()</link>
          method</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter>...</parameter>&nbsp;:</term>
          <listitem><simpara>additional user parameters (if any)</simpara></listitem>
        </varlistentry>
      </variablelist>

      <para>The "text-changed" signal is emitted when the text of the object
      which implements the <link
      linkend="class-atktext"><classname>atk.Text</classname></link>
      interface changes, This signal will have a detail which is either
      "insert" or "delete" which identifies whether the text change was an
      insertion or a deletion</para>

    </refsect2>

    <refsect2 id="signal-atktext--text-selection-changed">
      <title>The "text-selection-changed" atk.Text Signal</title>

      <programlisting><methodsynopsis language="python"><methodname>callback</methodname>
            <methodparam><parameter>atktext</parameter></methodparam>
            <methodparam><parameter>user_param1</parameter></methodparam>
            <methodparam><parameter>...</parameter></methodparam>
          </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><parameter>atktext</parameter>&nbsp;:</term>
          <listitem><simpara>the object which received the signal.</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter>user_param1</parameter>&nbsp;:</term>
          <listitem><simpara>the first user parameter (if any) specified
          with the <link
          linkend="method-gobject--connect"><methodname>connect</methodname>()</link>
          method</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter>...</parameter>&nbsp;:</term>
          <listitem><simpara>additional user parameters (if any)</simpara></listitem>
        </varlistentry>
      </variablelist>

      <para>The "text-selection-changed" signal is emitted when the selected
      text of an object which implements <link
      linkend="class-atktext"><classname>atk.Text</classname></link>
      changes.</para>

    </refsect2>

</refsect1>

</refentry>