home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ddkx86v1.zip / DDKX86 / H / PMWINX.H < prev    next >
C/C++ Source or Header  |  1995-04-14  |  17KB  |  423 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. APIRET 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.    /* NOINC */
  142.    #define DebugOutput Debug32Output
  143.    /* INC */
  144.    int     APIENTRY Debug32Output( PCH );
  145. #else
  146.    int     APIENTRY DebugOutput( PCH );
  147. #endif
  148. #endif      /* RC_INVOKED */
  149.  
  150.  
  151.  
  152. /* Input Translation Tables */
  153.  
  154. /* Valid values for idKeyboardType field */
  155. #define KB_AT         0       /* PC/AT physical keyboard */
  156. #define KB_ENHANCED   1       /* Enhanced PC/AT physical keyboard */
  157. #define KB_SUPERSPORT 2       /* Supersport physical keyboard   @D1A  */
  158. #define KB_JAGUAR     3       /* Jaguar physical keyboard PeteR Jaguar */
  159. /* endif DDK*/
  160.  
  161.  
  162. #define KBID_AT       1          /* Hardware generated AT ID          @D1A */
  163. #define KBID_SUPERSPORT  0xAB85  /* Hardware generated Supersport ID  @D1A */
  164. #define KBID_JAGUAR      0xAB86  /* Hardware generated Jaguar ID  PeteR Jaguar */
  165. #ifdef INCL_NLS                  /* @JD0A */
  166. #define KB_DBCSFIRST  0x0002     /* @JD0A */
  167. #define KB_DBCSLAST   0x0010     /* @JD0A */
  168. #endif /* INCL_NLS */            /* @JD0A */
  169.  
  170. /* if DDK */
  171. #define KBD_MSG  0x0200       /* Offset to add when looking up layout names */
  172.  
  173. /* Valid values for idNationalKeyboard field */
  174. #define LG_VKEY       1       /* VKey translation table */
  175. #define LG_BE         2       /* Belgium translation table */
  176. #define LG_CF         3       /* Canadian-French translation table */
  177. #define LG_DK         4       /* Denmark translation table */
  178. #define LG_FR         5       /* France translation table */
  179. #define LG_GR         6       /* Germany translation table */
  180. #define LG_IT         7       /* Italy translation table */
  181. #define LG_LA         8       /* Latin-American Spanish translation table */
  182. #define LG_NL         9       /* Netherlands translation table */
  183. #define LG_NO        10       /* Norway translation table */
  184. #define LG_PO        11       /* Portugal translation table */
  185. #define LG_SF        12       /* Swiss-French translation table */
  186. #define LG_SG        13       /* Swiss-German translation table */
  187. #define LG_SP        14       /* Spain translation table */
  188. #define LG_SU        15       /* Finland translation table */
  189. #define LG_SV        16       /* Sweden translation table */
  190. #define LG_UK        17       /* United Kingdom translation table */
  191. #define LG_US        18       /* United States translation table */
  192. #define LG_FR_NEW    19       /* New French layout */
  193. #define LG_IT_NEW    20       /* New Italian layout */
  194. #define LG_UK_NEW    21       /* New British layout */
  195. #define LG_TR        22         /* Turkish */
  196. #define LG_CS        23         /* Czech */
  197. #define LG_CS_NEW    24         /* New Czech */
  198. #define LG_HU        25         /* Hungarian */
  199. #define LG_YU        26         /* Yugoslav */
  200. #define LG_PL        27         /* Polish */
  201. #define LG_IC        28         /* Icelandic */
  202. #define LG_BR        29         /* Brazil */
  203. #define LG_BR_NEW    34         /* New Brazilian layout */
  204. #define LG_ALPHANUMERIC 0x50
  205. #define LG_KATAKANA     0x51
  206. #define LG_KATAR        0x52
  207. #define LG_HIRAGANA     0x53
  208. #define LG_HIRAR        0x54
  209. /* Valid values for iOutputType field */
  210. #define OUT_GLYPH     0       /* Table outputs a glyph */
  211. #define OUT_VKEY      1       /* Table outputs a vkey  */
  212.  
  213.  
  214.  
  215. #ifndef RC_INVOKED
  216.  
  217. typedef struct _VKEYGLYPHXLATETBL { /* vkglxl */
  218.     USHORT    cbHeader;       /* size of fixed header (this structure) */
  219.     USHORT    signature;      /* Signature USHORT */
  220.     USHORT    idKeyboardtype; /* PC/AT or enhanced keyboard */
  221.     USHORT    idNationalKeyboard; /* National keyboard identity */
  222.     USHORT    iOutputType;    /* Table returns glyph or vkey */
  223.     USHORT    cShiftKeys;     /* number of shift keys */
  224.     USHORT    offShiftKeys;   /* offset to shift key table */
  225.     USHORT    cTglKeys;       /* number of toggle keys */
  226.     USHORT    offTglKeys;     /* offset to toggle key table */
  227.     USHORT    cShiftStates;   /* number of shift states */
  228.     USHORT    offShiftXLate;  /* offset to shift state translation table */
  229. } VKEYGLYPHXLATETBL;
  230. typedef VKEYGLYPHXLATETBL FAR *PVKEYGLYPHXLATETBL;
  231.  
  232.  
  233. typedef struct _VKEYGLYPHXLATETBL2 { /* vkglxl2 */
  234.     USHORT    cbHeader;       /* size of fixed header (this structure) */
  235.     USHORT    signature;      /* Signature USHORT */
  236.     USHORT    idKeyboardtype; /* PC/AT or enhanced keyboard */
  237.     USHORT    idNationalKeyboard; /* National keyboard identity */
  238.     USHORT    iOutputType;    /* Table returns glyph or vkey */
  239.     USHORT    cShiftKeys;     /* number of shift keys */
  240.     USHORT    offShiftKeys;   /* offset to shift key table */
  241.     USHORT    cTglKeys;       /* number of toggle keys */
  242.     USHORT    offTglKeys;     /* offset to toggle key table */
  243.     USHORT    cShiftStates;   /* number of shift states */
  244.     USHORT    offShiftXLate;  /* offset to shift state translation table */
  245.     USHORT    offTglKeys2;    /* offset to toggle key table(new format) @NSJ200322 */
  246. } VKEYGLYPHXLATETBL2;
  247. typedef VKEYGLYPHXLATETBL2 FAR *PVKEYGLYPHXLATETBL2;
  248.  
  249. /* Valid value for signature field */
  250. #define VKEYGLYPHXLATETBL_SIG     0x4758  /* Signature value = 'GX' */
  251.  
  252.  
  253. typedef struct _SHIFTKEYS {     /* scsh */
  254.     BYTE    rgShiftKeys[ 1 ];       /* scan code for each shift key */
  255.     BYTE    rgShiftPriority[ 1 ];   /* priority of this shift key (1-8) */
  256. } SHIFTKEYS[];
  257.  
  258. /* The shift state priority is used to compute the shift state bit for each */
  259. /* shift key.  For example, the standard PC-AT keyboard has the following   */
  260. /* shift key table:                                                         */
  261. /*                                                                          */
  262. /*     DB Alt, Ctrl, LeftShift, RightShift                                  */
  263. /*     DB 3,   2,    1,         1                                           */
  264. /* The following flag, if set in the rgShiftPriority field, causes the      */
  265. /* a down transition of this shift key to reset any toggle key that         */
  266. /* toggles this shift priority.  Used to implement ShiftLock key            */
  267. /* functionality                                                            */
  268. /*                                                                          */
  269.  
  270. #define XL_TOGGLERESET  0x80
  271.  
  272.  
  273. typedef struct _TOGGLEKEYS {    /* sctg */
  274.     BYTE    rgTglKeys[ 1 ];     /* scan code for each toggle key */
  275.     USHORT  rgoffTglInfo[ 1 ];  /* offset to toggle key information */
  276. } TOGGLEKEYS[];
  277.  
  278. typedef struct _TOGGLEKEYS2 {   /* sctg2 */
  279.     BYTE    rgTglKeys[ 1 ];     /* scan code for each toggle key */
  280.     USHORT  rgoffTglInfo[ 1 ];  /* offset to toggle key information */
  281.     BYTE    rgTglShiftState[ 1 ];/* shift state for each toggle key @NSJ200322 */
  282. } TOGGLEKEYS2[];
  283.  
  284. #define tglshft_base_state               0x00
  285. #define tglshft_shift_state              0x01
  286. #define tglshft_ctrl_state               0x02
  287. #define tglshft_ctrl_shift_state         0x03
  288. #define tglshft_alt_state                0x04
  289. #define tglshft_alt_shift_state          0x05
  290. #define tglshft_alt_ctrl_state           0x06
  291. #define tglshft_alt_ctrl_shift_state     0x07
  292.  
  293.  
  294. typedef struct _TOGGLEINFO {    /* tgi */
  295.     BYTE    nTglShiftPri;       /* Shift key priority to toggle */
  296.     BYTE    cTglKeyRanges;      /* #scan code ranges for this toggle key */
  297.     USHORT  rgTglKeys[ 1 ];     /* scan code ranges */
  298. } TOGGLEINFO;
  299.                                 /* Low byte is low scan code of range and */
  300.                                 /* High byte is high scan code of range */
  301.  
  302.  
  303. typedef struct _SHIFTXLATE {    /* shxl */
  304.     USHORT    rgoffScanXLate[ 1 ];/* offset to scan code xlates for shift state */
  305. } SHIFTXLATE;
  306.  
  307.  
  308. typedef struct _SCANXLATE {     /* scxl */
  309.     USHORT  cScanRanges;        /* number of distinct scan code ranges */
  310.     BYTE    bScanLow;           /* Low value of first scan code range */
  311.     BYTE    bScanHigh;          /* High value of first scan code range */
  312.     USHORT  rgScanXLate[ 1 ];   /* Array of translations for each scan code
  313.                                    in range */
  314. } SCANXLATE;
  315.  
  316.  
  317. /* Valid values for elements of rgScanXLate array */
  318. #define XL_NOXLATE      0x0000
  319. #define XL_NOTENHANCED  0x00FF                                     /* @D1A */
  320. #define XL_GLYPHMASK    0x7FFF
  321. #define XL_VKEYMASK     0x00FF
  322. #define XL_VKEYBITS     0x7F00
  323.  
  324. /* The high order bit is always returned as zero */
  325. /* Internally, high bit is used for controlling the translation process */
  326. #define XL_NORETRY      0x8000
  327.  
  328.  
  329. typedef struct _CHARXLATETBL {  /* chxl */
  330.     USHORT    cbHeader;       /* size of fixed header (this structure) */
  331.     USHORT    signature;      /* Signature word */
  332.     USHORT    idCodePage;     /* code page that this table is for */
  333.     USHORT    cGlyphRanges;   /* number of glyph ranges */
  334.     USHORT    offGlyphTbl;    /* Offset to glyph ranges */
  335.     USHORT    cCharRanges;    /* number of character ranges */
  336.     USHORT    offCharTbl;     /* Offset to character ranges */
  337. } CHARXLATETBL;
  338. typedef CHARXLATETBL FAR *PCHARXLATETBL;
  339.  
  340. /* Valid value for signature field */
  341. #define CHARXLATETBL_SIG    0x4358  /* Signature value = 'CX' */
  342.  
  343. typedef struct _GLYPHTBL {  /* gltb */
  344.     USHORT wGlyphLow;         /* Low glyph for this range */
  345.     USHORT wGlyphHigh;        /* High glyph for this range */
  346.     USHORT rgChars[ 1 ];      /* Character code for each glyph in range */
  347. } GLYPHTBL;
  348.                             /* High byte valid only if low byte is a       */
  349.                             /* valid DBCS prefix character (i.e. contained */
  350.                             /* in DBCSTBL).  Word of zeros means that      */
  351.                             /* no code point in code page for this glyph   */
  352.  
  353. typedef struct _CHARTBL {   /* chtb */
  354.     USHORT wCharLow;          /* Low character for this range */
  355.     USHORT wCharHigh;         /* High character for this range */
  356.     USHORT rgGlyphs[ 1 ];     /* Glyph code for each character in range */
  357. } CHARTBL;
  358.  
  359. typedef struct _DKEYTBL {   /* dktb */
  360.     USHORT wDKeyLow;          /* Low glyph for this range */
  361.     USHORT wDKeyHigh;         /* High glyph for this range */
  362.     USHORT rgoffDKeyInfo[ 1 ];/* Deadkey info for each glyph in range */
  363. } DKEYTBL;
  364.  
  365. typedef struct _DKEYINFO {  /* dki */
  366.     USHORT cDKeyComb;         /* number of valid deadkey combinations */
  367.     USHORT rgDKeyComb[ 1 ];   /* Second glyph in deadkey combination */
  368.     USHORT rgDKeyGlyph[ 1 ];  /* Resulting glyph for corresponding comb */
  369. } DKEYINFO;
  370.  
  371. #ifdef INCL_32
  372.    PVKEYGLYPHXLATETBL APIENTRY WinLoadVKeyGlyphXlateTbl(HAB, HMODULE, ULONG, ULONG, ULONG);
  373.    PCHARXLATETBL      APIENTRY WinLoadCharXlateTbl(HAB, HMODULE, ULONG);
  374.    PVKEYGLYPHXLATETBL APIENTRY WinSetVKeyGlyphXlateTbl(PVKEYGLYPHXLATETBL,ULONG);
  375.    PCHARXLATETBL      APIENTRY WinSetCharXlateTbl(HMQ, PCHARXLATETBL);
  376.    ULONG              APIENTRY WinQueryProcessCP( VOID );
  377. #else
  378.    PVKEYGLYPHXLATETBL APIENTRY WinLoadVKeyGlyphXlateTbl(HAB, HMODULE, USHORT, USHORT, USHORT);
  379.    PCHARXLATETBL      APIENTRY WinLoadCharXlateTbl(HAB, HMODULE, USHORT);
  380.    PVKEYGLYPHXLATETBL APIENTRY WinSetVKeyGlyphXlateTbl(PVKEYGLYPHXLATETBL, USHORT);
  381.    PCHARXLATETBL      APIENTRY WinSetCharXlateTbl(HMQ, PCHARXLATETBL);
  382.    USHORT             APIENTRY WinQueryProcessCP( VOID );
  383. #endif
  384. #endif      /* RC_INVOKED */
  385.  
  386. /* IDS for separators in system menu */
  387. #define SMID_SEPARATOR1  -2
  388. #define SMID_SEPARATOR2  -3
  389. #endif /* INCL_WINP_MISC */
  390.  
  391. #ifdef INCL_WINP_SELSERVER
  392. USHORT APIENTRY SSAllocSeg(USHORT cb, PSEL ps, USHORT fsAttr);
  393. USHORT APIENTRY SSFreeSeg(SEL s);
  394. #endif /* INCL_WINP_SELSERVER */
  395. #ifdef INCL_WINPOINTERS
  396.  
  397. /* system bitmap constants for closebutton */
  398. #define SBMP_CLOSEBUTTON           50
  399. #define SBMP_CLOSEBUTTONDEP        51
  400. #endif      /* INCL_WINPOINTERS */
  401. #ifdef INCL_WINP_WININSTDATA
  402. /* NOINC */
  403. #define WinVisRegionNotify          Win32VisRegionNotify
  404. /* INC */
  405. ULONG   APIENTRY Win32VisRegionNotify(HDC hdc);
  406. #endif /* INCL_WINP_WININSTDATA */
  407. #ifdef INCL_WINHELP
  408. typedef BOOL (EXPENTRY FNDHI)(HWND);                   /* WinDestroyHelpInstance   */
  409. typedef FNDHI FAR *PFNDHI;
  410. typedef BOOL (EXPENTRY FNAHI)(HWND, HWND);             /* WinAssociateHelpInstance */
  411. typedef FNAHI FAR *PFNAHI;
  412. #endif
  413.  
  414. /* NOINC */
  415. #ifdef __IBMC__
  416.    #pragma checkout( suspend )
  417.       #ifndef __CHKHDR__
  418.          #pragma checkout( resume )
  419.       #endif
  420.    #pragma checkout( resume )
  421. #endif
  422. /* INC */
  423.