home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / pmos2002.zip / DEF / TILES.DEF < prev    next >
Text File  |  1995-02-11  |  3KB  |  88 lines

  1. DEFINITION MODULE Tiles;
  2.  
  3.     (********************************************************)
  4.     (*                            *)
  5.     (*        Support module for screen graphics        *)
  6.     (*                            *)
  7.     (*  Programmer:        P. Moylan            *)
  8.     (*  Last edited:    11 February 1995        *)
  9.     (*  Status:        Working                *)
  10.     (*                            *)
  11.     (*    NOTE: This is a support module for GWindows,    *)
  12.     (*    and is not intended to be called directly by    *)
  13.     (*    applications programs.  It does not contain    *)
  14.     (*    all of the data validity checks which the    *)
  15.     (*    end-user procedures perform.            *)
  16.     (*                            *)
  17.     (********************************************************)
  18.  
  19. FROM ScreenGeometry IMPORT
  20.     (* type *)    Point, Rectangle;
  21.  
  22. FROM Graphics IMPORT
  23.     (* type *)    ColourType;
  24.  
  25. TYPE
  26.     TileSet;        (* is private *)
  27.  
  28. PROCEDURE CreateTileSet (border: Rectangle;  background: ColourType): TileSet;
  29.  
  30.     (* Creates a TileSet which covers the given rectangular region.    *)
  31.     (* The second parameter specifies the background colour.        *)
  32.     (* This will usually require breaking up tiles of previously    *)
  33.     (* created TileSets, but since the caller does not have access to    *)
  34.     (* the internal structure of a TileSet this restructuring is    *)
  35.     (* transparent to the caller.                    *)
  36.  
  37. PROCEDURE DiscardTileSet (VAR (*INOUT*) T: TileSet);
  38.  
  39.     (* Destroys TileSet T.  This too might involve restructuring the    *)
  40.     (* tiling of other TileSets, but again the caller need not know    *)
  41.     (* the details.                            *)
  42.  
  43. PROCEDURE ClearTileSet (T: TileSet);
  44.  
  45.     (* Removes all points, lines, and text from T, and re-displays    *)
  46.     (* the visible parts of T.                        *)
  47.  
  48. PROCEDURE TileSetMemory (T: TileSet;  memory: BOOLEAN);
  49.  
  50.     (* Specifying a FALSE value for the memory parameter means that    *)
  51.     (* subsequent data sent to this TileSet will be written to the    *)
  52.     (* screen but not remembered.  This saves time and memory, the only    *)
  53.     (* penalty being that data covered by an overlapping TileSet will    *)
  54.     (* be lost.  Specifying TRUE restores the default condition, where    *)
  55.     (* all data are retained for refreshing the screen when necessary.    *)
  56.  
  57. PROCEDURE AddPoint (T: TileSet;  p: Point;  colour: ColourType);
  58.  
  59.     (* Adds a new point to TileSet T, and displays it on the screen.    *)
  60.  
  61. PROCEDURE AddLine (T: TileSet;  start, end: Point;  colour: ColourType);
  62.  
  63.     (* Adds a new line to TileSet T, and displays it on the screen.    *)
  64.  
  65. PROCEDURE AddRectangle (T: TileSet;  R: Rectangle;  colour: ColourType);
  66.  
  67.     (* Draws a rectangular shape.  A shorthand for four AddLine calls.    *)
  68.  
  69. PROCEDURE AddString (T: TileSet;  place: Point;
  70.             VAR (*IN*) text: ARRAY OF CHAR;
  71.             count: CARDINAL;  colour: ColourType;  R: Rectangle);
  72.  
  73.     (* Adds a string of count characters to tileset T, and displays it.    *)
  74.     (* Points outside rectangle R are not displayed.            *)
  75.  
  76. PROCEDURE AddRotatedString (T: TileSet;  place: Point;
  77.             VAR (*IN*) text: ARRAY OF CHAR;
  78.             count: CARDINAL;  colour: ColourType;  R: Rectangle);
  79.  
  80.     (* Like AddString, but writes in the +Y direction.    *)
  81.  
  82. PROCEDURE ScrollContents (TS: TileSet;  amount: INTEGER;  R: Rectangle);
  83.  
  84.     (* Moves all data within R up by "amount" rows, discarding what    *)
  85.     (* falls outside the rectangle.                    *)
  86.  
  87. END Tiles.
  88.