• 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     class Transform;
00035 }
00036 
00037 namespace gnash {
00038 namespace SWF {
00039 
00040 
00042 //
00046 class DefineTextTag : public DefinitionTag
00047 {
00048 public:
00049 
00050     static void loader(SWFStream& in, TagType tag, movie_definition& m, 
00051             const RunResources& r);
00052 
00054     void display(Renderer& renderer, const Transform& xform) const;
00055         
00056         const SWFRect& bounds() const {
00057         // TODO: There is a _matrix field in the definition(!) that's
00058         // currently ignored. Don't know if it needs to be transformed... 
00059         return _rect; 
00060     }
00061 
00063     //
00068     bool extractStaticText(std::vector<const TextRecord*>& to, size_t& size)
00069       const;
00070 
00071     virtual DisplayObject* createDisplayObject(Global_as& gl,
00072             DisplayObject* parent) const;
00073 
00074 private:
00075 
00077     friend class DefineText2Tag;
00078 
00080     //
00082         DefineTextTag(SWFStream& in, movie_definition& m, TagType tag,
00083             boost::uint16_t id)
00084         :
00085         DefinitionTag(id)
00086     {
00087         read(in, m, tag);
00088     }
00089 
00090         SWFRect _rect;
00091 
00092         SWFMatrix _matrix;
00093 
00094         void read(SWFStream& in, movie_definition& m, TagType tag);
00095         
00096     TextRecord::TextRecords _textRecords;
00097 };
00098 
00100 //
00102 class DefineText2Tag
00103 {
00104 public:
00105     static void loader(SWFStream& in, TagType tag, movie_definition& m, 
00106             const RunResources& r);
00107 };
00108 
00109 } // namespace SWF
00110 } // namespace gnash
00111 
00112 #endif 

Generated on Thu Sep 2 2010 for Gnash by  doxygen 1.7.1