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 #ifndef GNASH_INTERACTIVE_DISPLAY_OBJECT_H
00020 #define GNASH_INTERACTIVE_DISPLAY_OBJECT_H
00021
00022 #include "DisplayObject.h"
00023 #include "log.h"
00024 #include "as_object.h"
00025
00026 #include <vector>
00027 #include <cassert>
00028
00029 namespace gnash {
00030 class StaticText;
00031 namespace SWF {
00032 class TextRecord;
00033 }
00034 }
00035
00036 namespace gnash {
00037
00039
00042
00044 class InteractiveObject : public DisplayObject
00045 {
00046
00047 public:
00048
00049 InteractiveObject(as_object* object, DisplayObject* parent)
00050 :
00051 DisplayObject(getRoot(*object), object, parent)
00052 {
00053
00054
00055
00056 assert(object);
00057 }
00058
00059 virtual ~InteractiveObject() {}
00060
00062 virtual void display(Renderer& renderer, const Transform& xform) = 0;
00063
00065
00068 virtual bool mouseEnabled() const = 0;
00069
00071 virtual bool trackAsMenu() {
00072 return false;
00073 }
00074
00076
00079 virtual StaticText* getStaticText(std::vector<const SWF::TextRecord*>&,
00080 size_t&) {
00081 return 0;
00082 }
00083
00085
00089 virtual SWFRect getBounds() const = 0;
00090
00094
00115 virtual InteractiveObject* topmostMouseEntity(boost::int32_t ,
00116 boost::int32_t ) = 0;
00117
00118 virtual void mouseEvent(const event_id& id)
00119 {
00120 notifyEvent(id);
00121 }
00122
00124
00131 virtual bool pointInShape(boost::int32_t x, boost::int32_t y) const
00132 {
00133 log_error("Character %s did not override pointInShape() - "
00134 "using pointInBounds() instead", typeid(*this).name());
00135 return pointInBounds(x, y);
00136 }
00137
00138 void add_invalidated_bounds(InvalidatedRanges& ranges, bool force) = 0;
00139
00140 };
00141
00142
00143 }
00144
00145
00146 #endif
00147
00148
00149
00150
00151
00152