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 >
Wrap
Text File
|
1988-12-19
|
4KB
|
146 lines
/*********************************************************/
/* MOUSE header file for Rainbow */
/*********************************************************/
/* You must #define MOUSETYPE with one of the following */
/* before mouse.h to actually achieve anything */
/* Mouse types */
#define NOMOUSE 0
#define MICROSOFT 1
#define PCMOUSE 2
/* default is NO MOUSE*/
#ifndef MOUSETYPE
#define MOUSETYPE NOMOUSE
#endif
#if MOUSETYPE - MICROSOFT
#define MICROSOFTMOUSEIND
#endif
#if MOUSETYPE - PCMOUSE
#define PCMOUSEMOUSEIND
#endif
/* logical truthfulness */
#define TRUE 1
#define FALSE 0
/*Available Mouse port definitions */
#define MDM 1 /*Comms port*/
#define PRT 2 /*printer port*/
#define AUX 3 /*Aux. Comms port*/
/*MOUSE interrupt condition packet (why) */
typedef struct {
unsigned int Movement; /*TRUE movement occurred*/
int S_button_rel; /*secondary button release count*/
int S_button_dep; /*secondary button depress count*/
int P_button_rel; /*primary button release count*/
int P_button_dep; /*primary button depress count*/
int Delta_x; /*x delta factor (horizontal)*/
int Delta_y; /*y delta factor (vertical)*/
} CONDITION_PACKET;
CONDITION_PACKET *msdecode();
/*MOUSE control packet */
typedef struct {
int P_button, /*TRUE = left or primary button act*/
S_button, /*TRUE = right or secondary button*/
T_button, /*TRUE = middle or tertiary button */
Deltax, /*x acc. delta factor (horizontal)*/
X_ratio, /*x magnification factor (OPEN)*/
X_threshold, /*x speed limit (OPEN)*/
Deltay, /*y acc. delta factor (vertical)*/
Y_ratio, /*y magnification factor (OPEN)*/
Y_threshold; /*y speed limit (OPEN)*/
int Mouse_immediate; /*TRUE = wait for input*/
int Mouse_enabled; /*TRUE = mouse OK to use*/
int Mouse_type; /*mouse type - see MOUSETYPE*/
int Mouse_device; /*port number MDM, PRT or AUX*/
char Mouse_port_name[5]; /*port name*/
unsigned int Mouse_handle; /*device handle*/
unsigned char Mouse_bstate; /*button state storage*/
int Mouse_programmed; /*TRUE = port programmed for Mouse*/
int Mouse_new_vectors; /*TRUE = RCI vectored in*/
int Trace; /*TRUE = trace mode*/
} MOUSE_PACKET;
/* Local buffer for port I/O (std Dos structure*/
typedef struct {
int count,
size,
ipntr,
opntr,
highw,
loww,
head,
tail;
unsigned char mdata[128-16];
} MOUSE_PORT_BUFFER;
/*MOUSE control*/
#if MOUSETYPE
/*NOMOUSE*/
#define Mouse_x_threshold 0
#define Mouse_x_speed 0
#define Mouse_y_threshold 0
#define Mouse_y_speed 0
#define Mouse_num_buttons 0
#define Mouse_packet_size 0
#undef MICROSOFTMOUSEIND
#undef PCMOUSEMOUSEIND
#endif
#ifdef MICROSOFTMOUSEIND
/*MICROSOFT*/
#define Mouse_x_threshold 0x040 /* Threshold in Mickeys/sec */
#define Mouse_x_speed 2
#define Mouse_y_threshold 0x080 /* Threshold in Mickeys/sec */
#define Mouse_y_speed 2
#define Mouse_num_buttons 2
#define Mouse_packet_size 3
#undef MICROSOFTMOUSEIND
#endif
#ifdef PCMOUSEMOUSEIND
/*PCMOUSE*/
#define Mouse_x_threshold 0x040 /* Threshold in ??*/
#define Mouse_x_speed 2
#define Mouse_y_threshold 0x080 /* Threshold in ??*/
#define Mouse_y_speed 2
#define Mouse_num_buttons 3
#define Mouse_packet_size 5
#undef PCMOUSEMOUSEIND
#endif
/* PKT/CCB for Dos ioctl calls*/
struct COMM_BLOCK {
unsigned char cb_function; /*PKT function */
unsigned char cb_func_retc; /*PKT return code*/
unsigned char cb_character; /*PKT character in/out*/
unsigned char cb_char_stat; /*PKT character status*/
unsigned char cb_device; /*CCB device number */
unsigned char cb_control; /*CCB mode */
unsigned char cb_stop_bits; /*CCB stop bits*/
unsigned char cb_data_bits; /*CCB data bits*/
unsigned char cb_parity_out; /*CCB tx parity*/
unsigned char cb_rcv_baud; /*CCB rx speed*/
unsigned char cb_xmit_baud; /*CCB tx speed*/
unsigned char cb_xon_char; /*CCB XON char*/
unsigned char cb_xoff_char; /*CCB XOFF char*/
unsigned char cb_in_xon; /*CCB rx XON/XOFF*/
unsigned char cb_out_xon; /*CCB tx XON/XOFF*/
unsigned int cb_buffer_size; /*CCB user buffer size*/
unsigned char *cb_buffer_offset; /*CCB user buffer offset*/
unsigned int cb_buffer_segment; /*CCB user buffer segment*/
};