Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

text.h

Go to the documentation of this file.
00001 
00002 // Flash Plugin and Player
00003 // Copyright (C) 1998,1999 Olivier Debon
00004 // 
00005 // This program is free software; you can redistribute it and/or
00006 // modify it under the terms of the GNU General Public License
00007 // as published by the Free Software Foundation; either version 2
00008 // of the License, or (at your option) any later version.
00009 // 
00010 // This program is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 // GNU General Public License for more details.
00014 // 
00015 // You should have received a copy of the GNU General Public License
00016 // along with this program; if not, write to the Free Software
00017 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00018 // 
00020 #ifndef _TEXT_H_
00021 #define _TEXT_H_
00022 
00023 struct Glyph {
00024         long    index;
00025         long    xAdvance;
00026         long    code;   // Ascii code
00027 };
00028 
00029 struct TextRecord {
00030 
00031         // Normal text record
00032         Glyph           *glyphs;
00033         long             nbGlyphs;
00034 
00035         // Control text record
00036         TextFlags        flags;
00037         SwfFont         *font;
00038         long             fontHeight;
00039         Color            color;
00040         long             xOffset;
00041         long             yOffset;
00042 
00043         TextRecord *next;
00044 
00045         TextRecord();
00046         ~TextRecord();
00047 
00048         char            *getText();
00049 };
00050 
00051 class Text : public Character {
00052 
00053         Rect             boundary;
00054         Matrix           textMatrix;
00055         TextRecord      *textRecords;   // List
00056 
00057 public:
00058         Text(long id);
00059         ~Text();
00060 
00061         void             setTextBoundary(Rect rect);
00062         void             setTextMatrix(Matrix m);
00063         void             addTextRecord(TextRecord *tr);
00064         int              execute(GraphicDevice *gd, Matrix *matrix, Cxform *cxform);
00065         void             getRegion(GraphicDevice *gd, Matrix *matrix, 
00066                                    void *id, ScanLineFunc scan_line_func);
00067         int              doText(GraphicDevice *gd, Matrix *matrix, Cxform *cxform, ShapeAction action,
00068                                 void *id, ScanLineFunc scan_line_func);
00069         void             getBoundingBox(Rect *bb, DisplayListEntry *e);
00070         TextRecord      *getTextRecords();
00071 
00072 #ifdef DUMP
00073         void     dump(BitStream *bs);
00074 #endif
00075 };
00076 
00077 #endif /* _TEXT_H_ */

Generated on Sat Nov 5 16:15:36 2005 for OPIE by  doxygen 1.4.2