<?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="GtkTextMark">
<refmeta>
<refentrytitle role="top_of_page" id="GtkTextMark.top_of_page">GtkTextMark</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK4 Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>GtkTextMark</refname>
<refpurpose>A position in the buffer preserved across buffer modifications</refpurpose>
</refnamediv>

<refsect1 id="GtkTextMark.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="GtkTextMark"><returnvalue>GtkTextMark</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-text-mark-new">gtk_text_mark_new</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-mark-set-visible">gtk_text_mark_set_visible</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-mark-get-visible">gtk_text_mark_get_visible</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-mark-get-deleted">gtk_text_mark_get_deleted</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type">const <link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-text-mark-get-name">gtk_text_mark_get_name</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GtkTextBuffer"><returnvalue>GtkTextBuffer</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-text-mark-get-buffer">gtk_text_mark_get_buffer</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-mark-get-left-gravity">gtk_text_mark_get_left_gravity</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkTextMark.properties" role="properties">
<title role="properties.title">Properties</title>
<informaltable frame="none">
<tgroup cols="3">
<colspec colname="properties_type" colwidth="150px"/>
<colspec colname="properties_name" colwidth="300px"/>
<colspec colname="properties_flags" colwidth="200px"/>
<tbody>
<row><entry role="property_type"><link linkend="gboolean"><type>gboolean</type></link></entry><entry role="property_name"><link linkend="GtkTextMark--left-gravity">left-gravity</link></entry><entry role="property_flags">Read / Write / Construct&#160;Only</entry></row>
<row><entry role="property_type"><link linkend="gchar"><type>gchar</type></link>&#160;*</entry><entry role="property_name"><link linkend="GtkTextMark--name">name</link></entry><entry role="property_flags">Read / Write / Construct&#160;Only</entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkTextMark.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">struct</entry><entry role="function_name"><link linkend="GtkTextMark-struct">GtkTextMark</link></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkTextMark.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> GtkTextMark
</screen>
</refsect1>

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

<refsect1 id="GtkTextMark.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>
<para>A <link linkend="GtkTextMark"><type>GtkTextMark</type></link> is like a bookmark in a text buffer; it preserves a position in
the text. You can convert the mark to an iterator using
<link linkend="gtk-text-buffer-get-iter-at-mark"><function>gtk_text_buffer_get_iter_at_mark()</function></link>. Unlike iterators, marks remain valid across
buffer mutations, because their behavior is defined when text is inserted or
deleted. When text containing a mark is deleted, the mark remains in the
position originally occupied by the deleted text. When text is inserted at a
mark, a mark with “left gravity” will be moved to the
beginning of the newly-inserted text, and a mark with “right
gravity” will be moved to the end.</para>
<para>Note that “left” and “right” here refer to logical direction (left
is the toward the start of the buffer); in some languages such as
Hebrew the logically-leftmost text is not actually on the left when
displayed.</para>
<para>Marks are reference counted, but the reference count only controls the validity
of the memory; marks can be deleted from the buffer at any time with
<link linkend="gtk-text-buffer-delete-mark"><function>gtk_text_buffer_delete_mark()</function></link>. Once deleted from the buffer, a mark is
essentially useless.</para>
<para>Marks optionally have names; these can be convenient to avoid passing the
<link linkend="GtkTextMark"><type>GtkTextMark</type></link> object around.</para>
<para>Marks are typically created using the <link linkend="gtk-text-buffer-create-mark"><function>gtk_text_buffer_create_mark()</function></link> function.</para>

</refsect1>
<refsect1 id="GtkTextMark.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="gtk-text-mark-new" role="function">
<title>gtk_text_mark_new&#160;()</title>
<indexterm zone="gtk-text-mark-new"><primary>gtk_text_mark_new</primary></indexterm>
<programlisting language="C"><link linkend="GtkTextMark"><returnvalue>GtkTextMark</returnvalue></link>&#160;*
gtk_text_mark_new (<parameter>const <link linkend="gchar"><type>gchar</type></link> *name</parameter>,
                   <parameter><link linkend="gboolean"><type>gboolean</type></link> left_gravity</parameter>);</programlisting>
<para>Creates a text mark. Add it to a buffer using <link linkend="gtk-text-buffer-add-mark"><function>gtk_text_buffer_add_mark()</function></link>.
If <parameter>name</parameter>
 is <link linkend="NULL:CAPS"><literal>NULL</literal></link>, the mark is anonymous; otherwise, the mark can be 
retrieved by name using <link linkend="gtk-text-buffer-get-mark"><function>gtk_text_buffer_get_mark()</function></link>. If a mark has left 
gravity, and text is inserted at the mark’s current location, the mark 
will be moved to the left of the newly-inserted text. If the mark has 
right gravity (<parameter>left_gravity</parameter>
 = <link linkend="FALSE:CAPS"><literal>FALSE</literal></link>), the mark will end up on the 
right of newly-inserted text. The standard left-to-right cursor is a 
mark with right gravity (when you type, the cursor stays on the right
side of the text you’re typing).</para>
<refsect3 id="gtk-text-mark-new.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>name</para></entry>
<entry role="parameter_description"><para>mark name or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>allow-none</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>left_gravity</para></entry>
<entry role="parameter_description"><para>whether the mark should have left gravity</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-text-mark-new.returns" role="returns">
<title>Returns</title>
<para> new <link linkend="GtkTextMark"><type>GtkTextMark</type></link></para>
</refsect3></refsect2>
<refsect2 id="gtk-text-mark-set-visible" role="function">
<title>gtk_text_mark_set_visible&#160;()</title>
<indexterm zone="gtk-text-mark-set-visible"><primary>gtk_text_mark_set_visible</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_text_mark_set_visible (<parameter><link linkend="GtkTextMark"><type>GtkTextMark</type></link> *mark</parameter>,
                           <parameter><link linkend="gboolean"><type>gboolean</type></link> setting</parameter>);</programlisting>
<para>Sets the visibility of <parameter>mark</parameter>
; the insertion point is normally
visible, i.e. you can see it as a vertical bar. Also, the text
widget uses a visible mark to indicate where a drop will occur when
dragging-and-dropping text. Most other marks are not visible.
Marks are not visible by default.</para>
<refsect3 id="gtk-text-mark-set-visible.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>mark</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkTextMark"><type>GtkTextMark</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>setting</para></entry>
<entry role="parameter_description"><para>visibility of mark</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-text-mark-get-visible" role="function">
<title>gtk_text_mark_get_visible&#160;()</title>
<indexterm zone="gtk-text-mark-get-visible"><primary>gtk_text_mark_get_visible</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
gtk_text_mark_get_visible (<parameter><link linkend="GtkTextMark"><type>GtkTextMark</type></link> *mark</parameter>);</programlisting>
<para>Returns <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the mark is visible (i.e. a cursor is displayed
for it).</para>
<refsect3 id="gtk-text-mark-get-visible.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>mark</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkTextMark"><type>GtkTextMark</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-text-mark-get-visible.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if visible</para>
</refsect3></refsect2>
<refsect2 id="gtk-text-mark-get-deleted" role="function">
<title>gtk_text_mark_get_deleted&#160;()</title>
<indexterm zone="gtk-text-mark-get-deleted"><primary>gtk_text_mark_get_deleted</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
gtk_text_mark_get_deleted (<parameter><link linkend="GtkTextMark"><type>GtkTextMark</type></link> *mark</parameter>);</programlisting>
<para>Returns <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the mark has been removed from its buffer
with <link linkend="gtk-text-buffer-delete-mark"><function>gtk_text_buffer_delete_mark()</function></link>. See <link linkend="gtk-text-buffer-add-mark"><function>gtk_text_buffer_add_mark()</function></link>
for a way to add it to a buffer again.</para>
<refsect3 id="gtk-text-mark-get-deleted.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>mark</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkTextMark"><type>GtkTextMark</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-text-mark-get-deleted.returns" role="returns">
<title>Returns</title>
<para> whether the mark is deleted</para>
</refsect3></refsect2>
<refsect2 id="gtk-text-mark-get-name" role="function">
<title>gtk_text_mark_get_name&#160;()</title>
<indexterm zone="gtk-text-mark-get-name"><primary>gtk_text_mark_get_name</primary></indexterm>
<programlisting language="C">const <link linkend="gchar"><returnvalue>gchar</returnvalue></link>&#160;*
gtk_text_mark_get_name (<parameter><link linkend="GtkTextMark"><type>GtkTextMark</type></link> *mark</parameter>);</programlisting>
<para>Returns the mark name; returns NULL for anonymous marks.</para>
<refsect3 id="gtk-text-mark-get-name.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>mark</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkTextMark"><type>GtkTextMark</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-text-mark-get-name.returns" role="returns">
<title>Returns</title>
<para>mark name. </para>
<para><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gtk-text-mark-get-buffer" role="function">
<title>gtk_text_mark_get_buffer&#160;()</title>
<indexterm zone="gtk-text-mark-get-buffer"><primary>gtk_text_mark_get_buffer</primary></indexterm>
<programlisting language="C"><link linkend="GtkTextBuffer"><returnvalue>GtkTextBuffer</returnvalue></link>&#160;*
gtk_text_mark_get_buffer (<parameter><link linkend="GtkTextMark"><type>GtkTextMark</type></link> *mark</parameter>);</programlisting>
<para>Gets the buffer this mark is located inside,
or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if the mark is deleted.</para>
<refsect3 id="gtk-text-mark-get-buffer.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>mark</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkTextMark"><type>GtkTextMark</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-text-mark-get-buffer.returns" role="returns">
<title>Returns</title>
<para>the mark’s <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>. </para>
<para><emphasis role="annotation">[<acronym>transfer none</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gtk-text-mark-get-left-gravity" role="function">
<title>gtk_text_mark_get_left_gravity&#160;()</title>
<indexterm zone="gtk-text-mark-get-left-gravity"><primary>gtk_text_mark_get_left_gravity</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
gtk_text_mark_get_left_gravity (<parameter><link linkend="GtkTextMark"><type>GtkTextMark</type></link> *mark</parameter>);</programlisting>
<para>Determines whether the mark has left gravity.</para>
<refsect3 id="gtk-text-mark-get-left-gravity.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>mark</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkTextMark"><type>GtkTextMark</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-text-mark-get-left-gravity.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the mark has left gravity, <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> otherwise</para>
</refsect3></refsect2>

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

</refsect1>
<refsect1 id="GtkTextMark.property-details" role="property_details">
<title role="property_details.title">Property Details</title>
<refsect2 id="GtkTextMark--left-gravity" role="property"><title>The <literal>“left-gravity”</literal> property</title>
<indexterm zone="GtkTextMark--left-gravity"><primary>GtkTextMark:left-gravity</primary></indexterm>
<programlisting>  “left-gravity”             <link linkend="gboolean"><type>gboolean</type></link></programlisting>
<para>Whether the mark has left gravity. When text is inserted at the mark’s
current location, if the mark has left gravity it will be moved
to the left of the newly-inserted text, otherwise to the right.</para>
<para>Owner: GtkTextMark</para>
<para>Flags: Read / Write / Construct&#160;Only</para>
<para>Default value: FALSE</para>
</refsect2>
<refsect2 id="GtkTextMark--name" role="property"><title>The <literal>“name”</literal> property</title>
<indexterm zone="GtkTextMark--name"><primary>GtkTextMark:name</primary></indexterm>
<programlisting>  “name”                     <link linkend="gchar"><type>gchar</type></link>&#160;*</programlisting>
<para>The name of the mark or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if the mark is anonymous.</para>
<para>Owner: GtkTextMark</para>
<para>Flags: Read / Write / Construct&#160;Only</para>
<para>Default value: NULL</para>
</refsect2>

</refsect1>

</refentry>
