1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19  
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 /*
25  * Conversion parameters:
26  * inFile  = gobject-Signals.html
27  * outPack = gobject
28  * outFile = Signals
29  * strct   = 
30  * realStrct=
31  * ctorStrct=
32  * clss    = Signals
33  * interf  = 
34  * class Code: Yes
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- g_signal_
41  * omit structs:
42  * omit prefixes:
43  * omit code:
44  * omit signals:
45  * imports:
46  * 	- glib.Str
47  * 	- gobject.Closure
48  * 	- gobject.Value
49  * 	- glib.Quark
50  * structWrap:
51  * 	- GClosure* -> Closure
52  * 	- GQuark* -> Quark
53  * 	- GValue* -> Value
54  * module aliases:
55  * local aliases:
56  * overrides:
57  */
58 
59 module gobject.Signals;
60 
61 public  import gtkc.gobjecttypes;
62 
63 private import gtkc.gobject;
64 private import glib.ConstructionException;
65 private import gobject.ObjectG;
66 
67 private import glib.Str;
68 private import gobject.Closure;
69 private import gobject.Value;
70 private import glib.Quark;
71 
72 
73 
74 /**
75  * The basic concept of the signal system is that of the
76  * emission of a signal. Signals are introduced
77  * per-type and are identified through strings. Signals introduced
78  * for a parent type are available in derived types as well, so
79  * basically they are a per-type facility that is inherited. A signal
80  * emission mainly involves invocation of a certain set of callbacks
81  * in precisely defined manner. There are two main categories of such
82  * callbacks, per-object
83  * [10]
84  * ones and user provided ones.
85  * The per-object callbacks are most often referred to as "object method
86  * handler" or "default (signal) handler", while user provided callbacks are
87  * usually just called "signal handler".
88  * The object method handler is provided at signal creation time (this most
89  * frequently happens at the end of an object class' creation), while user
90  * provided handlers are frequently connected and disconnected to/from a certain
91  * signal on certain object instances.
92  *
93  * A signal emission consists of five stages, unless prematurely stopped:
94  *
95  * 	1 - Invocation of the object method handler for G_SIGNAL_RUN_FIRST signals
96  *
97  * 	2 - Invocation of normal user-provided signal handlers (after flag FALSE)
98  *
99  * 	3 - Invocation of the object method handler for G_SIGNAL_RUN_LAST signals
100  *
101  * 	4 - Invocation of user provided signal handlers, connected with an after flag of TRUE
102  *
103  * 	5 - Invocation of the object method handler for G_SIGNAL_RUN_CLEANUP signals
104  *
105  * The user-provided signal handlers are called in the order they were
106  * connected in.
107  * All handlers may prematurely stop a signal emission, and any number of
108  * handlers may be connected, disconnected, blocked or unblocked during
109  * a signal emission.
110  * There are certain criteria for skipping user handlers in stages 2 and 4
111  * of a signal emission.
112  * First, user handlers may be blocked, blocked handlers are omitted
113  * during callback invocation, to return from the "blocked" state, a
114  * handler has to get unblocked exactly the same amount of times
115  * it has been blocked before.
116  * Second, upon emission of a G_SIGNAL_DETAILED signal, an additional
117  * "detail" argument passed in to g_signal_emit() has to match the detail
118  * argument of the signal handler currently subject to invocation.
119  * Specification of no detail argument for signal handlers (omission of the
120  * detail part of the signal specification upon connection) serves as a
121  * wildcard and matches any detail argument passed in to emission.
122  */
123 public class Signals
124 {
125 	
126 	/** */
127 	public static gulong connectData(void* instanc, string detailedSignal, GCallback cHandler, Object data, GClosureNotify destroyData, GConnectFlags connectFlags)
128 	{
129 		// gulong g_signal_connect_data (gpointer instance,  const gchar *detailed_signal,  GCallback c_handler,  gpointer data,  GClosureNotify destroy_data,  GConnectFlags connect_flags);
130 		return g_signal_connect_data(instanc, Str.toStringz(detailedSignal), cHandler, cast(void*)data, destroyData, connectFlags);
131 	}
132 	
133 	
134 	/**
135 	 */
136 	
137 	/**
138 	 * Creates a new signal. (This is usually done in the class initializer.)
139 	 * See g_signal_new() for details on allowed signal names.
140 	 * If c_marshaller is NULL g_cclosure_marshal_generic will be used as
141 	 * the marshaller for this signal.
142 	 * Params:
143 	 * signalName = the name for the signal
144 	 * itype = the type this signal pertains to. It will also pertain to
145 	 * types which are derived from this type
146 	 * signalFlags = a combination of GSignalFlags specifying detail of when
147 	 * the default handler is to be invoked. You should at least specify
148 	 * G_SIGNAL_RUN_FIRST or G_SIGNAL_RUN_LAST
149 	 * classClosure = The closure to invoke on signal emission;
150 	 * may be NULL. [allow-none]
151 	 * accumulator = the accumulator for this signal; may be NULL. [allow-none]
152 	 * accuData = user data for the accumulator
153 	 * cMarshaller = the function to translate arrays of
154 	 * parameter values to signal emissions into C language callback
155 	 * invocations or NULL. [allow-none]
156 	 * returnType = the type of return value, or G_TYPE_NONE for a signal
157 	 * without a return value
158 	 * paramTypes = an array of types, one for
159 	 * each parameter. [array length=n_params]
160 	 * Returns: the signal id
161 	 */
162 	public static uint newv(string signalName, GType itype, GSignalFlags signalFlags, Closure classClosure, GSignalAccumulator accumulator, void* accuData, GSignalCMarshaller cMarshaller, GType returnType, GType[] paramTypes)
163 	{
164 		// guint g_signal_newv (const gchar *signal_name,  GType itype,  GSignalFlags signal_flags,  GClosure *class_closure,  GSignalAccumulator accumulator,  gpointer accu_data,  GSignalCMarshaller c_marshaller,  GType return_type,  guint n_params,  GType *param_types);
165 		return g_signal_newv(Str.toStringz(signalName), itype, signalFlags, (classClosure is null) ? null : classClosure.getClosureStruct(), accumulator, accuData, cMarshaller, returnType, cast(int) paramTypes.length, paramTypes.ptr);
166 	}
167 	
168 	/**
169 	 * Creates a new signal. (This is usually done in the class initializer.)
170 	 * See g_signal_new() for details on allowed signal names.
171 	 * If c_marshaller is NULL, g_cclosure_marshal_generic() will be used as
172 	 * the marshaller for this signal.
173 	 * Params:
174 	 * signalName = the name for the signal
175 	 * itype = the type this signal pertains to. It will also pertain to
176 	 * types which are derived from this type.
177 	 * signalFlags = a combination of GSignalFlags specifying detail of when
178 	 * the default handler is to be invoked. You should at least specify
179 	 * G_SIGNAL_RUN_FIRST or G_SIGNAL_RUN_LAST.
180 	 * classClosure = The closure to invoke on signal emission; may be NULL.
181 	 * accumulator = the accumulator for this signal; may be NULL.
182 	 * accuData = user data for the accumulator.
183 	 * cMarshaller = the function to translate arrays of parameter
184 	 * values to signal emissions into C language callback invocations or NULL. [allow-none]
185 	 * returnType = the type of return value, or G_TYPE_NONE for a signal
186 	 * without a return value.
187 	 * nParams = the number of parameter types in args.
188 	 * args = va_list of GType, one for each parameter.
189 	 * Returns: the signal id
190 	 */
191 	public static uint newValist(string signalName, GType itype, GSignalFlags signalFlags, Closure classClosure, GSignalAccumulator accumulator, void* accuData, GSignalCMarshaller cMarshaller, GType returnType, uint nParams, void* args)
192 	{
193 		// guint g_signal_new_valist (const gchar *signal_name,  GType itype,  GSignalFlags signal_flags,  GClosure *class_closure,  GSignalAccumulator accumulator,  gpointer accu_data,  GSignalCMarshaller c_marshaller,  GType return_type,  guint n_params,  va_list args);
194 		return g_signal_new_valist(Str.toStringz(signalName), itype, signalFlags, (classClosure is null) ? null : classClosure.getClosureStruct(), accumulator, accuData, cMarshaller, returnType, nParams, args);
195 	}
196 	
197 	/**
198 	 */
199 	public static void setVaMarshaller(uint signalId, GType instanceType, GSignalCVaMarshaller vaMarshaller)
200 	{
201 		// void g_signal_set_va_marshaller (guint signal_id,  GType instance_type,  GSignalCVaMarshaller va_marshaller);
202 		g_signal_set_va_marshaller(signalId, instanceType, vaMarshaller);
203 	}
204 	
205 	/**
206 	 * Queries the signal system for in-depth information about a
207 	 * specific signal. This function will fill in a user-provided
208 	 * structure to hold signal-specific information. If an invalid
209 	 * signal id is passed in, the signal_id member of the GSignalQuery
210 	 * is 0. All members filled into the GSignalQuery structure should
211 	 * be considered constant and have to be left untouched.
212 	 * Params:
213 	 * signalId = The signal id of the signal to query information for.
214 	 * query = A user provided structure that is
215 	 * filled in with constant values upon success. [out caller-allocates]
216 	 */
217 	public static void query(uint signalId, GSignalQuery* query)
218 	{
219 		// void g_signal_query (guint signal_id,  GSignalQuery *query);
220 		g_signal_query(signalId, query);
221 	}
222 	
223 	/**
224 	 * Given the name of the signal and the type of object it connects to, gets
225 	 * the signal's identifying integer. Emitting the signal by number is
226 	 * somewhat faster than using the name each time.
227 	 * Also tries the ancestors of the given type.
228 	 * See g_signal_new() for details on allowed signal names.
229 	 * Params:
230 	 * name = the signal's name.
231 	 * itype = the type that the signal operates on.
232 	 * Returns: the signal's identifying number, or 0 if no signal was found.
233 	 */
234 	public static uint lookup(string name, GType itype)
235 	{
236 		// guint g_signal_lookup (const gchar *name,  GType itype);
237 		return g_signal_lookup(Str.toStringz(name), itype);
238 	}
239 	
240 	/**
241 	 * Given the signal's identifier, finds its name.
242 	 * Two different signals may have the same name, if they have differing types.
243 	 * Params:
244 	 * signalId = the signal's identifying number.
245 	 * Returns: the signal name, or NULL if the signal number was invalid.
246 	 */
247 	public static string name(uint signalId)
248 	{
249 		// const gchar * g_signal_name (guint signal_id);
250 		return Str.toString(g_signal_name(signalId));
251 	}
252 	
253 	/**
254 	 * Lists the signals by id that a certain instance or interface type
255 	 * created. Further information about the signals can be acquired through
256 	 * g_signal_query().
257 	 * Params:
258 	 * itype = Instance or interface type.
259 	 * Returns: Newly allocated array of signal IDs. [array length=n_ids]
260 	 */
261 	public static uint[] listIds(GType itype)
262 	{
263 		// guint * g_signal_list_ids (GType itype,  guint *n_ids);
264 		uint nIds;
265 		auto p = g_signal_list_ids(itype, &nIds);
266 		
267 		if(p is null)
268 		{
269 			return null;
270 		}
271 		
272 		return p[0 .. nIds];
273 	}
274 	
275 	/**
276 	 * Emits a signal.
277 	 * Note that g_signal_emitv() doesn't change return_value if no handlers are
278 	 * connected, in contrast to g_signal_emit() and g_signal_emit_valist().
279 	 * Params:
280 	 * instanceAndParams = argument list for the signal emission.
281 	 * The first element in the array is a GValue for the instance the signal
282 	 * is being emitted on. The rest are any arguments to be passed to the signal. [array]
283 	 * signalId = the signal id
284 	 * detail = the detail
285 	 * returnValue = Location to store the return value of the signal emission.
286 	 */
287 	public static void emitv(Value instanceAndParams, uint signalId, GQuark detail, Value returnValue)
288 	{
289 		// void g_signal_emitv (const GValue *instance_and_params,  guint signal_id,  GQuark detail,  GValue *return_value);
290 		g_signal_emitv((instanceAndParams is null) ? null : instanceAndParams.getValueStruct(), signalId, detail, (returnValue is null) ? null : returnValue.getValueStruct());
291 	}
292 	
293 	/**
294 	 * Emits a signal.
295 	 * Note that g_signal_emit_valist() resets the return value to the default
296 	 * if no handlers are connected, in contrast to g_signal_emitv().
297 	 * Params:
298 	 * signalId = the signal id
299 	 * detail = the detail
300 	 * varArgs = a list of parameters to be passed to the signal, followed by a
301 	 * location for the return value. If the return type of the signal
302 	 * is G_TYPE_NONE, the return value location can be omitted.
303 	 */
304 	public static void emitValist(void* instanc, uint signalId, GQuark detail, void* varArgs)
305 	{
306 		// void g_signal_emit_valist (gpointer instance,  guint signal_id,  GQuark detail,  va_list var_args);
307 		g_signal_emit_valist(instanc, signalId, detail, varArgs);
308 	}
309 	
310 	/**
311 	 * This is similar to g_signal_connect_data(), but uses a closure which
312 	 * ensures that the gobject stays alive during the call to c_handler
313 	 * by temporarily adding a reference count to gobject.
314 	 * When the gobject is destroyed the signal handler will be automatically
315 	 * Params:
316 	 * detailedSignal = a string of the form "signal-name::detail".
317 	 * cHandler = the GCallback to connect.
318 	 * gobject = the object to pass as data to c_handler.
319 	 * connectFlags = a combination of GConnectFlags.
320 	 * Returns: the handler id.
321 	 */
322 	public static gulong connectObject(void* instanc, string detailedSignal, GCallback cHandler, void* gobject, GConnectFlags connectFlags)
323 	{
324 		// gulong g_signal_connect_object (gpointer instance,  const gchar *detailed_signal,  GCallback c_handler,  gpointer gobject,  GConnectFlags connect_flags);
325 		return g_signal_connect_object(instanc, Str.toStringz(detailedSignal), cHandler, gobject, connectFlags);
326 	}
327 	
328 	/**
329 	 * Connects a GCallback function to a signal for a particular object. Similar
330 	 * to g_signal_connect(), but allows to provide a GClosureNotify for the data
331 	 * which will be called when the signal handler is disconnected and no longer
332 	 * used. Specify connect_flags if you need ..._after() or
333 	 * ..._swapped() variants of this function.
334 	 * Params:
335 	 * detailedSignal = a string of the form "signal-name::detail".
336 	 * cHandler = the GCallback to connect.
337 	 * data = data to pass to c_handler calls.
338 	 * destroyData = a GClosureNotify for data.
339 	 * connectFlags = a combination of GConnectFlags.
340 	 * Returns: the handler id
341 	 */
342 	public static gulong connectData(void* instanc, string detailedSignal, GCallback cHandler, void* data, GClosureNotify destroyData, GConnectFlags connectFlags)
343 	{
344 		// gulong g_signal_connect_data (gpointer instance,  const gchar *detailed_signal,  GCallback c_handler,  gpointer data,  GClosureNotify destroy_data,  GConnectFlags connect_flags);
345 		return g_signal_connect_data(instanc, Str.toStringz(detailedSignal), cHandler, data, destroyData, connectFlags);
346 	}
347 	
348 	/**
349 	 * Connects a closure to a signal for a particular object.
350 	 * Params:
351 	 * detailedSignal = a string of the form "signal-name::detail".
352 	 * closure = the closure to connect.
353 	 * after = whether the handler should be called before or after the
354 	 * default handler of the signal.
355 	 * Returns: the handler id
356 	 */
357 	public static gulong connectClosure(void* instanc, string detailedSignal, Closure closure, int after)
358 	{
359 		// gulong g_signal_connect_closure (gpointer instance,  const gchar *detailed_signal,  GClosure *closure,  gboolean after);
360 		return g_signal_connect_closure(instanc, Str.toStringz(detailedSignal), (closure is null) ? null : closure.getClosureStruct(), after);
361 	}
362 	
363 	/**
364 	 * Connects a closure to a signal for a particular object.
365 	 * Params:
366 	 * signalId = the id of the signal.
367 	 * detail = the detail.
368 	 * closure = the closure to connect.
369 	 * after = whether the handler should be called before or after the
370 	 * default handler of the signal.
371 	 * Returns: the handler id
372 	 */
373 	public static gulong connectClosureById(void* instanc, uint signalId, GQuark detail, Closure closure, int after)
374 	{
375 		// gulong g_signal_connect_closure_by_id (gpointer instance,  guint signal_id,  GQuark detail,  GClosure *closure,  gboolean after);
376 		return g_signal_connect_closure_by_id(instanc, signalId, detail, (closure is null) ? null : closure.getClosureStruct(), after);
377 	}
378 	
379 	/**
380 	 * Blocks a handler of an instance so it will not be called during any
381 	 * signal emissions unless it is unblocked again. Thus "blocking" a
382 	 * signal handler means to temporarily deactive it, a signal handler
383 	 * has to be unblocked exactly the same amount of times it has been
384 	 * blocked before to become active again.
385 	 * The handler_id has to be a valid signal handler id, connected to a
386 	 * signal of instance.
387 	 * Params:
388 	 * handlerId = Handler id of the handler to be blocked.
389 	 */
390 	public static void handlerBlock(void* instanc, gulong handlerId)
391 	{
392 		// void g_signal_handler_block (gpointer instance,  gulong handler_id);
393 		g_signal_handler_block(instanc, handlerId);
394 	}
395 	
396 	/**
397 	 * Undoes the effect of a previous g_signal_handler_block() call. A
398 	 * blocked handler is skipped during signal emissions and will not be
399 	 * invoked, unblocking it (for exactly the amount of times it has been
400 	 * blocked before) reverts its "blocked" state, so the handler will be
401 	 * recognized by the signal system and is called upon future or
402 	 * currently ongoing signal emissions (since the order in which
403 	 * handlers are called during signal emissions is deterministic,
404 	 * whether the unblocked handler in question is called as part of a
405 	 * currently ongoing emission depends on how far that emission has
406 	 * proceeded yet).
407 	 * The handler_id has to be a valid id of a signal handler that is
408 	 * connected to a signal of instance and is currently blocked.
409 	 * Params:
410 	 * handlerId = Handler id of the handler to be unblocked.
411 	 */
412 	public static void handlerUnblock(void* instanc, gulong handlerId)
413 	{
414 		// void g_signal_handler_unblock (gpointer instance,  gulong handler_id);
415 		g_signal_handler_unblock(instanc, handlerId);
416 	}
417 	
418 	/**
419 	 * Disconnects a handler from an instance so it will not be called during
420 	 * any future or currently ongoing emissions of the signal it has been
421 	 * connected to. The handler_id becomes invalid and may be reused.
422 	 * The handler_id has to be a valid signal handler id, connected to a
423 	 * signal of instance.
424 	 * Params:
425 	 * handlerId = Handler id of the handler to be disconnected.
426 	 */
427 	public static void handlerDisconnect(void* instanc, gulong handlerId)
428 	{
429 		// void g_signal_handler_disconnect (gpointer instance,  gulong handler_id);
430 		g_signal_handler_disconnect(instanc, handlerId);
431 	}
432 	
433 	/**
434 	 * Finds the first signal handler that matches certain selection criteria.
435 	 * The criteria mask is passed as an OR-ed combination of GSignalMatchType
436 	 * flags, and the criteria values are passed as arguments.
437 	 * The match mask has to be non-0 for successful matches.
438 	 * If no handler was found, 0 is returned.
439 	 * Params:
440 	 * mask = Mask indicating which of signal_id, detail, closure, func
441 	 * and/or data the handler has to match.
442 	 * signalId = Signal the handler has to be connected to.
443 	 * detail = Signal detail the handler has to be connected to.
444 	 * closure = The closure the handler will invoke. [allow-none]
445 	 * func = The C closure callback of the handler (useless for non-C closures).
446 	 * data = The closure data of the handler's closure.
447 	 * Returns: A valid non-0 signal handler id for a successful match.
448 	 */
449 	public static gulong handlerFind(void* instanc, GSignalMatchType mask, uint signalId, GQuark detail, Closure closure, void* func, void* data)
450 	{
451 		// gulong g_signal_handler_find (gpointer instance,  GSignalMatchType mask,  guint signal_id,  GQuark detail,  GClosure *closure,  gpointer func,  gpointer data);
452 		return g_signal_handler_find(instanc, mask, signalId, detail, (closure is null) ? null : closure.getClosureStruct(), func, data);
453 	}
454 	
455 	/**
456 	 * Blocks all handlers on an instance that match a certain selection criteria.
457 	 * The criteria mask is passed as an OR-ed combination of GSignalMatchType
458 	 * flags, and the criteria values are passed as arguments.
459 	 * Passing at least one of the G_SIGNAL_MATCH_CLOSURE, G_SIGNAL_MATCH_FUNC
460 	 * or G_SIGNAL_MATCH_DATA match flags is required for successful matches.
461 	 * If no handlers were found, 0 is returned, the number of blocked handlers
462 	 * otherwise.
463 	 * Params:
464 	 * mask = Mask indicating which of signal_id, detail, closure, func
465 	 * and/or data the handlers have to match.
466 	 * signalId = Signal the handlers have to be connected to.
467 	 * detail = Signal detail the handlers have to be connected to.
468 	 * closure = The closure the handlers will invoke. [allow-none]
469 	 * func = The C closure callback of the handlers (useless for non-C closures).
470 	 * data = The closure data of the handlers' closures.
471 	 * Returns: The number of handlers that matched.
472 	 */
473 	public static uint handlersBlockMatched(void* instanc, GSignalMatchType mask, uint signalId, GQuark detail, Closure closure, void* func, void* data)
474 	{
475 		// guint g_signal_handlers_block_matched (gpointer instance,  GSignalMatchType mask,  guint signal_id,  GQuark detail,  GClosure *closure,  gpointer func,  gpointer data);
476 		return g_signal_handlers_block_matched(instanc, mask, signalId, detail, (closure is null) ? null : closure.getClosureStruct(), func, data);
477 	}
478 	
479 	/**
480 	 * Unblocks all handlers on an instance that match a certain selection
481 	 * criteria. The criteria mask is passed as an OR-ed combination of
482 	 * GSignalMatchType flags, and the criteria values are passed as arguments.
483 	 * Passing at least one of the G_SIGNAL_MATCH_CLOSURE, G_SIGNAL_MATCH_FUNC
484 	 * or G_SIGNAL_MATCH_DATA match flags is required for successful matches.
485 	 * If no handlers were found, 0 is returned, the number of unblocked handlers
486 	 * otherwise. The match criteria should not apply to any handlers that are
487 	 * not currently blocked.
488 	 * Params:
489 	 * mask = Mask indicating which of signal_id, detail, closure, func
490 	 * and/or data the handlers have to match.
491 	 * signalId = Signal the handlers have to be connected to.
492 	 * detail = Signal detail the handlers have to be connected to.
493 	 * closure = The closure the handlers will invoke. [allow-none]
494 	 * func = The C closure callback of the handlers (useless for non-C closures).
495 	 * data = The closure data of the handlers' closures.
496 	 * Returns: The number of handlers that matched.
497 	 */
498 	public static uint handlersUnblockMatched(void* instanc, GSignalMatchType mask, uint signalId, GQuark detail, Closure closure, void* func, void* data)
499 	{
500 		// guint g_signal_handlers_unblock_matched (gpointer instance,  GSignalMatchType mask,  guint signal_id,  GQuark detail,  GClosure *closure,  gpointer func,  gpointer data);
501 		return g_signal_handlers_unblock_matched(instanc, mask, signalId, detail, (closure is null) ? null : closure.getClosureStruct(), func, data);
502 	}
503 	
504 	/**
505 	 * Disconnects all handlers on an instance that match a certain
506 	 * selection criteria. The criteria mask is passed as an OR-ed
507 	 * combination of GSignalMatchType flags, and the criteria values are
508 	 * passed as arguments. Passing at least one of the
509 	 * G_SIGNAL_MATCH_CLOSURE, G_SIGNAL_MATCH_FUNC or
510 	 * G_SIGNAL_MATCH_DATA match flags is required for successful
511 	 * matches. If no handlers were found, 0 is returned, the number of
512 	 * disconnected handlers otherwise.
513 	 * Params:
514 	 * mask = Mask indicating which of signal_id, detail, closure, func
515 	 * and/or data the handlers have to match.
516 	 * signalId = Signal the handlers have to be connected to.
517 	 * detail = Signal detail the handlers have to be connected to.
518 	 * closure = The closure the handlers will invoke. [allow-none]
519 	 * func = The C closure callback of the handlers (useless for non-C closures).
520 	 * data = The closure data of the handlers' closures.
521 	 * Returns: The number of handlers that matched.
522 	 */
523 	public static uint handlersDisconnectMatched(void* instanc, GSignalMatchType mask, uint signalId, GQuark detail, Closure closure, void* func, void* data)
524 	{
525 		// guint g_signal_handlers_disconnect_matched  (gpointer instance,  GSignalMatchType mask,  guint signal_id,  GQuark detail,  GClosure *closure,  gpointer func,  gpointer data);
526 		return g_signal_handlers_disconnect_matched(instanc, mask, signalId, detail, (closure is null) ? null : closure.getClosureStruct(), func, data);
527 	}
528 	
529 	/**
530 	 * Returns whether handler_id is the id of a handler connected to instance.
531 	 * Params:
532 	 * handlerId = the handler id.
533 	 * Returns: whether handler_id identifies a handler connected to instance.
534 	 */
535 	public static int handlerIsConnected(void* instanc, gulong handlerId)
536 	{
537 		// gboolean g_signal_handler_is_connected (gpointer instance,  gulong handler_id);
538 		return g_signal_handler_is_connected(instanc, handlerId);
539 	}
540 	
541 	/**
542 	 * Returns whether there are any handlers connected to instance for the
543 	 * given signal id and detail.
544 	 * One example of when you might use this is when the arguments to the
545 	 * signal are difficult to compute. A class implementor may opt to not
546 	 * emit the signal if no one is attached anyway, thus saving the cost
547 	 * of building the arguments.
548 	 * Params:
549 	 * signalId = the signal id.
550 	 * detail = the detail.
551 	 * mayBeBlocked = whether blocked handlers should count as match.
552 	 * Returns: TRUE if a handler is connected to the signal, FALSE otherwise.
553 	 */
554 	public static int hasHandlerPending(void* instanc, uint signalId, GQuark detail, int mayBeBlocked)
555 	{
556 		// gboolean g_signal_has_handler_pending (gpointer instance,  guint signal_id,  GQuark detail,  gboolean may_be_blocked);
557 		return g_signal_has_handler_pending(instanc, signalId, detail, mayBeBlocked);
558 	}
559 	
560 	/**
561 	 * Stops a signal's current emission.
562 	 * This will prevent the default method from running, if the signal was
563 	 * G_SIGNAL_RUN_LAST and you connected normally (i.e. without the "after"
564 	 * flag).
565 	 * Prints a warning if used on a signal which isn't being emitted.
566 	 * Params:
567 	 * signalId = the signal identifier, as returned by g_signal_lookup().
568 	 * detail = the detail which the signal was emitted with.
569 	 */
570 	public static void stopEmission(void* instanc, uint signalId, GQuark detail)
571 	{
572 		// void g_signal_stop_emission (gpointer instance,  guint signal_id,  GQuark detail);
573 		g_signal_stop_emission(instanc, signalId, detail);
574 	}
575 	
576 	/**
577 	 * Stops a signal's current emission.
578 	 * This is just like g_signal_stop_emission() except it will look up the
579 	 * signal id for you.
580 	 * Params:
581 	 * detailedSignal = a string of the form "signal-name::detail".
582 	 */
583 	public static void stopEmissionByName(void* instanc, string detailedSignal)
584 	{
585 		// void g_signal_stop_emission_by_name (gpointer instance,  const gchar *detailed_signal);
586 		g_signal_stop_emission_by_name(instanc, Str.toStringz(detailedSignal));
587 	}
588 	
589 	/**
590 	 * Overrides the class closure (i.e. the default handler) for the given signal
591 	 * for emissions on instances of instance_type. instance_type must be derived
592 	 * from the type to which the signal belongs.
593 	 * See g_signal_chain_from_overridden() and
594 	 * g_signal_chain_from_overridden_handler() for how to chain up to the
595 	 * parent class closure from inside the overridden one.
596 	 * Params:
597 	 * signalId = the signal id
598 	 * instanceType = the instance type on which to override the class closure
599 	 * for the signal.
600 	 * classClosure = the closure.
601 	 */
602 	public static void overrideClassClosure(uint signalId, GType instanceType, Closure classClosure)
603 	{
604 		// void g_signal_override_class_closure (guint signal_id,  GType instance_type,  GClosure *class_closure);
605 		g_signal_override_class_closure(signalId, instanceType, (classClosure is null) ? null : classClosure.getClosureStruct());
606 	}
607 	
608 	/**
609 	 * Calls the original class closure of a signal. This function should only
610 	 * be called from an overridden class closure; see
611 	 * g_signal_override_class_closure() and
612 	 * g_signal_override_class_handler().
613 	 * Params:
614 	 * instanceAndParams = (array) the argument list of the signal emission.
615 	 * The first element in the array is a GValue for the instance the signal
616 	 * is being emitted on. The rest are any arguments to be passed to the signal.
617 	 * returnValue = Location for the return value.
618 	 */
619 	public static void chainFromOverridden(Value instanceAndParams, Value returnValue)
620 	{
621 		// void g_signal_chain_from_overridden (const GValue *instance_and_params,  GValue *return_value);
622 		g_signal_chain_from_overridden((instanceAndParams is null) ? null : instanceAndParams.getValueStruct(), (returnValue is null) ? null : returnValue.getValueStruct());
623 	}
624 	
625 	/**
626 	 * Overrides the class closure (i.e. the default handler) for the
627 	 * given signal for emissions on instances of instance_type with
628 	 * callback class_handler. instance_type must be derived from the
629 	 * type to which the signal belongs.
630 	 * See g_signal_chain_from_overridden() and
631 	 * g_signal_chain_from_overridden_handler() for how to chain up to the
632 	 * parent class closure from inside the overridden one.
633 	 * Since 2.18
634 	 * Params:
635 	 * signalName = the name for the signal
636 	 * instanceType = the instance type on which to override the class handler
637 	 * for the signal.
638 	 * classHandler = the handler.
639 	 */
640 	public static void overrideClassHandler(string signalName, GType instanceType, GCallback classHandler)
641 	{
642 		// void g_signal_override_class_handler (const gchar *signal_name,  GType instance_type,  GCallback class_handler);
643 		g_signal_override_class_handler(Str.toStringz(signalName), instanceType, classHandler);
644 	}
645 	
646 	/**
647 	 * Adds an emission hook for a signal, which will get called for any emission
648 	 * of that signal, independent of the instance. This is possible only
649 	 * for signals which don't have G_SIGNAL_NO_HOOKS flag set.
650 	 * Params:
651 	 * signalId = the signal identifier, as returned by g_signal_lookup().
652 	 * detail = the detail on which to call the hook.
653 	 * hookFunc = a GSignalEmissionHook function.
654 	 * hookData = user data for hook_func.
655 	 * dataDestroy = a GDestroyNotify for hook_data.
656 	 * Returns: the hook id, for later use with g_signal_remove_emission_hook().
657 	 */
658 	public static gulong addEmissionHook(uint signalId, GQuark detail, GSignalEmissionHook hookFunc, void* hookData, GDestroyNotify dataDestroy)
659 	{
660 		// gulong g_signal_add_emission_hook (guint signal_id,  GQuark detail,  GSignalEmissionHook hook_func,  gpointer hook_data,  GDestroyNotify data_destroy);
661 		return g_signal_add_emission_hook(signalId, detail, hookFunc, hookData, dataDestroy);
662 	}
663 	
664 	/**
665 	 * Deletes an emission hook.
666 	 * Params:
667 	 * signalId = the id of the signal
668 	 * hookId = the id of the emission hook, as returned by
669 	 * g_signal_add_emission_hook()
670 	 */
671 	public static void removeEmissionHook(uint signalId, gulong hookId)
672 	{
673 		// void g_signal_remove_emission_hook (guint signal_id,  gulong hook_id);
674 		g_signal_remove_emission_hook(signalId, hookId);
675 	}
676 	
677 	/**
678 	 * Internal function to parse a signal name into its signal_id
679 	 * and detail quark.
680 	 * Params:
681 	 * detailedSignal = a string of the form "signal-name::detail".
682 	 * itype = The interface/instance type that introduced "signal-name".
683 	 * signalIdP = Location to store the signal id. [out]
684 	 * detailP = Location to store the detail quark. [out]
685 	 * forceDetailQuark = TRUE forces creation of a GQuark for the detail.
686 	 * Returns: Whether the signal name could successfully be parsed and signal_id_p and detail_p contain valid return values.
687 	 */
688 	public static int parseName(string detailedSignal, GType itype, out uint signalIdP, Quark detailP, int forceDetailQuark)
689 	{
690 		// gboolean g_signal_parse_name (const gchar *detailed_signal,  GType itype,  guint *signal_id_p,  GQuark *detail_p,  gboolean force_detail_quark);
691 		return g_signal_parse_name(Str.toStringz(detailedSignal), itype, &signalIdP, (detailP is null) ? null : detailP.getQuarkStruct(), forceDetailQuark);
692 	}
693 	
694 	/**
695 	 * Returns the invocation hint of the innermost signal emission of instance.
696 	 * Returns: the invocation hint of the innermost signal emission. [transfer none]
697 	 */
698 	public static GSignalInvocationHint* getInvocationHint(void* instanc)
699 	{
700 		// GSignalInvocationHint * g_signal_get_invocation_hint (gpointer instance);
701 		return g_signal_get_invocation_hint(instanc);
702 	}
703 	
704 	/**
705 	 * Creates a new closure which invokes the function found at the offset
706 	 * struct_offset in the class structure of the interface or classed type
707 	 * identified by itype.
708 	 * Params:
709 	 * itype = the GType identifier of an interface or classed type
710 	 * structOffset = the offset of the member function of itype's class
711 	 * structure which is to be invoked by the new closure
712 	 * Returns: a new GCClosure
713 	 */
714 	public static Closure typeCclosureNew(GType itype, uint structOffset)
715 	{
716 		// GClosure * g_signal_type_cclosure_new (GType itype,  guint struct_offset);
717 		auto p = g_signal_type_cclosure_new(itype, structOffset);
718 		
719 		if(p is null)
720 		{
721 			return null;
722 		}
723 		
724 		return ObjectG.getDObject!(Closure)(cast(GClosure*) p);
725 	}
726 	
727 	/**
728 	 * A predefined GSignalAccumulator for signals intended to be used as a
729 	 * hook for application code to provide a particular value. Usually
730 	 * only one such value is desired and multiple handlers for the same
731 	 * signal don't make much sense (except for the case of the default
732 	 * handler defined in the class structure, in which case you will
733 	 * usually want the signal connection to override the class handler).
734 	 * This accumulator will use the return value from the first signal
735 	 * handler that is run as the return value for the signal and not run
736 	 * any further handlers (ie: the first handler "wins").
737 	 * Since 2.28
738 	 * Params:
739 	 * ihint = standard GSignalAccumulator parameter
740 	 * returnAccu = standard GSignalAccumulator parameter
741 	 * handlerReturn = standard GSignalAccumulator parameter
742 	 * dummy = standard GSignalAccumulator parameter
743 	 * Returns: standard GSignalAccumulator result
744 	 */
745 	public static int accumulatorFirstWins(GSignalInvocationHint* ihint, Value returnAccu, Value handlerReturn, void* dummy)
746 	{
747 		// gboolean g_signal_accumulator_first_wins (GSignalInvocationHint *ihint,  GValue *return_accu,  const GValue *handler_return,  gpointer dummy);
748 		return g_signal_accumulator_first_wins(ihint, (returnAccu is null) ? null : returnAccu.getValueStruct(), (handlerReturn is null) ? null : handlerReturn.getValueStruct(), dummy);
749 	}
750 	
751 	/**
752 	 * A predefined GSignalAccumulator for signals that return a
753 	 * boolean values. The behavior that this accumulator gives is
754 	 * that a return of TRUE stops the signal emission: no further
755 	 * callbacks will be invoked, while a return of FALSE allows
756 	 * the emission to continue. The idea here is that a TRUE return
757 	 * indicates that the callback handled the signal,
758 	 * and no further handling is needed.
759 	 * Since 2.4
760 	 * [10] Although signals can deal with any kind of instantiatable
761 	 * type, i'm referring to those types as "object types" in the following,
762 	 * simply because that is the context most users will encounter signals in.
763 	 * Params:
764 	 * ihint = standard GSignalAccumulator parameter
765 	 * returnAccu = standard GSignalAccumulator parameter
766 	 * handlerReturn = standard GSignalAccumulator parameter
767 	 * dummy = standard GSignalAccumulator parameter
768 	 * Returns: standard GSignalAccumulator result
769 	 */
770 	public static int accumulatorTrueHandled(GSignalInvocationHint* ihint, Value returnAccu, Value handlerReturn, void* dummy)
771 	{
772 		// gboolean g_signal_accumulator_true_handled (GSignalInvocationHint *ihint,  GValue *return_accu,  const GValue *handler_return,  gpointer dummy);
773 		return g_signal_accumulator_true_handled(ihint, (returnAccu is null) ? null : returnAccu.getValueStruct(), (handlerReturn is null) ? null : handlerReturn.getValueStruct(), dummy);
774 	}
775 }