1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
<title>Panel Applet Factory</title>
6
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
7
<link rel="home" href="index.html" title="Panel Applet Library Reference Manual">
8
<link rel="up" href="reference.html" title="Part IV. API Reference">
9
<link rel="prev" href="panel-applet-Panel-Applet.html" title="Panel Applet">
10
<link rel="next" href="panel-applet-GConf-Utilities.html" title="GConf Utilities">
11
<meta name="generator" content="GTK-Doc V1.17.1 (XML mode)">
12
<link rel="stylesheet" href="style.css" type="text/css">
14
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
17
<td><a accesskey="p" href="panel-applet-Panel-Applet.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
18
<td><a accesskey="u" href="reference.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
19
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
20
<th width="100%" align="center">Panel Applet Library Reference Manual</th>
21
<td><a accesskey="n" href="panel-applet-GConf-Utilities.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
23
<tr><td colspan="5" class="shortcuts">
24
<a href="#panel-applet-Panel-Applet-Factory.synopsis" class="shortcut">Top</a>
26
<a href="#panel-applet-Panel-Applet-Factory.description" class="shortcut">Description</a>
29
<div class="refentry">
30
<a name="panel-applet-Panel-Applet-Factory"></a><div class="titlepage"></div>
31
<div class="refnamediv"><table width="100%"><tr>
33
<h2><span class="refentrytitle"><a name="panel-applet-Panel-Applet-Factory.top_of_page"></a>Panel Applet Factory</span></h2>
34
<p>Panel Applet Factory — the factory that will create applets.</p>
36
<td valign="top" align="right"></td>
38
<div class="refsect1">
39
<a name="panel-applet-Panel-Applet-Factory.stability-level"></a><h2>Stability Level</h2>
40
Unstable, unless otherwise indicated
42
<div class="refsynopsisdiv">
43
<a name="panel-applet-Panel-Applet-Factory.synopsis"></a><h2>Synopsis</h2>
44
<pre class="synopsis">
45
#include <panel-applet.h>
47
<span class="returnvalue">gboolean</span> (<a class="link" href="panel-applet-Panel-Applet-Factory.html#PanelAppletFactoryCallback" title="PanelAppletFactoryCallback ()">*PanelAppletFactoryCallback</a>) (<em class="parameter"><code><a class="link" href="panel-applet-Panel-Applet.html#PanelApplet"><span class="type">PanelApplet</span></a> *applet</code></em>,
48
<em class="parameter"><code>const <span class="type">gchar</span> *iid</code></em>,
49
<em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);
50
#define <a class="link" href="panel-applet-Panel-Applet-Factory.html#PANEL-APPLET-OUT-PROCESS-FACTORY:CAPS" title="PANEL_APPLET_OUT_PROCESS_FACTORY()">PANEL_APPLET_OUT_PROCESS_FACTORY</a> (id,
54
#define <a class="link" href="panel-applet-Panel-Applet-Factory.html#PANEL-APPLET-IN-PROCESS-FACTORY:CAPS" title="PANEL_APPLET_IN_PROCESS_FACTORY()">PANEL_APPLET_IN_PROCESS_FACTORY</a> (id,
58
<span class="returnvalue">int</span> <a class="link" href="panel-applet-Panel-Applet-Factory.html#panel-applet-factory-main" title="panel_applet_factory_main ()">panel_applet_factory_main</a> (<em class="parameter"><code>const <span class="type">gchar</span> *factory_id</code></em>,
59
<em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a> applet_type</code></em>,
60
<em class="parameter"><code><a class="link" href="panel-applet-Panel-Applet-Factory.html#PanelAppletFactoryCallback" title="PanelAppletFactoryCallback ()"><span class="type">PanelAppletFactoryCallback</span></a> callback</code></em>,
61
<em class="parameter"><code><span class="type">gpointer</span> data</code></em>);
64
<div class="refsect1">
65
<a name="panel-applet-Panel-Applet-Factory.description"></a><h2>Description</h2>
67
This API is used to create an <a class="link" href="getting-started.concepts.html#getting-started.concepts.applet-factory" title="Applet Factory">applet factory</a>. You
68
need to call one and only one of these functions to get applets working in
72
<div class="refsect1">
73
<a name="panel-applet-Panel-Applet-Factory.details"></a><h2>Details</h2>
74
<div class="refsect2">
75
<a name="PanelAppletFactoryCallback"></a><h3>PanelAppletFactoryCallback ()</h3>
76
<pre class="programlisting"><span class="returnvalue">gboolean</span> (*PanelAppletFactoryCallback) (<em class="parameter"><code><a class="link" href="panel-applet-Panel-Applet.html#PanelApplet"><span class="type">PanelApplet</span></a> *applet</code></em>,
77
<em class="parameter"><code>const <span class="type">gchar</span> *iid</code></em>,
78
<em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre>
80
The type used for callbacks after. The callback will usually check that <em class="parameter"><code>iid</code></em>
81
is a valid applet type identifier for the applet factory, and will then fill
82
<em class="parameter"><code>applet</code></em> with widgets, connect to signals, etc.
84
<div class="variablelist"><table border="0">
85
<col align="left" valign="top">
88
<td><p><span class="term"><em class="parameter"><code>applet</code></em> :</span></p></td>
89
<td>a newly-created <a class="link" href="panel-applet-Panel-Applet.html#PanelApplet"><span class="type">PanelApplet</span></a>.</td>
92
<td><p><span class="term"><em class="parameter"><code>iid</code></em> :</span></p></td>
93
<td>identifier of the requested applet type.</td>
96
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
100
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
102
<code class="literal">TRUE</code> if <em class="parameter"><code>iid</code></em> is a valid applet type identifier for the applet
103
factory and if the creation of <em class="parameter"><code>applet</code></em> was successfully completed, <code class="literal">FALSE</code>
110
<div class="refsect2">
111
<a name="PANEL-APPLET-OUT-PROCESS-FACTORY:CAPS"></a><h3>PANEL_APPLET_OUT_PROCESS_FACTORY()</h3>
112
<pre class="programlisting">#define PANEL_APPLET_OUT_PROCESS_FACTORY(id, type, callback, data)</pre>
114
Convenience macro providing a <code class="function">main()</code> function for an out-of-process applet.
115
Internally, it will call <a class="link" href="panel-applet-Panel-Applet-Factory.html#panel-applet-factory-main" title="panel_applet_factory_main ()"><code class="function">panel_applet_factory_main()</code></a> to create the
116
<em class="parameter"><code>factory_id</code></em> applet factory.
119
Applet instances created by the applet factory will use <em class="parameter"><code>applet_type</code></em> as
120
GType. Unless you subclass <a class="link" href="panel-applet-Panel-Applet.html#PanelApplet"><span class="type">PanelApplet</span></a>, you should use <code class="literal">PANEL_TYPE_APPLET</code>
121
as <em class="parameter"><code>applet_type</code></em>.
124
On creation of the applet instances, <em class="parameter"><code>callback</code></em> is called to setup the
125
applet. If <em class="parameter"><code>callback</code></em> returns <code class="literal">FALSE</code>, the creation of the applet instance is
129
It can only be used once, and is incompatible with the use of
130
<a class="link" href="panel-applet-Panel-Applet-Factory.html#PANEL-APPLET-IN-PROCESS-FACTORY:CAPS" title="PANEL_APPLET_IN_PROCESS_FACTORY()"><code class="literal">PANEL_APPLET_IN_PROCESS_FACTORY</code></a> and <a class="link" href="panel-applet-Panel-Applet-Factory.html#panel-applet-factory-main" title="panel_applet_factory_main ()"><code class="function">panel_applet_factory_main()</code></a>.
132
<div class="variablelist"><table border="0">
133
<col align="left" valign="top">
136
<td><p><span class="term"><em class="parameter"><code>id</code></em> :</span></p></td>
137
<td>identifier of an applet factory.</td>
140
<td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
141
<td>GType of the applet this factory creates.</td>
144
<td><p><span class="term"><em class="parameter"><code>callback</code></em> :</span></p></td>
145
<td>callback to be called when a new applet is created. <span class="annotation">[<a href="http://foldoc.org/scope%20call"><span class="acronym">scope call</span></a>]</span>
149
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
150
<td>callback data. <span class="annotation">[<a href="http://foldoc.org/closure"><span class="acronym">closure</span></a>]</span>
157
<div class="refsect2">
158
<a name="PANEL-APPLET-IN-PROCESS-FACTORY:CAPS"></a><h3>PANEL_APPLET_IN_PROCESS_FACTORY()</h3>
159
<pre class="programlisting">#define PANEL_APPLET_IN_PROCESS_FACTORY(id, type, callback, data)</pre>
161
Convenience macro providing the symbol needed to automatically register the
162
<em class="parameter"><code>factory_id</code></em> applet factory for an in-process applet.
165
Applet instances created by the applet factory will use <em class="parameter"><code>applet_type</code></em> as
166
GType. Unless you subclass <a class="link" href="panel-applet-Panel-Applet.html#PanelApplet"><span class="type">PanelApplet</span></a>, you should use <code class="literal">PANEL_TYPE_APPLET</code>
167
as <em class="parameter"><code>applet_type</code></em>.
170
On creation of the applet instances, <em class="parameter"><code>callback</code></em> is called to setup the
171
applet. If <em class="parameter"><code>callback</code></em> returns <code class="literal">FALSE</code>, the creation of the applet instance is
175
It can only be used once, and is incompatible with the use of
176
<a class="link" href="panel-applet-Panel-Applet-Factory.html#PANEL-APPLET-OUT-PROCESS-FACTORY:CAPS" title="PANEL_APPLET_OUT_PROCESS_FACTORY()"><code class="literal">PANEL_APPLET_OUT_PROCESS_FACTORY</code></a> and <a class="link" href="panel-applet-Panel-Applet-Factory.html#panel-applet-factory-main" title="panel_applet_factory_main ()"><code class="function">panel_applet_factory_main()</code></a>.
178
<div class="variablelist"><table border="0">
179
<col align="left" valign="top">
182
<td><p><span class="term"><em class="parameter"><code>id</code></em> :</span></p></td>
183
<td>identifier of an applet factory.</td>
186
<td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
187
<td>GType of the applet this factory creates.</td>
190
<td><p><span class="term"><em class="parameter"><code>callback</code></em> :</span></p></td>
191
<td>callback to be called when a new applet is created. <span class="annotation">[<a href="http://foldoc.org/scope%20call"><span class="acronym">scope call</span></a>]</span>
195
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
196
<td>callback data. <span class="annotation">[<a href="http://foldoc.org/closure"><span class="acronym">closure</span></a>]</span>
203
<div class="refsect2">
204
<a name="panel-applet-factory-main"></a><h3>panel_applet_factory_main ()</h3>
205
<pre class="programlisting"><span class="returnvalue">int</span> panel_applet_factory_main (<em class="parameter"><code>const <span class="type">gchar</span> *factory_id</code></em>,
206
<em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a> applet_type</code></em>,
207
<em class="parameter"><code><a class="link" href="panel-applet-Panel-Applet-Factory.html#PanelAppletFactoryCallback" title="PanelAppletFactoryCallback ()"><span class="type">PanelAppletFactoryCallback</span></a> callback</code></em>,
208
<em class="parameter"><code><span class="type">gpointer</span> data</code></em>);</pre>
210
Creates the applet factory for <em class="parameter"><code>factory_id</code></em>, so that the factory can create
211
instances of the applet types it is associated with.
214
Applet instances created by the applet factory will use <em class="parameter"><code>applet_type</code></em> as
215
GType. Unless you subclass <a class="link" href="panel-applet-Panel-Applet.html#PanelApplet"><span class="type">PanelApplet</span></a>, you should use <code class="literal">PANEL_TYPE_APPLET</code>
216
as <em class="parameter"><code>applet_type</code></em>.
219
On creation of the applet instances, <em class="parameter"><code>callback</code></em> is called to setup the
220
applet. If <em class="parameter"><code>callback</code></em> returns <code class="literal">FALSE</code>, the creation of the applet instance is
224
If using C, it is recommended to use <a class="link" href="panel-applet-Panel-Applet-Factory.html#PANEL-APPLET-OUT-PROCESS-FACTORY:CAPS" title="PANEL_APPLET_OUT_PROCESS_FACTORY()"><span class="type">PANEL_APPLET_OUT_PROCESS_FACTORY</span></a>
225
instead as it will create a <code class="function">main()</code> function for you.
228
It can only be used once, and is incompatible with the use of
229
<a class="link" href="panel-applet-Panel-Applet-Factory.html#PANEL-APPLET-IN-PROCESS-FACTORY:CAPS" title="PANEL_APPLET_IN_PROCESS_FACTORY()"><code class="literal">PANEL_APPLET_IN_PROCESS_FACTORY</code></a> and <a class="link" href="panel-applet-Panel-Applet-Factory.html#PANEL-APPLET-OUT-PROCESS-FACTORY:CAPS" title="PANEL_APPLET_OUT_PROCESS_FACTORY()"><code class="literal">PANEL_APPLET_OUT_PROCESS_FACTORY</code></a>.
231
<div class="variablelist"><table border="0">
232
<col align="left" valign="top">
235
<td><p><span class="term"><em class="parameter"><code>factory_id</code></em> :</span></p></td>
236
<td>identifier of an applet factory.</td>
239
<td><p><span class="term"><em class="parameter"><code>applet_type</code></em> :</span></p></td>
240
<td>GType of the applet this factory creates.</td>
243
<td><p><span class="term"><em class="parameter"><code>callback</code></em> :</span></p></td>
244
<td>callback to be called when a new applet is created. <span class="annotation">[<a href="http://foldoc.org/scope%20call"><span class="acronym">scope call</span></a>]</span>
248
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
249
<td>callback data. <span class="annotation">[<a href="http://foldoc.org/closure"><span class="acronym">closure</span></a>]</span>
253
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
254
<td>0 on success, 1 if there is an error.</td>
263
Generated by GTK-Doc V1.17.1</div>
b'\\ No newline at end of file'