1. ----------------------------------------------------------------------- 
  2. --               GtkAda - Ada95 binding for Gtk+/Gnome               -- 
  3. --                                                                   -- 
  4. --                    Copyright (C) 2010-2013, 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. -- As a special exception, if other files instantiate generics from  -- 
  22. -- this unit, or you link this unit with other files to produce an   -- 
  23. -- executable, this  unit  does not  by itself cause  the resulting  -- 
  24. -- executable to be covered by the GNU General Public License. This  -- 
  25. -- exception does not however invalidate any other reasons why the   -- 
  26. -- executable file  might be covered by the  GNU Public License.     -- 
  27. ----------------------------------------------------------------------- 
  28.  
  29. --  <description> 
  30. --  A Gtk_Recent_Action represents a list of recently used files, which 
  31. --  can be shown by widgets such as Gtk_Recent_Chooser_Dialog or 
  32. --  Gtk_Recent_Chooser_Menu. 
  33. -- 
  34. --  To construct a submenu showing recently used files, use a Gtk_Recent_Action 
  35. --  as the action for a menuitem. To construct a menu toolbutton showing the 
  36. --  recently used files in the popup menu, use a Gtk_Recent_Action as the 
  37. --  action for a toolitem element. 
  38. --  </description> 
  39. --  <group>Action-based menus</group> 
  40. --  <c_version>2.16.6</c_version> 
  41.  
  42. with Glib.Properties; 
  43. with Gtk.Action; 
  44. with Gtk.Recent_Manager; 
  45.  
  46. package Gtk.Recent_Action is 
  47.  
  48.    type Gtk_Recent_Action_Record is 
  49.      new Gtk.Action.Gtk_Action_Record with private; 
  50.    type Gtk_Recent_Action is access all Gtk_Recent_Action_Record'Class; 
  51.  
  52.    procedure Gtk_New 
  53.      (Widget   : out Gtk_Recent_Action; 
  54.       Name     : String; 
  55.       Label    : String := ""; 
  56.       Tooltip  : String := ""; 
  57.       Stock_Id : String := ""); 
  58.    procedure Initialize 
  59.      (Widget   : access Gtk_Recent_Action_Record'Class; 
  60.       Name     : String; 
  61.       Label    : String := ""; 
  62.       Tooltip  : String := ""; 
  63.       Stock_Id : String := ""); 
  64.    --  Name: a unique name for the action 
  65.    --  Label: the label displayed in menu items and on buttons 
  66.    --  Tooltip: a tooltip for the action 
  67.    --  Stock_Id: the stock icon to display in widgets representing the 
  68.    --  action 
  69.    -- 
  70.    --  Creates a new Gtk_Recent_Action object. To add the action to 
  71.    --  a Gtk_Action_Group and set the accelerator for the action, 
  72.    --  call Gtk.Action_Group.Add_Action_With_Accel. 
  73.  
  74.    function Get_Type return GType; 
  75.    --  Return the internal value associated with this widget. 
  76.  
  77.    procedure Gtk_New_For_Manager 
  78.      (Widget   : out Gtk_Recent_Action; 
  79.       Name     : String; 
  80.       Label    : String := ""; 
  81.       Tooltip  : String := ""; 
  82.       Stock_Id : String := ""; 
  83.       Manager  : access Gtk.Recent_Manager.Gtk_Recent_Manager_Record'Class := 
  84.                  Gtk.Recent_Manager.Get_Default); 
  85.    procedure Initialize_For_Manager 
  86.      (Widget   : access Gtk_Recent_Action_Record'Class; 
  87.       Name     : String; 
  88.       Label    : String := ""; 
  89.       Tooltip  : String := ""; 
  90.       Stock_Id : String := ""; 
  91.       Manager  : access Gtk.Recent_Manager.Gtk_Recent_Manager_Record'Class := 
  92.                  Gtk.Recent_Manager.Get_Default); 
  93.    --  Name: a unique name for the action 
  94.    --  Label: the label displayed in menu items and on buttons 
  95.    --  Tooltip: a tooltip for the action 
  96.    --  Stock_Id: the stock icon to display in widgets representing the 
  97.    --  action 
  98.    --  manager: a Gtk_Recent_Manager, or use the default Gtk_Recent_Manager 
  99.    -- 
  100.    --  Creates a new Gtk_Recent_Action object. To add the action to 
  101.    --  a Gtk_Action_Group and set the accelerator for the action, 
  102.    --  call gtk_action_group_add_action_with_accel(). 
  103.  
  104.    function Get_Show_Numbers 
  105.      (Action : access Gtk_Recent_Action_Record) return Boolean; 
  106.    procedure Set_Show_Numbers 
  107.      (Action       : access Gtk_Recent_Action_Record; 
  108.       Show_Numbers : Boolean); 
  109.    --  Whether a number should be added to the items shown by the 
  110.    --  widgets representing Action. The numbers are shown to provide 
  111.    --  a unique character for a mnemonic to be used inside the menu item's 
  112.    --  label. Only the first ten items get a number to avoid clashes. 
  113.  
  114.    ---------------- 
  115.    -- Properties -- 
  116.    ---------------- 
  117.  
  118.    --  <properties> 
  119.    --  Name:  Show_Numbers_Property 
  120.    --  Type:  Boolean 
  121.    --  Descr: Whether the items should be displayed with a number 
  122.    -- 
  123.    --  </properties> 
  124.  
  125.    Show_Numbers_Property : constant Glib.Properties.Property_Boolean; 
  126.  
  127. private 
  128.    type Gtk_Recent_Action_Record is 
  129.      new Gtk.Action.Gtk_Action_Record with null record; 
  130.  
  131.    Show_Numbers_Property : constant Glib.Properties.Property_Boolean := 
  132.      Glib.Properties.Build ("show-numbers"); 
  133.  
  134.    pragma Import (C, Get_Type, "gtk_recent_action_get_type"); 
  135. end Gtk.Recent_Action;