/usr/share/ada/adainclude/gtkada/gtk-bindings.ads is in libgtkada2.24.1-dev 2.24.1-14.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 | -----------------------------------------------------------------------
-- GtkAda - Ada95 binding for Gtk+/Gnome --
-- --
-- Copyright (C) 2006-2009, AdaCore --
-- --
-- This library is free software; you can redistribute it and/or --
-- modify it under the terms of the GNU General Public --
-- License as published by the Free Software Foundation; either --
-- version 2 of the License, or (at your option) any later version. --
-- --
-- This library is distributed in the hope that it will be useful, --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --
-- General Public License for more details. --
-- --
-- You should have received a copy of the GNU General Public --
-- License along with this library; if not, write to the --
-- Free Software Foundation, Inc., 59 Temple Place - Suite 330, --
-- Boston, MA 02111-1307, USA. --
-- --
-----------------------------------------------------------------------
-- <description>
-- Gtk_Bindings provides a mechanism for configuring Gtk+ key bindings through
-- RC files. This eases key binding adjustments for application developers as
-- well as users and provides Gtk+ users or administrators with high key
-- binding configurability which requires no application or toolkit side
-- changes.
--
-- Installing a key binding
-- ========================
--
-- A resource file binding consists of a 'binding' definition and a match
-- statement to apply the binding to specific widget types. Details on the
-- matching mechanism are described under Pathnames and patterns. Inside the
-- binding definition, key combinations are bound to specific signal emissions
-- on the target widget. Key combinations are strings consisting of an
-- optional Gdk_Modifier_Type name and key names such as those defined in
-- Gdk.Types.Keysyms or returned from gdk_keyval_name(), they have to be
-- parsable by gtk_accelerator_parse(). Specifications of signal emissions
-- consist of a string identifying the signal name, and a list of signal
-- specific arguments in parenthesis. For example for binding Control and the
-- left or right cursor keys of a Gtk_Entry widget to the
-- Gtk_Entry::move-cursor signal, so movement occurs in 3 letter steps, the
-- following binding can be used:
--
-- binding "MoveCursor3" {
-- bind "<Control>Right" {
-- "move-cursor" (visual-positions, 3, 0)
-- }
-- bind "<Control>Left" {
-- "move-cursor" (visual-positions, -3, 0)
-- }
-- }
-- class "GtkEntry" binding "MoveCursor3"
--
-- Unbinding existing key bindings
-- ===============================
--
-- Gtk+ already defines a number of useful bindings for the widgets it
-- provides. Because custom bindings set up in RC files take precedence over
-- the default bindings shipped with Gtk+, overriding existing bindings as
-- demonstrated in Installing a key binding works as expected. The same
-- mechanism can not be used to "unbind" existing bindings, however.
--
-- binding "MoveCursor3" {
-- bind "<Control>Right" { }
-- bind "<Control>Left" { }
-- }
-- class "GtkEntry" binding "MoveCursor3"
--
-- The above example will not have the desired effect of causing
-- "<Control>Right" and "<Control>Left" key presses to be ignored by Gtk+.
-- Instead, it just causes any existing bindings from the bindings set
-- "MoveCursor3" to be deleted, so when "<Control>Right" or "<Control>Left"
-- are pressed, no binding for these keys is found in binding set
-- "MoveCursor3". Gtk+ will thus continue to search for matching key bindings,
-- and will eventually lookup and find the default Gtk+ bindings for entries
-- which implement word movement. To keep Gtk+ from activating its default
-- bindings, the "unbind" keyword can be used like this:
--
-- binding "MoveCursor3" {
-- unbind "<Control>Right"
-- unbind "<Control>Left"
-- }
-- class "GtkEntry" binding "MoveCursor3"
--
-- Now, Gtk+ will find a match when looking up "<Control>Right" and
-- "<Control>Left" key presses before it resorts to its default bindings, and
-- the match instructs it to abort ("unbind") the search, so the key presses
-- are not consumed by this widget. As usual, further processing of the key
-- presses, e.g. by an entries parent widget, is now possible.
-- </description>
-- <c_version>2.14</c_version>
-- <group>Configuration and Themes</group>
with Gdk.Event;
with Gdk.Types;
with Glib.Object;
with Gtk.Object;
package Gtk.Bindings is
type Gtk_Binding_Set is new Glib.C_Proxy;
-- A binding set maintains a list of activatable key bindings. A single
-- binding set can match multiple types of widgets. Similar to styles,
-- widgets can be mapped by widget name paths, widget class paths or widget
-- class types. When a binding within a set is matched upon activation, an
-- action signal is emitted on the target widget to carry out the actual
-- activation.
function Binding_Set_New (Set_Name : String) return Gtk_Binding_Set;
-- Gtk+ maintains a global list of binding sets. Each binding set has a
-- unique name which needs to be specified upon creation.
function Binding_Set_By_Class
(Object_Class : Glib.Object.GObject_Class) return Gtk_Binding_Set;
-- This function returns the binding set named after the type name of the
-- passed in class structure. New binding sets are created on demand by
-- this function.
function Binding_Set_Find (Set_Name : String) return Gtk_Binding_Set;
-- Find a binding set by its globally unique name. The set_name can either
-- be a name used for Binding_Set_New or the type name of a class
-- used in Binding_Set_By_Class.
function Activate
(Object : access Gtk.Object.Gtk_Object_Record'Class;
Keyval : Guint;
Modifiers : Gdk.Types.Gdk_Modifier_Type)
return Boolean;
-- Find a key binding matching keyval and modifiers and activate the
-- binding on object.
function Activate_Event
(Object : access Gtk.Object.Gtk_Object_Record;
Event : Gdk.Event.Gdk_Event_Key)
return Boolean;
-- Looks up key bindings for Object to find one matching
-- Event, and if one was found, activate it.
-- Return value: True if a matching key binding was found
function Binding_Set_Activate
(Binding_Set : Gtk_Binding_Set;
Keyval : Guint;
Modifiers : Gdk.Types.Gdk_Modifier_Type;
Object : access Gtk.Object.Gtk_Object_Record'Class)
return Boolean;
-- Find a key binding matching keyval and modifiers within binding_set and
-- activate the binding on object.
procedure Binding_Entry_Skip
(Binding_Set : Gtk_Binding_Set;
Keyval : Guint;
Modifiers : Gdk.Types.Gdk_Modifier_Type);
-- Install a binding on Binding_Set which causes key lookups
-- to be aborted, to prevent bindings from lower priority sets
-- to be activated.
-- Since: 2.12
procedure Add_Signal
(Binding_Set : Gtk_Binding_Set;
Keyval : Guint;
Modifiers : Gdk.Types.Gdk_Modifier_Type;
Signal_Name : String);
procedure Add_Signal
(Binding_Set : Gtk_Binding_Set;
Keyval : Guint;
Modifiers : Gdk.Types.Gdk_Modifier_Type;
Signal_Name : String;
Arg1 : Gint);
procedure Add_Signal
(Binding_Set : Gtk_Binding_Set;
Keyval : Guint;
Modifiers : Gdk.Types.Gdk_Modifier_Type;
Signal_Name : String;
Arg1 : Boolean);
procedure Add_Signal
(Binding_Set : Gtk_Binding_Set;
Keyval : Guint;
Modifiers : Gdk.Types.Gdk_Modifier_Type;
Signal_Name : String;
Arg1 : Gint;
Arg2 : Gint);
-- Override or install a new key binding for keyval with modifiers on
-- binding_set. When the binding is activated, signal_name will be emitted
-- on the target widget, with the given arguments as argument.
private
pragma Import (C, Binding_Set_By_Class, "gtk_binding_set_by_class");
pragma Import (C, Binding_Entry_Skip, "gtk_binding_entry_skip");
end Gtk.Bindings;
-- These are bound through our own C wrappers:
-- No binding: gtk_binding_entry_add_signal
-- These are internal gtk+ functions
-- No binding: gtk_binding_entry_add_signall
-- No binding: gtk_binding_entry_clear
-- No binding: gtk_binding_entry_remove
-- No binding: gtk_binding_parse_binding
-- No binding: gtk_binding_set_add_path
|