<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
               "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
<!ENTITY version SYSTEM "version.xml">
<!ENTITY tutorial SYSTEM "lang-tutorial.sgml">
<!ENTITY reference SYSTEM "lang-reference.sgml">
]>
<refentry id="GtkSourceBuffer">
<refmeta>
<refentrytitle role="top_of_page" id="GtkSourceBuffer.top_of_page">GtkSourceBuffer</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTKSOURCEVIEW-2.0 Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>GtkSourceBuffer</refname>
<refpurpose>Text buffer object for <link linkend="GtkSourceView"><type>GtkSourceView</type></link></refpurpose>
</refnamediv>

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

<synopsis>

#include &lt;gtksourceview/gtksourcebuffer.h&gt;

                    <link linkend="GtkSourceBuffer-struct">GtkSourceBuffer</link>;
                    <link linkend="GtkSourceBufferClass">GtkSourceBufferClass</link>;
<link linkend="GtkSourceBuffer">GtkSourceBuffer</link> *   <link linkend="gtk-source-buffer-new">gtk_source_buffer_new</link>               (<link linkend="GtkTextTagTable">GtkTextTagTable</link> *table);
<link linkend="GtkSourceBuffer">GtkSourceBuffer</link> *   <link linkend="gtk-source-buffer-new-with-language">gtk_source_buffer_new_with_language</link> (<link linkend="GtkSourceLanguage">GtkSourceLanguage</link> *language);
<link linkend="void">void</link>                <link linkend="gtk-source-buffer-set-highlight-syntax">gtk_source_buffer_set_highlight_syntax</link>
                                                        (<link linkend="GtkSourceBuffer">GtkSourceBuffer</link> *buffer,
                                                         <link linkend="gboolean">gboolean</link> highlight);
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-source-buffer-get-highlight-syntax">gtk_source_buffer_get_highlight_syntax</link>
                                                        (<link linkend="GtkSourceBuffer">GtkSourceBuffer</link> *buffer);
<link linkend="void">void</link>                <link linkend="gtk-source-buffer-set-language">gtk_source_buffer_set_language</link>      (<link linkend="GtkSourceBuffer">GtkSourceBuffer</link> *buffer,
                                                         <link linkend="GtkSourceLanguage">GtkSourceLanguage</link> *language);
<link linkend="GtkSourceLanguage">GtkSourceLanguage</link> * <link linkend="gtk-source-buffer-get-language">gtk_source_buffer_get_language</link>      (<link linkend="GtkSourceBuffer">GtkSourceBuffer</link> *buffer);
<link linkend="void">void</link>                <link linkend="gtk-source-buffer-set-highlight-matching-brackets">gtk_source_buffer_set_highlight_matching_brackets</link>
                                                        (<link linkend="GtkSourceBuffer">GtkSourceBuffer</link> *buffer,
                                                         <link linkend="gboolean">gboolean</link> highlight);
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-source-buffer-get-highlight-matching-brackets">gtk_source_buffer_get_highlight_matching_brackets</link>
                                                        (<link linkend="GtkSourceBuffer">GtkSourceBuffer</link> *buffer);
<link linkend="void">void</link>                <link linkend="gtk-source-buffer-set-style-scheme">gtk_source_buffer_set_style_scheme</link>  (<link linkend="GtkSourceBuffer">GtkSourceBuffer</link> *buffer,
                                                         <link linkend="GtkSourceStyleScheme">GtkSourceStyleScheme</link> *scheme);
<link linkend="GtkSourceStyleScheme">GtkSourceStyleScheme</link> * <link linkend="gtk-source-buffer-get-style-scheme">gtk_source_buffer_get_style_scheme</link>
                                                        (<link linkend="GtkSourceBuffer">GtkSourceBuffer</link> *buffer);
<link linkend="gint">gint</link>                <link linkend="gtk-source-buffer-get-max-undo-levels">gtk_source_buffer_get_max_undo_levels</link>
                                                        (<link linkend="GtkSourceBuffer">GtkSourceBuffer</link> *buffer);
<link linkend="void">void</link>                <link linkend="gtk-source-buffer-set-max-undo-levels">gtk_source_buffer_set_max_undo_levels</link>
                                                        (<link linkend="GtkSourceBuffer">GtkSourceBuffer</link> *buffer,
                                                         <link linkend="gint">gint</link> max_undo_levels);
<link linkend="void">void</link>                <link linkend="gtk-source-buffer-redo">gtk_source_buffer_redo</link>              (<link linkend="GtkSourceBuffer">GtkSourceBuffer</link> *buffer);
<link linkend="void">void</link>                <link linkend="gtk-source-buffer-undo">gtk_source_buffer_undo</link>              (<link linkend="GtkSourceBuffer">GtkSourceBuffer</link> *buffer);
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-source-buffer-can-redo">gtk_source_buffer_can_redo</link>          (<link linkend="GtkSourceBuffer">GtkSourceBuffer</link> *buffer);
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-source-buffer-can-undo">gtk_source_buffer_can_undo</link>          (<link linkend="GtkSourceBuffer">GtkSourceBuffer</link> *buffer);
<link linkend="void">void</link>                <link linkend="gtk-source-buffer-begin-not-undoable-action">gtk_source_buffer_begin_not_undoable_action</link>
                                                        (<link linkend="GtkSourceBuffer">GtkSourceBuffer</link> *buffer);
<link linkend="void">void</link>                <link linkend="gtk-source-buffer-end-not-undoable-action">gtk_source_buffer_end_not_undoable_action</link>
                                                        (<link linkend="GtkSourceBuffer">GtkSourceBuffer</link> *buffer);
<link linkend="GtkSourceMark">GtkSourceMark</link> *     <link linkend="gtk-source-buffer-create-source-mark">gtk_source_buffer_create_source_mark</link>
                                                        (<link linkend="GtkSourceBuffer">GtkSourceBuffer</link> *buffer,
                                                         const <link linkend="gchar">gchar</link> *name,
                                                         const <link linkend="gchar">gchar</link> *category,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *where);
<link linkend="GSList">GSList</link> *            <link linkend="gtk-source-buffer-get-source-marks-at-line">gtk_source_buffer_get_source_marks_at_line</link>
                                                        (<link linkend="GtkSourceBuffer">GtkSourceBuffer</link> *buffer,
                                                         <link linkend="gint">gint</link> line,
                                                         const <link linkend="gchar">gchar</link> *category);
<link linkend="GSList">GSList</link> *            <link linkend="gtk-source-buffer-get-source-marks-at-iter">gtk_source_buffer_get_source_marks_at_iter</link>
                                                        (<link linkend="GtkSourceBuffer">GtkSourceBuffer</link> *buffer,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                                         const <link linkend="gchar">gchar</link> *category);
<link linkend="void">void</link>                <link linkend="gtk-source-buffer-remove-source-marks">gtk_source_buffer_remove_source_marks</link>
                                                        (<link linkend="GtkSourceBuffer">GtkSourceBuffer</link> *buffer,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *start,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *end,
                                                         const <link linkend="gchar">gchar</link> *category);
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-source-buffer-forward-iter-to-source-mark">gtk_source_buffer_forward_iter_to_source_mark</link>
                                                        (<link linkend="GtkSourceBuffer">GtkSourceBuffer</link> *buffer,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                                         const <link linkend="gchar">gchar</link> *category);
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-source-buffer-backward-iter-to-source-mark">gtk_source_buffer_backward_iter_to_source_mark</link>
                                                        (<link linkend="GtkSourceBuffer">GtkSourceBuffer</link> *buffer,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                                         const <link linkend="gchar">gchar</link> *category);
<link linkend="void">void</link>                <link linkend="gtk-source-buffer-ensure-highlight">gtk_source_buffer_ensure_highlight</link>  (<link linkend="GtkSourceBuffer">GtkSourceBuffer</link> *buffer,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *start,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *end);
</synopsis>
</refsynopsisdiv>

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





<refsect1 id="GtkSourceBuffer.properties" role="properties">
<title role="properties.title">Properties</title>
<synopsis>
  &quot;<link linkend="GtkSourceBuffer--can-redo">can-redo</link>&quot;                 <link linkend="gboolean">gboolean</link>              : Read
  &quot;<link linkend="GtkSourceBuffer--can-undo">can-undo</link>&quot;                 <link linkend="gboolean">gboolean</link>              : Read
  &quot;<link linkend="GtkSourceBuffer--highlight-matching-brackets">highlight-matching-brackets</link>&quot; <link linkend="gboolean">gboolean</link>              : Read / Write
  &quot;<link linkend="GtkSourceBuffer--highlight-syntax">highlight-syntax</link>&quot;         <link linkend="gboolean">gboolean</link>              : Read / Write
  &quot;<link linkend="GtkSourceBuffer--language">language</link>&quot;                 <link linkend="GtkSourceLanguage">GtkSourceLanguage</link>*    : Read / Write
  &quot;<link linkend="GtkSourceBuffer--max-undo-levels">max-undo-levels</link>&quot;          <link linkend="gint">gint</link>                  : Read / Write
  &quot;<link linkend="GtkSourceBuffer--style-scheme">style-scheme</link>&quot;             <link linkend="GtkSourceStyleScheme">GtkSourceStyleScheme</link>*  : Read / Write
</synopsis>
</refsect1>

<refsect1 id="GtkSourceBuffer.signals" role="signal_proto">
<title role="signal_proto.title">Signals</title>
<synopsis>
  &quot;<link linkend="GtkSourceBuffer-highlight-updated">highlight-updated</link>&quot;                              : Run Last
  &quot;<link linkend="GtkSourceBuffer-source-mark-updated">source-mark-updated</link>&quot;                            : Run Last
</synopsis>
</refsect1>


<refsect1 id="GtkSourceBuffer.description" role="desc">
<title role="desc.title">Description</title>
<para>
The <link linkend="GtkSourceBuffer"><type>GtkSourceBuffer</type></link> object is the model for <link linkend="GtkSourceView"><type>GtkSourceView</type></link> widgets.
It extends the <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link> object by adding features necessary to
display and edit source code: syntax highlighting, bracket matching
and markers.  It also implements support for undo/redo operations.
</para>
<para>
To create a <link linkend="GtkSourceBuffer"><type>GtkSourceBuffer</type></link> use <link linkend="gtk-source-buffer-new"><function>gtk_source_buffer_new()</function></link> or
<link linkend="gtk-source-buffer-new-with-language"><function>gtk_source_buffer_new_with_language()</function></link>.  The second form is just a
convenience function which allows you to initially set a
<link linkend="GtkSourceLanguage"><type>GtkSourceLanguage</type></link>.
</para>
<para>
By default highlighting is enabled, but you can disable it with
<link linkend="gtk-source-buffer-set-highlight-syntax"><function>gtk_source_buffer_set_highlight_syntax()</function></link>.
</para>
</refsect1>

<refsect1 id="GtkSourceBuffer.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="GtkSourceBuffer-struct" role="struct">
<title>GtkSourceBuffer</title>
<indexterm zone="GtkSourceBuffer-struct"><primary sortas="GtkSourceBuffer">GtkSourceBuffer</primary></indexterm><programlisting>typedef struct _GtkSourceBuffer GtkSourceBuffer;</programlisting>
<para>
</para></refsect2>
<refsect2 id="GtkSourceBufferClass" role="struct">
<title>GtkSourceBufferClass</title>
<indexterm zone="GtkSourceBufferClass"><primary sortas="GtkSourceBufferClass">GtkSourceBufferClass</primary></indexterm><programlisting>typedef struct {
	GtkTextBufferClass parent_class;

	/* Padding for future expansion */
	void (*_gtk_source_reserved1) (void);
	void (*_gtk_source_reserved2) (void);
	void (*_gtk_source_reserved3) (void);
	void (*_gtk_source_reserved4) (void);
	void (*_gtk_source_reserved5) (void);
	void (*_gtk_source_reserved6) (void);
} GtkSourceBufferClass;
</programlisting>
<para>
</para></refsect2>
<refsect2 id="gtk-source-buffer-new" role="function">
<title>gtk_source_buffer_new ()</title>
<indexterm zone="gtk-source-buffer-new"><primary sortas="gtk_source_buffer_new">gtk_source_buffer_new</primary></indexterm><programlisting><link linkend="GtkSourceBuffer">GtkSourceBuffer</link> *   gtk_source_buffer_new               (<link linkend="GtkTextTagTable">GtkTextTagTable</link> *table);</programlisting>
<para>
Creates a new source buffer.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>table</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextTagTable"><type>GtkTextTagTable</type></link>, 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 source buffer.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-source-buffer-new-with-language" role="function">
<title>gtk_source_buffer_new_with_language ()</title>
<indexterm zone="gtk-source-buffer-new-with-language"><primary sortas="gtk_source_buffer_new_with_language">gtk_source_buffer_new_with_language</primary></indexterm><programlisting><link linkend="GtkSourceBuffer">GtkSourceBuffer</link> *   gtk_source_buffer_new_with_language (<link linkend="GtkSourceLanguage">GtkSourceLanguage</link> *language);</programlisting>
<para>
Creates a new source buffer using the highlighting patterns in
<parameter>language</parameter>.  This is equivalent to creating a new source buffer with
a new tag table and then calling <link linkend="gtk-source-buffer-set-language"><function>gtk_source_buffer_set_language()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>language</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourceLanguage"><type>GtkSourceLanguage</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a new source buffer which will highlight text
according to the highlighting patterns in <parameter>language</parameter>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-source-buffer-set-highlight-syntax" role="function">
<title>gtk_source_buffer_set_highlight_syntax ()</title>
<indexterm zone="gtk-source-buffer-set-highlight-syntax"><primary sortas="gtk_source_buffer_set_highlight_syntax">gtk_source_buffer_set_highlight_syntax</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_source_buffer_set_highlight_syntax
                                                        (<link linkend="GtkSourceBuffer">GtkSourceBuffer</link> *buffer,
                                                         <link linkend="gboolean">gboolean</link> highlight);</programlisting>
<para>
Controls whether syntax is highlighted in the buffer. If <parameter>highlight</parameter>
is <link linkend="TRUE--CAPS"><literal>TRUE</literal></link>, the text will be highlighted according to the syntax
patterns specified in the language set with
<link linkend="gtk-source-buffer-set-language"><function>gtk_source_buffer_set_language()</function></link>. If <parameter>highlight</parameter> is <link linkend="FALSE--CAPS"><literal>FALSE</literal></link>, syntax highlighting
is disabled and all the GtkTextTag objects that have been added by the
syntax highlighting engine are removed from the buffer.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourceBuffer"><type>GtkSourceBuffer</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>highlight</parameter>&#160;:</term>
<listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> to enable syntax highlighting, <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> to disable it.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-source-buffer-get-highlight-syntax" role="function">
<title>gtk_source_buffer_get_highlight_syntax ()</title>
<indexterm zone="gtk-source-buffer-get-highlight-syntax"><primary sortas="gtk_source_buffer_get_highlight_syntax">gtk_source_buffer_get_highlight_syntax</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_source_buffer_get_highlight_syntax
                                                        (<link linkend="GtkSourceBuffer">GtkSourceBuffer</link> *buffer);</programlisting>
<para>
Determines whether syntax highlighting is activated in the source
buffer.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourceBuffer"><type>GtkSourceBuffer</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if syntax highlighting is enabled, <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> otherwise.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-source-buffer-set-language" role="function">
<title>gtk_source_buffer_set_language ()</title>
<indexterm zone="gtk-source-buffer-set-language"><primary sortas="gtk_source_buffer_set_language">gtk_source_buffer_set_language</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_source_buffer_set_language      (<link linkend="GtkSourceBuffer">GtkSourceBuffer</link> *buffer,
                                                         <link linkend="GtkSourceLanguage">GtkSourceLanguage</link> *language);</programlisting>
<para>
Associate a <link linkend="GtkSourceLanguage"><type>GtkSourceLanguage</type></link> with the source buffer. If <parameter>language</parameter> is
not-<link linkend="NULL--CAPS"><literal>NULL</literal></link> and syntax highlighting is enabled (see <link linkend="gtk-source-buffer-set-highlight-syntax"><function>gtk_source_buffer_set_highlight_syntax()</function></link>),
the syntax patterns defined in <parameter>language</parameter> will be used to highlight the text
contained in the buffer. If <parameter>language</parameter> is <link linkend="NULL--CAPS"><literal>NULL</literal></link>, the text contained in the
buffer is not highlighted.
</para>
<para>
The buffer holds a reference to <parameter>language</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourceBuffer"><type>GtkSourceBuffer</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>language</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourceLanguage"><type>GtkSourceLanguage</type></link> to set, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-source-buffer-get-language" role="function">
<title>gtk_source_buffer_get_language ()</title>
<indexterm zone="gtk-source-buffer-get-language"><primary sortas="gtk_source_buffer_get_language">gtk_source_buffer_get_language</primary></indexterm><programlisting><link linkend="GtkSourceLanguage">GtkSourceLanguage</link> * gtk_source_buffer_get_language      (<link linkend="GtkSourceBuffer">GtkSourceBuffer</link> *buffer);</programlisting>
<para>
Returns the <link linkend="GtkSourceLanguage"><type>GtkSourceLanguage</type></link> associated with the buffer,
see <link linkend="gtk-source-buffer-set-language"><function>gtk_source_buffer_set_language()</function></link>.  The returned object should not be
unreferenced by the user.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourceBuffer"><type>GtkSourceBuffer</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="GtkSourceLanguage"><type>GtkSourceLanguage</type></link> associated with the buffer, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-source-buffer-set-highlight-matching-brackets" role="function">
<title>gtk_source_buffer_set_highlight_matching_brackets ()</title>
<indexterm zone="gtk-source-buffer-set-highlight-matching-brackets"><primary sortas="gtk_source_buffer_set_highlight_matching_brackets">gtk_source_buffer_set_highlight_matching_brackets</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_source_buffer_set_highlight_matching_brackets
                                                        (<link linkend="GtkSourceBuffer">GtkSourceBuffer</link> *buffer,
                                                         <link linkend="gboolean">gboolean</link> highlight);</programlisting>
<para>
Controls the bracket match highlighting function in the buffer.  If
activated, when you position your cursor over a bracket character
(a parenthesis, a square bracket, etc.) the matching opening or
closing bracket character will be highlighted.  You can specify the
style with the <link linkend="gtk-source-buffer-set-bracket-match-style"><function>gtk_source_buffer_set_bracket_match_style()</function></link>
function.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourceBuffer"><type>GtkSourceBuffer</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>highlight</parameter>&#160;:</term>
<listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if you want matching brackets highlighted.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-source-buffer-get-highlight-matching-brackets" role="function">
<title>gtk_source_buffer_get_highlight_matching_brackets ()</title>
<indexterm zone="gtk-source-buffer-get-highlight-matching-brackets"><primary sortas="gtk_source_buffer_get_highlight_matching_brackets">gtk_source_buffer_get_highlight_matching_brackets</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_source_buffer_get_highlight_matching_brackets
                                                        (<link linkend="GtkSourceBuffer">GtkSourceBuffer</link> *buffer);</programlisting>
<para>
Determines whether bracket match highlighting is activated for the
source buffer.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourceBuffer"><type>GtkSourceBuffer</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the source buffer will highlight matching
brackets.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-source-buffer-set-style-scheme" role="function">
<title>gtk_source_buffer_set_style_scheme ()</title>
<indexterm zone="gtk-source-buffer-set-style-scheme"><primary sortas="gtk_source_buffer_set_style_scheme">gtk_source_buffer_set_style_scheme</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_source_buffer_set_style_scheme  (<link linkend="GtkSourceBuffer">GtkSourceBuffer</link> *buffer,
                                                         <link linkend="GtkSourceStyleScheme">GtkSourceStyleScheme</link> *scheme);</programlisting>
<para>
Sets style scheme used by the buffer.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourceBuffer"><type>GtkSourceBuffer</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>scheme</parameter>&#160;:</term>
<listitem><simpara> style scheme.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-source-buffer-get-style-scheme" role="function">
<title>gtk_source_buffer_get_style_scheme ()</title>
<indexterm zone="gtk-source-buffer-get-style-scheme"><primary sortas="gtk_source_buffer_get_style_scheme">gtk_source_buffer_get_style_scheme</primary></indexterm><programlisting><link linkend="GtkSourceStyleScheme">GtkSourceStyleScheme</link> * gtk_source_buffer_get_style_scheme
                                                        (<link linkend="GtkSourceBuffer">GtkSourceBuffer</link> *buffer);</programlisting>
<para>
Returns the <link linkend="GtkSourceStyleScheme"><type>GtkSourceStyleScheme</type></link> currently used in <parameter>buffer</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourceBuffer"><type>GtkSourceBuffer</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the <link linkend="GtkSourceStyleScheme"><type>GtkSourceStyleScheme</type></link> set by
<link linkend="gtk-source-buffer-set-style-scheme"><function>gtk_source_buffer_set_style_scheme()</function></link>, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-source-buffer-get-max-undo-levels" role="function">
<title>gtk_source_buffer_get_max_undo_levels ()</title>
<indexterm zone="gtk-source-buffer-get-max-undo-levels"><primary sortas="gtk_source_buffer_get_max_undo_levels">gtk_source_buffer_get_max_undo_levels</primary></indexterm><programlisting><link linkend="gint">gint</link>                gtk_source_buffer_get_max_undo_levels
                                                        (<link linkend="GtkSourceBuffer">GtkSourceBuffer</link> *buffer);</programlisting>
<para>
Determines the number of undo levels the buffer will track for
buffer edits.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourceBuffer"><type>GtkSourceBuffer</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the maximum number of possible undo levels or
              -1 if no limit is set.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-source-buffer-set-max-undo-levels" role="function">
<title>gtk_source_buffer_set_max_undo_levels ()</title>
<indexterm zone="gtk-source-buffer-set-max-undo-levels"><primary sortas="gtk_source_buffer_set_max_undo_levels">gtk_source_buffer_set_max_undo_levels</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_source_buffer_set_max_undo_levels
                                                        (<link linkend="GtkSourceBuffer">GtkSourceBuffer</link> *buffer,
                                                         <link linkend="gint">gint</link> max_undo_levels);</programlisting>
<para>
Sets the number of undo levels for user actions the buffer will
track.  If the number of user actions exceeds the limit set by this
function, older actions will be discarded.
</para>
<para>
If <parameter>max_undo_levels</parameter> is -1, no limit is set.
</para>
<para>
A new action is started whenever the function
<link linkend="gtk-text-buffer-begin-user-action"><function>gtk_text_buffer_begin_user_action()</function></link> is called.  In general, this
happens whenever the user presses any key which modifies the
buffer, but the undo manager will try to merge similar consecutive
actions, such as multiple character insertions into one action.
But, inserting a newline does start a new action.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourceBuffer"><type>GtkSourceBuffer</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>max_undo_levels</parameter>&#160;:</term>
<listitem><simpara> the desired maximum number of undo levels.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-source-buffer-redo" role="function">
<title>gtk_source_buffer_redo ()</title>
<indexterm zone="gtk-source-buffer-redo"><primary sortas="gtk_source_buffer_redo">gtk_source_buffer_redo</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_source_buffer_redo              (<link linkend="GtkSourceBuffer">GtkSourceBuffer</link> *buffer);</programlisting>
<para>
Redoes the last undo operation.  Use <link linkend="gtk-source-buffer-can-redo"><function>gtk_source_buffer_can_redo()</function></link>
to check whether a call to this function will have any effect.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourceBuffer"><type>GtkSourceBuffer</type></link>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-source-buffer-undo" role="function">
<title>gtk_source_buffer_undo ()</title>
<indexterm zone="gtk-source-buffer-undo"><primary sortas="gtk_source_buffer_undo">gtk_source_buffer_undo</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_source_buffer_undo              (<link linkend="GtkSourceBuffer">GtkSourceBuffer</link> *buffer);</programlisting>
<para>
Undoes the last user action which modified the buffer.  Use
<link linkend="gtk-source-buffer-can-undo"><function>gtk_source_buffer_can_undo()</function></link> to check whether a call to this
function will have any effect.
</para>
<para>
Actions are defined as groups of operations between a call to
<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>, or sequences of similar edits
(inserts or deletes) on the same line.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourceBuffer"><type>GtkSourceBuffer</type></link>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-source-buffer-can-redo" role="function">
<title>gtk_source_buffer_can_redo ()</title>
<indexterm zone="gtk-source-buffer-can-redo"><primary sortas="gtk_source_buffer_can_redo">gtk_source_buffer_can_redo</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_source_buffer_can_redo          (<link linkend="GtkSourceBuffer">GtkSourceBuffer</link> *buffer);</programlisting>
<para>
Determines whether a source buffer can redo the last action
(i.e. if the last operation was an undo).</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourceBuffer"><type>GtkSourceBuffer</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if a redo is possible.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-source-buffer-can-undo" role="function">
<title>gtk_source_buffer_can_undo ()</title>
<indexterm zone="gtk-source-buffer-can-undo"><primary sortas="gtk_source_buffer_can_undo">gtk_source_buffer_can_undo</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_source_buffer_can_undo          (<link linkend="GtkSourceBuffer">GtkSourceBuffer</link> *buffer);</programlisting>
<para>
Determines whether a source buffer can undo the last action.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourceBuffer"><type>GtkSourceBuffer</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if it's possible to undo the last action.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-source-buffer-begin-not-undoable-action" role="function">
<title>gtk_source_buffer_begin_not_undoable_action ()</title>
<indexterm zone="gtk-source-buffer-begin-not-undoable-action"><primary sortas="gtk_source_buffer_begin_not_undoable_action">gtk_source_buffer_begin_not_undoable_action</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_source_buffer_begin_not_undoable_action
                                                        (<link linkend="GtkSourceBuffer">GtkSourceBuffer</link> *buffer);</programlisting>
<para>
Marks the beginning of a not undoable action on the buffer,
disabling the undo manager.  Typically you would call this function
before initially setting the contents of the buffer (e.g. when
loading a file in a text editor).
</para>
<para>
You may nest <link linkend="gtk-source-buffer-begin-not-undoable-action"><function>gtk_source_buffer_begin_not_undoable_action()</function></link> /
<link linkend="gtk-source-buffer-end-not-undoable-action"><function>gtk_source_buffer_end_not_undoable_action()</function></link> blocks.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourceBuffer"><type>GtkSourceBuffer</type></link>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-source-buffer-end-not-undoable-action" role="function">
<title>gtk_source_buffer_end_not_undoable_action ()</title>
<indexterm zone="gtk-source-buffer-end-not-undoable-action"><primary sortas="gtk_source_buffer_end_not_undoable_action">gtk_source_buffer_end_not_undoable_action</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_source_buffer_end_not_undoable_action
                                                        (<link linkend="GtkSourceBuffer">GtkSourceBuffer</link> *buffer);</programlisting>
<para>
Marks the end of a not undoable action on the buffer.  When the
last not undoable block is closed through the call to this
function, the list of undo actions is cleared and the undo manager
is re-enabled.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourceBuffer"><type>GtkSourceBuffer</type></link>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-source-buffer-create-source-mark" role="function" condition="since:2.2">
<title>gtk_source_buffer_create_source_mark ()</title>
<indexterm zone="gtk-source-buffer-create-source-mark" role="2.2"><primary sortas="gtk_source_buffer_create_source_mark">gtk_source_buffer_create_source_mark</primary></indexterm><programlisting><link linkend="GtkSourceMark">GtkSourceMark</link> *     gtk_source_buffer_create_source_mark
                                                        (<link linkend="GtkSourceBuffer">GtkSourceBuffer</link> *buffer,
                                                         const <link linkend="gchar">gchar</link> *name,
                                                         const <link linkend="gchar">gchar</link> *category,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *where);</programlisting>
<para>
Creates a source mark in the <parameter>buffer</parameter> of category <parameter>category</parameter>.  A source mark is
a <link linkend="GtkTextMark"><type>GtkTextMark</type></link> but organised into categories. Depending on the category
a pixbuf can be specified that will be displayed along the line of the mark.
</para>
<para>
Like a <link linkend="GtkTextMark"><type>GtkTextMark</type></link>, a <link linkend="GtkSourceMark"><type>GtkSourceMark</type></link> can be anonymous if the
passed <parameter>name</parameter> is <link linkend="NULL--CAPS"><literal>NULL</literal></link>.  Also, the buffer owns the marks so you
shouldn't unreference it.
</para>
<para>
Marks always have left gravity and are moved to the beginning of
the line when the user deletes the line they were in.
</para>
<para>
Typical uses for a source mark are bookmarks, breakpoints, current
executing instruction indication in a source file, etc..</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourceBuffer"><type>GtkSourceBuffer</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>name</parameter>&#160;:</term>
<listitem><simpara> the name of the mark, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>category</parameter>&#160;:</term>
<listitem><simpara> a string defining the mark category.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>where</parameter>&#160;:</term>
<listitem><simpara> location to place the mark.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a new <link linkend="GtkSourceMark"><type>GtkSourceMark</type></link>, owned by the buffer.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gtk-source-buffer-get-source-marks-at-line" role="function" condition="since:2.2">
<title>gtk_source_buffer_get_source_marks_at_line ()</title>
<indexterm zone="gtk-source-buffer-get-source-marks-at-line" role="2.2"><primary sortas="gtk_source_buffer_get_source_marks_at_line">gtk_source_buffer_get_source_marks_at_line</primary></indexterm><programlisting><link linkend="GSList">GSList</link> *            gtk_source_buffer_get_source_marks_at_line
                                                        (<link linkend="GtkSourceBuffer">GtkSourceBuffer</link> *buffer,
                                                         <link linkend="gint">gint</link> line,
                                                         const <link linkend="gchar">gchar</link> *category);</programlisting>
<para>
Returns the list of marks of the given category at <parameter>line</parameter>.
If <parameter>category</parameter> is NULL, all marks at <parameter>line</parameter> are returned.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourceBuffer"><type>GtkSourceBuffer</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>line</parameter>&#160;:</term>
<listitem><simpara> a line number.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>category</parameter>&#160;:</term>
<listitem><simpara> category to search for or <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a newly allocated <link linkend="GSList"><type>GSList</type></link>.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gtk-source-buffer-get-source-marks-at-iter" role="function" condition="since:2.2">
<title>gtk_source_buffer_get_source_marks_at_iter ()</title>
<indexterm zone="gtk-source-buffer-get-source-marks-at-iter" role="2.2"><primary sortas="gtk_source_buffer_get_source_marks_at_iter">gtk_source_buffer_get_source_marks_at_iter</primary></indexterm><programlisting><link linkend="GSList">GSList</link> *            gtk_source_buffer_get_source_marks_at_iter
                                                        (<link linkend="GtkSourceBuffer">GtkSourceBuffer</link> *buffer,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                                         const <link linkend="gchar">gchar</link> *category);</programlisting>
<para>
Returns the list of marks of the given category at <parameter>iter</parameter>. If <parameter>category</parameter>
is <link linkend="NULL--CAPS"><literal>NULL</literal></link> it returns all marks at <parameter>iter</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourceBuffer"><type>GtkSourceBuffer</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>iter</parameter>&#160;:</term>
<listitem><simpara> an iterator.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>category</parameter>&#160;:</term>
<listitem><simpara> category to search for or <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a newly allocated <link linkend="GSList"><type>GSList</type></link>.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gtk-source-buffer-remove-source-marks" role="function" condition="since:2.2">
<title>gtk_source_buffer_remove_source_marks ()</title>
<indexterm zone="gtk-source-buffer-remove-source-marks" role="2.2"><primary sortas="gtk_source_buffer_remove_source_marks">gtk_source_buffer_remove_source_marks</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_source_buffer_remove_source_marks
                                                        (<link linkend="GtkSourceBuffer">GtkSourceBuffer</link> *buffer,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *start,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *end,
                                                         const <link linkend="gchar">gchar</link> *category);</programlisting>
<para>
Remove all marks of <parameter>category</parameter> between <parameter>start</parameter> and <parameter>end</parameter> from the buffer.
If <parameter>category</parameter> is NULL, all marks in the range will be removed.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourceBuffer"><type>GtkSourceBuffer</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>start</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextIter"><type>GtkTextIter</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>end</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkTextIter"><type>GtkTextIter</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>category</parameter>&#160;:</term>
<listitem><simpara> category to search for or NULL
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gtk-source-buffer-forward-iter-to-source-mark" role="function" condition="since:2.2">
<title>gtk_source_buffer_forward_iter_to_source_mark ()</title>
<indexterm zone="gtk-source-buffer-forward-iter-to-source-mark" role="2.2"><primary sortas="gtk_source_buffer_forward_iter_to_source_mark">gtk_source_buffer_forward_iter_to_source_mark</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_source_buffer_forward_iter_to_source_mark
                                                        (<link linkend="GtkSourceBuffer">GtkSourceBuffer</link> *buffer,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                                         const <link linkend="gchar">gchar</link> *category);</programlisting>
<para>
Moves <parameter>iter</parameter> to the position of the next <link linkend="GtkSourceMark"><type>GtkSourceMark</type></link> of the given
<parameter>category</parameter>. Returns <link linkend="TRUE--CAPS"><type>TRUE</type></link> if <parameter>iter</parameter> was moved. If <parameter>category</parameter> is NULL, the
next source mark can be of any category.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourceBuffer"><type>GtkSourceBuffer</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>iter</parameter>&#160;:</term>
<listitem><simpara> an iterator.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>category</parameter>&#160;:</term>
<listitem><simpara> category to search for or <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> whether iter moved.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gtk-source-buffer-backward-iter-to-source-mark" role="function" condition="since:2.2">
<title>gtk_source_buffer_backward_iter_to_source_mark ()</title>
<indexterm zone="gtk-source-buffer-backward-iter-to-source-mark" role="2.2"><primary sortas="gtk_source_buffer_backward_iter_to_source_mark">gtk_source_buffer_backward_iter_to_source_mark</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_source_buffer_backward_iter_to_source_mark
                                                        (<link linkend="GtkSourceBuffer">GtkSourceBuffer</link> *buffer,
                                                         <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                                         const <link linkend="gchar">gchar</link> *category);</programlisting>
<para>
Moves <parameter>iter</parameter> to the position of the previous <link linkend="GtkSourceMark"><type>GtkSourceMark</type></link> of the given
category. Returns <link linkend="TRUE--CAPS"><type>TRUE</type></link> if <parameter>iter</parameter> was moved. If <parameter>category</parameter> is NULL, the
previous source mark can be of any category.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourceBuffer"><type>GtkSourceBuffer</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>iter</parameter>&#160;:</term>
<listitem><simpara> an iterator.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>category</parameter>&#160;:</term>
<listitem><simpara> category to search for or <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> whether iter moved.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gtk-source-buffer-ensure-highlight" role="function">
<title>gtk_source_buffer_ensure_highlight ()</title>
<indexterm zone="gtk-source-buffer-ensure-highlight"><primary sortas="gtk_source_buffer_ensure_highlight">gtk_source_buffer_ensure_highlight</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_source_buffer_ensure_highlight  (<link linkend="GtkSourceBuffer">GtkSourceBuffer</link> *buffer,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *start,
                                                         const <link linkend="GtkTextIter">GtkTextIter</link> *end);</programlisting>
<para>
Forces buffer to analyze and highlight the given area synchronously.
</para>
<para>
<note>
  <para>
    This is a potentially slow operation and should be used only
    when you need to make sure that some text not currently
    visible is highlighted, for instance before printing.
  </para>
</note></para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourceBuffer"><type>GtkSourceBuffer</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>start</parameter>&#160;:</term>
<listitem><simpara> start of the area to highlight.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>end</parameter>&#160;:</term>
<listitem><simpara> end of the area to highlight.
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>
<refsect1 id="GtkSourceBuffer.property-details" role="property_details">
<title role="property_details.title">Property Details</title>
<refsect2 id="GtkSourceBuffer--can-redo" role="property"><title>The <literal>&quot;can-redo&quot;</literal> property</title>
<indexterm zone="GtkSourceBuffer--can-redo"><primary sortas="GtkSourceBuffer:can-redo">GtkSourceBuffer:can-redo</primary></indexterm><programlisting>  &quot;can-redo&quot;                 <link linkend="gboolean">gboolean</link>              : Read</programlisting>
<para>Whether Redo operation is possible.</para><para>Default value: FALSE</para>
</refsect2>
<refsect2 id="GtkSourceBuffer--can-undo" role="property"><title>The <literal>&quot;can-undo&quot;</literal> property</title>
<indexterm zone="GtkSourceBuffer--can-undo"><primary sortas="GtkSourceBuffer:can-undo">GtkSourceBuffer:can-undo</primary></indexterm><programlisting>  &quot;can-undo&quot;                 <link linkend="gboolean">gboolean</link>              : Read</programlisting>
<para>Whether Undo operation is possible.</para><para>Default value: FALSE</para>
</refsect2>
<refsect2 id="GtkSourceBuffer--highlight-matching-brackets" role="property"><title>The <literal>&quot;highlight-matching-brackets&quot;</literal> property</title>
<indexterm zone="GtkSourceBuffer--highlight-matching-brackets"><primary sortas="GtkSourceBuffer:highlight-matching-brackets">GtkSourceBuffer:highlight-matching-brackets</primary></indexterm><programlisting>  &quot;highlight-matching-brackets&quot; <link linkend="gboolean">gboolean</link>              : Read / Write</programlisting>
<para>
Whether to highlight matching brackets in the buffer.</para>
<para>
</para><para>Default value: TRUE</para>
</refsect2>
<refsect2 id="GtkSourceBuffer--highlight-syntax" role="property"><title>The <literal>&quot;highlight-syntax&quot;</literal> property</title>
<indexterm zone="GtkSourceBuffer--highlight-syntax"><primary sortas="GtkSourceBuffer:highlight-syntax">GtkSourceBuffer:highlight-syntax</primary></indexterm><programlisting>  &quot;highlight-syntax&quot;         <link linkend="gboolean">gboolean</link>              : Read / Write</programlisting>
<para>
Whether to highlight syntax in the buffer.</para>
<para>
</para><para>Default value: TRUE</para>
</refsect2>
<refsect2 id="GtkSourceBuffer--language" role="property"><title>The <literal>&quot;language&quot;</literal> property</title>
<indexterm zone="GtkSourceBuffer--language"><primary sortas="GtkSourceBuffer:language">GtkSourceBuffer:language</primary></indexterm><programlisting>  &quot;language&quot;                 <link linkend="GtkSourceLanguage">GtkSourceLanguage</link>*    : Read / Write</programlisting>
<para>Language object to get highlighting patterns from.</para></refsect2>
<refsect2 id="GtkSourceBuffer--max-undo-levels" role="property"><title>The <literal>&quot;max-undo-levels&quot;</literal> property</title>
<indexterm zone="GtkSourceBuffer--max-undo-levels"><primary sortas="GtkSourceBuffer:max-undo-levels">GtkSourceBuffer:max-undo-levels</primary></indexterm><programlisting>  &quot;max-undo-levels&quot;          <link linkend="gint">gint</link>                  : Read / Write</programlisting>
<para>
Number of undo levels for the buffer. -1 means no limit.</para>
<para>
</para><para>Allowed values: &gt;= -1</para>
<para>Default value: 1000</para>
</refsect2>
<refsect2 id="GtkSourceBuffer--style-scheme" role="property"><title>The <literal>&quot;style-scheme&quot;</literal> property</title>
<indexterm zone="GtkSourceBuffer--style-scheme"><primary sortas="GtkSourceBuffer:style-scheme">GtkSourceBuffer:style-scheme</primary></indexterm><programlisting>  &quot;style-scheme&quot;             <link linkend="GtkSourceStyleScheme">GtkSourceStyleScheme</link>*  : Read / Write</programlisting>
<para>
Style scheme. It contains styles for syntax highlighting, optionally
foreground, background, cursor color, current line color, and matching
brackets style.</para>
<para>
</para></refsect2>
</refsect1>

<refsect1 id="GtkSourceBuffer.signal-details" role="signals">
<title role="signals.title">Signal Details</title>
<refsect2 id="GtkSourceBuffer-highlight-updated" role="signal"><title>The <literal>&quot;highlight-updated&quot;</literal> signal</title>
<indexterm zone="GtkSourceBuffer-highlight-updated"><primary sortas="GtkSourceBuffer::highlight-updated">GtkSourceBuffer::highlight-updated</primary></indexterm><programlisting><link linkend="void">void</link>                user_function                      (<link linkend="GtkSourceBuffer">GtkSourceBuffer</link> *sourcebuffer,
                                                        <link linkend="GtkTextIter">GtkTextIter</link>     *arg1,
                                                        <link linkend="GtkTextIter">GtkTextIter</link>     *arg2,
                                                        <link linkend="gpointer">gpointer</link>         user_data)         : Run Last</programlisting>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>sourcebuffer</parameter>&#160;:</term>
<listitem><simpara>the object which received the signal.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>arg1</parameter>&#160;:</term>
<listitem><simpara>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>arg2</parameter>&#160;:</term>
<listitem><simpara>
</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="GtkSourceBuffer-source-mark-updated" role="signal"><title>The <literal>&quot;source-mark-updated&quot;</literal> signal</title>
<indexterm zone="GtkSourceBuffer-source-mark-updated"><primary sortas="GtkSourceBuffer::source-mark-updated">GtkSourceBuffer::source-mark-updated</primary></indexterm><programlisting><link linkend="void">void</link>                user_function                      (<link linkend="GtkSourceBuffer">GtkSourceBuffer</link> *buffer,
                                                        <link linkend="GtkTextMark">GtkTextMark</link>     *arg1,
                                                        <link linkend="gpointer">gpointer</link>         user_data)      : Run Last</programlisting>
<para>
The ::source_mark_updated signal is emitted each time
a mark is added to, moved or removed from the <parameter>buffer</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> the buffer that 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>
</refsect1>


<refsect1 id="GtkSourceBuffer.see-also">
<title>See Also</title>
<para>
There is an <link linkend="TextWidget">introduction</link> document
describing the basic concepts of the buffer/view interactions.
</para>
<para>
Check <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link> for information about the base buffer; and
<link linkend="GtkSourceView"><type>GtkSourceView</type></link> for examples on setting up the buffer to be displayed
in a view widget.
</para>
</refsect1>

</refentry>
