1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>gtksourceview.SourceLanguage</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><link rel="home" href="index.html" title="Python GtkSourceView Reference Manual"><link rel="up" href="gtksourceview-class-reference.html" title="The GtkSourceView Class Reference"><link rel="prev" href="class-gtksourcebuffer.html" title="gtksourceview.SourceBuffer"><link rel="next" href="class-gtksourcelanguagesmanager.html" title="gtksourceview.SourceLanguagesManager"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">gtksourceview.SourceLanguage</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-gtksourcebuffer.html">Prev</a> </td><th width="60%" align="center">The GtkSourceView Class Reference</th><td width="20%" align="right"> <a accesskey="n" href="class-gtksourcelanguagesmanager.html">Next</a></td></tr></table><hr></div><div class="refentry" title="gtksourceview.SourceLanguage"><a name="class-gtksourcelanguage"></a><div class="titlepage"></div><div class="refnamediv"><h2>gtksourceview.SourceLanguage</h2><p>gtksourceview.SourceLanguage — Source language object for <a class="link" href="class-gtksourceview.html" title="gtksourceview.SourceView">gtksourceview.SourceView</a></p></div><div class="refsect1" title="Synopsis"><a name="id2565588"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">gtksourceview.SourceLanguage</span></span>(<span class="ooclass"><span class="classname">gobject.GObject</span></span>):
<code class="constructorsynopsis"> <span class="methodname"><a class="link" href="class-gtksourcelanguage.html#constructor-gtksourcelanguage" title="Constructor">gtksourceview.SourceLanguage</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code></code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtksourcelanguage.html#method-gtksourcelanguage--get-name" title="gtksourceview.SourceLanguage.get_name">get_name</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtksourcelanguage.html#method-gtksourcelanguage--get-section" title="gtksourceview.SourceLanguage.get_section">get_section</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtksourcelanguage.html#method-gtksourcelanguage--get-tags" title="gtksourceview.SourceLanguage.get_tags">get_tags</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtksourcelanguage.html#method-gtksourcelanguage--get-escape-char" title="gtksourceview.SourceLanguage.get_escape_char">get_escape_char</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtksourcelanguage.html#method-gtksourcelanguage--get-mime-types" title="gtksourceview.SourceLanguage.get_mime_types">get_mime_types</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtksourcelanguage.html#method-gtksourcelanguage--set-mime-types" title="gtksourceview.SourceLanguage.set_mime_types">set_mime_types</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>mime_types</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtksourcelanguage.html#method-gtksourcelanguage--get-style-scheme" title="gtksourceview.SourceLanguage.get_style_scheme">get_style_scheme</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtksourcelanguage.html#method-gtksourcelanguage--set-style-scheme" title="gtksourceview.SourceLanguage.set_style_scheme">set_style_scheme</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>style_scheme</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtksourcelanguage.html#method-gtksourcelanguage--get-tag-style" title="gtksourceview.SourceLanguage.get_tag_style">get_tag_style</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtksourcelanguage.html#method-gtksourcelanguage--set-tag-style" title="gtksourceview.SourceLanguage.set_style_scheme">set_tag_style</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>tag_style</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtksourcelanguage.html#method-gtksourcelanguage--get-tag-default-style" title="gtksourceview.SourceLanguage.get_tag_default_style">get_tag_default_style</a></span>(<span class="methodparam"></span>)</code><br></pre></td></tr></table></div><div class="refsect1" title="Ancestry"><a name="id2583184"></a><h2>Ancestry</h2><pre class="synopsis">+-- gobject.GObject
+-- <a class="link" href="class-gtksourcelanguage.html" title="gtksourceview.SourceLanguage">gtksourceview.SourceLanguage</a>
</pre></div><div class="refsect1" title="Signal Prototypes"><a name="id2583220"></a><h2>Signal Prototypes</h2><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term">"<a class="link" href="class-gtksourcelanguage.html#signal-gtksourcelanguage--tag-style-changed" title='The "tag-style-changed" gtksourceview.SourceLanguage Signal'>"tag-style-changed"</a>"</span></p></td><td><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>sourcelanguage</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>arg1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></td></tr></tbody></table></div><div class="refsect1" title="Description"><a name="description-gtksourcelanguage"></a><h2>Description</h2><p>
</p></div><div class="refsect1" title="Constructor"><a name="constructor-gtksourcelanguage"></a><h2>Constructor</h2><pre class="programlisting"><code class="constructorsynopsis"> <span class="methodname">gtksourceview.SourceLanguage</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code></code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a new <a class="link" href="class-gtksourcelanguage.html" title="gtksourceview.SourceLanguage"><code class="classname">gtksourceview.SourceLanguage</code></a>.</td></tr></tbody></table><p>
Creates a new <a class="link" href="class-gtksourcelanguage.html" title="gtksourceview.SourceLanguage"><code class="classname">gtksourceview.SourceLanguage</code></a> object.
</p></div><div class="refsect1" title="Methods"><a name="id2588063"></a><h2>Methods</h2><div class="refsect2" title="gtksourceview.SourceLanguage.get_name"><a name="method-gtksourcelanguage--get-name"></a><h3>gtksourceview.SourceLanguage.get_name</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_name</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> the name of <em class="parameter"><code>language</code></em>.</td></tr></tbody></table><p>
The <code class="methodname">get_name</code>() method returns the localized name of the language.
</p></div><div class="refsect2" title="gtksourceview.SourceLanguage.get_section"><a name="method-gtksourcelanguage--get-section"></a><h3>gtksourceview.SourceLanguage.get_section</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_section</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> the section of <em class="parameter"><code>language</code></em>.</td></tr></tbody></table><p>
The <code class="methodname">get_section</code>() method returns the localized section of the language.
Each language belong to a section (ex. HTML belogs to the Markup section)
</p></div><div class="refsect2" title="gtksourceview.SourceLanguage.get_tags"><a name="method-gtksourcelanguage--get-tags"></a><h3>gtksourceview.SourceLanguage.get_tags</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_tags</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> a list of <a class="link" href="class-gtksourcetagstyle.html" title="gtksourceview.SourceTagStyle"><code class="classname">gtksourceview.SourceTagStyle</code></a>
objects.</td></tr></tbody></table><p>
The <code class="methodname">get_tags</code>() method Returns a list of tags for the given <em class="parameter"><code>language</code></em>.
You should unref the tags and free the list after usage.
</p></div><div class="refsect2" title="gtksourceview.SourceLanguage.get_escape_char"><a name="method-gtksourcelanguage--get-escape-char"></a><h3>gtksourceview.SourceLanguage.get_escape_char</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_escape_char</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> the value of the ESC character.</td></tr></tbody></table><p>
The <code class="methodname">get_escape_char</code>() method gets the value of the ESC character in the given <em class="parameter"><code>language</code></em>.
</p></div><div class="refsect2" title="gtksourceview.SourceLanguage.get_mime_types"><a name="method-gtksourcelanguage--get-mime-types"></a><h3>gtksourceview.SourceLanguage.get_mime_types</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_mime_types</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> a list of mime types (strings).</td></tr></tbody></table><p>
The <code class="methodname">get_mime_types</code>() method returns a list of mime types for the given <em class="parameter"><code>language</code></em>.
After usage you should free each element of the list as well as the list itself.
</p></div><div class="refsect2" title="gtksourceview.SourceLanguage.set_mime_types"><a name="method-gtksourcelanguage--set-mime-types"></a><h3>gtksourceview.SourceLanguage.set_mime_types</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_mime_types</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>mime_types</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>mime_types</code></strong> :</span></p></td><td> a list of mime types (strings).</td></tr></tbody></table><p>
The <code class="methodname">set_mime_types</code>() method sets a list of <em class="parameter"><code>mime_types</code></em> for the given
<em class="parameter"><code>language</code></em>. If <em class="parameter"><code>mime_types</code></em> is <code class="literal">None</code> this function
will use the default mime types from the language file.
</p></div><div class="refsect2" title="gtksourceview.SourceLanguage.get_style_scheme"><a name="method-gtksourcelanguage--get-style-scheme"></a><h3>gtksourceview.SourceLanguage.get_style_scheme</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_style_scheme</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> a <a class="link" href="class-gtksourcestylescheme.html" title="gtksourceview.SourceStyleScheme"><code class="classname">gtksourceview.SourceStyleScheme</code></a>.</td></tr></tbody></table><p>
The <code class="methodname">get_style_scheme</code>() method gets the style scheme associated with the given <em class="parameter"><code>language</code></em>.
</p></div><div class="refsect2" title="gtksourceview.SourceLanguage.set_style_scheme"><a name="method-gtksourcelanguage--set-style-scheme"></a><h3>gtksourceview.SourceLanguage.set_style_scheme</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_style_scheme</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>style_scheme</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>style_scheme</code></strong> :</span></p></td><td> a <a class="link" href="class-gtksourcestylescheme.html" title="gtksourceview.SourceStyleScheme"><code class="classname">gtksourceview.SourceStyleScheme</code></a>.</td></tr></tbody></table><p>
The <code class="methodname">set_style_scheme</code>() method Sets the style scheme of the given <em class="parameter"><code>language</code></em>.
</p></div><div class="refsect2" title="gtksourceview.SourceLanguage.get_tag_style"><a name="method-gtksourcelanguage--get-tag-style"></a><h3>gtksourceview.SourceLanguage.get_tag_style</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_tag_style</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>tag_id</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>tag_id</code></strong> :</span></p></td><td> the ID of a <a class="link" href="class-gtksourcetag.html" title="gtksourceview.SourceTag"><code class="classname">gtksourceview.SourceTag</code></a>.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> a <a class="link" href="class-gtksourcetagstyle.html" title="gtksourceview.SourceTagStyle"><code class="classname">gtksourceview.SourceTagStyle</code></a>.</td></tr></tbody></table><p>
The <code class="methodname">get_tag_style</code>() method gets the style of the tag whose ID is <em class="parameter"><code>tag_id</code></em>.
If the style is not defined then returns the default style.
</p></div><div class="refsect2" title="gtksourceview.SourceLanguage.set_style_scheme"><a name="method-gtksourcelanguage--set-tag-style"></a><h3>gtksourceview.SourceLanguage.set_style_scheme</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_tag_style</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>tag_id</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>style</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>tag_id</code></strong> :</span></p></td><td> the ID of a <a class="link" href="class-gtksourcetag.html" title="gtksourceview.SourceTag"><code class="classname">gtksourceview.SourceTag</code></a>.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>style</code></strong> :</span></p></td><td> a <a class="link" href="class-gtksourcetagstyle.html" title="gtksourceview.SourceTagStyle"><code class="classname">gtksourceview.SourceTagStyle</code></a>.</td></tr></tbody></table><p>
The <code class="methodname">set_tag_style</code>() method sets the <em class="parameter"><code>style</code></em> of the tag whose
ID is <em class="parameter"><code>tag_id</code></em>. If style is <code class="literal">None</code> restore the default <em class="parameter"><code>style</code></em>.
</p></div><div class="refsect2" title="gtksourceview.SourceLanguage.get_tag_default_style"><a name="method-gtksourcelanguage--get-tag-default-style"></a><h3>gtksourceview.SourceLanguage.get_tag_default_style</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_tag_default_style</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>tag_id</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>tag_id</code></strong> :</span></p></td><td> the ID of a <a class="link" href="class-gtksourcetag.html" title="gtksourceview.SourceTag"><code class="classname">gtksourceview.SourceTag</code></a>.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> a <a class="link" href="class-gtksourcetagstyle.html" title="gtksourceview.SourceTagStyle"><code class="classname">gtksourceview.SourceTagStyle</code></a>.</td></tr></tbody></table><p>
The <code class="methodname">get_tag_default_style</code>() method gets the default style of the tag whose ID is <em class="parameter"><code>tag_id</code></em>.
</p></div></div><div class="refsect1" title="Signals"><a name="id2603778"></a><h2>Signals</h2><div class="refsect2" title='The "tag-style-changed" gtksourceview.SourceLanguage Signal'><a name="signal-gtksourcelanguage--tag-style-changed"></a><h3>The "tag-style-changed" gtksourceview.SourceLanguage Signal</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>sourcelanguage</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>arg1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><em class="parameter"><code>sourcelanguage</code></em> :</span></p></td><td>the sourcelanguage that received the signal</td></tr><tr><td><p><span class="term"><em class="parameter"><code>arg1</code></em> :</span></p></td><td></td></tr><tr><td><p><span class="term"><em class="parameter"><code>user_param1</code></em> :</span></p></td><td>the first user parameter (if any) specified with the
<code class="methodname">connect</code>() method</td></tr><tr><td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td><td>additional user parameters (if any)</td></tr></tbody></table><p>
The "tag-style-changed" signal is emitted when ....
</p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="class-gtksourcebuffer.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="gtksourceview-class-reference.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="class-gtksourcelanguagesmanager.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">gtksourceview.SourceBuffer </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> gtksourceview.SourceLanguagesManager</td></tr></table></div></body></html>
|