Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef GNASH_STATIC_TEXT_H
00021 #define GNASH_STATIC_TEXT_H
00022
00023 #include "smart_ptr.h"
00024 #include "DisplayObject.h"
00025 #include "swf/DefineTextTag.h"
00026
00027 #include <vector>
00028 #include <boost/dynamic_bitset.hpp>
00029 #include <boost/intrusive_ptr.hpp>
00030 #include <cassert>
00031
00032
00033 namespace gnash {
00034 namespace SWF {
00035 class TextRecord;
00036 }
00037 }
00038
00039 namespace gnash {
00040
00042
00044 class StaticText : public DisplayObject
00045 {
00046 public:
00047
00048 StaticText(movie_root& mr, as_object* object, const SWF::DefineTextTag* def,
00049 DisplayObject* parent)
00050 :
00051 DisplayObject(mr, object, parent),
00052 _def(def),
00053 _selectionColor(0, 255, 255, 255)
00054 {
00055 assert(_def);
00056 }
00057
00059
00062
00068 virtual StaticText* getStaticText(std::vector<const SWF::TextRecord*>& to,
00069 size_t& numChars);
00070
00071 virtual void display(Renderer& renderer);
00072
00073 void setSelected(size_t pos, bool selected) {
00074 _selectedText.set(pos, selected);
00075 }
00076
00078
00085 const boost::dynamic_bitset<>& getSelected() const {
00086 return _selectedText;
00087 }
00088
00089 void setSelectionColor(boost::uint32_t color);
00090
00091 virtual SWFRect getBounds() const {
00092 return _def->bounds();
00093 }
00094
00095 virtual bool pointInShape(boost::int32_t x, boost::int32_t y) const;
00096
00097 const rgba& selectionColor() const {
00098 return _selectionColor;
00099 }
00100
00101 private:
00102
00103 const boost::intrusive_ptr<const SWF::DefineTextTag> _def;
00104
00106
00109 boost::dynamic_bitset<> _selectedText;
00110
00112
00114 rgba _selectionColor;
00115
00116 };
00117
00118
00119 }
00120
00121
00122 #endif
00123
00124
00125
00126
00127
00128