summaryrefslogtreecommitdiff
path: root/docs/reference/pygio-emblem.xml
blob: 032b0ff9d140dfe4e9392500559f8e5707ed9c96 (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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
<?xml version="1.0" standalone="no"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
    "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">

<refentry id="class-gioemblem">
    <refnamediv>
        <refname>gio.Emblem</refname>
        <refpurpose>An object for emblems.</refpurpose>
    </refnamediv>

    <refsect1>
        <title>Synopsis</title>

    <classsynopsis language="python">
        <ooclass><classname>gio.Emblem</classname></ooclass>
        <ooclass><classname><link linkend="class-gobject">gobject.GObject</link></classname></ooclass>
        <ooclass><classname><link linkend="class-gioicon">gio.Icon</link></classname></ooclass>
    
    <constructorsynopsis language="python">
	<methodname><link linkend="constructor-gioemblem">gio.Emblem</link></methodname>
	<methodparam><parameter role="keyword">icon</parameter></methodparam>
	<methodparam><parameter role="keyword">origin</parameter><initializer><literal>gio.EMBLEM_ORIGIN_UNKNOWN</literal></initializer></methodparam>
    </constructorsynopsis>
    
    <methodsynopsis language="python">
        <methodname><link linkend="method-gioemblem--get-icon">get_icon</link></methodname>
        <methodparam></methodparam>
    </methodsynopsis>
    <methodsynopsis language="python">
        <methodname><link linkend="method-gioemblem--get-origin">get_origin</link></methodname>
        <methodparam></methodparam>
    </methodsynopsis>
    
    </classsynopsis>

<programlisting>
<emphasis role="bold">Functions</emphasis>
 
<methodsynopsis language="python">
    <methodname><link linkend="function-gio--emblem-new-with-origin">gio.emblem_new_with_origin</link></methodname>
    <methodparam><parameter role="keyword">icon</parameter></methodparam>
    <methodparam><parameter role="keyword">origin</parameter></methodparam>
</methodsynopsis></programlisting>

    </refsect1>

    <refsect1>
        <title>Ancestry</title>

<synopsis>+-- <link linkend="class-gobject">gobject.GObject</link>
  +-- <link linkend="class-gioemblem">gio.Emblem</link>
</synopsis>

    </refsect1>
    
    <refsect1>
	<title>Implemented Interfaces</title>
        <para>
            <link linkend="class-gioemblem"><classname>gio.Emblem</classname></link>
            implements
            <link linkend="class-gioicon"><classname>gio.Icon</classname></link>
        </para>
    </refsect1>

    <refsect1 id="properties-gioemblem">
        <title>gio.Emblem Properties</title>
    
        <blockquote role="properties">
            <informaltable pgwide="1" frame="none">
                <tgroup cols="3">
                    <colspec column="1" colwidth="1in"/>
                    <colspec column="2" colwidth="1in"/>
                    <colspec column="3" colwidth="4in"/>
                    <tbody>
                        <row valign="top">
                            <entry>"icon"</entry>
                            <entry>Read - Write - Construct Only</entry>
                            <entry>The actual icon of the emblem.</entry>
                        </row>
                        <row valign="top">
                            <entry>"origin"</entry>
                            <entry>Read - Write - Construct Only</entry>
                            <entry>Tells which origin the emblem is derived from.</entry>
                        </row>
                    </tbody>
                </tgroup>
            </informaltable>
        </blockquote>
  
    </refsect1>

    <refsect1>
        <title>Description</title>

        <para>
            The <link linkend="class-gioemblem"><classname>gio.Emblem</classname></link>
            class is an implementation of <classname><link linkend="class-gioicon">gio.Icon</link></classname>
            that supports having an emblem, which is an icon with additional properties.
            It can then be added to a
            <link linkend="class-gioemblemedicon"><classname>gio.EmblemedIcon</classname></link>.
        </para>
        <para>
            Currently, only metainformation about the emblem's origin is supported.
            More may be added in the future.
        </para>
    </refsect1>

    <refsect1 id="constructor-gioemblem">
        <title>Constructor</title>
  
        <programlisting><constructorsynopsis language="python">
            <methodname>gio.Emblem</methodname>
            <methodparam><parameter role="keyword">icon</parameter></methodparam>
            <methodparam><parameter role="keyword">origin</parameter><initializer><literal>gio.EMBLEM_ORIGIN_UNKNOWN</literal></initializer></methodparam>
        </constructorsynopsis></programlisting>
        <variablelist>
            <varlistentry>
                <term><parameter>icon</parameter>&nbsp;:</term>
                <listitem><simpara>a
                <link linkend="class-gioicon"><classname>gio.Icon</classname></link> containing the icon.
                </simpara></listitem>
            </varlistentry>
            <varlistentry>
                <term><parameter>origin</parameter>&nbsp;:</term>
                <listitem><simpara>
                <link linkend="gio-emblem-origin-constants">origin</link> of the emblem.
                </simpara></listitem>
            </varlistentry>
            <varlistentry>
                <term><emphasis>Returns</emphasis>&nbsp;:</term>
                <listitem><simpara>a new
                <link linkend="class-gioemblem"><classname>gio.Emblem</classname></link>.
                </simpara></listitem>
            </varlistentry>
        </variablelist>

        <note>
          Parameter <parameter>origin</parameter> is available since PyGObject 2.20.
        </note>
    
        <para>
            Creates a new <link linkend="class-gioemblem"><classname>gio.Emblem</classname></link> for icon.
        </para>
  
    </refsect1>

    <refsect1>
        <title>Methods</title>

        <refsect2 id="method-gioemblem--get-icon">
            <title>gio.Emblem.get_icon</title>

            <programlisting><methodsynopsis language="python">
                <methodname>get_icon</methodname>
                <methodparam></methodparam>
            </methodsynopsis></programlisting>
            
            <variablelist>
                <varlistentry>
                    <term><emphasis>Returns</emphasis>&nbsp;:</term>
                    <listitem><simpara>a
                    <link linkend="class-gioicon"><classname>gio.Icon</classname></link>.
                    </simpara></listitem>
                </varlistentry>
            </variablelist>
    
            <para>
                The <methodname>get_icon</methodname>() method gives back the icon from emblem.
            </para>
        </refsect2>

        <refsect2 id="method-gioemblem--get-origin">
            <title>gio.Emblem.get_origin</title>

            <programlisting><methodsynopsis language="python">
                <methodname>get_origin</methodname>
                <methodparam></methodparam>
            </methodsynopsis></programlisting>
            
            <variablelist>
                <varlistentry>
                    <term><emphasis>Returns</emphasis>&nbsp;:</term>
                    <listitem><simpara>the origin of the emblem.
                    </simpara></listitem>
                </varlistentry>
            </variablelist>
    
            <para>
                The <methodname>get_origin</methodname>() method gets the origin of the emblem.
            </para>
        </refsect2>
    </refsect1>
    
    <refsect1>
        <title>Functions</title>

        <refsect2 id="function-gio--emblem-new-with-origin">
            <title>gio.emblem_new_with_origin</title>

            <programlisting><methodsynopsis language="python">
                <methodname>emblem_new_with_origin</methodname>
                <methodparam><parameter role="keyword">icon</parameter></methodparam>
                <methodparam><parameter role="keyword">origin</parameter></methodparam>
            </methodsynopsis></programlisting>
            
            <variablelist>
                <varlistentry>
                    <term><parameter>origin</parameter>&nbsp;:</term>
                    <listitem><simpara>a <xref linkend="gio-emblem-origin-constants" endterm="gio-emblem-origin-constants-title"></xref>
                    defining the emblem's origin.
                    </simpara></listitem>
                </varlistentry>
                <varlistentry>
                    <term><emphasis>Returns</emphasis>&nbsp;:</term>
                    <listitem><simpara>A <link linkend="class-gioemblem"><classname>gio.Emblem</classname></link>.
                    </simpara></listitem>
                </varlistentry>
            </variablelist>

            <note>
              While this method is not deprecated, with 2.20 and up it is recommended
              to use the constructor instead.
            </note>


            <para>
                The <methodname>emblem_new_with_origin</methodname>() function creates
                a new emblem for icon.
            </para>
        </refsect2>
    </refsect1>
</refentry>