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