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