1. ----------------------------------------------------------------------- 
  2. --               GtkAda - Ada95 binding for Gtk+/Gnome               -- 
  3. --                                                                   -- 
  4. --   Copyright (C) 1998-2000 E. Briot, J. Brobecker and A. Charlet   -- 
  5. --                Copyright (C) 2000-2002 ACT-Europe                 -- 
  6. --                                                                   -- 
  7. -- This library is free software; you can redistribute it and/or     -- 
  8. -- modify it under the terms of the GNU General Public               -- 
  9. -- License as published by the Free Software Foundation; either      -- 
  10. -- version 2 of the License, or (at your option) any later version.  -- 
  11. --                                                                   -- 
  12. -- This library is distributed in the hope that it will be useful,   -- 
  13. -- but WITHOUT ANY WARRANTY; without even the implied warranty of    -- 
  14. -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU -- 
  15. -- General Public License for more details.                          -- 
  16. --                                                                   -- 
  17. -- You should have received a copy of the GNU General Public         -- 
  18. -- License along with this library; if not, write to the             -- 
  19. -- Free Software Foundation, Inc., 59 Temple Place - Suite 330,      -- 
  20. -- Boston, MA 02111-1307, USA.                                       -- 
  21. --                                                                   -- 
  22. -- -- -- -- -- -- -- -- -- -- -- --
  23. ----------------------------------------------------------------------- 
  24.  
  25. --  <c_version>1.3.6</c_version> 
  26. --  <group>Gdk, the low-level API</group> 
  27.  
  28. with Glib; use Glib; 
  29. with Gdk.Rectangle; 
  30. with Gdk.Types; 
  31.  
  32. package Gdk.Region is 
  33.  
  34.    subtype Gdk_Region is Gdk.Gdk_Region; 
  35.    Null_Region : constant Gdk_Region; 
  36.  
  37.    type Gdk_Fill_Rule is (Even_Odd_Rule, Winding_Rule); 
  38.    --  GC fill rule for polygons. 
  39.    pragma Convention (C, Gdk_Fill_Rule); 
  40.  
  41.    type Gdk_Overlap_Type is 
  42.      (Overlap_Rectangle_In, 
  43.       --  Rectangle is in region. 
  44.  
  45.       Overlap_Rectangle_Out, 
  46.       --  Rectangle is not in region. 
  47.  
  48.       Overlap_Rectangle_Part 
  49.       --  Rectangle is partially in region. 
  50.      ); 
  51.    --  Types of overlapping between a rectangle and a region. 
  52.    pragma Convention (C, Gdk_Overlap_Type); 
  53.  
  54.    procedure Gdk_New (Region : out Gdk_Region); 
  55.    --  Create a new region. 
  56.  
  57.    procedure Polygon 
  58.      (Region    : out Gdk_Region; 
  59.       Points    : Gdk.Types.Gdk_Points_Array; 
  60.       Fill_Rule : Gdk_Fill_Rule); 
  61.  
  62.    function Copy (Region : Gdk_Region) return Gdk_Region; 
  63.  
  64.    function Rectangle 
  65.      (Rectangle : Gdk.Rectangle.Gdk_Rectangle) return Gdk_Region; 
  66.  
  67.    procedure Destroy (Region : in out Gdk_Region); 
  68.  
  69.    procedure Get_Clipbox 
  70.      (Region    : Gdk_Region; 
  71.       Rectangle : out Gdk.Rectangle.Gdk_Rectangle); 
  72.  
  73.    procedure Get_Rectangles 
  74.      (Region       : Gdk_Region; 
  75.       Rectangle    : out Gdk.Rectangle.Gdk_Rectangle_Array; 
  76.       N_Rectangles : out Natural); 
  77.  
  78.    function Empty (Region : Gdk_Region) return Boolean; 
  79.  
  80.    function "=" (Left, Right : Gdk_Region) return Boolean; 
  81.  
  82.    function Point_In (Region : Gdk_Region; X, Y : Integer) return Boolean; 
  83.  
  84.    function Rect_In 
  85.      (Region : Gdk_Region; 
  86.       Rect   : Gdk.Rectangle.Gdk_Rectangle) return Gdk_Overlap_Type; 
  87.  
  88.    procedure Offset 
  89.      (Region : Gdk_Region; 
  90.       Dx     : Gint; 
  91.       Dy     : Gint); 
  92.  
  93.    procedure Shrink 
  94.      (Region : Gdk_Region; 
  95.       Dx     : Gint; 
  96.       Dy     : Gint); 
  97.  
  98.    procedure Union_With_Rect 
  99.      (Region : in out Gdk_Region; 
  100.       Rect   : Gdk.Rectangle.Gdk_Rectangle); 
  101.  
  102.    procedure Union_With_Rect 
  103.      (Result : in out Gdk_Region; 
  104.       Region : Gdk_Region; 
  105.       Rect   : Gdk.Rectangle.Gdk_Rectangle); 
  106.    --  Provided for backward compatibility. 
  107.    --  Region must be equal to Result. 
  108.  
  109.    procedure Intersect 
  110.      (Source1 : in out Gdk_Region; 
  111.       Source2 : Gdk_Region); 
  112.  
  113.    procedure Union 
  114.      (Source1 : in out Gdk_Region; 
  115.       Source2 : Gdk_Region); 
  116.  
  117.    procedure Substract 
  118.      (Source1 : in out Gdk_Region; 
  119.       Source2 : Gdk_Region); 
  120.  
  121.    procedure Gdk_Xor 
  122.      (Source1 : in out Gdk_Region; 
  123.       Source2 : Gdk_Region); 
  124.  
  125. private 
  126.    Null_Region : constant Gdk_Region := null; 
  127.  
  128.    pragma Import (C, Copy, "gdk_region_copy"); 
  129.    pragma Import (C, Rectangle, "gdk_region_rectangle"); 
  130.    pragma Import (C, Get_Clipbox, "gdk_region_get_clipbox"); 
  131.    pragma Import (C, Rect_In, "gdk_region_rect_in"); 
  132.    pragma Import (C, Offset, "gdk_region_offset"); 
  133.    pragma Import (C, Shrink, "gdk_region_shrink"); 
  134.    pragma Import (C, Intersect, "gdk_region_intersect"); 
  135.    pragma Import (C, Union, "gdk_region_union"); 
  136.    pragma Import (C, Substract, "gdk_region_subtract"); 
  137.    pragma Import (C, Gdk_Xor, "gdk_region_xor"); 
  138. end Gdk.Region; 
  139.  
  140. --  missing: 
  141. --  gdk_region_spans_intersect_foreach