home *** CD-ROM | disk | FTP | other *** search
/ Global Amiga Experience / globalamigaexperience.iso / compressed / development / clusterdemo.dms / clusterdemo.adf / Modules.lha / modules / txt / GfxDraw.def < prev    next >
Text File  |  1994-05-25  |  3KB  |  169 lines

  1. |##########|
  2. |#MAGIC   #|CLABLMHK
  3. |#PROJECT #|""
  4. |#PATHS   #|"StdProject"
  5. |#FLAGS   #|xx-x-x-xx---x-x-----------------
  6. |#USERSW  #|--------------------------------
  7. |#USERMASK#|--------------------------------
  8. |#SWITCHES#|xx---xxxxx------
  9. |##########|
  10. DEFINITION MODULE GfxDraw;
  11.  
  12. |
  13. | WB 26 May 1992 exceptions for correct and simple interface
  14. |
  15.  
  16. |
  17. | this module implements an alternative interface to drawing and areafunctions
  18. | also found in Graphics plus some more functions to ease the programming.
  19. | Rastports have been replaced by screens, thus, this a screen-only module.
  20. | Success return values have been replaced by exceptions in the failurecase.
  21. |
  22.  
  23.  
  24. FROM System    IMPORT BITSET,SHORTSET;
  25. FROM GfxScreen IMPORT Screen;
  26.  
  27. EXCEPTION
  28.  
  29.   AreaDrawFail        : "AreaDraw failed";    | Vektorliste voll
  30.   AreaEllipseFail     : "AreaEllipse failed"; |    - " -
  31.   AreaEndFail         : "AreaEnd failed";     |    - " -
  32.   AreaMoveFail        : "AreaMove failed";    | Vektorliste voll
  33.   FloodFail           : "Flood failed";
  34.   WritePixelFail      : "WritePixel failed";  | pixel außerhalb screen
  35.  
  36. TYPE
  37.  
  38.  
  39.   Point     = ARRAY [0..1] OF INTEGER;
  40.   Polygon   = ARRAY OF Point;
  41.  
  42.   DrawModes = (drawAPen,drawABPen,drawInvers);
  43.  
  44.   Pattern   = ARRAY OF CARDINAL;
  45.  
  46.  
  47.  
  48. PROCEDURE SetAPen(s : Screen;color : INTEGER);
  49.  
  50.  
  51. PROCEDURE SetBPen(s : Screen;color : INTEGER);
  52.  
  53.  
  54. PROCEDURE SetDrawMode(s : Screen;mode : DrawModes);
  55.  
  56.  
  57. PROCEDURE SetPlanes(s : Screen;plane : SHORTSET);
  58.  
  59.  
  60. PROCEDURE SetDrawPt(s : Screen;pat : CARDINAL);
  61.  
  62.  
  63. PROCEDURE SetAreaPt(s : Screen;VAR pat : Pattern);
  64.  
  65.  
  66.  
  67. PROCEDURE ClearScreen(s : Screen);
  68.  
  69.  
  70.  
  71. PROCEDURE WritePixel( s : Screen; x, y : INTEGER );
  72.  
  73.  
  74. PROCEDURE ReadPixel( s : Screen;x,y : INTEGER ): INTEGER;
  75.  
  76.  
  77.  
  78. PROCEDURE CursorX( s : Screen ): INTEGER;
  79.  
  80.  
  81. PROCEDURE CursorY( s : Screen ): INTEGER;
  82.  
  83.  
  84.  
  85. PROCEDURE Move(s : Screen;x,y : INTEGER);
  86.  
  87.  
  88. PROCEDURE MoveTo(s : Screen;dx,dy : INTEGER);
  89.  
  90.  
  91.  
  92. PROCEDURE Draw(s : Screen;x,y : INTEGER);
  93.  
  94.  
  95. PROCEDURE DrawTo(s : Screen;dx,dy : INTEGER);
  96.  
  97.  
  98.  
  99. PROCEDURE Line(s : Screen;x1,y1,x2,y2 : INTEGER);
  100.  
  101.  
  102.  
  103. PROCEDURE DrawRectangle(s : Screen;x1,y1,x2,y2 : INTEGER);
  104.  
  105.  
  106. PROCEDURE DrawPolygon(s : Screen;VAR poly : Polygon);
  107.  
  108.  
  109. PROCEDURE DrawCircle(s : Screen;x,y,r : INTEGER);
  110.  
  111.  
  112. PROCEDURE DrawEllipse(s : Screen;x,y,a,b : INTEGER);
  113.  
  114.  
  115. GROUP
  116.  
  117.   DrawGrp       =
  118.           Polygon,            Screen,             SHORTSET,
  119.           Draw,               DrawCircle,         DrawEllipse,
  120.           DrawPolygon,        DrawRectangle,      DrawTo,
  121.           Line,               Move,               MoveTo,
  122.           ReadPixel,          SetAPen,            SetAreaPt,
  123.           SetBPen,            SetDrawMode,        SetDrawPt,
  124.           SetPlanes,          WritePixel;
  125.  
  126.  
  127.  
  128. PROCEDURE AreaMove( s : Screen;x,y : INTEGER );
  129.  
  130.  
  131. PROCEDURE AreaDraw(s : Screen;x,y : INTEGER);
  132.  
  133.  
  134. PROCEDURE AreaEnd( s : Screen );
  135.  
  136.  
  137.  
  138. PROCEDURE AreaRectangle(s : Screen;x1,y1,x2,y2 : INTEGER);
  139.  
  140.  
  141. PROCEDURE AreaPolygon(s : Screen;VAR poly : Polygon);
  142.  
  143.  
  144. PROCEDURE AreaCircle(s : Screen;x,y,r : INTEGER);
  145.  
  146.  
  147. PROCEDURE AreaEllipse(s : Screen;x,y,a,b : INTEGER);
  148.  
  149.  
  150. PROCEDURE Flood(s : Screen;x,y : INTEGER);
  151.  
  152.  
  153. GROUP
  154.  
  155.   ExceptionGrp  = AreaDrawFail,       AreaEllipseFail,    AreaEndFail,
  156.           AreaMoveFail,       FloodFail,          WritePixelFail;
  157.  
  158.   AreaGrp       =
  159.           AreaMoveFail,       FloodFail,
  160.           AreaEnd,            AreaMove,           AreaPolygon,
  161.           AreaRectangle,      Flood,              SetAreaPt;
  162.  
  163.  
  164.   All           = DrawGrp,            AreaGrp;
  165.  
  166. END GfxDraw.
  167.  
  168.  
  169.