/*
 * This file is part of libtqtvd_astronav
 *
 * Copyright (C) 2008-2017 TQTVD Software
 * Copyright (C) 2017 Mirakulo Software (mirakulo@mirakulo.com)
 *
 * 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 the License, or (at your option) any later version.
 *
 * This library 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 have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 * 02110-1301  USA
 */

#ifndef BCGlyphBufferGraphicManager_h
#define BCGlyphBufferGraphicManager_h

#include <font/BIGlyphBuffer.h>
#include <font/BTFontData.h>

namespace BAL {

class BTFontData;

class BCGlyphBufferGraphicManager : public BIGlyphBuffer {
    public:
        virtual bool isEmpty() const;
        virtual int size() const;
        virtual void clear();
        virtual GlyphBufferGlyph* glyphs(int from);
        virtual const GlyphBufferGlyph* glyphs(int from) const;
        virtual GlyphBufferAdvance* advances(int from);
        virtual const GlyphBufferAdvance* advances(int from) const;
        virtual const BTFontData* fontDataAt(int index) const;
        virtual FloatSize offsetAt(int index) const;
        virtual void swap(int index1, int index2);
        virtual Glyph glyphAt(int index) const;
        virtual float advanceAt(int index) const;
        virtual void add(Glyph glyph, const BTFontData* font, float width, const FloatSize* offset = 0);
    private:
        Vector<const BTFontData*, 2048> m_fontData;
        Vector<GlyphBufferGlyph, 2048> m_glyphs;
        Vector<GlyphBufferAdvance, 2048> m_advances;
};

} //namespace BAL

#endif //BCGlyphBufferGraphicManager_h
