📄 atktext.xml
字号:
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 id="atk-text-get-character-count" role="function"><title>atk_text_get_character_count ()</title><indexterm zone="atk-text-get-character-count"><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 id="atk-text-get-offset-at-point" role="function"><title>atk_text_get_offset_at_point ()</title><indexterm zone="atk-text-get-offset-at-point"><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 id="atk-text-get-bounded-ranges" role="function" condition="since:ATK 1.3"><title>atk_text_get_bounded_ranges ()</title><indexterm zone="atk-text-get-bounded-ranges" role="ATK 1.3"><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><listitem><simpara> Specify whether coordinates are relative to the screen or widget window.</simpara></listitem></varlistentry><varlistentry><term><parameter>x_clip_type</parameter> :</term><listitem><simpara> Specify the horizontal clip type.</simpara></listitem></varlistentry><varlistentry><term><parameter>y_clip_type</parameter> :</term><listitem><simpara> Specify the vertical clip type.</simpara></listitem></varlistentry><varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> Array of AtkTextRange. The last element of the array returned by this function will be NULL.</simpara></listitem></varlistentry></variablelist><para role="since">Since ATK 1.3</para></refsect2><refsect2 id="atk-text-get-range-extents" role="function" condition="since:ATK 1.3"><title>atk_text_get_range_extents ()</title><indexterm zone="atk-text-get-range-extents" role="ATK 1.3"><primary>atk_text_get_range_extents</primary></indexterm><programlisting><link linkend="void">void</link> atk_text_get_range_extents (<link linkend="AtkText">AtkText</link> *text, <link linkend="gint">gint</link> start_offset, <link linkend="gint">gint</link> end_offset, <link linkend="AtkCoordType">AtkCoordType</link> coord_type, <link linkend="AtkTextRectangle">AtkTextRectangle</link> *rect);</programlisting><para>Get the bounding box for text within the specified range.</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>start_offset</parameter> :</term><listitem><simpara> The offset of the first text character for which boundary information is required.</simpara></listitem></varlistentry><varlistentry><term><parameter>end_offset</parameter> :</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>coord_type</parameter> :</term><listitem><simpara> Specify whether coordinates are relative to the screen or widget window.</simpara></listitem></varlistentry><varlistentry><term><parameter>rect</parameter> :</term><listitem><simpara> A pointer to a AtkTextRectangle which is filled in by this function.</simpara></listitem></varlistentry></variablelist><para role="since">Since ATK 1.3</para></refsect2><refsect2 id="atk-text-free-ranges" role="function" condition="since:ATK 1.3"><title>atk_text_free_ranges ()</title><indexterm zone="atk-text-free-ranges" role="ATK 1.3"><primary>atk_text_free_ranges</primary></indexterm><programlisting><link linkend="void">void</link> atk_text_free_ranges (<link linkend="AtkTextRange">AtkTextRange</link> **ranges);</programlisting><para>Frees the memory associated with an array of AtkTextRange. It is assumedthat the array was returned by the function atk_text_get_bounded_rangesand is NULL terminated.</para><para></para><variablelist role="params"><varlistentry><term><parameter>ranges</parameter> :</term><listitem><simpara> A pointer to an array of <link linkend="AtkTextRange"><type>AtkTextRange</type></link> which is to be freed.</simpara></listitem></varlistentry></variablelist><para role="since">Since ATK 1.3</para></refsect2><refsect2 id="atk-text-get-n-selections" role="function"><title>atk_text_get_n_selections ()</title><indexterm zone="atk-text-get-n-selections"><primary>atk_text_get_n_selections</primary></indexterm><programlisting><link linkend="gint">gint</link> atk_text_get_n_selections (<link linkend="AtkText">AtkText</link> *text);</programlisting><para>Gets the number of selected regions.</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 selected regions, or -1 if a failure occurred.</simpara></listitem></varlistentry></variablelist></refsect2><refsect2 id="atk-text-get-selection" role="function"><title>atk_text_get_selection ()</title><indexterm zone="atk-text-get-selection"><primary>atk_text_get_selection</primary></indexterm><programlisting><link linkend="gchar">gchar</link>* atk_text_get_selection (<link linkend="AtkText">AtkText</link> *text, <link linkend="gint">gint</link> selection_num, <link linkend="gint">gint</link> *start_offset, <link linkend="gint">gint</link> *end_offset);</programlisting><para>Gets the text from the specified selection.</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>selection_num</parameter> :</term><listitem><simpara> The selection number. The selected regions areassigned numbers that correspond to how far the region is from thestart of the text. The selected region closest to the beginningof 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>start_offset</parameter> :</term><listitem><simpara> passes back the start position of the selected region</simpara></listitem></varlistentry><varlistentry><term><parameter>end_offset</parameter> :</term><listitem><simpara> passes back the end position of (e.g. offset immediately past) the selected region</simpara></listitem></varlistentry><varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the selected text.</simpara></listitem></varlistentry></variablelist></refsect2><refsect2 id="atk-text-add-selection" role="function"><title>atk_text_add_selection ()</title><indexterm zone="atk-text-add-selection"><primary>atk_text_add_selection</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> atk_text_add_selection (<link linkend="AtkText">AtkText</link> *text, <link linkend="gint">gint</link> start_offset, <link linkend="gint">gint</link> end_offset);</programlisting><para>Adds a selection bounded by the specified offsets.</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>start_offset</parameter> :</term><listitem><simpara> the start position of the selected region</simpara></listitem></varlistentry><varlistentry><term><parameter>end_offset</parameter> :</term><listitem><simpara> the offset of the first character after the selected region.</simpara></listitem></varlistentry><varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if success, <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> otherwise</simpara></listitem></varlistentry></variablelist></refsect2><refsect2 id="atk-text-remove-selection" role="function"><title>atk_text_remove_selection ()</title><indexterm zone="atk-text-remove-selection"><primary>atk_text_remove_selection</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> atk_text_remove_selection (<link linkend="AtkText">AtkText</link> *text, <link linkend="gint">gint</link> selection_num);</programlisting><para>Removes the specified selection.</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>selection_num</parameter> :</term><listitem><simpara> The selection number. The selected regions areassigned numbers that correspond to how far the region is from thestart of the text. The selected region closest to the beginningof 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> :</term><listitem><simpara> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if success, <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> otherwise</simpara></listitem></varlistentry></variablelist></refsect2><
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -