home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / MOUSE / CMOUSE2.ZIP / MOUSE.H < prev    next >
Encoding:
C/C++ Source or Header  |  1990-11-21  |  2.1 KB  |  60 lines

  1. /*
  2.     mouse.h -
  3.     Header file for mouse processes. Adapted from 'The C Gazette' March
  4.     and Summer, 1988. For Microsoft C5.1.
  5. */
  6.  
  7. #define    NO_MOUSE        0                /*        No mouse driver found        */
  8. #define    SHOW            1                /*        Service to show cursor        */
  9. #define    HIDE            2                /*        Service to hide cursor        */
  10.  
  11. #define    LEFT            1                /*        Left button                        */
  12. #define    RIGHT            2                /*        Right button                    */
  13. #define    CENTER        4                /*        Center button                    */
  14.  
  15. #define    HORIZ            1                /*        Cursor direction                */
  16. #define    VERT            2
  17.  
  18. /* Values to OR together for mask */
  19. #define    MOVEMENT        0x01            /* 0000 0001 Any mouse movement    */
  20. #define    LEFT_DOWN    0x02            /* 0000 0010 Left button pressed    */
  21. #define    LEFT_UP        0x04            /* 0000 0100 Left button released */
  22. #define    RIGHT_DOWN    0x08            /* 0000 1000 Right button pressed */
  23. #define    RIGHT_UP        0x10            /* 0001 0000 Right button released */
  24. #define    MIDDLE_DOWN    0x20            /* 0010 0000 Middle button pressed */
  25. #define    MIDDLE_UP    0x40            /* 0100 0000 Middle button released */
  26. #define    ANYTHING        0x7f            /* 0111 1111 All the above            */
  27.  
  28. typedef struct            /* structure to hold data from mouse interrupt */
  29.     {
  30.     unsigned    what,            /* what happened?            */
  31.                 buttons,        /* button status at event */
  32.                 x_pos,        /* X coordinate */
  33.                 y_pos,        /* Y coordinate */
  34.                 x_mickeys,    /* horizontal mickey count */
  35.                 y_mickeys;    /* vertical mickey count */
  36.     } MOUSETRAP;
  37.  
  38. #define    callMDD    int86(0x33, &inregs, &inregs)
  39.  
  40. #ifndef MOUSE_LIB
  41.  
  42. extern int CheckMouse(void);
  43. extern void CloseMouse(void);
  44. extern void DisplayMCursor(int mode);
  45. extern int CheckPosition(int *p_x, int *p_y);
  46. extern int PositionMCursor(int x, int y);
  47. extern void GetPress(int button, int *p_x, int *p_y, int *p_presses);
  48. extern void GetRelease(int button, int *p_x, int *p_y, int *p_presses);
  49. extern void LimitCursor(int direction, int lo, int hi);
  50. extern void GraphicCursor(int hot_x, int hot_y, unsigned far *mask);
  51. extern void TextCursor(int type, unsigned int b1, unsigned int b2);
  52. extern void GetMickeys(int *p_x, int *p_y);
  53. extern void InstallTrap(unsigned mask, unsigned trap_seg, unsigned trap_offset);
  54.  
  55. extern int far _mouseInstalled;
  56. extern MOUSETRAP far *trap_data;
  57.  
  58. #endif
  59.  
  60.