/usr/share/gtk-doc/html/libbonobo/libbonobo-bonobo-event-source.html is in libbonobo2-dev 2.32.1-3.
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 | <!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-event-source</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<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="properties.html" title="Properties">
<link rel="next" href="libbonobo-bonobo-listener.html" title="bonobo-listener">
<meta name="generator" content="GTK-Doc V1.19 (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="properties.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-listener.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-event-source.synopsis" class="shortcut">Top</a>
|
<a href="#libbonobo-bonobo-event-source.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry">
<a name="libbonobo-bonobo-event-source"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="libbonobo-bonobo-event-source.top_of_page"></a>bonobo-event-source</span></h2>
<p>bonobo-event-source — An Event Source where clients can connect to listen to events.</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="libbonobo-bonobo-event-source.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis"><span class="returnvalue">BonoboEventSource</span> * <a class="link" href="libbonobo-bonobo-event-source.html#bonobo-event-source-new" title="bonobo_event_source_new ()">bonobo_event_source_new</a> (<em class="parameter"><code><span class="type">void</span></code></em>);
<span class="returnvalue">void</span> <a class="link" href="libbonobo-bonobo-event-source.html#bonobo-event-source-notify-listeners" title="bonobo_event_source_notify_listeners ()">bonobo_event_source_notify_listeners</a>
(<em class="parameter"><code><span class="type">BonoboEventSource</span> *event_source</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> *opt_value</code></em>,
<em class="parameter"><code><span class="type">CORBA_Environment</span> *opt_ev</code></em>);
<span class="returnvalue">void</span> <a class="link" href="libbonobo-bonobo-event-source.html#bonobo-event-source-notify-listeners-full" title="bonobo_event_source_notify_listeners_full ()">bonobo_event_source_notify_listeners_full</a>
(<em class="parameter"><code><span class="type">BonoboEventSource</span> *event_source</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *path</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *type</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *subtype</code></em>,
<em class="parameter"><code>const <span class="type">CORBA_any</span> *opt_value</code></em>,
<em class="parameter"><code><span class="type">CORBA_Environment</span> *opt_ev</code></em>);
<span class="returnvalue">void</span> <a class="link" href="libbonobo-bonobo-event-source.html#bonobo-event-source-client-remove-listener" title="bonobo_event_source_client_remove_listener ()">bonobo_event_source_client_remove_listener</a>
(<em class="parameter"><code><span class="type">Bonobo_Unknown</span> object</code></em>,
<em class="parameter"><code><span class="type">Bonobo_Listener</span> listener</code></em>,
<em class="parameter"><code><span class="type">CORBA_Environment</span> *opt_ev</code></em>);
<span class="returnvalue">void</span> <a class="link" href="libbonobo-bonobo-event-source.html#bonobo-event-source-client-add-listener" title="bonobo_event_source_client_add_listener ()">bonobo_event_source_client_add_listener</a>
(<em class="parameter"><code><span class="type">Bonobo_Unknown</span> object</code></em>,
<em class="parameter"><code><a class="link" href="libbonobo-bonobo-listener.html#BonoboListenerCallbackFn" title="BonoboListenerCallbackFn ()"><span class="type">BonoboListenerCallbackFn</span></a> event_callback</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *opt_mask</code></em>,
<em class="parameter"><code><span class="type">CORBA_Environment</span> *opt_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 href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="libbonobo-bonobo-event-source.html#bonobo-event-source-has-listener" title="bonobo_event_source_has_listener ()">bonobo_event_source_has_listener</a> (<em class="parameter"><code><span class="type">BonoboEventSource</span> *event_source</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *event_name</code></em>);
<span class="returnvalue">void</span> <a class="link" href="libbonobo-bonobo-event-source.html#bonobo-event-source-client-add-listener-closure" title="bonobo_event_source_client_add_listener_closure ()">bonobo_event_source_client_add_listener_closure</a>
(<em class="parameter"><code><span class="type">Bonobo_Unknown</span> object</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/gobject/gobject-Closures.html#GClosure"><span class="type">GClosure</span></a> *callback</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *opt_mask</code></em>,
<em class="parameter"><code><span class="type">CORBA_Environment</span> *opt_ev</code></em>);
<span class="returnvalue">Bonobo_Listener</span> <a class="link" href="libbonobo-bonobo-event-source.html#bonobo-event-source-client-add-listener-full" title="bonobo_event_source_client_add_listener_full ()">bonobo_event_source_client_add_listener_full</a>
(<em class="parameter"><code><span class="type">Bonobo_Unknown</span> object</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/gobject/gobject-Closures.html#GClosure"><span class="type">GClosure</span></a> *callback</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *opt_mask</code></em>,
<em class="parameter"><code><span class="type">CORBA_Environment</span> *opt_ev</code></em>);
<span class="returnvalue">void</span> <a class="link" href="libbonobo-bonobo-event-source.html#bonobo-event-source-ignore-listeners" title="bonobo_event_source_ignore_listeners ()">bonobo_event_source_ignore_listeners</a>
(<em class="parameter"><code><span class="type">BonoboEventSource</span> *event_source</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="libbonobo-bonobo-event-source.description"></a><h2>Description</h2>
<p>
An event source object is responsible for channeling the emission
of signals on an object to the appropriate attached listeners.
The API is extremely simple and allows implementations to notify
their listeners of a new event occuring.
</p>
<p>
To notify a listener, you need to construct a textual string,
this is done by the <code class="function">bonobo_event</code> functions
( see <a class="link" href="libbonobo-bonobo-listener.html#BonoboListener"><span class="type">BonoboListener</span></a> ) ':' delimiting the fields. It is reccommended
that the IDL module path of the interface be used as the first
part of the string. This is because many interfaces can be aggregated
together and need to share the same event namespace without conflicts.
So for example the bonobo property bag notification code
uses the IDL path "Bonobo/Property" the "change" kind and sets the
sub-type to the property name:
</p>
<div class="example">
<a name="id-1.4.3.4.3.3"></a><p class="title"><b>Example 9. An example event source notification</b></p>
<div class="example-contents">
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="listing_lines" align="right"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13</pre></td>
<td class="listing_code"><pre class="programlisting"><span class="gtkdoc kwb">static void</span>
<span class="function">notify_listeners</span> <span class="gtkdoc opt">(</span>BonoboPropertyBag <span class="gtkdoc opt">*</span>pb<span class="gtkdoc opt">,</span>
BonoboProperty <span class="gtkdoc opt">*</span>prop<span class="gtkdoc opt">,</span>
<span class="gtkdoc kwb">const</span> BonoboArg <span class="gtkdoc opt">*</span>new_value<span class="gtkdoc opt">,</span>
CORBA_Environment <span class="gtkdoc opt">*</span>opt_ev<span class="gtkdoc opt">)</span>
<span class="gtkdoc opt">{</span>
<span class="keyword">if</span> <span class="gtkdoc opt">(</span>prop<span class="gtkdoc opt">-></span>flags <span class="gtkdoc opt">&</span> BONOBO_PROPERTY_NO_LISTENING<span class="gtkdoc opt">)</span>
<span class="keyword">return</span><span class="gtkdoc opt">;</span>
<span class="function"><a href="libbonobo-bonobo-event-source.html#bonobo-event-source-notify-listeners-full">bonobo_event_source_notify_listeners_full</a></span> <span class="gtkdoc opt">(</span>pb<span class="gtkdoc opt">-></span>es<span class="gtkdoc opt">,</span>
<span class="string">"Bonobo/Property"</span><span class="gtkdoc opt">,</span>
<span class="string">"change"</span><span class="gtkdoc opt">,</span> prop<span class="gtkdoc opt">-></span>name<span class="gtkdoc opt">,</span>
new_value<span class="gtkdoc opt">,</span> opt_ev<span class="gtkdoc opt">);</span>
<span class="gtkdoc opt">}</span></pre></td>
</tr>
</tbody>
</table>
</div>
</div>
<p><br class="example-break">
Of course, you need to notify the listener with a valid
BonoboArg containing the event data, this could easily contain
a structure. eg.
</p>
<div class="example">
<a name="id-1.4.3.4.3.4"></a><p class="title"><b>Example 10. Passing a structure in an event</b></p>
<div class="example-contents">
<pre class="programlisting">
module GNOME {
module Foo {
struct BaaEvent {
double a;
string b;
long c;
};
};
};
</pre>
<pre class="programlisting">
static void
fire_event (BonoboEventSource *on_source,
double a_double,
char *a_string,
long a_float,
CORBA_Environment *opt_ev)
{
CORBA_any any;
GNOME_Foo_BaaEvent e;
e.a = a_double;
e.b = a_string;
e.c = a_float;
any->_type = TC_GNOME_Foo_BaaEvent;
any->_data = &e;
bonobo_event_source_notify_listeners_full (
on_source, "GNOME/Foo", "event", NULL,
&any, opt_ev);
}
</pre>
</div>
</div>
<p><br class="example-break">
NB. it is reccommended that you make it clear that the event
structure is intended for use with the <span class="type">BonoboEventSource</span> /
<a class="link" href="libbonobo-bonobo-listener.html#BonoboListener"><span class="type">BonoboListener</span></a> by naming it XYZEvent, ie. with the 'Event'
suffix.
</p>
</div>
<div class="refsect1">
<a name="libbonobo-bonobo-event-source.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="bonobo-event-source-new"></a><h3>bonobo_event_source_new ()</h3>
<pre class="programlisting"><span class="returnvalue">BonoboEventSource</span> * bonobo_event_source_new (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
Creates a new BonoboEventSource object. Typically this
object will be exposed to clients through CORBA and they
will register and unregister functions to be notified
of events that this EventSource generates.
</p>
<p>
To notify clients of an event, use the <a class="link" href="libbonobo-bonobo-event-source.html#bonobo-event-source-notify-listeners" title="bonobo_event_source_notify_listeners ()"><code class="function">bonobo_event_source_notify_listeners()</code></a>
function.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>A new <span class="type">BonoboEventSource</span> server object.</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="bonobo-event-source-notify-listeners"></a><h3>bonobo_event_source_notify_listeners ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> bonobo_event_source_notify_listeners
(<em class="parameter"><code><span class="type">BonoboEventSource</span> *event_source</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> *opt_value</code></em>,
<em class="parameter"><code><span class="type">CORBA_Environment</span> *opt_ev</code></em>);</pre>
<p>
This will notify all clients that have registered with this EventSource
(through the addListener or addListenerWithMask methods) of the availability
of the event named <em class="parameter"><code>event_name</code></em>. The <em class="parameter"><code>value</code></em> CORBA::any value is passed to
all listeners.
</p>
<p>
<em class="parameter"><code>event_name</code></em> can not contain comma separators, as commas are used to
separate the various event names.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>event_source</code></em> :</span></p></td>
<td>the Event Source that will emit the event.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>event_name</code></em> :</span></p></td>
<td>Name of the event being emitted</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>opt_value</code></em> :</span></p></td>
<td>A CORBA_any value that contains the data that is passed
to interested clients, or NULL for an empty value</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>opt_ev</code></em> :</span></p></td>
<td>A CORBA_Environment where a failure code can be returned, can be NULL.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="bonobo-event-source-notify-listeners-full"></a><h3>bonobo_event_source_notify_listeners_full ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> bonobo_event_source_notify_listeners_full
(<em class="parameter"><code><span class="type">BonoboEventSource</span> *event_source</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *path</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *type</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *subtype</code></em>,
<em class="parameter"><code>const <span class="type">CORBA_any</span> *opt_value</code></em>,
<em class="parameter"><code><span class="type">CORBA_Environment</span> *opt_ev</code></em>);</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2">
<a name="bonobo-event-source-client-remove-listener"></a><h3>bonobo_event_source_client_remove_listener ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> bonobo_event_source_client_remove_listener
(<em class="parameter"><code><span class="type">Bonobo_Unknown</span> object</code></em>,
<em class="parameter"><code><span class="type">Bonobo_Listener</span> listener</code></em>,
<em class="parameter"><code><span class="type">CORBA_Environment</span> *opt_ev</code></em>);</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2">
<a name="bonobo-event-source-client-add-listener"></a><h3>bonobo_event_source_client_add_listener ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> bonobo_event_source_client_add_listener
(<em class="parameter"><code><span class="type">Bonobo_Unknown</span> object</code></em>,
<em class="parameter"><code><a class="link" href="libbonobo-bonobo-listener.html#BonoboListenerCallbackFn" title="BonoboListenerCallbackFn ()"><span class="type">BonoboListenerCallbackFn</span></a> event_callback</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *opt_mask</code></em>,
<em class="parameter"><code><span class="type">CORBA_Environment</span> *opt_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>
</p>
</div>
<hr>
<div class="refsect2">
<a name="bonobo-event-source-has-listener"></a><h3>bonobo_event_source_has_listener ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> bonobo_event_source_has_listener (<em class="parameter"><code><span class="type">BonoboEventSource</span> *event_source</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *event_name</code></em>);</pre>
<p>
This method determines if there are any listeners for
the event to be broadcast. This can be used to detect
whether it is worth constructing a potentialy expensive
state update, before sending it to no-one.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>event_source</code></em> :</span></p></td>
<td>the Event Source that will emit the event.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>event_name</code></em> :</span></p></td>
<td>Name of the event being emitted</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>TRUE if it's worth sending, else FALSE</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="bonobo-event-source-client-add-listener-closure"></a><h3>bonobo_event_source_client_add_listener_closure ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> bonobo_event_source_client_add_listener_closure
(<em class="parameter"><code><span class="type">Bonobo_Unknown</span> object</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/gobject/gobject-Closures.html#GClosure"><span class="type">GClosure</span></a> *callback</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *opt_mask</code></em>,
<em class="parameter"><code><span class="type">CORBA_Environment</span> *opt_ev</code></em>);</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2">
<a name="bonobo-event-source-client-add-listener-full"></a><h3>bonobo_event_source_client_add_listener_full ()</h3>
<pre class="programlisting"><span class="returnvalue">Bonobo_Listener</span> bonobo_event_source_client_add_listener_full
(<em class="parameter"><code><span class="type">Bonobo_Unknown</span> object</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/gobject/gobject-Closures.html#GClosure"><span class="type">GClosure</span></a> *callback</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *opt_mask</code></em>,
<em class="parameter"><code><span class="type">CORBA_Environment</span> *opt_ev</code></em>);</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2">
<a name="bonobo-event-source-ignore-listeners"></a><h3>bonobo_event_source_ignore_listeners ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> bonobo_event_source_ignore_listeners
(<em class="parameter"><code><span class="type">BonoboEventSource</span> *event_source</code></em>);</pre>
<p>
Instructs the event source to de-register any listeners
that are added from the global running context.
</p>
</div>
</div>
<div class="refsect1">
<a name="libbonobo-bonobo-event-source.see-also"></a><h2>See Also</h2>
<p>
<a class="link" href="libbonobo-bonobo-listener.html#BonoboListener"><span class="type">BonoboListener</span></a> <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.19</div>
</body>
</html>
|