/src/wrappers/gobject/library/g_signal.e

http://github.com/tybor/Liberty · Specman e · 636 lines · 27 code · 137 blank · 472 comment · 0 complexity · ccbb6d3d6ba22df6d69ca88d1aff167f MD5 · raw file

  1. indexing
  2. description: "Signals -- A means for customization of object behaviour and a general purpose notification mechanism"
  3. long: ""
  4. copyright: "(C) 2006 Paolo Redaelli "
  5. license: "LGPL v2 or later"
  6. date: "$Date:$"
  7. revision: "$REvision:$"
  8. deferred class G_SIGNAL
  9. -- Note: a signal is not a c_struct inherit C_STRUCT rename make as make_struct end
  10. -- The basic concept of the signal system is that of the emission
  11. -- of a signal. Signals are introduced per-type and are identified
  12. -- through strings. Signals introduced for a parent type are
  13. -- available in derived types as well, so basically they are a
  14. -- per-type facility that is inherited. A signal emission mainly
  15. -- involves invocation of a certain set of callbacks in precisely
  16. -- defined manner. There are two main categories of such callbacks,
  17. -- per-object [11] ones and user provided ones. The per-object
  18. -- callbacks are most often referred to as "object method handler"
  19. -- or "default (signal) handler", while user provided callbacks are
  20. -- usually just called "signal handler". The object method handler
  21. -- is provided at signal creation time (this most frequently
  22. -- happens at the end of an object class' creation), while user
  23. -- provided handlers are frequently connected and disconnected
  24. -- to/from a certain signal on certain object instances.
  25. -- A signal emission consists of five stages, unless prematurely
  26. -- stopped:
  27. -- 1 - Invocation of the object method handler for
  28. -- G_SIGNAL_RUN_FIRST signals
  29. -- 2 - Invocation of normal user-provided signal handlers
  30. -- (after flag FALSE)
  31. -- 3 - Invocation of the object method handler for
  32. -- G_SIGNAL_RUN_LAST signals
  33. -- 4 - Invocation of user provided signal handlers, connected
  34. -- with an after flag of TRUE
  35. -- 5 - Invocation of the object method handler for
  36. -- G_SIGNAL_RUN_CLEANUP signals
  37. -- The user-provided signal handlers are called in the order they
  38. -- were connected in. All handlers may prematurely stop a signal
  39. -- emission, and any number of handlers may be connected,
  40. -- disconnected, blocked or unblocked during a signal
  41. -- emission. There are certain criteria for skipping user handlers
  42. -- in stages 2 and 4 of a signal emission. First, user handlers may
  43. -- be blocked, blocked handlers are omitted during callback
  44. -- invocation, to return from the "blocked" state, a handler has to
  45. -- get unblocked exactly the same amount of times it has been
  46. -- blocked before. Second, upon emission of a G_SIGNAL_DETAILED
  47. -- signal, an additional "detail" argument passed in to
  48. -- g_signal_emit() has to match the detail argument of the signal
  49. -- handler currently subject to invocation. Specification of no
  50. -- detail argument for signal handlers (omission of the detail part
  51. -- of the signal specification upon connection) serves as a
  52. -- wildcard and matches any detail argument passed in to emission.
  53. insert
  54. G_SIGNAL_EXTERNALS
  55. G_SIGNAL_FLAGS
  56. G_SIGNAL_INVOCATION_HINT
  57. G_SIGNAL_MATCH_TYPE
  58. feature -- Implementation
  59. signal_id: INTEGER_64
  60. feature -- Unwrapped C
  61. -- GSignalAccumulator ()
  62. -- gboolean (*GSignalAccumulator) (GSignalInvocationHint *ihint,
  63. -- GValue *return_accu,
  64. -- const GValue *handler_return,
  65. -- gpointer data);
  66. -- 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.
  67. -- ihint : Signal invocation hint, see GSignalInvocationHint.
  68. -- return_accu : Accumulator to collect callback return values in, this is the return value of the current signal emission.
  69. -- handler_return : A GValue holding the return value of the signal handler.
  70. -- data : Callback data that was specified when creating the signal.
  71. -- 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.
  72. -- GSignalCMarshaller
  73. -- typedef GClosureMarshal GSignalCMarshaller;
  74. -- 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.
  75. -- GSignalEmissionHook ()
  76. -- gboolean (*GSignalEmissionHook) (GSignalInvocationHint *ihint,
  77. -- guint n_param_values,
  78. -- const GValue *param_values,
  79. -- gpointer data);
  80. -- 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.
  81. -- You may not attach these to signals created with the G_SIGNAL_NO_HOOKS flag.
  82. -- ihint : Signal invocation hint, see GSignalInvocationHint.
  83. -- n_param_values : the number of parameters to the function, including the instance on which the signal was emitted.
  84. -- param_values : the instance on which the signal was emitted, followed by the parameters of the emission.
  85. -- data : user data associated with the hook.
  86. -- Returns : whether it wants to stay connected. If it returns FALSE, the signal hook is disconnected (and destroyed).
  87. -- G_SIGNAL_TYPE_STATIC_SCOPE
  88. -- #define G_SIGNAL_TYPE_STATIC_SCOPE (G_TYPE_FLAG_RESERVED_ID_BIT)
  89. -- 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.
  90. -- To flag a signal argument in this way, add | G_SIGNAL_TYPE_STATIC_SCOPE to the corresponding argument of g_signal_new().
  91. -- g_signal_new ("size_request",
  92. -- G_TYPE_FROM_CLASS (gobject_class),
  93. -- G_SIGNAL_RUN_FIRST,
  94. -- G_STRUCT_OFFSET (GtkWidgetClass, size_request),
  95. -- NULL, NULL,
  96. -- _gtk_marshal_VOID__BOXED,
  97. -- G_TYPE_NONE, 1,
  98. -- GTK_TYPE_REQUISITION | G_SIGNAL_TYPE_STATIC_SCOPE);
  99. -- G_SIGNAL_MATCH_MASK
  100. -- #define G_SIGNAL_MATCH_MASK 0x3f
  101. -- A mask for all GSignalMatchType bits.
  102. -- G_SIGNAL_FLAGS_MASK
  103. -- #define G_SIGNAL_FLAGS_MASK 0x7f
  104. -- A mask for all GSignalFlags bits.
  105. -- NOTE: g_signal_new is unwrappeble since variadic. g_signal_newv is
  106. -- wrapped and provides the same functionality
  107. feature {} -- Creation
  108. make (a_gobject: G_OBJECT; some_flags: INTEGER;
  109. a_return_type: INTEGER; parameters_types: ARRAY[INTEGER]) is
  110. -- Creates a new signal. This is usually done in the
  111. -- GObject's class initializer at C level.
  112. -- A signal name consists of segments consisting of ASCII
  113. -- letters and digits, separated by either the '-' or '_'
  114. -- character. The first character of a signal name must be a
  115. -- letter. Names which violate these rules lead to undefined
  116. -- behaviour of the GSignal system.
  117. -- When registering a signal and looking up a signal, either
  118. -- separator can be used, but they cannot be mixed.
  119. -- Note: Class-level closure and accumulator are currently not implemented;
  120. require
  121. valid_gobject: a_gobject /= Void
  122. valid_flags: are_valid_signal_flags (some_flags)
  123. valid_return_type:
  124. do
  125. -- guint g_signal_newv (const gchar *signal_name, Type itype,
  126. -- GSignalFlags signal_flags, GClosure *class_closure,
  127. -- GSignalAccumulator accumulator, gpointer accu_data,
  128. -- GSignalCMarshaller c_marshaller, GType return_type, guint
  129. -- n_params, GType *param_types);
  130. -- Creates a new signal. (This is usually done in the class initializer.)
  131. -- A signal name consists of segments consisting of ASCII
  132. -- letters and digits, separated by either the '-' or '_'
  133. -- character. The first character of a signal name must be a
  134. -- letter. Names which violate these rules lead to undefined
  135. -- behaviour of the GSignal system.
  136. -- When registering a signal and looking up a signal, either separator can be used, but they cannot be mixed.
  137. -- signal_name : the name for the signal
  138. -- itype : the type this signal pertains to. It will also pertain to types which are derived from this type.
  139. -- 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.
  140. -- class_closure : The closure to invoke on signal emission.
  141. -- accumulator : the accumulator for this signal; may be NULL.
  142. -- accu_data : user data for the accumulator.
  143. -- c_marshaller : the function to translate arrays of parameter values to signal emissions into C language callback invocations.
  144. -- return_type : the type of return value, or G_TYPE_NONE for a signal without a return value.
  145. -- n_params : the length of param_types.
  146. -- param_types : an array types, one for each parameter.
  147. -- Returns : the signal id
  148. -- signal_id := g_signal_newv (a_name.to_external, a_gobject.type,
  149. not_yet_implemented
  150. end
  151. -- g_signal_new_valist is unwrappable since it uses va_list
  152. -- g_signal_list_ids ()
  153. -- guint* g_signal_list_ids (GType itype,
  154. -- guint *n_ids);
  155. -- 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().
  156. -- itype : Instance or interface type.
  157. -- n_ids : Location to store the number of signal ids for itype.
  158. -- Returns : Newly allocated array of signal IDs.
  159. -- g_signal_emit ()
  160. -- void g_signal_emit (gpointer instance,
  161. -- guint signal_id,
  162. -- GQuark detail,
  163. -- ...);
  164. -- Emits a signal.
  165. -- Note that g_signal_emit() resets the return value to the default if no handlers are connected, in contrast to g_signal_emitv().
  166. -- instance : the instance the signal is being emitted on.
  167. -- signal_id : the signal id
  168. -- detail : the detail
  169. -- ... : 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.
  170. -- g_signal_emit_by_name ()
  171. -- void g_signal_emit_by_name (gpointer instance,
  172. -- const gchar *detailed_signal,
  173. -- ...);
  174. -- Emits a signal.
  175. -- 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().
  176. -- instance : the instance the signal is being emitted on.
  177. -- detailed_signal : a string of the form "signal-name::detail".
  178. -- ... : 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.
  179. -- g_signal_emitv ()
  180. -- void g_signal_emitv (const GValue *instance_and_params,
  181. -- guint signal_id,
  182. -- GQuark detail,
  183. -- GValue *return_value);
  184. -- Emits a signal.
  185. -- 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().
  186. -- 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.
  187. -- signal_id : the signal id
  188. -- detail : the detail
  189. -- return_value : Location to store the return value of the signal emission.
  190. -- g_signal_emit_valist ()
  191. -- void g_signal_emit_valist (gpointer instance,
  192. -- guint signal_id,
  193. -- GQuark detail,
  194. -- va_list var_args);
  195. -- Emits a signal.
  196. -- Note that g_signal_emit_valist() resets the return value to the default if no handlers are connected, in contrast to g_signal_emitv().
  197. -- instance : the instance the signal is being emitted on.
  198. -- signal_id : the signal id
  199. -- detail : the detail
  200. -- 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.
  201. -- Note: g_signal_connect() wrapped in G_SIGNALS
  202. -- g_signal_connect_after()
  203. -- #define g_signal_connect_after(instance, detailed_signal, c_handler, data)
  204. -- Connects a GCallback function to a signal for a particular object.
  205. -- The handler will be called after the default handler of the signal.
  206. -- instance : the instance to connect to.
  207. -- detailed_signal : a string of the form "signal-name::detail".
  208. -- c_handler : the GCallback to connect.
  209. -- data : data to pass to c_handler calls.
  210. -- Returns : the handler id
  211. -- g_signal_connect_swapped()
  212. -- #define g_signal_connect_swapped(instance, detailed_signal, c_handler, data)
  213. -- Connects a GCallback function to a signal for a particular object.
  214. -- The instance on which the signal is emitted and data will be swapped when calling the handler.
  215. -- instance : the instance to connect to.
  216. -- detailed_signal : a string of the form "signal-name::detail".
  217. -- c_handler : the GCallback to connect.
  218. -- data : data to pass to c_handler calls.
  219. -- Returns : the handler id
  220. -- g_signal_connect_object ()
  221. -- gulong g_signal_connect_object (gpointer instance,
  222. -- const gchar *detailed_signal,
  223. -- GCallback c_handler,
  224. -- gpointer gobject,
  225. -- GConnectFlags connect_flags);
  226. -- 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.
  227. -- 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.
  228. -- 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:
  229. -- if (g_signal_handler_is_connected (instance, id))
  230. -- g_signal_handler_disconnect (instance, id);
  231. -- instance : the instance to connect to.
  232. -- detailed_signal : a string of the form "signal-name::detail".
  233. -- c_handler : the GCallback to connect.
  234. -- gobject : the object to pass as data to c_handler.
  235. -- connect_flags : a combination of GConnnectFlags.
  236. -- Returns : the handler id.
  237. -- enum GConnectFlags
  238. -- typedef enum
  239. -- {
  240. -- G_CONNECT_AFTER = 1 < < 0,
  241. -- G_CONNECT_SWAPPED = 1 < < 1
  242. -- } GConnectFlags;
  243. -- The connection flags are used to specify the behaviour of a signal's connection.
  244. -- G_CONNECT_AFTER whether the handler should be called before or after the default handler of the signal.
  245. -- G_CONNECT_SWAPPED whether the instance and data should be swapped when calling the handler.
  246. -- g_signal_connect_data ()
  247. -- gulong g_signal_connect_data (gpointer instance,
  248. -- const gchar *detailed_signal,
  249. -- GCallback c_handler,
  250. -- gpointer data,
  251. -- GClosureNotify destroy_data,
  252. -- GConnectFlags connect_flags);
  253. -- 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.
  254. -- instance : the instance to connect to.
  255. -- detailed_signal : a string of the form "signal-name::detail".
  256. -- c_handler : the GCallback to connect.
  257. -- data : data to pass to c_handler calls.
  258. -- destroy_data : a GDestroyNotify for data.
  259. -- connect_flags : a combination of GConnectFlags.
  260. -- Returns : the handler id
  261. -- g_signal_connect_closure ()
  262. -- gulong g_signal_connect_closure (gpointer instance,
  263. -- const gchar *detailed_signal,
  264. -- GClosure *closure,
  265. -- gboolean after);
  266. -- Connects a closure to a signal for a particular object.
  267. -- instance : the instance to connect to.
  268. -- detailed_signal : a string of the form "signal-name::detail".
  269. -- closure : the closure to connect.
  270. -- after : whether the handler should be called before or after the default handler of the signal.
  271. -- Returns : the handler id
  272. -- g_signal_connect_closure_by_id ()
  273. -- gulong g_signal_connect_closure_by_id (gpointer instance,
  274. -- guint signal_id,
  275. -- GQuark detail,
  276. -- GClosure *closure,
  277. -- gboolean after);
  278. -- Connects a closure to a signal for a particular object.
  279. -- instance : the instance to connect to.
  280. -- signal_id : the id of the signal.
  281. -- detail : the detail.
  282. -- closure : the closure to connect.
  283. -- after : whether the handler should be called before or after the default handler of the signal.
  284. -- Returns : the handler id
  285. -- g_signal_handler_block ()
  286. -- void g_signal_handler_block (gpointer instance,
  287. -- gulong handler_id);
  288. -- 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.
  289. -- The handler_id has to be a valid signal handler id, connected to a signal of instance.
  290. -- instance : The instance to block the signal handler of.
  291. -- handler_id : Handler id of the handler to be blocked.
  292. -- g_signal_handler_unblock ()
  293. -- void g_signal_handler_unblock (gpointer instance,
  294. -- gulong handler_id);
  295. -- 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).
  296. -- 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.
  297. -- instance : The instance to unblock the signal handler of.
  298. -- handler_id : Handler id of the handler to be unblocked.
  299. -- g_signal_handler_disconnect ()
  300. -- void g_signal_handler_disconnect (gpointer instance,
  301. -- gulong handler_id);
  302. -- 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.
  303. -- The handler_id has to be a valid signal handler id, connected to a signal of instance.
  304. -- instance : The instance to remove the signal handler from.
  305. -- handler_id : Handler id of the handler to be disconnected.
  306. -- g_signal_handler_find ()
  307. -- gulong g_signal_handler_find (gpointer instance,
  308. -- GSignalMatchType mask,
  309. -- guint signal_id,
  310. -- GQuark detail,
  311. -- GClosure *closure,
  312. -- gpointer func,
  313. -- gpointer data);
  314. -- 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.
  315. -- instance : The instance owning the signal handler to be found.
  316. -- mask : Mask indicating which of signal_id, detail, closure, func and/or data the handler has to match.
  317. -- signal_id : Signal the handler has to be connected to.
  318. -- detail : Signal detail the handler has to be connected to.
  319. -- closure : The closure the handler will invoke.
  320. -- func : The C closure callback of the handler (useless for non-C closures).
  321. -- data : The closure data of the handler's closure.
  322. -- Returns : A valid non-0 signal handler id for a successful match.
  323. -- g_signal_handlers_block_matched ()
  324. -- guint g_signal_handlers_block_matched (gpointer instance,
  325. -- GSignalMatchType mask,
  326. -- guint signal_id,
  327. -- GQuark detail,
  328. -- GClosure *closure,
  329. -- gpointer func,
  330. -- gpointer data);
  331. -- 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.
  332. -- instance : The instance to block handlers from.
  333. -- mask : Mask indicating which of signal_id, detail, closure, func and/or data the handlers have to match.
  334. -- signal_id : Signal the handlers have to be connected to.
  335. -- detail : Signal detail the handlers have to be connected to.
  336. -- closure : The closure the handlers will invoke.
  337. -- func : The C closure callback of the handlers (useless for non-C closures).
  338. -- data : The closure data of the handlers' closures.
  339. -- Returns : The amount of handlers that got blocked.
  340. -- g_signal_handlers_unblock_matched ()
  341. -- guint g_signal_handlers_unblock_matched
  342. -- (gpointer instance,
  343. -- GSignalMatchType mask,
  344. -- guint signal_id,
  345. -- GQuark detail,
  346. -- GClosure *closure,
  347. -- gpointer func,
  348. -- gpointer data);
  349. -- 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.
  350. -- instance : The instance to unblock handlers from.
  351. -- mask : Mask indicating which of signal_id, detail, closure, func and/or data the handlers have to match.
  352. -- signal_id : Signal the handlers have to be connected to.
  353. -- detail : Signal detail the handlers have to be connected to.
  354. -- closure : The closure the handlers will invoke.
  355. -- func : The C closure callback of the handlers (useless for non-C closures).
  356. -- data : The closure data of the handlers' closures.
  357. -- Returns : The amount of handlers that got unblocked.
  358. -- g_signal_handlers_disconnect_matched ()
  359. -- guint g_signal_handlers_disconnect_matched
  360. -- (gpointer instance,
  361. -- GSignalMatchType mask,
  362. -- guint signal_id,
  363. -- GQuark detail,
  364. -- GClosure *closure,
  365. -- gpointer func,
  366. -- gpointer data);
  367. -- 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.
  368. -- instance : The instance to remove handlers from.
  369. -- mask : Mask indicating which of signal_id, detail, closure, func and/or data the handlers have to match.
  370. -- signal_id : Signal the handlers have to be connected to.
  371. -- detail : Signal detail the handlers have to be connected to.
  372. -- closure : The closure the handlers will invoke.
  373. -- func : The C closure callback of the handlers (useless for non-C closures).
  374. -- data : The closure data of the handlers' closures.
  375. -- Returns : The amount of handlers that got disconnected.
  376. -- g_signal_handler_is_connected ()
  377. -- gboolean g_signal_handler_is_connected (gpointer instance,
  378. -- gulong handler_id);
  379. -- Returns whether handler_id is the id of a handler connected to instance.
  380. -- instance : The instance where a signal handler is sought.
  381. -- handler_id : the handler id.
  382. -- Returns : whether handler_id identifies a handler connected to instance.
  383. -- g_signal_handlers_block_by_func()
  384. -- #define g_signal_handlers_block_by_func(instance, func, data)
  385. -- Blocks all handlers on an instance that match func and data.
  386. -- instance : The instance to block handlers from.
  387. -- func : The C closure callback of the handlers (useless for non-C closures).
  388. -- data : The closure data of the handlers' closures.
  389. -- Returns : The number of handlers that got blocked.
  390. -- g_signal_handlers_unblock_by_func()
  391. -- #define g_signal_handlers_unblock_by_func(instance, func, data)
  392. -- Unblocks all handlers on an instance that match func and data.
  393. -- instance : The instance to unblock handlers from.
  394. -- func : The C closure callback of the handlers (useless for non-C closures).
  395. -- data : The closure data of the handlers' closures.
  396. -- Returns : The number of handlers that got unblocked.
  397. -- g_signal_handlers_disconnect_by_func()
  398. -- #define g_signal_handlers_disconnect_by_func(instance, func, data)
  399. -- Disconnects all handlers on an instance that match func and data.
  400. -- instance : The instance to remove handlers from.
  401. -- func : The C closure callback of the handlers (useless for non-C closures).
  402. -- data : The closure data of the handlers' closures.
  403. -- Returns : The number of handlers that got disconnected.
  404. -- g_signal_has_handler_pending ()
  405. -- gboolean g_signal_has_handler_pending (gpointer instance,
  406. -- guint signal_id,
  407. -- GQuark detail,
  408. -- gboolean may_be_blocked);
  409. -- Returns whether there are any handlers connected to instance for the given signal id and detail.
  410. -- 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.
  411. -- instance : the object whose signal handlers are sought.
  412. -- signal_id : the signal id.
  413. -- detail : the detail.
  414. -- may_be_blocked : whether blocked handlers should count as match.
  415. -- Returns : TRUE if a handler is connected to the signal, FALSE otherwise.
  416. -- g_signal_stop_emission ()
  417. -- void g_signal_stop_emission (gpointer instance,
  418. -- guint signal_id,
  419. -- GQuark detail);
  420. -- Stops a signal's current emission.
  421. -- 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).
  422. -- Prints a warning if used on a signal which isn't being emitted.
  423. -- instance : the object whose signal handlers you wish to stop.
  424. -- signal_id : the signal identifier, as returned by g_signal_lookup().
  425. -- detail : the detail which the signal was emitted with.
  426. -- g_signal_override_class_closure ()
  427. -- void g_signal_override_class_closure (guint signal_id,
  428. -- GType instance_type,
  429. -- GClosure *class_closure);
  430. -- 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.
  431. -- signal_id : the signal id
  432. -- instance_type : the instance type on which to override the class closure for the signal.
  433. -- class_closure : the closure.
  434. -- g_signal_chain_from_overridden ()
  435. -- void g_signal_chain_from_overridden (const GValue *instance_and_params,
  436. -- GValue *return_value);
  437. -- 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().
  438. -- 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.
  439. -- return_value : Location for the return value.
  440. -- g_signal_add_emission_hook ()
  441. -- gulong g_signal_add_emission_hook (guint signal_id,
  442. -- GQuark detail,
  443. -- GSignalEmissionHook hook_func,
  444. -- gpointer hook_data,
  445. -- GDestroyNotify data_destroy);
  446. -- 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.
  447. -- signal_id : the signal identifier, as returned by g_signal_lookup().
  448. -- detail : the detail on which to call the hook.
  449. -- hook_func : a GSignalEmissionHook function.
  450. -- hook_data : user data for hook_func.
  451. -- data_destroy : a GDestroyNotify for hook_data.
  452. -- Returns : the hook id, for later use with g_signal_remove_emission_hook().
  453. -- g_signal_remove_emission_hook ()
  454. -- void g_signal_remove_emission_hook (guint signal_id,
  455. -- gulong hook_id);
  456. -- Deletes an emission hook.
  457. -- signal_id : the id of the signal
  458. -- hook_id : the id of the emission hook, as returned by g_signal_add_emission_hook()
  459. -- g_signal_parse_name ()
  460. -- gboolean g_signal_parse_name (const gchar *detailed_signal,
  461. -- GType itype,
  462. -- guint *signal_id_p,
  463. -- GQuark *detail_p,
  464. -- gboolean force_detail_quark);
  465. -- Internal function to parse a signal name into its signal_id and detail quark.
  466. -- detailed_signal : a string of the form "signal-name::detail".
  467. -- itype : The interface/instance type that introduced "signal-name".
  468. -- signal_id_p : Location to store the signal id.
  469. -- detail_p : Location to store the detail quark.
  470. -- force_detail_quark : TRUE forces creation of a GQuark for the detail.
  471. -- Returns : Whether the signal name could successfully be parsed and signal_id_p and detail_p contain valid return values.
  472. -- g_signal_get_invocation_hint ()
  473. -- GSignalInvocationHint* g_signal_get_invocation_hint
  474. -- (gpointer instance);
  475. -- Returns the invocation hint of the innermost signal emission of instance.
  476. -- instance : the instance to query
  477. -- Returns : the invocation hint of the innermost signal emission.
  478. -- g_signal_type_cclosure_new ()
  479. -- GClosure* g_signal_type_cclosure_new (GType itype,
  480. -- guint struct_offset);
  481. -- 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.
  482. -- itype : the GType identifier of an interface or classed type
  483. -- struct_offset : the offset of the member function of itype's class structure which is to be invoked by the new closure
  484. -- Returns : a new GCClosure
  485. -- g_signal_accumulator_true_handled ()
  486. -- gboolean g_signal_accumulator_true_handled
  487. -- (GSignalInvocationHint *ihint,
  488. -- GValue *return_accu,
  489. -- const GValue *handler_return,
  490. -- gpointer dummy);
  491. -- 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.
  492. -- ihint : standard GSignalAccumulator parameter
  493. -- return_accu : standard GSignalAccumulator parameter
  494. -- handler_return : standard GSignalAccumulator parameter
  495. -- dummy : standard GSignalAccumulator parameter
  496. -- Returns : standard GSignalAccumulator result
  497. -- Since 2.4
  498. -- [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.
  499. end