home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_02_05 / 2n05039a < prev    next >
Text File  |  1991-03-27  |  7KB  |  255 lines

  1.  
  2. (*
  3.         TITLE:          Turbo Pascal MicroSoft Mouse Library Unit;
  4.         FILENAME:       MOUSELIB.PAS;
  5.         REQUIRES:       MOUSELIB.ASM;
  6.         COMPILER:       Turbo Pascal V.4.0+;
  7.         ASSEMBLER:      TASM V.2.0;
  8.  
  9. *)
  10.  
  11.                            {  Int 33h ($CD $33)  Functions }
  12.  
  13. Unit MouseLib;
  14.  
  15.         (**********************************************************
  16.                                INTERFACE
  17.          **********************************************************)
  18.  
  19.     Interface
  20.  
  21.         Const
  22.                 LEFT_BUTTON = 1;
  23.                 RIGHT_BUTTON = 2;
  24.                 BOTH_BUTTONS = 3;
  25.  
  26.                 LeftMouseButton : Integer = 0;
  27.                 RightMouseButton : Integer = 1;
  28.  
  29. Function mouse_reset(Var num_buttons : Integer) : Integer;
  30.         {  Func 00h    }
  31.  
  32. Procedure mouse_show;
  33.         {  Func 01h    }
  34.  
  35. Procedure mouse_hide;
  36.         {  Func 02h    }
  37.  
  38. Function mouse_get_pos(Var x, y : Integer) : Integer;
  39.         {  Func 03h    }
  40.  
  41. Procedure mouse_set_pos(x, y : Integer);
  42.         {  Func 04h    }
  43.  
  44. Function mouse_button_press
  45.         (Var x, y, count : Integer; button : Integer) : Integer;
  46.         { Func 05h }
  47.                                 
  48. Function mouse_button_rel
  49.         (Var x, y, count : Integer; button : Integer) : Integer;
  50.         { Func 06h }
  51.  
  52. Procedure mouse_limit_x(min_x, max_x : Integer);   { Func 07h }
  53.  
  54. Procedure mouse_limit_y(min_y, max_y : Integer);   { Func 08h }
  55.  
  56. Procedure mouse_set_graphcursor(xspot, yspot : Integer; masks : pointer);
  57.         { Func 09h }
  58.  
  59.     
  60. Procedure mouse_set_textcursor(cursor_type, scr_mask, curs_mask : Integer);
  61.         { Func 0Ah }
  62.  
  63. Procedure mouse_get_movement(Var x, y : Integer);     
  64.         { 0Bh }
  65.  
  66. Procedure mouse_set_eventhandler(event_mask : Integer; mhandler : pointer);
  67.         { Func 0Ch }
  68.  
  69. Procedure mouse_start_pen_emul;    
  70.         { Func 0Dh }
  71.  
  72. Procedure mouse_stop_pen_emul;     
  73.         { Func 0Eh }
  74.  
  75.  
  76. Procedure mouse_set_movement_ratio(x_ratio, y_ratio : Integer);
  77.         { Func 0Fh }
  78.  
  79.     
  80. Procedure mouse_conditional_off(left, top, right, bottom : Integer);
  81.         { Func 10h }
  82.  
  83. Procedure mouse_set_speed(threshold : Integer);    
  84.         { Func 13h }
  85.  
  86.     
  87. Function mouse_swap_vector
  88.   (new_mask : Integer; Var old_mask : Integer; new_vector : pointer) : pointer;
  89.         { Func 14h }
  90.  
  91. Function mouse_get_bufsize : Integer;
  92.         { Func 15h }
  93.  
  94. Procedure mouse_save_state(state_buf : pointer);     
  95.         { Func 16h }
  96.  
  97. Procedure mouse_restore_state(state_buf : pointer);  
  98.         { Func 17h }
  99.  
  100.     
  101. Procedure mouse_set_alt_handler(alt_mask : Integer; func : pointer);
  102.         { Func 18h }
  103.  
  104.     
  105. Function mouse_get_alt_handler
  106.         (alt_mask : Integer; handler : pointer) : pointer;
  107.         { Func 19h }
  108.  
  109.     
  110. Procedure mouse_set_sens(x_ratio, y_ratio, threshold : Integer);
  111.         { Func 1Ah }
  112.  
  113.  
  114. Procedure mouse_get_sens(Var x_ratio, y_ratio, threshold : Integer);
  115.         { Func 1Bh }
  116.  
  117. Procedure mouse_set_crt_page(crt_page : Integer);
  118.         { Func 1Dh }
  119.  
  120. Function mouse_get_crt_page : Integer;
  121.         { Func 1Eh }
  122.  
  123.     
  124. Function mouse_disable_drvr(vector_33h : pointer) : Integer;
  125.         { Func 1Fh }
  126.  
  127. Procedure mouse_enable_drvr;            
  128.         { Func 20h }
  129.  
  130. Function mouse_soft_reset(Var nbuttons : Integer ) : Integer;    
  131.         { Func 21h }
  132.  
  133.         (**********************************************************
  134.                              IMPLEMENTATION
  135.          **********************************************************)
  136.          
  137.     Implementation
  138.  
  139. {$L mouselib}
  140.  
  141. Function mouse_reset(Var num_buttons : Integer) : Integer;external;
  142.         {  Func 00h    }
  143.  
  144. Procedure mouse_show;external;
  145.         {  Func 01h    }
  146.  
  147. Procedure mouse_hide;external;
  148.         {  Func 02h    }
  149.  
  150. Function mouse_get_pos(Var x, y : Integer) : Integer;external;
  151.         {  Func 03h    }
  152.  
  153. Procedure mouse_set_pos(x, y : Integer);external;
  154.         {  Func 04h    }
  155.  
  156. Function mouse_button_press
  157.         (Var x, y, count : Integer; button : Integer) : Integer;external;
  158.         { Func 05h }
  159.  
  160. Function mouse_button_rel
  161.         (Var x, y, count : Integer; button : Integer) : Integer;external;
  162.         { Func 06h }
  163.  
  164. Procedure mouse_limit_x(min_x, max_x : Integer);external;
  165.         { Func 07h }
  166.  
  167. Procedure mouse_limit_y(min_y, max_y : Integer);external;
  168.         { Func 08h }
  169.  
  170. Procedure mouse_set_graphcursor
  171.         (xspot, yspot : Integer; masks : pointer);external;
  172.         { Func 09h }
  173.  
  174.  
  175. Procedure mouse_set_textcursor
  176.         (cursor_type, scr_mask, curs_mask : Integer);external;
  177.         { Func 0Ah }
  178.  
  179. Procedure mouse_get_movement(Var x, y : Integer);external;
  180.         { 0Bh }
  181.  
  182. Procedure mouse_set_eventhandler
  183.         (event_mask : Integer; mhandler : pointer);external;
  184.         { Func 0Ch }
  185.  
  186. Procedure mouse_start_pen_emul;external;
  187.         { Func 0Dh }
  188.  
  189. Procedure mouse_stop_pen_emul;external;
  190.         { Func 0Eh }
  191.  
  192.  
  193. Procedure mouse_set_movement_ratio(x_ratio, y_ratio : Integer);external;
  194.         { Func 0Fh }
  195.  
  196.  
  197. Procedure mouse_conditional_off
  198.         (left, top, right, bottom : Integer);external;
  199.         { Func 10h }
  200.  
  201. Procedure mouse_set_speed(threshold : Integer);external;
  202.         { Func 13h }
  203.  
  204.  
  205. Function mouse_swap_vector
  206.         (new_mask : Integer; Var old_mask : Integer; new_vector : pointer)
  207.         : pointer;external;
  208.         { Func 14h }
  209.  
  210. Function mouse_get_bufsize : Integer;external;
  211.         { Func 15h }
  212.  
  213. Procedure mouse_save_state(state_buf : pointer);external;
  214.         { Func 16h }
  215.  
  216. Procedure mouse_restore_state(state_buf : pointer);external;
  217.         { Func 17h }
  218.  
  219.  
  220. Procedure mouse_set_alt_handler(alt_mask : Integer; func : pointer);external;
  221.         { Func 18h }
  222.  
  223.  
  224. Function mouse_get_alt_handler
  225.         (alt_mask : Integer; handler : pointer) : pointer;external;
  226.         { Func 19h }
  227.  
  228.  
  229. Procedure mouse_set_sens(x_ratio, y_ratio, threshold : Integer);external;
  230.         { Func 1Ah }
  231.  
  232.  
  233. Procedure mouse_get_sens(Var x_ratio, y_ratio, threshold : Integer);external;
  234.         { Func 1Bh }
  235.  
  236. Procedure mouse_set_crt_page(crt_page : Integer);external;
  237.         { Func 1Dh }
  238.  
  239. Function mouse_get_crt_page : Integer;external;
  240.         { Func 1Eh }
  241.  
  242.  
  243. Function mouse_disable_drvr(vector_33h : pointer) : Integer;external;
  244.         { Func 1Fh }
  245.  
  246. Procedure mouse_enable_drvr;external;
  247.         { Func 20h }
  248.  
  249. Function mouse_soft_reset(Var nbuttons : Integer ) : Integer;external;
  250.         { Func 21h }
  251.  
  252.  
  253. End.
  254. (*  MouseLib Unit  *)
  255.