1. ----------------------------------------------------------------------- 
  2. --               GtkAda - Ada95 binding for Gtk+/Gnome               -- 
  3. --                                                                   -- 
  4. --                Copyright (C) 2001-2002 ACT-Europe                 -- 
  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. -- 
  31. --  This package provides definitions for the error handling mechanism used in 
  32. --  Glib, Gdk and Gtk. 
  33. -- 
  34. --  </description> 
  35. --  <c_version>1.3.11</c_version> 
  36. --  <group>Glib, the general-purpose library</group> 
  37.  
  38. package Glib.Error is 
  39.    pragma Preelaborate; 
  40.  
  41.    type GError is new C_Proxy; 
  42.  
  43.    type GError_Access is access all GError; 
  44.  
  45.    function Error_New 
  46.      (Domain : GQuark; Code : Gint; Message : String) return GError; 
  47.    --  Create a new GError object. 
  48.  
  49.    procedure Error_Free (Error : GError); 
  50.    --  Free the memory associated with a GError. 
  51.  
  52.    function Error_Copy (Error : GError) return GError; 
  53.    --  Duplicate a GError object. 
  54.  
  55.    function Error_Matches 
  56.      (Error : GError; Domain : GQuark; Code : Gint) return Boolean; 
  57.    --  Return whether a given GError matches a domain/code. 
  58.  
  59.    function Get_Domain (Error : GError) return GQuark; 
  60.    --  Return the domain associated with a GError. 
  61.  
  62.    function Get_Code (Error : GError) return Gint; 
  63.    --  Return the code associated with a GError. 
  64.  
  65.    function Get_Message (Error : GError) return String; 
  66.    --  Return the message associated with a GError. 
  67.  
  68. private 
  69.  
  70.    pragma Import (C, Error_Free, "g_error_free"); 
  71.    pragma Import (C, Error_Copy, "g_error_copy"); 
  72.  
  73. end Glib.Error;