20 #ifndef GNASH_DISPLAY_OBJECT_H
21 #define GNASH_DISPLAY_OBJECT_H
31 #include <boost/cstdint.hpp>
32 #include <boost/noncopyable.hpp>
33 #include <boost/logic/tribool.hpp>
59 class movie_definition;
61 class InteractiveObject;
125 void copyMatrix(
const DisplayObject& from, DisplayObject& to);
135 SWFMatrix
getWorldMatrix(
const DisplayObject&
d,
bool includeRoot =
true);
195 static const int lowerAccessibleBound = -16384;
200 static const int upperAccessibleBound = 2130690044;
205 static const int staticDepthOffset = lowerAccessibleBound;
222 static const int removedDepthOffset = -32769;
230 static const int noClipDepthValue = -1000000;
237 assert(_parent != NULL);
238 return _parent->get_environment();
285 int getWorldVolume()
const;
304 void setMatrix(
const SWFMatrix&
m,
bool updateCache =
false);
313 void set_x_scale(
double factor);
322 void set_y_scale(
double factor);
333 void set_rotation(
double rot);
342 virtual void setWidth(
double width);
354 if (_transform.colorTransform != cx) {
356 _transform.colorTransform = cx;
363 if (r !=
_ratio) set_invalidated();
378 void set_clip_depth(
int d)
390 bool isMaskLayer()
const
392 return (m_clip_depth != noClipDepthValue && !_maskee);
404 bool isDynamicMask()
const
412 #if GNASH_PARANOIA_LEVEL > 1
413 if (_mask) assert(_mask->_maskee ==
this);
442 std::auto_ptr<ExecutableCode> get_event_handler(
const event_id&
id)
const;
475 virtual StaticText* getStaticText(std::vector<const SWF::TextRecord*>&,
480 virtual SWFRect getBounds()
const = 0;
488 bool pointInBounds(boost::int32_t
x, boost::int32_t
y)
const
501 virtual bool pointInShape(boost::int32_t
x, boost::int32_t
y)
const = 0;
515 virtual bool pointInVisibleShape(boost::int32_t
x, boost::int32_t
y)
const
518 if (isDynamicMask() || isMaskLayer())
return false;
519 return pointInShape(x, y);
573 bool get_accept_anim_moves()
const
575 return ! _scriptTransformed && ! _dynamicallyCreated;
593 return _dynamicallyCreated;
598 _dynamicallyCreated =
true;
611 void transformedByScript()
613 _scriptTransformed =
true;
620 void set_visible(
bool visible);
632 bool hasEventHandler(
const event_id&
id)
const;
649 if (
this != dragging &&
visible() && pointInVisibleShape(x, y)) {
663 return _child_invalidated;
692 void set_invalidated();
693 void set_invalidated(
const char* debug_file,
int debug_line);
706 void set_child_invalidated();
721 _invalidated =
false;
722 _child_invalidated =
false;
723 m_old_invalidated_ranges.setNull();
765 saveOriginalTarget();
782 virtual void getLoadedMovie(
Movie* newMovie);
801 virtual void destroy();
815 bool boundsInClippingArea(
Renderer& renderer)
const;
821 std::string getTargetPath()
const;
829 const std::string& getOrigTarget()
const
854 typedef tree<std::pair<std::string, std::string> > InfoTree;
864 virtual InfoTree::iterator getMovieInfo(InfoTree& tr,
865 InfoTree::iterator it);
873 BLENDMODE_UNDEFINED = 0,
874 BLENDMODE_NORMAL = 1,
887 BLENDMODE_HARDLIGHT = 14
900 typedef std::map<event_id, BufferList>
Events;
943 virtual void markReachableResources()
const;
991 void saveOriginalTarget()
993 _origTarget=getTarget();
998 return _event_handlers;
1001 void set_event_handlers(
const Events& copyfrom);
1049 double _xscale, _yscale, _rotation;
1052 boost::int32_t _depth;
1054 boost::tribool _focusRect;
1076 std::string _origTarget;
1089 bool _scriptTransformed;
1091 bool _dynamicallyCreated;
1112 bool _child_invalidated;
1124 inline const SWFCxForm&
1162 return d ? d->
object() : 0;
1172 #ifdef DEBUG_SET_INVALIDATED
1173 #define set_invalidated() set_invalidated(__FILE__, __LINE__)
1177 #endif // GNASH_CHARACTER_H