os/textandloc/fontservices/textshaperplugin/IcuSource/layout/ArabicShaping.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/textandloc/fontservices/textshaperplugin/IcuSource/layout/ArabicShaping.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,66 @@
     1.4 +/*
     1.5 + *
     1.6 + * (C) Copyright IBM Corp. 1998-2004 - All Rights Reserved
     1.7 + *
     1.8 + */
     1.9 +
    1.10 +#ifndef __ARABICSHAPING_H
    1.11 +#define __ARABICSHAPING_H
    1.12 +
    1.13 +/**
    1.14 + * \file
    1.15 + * \internal
    1.16 + */
    1.17 +
    1.18 +#include "LETypes.h"
    1.19 +#include "OpenTypeTables.h"
    1.20 +
    1.21 +U_NAMESPACE_BEGIN
    1.22 +
    1.23 +class LEGlyphStorage;
    1.24 +
    1.25 +class ArabicShaping /* not : public UObject because all methods are static */ {
    1.26 +public:
    1.27 +    // shaping bit masks
    1.28 +    enum ShapingBitMasks
    1.29 +    {
    1.30 +        MASK_SHAPE_RIGHT    = 1, // if this bit set, shapes to right
    1.31 +        MASK_SHAPE_LEFT     = 2, // if this bit set, shapes to left
    1.32 +        MASK_TRANSPARENT    = 4, // if this bit set, is transparent (ignore other bits)
    1.33 +        MASK_NOSHAPE        = 8  // if this bit set, don't shape this char, i.e. tatweel
    1.34 +    };
    1.35 +
    1.36 +    // shaping values
    1.37 +    enum ShapeTypeValues
    1.38 +    {
    1.39 +        ST_NONE         = 0,
    1.40 +        ST_RIGHT        = MASK_SHAPE_RIGHT,
    1.41 +        ST_LEFT         = MASK_SHAPE_LEFT,
    1.42 +        ST_DUAL         = MASK_SHAPE_RIGHT | MASK_SHAPE_LEFT,
    1.43 +        ST_TRANSPARENT  = MASK_TRANSPARENT,
    1.44 +        ST_NOSHAPE_DUAL = MASK_NOSHAPE | ST_DUAL,
    1.45 +        ST_NOSHAPE_NONE = MASK_NOSHAPE
    1.46 +    };
    1.47 +
    1.48 +    typedef le_int32 ShapeType;
    1.49 +
    1.50 +    static void shape(const LEUnicode *chars, le_int32 offset, le_int32 charCount, le_int32 charMax,
    1.51 +                      le_bool rightToLeft, LEGlyphStorage &glyphStorage);
    1.52 +
    1.53 +    static const LETag *getFeatureOrder();
    1.54 +
    1.55 +private:
    1.56 +    // forbid instantiation
    1.57 +    ArabicShaping();
    1.58 +
    1.59 +    static const LETag tagArray[];
    1.60 +
    1.61 +    static ShapeType getShapeType(LEUnicode c);
    1.62 +
    1.63 +    static const ShapeType shapeTypes[];
    1.64 +
    1.65 +    static void adjustTags(le_int32 outIndex, le_int32 shapeOffset, LEGlyphStorage &glyphStorage); 
    1.66 +};
    1.67 +
    1.68 +U_NAMESPACE_END
    1.69 +#endif