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  = gtk3-Keyboard-Accelerators.html
27  * outPack = gtk
28  * outFile = AccelGroup
29  * strct   = GtkAccelGroup
30  * realStrct=
31  * ctorStrct=
32  * clss    = AccelGroup
33  * interf  = 
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- gtk_accel_group_
41  * 	- gtk_
42  * omit structs:
43  * omit prefixes:
44  * omit code:
45  * omit signals:
46  * imports:
47  * 	- glib.Str
48  * 	- gobject.Closure
49  * 	- gobject.ObjectG
50  * 	- gdk.Display
51  * 	- glib.ListSG
52  * structWrap:
53  * 	- GClosure* -> Closure
54  * 	- GObject* -> ObjectG
55  * 	- GSList* -> ListSG
56  * 	- GdkDisplay* -> Display
57  * 	- GtkAccelGroup* -> AccelGroup
58  * module aliases:
59  * local aliases:
60  * overrides:
61  */
62 
63 module gtk.AccelGroup;
64 
65 public  import gtkc.gtktypes;
66 
67 private import gtkc.gtk;
68 private import glib.ConstructionException;
69 private import gobject.ObjectG;
70 
71 private import gobject.Signals;
72 public  import gtkc.gdktypes;
73 
74 private import glib.Str;
75 private import gobject.Closure;
76 private import gobject.ObjectG;
77 private import gdk.Display;
78 private import glib.ListSG;
79 
80 
81 
82 private import gobject.ObjectG;
83 
84 /**
85  * A GtkAccelGroup represents a group of keyboard accelerators,
86  * typically attached to a toplevel GtkWindow (with
87  * gtk_window_add_accel_group()). Usually you won't need to create a
88  * GtkAccelGroup directly; instead, when using GtkUIManager, GTK+
89  * automatically sets up the accelerators for your menus in the ui
90  * manager's GtkAccelGroup.
91  *
92  * Note that accelerators are different from
93  * mnemonics. Accelerators are shortcuts for
94  * activating a menu item; they appear alongside the menu item they're a
95  * shortcut for. For example "Ctrl+Q" might appear alongside the "Quit"
96  * menu item. Mnemonics are shortcuts for GUI elements such as text
97  * entries or buttons; they appear as underlined characters. See
98  * gtk_label_new_with_mnemonic(). Menu items can have both accelerators
99  * and mnemonics, of course.
100  */
101 public class AccelGroup : ObjectG
102 {
103 	
104 	/** the main Gtk struct */
105 	protected GtkAccelGroup* gtkAccelGroup;
106 	
107 	
108 	public GtkAccelGroup* getAccelGroupStruct()
109 	{
110 		return gtkAccelGroup;
111 	}
112 	
113 	
114 	/** the main Gtk struct as a void* */
115 	protected override void* getStruct()
116 	{
117 		return cast(void*)gtkAccelGroup;
118 	}
119 	
120 	/**
121 	 * Sets our main struct and passes it to the parent class
122 	 */
123 	public this (GtkAccelGroup* gtkAccelGroup)
124 	{
125 		super(cast(GObject*)gtkAccelGroup);
126 		this.gtkAccelGroup = gtkAccelGroup;
127 	}
128 	
129 	protected override void setStruct(GObject* obj)
130 	{
131 		super.setStruct(obj);
132 		gtkAccelGroup = cast(GtkAccelGroup*)obj;
133 	}
134 	
135 	/**
136 	 */
137 	int[string] connectedSignals;
138 	
139 	bool delegate(ObjectG, guint, GdkModifierType, AccelGroup)[] onAccelActivateListeners;
140 	/**
141 	 * The accel-activate signal is an implementation detail of
142 	 * GtkAccelGroup and not meant to be used by applications.
143 	 * TRUE if the accelerator was activated
144 	 */
145 	void addOnAccelActivate(bool delegate(ObjectG, guint, GdkModifierType, AccelGroup) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
146 	{
147 		if ( !("accel-activate" in connectedSignals) )
148 		{
149 			Signals.connectData(
150 			getStruct(),
151 			"accel-activate",
152 			cast(GCallback)&callBackAccelActivate,
153 			cast(void*)this,
154 			null,
155 			connectFlags);
156 			connectedSignals["accel-activate"] = 1;
157 		}
158 		onAccelActivateListeners ~= dlg;
159 	}
160 	extern(C) static gboolean callBackAccelActivate(GtkAccelGroup* accelGroupStruct, GObject* acceleratable, guint keyval, GdkModifierType modifier, AccelGroup _accelGroup)
161 	{
162 		foreach ( bool delegate(ObjectG, guint, GdkModifierType, AccelGroup) dlg ; _accelGroup.onAccelActivateListeners )
163 		{
164 			if ( dlg(ObjectG.getDObject!(ObjectG)(acceleratable), keyval, modifier, _accelGroup) )
165 			{
166 				return 1;
167 			}
168 		}
169 		
170 		return 0;
171 	}
172 	
173 	void delegate(guint, GdkModifierType, Closure, AccelGroup)[] onAccelChangedListeners;
174 	/**
175 	 * The accel-changed signal is emitted when an entry
176 	 * is added to or removed from the accel group.
177 	 * Widgets like GtkAccelLabel which display an associated
178 	 * accelerator should connect to this signal, and rebuild
179 	 * their visual representation if the accel_closure is theirs.
180 	 * See Also
181 	 * gtk_window_add_accel_group(), gtk_accel_map_change_entry(),
182 	 * gtk_item_factory_new(), gtk_label_new_with_mnemonic()
183 	 */
184 	void addOnAccelChanged(void delegate(guint, GdkModifierType, Closure, AccelGroup) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
185 	{
186 		if ( !("accel-changed" in connectedSignals) )
187 		{
188 			Signals.connectData(
189 			getStruct(),
190 			"accel-changed",
191 			cast(GCallback)&callBackAccelChanged,
192 			cast(void*)this,
193 			null,
194 			connectFlags);
195 			connectedSignals["accel-changed"] = 1;
196 		}
197 		onAccelChangedListeners ~= dlg;
198 	}
199 	extern(C) static void callBackAccelChanged(GtkAccelGroup* accelGroupStruct, guint keyval, GdkModifierType modifier, GClosure* accelClosure, AccelGroup _accelGroup)
200 	{
201 		foreach ( void delegate(guint, GdkModifierType, Closure, AccelGroup) dlg ; _accelGroup.onAccelChangedListeners )
202 		{
203 			dlg(keyval, modifier, ObjectG.getDObject!(Closure)(accelClosure), _accelGroup);
204 		}
205 	}
206 	
207 	
208 	/**
209 	 * Creates a new GtkAccelGroup.
210 	 * Throws: ConstructionException GTK+ fails to create the object.
211 	 */
212 	public this ()
213 	{
214 		// GtkAccelGroup * gtk_accel_group_new (void);
215 		auto p = gtk_accel_group_new();
216 		if(p is null)
217 		{
218 			throw new ConstructionException("null returned by gtk_accel_group_new()");
219 		}
220 		this(cast(GtkAccelGroup*) p);
221 	}
222 	
223 	/**
224 	 * Installs an accelerator in this group. When accel_group is being
225 	 * activated in response to a call to gtk_accel_groups_activate(),
226 	 * closure will be invoked if the accel_key and accel_mods from
227 	 * gtk_accel_groups_activate() match those of this connection.
228 	 * The signature used for the closure is that of GtkAccelGroupActivate.
229 	 * Note that, due to implementation details, a single closure can
230 	 * only be connected to one accelerator group.
231 	 * Params:
232 	 * accelKey = key value of the accelerator
233 	 * accelMods = modifier combination of the accelerator
234 	 * accelFlags = a flag mask to configure this accelerator
235 	 * closure = closure to be executed upon accelerator activation
236 	 */
237 	public void connect(uint accelKey, GdkModifierType accelMods, GtkAccelFlags accelFlags, Closure closure)
238 	{
239 		// void gtk_accel_group_connect (GtkAccelGroup *accel_group,  guint accel_key,  GdkModifierType accel_mods,  GtkAccelFlags accel_flags,  GClosure *closure);
240 		gtk_accel_group_connect(gtkAccelGroup, accelKey, accelMods, accelFlags, (closure is null) ? null : closure.getClosureStruct());
241 	}
242 	
243 	/**
244 	 * Installs an accelerator in this group, using an accelerator path
245 	 * to look up the appropriate key and modifiers (see
246 	 * gtk_accel_map_add_entry()). When accel_group is being activated
247 	 * in response to a call to gtk_accel_groups_activate(), closure will
248 	 * be invoked if the accel_key and accel_mods from
249 	 * gtk_accel_groups_activate() match the key and modifiers for the path.
250 	 * The signature used for the closure is that of GtkAccelGroupActivate.
251 	 * Note that accel_path string will be stored in a GQuark. Therefore,
252 	 * if you pass a static string, you can save some memory by interning it
253 	 * first with g_intern_static_string().
254 	 * Params:
255 	 * accelPath = path used for determining key and modifiers
256 	 * closure = closure to be executed upon accelerator activation
257 	 */
258 	public void connectByPath(string accelPath, Closure closure)
259 	{
260 		// void gtk_accel_group_connect_by_path (GtkAccelGroup *accel_group,  const gchar *accel_path,  GClosure *closure);
261 		gtk_accel_group_connect_by_path(gtkAccelGroup, Str.toStringz(accelPath), (closure is null) ? null : closure.getClosureStruct());
262 	}
263 	
264 	/**
265 	 * Removes an accelerator previously installed through
266 	 * gtk_accel_group_connect().
267 	 * Since 2.20 closure can be NULL.
268 	 * Params:
269 	 * closure = the closure to remove from this accelerator
270 	 * group, or NULL to remove all closures. [allow-none]
271 	 * Returns: TRUE if the closure was found and got disconnected
272 	 */
273 	public int disconnect(Closure closure)
274 	{
275 		// gboolean gtk_accel_group_disconnect (GtkAccelGroup *accel_group,  GClosure *closure);
276 		return gtk_accel_group_disconnect(gtkAccelGroup, (closure is null) ? null : closure.getClosureStruct());
277 	}
278 	
279 	/**
280 	 * Removes an accelerator previously installed through
281 	 * gtk_accel_group_connect().
282 	 * Params:
283 	 * accelKey = key value of the accelerator
284 	 * accelMods = modifier combination of the accelerator
285 	 * Returns: TRUE if there was an accelerator which could be removed, FALSE otherwise
286 	 */
287 	public int disconnectKey(uint accelKey, GdkModifierType accelMods)
288 	{
289 		// gboolean gtk_accel_group_disconnect_key (GtkAccelGroup *accel_group,  guint accel_key,  GdkModifierType accel_mods);
290 		return gtk_accel_group_disconnect_key(gtkAccelGroup, accelKey, accelMods);
291 	}
292 	
293 	/**
294 	 * Finds the first accelerator in accel_group that matches
295 	 * accel_key and accel_mods, and activates it.
296 	 * Params:
297 	 * accelQuark = the quark for the accelerator name
298 	 * acceleratable = the GObject, usually a GtkWindow, on which
299 	 * to activate the accelerator
300 	 * accelKey = accelerator keyval from a key event
301 	 * accelMods = keyboard state mask from a key event
302 	 * Returns: TRUE if an accelerator was activated and handled this keypress
303 	 */
304 	public int activate(GQuark accelQuark, ObjectG acceleratable, uint accelKey, GdkModifierType accelMods)
305 	{
306 		// gboolean gtk_accel_group_activate (GtkAccelGroup *accel_group,  GQuark accel_quark,  GObject *acceleratable,  guint accel_key,  GdkModifierType accel_mods);
307 		return gtk_accel_group_activate(gtkAccelGroup, accelQuark, (acceleratable is null) ? null : acceleratable.getObjectGStruct(), accelKey, accelMods);
308 	}
309 	
310 	/**
311 	 * Locks the given accelerator group.
312 	 * Locking an acelerator group prevents the accelerators contained
313 	 * within it to be changed during runtime. Refer to
314 	 * gtk_accel_map_change_entry() about runtime accelerator changes.
315 	 * If called more than once, accel_group remains locked until
316 	 * gtk_accel_group_unlock() has been called an equivalent number
317 	 * of times.
318 	 */
319 	public void lock()
320 	{
321 		// void gtk_accel_group_lock (GtkAccelGroup *accel_group);
322 		gtk_accel_group_lock(gtkAccelGroup);
323 	}
324 	
325 	/**
326 	 * Undoes the last call to gtk_accel_group_lock() on this accel_group.
327 	 */
328 	public void unlock()
329 	{
330 		// void gtk_accel_group_unlock (GtkAccelGroup *accel_group);
331 		gtk_accel_group_unlock(gtkAccelGroup);
332 	}
333 	
334 	/**
335 	 * Locks are added and removed using gtk_accel_group_lock() and
336 	 * gtk_accel_group_unlock().
337 	 * Since 2.14
338 	 * Returns: TRUE if there are 1 or more locks on the accel_group, FALSE otherwise.
339 	 */
340 	public int getIsLocked()
341 	{
342 		// gboolean gtk_accel_group_get_is_locked (GtkAccelGroup *accel_group);
343 		return gtk_accel_group_get_is_locked(gtkAccelGroup);
344 	}
345 	
346 	/**
347 	 * Finds the GtkAccelGroup to which closure is connected;
348 	 * see gtk_accel_group_connect().
349 	 * Params:
350 	 * closure = a GClosure
351 	 * Returns: the GtkAccelGroup to which closure is connected, or NULL. [transfer none]
352 	 */
353 	public static AccelGroup fromAccelClosure(Closure closure)
354 	{
355 		// GtkAccelGroup * gtk_accel_group_from_accel_closure (GClosure *closure);
356 		auto p = gtk_accel_group_from_accel_closure((closure is null) ? null : closure.getClosureStruct());
357 		
358 		if(p is null)
359 		{
360 			return null;
361 		}
362 		
363 		return ObjectG.getDObject!(AccelGroup)(cast(GtkAccelGroup*) p);
364 	}
365 	
366 	/**
367 	 * Gets a GdkModifierType representing the mask for this
368 	 * accel_group. For example, GDK_CONTROL_MASK, GDK_SHIFT_MASK, etc.
369 	 * Since 2.14
370 	 * Returns: the modifier mask for this accel group.
371 	 */
372 	public GdkModifierType getModifierMask()
373 	{
374 		// GdkModifierType gtk_accel_group_get_modifier_mask (GtkAccelGroup *accel_group);
375 		return gtk_accel_group_get_modifier_mask(gtkAccelGroup);
376 	}
377 	
378 	/**
379 	 * Finds the first accelerator in any GtkAccelGroup attached
380 	 * to object that matches accel_key and accel_mods, and
381 	 * activates that accelerator.
382 	 * Params:
383 	 * object = the GObject, usually a GtkWindow, on which
384 	 * to activate the accelerator
385 	 * accelKey = accelerator keyval from a key event
386 	 * accelMods = keyboard state mask from a key event
387 	 * Returns: TRUE if an accelerator was activated and handled this keypress
388 	 */
389 	public static int accelGroupsActivate(ObjectG object, uint accelKey, GdkModifierType accelMods)
390 	{
391 		// gboolean gtk_accel_groups_activate (GObject *object,  guint accel_key,  GdkModifierType accel_mods);
392 		return gtk_accel_groups_activate((object is null) ? null : object.getObjectGStruct(), accelKey, accelMods);
393 	}
394 	
395 	/**
396 	 * Gets a list of all accel groups which are attached to object.
397 	 * Params:
398 	 * object = a GObject, usually a GtkWindow
399 	 * Returns: a list of all accel groups which are attached to object. [element-type GtkAccelGroup][transfer none]
400 	 */
401 	public static ListSG accelGroupsFromObject(ObjectG object)
402 	{
403 		// GSList * gtk_accel_groups_from_object (GObject *object);
404 		auto p = gtk_accel_groups_from_object((object is null) ? null : object.getObjectGStruct());
405 		
406 		if(p is null)
407 		{
408 			return null;
409 		}
410 		
411 		return ObjectG.getDObject!(ListSG)(cast(GSList*) p);
412 	}
413 	
414 	/**
415 	 * Finds the first entry in an accelerator group for which
416 	 * find_func returns TRUE and returns its GtkAccelKey.
417 	 * Params:
418 	 * findFunc = a function to filter the entries
419 	 * of accel_group with. [scope call]
420 	 * data = data to pass to find_func
421 	 * Returns: the key of the first entry passing find_func. The key is owned by GTK+ and must not be freed. [transfer none]
422 	 */
423 	public GtkAccelKey* find(GtkAccelGroupFindFunc findFunc, void* data)
424 	{
425 		// GtkAccelKey * gtk_accel_group_find (GtkAccelGroup *accel_group,  GtkAccelGroupFindFunc find_func,  gpointer data);
426 		return gtk_accel_group_find(gtkAccelGroup, findFunc, data);
427 	}
428 	
429 	/**
430 	 * Determines whether a given keyval and modifier mask constitute
431 	 * a valid keyboard accelerator. For example, the GDK_KEY_a keyval
432 	 * plus GDK_CONTROL_MASK is valid - this is a "Ctrl+a" accelerator.
433 	 * But, you can't, for instance, use the GDK_KEY_Control_L keyval
434 	 * as an accelerator.
435 	 * Params:
436 	 * keyval = a GDK keyval
437 	 * modifiers = modifier mask
438 	 * Returns: TRUE if the accelerator is valid
439 	 */
440 	public static int acceleratorValid(uint keyval, GdkModifierType modifiers)
441 	{
442 		// gboolean gtk_accelerator_valid (guint keyval,  GdkModifierType modifiers);
443 		return gtk_accelerator_valid(keyval, modifiers);
444 	}
445 	
446 	/**
447 	 * Parses a string representing an accelerator. The
448 	 * format looks like "<Control>a" or "<Shift><Alt>F1"
449 	 * or "<Release>z" (the last one is for key release).
450 	 * The parser is fairly liberal and allows lower or upper case,
451 	 * and also abbreviations such as "<Ctl>" and "<Ctrl>".
452 	 * Key names are parsed using gdk_keyval_from_name(). For character
453 	 * keys the name is not the symbol, but the lowercase name, e.g. one
454 	 * would use "<Ctrl>minus" instead of "<Ctrl>-".
455 	 * If the parse fails, accelerator_key and accelerator_mods will
456 	 * be set to 0 (zero).
457 	 * Params:
458 	 * accelerator = string representing an accelerator
459 	 * acceleratorKey = return location for accelerator
460 	 * keyval, or NULL. [out][allow-none]
461 	 * acceleratorMods = return location for accelerator
462 	 * modifier mask, NULL. [out][allow-none]
463 	 */
464 	public static void acceleratorParse(string accelerator, out uint acceleratorKey, out GdkModifierType acceleratorMods)
465 	{
466 		// void gtk_accelerator_parse (const gchar *accelerator,  guint *accelerator_key,  GdkModifierType *accelerator_mods);
467 		gtk_accelerator_parse(Str.toStringz(accelerator), &acceleratorKey, &acceleratorMods);
468 	}
469 	
470 	/**
471 	 * Converts an accelerator keyval and modifier mask
472 	 * into a string parseable by gtk_accelerator_parse().
473 	 * For example, if you pass in GDK_KEY_q and GDK_CONTROL_MASK,
474 	 * this function returns "<Control>q".
475 	 * If you need to display accelerators in the user interface,
476 	 * see gtk_accelerator_get_label().
477 	 * Params:
478 	 * acceleratorKey = accelerator keyval
479 	 * acceleratorMods = accelerator modifier mask
480 	 * Returns: a newly-allocated accelerator name
481 	 */
482 	public static string acceleratorName(uint acceleratorKey, GdkModifierType acceleratorMods)
483 	{
484 		// gchar * gtk_accelerator_name (guint accelerator_key,  GdkModifierType accelerator_mods);
485 		return Str.toString(gtk_accelerator_name(acceleratorKey, acceleratorMods));
486 	}
487 	
488 	/**
489 	 * Converts an accelerator keyval and modifier mask into a string
490 	 * which can be used to represent the accelerator to the user.
491 	 * Since 2.6
492 	 * Params:
493 	 * acceleratorKey = accelerator keyval
494 	 * acceleratorMods = accelerator modifier mask
495 	 * Returns: a newly-allocated string representing the accelerator.
496 	 */
497 	public static string acceleratorGetLabel(uint acceleratorKey, GdkModifierType acceleratorMods)
498 	{
499 		// gchar * gtk_accelerator_get_label (guint accelerator_key,  GdkModifierType accelerator_mods);
500 		return Str.toString(gtk_accelerator_get_label(acceleratorKey, acceleratorMods));
501 	}
502 	
503 	/**
504 	 * Parses a string representing an accelerator, similarly to
505 	 * gtk_accelerator_parse() but handles keycodes as well. This is only
506 	 * useful for system-level components, applications should use
507 	 * gtk_accelerator_parse() instead.
508 	 * If accelerator_codes is given and the result stored in it is non-NULL,
509 	 * the result must be freed with g_free().
510 	 * If a keycode is present in the accelerator and no accelerator_codes
511 	 * is given, the parse will fail.
512 	 * If the parse fails, accelerator_key, accelerator_mods and
513 	 * accelerator_codes will be set to 0 (zero).
514 	 * Params:
515 	 * accelerator = string representing an accelerator
516 	 * acceleratorKey = return location for accelerator
517 	 * keyval, or NULL. [out][allow-none]
518 	 * acceleratorCodes = return location for accelerator keycodes, or NULL. [out][array zero-terminated=1][transfer full][allow-none]
519 	 * acceleratorMods = return location for accelerator
520 	 * modifier mask, NULL. [out][allow-none]
521 	 * Since 3.4
522 	 */
523 	public static void acceleratorParseWithKeycode(string accelerator, out uint acceleratorKey, out uint* acceleratorCodes, out GdkModifierType acceleratorMods)
524 	{
525 		// void gtk_accelerator_parse_with_keycode (const gchar *accelerator,  guint *accelerator_key,  guint **accelerator_codes,  GdkModifierType *accelerator_mods);
526 		gtk_accelerator_parse_with_keycode(Str.toStringz(accelerator), &acceleratorKey, &acceleratorCodes, &acceleratorMods);
527 	}
528 	
529 	/**
530 	 * Converts an accelerator keyval and modifier mask
531 	 * into a string parseable by gtk_accelerator_parse_full(),
532 	 * similarly to gtk_accelerator_name() but handling keycodes.
533 	 * This is only useful for system-level components, applications
534 	 * should use gtk_accelerator_parse() instead.
535 	 * Params:
536 	 * display = a GdkDisplay or NULL to use the default display. [allow-none]
537 	 * acceleratorKey = accelerator keyval
538 	 * keycode = accelerator keycode
539 	 * acceleratorMods = accelerator modifier mask
540 	 * Returns: a newly allocated accelerator name. Since 3.4
541 	 */
542 	public static string acceleratorNameWithKeycode(Display display, uint acceleratorKey, uint keycode, GdkModifierType acceleratorMods)
543 	{
544 		// gchar * gtk_accelerator_name_with_keycode (GdkDisplay *display,  guint accelerator_key,  guint keycode,  GdkModifierType accelerator_mods);
545 		return Str.toString(gtk_accelerator_name_with_keycode((display is null) ? null : display.getDisplayStruct(), acceleratorKey, keycode, acceleratorMods));
546 	}
547 	
548 	/**
549 	 * Converts an accelerator keyval and modifier mask
550 	 * into a (possibly translated) string that can be displayed to
551 	 * a user, similarly to gtk_accelerator_get_label(), but handling
552 	 * keycodes.
553 	 * This is only useful for system-level components, applications
554 	 * should use gtk_accelerator_parse() instead.
555 	 * Params:
556 	 * display = a GdkDisplay or NULL to use the default display. [allow-none]
557 	 * acceleratorKey = accelerator keyval
558 	 * keycode = accelerator keycode
559 	 * acceleratorMods = accelerator modifier mask
560 	 * Returns: a newly-allocated string representing the accelerator. Since 3.4
561 	 */
562 	public static string acceleratorGetLabelWithKeycode(Display display, uint acceleratorKey, uint keycode, GdkModifierType acceleratorMods)
563 	{
564 		// gchar * gtk_accelerator_get_label_with_keycode  (GdkDisplay *display,  guint accelerator_key,  guint keycode,  GdkModifierType accelerator_mods);
565 		return Str.toString(gtk_accelerator_get_label_with_keycode((display is null) ? null : display.getDisplayStruct(), acceleratorKey, keycode, acceleratorMods));
566 	}
567 	
568 	/**
569 	 * Sets the modifiers that will be considered significant for keyboard
570 	 * accelerators. The default mod mask is GDK_CONTROL_MASK |
571 	 * GDK_SHIFT_MASK | GDK_MOD1_MASK | GDK_SUPER_MASK |
572 	 * GDK_HYPER_MASK | GDK_META_MASK, that is, Control, Shift, Alt,
573 	 * Super, Hyper and Meta. Other modifiers will by default be ignored
574 	 * by GtkAccelGroup.
575 	 * You must include at least the three modifiers Control, Shift
576 	 * and Alt in any value you pass to this function.
577 	 * The default mod mask should be changed on application startup,
578 	 * before using any accelerator groups.
579 	 * Params:
580 	 * defaultModMask = accelerator modifier mask
581 	 */
582 	public static void acceleratorSetDefaultModMask(GdkModifierType defaultModMask)
583 	{
584 		// void gtk_accelerator_set_default_mod_mask  (GdkModifierType default_mod_mask);
585 		gtk_accelerator_set_default_mod_mask(defaultModMask);
586 	}
587 	
588 	/**
589 	 * Gets the value set by gtk_accelerator_set_default_mod_mask().
590 	 * Returns: the default accelerator modifier mask
591 	 */
592 	public static GdkModifierType acceleratorGetDefaultModMask()
593 	{
594 		// GdkModifierType gtk_accelerator_get_default_mod_mask  (void);
595 		return gtk_accelerator_get_default_mod_mask();
596 	}
597 }