home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / warptlk3.zip / TOOLKIT / H / PMBIDI.H < prev    next >
C/C++ Source or Header  |  1995-08-30  |  17KB  |  379 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, ULONG idKbdLayer, ULONG flFlags);
  244. ULONG   APIENTRY WinQueryKbdLayer   ( HWND hwnd );
  245.  
  246. HWND    APIENTRY WinSetLangViewer   ( HAB hab, HWND hwndLangViewer, ULONG Codepage);
  247. HWND    APIENTRY WinQueryLangViewer ( HAB hab, ULONG Codepage );
  248.  
  249. ULONG   APIENTRY GpiSetBidiAttr     ( HPS  hps, ULONG BidiAttr );
  250. ULONG   APIENTRY GpiQueryBidiAttr   ( HPS  hps );
  251.  
  252. /*****************************************************************************/
  253. /*  Macros to manipulate Bidi values                                         */
  254. /*****************************************************************************/
  255. /*
  256.  * Macro to make a BidiAttribute/Status ULONG from several fields
  257.  *
  258.  * Example :      SET_BD_VALUE(BidiAtts,
  259.  *                             BDA_TEXT_ORIENT_RTL   | BDA_TEXTTYPE_IMPLICIT,
  260.  *                             BDAM_TEXT_ORIENTATION | BDAM_TEXTTYPE)
  261.  *
  262.  */
  263. #define SET_BD_VALUE(BidiValue,NewBidiValue,Mask) \
  264.         (BidiValue = ((BidiValue & (~(Mask))) | (NewBidiValue & (Mask))))
  265.  
  266. /*
  267.  * Macro to extract one or more fields from a BidiAttribute/Status ULONG
  268.  *
  269.  * Example :      Orientation = QUERY_BD_VALUE(BidiAtts,BDAM_TEXT_ORIENTATION)
  270.  *
  271.  */
  272. #define QUERY_BD_VALUE(BidiValue,Mask) \
  273.        ( ((ULONG)BidiValue) & ((ULONG)Mask) )
  274.  
  275.  
  276. /************************************************************************/
  277. /* New CURSOR flags for Left-To-Right and Right-To-Left cursors         */
  278. /* These are in addtion to those in the CURSOR section in PMWIN.H       */
  279. /************************************************************************/
  280. #define CURSOR_DIR       0x0100
  281. #define CURSOR_DIR_LTR   0x0100
  282. #define CURSOR_DIR_RTL   0x0300
  283.  
  284.  
  285. /*****************************************************************************/
  286. /*  PM Bidi Error codes.                                                     */
  287. /*****************************************************************************/
  288. #define PMERR_BIDI_FIRST               0x10F0
  289. #define PMERR_BIDI_TEXT_CONV_FAILED    0x10F0
  290. #define PMERR_BIDI_LAST                0x10FF
  291.  
  292. /*****************************************************************************/
  293. /* Bidi virtual key definitions                                              */
  294. /*****************************************************************************/
  295.  
  296. #define VK_BIDI_FIRST          0xE0
  297.  
  298. #define VK_START_PUSH          0xE0
  299. #define VK_END_PUSH            0xE1
  300. #define VK_REVERSE_FIELD       0xE2
  301. #define VK_REVERSE_WINDOW      0xE3
  302. #define VK_AUTOPUSH            0xE4
  303. #define VK_STATUS_INDICATOR    0xE5
  304.  
  305. #define VK_TEXT_DISPLAY_SHAPED 0xE6
  306. #define VK_TEXT_INITIAL        0xE7
  307. #define VK_TEXT_MIDDLE         0xE8
  308. #define VK_TEXT_FINAL          0xE9
  309. #define VK_TEXT_ISOLATED       0xEA
  310. #define VK_TEXT_SAVE_SHAPED    0xEB
  311.  
  312. #define VK_REQUIRED_SPACE      0xEC
  313. #define VK_LTR_MARKER          0xED
  314. #define VK_RTL_MARKER          0xEE
  315.  
  316. #define VK_ENTRY_SWITCH_UI     0xEF
  317.  
  318. #define VK_LAYER0              0xF0
  319. #define VK_LAYER1              0xF1
  320. #define VK_LAYER2              0xF2
  321. #define VK_LAYER3              0xF3
  322. #define VK_LATIN_LAYER         VK_LAYER0
  323. #define VK_NATIONAL_LAYER      VK_LAYER1
  324.  
  325. #define VK_BIDI_LAST           0xFF
  326.  
  327.  
  328. #ifdef INCL_WINSTDDLGS   /* StdDlgs related Bidi Definitions             */
  329.  /************************************************************************/
  330.  /*  Language-sensitive definition for standard File and Font dialogs.   */
  331.  /************************************************************************/
  332.  #define FNTS_NATIONAL_LANGUAGE   0x80000000L /* Use National Language */
  333.  #define FDS_NATIONAL_LANGUAGE    0x80000000L /* Use National Language */
  334.  
  335.  
  336.  /************************************************************************/
  337.  /*  WM_ messages related to bidirectional language support for          */
  338.  /*      CUATOOLS components.                                            */
  339.  /************************************************************************/
  340.  #define CM_SETITEMBIDIATTR             0x0390
  341.  #define CM_SETFIELDBIDIATTR            0x0391
  342.  #define CM_QUERYITEMBIDIATTR           0x0392
  343.  #define CM_QUERYFIELDBIDIATTR          0x0393
  344.  
  345.  #define BKM_SETSTATUSLINEBIDIATTR      0x0394
  346.  #define BKM_QUERYSTATUSLINEBIDIATTR    0x0395
  347.  #define BKM_SETTABTEXTBIDIATTR         0x0396
  348.  #define BKM_QUERYTABTEXTBIDIATTR       0x0397
  349.  
  350.  #define VM_SETITEMBIDIATTR             0x0398
  351.  #define VM_QUERYITEMBIDIATTR           0x0399
  352.  
  353.  
  354.  
  355.  typedef struct _BD_ATTR_MASK      /* bam */
  356.  {
  357.       ULONG ulBdAttr;              /* Bidirectional Attributes word */
  358.       ULONG ulBdMask;              /* Bitmask to define which bidi  */
  359.  } BD_ATTR_MASK;                   /* attributes are to be used.    */
  360.  typedef BD_ATTR_MASK FAR *PBD_ATTR_MASK;
  361.  
  362.  /**********************************************************************/
  363.  /* BOOKPAGEBIDIINFO structure is pointed to from the BOOKPAGEINFO     */
  364.  /* structure (BKM_SETPAGEINFO notebook message)                       */
  365.  /**********************************************************************/
  366.  typedef struct _BOOKPAGEBIDIINFO  /* bkpgbdi */
  367.  {
  368.       BD_ATTR_MASK bamMajorTab;    /* Major Tab Text BD_ATTR_MASK struct.   */
  369.       BD_ATTR_MASK bamMinorTab;    /* Minor Tab Text BD_ATTR_MASK struct.   */
  370.       BD_ATTR_MASK bamStatusLine;  /* Status Line Text BD_ATTR_MASK struct. */
  371.  } BOOKPAGEBIDIINFO;
  372.  typedef BOOKPAGEBIDIINFO FAR *PBOOKPAGEBIDIINFO;
  373.  
  374.  
  375. #endif /*INCL_WINSTDDLGS */
  376.  
  377. #endif  /*PM_BIDI_INCLUDED*/    /* Eliminate multiple definitions... */
  378.  
  379.