1. ----------------------------------------------------------------------- 
  2. --              GtkAda - Ada95 binding for Gtk+/Gnome                -- 
  3. --                                                                   -- 
  4. --                Copyright (C) 2001-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. --  This widget works like a normal menu_item, but you can insert a 
  31. --  arbitrary widget (most often a pixmap widget), which is displayed 
  32. --  at the left side. The advantage is that indentation is handled the 
  33. --  same way as GtkAda does (i.e if you create a menu with a 
  34. --  Gtk_Check_Menu_Item, all normal menu_items are automatically indented by 
  35. --  GtkAda - so if you use a normal menu_item to display pixmaps at the left 
  36. --  side, the pixmaps will be indented, which is not what you want. This widget 
  37. --  solves the problem). 
  38. --  </description> 
  39. --  <c_version>2.16.6</c_version> 
  40. --  <group>Menus and Toolbars</group> 
  41.  
  42. with Glib.Properties; 
  43. with Gtk.Accel_Group; 
  44. with Gtk.Menu_Item; 
  45. with Gtk.Widget; 
  46.  
  47. package Gtk.Image_Menu_Item is 
  48.  
  49.    type Gtk_Image_Menu_Item_Record is new 
  50.      Gtk.Menu_Item.Gtk_Menu_Item_Record with private; 
  51.    type Gtk_Image_Menu_Item is access all Gtk_Image_Menu_Item_Record'Class; 
  52.  
  53.    procedure Gtk_New 
  54.      (Widget : out Gtk_Image_Menu_Item; 
  55.       Label  : UTF8_String); 
  56.    --  Create a new Gtk_Image_Menu_Item. 
  57.    --  If label is non null, set the label of the menu item. 
  58.  
  59.    procedure Gtk_New_From_Stock 
  60.      (Widget   : out Gtk_Image_Menu_Item; 
  61.       Stock_Id : String); 
  62.    --  Create a new Gtk_Image_Menu_Item from a stock item. 
  63.  
  64.    procedure Gtk_New 
  65.      (Widget      : out Gtk_Image_Menu_Item; 
  66.       Stock_Id    : String; 
  67.       Accel_Group : Gtk.Accel_Group.Gtk_Accel_Group); 
  68.    --  Create a new Gtk_Image_Menu_Item with a label. 
  69.    --  If label contains an underscore, a mnemonic is created accordingly. 
  70.  
  71.    procedure Gtk_New_With_Mnemonic 
  72.      (Widget : out Gtk_Image_Menu_Item; 
  73.       Label  : UTF8_String); 
  74.    --  Create a new Gtk_Image_Menu_Item with a label. 
  75.    --  If label contains an underscore, a mnemonic is created accordingly. 
  76.  
  77.    procedure Initialize 
  78.      (Widget : access Gtk_Image_Menu_Item_Record'Class; 
  79.       Label  : UTF8_String); 
  80.    --  Internal initialization function. 
  81.    --  See the section "Creating your own widgets" in the documentation. 
  82.  
  83.    procedure Initialize 
  84.      (Widget      : access Gtk_Image_Menu_Item_Record'Class; 
  85.       Stock_Id    : String; 
  86.       Accel_Group : Gtk.Accel_Group.Gtk_Accel_Group); 
  87.    --  ditto. 
  88.  
  89.    procedure Initialize_With_Mnemonic 
  90.      (Widget : access Gtk_Image_Menu_Item_Record'Class; 
  91.       Label  : UTF8_String); 
  92.    --  ditto. 
  93.  
  94.    procedure Initialize_From_Stock 
  95.      (Widget   : access Gtk_Image_Menu_Item_Record'Class; 
  96.       Stock_Id : String); 
  97.    --  ditto. 
  98.  
  99.    function Get_Type return Gtk.Gtk_Type; 
  100.    --  Return the internal value associated with this widget. 
  101.  
  102.    procedure Set_Image 
  103.      (Menu_Item : access Gtk_Image_Menu_Item_Record; 
  104.       Image     : access Gtk.Widget.Gtk_Widget_Record'Class); 
  105.  
  106.    function Get_Image 
  107.      (Menu_Item : access Gtk_Image_Menu_Item_Record) 
  108.       return Gtk.Widget.Gtk_Widget; 
  109.  
  110.    procedure Set_Accel_Group 
  111.      (Image_Menu_Item : access Gtk_Image_Menu_Item_Record'Class; 
  112.       Accel_Group     : access Gtk.Accel_Group.Gtk_Accel_Group_Record'Class); 
  113.    --  Specifies an Accel_Group to add the menu items accelerator to. 
  114.    --  This only applies to stock items, so a stock item must already 
  115.    --  be set.  Make sure to call Set_Use_Stock and Gtk.Menu_Item.Set_Label 
  116.    --  with a valid stock item first. 
  117.    -- 
  118.    --  If you want this menu item to have changeable accelerators then 
  119.    --  you shouldn't need this (see Gtk_New_From_Stock). 
  120.  
  121.    function Get_Always_Show_Image 
  122.      (Image_Menu_Item : access Gtk_Image_Menu_Item_Record'Class) 
  123.       return Boolean; 
  124.    procedure Set_Always_Show_Image 
  125.      (Image_Menu_Item : access Gtk_Image_Menu_Item_Record'Class; 
  126.       Always_Show     : Boolean); 
  127.    --  If True, the menu item will ignore the GtkSettings:gtk-menu-images 
  128.    --  setting and always show the image, if available. 
  129.    -- 
  130.    --  Use this property if the menuitem would be useless or hard to use 
  131.    --  without the image. 
  132.  
  133.    function Get_Use_Stock 
  134.      (Image_Menu_Item : access Gtk_Image_Menu_Item_Record'Class) 
  135.       return Boolean; 
  136.    procedure Set_Use_Stock 
  137.      (Image_Menu_Item : access Gtk_Image_Menu_Item_Record'Class; 
  138.       Use_Stock       : Boolean); 
  139.    --  If True, the label set in the Image_Menu_Item is used as a 
  140.    --  stock id to select the stock item for the item. 
  141.  
  142.    ---------------- 
  143.    -- Properties -- 
  144.    ---------------- 
  145.  
  146.    --  <properties> 
  147.    --  The following properties are defined for this widget. See 
  148.    --  Glib.Properties for more information on properties. 
  149.    -- 
  150.    --  Name:  Accel_Group_Property 
  151.    --  Type:  Object 
  152.    --  Descr: The Accel Group to use for stock accelerator keys 
  153.    -- 
  154.    --  Name:  Always_Show_Image_Property 
  155.    --  Type:  Boolean 
  156.    --  Descr: Whether the image will always be shown 
  157.    -- 
  158.    --  Name:  Image_Property 
  159.    --  Type:  Object 
  160.    --  Descr: Child widget to appear next to the menu text 
  161.    -- 
  162.    --  Name:  Use_Stock_Property 
  163.    --  Type:  Boolean 
  164.    --  Descr: Whether to use the label text to create a stock menu item 
  165.    -- 
  166.    --  </properties> 
  167.  
  168.    Accel_Group_Property       : constant Glib.Properties.Property_Object; 
  169.    Always_Show_Image_Property : constant Glib.Properties.Property_Boolean; 
  170.    Image_Property             : constant Glib.Properties.Property_Object; 
  171.    Use_Stock_Property         : constant Glib.Properties.Property_Boolean; 
  172.  
  173.    ------------- 
  174.    -- Signals -- 
  175.    ------------- 
  176.  
  177.    --  <signals> 
  178.    --  The following new signals are defined for this widget: 
  179.    -- 
  180.    --  </signals> 
  181.  
  182. private 
  183.    type Gtk_Image_Menu_Item_Record is new 
  184.      Gtk.Menu_Item.Gtk_Menu_Item_Record with null record; 
  185.  
  186.    Accel_Group_Property : constant Glib.Properties.Property_Object := 
  187.      Glib.Properties.Build ("accel-group"); 
  188.    Always_Show_Image_Property : constant Glib.Properties.Property_Boolean := 
  189.      Glib.Properties.Build ("always-show-image"); 
  190.    Image_Property : constant Glib.Properties.Property_Object := 
  191.      Glib.Properties.Build ("image"); 
  192.    Use_Stock_Property : constant Glib.Properties.Property_Boolean := 
  193.      Glib.Properties.Build ("use-stock"); 
  194.  
  195.    pragma Import (C, Get_Type, "gtk_image_menu_item_get_type"); 
  196. end Gtk.Image_Menu_Item;