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 module gtk.BindingEntry;
26 
27 private import glib.ListSG;
28 private import glib.Str;
29 private import gtk.BindingSet;
30 private import gtkc.gtk;
31 public  import gtkc.gtktypes;
32 
33 
34 /**
35  * Each key binding element of a binding sets binding list is
36  * represented by a GtkBindingEntry.
37  */
38 public struct BindingEntry
39 {
40 
41 	/**
42 	 * Parses a signal description from @signal_desc and incorporates
43 	 * it into @binding_set.
44 	 *
45 	 * Signal descriptions may either bind a key combination to
46 	 * one or more signals:
47 	 * |[
48 	 * bind "key" {
49 	 * "signalname" (param, ...)
50 	 * ...
51 	 * }
52 	 * ]|
53 	 *
54 	 * Or they may also unbind a key combination:
55 	 * |[
56 	 * unbind "key"
57 	 * ]|
58 	 *
59 	 * Key combinations must be in a format that can be parsed by
60 	 * gtk_accelerator_parse().
61 	 *
62 	 * Params:
63 	 *     bindingSet = a #GtkBindingSet
64 	 *     signalDesc = a signal description
65 	 *
66 	 * Returns: %G_TOKEN_NONE if the signal was successfully parsed and added,
67 	 *     the expected token otherwise
68 	 *
69 	 * Since: 3.0
70 	 */
71 	public static GTokenType addSignalFromString(BindingSet bindingSet, string signalDesc)
72 	{
73 		return gtk_binding_entry_add_signal_from_string((bindingSet is null) ? null : bindingSet.getBindingSetStruct(), Str.toStringz(signalDesc));
74 	}
75 
76 	/**
77 	 * Override or install a new key binding for @keyval with @modifiers on
78 	 * @binding_set.
79 	 *
80 	 * Params:
81 	 *     bindingSet = a #GtkBindingSet to add a signal to
82 	 *     keyval = key value
83 	 *     modifiers = key modifier
84 	 *     signalName = signal name to be bound
85 	 *     bindingArgs = list of #GtkBindingArg signal arguments
86 	 */
87 	public static void addSignall(BindingSet bindingSet, uint keyval, GdkModifierType modifiers, string signalName, ListSG bindingArgs)
88 	{
89 		gtk_binding_entry_add_signall((bindingSet is null) ? null : bindingSet.getBindingSetStruct(), keyval, modifiers, Str.toStringz(signalName), (bindingArgs is null) ? null : bindingArgs.getListSGStruct());
90 	}
91 
92 	/**
93 	 * Remove a binding previously installed via
94 	 * gtk_binding_entry_add_signal() on @binding_set.
95 	 *
96 	 * Params:
97 	 *     bindingSet = a #GtkBindingSet to remove an entry of
98 	 *     keyval = key value of binding to remove
99 	 *     modifiers = key modifier of binding to remove
100 	 */
101 	public static void remove(BindingSet bindingSet, uint keyval, GdkModifierType modifiers)
102 	{
103 		gtk_binding_entry_remove((bindingSet is null) ? null : bindingSet.getBindingSetStruct(), keyval, modifiers);
104 	}
105 
106 	/**
107 	 * Install a binding on @binding_set which causes key lookups
108 	 * to be aborted, to prevent bindings from lower priority sets
109 	 * to be activated.
110 	 *
111 	 * Params:
112 	 *     bindingSet = a #GtkBindingSet to skip an entry of
113 	 *     keyval = key value of binding to skip
114 	 *     modifiers = key modifier of binding to skip
115 	 *
116 	 * Since: 2.12
117 	 */
118 	public static void skip(BindingSet bindingSet, uint keyval, GdkModifierType modifiers)
119 	{
120 		gtk_binding_entry_skip((bindingSet is null) ? null : bindingSet.getBindingSetStruct(), keyval, modifiers);
121 	}
122 }