<?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 index-Objects-Grouped SYSTEM "objects_grouped.sgml"-->
<refentry id="GtkTextBuffer">
<refmeta>
<refentrytitle role="top_of_page" id="GtkTextBuffer.top_of_page">GtkTextBuffer</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>GtkTextBuffer</refname>
<refpurpose>Stores attributed text for display in a GtkTextView</refpurpose>
</refnamediv>

<refsynopsisdiv id="GtkTextBuffer.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>

#include &lt;gtk/gtk.h&gt;

                    <link linkend="GtkTextBuffer-struct">GtkTextBuffer</link>;
<link linkend="GtkTextBuffer">GtkTextBuffer</link> *     <link linkend="gtk-text-buffer-new">gtk_text_buffer_new</link>                 (<link linkend="GtkTextTagTable">GtkTextTagTable</link> *table);
<link linkend="gint">gint</link>                <link linkend="gtk-text-buffer-get-line-count">gtk_text_buffer_get_line_count</link>      (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer);
<link linkend="gint">gint</link>                <link linkend="gtk-text-buffer-get-char-count">gtk_text_buffer_get_char_count</link>      (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer);
<link linkend="GtkTextTagTable">GtkTextTagTable</link>*    <link linkend="gtk-text-buffer-get-tag-table">gtk_text_buffer_get_tag_table</link>       (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer);
<link linkend="void">void</link>                <link linkend="gtk-text-buffer-insert">gtk_text_buffer_insert</link>              (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                                         const <link linkend="gchar">gchar</link> *text,
                                                         <link linkend="gint">gint</link> len);
<link linkend="void">void</link>                <link linkend="gtk-text-buffer-insert-at-cursor">gtk_text_buffer_insert_at_cursor</link>    (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         const <link linkend="gchar">gchar</link> *text,
                                                         <link linkend="gint">gint</link> len);
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-text-buffer-insert-interactive">gtk_text_buffer_insert_interactive</link>  (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                                         const <link linkend="gchar">gchar</link> *text,
                                                         <link linkend="gint">gint</link> len,
                                                         <link linkend="gboolean">gboolean</link> default_editable);
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-text-buffer-insert-interactive-at-cursor">gtk_text_buffer_insert_interactive_at_cursor</link>
                                                        (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         const <link linkend="gchar">gchar</link> *text,
                                                         <link linkend="gint">gint</link> len,
                                                         <link linkend="gboolean">gboolean</link> default_editable);
<link linkend="void">void</link>                <link linkend="gtk-text-buffer-insert-range">gtk_text_buffer_insert_range</link>        (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *start,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *end);
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-text-buffer-insert-range-interactive">gtk_text_buffer_insert_range_interactive</link>
                                                        (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *start,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *end,
                                                         <link linkend="gboolean">gboolean</link> default_editable);
<link linkend="void">void</link>                <link linkend="gtk-text-buffer-insert-with-tags">gtk_text_buffer_insert_with_tags</link>    (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                                         const <link linkend="gchar">gchar</link> *text,
                                                         <link linkend="gint">gint</link> len,
                                                         <link linkend="GtkTextTag">GtkTextTag</link> *first_tag,
                                                         ...);
<link linkend="void">void</link>                <link linkend="gtk-text-buffer-insert-with-tags-by-name">gtk_text_buffer_insert_with_tags_by_name</link>
                                                        (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                                         const <link linkend="gchar">gchar</link> *text,
                                                         <link linkend="gint">gint</link> len,
                                                         const <link linkend="gchar">gchar</link> *first_tag_name,
                                                         ...);
<link linkend="void">void</link>                <link linkend="gtk-text-buffer-delete">gtk_text_buffer_delete</link>              (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *start,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *end);
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-text-buffer-delete-interactive">gtk_text_buffer_delete_interactive</link>  (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *start_iter,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *end_iter,
                                                         <link linkend="gboolean">gboolean</link> default_editable);
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-text-buffer-backspace">gtk_text_buffer_backspace</link>           (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                                         <link linkend="gboolean">gboolean</link> interactive,
                                                         <link linkend="gboolean">gboolean</link> default_editable);
<link linkend="void">void</link>                <link linkend="gtk-text-buffer-set-text">gtk_text_buffer_set_text</link>            (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         const <link linkend="gchar">gchar</link> *text,
                                                         <link linkend="gint">gint</link> len);
<link linkend="gchar">gchar</link> *             <link linkend="gtk-text-buffer-get-text">gtk_text_buffer_get_text</link>            (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *start,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *end,
                                                         <link linkend="gboolean">gboolean</link> include_hidden_chars);
<link linkend="gchar">gchar</link> *             <link linkend="gtk-text-buffer-get-slice">gtk_text_buffer_get_slice</link>           (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *start,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *end,
                                                         <link linkend="gboolean">gboolean</link> include_hidden_chars);
<link linkend="void">void</link>                <link linkend="gtk-text-buffer-insert-pixbuf">gtk_text_buffer_insert_pixbuf</link>       (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                                         <link linkend="GdkPixbuf">GdkPixbuf</link> *pixbuf);
<link linkend="void">void</link>                <link linkend="gtk-text-buffer-insert-child-anchor">gtk_text_buffer_insert_child_anchor</link> (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                                         <link linkend="GtkTextChildAnchor">GtkTextChildAnchor</link> *anchor);
<link linkend="GtkTextChildAnchor">GtkTextChildAnchor</link> * <link linkend="gtk-text-buffer-create-child-anchor">gtk_text_buffer_create_child_anchor</link>
                                                        (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *iter);
<link linkend="GtkTextMark">GtkTextMark</link> *       <link linkend="gtk-text-buffer-create-mark">gtk_text_buffer_create_mark</link>         (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         const <link linkend="gchar">gchar</link> *mark_name,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *where,
                                                         <link linkend="gboolean">gboolean</link> left_gravity);
<link linkend="void">void</link>                <link linkend="gtk-text-buffer-move-mark">gtk_text_buffer_move_mark</link>           (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkTextMark">GtkTextMark</link> *mark,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *where);
<link linkend="void">void</link>                <link linkend="gtk-text-buffer-move-mark-by-name">gtk_text_buffer_move_mark_by_name</link>   (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         const <link linkend="gchar">gchar</link> *name,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *where);
<link linkend="void">void</link>                <link linkend="gtk-text-buffer-add-mark">gtk_text_buffer_add_mark</link>            (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkTextMark">GtkTextMark</link> *mark,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *where);
<link linkend="void">void</link>                <link linkend="gtk-text-buffer-delete-mark">gtk_text_buffer_delete_mark</link>         (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkTextMark">GtkTextMark</link> *mark);
<link linkend="void">void</link>                <link linkend="gtk-text-buffer-delete-mark-by-name">gtk_text_buffer_delete_mark_by_name</link> (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         const <link linkend="gchar">gchar</link> *name);
<link linkend="GtkTextMark">GtkTextMark</link>*        <link linkend="gtk-text-buffer-get-mark">gtk_text_buffer_get_mark</link>            (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         const <link linkend="gchar">gchar</link> *name);
<link linkend="GtkTextMark">GtkTextMark</link>*        <link linkend="gtk-text-buffer-get-insert">gtk_text_buffer_get_insert</link>          (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer);
<link linkend="GtkTextMark">GtkTextMark</link>*        <link linkend="gtk-text-buffer-get-selection-bound">gtk_text_buffer_get_selection_bound</link> (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer);
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-text-buffer-get-has-selection">gtk_text_buffer_get_has_selection</link>   (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer);
<link linkend="void">void</link>                <link linkend="gtk-text-buffer-place-cursor">gtk_text_buffer_place_cursor</link>        (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *where);
<link linkend="void">void</link>                <link linkend="gtk-text-buffer-select-range">gtk_text_buffer_select_range</link>        (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *ins,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *bound);
<link linkend="void">void</link>                <link linkend="gtk-text-buffer-apply-tag">gtk_text_buffer_apply_tag</link>           (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkTextTag">GtkTextTag</link> *tag,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *start,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *end);
<link linkend="void">void</link>                <link linkend="gtk-text-buffer-remove-tag">gtk_text_buffer_remove_tag</link>          (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkTextTag">GtkTextTag</link> *tag,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *start,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *end);
<link linkend="void">void</link>                <link linkend="gtk-text-buffer-apply-tag-by-name">gtk_text_buffer_apply_tag_by_name</link>   (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         const <link linkend="gchar">gchar</link> *name,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *start,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *end);
<link linkend="void">void</link>                <link linkend="gtk-text-buffer-remove-tag-by-name">gtk_text_buffer_remove_tag_by_name</link>  (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         const <link linkend="gchar">gchar</link> *name,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *start,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *end);
<link linkend="void">void</link>                <link linkend="gtk-text-buffer-remove-all-tags">gtk_text_buffer_remove_all_tags</link>     (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *start,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *end);
<link linkend="GtkTextTag">GtkTextTag</link> *        <link linkend="gtk-text-buffer-create-tag">gtk_text_buffer_create_tag</link>          (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         const <link linkend="gchar">gchar</link> *tag_name,
                                                         const <link linkend="gchar">gchar</link> *first_property_name,
                                                         ...);
<link linkend="void">void</link>                <link linkend="gtk-text-buffer-get-iter-at-line-offset">gtk_text_buffer_get_iter_at_line_offset</link>
                                                        (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                                         <link linkend="gint">gint</link> line_number,
                                                         <link linkend="gint">gint</link> char_offset);
<link linkend="void">void</link>                <link linkend="gtk-text-buffer-get-iter-at-offset">gtk_text_buffer_get_iter_at_offset</link>  (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                                         <link linkend="gint">gint</link> char_offset);
<link linkend="void">void</link>                <link linkend="gtk-text-buffer-get-iter-at-line">gtk_text_buffer_get_iter_at_line</link>    (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                                         <link linkend="gint">gint</link> line_number);
<link linkend="void">void</link>                <link linkend="gtk-text-buffer-get-iter-at-line-index">gtk_text_buffer_get_iter_at_line_index</link>
                                                        (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                                         <link linkend="gint">gint</link> line_number,
                                                         <link linkend="gint">gint</link> byte_index);
<link linkend="void">void</link>                <link linkend="gtk-text-buffer-get-iter-at-mark">gtk_text_buffer_get_iter_at_mark</link>    (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                                         <link linkend="GtkTextMark">GtkTextMark</link> *mark);
<link linkend="void">void</link>                <link linkend="gtk-text-buffer-get-iter-at-child-anchor">gtk_text_buffer_get_iter_at_child_anchor</link>
                                                        (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                                         <link linkend="GtkTextChildAnchor">GtkTextChildAnchor</link> *anchor);
<link linkend="void">void</link>                <link linkend="gtk-text-buffer-get-start-iter">gtk_text_buffer_get_start_iter</link>      (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *iter);
<link linkend="void">void</link>                <link linkend="gtk-text-buffer-get-end-iter">gtk_text_buffer_get_end_iter</link>        (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *iter);
<link linkend="void">void</link>                <link linkend="gtk-text-buffer-get-bounds">gtk_text_buffer_get_bounds</link>          (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *start,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *end);
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-text-buffer-get-modified">gtk_text_buffer_get_modified</link>        (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer);
<link linkend="void">void</link>                <link linkend="gtk-text-buffer-set-modified">gtk_text_buffer_set_modified</link>        (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="gboolean">gboolean</link> setting);
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-text-buffer-delete-selection">gtk_text_buffer_delete_selection</link>    (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="gboolean">gboolean</link> interactive,
                                                         <link linkend="gboolean">gboolean</link> default_editable);
<link linkend="void">void</link>                <link linkend="gtk-text-buffer-paste-clipboard">gtk_text_buffer_paste_clipboard</link>     (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkClipboard">GtkClipboard</link> *clipboard,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *override_location,
                                                         <link linkend="gboolean">gboolean</link> default_editable);
<link linkend="void">void</link>                <link linkend="gtk-text-buffer-copy-clipboard">gtk_text_buffer_copy_clipboard</link>      (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkClipboard">GtkClipboard</link> *clipboard);
<link linkend="void">void</link>                <link linkend="gtk-text-buffer-cut-clipboard">gtk_text_buffer_cut_clipboard</link>       (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkClipboard">GtkClipboard</link> *clipboard,
                                                         <link linkend="gboolean">gboolean</link> default_editable);
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-text-buffer-get-selection-bounds">gtk_text_buffer_get_selection_bounds</link>
                                                        (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *start,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *end);
<link linkend="void">void</link>                <link linkend="gtk-text-buffer-begin-user-action">gtk_text_buffer_begin_user_action</link>   (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer);
<link linkend="void">void</link>                <link linkend="gtk-text-buffer-end-user-action">gtk_text_buffer_end_user_action</link>     (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer);
<link linkend="void">void</link>                <link linkend="gtk-text-buffer-add-selection-clipboard">gtk_text_buffer_add_selection_clipboard</link>
                                                        (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkClipboard">GtkClipboard</link> *clipboard);
<link linkend="void">void</link>                <link linkend="gtk-text-buffer-remove-selection-clipboard">gtk_text_buffer_remove_selection_clipboard</link>
                                                        (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkClipboard">GtkClipboard</link> *clipboard);

enum                <link linkend="GtkTextBufferTargetInfo">GtkTextBufferTargetInfo</link>;
<link linkend="gboolean">gboolean</link>            (<link linkend="GtkTextBufferDeserializeFunc">*GtkTextBufferDeserializeFunc</link>)     (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *register_buffer,
                                                         <link linkend="GtkTextBuffer">GtkTextBuffer</link> *content_buffer,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                                         const <link linkend="guint8">guint8</link> *data,
                                                         <link linkend="gsize">gsize</link> length,
                                                         <link linkend="gboolean">gboolean</link> create_tags,
                                                         <link linkend="gpointer">gpointer</link> user_data,
                                                         <link linkend="GError">GError</link> **error);
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-text-buffer-deserialize">gtk_text_buffer_deserialize</link>         (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *register_buffer,
                                                         <link linkend="GtkTextBuffer">GtkTextBuffer</link> *content_buffer,
                                                         <link linkend="GdkAtom">GdkAtom</link> format,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                                         const <link linkend="guint8">guint8</link> *data,
                                                         <link linkend="gsize">gsize</link> length,
                                                         <link linkend="GError">GError</link> **error);
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-text-buffer-deserialize-get-can-create-tags">gtk_text_buffer_deserialize_get_can_create_tags</link>
                                                        (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GdkAtom">GdkAtom</link> format);
<link linkend="void">void</link>                <link linkend="gtk-text-buffer-deserialize-set-can-create-tags">gtk_text_buffer_deserialize_set_can_create_tags</link>
                                                        (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GdkAtom">GdkAtom</link> format,
                                                         <link linkend="gboolean">gboolean</link> can_create_tags);
<link linkend="GtkTargetList">GtkTargetList</link> *     <link linkend="gtk-text-buffer-get-copy-target-list">gtk_text_buffer_get_copy_target_list</link>
                                                        (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer);
<link linkend="GdkAtom">GdkAtom</link> *           <link linkend="gtk-text-buffer-get-deserialize-formats">gtk_text_buffer_get_deserialize_formats</link>
                                                        (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="gint">gint</link> *n_formats);
<link linkend="GtkTargetList">GtkTargetList</link> *     <link linkend="gtk-text-buffer-get-paste-target-list">gtk_text_buffer_get_paste_target_list</link>
                                                        (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer);
<link linkend="GdkAtom">GdkAtom</link> *           <link linkend="gtk-text-buffer-get-serialize-formats">gtk_text_buffer_get_serialize_formats</link>
                                                        (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="gint">gint</link> *n_formats);
<link linkend="GdkAtom">GdkAtom</link>             <link linkend="gtk-text-buffer-register-deserialize-format">gtk_text_buffer_register_deserialize_format</link>
                                                        (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         const <link linkend="gchar">gchar</link> *mime_type,
                                                         <link linkend="GtkTextBufferDeserializeFunc">GtkTextBufferDeserializeFunc</link> function,
                                                         <link linkend="gpointer">gpointer</link> user_data,
                                                         <link linkend="GDestroyNotify">GDestroyNotify</link> user_data_destroy);
<link linkend="GdkAtom">GdkAtom</link>             <link linkend="gtk-text-buffer-register-deserialize-tagset">gtk_text_buffer_register_deserialize_tagset</link>
                                                        (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         const <link linkend="gchar">gchar</link> *tagset_name);
<link linkend="GdkAtom">GdkAtom</link>             <link linkend="gtk-text-buffer-register-serialize-format">gtk_text_buffer_register_serialize_format</link>
                                                        (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         const <link linkend="gchar">gchar</link> *mime_type,
                                                         <link linkend="GtkTextBufferSerializeFunc">GtkTextBufferSerializeFunc</link> function,
                                                         <link linkend="gpointer">gpointer</link> user_data,
                                                         <link linkend="GDestroyNotify">GDestroyNotify</link> user_data_destroy);
<link linkend="GdkAtom">GdkAtom</link>             <link linkend="gtk-text-buffer-register-serialize-tagset">gtk_text_buffer_register_serialize_tagset</link>
                                                        (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         const <link linkend="gchar">gchar</link> *tagset_name);
<link linkend="guint8">guint8</link> *            (<link linkend="GtkTextBufferSerializeFunc">*GtkTextBufferSerializeFunc</link>)       (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *register_buffer,
                                                         <link linkend="GtkTextBuffer">GtkTextBuffer</link> *content_buffer,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *start,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *end,
                                                         <link linkend="gsize">gsize</link> *length,
                                                         <link linkend="gpointer">gpointer</link> user_data);
<link linkend="guint8">guint8</link> *            <link linkend="gtk-text-buffer-serialize">gtk_text_buffer_serialize</link>           (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *register_buffer,
                                                         <link linkend="GtkTextBuffer">GtkTextBuffer</link> *content_buffer,
                                                         <link linkend="GdkAtom">GdkAtom</link> format,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *start,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *end,
                                                         <link linkend="gsize">gsize</link> *length);
<link linkend="void">void</link>                <link linkend="gtk-text-buffer-unregister-deserialize-format">gtk_text_buffer_unregister_deserialize_format</link>
                                                        (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GdkAtom">GdkAtom</link> format);
<link linkend="void">void</link>                <link linkend="gtk-text-buffer-unregister-serialize-format">gtk_text_buffer_unregister_serialize_format</link>
                                                        (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GdkAtom">GdkAtom</link> format);
</synopsis>
</refsynopsisdiv>

<refsect1 id="GtkTextBuffer.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<synopsis>
  <link linkend="GObject">GObject</link>
   +----GtkTextBuffer
</synopsis>
</refsect1>





<refsect1 id="GtkTextBuffer.properties" role="properties">
<title role="properties.title">Properties</title>
<synopsis>
  &quot;<link linkend="GtkTextBuffer--copy-target-list">copy-target-list</link>&quot;         <link linkend="GtkTargetList">GtkTargetList</link>*        : Read
  &quot;<link linkend="GtkTextBuffer--cursor-position">cursor-position</link>&quot;          <link linkend="gint">gint</link>                  : Read
  &quot;<link linkend="GtkTextBuffer--has-selection">has-selection</link>&quot;            <link linkend="gboolean">gboolean</link>              : Read
  &quot;<link linkend="GtkTextBuffer--paste-target-list">paste-target-list</link>&quot;        <link linkend="GtkTargetList">GtkTargetList</link>*        : Read
  &quot;<link linkend="GtkTextBuffer--tag-table">tag-table</link>&quot;                <link linkend="GtkTextTagTable">GtkTextTagTable</link>*      : Read / Write / Construct Only
  &quot;<link linkend="GtkTextBuffer--text">text</link>&quot;                     <link linkend="gchar">gchar</link>*                : Read / Write
</synopsis>
</refsect1>

<refsect1 id="GtkTextBuffer.signals" role="signal_proto">
<title role="signal_proto.title">Signals</title>
<synopsis>
  &quot;<link linkend="GtkTextBuffer-apply-tag">apply-tag</link>&quot;                                      : Run Last
  &quot;<link linkend="GtkTextBuffer-begin-user-action">begin-user-action</link>&quot;                              : Run Last
  &quot;<link linkend="GtkTextBuffer-changed">changed</link>&quot;                                        : Run Last
  &quot;<link linkend="GtkTextBuffer-delete-range">delete-range</link>&quot;                                   : Run Last
  &quot;<link linkend="GtkTextBuffer-end-user-action">end-user-action</link>&quot;                                : Run Last
  &quot;<link linkend="GtkTextBuffer-insert-child-anchor">insert-child-anchor</link>&quot;                            : Run Last
  &quot;<link linkend="GtkTextBuffer-insert-pixbuf">insert-pixbuf</link>&quot;                                  : Run Last
  &quot;<link linkend="GtkTextBuffer-insert-text">insert-text</link>&quot;                                    : Run Last
  &quot;<link linkend="GtkTextBuffer-mark-deleted">mark-deleted</link>&quot;                                   : Run Last
  &quot;<link linkend="GtkTextBuffer-mark-set">mark-set</link>&quot;                                       : Run Last
  &quot;<link linkend="GtkTextBuffer-modified-changed">modified-changed</link>&quot;                               : Run Last
  &quot;<link linkend="GtkTextBuffer-paste-done">paste-done</link>&quot;                                     : Run Last
  &quot;<link linkend="GtkTextBuffer-remove-tag">remove-tag</link>&quot;                                     : Run Last
</synopsis>
</refsect1>


<refsect1 id="GtkTextBuffer.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>
</para>
</refsect1>

<refsect1 id="GtkTextBuffer.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="GtkTextBuffer-struct" role="struct">
<title>GtkTextBuffer</title>
<indexterm zone="GtkTextBuffer-struct"><primary sortas="TextBuffer">GtkTextBuffer</primary></indexterm><programlisting>typedef struct _GtkTextBuffer GtkTextBuffer;</programlisting>
<para>
</para></refsect2>
<refsect2 id="gtk-text-buffer-new" role="function">
<title>gtk_text_buffer_new ()</title>
<indexterm zone="gtk-text-buffer-new"><primary sortas="text_buffer_new">gtk_text_buffer_new</primary></indexterm><programlisting><link linkend="GtkTextBuffer">GtkTextBuffer</link> *     gtk_text_buffer_new                 (<link linkend="GtkTextTagTable">GtkTextTagTable</link> *table);</programlisting>
<para>
Creates a new text buffer.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>table</parameter>&#160;:</term>
<listitem><simpara> a tag table, or <link linkend="NULL--CAPS"><literal>NULL</literal></link> to create a new one
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a new text buffer
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-text-buffer-get-line-count" role="function">
<title>gtk_text_buffer_get_line_count ()</title>
<indexterm zone="gtk-text-buffer-get-line-count"><primary sortas="text_buffer_get_line_count">gtk_text_buffer_get_line_count</primary></indexterm><programlisting><link linkend="gint">gint</link>                gtk_text_buffer_get_line_count      (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer);</programlisting>
<para>
Obtains the number of lines in the buffer. This value is cached, so
the function is very fast.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link> 
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> number of lines in the buffer
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-text-buffer-get-char-count" role="function">
<title>gtk_text_buffer_get_char_count ()</title>
<indexterm zone="gtk-text-buffer-get-char-count"><primary sortas="text_buffer_get_char_count">gtk_text_buffer_get_char_count</primary></indexterm><programlisting><link linkend="gint">gint</link>                gtk_text_buffer_get_char_count      (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer);</programlisting>
<para>
Gets the number of characters in the buffer; note that characters
and bytes are not the same, you can't e.g. expect the contents of
the buffer in string form to be this many bytes long. The character
count is cached, so this function is very fast.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link> 
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> number of characters in the buffer
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-text-buffer-get-tag-table" role="function">
<title>gtk_text_buffer_get_tag_table ()</title>
<indexterm zone="gtk-text-buffer-get-tag-table"><primary sortas="text_buffer_get_tag_table">gtk_text_buffer_get_tag_table</primary></indexterm><programlisting><link linkend="GtkTextTagTable">GtkTextTagTable</link>*    gtk_text_buffer_get_tag_table       (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer);</programlisting>
<para>
Get the <link linkend="GtkTextTagTable"><type>GtkTextTagTable</type></link> associated with this buffer.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the buffer's tag table
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-text-buffer-insert" role="function">
<title>gtk_text_buffer_insert ()</title>
<indexterm zone="gtk-text-buffer-insert"><primary sortas="text_buffer_insert">gtk_text_buffer_insert</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_text_buffer_insert              (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                                         const <link linkend="gchar">gchar</link> *text,
                                                         <link linkend="gint">gint</link> len);</programlisting>
<para>
Inserts <parameter>len</parameter> bytes of <parameter>text</parameter> at position <parameter>iter</parameter>.  If <parameter>len</parameter> is -1,
<parameter>text</parameter> must be nul-terminated and will be inserted in its
entirety. Emits the "insert-text" signal; insertion actually occurs
in the default handler for the signal. <parameter>iter</parameter> is invalidated when
insertion occurs (because the buffer contents change), but the
default signal handler revalidates it to point to the end of the
inserted text.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>iter</parameter>&#160;:</term>
<listitem><simpara> a position in the buffer
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>text</parameter>&#160;:</term>
<listitem><simpara> UTF-8 format text to insert
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>len</parameter>&#160;:</term>
<listitem><simpara> length of text in bytes, or -1
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-text-buffer-insert-at-cursor" role="function">
<title>gtk_text_buffer_insert_at_cursor ()</title>
<indexterm zone="gtk-text-buffer-insert-at-cursor"><primary sortas="text_buffer_insert_at_cursor">gtk_text_buffer_insert_at_cursor</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_text_buffer_insert_at_cursor    (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         const <link linkend="gchar">gchar</link> *text,
                                                         <link linkend="gint">gint</link> len);</programlisting>
<para>
Simply calls <link linkend="gtk-text-buffer-insert"><function>gtk_text_buffer_insert()</function></link>, using the current
cursor position as the insertion point.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>text</parameter>&#160;:</term>
<listitem><simpara> some text in UTF-8 format
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>len</parameter>&#160;:</term>
<listitem><simpara> length of text, in bytes
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-text-buffer-insert-interactive" role="function">
<title>gtk_text_buffer_insert_interactive ()</title>
<indexterm zone="gtk-text-buffer-insert-interactive"><primary sortas="text_buffer_insert_interactive">gtk_text_buffer_insert_interactive</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_text_buffer_insert_interactive  (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                                         const <link linkend="gchar">gchar</link> *text,
                                                         <link linkend="gint">gint</link> len,
                                                         <link linkend="gboolean">gboolean</link> default_editable);</programlisting>
<para>
Like <link linkend="gtk-text-buffer-insert"><function>gtk_text_buffer_insert()</function></link>, but the insertion will not occur if
<parameter>iter</parameter> is at a non-editable location in the buffer. Usually you
want to prevent insertions at ineditable locations if the insertion
results from a user action (is interactive).
</para>
<para>
<parameter>default_editable</parameter> indicates the editability of text that doesn't
have a tag affecting editability applied to it. Typically the
result of <link linkend="gtk-text-view-get-editable"><function>gtk_text_view_get_editable()</function></link> is appropriate here.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>iter</parameter>&#160;:</term>
<listitem><simpara> a position in <parameter>buffer</parameter>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>text</parameter>&#160;:</term>
<listitem><simpara> some UTF-8 text
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>len</parameter>&#160;:</term>
<listitem><simpara> length of text in bytes, or -1
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>default_editable</parameter>&#160;:</term>
<listitem><simpara> default editability of buffer
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> whether text was actually inserted
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-text-buffer-insert-interactive-at-cursor" role="function">
<title>gtk_text_buffer_insert_interactive_at_cursor ()</title>
<indexterm zone="gtk-text-buffer-insert-interactive-at-cursor"><primary sortas="text_buffer_insert_interactive_at_cursor">gtk_text_buffer_insert_interactive_at_cursor</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_text_buffer_insert_interactive_at_cursor
                                                        (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         const <link linkend="gchar">gchar</link> *text,
                                                         <link linkend="gint">gint</link> len,
                                                         <link linkend="gboolean">gboolean</link> default_editable);</programlisting>
<para>
Calls <link linkend="gtk-text-buffer-insert-interactive"><function>gtk_text_buffer_insert_interactive()</function></link> at the cursor
position.
</para>
<para>
<parameter>default_editable</parameter> indicates the editability of text that doesn't
have a tag affecting editability applied to it. Typically the
result of <link linkend="gtk-text-view-get-editable"><function>gtk_text_view_get_editable()</function></link> is appropriate here.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>text</parameter>&#160;:</term>
<listitem><simpara> text in UTF-8 format
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>len</parameter>&#160;:</term>
<listitem><simpara> length of text in bytes, or -1
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>default_editable</parameter>&#160;:</term>
<listitem><simpara> default editability of buffer
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> whether text was actually inserted
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-text-buffer-insert-range" role="function">
<title>gtk_text_buffer_insert_range ()</title>
<indexterm zone="gtk-text-buffer-insert-range"><primary sortas="text_buffer_insert_range">gtk_text_buffer_insert_range</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_text_buffer_insert_range        (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *start,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *end);</programlisting>
<para>
Copies text, tags, and pixbufs between <parameter>start</parameter> and <parameter>end</parameter> (the order
of <parameter>start</parameter> and <parameter>end</parameter> doesn't matter) and inserts the copy at <parameter>iter</parameter>.
Used instead of simply getting/inserting text because it preserves
images and tags. If <parameter>start</parameter> and <parameter>end</parameter> are in a different buffer from
<parameter>buffer</parameter>, the two buffers must share the same tag table.
</para>
<para>
Implemented via emissions of the insert_text and apply_tag signals,
so expect those.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>iter</parameter>&#160;:</term>
<listitem><simpara> a position in <parameter>buffer</parameter>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>start</parameter>&#160;:</term>
<listitem><simpara> a position in a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>end</parameter>&#160;:</term>
<listitem><simpara> another position in the same buffer as <parameter>start</parameter>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-text-buffer-insert-range-interactive" role="function">
<title>gtk_text_buffer_insert_range_interactive ()</title>
<indexterm zone="gtk-text-buffer-insert-range-interactive"><primary sortas="text_buffer_insert_range_interactive">gtk_text_buffer_insert_range_interactive</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_text_buffer_insert_range_interactive
                                                        (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *start,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *end,
                                                         <link linkend="gboolean">gboolean</link> default_editable);</programlisting>
<para>
Same as <link linkend="gtk-text-buffer-insert-range"><function>gtk_text_buffer_insert_range()</function></link>, but does nothing if the
insertion point isn't editable. The <parameter>default_editable</parameter> parameter
indicates whether the text is editable at <parameter>iter</parameter> if no tags
enclosing <parameter>iter</parameter> affect editability. Typically the result of
<link linkend="gtk-text-view-get-editable"><function>gtk_text_view_get_editable()</function></link> is appropriate here.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>iter</parameter>&#160;:</term>
<listitem><simpara> a position in <parameter>buffer</parameter>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>start</parameter>&#160;:</term>
<listitem><simpara> a position in a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>end</parameter>&#160;:</term>
<listitem><simpara> another position in the same buffer as <parameter>start</parameter>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>default_editable</parameter>&#160;:</term>
<listitem><simpara> default editability of the buffer
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> whether an insertion was possible at <parameter>iter</parameter>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-text-buffer-insert-with-tags" role="function">
<title>gtk_text_buffer_insert_with_tags ()</title>
<indexterm zone="gtk-text-buffer-insert-with-tags"><primary sortas="text_buffer_insert_with_tags">gtk_text_buffer_insert_with_tags</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_text_buffer_insert_with_tags    (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                                         const <link linkend="gchar">gchar</link> *text,
                                                         <link linkend="gint">gint</link> len,
                                                         <link linkend="GtkTextTag">GtkTextTag</link> *first_tag,
                                                         ...);</programlisting>
<para>
Inserts <parameter>text</parameter> into <parameter>buffer</parameter> at <parameter>iter</parameter>, applying the list of tags to
the newly-inserted text. The last tag specified must be NULL to
terminate the list. Equivalent to calling <link linkend="gtk-text-buffer-insert"><function>gtk_text_buffer_insert()</function></link>,
then <link linkend="gtk-text-buffer-apply-tag"><function>gtk_text_buffer_apply_tag()</function></link> on the inserted text;
<link linkend="gtk-text-buffer-insert-with-tags"><function>gtk_text_buffer_insert_with_tags()</function></link> is just a convenience function.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>iter</parameter>&#160;:</term>
<listitem><simpara> an iterator in <parameter>buffer</parameter>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>text</parameter>&#160;:</term>
<listitem><simpara> UTF-8 text
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>len</parameter>&#160;:</term>
<listitem><simpara> length of <parameter>text</parameter>, or -1
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>first_tag</parameter>&#160;:</term>
<listitem><simpara> first tag to apply to <parameter>text</parameter>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>...</parameter>&#160;:</term>
<listitem><simpara> NULL-terminated list of tags to apply
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-text-buffer-insert-with-tags-by-name" role="function">
<title>gtk_text_buffer_insert_with_tags_by_name ()</title>
<indexterm zone="gtk-text-buffer-insert-with-tags-by-name"><primary sortas="text_buffer_insert_with_tags_by_name">gtk_text_buffer_insert_with_tags_by_name</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_text_buffer_insert_with_tags_by_name
                                                        (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                                         const <link linkend="gchar">gchar</link> *text,
                                                         <link linkend="gint">gint</link> len,
                                                         const <link linkend="gchar">gchar</link> *first_tag_name,
                                                         ...);</programlisting>
<para>
Same as <link linkend="gtk-text-buffer-insert-with-tags"><function>gtk_text_buffer_insert_with_tags()</function></link>, but allows you
to pass in tag names instead of tag objects.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>iter</parameter>&#160;:</term>
<listitem><simpara> position in <parameter>buffer</parameter>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>text</parameter>&#160;:</term>
<listitem><simpara> UTF-8 text
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>len</parameter>&#160;:</term>
<listitem><simpara> length of <parameter>text</parameter>, or -1
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>first_tag_name</parameter>&#160;:</term>
<listitem><simpara> name of a tag to apply to <parameter>text</parameter>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>...</parameter>&#160;:</term>
<listitem><simpara> more tag names
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-text-buffer-delete" role="function">
<title>gtk_text_buffer_delete ()</title>
<indexterm zone="gtk-text-buffer-delete"><primary sortas="text_buffer_delete">gtk_text_buffer_delete</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_text_buffer_delete              (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *start,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *end);</programlisting>
<para>
Deletes text between <parameter>start</parameter> and <parameter>end</parameter>. The order of <parameter>start</parameter> and <parameter>end</parameter>
is not actually relevant; <link linkend="gtk-text-buffer-delete"><function>gtk_text_buffer_delete()</function></link> will reorder
them. This function actually emits the "delete-range" signal, and
the default handler of that signal deletes the text. Because the
buffer is modified, all outstanding iterators become invalid after
calling this function; however, the <parameter>start</parameter> and <parameter>end</parameter> will be
re-initialized to point to the location where text was deleted.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>start</parameter>&#160;:</term>
<listitem><simpara> a position in <parameter>buffer</parameter>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>end</parameter>&#160;:</term>
<listitem><simpara> another position in <parameter>buffer</parameter>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-text-buffer-delete-interactive" role="function">
<title>gtk_text_buffer_delete_interactive ()</title>
<indexterm zone="gtk-text-buffer-delete-interactive"><primary sortas="text_buffer_delete_interactive">gtk_text_buffer_delete_interactive</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_text_buffer_delete_interactive  (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *start_iter,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *end_iter,
                                                         <link linkend="gboolean">gboolean</link> default_editable);</programlisting>
<para>
Deletes all <emphasis>editable</emphasis> text in the given range.
Calls <link linkend="gtk-text-buffer-delete"><function>gtk_text_buffer_delete()</function></link> for each editable sub-range of
[<parameter>start</parameter>,<parameter>end</parameter>). <parameter>start</parameter> and <parameter>end</parameter> are revalidated to point to
the location of the last deleted range, or left untouched if
no text was deleted.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>start_iter</parameter>&#160;:</term>
<listitem><simpara> start of range to delete
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>end_iter</parameter>&#160;:</term>
<listitem><simpara> end of range
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>default_editable</parameter>&#160;:</term>
<listitem><simpara> whether the buffer is editable by default
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> whether some text was actually deleted
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-text-buffer-backspace" role="function" condition="since:2.6">
<title>gtk_text_buffer_backspace ()</title>
<indexterm zone="gtk-text-buffer-backspace" role="2.6"><primary sortas="text_buffer_backspace">gtk_text_buffer_backspace</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_text_buffer_backspace           (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                                         <link linkend="gboolean">gboolean</link> interactive,
                                                         <link linkend="gboolean">gboolean</link> default_editable);</programlisting>
<para>
Performs the appropriate action as if the user hit the delete
key with the cursor at the position specified by <parameter>iter</parameter>. In the
normal case a single character will be deleted, but when
combining accents are involved, more than one character can
be deleted, and when precomposed character and accent combinations
are involved, less than one character will be deleted.
</para>
<para>
Because the buffer is modified, all outstanding iterators become 
invalid after calling this function; however, the <parameter>iter</parameter> will be
re-initialized to point to the location where text was deleted.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>iter</parameter>&#160;:</term>
<listitem><simpara> a position in <parameter>buffer</parameter>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>interactive</parameter>&#160;:</term>
<listitem><simpara> whether the deletion is caused by user interaction
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>default_editable</parameter>&#160;:</term>
<listitem><simpara> whether the buffer is editable by default
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the buffer was modified

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.6</para></refsect2>
<refsect2 id="gtk-text-buffer-set-text" role="function">
<title>gtk_text_buffer_set_text ()</title>
<indexterm zone="gtk-text-buffer-set-text"><primary sortas="text_buffer_set_text">gtk_text_buffer_set_text</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_text_buffer_set_text            (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         const <link linkend="gchar">gchar</link> *text,
                                                         <link linkend="gint">gint</link> len);</programlisting>
<para>
Deletes current contents of <parameter>buffer</parameter>, and inserts <parameter>text</parameter> instead. If
<parameter>len</parameter> is -1, <parameter>text</parameter> must be nul-terminated. <parameter>text</parameter> must be valid UTF-8.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>text</parameter>&#160;:</term>
<listitem><simpara> UTF-8 text to insert
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>len</parameter>&#160;:</term>
<listitem><simpara> length of <parameter>text</parameter> in bytes
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-text-buffer-get-text" role="function">
<title>gtk_text_buffer_get_text ()</title>
<indexterm zone="gtk-text-buffer-get-text"><primary sortas="text_buffer_get_text">gtk_text_buffer_get_text</primary></indexterm><programlisting><link linkend="gchar">gchar</link> *             gtk_text_buffer_get_text            (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *start,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *end,
                                                         <link linkend="gboolean">gboolean</link> include_hidden_chars);</programlisting>
<para>
Returns the text in the range [<parameter>start</parameter>,<parameter>end</parameter>). Excludes undisplayed
text (text marked with tags that set the invisibility attribute) if
<parameter>include_hidden_chars</parameter> is <link linkend="FALSE--CAPS"><literal>FALSE</literal></link>. Does not include characters
representing embedded images, so byte and character indexes into
the returned string do <emphasis>not</emphasis> correspond to byte
and character indexes into the buffer. Contrast with
<link linkend="gtk-text-buffer-get-slice"><function>gtk_text_buffer_get_slice()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>start</parameter>&#160;:</term>
<listitem><simpara> start of a range
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>end</parameter>&#160;:</term>
<listitem><simpara> end of a range
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>include_hidden_chars</parameter>&#160;:</term>
<listitem><simpara> whether to include invisible text
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> an allocated UTF-8 string
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-text-buffer-get-slice" role="function">
<title>gtk_text_buffer_get_slice ()</title>
<indexterm zone="gtk-text-buffer-get-slice"><primary sortas="text_buffer_get_slice">gtk_text_buffer_get_slice</primary></indexterm><programlisting><link linkend="gchar">gchar</link> *             gtk_text_buffer_get_slice           (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *start,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *end,
                                                         <link linkend="gboolean">gboolean</link> include_hidden_chars);</programlisting>
<para>
Returns the text in the range [<parameter>start</parameter>,<parameter>end</parameter>). Excludes undisplayed
text (text marked with tags that set the invisibility attribute) if
<parameter>include_hidden_chars</parameter> is <link linkend="FALSE--CAPS"><literal>FALSE</literal></link>. The returned string includes a
0xFFFC character whenever the buffer contains
embedded images, so byte and character indexes into
the returned string <emphasis>do</emphasis> correspond to byte
and character indexes into the buffer. Contrast with
<link linkend="gtk-text-buffer-get-text"><function>gtk_text_buffer_get_text()</function></link>. Note that 0xFFFC can occur in normal
text as well, so it is not a reliable indicator that a pixbuf or
widget is in the buffer.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>start</parameter>&#160;:</term>
<listitem><simpara> start of a range
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>end</parameter>&#160;:</term>
<listitem><simpara> end of a range
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>include_hidden_chars</parameter>&#160;:</term>
<listitem><simpara> whether to include invisible text
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> an allocated UTF-8 string
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-text-buffer-insert-pixbuf" role="function">
<title>gtk_text_buffer_insert_pixbuf ()</title>
<indexterm zone="gtk-text-buffer-insert-pixbuf"><primary sortas="text_buffer_insert_pixbuf">gtk_text_buffer_insert_pixbuf</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_text_buffer_insert_pixbuf       (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                                         <link linkend="GdkPixbuf">GdkPixbuf</link> *pixbuf);</programlisting>
<para>
Inserts an image into the text buffer at <parameter>iter</parameter>. The image will be
counted as one character in character counts, and when obtaining
the buffer contents as a string, will be represented by the Unicode
"object replacement character" 0xFFFC. Note that the "slice"
variants for obtaining portions of the buffer as a string include
this character for pixbufs, but the "text" variants do
not. e.g. see <link linkend="gtk-text-buffer-get-slice"><function>gtk_text_buffer_get_slice()</function></link> and
<link linkend="gtk-text-buffer-get-text"><function>gtk_text_buffer_get_text()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>iter</parameter>&#160;:</term>
<listitem><simpara> location to insert the pixbuf
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>pixbuf</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkPixbuf"><type>GdkPixbuf</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-text-buffer-insert-child-anchor" role="function">
<title>gtk_text_buffer_insert_child_anchor ()</title>
<indexterm zone="gtk-text-buffer-insert-child-anchor"><primary sortas="text_buffer_insert_child_anchor">gtk_text_buffer_insert_child_anchor</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_text_buffer_insert_child_anchor (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                                         <link linkend="GtkTextChildAnchor">GtkTextChildAnchor</link> *anchor);</programlisting>
<para>
Inserts a child widget anchor into the text buffer at <parameter>iter</parameter>. The
anchor will be counted as one character in character counts, and
when obtaining the buffer contents as a string, will be represented
by the Unicode "object replacement character" 0xFFFC. Note that the
"slice" variants for obtaining portions of the buffer as a string
include this character for child anchors, but the "text" variants do
not. E.g. see <link linkend="gtk-text-buffer-get-slice"><function>gtk_text_buffer_get_slice()</function></link> and
<link linkend="gtk-text-buffer-get-text"><function>gtk_text_buffer_get_text()</function></link>. Consider
<link linkend="gtk-text-buffer-create-child-anchor"><function>gtk_text_buffer_create_child_anchor()</function></link> as a more convenient
alternative to this function. The buffer will add a reference to
the anchor, so you can unref it after insertion.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>iter</parameter>&#160;:</term>
<listitem><simpara> location to insert the anchor
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>anchor</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextChildAnchor"><type>GtkTextChildAnchor</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-text-buffer-create-child-anchor" role="function">
<title>gtk_text_buffer_create_child_anchor ()</title>
<indexterm zone="gtk-text-buffer-create-child-anchor"><primary sortas="text_buffer_create_child_anchor">gtk_text_buffer_create_child_anchor</primary></indexterm><programlisting><link linkend="GtkTextChildAnchor">GtkTextChildAnchor</link> * gtk_text_buffer_create_child_anchor
                                                        (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *iter);</programlisting>
<para>
This is a convenience function which simply creates a child anchor
with <link linkend="gtk-text-child-anchor-new"><function>gtk_text_child_anchor_new()</function></link> and inserts it into the buffer
with <link linkend="gtk-text-buffer-insert-child-anchor"><function>gtk_text_buffer_insert_child_anchor()</function></link>. The new anchor is
owned by the buffer; no reference count is returned to
the caller of <link linkend="gtk-text-buffer-create-child-anchor"><function>gtk_text_buffer_create_child_anchor()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>iter</parameter>&#160;:</term>
<listitem><simpara> location in the buffer
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the created child anchor
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-text-buffer-create-mark" role="function">
<title>gtk_text_buffer_create_mark ()</title>
<indexterm zone="gtk-text-buffer-create-mark"><primary sortas="text_buffer_create_mark">gtk_text_buffer_create_mark</primary></indexterm><programlisting><link linkend="GtkTextMark">GtkTextMark</link> *       gtk_text_buffer_create_mark         (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         const <link linkend="gchar">gchar</link> *mark_name,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *where,
                                                         <link linkend="gboolean">gboolean</link> left_gravity);</programlisting>
<para>
Creates a mark at position <parameter>where</parameter>. If <parameter>mark_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>
<para>
The caller of this function does <emphasis>not</emphasis> own a 
reference to the returned <link linkend="GtkTextMark"><type>GtkTextMark</type></link>, so you can ignore the 
return value if you like. Marks are owned by the buffer and go 
away when the buffer does.
</para>
<para>
Emits the "mark-set" signal as notification of the mark's initial
placement.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>mark_name</parameter>&#160;:</term>
<listitem><simpara> name for mark, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>where</parameter>&#160;:</term>
<listitem><simpara> location to place mark
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>left_gravity</parameter>&#160;:</term>
<listitem><simpara> whether the mark has left gravity
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the new <link linkend="GtkTextMark"><type>GtkTextMark</type></link> object
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-text-buffer-move-mark" role="function">
<title>gtk_text_buffer_move_mark ()</title>
<indexterm zone="gtk-text-buffer-move-mark"><primary sortas="text_buffer_move_mark">gtk_text_buffer_move_mark</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_text_buffer_move_mark           (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkTextMark">GtkTextMark</link> *mark,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *where);</programlisting>
<para>
Moves <parameter>mark</parameter> to the new location <parameter>where</parameter>. Emits the "mark-set" signal
as notification of the move.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>mark</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextMark"><type>GtkTextMark</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>where</parameter>&#160;:</term>
<listitem><simpara> new location for <parameter>mark</parameter> in <parameter>buffer</parameter>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-text-buffer-move-mark-by-name" role="function">
<title>gtk_text_buffer_move_mark_by_name ()</title>
<indexterm zone="gtk-text-buffer-move-mark-by-name"><primary sortas="text_buffer_move_mark_by_name">gtk_text_buffer_move_mark_by_name</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_text_buffer_move_mark_by_name   (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         const <link linkend="gchar">gchar</link> *name,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *where);</programlisting>
<para>
Moves the mark named <parameter>name</parameter> (which must exist) to location <parameter>where</parameter>.
See <link linkend="gtk-text-buffer-move-mark"><function>gtk_text_buffer_move_mark()</function></link> for details.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>name</parameter>&#160;:</term>
<listitem><simpara> name of a mark
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>where</parameter>&#160;:</term>
<listitem><simpara> new location for mark
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-text-buffer-add-mark" role="function" condition="since:2.12">
<title>gtk_text_buffer_add_mark ()</title>
<indexterm zone="gtk-text-buffer-add-mark" role="2.12"><primary sortas="text_buffer_add_mark">gtk_text_buffer_add_mark</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_text_buffer_add_mark            (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkTextMark">GtkTextMark</link> *mark,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *where);</programlisting>
<para>
Adds the mark at position <parameter>where</parameter>. The mark must not be added to
another buffer, and if its name is not <link linkend="NULL--CAPS"><literal>NULL</literal></link> then there must not
be another mark in the buffer with the same name.
</para>
<para>
Emits the "mark-set" signal as notification of the mark's initial
placement.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>mark</parameter>&#160;:</term>
<listitem><simpara> the mark to add
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>where</parameter>&#160;:</term>
<listitem><simpara> location to place mark
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.12</para></refsect2>
<refsect2 id="gtk-text-buffer-delete-mark" role="function">
<title>gtk_text_buffer_delete_mark ()</title>
<indexterm zone="gtk-text-buffer-delete-mark"><primary sortas="text_buffer_delete_mark">gtk_text_buffer_delete_mark</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_text_buffer_delete_mark         (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkTextMark">GtkTextMark</link> *mark);</programlisting>
<para>
Deletes <parameter>mark</parameter>, so that it's no longer located anywhere in the
buffer. Removes the reference the buffer holds to the mark, so if
you haven't called <link linkend="g-object-ref"><function>g_object_ref()</function></link> on the mark, it will be freed. Even
if the mark isn't freed, most operations on <parameter>mark</parameter> become
invalid, until it gets added to a buffer again with 
<link linkend="gtk-text-buffer-add-mark"><function>gtk_text_buffer_add_mark()</function></link>. Use <link linkend="gtk-text-mark-get-deleted"><function>gtk_text_mark_get_deleted()</function></link> to  
find out if a mark has been removed from its buffer.
The "mark-deleted" signal will be emitted as notification after 
the mark is deleted.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>mark</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextMark"><type>GtkTextMark</type></link> in <parameter>buffer</parameter>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-text-buffer-delete-mark-by-name" role="function">
<title>gtk_text_buffer_delete_mark_by_name ()</title>
<indexterm zone="gtk-text-buffer-delete-mark-by-name"><primary sortas="text_buffer_delete_mark_by_name">gtk_text_buffer_delete_mark_by_name</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_text_buffer_delete_mark_by_name (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         const <link linkend="gchar">gchar</link> *name);</programlisting>
<para>
Deletes the mark named <parameter>name</parameter>; the mark must exist. See
<link linkend="gtk-text-buffer-delete-mark"><function>gtk_text_buffer_delete_mark()</function></link> for details.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>name</parameter>&#160;:</term>
<listitem><simpara> name of a mark in <parameter>buffer</parameter>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-text-buffer-get-mark" role="function">
<title>gtk_text_buffer_get_mark ()</title>
<indexterm zone="gtk-text-buffer-get-mark"><primary sortas="text_buffer_get_mark">gtk_text_buffer_get_mark</primary></indexterm><programlisting><link linkend="GtkTextMark">GtkTextMark</link>*        gtk_text_buffer_get_mark            (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         const <link linkend="gchar">gchar</link> *name);</programlisting>
<para>
Returns the mark named <parameter>name</parameter> in buffer <parameter>buffer</parameter>, or <link linkend="NULL--CAPS"><literal>NULL</literal></link> if no such
mark exists in the buffer.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>name</parameter>&#160;:</term>
<listitem><simpara> a mark name
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a <link linkend="GtkTextMark"><type>GtkTextMark</type></link>, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-text-buffer-get-insert" role="function">
<title>gtk_text_buffer_get_insert ()</title>
<indexterm zone="gtk-text-buffer-get-insert"><primary sortas="text_buffer_get_insert">gtk_text_buffer_get_insert</primary></indexterm><programlisting><link linkend="GtkTextMark">GtkTextMark</link>*        gtk_text_buffer_get_insert          (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer);</programlisting>
<para>
Returns the mark that represents the cursor (insertion point).
Equivalent to calling <link linkend="gtk-text-buffer-get-mark"><function>gtk_text_buffer_get_mark()</function></link> to get the mark
named "insert", but very slightly more efficient, and involves less
typing.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> insertion point mark
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-text-buffer-get-selection-bound" role="function">
<title>gtk_text_buffer_get_selection_bound ()</title>
<indexterm zone="gtk-text-buffer-get-selection-bound"><primary sortas="text_buffer_get_selection_bound">gtk_text_buffer_get_selection_bound</primary></indexterm><programlisting><link linkend="GtkTextMark">GtkTextMark</link>*        gtk_text_buffer_get_selection_bound (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer);</programlisting>
<para>
Returns the mark that represents the selection bound.  Equivalent
to calling <link linkend="gtk-text-buffer-get-mark"><function>gtk_text_buffer_get_mark()</function></link> to get the mark named
"selection_bound", but very slightly more efficient, and involves
less typing.
</para>
<para>
The currently-selected text in <parameter>buffer</parameter> is the region between the
"selection_bound" and "insert" marks. If "selection_bound" and
"insert" are in the same place, then there is no current selection.
<link linkend="gtk-text-buffer-get-selection-bounds"><function>gtk_text_buffer_get_selection_bounds()</function></link> is another convenient function
for handling the selection, if you just want to know whether there's a
selection and what its bounds are.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> selection bound mark
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-text-buffer-get-has-selection" role="function" condition="since:2.10">
<title>gtk_text_buffer_get_has_selection ()</title>
<indexterm zone="gtk-text-buffer-get-has-selection" role="2.10"><primary sortas="text_buffer_get_has_selection">gtk_text_buffer_get_has_selection</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_text_buffer_get_has_selection   (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer);</programlisting>
<para>
Indicates whether the buffer has some text currently selected.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link> 
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the there is text selected

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.10</para></refsect2>
<refsect2 id="gtk-text-buffer-place-cursor" role="function">
<title>gtk_text_buffer_place_cursor ()</title>
<indexterm zone="gtk-text-buffer-place-cursor"><primary sortas="text_buffer_place_cursor">gtk_text_buffer_place_cursor</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_text_buffer_place_cursor        (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *where);</programlisting>
<para>
This function moves the "insert" and "selection_bound" marks
simultaneously.  If you move them to the same place in two steps
with <link linkend="gtk-text-buffer-move-mark"><function>gtk_text_buffer_move_mark()</function></link>, you will temporarily select a
region in between their old and new locations, which can be pretty
inefficient since the temporarily-selected region will force stuff
to be recalculated. This function moves them as a unit, which can
be optimized.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>where</parameter>&#160;:</term>
<listitem><simpara> where to put the cursor
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-text-buffer-select-range" role="function" condition="since:2.4">
<title>gtk_text_buffer_select_range ()</title>
<indexterm zone="gtk-text-buffer-select-range" role="2.4"><primary sortas="text_buffer_select_range">gtk_text_buffer_select_range</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_text_buffer_select_range        (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *ins,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *bound);</programlisting>
<para>
This function moves the "insert" and "selection_bound" marks
simultaneously.  If you move them in two steps
with <link linkend="gtk-text-buffer-move-mark"><function>gtk_text_buffer_move_mark()</function></link>, you will temporarily select a
region in between their old and new locations, which can be pretty
inefficient since the temporarily-selected region will force stuff
to be recalculated. This function moves them as a unit, which can
be optimized.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>ins</parameter>&#160;:</term>
<listitem><simpara> where to put the "insert" mark
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>bound</parameter>&#160;:</term>
<listitem><simpara> where to put the "selection_bound" mark
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.4</para></refsect2>
<refsect2 id="gtk-text-buffer-apply-tag" role="function">
<title>gtk_text_buffer_apply_tag ()</title>
<indexterm zone="gtk-text-buffer-apply-tag"><primary sortas="text_buffer_apply_tag">gtk_text_buffer_apply_tag</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_text_buffer_apply_tag           (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkTextTag">GtkTextTag</link> *tag,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *start,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *end);</programlisting>
<para>
Emits the "apply-tag" signal on <parameter>buffer</parameter>. The default
handler for the signal applies <parameter>tag</parameter> to the given range.
<parameter>start</parameter> and <parameter>end</parameter> do not have to be in order.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>tag</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextTag"><type>GtkTextTag</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>start</parameter>&#160;:</term>
<listitem><simpara> one bound of range to be tagged
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>end</parameter>&#160;:</term>
<listitem><simpara> other bound of range to be tagged
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-text-buffer-remove-tag" role="function">
<title>gtk_text_buffer_remove_tag ()</title>
<indexterm zone="gtk-text-buffer-remove-tag"><primary sortas="text_buffer_remove_tag">gtk_text_buffer_remove_tag</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_text_buffer_remove_tag          (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkTextTag">GtkTextTag</link> *tag,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *start,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *end);</programlisting>
<para>
Emits the "remove-tag" signal. The default handler for the signal
removes all occurrences of <parameter>tag</parameter> from the given range. <parameter>start</parameter> and
<parameter>end</parameter> don't have to be in order.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>tag</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextTag"><type>GtkTextTag</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>start</parameter>&#160;:</term>
<listitem><simpara> one bound of range to be untagged
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>end</parameter>&#160;:</term>
<listitem><simpara> other bound of range to be untagged
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-text-buffer-apply-tag-by-name" role="function">
<title>gtk_text_buffer_apply_tag_by_name ()</title>
<indexterm zone="gtk-text-buffer-apply-tag-by-name"><primary sortas="text_buffer_apply_tag_by_name">gtk_text_buffer_apply_tag_by_name</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_text_buffer_apply_tag_by_name   (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         const <link linkend="gchar">gchar</link> *name,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *start,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *end);</programlisting>
<para>
Calls <link linkend="gtk-text-tag-table-lookup"><function>gtk_text_tag_table_lookup()</function></link> on the buffer's tag table to
get a <link linkend="GtkTextTag"><type>GtkTextTag</type></link>, then calls <link linkend="gtk-text-buffer-apply-tag"><function>gtk_text_buffer_apply_tag()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>name</parameter>&#160;:</term>
<listitem><simpara> name of a named <link linkend="GtkTextTag"><type>GtkTextTag</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>start</parameter>&#160;:</term>
<listitem><simpara> one bound of range to be tagged
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>end</parameter>&#160;:</term>
<listitem><simpara> other bound of range to be tagged
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-text-buffer-remove-tag-by-name" role="function">
<title>gtk_text_buffer_remove_tag_by_name ()</title>
<indexterm zone="gtk-text-buffer-remove-tag-by-name"><primary sortas="text_buffer_remove_tag_by_name">gtk_text_buffer_remove_tag_by_name</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_text_buffer_remove_tag_by_name  (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         const <link linkend="gchar">gchar</link> *name,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *start,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *end);</programlisting>
<para>
Calls <link linkend="gtk-text-tag-table-lookup"><function>gtk_text_tag_table_lookup()</function></link> on the buffer's tag table to
get a <link linkend="GtkTextTag"><type>GtkTextTag</type></link>, then calls <link linkend="gtk-text-buffer-remove-tag"><function>gtk_text_buffer_remove_tag()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>name</parameter>&#160;:</term>
<listitem><simpara> name of a <link linkend="GtkTextTag"><type>GtkTextTag</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>start</parameter>&#160;:</term>
<listitem><simpara> one bound of range to be untagged
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>end</parameter>&#160;:</term>
<listitem><simpara> other bound of range to be untagged
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-text-buffer-remove-all-tags" role="function">
<title>gtk_text_buffer_remove_all_tags ()</title>
<indexterm zone="gtk-text-buffer-remove-all-tags"><primary sortas="text_buffer_remove_all_tags">gtk_text_buffer_remove_all_tags</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_text_buffer_remove_all_tags     (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *start,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *end);</programlisting>
<para>
Removes all tags in the range between <parameter>start</parameter> and <parameter>end</parameter>.  Be careful
with this function; it could remove tags added in code unrelated to
the code you're currently writing. That is, using this function is
probably a bad idea if you have two or more unrelated code sections
that add tags.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>start</parameter>&#160;:</term>
<listitem><simpara> one bound of range to be untagged
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>end</parameter>&#160;:</term>
<listitem><simpara> other bound of range to be untagged
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-text-buffer-create-tag" role="function">
<title>gtk_text_buffer_create_tag ()</title>
<indexterm zone="gtk-text-buffer-create-tag"><primary sortas="text_buffer_create_tag">gtk_text_buffer_create_tag</primary></indexterm><programlisting><link linkend="GtkTextTag">GtkTextTag</link> *        gtk_text_buffer_create_tag          (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         const <link linkend="gchar">gchar</link> *tag_name,
                                                         const <link linkend="gchar">gchar</link> *first_property_name,
                                                         ...);</programlisting>
<para>
Creates a tag and adds it to the tag table for <parameter>buffer</parameter>.
Equivalent to calling <link linkend="gtk-text-tag-new"><function>gtk_text_tag_new()</function></link> and then adding the
tag to the buffer's tag table. The returned tag is owned by
the buffer's tag table, so the ref count will be equal to one.
</para>
<para>
If <parameter>tag_name</parameter> is <link linkend="NULL--CAPS"><literal>NULL</literal></link>, the tag is anonymous.
</para>
<para>
If <parameter>tag_name</parameter> is non-<link linkend="NULL--CAPS"><literal>NULL</literal></link>, a tag called <parameter>tag_name</parameter> must not already
exist in the tag table for this buffer.
</para>
<para>
The <parameter>first_property_name</parameter> argument and subsequent arguments are a list
of properties to set on the tag, as with <link linkend="g-object-set"><function>g_object_set()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>tag_name</parameter>&#160;:</term>
<listitem><simpara> name of the new tag, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>first_property_name</parameter>&#160;:</term>
<listitem><simpara> name of first property to set, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>...</parameter>&#160;:</term>
<listitem><simpara> <link linkend="NULL--CAPS"><literal>NULL</literal></link>-terminated list of property names and values
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a new tag
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-text-buffer-get-iter-at-line-offset" role="function">
<title>gtk_text_buffer_get_iter_at_line_offset ()</title>
<indexterm zone="gtk-text-buffer-get-iter-at-line-offset"><primary sortas="text_buffer_get_iter_at_line_offset">gtk_text_buffer_get_iter_at_line_offset</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_text_buffer_get_iter_at_line_offset
                                                        (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                                         <link linkend="gint">gint</link> line_number,
                                                         <link linkend="gint">gint</link> char_offset);</programlisting>
<para>
Obtains an iterator pointing to <parameter>char_offset</parameter> within the given
line. The <parameter>char_offset</parameter> must exist, offsets off the end of the line
are not allowed. Note <emphasis>characters</emphasis>, not bytes;
UTF-8 may encode one character as multiple bytes.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>iter</parameter>&#160;:</term>
<listitem><simpara> iterator to initialize
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>line_number</parameter>&#160;:</term>
<listitem><simpara> line number counting from 0
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>char_offset</parameter>&#160;:</term>
<listitem><simpara> char offset from start of line
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-text-buffer-get-iter-at-offset" role="function">
<title>gtk_text_buffer_get_iter_at_offset ()</title>
<indexterm zone="gtk-text-buffer-get-iter-at-offset"><primary sortas="text_buffer_get_iter_at_offset">gtk_text_buffer_get_iter_at_offset</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_text_buffer_get_iter_at_offset  (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                                         <link linkend="gint">gint</link> char_offset);</programlisting>
<para>
Initializes <parameter>iter</parameter> to a position <parameter>char_offset</parameter> chars from the start
of the entire buffer. If <parameter>char_offset</parameter> is -1 or greater than the number
of characters in the buffer, <parameter>iter</parameter> is initialized to the end iterator,
the iterator one past the last valid character in the buffer.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link> 
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>iter</parameter>&#160;:</term>
<listitem><simpara> iterator to initialize
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>char_offset</parameter>&#160;:</term>
<listitem><simpara> char offset from start of buffer, counting from 0, or -1
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-text-buffer-get-iter-at-line" role="function">
<title>gtk_text_buffer_get_iter_at_line ()</title>
<indexterm zone="gtk-text-buffer-get-iter-at-line"><primary sortas="text_buffer_get_iter_at_line">gtk_text_buffer_get_iter_at_line</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_text_buffer_get_iter_at_line    (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                                         <link linkend="gint">gint</link> line_number);</programlisting>
<para>
Initializes <parameter>iter</parameter> to the start of the given line.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link> 
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>iter</parameter>&#160;:</term>
<listitem><simpara> iterator to initialize
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>line_number</parameter>&#160;:</term>
<listitem><simpara> line number counting from 0
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-text-buffer-get-iter-at-line-index" role="function">
<title>gtk_text_buffer_get_iter_at_line_index ()</title>
<indexterm zone="gtk-text-buffer-get-iter-at-line-index"><primary sortas="text_buffer_get_iter_at_line_index">gtk_text_buffer_get_iter_at_line_index</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_text_buffer_get_iter_at_line_index
                                                        (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                                         <link linkend="gint">gint</link> line_number,
                                                         <link linkend="gint">gint</link> byte_index);</programlisting>
<para>
Obtains an iterator pointing to <parameter>byte_index</parameter> within the given line.
<parameter>byte_index</parameter> must be the start of a UTF-8 character, and must not be
beyond the end of the line.  Note <emphasis>bytes</emphasis>, not
characters; UTF-8 may encode one character as multiple bytes.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link> 
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>iter</parameter>&#160;:</term>
<listitem><simpara> iterator to initialize 
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>line_number</parameter>&#160;:</term>
<listitem><simpara> line number counting from 0
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>byte_index</parameter>&#160;:</term>
<listitem><simpara> byte index from start of line
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-text-buffer-get-iter-at-mark" role="function">
<title>gtk_text_buffer_get_iter_at_mark ()</title>
<indexterm zone="gtk-text-buffer-get-iter-at-mark"><primary sortas="text_buffer_get_iter_at_mark">gtk_text_buffer_get_iter_at_mark</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_text_buffer_get_iter_at_mark    (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                                         <link linkend="GtkTextMark">GtkTextMark</link> *mark);</programlisting>
<para>
Initializes <parameter>iter</parameter> with the current position of <parameter>mark</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>iter</parameter>&#160;:</term>
<listitem><simpara> iterator to initialize
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>mark</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextMark"><type>GtkTextMark</type></link> in <parameter>buffer</parameter>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-text-buffer-get-iter-at-child-anchor" role="function">
<title>gtk_text_buffer_get_iter_at_child_anchor ()</title>
<indexterm zone="gtk-text-buffer-get-iter-at-child-anchor"><primary sortas="text_buffer_get_iter_at_child_anchor">gtk_text_buffer_get_iter_at_child_anchor</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_text_buffer_get_iter_at_child_anchor
                                                        (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                                         <link linkend="GtkTextChildAnchor">GtkTextChildAnchor</link> *anchor);</programlisting>
<para>
Obtains the location of <parameter>anchor</parameter> within <parameter>buffer</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>iter</parameter>&#160;:</term>
<listitem><simpara> an iterator to be initialized
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>anchor</parameter>&#160;:</term>
<listitem><simpara> a child anchor that appears in <parameter>buffer</parameter>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-text-buffer-get-start-iter" role="function">
<title>gtk_text_buffer_get_start_iter ()</title>
<indexterm zone="gtk-text-buffer-get-start-iter"><primary sortas="text_buffer_get_start_iter">gtk_text_buffer_get_start_iter</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_text_buffer_get_start_iter      (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *iter);</programlisting>
<para>
Initialized <parameter>iter</parameter> with the first position in the text buffer. This
is the same as using <link linkend="gtk-text-buffer-get-iter-at-offset"><function>gtk_text_buffer_get_iter_at_offset()</function></link> to get
the iter at character offset 0.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>iter</parameter>&#160;:</term>
<listitem><simpara> iterator to initialize
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-text-buffer-get-end-iter" role="function">
<title>gtk_text_buffer_get_end_iter ()</title>
<indexterm zone="gtk-text-buffer-get-end-iter"><primary sortas="text_buffer_get_end_iter">gtk_text_buffer_get_end_iter</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_text_buffer_get_end_iter        (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *iter);</programlisting>
<para>
Initializes <parameter>iter</parameter> with the "end iterator," one past the last valid
character in the text buffer. If dereferenced with
<link linkend="gtk-text-iter-get-char"><function>gtk_text_iter_get_char()</function></link>, the end iterator has a character value of
0. The entire buffer lies in the range from the first position in
the buffer (call <link linkend="gtk-text-buffer-get-start-iter"><function>gtk_text_buffer_get_start_iter()</function></link> to get
character position 0) to the end iterator.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link> 
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>iter</parameter>&#160;:</term>
<listitem><simpara> iterator to initialize
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-text-buffer-get-bounds" role="function">
<title>gtk_text_buffer_get_bounds ()</title>
<indexterm zone="gtk-text-buffer-get-bounds"><primary sortas="text_buffer_get_bounds">gtk_text_buffer_get_bounds</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_text_buffer_get_bounds          (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *start,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *end);</programlisting>
<para>
Retrieves the first and last iterators in the buffer, i.e. the
entire buffer lies within the range [<parameter>start</parameter>,<parameter>end</parameter>).</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link> 
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>start</parameter>&#160;:</term>
<listitem><simpara> iterator to initialize with first position in the buffer
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>end</parameter>&#160;:</term>
<listitem><simpara> iterator to initialize with the end iterator
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-text-buffer-get-modified" role="function">
<title>gtk_text_buffer_get_modified ()</title>
<indexterm zone="gtk-text-buffer-get-modified"><primary sortas="text_buffer_get_modified">gtk_text_buffer_get_modified</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_text_buffer_get_modified        (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer);</programlisting>
<para>
Indicates whether the buffer has been modified since the last call
to <link linkend="gtk-text-buffer-set-modified"><function>gtk_text_buffer_set_modified()</function></link> set the modification flag to
<link linkend="FALSE--CAPS"><literal>FALSE</literal></link>. Used for example to enable a "save" function in a text
editor.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link> 
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the buffer has been modified
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-text-buffer-set-modified" role="function">
<title>gtk_text_buffer_set_modified ()</title>
<indexterm zone="gtk-text-buffer-set-modified"><primary sortas="text_buffer_set_modified">gtk_text_buffer_set_modified</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_text_buffer_set_modified        (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="gboolean">gboolean</link> setting);</programlisting>
<para>
Used to keep track of whether the buffer has been modified since the
last time it was saved. Whenever the buffer is saved to disk, call
gtk_text_buffer_set_modified (<parameter>buffer</parameter>, FALSE). When the buffer is modified,
it will automatically toggled on the modified bit again. When the modified
bit flips, the buffer emits a "modified-changed" signal.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link> 
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>setting</parameter>&#160;:</term>
<listitem><simpara> modification flag setting
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-text-buffer-delete-selection" role="function">
<title>gtk_text_buffer_delete_selection ()</title>
<indexterm zone="gtk-text-buffer-delete-selection"><primary sortas="text_buffer_delete_selection">gtk_text_buffer_delete_selection</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_text_buffer_delete_selection    (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="gboolean">gboolean</link> interactive,
                                                         <link linkend="gboolean">gboolean</link> default_editable);</programlisting>
<para>
Deletes the range between the "insert" and "selection_bound" marks,
that is, the currently-selected text. If <parameter>interactive</parameter> is <link linkend="TRUE--CAPS"><literal>TRUE</literal></link>,
the editability of the selection will be considered (users can't delete
uneditable text).</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link> 
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>interactive</parameter>&#160;:</term>
<listitem><simpara> whether the deletion is caused by user interaction
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>default_editable</parameter>&#160;:</term>
<listitem><simpara> whether the buffer is editable by default
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> whether there was a non-empty selection to delete
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-text-buffer-paste-clipboard" role="function">
<title>gtk_text_buffer_paste_clipboard ()</title>
<indexterm zone="gtk-text-buffer-paste-clipboard"><primary sortas="text_buffer_paste_clipboard">gtk_text_buffer_paste_clipboard</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_text_buffer_paste_clipboard     (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkClipboard">GtkClipboard</link> *clipboard,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *override_location,
                                                         <link linkend="gboolean">gboolean</link> default_editable);</programlisting>
<para>
Pastes the contents of a clipboard at the insertion point, or at 
<parameter>override_location</parameter>. (Note: pasting is asynchronous, that is, we'll 
ask for the paste data and return, and at some point later after 
the main loop runs, the paste data will be inserted.)</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>clipboard</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GtkClipboard"><type>GtkClipboard</type></link> to paste from
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>override_location</parameter>&#160;:</term>
<listitem><simpara> location to insert pasted text, or <link linkend="NULL--CAPS"><literal>NULL</literal></link> for 
                    at the cursor
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>default_editable</parameter>&#160;:</term>
<listitem><simpara> whether the buffer is editable by default
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-text-buffer-copy-clipboard" role="function">
<title>gtk_text_buffer_copy_clipboard ()</title>
<indexterm zone="gtk-text-buffer-copy-clipboard"><primary sortas="text_buffer_copy_clipboard">gtk_text_buffer_copy_clipboard</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_text_buffer_copy_clipboard      (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkClipboard">GtkClipboard</link> *clipboard);</programlisting>
<para>
Copies the currently-selected text to a clipboard.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link> 
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>clipboard</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GtkClipboard"><type>GtkClipboard</type></link> object to copy to
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-text-buffer-cut-clipboard" role="function">
<title>gtk_text_buffer_cut_clipboard ()</title>
<indexterm zone="gtk-text-buffer-cut-clipboard"><primary sortas="text_buffer_cut_clipboard">gtk_text_buffer_cut_clipboard</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_text_buffer_cut_clipboard       (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkClipboard">GtkClipboard</link> *clipboard,
                                                         <link linkend="gboolean">gboolean</link> default_editable);</programlisting>
<para>
Copies the currently-selected text to a clipboard, then deletes
said text if it's editable.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>clipboard</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GtkClipboard"><type>GtkClipboard</type></link> object to cut to
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>default_editable</parameter>&#160;:</term>
<listitem><simpara> default editability of the buffer
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-text-buffer-get-selection-bounds" role="function">
<title>gtk_text_buffer_get_selection_bounds ()</title>
<indexterm zone="gtk-text-buffer-get-selection-bounds"><primary sortas="text_buffer_get_selection_bounds">gtk_text_buffer_get_selection_bounds</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_text_buffer_get_selection_bounds
                                                        (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *start,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *end);</programlisting>
<para>
Returns <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if some text is selected; places the bounds
of the selection in <parameter>start</parameter> and <parameter>end</parameter> (if the selection has length 0,
then <parameter>start</parameter> and <parameter>end</parameter> are filled in with the same value).
<parameter>start</parameter> and <parameter>end</parameter> will be in ascending order. If <parameter>start</parameter> and <parameter>end</parameter> are
NULL, then they are not filled in, but the return value still indicates
whether text is selected.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>start</parameter>&#160;:</term>
<listitem><simpara> iterator to initialize with selection start
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>end</parameter>&#160;:</term>
<listitem><simpara> iterator to initialize with selection end
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> whether the selection has nonzero length
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-text-buffer-begin-user-action" role="function">
<title>gtk_text_buffer_begin_user_action ()</title>
<indexterm zone="gtk-text-buffer-begin-user-action"><primary sortas="text_buffer_begin_user_action">gtk_text_buffer_begin_user_action</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_text_buffer_begin_user_action   (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer);</programlisting>
<para>
Called to indicate that the buffer operations between here and a
call to <link linkend="gtk-text-buffer-end-user-action"><function>gtk_text_buffer_end_user_action()</function></link> are part of a single
user-visible operation. The operations between
<link linkend="gtk-text-buffer-begin-user-action"><function>gtk_text_buffer_begin_user_action()</function></link> and
<link linkend="gtk-text-buffer-end-user-action"><function>gtk_text_buffer_end_user_action()</function></link> can then be grouped when creating
an undo stack. <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link> maintains a count of calls to
<link linkend="gtk-text-buffer-begin-user-action"><function>gtk_text_buffer_begin_user_action()</function></link> that have not been closed with
a call to <link linkend="gtk-text-buffer-end-user-action"><function>gtk_text_buffer_end_user_action()</function></link>, and emits the 
"begin-user-action" and "end-user-action" signals only for the 
outermost pair of calls. This allows you to build user actions 
from other user actions.
</para>
<para>
The "interactive" buffer mutation functions, such as
<link linkend="gtk-text-buffer-insert-interactive"><function>gtk_text_buffer_insert_interactive()</function></link>, automatically call begin/end
user action around the buffer operations they perform, so there's
no need to add extra calls if you user action consists solely of a
single call to one of those functions.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-text-buffer-end-user-action" role="function">
<title>gtk_text_buffer_end_user_action ()</title>
<indexterm zone="gtk-text-buffer-end-user-action"><primary sortas="text_buffer_end_user_action">gtk_text_buffer_end_user_action</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_text_buffer_end_user_action     (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer);</programlisting>
<para>
Should be paired with a call to <link linkend="gtk-text-buffer-begin-user-action"><function>gtk_text_buffer_begin_user_action()</function></link>.
See that function for a full explanation.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-text-buffer-add-selection-clipboard" role="function">
<title>gtk_text_buffer_add_selection_clipboard ()</title>
<indexterm zone="gtk-text-buffer-add-selection-clipboard"><primary sortas="text_buffer_add_selection_clipboard">gtk_text_buffer_add_selection_clipboard</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_text_buffer_add_selection_clipboard
                                                        (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkClipboard">GtkClipboard</link> *clipboard);</programlisting>
<para>
Adds <parameter>clipboard</parameter> to the list of clipboards in which the selection 
contents of <parameter>buffer</parameter> are available. In most cases, <parameter>clipboard</parameter> will be 
the <link linkend="GtkClipboard"><type>GtkClipboard</type></link> of type <link linkend="GDK-SELECTION-PRIMARY--CAPS"><literal>GDK_SELECTION_PRIMARY</literal></link> for a view of <parameter>buffer</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>clipboard</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkClipboard"><type>GtkClipboard</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-text-buffer-remove-selection-clipboard" role="function">
<title>gtk_text_buffer_remove_selection_clipboard ()</title>
<indexterm zone="gtk-text-buffer-remove-selection-clipboard"><primary sortas="text_buffer_remove_selection_clipboard">gtk_text_buffer_remove_selection_clipboard</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_text_buffer_remove_selection_clipboard
                                                        (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GtkClipboard">GtkClipboard</link> *clipboard);</programlisting>
<para>
Removes a <link linkend="GtkClipboard"><type>GtkClipboard</type></link> added with 
<link linkend="gtk-text-buffer-add-selection-clipboard"><function>gtk_text_buffer_add_selection_clipboard()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>clipboard</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkClipboard"><type>GtkClipboard</type></link> added to <parameter>buffer</parameter> by 
            <link linkend="gtk-text-buffer-add-selection-clipboard"><function>gtk_text_buffer_add_selection_clipboard()</function></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GtkTextBufferTargetInfo" role="enum">
<title>enum GtkTextBufferTargetInfo</title>
<indexterm zone="GtkTextBufferTargetInfo"><primary sortas="TextBufferTargetInfo">GtkTextBufferTargetInfo</primary></indexterm><programlisting>typedef enum
{
  GTK_TEXT_BUFFER_TARGET_INFO_BUFFER_CONTENTS = - 1,
  GTK_TEXT_BUFFER_TARGET_INFO_RICH_TEXT       = - 2,
  GTK_TEXT_BUFFER_TARGET_INFO_TEXT            = - 3
} GtkTextBufferTargetInfo;
</programlisting>
<para>
</para></refsect2>
<refsect2 id="GtkTextBufferDeserializeFunc" role="function">
<title>GtkTextBufferDeserializeFunc ()</title>
<indexterm zone="GtkTextBufferDeserializeFunc"><primary sortas="TextBufferDeserializeFunc">GtkTextBufferDeserializeFunc</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            (*GtkTextBufferDeserializeFunc)     (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *register_buffer,
                                                         <link linkend="GtkTextBuffer">GtkTextBuffer</link> *content_buffer,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                                         const <link linkend="guint8">guint8</link> *data,
                                                         <link linkend="gsize">gsize</link> length,
                                                         <link linkend="gboolean">gboolean</link> create_tags,
                                                         <link linkend="gpointer">gpointer</link> user_data,
                                                         <link linkend="GError">GError</link> **error);</programlisting>
<para>
A function that is called to deserialize rich text that has been
serialized with <link linkend="gtk-text-buffer-serialize"><function>gtk_text_buffer_serialize()</function></link>, and insert it at <parameter>iter</parameter>.
</para><variablelist role="params">
<varlistentry><term><parameter>register_buffer</parameter>&#160;:</term>
<listitem><simpara>the <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link> the format is registered with
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>content_buffer</parameter>&#160;:</term>
<listitem><simpara>the <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link> to deserialize into
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>iter</parameter>&#160;:</term>
<listitem><simpara>insertion point for the deserialized text
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara>data to deserialize
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>length</parameter>&#160;:</term>
<listitem><simpara>length of <link linkend="data"><literal>data</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>create_tags</parameter>&#160;:</term>
<listitem><simpara>%TRUE if deserializing may create tags
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara>user data that was specified when registering the format
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter>&#160;:</term>
<listitem><simpara>return location for a <link linkend="GError"><type>GError</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>%TRUE on success, <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> otherwise
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-text-buffer-deserialize" role="function" condition="since:2.10">
<title>gtk_text_buffer_deserialize ()</title>
<indexterm zone="gtk-text-buffer-deserialize" role="2.10"><primary sortas="text_buffer_deserialize">gtk_text_buffer_deserialize</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_text_buffer_deserialize         (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *register_buffer,
                                                         <link linkend="GtkTextBuffer">GtkTextBuffer</link> *content_buffer,
                                                         <link linkend="GdkAtom">GdkAtom</link> format,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                                         const <link linkend="guint8">guint8</link> *data,
                                                         <link linkend="gsize">gsize</link> length,
                                                         <link linkend="GError">GError</link> **error);</programlisting>
<para>
This function deserializes rich text in format <parameter>format</parameter> and inserts
it at <parameter>iter</parameter>.
</para>
<para>
<parameter>format</parameter><!-- -->s to be used must be registered using
<link linkend="gtk-text-buffer-register-deserialize-format"><function>gtk_text_buffer_register_deserialize_format()</function></link> or
<link linkend="gtk-text-buffer-register-deserialize-tagset"><function>gtk_text_buffer_register_deserialize_tagset()</function></link> beforehand.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>register_buffer</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link> <parameter>format</parameter> is registered with
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>content_buffer</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link> to deserialize into
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>format</parameter>&#160;:</term>
<listitem><simpara> the rich text format to use for deserializing
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>iter</parameter>&#160;:</term>
<listitem><simpara> insertion point for the deserialized text
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara> data to deserialize
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>length</parameter>&#160;:</term>
<listitem><simpara> length of <parameter>data</parameter>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter>&#160;:</term>
<listitem><simpara> return location for a <link linkend="GError"><type>GError</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> on success, <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> otherwise.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.10</para></refsect2>
<refsect2 id="gtk-text-buffer-deserialize-get-can-create-tags" role="function" condition="since:2.10">
<title>gtk_text_buffer_deserialize_get_can_create_tags ()</title>
<indexterm zone="gtk-text-buffer-deserialize-get-can-create-tags" role="2.10"><primary sortas="text_buffer_deserialize_get_can_create_tags">gtk_text_buffer_deserialize_get_can_create_tags</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_text_buffer_deserialize_get_can_create_tags
                                                        (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GdkAtom">GdkAtom</link> format);</programlisting>
<para>
This functions returns the value set with
<link linkend="gtk-text-buffer-deserialize-set-can-create-tags"><function>gtk_text_buffer_deserialize_set_can_create_tags()</function></link></para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>format</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkAtom"><type>GdkAtom</type></link> representing a registered rich text format
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> whether deserializing this format may create tags

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.10</para></refsect2>
<refsect2 id="gtk-text-buffer-deserialize-set-can-create-tags" role="function" condition="since:2.10">
<title>gtk_text_buffer_deserialize_set_can_create_tags ()</title>
<indexterm zone="gtk-text-buffer-deserialize-set-can-create-tags" role="2.10"><primary sortas="text_buffer_deserialize_set_can_create_tags">gtk_text_buffer_deserialize_set_can_create_tags</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_text_buffer_deserialize_set_can_create_tags
                                                        (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GdkAtom">GdkAtom</link> format,
                                                         <link linkend="gboolean">gboolean</link> can_create_tags);</programlisting>
<para>
Use this function to allow a rich text deserialization function to
create new tags in the receiving buffer. Note that using this
function is almost always a bad idea, because the rich text
functions you register should know how to map the rich text format
they handler to your text buffers set of tags.
</para>
<para>
The ability of creating new (arbitrary!) tags in the receiving buffer
is meant for special rich text formats like the internal one that
is registered using <link linkend="gtk-text-buffer-register-deserialize-tagset"><function>gtk_text_buffer_register_deserialize_tagset()</function></link>,
because that format is essentially a dump of the internal structure
of the source buffer, including its tag names.
</para>
<para>
You should allow creation of tags only if you know what you are
doing, e.g. if you defined a tagset name for your application
suite's text buffers and you know that it's fine to receive new
tags from these buffers, because you know that your application can
handle the newly created tags.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>format</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkAtom"><type>GdkAtom</type></link> representing a registered rich text format
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>can_create_tags</parameter>&#160;:</term>
<listitem><simpara> whether deserializing this format may create tags
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.10</para></refsect2>
<refsect2 id="gtk-text-buffer-get-copy-target-list" role="function" condition="since:2.10">
<title>gtk_text_buffer_get_copy_target_list ()</title>
<indexterm zone="gtk-text-buffer-get-copy-target-list" role="2.10"><primary sortas="text_buffer_get_copy_target_list">gtk_text_buffer_get_copy_target_list</primary></indexterm><programlisting><link linkend="GtkTargetList">GtkTargetList</link> *     gtk_text_buffer_get_copy_target_list
                                                        (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer);</programlisting>
<para>
This function returns the list of targets this text buffer can
provide for copying and as DND source. The targets in the list are
added with <link linkend="info"><literal>info</literal></link> values from the <link linkend="GtkTextBufferTargetInfo"><type>GtkTextBufferTargetInfo</type></link> enum,
using <link linkend="gtk-target-list-add-rich-text-targets"><function>gtk_target_list_add_rich_text_targets()</function></link> and
<link linkend="gtk-target-list-add-text-targets"><function>gtk_target_list_add_text_targets()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the <link linkend="GtkTargetList"><type>GtkTargetList</type></link>

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.10</para></refsect2>
<refsect2 id="gtk-text-buffer-get-deserialize-formats" role="function" condition="since:2.10">
<title>gtk_text_buffer_get_deserialize_formats ()</title>
<indexterm zone="gtk-text-buffer-get-deserialize-formats" role="2.10"><primary sortas="text_buffer_get_deserialize_formats">gtk_text_buffer_get_deserialize_formats</primary></indexterm><programlisting><link linkend="GdkAtom">GdkAtom</link> *           gtk_text_buffer_get_deserialize_formats
                                                        (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="gint">gint</link> *n_formats);</programlisting>
<para>
This function returns the rich text deserialize formats registered
with <parameter>buffer</parameter> using <link linkend="gtk-text-buffer-register-deserialize-format"><function>gtk_text_buffer_register_deserialize_format()</function></link> or
<link linkend="gtk-text-buffer-register-deserialize-tagset"><function>gtk_text_buffer_register_deserialize_tagset()</function></link></para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>n_formats</parameter>&#160;:</term>
<listitem><simpara> return location for the number of formats
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> an array of <link linkend="GdkAtom"><type>GdkAtom</type></link><!-- -->s representing the registered
              formats.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.10</para></refsect2>
<refsect2 id="gtk-text-buffer-get-paste-target-list" role="function" condition="since:2.10">
<title>gtk_text_buffer_get_paste_target_list ()</title>
<indexterm zone="gtk-text-buffer-get-paste-target-list" role="2.10"><primary sortas="text_buffer_get_paste_target_list">gtk_text_buffer_get_paste_target_list</primary></indexterm><programlisting><link linkend="GtkTargetList">GtkTargetList</link> *     gtk_text_buffer_get_paste_target_list
                                                        (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer);</programlisting>
<para>
This function returns the list of targets this text buffer supports
for pasting and as DND destination. The targets in the list are
added with <link linkend="info"><literal>info</literal></link> values from the <link linkend="GtkTextBufferTargetInfo"><type>GtkTextBufferTargetInfo</type></link> enum,
using <link linkend="gtk-target-list-add-rich-text-targets"><function>gtk_target_list_add_rich_text_targets()</function></link> and
<link linkend="gtk-target-list-add-text-targets"><function>gtk_target_list_add_text_targets()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the <link linkend="GtkTargetList"><type>GtkTargetList</type></link>

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.10</para></refsect2>
<refsect2 id="gtk-text-buffer-get-serialize-formats" role="function" condition="since:2.10">
<title>gtk_text_buffer_get_serialize_formats ()</title>
<indexterm zone="gtk-text-buffer-get-serialize-formats" role="2.10"><primary sortas="text_buffer_get_serialize_formats">gtk_text_buffer_get_serialize_formats</primary></indexterm><programlisting><link linkend="GdkAtom">GdkAtom</link> *           gtk_text_buffer_get_serialize_formats
                                                        (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="gint">gint</link> *n_formats);</programlisting>
<para>
This function returns the rich text serialize formats registered
with <parameter>buffer</parameter> using <link linkend="gtk-text-buffer-register-serialize-format"><function>gtk_text_buffer_register_serialize_format()</function></link> or
<link linkend="gtk-text-buffer-register-serialize-tagset"><function>gtk_text_buffer_register_serialize_tagset()</function></link></para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>n_formats</parameter>&#160;:</term>
<listitem><simpara> return location for the number of formats
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> an array of <link linkend="GdkAtom"><type>GdkAtom</type></link><!-- -->s representing the registered
              formats.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.10</para></refsect2>
<refsect2 id="gtk-text-buffer-register-deserialize-format" role="function" condition="since:2.10">
<title>gtk_text_buffer_register_deserialize_format ()</title>
<indexterm zone="gtk-text-buffer-register-deserialize-format" role="2.10"><primary sortas="text_buffer_register_deserialize_format">gtk_text_buffer_register_deserialize_format</primary></indexterm><programlisting><link linkend="GdkAtom">GdkAtom</link>             gtk_text_buffer_register_deserialize_format
                                                        (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         const <link linkend="gchar">gchar</link> *mime_type,
                                                         <link linkend="GtkTextBufferDeserializeFunc">GtkTextBufferDeserializeFunc</link> function,
                                                         <link linkend="gpointer">gpointer</link> user_data,
                                                         <link linkend="GDestroyNotify">GDestroyNotify</link> user_data_destroy);</programlisting>
<para>
This function registers a rich text deserialization <parameter>function</parameter> along with
its <parameter>mime_type</parameter> with the passed <parameter>buffer</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>mime_type</parameter>&#160;:</term>
<listitem><simpara> the format's mime-type
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>function</parameter>&#160;:</term>
<listitem><simpara> the deserialize function to register
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara> <parameter>function</parameter>'s user_data
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data_destroy</parameter>&#160;:</term>
<listitem><simpara> a function to call when <parameter>user_data</parameter> is no longer needed
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the <link linkend="GdkAtom"><type>GdkAtom</type></link> that corresponds to the newly registered
              format's mime-type.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.10</para></refsect2>
<refsect2 id="gtk-text-buffer-register-deserialize-tagset" role="function" condition="since:2.10">
<title>gtk_text_buffer_register_deserialize_tagset ()</title>
<indexterm zone="gtk-text-buffer-register-deserialize-tagset" role="2.10"><primary sortas="text_buffer_register_deserialize_tagset">gtk_text_buffer_register_deserialize_tagset</primary></indexterm><programlisting><link linkend="GdkAtom">GdkAtom</link>             gtk_text_buffer_register_deserialize_tagset
                                                        (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         const <link linkend="gchar">gchar</link> *tagset_name);</programlisting>
<para>
This function registers GTK+'s internal rich text serialization
format with the passed <parameter>buffer</parameter>. See
<link linkend="gtk-text-buffer-register-serialize-tagset"><function>gtk_text_buffer_register_serialize_tagset()</function></link> for details.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>tagset_name</parameter>&#160;:</term>
<listitem><simpara> an optional tagset name, on <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the <link linkend="GdkAtom"><type>GdkAtom</type></link> that corresponds to the newly registered
              format's mime-type.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.10</para></refsect2>
<refsect2 id="gtk-text-buffer-register-serialize-format" role="function" condition="since:2.10">
<title>gtk_text_buffer_register_serialize_format ()</title>
<indexterm zone="gtk-text-buffer-register-serialize-format" role="2.10"><primary sortas="text_buffer_register_serialize_format">gtk_text_buffer_register_serialize_format</primary></indexterm><programlisting><link linkend="GdkAtom">GdkAtom</link>             gtk_text_buffer_register_serialize_format
                                                        (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         const <link linkend="gchar">gchar</link> *mime_type,
                                                         <link linkend="GtkTextBufferSerializeFunc">GtkTextBufferSerializeFunc</link> function,
                                                         <link linkend="gpointer">gpointer</link> user_data,
                                                         <link linkend="GDestroyNotify">GDestroyNotify</link> user_data_destroy);</programlisting>
<para>
This function registers a rich text serialization <parameter>function</parameter> along with
its <parameter>mime_type</parameter> with the passed <parameter>buffer</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>mime_type</parameter>&#160;:</term>
<listitem><simpara> the format's mime-type
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>function</parameter>&#160;:</term>
<listitem><simpara> the serialize function to register
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara> <link linkend="function"><literal>function</literal></link>'s user_data
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data_destroy</parameter>&#160;:</term>
<listitem><simpara> a function to call when <parameter>user_data</parameter> is no longer needed
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the <link linkend="GdkAtom"><type>GdkAtom</type></link> that corresponds to the newly registered
              format's mime-type.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.10</para></refsect2>
<refsect2 id="gtk-text-buffer-register-serialize-tagset" role="function" condition="since:2.10">
<title>gtk_text_buffer_register_serialize_tagset ()</title>
<indexterm zone="gtk-text-buffer-register-serialize-tagset" role="2.10"><primary sortas="text_buffer_register_serialize_tagset">gtk_text_buffer_register_serialize_tagset</primary></indexterm><programlisting><link linkend="GdkAtom">GdkAtom</link>             gtk_text_buffer_register_serialize_tagset
                                                        (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         const <link linkend="gchar">gchar</link> *tagset_name);</programlisting>
<para>
This function registers GTK+'s internal rich text serialization
format with the passed <parameter>buffer</parameter>. The internal format does not comply
to any standard rich text format and only works between <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>
instances. It is capable of serializing all of a text buffer's tags
and embedded pixbufs.
</para>
<para>
This function is just a wrapper around
<link linkend="gtk-text-buffer-register-serialize-format"><function>gtk_text_buffer_register_serialize_format()</function></link>. The mime type used
for registering is "application/x-gtk-text-buffer-rich-text", or
"application/x-gtk-text-buffer-rich-text;format=<parameter>tagset_name</parameter>" if a
<parameter>tagset_name</parameter> was passed.
</para>
<para>
The <parameter>tagset_name</parameter> can be used to restrict the transfer of rich text
to buffers with compatible sets of tags, in order to avoid unknown
tags from being pasted. It is probably the common case to pass an
identifier != <link linkend="NULL--CAPS"><literal>NULL</literal></link> here, since the <link linkend="NULL--CAPS"><literal>NULL</literal></link> tagset requires the
receiving buffer to deal with with pasting of arbitrary tags.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>tagset_name</parameter>&#160;:</term>
<listitem><simpara> an optional tagset name, on <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the <link linkend="GdkAtom"><type>GdkAtom</type></link> that corresponds to the newly registered
              format's mime-type.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.10</para></refsect2>
<refsect2 id="GtkTextBufferSerializeFunc" role="function">
<title>GtkTextBufferSerializeFunc ()</title>
<indexterm zone="GtkTextBufferSerializeFunc"><primary sortas="TextBufferSerializeFunc">GtkTextBufferSerializeFunc</primary></indexterm><programlisting><link linkend="guint8">guint8</link> *            (*GtkTextBufferSerializeFunc)       (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *register_buffer,
                                                         <link linkend="GtkTextBuffer">GtkTextBuffer</link> *content_buffer,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *start,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *end,
                                                         <link linkend="gsize">gsize</link> *length,
                                                         <link linkend="gpointer">gpointer</link> user_data);</programlisting>
<para>
A function that is called to serialize the content of a text buffer.
It must return the serialized form of the content.
</para><variablelist role="params">
<varlistentry><term><parameter>register_buffer</parameter>&#160;:</term>
<listitem><simpara>the <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link> for which the format is registered
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>content_buffer</parameter>&#160;:</term>
<listitem><simpara>the <link linkend="GtkTextsBuffer"><type>GtkTextsBuffer</type></link> to serialize
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>start</parameter>&#160;:</term>
<listitem><simpara>start of the block of text to serialize
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>end</parameter>&#160;:</term>
<listitem><simpara>end of the block of text to serialize
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>length</parameter>&#160;:</term>
<listitem><simpara>Return location for the length of the serialized data
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara>user data that was specified when registering the format
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>a newly-allocated array of guint8 which contains the serialized
          data, or <link linkend="NULL--CAPS"><literal>NULL</literal></link> if an error occurred
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-text-buffer-serialize" role="function" condition="since:2.10">
<title>gtk_text_buffer_serialize ()</title>
<indexterm zone="gtk-text-buffer-serialize" role="2.10"><primary sortas="text_buffer_serialize">gtk_text_buffer_serialize</primary></indexterm><programlisting><link linkend="guint8">guint8</link> *            gtk_text_buffer_serialize           (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *register_buffer,
                                                         <link linkend="GtkTextBuffer">GtkTextBuffer</link> *content_buffer,
                                                         <link linkend="GdkAtom">GdkAtom</link> format,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *start,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *end,
                                                         <link linkend="gsize">gsize</link> *length);</programlisting>
<para>
This function serializes the portion of text between <parameter>start</parameter>
and <parameter>end</parameter> in the rich text format represented by <parameter>format</parameter>.
</para>
<para>
<parameter>format</parameter><!-- -->s to be used must be registered using
<link linkend="gtk-text-buffer-register-serialize-format"><function>gtk_text_buffer_register_serialize_format()</function></link> or
<link linkend="gtk-text-buffer-register-serialize-tagset"><function>gtk_text_buffer_register_serialize_tagset()</function></link> beforehand.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>register_buffer</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link> <parameter>format</parameter> is registered with
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>content_buffer</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link> to serialize
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>format</parameter>&#160;:</term>
<listitem><simpara> the rich text format to use for serializing
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>start</parameter>&#160;:</term>
<listitem><simpara> start of block of text to serialize
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>end</parameter>&#160;:</term>
<listitem><simpara> end of block of test to serialize
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>length</parameter>&#160;:</term>
<listitem><simpara> return location for the length of the serialized data
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the serialized data, encoded as <parameter>format</parameter>

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.10</para></refsect2>
<refsect2 id="gtk-text-buffer-unregister-deserialize-format" role="function" condition="since:2.10">
<title>gtk_text_buffer_unregister_deserialize_format ()</title>
<indexterm zone="gtk-text-buffer-unregister-deserialize-format" role="2.10"><primary sortas="text_buffer_unregister_deserialize_format">gtk_text_buffer_unregister_deserialize_format</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_text_buffer_unregister_deserialize_format
                                                        (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GdkAtom">GdkAtom</link> format);</programlisting>
<para>
This function unregisters a rich text format that was previously
registered using <link linkend="gtk-text-buffer-register-deserialize-format"><function>gtk_text_buffer_register_deserialize_format()</function></link> or
<link linkend="gtk-text-buffer-register-deserialize-tagset"><function>gtk_text_buffer_register_deserialize_tagset()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>format</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkAtom"><type>GdkAtom</type></link> representing a registered rich text format.
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.10</para></refsect2>
<refsect2 id="gtk-text-buffer-unregister-serialize-format" role="function" condition="since:2.10">
<title>gtk_text_buffer_unregister_serialize_format ()</title>
<indexterm zone="gtk-text-buffer-unregister-serialize-format" role="2.10"><primary sortas="text_buffer_unregister_serialize_format">gtk_text_buffer_unregister_serialize_format</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_text_buffer_unregister_serialize_format
                                                        (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                                         <link linkend="GdkAtom">GdkAtom</link> format);</programlisting>
<para>
This function unregisters a rich text format that was previously
registered using <link linkend="gtk-text-buffer-register-serialize-format"><function>gtk_text_buffer_register_serialize_format()</function></link> or
<link linkend="gtk-text-buffer-register-serialize-tagset"><function>gtk_text_buffer_register_serialize_tagset()</function></link></para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>format</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkAtom"><type>GdkAtom</type></link> representing a registered rich text format.
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.10</para></refsect2>

</refsect1>
<refsect1 id="GtkTextBuffer.property-details" role="property_details">
<title role="property_details.title">Property Details</title>
<refsect2 id="GtkTextBuffer--copy-target-list" role="property"><title>The <literal>&quot;copy-target-list&quot;</literal> property</title>
<indexterm zone="GtkTextBuffer--copy-target-list" role="2.10"><primary sortas="TextBuffer:copy-target-list">GtkTextBuffer:copy-target-list</primary></indexterm><programlisting>  &quot;copy-target-list&quot;         <link linkend="GtkTargetList">GtkTargetList</link>*        : Read</programlisting>
<para>
The list of targets this buffer supports for clipboard copying
and as DND source.</para>
<para>
</para><para>Since 2.10</para>
</refsect2>
<refsect2 id="GtkTextBuffer--cursor-position" role="property"><title>The <literal>&quot;cursor-position&quot;</literal> property</title>
<indexterm zone="GtkTextBuffer--cursor-position" role="2.10"><primary sortas="TextBuffer:cursor-position">GtkTextBuffer:cursor-position</primary></indexterm><programlisting>  &quot;cursor-position&quot;          <link linkend="gint">gint</link>                  : Read</programlisting>
<para>
The position of the insert mark (as offset from the beginning
of the buffer). It is useful for getting notified when the 
cursor moves.</para>
<para>
</para><para>Allowed values: &gt;= 0</para>
<para>Default value: 0</para>
<para>Since 2.10</para>
</refsect2>
<refsect2 id="GtkTextBuffer--has-selection" role="property"><title>The <literal>&quot;has-selection&quot;</literal> property</title>
<indexterm zone="GtkTextBuffer--has-selection" role="2.10"><primary sortas="TextBuffer:has-selection">GtkTextBuffer:has-selection</primary></indexterm><programlisting>  &quot;has-selection&quot;            <link linkend="gboolean">gboolean</link>              : Read</programlisting>
<para>
Whether the buffer has some text currently selected.</para>
<para>
</para><para>Default value: FALSE</para>
<para>Since 2.10</para>
</refsect2>
<refsect2 id="GtkTextBuffer--paste-target-list" role="property"><title>The <literal>&quot;paste-target-list&quot;</literal> property</title>
<indexterm zone="GtkTextBuffer--paste-target-list" role="2.10"><primary sortas="TextBuffer:paste-target-list">GtkTextBuffer:paste-target-list</primary></indexterm><programlisting>  &quot;paste-target-list&quot;        <link linkend="GtkTargetList">GtkTargetList</link>*        : Read</programlisting>
<para>
The list of targets this buffer supports for clipboard pasting
and as DND destination.</para>
<para>
</para><para>Since 2.10</para>
</refsect2>
<refsect2 id="GtkTextBuffer--tag-table" role="property"><title>The <literal>&quot;tag-table&quot;</literal> property</title>
<indexterm zone="GtkTextBuffer--tag-table"><primary sortas="TextBuffer:tag-table">GtkTextBuffer:tag-table</primary></indexterm><programlisting>  &quot;tag-table&quot;                <link linkend="GtkTextTagTable">GtkTextTagTable</link>*      : Read / Write / Construct Only</programlisting>
<para>Text Tag Table.</para></refsect2>
<refsect2 id="GtkTextBuffer--text" role="property"><title>The <literal>&quot;text&quot;</literal> property</title>
<indexterm zone="GtkTextBuffer--text" role="2.8"><primary sortas="TextBuffer:text">GtkTextBuffer:text</primary></indexterm><programlisting>  &quot;text&quot;                     <link linkend="gchar">gchar</link>*                : Read / Write</programlisting>
<para>
The text content of the buffer. Without child widgets and images,
see <link linkend="gtk-text-buffer-get-text"><function>gtk_text_buffer_get_text()</function></link> for more information.</para>
<para>
</para><para>Default value: ""</para>
<para>Since 2.8</para>
</refsect2>

</refsect1>

<refsect1 id="GtkTextBuffer.signal-details" role="signals">
<title role="signals.title">Signal Details</title>
<refsect2 id="GtkTextBuffer-apply-tag" role="signal"><title>The <literal>&quot;apply-tag&quot;</literal> signal</title>
<indexterm zone="GtkTextBuffer-apply-tag"><primary sortas="TextBuffer::apply-tag">GtkTextBuffer::apply-tag</primary></indexterm><programlisting><link linkend="void">void</link>                user_function                      (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *textbuffer,
                                                        <link linkend="GtkTextTag">GtkTextTag</link>    *tag,
                                                        <link linkend="GtkTextIter">GtkTextIter</link>   *start,
                                                        <link linkend="GtkTextIter">GtkTextIter</link>   *end,
                                                        <link linkend="gpointer">gpointer</link>       user_data)       : Run Last</programlisting>
<para>
The ::apply-tag signal is emitted to apply a tag to a
range of text in a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>.
Applying actually occurs in the default handler.
</para>
<para>
Note that if your handler runs before the default handler it must not 
invalidate the <parameter>start</parameter> and <parameter>end</parameter> iters (or has to revalidate them). 
</para>
<para>
See also: 
<link linkend="gtk-text-buffer-apply-tag"><function>gtk_text_buffer_apply_tag()</function></link>,
<link linkend="gtk-text-buffer-insert-with-tags"><function>gtk_text_buffer_insert_with_tags()</function></link>,
<link linkend="gtk-text-buffer-insert-range"><function>gtk_text_buffer_insert_range()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>textbuffer</parameter>&#160;:</term>
<listitem><simpara> the object which received the signal
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>tag</parameter>&#160;:</term>
<listitem><simpara> the applied tag
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>start</parameter>&#160;:</term>
<listitem><simpara> the start of the range the tag is applied to
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>end</parameter>&#160;:</term>
<listitem><simpara> the end of the range the tag is applied to
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2><refsect2 id="GtkTextBuffer-begin-user-action" role="signal"><title>The <literal>&quot;begin-user-action&quot;</literal> signal</title>
<indexterm zone="GtkTextBuffer-begin-user-action"><primary sortas="TextBuffer::begin-user-action">GtkTextBuffer::begin-user-action</primary></indexterm><programlisting><link linkend="void">void</link>                user_function                      (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *textbuffer,
                                                        <link linkend="gpointer">gpointer</link>       user_data)       : Run Last</programlisting>
<para>
The ::begin-user-action signal is emitted at the beginning of a single
user-visible operation on a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>.
</para>
<para>
See also: 
<link linkend="gtk-text-buffer-begin-user-action"><function>gtk_text_buffer_begin_user_action()</function></link>,
<link linkend="gtk-text-buffer-insert-interactive"><function>gtk_text_buffer_insert_interactive()</function></link>,
<link linkend="gtk-text-buffer-insert-range-interactive"><function>gtk_text_buffer_insert_range_interactive()</function></link>,
<link linkend="gtk-text-buffer-delete-interactive"><function>gtk_text_buffer_delete_interactive()</function></link>,
<link linkend="gtk-text-buffer-backspace"><function>gtk_text_buffer_backspace()</function></link>,
<link linkend="gtk-text-buffer-delete-selection"><function>gtk_text_buffer_delete_selection()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>textbuffer</parameter>&#160;:</term>
<listitem><simpara> the object which received the signal
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2><refsect2 id="GtkTextBuffer-changed" role="signal"><title>The <literal>&quot;changed&quot;</literal> signal</title>
<indexterm zone="GtkTextBuffer-changed"><primary sortas="TextBuffer::changed">GtkTextBuffer::changed</primary></indexterm><programlisting><link linkend="void">void</link>                user_function                      (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *textbuffer,
                                                        <link linkend="gpointer">gpointer</link>       user_data)       : Run Last</programlisting>
<para>
The ::changed signal is emitted when the content of a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link> 
has changed.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>textbuffer</parameter>&#160;:</term>
<listitem><simpara> the object which received the signal
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2><refsect2 id="GtkTextBuffer-delete-range" role="signal"><title>The <literal>&quot;delete-range&quot;</literal> signal</title>
<indexterm zone="GtkTextBuffer-delete-range"><primary sortas="TextBuffer::delete-range">GtkTextBuffer::delete-range</primary></indexterm><programlisting><link linkend="void">void</link>                user_function                      (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *textbuffer,
                                                        <link linkend="GtkTextIter">GtkTextIter</link>   *start,
                                                        <link linkend="GtkTextIter">GtkTextIter</link>   *end,
                                                        <link linkend="gpointer">gpointer</link>       user_data)       : Run Last</programlisting>
<para>
The ::delete-range signal is emitted to delete a range 
from a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>. 
</para>
<para>
Note that if your handler runs before the default handler it must not 
invalidate the <parameter>start</parameter> and <parameter>end</parameter> iters (or has to revalidate them). 
The default signal handler revalidates the <parameter>start</parameter> and <parameter>end</parameter> iters to 
both point point to the location where text was deleted. Handlers
which run after the default handler (see <link linkend="g-signal-connect-after"><function>g_signal_connect_after()</function></link>)
do not have access to the deleted text.
</para>
<para>
See also: <link linkend="gtk-text-buffer-delete"><function>gtk_text_buffer_delete()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>textbuffer</parameter>&#160;:</term>
<listitem><simpara> the object which received the signal
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>start</parameter>&#160;:</term>
<listitem><simpara> the start of the range to be deleted
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>end</parameter>&#160;:</term>
<listitem><simpara> the end of the range to be deleted
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2><refsect2 id="GtkTextBuffer-end-user-action" role="signal"><title>The <literal>&quot;end-user-action&quot;</literal> signal</title>
<indexterm zone="GtkTextBuffer-end-user-action"><primary sortas="TextBuffer::end-user-action">GtkTextBuffer::end-user-action</primary></indexterm><programlisting><link linkend="void">void</link>                user_function                      (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *textbuffer,
                                                        <link linkend="gpointer">gpointer</link>       user_data)       : Run Last</programlisting>
<para>
The ::end-user-action signal is emitted at the end of a single
user-visible operation on the <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>.
</para>
<para>
See also: 
<link linkend="gtk-text-buffer-end-user-action"><function>gtk_text_buffer_end_user_action()</function></link>,
<link linkend="gtk-text-buffer-insert-interactive"><function>gtk_text_buffer_insert_interactive()</function></link>,
<link linkend="gtk-text-buffer-insert-range-interactive"><function>gtk_text_buffer_insert_range_interactive()</function></link>,
<link linkend="gtk-text-buffer-delete-interactive"><function>gtk_text_buffer_delete_interactive()</function></link>,
<link linkend="gtk-text-buffer-backspace"><function>gtk_text_buffer_backspace()</function></link>,
<link linkend="gtk-text-buffer-delete-selection"><function>gtk_text_buffer_delete_selection()</function></link>,
<link linkend="gtk-text-buffer-backspace"><function>gtk_text_buffer_backspace()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>textbuffer</parameter>&#160;:</term>
<listitem><simpara> the object which received the signal
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2><refsect2 id="GtkTextBuffer-insert-child-anchor" role="signal"><title>The <literal>&quot;insert-child-anchor&quot;</literal> signal</title>
<indexterm zone="GtkTextBuffer-insert-child-anchor"><primary sortas="TextBuffer::insert-child-anchor">GtkTextBuffer::insert-child-anchor</primary></indexterm><programlisting><link linkend="void">void</link>                user_function                      (<link linkend="GtkTextBuffer">GtkTextBuffer</link>      *textbuffer,
                                                        <link linkend="GtkTextIter">GtkTextIter</link>        *location,
                                                        <link linkend="GtkTextChildAnchor">GtkTextChildAnchor</link> *anchor,
                                                        <link linkend="gpointer">gpointer</link>            user_data)       : Run Last</programlisting>
<para>
The ::insert-child-anchor signal is emitted to insert a
<link linkend="GtkTextChildAnchor"><type>GtkTextChildAnchor</type></link> in a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>.
Insertion actually occurs in the default handler.
</para>
<para>
Note that if your handler runs before the default handler it must
not invalidate the <parameter>location</parameter> iter (or has to revalidate it). 
The default signal handler revalidates it to be placed after the 
inserted <parameter>anchor</parameter>.
</para>
<para>
See also: <link linkend="gtk-text-buffer-insert-child-anchor"><function>gtk_text_buffer_insert_child_anchor()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>textbuffer</parameter>&#160;:</term>
<listitem><simpara> the object which received the signal
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>location</parameter>&#160;:</term>
<listitem><simpara> position to insert <parameter>anchor</parameter> in <parameter>textbuffer</parameter>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>anchor</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GtkTextChildAnchor"><type>GtkTextChildAnchor</type></link> to be inserted
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2><refsect2 id="GtkTextBuffer-insert-pixbuf" role="signal"><title>The <literal>&quot;insert-pixbuf&quot;</literal> signal</title>
<indexterm zone="GtkTextBuffer-insert-pixbuf"><primary sortas="TextBuffer::insert-pixbuf">GtkTextBuffer::insert-pixbuf</primary></indexterm><programlisting><link linkend="void">void</link>                user_function                      (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *textbuffer,
                                                        <link linkend="GtkTextIter">GtkTextIter</link>   *location,
                                                        <link linkend="GdkPixbuf">GdkPixbuf</link>     *pixbuf,
                                                        <link linkend="gpointer">gpointer</link>       user_data)       : Run Last</programlisting>
<para>
The ::insert-pixbuf signal is emitted to insert a <link linkend="GdkPixbuf"><type>GdkPixbuf</type></link> 
in a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>. Insertion actually occurs in the default handler.
</para>
<para>
Note that if your handler runs before the default handler it must not 
invalidate the <parameter>location</parameter> iter (or has to revalidate it). 
The default signal handler revalidates it to be placed after the 
inserted <parameter>pixbuf</parameter>.
</para>
<para>
See also: <link linkend="gtk-text-buffer-insert-pixbuf"><function>gtk_text_buffer_insert_pixbuf()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>textbuffer</parameter>&#160;:</term>
<listitem><simpara> the object which received the signal
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>location</parameter>&#160;:</term>
<listitem><simpara> position to insert <parameter>pixbuf</parameter> in <parameter>textbuffer</parameter>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>pixbuf</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GdkPixbuf"><type>GdkPixbuf</type></link> to be inserted
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2><refsect2 id="GtkTextBuffer-insert-text" role="signal"><title>The <literal>&quot;insert-text&quot;</literal> signal</title>
<indexterm zone="GtkTextBuffer-insert-text"><primary sortas="TextBuffer::insert-text">GtkTextBuffer::insert-text</primary></indexterm><programlisting><link linkend="void">void</link>                user_function                      (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *textbuffer,
                                                        <link linkend="GtkTextIter">GtkTextIter</link>   *location,
                                                        <link linkend="gchar">gchar</link>         *text,
                                                        <link linkend="gint">gint</link>           len,
                                                        <link linkend="gpointer">gpointer</link>       user_data)       : Run Last</programlisting>
<para>
The ::insert-text signal is emitted to insert text in a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>.
Insertion actually occurs in the default handler.  
</para>
<para>
Note that if your handler runs before the default handler it must not 
invalidate the <parameter>location</parameter> iter (or has to revalidate it). 
The default signal handler revalidates it to point to the end of the 
inserted text.
</para>
<para>
See also: 
<link linkend="gtk-text-buffer-insert"><function>gtk_text_buffer_insert()</function></link>, 
<link linkend="gtk-text-buffer-insert-range"><function>gtk_text_buffer_insert_range()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>textbuffer</parameter>&#160;:</term>
<listitem><simpara> the object which received the signal
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>location</parameter>&#160;:</term>
<listitem><simpara> position to insert <parameter>text</parameter> in <parameter>textbuffer</parameter>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>text</parameter>&#160;:</term>
<listitem><simpara> the UTF-8 text to be inserted
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>len</parameter>&#160;:</term>
<listitem><simpara> length of the inserted text in bytes
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2><refsect2 id="GtkTextBuffer-mark-deleted" role="signal"><title>The <literal>&quot;mark-deleted&quot;</literal> signal</title>
<indexterm zone="GtkTextBuffer-mark-deleted"><primary sortas="TextBuffer::mark-deleted">GtkTextBuffer::mark-deleted</primary></indexterm><programlisting><link linkend="void">void</link>                user_function                      (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *textbuffer,
                                                        <link linkend="GtkTextMark">GtkTextMark</link>   *mark,
                                                        <link linkend="gpointer">gpointer</link>       user_data)       : Run Last</programlisting>
<para>
The ::mark-deleted signal is emitted as notification
after a <link linkend="GtkTextMark"><type>GtkTextMark</type></link> is deleted. 
</para>
<para>
See also:
<link linkend="gtk-text-buffer-delete-mark"><function>gtk_text_buffer_delete_mark()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>textbuffer</parameter>&#160;:</term>
<listitem><simpara> the object which received the signal
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>mark</parameter>&#160;:</term>
<listitem><simpara> The mark that was deleted
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2><refsect2 id="GtkTextBuffer-mark-set" role="signal"><title>The <literal>&quot;mark-set&quot;</literal> signal</title>
<indexterm zone="GtkTextBuffer-mark-set"><primary sortas="TextBuffer::mark-set">GtkTextBuffer::mark-set</primary></indexterm><programlisting><link linkend="void">void</link>                user_function                      (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *textbuffer,
                                                        <link linkend="GtkTextIter">GtkTextIter</link>   *location,
                                                        <link linkend="GtkTextMark">GtkTextMark</link>   *mark,
                                                        <link linkend="gpointer">gpointer</link>       user_data)       : Run Last</programlisting>
<para>
The ::mark-set signal is emitted as notification
after a <link linkend="GtkTextMark"><type>GtkTextMark</type></link> is set.
</para>
<para>
See also: 
<link linkend="gtk-text-buffer-create-mark"><function>gtk_text_buffer_create_mark()</function></link>,
<link linkend="gtk-text-buffer-move-mark"><function>gtk_text_buffer_move_mark()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>textbuffer</parameter>&#160;:</term>
<listitem><simpara> the object which received the signal
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>location</parameter>&#160;:</term>
<listitem><simpara> The location of <parameter>mark</parameter> in <parameter>textbuffer</parameter>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>mark</parameter>&#160;:</term>
<listitem><simpara> The mark that is set
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2><refsect2 id="GtkTextBuffer-modified-changed" role="signal"><title>The <literal>&quot;modified-changed&quot;</literal> signal</title>
<indexterm zone="GtkTextBuffer-modified-changed"><primary sortas="TextBuffer::modified-changed">GtkTextBuffer::modified-changed</primary></indexterm><programlisting><link linkend="void">void</link>                user_function                      (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *textbuffer,
                                                        <link linkend="gpointer">gpointer</link>       user_data)       : Run Last</programlisting>
<para>
The ::modified-changed signal is emitted when the modified bit of a 
<link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link> flips.
</para>
<para>
See also:
<link linkend="gtk-text-buffer-set-modified"><function>gtk_text_buffer_set_modified()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>textbuffer</parameter>&#160;:</term>
<listitem><simpara> the object which received the signal
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2><refsect2 id="GtkTextBuffer-paste-done" role="signal"><title>The <literal>&quot;paste-done&quot;</literal> signal</title>
<indexterm zone="GtkTextBuffer-paste-done" role="2.16"><primary sortas="TextBuffer::paste-done">GtkTextBuffer::paste-done</primary></indexterm><programlisting><link linkend="void">void</link>                user_function                      (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *textbuffer,
                                                        <link linkend="GtkClipboard">GtkClipboard</link>  *arg1,
                                                        <link linkend="gpointer">gpointer</link>       user_data)       : Run Last</programlisting>
<para>
The paste-done signal is emitted after paste operation has been completed.
This is useful to properly scroll the view to the end of the pasted text.
See <link linkend="gtk-text-buffer-paste-clipboard"><function>gtk_text_buffer_paste_clipboard()</function></link> for more details.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>textbuffer</parameter>&#160;:</term>
<listitem><simpara> the object which received the signal
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist><para>Since 2.16</para></refsect2><refsect2 id="GtkTextBuffer-remove-tag" role="signal"><title>The <literal>&quot;remove-tag&quot;</literal> signal</title>
<indexterm zone="GtkTextBuffer-remove-tag"><primary sortas="TextBuffer::remove-tag">GtkTextBuffer::remove-tag</primary></indexterm><programlisting><link linkend="void">void</link>                user_function                      (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *textbuffer,
                                                        <link linkend="GtkTextTag">GtkTextTag</link>    *tag,
                                                        <link linkend="GtkTextIter">GtkTextIter</link>   *start,
                                                        <link linkend="GtkTextIter">GtkTextIter</link>   *end,
                                                        <link linkend="gpointer">gpointer</link>       user_data)       : Run Last</programlisting>
<para>
The ::remove-tag signal is emitted to remove all occurrences of <parameter>tag</parameter> from
a range of text in a <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link>. 
Removal actually occurs in the default handler.
</para>
<para>
Note that if your handler runs before the default handler it must not 
invalidate the <parameter>start</parameter> and <parameter>end</parameter> iters (or has to revalidate them). 
</para>
<para>
See also: 
<link linkend="gtk-text-buffer-remove-tag"><function>gtk_text_buffer_remove_tag()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>textbuffer</parameter>&#160;:</term>
<listitem><simpara> the object which received the signal
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>tag</parameter>&#160;:</term>
<listitem><simpara> the tag to be removed
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>start</parameter>&#160;:</term>
<listitem><simpara> the start of the range the tag is removed from
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>end</parameter>&#160;:</term>
<listitem><simpara> the end of the range the tag is removed from
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2>
</refsect1>


<refsect1 id="GtkTextBuffer.see-also">
<title>See Also</title>
<para>
<link linkend="GtkTextView"><type>GtkTextView</type></link>, <link linkend="GtkTextIter"><type>GtkTextIter</type></link>, <link linkend="GtkTextMark"><type>GtkTextMark</type></link>
</para>
</refsect1>

</refentry>
