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>GUPnPContextManager</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
7 <link rel="home" href="index.html" title="GUPnP Reference Manual">
8 <link rel="up" href="api-utility.html" title="Utility Functions">
9 <link rel="prev" href="GUPnPContext.html" title="GUPnPContext">
10 <link rel="next" href="GUPnPResourceFactory.html" title="GUPnPResourceFactory">
11 <meta name="generator" content="GTK-Doc V1.18 (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="GUPnPContext.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
18 <td><a accesskey="u" href="api-utility.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">GUPnP Reference Manual</th>
21 <td><a accesskey="n" href="GUPnPResourceFactory.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="#GUPnPContextManager.synopsis" class="shortcut">Top</a>
26 <a href="#GUPnPContextManager.description" class="shortcut">Description</a>
28 <a href="#GUPnPContextManager.object-hierarchy" class="shortcut">Object Hierarchy</a>
30 <a href="#GUPnPContextManager.properties" class="shortcut">Properties</a>
32 <a href="#GUPnPContextManager.signals" class="shortcut">Signals</a>
35 <div class="refentry">
36 <a name="GUPnPContextManager"></a><div class="titlepage"></div>
37 <div class="refnamediv"><table width="100%"><tr>
39 <h2><span class="refentrytitle"><a name="GUPnPContextManager.top_of_page"></a>GUPnPContextManager</span></h2>
40 <p>GUPnPContextManager — Manages <a class="link" href="GUPnPContext.html" title="GUPnPContext"><span class="type">GUPnPContext</span></a> objects.</p>
42 <td valign="top" align="right"></td>
44 <div class="refsynopsisdiv">
45 <a name="GUPnPContextManager.synopsis"></a><h2>Synopsis</h2>
46 <pre class="synopsis">struct <a class="link" href="GUPnPContextManager.html#GUPnPContextManager-struct" title="struct GUPnPContextManager">GUPnPContextManager</a>;
47 <a class="link" href="GUPnPContextManager.html" title="GUPnPContextManager"><span class="returnvalue">GUPnPContextManager</span></a> * <a class="link" href="GUPnPContextManager.html#gupnp-context-manager-new" title="gupnp_context_manager_new ()">gupnp_context_manager_new</a> (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#GMainContext"><span class="type">GMainContext</span></a> *main_context</code></em>,
48 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> port</code></em>);
49 <a class="link" href="GUPnPContextManager.html" title="GUPnPContextManager"><span class="returnvalue">GUPnPContextManager</span></a> * <a class="link" href="GUPnPContextManager.html#gupnp-context-manager-create" title="gupnp_context_manager_create ()">gupnp_context_manager_create</a> (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> port</code></em>);
50 <span class="returnvalue">void</span> <a class="link" href="GUPnPContextManager.html#gupnp-context-manager-manage-control-point" title="gupnp_context_manager_manage_control_point ()">gupnp_context_manager_manage_control_point</a>
51 (<em class="parameter"><code><a class="link" href="GUPnPContextManager.html" title="GUPnPContextManager"><span class="type">GUPnPContextManager</span></a> *manager</code></em>,
52 <em class="parameter"><code><a class="link" href="GUPnPControlPoint.html" title="GUPnPControlPoint"><span class="type">GUPnPControlPoint</span></a> *control_point</code></em>);
53 <span class="returnvalue">void</span> <a class="link" href="GUPnPContextManager.html#gupnp-context-manager-manage-root-device" title="gupnp_context_manager_manage_root_device ()">gupnp_context_manager_manage_root_device</a>
54 (<em class="parameter"><code><a class="link" href="GUPnPContextManager.html" title="GUPnPContextManager"><span class="type">GUPnPContextManager</span></a> *manager</code></em>,
55 <em class="parameter"><code><a class="link" href="GUPnPRootDevice.html" title="GUPnPRootDevice"><span class="type">GUPnPRootDevice</span></a> *root_device</code></em>);
56 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> <a class="link" href="GUPnPContextManager.html#gupnp-context-manager-get-port" title="gupnp_context_manager_get_port ()">gupnp_context_manager_get_port</a> (<em class="parameter"><code><a class="link" href="GUPnPContextManager.html" title="GUPnPContextManager"><span class="type">GUPnPContextManager</span></a> *manager</code></em>);
59 <div class="refsect1">
60 <a name="GUPnPContextManager.object-hierarchy"></a><h2>Object Hierarchy</h2>
61 <pre class="synopsis">
62 <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject">GObject</a>
63 +----GUPnPContextManager
66 <div class="refsect1">
67 <a name="GUPnPContextManager.properties"></a><h2>Properties</h2>
68 <pre class="synopsis">
69 "<a class="link" href="GUPnPContextManager.html#GUPnPContextManager--main-context" title='The "main-context" property'>main-context</a>" <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> : Read / Write / Construct Only
70 "<a class="link" href="GUPnPContextManager.html#GUPnPContextManager--port" title='The "port" property'>port</a>" <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> : Read / Write / Construct Only
73 <div class="refsect1">
74 <a name="GUPnPContextManager.signals"></a><h2>Signals</h2>
75 <pre class="synopsis">
76 "<a class="link" href="GUPnPContextManager.html#GUPnPContextManager-context-available" title='The "context-available" signal'>context-available</a>" : <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#G-SIGNAL-RUN-LAST:CAPS"><code class="literal">Run Last</code></a>
77 "<a class="link" href="GUPnPContextManager.html#GUPnPContextManager-context-unavailable" title='The "context-unavailable" signal'>context-unavailable</a>" : <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#G-SIGNAL-RUN-FIRST:CAPS"><code class="literal">Run First</code></a>
80 <div class="refsect1">
81 <a name="GUPnPContextManager.description"></a><h2>Description</h2>
83 A Utility class that takes care of creation and destruction of
84 <a class="link" href="GUPnPContext.html" title="GUPnPContext"><span class="type">GUPnPContext</span></a> objects for all available network interfaces as they go up
85 (connect) and down (disconnect), respectively.
88 <div class="refsect1">
89 <a name="GUPnPContextManager.details"></a><h2>Details</h2>
90 <div class="refsect2">
91 <a name="GUPnPContextManager-struct"></a><h3>struct GUPnPContextManager</h3>
92 <pre class="programlisting">struct GUPnPContextManager;</pre>
94 This struct contains private data only, and should be accessed using the
99 <div class="refsect2">
100 <a name="gupnp-context-manager-new"></a><h3>gupnp_context_manager_new ()</h3>
101 <pre class="programlisting"><a class="link" href="GUPnPContextManager.html" title="GUPnPContextManager"><span class="returnvalue">GUPnPContextManager</span></a> * gupnp_context_manager_new (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#GMainContext"><span class="type">GMainContext</span></a> *main_context</code></em>,
102 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> port</code></em>);</pre>
103 <div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
104 <h3 class="title">Warning</h3>
105 <p><code class="literal">gupnp_context_manager_new</code> has been deprecated since version 0.17.2 and should not be used in newly-written code. Use <a class="link" href="GUPnPContextManager.html#gupnp-context-manager-create" title="gupnp_context_manager_create ()"><code class="function">gupnp_context_manager_create()</code></a>.</p>
108 Same as <a class="link" href="GUPnPContextManager.html#gupnp-context-manager-create" title="gupnp_context_manager_create ()"><code class="function">gupnp_context_manager_create()</code></a>.
110 <div class="variablelist"><table border="0">
111 <col align="left" valign="top">
114 <td><p><span class="term"><em class="parameter"><code>main_context</code></em> :</span></p></td>
115 <td>Deprecated: 0.17.2: <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. If you want to use
116 a different main context use
117 <a href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#g-main-context-push-thread-default"><code class="function">g_main_context_push_thread_default()</code></a> instead. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
121 <td><p><span class="term"><em class="parameter"><code>port</code></em> :</span></p></td>
122 <td>Port to create contexts for, or 0 if you don't care what port is used.</td>
125 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
126 <td>A new <a class="link" href="GUPnPContextManager.html" title="GUPnPContextManager"><span class="type">GUPnPContextManager</span></a> object. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
133 <div class="refsect2">
134 <a name="gupnp-context-manager-create"></a><h3>gupnp_context_manager_create ()</h3>
135 <pre class="programlisting"><a class="link" href="GUPnPContextManager.html" title="GUPnPContextManager"><span class="returnvalue">GUPnPContextManager</span></a> * gupnp_context_manager_create (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> port</code></em>);</pre>
137 Factory-method to create a new <a class="link" href="GUPnPContextManager.html" title="GUPnPContextManager"><span class="type">GUPnPContextManager</span></a>. The final type of the
138 <a class="link" href="GUPnPContextManager.html" title="GUPnPContextManager"><span class="type">GUPnPContextManager</span></a> depends on the compile-time selection or - in case of
139 NetworkManager - on its availability during runtime. If it is not available,
140 the implementation falls back to the basic Unix context manager instead.
142 <div class="variablelist"><table border="0">
143 <col align="left" valign="top">
146 <td><p><span class="term"><em class="parameter"><code>port</code></em> :</span></p></td>
147 <td>Port to create contexts for, or 0 if you don't care what port is used.</td>
150 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
151 <td>A new <a class="link" href="GUPnPContextManager.html" title="GUPnPContextManager"><span class="type">GUPnPContextManager</span></a> object. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
158 <div class="refsect2">
159 <a name="gupnp-context-manager-manage-control-point"></a><h3>gupnp_context_manager_manage_control_point ()</h3>
160 <pre class="programlisting"><span class="returnvalue">void</span> gupnp_context_manager_manage_control_point
161 (<em class="parameter"><code><a class="link" href="GUPnPContextManager.html" title="GUPnPContextManager"><span class="type">GUPnPContextManager</span></a> *manager</code></em>,
162 <em class="parameter"><code><a class="link" href="GUPnPControlPoint.html" title="GUPnPControlPoint"><span class="type">GUPnPControlPoint</span></a> *control_point</code></em>);</pre>
164 By calling this function, you are asking <em class="parameter"><code>manager</code></em> to keep a reference to
165 <em class="parameter"><code>control_point</code></em> until it's associated <a class="link" href="GUPnPContext.html" title="GUPnPContext"><span class="type">GUPnPContext</span></a> is no longer available.
166 You usually want to call this function from
167 <a class="link" href="GUPnPContextManager.html#GUPnPContextManager-context-available" title='The "context-available" signal'><span class="type">"context-available"</span></a> handler after you create a
168 <a class="link" href="GUPnPControlPoint.html" title="GUPnPControlPoint"><span class="type">GUPnPControlPoint</span></a> object for the newly available context.
170 <div class="variablelist"><table border="0">
171 <col align="left" valign="top">
174 <td><p><span class="term"><em class="parameter"><code>manager</code></em> :</span></p></td>
175 <td>A <a class="link" href="GUPnPContextManager.html" title="GUPnPContextManager"><span class="type">GUPnPContextManager</span></a>
179 <td><p><span class="term"><em class="parameter"><code>control_point</code></em> :</span></p></td>
180 <td>The <a class="link" href="GUPnPControlPoint.html" title="GUPnPControlPoint"><span class="type">GUPnPControlPoint</span></a> to be taken care of</td>
186 <div class="refsect2">
187 <a name="gupnp-context-manager-manage-root-device"></a><h3>gupnp_context_manager_manage_root_device ()</h3>
188 <pre class="programlisting"><span class="returnvalue">void</span> gupnp_context_manager_manage_root_device
189 (<em class="parameter"><code><a class="link" href="GUPnPContextManager.html" title="GUPnPContextManager"><span class="type">GUPnPContextManager</span></a> *manager</code></em>,
190 <em class="parameter"><code><a class="link" href="GUPnPRootDevice.html" title="GUPnPRootDevice"><span class="type">GUPnPRootDevice</span></a> *root_device</code></em>);</pre>
192 By calling this function, you are asking <em class="parameter"><code>manager</code></em> to keep a reference to
193 <em class="parameter"><code>root_device</code></em> when it's associated <a class="link" href="GUPnPContext.html" title="GUPnPContext"><span class="type">GUPnPContext</span></a> is no longer available. You
194 usually want to call this function from
195 <a class="link" href="GUPnPContextManager.html#GUPnPContextManager-context-available" title='The "context-available" signal'><span class="type">"context-available"</span></a> handler after you create a
196 <a class="link" href="GUPnPRootDevice.html" title="GUPnPRootDevice"><span class="type">GUPnPRootDevice</span></a> object for the newly available context.
198 <div class="variablelist"><table border="0">
199 <col align="left" valign="top">
202 <td><p><span class="term"><em class="parameter"><code>manager</code></em> :</span></p></td>
203 <td>A <a class="link" href="GUPnPContextManager.html" title="GUPnPContextManager"><span class="type">GUPnPContextManager</span></a>
207 <td><p><span class="term"><em class="parameter"><code>root_device</code></em> :</span></p></td>
208 <td>The <a class="link" href="GUPnPRootDevice.html" title="GUPnPRootDevice"><span class="type">GUPnPRootDevice</span></a> to be taken care of</td>
214 <div class="refsect2">
215 <a name="gupnp-context-manager-get-port"></a><h3>gupnp_context_manager_get_port ()</h3>
216 <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> gupnp_context_manager_get_port (<em class="parameter"><code><a class="link" href="GUPnPContextManager.html" title="GUPnPContextManager"><span class="type">GUPnPContextManager</span></a> *manager</code></em>);</pre>
218 Get the network port associated with this context manager.
220 <div class="variablelist"><table border="0">
221 <col align="left" valign="top">
224 <td><p><span class="term"><em class="parameter"><code>manager</code></em> :</span></p></td>
225 <td>A <a class="link" href="GUPnPContextManager.html" title="GUPnPContextManager"><span class="type">GUPnPContextManager</span></a>
229 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
230 <td>The network port asssociated with this context manager.</td>
236 <div class="refsect1">
237 <a name="GUPnPContextManager.property-details"></a><h2>Property Details</h2>
238 <div class="refsect2">
239 <a name="GUPnPContextManager--main-context"></a><h3>The <code class="literal">"main-context"</code> property</h3>
240 <pre class="programlisting"> "main-context" <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> : Read / Write / Construct Only</pre>
241 <p>GMainContext to pass to created GUPnPContext objects.</p>
244 <div class="refsect2">
245 <a name="GUPnPContextManager--port"></a><h3>The <code class="literal">"port"</code> property</h3>
246 <pre class="programlisting"> "port" <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> : Read / Write / Construct Only</pre>
248 Port the contexts listen on, or 0 if you don't care what
249 port is used by <a class="link" href="GUPnPContext.html" title="GUPnPContext"><span class="type">GUPnPContext</span></a> objects created by this object.
251 <p>Default value: 0</p>
254 <div class="refsect1">
255 <a name="GUPnPContextManager.signal-details"></a><h2>Signal Details</h2>
256 <div class="refsect2">
257 <a name="GUPnPContextManager-context-available"></a><h3>The <code class="literal">"context-available"</code> signal</h3>
258 <pre class="programlisting"><span class="returnvalue">void</span> user_function (<a class="link" href="GUPnPContextManager.html" title="GUPnPContextManager"><span class="type">GUPnPContextManager</span></a> *context_manager,
259 <a class="link" href="GUPnPContext.html" title="GUPnPContext"><span class="type">GUPnPContext</span></a> *context,
260 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data) : <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#G-SIGNAL-RUN-LAST:CAPS"><code class="literal">Run Last</code></a></pre>
262 Signals the availability of new <a class="link" href="GUPnPContext.html" title="GUPnPContext"><span class="type">GUPnPContext</span></a>.
264 <div class="variablelist"><table border="0">
265 <col align="left" valign="top">
268 <td><p><span class="term"><em class="parameter"><code>context_manager</code></em> :</span></p></td>
269 <td>The <a class="link" href="GUPnPContextManager.html" title="GUPnPContextManager"><span class="type">GUPnPContextManager</span></a> that received the signal</td>
272 <td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td>
273 <td>The now available <a class="link" href="GUPnPContext.html" title="GUPnPContext"><span class="type">GUPnPContext</span></a>
277 <td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
278 <td>user data set when the signal handler was connected.</td>
284 <div class="refsect2">
285 <a name="GUPnPContextManager-context-unavailable"></a><h3>The <code class="literal">"context-unavailable"</code> signal</h3>
286 <pre class="programlisting"><span class="returnvalue">void</span> user_function (<a class="link" href="GUPnPContextManager.html" title="GUPnPContextManager"><span class="type">GUPnPContextManager</span></a> *context_manager,
287 <a class="link" href="GUPnPContext.html" title="GUPnPContext"><span class="type">GUPnPContext</span></a> *context,
288 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data) : <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#G-SIGNAL-RUN-FIRST:CAPS"><code class="literal">Run First</code></a></pre>
290 Signals the unavailability of a <a class="link" href="GUPnPContext.html" title="GUPnPContext"><span class="type">GUPnPContext</span></a>.
292 <div class="variablelist"><table border="0">
293 <col align="left" valign="top">
296 <td><p><span class="term"><em class="parameter"><code>context_manager</code></em> :</span></p></td>
297 <td>The <a class="link" href="GUPnPContextManager.html" title="GUPnPContextManager"><span class="type">GUPnPContextManager</span></a> that received the signal</td>
300 <td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td>
301 <td>The now unavailable <a class="link" href="GUPnPContext.html" title="GUPnPContext"><span class="type">GUPnPContext</span></a>
305 <td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
306 <td>user data set when the signal handler was connected.</td>
315 Generated by GTK-Doc V1.18</div>