📄 atktext.xml
字号:
<link linkend="gint">gint</link> offset, <link linkend="AtkTextBoundary">AtkTextBoundary</link> boundary_type, <link linkend="gint">gint</link> *start_offset, <link linkend="gint">gint</link> *end_offset);</programlisting><para>Gets the specified text.</para><para>If the boundary_type if ATK_TEXT_BOUNDARY_CHAR the character before theoffset is returned.</para><para>If the boundary_type is ATK_TEXT_BOUNDARY_WORD_START the returned stringis 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 offsetis 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 boundary_type is ATK_TEXT_BOUNDARY_WORD_END the returned stringis 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 offsetis inside a word or if the offset is not inside a word.</para><para>If the boundary type is ATK_TEXT_BOUNDARY_SENTENCE_START the returnedstring 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 boundary_type is ATK_TEXT_BOUNDARY_SENTENCE_END the returned stringis 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 boundary type is ATK_TEXT_BOUNDARY_LINE_START the returnedstring 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 boundary_type is ATK_TEXT_BOUNDARY_LINE_END the returned stringis from the line end before the line end before the offset to the line end before the offset.</para><para></para><variablelist role="params"><varlistentry><term><parameter>text</parameter> :</term><listitem><simpara> an <link linkend="AtkText"><type>AtkText</type></link></simpara></listitem></varlistentry><varlistentry><term><parameter>offset</parameter> :</term><listitem><simpara> position</simpara></listitem></varlistentry><varlistentry><term><parameter>boundary_type</parameter> :</term><listitem><simpara> An <link linkend="AtkTextBoundary"><type>AtkTextBoundary</type></link></simpara></listitem></varlistentry><varlistentry><term><parameter>start_offset</parameter> :</term><listitem><simpara> the start offset of the returned string.</simpara></listitem></varlistentry><varlistentry><term><parameter>end_offset</parameter> :</term><listitem><simpara> the end offset of the returned string.</simpara></listitem></varlistentry><varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the text before <parameter>offset</parameter> bounded by the specified <parameter>boundary_type</parameter>.</simpara></listitem></varlistentry></variablelist></refsect2><refsect2><title><anchor id="atk-text-get-caret-offset"/>atk_text_get_caret_offset ()</title><indexterm><primary>atk_text_get_caret_offset</primary></indexterm><programlisting><link linkend="gint">gint</link> atk_text_get_caret_offset (<link linkend="AtkText">AtkText</link> *text);</programlisting><para>Gets the offset position of the caret (cursor).</para><para></para><variablelist role="params"><varlistentry><term><parameter>text</parameter> :</term><listitem><simpara> an <link linkend="AtkText"><type>AtkText</type></link></simpara></listitem></varlistentry><varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the offset position of the caret (cursor).</simpara></listitem></varlistentry></variablelist></refsect2><refsect2><title><anchor id="atk-text-get-character-extents"/>atk_text_get_character_extents ()</title><indexterm><primary>atk_text_get_character_extents</primary></indexterm><programlisting><link linkend="void">void</link> atk_text_get_character_extents (<link linkend="AtkText">AtkText</link> *text, <link linkend="gint">gint</link> offset, <link linkend="gint">gint</link> *x, <link linkend="gint">gint</link> *y, <link linkend="gint">gint</link> *width, <link linkend="gint">gint</link> *height, <link linkend="AtkCoordType">AtkCoordType</link> coords);</programlisting><para>Get the bounding box containing the glyph representing the character at a particular text offset.</para><para></para><variablelist role="params"><varlistentry><term><parameter>text</parameter> :</term><listitem><simpara> an <link linkend="AtkText"><type>AtkText</type></link></simpara></listitem></varlistentry><varlistentry><term><parameter>offset</parameter> :</term><listitem><simpara> The offset of the text character for which bounding information is required.</simpara></listitem></varlistentry><varlistentry><term><parameter>x</parameter> :</term><listitem><simpara> Pointer for the x cordinate of the bounding box.</simpara></listitem></varlistentry><varlistentry><term><parameter>y</parameter> :</term><listitem><simpara> Pointer for the y cordinate of the bounding box.</simpara></listitem></varlistentry><varlistentry><term><parameter>width</parameter> :</term><listitem><simpara> Pointer for the width of the bounding box</simpara></listitem></varlistentry><varlistentry><term><parameter>height</parameter> :</term><listitem><simpara> Pointer for the height of the bounding box.</simpara></listitem></varlistentry><varlistentry><term><parameter>coords</parameter> :</term><listitem><simpara> specify whether coordinates are relative to the screen or widget window </simpara></listitem></varlistentry></variablelist></refsect2><refsect2><title><anchor id="atk-text-get-run-attributes"/>atk_text_get_run_attributes ()</title><indexterm><primary>atk_text_get_run_attributes</primary></indexterm><programlisting><link linkend="AtkAttributeSet">AtkAttributeSet</link>* atk_text_get_run_attributes (<link linkend="AtkText">AtkText</link> *text, <link linkend="gint">gint</link> offset, <link linkend="gint">gint</link> *start_offset, <link linkend="gint">gint</link> *end_offset);</programlisting><para>Creates an <link linkend="AtkAttributeSet"><type>AtkAttributeSet</type></link> which consists of the attributes explicitlyset at the position <parameter>offset</parameter> in the text. <parameter>start_offset</parameter> and <parameter>end_offset</parameter> areset to the start and end of the range around <parameter>offset</parameter> where the attributes areinvariant. See the enum AtkTextAttribute for types of text attributes that can be returned. Note that other attributes may also be returned.</para><para></para><variablelist role="params"><varlistentry><term><parameter>text</parameter> :</term><listitem><simpara> an <link linkend="AtkText"><type>AtkText</type></link></simpara></listitem></varlistentry><varlistentry><term><parameter>offset</parameter> :</term><listitem><simpara> the offset at which to get the attributes</simpara></listitem></varlistentry><varlistentry><term><parameter>start_offset</parameter> :</term><listitem><simpara> the address to put the start offset of the range</simpara></listitem></varlistentry><varlistentry><term><parameter>end_offset</parameter> :</term><listitem><simpara> the address to put the end offset of the range</simpara></listitem></varlistentry><varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> an <link linkend="AtkAttributeSet"><type>AtkAttributeSet</type></link> which contains the attributes explicitly setat <parameter>offset</parameter>. This <link linkend="AtkAttributeSet"><type>AtkAttributeSet</type></link> should be freed by a call to<link linkend="atk-attribute-set-free"><function>atk_attribute_set_free()</function></link>.</simpara></listitem></varlistentry></variablelist></refsect2><refsect2><title><anchor id="atk-text-get-default-attributes"/>atk_text_get_default_attributes ()</title><indexterm><primary>atk_text_get_default_attributes</primary></indexterm><programlisting><link linkend="AtkAttributeSet">AtkAttributeSet</link>* atk_text_get_default_attributes (<link linkend="AtkText">AtkText</link> *text);</programlisting><para>Creates an <link linkend="AtkAttributeSet"><type>AtkAttributeSet</type></link> which consists of the default values ofattributes for the text. See the enum AtkTextAttribute for types of text attributes that can be returned. Note that other attributes may also be returned.</para><para></para><variablelist role="params"><varlistentry><term><parameter>text</parameter> :</term><listitem><simpara> an <link linkend="AtkText"><type>AtkText</type></link></simpara></listitem></varlistentry><varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> an <link linkend="AtkAttributeSet"><type>AtkAttributeSet</type></link> which contains the default values of attributes.at <parameter>offset</parameter>. This <link linkend="AtkAttributeSet"><type>AtkAttributeSet</type></link> should be freed by a call to<link linkend="atk-attribute-set-free"><function>atk_attribute_set_free()</function></link>.</simpara></listitem></varlistentry></variablelist></refsect2><refsect2><title><anchor id="atk-text-get-character-count"/>atk_text_get_character_count ()</title><indexterm><primary>atk_text_get_character_count</primary></indexterm><programlisting><link linkend="gint">gint</link> atk_text_get_character_count (<link linkend="AtkText">AtkText</link> *text);</programlisting><para>Gets the character count.</para><para></para><variablelist role="params"><varlistentry><term><parameter>text</parameter> :</term><listitem><simpara> an <link linkend="AtkText"><type>AtkText</type></link></simpara></listitem></varlistentry><varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the number of characters.</simpara></listitem></varlistentry></variablelist></refsect2><refsect2><title><anchor id="atk-text-get-offset-at-point"/>atk_text_get_offset_at_point ()</title><indexterm><primary>atk_text_get_offset_at_point</primary></indexterm><programlisting><link linkend="gint">gint</link> atk_text_get_offset_at_point (<link linkend="AtkText">AtkText</link> *text, <link linkend="gint">gint</link> x, <link linkend="gint">gint</link> y, <link linkend="AtkCoordType">AtkCoordType</link> coords);</programlisting><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 windowdepending on <parameter>coords</parameter>.</para><para></para><variablelist role="params"><varlistentry><term><parameter>text</parameter> :</term><listitem><simpara> an <link linkend="AtkText"><type>AtkText</type></link></simpara></listitem></varlistentry><varlistentry><term><parameter>x</parameter> :</term><listitem><simpara> screen x-position of character</simpara></listitem></varlistentry><varlistentry><term><parameter>y</parameter> :</term><listitem><simpara> screen y-position of character</simpara></listitem></varlistentry><varlistentry><term><parameter>coords</parameter> :</term><listitem><simpara> specify whether coordinates are relative to the screen orwidget window </simpara></listitem></varlistentry><varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the offset to the character which is located atthe specified <parameter>x</parameter> and <parameter>y</parameter> coordinates.</simpara></listitem></varlistentry></variablelist></refsect2><refsect2><title><anchor id="atk-text-get-bounded-ranges"/>atk_text_get_bounded_ranges ()</title><indexterm><primary>atk_text_get_bounded_ranges</primary></indexterm><programlisting><link linkend="AtkTextRange">AtkTextRange</link>** atk_text_get_bounded_ranges (<link linkend="AtkText">AtkText</link> *text, <link linkend="AtkTextRectangle">AtkTextRectangle</link> *rect, <link linkend="AtkCoordType">AtkCoordType</link> coord_type, <link linkend="AtkTextClipType">AtkTextClipType</link> x_clip_type, <link linkend="AtkTextClipType">AtkTextClipType</link> y_clip_type);</programlisting><para>Get the ranges of text in the specified bounding box.</para><para></para><variablelist role="params"><varlistentry><term><parameter>text</parameter> :</term><listitem><simpara> an <link linkend="AtkText"><type>AtkText</type></link></simpara></listitem></varlistentry><varlistentry><term><parameter>rect</parameter> :</term><listitem><simpara> An AtkTextRectagle giving the dimensions of the bounding box.</simpara></listitem></varlistentry><varlistentry><term><parameter>coord_type</parameter> :</term>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -