home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / warphead.zip / H / VMD.H < prev    next >
C/C++ Source or Header  |  1997-04-10  |  10KB  |  249 lines

  1. /***************************************************************************
  2. *
  3. * Module Name: VMD.H (MVDM Virtual Mouse Exported Definitions)
  4. *
  5. * OS/2 public header file.
  6. *
  7. * Copyright (c) 1987 - 1993  IBM Corporation
  8. *
  9. *****************************************************************************/
  10.  
  11.  
  12. #ifndef INCL_NONE                       // include everything by default
  13. #define INCL_VMOUSE
  14. #endif
  15.  
  16. #ifdef  INCL_VMOUSE
  17. #define INCL_VMOUSEINT
  18. #define INCL_VMOUSESYSREQ
  19. #define INCL_VMOUSEDEVREQ
  20. #endif
  21.  
  22. #pragma checkout( suspend )
  23.    #ifndef __CHKHDR__
  24.       #pragma checkout( suspend )
  25.    #endif
  26. #pragma checkout( resume )
  27.  
  28. #ifndef __VMD__
  29. #define __VMD__
  30.  
  31. #ifdef  INCL_VMOUSEINT
  32.  
  33. /***    VMD INT 33h constants
  34.  */
  35.  
  36. #define INT_MOUSE            0x33       // mouse software interrupt
  37.  
  38. #define INT33_RESET             0       // mouse reset and status
  39. #define INT33_SHOWPOINTER       1       // show pointer
  40. #define INT33_HIDEPOINTER       2       // hide pointer
  41. #define INT33_QUERYSTATUS       3       // query button status and mouse pos.
  42. #define INT33_SETPOSITION       4       // set mouse position
  43. #define INT33_GETPRESSINFO      5       // get button press information
  44. #define INT33_GETRELEASEINFO    6       // get button release information
  45. #define INT33_SETHORIZONTAL     7       // set horizontal min/max boundaries
  46. #define INT33_SETVERTICAL       8       // set vertical min/max boundaries
  47. #define INT33_DEFINEGRPOINTER   9       // define graphics pointer
  48. #define INT33_DEFINETEXTPOINTER 10      // define text/hardware pointer
  49. #define INT33_GETMOTIONCOUNTS   11      // get mouse motion counters
  50. #define INT33_SETUSERSUB        12      // set user call mask/address
  51. #define INT33_ENABLELIGHTPEN    13      // enable lightpen emulation
  52. #define INT33_DISABLELIGHTPEN   14      // disable lightpen emulation
  53. #define INT33_SETMICKEYRATIO    15      // set mickeys-to-8-pixels ratio
  54. #define INT33_SETCONDITIONAL    16      // set conditional-off area
  55. #define INT33_FUNCTION17        17      // UNDEFINED (points to function 19)
  56. #define INT33_DEFINEVARPOINTER  18      // define variable-size graphics pointer
  57. #define INT33_SETDBLSPEED       19      // set dbl-speed threshold
  58. #define INT33_SWAPUSERSUB       20      // swap user call mask/address
  59. #define INT33_QUERYSTATESIZE    21      // query save-state storage req.
  60. #define INT33_SAVESTATE         22      // save driver state
  61. #define INT33_RESTORESTATE      23      // restore driver state
  62. #define INT33_SETALTUSERSUB     24      // set alternate call mask/address
  63. #define INT33_QUERYALTUSERSUB   25      // query alternate call mask/address
  64. #define INT33_SETSENSITIVITY    26      // set mickeys/pixel, dbl-speed thres.
  65. #define INT33_QUERYSENSITIVITY  27      // query mickeys/pixel, dbl-speed thres.
  66. #define INT33_SETINTERRUPTRATE  28      // set interrupt rate (inport only)
  67. #define INT33_SETPOINTERCOLOR   28      // set pointer color
  68. #define INT33_SETCRTPAGE        29      // set CRT page #
  69. #define INT33_QUERYCRTPAGE      30      // query CRT page #
  70. #define INT33_DISABLEDRIVER     31      // disable driver
  71. #define INT33_ENABLEDRIVER      32      // enable driver
  72. #define INT33_SOFTWARERESET     33      // more complete mouse reset
  73. #define INT33_SETLANGUAGE       34      // set language #
  74. #define INT33_QUERYLANGUAGE     35      // query language #
  75. #define INT33_QUERYMOUSEVERSION 36      // query mouse version, type, and IRQ
  76. #define INT33_MAXFUNC           INT33_QUERYMOUSEVERSION
  77.  
  78. #define INT33_ERROR             -1      // error return in AX of INT 33 function
  79.  
  80. #define MAX_PTRWIDTH            2       // maximum # bytes across
  81. #define MAX_PTRHEIGHT           16      // maximum # bytes in height
  82.  
  83. #define BUTTON_LEFT             0       // button ordinals
  84. #define BUTTON_RIGHT            1
  85. #define BUTTON_CENTER           2
  86.  
  87. #define BUTBIT_LEFT             0x0001  // button bit positions
  88. #define BUTBIT_RIGHT            0x0002
  89. #define BUTBIT_CENTER           0x0004
  90.  
  91. #define CALLMASK_MOTION         0x0001  // motion
  92. #define CALLMASK_LEFTDOWN       0x0002  // LEFT button down
  93. #define CALLMASK_LEFTUP         0x0004  // LEFT button up
  94. #define CALLMASK_RIGHTDOWN      0x0008  // RIGHT button down
  95. #define CALLMASK_RIGHTUP        0x0010  // RIGHT button up
  96. #define CALLMASK_SHIFTBUTTON    0x0020  // SHIFT key held while button up/down
  97. #define CALLMASK_CTRLBUTTON     0x0040  // CTRL key held while button up/down
  98. #define CALLMASK_ALTBUTTON      0x0080  // ALT key held while button up/down
  99. #define CALLMASK_CENTERDOWN     0x0100  // CENTER button down
  100. #define CALLMASK_CENTERUP       0x0200  // CENTER button up
  101. #define CALLMASK_ALLOWED        0x03FF
  102. #define CALLMASK_BUTTONSHIFTS   (CALLMASK_SHIFTBUTTON | \
  103.                                  CALLMASK_CTRLBUTTON  | \
  104.                                  CALLMASK_ALTBUTTON)
  105.  
  106. #define CALL12MASK_CENTERDOWN   0x0020  // CENTER button down (SETUSERSUB only)
  107. #define CALL12MASK_CENTERUP     0x0040  // CENTER button up (SETUSERSUB only)
  108. #define CALL12MASK_ALLOWED      0x007F
  109.  
  110.  
  111. #define DEF_XMICKEYS    8               // (x_pixel)
  112. #define DEF_YMICKEYS    16              // (y_pixel)
  113. #define DEF_XMICKEYS_J  4               // (x_pixel) J-DOS
  114. #define DEF_YMICKEYS_J  4               // (y_pixel) J-DOS
  115.  
  116. #define DEF_XMICSSCALE  50              // range 0-100
  117. #define DEF_YMICSSCALE  50              // range 0-100
  118. #define DEF_THRESHOLDSCALE      50      // range 0-100
  119.  
  120. #define DEF_TEXTANDMASK 0xffff          // (DfltTextAndMask)
  121. #define DEF_TEXTXORMASK 0x7700          // (DfltTextXorMask)
  122.  
  123. #define DEF_THRESHOLD   64
  124. #define DEF_THRESHOLD_J 0x7fff          // disable threshold
  125.                                         // function in J-DOS.
  126. #define DEF_COLOR       15              // pointer color
  127.  
  128. #endif
  129.  
  130.  
  131. #ifdef  INCL_VMOUSESYSREQ
  132.  
  133. /***    VMSE constants
  134.  */
  135.  
  136. #define VMD_NAME "VMOUSE$"              // name of VMD
  137.  
  138. /***    VMSE functions for use by PMVDMP
  139.  */
  140.  
  141. #define VMSESYSREQ_SETACCESS    1       // obtain exclusive access for VDM
  142. #define VMSESYSREQ_SETFOCUS     2       // notify VDM is gaining/losing focus
  143. #define VMSESYSREQ_POSTMOUSE    3       // send mouse events to a VDM
  144. #define VMSESYSREQ_MAX          3
  145.  
  146. #endif
  147.  
  148.  
  149. #ifdef  INCL_VMOUSEDEVREQ
  150.  
  151. /***EK+ VMD constants
  152.  */
  153.  
  154. #define VMDEVREQ_REGISTER       1       // VMD-defined functions for
  155. #define VMDEVREQ_SETSIZE        2       // communication from VVD to VMD
  156. #define VMDEVREQ_SEAMLESS       3       // Seamless notification
  157. #define VMDEVREQ_PROTINT33      4       // VDPX to VMD for Pmode Int 33h calls
  158. #define VMDEVREQ_DPMITASK       5       // DPMI program start/stop notification
  159. /*end*/
  160.  
  161.  
  162. /***ET+ VMD VDHRequestVDD communication structures
  163.  *
  164.  *  VMREG is the input packet passed with the VMDEVREQ_REGISTER request
  165.  *  from a VVD, and contains all the functions required by VMD of every
  166.  *  supported VVD, which are:
  167.  *
  168.  *      Show pointer
  169.  *      Hide pointer
  170.  *      Define text pointer
  171.  *      Define graphics pointer
  172.  *      Enable/disable light pen emulation
  173.  *
  174.  *  VMFUNC is the output packet filled in on the same (VMDEVREQ_REGISTER)
  175.  *  request.  It points to the following functions:
  176.  *
  177.  *      VDM Light pen request (to call only when light pen emulation enabled)
  178.  *
  179.  *  VMSSIZE is the input packet passed with the VMDEVREQ_SETSIZE request
  180.  *  from a VVD, and defines the current video mode (or -1 if unknown),
  181.  *  physical screen dimensions, and cell size.  There is no output packet
  182.  *  for this request.
  183.  */
  184.  
  185. typedef BOOL (*EXPENTRY PFNSHOWPTR)(HVDM, ULONG, ULONG);
  186. typedef BOOL (*EXPENTRY PFNHIDEPTR)(HVDM);
  187. typedef BOOL (*EXPENTRY PFNDEFTEXT)(HVDM, ULONG, ULONG, BOOL);
  188. typedef BOOL (*EXPENTRY PFNDEFGRAPH)(HVDM, PUSHORT, ULONG, ULONG);
  189. typedef BOOL (*EXPENTRY PFNSETPAGE)(HVDM, ULONG);
  190. typedef BOOL (*EXPENTRY PFNSETLPEN)(HVDM, BOOL);
  191. typedef BOOL (EXPENTRY *PFNSETCOLOR)(HVDM, ULONG);
  192.  
  193. typedef struct vmreg_s {                /* vmreg */
  194.     ULONG       vmreg_nb;               // size of structure, in bytes (24)
  195.     PFNSHOWPTR  vmreg_pfnShowPtr;       // ptr to show pointer fn.
  196.     PFNHIDEPTR  vmreg_pfnHidePtr;       // ptr to hide pointer fn.
  197.     PFNDEFTEXT  vmreg_pfnDefTextPtr;    // ptr to define text pointer fn.
  198.     PFNDEFGRAPH vmreg_pfnDefGraphPtr;   // ptr to define graphics pointer fn.
  199.     PFNSETPAGE  vmreg_pfnSetVideoPage;  // ptr to set video page fn.
  200.     PFNSETLPEN  vmreg_pfnSetLPenEm;     // ptr to enable/disable lpen fn.
  201.     PFNSETCOLOR vmreg_pfnSetPtrColor;   // ptr to set pointer color fn.
  202. } VMREG;
  203.  
  204. typedef VMREG *PVMREG;
  205.  
  206.  
  207. typedef struct vmstat_s {
  208.     BOOL    vmstat_fPtrHidden;          // visual pointer status
  209.     ULONG   vmstat_x;                   // current virtual position
  210.     ULONG   vmstat_y;
  211.     ULONG   vmstat_flButtons;           // current button status (see BUTBITs)
  212. } VMSTAT;
  213.  
  214. typedef VMSTAT *PVMSTAT;
  215.  
  216. typedef BOOL (*EXPENTRY PFNQUERYSTAT)(HVDM, PVMSTAT);
  217.  
  218. typedef struct vmfunc_s {               /* vmfunc */
  219.     ULONG        vmfunc_nb;             // size of structure, in bytes (8)
  220.     PFNQUERYSTAT vmfunc_pfnQueryStatus; // ptr to query virtual status proc.
  221. } VMFUNC;
  222.  
  223. typedef VMFUNC *PVMFUNC;
  224.  
  225. typedef struct vmss_s {                 /* vmss */
  226.     ULONG   vmss_nb;                    // size of structure, in bytes (36)
  227.     LONG    vmss_lMode;                 // video mode (eg, 00h-13h, or -1)
  228.     ULONG   vmss_ulWidth;               // width of screen, in pixels
  229.     ULONG   vmss_ulHeight;              // height of screen, in pixels
  230.     ULONG   vmss_ulCellWidth;           // width of screen cells, in pixels
  231.     ULONG   vmss_ulCellHeight;          // height of screen cells, in pixels
  232.     ULONG   vmss_ulPtrWidth;            // width of pointer drawing size, in pixels
  233.     ULONG   vmss_ulPtrHeight;           // height of pointer drawing size, in pixels
  234.     ULONG   vmss_ulPtrUnitWidth;        // width of pointer drawing unit, in pixels
  235. } VMSSIZE;
  236.  
  237. typedef VMSSIZE *PVMSSIZE;
  238. /*end*/
  239.  
  240. #endif  // INCL_VMOUSEDEVREQ
  241.  
  242. #endif /* __VMD__ */
  243.  
  244. #pragma checkout( suspend )
  245.    #ifndef __CHKHDR__
  246.       #pragma checkout( resume )
  247.    #endif
  248. #pragma checkout( resume )
  249.