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