Gnash
0.8.11dev
|
DisplayObject is the base class for all DisplayList objects. More...
#include <DisplayObject.h>
Classes | |
class | MaskRenderer |
Render a dynamic mask for a specified DisplayObject. More... | |
Public Types | |
enum | BlendMode { BLENDMODE_UNDEFINED = 0, BLENDMODE_NORMAL = 1, BLENDMODE_LAYER, BLENDMODE_MULTIPLY, BLENDMODE_SCREEN, BLENDMODE_LIGHTEN, BLENDMODE_DARKEN, BLENDMODE_DIFFERENCE, BLENDMODE_ADD, BLENDMODE_SUBTRACT, BLENDMODE_INVERT, BLENDMODE_ALPHA, BLENDMODE_ERASE, BLENDMODE_OVERLAY, BLENDMODE_HARDLIGHT = 14 } |
typedef std::vector< const action_buffer * > | BufferList |
typedef std::map< event_id, BufferList > | Events |
Public Member Functions | |
DisplayObject (movie_root &mr, as_object *object, DisplayObject *parent) | |
Construct a DisplayObject. More... | |
virtual | ~DisplayObject () |
virtual as_environment & | get_environment () |
Return a reference to the variable scope of this DisplayObject. More... | |
virtual void | visitNonProperties (KeyVisitor &) const |
Enumerate any non-proper properties. More... | |
DisplayObject * | parent () const |
Return the parent of this DisplayObject, or NULL if the DisplayObject has no parent. More... | |
void | set_parent (DisplayObject *parent) |
Set the parent of this DisplayObject. More... | |
virtual MovieClip * | to_movie () |
int | get_depth () const |
void | set_depth (int d) |
int | getVolume () const |
Get sound volume for this DisplayObject. More... | |
void | setVolume (int vol) |
Set sound volume for this DisplayObject. More... | |
int | getWorldVolume () const |
Get concatenated sound volume for this DisplayObject. More... | |
virtual int | getDefinitionVersion () const |
DisplayObjects can return the version of the SWF they were parsed from. More... | |
const Transform & | transform () const |
void | setMatrix (const SWFMatrix &m, bool updateCache=false) |
Set local transform SWFMatrix for this DisplayObject. More... | |
void | set_x_scale (double factor) |
Set the xscale value of current SWFMatrix. More... | |
void | set_y_scale (double factor) |
Set the yscale value of current SWFMatrix. More... | |
void | set_rotation (double rot) |
Set the rotation value of current SWFMatrix. More... | |
virtual void | setWidth (double width) |
Set the width of this DisplayObject, modifying its SWFMatrix. More... | |
virtual void | setHeight (double height) |
Set the height of this DisplayObject, modifying its SWFMatrix. More... | |
void | setCxForm (const SWFCxForm &cx) |
std::uint16_t | get_ratio () const |
void | set_ratio (std::uint16_t r) |
int | get_clip_depth () const |
void | set_clip_depth (int d) |
See get_clip_depth() More... | |
bool | isMaskLayer () const |
bool | isDynamicMask () const |
DisplayObject * | getMask () const |
Return the DisplayObject masking this instance (if any) More... | |
void | setMask (DisplayObject *mask) |
void | set_name (const ObjectURI &uri) |
Set DisplayObject name, initializing the original target member. More... | |
const ObjectURI & | get_name () const |
std::unique_ptr< ExecutableCode > | get_event_handler (const event_id &id) const |
Get the built-in function handlers code for the given event. More... | |
void | add_event_handler (const event_id &id, const action_buffer &code) |
Set a built-in function handler for the given event. More... | |
virtual void | display (Renderer &renderer, const Transform &xform)=0 |
Render the DisplayObject. More... | |
virtual StaticText * | getStaticText (std::vector< const SWF::TextRecord *> &, size_t &) |
Search for StaticText objects. More... | |
virtual SWFRect | getBounds () const =0 |
bool | pointInBounds (std::int32_t x, std::int32_t y) const |
Return true if the given point falls in this DisplayObject's bounds. More... | |
virtual bool | pointInShape (std::int32_t x, std::int32_t y) const =0 |
Return true if the given point falls in this DisplayObject's shape. More... | |
virtual bool | pointInVisibleShape (std::int32_t x, std::int32_t y) const |
true if the given point falls in this DisplayObject's visible shape More... | |
virtual Movie * | get_root () const |
Return the relative root of this DisplayObject. More... | |
virtual MovieClip * | getAsRoot () |
Return the _root ActionScript property of this DisplayObject. More... | |
virtual as_object * | pathElement (const ObjectURI &uri) |
bool | get_accept_anim_moves () const |
Return true if PlaceObjects tag are allowed to move this DisplayObject. More... | |
bool | isDynamic () const |
Was this DisplayObject dynamically created ? More... | |
void | setDynamic () |
Mark this DisplayObject as dynamically created. More... | |
void | transformedByScript () |
Call this function when the sprite has been transformed due to ActionScript code. More... | |
void | set_visible (bool visible) |
Set whether this DisplayObject should be rendered. More... | |
bool | visible () const |
bool | hasEventHandler (const event_id &id) const |
Return true if an handler for the given event is defined. More... | |
virtual InteractiveObject * | topmostMouseEntity (std::int32_t, std::int32_t) |
DisplayObjects are not a mouse entity by default. More... | |
virtual const DisplayObject * | findDropTarget (std::int32_t x, std::int32_t y, DisplayObject *dragging) const |
Point coordinates in global twips. More... | |
bool | invalidated () const |
Return whether this DisplayObject has been invalidated or not. More... | |
bool | childInvalidated () const |
Return whether this DisplayObject has and invalidated child or not. More... | |
virtual void | update () |
Notify a change in the DisplayObject's appearance. More... | |
void | set_invalidated () |
This function marks the DisplayObject as being modified in aspect and keeps track of current invalidated bounds the first time it's called after each call to clear_invalidated(). More... | |
void | set_invalidated (const char *debug_file, int debug_line) |
void | extend_invalidated_bounds (const InvalidatedRanges &ranges) |
void | set_child_invalidated () |
void | clear_invalidated () |
virtual void | add_invalidated_bounds (InvalidatedRanges &ranges, bool force) |
Add the DisplayObject's invalidated bounds to the given ranges list. More... | |
virtual void | omit_display () |
virtual void | construct (as_object *=nullptr) |
Callback invoked whenever a DisplayObject is placed on stage. More... | |
bool | unload () |
Unload this instance from the stage. More... | |
virtual void | getLoadedMovie (Movie *newMovie) |
Accept a loaded Movie. More... | |
bool | unloaded () const |
Return true if this DisplayObject was unloaded from the stage. More... | |
virtual void | destroy () |
Mark this DisplayObject as destroyed. More... | |
bool | isDestroyed () const |
Return true if this DisplayObject was destroyed. More... | |
bool | boundsInClippingArea (Renderer &renderer) const |
std::string | getTargetPath () const |
Return full path to this object, in slash notation. More... | |
const std::string & | getOrigTarget () const |
std::string DSOEXPORT | getTarget () const |
Return full path to this object, in dot notation. More... | |
virtual bool | isSelectableTextField () const |
Return true if this DisplayObject is a selectable TextField. More... | |
bool DSOEXPORT | allowHandCursor () const |
Return true if this DisplayObject allows turning the cursor into an hand shape when it happens to be the one receiving mouse events. More... | |
ObjectURI | getNextUnnamedInstanceName () |
Used to assign a name to unnamed instances. More... | |
BlendMode | getBlendMode () const |
void | setBlendMode (BlendMode bm) |
virtual bool | handleFocus () |
Set the current focus to this DisplayObject. More... | |
virtual void | killFocus () |
Some DisplayObjects require actions on losing focus. More... | |
double | rotation () const |
double | scaleX () const |
double | scaleY () const |
as_object * | object () const |
virtual void | markReachableResources () const |
Mark all reachable resources. More... | |
virtual void | markOwnResources () const |
Called by markReachableResources() More... | |
boost::tribool | focusRect () const |
void | focusRect (boost::tribool focus) |
![]() | |
GcResource (GC &gc) | |
Create a Garbage-collected resource associated with a GC. More... | |
void | setReachable () const |
Mark this resource as being reachable. More... | |
bool | isReachable () const |
Return true if this object is marked as reachable. More... | |
void | clearReachable () const |
Clear the reachable flag. More... | |
Static Public Member Functions | |
static as_value | blendMode (const fn_call &fn) |
Getter-setter for blendMode. More... | |
Static Public Attributes | |
static const int | lowerAccessibleBound = -16384 |
See also http://www.kirupa.com/developer/actionscript/depths2.htm. More... | |
static const int | upperAccessibleBound = 2130690044 |
static const int | staticDepthOffset = lowerAccessibleBound |
static const int | removedDepthOffset = -32769 |
static const int | noClipDepthValue = -1000000 |
Protected Member Functions | |
virtual bool | unloadChildren () |
movie_root & | stage () const |
Get the movie_root to which this DisplayObject belongs. More... | |
void | saveOriginalTarget () |
const Events & | get_event_handlers () const |
void | set_event_handlers (const Events ©from) |
as_object * | getPathElementSeparator (string_table::key key) |
look for '.', 'this', '..', '_parent', '_level0' and '_root' More... | |
![]() | |
virtual | ~GcResource () |
Delete this resource. More... | |
Protected Attributes | |
ObjectURI | _name |
Name of this DisplayObject (if any) More... | |
DisplayObject * | _parent |
InvalidatedRanges | m_old_invalidated_ranges |
Bounds of this DisplayObject instance before first invalidation since last call to clear_invalidated(). More... | |
DisplayObject is the base class for all DisplayList objects.
It represents a single active element in a movie. This class does not supply any interactivity. The hierarchy of DisplayObjects in a movie provides all visual elements in a SWF. The DisplayObject hierarchy is independent of ActionScript resources, but can be controlled via AS. DisplayObjects that can be controlled through ActionScript have an associated as_object. DisplayObjects such as Shape, do not have an associated object and cannot be referenced in AS. Derived classes include InteractiveObject, StaticText, Bitmap, Video, and Shape. All DisplayObjects may be constructed during SWF parsing. In this case they are constructed using an immutable, non-copyable SWF::DefinitionTag. This tag should never be changed! Most DisplayObjects may also be constructed dynamically. In AS3, Bitmaps and Shapes can be dynamically created. Dynamically-created DisplayObjects must not have a SWF::DefinitionTag! The presence of a definition tag may be used to distinguish static from dynamic DisplayObjects, but tags are not always stored. They are not stored in most InteractiveObjects because most properties can be overridden during SWF execution.
typedef std::vector<const action_buffer*> gnash::DisplayObject::BufferList |
typedef std::map<event_id, BufferList> gnash::DisplayObject::Events |
gnash::DisplayObject::DisplayObject | ( | movie_root & | mr, |
as_object * | object, | ||
DisplayObject * | parent | ||
) |
Construct a DisplayObject.
mr | The movie_root containing the DisplayObject hierarchy. All DisplayObjects may need movie_root resources. |
object | An object to be associated with this DisplayObject. If this is non-null, the DisplayObject will be referenceable in ActionScript. Referenceable DisplayObjects may access AS resources through their associated object. |
parent | The parent of the new DisplayObject. This may be null. |
|
inlinevirtual |
void gnash::DisplayObject::add_event_handler | ( | const event_id & | id, |
const action_buffer & | code | ||
) |
Set a built-in function handler for the given event.
Mark the DisplayObject as having mouse or Key event handlers if this is the case.
NOTE: this function is only for registering statically-defined event handlers, which are the ones attached to a DisplayObject with a PlaceObject2. It's the DisplayObject's responsibility to properly invoke any user-defined event handler, which are the ones attached to a DisplayObject with ActionScript code.
id | The event triggering the handler. |
code | An action buffer to execute when given event is triggered. The buffer is externally owned (not copied), make sure it is kept alive for the whole lifetime of this DisplayObject. |
Referenced by gnash::MovieClip::add_display_object(), and set_event_handlers().
|
virtual |
Add the DisplayObject's invalidated bounds to the given ranges list.
NOTE that this method should include the bounds that it covered the last time clear_invalidated() was called, as those need to be rerendered as well (to clear the region previously occupied by this DisplayObject).
That's why it returns the union of old_invalidated_ranges and the current bounds. The function is also used internally by set_invalidated() to update m_old_invalidated_ranges itself (you may notice some kind of circular reference), but that's no problem since old_invalidated_ranges is NULL during that call.
It is used to determine what area needs to be re-rendered. The coordinates are world coordinates (in TWIPS). Only instances with _invalidated flag set are checked unless force is set.
Reimplemented in gnash::MovieClip, gnash::TextField, gnash::InteractiveObject, gnash::Button, gnash::Video, and gnash::Bitmap.
References gnash::geometry::SnappingRanges2d< T >::add(), gnash::SWFRect::expand_to_transformed_rect(), getBounds(), gnash::SWFRect::getRange(), gnash::getWorldMatrix(), m_old_invalidated_ranges, and visible().
Referenced by gnash::Button::add_invalidated_bounds(), gnash::DisplayList::add_invalidated_bounds(), gnash::DisplayList::replaceDisplayObject(), and set_invalidated().
bool gnash::DisplayObject::allowHandCursor | ( | ) | const |
Return true if this DisplayObject allows turning the cursor into an hand shape when it happens to be the one receiving mouse events.
Whether to use a hand cursor when the mouse is over this DisplayObject.
This depends on the useHandCursor AS property, but:
References gnash::as_object::get_member(), gnash::getObject(), gnash::getVM(), gnash::NSV::PROP_USEHANDCURSOR, and gnash::toBool().
Referenced by gnash::Gui::notifyMouseMove(), and gnash::Gui::setInvalidatedRegions().
Getter-setter for blendMode.
If the blend mode is undefined, it doesn't return a string.
The extra static cast is required to keep OpenBSD happy.
References _, gnash::key::_1, gnash::fn_call::arg(), BLENDMODE_HARDLIGHT, BLENDMODE_NORMAL, BLENDMODE_UNDEFINED, getBlendMode(), gnash::getVM(), LOG_ONCE, gnash::log_unimpl(), gnash::fn_call::nargs, setBlendMode(), and gnash::toNumber().
Referenced by gnash::registerMovieClipNative().
bool gnash::DisplayObject::boundsInClippingArea | ( | Renderer & | renderer | ) | const |
Returns true when the DisplayObject bounds intersect with the current rendering clipping area.
There is no need to do any rendering for this DisplayObject when this function returns false because the renderer will not change any pixels in the area where this DisplayObject is placed.
References _, gnash::Renderer::bounds_in_clipping_area(), get_clip_depth(), get_depth(), get_ratio(), getBounds(), gnash::SWFRect::getRange(), getTarget(), gnash::getWorldMatrix(), gnash::SWFRect::height(), isDestroyed(), isDynamic(), isMaskLayer(), noClipDepthValue, gnash::SWFMatrix::transform(), gnash::typeName(), unloaded(), and gnash::SWFRect::width().
Referenced by gnash::DisplayList::display().
|
inline |
Return whether this DisplayObject has and invalidated child or not.
Referenced by gnash::MovieClip::add_invalidated_bounds(), and gnash::MovieClip::omit_display().
|
inline |
Clear invalidated flag and reset m_old_invalidated_bounds to null.
It is very important that each DisplayObject with any m_XXXX_invalidated flag set calls clear_invalidated() during the rendering of one frame. Basically this means each call to display() must match a call to clear_invalidated. This includes no-op display() calls, i.e. when the DisplayObject is outside of the screen. The DisplayList must still call clear_invalidated() even if display() is not necessary.
Not doing so will result in a stale invalidated flag which in turn will prevent the parent to be informed when this DisplayObject (or a child) is invalidated again (see set_invalidated() recursion).
Referenced by gnash::Shape::display(), gnash::MorphShape::display(), gnash::Video::display(), gnash::Bitmap::display(), gnash::StaticText::display(), gnash::Button::display(), gnash::TextField::display(), gnash::MovieClip::display(), gnash::movie_root::display(), and gnash::MovieClip::omit_display().
|
inlinevirtual |
Callback invoked whenever a DisplayObject is placed on stage.
This function must be called when the DisplayObject is placed on stage for the first time.
The DisplayObject version of this call sets the original target of the DisplayObject, for soft references to work. If you override the method remember to call saveOriginalTarget() as the first thing.
This handles all ActionScript construction and initialization events.
Reimplemented in gnash::MovieClip, gnash::Button, gnash::SWFMovie, gnash::Bitmap, and gnash::Video.
Referenced by gnash::MovieClip::add_display_object(), gnash::MovieClip::addDisplayListObject(), gnash::MovieClip::attachCharacter(), gnash::Button::construct(), gnash::MovieClip::replace_display_object(), and gnash::Button::set_current_state().
|
virtual |
Mark this DisplayObject as destroyed.
A DisplayObject should be destroyed when is removed from the display list and is not more needed for names (target) resolutions. Sprites are needed for names resolution whenever themselves or a contained object has an onUnload event handler defined, in which case we want the event handler to find the 'this' variable w/out attempting to rebind it.
Note: this function can safely release most memory associated with the DisplayObject as it will not be needed anymore.
we may destory a DisplayObject that's not unloaded. (we don't have chance to unload it in current model, see new_child_in_unload_test.c) We don't destroy ourself twice, right ?
Reimplemented in gnash::MovieClip, and gnash::Button.
References gnash::as_object::clearProperties().
Referenced by gnash::Button::destroy(), gnash::DisplayList::destroy(), gnash::MovieClip::destroy(), gnash::DisplayList::mergeDisplayList(), gnash::DisplayList::placeDisplayObject(), gnash::DisplayList::removeDisplayObject(), gnash::DisplayList::replaceDisplayObject(), gnash::Button::set_current_state(), and gnash::DisplayList::unload().
|
pure virtual |
Render the DisplayObject.
All DisplayObjects must have a display() function.
Implemented in gnash::MovieClip, gnash::TextField, gnash::Button, gnash::StaticText, gnash::Bitmap, gnash::Video, gnash::InteractiveObject, gnash::MorphShape, and gnash::Shape.
Referenced by gnash::DisplayList::display().
void gnash::DisplayObject::extend_invalidated_bounds | ( | const InvalidatedRanges & | ranges | ) |
Calls set_invalidated() and extends old_invalidated_ranges to the given value so that also this area gets re-rendered (used when replacing DisplayObjects).
References gnash::geometry::SnappingRanges2d< T >::add(), m_old_invalidated_ranges, and set_invalidated().
Referenced by gnash::DisplayList::placeDisplayObject(), and gnash::DisplayList::replaceDisplayObject().
|
inlinevirtual |
Point coordinates in global twips.
Find highest depth DisplayObject whose shape contains the given point and is not the DisplayObject being dragged or any of its childs.
Reimplemented in gnash::MovieClip.
References gnash::visible().
|
inline |
Referenced by gnash::DisplayObject::MaskRenderer::~MaskRenderer().
|
inline |
|
inline |
Return true if PlaceObjects tag are allowed to move this DisplayObject.
Once a DisplayObject has been transformed by ActionScript, further transformation trought non-action SWF constrol tags is not allowed.
See scriptTransformed()
Referenced by gnash::DisplayList::mergeDisplayList(), and gnash::DisplayList::moveDisplayObject().
|
inline |
Returns the clipping depth (if any) of this DisplayObject. The parameter tells us to use the DisplayObject as a mask for all the objects contained in the display list from _depth to m_clipping_depth inclusive.
The value returned by get_clip_depth() is only valid when isMaskLayer() returns true!
Referenced by gnash::DisplayList::add_invalidated_bounds(), boundsInClippingArea(), gnash::DisplayList::display(), gnash::MovieClip::duplicateMovieClip(), and gnash::MovieClip::getLoadedMovie().
|
inline |
Referenced by gnash::DisplayList::add(), gnash::DisplayList::add_invalidated_bounds(), boundsInClippingArea(), gnash::DisplayList::display(), gnash::MovieClip::getLoadedMovie(), getTarget(), getTargetPath(), gnash::DisplayList::mergeDisplayList(), gnash::Button::mouseEvent(), gnash::MovieClip::notifyEvent(), gnash::DisplayList::operator!=(), gnash::DepthComparator::operator()(), gnash::operator<<(), gnash::registerMovieClipNative(), gnash::registerTextFieldNative(), gnash::MovieClip::removeMovieClip(), gnash::TextField::removeTextField(), gnash::movie_root::replaceLevel(), gnash::Button::set_current_state(), gnash::Gui::setInvalidatedRegions(), gnash::movie_root::setLevel(), gnash::DisplayList::swapDepths(), and gnash::movie_root::swapLevels().
|
inlinevirtual |
Return a reference to the variable scope of this DisplayObject.
Reimplemented in gnash::MovieClip.
Referenced by gnash::TextField::getDefinitionVersion(), and gnash::Button::mouseEvent().
std::unique_ptr< ExecutableCode > gnash::DisplayObject::get_event_handler | ( | const event_id & | id | ) | const |
Get the built-in function handlers code for the given event.
NOTE: this function is only for getting statically-defined event handlers, which are the ones attached to a DisplayObject with a PlaceObject2. It's the DisplayObject's responsibility to properly fetch any user-defined event handler, which are the ones attached to a DisplayObject with ActionScript code.
Referenced by gnash::Button::mouseEvent(), and gnash::MovieClip::notifyEvent().
|
inlineprotected |
|
inline |
|
inline |
|
inlinevirtual |
Return the relative root of this DisplayObject.
The "relative" is the Movie created by the same SWF definition that contained the definition of this DisplayObject.
The default implementation is to invoke get_root against this DisplayObject's parent.
Reimplemented in gnash::MovieClip.
References get_root(), and test::uri.
Referenced by gnash::sprite_definition::createDisplayObject(), get_root(), getAsRoot(), gnash::TextField::getDefinitionVersion(), gnash::initObjectClass(), gnash::registerBitmapDataNative(), gnash::registerTextFieldNative(), and gnash::DisplayObject::MaskRenderer::~MaskRenderer().
|
virtual |
Return the _root ActionScript property of this DisplayObject.
By default calls get_root(). The resulting MovieClip may be passed to actionscript methods, so it is not const. As the override in MovieClip may return this, the method cannot be const either.
Reimplemented in gnash::MovieClip.
References get_root().
Referenced by gnash::Function2::call(), gnash::findObject(), gnash::MovieClip::getAsRoot(), and gnash::getDisplayObjectProperty().
|
inline |
Referenced by blendMode().
|
pure virtual |
Implemented in gnash::TextField, gnash::MovieClip, gnash::Button, gnash::StaticText, gnash::InteractiveObject, gnash::Bitmap, gnash::Video, gnash::MorphShape, and gnash::Shape.
Referenced by add_invalidated_bounds(), boundsInClippingArea(), gnash::Button::getBounds(), gnash::getHeight(), gnash::registerMovieClipNative(), setHeight(), setWidth(), and gnash::DisplayObject::MaskRenderer::~MaskRenderer().
|
inlinevirtual |
DisplayObjects can return the version of the SWF they were parsed from.
Reimplemented in gnash::MovieClip, and gnash::TextField.
Referenced by gnash::registerMovieClipNative().
|
virtual |
Accept a loaded Movie.
Reimplemented in gnash::MovieClip.
References _, LOG_ONCE, gnash::log_unimpl(), gnash::typeName(), and UNUSED.
Referenced by gnash::MovieLoader::clear().
|
inline |
Return the DisplayObject masking this instance (if any)
Referenced by gnash::MovieClip::pointInHitableShape(), and gnash::MovieClip::pointInVisibleShape().
ObjectURI gnash::DisplayObject::getNextUnnamedInstanceName | ( | ) |
Used to assign a name to unnamed instances.
References gnash::getURI(), gnash::movie_root::getVM(), gnash::movie_root::nextUnnamedInstance(), and stage().
Referenced by gnash::MovieClip::add_display_object(), gnash::SWF::ButtonRecord::instantiate(), and gnash::MovieClip::replace_display_object().
|
inline |
Return original target path to this object, in dot notation as of at construction time. This is needed to properly dereference dangling soft-references See testcase misc-swfc.all/soft_reference_test1.sc
References DSOEXPORT.
|
protected |
look for '.', 'this', '..', '_parent', '_level0' and '_root'
NOTE: case insensitive up to SWF6, sensitive from SWF7 up
|
inlinevirtual |
Search for StaticText objects.
If this is a StaticText object and contains SWF::TextRecords, these are written to the passed parameter. @ return 0 if this object is not a StaticText or contains no text.
Reimplemented in gnash::InteractiveObject, and gnash::StaticText.
std::string gnash::DisplayObject::getTarget | ( | ) | const |
Return full path to this object, in dot notation.
e.g. "_level0.sprite1.sprite2.ourSprite"
References gnash::Path::empty(), get_depth(), get_name(), gnash::VM::getStringTable(), gnash::movie_root::getVM(), parent(), path, stage(), staticDepthOffset, and gnash::ObjectURI::toString().
Referenced by gnash::MovieClip::advance(), boundsInClippingArea(), gnash::MovieClip::construct(), gnash::MovieClip::constructAsScriptObject(), gnash::Video::display(), gnash::MovieClip::duplicateMovieClip(), gnash::MovieClip::execute_init_action_buffer(), gnash::CharacterProxy::getTarget(), gnash::DisplayList::mergeDisplayList(), gnash::Button::mouseEvent(), gnash::MovieClip::notifyEvent(), gnash::ActionExec::operator()(), gnash::MovieClip::pointInVisibleShape(), gnash::movie_root::registerButton(), gnash::registerMovieClipNative(), gnash::registerSelectionNative(), gnash::registerTextFieldNative(), gnash::MovieClip::removeMovieClip(), gnash::TextField::removeTextField(), set_invalidated(), gnash::TextField::setFont(), gnash::setHeight(), gnash::setIndexedProperty(), gnash::Gui::setInvalidatedRegions(), gnash::DisplayList::swapDepths(), gnash::movie_root::swapLevels(), gnash::movie_root::testInvariant(), and gnash::DisplayObject::MaskRenderer::~MaskRenderer().
std::string gnash::DisplayObject::getTargetPath | ( | ) | const |
Return full path to this object, in slash notation.
e.g. "/sprite1/sprite2/ourSprite"
References gnash::Path::empty(), get_depth(), get_name(), gnash::getObject(), gnash::movie_root::getRootMovie(), gnash::getStringTable(), parent(), path, stage(), staticDepthOffset, and gnash::ObjectURI::toString().
Referenced by gnash::MovieClip::advance(), gnash::MovieClip::execute_action(), gnash::MovieClip::goto_frame(), gnash::movie_root::mouseClick(), gnash::movie_root::pushAction(), gnash::MovieClip::unloadChildren(), and gnash::DisplayObject::MaskRenderer::~MaskRenderer().
|
inline |
Get sound volume for this DisplayObject.
Referenced by getWorldVolume(), and gnash::registerSoundNative().
int gnash::DisplayObject::getWorldVolume | ( | ) | const |
Get concatenated sound volume for this DisplayObject.
NOTE: the concatenated volume does NOT include global volume settings, which is the one controlled by Sound instances created passing null, undefined or no argument to constructor.
References _parent, getVolume(), and volume.
Referenced by gnash::NetStream_as::play().
|
inlinevirtual |
Set the current focus to this DisplayObject.
Reimplemented in gnash::MovieClip, and gnash::Button.
Referenced by gnash::movie_root::setFocus().
bool gnash::DisplayObject::hasEventHandler | ( | const event_id & | id | ) | const |
Return true if an handler for the given event is defined.
NOTE that we look for both clip-defined and user-defined handlers, which is likely error prone since we're doing this in a non-virtual function. Main use for this method is for being called by ::unload() to verify an Unload handler is available.
References gnash::as_object::findProperty().
Referenced by gnash::MovieClip::mouseEnabled(), and gnash::MovieClip::unloadChildren().
|
inline |
Return whether this DisplayObject has been invalidated or not.
Referenced by gnash::Bitmap::add_invalidated_bounds(), gnash::Video::add_invalidated_bounds(), gnash::Button::add_invalidated_bounds(), gnash::TextField::add_invalidated_bounds(), and gnash::MovieClip::add_invalidated_bounds().
|
inline |
Return true if this DisplayObject was destroyed.
See destroy() for more info.
Referenced by gnash::MovieClip::add_display_object(), boundsInClippingArea(), gnash::MovieClip::call_frame_actions(), gnash::DisplayList::destroy(), gnash::DisplayList::display(), gnash::MovieClip::execute_action(), gnash::DisplayList::mergeDisplayList(), gnash::Button::mouseEvent(), gnash::operator<<(), gnash::movie_root::registerButton(), gnash::Button::set_current_state(), and gnash::DisplayList::unload().
|
inline |
Was this DisplayObject dynamically created ?
"Dynamically created" means created trough ActionScript.
NOTE, With current code:
Referenced by boundsInClippingArea(), gnash::MovieClip::construct(), gnash::DisplayList::mergeDisplayList(), and gnash::MovieClip::notifyEvent().
|
inline |
Returns true when the DisplayObject (and its childs) is used as a mask for another DisplayObject. isDynamicMask() does not return true when one of its parents is a mask and the DisplayObject itself is not.
NOTE: there's no way to obtain the maskee from a dynamic mask
See also isMaskLayer() and isMask()
Referenced by gnash::DisplayList::display(), gnash::MovieClip::pointInHitableShape(), and gnash::MovieClip::pointInVisibleShape().
|
inline |
Returns true when the DisplayObject (and its childs) is used as a mask for other DisplayObjects at higher depth (up to get_clip_depth). isMaskLayer() does not return true when one of its parents is a mask and the DisplayObject itself is not.
See also isDynamicMask() and isMask()
Referenced by gnash::DisplayList::add_invalidated_bounds(), boundsInClippingArea(), and gnash::DisplayList::display().
|
inlinevirtual |
Return true if this DisplayObject is a selectable TextField.
This method is used by Gui to set up an appropriate cursor for input textfields.
Reimplemented in gnash::TextField.
References DSOEXPORT.
Referenced by gnash::Gui::notifyMouseMove().
|
inlinevirtual |
Some DisplayObjects require actions on losing focus.
Default is a no-op. TextField implements this function.
Referenced by gnash::movie_root::setFocus().
|
inlinevirtual |
Called by markReachableResources()
DisplayObjects should mark their own resources in this function.
Reimplemented in gnash::MovieClip, gnash::Button, and gnash::Video.
Referenced by markReachableResources().
|
virtual |
Mark all reachable resources.
Try not to override this function in derived classes. This always marks the base class's resources and calls markOwnResources() to take care of any further GC resources.
Reimplemented from gnash::GcResource.
References _parent, markOwnResources(), and gnash::GcResource::setReachable().
|
inline |
References _object.
Referenced by gnash::getObject(), and gnash::isReferenceable().
|
inlinevirtual |
Called instead of display() when the DisplayObject is not visible on stage. Used to clear the invalidated flags.
Reimplemented in gnash::MovieClip.
Referenced by gnash::DisplayList::display(), and gnash::DisplayList::omit_display().
|
inline |
Return the parent of this DisplayObject, or NULL if the DisplayObject has no parent.
Referenced by gnash::Function2::call(), gnash::MovieClip::constructAsScriptObject(), gnash::DisplayList::display(), gnash::MovieClip::duplicateMovieClip(), gnash::MovieClip::getAsRoot(), gnash::MovieClip::getLoadedMovie(), getTarget(), getTargetPath(), gnash::getWorldCxForm(), gnash::getWorldMatrix(), gnash::MovieClip::notifyEvent(), pathElement(), gnash::MovieClip::queueLoad(), gnash::registerMovieClipNative(), gnash::MovieClip::removeMovieClip(), gnash::TextField::removeTextField(), gnash::movie_root::setDragState(), gnash::movie_root::testInvariant(), gnash::Button::topmostMouseEntity(), gnash::MovieClip::topmostMouseEntity(), and gnash::DisplayObject::MaskRenderer::~MaskRenderer().
Find the object which is one degree removed from us, given the relative pathname.
If the pathname is "..", then return our parent. If the pathname is ".", then return ourself. If the pathname is "_level0" or "_root", then return the root movie.
Otherwise, the name should refer to one our our named DisplayObjects, so we return it.
NOTE: In ActionScript 2.0, top level names (like "_root" and "_level0") are CASE SENSITIVE. Character names in a display list are CASE SENSITIVE. Member names are CASE INSENSITIVE. Gah.
In ActionScript 1.0, everything seems to be CASE INSENSITIVE.
Reimplemented in gnash::MovieClip.
References gnash::caseless(), gnash::string_table::find(), gnash::getName(), gnash::getObject(), gnash::VM::getStringTable(), gnash::movie_root::getVM(), parent(), gnash::NSV::PROP_THIS, stage(), and test::uri.
Referenced by gnash::movie_root::findCharacterByTarget(), gnash::parsePath(), and gnash::MovieClip::pathElement().
|
inline |
Return true if the given point falls in this DisplayObject's bounds.
x | Point x coordinate in world space |
y | Point y coordinate in world space |
References gnash::getWorldMatrix(), gnash::SWFRect::point_test(), gnash::SWFMatrix::transform(), x, and y.
Referenced by gnash::Bitmap::pointInShape(), gnash::StaticText::pointInShape(), and gnash::registerMovieClipNative().
|
pure virtual |
Return true if the given point falls in this DisplayObject's shape.
x | Point x coordinate in world space |
y | Point y coordinate in world space |
Implemented in gnash::TextField, gnash::MovieClip, gnash::InteractiveObject, gnash::Button, gnash::StaticText, gnash::Bitmap, gnash::MorphShape, gnash::Video, and gnash::Shape.
Referenced by gnash::MovieClip::pointInHitableShape(), gnash::Button::pointInShape(), and gnash::MovieClip::pointInVisibleShape().
|
inlinevirtual |
true if the given point falls in this DisplayObject's visible shape
Point coordinates are in world TWIPS
The default implementation returns false if the DisplayObject is not visible, calling pointInShape() otherwise.
Note that this is good for simple DisplayObjects but needs to be overridden for DisplayObjects with childs. When a DisplayObject has childs it must take into account the case in which some childs are visible and some are not.
Reimplemented in gnash::MovieClip.
References gnash::visible().
|
inline |
Referenced by set_rotation(), setHeight(), setWidth(), and gnash::DisplayObject::MaskRenderer::~MaskRenderer().
|
inlineprotected |
Register currently computable target as the "original" one. This will be used by soft references (as_value) and should be called as soon as the stagePlacementCallback is invoked.
Referenced by gnash::Video::construct(), gnash::SWFMovie::construct(), gnash::Button::construct(), and gnash::MovieClip::construct().
|
inline |
Referenced by set_rotation(), and gnash::DisplayObject::MaskRenderer::~MaskRenderer().
|
inline |
Referenced by gnash::DisplayObject::MaskRenderer::~MaskRenderer().
void gnash::DisplayObject::set_child_invalidated | ( | ) |
Called by a child to signalize it has changed visibily. The difference to set_invalidated() is that this DisplayObject does not need to redraw itself completely. This function will recursively inform all its parents of the change.
References _parent, and set_child_invalidated().
Referenced by set_child_invalidated(), and set_invalidated().
|
inline |
See get_clip_depth()
References gnash::key::d.
Referenced by gnash::MovieClip::add_display_object(), gnash::MovieClip::duplicateMovieClip(), gnash::MovieClip::getLoadedMovie(), and setMask().
|
inline |
References gnash::key::d.
Referenced by gnash::MovieLoader::clear(), gnash::movie_root::init(), gnash::DisplayList::insertDisplayObject(), gnash::SWF::ButtonRecord::instantiate(), gnash::DisplayList::mergeDisplayList(), gnash::DisplayList::placeDisplayObject(), gnash::DisplayList::replaceDisplayObject(), gnash::movie_root::replaceLevel(), gnash::Button::set_current_state(), gnash::DisplayList::swapDepths(), and gnash::movie_root::swapLevels().
|
protected |
References add_event_handler().
Referenced by gnash::MovieClip::duplicateMovieClip(), and gnash::MovieClip::getLoadedMovie().
void gnash::DisplayObject::set_invalidated | ( | ) |
This function marks the DisplayObject as being modified in aspect and keeps track of current invalidated bounds the first time it's called after each call to clear_invalidated().
Call this function before any change in this DisplayObject that modifies its rendering. This information will be used to detect visual changes that need to be redrawn.
It is important to call this function before the change rather then after as it will also take care of updating the previously invalidated bounds (m_old_invalidated_bounds)
Calling this function multiple time is a no-op, unless clear_invalidated() is called in between.
NOTE: Marking a DisplayObject as invalidated automatically marks its parent as being invalidated.
Referenced by gnash::MovieClip::addDisplayListObject(), gnash::Video::clear(), gnash::Bitmap::construct(), gnash::SWF::RemoveObjectTag::executeState(), extend_invalidated_bounds(), gnash::TextField::getTextAlignment(), gnash::DisplayList::insertDisplayObject(), gnash::TextField::keyInput(), gnash::DisplayList::mergeDisplayList(), gnash::DisplayList::placeDisplayObject(), gnash::MovieClip::remove_display_object(), gnash::DisplayList::replaceDisplayObject(), gnash::NetStream_as::seek(), gnash::Button::set_current_state(), set_visible(), gnash::TextField::setAlignment(), gnash::TextField::setAutoSize(), gnash::TextField::setBackgroundColor(), gnash::TextField::setBlockIndent(), gnash::TextField::setBorderColor(), gnash::TextField::setDisplay(), gnash::TextField::setDrawBackground(), gnash::TextField::setDrawBorder(), gnash::TextField::setEmbedFonts(), gnash::TextField::setFont(), gnash::TextField::setFontHeight(), gnash::TextField::setIndent(), gnash::TextField::setLeading(), gnash::TextField::setLeftMargin(), gnash::movie_root::setLevel(), setMask(), setMatrix(), gnash::TextField::setRightMargin(), gnash::TextField::setTabStops(), gnash::TextField::setTarget(), gnash::TextField::setTextColor(), gnash::TextField::setUnderlined(), gnash::TextField::setURL(), gnash::TextField::setWordWrap(), gnash::DisplayList::swapDepths(), gnash::movie_root::swapLevels(), gnash::Bitmap::update(), and gnash::TextField::updateText().
void gnash::DisplayObject::set_invalidated | ( | const char * | debug_file, |
int | debug_line | ||
) |
|
inline |
Set DisplayObject name, initializing the original target member.
Referenced by gnash::MovieClip::add_display_object(), gnash::MovieClip::duplicateMovieClip(), gnash::MovieClip::getLoadedMovie(), gnash::SWF::ButtonRecord::instantiate(), gnash::registerMovieClipNative(), gnash::registerTextFieldNative(), gnash::MovieClip::replace_display_object(), and gnash::DisplayObject::MaskRenderer::~MaskRenderer().
|
inline |
Set the parent of this DisplayObject.
In AS3, DisplayObjects may be created before being attached to a parent. In AS2, this is only used for external movies
Referenced by gnash::MovieClip::getLoadedMovie().
|
inline |
void gnash::DisplayObject::set_rotation | ( | double | rot | ) |
Set the rotation value of current SWFMatrix.
Set the real and cached rotation.
This is used when setting _rotation See rotation_getset
rot | rotation in degrees. will be trimmed to the -180 .. 180 range, can be passed outside it. |
Cached scale values are not updated.
References gnash::getMatrix(), gnash::key::m, rotation(), scaleX(), gnash::SWFMatrix::set_rotation(), gnash::SWFMatrix::set_x_scale(), setMatrix(), and transformedByScript().
Referenced by gnash::DisplayObject::MaskRenderer::~MaskRenderer().
void gnash::DisplayObject::set_visible | ( | bool | visible | ) |
Set whether this DisplayObject should be rendered.
TODO: handle all visible getter/setters in DisplayObject, not in subclasses, and drop this / make it private.
References gnash::movie_root::getFocus(), set_invalidated(), gnash::movie_root::setFocus(), stage(), and visible().
Referenced by gnash::DisplayObject::MaskRenderer::~MaskRenderer().
void gnash::DisplayObject::set_x_scale | ( | double | scale_percent | ) |
Set the xscale value of current SWFMatrix.
Set the real and cached x scale.
This is used when setting _xscale. See xscale_getset.
factor | scale factor, in percent |
Cached rotation and y scale are not updated.
References gnash::getMatrix(), gnash::key::m, gnash::SWFMatrix::set_x_scale(), setMatrix(), and transformedByScript().
Referenced by gnash::DisplayObject::MaskRenderer::~MaskRenderer().
void gnash::DisplayObject::set_y_scale | ( | double | scale_percent | ) |
Set the yscale value of current SWFMatrix.
Set the real and cached y scale.
This is used when setting _yscale See yscale_getset.
factor | scale factor, in percent |
Cached rotation and x scale are not updated.
References gnash::getMatrix(), gnash::key::m, gnash::SWFMatrix::set_y_scale(), setMatrix(), and transformedByScript().
Referenced by gnash::DisplayObject::MaskRenderer::~MaskRenderer().
|
inline |
Referenced by gnash::MovieClip::add_display_object(), and blendMode().
|
inline |
Referenced by gnash::MovieClip::add_display_object(), gnash::color_class_init(), gnash::MovieClip::duplicateMovieClip(), gnash::SWF::ButtonRecord::instantiate(), gnash::DisplayList::mergeDisplayList(), gnash::DisplayList::moveDisplayObject(), gnash::MovieClip::replace_display_object(), gnash::DisplayList::replaceDisplayObject(), and gnash::DisplayObject::MaskRenderer::~MaskRenderer().
|
inline |
Mark this DisplayObject as dynamically created.
Referenced by gnash::MovieClip::duplicateMovieClip(), gnash::registerMovieClipNative(), and gnash::registerTextFieldNative().
|
virtual |
Set the height of this DisplayObject, modifying its SWFMatrix.
This is used when setting _height
h | new height, in TWIPS. |
Reimplemented in gnash::TextField.
References gnash::SWFMatrix::get_x_scale(), getBounds(), gnash::getMatrix(), gnash::SWFRect::height(), gnash::key::m, rotation(), gnash::SWFMatrix::set_scale_rotation(), and setMatrix().
Referenced by gnash::setHeight(), and gnash::DisplayObject::MaskRenderer::~MaskRenderer().
void gnash::DisplayObject::setMask | ( | DisplayObject * | mask | ) |
Register a DisplayObject as a mask for this instance.
mask | The DisplayObject to use as a mask, possibly NULL. A reference to us will be registered with the mask, if not null, so it'll know it's a mask for us, and would stop being a mask for anything else. |
Register as as masked by the mask
References noClipDepthValue, set_clip_depth(), set_invalidated(), and setMask().
Referenced by gnash::registerMovieClipNative(), setMask(), and unload().
void gnash::DisplayObject::setMatrix | ( | const SWFMatrix & | m, |
bool | updateCache = false |
||
) |
Set local transform SWFMatrix for this DisplayObject.
m | the new SWFMatrix to assign to this DisplayObject |
updateCache | if true, updates the cache values from the SWFMatrix (only if SWFMatrix != current SWFMatrix) |
References gnash::SWFMatrix::get_rotation(), gnash::SWFMatrix::get_x_scale(), gnash::SWFMatrix::get_y_scale(), gnash::key::m, gnash::Transform::matrix, and set_invalidated().
Referenced by gnash::MovieClip::add_display_object(), gnash::MovieClip::duplicateMovieClip(), gnash::SWF::ButtonRecord::instantiate(), gnash::DisplayList::mergeDisplayList(), gnash::DisplayList::moveDisplayObject(), gnash::registerTextFieldNative(), gnash::MovieClip::replace_display_object(), gnash::DisplayList::replaceDisplayObject(), set_rotation(), set_x_scale(), set_y_scale(), gnash::movie_root::setDragState(), setHeight(), setWidth(), and gnash::DisplayObject::MaskRenderer::~MaskRenderer().
|
inline |
Set sound volume for this DisplayObject.
Referenced by gnash::registerSoundNative().
|
virtual |
Set the width of this DisplayObject, modifying its SWFMatrix.
This is used when setting _width
w | new width, in TWIPS. TextField does this differently (caches not updated). |
Reimplemented in gnash::TextField.
References gnash::SWFMatrix::get_y_scale(), getBounds(), gnash::getMatrix(), gnash::key::m, rotation(), gnash::SWFMatrix::set_scale_rotation(), setMatrix(), and gnash::SWFRect::width().
Referenced by gnash::DisplayObject::MaskRenderer::~MaskRenderer().
|
inlineprotected |
Get the movie_root to which this DisplayObject belongs.
Referenced by gnash::BitmapMovie::BitmapMovie(), gnash::Button::construct(), gnash::MovieClip::construct(), gnash::MovieClip::constructAsScriptObject(), gnash::Button::destroy(), gnash::MovieClip::execute_init_action_buffer(), gnash::MovieClip::getAsRoot(), gnash::MovieClip::getLoadedMovie(), getNextUnnamedInstanceName(), getTarget(), getTargetPath(), gnash::Button::keyPress(), gnash::MovieClip::loadVariables(), gnash::Button::mouseEvent(), gnash::TextField::mouseEvent(), gnash::MovieClip::notifyEvent(), pathElement(), gnash::MovieClip::queueAction(), gnash::MovieClip::queueEvent(), gnash::MovieClip::removeMovieClip(), gnash::MovieClip::set_background_color(), set_visible(), gnash::MovieClip::setStreamSoundId(), and gnash::MovieClip::unloadChildren().
|
inlinevirtual |
Reimplemented in gnash::MovieClip.
Referenced by gnash::color_class_init(), gnash::MovieClip::duplicateMovieClip(), gnash::SWF::SWFHandlers::execute(), gnash::getDisplayObjectProperty(), gnash::MovieClip::getLoadedMovie(), gnash::getVariable(), gnash::movie_root::mouseClick(), gnash::TextField::removeTextField(), gnash::as_value::toMovieClip(), gnash::as_value::typeOf(), and gnash::DisplayObject::MaskRenderer::~MaskRenderer().
|
inlinevirtual |
DisplayObjects are not a mouse entity by default.
Override this function for InteractiveObjects.
Reimplemented in gnash::MovieClip, gnash::TextField, gnash::InteractiveObject, and gnash::Button.
Referenced by gnash::Button::topmostMouseEntity().
|
inline |
References height, gnash::key::m, gnash::setHeight(), and width.
Referenced by gnash::Shape::display(), gnash::MorphShape::display(), gnash::Bitmap::display(), gnash::Video::display(), gnash::StaticText::display(), gnash::Button::display(), gnash::TextField::display(), gnash::MovieClip::display(), gnash::getCxForm(), and gnash::getMatrix().
|
inline |
Call this function when the sprite has been transformed due to ActionScript code.
This information will be used while executing PlaceObject tags in that ActionScript-transformed DisplayObjects won't be allowed to be moved.
TODO: make protected
References gnash::visible().
Referenced by gnash::SWF::SWFHandlers::execute(), gnash::registerMovieClipNative(), set_rotation(), set_x_scale(), set_y_scale(), gnash::DisplayList::swapDepths(), and gnash::DisplayObject::MaskRenderer::~MaskRenderer().
bool gnash::DisplayObject::unload | ( | ) |
Unload this instance from the stage.
This function must be called when the DisplayObject is removed from the stage. It will take care of properly calling unload against any child DisplayObjects and queuing the 'UNLOAD' event handler.
References setMask(), and unloadChildren().
Referenced by gnash::movie_root::dropLevel(), gnash::DisplayList::mergeDisplayList(), gnash::DisplayList::placeDisplayObject(), gnash::DisplayList::removeDisplayObject(), gnash::DisplayList::replaceDisplayObject(), gnash::Button::set_current_state(), and gnash::DisplayList::unload().
|
inlineprotectedvirtual |
Reimplemented in gnash::MovieClip, and gnash::Button.
Referenced by unload().
|
inline |
Return true if this DisplayObject was unloaded from the stage.
Referenced by gnash::MovieClip::advance(), boundsInClippingArea(), gnash::MovieClip::construct(), gnash::DisplayList::display(), gnash::DisplayList::insertDisplayObject(), gnash::Button::keyPress(), gnash::DisplayList::mergeDisplayList(), gnash::Button::mouseEvent(), gnash::DisplayList::moveDisplayObject(), gnash::MovieClip::notifyEvent(), gnash::ActionExec::operator()(), gnash::operator<<(), gnash::DisplayList::placeDisplayObject(), gnash::movie_root::registerButton(), gnash::DisplayList::removeUnloaded(), gnash::DisplayList::replaceDisplayObject(), gnash::MovieClip::set_background_color(), gnash::Button::set_current_state(), gnash::movie_root::setDragState(), gnash::movie_root::testInvariant(), and gnash::MovieClip::unloadChildren().
|
inlinevirtual |
Notify a change in the DisplayObject's appearance.
Reimplemented in gnash::Bitmap.
Referenced by gnash::BitmapData_as::updateObjects().
|
inline |
Referenced by gnash::Button::add_invalidated_bounds(), gnash::MovieClip::add_invalidated_bounds(), add_invalidated_bounds(), gnash::DisplayList::display(), gnash::movie_root::display(), gnash::MovieClip::findDropTarget(), gnash::MovieClip::pointInVisibleShape(), set_visible(), gnash::Button::topmostMouseEntity(), gnash::TextField::topmostMouseEntity(), gnash::MovieClip::topmostMouseEntity(), and gnash::DisplayObject::MaskRenderer::~MaskRenderer().
|
inlinevirtual |
Enumerate any non-proper properties.
This function allows enumeration of properties that are derived from the DisplayObject type, e.g. DisplayList members.
The default implementation adds nothing
Reimplemented in gnash::MovieClip.
Referenced by gnash::as_object::visitKeys().
|
protected |
Name of this DisplayObject (if any)
|
protected |
Referenced by getWorldVolume(), markReachableResources(), set_child_invalidated(), and set_invalidated().
|
static |
See also http://www.kirupa.com/developer/actionscript/depths2.htm.
The lowest placeable and accessible depth for a DisplayObject. Macromedia Flash help says: depth starts at -16383 (0x3FFF)
See: http://www.senocular.com/flash/tutorials/depths/?page=2The only way to exceed these bounds is with createEmptyMoveClip(), which can be placed at any depth within +/- 2**31.
Referenced by gnash::SWF::SWFHandlers::execute(), and gnash::registerMovieClipNative().
|
protected |
Bounds of this DisplayObject instance before first invalidation since last call to clear_invalidated().
This stores the bounds of the DisplayObject before it has been changed, ie. the position when set_invalidated() is being called. While drawing, both the old and the new bounds are updated (rendered). When moving a DisplayObject A to B then both the position A needs to be re-rendered (to reveal the backgrond) and the position B needs to be re-rendered (to show the DisplayObject in its new position). The bounds may be identical or overlap, but SnappingRanges takes care of that.
Will be set by set_invalidated() and used by get_invalidated_bounds().
Referenced by gnash::Bitmap::add_invalidated_bounds(), gnash::Video::add_invalidated_bounds(), gnash::Button::add_invalidated_bounds(), gnash::TextField::add_invalidated_bounds(), gnash::MovieClip::add_invalidated_bounds(), add_invalidated_bounds(), extend_invalidated_bounds(), and set_invalidated().
|
static |
This value is used for m_clip_depth when the DisplayObject is not a layer mask. Depths below -16384 are illegal, so this value should not collide with real depths.
Referenced by boundsInClippingArea(), and setMask().
|
static |
This is the offset at which DisplayObject's depth is shifted when a DisplayObject is removed from stage but an onUnload event handler is defined.
Example: a DisplayObject at depth 60 gets moved to depth -32829 (-32769-60) when unloaded and an onUnload event handler is defined for it or any of its childs.
So, to recap: 1: -32769 to -16385 are removed 2: -16384 to 0 are statics 3: Max depth for a PlaceObject call is 16384 (which becomes 0 in the statics) (all of the above correct?)
Referenced by gnash::DisplayList::mergeDisplayList(), gnash::DisplayList::removeUnloaded(), and gnash::Button::set_current_state().
|
static |
This is the amount added to displaylist tag defined depths. DisplayObjects placed by tags (vs. DisplayObjects instantiated by ActionScript) always have negative depths by effect of this offset.
Referenced by gnash::BitmapMovie::BitmapMovie(), gnash::MovieLoader::clear(), gnash::SWF::SWFHandlers::execute(), gnash::movie_root::getLevel(), gnash::MovieClip::getLoadedMovie(), getTarget(), getTargetPath(), gnash::movie_root::init(), gnash::SWF::ButtonRecord::instantiate(), gnash::DisplayList::mergeDisplayList(), gnash::Button::mouseEvent(), gnash::SWF::RemoveObjectTag::read(), gnash::DisplayList::removeUnloaded(), gnash::movie_root::replaceLevel(), gnash::movie_root::setLevel(), gnash::DisplayList::swapDepths(), and gnash::movie_root::swapLevels().
|
static |
This is the maximum depth a MovieClip DisplayObject can be placed at (attachMovie). Kirupa (see above) says 2130690045, but this seems not to be included in the range.
Referenced by gnash::SWF::SWFHandlers::execute(), and gnash::registerMovieClipNative().