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. --  The "system tray" or notification area is normally used for transient 
  26. --  icons that indicate some special state. For example, a system tray icon 
  27. --  might appear to tell the user that they have new mail, or have an incoming 
  28. --  instant message, or something along those lines. The basic idea is that 
  29. --  creating an icon in the notification area is less annoying than popping up 
  30. --  a dialog. 
  31. -- 
  32. --  A Gtk.Status_Icon.Gtk_Status_Icon object can be used to display an icon in 
  33. --  a "system tray". The icon can have a tooltip, and the user can interact 
  34. --  with it by activating it or popping up a context menu. Critical information 
  35. --  should not solely be displayed in a Gtk.Status_Icon.Gtk_Status_Icon, since 
  36. --  it may not be visible (e.g. when the user doesn't have a notification area 
  37. --  on his panel). This can be checked with Gtk.Status_Icon.Is_Embedded. 
  38. -- 
  39. --  On X11, the implementation follows the freedesktop.org "System Tray" 
  40. --  <ulink 
  41. --  url="http://www.freedesktop.org/wiki/Specifications/systemtray-spec">specification</ulink>. 
  42. --  Implementations of the "tray" side of this specification can be found e.g. 
  43. --  in the GNOME 2 and KDE panel applications. 
  44. -- 
  45. --  Note that a GtkStatusIcon is *not* a widget, but just a 
  46. --  Glib.Object.GObject. Making it a widget would be impractical, since the 
  47. --  system tray on Win32 doesn't allow to embed arbitrary widgets. 
  48. -- 
  49. --  </description> 
  50. pragma Ada_2005; 
  51.  
  52. pragma Warnings (Off, "*is already use-visible*"); 
  53. with Gdk.Event;       use Gdk.Event; 
  54. with Gdk.Pixbuf;      use Gdk.Pixbuf; 
  55. with Gdk.Screen;      use Gdk.Screen; 
  56. with Glib;            use Glib; 
  57. with Glib.G_Icon;     use Glib.G_Icon; 
  58. with Glib.Object;     use Glib.Object; 
  59. with Glib.Properties; use Glib.Properties; 
  60. with Gtk.Enums;       use Gtk.Enums; 
  61. with Gtk.Image;       use Gtk.Image; 
  62. with Gtk.Menu;        use Gtk.Menu; 
  63. with Gtk.Tooltip;     use Gtk.Tooltip; 
  64.  
  65. package Gtk.Status_Icon is 
  66.  
  67.    type Gtk_Status_Icon_Record is new GObject_Record with null record; 
  68.    type Gtk_Status_Icon is access all Gtk_Status_Icon_Record'Class; 
  69.  
  70.    ------------------ 
  71.    -- Constructors -- 
  72.    ------------------ 
  73.  
  74.    procedure Gtk_New (Status_Icon : out Gtk_Status_Icon); 
  75.    procedure Initialize 
  76.       (Status_Icon : not null access Gtk_Status_Icon_Record'Class); 
  77.    --  Creates an empty status icon object. 
  78.    --  Since: gtk+ 2.10 
  79.  
  80.    function Gtk_Status_Icon_New return Gtk_Status_Icon; 
  81.    --  Creates an empty status icon object. 
  82.    --  Since: gtk+ 2.10 
  83.  
  84.    procedure Gtk_New_From_File 
  85.       (Status_Icon : out Gtk_Status_Icon; 
  86.        Filename    : UTF8_String); 
  87.    procedure Initialize_From_File 
  88.       (Status_Icon : not null access Gtk_Status_Icon_Record'Class; 
  89.        Filename    : UTF8_String); 
  90.    --  Creates a status icon displaying the file Filename. 
  91.    --  The image will be scaled down to fit in the available space in the 
  92.    --  notification area, if necessary. 
  93.    --  Since: gtk+ 2.10 
  94.    --  "filename": a filename 
  95.  
  96.    function Gtk_Status_Icon_New_From_File 
  97.       (Filename : UTF8_String) return Gtk_Status_Icon; 
  98.    --  Creates a status icon displaying the file Filename. 
  99.    --  The image will be scaled down to fit in the available space in the 
  100.    --  notification area, if necessary. 
  101.    --  Since: gtk+ 2.10 
  102.    --  "filename": a filename 
  103.  
  104.    procedure Gtk_New_From_Gicon 
  105.       (Status_Icon : out Gtk_Status_Icon; 
  106.        Icon        : Glib.G_Icon.G_Icon); 
  107.    procedure Initialize_From_Gicon 
  108.       (Status_Icon : not null access Gtk_Status_Icon_Record'Class; 
  109.        Icon        : Glib.G_Icon.G_Icon); 
  110.    --  Creates a status icon displaying a Glib.G_Icon.G_Icon. If the icon is a 
  111.    --  themed icon, it will be updated when the theme changes. 
  112.    --  Since: gtk+ 2.14 
  113.    --  "icon": a Glib.G_Icon.G_Icon 
  114.  
  115.    function Gtk_Status_Icon_New_From_Gicon 
  116.       (Icon : Glib.G_Icon.G_Icon) return Gtk_Status_Icon; 
  117.    --  Creates a status icon displaying a Glib.G_Icon.G_Icon. If the icon is a 
  118.    --  themed icon, it will be updated when the theme changes. 
  119.    --  Since: gtk+ 2.14 
  120.    --  "icon": a Glib.G_Icon.G_Icon 
  121.  
  122.    procedure Gtk_New_From_Icon_Name 
  123.       (Status_Icon : out Gtk_Status_Icon; 
  124.        Icon_Name   : UTF8_String); 
  125.    procedure Initialize_From_Icon_Name 
  126.       (Status_Icon : not null access Gtk_Status_Icon_Record'Class; 
  127.        Icon_Name   : UTF8_String); 
  128.    --  Creates a status icon displaying an icon from the current icon theme. 
  129.    --  If the current icon theme is changed, the icon will be updated 
  130.    --  appropriately. 
  131.    --  Since: gtk+ 2.10 
  132.    --  "icon_name": an icon name 
  133.  
  134.    function Gtk_Status_Icon_New_From_Icon_Name 
  135.       (Icon_Name : UTF8_String) return Gtk_Status_Icon; 
  136.    --  Creates a status icon displaying an icon from the current icon theme. 
  137.    --  If the current icon theme is changed, the icon will be updated 
  138.    --  appropriately. 
  139.    --  Since: gtk+ 2.10 
  140.    --  "icon_name": an icon name 
  141.  
  142.    procedure Gtk_New_From_Pixbuf 
  143.       (Status_Icon : out Gtk_Status_Icon; 
  144.        Pixbuf      : not null access Gdk.Pixbuf.Gdk_Pixbuf_Record'Class); 
  145.    procedure Initialize_From_Pixbuf 
  146.       (Status_Icon : not null access Gtk_Status_Icon_Record'Class; 
  147.        Pixbuf      : not null access Gdk.Pixbuf.Gdk_Pixbuf_Record'Class); 
  148.    --  Creates a status icon displaying Pixbuf. 
  149.    --  The image will be scaled down to fit in the available space in the 
  150.    --  notification area, if necessary. 
  151.    --  Since: gtk+ 2.10 
  152.    --  "pixbuf": a Gdk.Pixbuf.Gdk_Pixbuf 
  153.  
  154.    function Gtk_Status_Icon_New_From_Pixbuf 
  155.       (Pixbuf : not null access Gdk.Pixbuf.Gdk_Pixbuf_Record'Class) 
  156.        return Gtk_Status_Icon; 
  157.    --  Creates a status icon displaying Pixbuf. 
  158.    --  The image will be scaled down to fit in the available space in the 
  159.    --  notification area, if necessary. 
  160.    --  Since: gtk+ 2.10 
  161.    --  "pixbuf": a Gdk.Pixbuf.Gdk_Pixbuf 
  162.  
  163.    procedure Gtk_New_From_Stock 
  164.       (Status_Icon : out Gtk_Status_Icon; 
  165.        Stock_Id    : UTF8_String); 
  166.    procedure Initialize_From_Stock 
  167.       (Status_Icon : not null access Gtk_Status_Icon_Record'Class; 
  168.        Stock_Id    : UTF8_String); 
  169.    --  Creates a status icon displaying a stock icon. Sample stock icon names 
  170.    --  are GTK_STOCK_OPEN, GTK_STOCK_QUIT. You can register your own stock icon 
  171.    --  names, see Gtk.Icon_Factory.Add_Default and Gtk.Icon_Factory.Add. 
  172.    --  Since: gtk+ 2.10 
  173.    --  "stock_id": a stock icon id 
  174.  
  175.    function Gtk_Status_Icon_New_From_Stock 
  176.       (Stock_Id : UTF8_String) return Gtk_Status_Icon; 
  177.    --  Creates a status icon displaying a stock icon. Sample stock icon names 
  178.    --  are GTK_STOCK_OPEN, GTK_STOCK_QUIT. You can register your own stock icon 
  179.    --  names, see Gtk.Icon_Factory.Add_Default and Gtk.Icon_Factory.Add. 
  180.    --  Since: gtk+ 2.10 
  181.    --  "stock_id": a stock icon id 
  182.  
  183.    function Get_Type return Glib.GType; 
  184.    pragma Import (C, Get_Type, "gtk_status_icon_get_type"); 
  185.  
  186.    ------------- 
  187.    -- Methods -- 
  188.    ------------- 
  189.  
  190.    function Get_Gicon 
  191.       (Status_Icon : not null access Gtk_Status_Icon_Record) 
  192.        return Glib.G_Icon.G_Icon; 
  193.    --  Retrieves the Glib.G_Icon.G_Icon being displayed by the 
  194.    --  Gtk.Status_Icon.Gtk_Status_Icon. The storage type of the status icon 
  195.    --  must be Gtk.Image.Image_Empty or Gtk.Image.Image_Gicon (see 
  196.    --  Gtk.Status_Icon.Get_Storage_Type). The caller of this function does not 
  197.    --  own a reference to the returned Glib.G_Icon.G_Icon. 
  198.    --  If this function fails, Icon is left unchanged; 
  199.    --  Since: gtk+ 2.14 
  200.  
  201.    procedure Set_From_Gicon 
  202.       (Status_Icon : not null access Gtk_Status_Icon_Record; 
  203.        Icon        : Glib.G_Icon.G_Icon); 
  204.    --  Makes Status_Icon display the Glib.G_Icon.G_Icon. See 
  205.    --  Gtk.Status_Icon.Gtk_New_From_Gicon for details. 
  206.    --  Since: gtk+ 2.14 
  207.    --  "icon": a GIcon 
  208.  
  209.    function Get_Has_Tooltip 
  210.       (Status_Icon : not null access Gtk_Status_Icon_Record) return Boolean; 
  211.    --  Returns the current value of the has-tooltip property. See 
  212.    --  Gtk.Status_Icon.Gtk_Status_Icon:has-tooltip for more information. 
  213.    --  Since: gtk+ 2.16 
  214.  
  215.    procedure Set_Has_Tooltip 
  216.       (Status_Icon : not null access Gtk_Status_Icon_Record; 
  217.        Has_Tooltip : Boolean); 
  218.    --  Sets the has-tooltip property on Status_Icon to Has_Tooltip. See 
  219.    --  Gtk.Status_Icon.Gtk_Status_Icon:has-tooltip for more information. 
  220.    --  Since: gtk+ 2.16 
  221.    --  "has_tooltip": whether or not Status_Icon has a tooltip 
  222.  
  223.    function Get_Icon_Name 
  224.       (Status_Icon : not null access Gtk_Status_Icon_Record) 
  225.        return UTF8_String; 
  226.    --  Gets the name of the icon being displayed by the 
  227.    --  Gtk.Status_Icon.Gtk_Status_Icon. The storage type of the status icon 
  228.    --  must be Gtk.Image.Image_Empty or Gtk.Image.Image_Icon_Name (see 
  229.    --  Gtk.Status_Icon.Get_Storage_Type). The returned string is owned by the 
  230.    --  Gtk.Status_Icon.Gtk_Status_Icon and should not be freed or modified. 
  231.    --  Since: gtk+ 2.10 
  232.  
  233.    procedure Set_From_Icon_Name 
  234.       (Status_Icon : not null access Gtk_Status_Icon_Record; 
  235.        Icon_Name   : UTF8_String); 
  236.    --  Makes Status_Icon display the icon named Icon_Name from the current 
  237.    --  icon theme. See Gtk.Status_Icon.Gtk_New_From_Icon_Name for details. 
  238.    --  Since: gtk+ 2.10 
  239.    --  "icon_name": an icon name 
  240.  
  241.    function Get_Pixbuf 
  242.       (Status_Icon : not null access Gtk_Status_Icon_Record) 
  243.        return Gdk.Pixbuf.Gdk_Pixbuf; 
  244.    --  Gets the Gdk.Pixbuf.Gdk_Pixbuf being displayed by the 
  245.    --  Gtk.Status_Icon.Gtk_Status_Icon. The storage type of the status icon 
  246.    --  must be Gtk.Image.Image_Empty or Gtk.Image.Image_Pixbuf (see 
  247.    --  Gtk.Status_Icon.Get_Storage_Type). The caller of this function does not 
  248.    --  own a reference to the returned pixbuf. 
  249.    --  Since: gtk+ 2.10 
  250.  
  251.    procedure Set_From_Pixbuf 
  252.       (Status_Icon : not null access Gtk_Status_Icon_Record; 
  253.        Pixbuf      : access Gdk.Pixbuf.Gdk_Pixbuf_Record'Class); 
  254.    --  Makes Status_Icon display Pixbuf. See 
  255.    --  Gtk.Status_Icon.Gtk_New_From_Pixbuf for details. 
  256.    --  Since: gtk+ 2.10 
  257.    --  "pixbuf": a Gdk.Pixbuf.Gdk_Pixbuf or null 
  258.  
  259.    function Get_Screen 
  260.       (Status_Icon : not null access Gtk_Status_Icon_Record) 
  261.        return Gdk.Screen.Gdk_Screen; 
  262.    --  Returns the Gdk.Screen.Gdk_Screen associated with Status_Icon. 
  263.    --  Since: gtk+ 2.12 
  264.  
  265.    procedure Set_Screen 
  266.       (Status_Icon : not null access Gtk_Status_Icon_Record; 
  267.        Screen      : not null access Gdk.Screen.Gdk_Screen_Record'Class); 
  268.    --  Sets the Gdk.Screen.Gdk_Screen where Status_Icon is displayed; if the 
  269.    --  icon is already mapped, it will be unmapped, and then remapped on the 
  270.    --  new screen. 
  271.    --  Since: gtk+ 2.12 
  272.    --  "screen": a Gdk.Screen.Gdk_Screen 
  273.  
  274.    function Get_Size 
  275.       (Status_Icon : not null access Gtk_Status_Icon_Record) return Gint; 
  276.    --  Gets the size in pixels that is available for the image. Stock icons 
  277.    --  and named icons adapt their size automatically if the size of the 
  278.    --  notification area changes. For other storage types, the size-changed 
  279.    --  signal can be used to react to size changes. 
  280.    --  Note that the returned size is only meaningful while the status icon is 
  281.    --  embedded (see Gtk.Status_Icon.Is_Embedded). 
  282.    --  Since: gtk+ 2.10 
  283.  
  284.    function Get_Stock 
  285.       (Status_Icon : not null access Gtk_Status_Icon_Record) 
  286.        return UTF8_String; 
  287.    --  Gets the id of the stock icon being displayed by the 
  288.    --  Gtk.Status_Icon.Gtk_Status_Icon. The storage type of the status icon 
  289.    --  must be Gtk.Image.Image_Empty or Gtk.Image.Image_Stock (see 
  290.    --  Gtk.Status_Icon.Get_Storage_Type). The returned string is owned by the 
  291.    --  Gtk.Status_Icon.Gtk_Status_Icon and should not be freed or modified. 
  292.    --  Since: gtk+ 2.10 
  293.  
  294.    procedure Set_From_Stock 
  295.       (Status_Icon : not null access Gtk_Status_Icon_Record; 
  296.        Stock_Id    : UTF8_String); 
  297.    --  Makes Status_Icon display the stock icon with the id Stock_Id. See 
  298.    --  Gtk.Status_Icon.Gtk_New_From_Stock for details. 
  299.    --  Since: gtk+ 2.10 
  300.    --  "stock_id": a stock icon id 
  301.  
  302.    function Get_Storage_Type 
  303.       (Status_Icon : not null access Gtk_Status_Icon_Record) 
  304.        return Gtk.Image.Gtk_Image_Type; 
  305.    --  Gets the type of representation being used by the 
  306.    --  Gtk.Status_Icon.Gtk_Status_Icon to store image data. If the 
  307.    --  Gtk.Status_Icon.Gtk_Status_Icon has no image data, the return value will 
  308.    --  be Gtk.Image.Image_Empty. 
  309.    --  Since: gtk+ 2.10 
  310.  
  311.    function Get_Title 
  312.       (Status_Icon : not null access Gtk_Status_Icon_Record) 
  313.        return UTF8_String; 
  314.    --  Gets the title of this tray icon. See Gtk.Status_Icon.Set_Title. 
  315.    --  Since: gtk+ 2.18 
  316.  
  317.    procedure Set_Title 
  318.       (Status_Icon : not null access Gtk_Status_Icon_Record; 
  319.        Title       : UTF8_String); 
  320.    --  Sets the title of this tray icon. This should be a short, 
  321.    --  human-readable, localized string describing the tray icon. It may be 
  322.    --  used by tools like screen readers to render the tray icon. 
  323.    --  Since: gtk+ 2.18 
  324.    --  "title": the title 
  325.  
  326.    function Get_Tooltip_Markup 
  327.       (Status_Icon : not null access Gtk_Status_Icon_Record) 
  328.        return UTF8_String; 
  329.    --  Gets the contents of the tooltip for Status_Icon. 
  330.    --  Since: gtk+ 2.16 
  331.  
  332.    procedure Set_Tooltip_Markup 
  333.       (Status_Icon : not null access Gtk_Status_Icon_Record; 
  334.        Markup      : UTF8_String := ""); 
  335.    --  Sets Markup as the contents of the tooltip, which is marked up with the 
  336.    --  <link linkend="PangoMarkupFormat">Pango text markup language</link>. 
  337.    --  This function will take care of setting 
  338.    --  Gtk.Status_Icon.Gtk_Status_Icon:has-tooltip to True and of the default 
  339.    --  handler for the Gtk.Status_Icon.Gtk_Status_Icon::query-tooltip signal. 
  340.    --  See also the Gtk.Status_Icon.Gtk_Status_Icon:tooltip-markup property 
  341.    --  and Gtk.Tooltip.Set_Markup. 
  342.    --  Since: gtk+ 2.16 
  343.    --  "markup": the contents of the tooltip for Status_Icon, or null 
  344.  
  345.    function Get_Tooltip_Text 
  346.       (Status_Icon : not null access Gtk_Status_Icon_Record) 
  347.        return UTF8_String; 
  348.    --  Gets the contents of the tooltip for Status_Icon. 
  349.    --  Since: gtk+ 2.16 
  350.  
  351.    procedure Set_Tooltip_Text 
  352.       (Status_Icon : not null access Gtk_Status_Icon_Record; 
  353.        Text        : UTF8_String); 
  354.    --  Sets Text as the contents of the tooltip. 
  355.    --  This function will take care of setting 
  356.    --  Gtk.Status_Icon.Gtk_Status_Icon:has-tooltip to True and of the default 
  357.    --  handler for the Gtk.Status_Icon.Gtk_Status_Icon::query-tooltip signal. 
  358.    --  See also the Gtk.Status_Icon.Gtk_Status_Icon:tooltip-text property and 
  359.    --  Gtk.Tooltip.Set_Text. 
  360.    --  Since: gtk+ 2.16 
  361.    --  "text": the contents of the tooltip for Status_Icon 
  362.  
  363.    function Get_Visible 
  364.       (Status_Icon : not null access Gtk_Status_Icon_Record) return Boolean; 
  365.    --  Returns whether the status icon is visible or not. Note that being 
  366.    --  visible does not guarantee that the user can actually see the icon, see 
  367.    --  also Gtk.Status_Icon.Is_Embedded. 
  368.    --  Since: gtk+ 2.10 
  369.  
  370.    procedure Set_Visible 
  371.       (Status_Icon : not null access Gtk_Status_Icon_Record; 
  372.        Visible     : Boolean); 
  373.    --  Shows or hides a status icon. 
  374.    --  Since: gtk+ 2.10 
  375.    --  "visible": True to show the status icon, False to hide it 
  376.  
  377.    function Get_X11_Window_Id 
  378.       (Status_Icon : not null access Gtk_Status_Icon_Record) return Guint32; 
  379.    --  This function is only useful on the X11/freedesktop.org platform. It 
  380.    --  returns a window ID for the widget in the underlying status icon 
  381.    --  implementation. This is useful for the Galago notification service, 
  382.    --  which can send a window ID in the protocol in order for the server to 
  383.    --  position notification windows pointing to a status icon reliably. 
  384.    --  This function is not intended for other use cases which are more likely 
  385.    --  to be met by one of the non-X11 specific methods, such as 
  386.    --  Gtk.Status_Icon.Position_Menu. 
  387.    --  Since: gtk+ 2.14 
  388.  
  389.    function Is_Embedded 
  390.       (Status_Icon : not null access Gtk_Status_Icon_Record) return Boolean; 
  391.    --  Returns whether the status icon is embedded in a notification area. 
  392.    --  Since: gtk+ 2.10 
  393.  
  394.    procedure Set_From_File 
  395.       (Status_Icon : not null access Gtk_Status_Icon_Record; 
  396.        Filename    : UTF8_String); 
  397.    --  Makes Status_Icon display the file Filename. See 
  398.    --  Gtk.Status_Icon.Gtk_New_From_File for details. 
  399.    --  Since: gtk+ 2.10 
  400.    --  "filename": a filename 
  401.  
  402.    procedure Set_Name 
  403.       (Status_Icon : not null access Gtk_Status_Icon_Record; 
  404.        Name        : UTF8_String); 
  405.    --  Sets the name of this tray icon. This should be a string identifying 
  406.    --  this icon. It is may be used for sorting the icons in the tray and will 
  407.    --  not be shown to the user. 
  408.    --  Since: gtk+ 2.20 
  409.    --  "name": the name 
  410.  
  411.    --------------- 
  412.    -- Functions -- 
  413.    --------------- 
  414.  
  415.    procedure Position_Menu 
  416.       (Menu    : not null access Gtk.Menu.Gtk_Menu_Record'Class; 
  417.        X       : in out Gint; 
  418.        Y       : in out Gint; 
  419.        Push_In : out Boolean; 
  420.        Icon    : Glib.Object.GObject); 
  421.    --  Menu positioning function to use with Gtk.Menu.Popup to position Menu 
  422.    --  aligned to the status icon User_Data. 
  423.    --  Since: gtk+ 2.10 
  424.    --  "menu": the Gtk.Menu.Gtk_Menu 
  425.    --  "x": return location for the x position 
  426.    --  "y": return location for the y position 
  427.    --  "push_in": whether the first menu item should be offset (pushed in) to 
  428.    --  be aligned with the menu popup position (only useful for GtkOptionMenu). 
  429.    --  "Icon": the status icon to position the menu on 
  430.  
  431.    ---------------- 
  432.    -- Properties -- 
  433.    ---------------- 
  434.    --  The following properties are defined for this widget. See 
  435.    --  Glib.Properties for more information on properties) 
  436.  
  437.    Embedded_Property : constant Glib.Properties.Property_Boolean; 
  438.    --  True if the statusicon is embedded in a notification area. 
  439.  
  440.    File_Property : constant Glib.Properties.Property_String; 
  441.    --  Flags: write 
  442.  
  443.    G_Icon_Property : constant Glib.Properties.Property_Boxed; 
  444.    --  Type: Glib.G_Icon.G_Icon 
  445.    --  The Glib.G_Icon.G_Icon displayed in the 
  446.    --  Gtk.Status_Icon.Gtk_Status_Icon. For themed icons, the image will be 
  447.    --  updated automatically if the theme changes. 
  448.  
  449.    Has_Tooltip_Property : constant Glib.Properties.Property_Boolean; 
  450.    --  Enables or disables the emission of 
  451.    --  Gtk.Status_Icon.Gtk_Status_Icon::query-tooltip on Status_Icon. A value 
  452.    --  of True indicates that Status_Icon can have a tooltip, in this case the 
  453.    --  status icon will be queried using 
  454.    --  Gtk.Status_Icon.Gtk_Status_Icon::query-tooltip to determine whether it 
  455.    --  will provide a tooltip or not. 
  456.    -- 
  457.    --  Note that setting this property to True for the first time will change 
  458.    --  the event masks of the windows of this status icon to include 
  459.    --  leave-notify and motion-notify events. This will not be undone when the 
  460.    --  property is set to False again. 
  461.    -- 
  462.    --  Whether this property is respected is platform dependent. For plain 
  463.    --  text tooltips, use Gtk.Status_Icon.Gtk_Status_Icon:tooltip-text in 
  464.    --  preference. 
  465.  
  466.    Icon_Name_Property : constant Glib.Properties.Property_String; 
  467.  
  468.    Orientation_Property : constant Gtk.Enums.Property_Gtk_Orientation; 
  469.    --  The orientation of the tray in which the statusicon is embedded. 
  470.  
  471.    Pixbuf_Property : constant Glib.Properties.Property_Object; 
  472.    --  Type: Gdk.Pixbuf.Gdk_Pixbuf 
  473.  
  474.    Screen_Property : constant Glib.Properties.Property_Object; 
  475.    --  Type: Gdk.Screen.Gdk_Screen 
  476.  
  477.    Size_Property : constant Glib.Properties.Property_Int; 
  478.  
  479.    Stock_Property : constant Glib.Properties.Property_String; 
  480.  
  481.    Storage_Type_Property : constant Gtk.Image.Property_Gtk_Image_Type; 
  482.    --  Type: Gtk.Image.Gtk_Image_Type 
  483.  
  484.    Title_Property : constant Glib.Properties.Property_String; 
  485.    --  The title of this tray icon. This should be a short, human-readable, 
  486.    --  localized string describing the tray icon. It may be used by tools like 
  487.    --  screen readers to render the tray icon. 
  488.  
  489.    Tooltip_Markup_Property : constant Glib.Properties.Property_String; 
  490.    --  Sets the text of tooltip to be the given string, which is marked up 
  491.    --  with the <link linkend="PangoMarkupFormat">Pango text markup 
  492.    --  language</link>. Also see Gtk.Tooltip.Set_Markup. 
  493.    -- 
  494.    --  This is a convenience property which will take care of getting the 
  495.    --  tooltip shown if the given string is not null. 
  496.    --  Gtk.Status_Icon.Gtk_Status_Icon:has-tooltip will automatically be set to 
  497.    --  True and the default handler for the 
  498.    --  Gtk.Status_Icon.Gtk_Status_Icon::query-tooltip signal will take care of 
  499.    --  displaying the tooltip. 
  500.    -- 
  501.    --  On some platforms, embedded markup will be ignored. 
  502.  
  503.    Tooltip_Text_Property : constant Glib.Properties.Property_String; 
  504.    --  Sets the text of tooltip to be the given string. 
  505.    -- 
  506.    --  Also see Gtk.Tooltip.Set_Text. 
  507.    -- 
  508.    --  This is a convenience property which will take care of getting the 
  509.    --  tooltip shown if the given string is not null. 
  510.    --  Gtk.Status_Icon.Gtk_Status_Icon:has-tooltip will automatically be set to 
  511.    --  True and the default handler for the 
  512.    --  Gtk.Status_Icon.Gtk_Status_Icon::query-tooltip signal will take care of 
  513.    --  displaying the tooltip. 
  514.    -- 
  515.    --  Note that some platforms have limitations on the length of tooltips 
  516.    --  that they allow on status icons, e.g. Windows only shows the first 64 
  517.    --  characters. 
  518.  
  519.    Visible_Property : constant Glib.Properties.Property_Boolean; 
  520.  
  521.    ------------- 
  522.    -- Signals -- 
  523.    ------------- 
  524.  
  525.    type Cb_Gtk_Status_Icon_Void is not null access procedure 
  526.      (Self : access Gtk_Status_Icon_Record'Class); 
  527.  
  528.    type Cb_GObject_Void is not null access procedure 
  529.      (Self : access Glib.Object.GObject_Record'Class); 
  530.  
  531.    Signal_Activate : constant Glib.Signal_Name := "activate"; 
  532.    procedure On_Activate 
  533.       (Self  : not null access Gtk_Status_Icon_Record; 
  534.        Call  : Cb_Gtk_Status_Icon_Void; 
  535.        After : Boolean := False); 
  536.    procedure On_Activate 
  537.       (Self  : not null access Gtk_Status_Icon_Record; 
  538.        Call  : Cb_GObject_Void; 
  539.        Slot  : not null access Glib.Object.GObject_Record'Class; 
  540.        After : Boolean := False); 
  541.    --  Gets emitted when the user activates the status icon. If and how status 
  542.    --  icons can activated is platform-dependent. 
  543.    -- 
  544.    --  Unlike most G_SIGNAL_ACTION signals, this signal is meant to be used by 
  545.    --  applications and should be wrapped by language bindings. 
  546.  
  547.    type Cb_Gtk_Status_Icon_Gdk_Event_Button_Boolean is not null access function 
  548.      (Self  : access Gtk_Status_Icon_Record'Class; 
  549.       Event : Gdk.Event.Gdk_Event_Button) return Boolean; 
  550.  
  551.    type Cb_GObject_Gdk_Event_Button_Boolean is not null access function 
  552.      (Self  : access Glib.Object.GObject_Record'Class; 
  553.       Event : Gdk.Event.Gdk_Event_Button) return Boolean; 
  554.  
  555.    Signal_Button_Press_Event : constant Glib.Signal_Name := "button-press-event"; 
  556.    procedure On_Button_Press_Event 
  557.       (Self  : not null access Gtk_Status_Icon_Record; 
  558.        Call  : Cb_Gtk_Status_Icon_Gdk_Event_Button_Boolean; 
  559.        After : Boolean := False); 
  560.    procedure On_Button_Press_Event 
  561.       (Self  : not null access Gtk_Status_Icon_Record; 
  562.        Call  : Cb_GObject_Gdk_Event_Button_Boolean; 
  563.        Slot  : not null access Glib.Object.GObject_Record'Class; 
  564.        After : Boolean := False); 
  565.    --  The ::button-press-event signal will be emitted when a button 
  566.    --  (typically from a mouse) is pressed. 
  567.    -- 
  568.    --  Whether this event is emitted is platform-dependent. Use the ::activate 
  569.    --  and ::popup-menu signals in preference. 
  570.    --  
  571.    --  Callback parameters: 
  572.    --    --  "event": the Gdk.Event.Gdk_Event_Button which triggered this signal 
  573.    --    --  Returns True to stop other handlers from being invoked for the event. False to propagate the event further. 
  574.  
  575.    Signal_Button_Release_Event : constant Glib.Signal_Name := "button-release-event"; 
  576.    procedure On_Button_Release_Event 
  577.       (Self  : not null access Gtk_Status_Icon_Record; 
  578.        Call  : Cb_Gtk_Status_Icon_Gdk_Event_Button_Boolean; 
  579.        After : Boolean := False); 
  580.    procedure On_Button_Release_Event 
  581.       (Self  : not null access Gtk_Status_Icon_Record; 
  582.        Call  : Cb_GObject_Gdk_Event_Button_Boolean; 
  583.        Slot  : not null access Glib.Object.GObject_Record'Class; 
  584.        After : Boolean := False); 
  585.    --  The ::button-release-event signal will be emitted when a button 
  586.    --  (typically from a mouse) is released. 
  587.    -- 
  588.    --  Whether this event is emitted is platform-dependent. Use the ::activate 
  589.    --  and ::popup-menu signals in preference. 
  590.    --  
  591.    --  Callback parameters: 
  592.    --    --  "event": the Gdk.Event.Gdk_Event_Button which triggered this signal 
  593.    --    --  Returns True to stop other handlers from being invoked for the event. False to propagate the event further. 
  594.  
  595.    type Cb_Gtk_Status_Icon_Guint_Guint_Void is not null access procedure 
  596.      (Self          : access Gtk_Status_Icon_Record'Class; 
  597.       Button        : Guint; 
  598.       Activate_Time : Guint); 
  599.  
  600.    type Cb_GObject_Guint_Guint_Void is not null access procedure 
  601.      (Self          : access Glib.Object.GObject_Record'Class; 
  602.       Button        : Guint; 
  603.       Activate_Time : Guint); 
  604.  
  605.    Signal_Popup_Menu : constant Glib.Signal_Name := "popup-menu"; 
  606.    procedure On_Popup_Menu 
  607.       (Self  : not null access Gtk_Status_Icon_Record; 
  608.        Call  : Cb_Gtk_Status_Icon_Guint_Guint_Void; 
  609.        After : Boolean := False); 
  610.    procedure On_Popup_Menu 
  611.       (Self  : not null access Gtk_Status_Icon_Record; 
  612.        Call  : Cb_GObject_Guint_Guint_Void; 
  613.        Slot  : not null access Glib.Object.GObject_Record'Class; 
  614.        After : Boolean := False); 
  615.    --  Gets emitted when the user brings up the context menu of the status 
  616.    --  icon. Whether status icons can have context menus and how these are 
  617.    --  activated is platform-dependent. 
  618.    -- 
  619.    --  The Button and Activate_Time parameters should be passed as the last to 
  620.    --  arguments to Gtk.Menu.Popup. 
  621.    -- 
  622.    --  Unlike most G_SIGNAL_ACTION signals, this signal is meant to be used by 
  623.    --  applications and should be wrapped by language bindings. 
  624.    --  
  625.    --  Callback parameters: 
  626.    --    --  "button": the button that was pressed, or 0 if the signal is not 
  627.    --    --  emitted in response to a button press event 
  628.    --    --  "activate_time": the timestamp of the event that triggered the signal 
  629.    --    --  emission 
  630.  
  631.    type Cb_Gtk_Status_Icon_Gint_Gint_Boolean_Gtk_Tooltip_Boolean is not null access function 
  632.      (Self          : access Gtk_Status_Icon_Record'Class; 
  633.       X             : Gint; 
  634.       Y             : Gint; 
  635.       Keyboard_Mode : Boolean; 
  636.       Tooltip       : not null access Gtk.Tooltip.Gtk_Tooltip_Record'Class) 
  637.    return Boolean; 
  638.  
  639.    type Cb_GObject_Gint_Gint_Boolean_Gtk_Tooltip_Boolean is not null access function 
  640.      (Self          : access Glib.Object.GObject_Record'Class; 
  641.       X             : Gint; 
  642.       Y             : Gint; 
  643.       Keyboard_Mode : Boolean; 
  644.       Tooltip       : not null access Gtk.Tooltip.Gtk_Tooltip_Record'Class) 
  645.    return Boolean; 
  646.  
  647.    Signal_Query_Tooltip : constant Glib.Signal_Name := "query-tooltip"; 
  648.    procedure On_Query_Tooltip 
  649.       (Self  : not null access Gtk_Status_Icon_Record; 
  650.        Call  : Cb_Gtk_Status_Icon_Gint_Gint_Boolean_Gtk_Tooltip_Boolean; 
  651.        After : Boolean := False); 
  652.    procedure On_Query_Tooltip 
  653.       (Self  : not null access Gtk_Status_Icon_Record; 
  654.        Call  : Cb_GObject_Gint_Gint_Boolean_Gtk_Tooltip_Boolean; 
  655.        Slot  : not null access Glib.Object.GObject_Record'Class; 
  656.        After : Boolean := False); 
  657.    --  Emitted when the Gtk.Settings.Gtk_Settings:gtk-tooltip-timeout has 
  658.    --  expired with the cursor hovering above Status_Icon; or emitted when 
  659.    --  Status_Icon got focus in keyboard mode. 
  660.    -- 
  661.    --  Using the given coordinates, the signal handler should determine 
  662.    --  whether a tooltip should be shown for Status_Icon. If this is the case 
  663.    --  True should be returned, False otherwise. Note that if Keyboard_Mode is 
  664.    --  True, the values of X and Y are undefined and should not be used. 
  665.    -- 
  666.    --  The signal handler is free to manipulate Tooltip with the therefore 
  667.    --  destined function calls. 
  668.    -- 
  669.    --  Whether this signal is emitted is platform-dependent. For plain text 
  670.    --  tooltips, use Gtk.Status_Icon.Gtk_Status_Icon:tooltip-text in 
  671.    --  preference. 
  672.    --  
  673.    --  Callback parameters: 
  674.    --    --  "x": the x coordinate of the cursor position where the request has been 
  675.    --    --  emitted, relative to Status_Icon 
  676.    --    --  "y": the y coordinate of the cursor position where the request has been 
  677.    --    --  emitted, relative to Status_Icon 
  678.    --    --  "keyboard_mode": True if the tooltip was trigged using the keyboard 
  679.    --    --  "tooltip": a Gtk.Tooltip.Gtk_Tooltip 
  680.    --    --  Returns True if Tooltip should be shown right now, False otherwise. 
  681.  
  682.    type Cb_Gtk_Status_Icon_Gdk_Event_Scroll_Boolean is not null access function 
  683.      (Self  : access Gtk_Status_Icon_Record'Class; 
  684.       Event : Gdk.Event.Gdk_Event_Scroll) return Boolean; 
  685.  
  686.    type Cb_GObject_Gdk_Event_Scroll_Boolean is not null access function 
  687.      (Self  : access Glib.Object.GObject_Record'Class; 
  688.       Event : Gdk.Event.Gdk_Event_Scroll) return Boolean; 
  689.  
  690.    Signal_Scroll_Event : constant Glib.Signal_Name := "scroll-event"; 
  691.    procedure On_Scroll_Event 
  692.       (Self  : not null access Gtk_Status_Icon_Record; 
  693.        Call  : Cb_Gtk_Status_Icon_Gdk_Event_Scroll_Boolean; 
  694.        After : Boolean := False); 
  695.    procedure On_Scroll_Event 
  696.       (Self  : not null access Gtk_Status_Icon_Record; 
  697.        Call  : Cb_GObject_Gdk_Event_Scroll_Boolean; 
  698.        Slot  : not null access Glib.Object.GObject_Record'Class; 
  699.        After : Boolean := False); 
  700.    --  The ::scroll-event signal is emitted when a button in the 4 to 7 range 
  701.    --  is pressed. Wheel mice are usually configured to generate button press 
  702.    --  events for buttons 4 and 5 when the wheel is turned. 
  703.    -- 
  704.    --  Whether this event is emitted is platform-dependent. 
  705.    --  
  706.    --  Callback parameters: 
  707.    --    --  "event": the Gdk.Event.Gdk_Event_Scroll which triggered this signal 
  708.    --    --  Returns True to stop other handlers from being invoked for the event. False to propagate the event further. 
  709.  
  710.    type Cb_Gtk_Status_Icon_Gint_Boolean is not null access function 
  711.      (Self : access Gtk_Status_Icon_Record'Class; 
  712.       Size : Gint) return Boolean; 
  713.  
  714.    type Cb_GObject_Gint_Boolean is not null access function 
  715.      (Self : access Glib.Object.GObject_Record'Class; 
  716.       Size : Gint) return Boolean; 
  717.  
  718.    Signal_Size_Changed : constant Glib.Signal_Name := "size-changed"; 
  719.    procedure On_Size_Changed 
  720.       (Self  : not null access Gtk_Status_Icon_Record; 
  721.        Call  : Cb_Gtk_Status_Icon_Gint_Boolean; 
  722.        After : Boolean := False); 
  723.    procedure On_Size_Changed 
  724.       (Self  : not null access Gtk_Status_Icon_Record; 
  725.        Call  : Cb_GObject_Gint_Boolean; 
  726.        Slot  : not null access Glib.Object.GObject_Record'Class; 
  727.        After : Boolean := False); 
  728.    --  Gets emitted when the size available for the image changes, e.g. 
  729.    --  because the notification area got resized. 
  730.    --  
  731.    --  Callback parameters: 
  732.    --    --  "size": the new size 
  733.    --    --  Returns True if the icon was updated for the new size. Otherwise, GTK+ will scale the icon as necessary. 
  734.  
  735. private 
  736.    Visible_Property : constant Glib.Properties.Property_Boolean := 
  737.      Glib.Properties.Build ("visible"); 
  738.    Tooltip_Text_Property : constant Glib.Properties.Property_String := 
  739.      Glib.Properties.Build ("tooltip-text"); 
  740.    Tooltip_Markup_Property : constant Glib.Properties.Property_String := 
  741.      Glib.Properties.Build ("tooltip-markup"); 
  742.    Title_Property : constant Glib.Properties.Property_String := 
  743.      Glib.Properties.Build ("title"); 
  744.    Storage_Type_Property : constant Gtk.Image.Property_Gtk_Image_Type := 
  745.      Gtk.Image.Build ("storage-type"); 
  746.    Stock_Property : constant Glib.Properties.Property_String := 
  747.      Glib.Properties.Build ("stock"); 
  748.    Size_Property : constant Glib.Properties.Property_Int := 
  749.      Glib.Properties.Build ("size"); 
  750.    Screen_Property : constant Glib.Properties.Property_Object := 
  751.      Glib.Properties.Build ("screen"); 
  752.    Pixbuf_Property : constant Glib.Properties.Property_Object := 
  753.      Glib.Properties.Build ("pixbuf"); 
  754.    Orientation_Property : constant Gtk.Enums.Property_Gtk_Orientation := 
  755.      Gtk.Enums.Build ("orientation"); 
  756.    Icon_Name_Property : constant Glib.Properties.Property_String := 
  757.      Glib.Properties.Build ("icon-name"); 
  758.    Has_Tooltip_Property : constant Glib.Properties.Property_Boolean := 
  759.      Glib.Properties.Build ("has-tooltip"); 
  760.    G_Icon_Property : constant Glib.Properties.Property_Boxed := 
  761.      Glib.Properties.Build ("gicon"); 
  762.    File_Property : constant Glib.Properties.Property_String := 
  763.      Glib.Properties.Build ("file"); 
  764.    Embedded_Property : constant Glib.Properties.Property_Boolean := 
  765.      Glib.Properties.Build ("embedded"); 
  766. end Gtk.Status_Icon;