home *** CD-ROM | disk | FTP | other *** search
/ The Developer Connection…ice Driver Kit for OS/2 3 / DEV3-D1.ISO / devtools / bidi / os2h / h_16 / pmbidi16.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-09  |  15.5 KB  |  364 lines

  1. /****************************** Module Header ******************************\
  2. *
  3. * Module Name: PMBIDI.H
  4. *
  5. * OS/2 Presentation Manager Window Manager - Bidirectional support -
  6. *      include file for 16-bit programming.
  7. *
  8. * Copyright (c) International Business Machines Corporation 1993
  9. *
  10. \***************************************************************************/
  11.  
  12. #ifndef PM_BIDI_INCLUDED    // Eliminate multiple definitions...
  13. #define PM_BIDI_INCLUDED
  14.  
  15. /************************************************************************/
  16. /* Bidirectional oriented window messages                               */
  17. /************************************************************************/
  18. #define WM_SETBIDIATTR       0x0BD0
  19. #define WM_QUERYBIDIATTR     0x0BD1
  20. #define WM_SETBIDISTAT       0x0BD2
  21. #define WM_QUERYBIDISTAT     0x0BD3
  22. #define WM_KBDLAYERCHANGED   0x0BD4
  23.  
  24.  
  25. /************************************************************************/
  26. /*  Language Viewer messages                                            */
  27. /************************************************************************/
  28.  #define WM_LANGVIEWINFOCHANGED   0x0BE0
  29.  #define WM_LANG_OPTIONS_DIALOG   0x0BE1
  30.  #define WM_LANGOPTIONSDIALOG     0x0BE2
  31.  
  32.  /* LVI values - indicating which Bidi information has changed */
  33.  
  34.  #define LVI_WND_BIDI_ATTR     1
  35.  #define LVI_WND_BIDI_STAT     2
  36.  #define LVI_FOCUS_CHANGE      3
  37.  #define LVI_KBD_LAYER         4
  38.  #define LVI_CSD               5
  39.  #define LVI_ALL             (-1)
  40.  
  41.  
  42.  
  43. /* Possible return values from WM_SETBIDIATTR/WM_SETBIDISTAT */
  44. #define SBI_MSG_NOT_PROCESSED   0L
  45. #define SBI_MSG_PROCESSED       1L
  46. #define SBI_MSG_PROCESSED_SELF  2L
  47.  
  48.  
  49. /************************************************************************/
  50. /* Bidirectional attributes masks                                       */
  51. /************************************************************************/
  52. #define BDAM_INIT               0x80000000
  53. #define BDAM_LEVEL              0x70000000
  54. #define BDAM_TEXTTYPE           0x01000000
  55. #define BDAM_TEXT_ORIENTATION   0x00030000
  56. #define BDAM_WND_ORIENTATION    0x00100000
  57. #define BDAM_NUMERALS           0x00003000
  58. #define BDAM_SYM_SWAP           0x00000100
  59. #define BDAM_WORD_BREAK         0x00000200
  60. #define BDAM_TEXT_SHAPE         0x000000FF
  61.  
  62. #define BDAM_ALL    (BDAM_INIT             | \
  63.                      BDAM_LEVEL            | \
  64.                      BDAM_TEXTTYPE         | \
  65.                      BDAM_TEXT_ORIENTATION | \
  66.                      BDAM_WND_ORIENTATION  | \
  67.                      BDAM_NUMERALS         | \
  68.                      BDAM_SYM_SWAP         | \
  69.                      BDAM_WORD_BREAK       | \
  70.                      BDAM_TEXT_SHAPE         )
  71.  
  72. /************************************************************************/
  73. /* Bidirectional attributes values (in Bidi attributes word)            */
  74. /*                                                                      */
  75. /* Note: Value of the attributes must match the values in layout.h.     */
  76. /************************************************************************/
  77. #define BDA_INIT                0x80000000
  78. #define BDA_LEVEL               0x30000000
  79.  
  80. #define BDA_TEXTTYPE_VISUAL     0x00000000
  81. #define BDA_TEXTTYPE_IMPLICIT   0x01000000
  82.  
  83. #define BDA_WND_ORIENT_LTR      0x00000000
  84. #define BDA_WND_ORIENT_RTL      0x00100000
  85.  
  86. #define BDA_TEXT_ORIENT_LTR     0x00000000
  87. #define BDA_TEXT_ORIENT_RTL     0x00010000
  88. #define BDA_TEXT_ORIENT_DYNAMIC 0x00020000
  89. #define BDA_TEXT_ORIENT_CONTEXT 0x00020000
  90.  
  91. #define BDA_NUMERALS_NOMINAL    0x00000000
  92. #define BDA_NUMERALS_PASSTHRU   0x00001000
  93. #define BDA_NUMERALS_NATIONAL   0x00002000
  94. #define BDA_NUMERALS_CONTEXTUAL 0x00003000
  95.  
  96. #define BDA_SYM_SWAP_OFF        0x00000000
  97. #define BDA_SYM_SWAP_ON         0x00000100
  98.  
  99. #define BDA_WORD_BREAK_OFF      0x00000000
  100. #define BDA_WORD_BREAK_ON       0x00000200
  101.  
  102. #define BDA_TEXT_DISPLAY_SHAPED 0x00000000
  103. #define BDA_TEXT_SAVE_SHAPED    0x00000001
  104. #define BDA_TEXT_NOMINAL        0x00000010
  105. #define BDA_TEXT_INITIAL        0x00000011
  106. #define BDA_TEXT_MIDDLE         0x00000012
  107. #define BDA_TEXT_FINAL          0x00000013
  108. #define BDA_TEXT_ISOLATED       0x00000014
  109.  
  110.  
  111. /************************************************************************/
  112. /* Bidirectional attribute (BIDIATTR) as specified in a window template */
  113. /* or in the resource script.                                           */
  114. /************************************************************************/
  115. #define BIDIPARAM                  PRESPARAMS
  116.  
  117. #define PP_BDATTR_FIRST            0x100L  /* First BidiAttr PresParam  */
  118.                                            /*                           */
  119. #define PP_BDATTR_ALL              0x101L  /* Set ALL Bidi attrs        */
  120.                                            /*                           */
  121. #define PP_BDATTR_TEXTTYPE         0x102L  /* Text/Data type            */
  122. #define PP_BDATTR_TEXT_ORIENTATION 0x103L  /* Text Orientation          */
  123. #define PP_BDATTR_WND_ORIENTATION  0x104L  /* Window Orientation        */
  124. #define PP_BDATTR_NUMERALS         0x105L  /* Arabic/Hindi Numerals     */
  125. #define PP_BDATTR_SYM_SWAP         0x106L  /* Symetric Swapping         */
  126. #define PP_BDATTR_WORD_BREAK       0x107L  /* Word break                */
  127. #define PP_BDATTR_TEXT_SHAPE       0x108L  /* Char Shape Determination  */
  128.                                            /*                           */
  129. #define PP_BDATTR_LAST             0x108L  /* Last BidiAttr PresParam   */
  130.                                            /*                           */
  131. #define PP_BDSTATUS                0x110L  /* Bidirectional status flags*/
  132.  
  133.  
  134. /************************************************************************/
  135. /* Values used in Set/Query Bidirectional status word                   */
  136. /************************************************************************/
  137. #define BDS_HKFLAG_ENG_LAYER            0x00010000
  138. #define BDS_HKFLAG_NAT_LAYER            0x00020000
  139. #define BDS_HKFLAG_PUSH                 0x00040000
  140. #define BDS_HKFLAG_END_PUSH             0x00080000
  141. #define BDS_HKFLAG_AUTO_PUSH            0x00100000
  142. #define BDS_HKFLAG_FIELD_REV            0x00200000
  143. #define BDS_HKFLAG_SCREEN_REV           0x00400000
  144. #define BDS_HKFLAG_STATUS_INDICATOR     0x02000000
  145.  
  146. #define BDS_HKFLAG_DISPLAY_SHAPED       0x04000000
  147. #define BDS_HKFLAG_INITIAL              0x08000000
  148. #define BDS_HKFLAG_MIDDLE               0x10000000
  149. #define BDS_HKFLAG_FINAL                0x20000000
  150. #define BDS_HKFLAG_ISOLATED             0x40000000
  151. #define BDS_HKFLAG_SAVE_SHAPED          0x80000000
  152. #define BDS_HKFLAG_ENTRY_SWITCH_UI      0x00800000
  153.  
  154. #define BDS_FAUTOPUSH_RTL_ON            0x00000001
  155. #define BDS_FAUTOPUSH_LTR_ON            0x00000002
  156. #define BDS_FPUSH_ON                    0x00000004
  157.  
  158. #define BDS_DISABLE_INPUT_PROCESSING    0x00000020
  159.  
  160.  
  161. /************************************************************************/
  162. /* Bidirectional status masks                                           */
  163. /************************************************************************/
  164. #define BDSM_HKFLAGS                    0xFE7F0000
  165.  
  166. #define BDSM_AUTOPUSH_RTL               0x00000001
  167. #define BDSM_AUTOPUSH_LTR               0x00000002
  168. #define BDSM_PUSH_ON                    0x00000004
  169.  
  170. #define BDSM_DISABLE_INPUT_PROCESSING   0x00000020
  171.  
  172. #define BDSM_ALL           ( BDSM_HKFLAGS      |                \
  173.                              BDSM_AUTOPUSH_RTL |                \
  174.                              BDSM_AUTOPUSH_LTR |                \
  175.                              BDSM_PUSH_ON      |                \
  176.                              BDSM_DISABLE_INPUT_PROCESSING )
  177.  
  178.  
  179. /************************************************************************/
  180. /* Functions to Set/Query Bidirectional Langugage Information           */
  181. /************************************************************************/
  182. #define  LI_BD_PROCESS_ATTR   0x00000010L /* Process Bidi attributes    */
  183. #define  LI_BD_PROCESS_STAT   0x00000011L /* Process Bidi attributes    */
  184. #define  LI_BD_WND_ATTR       0x00000020L /* Window Bidi Attributes     */
  185. #define  LI_BD_WND_STAT       0x00000021L /* Window Bidi Status         */
  186. #define  LI_BD_CLIP_ATTR      0x00000030L /* Clipboard Bidi Attributes  */
  187. #define  LI_BD_CLIP_CONV_ATTR 0x00000031L /* Clipboard Conversion Bidi Attributes  */
  188.  
  189.  
  190.  
  191. /* Values used in WinSet/QueryLangInfo (in flFlags); */
  192. #define LIF_NO_SENDMSG      0x00000001     /* No message is sent to the */
  193.                                            /* window to inform it of the*/
  194.                                            /* change                    */
  195. #define LIF_CHILD_INHERIT   0x00000002     /* Send SetBidiAttr msg to   */
  196.                                            /* all child windows.        */
  197. #define LIF_WND_REFRESH     0x00000004     /* Refresh all windows whose */
  198.                                            /* bidi attributes are set   */
  199.                                            /* directly by the API (and  */
  200.                                            /* not by a sent message.    */
  201.  
  202.  
  203.  
  204.  
  205. /************************************************************************/
  206. /* Flags for WinSetKbdLayer                                             */
  207. /************************************************************************/
  208. #define SKLF_SENDMSG 0x00000001
  209.  
  210. /************************************************************************/
  211. /* Keyboard layers for WinSetKbdLayer                                   */
  212. /************************************************************************/
  213. #define KL_LATIN     0x00000000
  214. #define KL_NATIONAL  0x00000001
  215.  
  216. /************************************************************************/
  217. /* PM Bidirectional support - function prototypes.                      */
  218. /************************************************************************/
  219.  #define  WinSetLangInfo       Win16SetLangInfo
  220.  #define  WinQueryLangInfo     Win16QueryLangInfo
  221.  
  222.  #define  WinSetKbdLayer       Win16SetKbdLayer
  223.  #define  WinQueryKbdLayer     Win16QueryKbdLayer
  224.  
  225.  #define  WinSetLangViewer     Win16SetLangViewer
  226.  #define  WinQueryLangViewer   Win16QueryLangViewer
  227.  
  228.  #define  GpiSetBidiAttr       Gpi16SetBidiAttr
  229.  #define  GpiQueryBidiAttr     Gpi16QueryBidiAttr
  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.  typedef struct _BD_ATTR_MASK
  354.          {
  355.           ULONG ulBdAttr;
  356.           ULONG ulBdMask;
  357.          } BD_ATTR_MASK;
  358.  typedef BD_ATTR_MASK FAR *PBD_ATTR_MASK;
  359.  
  360. #endif /*INCL_WINSTDDLGS */
  361.  
  362. #endif  /*PM_BIDI_INCLUDED*/    // Eliminate multiple definitions...
  363.  
  364.