home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ddkx86v2.zip / DDKX86 / DBCSDD / H / PMWINX.H < prev    next >
C/C++ Source or Header  |  1995-04-14  |  16KB  |  402 lines

  1. /*DDK*************************************************************************/
  2. /*                                                                           */
  3. /* COPYRIGHT    Copyright (C) 1995 IBM Corporation                           */
  4. /*                                                                           */
  5. /*    The following IBM OS/2 WARP source code is provided to you solely for  */
  6. /*    the purpose of assisting you in your development of OS/2 WARP device   */
  7. /*    drivers. You may use this code in accordance with the IBM License      */
  8. /*    Agreement provided in the IBM Device Driver Source Kit for OS/2. This  */
  9. /*    Copyright statement may not be removed.                                */
  10. /*                                                                           */
  11. /*****************************************************************************/
  12. /* NOINC */
  13. #ifdef __IBMC__
  14.    #pragma checkout( suspend )
  15.       #ifndef __CHKHDR__
  16.          #pragma checkout( suspend )
  17.       #endif
  18.    #pragma checkout( resume )
  19. #endif
  20. /* INC */
  21.  
  22. #define PMWINP_INCLUDED
  23.  
  24. #ifndef INCL_32         /* If neither INCL_32 or INCL_16 set already */
  25.    #ifndef INCL_16      /* find out from compiler if 32-bit or not.  */
  26.      #ifdef M_I386
  27.         #define INCL_32 /* Compiling for 32-bit */
  28.      #else
  29.         #define INCL_16 /* Compiling for 16-bit */
  30.      #endif
  31.   #endif
  32. #endif
  33.  
  34. #ifndef INCL_WINP_SELECTIVE
  35. #define INCL_WINP_ALL
  36. #endif
  37.  
  38. #ifdef INCL_WINP_ALL
  39. #define INCL_WINP_SEI
  40. #define INCL_WINP_FSRS
  41. #define INCL_WINP_MISC
  42. #define INCL_WINP_WININSTDATA
  43. #define INCL_WINP_DISP32
  44. #endif
  45. #define WPTR_ARROW          32512
  46. #define WPTR_UPARROW        32516
  47. #define WPTR_CROSS          32515
  48. #define WPTR_IBEAM          32513
  49. #define WPTR_ICON           32641
  50. #define WPTR_SIZE           32640
  51. #define WPTR_SIZENS         32645
  52. #define WPTR_SIZEWE         32644
  53. #define WPTR_SIZENWSE       32642
  54. #define WPTR_SIZENESW       32643
  55. #define WPTR_WAIT           32514
  56.  
  57. #ifndef RC_INVOKED
  58.  
  59. #ifdef INCL_WINP_SEI
  60. #ifndef SEI_PMWIN                                                       /*@D7D*/
  61.   #define SEI_PMWINP                                                    /*@D7D*/
  62.   #include <pmsei.h>                                                    /*@D7D*/
  63. #endif /*SEI_PMWIN*/                                                    /*@D7D*/
  64. #endif /* INCL_WINP_SEI */
  65.  
  66. #ifdef INCL_WINP_FSRS
  67.  
  68. /* Fast, Safe RAM Semaphore declarations */
  69.  
  70. typedef struct _FSRSEM {  /* fsrs */
  71.     USHORT Length;
  72.     USHORT Padding;
  73.     USHORT ProcID;
  74.     USHORT ThrdID;
  75.     USHORT Usage;
  76.     USHORT Client;
  77.     ULONG  Timeout;
  78.     ULONG  RAMsem;
  79. } FSRSEM;
  80. typedef FSRSEM *PFSRSEM;
  81.  
  82. int   APIENTRY FSRSemEnter( PFSRSEM );
  83.  
  84. VOID  APIENTRY FSRSemLeave( PFSRSEM );
  85.  
  86. VOID  APIENTRY FSRSemExit( PFSRSEM );
  87.  
  88. ULONG APIENTRY FSRSemCheck(  PFSRSEM );
  89.  
  90. int   APIENTRY FSRSemEnterP( ULONG, PFSRSEM );
  91.  
  92. #endif /* INCL_WINP_FSRS */
  93. #define EXLST_PRTY_UNLOCK       0x1080      /* Unlock DLL: free semaphores, etc */
  94. #define EXLST_PRTY_PMDRIVERS    0xad00      /* Drivers: display, printers */
  95. #endif /* RC_INVOKED */
  96.  
  97. #ifdef INCL_WINP_MISC
  98.  
  99. #ifndef RC_INVOKED
  100. #define HK_PREACCEL                 17
  101. /* InputGetDeviceInfo declarations */
  102.  
  103. typedef struct _INPUTINFO {   /* inpi */
  104.     USHORT KbdType;
  105.     USHORT NumFunc;
  106.     USHORT HasBreak;
  107.     USHORT MouType;
  108.     USHORT NumButtons;
  109.     USHORT NumMickeys;
  110. } INPUTINFO;
  111. typedef INPUTINFO FAR *PINPUTINFO;
  112.  
  113. int  APIENTRY InputGetDeviceInfo( PINPUTINFO );
  114. typedef struct _KBDEVENT {    /* kevt */
  115.     BYTE monFlags;          /* Open, Close and Flush monitor flags */
  116.     BYTE scancode;          /* Original scan code (actually high byte of
  117.                                monitor flags */
  118.     BYTE xlatedchar;        /* Output of interrupt level character translation
  119.                                table */
  120.  
  121.     BYTE xlatedscan;        /* Translated scan code.  Different only for
  122.                                the enhanced keyboard */
  123.  
  124.     USHORT shiftDBCS;         /* DBCS shift state and status */
  125.     USHORT shiftstate;        /* Current state of shift keys */
  126.     ULONG time;             /* millisecond counter time stamp */
  127.     USHORT ddFlags;           /* Keyboard device driver flags */
  128. } KBDEVENT;
  129. typedef KBDEVENT *PKBDEVENT;
  130. /* Valid values for ddFlags field */
  131. #define KDD_MULTIMAKE   0x0100
  132. #define KDD_BREAK       0x0040
  133.  
  134. #define KDD_EXTENDEDKEY 0x0020  /* added for dcr 357 */
  135. /* Valid values for KDD_ACTIONFIELD portion of ddFlags field */
  136. #define KDD_SHIFTKEY    0x0007
  137. #define KDD_PAUSEKEY    0x0008
  138. #define KDD_BREAKKEY    0x0011
  139. #define KDD_PSEUDOBREAK 0x0012
  140. #ifdef INCL_32
  141. #define DebugOutput Debug32Output
  142. int     APIENTRY Debug32Output( PCH );
  143. #else
  144. int     APIENTRY DebugOutput( PCH );
  145. #endif
  146. #endif      /* RC_INVOKED */
  147.  
  148.  
  149.  
  150. /* Input Translation Tables */
  151.  
  152. /* Valid values for idKeyboardType field */
  153. #define KB_AT         0       /* PC/AT physical keyboard */
  154. #define KB_ENHANCED   1       /* Enhanced PC/AT physical keyboard */
  155. #define KB_SUPERSPORT 2       /* Supersport physical keyboard   @D1A  */
  156. #define KB_JAGUAR     3       /* Jaguar physical keyboard PeteR Jaguar */
  157. #define KBD_MSG  0x0200       /* Offset to add when looking up layout names */
  158.  
  159. /* Valid values for idNationalKeyboard field */
  160. #define LG_VKEY       1       /* VKey translation table */
  161. #define LG_BE         2       /* Belgium translation table */
  162. #define LG_CF         3       /* Canadian-French translation table */
  163. #define LG_DK         4       /* Denmark translation table */
  164. #define LG_FR         5       /* France translation table */
  165. #define LG_GR         6       /* Germany translation table */
  166. #define LG_IT         7       /* Italy translation table */
  167. #define LG_LA         8       /* Latin-American Spanish translation table */
  168. #define LG_NL         9       /* Netherlands translation table */
  169. #define LG_NO        10       /* Norway translation table */
  170. #define LG_PO        11       /* Portugal translation table */
  171. #define LG_SF        12       /* Swiss-French translation table */
  172. #define LG_SG        13       /* Swiss-German translation table */
  173. #define LG_SP        14       /* Spain translation table */
  174. #define LG_SU        15       /* Finland translation table */
  175. #define LG_SV        16       /* Sweden translation table */
  176. #define LG_UK        17       /* United Kingdom translation table */
  177. #define LG_US        18       /* United States translation table */
  178. #define LG_FR_NEW    19       /* New French layout */
  179. #define LG_IT_NEW    20       /* New Italian layout */
  180. #define LG_UK_NEW    21       /* New British layout */
  181. #define LG_TR        22         /* Turkish */
  182. #define LG_CS        23         /* Czech */
  183. #define LG_CS_NEW    24         /* New Czech */
  184. #define LG_HU        25         /* Hungarian */
  185. #define LG_YU        26         /* Yugoslav */
  186. #define LG_PL        27         /* Polish */
  187. #define LG_IC        28         /* Icelandic */
  188. #define LG_BR        29         /* Brazil */
  189. #define LG_ALPHANUMERIC 0x50
  190. #define LG_KATAKANA     0x51
  191. #define LG_KATAR        0x52
  192. #define LG_HIRAGANA     0x53
  193. #define LG_HIRAR        0x54
  194. /* Valid values for iOutputType field */
  195. #define OUT_GLYPH     0       /* Table outputs a glyph */
  196. #define OUT_VKEY      1       /* Table outputs a vkey  */
  197.  
  198.  
  199.  
  200. #ifndef RC_INVOKED
  201.  
  202. typedef struct _VKEYGLYPHXLATETBL { /* vkglxl */
  203.     USHORT    cbHeader;       /* size of fixed header (this structure) */
  204.     USHORT    signature;      /* Signature USHORT */
  205.     USHORT    idKeyboardtype; /* PC/AT or enhanced keyboard */
  206.     USHORT    idNationalKeyboard; /* National keyboard identity */
  207.     USHORT    iOutputType;    /* Table returns glyph or vkey */
  208.     USHORT    cShiftKeys;     /* number of shift keys */
  209.     USHORT    offShiftKeys;   /* offset to shift key table */
  210.     USHORT    cTglKeys;       /* number of toggle keys */
  211.     USHORT    offTglKeys;     /* offset to toggle key table */
  212.     USHORT    cShiftStates;   /* number of shift states */
  213.     USHORT    offShiftXLate;  /* offset to shift state translation table */
  214. } VKEYGLYPHXLATETBL;
  215. typedef VKEYGLYPHXLATETBL FAR *PVKEYGLYPHXLATETBL;
  216.  
  217.  
  218. typedef struct _VKEYGLYPHXLATETBL2 { /* vkglxl2 */
  219.     USHORT    cbHeader;       /* size of fixed header (this structure) */
  220.     USHORT    signature;      /* Signature USHORT */
  221.     USHORT    idKeyboardtype; /* PC/AT or enhanced keyboard */
  222.     USHORT    idNationalKeyboard; /* National keyboard identity */
  223.     USHORT    iOutputType;    /* Table returns glyph or vkey */
  224.     USHORT    cShiftKeys;     /* number of shift keys */
  225.     USHORT    offShiftKeys;   /* offset to shift key table */
  226.     USHORT    cTglKeys;       /* number of toggle keys */
  227.     USHORT    offTglKeys;     /* offset to toggle key table */
  228.     USHORT    cShiftStates;   /* number of shift states */
  229.     USHORT    offShiftXLate;  /* offset to shift state translation table */
  230.     USHORT    offTglKeys2;    /* offset to toggle key table(new format) @NSJ200322 */
  231. } VKEYGLYPHXLATETBL2;
  232. typedef VKEYGLYPHXLATETBL2 FAR *PVKEYGLYPHXLATETBL2;
  233.  
  234. /* Valid value for signature field */
  235. #define VKEYGLYPHXLATETBL_SIG     0x4758  /* Signature value = 'GX' */
  236.  
  237.  
  238. typedef struct _SHIFTKEYS {     /* scsh */
  239.     BYTE    rgShiftKeys[ 1 ];       /* scan code for each shift key */
  240.     BYTE    rgShiftPriority[ 1 ];   /* priority of this shift key (1-8) */
  241. } SHIFTKEYS[];
  242.  
  243. /* The shift state priority is used to compute the shift state bit for each */
  244. /* shift key.  For example, the standard PC-AT keyboard has the following   */
  245. /* shift key table:                                                         */
  246. /*                                                                          */
  247. /*     DB Alt, Ctrl, LeftShift, RightShift                                  */
  248. /*     DB 3,   2,    1,         1                                           */
  249. /* The following flag, if set in the rgShiftPriority field, causes the      */
  250. /* a down transition of this shift key to reset any toggle key that         */
  251. /* toggles this shift priority.  Used to implement ShiftLock key            */
  252. /* functionality                                                            */
  253. /*                                                                          */
  254.  
  255. #define XL_TOGGLERESET  0x80
  256.  
  257.  
  258. typedef struct _TOGGLEKEYS {    /* sctg */
  259.     BYTE    rgTglKeys[ 1 ];     /* scan code for each toggle key */
  260.     USHORT  rgoffTglInfo[ 1 ];  /* offset to toggle key information */
  261. } TOGGLEKEYS[];
  262.  
  263. typedef struct _TOGGLEKEYS2 {   /* sctg2 */
  264.     BYTE    rgTglKeys[ 1 ];     /* scan code for each toggle key */
  265.     USHORT  rgoffTglInfo[ 1 ];  /* offset to toggle key information */
  266.     BYTE    rgTglShiftState[ 1 ];/* shift state for each toggle key @NSJ200322 */
  267. } TOGGLEKEYS2[];
  268.  
  269. #define tglshft_base_state               0x00
  270. #define tglshft_shift_state              0x01
  271. #define tglshft_ctrl_state               0x02
  272. #define tglshft_ctrl_shift_state         0x03
  273. #define tglshft_alt_state                0x04
  274. #define tglshft_alt_shift_state          0x05
  275. #define tglshft_alt_ctrl_state           0x06
  276. #define tglshft_alt_ctrl_shift_state     0x07
  277.  
  278.  
  279. typedef struct _TOGGLEINFO {    /* tgi */
  280.     BYTE    nTglShiftPri;       /* Shift key priority to toggle */
  281.     BYTE    cTglKeyRanges;      /* #scan code ranges for this toggle key */
  282.     USHORT  rgTglKeys[ 1 ];     /* scan code ranges */
  283. } TOGGLEINFO;
  284.                                 /* Low byte is low scan code of range and */
  285.                                 /* High byte is high scan code of range */
  286.  
  287.  
  288. typedef struct _SHIFTXLATE {    /* shxl */
  289.     USHORT    rgoffScanXLate[ 1 ];/* offset to scan code xlates for shift state */
  290. } SHIFTXLATE;
  291.  
  292.  
  293. typedef struct _SCANXLATE {     /* scxl */
  294.     USHORT  cScanRanges;        /* number of distinct scan code ranges */
  295.     BYTE    bScanLow;           /* Low value of first scan code range */
  296.     BYTE    bScanHigh;          /* High value of first scan code range */
  297.     USHORT  rgScanXLate[ 1 ];   /* Array of translations for each scan code
  298.                                    in range */
  299. } SCANXLATE;
  300.  
  301.  
  302. /* Valid values for elements of rgScanXLate array */
  303. #define XL_NOXLATE      0x0000
  304. #define XL_NOTENHANCED  0x00FF                                     /* @D1A */
  305. #define XL_GLYPHMASK    0x7FFF
  306. #define XL_VKEYMASK     0x00FF
  307. #define XL_VKEYBITS     0x7F00
  308.  
  309. /* The high order bit is always returned as zero */
  310. /* Internally, high bit is used for controlling the translation process */
  311. #define XL_NORETRY      0x8000
  312.  
  313.  
  314. typedef struct _CHARXLATETBL {  /* chxl */
  315.     USHORT    cbHeader;       /* size of fixed header (this structure) */
  316.     USHORT    signature;      /* Signature word */
  317.     USHORT    idCodePage;     /* code page that this table is for */
  318.     USHORT    cGlyphRanges;   /* number of glyph ranges */
  319.     USHORT    offGlyphTbl;    /* Offset to glyph ranges */
  320.     USHORT    cCharRanges;    /* number of character ranges */
  321.     USHORT    offCharTbl;     /* Offset to character ranges */
  322. } CHARXLATETBL;
  323. typedef CHARXLATETBL FAR *PCHARXLATETBL;
  324.  
  325. /* Valid value for signature field */
  326. #define CHARXLATETBL_SIG    0x4358  /* Signature value = 'CX' */
  327.  
  328. typedef struct _GLYPHTBL {  /* gltb */
  329.     USHORT wGlyphLow;         /* Low glyph for this range */
  330.     USHORT wGlyphHigh;        /* High glyph for this range */
  331.     USHORT rgChars[ 1 ];      /* Character code for each glyph in range */
  332. } GLYPHTBL;
  333.                             /* High byte valid only if low byte is a       */
  334.                             /* valid DBCS prefix character (i.e. contained */
  335.                             /* in DBCSTBL).  Word of zeros means that      */
  336.                             /* no code point in code page for this glyph   */
  337.  
  338. typedef struct _CHARTBL {   /* chtb */
  339.     USHORT wCharLow;          /* Low character for this range */
  340.     USHORT wCharHigh;         /* High character for this range */
  341.     USHORT rgGlyphs[ 1 ];     /* Glyph code for each character in range */
  342. } CHARTBL;
  343.  
  344. typedef struct _DKEYTBL {   /* dktb */
  345.     USHORT wDKeyLow;          /* Low glyph for this range */
  346.     USHORT wDKeyHigh;         /* High glyph for this range */
  347.     USHORT rgoffDKeyInfo[ 1 ];/* Deadkey info for each glyph in range */
  348. } DKEYTBL;
  349.  
  350. typedef struct _DKEYINFO {  /* dki */
  351.     USHORT cDKeyComb;         /* number of valid deadkey combinations */
  352.     USHORT rgDKeyComb[ 1 ];   /* Second glyph in deadkey combination */
  353.     USHORT rgDKeyGlyph[ 1 ];  /* Resulting glyph for corresponding comb */
  354. } DKEYINFO;
  355.  
  356.  
  357. PVKEYGLYPHXLATETBL APIENTRY WinLoadVKeyGlyphXlateTbl(HAB, HMODULE, USHORT, USHORT, USHORT);
  358. PCHARXLATETBL      APIENTRY WinLoadCharXlateTbl(HAB, HMODULE, USHORT);
  359. PVKEYGLYPHXLATETBL APIENTRY WinSetVKeyGlyphXlateTbl(PVKEYGLYPHXLATETBL, USHORT);
  360. PCHARXLATETBL      APIENTRY WinSetCharXlateTbl(HMQ, PCHARXLATETBL);
  361. USHORT             APIENTRY WinQueryProcessCP( VOID );
  362. #endif      /* RC_INVOKED */
  363.  
  364. /* IDS for separators in system menu */
  365. #define SMID_SEPARATOR1  -2
  366. #define SMID_SEPARATOR2  -3
  367. #endif /* INCL_WINP_MISC */
  368.  
  369. #ifdef INCL_WINP_SELSERVER
  370. USHORT APIENTRY SSAllocSeg(USHORT cb, PSEL ps, USHORT fsAttr);
  371. USHORT APIENTRY SSFreeSeg(SEL s);
  372. #endif /* INCL_WINP_SELSERVER */
  373. #ifdef INCL_WINPOINTERS
  374.  
  375. #ifdef KITTYHAWK
  376. /* system bitmap constants for closebutton */
  377. #define SBMP_CLOSEBUTTON           50
  378. #define SBMP_CLOSEBUTTONDEP        51
  379. #endif
  380. #endif      /* INCL_WINPOINTERS */
  381. #ifdef INCL_WINP_WININSTDATA
  382. ULONG   APIENTRY WinVisRegionNotify(HDC hdc);
  383. #endif /* INCL_WINP_WININSTDATA */
  384. #ifdef INCL_WINHELP
  385. typedef HWND (EXPENTRY FNCHI)(HAB, PHELPINIT);         /* WinCreateHelpInstance    */
  386. typedef FNCHI FAR *PFNCHI;
  387. typedef BOOL (EXPENTRY FNDHI)(HWND);                   /* WinDestroyHelpInstance   */
  388. typedef FNDHI FAR *PFNDHI;
  389. typedef BOOL (EXPENTRY FNAHI)(HWND, HWND);             /* WinAssociateHelpInstance */
  390. typedef FNAHI FAR *PFNAHI;
  391. #endif
  392.  
  393. /* NOINC */
  394. #ifdef __IBMC__
  395.    #pragma checkout( suspend )
  396.       #ifndef __CHKHDR__
  397.          #pragma checkout( resume )
  398.       #endif
  399.    #pragma checkout( resume )
  400. #endif
  401. /* INC */
  402.