/src/wrappers/gobject/library/g_signal.e
Specman e | 636 lines | 27 code | 137 blank | 472 comment | 0 complexity | ccbb6d3d6ba22df6d69ca88d1aff167f MD5 | raw file
1indexing 2 3 description: "Signals -- A means for customization of object behaviour and a general purpose notification mechanism" 4 long: "" 5 copyright: "(C) 2006 Paolo Redaelli " 6 license: "LGPL v2 or later" 7 date: "$Date:$" 8 revision: "$REvision:$" 9 10deferred class G_SIGNAL 11 12 -- Note: a signal is not a c_struct inherit C_STRUCT rename make as make_struct end 13 14 -- The basic concept of the signal system is that of the emission 15 -- of a signal. Signals are introduced per-type and are identified 16 -- through strings. Signals introduced for a parent type are 17 -- available in derived types as well, so basically they are a 18 -- per-type facility that is inherited. A signal emission mainly 19 -- involves invocation of a certain set of callbacks in precisely 20 -- defined manner. There are two main categories of such callbacks, 21 -- per-object [11] ones and user provided ones. The per-object 22 -- callbacks are most often referred to as "object method handler" 23 -- or "default (signal) handler", while user provided callbacks are 24 -- usually just called "signal handler". The object method handler 25 -- is provided at signal creation time (this most frequently 26 -- happens at the end of an object class' creation), while user 27 -- provided handlers are frequently connected and disconnected 28 -- to/from a certain signal on certain object instances. 29 30 -- A signal emission consists of five stages, unless prematurely 31 -- stopped: 32 33 -- 1 - Invocation of the object method handler for 34 -- G_SIGNAL_RUN_FIRST signals 35 36 -- 2 - Invocation of normal user-provided signal handlers 37 -- (after flag FALSE) 38 39 -- 3 - Invocation of the object method handler for 40 -- G_SIGNAL_RUN_LAST signals 41 42 -- 4 - Invocation of user provided signal handlers, connected 43 -- with an after flag of TRUE 44 45 -- 5 - Invocation of the object method handler for 46 -- G_SIGNAL_RUN_CLEANUP signals 47 48 -- The user-provided signal handlers are called in the order they 49 -- were connected in. All handlers may prematurely stop a signal 50 -- emission, and any number of handlers may be connected, 51 -- disconnected, blocked or unblocked during a signal 52 -- emission. There are certain criteria for skipping user handlers 53 -- in stages 2 and 4 of a signal emission. First, user handlers may 54 -- be blocked, blocked handlers are omitted during callback 55 -- invocation, to return from the "blocked" state, a handler has to 56 -- get unblocked exactly the same amount of times it has been 57 -- blocked before. Second, upon emission of a G_SIGNAL_DETAILED 58 -- signal, an additional "detail" argument passed in to 59 -- g_signal_emit() has to match the detail argument of the signal 60 -- handler currently subject to invocation. Specification of no 61 -- detail argument for signal handlers (omission of the detail part 62 -- of the signal specification upon connection) serves as a 63 -- wildcard and matches any detail argument passed in to emission. 64 65insert 66 G_SIGNAL_EXTERNALS 67 G_SIGNAL_FLAGS 68 G_SIGNAL_INVOCATION_HINT 69 G_SIGNAL_MATCH_TYPE 70 71feature -- Implementation 72 signal_id: INTEGER_64 73 74feature -- Unwrapped C 75 76 -- GSignalAccumulator () 77 78 -- gboolean (*GSignalAccumulator) (GSignalInvocationHint *ihint, 79 -- GValue *return_accu, 80 -- const GValue *handler_return, 81 -- gpointer data); 82 83 -- The signal accumulator is a special callback function that can be used to collect return values of the various callbacks that are called during a signal emission. The signal accumulator is specified at signal creation time, if it is left NULL, no accumulation of callback return values is performed. The return value of signal emissions is then the value returned by the last callback. 84 -- ihint : Signal invocation hint, see GSignalInvocationHint. 85 -- return_accu : Accumulator to collect callback return values in, this is the return value of the current signal emission. 86 -- handler_return : A GValue holding the return value of the signal handler. 87 -- data : Callback data that was specified when creating the signal. 88 -- Returns : The accumulator function returns whether the signal emission should be aborted. Returning FALSE means to abort the current emission and TRUE is returned for continuation. 89 -- GSignalCMarshaller 90 91 -- typedef GClosureMarshal GSignalCMarshaller; 92 93 -- This is the signature of marshaller functions, required to marshall arrays of parameter values to signal emissions into C language callback invocations. It is merely an alias to GClosureMarshal since the GClosure mechanism takes over responsibility of actual function invocation for the signal system. 94 -- GSignalEmissionHook () 95 96 -- gboolean (*GSignalEmissionHook) (GSignalInvocationHint *ihint, 97 -- guint n_param_values, 98 -- const GValue *param_values, 99 -- gpointer data); 100 101 -- A simple function pointer to get invoked when the signal is emitted. This allows you to tie a hook to the signal type, so that it will trap all emissions of that signal, from any object. 102 103 -- You may not attach these to signals created with the G_SIGNAL_NO_HOOKS flag. 104 -- ihint : Signal invocation hint, see GSignalInvocationHint. 105 -- n_param_values : the number of parameters to the function, including the instance on which the signal was emitted. 106 -- param_values : the instance on which the signal was emitted, followed by the parameters of the emission. 107 -- data : user data associated with the hook. 108 -- Returns : whether it wants to stay connected. If it returns FALSE, the signal hook is disconnected (and destroyed). 109 110 111 -- G_SIGNAL_TYPE_STATIC_SCOPE 112 113 -- #define G_SIGNAL_TYPE_STATIC_SCOPE (G_TYPE_FLAG_RESERVED_ID_BIT) 114 115 -- This macro flags signal argument types for which the signal system may assume that instances thereof remain persistent across all signal emissions they are used in. This is only useful for non ref-counted, value-copy types. 116 117 -- To flag a signal argument in this way, add | G_SIGNAL_TYPE_STATIC_SCOPE to the corresponding argument of g_signal_new(). 118 119 -- g_signal_new ("size_request", 120 -- G_TYPE_FROM_CLASS (gobject_class), 121 -- G_SIGNAL_RUN_FIRST, 122 -- G_STRUCT_OFFSET (GtkWidgetClass, size_request), 123 -- NULL, NULL, 124 -- _gtk_marshal_VOID__BOXED, 125 -- G_TYPE_NONE, 1, 126 -- GTK_TYPE_REQUISITION | G_SIGNAL_TYPE_STATIC_SCOPE); 127 128 -- G_SIGNAL_MATCH_MASK 129 130 -- #define G_SIGNAL_MATCH_MASK 0x3f 131 132 -- A mask for all GSignalMatchType bits. 133 -- G_SIGNAL_FLAGS_MASK 134 135 -- #define G_SIGNAL_FLAGS_MASK 0x7f 136 137 -- A mask for all GSignalFlags bits. 138 139 140 -- NOTE: g_signal_new is unwrappeble since variadic. g_signal_newv is 141 -- wrapped and provides the same functionality 142feature {} -- Creation 143 144 make (a_gobject: G_OBJECT; some_flags: INTEGER; 145 a_return_type: INTEGER; parameters_types: ARRAY[INTEGER]) is 146 -- Creates a new signal. This is usually done in the 147 -- GObject's class initializer at C level. 148 149 -- A signal name consists of segments consisting of ASCII 150 -- letters and digits, separated by either the '-' or '_' 151 -- character. The first character of a signal name must be a 152 -- letter. Names which violate these rules lead to undefined 153 -- behaviour of the GSignal system. 154 155 -- When registering a signal and looking up a signal, either 156 -- separator can be used, but they cannot be mixed. 157 158 -- Note: Class-level closure and accumulator are currently not implemented; 159 require 160 valid_gobject: a_gobject /= Void 161 valid_flags: are_valid_signal_flags (some_flags) 162 valid_return_type: 163 do 164 -- guint g_signal_newv (const gchar *signal_name, Type itype, 165 -- GSignalFlags signal_flags, GClosure *class_closure, 166 -- GSignalAccumulator accumulator, gpointer accu_data, 167 -- GSignalCMarshaller c_marshaller, GType return_type, guint 168 -- n_params, GType *param_types); 169 170 -- Creates a new signal. (This is usually done in the class initializer.) 171 172 -- A signal name consists of segments consisting of ASCII 173 -- letters and digits, separated by either the '-' or '_' 174 -- character. The first character of a signal name must be a 175 -- letter. Names which violate these rules lead to undefined 176 -- behaviour of the GSignal system. 177 178 -- When registering a signal and looking up a signal, either separator can be used, but they cannot be mixed. 179 -- signal_name : the name for the signal 180 -- itype : the type this signal pertains to. It will also pertain to types which are derived from this type. 181 -- signal_flags : a combination of GSignalFlags specifying detail of when the default handler is to be invoked. You should at least specify G_SIGNAL_RUN_FIRST or G_SIGNAL_RUN_LAST. 182 -- class_closure : The closure to invoke on signal emission. 183 -- accumulator : the accumulator for this signal; may be NULL. 184 -- accu_data : user data for the accumulator. 185 -- c_marshaller : the function to translate arrays of parameter values to signal emissions into C language callback invocations. 186 -- return_type : the type of return value, or G_TYPE_NONE for a signal without a return value. 187 -- n_params : the length of param_types. 188 -- param_types : an array types, one for each parameter. 189 -- Returns : the signal id 190 191 -- signal_id := g_signal_newv (a_name.to_external, a_gobject.type, 192 not_yet_implemented 193 end 194 195 -- g_signal_new_valist is unwrappable since it uses va_list 196 197 198 -- g_signal_list_ids () 199 200 -- guint* g_signal_list_ids (GType itype, 201 -- guint *n_ids); 202 203 -- Lists the signals by id that a certain instance or interface type created. Further information about the signals can be acquired through g_signal_query(). 204 -- itype : Instance or interface type. 205 -- n_ids : Location to store the number of signal ids for itype. 206 -- Returns : Newly allocated array of signal IDs. 207 -- g_signal_emit () 208 209 -- void g_signal_emit (gpointer instance, 210 -- guint signal_id, 211 -- GQuark detail, 212 -- ...); 213 214 -- Emits a signal. 215 216 -- Note that g_signal_emit() resets the return value to the default if no handlers are connected, in contrast to g_signal_emitv(). 217 -- instance : the instance the signal is being emitted on. 218 -- signal_id : the signal id 219 -- detail : the detail 220 -- ... : parameters to be passed to the signal, followed by a location for the return value. If the return type of the signal is G_TYPE_NONE, the return value location can be omitted. 221 -- g_signal_emit_by_name () 222 223 -- void g_signal_emit_by_name (gpointer instance, 224 -- const gchar *detailed_signal, 225 -- ...); 226 227 -- Emits a signal. 228 229 -- Note that g_signal_emit_by_name() resets the return value to the default if no handlers are connected, in contrast to g_signal_emitv(). 230 -- instance : the instance the signal is being emitted on. 231 -- detailed_signal : a string of the form "signal-name::detail". 232 -- ... : parameters to be passed to the signal, followed by a location for the return value. If the return type of the signal is G_TYPE_NONE, the return value location can be omitted. 233 -- g_signal_emitv () 234 235 -- void g_signal_emitv (const GValue *instance_and_params, 236 -- guint signal_id, 237 -- GQuark detail, 238 -- GValue *return_value); 239 240 -- Emits a signal. 241 242 -- Note that g_signal_emitv() doesn't change return_value if no handlers are connected, in contrast to g_signal_emit() and g_signal_emit_valist(). 243 -- instance_and_params : argument list for the signal emission. The first element in the array is a GValue for the instance the signal is being emitted on. The rest are any arguments to be passed to the signal. 244 -- signal_id : the signal id 245 -- detail : the detail 246 -- return_value : Location to store the return value of the signal emission. 247 -- g_signal_emit_valist () 248 249 -- void g_signal_emit_valist (gpointer instance, 250 -- guint signal_id, 251 -- GQuark detail, 252 -- va_list var_args); 253 254 -- Emits a signal. 255 256 -- Note that g_signal_emit_valist() resets the return value to the default if no handlers are connected, in contrast to g_signal_emitv(). 257 -- instance : the instance the signal is being emitted on. 258 -- signal_id : the signal id 259 -- detail : the detail 260 -- var_args : a list of parameters to be passed to the signal, followed by a location for the return value. If the return type of the signal is G_TYPE_NONE, the return value location can be omitted. 261 262 -- Note: g_signal_connect() wrapped in G_SIGNALS 263 264 -- g_signal_connect_after() 265 266 -- #define g_signal_connect_after(instance, detailed_signal, c_handler, data) 267 268 -- Connects a GCallback function to a signal for a particular object. 269 270 -- The handler will be called after the default handler of the signal. 271 -- instance : the instance to connect to. 272 -- detailed_signal : a string of the form "signal-name::detail". 273 -- c_handler : the GCallback to connect. 274 -- data : data to pass to c_handler calls. 275 -- Returns : the handler id 276 -- g_signal_connect_swapped() 277 278 -- #define g_signal_connect_swapped(instance, detailed_signal, c_handler, data) 279 280 -- Connects a GCallback function to a signal for a particular object. 281 282 -- The instance on which the signal is emitted and data will be swapped when calling the handler. 283 -- instance : the instance to connect to. 284 -- detailed_signal : a string of the form "signal-name::detail". 285 -- c_handler : the GCallback to connect. 286 -- data : data to pass to c_handler calls. 287 -- Returns : the handler id 288 -- g_signal_connect_object () 289 290 -- gulong g_signal_connect_object (gpointer instance, 291 -- const gchar *detailed_signal, 292 -- GCallback c_handler, 293 -- gpointer gobject, 294 -- GConnectFlags connect_flags); 295 296 -- This is similar to g_signal_connect_data(), but uses a closure which ensures that the gobject stays alive during the call to c_handler by temporarily adding a reference count to gobject. 297 298 -- Note that there is a bug in GObject that makes this function much less useful than it might seem otherwise. Once gobject is disposed, the callback will no longer be called, but, the signal handler is not currently disconnected. If the instance is itself being freed at the same time than this doesn't matter, since the signal will automatically be removed, but if instance persists, then the signal handler will leak. You should not remove the signal yourself because in a future versions of GObject, the handler will automatically be disconnected. 299 300 -- It's possible to work around this problem in a way that will continue to work with future versions of GObject by checking that the signal handler is still connected before disconnected it: 301 302 -- if (g_signal_handler_is_connected (instance, id)) 303 -- g_signal_handler_disconnect (instance, id); 304 305 -- instance : the instance to connect to. 306 -- detailed_signal : a string of the form "signal-name::detail". 307 -- c_handler : the GCallback to connect. 308 -- gobject : the object to pass as data to c_handler. 309 -- connect_flags : a combination of GConnnectFlags. 310 -- Returns : the handler id. 311 -- enum GConnectFlags 312 313 -- typedef enum 314 -- { 315 -- G_CONNECT_AFTER = 1 < < 0, 316 -- G_CONNECT_SWAPPED = 1 < < 1 317 -- } GConnectFlags; 318 319 -- The connection flags are used to specify the behaviour of a signal's connection. 320 -- G_CONNECT_AFTER whether the handler should be called before or after the default handler of the signal. 321 -- G_CONNECT_SWAPPED whether the instance and data should be swapped when calling the handler. 322 323 324 -- g_signal_connect_data () 325 326 -- gulong g_signal_connect_data (gpointer instance, 327 -- const gchar *detailed_signal, 328 -- GCallback c_handler, 329 -- gpointer data, 330 -- GClosureNotify destroy_data, 331 -- GConnectFlags connect_flags); 332 333 -- Connects a GCallback function to a signal for a particular object. Similar to g_signal_connect(), but allows to provide a GDestroyNotify for the data which will be called when the signal handler is disconnected and no longer used. Specify connect_flags if you need ..._after() pr ..._swapped() variants of this function. 334 -- instance : the instance to connect to. 335 -- detailed_signal : a string of the form "signal-name::detail". 336 -- c_handler : the GCallback to connect. 337 -- data : data to pass to c_handler calls. 338 -- destroy_data : a GDestroyNotify for data. 339 -- connect_flags : a combination of GConnectFlags. 340 -- Returns : the handler id 341 -- g_signal_connect_closure () 342 343 -- gulong g_signal_connect_closure (gpointer instance, 344 -- const gchar *detailed_signal, 345 -- GClosure *closure, 346 -- gboolean after); 347 348 -- Connects a closure to a signal for a particular object. 349 -- instance : the instance to connect to. 350 -- detailed_signal : a string of the form "signal-name::detail". 351 -- closure : the closure to connect. 352 -- after : whether the handler should be called before or after the default handler of the signal. 353 -- Returns : the handler id 354 -- g_signal_connect_closure_by_id () 355 356 -- gulong g_signal_connect_closure_by_id (gpointer instance, 357 -- guint signal_id, 358 -- GQuark detail, 359 -- GClosure *closure, 360 -- gboolean after); 361 362 -- Connects a closure to a signal for a particular object. 363 -- instance : the instance to connect to. 364 -- signal_id : the id of the signal. 365 -- detail : the detail. 366 -- closure : the closure to connect. 367 -- after : whether the handler should be called before or after the default handler of the signal. 368 -- Returns : the handler id 369 -- g_signal_handler_block () 370 371 -- void g_signal_handler_block (gpointer instance, 372 -- gulong handler_id); 373 374 -- Blocks a handler of an instance so it will not be called during any signal emissions unless it is unblocked again. Thus "blocking" a signal handler means to temporarily deactive it, a signal handler has to be unblocked exactly the same amount of times it has been blocked before to become active again. 375 376 -- The handler_id has to be a valid signal handler id, connected to a signal of instance. 377 -- instance : The instance to block the signal handler of. 378 -- handler_id : Handler id of the handler to be blocked. 379 -- g_signal_handler_unblock () 380 381 -- void g_signal_handler_unblock (gpointer instance, 382 -- gulong handler_id); 383 384 -- Undoes the effect of a previous g_signal_handler_block() call. A blocked handler is skipped during signal emissions and will not be invoked, unblocking it (for exactly the amount of times it has been blocked before) reverts its "blocked" state, so the handler will be recognized by the signal system and is called upon future or currently ongoing signal emissions (since the order in which handlers are called during signal emissions is deterministic, whether the unblocked handler in question is called as part of a currently ongoing emission depends on how far that emission has proceeded yet). 385 386 -- The handler_id has to be a valid id of a signal handler that is connected to a signal of instance and is currently blocked. 387 -- instance : The instance to unblock the signal handler of. 388 -- handler_id : Handler id of the handler to be unblocked. 389 -- g_signal_handler_disconnect () 390 391 -- void g_signal_handler_disconnect (gpointer instance, 392 -- gulong handler_id); 393 394 -- Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to. The handler_id becomes invalid and may be reused. 395 396 -- The handler_id has to be a valid signal handler id, connected to a signal of instance. 397 -- instance : The instance to remove the signal handler from. 398 -- handler_id : Handler id of the handler to be disconnected. 399 -- g_signal_handler_find () 400 401 -- gulong g_signal_handler_find (gpointer instance, 402 -- GSignalMatchType mask, 403 -- guint signal_id, 404 -- GQuark detail, 405 -- GClosure *closure, 406 -- gpointer func, 407 -- gpointer data); 408 409 -- Finds the first signal handler that matches certain selection criteria. The criteria mask is passed as an OR-ed combination of GSignalMatchType flags, and the criteria values are passed as arguments. The match mask has to be non-0 for successful matches. If no handler was found, 0 is returned. 410 -- instance : The instance owning the signal handler to be found. 411 -- mask : Mask indicating which of signal_id, detail, closure, func and/or data the handler has to match. 412 -- signal_id : Signal the handler has to be connected to. 413 -- detail : Signal detail the handler has to be connected to. 414 -- closure : The closure the handler will invoke. 415 -- func : The C closure callback of the handler (useless for non-C closures). 416 -- data : The closure data of the handler's closure. 417 -- Returns : A valid non-0 signal handler id for a successful match. 418 -- g_signal_handlers_block_matched () 419 420 -- guint g_signal_handlers_block_matched (gpointer instance, 421 -- GSignalMatchType mask, 422 -- guint signal_id, 423 -- GQuark detail, 424 -- GClosure *closure, 425 -- gpointer func, 426 -- gpointer data); 427 428 -- Blocks all handlers on an instance that match a certain selection criteria. The criteria mask is passed as an OR-ed combination of GSignalMatchType flags, and the criteria values are passed as arguments. Passing at least one of the G_SIGNAL_MATCH_CLOSURE, G_SIGNAL_MATCH_FUNC or G_SIGNAL_MATCH_DATA match flags is required for successful matches. If no handlers were found, 0 is returned, the number of blocked handlers otherwise. 429 -- instance : The instance to block handlers from. 430 -- mask : Mask indicating which of signal_id, detail, closure, func and/or data the handlers have to match. 431 -- signal_id : Signal the handlers have to be connected to. 432 -- detail : Signal detail the handlers have to be connected to. 433 -- closure : The closure the handlers will invoke. 434 -- func : The C closure callback of the handlers (useless for non-C closures). 435 -- data : The closure data of the handlers' closures. 436 -- Returns : The amount of handlers that got blocked. 437 -- g_signal_handlers_unblock_matched () 438 439 -- guint g_signal_handlers_unblock_matched 440 -- (gpointer instance, 441 -- GSignalMatchType mask, 442 -- guint signal_id, 443 -- GQuark detail, 444 -- GClosure *closure, 445 -- gpointer func, 446 -- gpointer data); 447 448 -- Unblocks all handlers on an instance that match a certain selection criteria. The criteria mask is passed as an OR-ed combination of GSignalMatchType flags, and the criteria values are passed as arguments. Passing at least one of the G_SIGNAL_MATCH_CLOSURE, G_SIGNAL_MATCH_FUNC or G_SIGNAL_MATCH_DATA match flags is required for successful matches. If no handlers were found, 0 is returned, the number of unblocked handlers otherwise. The match criteria should not apply to any handlers that are not currently blocked. 449 -- instance : The instance to unblock handlers from. 450 -- mask : Mask indicating which of signal_id, detail, closure, func and/or data the handlers have to match. 451 -- signal_id : Signal the handlers have to be connected to. 452 -- detail : Signal detail the handlers have to be connected to. 453 -- closure : The closure the handlers will invoke. 454 -- func : The C closure callback of the handlers (useless for non-C closures). 455 -- data : The closure data of the handlers' closures. 456 -- Returns : The amount of handlers that got unblocked. 457 -- g_signal_handlers_disconnect_matched () 458 459 -- guint g_signal_handlers_disconnect_matched 460 -- (gpointer instance, 461 -- GSignalMatchType mask, 462 -- guint signal_id, 463 -- GQuark detail, 464 -- GClosure *closure, 465 -- gpointer func, 466 -- gpointer data); 467 468 -- Disconnects all handlers on an instance that match a certain selection criteria. The criteria mask is passed as an OR-ed combination of GSignalMatchType flags, and the criteria values are passed as arguments. Passing at least one of the G_SIGNAL_MATCH_CLOSURE, G_SIGNAL_MATCH_FUNC or G_SIGNAL_MATCH_DATA match flags is required for successful matches. If no handlers were found, 0 is returned, the number of disconnected handlers otherwise. 469 -- instance : The instance to remove handlers from. 470 -- mask : Mask indicating which of signal_id, detail, closure, func and/or data the handlers have to match. 471 -- signal_id : Signal the handlers have to be connected to. 472 -- detail : Signal detail the handlers have to be connected to. 473 -- closure : The closure the handlers will invoke. 474 -- func : The C closure callback of the handlers (useless for non-C closures). 475 -- data : The closure data of the handlers' closures. 476 -- Returns : The amount of handlers that got disconnected. 477 -- g_signal_handler_is_connected () 478 479 -- gboolean g_signal_handler_is_connected (gpointer instance, 480 -- gulong handler_id); 481 482 -- Returns whether handler_id is the id of a handler connected to instance. 483 -- instance : The instance where a signal handler is sought. 484 -- handler_id : the handler id. 485 -- Returns : whether handler_id identifies a handler connected to instance. 486 -- g_signal_handlers_block_by_func() 487 488 -- #define g_signal_handlers_block_by_func(instance, func, data) 489 490 -- Blocks all handlers on an instance that match func and data. 491 -- instance : The instance to block handlers from. 492 -- func : The C closure callback of the handlers (useless for non-C closures). 493 -- data : The closure data of the handlers' closures. 494 -- Returns : The number of handlers that got blocked. 495 -- g_signal_handlers_unblock_by_func() 496 497 -- #define g_signal_handlers_unblock_by_func(instance, func, data) 498 499 -- Unblocks all handlers on an instance that match func and data. 500 -- instance : The instance to unblock handlers from. 501 -- func : The C closure callback of the handlers (useless for non-C closures). 502 -- data : The closure data of the handlers' closures. 503 -- Returns : The number of handlers that got unblocked. 504 -- g_signal_handlers_disconnect_by_func() 505 506 -- #define g_signal_handlers_disconnect_by_func(instance, func, data) 507 508 -- Disconnects all handlers on an instance that match func and data. 509 -- instance : The instance to remove handlers from. 510 -- func : The C closure callback of the handlers (useless for non-C closures). 511 -- data : The closure data of the handlers' closures. 512 -- Returns : The number of handlers that got disconnected. 513 -- g_signal_has_handler_pending () 514 515 -- gboolean g_signal_has_handler_pending (gpointer instance, 516 -- guint signal_id, 517 -- GQuark detail, 518 -- gboolean may_be_blocked); 519 520 -- Returns whether there are any handlers connected to instance for the given signal id and detail. 521 522 -- One example of when you might use this is when the arguments to the signal are difficult to compute. A class implementor may opt to not emit the signal if no one is attached anyway, thus saving the cost of building the arguments. 523 -- instance : the object whose signal handlers are sought. 524 -- signal_id : the signal id. 525 -- detail : the detail. 526 -- may_be_blocked : whether blocked handlers should count as match. 527 -- Returns : TRUE if a handler is connected to the signal, FALSE otherwise. 528 -- g_signal_stop_emission () 529 530 -- void g_signal_stop_emission (gpointer instance, 531 -- guint signal_id, 532 -- GQuark detail); 533 534 -- Stops a signal's current emission. 535 536 -- This will prevent the default method from running, if the signal was G_SIGNAL_RUN_LAST and you connected normally (i.e. without the "after" flag). 537 538 -- Prints a warning if used on a signal which isn't being emitted. 539 -- instance : the object whose signal handlers you wish to stop. 540 -- signal_id : the signal identifier, as returned by g_signal_lookup(). 541 -- detail : the detail which the signal was emitted with. 542 -- g_signal_override_class_closure () 543 544 -- void g_signal_override_class_closure (guint signal_id, 545 -- GType instance_type, 546 -- GClosure *class_closure); 547 548 -- Overrides the class closure (i.e. the default handler) for the given signal for emissions on instances of instance_type. instance_type must be derived from the type to which the signal belongs. 549 -- signal_id : the signal id 550 -- instance_type : the instance type on which to override the class closure for the signal. 551 -- class_closure : the closure. 552 -- g_signal_chain_from_overridden () 553 554 -- void g_signal_chain_from_overridden (const GValue *instance_and_params, 555 -- GValue *return_value); 556 557 -- Calls the original class closure of a signal. This function should only be called from an overridden class closure; see g_signal_override_class_closure(). 558 -- instance_and_params : the argument list of the signal emission. The first element in the array is a GValue for the instance the signal is being emitted on. The rest are any arguments to be passed to the signal. 559 -- return_value : Location for the return value. 560 -- g_signal_add_emission_hook () 561 562 -- gulong g_signal_add_emission_hook (guint signal_id, 563 -- GQuark detail, 564 -- GSignalEmissionHook hook_func, 565 -- gpointer hook_data, 566 -- GDestroyNotify data_destroy); 567 568 -- Adds an emission hook for a signal, which will get called for any emission of that signal, independent of the instance. This is possible only for signals which don't have G_SIGNAL_NO_HOOKS flag set. 569 -- signal_id : the signal identifier, as returned by g_signal_lookup(). 570 -- detail : the detail on which to call the hook. 571 -- hook_func : a GSignalEmissionHook function. 572 -- hook_data : user data for hook_func. 573 -- data_destroy : a GDestroyNotify for hook_data. 574 -- Returns : the hook id, for later use with g_signal_remove_emission_hook(). 575 -- g_signal_remove_emission_hook () 576 577 -- void g_signal_remove_emission_hook (guint signal_id, 578 -- gulong hook_id); 579 580 -- Deletes an emission hook. 581 -- signal_id : the id of the signal 582 -- hook_id : the id of the emission hook, as returned by g_signal_add_emission_hook() 583 -- g_signal_parse_name () 584 585 -- gboolean g_signal_parse_name (const gchar *detailed_signal, 586 -- GType itype, 587 -- guint *signal_id_p, 588 -- GQuark *detail_p, 589 -- gboolean force_detail_quark); 590 591 -- Internal function to parse a signal name into its signal_id and detail quark. 592 -- detailed_signal : a string of the form "signal-name::detail". 593 -- itype : The interface/instance type that introduced "signal-name". 594 -- signal_id_p : Location to store the signal id. 595 -- detail_p : Location to store the detail quark. 596 -- force_detail_quark : TRUE forces creation of a GQuark for the detail. 597 -- Returns : Whether the signal name could successfully be parsed and signal_id_p and detail_p contain valid return values. 598 -- g_signal_get_invocation_hint () 599 600 -- GSignalInvocationHint* g_signal_get_invocation_hint 601 -- (gpointer instance); 602 603 -- Returns the invocation hint of the innermost signal emission of instance. 604 -- instance : the instance to query 605 -- Returns : the invocation hint of the innermost signal emission. 606 -- g_signal_type_cclosure_new () 607 608 -- GClosure* g_signal_type_cclosure_new (GType itype, 609 -- guint struct_offset); 610 611 -- Creates a new closure which invokes the function found at the offset struct_offset in the class structure of the interface or classed type identified by itype. 612 -- itype : the GType identifier of an interface or classed type 613 -- struct_offset : the offset of the member function of itype's class structure which is to be invoked by the new closure 614 -- Returns : a new GCClosure 615 -- g_signal_accumulator_true_handled () 616 617 -- gboolean g_signal_accumulator_true_handled 618 -- (GSignalInvocationHint *ihint, 619 -- GValue *return_accu, 620 -- const GValue *handler_return, 621 -- gpointer dummy); 622 623 -- A predefined GSignalAccumulator for signals that return a boolean values. The behavior that this accumulator gives is that a return of TRUE stops the signal emission: no further callbacks will be invoked, while a return of FALSE allows the emission to coninue. The idea here is that a TRUE return indicates that the callback handled the signal, and no further handling is needed. 624 -- ihint : standard GSignalAccumulator parameter 625 -- return_accu : standard GSignalAccumulator parameter 626 -- handler_return : standard GSignalAccumulator parameter 627 -- dummy : standard GSignalAccumulator parameter 628 -- Returns : standard GSignalAccumulator result 629 630 -- Since 2.4 631 632 -- [11] Although signals can deal with any kind of instantiatable type, i'm referring to those types as "object types" in the following, simply because that is the context most users will encounter signals in. 633 634end 635 636