home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / header45.zip / layout.h < prev    next >
Text File  |  1999-04-30  |  8KB  |  216 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.    {
  145.       ULONG front;                                          /* previous chars */
  146.       ULONG back;                                         /* succeeding chars */
  147.    } LAYOUT_EDIT_SIZE;
  148.    
  149.    #define LAYOUT_TEXT_DESCRIPTOR LayoutTextDescriptorRec
  150.    typedef struct _LAYOUT_TEXT_DESCRIPTOR
  151.    {
  152.       ULONG in;                                    /* input buffer description */
  153.       ULONG out;                                         /* output description */
  154.    } LAYOUT_TEXT_DESCRIPTOR;
  155.    
  156.    #pragma pack()                              /* restore packing to default */
  157.    
  158.    #define LAYOUT_OBJECT LayoutObject
  159.    typedef PVOID  LAYOUT_OBJECT;
  160.    
  161.    typedef PVOID *PLAYOUT_OBJECT;
  162.    
  163.    #define PLAYOUT_VALUES LayoutValues
  164.    typedef LAYOUT_VALUES *PLAYOUT_VALUES;
  165.    
  166.    #define PLAYOUT_EDIT_SIZE LayoutEditSize
  167.    typedef LAYOUT_EDIT_SIZE *PLAYOUT_EDIT_SIZE;
  168.    
  169.    #define PLAYOUT_TEXT_DESCRIPTOR LayoutTextDescriptor
  170.    typedef LAYOUT_TEXT_DESCRIPTOR *PLAYOUT_TEXT_DESCRIPTOR;
  171.    
  172.    /************************************************************************/
  173.    /***                Layout Text Conversion Functions                  ***/
  174.    /************************************************************************/
  175.    
  176.    #define LayoutCreateObject  layout_object_create
  177.    #define LayoutDestroyObject layout_object_destroy
  178.    #define LayoutTransformText layout_object_transform
  179.    #define LayoutEditShape     layout_object_editshape
  180.    #define LayoutSetValues     layout_object_setvalues
  181.    #define LayoutQueryValues   layout_object_getvalues
  182.    
  183.    APIRET APIENTRY LayoutCreateObject(const PUCHAR locale_name,
  184.                                       PLAYOUT_OBJECT plh);
  185.    
  186.    APIRET APIENTRY LayoutDestroyObject(LAYOUT_OBJECT  plh);
  187.    
  188.    APIRET APIENTRY LayoutSetValues(    LAYOUT_OBJECT  plh,
  189.                                    PLAYOUT_VALUES values,
  190.                                    PULONG         index_returned);
  191.    
  192.    
  193.    APIRET APIENTRY LayoutQueryValues(  LAYOUT_OBJECT  plh,
  194.                                      PLAYOUT_VALUES values,
  195.                                      PULONG         index_returned);
  196.    
  197.    APIRET APIENTRY LayoutTransformText(LAYOUT_OBJECT  plh,
  198.                                        PUCHAR         InpBuf,
  199.                                        PULONG         InpSize,
  200.                                        PVOID          OutBuf,
  201.                                        PULONG         OutSize,
  202.                                        PULONG         InpToOut,
  203.                                        PULONG         OutToInp,
  204.                                        PUCHAR         BidiLevel);
  205.    
  206.    APIRET APIENTRY LayoutEditShape(    LAYOUT_OBJECT  plh,
  207.                                    BOOL           EditType,
  208.                                    PULONG         index,
  209.                                    PUCHAR         InpBuf,
  210.                                    PULONG         InpSize,
  211.                                    PVOID          OutBuf,
  212.                                    PULONG         OutSize);
  213.    
  214.    
  215. #endif  /* INCL_LAYOUT */
  216.