gfx/graphite2/src/inc/CharInfo.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gfx/graphite2/src/inc/CharInfo.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,67 @@
     1.4 +/*  GRAPHITE2 LICENSING
     1.5 +
     1.6 +    Copyright 2010, SIL International
     1.7 +    All rights reserved.
     1.8 +
     1.9 +    This library is free software; you can redistribute it and/or modify
    1.10 +    it under the terms of the GNU Lesser General Public License as published
    1.11 +    by the Free Software Foundation; either version 2.1 of License, or
    1.12 +    (at your option) any later version.
    1.13 +
    1.14 +    This program is distributed in the hope that it will be useful,
    1.15 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.16 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    1.17 +    Lesser General Public License for more details.
    1.18 +
    1.19 +    You should also have received a copy of the GNU Lesser General Public
    1.20 +    License along with this library in the file named "LICENSE".
    1.21 +    If not, write to the Free Software Foundation, 51 Franklin Street, 
    1.22 +    Suite 500, Boston, MA 02110-1335, USA or visit their web page on the 
    1.23 +    internet at http://www.fsf.org/licenses/lgpl.html.
    1.24 +
    1.25 +Alternatively, the contents of this file may be used under the terms of the
    1.26 +Mozilla Public License (http://mozilla.org/MPL) or the GNU General Public
    1.27 +License, as published by the Free Software Foundation, either version 2
    1.28 +of the License or (at your option) any later version.
    1.29 +*/
    1.30 +#pragma once
    1.31 +#include "inc/Main.h"
    1.32 +
    1.33 +
    1.34 +namespace graphite2 {
    1.35 +
    1.36 +class CharInfo
    1.37 +{
    1.38 +
    1.39 +public:
    1.40 +    CharInfo() : m_char(0), m_before(-1), m_after(-1), m_base(0), m_featureid(0), m_break(0), m_flags(0) {}
    1.41 +    void init(int cid) { m_char = cid; }
    1.42 +    unsigned int unicodeChar() const { return m_char; }
    1.43 +    void feats(int offset) { m_featureid = offset; }
    1.44 +    int fid() const { return m_featureid; }
    1.45 +    int breakWeight() const { return m_break; }
    1.46 +    void breakWeight(int val) { m_break = val; }
    1.47 +    int after() const { return m_after; }
    1.48 +    void after(int val) { m_after = val; }
    1.49 +    int before() const { return m_before; }
    1.50 +    void before(int val) { m_before = val; }
    1.51 +    size_t base() const { return m_base; }
    1.52 +    void base(size_t offset) { m_base = offset; }
    1.53 +    void addflags(uint8 val) { m_flags |= val; }
    1.54 +    uint8 flags() const { return m_flags; }
    1.55 +
    1.56 +    CLASS_NEW_DELETE
    1.57 +private:
    1.58 +    int m_char;     // Unicode character from character stream
    1.59 +    int m_before;   // slot index before us, comes before
    1.60 +    int m_after;    // slot index after us, comes after
    1.61 +    size_t  m_base; // offset into input string corresponding to this charinfo
    1.62 +    uint8 m_featureid;  // index into features list in the segment
    1.63 +    int8 m_break;   // breakweight coming from lb table
    1.64 +    uint8 m_flags;  // 0,1 segment split.
    1.65 +};
    1.66 +
    1.67 +} // namespace graphite2
    1.68 +
    1.69 +struct gr_char_info : public graphite2::CharInfo {};
    1.70 +

mercurial