home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / warphead.zip / H / PMBIDI.H < prev    next >
Text File  |  1997-08-17  |  17KB  |  385 lines

  1. /****************************** Module Header ******************************\
  2. *
  3. * Module Name: PMBIDI.H
  4. *
  5. * OS/2 Presentation Manager Window Manager - Bidirectional support include file.
  6. *
  7. * Copyright (c) International Business Machines Corporation 1993, 1994.
  8. *
  9. \***************************************************************************/
  10.  
  11. #ifndef PM_BIDI_INCLUDED    /* Eliminate multiple definitions... */
  12.    #define PM_BIDI_INCLUDED
  13.    
  14.    /************************************************************************/
  15.    /* Bidirectional languages support window messages                      */
  16.    /************************************************************************/
  17.    #define WM_SETBIDIATTR       0x0BD0
  18.    #define WM_QUERYBIDIATTR     0x0BD1
  19.    #define WM_SETBIDISTAT       0x0BD2
  20.    #define WM_QUERYBIDISTAT     0x0BD3
  21.    #define WM_KBDLAYERCHANGED   0x0BD4
  22.    
  23.    
  24.    /************************************************************************/
  25.    /*  Language Viewer messages                                            */
  26.    /************************************************************************/
  27.    #define WM_LANGVIEWINFOCHANGED   0x0BE0
  28.    #define WM_LANG_OPTIONS_DIALOG   0x0BE2
  29.    #define WM_LANGOPTIONSDIALOG     0x0BE2
  30.    
  31.    /* LVI values - indicating which Bidi information has changed */
  32.    
  33.    #define LVI_WND_BIDI_ATTR     1
  34.    #define LVI_WND_BIDI_STAT     2
  35.    #define LVI_FOCUS_CHANGE      3
  36.    #define LVI_KBD_LAYER         4
  37.    #define LVI_CSD               5
  38.    #define LVI_ALL             (-1)
  39.    
  40.    
  41.    
  42.    /* Possible return values from WM_SETBIDIATTR/WM_SETBIDISTAT */
  43.    #define SBI_MSG_NOT_PROCESSED   0L
  44.    #define SBI_MSG_PROCESSED       1L
  45.    #define SBI_MSG_PROCESSED_SELF  2L
  46.    
  47.    
  48.    /************************************************************************/
  49.    /* Bidirectional attributes masks                                       */
  50.    /************************************************************************/
  51.    #define BDAM_INIT               0x80000000
  52.    #define BDAM_LEVEL              0x70000000
  53.    #define BDAM_TEXTTYPE           0x01000000
  54.    #define BDAM_TEXT_ORIENTATION   0x00030000
  55.    #define BDAM_WND_ORIENTATION    0x00100000
  56.    #define BDAM_NUMERALS           0x00003000
  57.    #define BDAM_SYM_SWAP           0x00000100
  58.    #define BDAM_WORD_BREAK         0x00000200
  59.    #define BDAM_TEXT_SHAPE         0x000000FF
  60.    
  61.    #define BDAM_ALL    (BDAM_INIT             | \
  62.    BDAM_LEVEL            | \
  63.    BDAM_TEXTTYPE         | \
  64.    BDAM_TEXT_ORIENTATION | \
  65.    BDAM_WND_ORIENTATION  | \
  66.    BDAM_NUMERALS         | \
  67.    BDAM_SYM_SWAP         | \
  68.    BDAM_WORD_BREAK       | \
  69.    BDAM_TEXT_SHAPE         )
  70.    
  71.    /************************************************************************/
  72.    /* Bidirectional attributes values (in Bidi attributes word)            */
  73.    /*                                                                      */
  74.    /* Note: Value of the attributes must match the values in layout.h.     */
  75.    /************************************************************************/
  76.    #define BDA_INIT                0x80000000
  77.    #define BDA_LEVEL               0x30000000
  78.    
  79.    #define BDA_TEXTTYPE_VISUAL     0x00000000
  80.    #define BDA_TEXTTYPE_IMPLICIT   0x01000000
  81.    
  82.    #define BDA_WND_ORIENT_LTR      0x00000000
  83.    #define BDA_WND_ORIENT_RTL      0x00100000
  84.    
  85.    #define BDA_TEXT_ORIENT_LTR     0x00000000
  86.    #define BDA_TEXT_ORIENT_RTL     0x00010000
  87.    #define BDA_TEXT_ORIENT_DYNAMIC 0x00020000
  88.    #define BDA_TEXT_ORIENT_CONTEXT 0x00020000
  89.    
  90.    #define BDA_NUMERALS_NOMINAL    0x00000000
  91.    #define BDA_NUMERALS_PASSTHRU   0x00001000
  92.    #define BDA_NUMERALS_NATIONAL   0x00002000
  93.    #define BDA_NUMERALS_CONTEXTUAL 0x00003000
  94.    
  95.    #define BDA_SYM_SWAP_OFF        0x00000000
  96.    #define BDA_SYM_SWAP_ON         0x00000100
  97.    
  98.    #define BDA_WORD_BREAK_OFF      0x00000000
  99.    #define BDA_WORD_BREAK_ON       0x00000200
  100.    
  101.    #define BDA_TEXT_DISPLAY_SHAPED 0x00000000
  102.    #define BDA_TEXT_SAVE_SHAPED    0x00000001
  103.    #define BDA_TEXT_NOMINAL        0x00000010
  104.    #define BDA_TEXT_INITIAL        0x00000011
  105.    #define BDA_TEXT_MIDDLE         0x00000012
  106.    #define BDA_TEXT_FINAL          0x00000013
  107.    #define BDA_TEXT_ISOLATED       0x00000014
  108.    
  109.    
  110.    /************************************************************************/
  111.    /* Bidirectional attribute (BIDIATTR) as specified in a window template */
  112.    /* or in the resource script.                                           */
  113.    /************************************************************************/
  114.    #define BIDIPARAM                  PRESPARAMS
  115.    
  116.    #define PP_BDATTR_FIRST            0x100L  /* First BidiAttr PresParam  */
  117.    /*                           */
  118.    #define PP_BDATTR_ALL              0x101L  /* Set ALL Bidi attrs        */
  119.    /*                           */
  120.    #define PP_BDATTR_TEXTTYPE         0x102L  /* Text/Data type            */
  121.    #define PP_BDATTR_TEXT_ORIENTATION 0x103L  /* Text Orientation          */
  122.    #define PP_BDATTR_WND_ORIENTATION  0x104L  /* Window Orientation        */
  123.    #define PP_BDATTR_NUMERALS         0x105L  /* Arabic/Hindi Numerals     */
  124.    #define PP_BDATTR_SYM_SWAP         0x106L  /* Symetric Swapping         */
  125.    #define PP_BDATTR_WORD_BREAK       0x107L  /* Word break                */
  126.    #define PP_BDATTR_TEXT_SHAPE       0x108L  /* Char Shape Determination  */
  127.    /*                           */
  128.    #define PP_BDATTR_LAST             0x108L  /* Last BidiAttr PresParam   */
  129.    /*                           */
  130.    #define PP_BDSTATUS                0x110L  /* Bidirectional status flags*/
  131.    
  132.    
  133.    /************************************************************************/
  134.    /* Values used in Set/Query Bidirectional status word                   */
  135.    /************************************************************************/
  136.    #define BDS_HKFLAG_ENG_LAYER            0x00010000
  137.    #define BDS_HKFLAG_NAT_LAYER            0x00020000
  138.    #define BDS_HKFLAG_PUSH                 0x00040000
  139.    #define BDS_HKFLAG_END_PUSH             0x00080000
  140.    #define BDS_HKFLAG_AUTO_PUSH            0x00100000
  141.    #define BDS_HKFLAG_FIELD_REV            0x00200000
  142.    #define BDS_HKFLAG_SCREEN_REV           0x00400000
  143.    #define BDS_HKFLAG_STATUS_INDICATOR     0x02000000
  144.    
  145.    #define BDS_HKFLAG_DISPLAY_SHAPED       0x04000000
  146.    #define BDS_HKFLAG_INITIAL              0x08000000
  147.    #define BDS_HKFLAG_MIDDLE               0x10000000
  148.    #define BDS_HKFLAG_FINAL                0x20000000
  149.    #define BDS_HKFLAG_ISOLATED             0x40000000
  150.    #define BDS_HKFLAG_SAVE_SHAPED          0x80000000
  151.    #define BDS_HKFLAG_ENTRY_SWITCH_UI      0x00800000
  152.    
  153.    #define BDS_FAUTOPUSH_RTL_ON            0x00000001
  154.    #define BDS_FAUTOPUSH_LTR_ON            0x00000002
  155.    #define BDS_FPUSH_ON                    0x00000004
  156.    
  157.    #define BDS_DISABLE_INPUT_PROCESSING    0x00000020
  158.    
  159.    
  160.    /************************************************************************/
  161.    /* Bidirectional status masks                                           */
  162.    /************************************************************************/
  163.    #define BDSM_HKFLAGS                    0xFE7F0000
  164.    
  165.    #define BDSM_AUTOPUSH_RTL               0x00000001
  166.    #define BDSM_AUTOPUSH_LTR               0x00000002
  167.    #define BDSM_PUSH_ON                    0x00000004
  168.    
  169.    #define BDSM_DISABLE_INPUT_PROCESSING   0x00000020
  170.    
  171.    #define BDSM_ALL           ( BDSM_HKFLAGS      |                \
  172.    BDSM_AUTOPUSH_RTL |                \
  173.    BDSM_AUTOPUSH_LTR |                \
  174.    BDSM_PUSH_ON      |                \
  175.    BDSM_DISABLE_INPUT_PROCESSING )
  176.    
  177.    
  178.    /************************************************************************/
  179.    /* Functions to Set/Query Bidirectional Langugage Information           */
  180.    /************************************************************************/
  181.    #define  LI_BD_PROCESS_ATTR   0x00000010L /* Process Bidi attributes    */
  182.    #define  LI_BD_PROCESS_STAT   0x00000011L /* Process Bidi attributes    */
  183.    #define  LI_BD_WND_ATTR       0x00000020L /* Window Bidi Attributes     */
  184.    #define  LI_BD_WND_STAT       0x00000021L /* Window Bidi Status         */
  185.    #define  LI_BD_CLIP_ATTR      0x00000030L /* Clipboard Bidi Attributes  */
  186.    #define  LI_BD_CLIP_CONV_ATTR 0x00000031L /* Clipboard Conversion Bidi Attributes  */
  187.    
  188.    
  189.    
  190.    /* Values used in WinSet/QueryLangInfo (in flFlags); */
  191.    #define LIF_NO_SENDMSG      0x00000001     /* No message is sent to the */
  192.    /* window to inform it of the*/
  193.    /* change                    */
  194.    #define LIF_CHILD_INHERIT   0x00000002     /* Send SetBidiAttr msg to   */
  195.    /* all child windows.        */
  196.    #define LIF_WND_REFRESH     0x00000004     /* Refresh all windows whose */
  197.    /* bidi attributes are set   */
  198.    /* directly by the API (and  */
  199.    /* not by a sent message.    */
  200.    
  201.    
  202.    
  203.    
  204.    /************************************************************************/
  205.    /* Flags for WinSetKbdLayer                                             */
  206.    /************************************************************************/
  207.    #define SKLF_SENDMSG 0x00000001
  208.    
  209.    /************************************************************************/
  210.    /* Keyboard layers for WinSetKbdLayer                                   */
  211.    /************************************************************************/
  212.    #define KL_LATIN     0x00000000
  213.    #define KL_NATIONAL  0x00000001
  214.    
  215.    /************************************************************************/
  216.    /* PM Bidirectional support - function prototypes.                      */
  217.    /************************************************************************/
  218.    #define  WinSetLangInfo       Win32SetLangInfo
  219.    #define  WinQueryLangInfo     Win32QueryLangInfo
  220.    
  221.    #define  WinSetKbdLayer       Win32SetKbdLayer
  222.    #define  WinQueryKbdLayer     Win32QueryKbdLayer
  223.    
  224.    #define  WinSetLangViewer     Win32SetLangViewer
  225.    #define  WinQueryLangViewer   Win32QueryLangViewer
  226.    
  227.    #define  GpiSetBidiAttr       Gpi32SetBidiAttr
  228.    #define  GpiQueryBidiAttr     Gpi32QueryBidiAttr
  229.    
  230.    
  231.    ULONG   APIENTRY WinSetLangInfo     ( HWND    hwnd,
  232.                                         ULONG   ulEffect,
  233.                                         ULONG   ulData,
  234.                                         ULONG   flMask,
  235.                                         ULONG   flFlags,
  236.                                         ULONG   ulReserved );
  237.    
  238.    ULONG   APIENTRY WinQueryLangInfo   ( HWND    hwnd,
  239.                                         ULONG   ulEffect,
  240.                                         ULONG   flFlags,
  241.                                         ULONG   ulReserved );
  242.    
  243.    ULONG   APIENTRY WinSetKbdLayer     ( HWND hwnd,
  244.                                         ULONG idKbdLayer,
  245.                                         ULONG flFlags);
  246.    ULONG   APIENTRY WinQueryKbdLayer   ( HWND hwnd );
  247.    
  248.    HWND    APIENTRY WinSetLangViewer   ( HAB hab,
  249.                                         HWND hwndLangViewer,
  250.                                         ULONG Codepage);
  251.    HWND    APIENTRY WinQueryLangViewer ( HAB hab,
  252.                                         ULONG Codepage );
  253.    
  254.    ULONG   APIENTRY GpiSetBidiAttr     ( HPS  hps,
  255.                                         ULONG BidiAttr );
  256.    ULONG   APIENTRY GpiQueryBidiAttr   ( HPS  hps );
  257.    
  258.    /*****************************************************************************/
  259.    /*  Macros to manipulate Bidi values                                         */
  260.    /*****************************************************************************/
  261.    /*
  262.    * Macro to make a BidiAttribute/Status ULONG from several fields
  263.    *
  264.    * Example :      SET_BD_VALUE(BidiAtts,
  265.    *                             BDA_TEXT_ORIENT_RTL   | BDA_TEXTTYPE_IMPLICIT,
  266.    *                             BDAM_TEXT_ORIENTATION | BDAM_TEXTTYPE)
  267.    *
  268.    */
  269.    #define SET_BD_VALUE(BidiValue,NewBidiValue,Mask) \
  270.    (BidiValue = ((BidiValue & (~(Mask))) | (NewBidiValue & (Mask))))
  271.    
  272.    /*
  273.    * Macro to extract one or more fields from a BidiAttribute/Status ULONG
  274.    *
  275.    * Example :      Orientation = QUERY_BD_VALUE(BidiAtts,BDAM_TEXT_ORIENTATION)
  276.    *
  277.    */
  278.    #define QUERY_BD_VALUE(BidiValue,Mask) \
  279.    ( ((ULONG)BidiValue) & ((ULONG)Mask) )
  280.    
  281.    
  282.    /************************************************************************/
  283.    /* New CURSOR flags for Left-To-Right and Right-To-Left cursors         */
  284.    /* These are in addtion to those in the CURSOR section in PMWIN.H       */
  285.    /************************************************************************/
  286.    #define CURSOR_DIR       0x0100
  287.    #define CURSOR_DIR_LTR   0x0100
  288.    #define CURSOR_DIR_RTL   0x0300
  289.    
  290.    
  291.    /*****************************************************************************/
  292.    /*  PM Bidi Error codes.                                                     */
  293.    /*****************************************************************************/
  294.    #define PMERR_BIDI_FIRST               0x10F0
  295.    #define PMERR_BIDI_TEXT_CONV_FAILED    0x10F0
  296.    #define PMERR_BIDI_LAST                0x10FF
  297.    
  298.    /*****************************************************************************/
  299.    /* Bidi virtual key definitions                                              */
  300.    /*****************************************************************************/
  301.    
  302.    #define VK_BIDI_FIRST          0xE0
  303.    
  304.    #define VK_START_PUSH          0xE0
  305.    #define VK_END_PUSH            0xE1
  306.    #define VK_REVERSE_FIELD       0xE2
  307.    #define VK_REVERSE_WINDOW      0xE3
  308.    #define VK_AUTOPUSH            0xE4
  309.    #define VK_STATUS_INDICATOR    0xE5
  310.    
  311.    #define VK_TEXT_DISPLAY_SHAPED 0xE6
  312.    #define VK_TEXT_INITIAL        0xE7
  313.    #define VK_TEXT_MIDDLE         0xE8
  314.    #define VK_TEXT_FINAL          0xE9
  315.    #define VK_TEXT_ISOLATED       0xEA
  316.    #define VK_TEXT_SAVE_SHAPED    0xEB
  317.    
  318.    #define VK_REQUIRED_SPACE      0xEC
  319.    #define VK_LTR_MARKER          0xED
  320.    #define VK_RTL_MARKER          0xEE
  321.    
  322.    #define VK_ENTRY_SWITCH_UI     0xEF
  323.    
  324.    #define VK_LAYER0              0xF0
  325.    #define VK_LAYER1              0xF1
  326.    #define VK_LAYER2              0xF2
  327.    #define VK_LAYER3              0xF3
  328.    #define VK_LATIN_LAYER         VK_LAYER0
  329.    #define VK_NATIONAL_LAYER      VK_LAYER1
  330.    
  331.    #define VK_BIDI_LAST           0xFF
  332.    
  333.    
  334.    #ifdef INCL_WINSTDDLGS   /* StdDlgs related Bidi Definitions             */
  335.       /************************************************************************/
  336.       /*  Language-sensitive definition for standard File and Font dialogs.   */
  337.       /************************************************************************/
  338.       #define FNTS_NATIONAL_LANGUAGE   0x80000000L /* Use National Language */
  339.       #define FDS_NATIONAL_LANGUAGE    0x80000000L /* Use National Language */
  340.       
  341.       
  342.       /************************************************************************/
  343.       /*  WM_ messages related to bidirectional language support for          */
  344.       /*      CUATOOLS components.                                            */
  345.       /************************************************************************/
  346.       #define CM_SETITEMBIDIATTR             0x0390
  347.       #define CM_SETFIELDBIDIATTR            0x0391
  348.       #define CM_QUERYITEMBIDIATTR           0x0392
  349.       #define CM_QUERYFIELDBIDIATTR          0x0393
  350.       
  351.       #define BKM_SETSTATUSLINEBIDIATTR      0x0394
  352.       #define BKM_QUERYSTATUSLINEBIDIATTR    0x0395
  353.       #define BKM_SETTABTEXTBIDIATTR         0x0396
  354.       #define BKM_QUERYTABTEXTBIDIATTR       0x0397
  355.       
  356.       #define VM_SETITEMBIDIATTR             0x0398
  357.       #define VM_QUERYITEMBIDIATTR           0x0399
  358.       
  359.       
  360.       
  361.       typedef struct _BD_ATTR_MASK      /* bam */
  362.       {
  363.          ULONG ulBdAttr;              /* Bidirectional Attributes word */
  364.          ULONG ulBdMask;              /* Bitmask to define which bidi  */
  365.       } BD_ATTR_MASK;                   /* attributes are to be used.    */
  366.       typedef BD_ATTR_MASK *PBD_ATTR_MASK;
  367.       
  368.       /**********************************************************************/
  369.       /* BOOKPAGEBIDIINFO structure is pointed to from the BOOKPAGEINFO     */
  370.       /* structure (BKM_SETPAGEINFO notebook message)                       */
  371.       /**********************************************************************/
  372.       typedef struct _BOOKPAGEBIDIINFO  /* bkpgbdi */
  373.       {
  374.          BD_ATTR_MASK bamMajorTab;    /* Major Tab Text BD_ATTR_MASK struct.   */
  375.          BD_ATTR_MASK bamMinorTab;    /* Minor Tab Text BD_ATTR_MASK struct.   */
  376.          BD_ATTR_MASK bamStatusLine;  /* Status Line Text BD_ATTR_MASK struct. */
  377.       } BOOKPAGEBIDIINFO;
  378.       typedef BOOKPAGEBIDIINFO *PBOOKPAGEBIDIINFO;
  379.       
  380.       
  381.    #endif /*INCL_WINSTDDLGS */
  382.    
  383. #endif  /*PM_BIDI_INCLUDED*/    /* Eliminate multiple definitions... */
  384.  
  385.