summaryrefslogtreecommitdiff
path: root/docs/html/class-gioicon.html
blob: aed715709459a1832669203850227a279c541699 (plain)
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>gio.Icon</title><link rel="stylesheet" href="style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><link rel="home" href="index.html" title="PyGObject Reference Manual"><link rel="up" href="gio-class-reference.html" title="PyGio Class Reference"><link rel="prev" href="class-giofilteroutputstream.html" title="gio.FilterOutputStream"><link rel="next" href="class-gioinputstream.html" title="gio.InputStream"></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">gio.Icon</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-giofilteroutputstream.html">Prev</a> </td><th width="60%" align="center">PyGio Class Reference</th><td width="20%" align="right"> <a accesskey="n" href="class-gioinputstream.html">Next</a></td></tr></table><hr></div><div class="refentry" title="gio.Icon"><a name="class-gioicon"></a><div class="titlepage"></div><div class="refnamediv"><h2>gio.Icon</h2><p>gio.Icon — Interface for icons.</p></div><div class="refsect1" title="Synopsis"><a name="id3054622"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">gio.Icon</span></span>(<span class="ooclass"><span class="classname"><a class="link" href="class-gobjectginterface.html" title="gobject.GInterface">gobject.GInterface</a></span></span>):
<code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-gioicon.html#method-gioicon--equal" title="gio.Icon.equal">equal</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>icon2</code></strong></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-gioicon.html#method-gioicon--to-string" title="gio.Icon.to_string">to_string</a></span>(<span class="methodparam"></span>)</code><br></pre></td></tr></table><pre class="programlisting">
<span class="bold"><strong>Functions</strong></span>
 
<code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-gioicon.html#function-gio--icon-new-from-string" title="gio.icon_new_from_string">gio.icon_new_from_string</a></span>(<span class="methodparam"></span>)</code></pre></div><div class="refsect1" title="Ancestry"><a name="id3054729"></a><h2>Ancestry</h2><pre class="synopsis">+-- <a class="link" href="class-gobjectginterface.html" title="gobject.GInterface">gobject.GInterface</a>
  +-- <a class="link" href="class-gioicon.html" title="gio.Icon">gio.Icon</a>
</pre></div><div class="refsect1" title="Known Derived Interfaces"><a name="id3054756"></a><h2>Known Derived Interfaces</h2><p>
            <a class="link" href="class-gioicon.html" title="gio.Icon"><code class="classname">gio.Icon</code></a> is required by
            <a class="link" href="class-gioloadableicon.html" title="gio.LoadableIcon"><code class="classname">gio.LoadableIcon</code></a>.
        </p></div><div class="refsect1" title="Known Implementation"><a name="id3054782"></a><h2>Known Implementation</h2><p>
            <a class="link" href="class-gioicon.html" title="gio.Icon"><code class="classname">gio.Icon</code></a> is implemented by
            <a class="link" href="class-giothemedicon.html" title="gio.ThemedIcon"><code class="classname">gio.ThemedIcon</code></a>,
            <a class="link" href="class-giofileicon.html" title="gio.FileIcon"><code class="classname">gio.FileIcon</code></a>,
            <a class="link" href="class-gioemblem.html" title="gio.Emblem"><code class="classname">gio.Emblem</code></a>,
            <a class="link" href="class-gioemblemedicon.html" title="gio.EmblemedIcon"><code class="classname">gio.EmblemedIcon</code></a>.
        </p></div><div class="refsect1" title="Description"><a name="id3058254"></a><h2>Description</h2><p>
            <a class="link" href="class-gioicon.html" title="gio.Icon"><code class="classname">gio.Icon</code></a>
            is a very minimal interface for icons. It provides functions for checking
            the equality of two icons, hashing of icons and serializing an icon to and from strings. 
        </p><p>
            <a class="link" href="class-gioicon.html" title="gio.Icon"><code class="classname">gio.Icon</code></a>
            does not provide the actual pixmap for the icon as this is out of GIO's
            scope, however implementations of
            <a class="link" href="class-gioicon.html" title="gio.Icon"><code class="classname">gio.Icon</code></a>
            may contain the name of an icon (see
            <a class="link" href="class-giothemedicon.html" title="gio.ThemedIcon"><code class="classname">gio.ThemedIcon</code></a>),
            or the path to an icon (see
            <a class="link" href="class-gioloadableicon.html" title="gio.LoadableIcon"><code class="classname">gio.LoadableIcon</code></a>).
        </p><p>
            To check if two GIcons are equal, see
            <code class="methodname"><a class="link" href="class-gioicon.html#method-gioicon--equal" title="gio.Icon.equal">gio.Icon.equal</a></code>().
        </p><p>
            For serializing a <a class="link" href="class-gioicon.html" title="gio.Icon"><code class="classname">gio.Icon</code></a>,
            use <code class="methodname"><PYGTKDOCLINK HREF="method-gioicon-%20-to-string">gio.Icon.to_string</PYGTKDOCLINK></code>() and
            <code class="methodname"><PYGTKDOCLINK HREF="method-gioicon-%20-new-from-string">gio.Icon.new_from_string</PYGTKDOCLINK></code>(). 
        </p><p>
            If your application or library provides one or more
            <a class="link" href="class-gioicon.html" title="gio.Icon"><code class="classname">gio.Icon</code></a>
            implementations you need to ensure that each GType is registered
            with the type system prior to calling
            <code class="methodname"><PYGTKDOCLINK HREF="function-gioicon--new-from-string">gio.icon_new_from_string</PYGTKDOCLINK></code>(). 
        </p></div><div class="refsect1" title="Methods"><a name="id3058365"></a><h2>Methods</h2><div class="refsect2" title="gio.Icon.equal"><a name="method-gioicon--equal"></a><h3>gio.Icon.equal</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">equal</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>icon2</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"><em class="parameter"><code>icon2</code></em> :</span></p></td><td>the second
                    <a class="link" href="class-gioicon.html" title="gio.Icon"><code class="classname">gio.Icon</code></a>
                    </td></tr></tbody></table><p>
                The <code class="methodname">equal</code>() method checks if two icons are equal.
            </p></div><div class="refsect2" title="gio.Icon.to_string"><a name="method-gioicon--to-string"></a><h3>gio.Icon.to_string</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">to_string</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>An UTF8 string or <code class="literal">None</code>
		    if icon can't be serialized.
                    </td></tr></tbody></table><p>
                The <code class="methodname">to_string</code>() method generates a textual
		representation of icon that can be used for serialization such as when
		passing icon to a different process or saving it to persistent storage. Use
		<code class="methodname"><a class="link" href="class-gioicon.html#function-gio--icon-new-from-string" title="gio.icon_new_from_string">gio.icon_new_from_string</a></code>()
		to get icon back from the returned string.
            </p><p>
		The encoding of the returned string is proprietary to GIcon except in the following two cases
	    </p><p>
		If icon is a <a class="link" href="class-giofileicon.html" title="gio.FileIcon"><code class="classname">gio.FileIcon</code></a>,
		the returned string is a native path (such as /path/to/my icon.png) without escaping
		if the <a class="link" href="class-giofile.html" title="gio.File"><code class="classname">gio.File</code></a>
		for icon is a native file. If the file is not native, the returned string is the result of
		<code class="methodname"><a class="link" href="class-giofile.html#method-giofile--get-uri" title="gio.File.get_uri">gio.File.get_uri</a></code>()
		(such as sftp://path/to/my%20icon.png).
	    </p><p>
		If icon is a <a class="link" href="class-giothemedicon.html" title="gio.ThemedIcon"><code class="classname">gio.ThemedIcon</code></a>
		with exactly one name, the encoding is simply the name (such as network-server).
	    </p></div></div><div class="refsect1" title="Functions"><a name="id3058543"></a><h2>Functions</h2><div class="refsect2" title="gio.icon_new_from_string"><a name="function-gio--icon-new-from-string"></a><h3>gio.icon_new_from_string</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">icon_new_from_string</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>str</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"><em class="parameter"><code>str</code></em> :</span></p></td><td>A string obtained via
		    <code class="methodname"><a class="link" href="class-gioicon.html#method-gioicon--to-string" title="gio.Icon.to_string">gio.Icon.to_string</a></code>().
                    </td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>An object implementing the
		    <a class="link" href="class-gioicon.html" title="gio.Icon"><code class="classname">gio.Icon</code></a>
		    interface or <code class="literal">None</code> if error is set.
                    </td></tr></tbody></table><p>
                The <code class="methodname">icon_new_from_string</code>() function generate a
		<a class="link" href="class-gioicon.html" title="gio.Icon"><code class="classname">gio.Icon</code></a>
		instance from str. This function can fail if str is not valid - see
		<code class="methodname"><a class="link" href="class-gioicon.html#method-gioicon--to-string" title="gio.Icon.to_string">gio.Icon.to_string</a></code>()
		for discussion.
            </p><p>
                If your application or library provides one or more GIcon implementations you need
		to ensure that each GType is registered with the type system prior to calling
		<code class="methodname"><a class="link" href="class-gioicon.html#function-gio--icon-new-from-string" title="gio.icon_new_from_string">gio.icon_new_from_string</a></code>().
            </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-giofilteroutputstream.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="gio-class-reference.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="class-gioinputstream.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">gio.FilterOutputStream </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> gio.InputStream</td></tr></table></div></body></html>