<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
               "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY % local.common.attrib "xmlns:xi  CDATA  #FIXED 'http://www.w3.org/2003/XInclude'">
<!ENTITY version SYSTEM "version.xml">
<!ENTITY pi "&#960;">
<!ENTITY solidus "&#8260;">
]>
<refentry id="GtkTextTagTable">
<refmeta>
<refentrytitle role="top_of_page" id="GtkTextTagTable.top_of_page">GtkTextTagTable</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK4 Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>GtkTextTagTable</refname>
<refpurpose>Collection of tags that can be used together</refpurpose>
</refnamediv>

<refsect1 id="GtkTextTagTable.functions" role="functions_proto">
<title role="functions_proto.title">Functions</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="functions_proto_type" colwidth="150px"/>
<colspec colname="functions_proto_name"/>
<tbody>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><phrase role="c_punctuation">(</phrase><link linkend="GtkTextTagTableForeach">*GtkTextTagTableForeach</link><phrase role="c_punctuation">)</phrase>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GtkTextTagTable"><returnvalue>GtkTextTagTable</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-text-tag-table-new">gtk_text_tag_table_new</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-text-tag-table-add">gtk_text_tag_table_add</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-text-tag-table-remove">gtk_text_tag_table_remove</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GtkTextTag"><returnvalue>GtkTextTag</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-text-tag-table-lookup">gtk_text_tag_table_lookup</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-text-tag-table-foreach">gtk_text_tag_table_foreach</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gint"><returnvalue>gint</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-text-tag-table-get-size">gtk_text_tag_table_get_size</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkTextTagTable.signals" role="signal_proto">
<title role="signal_proto.title">Signals</title>
<informaltable frame="none">
<tgroup cols="3">
<colspec colname="signal_proto_type" colwidth="150px"/>
<colspec colname="signal_proto_name" colwidth="300px"/>
<colspec colname="signal_proto_flags" colwidth="200px"/>
<tbody>
<row><entry role="signal_type"><link linkend="void"><returnvalue>void</returnvalue></link></entry><entry role="signal_name"><link linkend="GtkTextTagTable-tag-added">tag-added</link></entry><entry role="signal_flags"><link linkend="G-SIGNAL-RUN-LAST:CAPS">Run Last</link></entry></row>
<row><entry role="signal_type"><link linkend="void"><returnvalue>void</returnvalue></link></entry><entry role="signal_name"><link linkend="GtkTextTagTable-tag-changed">tag-changed</link></entry><entry role="signal_flags"><link linkend="G-SIGNAL-RUN-LAST:CAPS">Run Last</link></entry></row>
<row><entry role="signal_type"><link linkend="void"><returnvalue>void</returnvalue></link></entry><entry role="signal_name"><link linkend="GtkTextTagTable-tag-removed">tag-removed</link></entry><entry role="signal_flags"><link linkend="G-SIGNAL-RUN-LAST:CAPS">Run Last</link></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkTextTagTable.other" role="other_proto">
<title role="other_proto.title">Types and Values</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="other_proto_type" colwidth="150px"/>
<colspec colname="other_proto_name"/>
<tbody>
<row><entry role="datatype_keyword"></entry><entry role="function_name"><link linkend="GtkTextTagTable-struct">GtkTextTagTable</link></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkTextTagTable.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<screen>    <link linkend="GObject">GObject</link>
    <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> GtkTextTagTable
</screen>
</refsect1>
<refsect1 id="GtkTextTagTable.implemented-interfaces" role="impl_interfaces">
<title role="impl_interfaces.title">Implemented Interfaces</title>
<para>
GtkTextTagTable implements
 <link linkend="GtkBuildable">GtkBuildable</link>.</para>

</refsect1>

<refsect1 id="GtkTextTagTable.includes"><title>Includes</title><synopsis>#include &lt;gtk/gtk.h&gt;
</synopsis></refsect1>

<refsect1 id="GtkTextTagTable.description" role="desc">
<title role="desc.title">Description</title>
<para>You may wish to begin by reading the
<link linkend="TextWidget">text widget conceptual overview</link>
which gives an overview of all the objects and
data types related to the text widget and how they work together.</para>
<refsect2><title>GtkTextTagTables as GtkBuildable</title><para>The GtkTextTagTable implementation of the GtkBuildable interface
supports adding tags by specifying “tag” as the “type” attribute
of a &lt;child> element.</para>
<para>An example of a UI definition fragment specifying tags:</para>
<informalexample><programlisting role="example"><![CDATA[
<object class="GtkTextTagTable">
 <child type="tag">
   <object class="GtkTextTag"/>
 </child>
</object>
]]></programlisting></informalexample>
<para></para>
</refsect2>

</refsect1>
<refsect1 id="GtkTextTagTable.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="GtkTextTagTableForeach" role="function">
<title>GtkTextTagTableForeach&#160;()</title>
<indexterm zone="GtkTextTagTableForeach"><primary>GtkTextTagTableForeach</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
<phrase role="c_punctuation">(</phrase>*GtkTextTagTableForeach<phrase role="c_punctuation">)</phrase> (<parameter><link linkend="GtkTextTag"><type>GtkTextTag</type></link> *tag</parameter>,
                           <parameter><link linkend="gpointer"><type>gpointer</type></link> data</parameter>);</programlisting>
<refsect3 id="GtkTextTagTableForeach.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>tag</para></entry>
<entry role="parameter_description"><para>the <link linkend="GtkTextTag"><type>GtkTextTag</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>data</para></entry>
<entry role="parameter_description"><para>data passed to <link linkend="gtk-text-tag-table-foreach"><function>gtk_text_tag_table_foreach()</function></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>closure</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-text-tag-table-new" role="function">
<title>gtk_text_tag_table_new&#160;()</title>
<indexterm zone="gtk-text-tag-table-new"><primary>gtk_text_tag_table_new</primary></indexterm>
<programlisting language="C"><link linkend="GtkTextTagTable"><returnvalue>GtkTextTagTable</returnvalue></link>&#160;*
gtk_text_tag_table_new (<parameter><type>void</type></parameter>);</programlisting>
<para>Creates a new <link linkend="GtkTextTagTable"><type>GtkTextTagTable</type></link>. The table contains no tags by
default.</para>
<refsect3 id="gtk-text-tag-table-new.returns" role="returns">
<title>Returns</title>
<para> a new <link linkend="GtkTextTagTable"><type>GtkTextTagTable</type></link></para>
</refsect3></refsect2>
<refsect2 id="gtk-text-tag-table-add" role="function">
<title>gtk_text_tag_table_add&#160;()</title>
<indexterm zone="gtk-text-tag-table-add"><primary>gtk_text_tag_table_add</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
gtk_text_tag_table_add (<parameter><link linkend="GtkTextTagTable"><type>GtkTextTagTable</type></link> *table</parameter>,
                        <parameter><link linkend="GtkTextTag"><type>GtkTextTag</type></link> *tag</parameter>);</programlisting>
<para>Add a tag to the table. The tag is assigned the highest priority
in the table.</para>
<para><parameter>tag</parameter>
 must not be in a tag table already, and may not have
the same name as an already-added tag.</para>
<refsect3 id="gtk-text-tag-table-add.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>table</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkTextTagTable"><type>GtkTextTagTable</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>tag</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkTextTag"><type>GtkTextTag</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-text-tag-table-add.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> on success.</para>
</refsect3></refsect2>
<refsect2 id="gtk-text-tag-table-remove" role="function">
<title>gtk_text_tag_table_remove&#160;()</title>
<indexterm zone="gtk-text-tag-table-remove"><primary>gtk_text_tag_table_remove</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_text_tag_table_remove (<parameter><link linkend="GtkTextTagTable"><type>GtkTextTagTable</type></link> *table</parameter>,
                           <parameter><link linkend="GtkTextTag"><type>GtkTextTag</type></link> *tag</parameter>);</programlisting>
<para>Remove a tag from the table. If a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link> has <parameter>table</parameter>
 as its tag table,
the tag is removed from the buffer. The table’s reference to the tag is
removed, so the tag will end up destroyed if you don’t have a reference to
it.</para>
<refsect3 id="gtk-text-tag-table-remove.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>table</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkTextTagTable"><type>GtkTextTagTable</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>tag</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkTextTag"><type>GtkTextTag</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-text-tag-table-lookup" role="function">
<title>gtk_text_tag_table_lookup&#160;()</title>
<indexterm zone="gtk-text-tag-table-lookup"><primary>gtk_text_tag_table_lookup</primary></indexterm>
<programlisting language="C"><link linkend="GtkTextTag"><returnvalue>GtkTextTag</returnvalue></link>&#160;*
gtk_text_tag_table_lookup (<parameter><link linkend="GtkTextTagTable"><type>GtkTextTagTable</type></link> *table</parameter>,
                           <parameter>const <link linkend="gchar"><type>gchar</type></link> *name</parameter>);</programlisting>
<para>Look up a named tag.</para>
<refsect3 id="gtk-text-tag-table-lookup.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>table</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkTextTagTable"><type>GtkTextTagTable</type></link> </para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>name</para></entry>
<entry role="parameter_description"><para>name of a tag</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-text-tag-table-lookup.returns" role="returns">
<title>Returns</title>
<para>The tag, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if none by that
name is in the table. </para>
<para><emphasis role="annotation">[<acronym>nullable</acronym>][<acronym>transfer none</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gtk-text-tag-table-foreach" role="function">
<title>gtk_text_tag_table_foreach&#160;()</title>
<indexterm zone="gtk-text-tag-table-foreach"><primary>gtk_text_tag_table_foreach</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_text_tag_table_foreach (<parameter><link linkend="GtkTextTagTable"><type>GtkTextTagTable</type></link> *table</parameter>,
                            <parameter><link linkend="GtkTextTagTableForeach"><type>GtkTextTagTableForeach</type></link> func</parameter>,
                            <parameter><link linkend="gpointer"><type>gpointer</type></link> data</parameter>);</programlisting>
<para>Calls <parameter>func</parameter>
 on each tag in <parameter>table</parameter>
, with user data <parameter>data</parameter>
.
Note that the table may not be modified while iterating 
over it (you can’t add/remove tags).</para>
<refsect3 id="gtk-text-tag-table-foreach.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>table</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkTextTagTable"><type>GtkTextTagTable</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>func</para></entry>
<entry role="parameter_description"><para>a function to call on each tag. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>scope call</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>data</para></entry>
<entry role="parameter_description"><para>user data</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-text-tag-table-get-size" role="function">
<title>gtk_text_tag_table_get_size&#160;()</title>
<indexterm zone="gtk-text-tag-table-get-size"><primary>gtk_text_tag_table_get_size</primary></indexterm>
<programlisting language="C"><link linkend="gint"><returnvalue>gint</returnvalue></link>
gtk_text_tag_table_get_size (<parameter><link linkend="GtkTextTagTable"><type>GtkTextTagTable</type></link> *table</parameter>);</programlisting>
<para>Returns the size of the table (number of tags)</para>
<refsect3 id="gtk-text-tag-table-get-size.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>table</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkTextTagTable"><type>GtkTextTagTable</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-text-tag-table-get-size.returns" role="returns">
<title>Returns</title>
<para> number of tags in <parameter>table</parameter>
</para>
</refsect3></refsect2>

</refsect1>
<refsect1 id="GtkTextTagTable.other_details" role="details">
<title role="details.title">Types and Values</title>
<refsect2 id="GtkTextTagTable-struct" role="struct">
<title>GtkTextTagTable</title>
<indexterm zone="GtkTextTagTable-struct"><primary>GtkTextTagTable</primary></indexterm>
<programlisting language="C">typedef struct _GtkTextTagTable GtkTextTagTable;</programlisting>
</refsect2>

</refsect1>
<refsect1 id="GtkTextTagTable.signal-details" role="signals">
<title role="signals.title">Signal Details</title>
<refsect2 id="GtkTextTagTable-tag-added" role="signal"><title>The <literal>“tag-added”</literal> signal</title>
<indexterm zone="GtkTextTagTable-tag-added"><primary>GtkTextTagTable::tag-added</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
user_function (<link linkend="GtkTextTagTable"><type>GtkTextTagTable</type></link> *texttagtable,
               <link linkend="GtkTextTag"><type>GtkTextTag</type></link>      *tag,
               <link linkend="gpointer"><type>gpointer</type></link>         user_data)</programlisting>
<refsect3 id="GtkTextTagTable-tag-added.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>texttagtable</para></entry>
<entry role="parameter_description"><para>the object which received the signal.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>tag</para></entry>
<entry role="parameter_description"><para>the added tag.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><simpara>user_data</simpara></entry>
<entry role="parameter_description"><simpara>user data set when the signal handler was connected.</simpara></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><para>Flags: <link linkend="G-SIGNAL-RUN-LAST:CAPS">Run Last</link></para>
</refsect2><refsect2 id="GtkTextTagTable-tag-changed" role="signal"><title>The <literal>“tag-changed”</literal> signal</title>
<indexterm zone="GtkTextTagTable-tag-changed"><primary>GtkTextTagTable::tag-changed</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
user_function (<link linkend="GtkTextTagTable"><type>GtkTextTagTable</type></link> *texttagtable,
               <link linkend="GtkTextTag"><type>GtkTextTag</type></link>      *tag,
               <link linkend="gboolean"><type>gboolean</type></link>         size_changed,
               <link linkend="gpointer"><type>gpointer</type></link>         user_data)</programlisting>
<refsect3 id="GtkTextTagTable-tag-changed.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>texttagtable</para></entry>
<entry role="parameter_description"><para>the object which received the signal.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>tag</para></entry>
<entry role="parameter_description"><para>the changed tag.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>size_changed</para></entry>
<entry role="parameter_description"><para>whether the change affects the <link linkend="GtkTextView"><type>GtkTextView</type></link> layout.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><simpara>user_data</simpara></entry>
<entry role="parameter_description"><simpara>user data set when the signal handler was connected.</simpara></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><para>Flags: <link linkend="G-SIGNAL-RUN-LAST:CAPS">Run Last</link></para>
</refsect2><refsect2 id="GtkTextTagTable-tag-removed" role="signal"><title>The <literal>“tag-removed”</literal> signal</title>
<indexterm zone="GtkTextTagTable-tag-removed"><primary>GtkTextTagTable::tag-removed</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
user_function (<link linkend="GtkTextTagTable"><type>GtkTextTagTable</type></link> *texttagtable,
               <link linkend="GtkTextTag"><type>GtkTextTag</type></link>      *tag,
               <link linkend="gpointer"><type>gpointer</type></link>         user_data)</programlisting>
<refsect3 id="GtkTextTagTable-tag-removed.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>texttagtable</para></entry>
<entry role="parameter_description"><para>the object which received the signal.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>tag</para></entry>
<entry role="parameter_description"><para>the removed tag.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><simpara>user_data</simpara></entry>
<entry role="parameter_description"><simpara>user data set when the signal handler was connected.</simpara></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><para>Flags: <link linkend="G-SIGNAL-RUN-LAST:CAPS">Run Last</link></para>
</refsect2>
</refsect1>

</refentry>
