home *** CD-ROM | disk | FTP | other *** search
/ ftp.update.uu.se / ftp.update.uu.se.2014.03.zip / ftp.update.uu.se / pub / rainbow / msdos / decus / RB140 / grlib03a.arj / MOUSE.H < prev    next >
Text File  |  1988-12-19  |  4KB  |  146 lines

  1. /*********************************************************/
  2. /*           MOUSE header file for Rainbow               */
  3. /*********************************************************/
  4.  
  5. /*  You must #define MOUSETYPE with one of the following */
  6. /*  before mouse.h to actually achieve anything          */
  7.  
  8. /* Mouse types */
  9. #define  NOMOUSE    0
  10. #define  MICROSOFT    1
  11. #define  PCMOUSE    2
  12.  
  13. /* default is NO MOUSE*/
  14. #ifndef MOUSETYPE
  15. #define MOUSETYPE NOMOUSE
  16. #endif
  17.  
  18. #if MOUSETYPE - MICROSOFT
  19. #define MICROSOFTMOUSEIND
  20. #endif
  21. #if MOUSETYPE - PCMOUSE
  22. #define PCMOUSEMOUSEIND
  23. #endif
  24.  
  25. /* logical truthfulness */
  26. #define TRUE         1
  27. #define FALSE         0
  28.  
  29.  
  30. /*Available Mouse port definitions */
  31. #define MDM        1        /*Comms port*/
  32. #define PRT        2        /*printer port*/
  33. #define AUX        3        /*Aux. Comms port*/
  34.  
  35.  
  36. /*MOUSE interrupt condition packet (why) */
  37. typedef struct {
  38.     unsigned int Movement;        /*TRUE movement occurred*/
  39.     int S_button_rel;        /*secondary button release count*/
  40.     int S_button_dep;        /*secondary button depress count*/
  41.     int P_button_rel;        /*primary button release count*/
  42.     int P_button_dep;        /*primary button depress count*/
  43.     int Delta_x;            /*x delta factor (horizontal)*/
  44.     int Delta_y;            /*y delta factor (vertical)*/
  45.     } CONDITION_PACKET;
  46.  
  47.  CONDITION_PACKET  *msdecode();
  48.  
  49. /*MOUSE control packet */
  50. typedef struct {
  51.     int P_button,            /*TRUE = left or primary button act*/
  52.         S_button,            /*TRUE = right or secondary button*/
  53.         T_button,            /*TRUE = middle or tertiary button */
  54.         Deltax,            /*x acc. delta factor (horizontal)*/
  55.         X_ratio,            /*x magnification factor (OPEN)*/
  56.         X_threshold,        /*x speed limit          (OPEN)*/
  57.         Deltay,            /*y acc. delta factor (vertical)*/
  58.         Y_ratio,            /*y magnification factor (OPEN)*/
  59.         Y_threshold;        /*y speed limit          (OPEN)*/
  60.     int Mouse_immediate;        /*TRUE = wait for input*/
  61.     int Mouse_enabled;        /*TRUE = mouse OK to use*/
  62.     int Mouse_type;            /*mouse type - see MOUSETYPE*/
  63.     int Mouse_device;        /*port number MDM, PRT or AUX*/
  64.     char Mouse_port_name[5];    /*port name*/
  65.     unsigned int Mouse_handle;    /*device handle*/
  66.     unsigned char Mouse_bstate;    /*button state storage*/
  67.     int Mouse_programmed;        /*TRUE = port programmed for Mouse*/
  68.     int Mouse_new_vectors;        /*TRUE = RCI vectored in*/
  69.     int Trace;            /*TRUE = trace mode*/
  70.     } MOUSE_PACKET;
  71.  
  72.  
  73. /* Local buffer for port I/O (std Dos structure*/
  74. typedef struct {
  75.     int count, 
  76.         size,
  77.         ipntr,
  78.         opntr,
  79.         highw,
  80.         loww,
  81.         head,
  82.         tail;
  83.     unsigned char mdata[128-16];
  84.     } MOUSE_PORT_BUFFER;
  85.  
  86. /*MOUSE control*/
  87. #if MOUSETYPE
  88. /*NOMOUSE*/
  89. #define Mouse_x_threshold    0
  90. #define Mouse_x_speed        0
  91. #define Mouse_y_threshold    0
  92. #define Mouse_y_speed        0
  93. #define Mouse_num_buttons    0
  94. #define Mouse_packet_size    0
  95. #undef MICROSOFTMOUSEIND
  96. #undef PCMOUSEMOUSEIND
  97. #endif
  98.  
  99. #ifdef MICROSOFTMOUSEIND
  100. /*MICROSOFT*/
  101. #define Mouse_x_threshold    0x040    /* Threshold in Mickeys/sec */
  102. #define Mouse_x_speed        2
  103. #define Mouse_y_threshold    0x080    /* Threshold in Mickeys/sec */
  104. #define Mouse_y_speed        2
  105. #define Mouse_num_buttons    2
  106. #define Mouse_packet_size    3
  107. #undef MICROSOFTMOUSEIND
  108. #endif
  109.  
  110. #ifdef PCMOUSEMOUSEIND
  111. /*PCMOUSE*/
  112. #define Mouse_x_threshold    0x040    /* Threshold in ??*/
  113. #define Mouse_x_speed        2
  114. #define Mouse_y_threshold    0x080    /* Threshold in ??*/
  115. #define Mouse_y_speed        2
  116. #define Mouse_num_buttons    3
  117. #define Mouse_packet_size    5
  118. #undef PCMOUSEMOUSEIND
  119. #endif
  120.  
  121.  
  122.  
  123. /* PKT/CCB for Dos ioctl calls*/
  124. struct    COMM_BLOCK {
  125.     unsigned char cb_function;        /*PKT function */
  126.     unsigned char cb_func_retc;        /*PKT return code*/
  127.     unsigned char cb_character;        /*PKT character in/out*/
  128.     unsigned char cb_char_stat;        /*PKT character status*/
  129.     unsigned char    cb_device;        /*CCB device number */
  130.     unsigned char    cb_control;        /*CCB mode */
  131.     unsigned char    cb_stop_bits;        /*CCB stop bits*/
  132.     unsigned char    cb_data_bits;        /*CCB data bits*/
  133.     unsigned char    cb_parity_out;        /*CCB tx parity*/
  134.     unsigned char    cb_rcv_baud;        /*CCB rx speed*/
  135.     unsigned char    cb_xmit_baud;        /*CCB tx speed*/
  136.     unsigned char    cb_xon_char;        /*CCB XON char*/
  137.     unsigned char    cb_xoff_char;        /*CCB XOFF char*/
  138.     unsigned char    cb_in_xon;        /*CCB rx XON/XOFF*/
  139.     unsigned char    cb_out_xon;        /*CCB tx XON/XOFF*/
  140.     unsigned int    cb_buffer_size;        /*CCB user buffer size*/
  141.     unsigned char    *cb_buffer_offset;    /*CCB user buffer offset*/
  142.     unsigned int    cb_buffer_segment;    /*CCB user buffer segment*/
  143.     };
  144.  
  145. 
  146.