45
45
</tr></table></div>
46
46
<div class="refsynopsisdiv" title="Synopsis">
47
47
<a name="libbonobo-bonobo-event-source.synopsis"></a><h2>Synopsis</h2>
48
<pre class="synopsis">
49
BonoboEventSource * <a class="link" href="libbonobo-bonobo-event-source.html#bonobo-event-source-new" title="bonobo_event_source_new ()">bonobo_event_source_new</a> (void);
50
void <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>
51
(BonoboEventSource *event_source,
52
const char *event_name,
53
const CORBA_any *opt_value,
54
CORBA_Environment *opt_ev);
55
void <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>
56
(BonoboEventSource *event_source,
60
const CORBA_any *opt_value,
61
CORBA_Environment *opt_ev);
62
void <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>
63
(Bonobo_Unknown object,
64
Bonobo_Listener listener,
65
CORBA_Environment *opt_ev);
66
void <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>
67
(Bonobo_Unknown object,
68
<a class="link" href="libbonobo-bonobo-listener.html#BonoboListenerCallbackFn" title="BonoboListenerCallbackFn ()">BonoboListenerCallbackFn</a> event_callback,
70
CORBA_Environment *opt_ev,
72
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
73
>gpointer</a> user_data);
75
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"
76
>gboolean</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> (BonoboEventSource *event_source,
77
const char *event_name);
78
void <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>
79
(Bonobo_Unknown object,
81
href="http://library.gnome.org/devel/gobject/unstable/gobject-Closures.html#GClosure"
82
>GClosure</a> *callback,
84
CORBA_Environment *opt_ev);
85
Bonobo_Listener <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>
86
(Bonobo_Unknown object,
88
href="http://library.gnome.org/devel/gobject/unstable/gobject-Closures.html#GClosure"
89
>GClosure</a> *callback,
91
CORBA_Environment *opt_ev);
92
void <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>
93
(BonoboEventSource *event_source);
48
<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> (void);
49
<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>
50
(<span class="returnvalue">BonoboEventSource</span> *event_source,
51
const <span class="returnvalue">char</span> *event_name,
52
const <span class="returnvalue">CORBA_any</span> *opt_value,
53
<span class="returnvalue">CORBA_Environment</span> *opt_ev);
54
<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>
55
(<span class="returnvalue">BonoboEventSource</span> *event_source,
56
const <span class="returnvalue">char</span> *path,
57
const <span class="returnvalue">char</span> *type,
58
const <span class="returnvalue">char</span> *subtype,
59
const <span class="returnvalue">CORBA_any</span> *opt_value,
60
<span class="returnvalue">CORBA_Environment</span> *opt_ev);
61
<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>
62
(<span class="returnvalue">Bonobo_Unknown</span> object,
63
<span class="returnvalue">Bonobo_Listener</span> listener,
64
<span class="returnvalue">CORBA_Environment</span> *opt_ev);
65
<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>
66
(<span class="returnvalue">Bonobo_Unknown</span> object,
67
<a class="link" href="libbonobo-bonobo-listener.html#BonoboListenerCallbackFn" title="BonoboListenerCallbackFn ()"><span class="returnvalue">BonoboListenerCallbackFn</span></a> event_callback,
68
const <span class="returnvalue">char</span> *opt_mask,
69
<span class="returnvalue">CORBA_Environment</span> *opt_ev,
70
<span class="returnvalue">gpointer</span> user_data);
71
<span class="returnvalue">gboolean</span> <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> (<span class="returnvalue">BonoboEventSource</span> *event_source,
72
const <span class="returnvalue">char</span> *event_name);
73
<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>
74
(<span class="returnvalue">Bonobo_Unknown</span> object,
75
<span class="returnvalue">GClosure</span> *callback,
76
const <span class="returnvalue">char</span> *opt_mask,
77
<span class="returnvalue">CORBA_Environment</span> *opt_ev);
78
<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>
79
(<span class="returnvalue">Bonobo_Unknown</span> object,
80
<span class="returnvalue">GClosure</span> *callback,
81
const <span class="returnvalue">char</span> *opt_mask,
82
<span class="returnvalue">CORBA_Environment</span> *opt_ev);
83
<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>
84
(<span class="returnvalue">BonoboEventSource</span> *event_source);
96
87
<div class="refsect1" title="Description">
113
104
sub-type to the property name:
115
106
<div class="example">
116
<a name="id2981226"></a><p class="title"><b>Example 9. An example event source notification</b></p>
117
<div class="example-contents"><pre class="programlisting">
107
<a name="id2621519"></a><p class="title"><b>Example 9. An example event source notification</b></p>
108
<div class="example-contents">
109
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
112
<td class="listing_lines" align="right"><pre>1
125
<td class="listing_code"><pre class="programlisting"><span class="type">static</span> <span class="type">void</span>
119
126
notify_listeners (BonoboPropertyBag *pb,
120
BonoboProperty *prop,
121
const BonoboArg *new_value,
122
CORBA_Environment *opt_ev)
127
BonoboProperty *prop,
128
<span class="type">const</span> BonoboArg *new_value,
129
CORBA_Environment *opt_ev)
124
if (prop->flags & BONOBO_PROPERTY_NO_LISTENING)
126
bonobo_event_source_notify_listeners_full (pb->es,
128
"change", prop->name,
131
<span class="keyword">if</span> (prop->flags & BONOBO_PROPERTY_NO_LISTENING)
132
<span class="keyword">return</span>;
133
bonobo_event_source_notify_listeners_full (pb->es,
134
<span class="number">"Bonobo/Property"</span>,
135
<span class="number">"change"</span>, prop->name,
133
144
<p><br class="example-break">
134
145
Of course, you need to notify the listener with a valid
207
216
<div class="refsect2" title="bonobo_event_source_notify_listeners ()">
208
217
<a name="bonobo-event-source-notify-listeners"></a><h3>bonobo_event_source_notify_listeners ()</h3>
209
<pre class="programlisting">void bonobo_event_source_notify_listeners
210
(BonoboEventSource *event_source,
211
const char *event_name,
212
const CORBA_any *opt_value,
213
CORBA_Environment *opt_ev);</pre>
218
<pre class="programlisting"><span class="returnvalue">void</span> bonobo_event_source_notify_listeners
219
(<span class="returnvalue">BonoboEventSource</span> *event_source,
220
const <span class="returnvalue">char</span> *event_name,
221
const <span class="returnvalue">CORBA_any</span> *opt_value,
222
<span class="returnvalue">CORBA_Environment</span> *opt_ev);</pre>
215
224
This will notify all clients that have registered with this EventSource
216
225
(through the addListener or addListenerWithMask methods) of the availability
253
260
<div class="refsect2" title="bonobo_event_source_notify_listeners_full ()">
254
261
<a name="bonobo-event-source-notify-listeners-full"></a><h3>bonobo_event_source_notify_listeners_full ()</h3>
255
<pre class="programlisting">void bonobo_event_source_notify_listeners_full
256
(BonoboEventSource *event_source,
260
const CORBA_any *opt_value,
261
CORBA_Environment *opt_ev);</pre>
262
<pre class="programlisting"><span class="returnvalue">void</span> bonobo_event_source_notify_listeners_full
263
(<span class="returnvalue">BonoboEventSource</span> *event_source,
264
const <span class="returnvalue">char</span> *path,
265
const <span class="returnvalue">char</span> *type,
266
const <span class="returnvalue">char</span> *subtype,
267
const <span class="returnvalue">CORBA_any</span> *opt_value,
268
<span class="returnvalue">CORBA_Environment</span> *opt_ev);</pre>
264
271
<div class="variablelist"><table border="0">
331
338
<div class="refsect2" title="bonobo_event_source_client_add_listener ()">
332
339
<a name="bonobo-event-source-client-add-listener"></a><h3>bonobo_event_source_client_add_listener ()</h3>
333
<pre class="programlisting">void bonobo_event_source_client_add_listener
334
(Bonobo_Unknown object,
335
<a class="link" href="libbonobo-bonobo-listener.html#BonoboListenerCallbackFn" title="BonoboListenerCallbackFn ()">BonoboListenerCallbackFn</a> event_callback,
336
const char *opt_mask,
337
CORBA_Environment *opt_ev,
339
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
340
>gpointer</a> user_data);</pre>
340
<pre class="programlisting"><span class="returnvalue">void</span> bonobo_event_source_client_add_listener
341
(<span class="returnvalue">Bonobo_Unknown</span> object,
342
<a class="link" href="libbonobo-bonobo-listener.html#BonoboListenerCallbackFn" title="BonoboListenerCallbackFn ()"><span class="returnvalue">BonoboListenerCallbackFn</span></a> event_callback,
343
const <span class="returnvalue">char</span> *opt_mask,
344
<span class="returnvalue">CORBA_Environment</span> *opt_ev,
345
<span class="returnvalue">gpointer</span> user_data);</pre>
343
348
<div class="variablelist"><table border="0">
375
380
<div class="refsect2" title="bonobo_event_source_has_listener ()">
376
381
<a name="bonobo-event-source-has-listener"></a><h3>bonobo_event_source_has_listener ()</h3>
377
<pre class="programlisting"><a
378
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"
379
>gboolean</a> bonobo_event_source_has_listener (BonoboEventSource *event_source,
380
const char *event_name);</pre>
382
<pre class="programlisting"><span class="returnvalue">gboolean</span> bonobo_event_source_has_listener (<span class="returnvalue">BonoboEventSource</span> *event_source,
383
const <span class="returnvalue">char</span> *event_name);</pre>
382
385
This method determines if there are any listeners for
383
386
the event to be broadcast. This can be used to detect
384
387
whether it is worth constructing a potentialy expensive
385
388
state update, before sending it to no-one.</p>
388
389
<div class="variablelist"><table border="0">
389
390
<col align="left" valign="top">