1. ----------------------------------------------------------------------- 
  2. --              GtkAda - Ada95 binding for Gtk+/Gnome                -- 
  3. --                                                                   -- 
  4. --                Copyright (C) 2006, 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. -- -- -- -- -- -- -- -- -- -- -- --
  22. ----------------------------------------------------------------------- 
  23.  
  24. --  <description> 
  25. --  This package provides a convenitn function to create a new graphic 
  26. --  context. Such contexts are needed in several places in GtkAda, in 
  27. --  particular for the drawing routines, and this function provides a 
  28. --  convenient way to create them. 
  29. --  </description> 
  30. --  <c_version>2.8.17</c_version> 
  31. --  <group>Miscellaneous</group> 
  32. --  <see>Gdk.GC</see> 
  33.  
  34. with Gdk.GC; 
  35.  
  36. package Gtk.GC is 
  37.  
  38.    function Get 
  39.      (Depth       : Gint; 
  40.       Colormap    : Gdk.Gdk_Colormap; 
  41.       Values      : Gdk.GC.Gdk_GC_Values; 
  42.       Values_Mask : Gdk.GC.Gdk_GC_Values_Mask) 
  43.       return Gdk_GC; 
  44.    --  Create a new GC with the matching attributes. 
  45.    --  If such a graphic context already exists, it is returned, which is much 
  46.    --  faster than creating a new one. Creating a new context requires a 
  47.    --  round-trip to the server (X11 for instance), and can be slow. 
  48.    --  You shouldn't modify the attributes of the returned context, since that 
  49.    --  might impact other parts of the code that have queried it. 
  50.  
  51.    procedure Release (Gc : Gdk_GC); 
  52.    --  Decrease the reference counting for the GC. If it reaches 0, then 
  53.    --  calling Get will create a new one the next time it is called with the 
  54.    --  same attributes. 
  55.  
  56. private 
  57.    pragma Import (C, Get, "gtk_gc_get"); 
  58.    pragma Import (C, Release, "gtk_gc_release"); 
  59. end Gtk.GC;