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 Gtk.Tearoff_Menu_Item.Gtk_Tearoff_Menu_Item is a special 
  26. --  Gtk.Menu_Item.Gtk_Menu_Item which is used to tear off and reattach its 
  27. --  menu. 
  28. -- 
  29. --  When its menu is shown normally, the 
  30. --  Gtk.Tearoff_Menu_Item.Gtk_Tearoff_Menu_Item is drawn as a dotted line 
  31. --  indicating that the menu can be torn off. Activating it causes its menu to 
  32. --  be torn off and displayed in its own window as a tearoff menu. 
  33. -- 
  34. --  When its menu is shown as a tearoff menu, the 
  35. --  Gtk.Tearoff_Menu_Item.Gtk_Tearoff_Menu_Item is drawn as a dotted line which 
  36. --  has a left pointing arrow graphic indicating that the tearoff menu can be 
  37. --  reattached. Activating it will erase the tearoff menu window. 
  38. -- 
  39. --  Note: Gtk.Tearoff_Menu_Item.Gtk_Tearoff_Menu_Item is deprecated and should 
  40. --  not be used in newly written code. Menus are not meant to be torn around. 
  41. -- 
  42. --  </description> 
  43. pragma Ada_2005; 
  44.  
  45. pragma Warnings (Off, "*is already use-visible*"); 
  46. with Glib;            use Glib; 
  47. with Glib.Types;      use Glib.Types; 
  48. with Glib.Variant;    use Glib.Variant; 
  49. with Gtk.Action;      use Gtk.Action; 
  50. with Gtk.Actionable;  use Gtk.Actionable; 
  51. with Gtk.Activatable; use Gtk.Activatable; 
  52. with Gtk.Buildable;   use Gtk.Buildable; 
  53. with Gtk.Menu_Item;   use Gtk.Menu_Item; 
  54.  
  55. package Gtk.Tearoff_Menu_Item is 
  56.  
  57.    type Gtk_Tearoff_Menu_Item_Record is new Gtk_Menu_Item_Record with null record; 
  58.    type Gtk_Tearoff_Menu_Item is access all Gtk_Tearoff_Menu_Item_Record'Class; 
  59.  
  60.    ------------------ 
  61.    -- Constructors -- 
  62.    ------------------ 
  63.  
  64.    procedure Gtk_New (Menu_Item : out Gtk_Tearoff_Menu_Item); 
  65.    procedure Initialize 
  66.       (Menu_Item : not null access Gtk_Tearoff_Menu_Item_Record'Class); 
  67.    --  Creates a new Gtk.Tearoff_Menu_Item.Gtk_Tearoff_Menu_Item. 
  68.  
  69.    function Gtk_Tearoff_Menu_Item_New return Gtk_Tearoff_Menu_Item; 
  70.    --  Creates a new Gtk.Tearoff_Menu_Item.Gtk_Tearoff_Menu_Item. 
  71.  
  72.    function Get_Type return Glib.GType; 
  73.    pragma Import (C, Get_Type, "gtk_tearoff_menu_item_get_type"); 
  74.  
  75.    --------------------------------------------- 
  76.    -- Inherited subprograms (from interfaces) -- 
  77.    --------------------------------------------- 
  78.    --  Methods inherited from the Buildable interface are not duplicated here 
  79.    --  since they are meant to be used by tools, mostly. If you need to call 
  80.    --  them, use an explicit cast through the "-" operator below. 
  81.  
  82.    function Get_Action_Name 
  83.       (Self : not null access Gtk_Tearoff_Menu_Item_Record) 
  84.        return UTF8_String; 
  85.  
  86.    procedure Set_Action_Name 
  87.       (Self        : not null access Gtk_Tearoff_Menu_Item_Record; 
  88.        Action_Name : UTF8_String); 
  89.  
  90.    function Get_Action_Target_Value 
  91.       (Self : not null access Gtk_Tearoff_Menu_Item_Record) 
  92.        return Glib.Variant.Gvariant; 
  93.  
  94.    procedure Set_Action_Target_Value 
  95.       (Self         : not null access Gtk_Tearoff_Menu_Item_Record; 
  96.        Target_Value : Glib.Variant.Gvariant); 
  97.  
  98.    procedure Set_Detailed_Action_Name 
  99.       (Self                 : not null access Gtk_Tearoff_Menu_Item_Record; 
  100.        Detailed_Action_Name : UTF8_String); 
  101.  
  102.    procedure Do_Set_Related_Action 
  103.       (Self   : not null access Gtk_Tearoff_Menu_Item_Record; 
  104.        Action : not null access Gtk.Action.Gtk_Action_Record'Class); 
  105.  
  106.    function Get_Related_Action 
  107.       (Self : not null access Gtk_Tearoff_Menu_Item_Record) 
  108.        return Gtk.Action.Gtk_Action; 
  109.  
  110.    procedure Set_Related_Action 
  111.       (Self   : not null access Gtk_Tearoff_Menu_Item_Record; 
  112.        Action : not null access Gtk.Action.Gtk_Action_Record'Class); 
  113.  
  114.    function Get_Use_Action_Appearance 
  115.       (Self : not null access Gtk_Tearoff_Menu_Item_Record) return Boolean; 
  116.  
  117.    procedure Set_Use_Action_Appearance 
  118.       (Self           : not null access Gtk_Tearoff_Menu_Item_Record; 
  119.        Use_Appearance : Boolean); 
  120.  
  121.    procedure Sync_Action_Properties 
  122.       (Self   : not null access Gtk_Tearoff_Menu_Item_Record; 
  123.        Action : access Gtk.Action.Gtk_Action_Record'Class); 
  124.  
  125.    ---------------- 
  126.    -- Interfaces -- 
  127.    ---------------- 
  128.    --  This class implements several interfaces. See Glib.Types 
  129.    -- 
  130.    --  - "Actionable" 
  131.    -- 
  132.    --  - "Activatable" 
  133.    -- 
  134.    --  - "Buildable" 
  135.  
  136.    package Implements_Gtk_Actionable is new Glib.Types.Implements 
  137.      (Gtk.Actionable.Gtk_Actionable, Gtk_Tearoff_Menu_Item_Record, Gtk_Tearoff_Menu_Item); 
  138.    function "+" 
  139.      (Widget : access Gtk_Tearoff_Menu_Item_Record'Class) 
  140.    return Gtk.Actionable.Gtk_Actionable 
  141.    renames Implements_Gtk_Actionable.To_Interface; 
  142.    function "-" 
  143.      (Interf : Gtk.Actionable.Gtk_Actionable) 
  144.    return Gtk_Tearoff_Menu_Item 
  145.    renames Implements_Gtk_Actionable.To_Object; 
  146.  
  147.    package Implements_Gtk_Activatable is new Glib.Types.Implements 
  148.      (Gtk.Activatable.Gtk_Activatable, Gtk_Tearoff_Menu_Item_Record, Gtk_Tearoff_Menu_Item); 
  149.    function "+" 
  150.      (Widget : access Gtk_Tearoff_Menu_Item_Record'Class) 
  151.    return Gtk.Activatable.Gtk_Activatable 
  152.    renames Implements_Gtk_Activatable.To_Interface; 
  153.    function "-" 
  154.      (Interf : Gtk.Activatable.Gtk_Activatable) 
  155.    return Gtk_Tearoff_Menu_Item 
  156.    renames Implements_Gtk_Activatable.To_Object; 
  157.  
  158.    package Implements_Gtk_Buildable is new Glib.Types.Implements 
  159.      (Gtk.Buildable.Gtk_Buildable, Gtk_Tearoff_Menu_Item_Record, Gtk_Tearoff_Menu_Item); 
  160.    function "+" 
  161.      (Widget : access Gtk_Tearoff_Menu_Item_Record'Class) 
  162.    return Gtk.Buildable.Gtk_Buildable 
  163.    renames Implements_Gtk_Buildable.To_Interface; 
  164.    function "-" 
  165.      (Interf : Gtk.Buildable.Gtk_Buildable) 
  166.    return Gtk_Tearoff_Menu_Item 
  167.    renames Implements_Gtk_Buildable.To_Object; 
  168.  
  169. end Gtk.Tearoff_Menu_Item;