os/textandloc/fontservices/textshaperplugin/IcuSource/layout/LookupProcessor.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /*
     2  * %W% %E%
     3  *
     4  * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved
     5  *
     6  */
     7 
     8 #ifndef __LOOKUPPROCESSOR_H
     9 #define __LOOKUPPROCESSOR_H
    10 
    11 /**
    12  * \file
    13  * \internal
    14  */
    15 
    16 #include "LETypes.h"
    17 #include "LEFontInstance.h"
    18 #include "OpenTypeTables.h"
    19 //#include "Lookups.h"
    20 //#include "Features.h"
    21 
    22 U_NAMESPACE_BEGIN
    23 
    24 class  LEFontInstance;
    25 class  LEGlyphStorage;
    26 class  GlyphIterator;
    27 class  GlyphPositionAdjustments;
    28 struct FeatureTable;
    29 struct FeatureListTable;
    30 struct GlyphDefinitionTableHeader;
    31 struct LookupSubtable;
    32 struct LookupTable;
    33 
    34 class LookupProcessor : public UMemory {
    35 public:
    36     static const LETag notSelected;
    37     static const LETag defaultFeature;
    38 
    39     le_bool isBogus();
    40 
    41     le_int32 process(LEGlyphStorage &glyphStorage,
    42         GlyphPositionAdjustments *glyphPositionAdjustments, le_bool rightToLeft,
    43         const GlyphDefinitionTableHeader *glyphDefinitionTableHeader,
    44         const LEFontInstance *fontInstance, LEErrorCode& success) const;
    45 
    46     le_uint32 applyLookupTable(const LookupTable *lookupTable, GlyphIterator *glyphIterator,
    47         const LEFontInstance *fontInstance, LEErrorCode& success) const;
    48 
    49     le_uint32 applySingleLookup(le_uint16 lookupTableIndex, GlyphIterator *glyphIterator,
    50         const LEFontInstance *fontInstance, LEErrorCode& success) const;
    51 
    52     virtual le_uint32 applySubtable(const LookupSubtable *lookupSubtable, le_uint16 subtableType,
    53         GlyphIterator *glyphIterator, const LEFontInstance *fontInstance,
    54         LEErrorCode& success) const = 0;
    55 
    56     virtual ~LookupProcessor();
    57 
    58 protected:
    59     LookupProcessor(const char *baseAddress,
    60         Offset scriptListOffset, Offset featureListOffset, Offset lookupListOffset,
    61         LETag scriptTag, LETag languageTag, const LETag *featureOrder);
    62 
    63     LookupProcessor();
    64 
    65     le_int32 selectLookups(const FeatureTable *featureTable, LETag featureTag, le_int32 order);
    66 
    67     const LookupListTable   *lookupListTable;
    68     const FeatureListTable  *featureListTable;
    69 
    70     LETag                   *lookupSelectArray;
    71     LETag                   requiredFeatureTag;
    72 
    73     le_uint16               *lookupOrderArray;
    74     le_uint32               lookupOrderCount;
    75 
    76 private:
    77 
    78     LookupProcessor(const LookupProcessor &other); // forbid copying of this class
    79     LookupProcessor &operator=(const LookupProcessor &other); // forbid copying of this class
    80 };
    81 
    82 U_NAMESPACE_END
    83 #endif