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. -- As a special exception, if other files instantiate generics from  -- 
  23. -- this unit, or you link this unit with other files to produce an   -- 
  24. -- executable, this  unit  does not  by itself cause  the resulting  -- 
  25. -- executable to be covered by the GNU General Public License. This  -- 
  26. -- exception does not however invalidate any other reasons why the   -- 
  27. -- executable file  might be covered by the  GNU Public License.     -- 
  28. ----------------------------------------------------------------------- 
  29.  
  30. --  <c_version>1.3.6</c_version> 
  31. --  <group>Gdk, the low-level API</group> 
  32.  
  33. with Glib; use Glib; 
  34. with Gdk.Rectangle; 
  35. with Gdk.Types; 
  36.  
  37. package Gdk.Region is 
  38.  
  39.    subtype Gdk_Region is Gdk.Gdk_Region; 
  40.    Null_Region : constant Gdk_Region; 
  41.  
  42.    type Gdk_Fill_Rule is (Even_Odd_Rule, Winding_Rule); 
  43.    --  GC fill rule for polygons. 
  44.    pragma Convention (C, Gdk_Fill_Rule); 
  45.  
  46.    type Gdk_Overlap_Type is 
  47.      (Overlap_Rectangle_In, 
  48.       --  Rectangle is in region. 
  49.  
  50.       Overlap_Rectangle_Out, 
  51.       --  Rectangle is not in region. 
  52.  
  53.       Overlap_Rectangle_Part 
  54.       --  Rectangle is partially in region. 
  55.      ); 
  56.    --  Types of overlapping between a rectangle and a region. 
  57.    pragma Convention (C, Gdk_Overlap_Type); 
  58.  
  59.    procedure Gdk_New (Region : out Gdk_Region); 
  60.    --  Create a new region. 
  61.  
  62.    procedure Polygon 
  63.      (Region    : out Gdk_Region; 
  64.       Points    : Gdk.Types.Gdk_Points_Array; 
  65.       Fill_Rule : Gdk_Fill_Rule); 
  66.  
  67.    function Copy (Region : Gdk_Region) return Gdk_Region; 
  68.  
  69.    function Rectangle 
  70.      (Rectangle : Gdk.Rectangle.Gdk_Rectangle) return Gdk_Region; 
  71.  
  72.    procedure Destroy (Region : in out Gdk_Region); 
  73.  
  74.    procedure Get_Clipbox 
  75.      (Region    : Gdk_Region; 
  76.       Rectangle : out Gdk.Rectangle.Gdk_Rectangle); 
  77.  
  78.    procedure Get_Rectangles 
  79.      (Region       : Gdk_Region; 
  80.       Rectangle    : out Gdk.Rectangle.Gdk_Rectangle_Array; 
  81.       N_Rectangles : out Natural); 
  82.  
  83.    function Empty (Region : Gdk_Region) return Boolean; 
  84.  
  85.    function "=" (Left, Right : Gdk_Region) return Boolean; 
  86.  
  87.    function Point_In (Region : Gdk_Region; X, Y : Integer) return Boolean; 
  88.  
  89.    function Rect_In 
  90.      (Region : Gdk_Region; 
  91.       Rect   : Gdk.Rectangle.Gdk_Rectangle) return Gdk_Overlap_Type; 
  92.  
  93.    procedure Offset 
  94.      (Region : Gdk_Region; 
  95.       Dx     : Gint; 
  96.       Dy     : Gint); 
  97.  
  98.    procedure Shrink 
  99.      (Region : Gdk_Region; 
  100.       Dx     : Gint; 
  101.       Dy     : Gint); 
  102.  
  103.    procedure Union_With_Rect 
  104.      (Region : in out Gdk_Region; 
  105.       Rect   : Gdk.Rectangle.Gdk_Rectangle); 
  106.  
  107.    procedure Union_With_Rect 
  108.      (Result : in out Gdk_Region; 
  109.       Region : Gdk_Region; 
  110.       Rect   : Gdk.Rectangle.Gdk_Rectangle); 
  111.    --  Provided for backward compatibility. 
  112.    --  Region must be equal to Result. 
  113.  
  114.    procedure Intersect 
  115.      (Source1 : in out Gdk_Region; 
  116.       Source2 : Gdk_Region); 
  117.  
  118.    procedure Union 
  119.      (Source1 : in out Gdk_Region; 
  120.       Source2 : Gdk_Region); 
  121.  
  122.    procedure Substract 
  123.      (Source1 : in out Gdk_Region; 
  124.       Source2 : Gdk_Region); 
  125.  
  126.    procedure Gdk_Xor 
  127.      (Source1 : in out Gdk_Region; 
  128.       Source2 : Gdk_Region); 
  129.  
  130. private 
  131.    Null_Region : constant Gdk_Region := null; 
  132.  
  133.    pragma Import (C, Copy, "gdk_region_copy"); 
  134.    pragma Import (C, Rectangle, "gdk_region_rectangle"); 
  135.    pragma Import (C, Get_Clipbox, "gdk_region_get_clipbox"); 
  136.    pragma Import (C, Rect_In, "gdk_region_rect_in"); 
  137.    pragma Import (C, Offset, "gdk_region_offset"); 
  138.    pragma Import (C, Shrink, "gdk_region_shrink"); 
  139.    pragma Import (C, Intersect, "gdk_region_intersect"); 
  140.    pragma Import (C, Union, "gdk_region_union"); 
  141.    pragma Import (C, Substract, "gdk_region_subtract"); 
  142.    pragma Import (C, Gdk_Xor, "gdk_region_xor"); 
  143. end Gdk.Region; 
  144.  
  145. --  missing: 
  146. --  gdk_region_spans_intersect_foreach