• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • Examples
  • File List
  • File Members

DefineTextTag.h

Go to the documentation of this file.
00001 // 
00002 //   Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Free Software
00003 //   Foundation, Inc
00004 // 
00005 // This program is free software; you can redistribute it and/or modify
00006 // it under the terms of the GNU General Public License as published by
00007 // the Free Software Foundation; either version 3 of the License, or
00008 // (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., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00018 
00019 #ifndef GNASH_SWF_DEFINETEXTTAG_H
00020 #define GNASH_SWF_DEFINETEXTTAG_H
00021 
00022 #include <vector>
00023 #include "DefinitionTag.h" // for inheritance
00024 #include "SWFRect.h" // for composition
00025 #include "SWF.h"
00026 #include "SWFMatrix.h"
00027 #include "TextRecord.h"
00028 
00029 namespace gnash {
00030     class movie_definition;
00031     class SWFStream;
00032     class RunResources;
00033     class StaticText;
00034 }
00035 
00036 namespace gnash {
00037 namespace SWF {
00038 
00039 
00041 //
00045 class DefineTextTag : public DefinitionTag
00046 {
00047 public:
00048 
00049     static void loader(SWFStream& in, TagType tag, movie_definition& m, 
00050             const RunResources& r);
00051 
00053         void display(Renderer& renderer, const StaticText& inst) const;
00054         
00055         const SWFRect& bounds() const {
00056         // TODO: There is a _matrix field in the definition(!) that's
00057         // currently ignored. Don't know if it needs to be transformed... 
00058         return _rect; 
00059     }
00060 
00062     //
00067     bool extractStaticText(std::vector<const TextRecord*>& to, size_t& size)
00068       const;
00069 
00070     virtual DisplayObject* createDisplayObject(Global_as& gl,
00071             DisplayObject* parent) const;
00072 
00073 private:
00074 
00076     friend class DefineText2Tag;
00077 
00079     //
00081         DefineTextTag(SWFStream& in, movie_definition& m, TagType tag,
00082             boost::uint16_t id)
00083         :
00084         DefinitionTag(id)
00085     {
00086         read(in, m, tag);
00087     }
00088 
00089         SWFRect _rect;
00090 
00091         SWFMatrix _matrix;
00092 
00093         void read(SWFStream& in, movie_definition& m, TagType tag);
00094         
00095     TextRecord::TextRecords _textRecords;
00096 };
00097 
00099 //
00101 class DefineText2Tag
00102 {
00103 public:
00104     static void loader(SWFStream& in, TagType tag, movie_definition& m, 
00105             const RunResources& r);
00106 };
00107 
00108 } // namespace SWF
00109 } // namespace gnash
00110 
00111 #endif 

Generated on Thu Sep 30 2010 14:34:57 for Gnash by  doxygen 1.7.1