diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2013-12-02 09:17:29 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2013-12-02 09:17:29 +0000 |
commit | c213aa5e07da96e6e628f68e6ebc1aeaca213ea9 (patch) | |
tree | 3f8a0a47fec4e76f1371b33012602f739fb47dad /Build/source/libs/graphite2/graphite2-1.2.4/src/inc/Pass.h | |
parent | 9ac026df0b860968a28af4b64d75c2246924ff40 (diff) |
graphite2 1.2.4
git-svn-id: svn://tug.org/texlive/trunk@32299 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/libs/graphite2/graphite2-1.2.4/src/inc/Pass.h')
-rw-r--r-- | Build/source/libs/graphite2/graphite2-1.2.4/src/inc/Pass.h | 98 |
1 files changed, 98 insertions, 0 deletions
diff --git a/Build/source/libs/graphite2/graphite2-1.2.4/src/inc/Pass.h b/Build/source/libs/graphite2/graphite2-1.2.4/src/inc/Pass.h new file mode 100644 index 00000000000..33abbdce503 --- /dev/null +++ b/Build/source/libs/graphite2/graphite2-1.2.4/src/inc/Pass.h @@ -0,0 +1,98 @@ +/* GRAPHITE2 LICENSING + + Copyright 2010, SIL International + All rights reserved. + + This library is free software; you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should also have received a copy of the GNU Lesser General Public + License along with this library in the file named "LICENSE". + If not, write to the Free Software Foundation, 51 Franklin Street, + Suite 500, Boston, MA 02110-1335, USA or visit their web page on the + internet at http://www.fsf.org/licenses/lgpl.html. + +Alternatively, the contents of this file may be used under the terms of the +Mozilla Public License (http://mozilla.org/MPL) or the GNU General Public +License, as published by the Free Software Foundation, either version 2 +of the License or (at your option) any later version. +*/ +#pragma once + +#include <cstdlib> +#include "inc/Code.h" + +namespace graphite2 { + +class Segment; +class Face; +class Silf; +struct Rule; +struct RuleEntry; +struct State; +class FiniteStateMachine; +class Error; + +class Pass +{ +public: + Pass(); + ~Pass(); + + bool readPass(const byte * pPass, size_t pass_length, size_t subtable_base, Face & face, Error &e); + void runGraphite(vm::Machine & m, FiniteStateMachine & fsm) const; + void init(Silf *silf) { m_silf = silf; } + byte spaceContextuals() const { return (m_flags & 0x0E) >> 1; } + + CLASS_NEW_DELETE +private: + void findNDoRule(Slot* & iSlot, vm::Machine &, FiniteStateMachine& fsm) const; + int doAction(const vm::Machine::Code* codeptr, Slot * & slot_out, vm::Machine &) const; + bool testPassConstraint(vm::Machine & m) const; + bool testConstraint(const Rule & r, vm::Machine &) const; + bool readRules(const byte * rule_map, const size_t num_entries, + const byte *precontext, const uint16 * sort_key, + const uint16 * o_constraint, const byte *constraint_data, + const uint16 * o_action, const byte * action_data, + Face &, Error &e); + bool readStates(const byte * starts, const byte * states, const byte * o_rule_map, Face &, Error &e); + bool readRanges(const byte * ranges, size_t num_ranges, Error &e); + uint16 glyphToCol(const uint16 gid) const; + bool runFSM(FiniteStateMachine & fsm, Slot * slot) const; + void dumpRuleEventConsidered(const FiniteStateMachine & fsm, const RuleEntry & re) const; + void dumpRuleEventOutput(const FiniteStateMachine & fsm, const Rule & r, Slot * os) const; + void adjustSlot(int delta, Slot * & slot_out, SlotMap &) const; + const Silf* m_silf; + uint16 * m_cols; + Rule * m_rules; // rules + RuleEntry * m_ruleMap; + uint16 * m_startStates; // prectxt length + uint16 * m_transitions; + State * m_states; + + byte m_flags; + byte m_iMaxLoop; + uint16 m_numGlyphs; + uint16 m_numRules; + uint16 m_numStates; + uint16 m_numTransition; + uint16 m_numSuccess; + uint16 m_successStart; + uint16 m_numColumns; + byte m_minPreCtxt; + byte m_maxPreCtxt; + vm::Machine::Code m_cPConstraint; + +private: //defensive + Pass(const Pass&); + Pass& operator=(const Pass&); +}; + +} // namespace graphite2 |