pleyo.com

/src/trunk2/BAL/Interfaces/font/BIGlyphBuffer.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2007 Pleyo.  All rights reserved.
00003  *
00004  * Redistribution and use in source and binary forms, with or without
00005  * modification, are permitted provided that the following conditions
00006  * are met:
00007  *
00008  * 1.  Redistributions of source code must retain the above copyright
00009  *     notice, this list of conditions and the following disclaimer.
00010  * 2.  Redistributions in binary form must reproduce the above copyright
00011  *     notice, this list of conditions and the following disclaimer in the
00012  *     documentation and/or other materials provided with the distribution.
00013  * 3.  Neither the name of Pleyo nor the names of
00014  *     its contributors may be used to endorse or promote products derived
00015  *     from this software without specific prior written permission.
00016  *
00017  * THIS SOFTWARE IS PROVIDED BY PLEYO AND ITS CONTRIBUTORS "AS IS" AND ANY
00018  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00019  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00020  * DISCLAIMED. IN NO EVENT SHALL PLEYO OR ITS CONTRIBUTORS BE LIABLE FOR ANY
00021  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
00022  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00023  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
00024  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00025  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
00026  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00027  */
00028 
00040 #ifndef BIGLYPHBUFFER_H
00041 #define BIGLYPHBUFFER_H
00042 
00043 #include "FloatSize.h"
00044 
00045 using WebCore::FloatSize;
00046 
00047 namespace BAL {
00048 
00052 typedef unsigned short Glyph;
00053 class BTFontData;
00054 typedef unsigned short GlyphBufferGlyph;
00055 typedef FloatSize GlyphBufferAdvance;
00056 
00067 class BIGlyphBuffer {
00068 public:
00074     virtual bool isEmpty() const = 0;
00080     virtual int size() const = 0;
00081 
00085     virtual void clear() = 0;
00086 
00087     virtual GlyphBufferGlyph* glyphs(int from) = 0;
00088     virtual const GlyphBufferGlyph* glyphs(int from) const = 0;
00089 
00090     virtual GlyphBufferAdvance* advances(int from) = 0;
00091     virtual const GlyphBufferAdvance* advances(int from) const = 0;
00092 
00098     virtual const BTFontData* fontDataAt(int index) const = 0;
00099 
00100     virtual FloatSize offsetAt(int index) const = 0;
00101 
00109     virtual void swap(int index1, int index2) = 0;
00110 
00117     virtual Glyph glyphAt(int index) const = 0;
00118 
00125     virtual float advanceAt(int index) const = 0;
00126 
00134     virtual void add(Glyph glyph, const BTFontData* font, float width, const FloatSize* offset = 0) = 0;
00135 
00136     virtual ~BIGlyphBuffer() {};
00137 };
00138 
00139 #define IMPLEMENT_BIGLYPHBUFFER \
00140     public: \
00141         virtual bool                isEmpty() const;\
00142         virtual int                 size() const;\
00143         virtual void                clear();\
00144         virtual GlyphBufferGlyph*       glyphs(int from); \
00145         virtual const GlyphBufferGlyph* glyphs(int from) const; \
00146         virtual GlyphBufferAdvance* advances(int from); \
00147         virtual const GlyphBufferAdvance* advances(int from) const; \
00148         virtual const BTFontData*   fontDataAt(int index) const;\
00149         virtual FloatSize                       offsetAt(int index) const; \
00150         virtual void                swap(int index1, int index2);\
00151         virtual Glyph               glyphAt(int index) const;\
00152         virtual float               advanceAt(int index) const;\
00153         virtual void                add(Glyph, const BTFontData*, float width);
00154 
00155 }
00156 #endif // BIGLYPHBUFFER_H
00157 
00158 

Generated on Wed Nov 21 20:04:16 2007 for Origyn Web Browser by Doxygen 1.5.3

pleyo.com
pleyo.com