GR_ATTRI.DEF 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. DEFINITION MODULE GR_Attributes;
  2. (*
  3. ** Author : Peter Jardine
  4. **
  5. ** Version:
  6. ** 1.0 17 Apr 92 New file - based on the work of
  7. ** Michael McCarthy & John Pfitzner,
  8. ** CSP-960 Project, Semester 2, 1991.
  9. *)
  10. IMPORT GrafCore;
  11. CONST
  12. (* ======================= Colours ============================== *)
  13. (*
  14. ** Standard 4 colour CGA palette: Black; Cyan; Magenta; White;
  15. **
  16. ** Alternative 4 colour CGA palette: Black; Green; Red; Yellow;
  17. *)
  18. CGA_Black = 0;
  19. CGA_Cyan = 1; CGA_Green = 1;
  20. CGA_Magenta = 2; CGA_Red = 2;
  21. CGA_White = 3; CGA_Yellow = 3;
  22. (*
  23. ** 16 colour EGA/VGA palette:
  24. **
  25. ** Dark colours Light colours
  26. *)
  27. Black = 0; DarkGray = 8;
  28. Blue = 1; LightBlue = 9;
  29. Green = 2; LightGreen = 10;
  30. Cyan = 3; LightCyan = 11;
  31. Red = 4; LightRed = 12;
  32. Magenta = 5; LightMagenta = 13;
  33. Brown = 6; Yellow = 14;
  34. LightGray = 7; White = 15;
  35. (* ===================== Aspect Settings ======================= *)
  36. DefaultAspect = 0;
  37. MaxXAspect = 1;
  38. MaxYAspect = 2;
  39. (* ======================= Write Modes ========================= *)
  40. (*
  41. ** These are made visible by the WriteMode Type declaration.
  42. **
  43. replaceMode;
  44. andMode;
  45. orMode;
  46. xorMode;
  47. *)
  48. TYPE
  49. AspectSetting = [DefaultAspect .. MaxYAspect];
  50. WriteMode = GrafCore.WriteMode;
  51. (* replaceMode, andMode, orMode, xorMode *)
  52. PROCEDURE GetNDCAspect(VAR aspect : AspectSetting);
  53. (*
  54. ** Get the current aspect setting in use by the NDC routines.
  55. *)
  56. PROCEDURE GetBgColour(VAR colour : CARDINAL);
  57. PROCEDURE GetRGBBgColour(VAR red, green, blue : REAL);
  58. (*
  59. ** Get the background colour being used for all display operations.
  60. *)
  61. PROCEDURE GetColour(VAR colour : CARDINAL);
  62. PROCEDURE GetRGBColour(VAR red, green, blue : REAL);
  63. (*
  64. ** Get the foreground colour being used for all display operations.
  65. *)
  66. PROCEDURE GetWriteMode(VAR penMode : WriteMode);
  67. (*
  68. ** Get the current pixel placement method.
  69. *)
  70. PROCEDURE SetNDCAspect(aspect : AspectSetting);
  71. (*
  72. ** Set the aspect ratio to use for NDC routines. Legal values are
  73. ** DEFAULT which uses the full resolution of the display, MaxXAspect,
  74. ** or MaxYAspect which may use less than the full resoultion of the
  75. ** display, but squares will be square, and circles will be circular.
  76. *)
  77. PROCEDURE SetBgColour(colour : CARDINAL);
  78. PROCEDURE SetRGBBgColour(red, green, blue : REAL);
  79. (*
  80. ** Set the background colour to use for all display operations.
  81. *)
  82. PROCEDURE SetColour(colour : CARDINAL);
  83. PROCEDURE SetRGBColour(red, green, blue : REAL);
  84. (*
  85. ** Set the foreground colour to use for all display operations.
  86. *)
  87. PROCEDURE SetClipping(switch : BOOLEAN);
  88. (*
  89. ** Turns clipping on or off. Note that all write operations run
  90. ** significantly slower with clipping on. When developing programs,
  91. ** however, it is generally a good idea to set clipping to the full
  92. ** screen rectangle, and turn it on, since the low level routines
  93. ** perform no bounds checking whatsoever. The default value is
  94. ** clipping set to the full screen rectangle and enabled. Be sure
  95. ** your program does not write outside the screen area if you turn
  96. ** clipping off. Attempts to write outside the screen area when
  97. ** clipping is disabled could have unpredictable results.
  98. *)
  99. PROCEDURE SetClipRect(col1, row1, col2, row2 : INTEGER);
  100. PROCEDURE SetNDCClipRect(x1, y1, x2, y2 : REAL);
  101. (*
  102. ** Sets the boundaries of the clipping rectangle, so that all graphics
  103. ** write operations are clipped to the interior and boundary of the
  104. ** rectangle.
  105. *)
  106. PROCEDURE SetWriteMode(penMode : WriteMode);
  107. (*
  108. ** Sets the default method for interaction with background pixels in
  109. ** line drawing, block restoration, and char/string output.
  110. ** If default method is replaceMode, object overwrites the current screen
  111. ** contents; if the default method is xorMode, the object is XORed with
  112. ** the current screen contents, and so on.
  113. ** This function is only implemented for all write functions in EGA/VGA
  114. ** modes. For CGA and Hercules modes, it is only functional for WrPxl,
  115. ** BlockRestore, Circle and Ellipse.
  116. *)
  117. END GR_Attributes.