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