/usr/share/gtk-doc/html/libbonobo/libbonobo-bonobo-listener.html is in libbonobo2-dev 2.32.1-0ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>bonobo-listener</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="index.html" title="Libbonobo Reference Manual">
<link rel="up" href="property-bags.html" title="Property Bags, Events, Listeners">
<link rel="prev" href="libbonobo-bonobo-event-source.html" title="bonobo-event-source">
<link rel="next" href="libbonobo-bonobo-property-bag.html" title="BonoboPropertyBag">
<meta name="generator" content="GTK-Doc V1.16 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="libbonobo-bonobo-event-source.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="property-bags.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">Libbonobo Reference Manual</th>
<td><a accesskey="n" href="libbonobo-bonobo-property-bag.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#libbonobo-bonobo-listener.synopsis" class="shortcut">Top</a>
|
<a href="#libbonobo-bonobo-listener.description" class="shortcut">Description</a>
|
<a href="#libbonobo-bonobo-listener.object-hierarchy" class="shortcut">Object Hierarchy</a>
|
<a href="#libbonobo-bonobo-listener.signals" class="shortcut">Signals</a>
</td></tr>
</table>
<div class="refentry">
<a name="libbonobo-bonobo-listener"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="libbonobo-bonobo-listener.top_of_page"></a>bonobo-listener</span></h2>
<p>bonobo-listener — An Event Listener (an implementation of Bonobo::Listener)</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="libbonobo-bonobo-listener.synopsis"></a><h2>Synopsis</h2>
<a name="BonoboListener"></a><pre class="synopsis">struct <a class="link" href="libbonobo-bonobo-listener.html#BonoboListener-struct" title="struct BonoboListener">BonoboListener</a>;
<a class="link" href="libbonobo-bonobo-listener.html#BonoboListenerClass" title="BonoboListenerClass">BonoboListenerClass</a>;
<span class="returnvalue">void</span> (<a class="link" href="libbonobo-bonobo-listener.html#BonoboListenerCallbackFn" title="BonoboListenerCallbackFn ()">*BonoboListenerCallbackFn</a>) (<em class="parameter"><code><a class="link" href="libbonobo-bonobo-listener.html#BonoboListener"><span class="type">BonoboListener</span></a> *listener</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *event_name</code></em>,
<em class="parameter"><code>const <span class="type">CORBA_any</span> *any</code></em>,
<em class="parameter"><code><span class="type">CORBA_Environment</span> *ev</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);
<a class="link" href="libbonobo-bonobo-listener.html#BonoboListener"><span class="returnvalue">BonoboListener</span></a> * <a class="link" href="libbonobo-bonobo-listener.html#bonobo-listener-new" title="bonobo_listener_new ()">bonobo_listener_new</a> (<em class="parameter"><code><a class="link" href="libbonobo-bonobo-listener.html#BonoboListenerCallbackFn" title="BonoboListenerCallbackFn ()"><span class="type">BonoboListenerCallbackFn</span></a> event_cb</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);
<a class="link" href="libbonobo-bonobo-listener.html#BonoboListener"><span class="returnvalue">BonoboListener</span></a> * <a class="link" href="libbonobo-bonobo-listener.html#bonobo-listener-new-closure" title="bonobo_listener_new_closure ()">bonobo_listener_new_closure</a> (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/gobject/gobject-Closures.html#GClosure"><span class="type">GClosure</span></a> *event_closure</code></em>);
<span class="returnvalue">char</span> * <a class="link" href="libbonobo-bonobo-listener.html#bonobo-event-make-name" title="bonobo_event_make_name ()">bonobo_event_make_name</a> (<em class="parameter"><code>const <span class="type">char</span> *idl_path</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *kind</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *subtype</code></em>);
<span class="returnvalue">char</span> * <a class="link" href="libbonobo-bonobo-listener.html#bonobo-event-type" title="bonobo_event_type ()">bonobo_event_type</a> (<em class="parameter"><code>const <span class="type">char</span> *event_name</code></em>);
<span class="returnvalue">char</span> * <a class="link" href="libbonobo-bonobo-listener.html#bonobo-event-subtype" title="bonobo_event_subtype ()">bonobo_event_subtype</a> (<em class="parameter"><code>const <span class="type">char</span> *event_name</code></em>);
<span class="returnvalue">char</span> * <a class="link" href="libbonobo-bonobo-listener.html#bonobo-event-kind" title="bonobo_event_kind ()">bonobo_event_kind</a> (<em class="parameter"><code>const <span class="type">char</span> *event_name</code></em>);
<span class="returnvalue">char</span> * <a class="link" href="libbonobo-bonobo-listener.html#bonobo-event-idl-path" title="bonobo_event_idl_path ()">bonobo_event_idl_path</a> (<em class="parameter"><code>const <span class="type">char</span> *event_name</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="libbonobo-bonobo-listener.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="synopsis">
<a href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject">GObject</a>
+----<a class="link" href="libbonobo-bonobo-object.html#BonoboObject">BonoboObject</a>
+----BonoboListener
</pre>
</div>
<div class="refsect1">
<a name="libbonobo-bonobo-listener.signals"></a><h2>Signals</h2>
<pre class="synopsis">
"<a class="link" href="libbonobo-bonobo-listener.html#BonoboListener-event-notify" title='The "event-notify" signal'>event-notify</a>" : <a href="/usr/share/gtk-doc/html/gobject/gobject-Signals.html#G-SIGNAL-RUN-LAST:CAPS"><code class="literal">Run Last</code></a>
</pre>
</div>
<div class="refsect1">
<a name="libbonobo-bonobo-listener.description"></a><h2>Description</h2>
<p>
The BonoboListener object is a CORBA server used to receive events
emitted by a remote Bonobo::EventSource server. The combination
EventSource/Listener is used to notify one or more client
applications of events that happen in a component. Think of the
EventSource/Listener as a notification/callback system that allows
multiple clients to be informed of events.
</p>
<p>
Once created, the BonoboListener object needs to be attached to a
remote IDL:Bonobo/EventSource:1.0 server. This is done by passing the
CORBA Object reference of the BonoboListener to the addListener
method in the IDL:Bonobo/EventSource:1.0.
</p>
<p>
The BonoboListener object allows the user to specify a callback
function to be invoked when an event is emitted by the
IDL:Bonobo/EventSource:1.0 server. The BonoboListener object also
emits the "event_notify" Gtk+ signal, which allows you to connect
multiple code segments to the same event notification.
</p>
<p>
Here is a sample client application that registers interest in
being notified of events from the fictional "Keyboard" event
source:
</p>
<div class="informalexample"><pre class="programlisting">
BonoboListener *keyboard_listener;
my_listener_function (BonoboListener *l, char *event_name,
CORBA_any value, CORBA_Environment *ev,
gpointer user_data)
{
printf ("Received event named: %s\n", event_name);
}
connect_to_keyboard_source (Bonobo_EventSource *keyboard)
{
Bonobo_Unknown reference;
/*
* First, create the listener Bonobo server.
*/
keyboard_listener = bonobo_listener_new (my_listener_function, NULL);
/*
* Now, register our listener with the EventSource
*/
reference = bonobo_object_corba_objref (keyboard_listener);
Bonobo_EventSource_addListener (keyboard, reference);
}
</pre></div>
<p>
</p>
<p>
The CORBA::any value passed to the listener function is defined by
the contract between the EventSource's event you are using and you.
To manipulate the value, you can use the CORBA DynamicAny interface
to introspect the value and extract the information you need.
</p>
</div>
<div class="refsect1">
<a name="libbonobo-bonobo-listener.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="BonoboListener-struct"></a><h3>struct BonoboListener</h3>
<pre class="programlisting">struct BonoboListener;</pre>
<p>
Implementents Bonobo::Listener.
</p>
</div>
<hr>
<div class="refsect2">
<a name="BonoboListenerClass"></a><h3>BonoboListenerClass</h3>
<pre class="programlisting">typedef struct {
BonoboObjectClass parent_class;
POA_Bonobo_Listener__epv epv;
/* Signals */
void (* event_notify) (BonoboListener *listener,
char *event_name,
BonoboArg *event_data,
CORBA_Environment *ev);
} BonoboListenerClass;
</pre>
<p>
<a class="link" href="libbonobo-bonobo-listener.html#BonoboListener"><span class="type">BonoboListener</span></a>'s class
</p>
</div>
<hr>
<div class="refsect2">
<a name="BonoboListenerCallbackFn"></a><h3>BonoboListenerCallbackFn ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> (*BonoboListenerCallbackFn) (<em class="parameter"><code><a class="link" href="libbonobo-bonobo-listener.html#BonoboListener"><span class="type">BonoboListener</span></a> *listener</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *event_name</code></em>,
<em class="parameter"><code>const <span class="type">CORBA_any</span> *any</code></em>,
<em class="parameter"><code><span class="type">CORBA_Environment</span> *ev</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre>
<p>
The signature for the callback function invoked when an event is
delivered to the BonoboListener object.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>listener</code></em> :</span></p></td>
<td>a pointer to the BonoboListener.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>event_name</code></em> :</span></p></td>
<td>the event name that was emitted.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>any</code></em> :</span></p></td>
<td>The value (A CORBA Any) that was passed by the EventSource.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>ev</code></em> :</span></p></td>
<td>Environment for returning CORBA errors.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td>the data pointer specified when you called bonobo_listener_new</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="bonobo-listener-new"></a><h3>bonobo_listener_new ()</h3>
<pre class="programlisting"><a class="link" href="libbonobo-bonobo-listener.html#BonoboListener"><span class="returnvalue">BonoboListener</span></a> * bonobo_listener_new (<em class="parameter"><code><a class="link" href="libbonobo-bonobo-listener.html#BonoboListenerCallbackFn" title="BonoboListenerCallbackFn ()"><span class="type">BonoboListenerCallbackFn</span></a> event_cb</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre>
<p>
Creates a generic event listener. The listener calls the <em class="parameter"><code>event_callback</code></em>
function and emits an "event_notify" signal when notified of an event.
The signal callback should be of the form:
</p>
<p>
</p>
<div class="informalexample"><pre class="programlisting">
void some_callback (BonoboListener *listener,
char *event_name,
CORBA_any *any,
CORBA_Environment *ev,
gpointer user_data);
</pre></div>
<p>
</p>
<p>
You will typically pass the CORBA_Object reference in the return value
to an EventSource (by invoking EventSource::addListener).
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>event_cb</code></em> :</span></p></td>
<td>function to be invoked when an event is emitted by the EventSource.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td>data passed to the functioned pointed by <em class="parameter"><code>event_call</code></em>.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>A BonoboListener object.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="bonobo-listener-new-closure"></a><h3>bonobo_listener_new_closure ()</h3>
<pre class="programlisting"><a class="link" href="libbonobo-bonobo-listener.html#BonoboListener"><span class="returnvalue">BonoboListener</span></a> * bonobo_listener_new_closure (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/gobject/gobject-Closures.html#GClosure"><span class="type">GClosure</span></a> *event_closure</code></em>);</pre>
<p>
Creates a generic event listener. The listener invokes the <em class="parameter"><code>event_closure</code></em>
closure and emits an "event_notify" signal when notified of an event.
The signal callback should be of the form:
</p>
<p>
</p>
<div class="informalexample"><pre class="programlisting">
void some_callback (BonoboListener *listener,
char *event_name,
CORBA_any *any,
CORBA_Environment *ev,
gpointer user_data);
</pre></div>
<p>
</p>
<p>
You will typically pass the CORBA_Object reference in the return value
to an EventSource (by invoking EventSource::addListener).
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>event_closure</code></em> :</span></p></td>
<td>closure to be invoked when an event is emitted by the EventSource.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>A BonoboListener object.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="bonobo-event-make-name"></a><h3>bonobo_event_make_name ()</h3>
<pre class="programlisting"><span class="returnvalue">char</span> * bonobo_event_make_name (<em class="parameter"><code>const <span class="type">char</span> *idl_path</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *kind</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *subtype</code></em>);</pre>
<p>
Creates an event name. Event names consist of three parts. The <em class="parameter"><code>idl_path</code></em> is
mainly to create a unique namespace, and should identify the interface
which triggered the event, for example "Bonobo/Property". The <em class="parameter"><code>kind</code></em> denotes
what happened, for example "change". Finally you can use the optional
<em class="parameter"><code>subtype</code></em> to make events more specific. All three parts of the name are
joined together separated by colons. "Bonobo/Property:change" or
"Bonobo/Property:change:autosave" are examples of valid event names.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>idl_path</code></em> :</span></p></td>
<td>the IDL part of the event name.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>kind</code></em> :</span></p></td>
<td>the kind of the event</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>subtype</code></em> :</span></p></td>
<td>an optional subtype</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>A valid event_name, or NULL on error.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="bonobo-event-type"></a><h3>bonobo_event_type ()</h3>
<pre class="programlisting"><span class="returnvalue">char</span> * bonobo_event_type (<em class="parameter"><code>const <span class="type">char</span> *event_name</code></em>);</pre>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>event_name</code></em> :</span></p></td>
<td>the event name</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>The event subtype, or NULL on error.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="bonobo-event-subtype"></a><h3>bonobo_event_subtype ()</h3>
<pre class="programlisting"><span class="returnvalue">char</span> * bonobo_event_subtype (<em class="parameter"><code>const <span class="type">char</span> *event_name</code></em>);</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2">
<a name="bonobo-event-kind"></a><h3>bonobo_event_kind ()</h3>
<pre class="programlisting"><span class="returnvalue">char</span> * bonobo_event_kind (<em class="parameter"><code>const <span class="type">char</span> *event_name</code></em>);</pre>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>event_name</code></em> :</span></p></td>
<td>the event name</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>The event kind, or NULL on error.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="bonobo-event-idl-path"></a><h3>bonobo_event_idl_path ()</h3>
<pre class="programlisting"><span class="returnvalue">char</span> * bonobo_event_idl_path (<em class="parameter"><code>const <span class="type">char</span> *event_name</code></em>);</pre>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>event_name</code></em> :</span></p></td>
<td>the event name</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>The event idl path, or NULL on error.</td>
</tr>
</tbody>
</table></div>
</div>
</div>
<div class="refsect1">
<a name="libbonobo-bonobo-listener.signal-details"></a><h2>Signal Details</h2>
<div class="refsect2">
<a name="BonoboListener-event-notify"></a><h3>The <code class="literal">"event-notify"</code> signal</h3>
<pre class="programlisting"><span class="returnvalue">void</span> user_function (<a class="link" href="libbonobo-bonobo-listener.html#BonoboListener"><span class="type">BonoboListener</span></a> *bonobolistener,
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *arg1,
<span class="type">BonoboCorbaAny</span> *arg2,
<span class="type">BonoboCorbaException</span> *arg3,
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data) : <a href="/usr/share/gtk-doc/html/gobject/gobject-Signals.html#G-SIGNAL-RUN-LAST:CAPS"><code class="literal">Run Last</code></a></pre>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>bonobolistener</code></em> :</span></p></td>
<td>the object which received the signal.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td>user data set when the signal handler was connected.</td>
</tr>
</tbody>
</table></div>
</div>
</div>
<div class="refsect1">
<a name="libbonobo-bonobo-listener.see-also"></a><h2>See Also</h2>
<p>
<span class="type">BonoboEventSource</span> <a class="link" href="libbonobo-bonobo-arg.html#BonoboArg" title="BonoboArg"><span class="type">BonoboArg</span></a>
</p>
</div>
</div>
<div class="footer">
<hr>
Generated by GTK-Doc V1.16</div>
</body>
</html>
|