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. with System; 
  30.  
  31. package Glib.G_Icon is 
  32.  
  33.    type G_Icon is private; 
  34.    Null_G_Icon : constant G_Icon; 
  35.  
  36.    function G_Icon_Get_Type return GType; 
  37.  
  38.    function "=" (Icon1, Icon2 : G_Icon) return Boolean; 
  39.    --  Returns whether two icons are equal. 
  40.  
  41.    function Hash (Icon : G_Icon) return Guint; 
  42.    --  Returns a Guint containing a hash for the Icon, suitable for 
  43.    --  use in a GHashTable or similar data structure. 
  44.  
  45.    function To_String (Icon : G_Icon) return UTF8_String; 
  46.    --  Generates a textual representation of Icon that can be used for 
  47.    --  serialization such as when passing Icon to a different process or 
  48.    --  saving it to persistent storage. Use New_For_String to get Icon 
  49.    --  back from the returned string. 
  50.    -- 
  51.    --  The encoding of the returned string is proprietary to G_Icon except 
  52.    --  in the following two cases: 
  53.    -- 
  54.    --  If Icon is a GFileIcon, the returned string is a native path 
  55.    --  (such as "/path/to/my icon.png") without escaping if the GFile for 
  56.    --  Icon is a native file.  If the file is not native, the returned 
  57.    --  string is the result of g_file_get_uri() (such as 
  58.    --  "sftp://path/to/my%%20icon.png"). 
  59.    -- 
  60.    --  If Icon is a GThemedIcon with exactly one name, the encoding is 
  61.    --  simply the name (such as "network-server"). 
  62.  
  63.    procedure New_For_String 
  64.      (Widget : out G_Icon; 
  65.       Str    : String); 
  66.    --  Generate a G_Icon instance from Str. This function can fail if 
  67.    --  Str is not valid - see To_String for discussion.  Returns 
  68.    --  Null_G_Icon on failure. 
  69.    -- 
  70.    --  If your application or library provides one or more G_Icon 
  71.    --  implementations you need to ensure that each GType is registered 
  72.    --  with the type system prior to calling New_For_String. 
  73.  
  74. private 
  75.  
  76.    type G_Icon is new System.Address; 
  77.    Null_G_Icon : constant G_Icon := G_Icon (System.Null_Address); 
  78.  
  79. end Glib.G_Icon;