CURSOR.DEF 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. FOREIGN DEFINITION MODULE Cursor;
  2. (*
  3. CURSOR.DEF - Provides some basic cursor manipulations, e.g. hiding
  4. and displaying the cursor, changing it's shape and getting
  5. the attributes of the current cursor.
  6. Initial Release : 08-Aug-94
  7. Philip Sinfield - Programming Languages & Systems
  8. Group - GPM
  9. *)
  10. IMPORT IMPLEMENTATION FROM "cursor.obj";
  11. FROM Types IMPORT BYTECARD;
  12. (*
  13. Note : The use of BYTECARD is important as the low level BIOS routines
  14. return byte sized results (i.e. half 16 bit registers)
  15. *)
  16. (* ************************************************************************ *)
  17. PROCEDURE Hide ();
  18. (* Hides the cursor from view
  19. Pre : A visible cursor exists
  20. Post: Cursor is hidden from display
  21. *)
  22. (* ************************************************************************ *)
  23. PROCEDURE Restore ();
  24. (* Restore the cursor to the screen
  25. Pre : Cursor is not visible
  26. Post: Cursor is made visible
  27. *)
  28. (* ************************************************************************ *)
  29. (*
  30. The next two procedures are dependent on the graphics hardware of
  31. an individual PC. The values for "start" and "end" (0 -20H) are for
  32. VGA & SVGA hardware. If VGA or SVGA hardware is not being used, then
  33. the scan line limits will need to be obtained from relevant technical
  34. documents.
  35. *)
  36. (* ************************************************************************ *)
  37. PROCEDURE SetShape (start : BYTECARD; end : BYTECARD);
  38. (* Sets the shape of the cursor
  39. Pre : A visible cursor exists
  40. 0 <= start <= 020H
  41. 0 <= end <= 01fH
  42. Post: Cursor shape is set by scan line "start" and
  43. scan line "end".
  44. If start = 20H then cursor is "hidden"
  45. *)
  46. (* ************************************************************************ *)
  47. PROCEDURE GetShape (VAR start : BYTECARD; VAR end : BYTECARD);
  48. (* Returns the size of the current cursor
  49. Pre : A visible cursor exists
  50. Post: Current cursor shape is defined by scan line "start" and
  51. scan line "end".
  52. 0 <= start <= 020H
  53. 0 <= end <= 01fH
  54. If start = 20H then cursor is "hidden"
  55. *)
  56. (* ************************************************************************ *)
  57. PROCEDURE GetAttribute (VAR ch : CHAR; VAR bg : BYTECARD;
  58. VAR fg : BYTECARD;
  59. VAR h : BYTECARD;
  60. VAR b : BYTECARD);
  61. (* Returns the character at the cursor and its attributes
  62. Pre : TRUE
  63. Post: ch is the character at the cursor
  64. bg is the background colour -> 00H - Black
  65. 01H - Blue
  66. 02H - Green
  67. 03H - Cyan
  68. 04H - Red
  69. 05H - Magenta
  70. 06H - Brown
  71. 07H - White
  72. fg is the foreground colour -> 00H - Black
  73. 01H - Blue
  74. 02H - Green
  75. 03H - Cyan
  76. 04H - Red
  77. 05H - Magenta
  78. 06H - Brown
  79. 07H - White
  80. 08H - Grey
  81. 09H - Bright Blue
  82. 0aH - Bright Green
  83. 0bH - Bright Cyan
  84. 0cH - Bright Red
  85. 0dH - Bright Magenta
  86. 0eH - Yellow
  87. 0fH - Bright White
  88. h is the highlight attribute -> 1 - Bright
  89. 0 - Normal
  90. b is the blink attribute -> 1 - Blinking
  91. 0 - No Blink
  92. *)
  93. END Cursor.