home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / warptlk3.zip / TOOLKIT / H / LAYOUT.H < prev    next >
C/C++ Source or Header  |  1995-08-30  |  8KB  |  215 lines

  1. /****************************** Module Header ******************************\
  2. *
  3. * Module Name: LAYOUT.H
  4. *
  5. * OS/2 Layout Utility include file.
  6. *
  7. * Copyright (c) International Business Machines Corporation 1993
  8. *
  9. \***************************************************************************/
  10.  
  11. #ifndef INCL_LAYOUT   /* Eliminate multiple definitions... */
  12. #define INCL_LAYOUT
  13.  
  14.  
  15. /**************************************************************************/
  16. /***                      Layout Utility constants                      ***/
  17. /**************************************************************************/
  18.  
  19.  
  20. /*** Locales ***************************************************************/
  21.  
  22. #define Locale_Arabic   "Ar_AA"
  23. #define Locale_Hebrew   "Iw_IL"
  24.  
  25.  
  26. /*
  27.  * Layout Values Names used for LayoutSet/QueryValues()
  28.  * Types are defined as ULONG (32 bits) split into 2 parts
  29.  * Lower 16 bits  - LayoutTextDescriptor
  30.  * Higher 16 bits - any other type
  31.  */
  32.  
  33. /*** Layout text descriptors. These Names can be ORed together *************/
  34.  
  35. #define AllTextDescptors        0x0000ffff
  36. #define Orientation             0x00000001
  37. #define TypeOfText              0x00000002
  38. #define Swapping                0x00000004
  39. #define Numerals                0x00000008
  40. #define TextShaping             0x00000010
  41. #define ArabicSpecialShaping    0x00000020
  42. #define ArabicOneCellShaping    0x00000040
  43. #define Word_Break              0x00000080
  44. #define BidiType                0x00000100
  45.  
  46. /*** General Layout Value names. These names should NOT be ORed together ***/
  47.  
  48. #define ActiveShapeEditing      (0x0001<<16)
  49. #define ActiveBidirection       (0x0002<<16)
  50. #define ShapeCharset            (0x0003<<16)
  51. #define ShapeCharsetSize        (0x0004<<16)
  52. #define ShapeContextSize        (0x0005<<16)
  53. #define CellSize                (0x0006<<16)
  54. #define InputMode               (0x0007<<16)
  55. #define InOnlyTextDescr         (0x0008<<16)
  56. #define OutOnlyTextDescr        (0x0009<<16)
  57. #define InOutTextDescrMask      (0x000a<<16)
  58. #define CallerAllocMem          (0x000b<<16)
  59.  
  60. /*
  61.  * QueryValueSize can be ORed with any of
  62.  * the above Names at query time to determine
  63.  * the amount of memory needed for that value
  64.  */
  65. #define QueryValueSize          (0x8000<<16)
  66.  
  67.  
  68. /*
  69.  * Bidirectional attributes values (in Bidi attributes word)
  70.  * To be used as values for the following Layout text descriptors:
  71.  *   - InOnlyTextDescr
  72.  *   - OutOnlyTextDescr
  73.  *
  74.  * Note: These bidi attributes value must match the BDA_XXX
  75.  *       values in pmbidi.h.
  76.  */
  77.  
  78.                                                              /* Text Type */
  79. #define TEXT_VISUAL             0x00000000
  80. #define TEXT_IMPLICIT           0x01000000
  81. #define TEXT_EXPLICIT           0x02000000
  82.  
  83.                                                              /* Bidi Type */
  84. #define BIDI_DEFAULT            0x00000000
  85. #define BIDI_UCS                0x04000000
  86.  
  87.                                                       /* Text Orientation */
  88. #define ORIENTATION_LTR         0x00000000
  89. #define ORIENTATION_RTL         0x00010000
  90.  
  91.                                 /* ORIENTATION_CONTEXT_LTR is equivalent  */
  92.                                 /* to BDA_TEXT_ORIENT_CONTEXT in pmbidi.h */
  93. #define ORIENTATION_CONTEXT_LTR 0x00020000
  94.                                            /* ORIENTATION_CONTEXT_RTL has */
  95.                                            /* no equivalent in pmbidi.h   */
  96. #define ORIENTATION_CONTEXT_RTL 0x00030000
  97.  
  98.                                                               /* Numerals */
  99. #define NUMERALS_NOMINAL        0x00000000
  100. #define NUMERALS_NATIONAL       0x00002000
  101. #define NUMERALS_CONTEXTUAL     0x00003000
  102.  
  103.                                                             /* Word Break */
  104. #define BREAK                   0x00000200
  105. #define NO_BREAK                0x00000000
  106.  
  107.                                                     /* Symmetric Swapping */
  108. #define SWAPPING                0x00000100
  109. #define NO_SWAPPING             0x00000000
  110.                                                             /* Text shape */
  111. #define TEXT_SHAPED             0x00000000
  112. #define TEXT_NOMINAL            0x00000010
  113. #define TEXT_INITIAL            0x00000011
  114. #define TEXT_MIDDLE             0x00000012
  115. #define TEXT_FINAL              0x00000013
  116. #define TEXT_ISOLATED           0x00000014
  117.  
  118.  
  119. /*** Edit type values used In LayoutEditShape  *************************/
  120. #define EDITINPUT               0
  121. #define EDITREPLACE             1
  122.  
  123.  
  124. /**************************************************************************/
  125. /***                          ERROR CODES                               ***/
  126. /**************************************************************************/
  127. #define E2BIG            999
  128.  
  129. /**************************************************************************/
  130. /***                          STRUCTURES                                ***/
  131. /**************************************************************************/
  132.  
  133. #pragma pack (2)                     /* force structure alignment packing */
  134.  
  135. #define LAYOUT_VALUES LayoutValueRec
  136. typedef struct _LAYOUT_VALUES
  137. {
  138.   ULONG   name;                              /* Name of Layout Value Item */
  139.   PVOID   value;                             /* Data of Layout Value Item */
  140. } LAYOUT_VALUES ;
  141.  
  142. #define LAYOUT_EDIT_SIZE LayoutEditSizeRec
  143. typedef struct _LAYOUT_EDIT_SIZE {
  144.   ULONG front;                                          /* previous chars */
  145.   ULONG back;                                         /* succeeding chars */
  146. } LAYOUT_EDIT_SIZE;
  147.  
  148. #define LAYOUT_TEXT_DESCRIPTOR LayoutTextDescriptorRec
  149. typedef struct _LAYOUT_TEXT_DESCRIPTOR
  150. {
  151.  ULONG in;                                    /* input buffer description */
  152.  ULONG out;                                         /* output description */
  153. } LAYOUT_TEXT_DESCRIPTOR;
  154.  
  155. #pragma pack()                              /* restore packing to default */
  156.  
  157. #define LAYOUT_OBJECT LayoutObject
  158. typedef PVOID  LAYOUT_OBJECT;
  159.  
  160. typedef PVOID  FAR *  PLAYOUT_OBJECT;
  161.  
  162. #define PLAYOUT_VALUES LayoutValues
  163. typedef LAYOUT_VALUES FAR *  PLAYOUT_VALUES;
  164.  
  165. #define PLAYOUT_EDIT_SIZE LayoutEditSize
  166. typedef LAYOUT_EDIT_SIZE FAR *  PLAYOUT_EDIT_SIZE;
  167.  
  168. #define PLAYOUT_TEXT_DESCRIPTOR LayoutTextDescriptor
  169. typedef LAYOUT_TEXT_DESCRIPTOR FAR *  PLAYOUT_TEXT_DESCRIPTOR;
  170.  
  171. /************************************************************************/
  172. /***                Layout Text Conversion Functions                  ***/
  173. /************************************************************************/
  174.  
  175. #define LayoutCreateObject  layout_object_create
  176. #define LayoutDestroyObject layout_object_destroy
  177. #define LayoutTransformText layout_object_transform
  178. #define LayoutEditShape     layout_object_editshape
  179. #define LayoutSetValues     layout_object_setvalues
  180. #define LayoutQueryValues   layout_object_getvalues
  181.  
  182. APIRET APIENTRY LayoutCreateObject(const PUCHAR locale_name,
  183.                                    PLAYOUT_OBJECT plh);
  184.  
  185. APIRET APIENTRY LayoutDestroyObject(LAYOUT_OBJECT  plh);
  186.  
  187. APIRET APIENTRY LayoutSetValues(    LAYOUT_OBJECT  plh,
  188.                                     PLAYOUT_VALUES values,
  189.                                     PULONG         index_returned);
  190.  
  191.  
  192. APIRET APIENTRY LayoutQueryValues(  LAYOUT_OBJECT  plh,
  193.                                     PLAYOUT_VALUES values,
  194.                                     PULONG         index_returned);
  195.  
  196. APIRET APIENTRY LayoutTransformText(LAYOUT_OBJECT  plh,
  197.                                     PUCHAR         InpBuf,
  198.                                     PULONG         InpSize,
  199.                                     PVOID          OutBuf,
  200.                                     PULONG         OutSize,
  201.                                     PULONG         InpToOut,
  202.                                     PULONG         OutToInp,
  203.                                     PUCHAR         BidiLevel);
  204.  
  205. APIRET APIENTRY LayoutEditShape(    LAYOUT_OBJECT  plh,
  206.                                     BOOL           EditType,
  207.                                     PULONG         index,
  208.                                     PUCHAR         InpBuf,
  209.                                     PULONG         InpSize,
  210.                                     PVOID          OutBuf,
  211.                                     PULONG         OutSize);
  212.  
  213.  
  214. #endif  /* INCL_LAYOUT */
  215.