home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / pmos2002.zip / DEF / SCREENGE.DEF < prev    next >
Text File  |  1993-10-06  |  1KB  |  42 lines

  1. DEFINITION MODULE ScreenGeometry;
  2.  
  3.     (********************************************************)
  4.     (*                            *)
  5.     (*        Support module for screen graphics        *)
  6.     (*                            *)
  7.     (*  Programmer:        P. Moylan            *)
  8.     (*  Last edited:    6 October 1993            *)
  9.     (*  Status:        OK                *)
  10.     (*                            *)
  11.     (********************************************************)
  12.  
  13. TYPE
  14.     Point = RECORD
  15.         x, y: INTEGER;
  16.         END (*RECORD*);
  17.  
  18.     Rectangle =    RECORD
  19.             top, bottom, left, right: INTEGER;
  20.         END (*RECORD*);
  21.  
  22. (************************************************************************)
  23.  
  24. PROCEDURE Inside (x, y: INTEGER;  R: Rectangle): BOOLEAN;
  25.  
  26.     (* Returns TRUE iff point (x,y) is in (or on the border of) R.    *)
  27.  
  28. PROCEDURE Adjacent (R1, R2: Rectangle;
  29.                 VAR (*OUT*) union: Rectangle): BOOLEAN;
  30.  
  31.     (* If the union of R1 and R2 is itself a rectangle, returns TRUE    *)
  32.     (* and sets "union" to be the combined rectangle.  Otherwise    *)
  33.     (* returns FALSE, and the "union" result is meaningless.        *)
  34.  
  35. PROCEDURE TrimLine (VAR (*INOUT*) end1, end2: Point;  R: Rectangle): BOOLEAN;
  36.  
  37.     (* Modifies end1 and end2, if necessary, to cut off the ends of    *)
  38.     (* the line from end1 to end2 which do not fit in R.        *)
  39.     (* Returns FALSE if none of the line passes through the rectangle.    *)
  40.  
  41. END ScreenGeometry.
  42.