<?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="GtkSourceStyleScheme">
<refmeta>
<refentrytitle role="top_of_page" id="GtkSourceStyleScheme.top_of_page">GtkSourceStyleScheme</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTKSOURCEVIEW-2.0 Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>GtkSourceStyleScheme</refname>
<refpurpose>Object controlling apperance of <link linkend="GtkSourceView"><type>GtkSourceView</type></link></refpurpose>
</refnamediv>

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

<synopsis>

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

                    <link linkend="GtkSourceStyleScheme-struct">GtkSourceStyleScheme</link>;
const <link linkend="gchar">gchar</link> *       <link linkend="gtk-source-style-scheme-get-id">gtk_source_style_scheme_get_id</link>      (<link linkend="GtkSourceStyleScheme">GtkSourceStyleScheme</link> *scheme);
const <link linkend="gchar">gchar</link> *       <link linkend="gtk-source-style-scheme-get-name">gtk_source_style_scheme_get_name</link>    (<link linkend="GtkSourceStyleScheme">GtkSourceStyleScheme</link> *scheme);
const <link linkend="gchar">gchar</link> *       <link linkend="gtk-source-style-scheme-get-description">gtk_source_style_scheme_get_description</link>
                                                        (<link linkend="GtkSourceStyleScheme">GtkSourceStyleScheme</link> *scheme);
const <link linkend="gchar">gchar</link> * const * <link linkend="gtk-source-style-scheme-get-authors">gtk_source_style_scheme_get_authors</link>
                                                        (<link linkend="GtkSourceStyleScheme">GtkSourceStyleScheme</link> *scheme);
const <link linkend="gchar">gchar</link> *       <link linkend="gtk-source-style-scheme-get-filename">gtk_source_style_scheme_get_filename</link>
                                                        (<link linkend="GtkSourceStyleScheme">GtkSourceStyleScheme</link> *scheme);
<link linkend="GtkSourceStyle">GtkSourceStyle</link> *    <link linkend="gtk-source-style-scheme-get-style">gtk_source_style_scheme_get_style</link>   (<link linkend="GtkSourceStyleScheme">GtkSourceStyleScheme</link> *scheme,
                                                         const <link linkend="gchar">gchar</link> *style_id);
</synopsis>
</refsynopsisdiv>

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





<refsect1 id="GtkSourceStyleScheme.properties" role="properties">
<title role="properties.title">Properties</title>
<synopsis>
  &quot;<link linkend="GtkSourceStyleScheme--description">description</link>&quot;              <link linkend="gchar">gchar</link>*                : Read
  &quot;<link linkend="GtkSourceStyleScheme--filename">filename</link>&quot;                 <link linkend="gchar">gchar</link>*                : Read
  &quot;<link linkend="GtkSourceStyleScheme--id">id</link>&quot;                       <link linkend="gchar">gchar</link>*                : Read / Write / Construct Only
  &quot;<link linkend="GtkSourceStyleScheme--name">name</link>&quot;                     <link linkend="gchar">gchar</link>*                : Read
</synopsis>
</refsect1>



<refsect1 id="GtkSourceStyleScheme.description" role="desc">
<title role="desc.title">Description</title>
<para>
<link linkend="GtkSourceStyleScheme"><type>GtkSourceStyleScheme</type></link> contains all the text styles to be used
in <link linkend="GtkSourceView"><type>GtkSourceView</type></link> and <link linkend="GtkSourceBuffer"><type>GtkSourceBuffer</type></link>. For instance, it contains
text styles for syntax highlighting, it may contain foreground
and background color for non-highlighted text, etc.
</para>
<para>
Style schemes are stored in XML files. The format of scheme file is
the following.
</para>
<para>
The toplevel tag in a style scheme file is <code>&lt;style-scheme&gt;</code>.
It has the following attributes:
<variablelist>
<varlistentry>
<term><code>id</code> (mandatory)</term>
<listitem><para>
Identifier for the style scheme. This is must be unique among style schemes.
</para></listitem>
</varlistentry>
<varlistentry>
<term><code>name</code> (mandatory)</term>
<listitem><para>
Name of the style scheme. This is the name of the scheme to display to user, e.g.
in a preferences dialog.
</para></listitem>
</varlistentry>
<varlistentry>
<term><code>_name</code></term>
<listitem><para>
This is the same as <code>name</code> attribute, except it will be translated.
<code>name</code> and <code>_name</code> may not be used simultaneously.
</para></listitem>
</varlistentry>
<varlistentry>
<term><code>parent-scheme</code> (optional)</term>
<listitem><para>
Style schemes may have <emphasis>parent</emphasis> schemes: all styles but those specified
in the scheme will be taken from the parent scheme. In this way a scheme may
be customized without copying all its content.
</para></listitem>
</varlistentry>
<varlistentry>
<term><code>version</code> (mandatory)</term>
<listitem><para>
Style scheme format identifier. At the moment it must be "1.0".
</para></listitem>
</varlistentry>
</variablelist>
</para>
<para>
<code>style-scheme</code> tag may contain the following tags:
<variablelist>
<varlistentry>
<term><code>author</code></term>
<listitem><para>
Name of the style scheme author.
</para></listitem>
</varlistentry>
<varlistentry>
<term><code>description</code></term>
<listitem><para>
Description of the style scheme.
</para></listitem>
</varlistentry>
<varlistentry>
<term><code>_description</code></term>
<listitem><para>
Same as <code>description</code> except it will be localized.
</para></listitem>
</varlistentry>
<varlistentry>
<term><code>color</code> tags</term>
<listitem><para>
These define color names to be used in <code>style</code> tags.
It has two attributes: <code>name</code> and <code>value</code>.
<code>value</code> is the hexadecimal color specification like
"&num;000000" or named color understood by Gdk prefixed with "&num;",
e.g. "&num;beige".
</para></listitem>
</varlistentry>
<varlistentry>
<term><code>style</code> tags</term>
<listitem><para>
See below for their format description.
</para></listitem>
</varlistentry>
</variablelist>
</para>
<para>
Each <code>style</code> tag describes a single element of style scheme (it corresponds
to <link linkend="GtkSourceStyle"><type>GtkSourceStyle</type></link> object). It has the following attributes:
<variablelist>
<varlistentry>
<term><code>name</code> (mandatory)</term>
<listitem><para>
Name of the style. It can be anything, syntax highlighting uses <emphasis>lang-id:style-id</emphasis>,
and there are few special styles which are used to control general appearance
of the text. Style scheme may contain other names to be used in an application. For instance,
it may define color to highlight compilation errors in a build log or a color for
bookmarks.
</para></listitem>
</varlistentry>
<varlistentry>
<term><code>foreground</code></term>
<listitem><para>
Foreground color. It may be name defined in one of <code>color</code> tags, or value in
hexadecimal format, e.g. "&num;000000", or symbolic name understood
by Gdk, prefixed with "&num;", e.g. "&num;magenta" or "&num;darkred".
</para></listitem>
</varlistentry>
<varlistentry>
<term><code>background</code></term>
<listitem><para>
Background color.
</para></listitem>
</varlistentry>
<varlistentry>
<term><code>italic</code></term>
<listitem><para>"true" or "false"</para></listitem>
</varlistentry>
<varlistentry>
<term><code>bold</code></term>
<listitem><para>"true" or "false"</para></listitem>
</varlistentry>
<varlistentry>
<term><code>underline</code></term>
<listitem><para>"true" or "false"</para></listitem>
</varlistentry>
<varlistentry>
<term><code>strikethrough</code></term>
<listitem><para>"true" or "false"</para></listitem>
</varlistentry>
</variablelist>
</para>
<para>
The following are names of styles which control <link linkend="GtkSourceView"><type>GtkSourceView</type></link> appearance:
<variablelist>
<varlistentry>
<term><code>text</code></term>
<listitem><para>Default style of text.</para></listitem>
</varlistentry>
<varlistentry>
<term><code>selection</code></term>
<listitem><para>Style of selected text.</para></listitem>
</varlistentry>
<varlistentry>
<term><code>selection-unfocused</code></term>
<listitem><para>Style of selected text when the widget doesn't have input focus.</para></listitem>
</varlistentry>
<varlistentry>
<term><code>cursor</code></term>
<listitem><para>Text cursor style. Only <code>foreground</code> attribute is used
for this style</para></listitem>
</varlistentry>
<varlistentry>
<term><code>secondary-cursor</code></term>
<listitem><para>Secondary cursor style (used in bidi text). Only <code>foreground</code> attribute
is used for this style. If this is not set while "cursor" is, then a color between text background
and cursor colors is chosen, so it is enough to use "cursor" style only.</para></listitem>
</varlistentry>
<varlistentry>
<term><code>current-line</code></term>
<listitem><para>Current line style. Only <code>background</code> attribute is used</para></listitem>
</varlistentry>
<varlistentry>
<term><code>line-numbers</code></term>
<listitem><para>Text and background colors for the left margin, on which line numbers are
drawn</para></listitem>
</varlistentry>
<varlistentry>
<term><code>bracket-match</code></term>
<listitem><para>Style to use for matching brackets.</para></listitem>
</varlistentry>
<varlistentry>
<term><code>bracket-mismatch</code></term>
<listitem><para>Style to use for mismatching brackets.</para></listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>

<refsect1 id="GtkSourceStyleScheme.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="GtkSourceStyleScheme-struct" role="struct">
<title>GtkSourceStyleScheme</title>
<indexterm zone="GtkSourceStyleScheme-struct"><primary sortas="GtkSourceStyleScheme">GtkSourceStyleScheme</primary></indexterm><programlisting>typedef struct _GtkSourceStyleScheme GtkSourceStyleScheme;</programlisting>
<para>
<structname>GtkSourceStyleScheme</structname> structure contains only
private members and should not be accessed directly.
</para></refsect2>
<refsect2 id="gtk-source-style-scheme-get-id" role="function" condition="since:2.0">
<title>gtk_source_style_scheme_get_id ()</title>
<indexterm zone="gtk-source-style-scheme-get-id" role="2.0"><primary sortas="gtk_source_style_scheme_get_id">gtk_source_style_scheme_get_id</primary></indexterm><programlisting>const <link linkend="gchar">gchar</link> *       gtk_source_style_scheme_get_id      (<link linkend="GtkSourceStyleScheme">GtkSourceStyleScheme</link> *scheme);</programlisting>
<para>
</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>scheme</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourceStyleScheme"><type>GtkSourceStyleScheme</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <parameter>scheme</parameter> id.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.0</para></refsect2>
<refsect2 id="gtk-source-style-scheme-get-name" role="function" condition="since:2.0">
<title>gtk_source_style_scheme_get_name ()</title>
<indexterm zone="gtk-source-style-scheme-get-name" role="2.0"><primary sortas="gtk_source_style_scheme_get_name">gtk_source_style_scheme_get_name</primary></indexterm><programlisting>const <link linkend="gchar">gchar</link> *       gtk_source_style_scheme_get_name    (<link linkend="GtkSourceStyleScheme">GtkSourceStyleScheme</link> *scheme);</programlisting>
<para>
</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>scheme</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourceStyleScheme"><type>GtkSourceStyleScheme</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <parameter>scheme</parameter> name.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.0</para></refsect2>
<refsect2 id="gtk-source-style-scheme-get-description" role="function" condition="since:2.0">
<title>gtk_source_style_scheme_get_description ()</title>
<indexterm zone="gtk-source-style-scheme-get-description" role="2.0"><primary sortas="gtk_source_style_scheme_get_description">gtk_source_style_scheme_get_description</primary></indexterm><programlisting>const <link linkend="gchar">gchar</link> *       gtk_source_style_scheme_get_description
                                                        (<link linkend="GtkSourceStyleScheme">GtkSourceStyleScheme</link> *scheme);</programlisting>
<para>
</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>scheme</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourceStyleScheme"><type>GtkSourceStyleScheme</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <parameter>scheme</parameter> description (if defined) or NULL.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.0</para></refsect2>
<refsect2 id="gtk-source-style-scheme-get-authors" role="function" condition="since:2.0">
<title>gtk_source_style_scheme_get_authors ()</title>
<indexterm zone="gtk-source-style-scheme-get-authors" role="2.0"><primary sortas="gtk_source_style_scheme_get_authors">gtk_source_style_scheme_get_authors</primary></indexterm><programlisting>const <link linkend="gchar">gchar</link> * const * gtk_source_style_scheme_get_authors
                                                        (<link linkend="GtkSourceStyleScheme">GtkSourceStyleScheme</link> *scheme);</programlisting>
<para>
</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>scheme</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourceStyleScheme"><type>GtkSourceStyleScheme</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a <link linkend="NULL--CAPS"><literal>NULL</literal></link>-terminated array containing the <parameter>scheme</parameter> authors or
<link linkend="NULL--CAPS"><literal>NULL</literal></link> if no author is specified by the style
scheme.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.0</para></refsect2>
<refsect2 id="gtk-source-style-scheme-get-filename" role="function" condition="since:2.0">
<title>gtk_source_style_scheme_get_filename ()</title>
<indexterm zone="gtk-source-style-scheme-get-filename" role="2.0"><primary sortas="gtk_source_style_scheme_get_filename">gtk_source_style_scheme_get_filename</primary></indexterm><programlisting>const <link linkend="gchar">gchar</link> *       gtk_source_style_scheme_get_filename
                                                        (<link linkend="GtkSourceStyleScheme">GtkSourceStyleScheme</link> *scheme);</programlisting>
<para>
</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>scheme</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourceStyleScheme"><type>GtkSourceStyleScheme</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <parameter>scheme</parameter> file name if the scheme was created parsing a
style scheme file or NULL in the other cases.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.0</para></refsect2>
<refsect2 id="gtk-source-style-scheme-get-style" role="function" condition="since:2.0">
<title>gtk_source_style_scheme_get_style ()</title>
<indexterm zone="gtk-source-style-scheme-get-style" role="2.0"><primary sortas="gtk_source_style_scheme_get_style">gtk_source_style_scheme_get_style</primary></indexterm><programlisting><link linkend="GtkSourceStyle">GtkSourceStyle</link> *    gtk_source_style_scheme_get_style   (<link linkend="GtkSourceStyleScheme">GtkSourceStyleScheme</link> *scheme,
                                                         const <link linkend="gchar">gchar</link> *style_id);</programlisting>
<para>
</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>scheme</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkSourceStyleScheme"><type>GtkSourceStyleScheme</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>style_id</parameter>&#160;:</term>
<listitem><simpara> id of the style to retrieve.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> style which corresponds to <parameter>style_id</parameter> in the <parameter>scheme</parameter>,
or <link linkend="NULL--CAPS"><literal>NULL</literal></link> when no style with this name found. It is owned by <parameter>scheme</parameter>
and may not be unref'ed.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.0</para></refsect2>

</refsect1>
<refsect1 id="GtkSourceStyleScheme.property-details" role="property_details">
<title role="property_details.title">Property Details</title>
<refsect2 id="GtkSourceStyleScheme--description" role="property"><title>The <literal>&quot;description&quot;</literal> property</title>
<indexterm zone="GtkSourceStyleScheme--description"><primary sortas="GtkSourceStyleScheme:description">GtkSourceStyleScheme:description</primary></indexterm><programlisting>  &quot;description&quot;              <link linkend="gchar">gchar</link>*                : Read</programlisting>
<para>Style scheme description.</para><para>Default value: NULL</para>
</refsect2>
<refsect2 id="GtkSourceStyleScheme--filename" role="property"><title>The <literal>&quot;filename&quot;</literal> property</title>
<indexterm zone="GtkSourceStyleScheme--filename"><primary sortas="GtkSourceStyleScheme:filename">GtkSourceStyleScheme:filename</primary></indexterm><programlisting>  &quot;filename&quot;                 <link linkend="gchar">gchar</link>*                : Read</programlisting>
<para>
Style scheme filename or NULL.</para>
<para>
</para><para>Default value: NULL</para>
</refsect2>
<refsect2 id="GtkSourceStyleScheme--id" role="property"><title>The <literal>&quot;id&quot;</literal> property</title>
<indexterm zone="GtkSourceStyleScheme--id"><primary sortas="GtkSourceStyleScheme:id">GtkSourceStyleScheme:id</primary></indexterm><programlisting>  &quot;id&quot;                       <link linkend="gchar">gchar</link>*                : Read / Write / Construct Only</programlisting>
<para>
Style scheme id, a unique string used to identify the style scheme
in <link linkend="GtkSourceStyleSchemeManager"><type>GtkSourceStyleSchemeManager</type></link>.</para>
<para>
</para><para>Default value: NULL</para>
</refsect2>
<refsect2 id="GtkSourceStyleScheme--name" role="property"><title>The <literal>&quot;name&quot;</literal> property</title>
<indexterm zone="GtkSourceStyleScheme--name"><primary sortas="GtkSourceStyleScheme:name">GtkSourceStyleScheme:name</primary></indexterm><programlisting>  &quot;name&quot;                     <link linkend="gchar">gchar</link>*                : Read</programlisting>
<para>
Style scheme name, a translatable string to present to user.</para>
<para>
</para><para>Default value: NULL</para>
</refsect2>
</refsect1>



<refsect1 id="GtkSourceStyleScheme.see-also">
<title>See Also</title>
<para>
<link linkend="GtkSourceStyle"><type>GtkSourceStyle</type></link>, <link linkend="GtkSourceStyleSchemeManager"><type>GtkSourceStyleSchemeManager</type></link>
</para>
</refsect1>

</refentry>
