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. --  Gtk.Cell_Renderer_Accel.Gtk_Cell_Renderer_Accel displays a keyboard 
  26. --  accelerator (i.e. a key combination like ['Control''a']. If the cell 
  27. --  renderer is editable, the accelerator can be changed by simply typing the 
  28. --  new combination. 
  29. -- 
  30. --  The Gtk.Cell_Renderer_Accel.Gtk_Cell_Renderer_Accel cell renderer was 
  31. --  added in GTK+ 2.10. 
  32. -- 
  33. --  </description> 
  34. pragma Ada_2005; 
  35.  
  36. pragma Warnings (Off, "*is already use-visible*"); 
  37. with Gdk.Types;              use Gdk.Types; 
  38. with Glib;                   use Glib; 
  39. with Glib.Object;            use Glib.Object; 
  40. with Glib.Properties;        use Glib.Properties; 
  41. with Gtk.Cell_Renderer_Text; use Gtk.Cell_Renderer_Text; 
  42.  
  43. package Gtk.Cell_Renderer_Accel is 
  44.  
  45.    type Gtk_Cell_Renderer_Accel_Record is new Gtk_Cell_Renderer_Text_Record with null record; 
  46.    type Gtk_Cell_Renderer_Accel is access all Gtk_Cell_Renderer_Accel_Record'Class; 
  47.  
  48.    ------------------ 
  49.    -- Constructors -- 
  50.    ------------------ 
  51.  
  52.    procedure Gtk_New (Self : out Gtk_Cell_Renderer_Accel); 
  53.    procedure Initialize 
  54.       (Self : not null access Gtk_Cell_Renderer_Accel_Record'Class); 
  55.    --  Creates a new Gtk.Cell_Renderer_Accel.Gtk_Cell_Renderer_Accel. 
  56.    --  Since: gtk+ 2.10 
  57.  
  58.    function Gtk_Cell_Renderer_Accel_New return Gtk_Cell_Renderer_Accel; 
  59.    --  Creates a new Gtk.Cell_Renderer_Accel.Gtk_Cell_Renderer_Accel. 
  60.    --  Since: gtk+ 2.10 
  61.  
  62.    function Get_Type return Glib.GType; 
  63.    pragma Import (C, Get_Type, "gtk_cell_renderer_accel_get_type"); 
  64.  
  65.    ---------------- 
  66.    -- Properties -- 
  67.    ---------------- 
  68.    --  The following properties are defined for this widget. See 
  69.    --  Glib.Properties for more information on properties) 
  70.  
  71.    Accel_Key_Property : constant Glib.Properties.Property_Uint; 
  72.    --  The keyval of the accelerator. 
  73.  
  74.    Accel_Mode_Property : constant Glib.Properties.Property_Boxed; 
  75.    --  Type: Cell_Renderer_Accel_Mode 
  76.    --  Determines if the edited accelerators are GTK+ accelerators. If they 
  77.    --  are, consumed modifiers are suppressed, only accelerators accepted by 
  78.    --  GTK+ are allowed, and the accelerators are rendered in the same way as 
  79.    --  they are in menus. 
  80.  
  81.    Accel_Mods_Property : constant Glib.Properties.Property_Boxed; 
  82.    --  Type: Gdk.Types.Gdk_Modifier_Type 
  83.    --  The modifier mask of the accelerator. 
  84.  
  85.    Keycode_Property : constant Glib.Properties.Property_Uint; 
  86.    --  The hardware keycode of the accelerator. Note that the hardware keycode 
  87.    --  is only relevant if the key does not have a keyval. Normally, the 
  88.    --  keyboard configuration should assign keyvals to all keys. 
  89.  
  90.    ------------- 
  91.    -- Signals -- 
  92.    ------------- 
  93.  
  94.    type Cb_Gtk_Cell_Renderer_Accel_UTF8_String_Void is not null access procedure 
  95.      (Self        : access Gtk_Cell_Renderer_Accel_Record'Class; 
  96.       Path_String : UTF8_String); 
  97.  
  98.    type Cb_GObject_UTF8_String_Void is not null access procedure 
  99.      (Self        : access Glib.Object.GObject_Record'Class; 
  100.       Path_String : UTF8_String); 
  101.  
  102.    Signal_Accel_Cleared : constant Glib.Signal_Name := "accel-cleared"; 
  103.    procedure On_Accel_Cleared 
  104.       (Self  : not null access Gtk_Cell_Renderer_Accel_Record; 
  105.        Call  : Cb_Gtk_Cell_Renderer_Accel_UTF8_String_Void; 
  106.        After : Boolean := False); 
  107.    procedure On_Accel_Cleared 
  108.       (Self  : not null access Gtk_Cell_Renderer_Accel_Record; 
  109.        Call  : Cb_GObject_UTF8_String_Void; 
  110.        Slot  : not null access Glib.Object.GObject_Record'Class; 
  111.        After : Boolean := False); 
  112.    --  Gets emitted when the user has removed the accelerator. 
  113.  
  114.    type Cb_Gtk_Cell_Renderer_Accel_UTF8_String_Guint_Gdk_Modifier_Type_Guint_Void is not null access procedure 
  115.      (Self             : access Gtk_Cell_Renderer_Accel_Record'Class; 
  116.       Path_String      : UTF8_String; 
  117.       Accel_Key        : Guint; 
  118.       Accel_Mods       : Gdk.Types.Gdk_Modifier_Type; 
  119.       Hardware_Keycode : Guint); 
  120.  
  121.    type Cb_GObject_UTF8_String_Guint_Gdk_Modifier_Type_Guint_Void is not null access procedure 
  122.      (Self             : access Glib.Object.GObject_Record'Class; 
  123.       Path_String      : UTF8_String; 
  124.       Accel_Key        : Guint; 
  125.       Accel_Mods       : Gdk.Types.Gdk_Modifier_Type; 
  126.       Hardware_Keycode : Guint); 
  127.  
  128.    Signal_Accel_Edited : constant Glib.Signal_Name := "accel-edited"; 
  129.    procedure On_Accel_Edited 
  130.       (Self  : not null access Gtk_Cell_Renderer_Accel_Record; 
  131.        Call  : Cb_Gtk_Cell_Renderer_Accel_UTF8_String_Guint_Gdk_Modifier_Type_Guint_Void; 
  132.        After : Boolean := False); 
  133.    procedure On_Accel_Edited 
  134.       (Self  : not null access Gtk_Cell_Renderer_Accel_Record; 
  135.        Call  : Cb_GObject_UTF8_String_Guint_Gdk_Modifier_Type_Guint_Void; 
  136.        Slot  : not null access Glib.Object.GObject_Record'Class; 
  137.        After : Boolean := False); 
  138.    --  Gets emitted when the user has selected a new accelerator. 
  139.    --  
  140.    --  Callback parameters: 
  141.    --    --  "path_string": the path identifying the row of the edited cell 
  142.    --    --  "accel_key": the new accelerator keyval 
  143.    --    --  "accel_mods": the new acclerator modifier mask 
  144.    --    --  "hardware_keycode": the keycode of the new accelerator 
  145.  
  146. private 
  147.    Keycode_Property : constant Glib.Properties.Property_Uint := 
  148.      Glib.Properties.Build ("keycode"); 
  149.    Accel_Mods_Property : constant Glib.Properties.Property_Boxed := 
  150.      Glib.Properties.Build ("accel-mods"); 
  151.    Accel_Mode_Property : constant Glib.Properties.Property_Boxed := 
  152.      Glib.Properties.Build ("accel-mode"); 
  153.    Accel_Key_Property : constant Glib.Properties.Property_Uint := 
  154.      Glib.Properties.Build ("accel-key"); 
  155. end Gtk.Cell_Renderer_Accel;