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

<refnamediv>
<refname>GtkSourceLanguage</refname>
<refpurpose>Syntax highlighting language</refpurpose>
</refnamediv>

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

<synopsis>

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

                    <link linkend="GtkSourceLanguage-struct">GtkSourceLanguage</link>;
const <link linkend="gchar">gchar</link> *       <link linkend="gtk-source-language-get-id">gtk_source_language_get_id</link>          (<link linkend="GtkSourceLanguage">GtkSourceLanguage</link> *language);
const <link linkend="gchar">gchar</link> *       <link linkend="gtk-source-language-get-name">gtk_source_language_get_name</link>        (<link linkend="GtkSourceLanguage">GtkSourceLanguage</link> *language);
const <link linkend="gchar">gchar</link> *       <link linkend="gtk-source-language-get-section">gtk_source_language_get_section</link>     (<link linkend="GtkSourceLanguage">GtkSourceLanguage</link> *language);
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-source-language-get-hidden">gtk_source_language_get_hidden</link>      (<link linkend="GtkSourceLanguage">GtkSourceLanguage</link> *language);
const <link linkend="gchar">gchar</link> *       <link linkend="gtk-source-language-get-metadata">gtk_source_language_get_metadata</link>    (<link linkend="GtkSourceLanguage">GtkSourceLanguage</link> *language,
                                                         const <link linkend="gchar">gchar</link> *name);
<link linkend="gchar">gchar</link> **            <link linkend="gtk-source-language-get-mime-types">gtk_source_language_get_mime_types</link>  (<link linkend="GtkSourceLanguage">GtkSourceLanguage</link> *language);
<link linkend="gchar">gchar</link> **            <link linkend="gtk-source-language-get-globs">gtk_source_language_get_globs</link>       (<link linkend="GtkSourceLanguage">GtkSourceLanguage</link> *language);
const <link linkend="gchar">gchar</link> *       <link linkend="gtk-source-language-get-style-name">gtk_source_language_get_style_name</link>  (<link linkend="GtkSourceLanguage">GtkSourceLanguage</link> *language,
                                                         const <link linkend="gchar">gchar</link> *style_id);
<link linkend="gchar">gchar</link> **            <link linkend="gtk-source-language-get-style-ids">gtk_source_language_get_style_ids</link>   (<link linkend="GtkSourceLanguage">GtkSourceLanguage</link> *language);
</synopsis>
</refsynopsisdiv>

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





<refsect1 id="GtkSourceLanguage.properties" role="properties">
<title role="properties.title">Properties</title>
<synopsis>
  &quot;<link linkend="GtkSourceLanguage--hidden">hidden</link>&quot;                   <link linkend="gboolean">gboolean</link>              : Read
  &quot;<link linkend="GtkSourceLanguage--id">id</link>&quot;                       <link linkend="gchar">gchar</link>*                : Read
  &quot;<link linkend="GtkSourceLanguage--name">name</link>&quot;                     <link linkend="gchar">gchar</link>*                : Read
  &quot;<link linkend="GtkSourceLanguage--section">section</link>&quot;                  <link linkend="gchar">gchar</link>*                : Read
</synopsis>
</refsect1>



<refsect1 id="GtkSourceLanguage.description" role="desc">
<title role="desc.title">Description</title>
<para>
<link linkend="GtkSourceLanguage"><type>GtkSourceLanguage</type></link> encapsulates syntax and highlighting styles for a
particular language. Use <link linkend="GtkSourceLanguageManager"><type>GtkSourceLanguageManager</type></link> to obtain a
<link linkend="GtkSourceLanguage"><type>GtkSourceLanguage</type></link> instance, and <link linkend="gtk-source-buffer-set-language"><function>gtk_source_buffer_set_language()</function></link>
to apply it to a <link linkend="GtkSourceBuffer"><type>GtkSourceBuffer</type></link>.
</para>
</refsect1>

<refsect1 id="GtkSourceLanguage.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="GtkSourceLanguage-struct" role="struct">
<title>GtkSourceLanguage</title>
<indexterm zone="GtkSourceLanguage-struct"><primary sortas="GtkSourceLanguage">GtkSourceLanguage</primary></indexterm><programlisting>typedef struct _GtkSourceLanguage GtkSourceLanguage;</programlisting>
<para>
<structname>GtkSourceLanguage</structname> structure contains only
private members and should not be accessed directly.
</para></refsect2>
<refsect2 id="gtk-source-language-get-id" role="function">
<title>gtk_source_language_get_id ()</title>
<indexterm zone="gtk-source-language-get-id"><primary sortas="gtk_source_language_get_id">gtk_source_language_get_id</primary></indexterm><programlisting>const <link linkend="gchar">gchar</link> *       gtk_source_language_get_id          (<link linkend="GtkSourceLanguage">GtkSourceLanguage</link> *language);</programlisting>
<para>
Returns the ID of the language. The ID is not locale-dependent.</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> the ID of <parameter>language</parameter>.
The returned string is owned by <parameter>language</parameter> and should not be freed
or modified.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-source-language-get-name" role="function">
<title>gtk_source_language_get_name ()</title>
<indexterm zone="gtk-source-language-get-name"><primary sortas="gtk_source_language_get_name">gtk_source_language_get_name</primary></indexterm><programlisting>const <link linkend="gchar">gchar</link> *       gtk_source_language_get_name        (<link linkend="GtkSourceLanguage">GtkSourceLanguage</link> *language);</programlisting>
<para>
Returns the localized name of the language.</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> the name of <parameter>language</parameter>.
The returned string is owned by <parameter>language</parameter> and should not be freed
or modified.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-source-language-get-section" role="function">
<title>gtk_source_language_get_section ()</title>
<indexterm zone="gtk-source-language-get-section"><primary sortas="gtk_source_language_get_section">gtk_source_language_get_section</primary></indexterm><programlisting>const <link linkend="gchar">gchar</link> *       gtk_source_language_get_section     (<link linkend="GtkSourceLanguage">GtkSourceLanguage</link> *language);</programlisting>
<para>
Returns the localized section of the language.
Each language belong to a section (ex. HTML belogs to the
Markup section).</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> the section of <parameter>language</parameter>.
The returned string is owned by <parameter>language</parameter> and should not be freed
or modified.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-source-language-get-hidden" role="function">
<title>gtk_source_language_get_hidden ()</title>
<indexterm zone="gtk-source-language-get-hidden"><primary sortas="gtk_source_language_get_hidden">gtk_source_language_get_hidden</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_source_language_get_hidden      (<link linkend="GtkSourceLanguage">GtkSourceLanguage</link> *language);</programlisting>
<para>
Returns whether the language should be hidden from the user.</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> TRUE if the language should be hidden, FALSE otherwise.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-source-language-get-metadata" role="function">
<title>gtk_source_language_get_metadata ()</title>
<indexterm zone="gtk-source-language-get-metadata"><primary sortas="gtk_source_language_get_metadata">gtk_source_language_get_metadata</primary></indexterm><programlisting>const <link linkend="gchar">gchar</link> *       gtk_source_language_get_metadata    (<link linkend="GtkSourceLanguage">GtkSourceLanguage</link> *language,
                                                         const <link linkend="gchar">gchar</link> *name);</programlisting>
<para>
</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><parameter>name</parameter>&#160;:</term>
<listitem><simpara> metadata property name.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> value of property <parameter>name</parameter> stored in the metadata of <parameter>language</parameter>
or <link linkend="NULL--CAPS"><literal>NULL</literal></link> if language doesn't contain that metadata property.
The returned string is owned by <parameter>language</parameter> and should not be freed
or modified.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-source-language-get-mime-types" role="function">
<title>gtk_source_language_get_mime_types ()</title>
<indexterm zone="gtk-source-language-get-mime-types"><primary sortas="gtk_source_language_get_mime_types">gtk_source_language_get_mime_types</primary></indexterm><programlisting><link linkend="gchar">gchar</link> **            gtk_source_language_get_mime_types  (<link linkend="GtkSourceLanguage">GtkSourceLanguage</link> *language);</programlisting>
<para>
Returns the mime types associated to this language. This is just
an utility wrapper around <link linkend="gtk-source-language-get-metadata"><function>gtk_source_language_get_metadata()</function></link> to
retrieve the "mimetypes" metadata property and split it into an
array.</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 newly-allocated <link linkend="NULL--CAPS"><literal>NULL</literal></link> terminated array containing
the mime types or <link linkend="NULL--CAPS"><literal>NULL</literal></link> if no mime types are found.
The returned array must be freed with <link linkend="g-strfreev"><function>g_strfreev()</function></link>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-source-language-get-globs" role="function">
<title>gtk_source_language_get_globs ()</title>
<indexterm zone="gtk-source-language-get-globs"><primary sortas="gtk_source_language_get_globs">gtk_source_language_get_globs</primary></indexterm><programlisting><link linkend="gchar">gchar</link> **            gtk_source_language_get_globs       (<link linkend="GtkSourceLanguage">GtkSourceLanguage</link> *language);</programlisting>
<para>
Returns the globs associated to this language. This is just
an utility wrapper around <link linkend="gtk-source-language-get-metadata"><function>gtk_source_language_get_metadata()</function></link> to
retrieve the "globs" metadata property and split it into an array.</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 newly-allocated <link linkend="NULL--CAPS"><literal>NULL</literal></link> terminated array containing
the globs or <link linkend="NULL--CAPS"><literal>NULL</literal></link> if no globs are found.
The returned array must be freed with <link linkend="g-strfreev"><function>g_strfreev()</function></link>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-source-language-get-style-name" role="function">
<title>gtk_source_language_get_style_name ()</title>
<indexterm zone="gtk-source-language-get-style-name"><primary sortas="gtk_source_language_get_style_name">gtk_source_language_get_style_name</primary></indexterm><programlisting>const <link linkend="gchar">gchar</link> *       gtk_source_language_get_style_name  (<link linkend="GtkSourceLanguage">GtkSourceLanguage</link> *language,
                                                         const <link linkend="gchar">gchar</link> *style_id);</programlisting>
<para>
Returns the name of the style with ID <parameter>style_id</parameter> defined by this <parameter>language</parameter>.</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><parameter>style_id</parameter>&#160;:</term>
<listitem><simpara> a style ID
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the name of the style with ID <parameter>style_id</parameter> defined by this <parameter>language</parameter> or
<link linkend="NULL--CAPS"><literal>NULL</literal></link> if the style has no name or there is no style with ID <parameter>style_id</parameter> defined
by this <parameter>language</parameter>. The returned string is owned by the <parameter>language</parameter> and must
not be modified.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-source-language-get-style-ids" role="function">
<title>gtk_source_language_get_style_ids ()</title>
<indexterm zone="gtk-source-language-get-style-ids"><primary sortas="gtk_source_language_get_style_ids">gtk_source_language_get_style_ids</primary></indexterm><programlisting><link linkend="gchar">gchar</link> **            gtk_source_language_get_style_ids   (<link linkend="GtkSourceLanguage">GtkSourceLanguage</link> *language);</programlisting>
<para>
Returns the ids of the styles defined by this <parameter>language</parameter>.</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  <link linkend="NULL--CAPS"><literal>NULL</literal></link> terminated array containing
ids of the styles defined by this <parameter>language</parameter> or <link linkend="NULL--CAPS"><literal>NULL</literal></link> if no style is
defined.  The returned array must be freed with <link linkend="g-strfreev"><function>g_strfreev()</function></link>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>
<refsect1 id="GtkSourceLanguage.property-details" role="property_details">
<title role="property_details.title">Property Details</title>
<refsect2 id="GtkSourceLanguage--hidden" role="property"><title>The <literal>&quot;hidden&quot;</literal> property</title>
<indexterm zone="GtkSourceLanguage--hidden"><primary sortas="GtkSourceLanguage:hidden">GtkSourceLanguage:hidden</primary></indexterm><programlisting>  &quot;hidden&quot;                   <link linkend="gboolean">gboolean</link>              : Read</programlisting>
<para>Whether the language should be hidden from the user.</para><para>Default value: FALSE</para>
</refsect2>
<refsect2 id="GtkSourceLanguage--id" role="property"><title>The <literal>&quot;id&quot;</literal> property</title>
<indexterm zone="GtkSourceLanguage--id"><primary sortas="GtkSourceLanguage:id">GtkSourceLanguage:id</primary></indexterm><programlisting>  &quot;id&quot;                       <link linkend="gchar">gchar</link>*                : Read</programlisting>
<para>Language id.</para><para>Default value: NULL</para>
</refsect2>
<refsect2 id="GtkSourceLanguage--name" role="property"><title>The <literal>&quot;name&quot;</literal> property</title>
<indexterm zone="GtkSourceLanguage--name"><primary sortas="GtkSourceLanguage:name">GtkSourceLanguage:name</primary></indexterm><programlisting>  &quot;name&quot;                     <link linkend="gchar">gchar</link>*                : Read</programlisting>
<para>Language name.</para><para>Default value: NULL</para>
</refsect2>
<refsect2 id="GtkSourceLanguage--section" role="property"><title>The <literal>&quot;section&quot;</literal> property</title>
<indexterm zone="GtkSourceLanguage--section"><primary sortas="GtkSourceLanguage:section">GtkSourceLanguage:section</primary></indexterm><programlisting>  &quot;section&quot;                  <link linkend="gchar">gchar</link>*                : Read</programlisting>
<para>Language section.</para><para>Default value: NULL</para>
</refsect2>
</refsect1>



<refsect1 id="GtkSourceLanguage.see-also">
<title>See Also</title>
<para>
<link linkend="GtkSourceLanguageManager"><type>GtkSourceLanguageManager</type></link>
</para>
</refsect1>

</refentry>
