1. -- 
  2. -- Copyright (c) 2012 Kevin Wellwood 
  3. -- All rights reserved. 
  4. -- 
  5. -- This source code is distributed under the Modified BSD License. For terms and 
  6. -- conditions, see license.txt. 
  7. -- 
  8.  
  9. with Tiles.Matrices;                    use Tiles.Matrices; 
  10.  
  11. package Tools.Matrixbrushes is 
  12.  
  13.     type Matrixbrush is new Tool with private; 
  14.     type A_Matrixbrush is access all Matrixbrush'Class; 
  15.  
  16.     function Create_Matrixbrush( matrix  : not null A_Tile_Matrix; 
  17.                                  offsetX, 
  18.                                  offsetY : Integer ) return A_Tool; 
  19.     pragma Postcondition( Create_Matrixbrush'Result /= null ); 
  20.  
  21.     -- Returns a reference to the internal tile matrix. Do not modify it. 
  22.     function Get_Matrix( this : not null access Matrixbrush'Class ) return A_Tile_Matrix; 
  23.     pragma Postcondition( Get_Matrix'Result /= null ); 
  24.  
  25.     procedure Get_Offset( this : not null access Matrixbrush'Class; 
  26.                           x, y : out Integer ); 
  27.  
  28. private 
  29.  
  30.     type Matrixbrush is new Tool with 
  31.         record 
  32.             matrix     : A_Tile_Matrix := null; 
  33.             offsetX, 
  34.             offsetY    : Integer := 0; 
  35.             startTileX, 
  36.             startTileY, 
  37.             overTileX, 
  38.             overTileY  : Integer := -1; 
  39.         end record; 
  40.  
  41.     procedure Adjust( this : access Matrixbrush ); 
  42.  
  43.     procedure Construct( this    : access Matrixbrush; 
  44.                          matrix  : A_Tile_Matrix; 
  45.                          offsetX, 
  46.                          offsetY : Integer ); 
  47.  
  48.     procedure Delete( this : in out Matrixbrush ); 
  49.  
  50.     procedure Apply( this : access Matrixbrush; context : Tool_Context ); 
  51.  
  52.     function Get_Type( this : access Matrixbrush ) return Tool_Type; 
  53.  
  54. end Tools.Matrixbrushes;