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. --  Glib.G_Icon.G_Icon is a very minimal interface for icons. It provides 
  26. --  functions for checking the equality of two icons, hashing of icons and 
  27. --  serializing an icon to and from strings. 
  28. -- 
  29. --  Glib.G_Icon.G_Icon does not provide the actual pixmap for the icon as this 
  30. --  is out of GIO's scope, however implementations of Glib.G_Icon.G_Icon may 
  31. --  contain the name of an icon (see Gthemed.Icon.Gthemed_Icon), or the path to 
  32. --  an icon (see Gloadable.Icon.Gloadable_Icon). 
  33. -- 
  34. --  To obtain a hash of a Glib.G_Icon.G_Icon, see Glib.G_Icon.Hash. 
  35. -- 
  36. --  To check if two GIcons are equal, see Glib.G_Icon.Equal. 
  37. -- 
  38. --  For serializing a Glib.G_Icon.G_Icon, use Glib.G_Icon.To_String and 
  39. --  Glib.G_Icon.New_For_String. 
  40. -- 
  41. --  If your application or library provides one or more Glib.G_Icon.G_Icon 
  42. --  implementations you need to ensure that each GType is registered with the 
  43. --  type system prior to calling Glib.G_Icon.New_For_String. 
  44. -- 
  45. --  </description> 
  46. pragma Ada_2005; 
  47.  
  48. pragma Warnings (Off, "*is already use-visible*"); 
  49. with Glib;       use Glib; 
  50. with Glib.Types; use Glib.Types; 
  51.  
  52. package Glib.G_Icon is 
  53.  
  54.    type G_Icon is new Glib.Types.GType_Interface; 
  55.    Null_G_Icon : constant G_Icon; 
  56.  
  57.    ------------------ 
  58.    -- Constructors -- 
  59.    ------------------ 
  60.  
  61.    function Get_Type return Glib.GType; 
  62.    pragma Import (C, Get_Type, "g_icon_get_type"); 
  63.  
  64.    ------------- 
  65.    -- Methods -- 
  66.    ------------- 
  67.  
  68.    function Equal (Self : G_Icon; Icon2 : G_Icon) return Boolean; 
  69.    --  Checks if two icons are equal. 
  70.    --  "icon2": pointer to the second Glib.G_Icon.G_Icon. 
  71.  
  72.    function To_String (Self : G_Icon) return UTF8_String; 
  73.    --  Generates a textual representation of Icon that can be used for 
  74.    --  serialization such as when passing Icon to a different process or saving 
  75.    --  it to persistent storage. Use Glib.G_Icon.New_For_String to get Icon 
  76.    --  back from the returned string. 
  77.    --  The encoding of the returned string is proprietary to 
  78.    --  Glib.G_Icon.G_Icon except in the following two cases 
  79.    --     * If Icon is a Gfile.Icon.Gfile_Icon, the returned string is a 
  80.    --  native path (such as '/path/to/my icon.png') without escaping if the 
  81.    --  Gfile.Gfile for Icon is a native file. If the file is not native, the 
  82.    --  returned string is the result of g_file_get_uri (such as 
  83.    --  'sftp://path/to/my%20icon.png'). 
  84.    --     * If Icon is a Gthemed.Icon.Gthemed_Icon with exactly one name, the 
  85.    --  encoding is simply the name (such as 'network-server'). 
  86.    --  Since: gtk+ 2.20 
  87.  
  88.    --------------- 
  89.    -- Functions -- 
  90.    --------------- 
  91.  
  92.    function Hash (Icon : G_Icon) return Guint; 
  93.    pragma Import (C, Hash, "g_icon_hash"); 
  94.    --  Gets a hash for an icon. 
  95.    --  "icon": gconstpointer to an icon object. 
  96.  
  97.    function New_For_String (Str : UTF8_String) return G_Icon; 
  98.    --  Generate a Glib.G_Icon.G_Icon instance from Str. This function can fail 
  99.    --  if Str is not valid - see Glib.G_Icon.To_String for discussion. 
  100.    --  If your application or library provides one or more Glib.G_Icon.G_Icon 
  101.    --  implementations you need to ensure that each GType is registered with 
  102.    --  the type system prior to calling Glib.G_Icon.New_For_String. 
  103.    --  Since: gtk+ 2.20 
  104.    --  "str": A string obtained via Glib.G_Icon.To_String. 
  105.  
  106.    ---------------- 
  107.    -- Interfaces -- 
  108.    ---------------- 
  109.    --  This class implements several interfaces. See Glib.Types 
  110.    -- 
  111.    --  - "G_Icon" 
  112.  
  113.    function "+" (W : G_Icon) return G_Icon; 
  114.    pragma Inline ("+"); 
  115.  
  116. private 
  117.  
  118. Null_G_Icon : constant G_Icon := 
  119.    G_Icon (Glib.Types.Null_Interface); 
  120. end Glib.G_Icon;