1. ------------------------------------------------------------------------------ 
  2. --                                                                          -- 
  3. --      Copyright (C) 1998-2000 E. Briot, J. Brobecker and A. Charlet       -- 
  4. --                     Copyright (C) 2000-2014, AdaCore                     -- 
  5. --                                                                          -- 
  6. -- This library is free software;  you can redistribute it and/or modify it -- 
  7. -- under terms of the  GNU General Public License  as published by the Free -- 
  8. -- Software  Foundation;  either version 3,  or (at your  option) any later -- 
  9. -- version. This library is distributed in the hope that it will be useful, -- 
  10. -- but WITHOUT ANY WARRANTY;  without even the implied warranty of MERCHAN- -- 
  11. -- TABILITY or FITNESS FOR A PARTICULAR PURPOSE.                            -- 
  12. --                                                                          -- 
  13. -- As a special exception under Section 7 of GPL version 3, you are granted -- 
  14. -- additional permissions described in the GCC Runtime Library Exception,   -- 
  15. -- version 3.1, as published by the Free Software Foundation.               -- 
  16. --                                                                          -- 
  17. -- You should have received a copy of the GNU General Public License and    -- 
  18. -- a copy of the GCC Runtime Library Exception along with this program;     -- 
  19. -- see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see    -- 
  20. -- <http://www.gnu.org/licenses/>.                                          -- 
  21. --                                                                          -- 
  22. ------------------------------------------------------------------------------ 
  23.  
  24. --  <description> 
  25. --  A binding set maintains a list of activatable key bindings. A single 
  26. --  binding set can match multiple types of widgets. Similar to style contexts, 
  27. --  can be matched by any information contained in a widgets 
  28. --  Gtk.Widget.Gtk_Widget_Path. When a binding within a set is matched upon 
  29. --  activation, an action signal is emitted on the target widget to carry out 
  30. --  the actual activation. 
  31. -- 
  32. --  </description> 
  33. pragma Ada_2005; 
  34.  
  35. pragma Warnings (Off, "*is already use-visible*"); 
  36. with Gdk.Types;            use Gdk.Types; 
  37. with Glib.Object;          use Glib.Object; 
  38. with Gtk.Enums;            use Gtk.Enums; 
  39. with Interfaces.C.Strings; use Interfaces.C.Strings; 
  40.  
  41. package Gtk.Binding_Set is 
  42.  
  43.    type Gtk_Binding_Set is record 
  44.       Set_Name : Interfaces.C.Strings.chars_ptr; 
  45.       Priority : Gint; 
  46.       Widget_Path_Pspecs : System.Address; 
  47.       Widget_Class_Pspecs : System.Address; 
  48.       Class_Branch_Pspecs : System.Address; 
  49.       Entries : System.Address; 
  50.       Current : System.Address; 
  51.       Parsed : Guint; 
  52.    end record; 
  53.    pragma Convention (C, Gtk_Binding_Set); 
  54.  
  55.    function From_Object_Free (B : access Gtk_Binding_Set) return Gtk_Binding_Set; 
  56.    pragma Inline (From_Object_Free); 
  57.    --  A binding set maintains a list of activatable key bindings. A single 
  58.    --  binding set can match multiple types of widgets. Similar to style 
  59.    --  contexts, can be matched by any information contained in a widgets 
  60.    --  Gtk.Widget.Gtk_Widget_Path. When a binding within a set is matched upon 
  61.    --  activation, an action signal is emitted on the target widget to carry 
  62.    --  out the actual activation. 
  63.  
  64.    ------------------ 
  65.    -- Constructors -- 
  66.    ------------------ 
  67.  
  68.    procedure Gtk_New (Self : out Gtk_Binding_Set; Set_Name : UTF8_String); 
  69.    --  GTK+ maintains a global list of binding sets. Each binding set has a 
  70.    --  unique name which needs to be specified upon creation. 
  71.    --  "set_name": unique name of this binding set 
  72.  
  73.    function Gtk_Binding_Set_New 
  74.       (Set_Name : UTF8_String) return Gtk_Binding_Set; 
  75.    --  GTK+ maintains a global list of binding sets. Each binding set has a 
  76.    --  unique name which needs to be specified upon creation. 
  77.    --  "set_name": unique name of this binding set 
  78.  
  79.    ------------- 
  80.    -- Methods -- 
  81.    ------------- 
  82.  
  83.    function Activate 
  84.       (Self      : Gtk_Binding_Set; 
  85.        Keyval    : Guint; 
  86.        Modifiers : Gdk.Types.Gdk_Modifier_Type; 
  87.        Object    : not null access Glib.Object.GObject_Record'Class) 
  88.        return Boolean; 
  89.    --  Find a key binding matching Keyval and Modifiers within Binding_Set and 
  90.    --  activate the binding on Object. 
  91.    --  "keyval": key value of the binding 
  92.    --  "modifiers": key modifier of the binding 
  93.    --  "object": object to activate when binding found 
  94.  
  95.    procedure Add_Path 
  96.       (Self         : Gtk_Binding_Set; 
  97.        Path_Type    : Gtk.Enums.Gtk_Path_Type; 
  98.        Path_Pattern : UTF8_String; 
  99.        Priority     : Gtk.Enums.Gtk_Path_Priority_Type); 
  100.    pragma Obsolescent (Add_Path); 
  101.    --  This function was used internally by the GtkRC parsing mechanism to 
  102.    --  assign match patterns to Gtk.Binding_Set.Gtk_Binding_Set structures. 
  103.    --  In GTK+ 3, these match patterns are unused. 
  104.    --  Deprecated since None, 3.0 
  105.    --  "path_type": path type the pattern applies to 
  106.    --  "path_pattern": the actual match pattern 
  107.    --  "priority": binding priority 
  108.  
  109.    --------------- 
  110.    -- Functions -- 
  111.    --------------- 
  112.  
  113.    function By_Class (Object_Class : System.Address) return Gtk_Binding_Set; 
  114.    pragma Import (C, By_Class, "gtk_binding_set_by_class"); 
  115.    --  This function returns the binding set named after the type name of the 
  116.    --  passed in class structure. New binding sets are created on demand by 
  117.    --  this function. 
  118.    --  "object_class": a valid Glib.Object.GObject class 
  119.  
  120.    function Find (Set_Name : UTF8_String) return Gtk_Binding_Set; 
  121.    --  Find a binding set by its globally unique name. 
  122.    --  The Set_Name can either be a name used for Gtk.Binding_Set.Gtk_New or 
  123.    --  the type name of a class used in Gtk.Binding_Set.By_Class. 
  124.    --  "set_name": unique binding set name 
  125.  
  126. end Gtk.Binding_Set;