home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / pmos2002.zip / DEF / MOUSE.DEF < prev    next >
Text File  |  1996-10-14  |  3KB  |  81 lines

  1. DEFINITION MODULE Mouse;
  2.  
  3.         (********************************************************)
  4.         (*                                                      *)
  5.         (*                  Mouse driver                        *)
  6.         (*                                                      *)
  7.         (*  Programmer:         P. Moylan                       *)
  8.         (*  Last edited:        14 October 1996                 *)
  9.         (*  Status:             OK                              *)
  10.         (*                                                      *)
  11.         (********************************************************)
  12.  
  13. IMPORT Mouse0;
  14.  
  15. TYPE
  16.     Buttons      = Mouse0.Buttons;
  17.     ButtonSet    = Mouse0.ButtonSet;
  18.     Events       = Mouse0.Events;
  19.     EventSet     = Mouse0.EventSet;
  20.     EventHandler = Mouse0.EventHandler;
  21.  
  22. (************************************************************************)
  23.  
  24. PROCEDURE MouseAvailable (): BOOLEAN;
  25.  
  26.     (* Returns TRUE iff a mouse driver is loaded, a mouse exists, and   *)
  27.     (* mouse operation is permitted in module ConfigurationOptions.     *)
  28.  
  29. PROCEDURE ResetMouse (VAR (*OUT*) MousePresent: BOOLEAN;
  30.                         VAR (*OUT*) NumberOfButtons: CARDINAL);
  31.  
  32.     (* Initializes mouse, returning MousePresent as FALSE if no mouse   *)
  33.     (* available and as TRUE if it is, and NumberOfButtons as the       *)
  34.     (* number of buttons for the mouse if installed.                    *)
  35.  
  36. PROCEDURE GetTextMousePosition (VAR (*OUT*) Xposition: CARDINAL;
  37.                                 VAR (*OUT*) Yposition: CARDINAL);
  38.  
  39.     (* Returns the current position of the mouse cursor. *)
  40.  
  41. PROCEDURE GetTextMouseStatus (VAR (*OUT*) buttons: ButtonSet;
  42.                                 VAR (*OUT*) Xposition: CARDINAL;
  43.                                 VAR (*OUT*) Yposition: CARDINAL);
  44.  
  45.     (* Returns the current mouse position and state of the buttons.     *)
  46.  
  47. PROCEDURE SetTextMousePosition (Xposition: CARDINAL; Yposition: CARDINAL);
  48.  
  49.     (* Initialises the mouse position. *)
  50.  
  51. PROCEDURE SetTextMousePage (page: CARDINAL);
  52.  
  53.     (* Sets the hardware screen page where the mouse is visible. *)
  54.  
  55. PROCEDURE SetMouseCursorLimits (top, bottom: CARDINAL;
  56.                                         left, right: CARDINAL);
  57.  
  58.     (* Specifies a rectangular region outside which the mouse cursor    *)
  59.     (* may not go.                                                      *)
  60.  
  61. PROCEDURE ShowMouseCursor;
  62.  
  63.     (* Makes the mouse cursor visible on the screen. *)
  64.  
  65. PROCEDURE HideMouseCursor;
  66.  
  67.     (* Makes the mouse cursor invisible. *)
  68.  
  69. PROCEDURE InstallEventHandler (DetectedEvents: EventSet;
  70.                                         Handler: EventHandler);
  71.  
  72.     (* Nominates the procedure to be called whenever an event in the    *)
  73.     (* set DetectedEvents occurs.  Note: the Handler is like an         *)
  74.     (* interrupt procedure, in that it is executing in the context of   *)
  75.     (* an unknown task; typically it should probably restrict its       *)
  76.     (* actions to fairly elementary things, like a Signal to wake up    *)
  77.     (* the task that really wants to know about the event.              *)
  78.  
  79. END Mouse.
  80.  
  81.