Home | History | Annotate | Download | only in gobject

Lines Matching full:signal

2 <chapter id="chapter-signal">
9 Closures are central to the concept of asynchronous signal delivery
36 writing Python code and one of your Python callbacks receives a signal from
78 which have a pretty minimal API or the even simpler <function><link linkend="g-signal-connect">g_signal_connect</link></function>
170 <sect1 id="signal">
177 from the X server and generates a GTK+ event under the form of a signal emission
182 Each signal is registered in the type system together with the type on which
184 to the signal on a given type instance when they register a closure to be
185 invoked upon the signal emission. Users can also emit the signal by themselves
186 or stop the emission of the signal from within one of the closures connected
187 to the signal.
191 When a signal is emitted on a given type instance, all the closures
192 connected to this signal on this type instance will be invoked. All the closures
193 connected to such a signal represent callbacks whose signature looks like:
199 <sect2 id="signal-registration">
200 <title>Signal registration</title>
203 To register a new signal on an existing type, we can use any of <function><link linkend="g-signal-newv">g_signal_newv</link></function>,
204 <function><link linkend="g-signal-new-valist">g_signal_new_valist</link></function> or <function><link linkend="g-signal-new">g_signal_new</link></function> functions:
221 signal_name: is a string which can be used to uniquely identify a given signal.
224 itype: is the instance type on which this signal can be emitted.
228 signal are invoked.
231 class_closure: this is the default closure for the signal: if it is not NULL upon
232 the signal emission, it will be invoked upon this emission of the signal. The
234 signal depends partly on the signal_flags.
238 has been invoked. If it returns FALSE, signal emission is stopped. If it returns
239 TRUE, signal emission proceeds normally. It is also used to compute the return
240 value of the signal based on the return value of all the invoked closures.
248 this signal.
251 return_type: this is the type of the return value of the signal.
254 n_params: this is the number of parameters this signal takes.
258 of the signal. The length of this array is indicated by n_params.
264 As you can see from the above definition, a signal is basically a description
265 of the closures which can be connected to this signal and a description of the
266 order in which the closures connected to this signal will be invoked.
271 <sect2 id="signal-connection">
272 <title>Signal connection</title>
275 If you want to connect to a signal with a closure, you have three possibilities:
278 You can register a class closure at signal registration: this is a
280 of a given signal on all the instances of the type which supports that signal.
283 You can use <function><link linkend="g-signal-override-class-closure">g_signal_override_class_closure</link></function> which
285 only on a derived type of the type on which the signal was registered.
289 You can register a closure with the <function><link linkend="g-signal-connect">g_signal_connect</link></function>
291 will be invoked only during emission of a given signal on a given instance.
294 It is also possible to connect a different kind of callback on a given signal:
295 emission hooks are invoked whenever a given signal is emitted whatever the instance on
298 Emission hooks are connected with <function><link linkend="g-signal-add-emission-hook">g_signal_add_emission_hook</link></function>
299 and removed with <function><link linkend="g-signal-remove-emission-hook">g_signal_remove_emission_hook</link></function>.
304 <sect2 id="signal-emission">
305 <title>Signal emission</title>
308 Signal emission is done through the use of the <function><link linkend="g-signal-emit">g_signal_emit</link></function> family
319 parameters to the signal. The first element of the array is the
320 instance pointer on which to invoke the signal. The following elements of
321 the array contain the list of parameters to the signal.
324 signal_id identifies the signal to invoke.
327 detail identifies the specific detail of the signal to invoke. A detail is a kind of
328 magic token/argument which is passed around during signal emission and which is used
329 by closures connected to the signal to filter out unwanted signal emissions. In most
330 cases, you can safely set this value to zero. See <xref linkend="signal-detail"/> for
335 no accumulator was specified. If an accumulator was specified during signal creation,
355 Signal emission can be decomposed in 5 steps:
359 during signal registration and if there exist a class_closure for this signal,
364 the signal, they are invoked from first to last added. Accumulate return values
369 with the <function><link linkend="g-signal-connect">g_signal_connect</link></function> family of
370 functions, and if they are not blocked (with the <function><link linkend="g-signal-handler-block">g_signal_handler_block</link></function>
390 it is invoked here. Signal emission is completed here.
397 closures or emission hook stops the signal emission with
398 <function><link linkend="g-signal-stop">g_signal_stop</link></function>, emission jumps to CLEANUP state.
403 emits the same signal on the same instance, emission is restarted from
410 the closure return value into the signal return value and returns TRUE or
416 run will be returned by <function><link linkend="g-signal-emit">g_signal_emit</link></function>.
422 <sect2 id="signal-detail">
425 <para>All the functions related to signal emission or signal connection have a parameter
446 The two other functions hide the detail parameter in the signal name identification:
459 Their detailed_signal parameter is a string which identifies the name of the signal
461 <emphasis>signal_name::detail_name</emphasis>. Connecting to the signal
462 named <emphasis>notify::cursor_position</emphasis> will actually connect to the signal
468 Of the four main signal emission functions, three have an explicit detail parameter as a
484 The fourth function hides it in its signal name parameter:
491 the <function><link linkend="g-signal-connect">g_signal_connect</link></function> functions: <emphasis>signal_name::detail_name</emphasis>.
498 (even though they are connected to a signal which is being emitted).
505 by the <emphasis>notify</emphasis> signal of GObject: whenever a property is modified on a GObject,
506 instead of just emitting the <emphasis>notify</emphasis> signal, GObject associates as a detail to this
507 signal emission the name of the property modified. This allows clients who wish to be notified of changes