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