1. ----------------------------------------------------------------------- 
  2. --               GtkAda - Ada95 binding for Gtk+/Gnome               -- 
  3. --                                                                   -- 
  4. --                    Copyright (C) 2010, AdaCore                    -- 
  5. --                                                                   -- 
  6. -- This library is free software; you can redistribute it and/or     -- 
  7. -- modify it under the terms of the GNU General Public               -- 
  8. -- License as published by the Free Software Foundation; either      -- 
  9. -- version 2 of the License, or (at your option) any later version.  -- 
  10. --                                                                   -- 
  11. -- This library is distributed in the hope that it will be useful,   -- 
  12. -- but WITHOUT ANY WARRANTY; without even the implied warranty of    -- 
  13. -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU -- 
  14. -- General Public License for more details.                          -- 
  15. --                                                                   -- 
  16. -- You should have received a copy of the GNU General Public         -- 
  17. -- License along with this library; if not, write to the             -- 
  18. -- Free Software Foundation, Inc., 59 Temple Place - Suite 330,      -- 
  19. -- Boston, MA 02111-1307, USA.                                       -- 
  20. --                                                                   -- 
  21. -- -- -- -- -- -- -- -- -- -- -- --
  22. ----------------------------------------------------------------------- 
  23.  
  24. --  <description> 
  25. --  A Gtk_Recent_Action represents a list of recently used files, which 
  26. --  can be shown by widgets such as Gtk_Recent_Chooser_Dialog or 
  27. --  Gtk_Recent_Chooser_Menu. 
  28. -- 
  29. --  To construct a submenu showing recently used files, use a Gtk_Recent_Action 
  30. --  as the action for a menuitem. To construct a menu toolbutton showing the 
  31. --  recently used files in the popup menu, use a Gtk_Recent_Action as the 
  32. --  action for a toolitem element. 
  33. --  </description> 
  34. --  <group>Action-based menus</group> 
  35. --  <c_version>2.16.6</c_version> 
  36.  
  37. with Glib.Properties; 
  38. with Gtk.Action; 
  39. with Gtk.Recent_Manager; 
  40.  
  41. package Gtk.Recent_Action is 
  42.  
  43.    type Gtk_Recent_Action_Record is 
  44.      new Gtk.Action.Gtk_Action_Record with private; 
  45.    type Gtk_Recent_Action is access all Gtk_Recent_Action_Record'Class; 
  46.  
  47.    procedure Gtk_New 
  48.      (Widget   : out Gtk_Recent_Action; 
  49.       Name     : String; 
  50.       Label    : String := ""; 
  51.       Tooltip  : String := ""; 
  52.       Stock_Id : String := ""); 
  53.    procedure Initialize 
  54.      (Widget   : access Gtk_Recent_Action_Record'Class; 
  55.       Name     : String; 
  56.       Label    : String := ""; 
  57.       Tooltip  : String := ""; 
  58.       Stock_Id : String := ""); 
  59.    --  Name: a unique name for the action 
  60.    --  Label: the label displayed in menu items and on buttons 
  61.    --  Tooltip: a tooltip for the action 
  62.    --  Stock_Id: the stock icon to display in widgets representing the 
  63.    --  action 
  64.    -- 
  65.    --  Creates a new Gtk_Recent_Action object. To add the action to 
  66.    --  a Gtk_Action_Group and set the accelerator for the action, 
  67.    --  call Gtk.Action_Group.Add_Action_With_Accel. 
  68.  
  69.    function Get_Type return GType; 
  70.    --  Return the internal value associated with this widget. 
  71.  
  72.    procedure Gtk_New_For_Manager 
  73.      (Widget   : out Gtk_Recent_Action; 
  74.       Name     : String; 
  75.       Label    : String := ""; 
  76.       Tooltip  : String := ""; 
  77.       Stock_Id : String := ""; 
  78.       Manager  : access Gtk.Recent_Manager.Gtk_Recent_Manager_Record'Class := 
  79.                  Gtk.Recent_Manager.Get_Default); 
  80.    procedure Initialize_For_Manager 
  81.      (Widget   : access Gtk_Recent_Action_Record'Class; 
  82.       Name     : String; 
  83.       Label    : String := ""; 
  84.       Tooltip  : String := ""; 
  85.       Stock_Id : String := ""; 
  86.       Manager  : access Gtk.Recent_Manager.Gtk_Recent_Manager_Record'Class := 
  87.                  Gtk.Recent_Manager.Get_Default); 
  88.    --  Name: a unique name for the action 
  89.    --  Label: the label displayed in menu items and on buttons 
  90.    --  Tooltip: a tooltip for the action 
  91.    --  Stock_Id: the stock icon to display in widgets representing the 
  92.    --  action 
  93.    --  manager: a Gtk_Recent_Manager, or use the default Gtk_Recent_Manager 
  94.    -- 
  95.    --  Creates a new Gtk_Recent_Action object. To add the action to 
  96.    --  a Gtk_Action_Group and set the accelerator for the action, 
  97.    --  call gtk_action_group_add_action_with_accel(). 
  98.  
  99.    function Get_Show_Numbers 
  100.      (Action : access Gtk_Recent_Action_Record) return Boolean; 
  101.    procedure Set_Show_Numbers 
  102.      (Action       : access Gtk_Recent_Action_Record; 
  103.       Show_Numbers : Boolean); 
  104.    --  Whether a number should be added to the items shown by the 
  105.    --  widgets representing Action. The numbers are shown to provide 
  106.    --  a unique character for a mnemonic to be used inside the menu item's 
  107.    --  label. Only the first ten items get a number to avoid clashes. 
  108.  
  109.    ---------------- 
  110.    -- Properties -- 
  111.    ---------------- 
  112.  
  113.    --  <properties> 
  114.    --  Name:  Show_Numbers_Property 
  115.    --  Type:  Boolean 
  116.    --  Descr: Whether the items should be displayed with a number 
  117.    -- 
  118.    --  </properties> 
  119.  
  120.    Show_Numbers_Property : constant Glib.Properties.Property_Boolean; 
  121.  
  122. private 
  123.    type Gtk_Recent_Action_Record is 
  124.      new Gtk.Action.Gtk_Action_Record with null record; 
  125.  
  126.    Show_Numbers_Property : constant Glib.Properties.Property_Boolean := 
  127.      Glib.Properties.Build ("show-numbers"); 
  128.  
  129.    pragma Import (C, Get_Type, "gtk_recent_action_get_type"); 
  130. end Gtk.Recent_Action;