home *** CD-ROM | disk | FTP | other *** search
/ Turbo Toolbox / Turbo_Toolbox.iso / 1989 / 03 / extra / mouse.def < prev    next >
Encoding:
Modula Definition  |  1988-12-23  |  2.5 KB  |  86 lines

  1. (***********************************************)
  2. (*                  MOUSE.DEF                  *)
  3. (*        Maus-Modul für TopSpeed Modula 2     *)
  4. (*          (C) 1988 M.Schlöter & TOOLBOX      *)
  5.  
  6. DEFINITION MODULE Mouse;
  7.  
  8. FROM SYSTEM IMPORT WORD;
  9.  
  10. CONST (* Constants for comparison which *)
  11.       (* mouse-button has been pressed  *)
  12.       MLButton = 0;
  13.       MRButton = 1;
  14.  
  15. TYPE tMMasks = RECORD  (* mouse-pointer bitmasks *)
  16.        screen, mask : ARRAY[0..15] OF WORD;
  17.      END;
  18.  
  19. VAR MArrow : tMMasks;
  20.                (* contains graphic mouse-pointer *)
  21.  
  22. PROCEDURE CheckM() : INTEGER;
  23.   (* Returns # of mouse-buttons or 0 if no mouse  *)
  24.   (* REMEMBER: Microsoft kompatible mouses always *)
  25.   (*           return 1 button, but have realy 2  *)
  26.  
  27. PROCEDURE MButtonPressed() : BOOLEAN;
  28.   (* Actually a button pressed ? *)
  29.  
  30. PROCEDURE TextCoords(flag : BOOLEAN);
  31.   (* Use text-coordinates ?  *)
  32.  
  33. PROCEDURE MouseInArea(x1, y1, x2, y2 : INTEGER)
  34.                                         : BOOLEAN;
  35.   (* Is mouse-pointer in area ? *)
  36.  
  37. PROCEDURE SetMSpeed (s : INTEGER);
  38.   (* Set mouse-speed *)
  39.  
  40. PROCEDURE WaitMEvent;
  41.   (* Wait until mouse moved or button clicked *)
  42.  
  43. PROCEDURE ActMButton() : INTEGER;
  44.   (* Which mouse-button is actually pressed ? *)
  45.  
  46. PROCEDURE GetMRate (VAR xmove, ymove : INTEGER);
  47.   (* Whats the mouse-moving rate since *)
  48.   (* last event (in mickeys) ?         *)
  49.  
  50. PROCEDURE SetTextMAttr (MouseChar          : CHAR;
  51.                         CharColor,
  52.                         BackgroundColor : INTEGER);
  53.   (* Set mouse pointer attributes for textmode *)
  54.  
  55. PROCEDURE SetGraphM (HotX, HotY : INTEGER;
  56.                      masks      : tMMasks);
  57.   (* Define graphics mouse pointer *)
  58.  
  59. PROCEDURE SetMFence (x1, y1, x2, y2 : INTEGER);
  60.   (* set limits of mouse area *)
  61.  
  62. PROCEDURE MPointerOn;
  63.   (* Switch mouse pointer on *)
  64.  
  65. PROCEDURE MPointerOff;
  66.   (* Switch mouse pointer off *)
  67.  
  68. PROCEDURE MState (VAR ActX, ActY,
  69.                   PressedButtons : INTEGER);
  70.   (* Position and pressed button(s) *)
  71.  
  72. PROCEDURE SetMouse (x, y : INTEGER);
  73.   (* Set mouse position *)
  74.  
  75. PROCEDURE MButtonPressedPolling (button : INTEGER;
  76.                               VAR x,y,n : INTEGER);
  77.   (* Where has the button been pressed *)
  78.   (*  and how often since last call ?  *)
  79.  
  80. PROCEDURE MButtonReleasedPolling (button : INTEGER;
  81.                                VAR x,y,n : INTEGER);
  82.   (* Where has the button been released and *)
  83.   (* how often since last call ?            *)
  84.  
  85. END Mouse.
  86.