Gnash
0.8.11dev
|
A MovieClip is a container for DisplayObjects. More...
#include <MovieClip.h>
Public Types | |
enum | PlayState { PLAYSTATE_PLAY, PLAYSTATE_STOP } |
enum | VariablesMethod { METHOD_NONE = 0, METHOD_GET, METHOD_POST } |
The various methods for sending data in requests. More... | |
typedef std::vector< TextField * > | TextFields |
typedef std::map< ObjectURI, TextFields, ObjectURI::LessThan > | TextFieldIndex |
A container for textfields, indexed by their variable name. More... | |
typedef std::map< std::string, std::string > | MovieVariables |
typedef movie_definition::PlayList | PlayList |
![]() | |
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 | |
MovieClip (as_object *object, const movie_definition *def, Movie *root, DisplayObject *parent) | |
Construct a MovieClip instance. More... | |
virtual | ~MovieClip () |
virtual Movie * | get_root () const |
Return the relative root of this DisplayObject. More... | |
virtual bool | trackAsMenu () |
ActionScript property of Buttons and MovieClips altering mouse handling. More... | |
void | queueEvent (const event_id &id, int lvl) |
Queue event in the global action queue. More... | |
void | queueLoad () |
virtual MovieClip * | getAsRoot () |
Return the _root ActionScript property of this sprite. More... | |
virtual SWFRect | getBounds () const |
Get the composite bounds of all component drawing elements. More... | |
virtual bool | pointInShape (std::int32_t x, std::int32_t y) const |
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 bool | pointInHitableShape (std::int32_t x, std::int32_t y) const |
size_t | get_current_frame () const |
Return 0-based index to current frame. More... | |
size_t | get_frame_count () const |
size_t | get_loaded_frames () const |
Return number of completely loaded frames of this sprite/movie. More... | |
size_t | get_bytes_total () const |
size_t | get_bytes_loaded () const |
const SWFRect & | get_frame_size () const |
DSOEXPORT void | setPlayState (PlayState s) |
Stop or play the sprite. More... | |
PlayState | getPlayState () const |
void | set_background_color (const rgba &color) |
virtual bool | mouseEnabled () const |
Return true if we have any mouse event handlers. More... | |
virtual InteractiveObject * | topmostMouseEntity (std::int32_t x, std::int32_t y) |
Return the topmost entity that the given point covers that can receive mouse events. NULL if none. Coords are in parent's frame. More... | |
const DisplayObject * | findDropTarget (std::int32_t x, std::int32_t y, DisplayObject *dragging) const |
Point coordinates in global twips. More... | |
void | setDropTarget (const std::string &tgt) |
const std::string & | getDropTarget () const |
virtual void | advance () |
Advance to the next frame of the MovieClip. More... | |
DSOEXPORT void | goto_frame (size_t target_frame_number) |
Set the sprite state at the specified frame number. More... | |
bool | get_frame_number (const as_value &frame_spec, size_t &frameno) const |
Parse frame spec and return a 0-based frame number. More... | |
bool | goto_labeled_frame (const std::string &label) |
Look up the labeled frame, and jump to it. More... | |
virtual void | display (Renderer &renderer, const Transform &xform) |
Render this MovieClip. More... | |
void | draw (Renderer &renderer, const Transform &xform) |
Draw this MovieClip. More... | |
void | omit_display () |
void | swapDepths (DisplayObject *ch1, int newdepth) |
Swap depth of the given DisplayObjects in the DisplayList. More... | |
DisplayObject * | getDisplayObjectAtDepth (int depth) |
Return the DisplayObject at given depth in our DisplayList. More... | |
DisplayObject * | addDisplayListObject (DisplayObject *obj, int depth) |
Attach a DisplayObject at the specified depth. More... | |
DisplayObject * | add_display_object (const SWF::PlaceObject2Tag *tag, DisplayList &dlist) |
Place a DisplayObject or mask to the DisplayList. More... | |
void | move_display_object (const SWF::PlaceObject2Tag *tag, DisplayList &dlist) |
Proxy of DisplayList::moveDisplayObject() More... | |
void | replace_display_object (const SWF::PlaceObject2Tag *tag, DisplayList &dlist) |
Proxy of DisplayList::replaceDisplayObject() More... | |
void | remove_display_object (const SWF::PlaceObject2Tag *tag, DisplayList &dlist) |
Proxy of DisplayList::removeDisplayObject() More... | |
void | remove_display_object (int depth, int) |
Remove the object at the specified depth. More... | |
void | unloadMovie () |
void | attachCharacter (DisplayObject &newch, int depth, as_object *initObject) |
Attach the given DisplayObject instance to current display list. More... | |
virtual void | construct (as_object *initObj=nullptr) |
Handle placement event. More... | |
void | destroy () |
Mark this sprite as destroyed. More... | |
void | add_action_buffer (const action_buffer *a) |
void | execute_init_action_buffer (const action_buffer &a, int cid) |
Execute the given init action buffer, if not done yet for the target DisplayObject id. More... | |
void | execute_action (const action_buffer &ab) |
Execute a single action buffer (DOACTION block) More... | |
MovieClip * | to_movie () |
virtual void | getLoadedMovie (Movie *newMovie) |
Accept a loaded Movie. More... | |
void | loadVariables (const std::string &urlstr, VariablesMethod sendVarsMethod) |
Load url-encoded variables from the given url, optionally sending variables from this timeline too. More... | |
bool | getTextFieldVariables (const ObjectURI &uri, as_value &val) |
Get TextField variables. More... | |
bool | setTextFieldVariables (const ObjectURI &uri, const as_value &val) |
TODO: this is also unlikely to be the best way to do it. More... | |
DisplayObject * | getDisplayListObject (const ObjectURI &uri) |
Search for a named object on the DisplayList. More... | |
as_object * | pathElement (const ObjectURI &uri) |
Overridden to look in DisplayList for a match. More... | |
virtual void | call_frame_actions (const as_value &frame_spec) |
Execute the actions for the specified frame. More... | |
MovieClip * | duplicateMovieClip (const std::string &newname, int newdepth, as_object *init_object=nullptr) |
Duplicate this sprite in its timeline. More... | |
virtual void | mouseEvent (const event_id &id) |
Called when a mouse event affects this MovieClip. More... | |
void | notifyEvent (const event_id &id) |
Dispatch event handler(s), if any. More... | |
virtual as_environment & | get_environment () |
Return a reference to the variable scope of this DisplayObject. More... | |
void | set_textfield_variable (const ObjectURI &name, TextField *ch) |
Set a TextField variable to this timeline. More... | |
void | add_invalidated_bounds (InvalidatedRanges &ranges, bool force) |
Add the DisplayObject's invalidated bounds to the given ranges list. More... | |
const DisplayList & | getDisplayList () const |
int | getNextHighestDepth () const |
Return the next highest available depth. More... | |
void | setStreamSoundId (int id) |
Set the currently playing m_sound_stream_id. More... | |
void | removeMovieClip () |
Remove this sprite from the stage. More... | |
DynamicShape & | graphics () |
Direct access to the Graphics object for drawing. More... | |
virtual bool | handleFocus () |
Set focus to this MovieClip. More... | |
DSOEXPORT void | setVariables (const MovieVariables &vars) |
Set all variables in the given map with their corresponding values. More... | |
virtual void | visitNonProperties (KeyVisitor &v) const |
Enumerate child DisplayObjects. More... | |
void | cleanupDisplayList () |
void | queueAction (const action_buffer &buf) |
Queue the given action buffer. More... | |
void | constructAsScriptObject () |
Construct this instance as an ActionScript object. More... | |
bool | getLockRoot () const |
void | setLockRoot (bool lr) |
virtual int | getDefinitionVersion () const |
Return the version of the SWF this MovieClip was parsed from. More... | |
![]() | |
DisplayObjectContainer (as_object *object, DisplayObject *parent) | |
virtual | ~DisplayObjectContainer () |
size_t | numChildren () const |
![]() | |
InteractiveObject (as_object *object, DisplayObject *parent) | |
virtual | ~InteractiveObject () |
virtual StaticText * | getStaticText (std::vector< const SWF::TextRecord *> &, size_t &) |
Allow extraction of static text. More... | |
![]() | |
DisplayObject (movie_root &mr, as_object *object, DisplayObject *parent) | |
Construct a DisplayObject. More... | |
virtual | ~DisplayObject () |
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... | |
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... | |
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... | |
bool | pointInBounds (std::int32_t x, std::int32_t y) const |
Return true if the given point falls in this DisplayObject's bounds. More... | |
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... | |
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 () |
bool | unload () |
Unload this instance from the stage. More... | |
bool | unloaded () const |
Return true if this DisplayObject was unloaded from the stage. 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 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... | |
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... | |
Protected Member Functions | |
virtual bool | unloadChildren () |
Unload all contents in the displaylist and this instance. More... | |
virtual void | markOwnResources () const |
Mark sprite-specific reachable resources. More... | |
void | placeDisplayObject (DisplayObject *ch, int depth) |
![]() | |
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... | |
Additional Inherited Members | |
![]() | |
static as_value | blendMode (const fn_call &fn) |
Getter-setter for blendMode. More... | |
![]() | |
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 |
![]() | |
DisplayList | _displayList |
![]() | |
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... | |
A MovieClip is a container for DisplayObjects.
TODO: This class should inherit from Sprite In AS3 is it distinguished from a Sprite by having a timeline, i.e. more than one frame. In AS2, there is no Sprite class. There are basically two types of MovieClip: dynamic and non-dynamic. Dynamic clips are created using createEmptyMovieClip() or duplicateMovieClip(). Non-dynamic MovieClips are parsed from a SWF file. The isDynamic() member function is the only way to tell the difference (see following paragraph). The presence of a definition (the _def member) reveals whether the MovieClip was constructed with an immutable definition or not. MovieClips created using createEmptyMovieClip() have no definition. MovieClips constructed using duplicateMovieClip() have the same definition as the duplicated clip. They are "dynamic", but may have a definition! A MovieClip always has an _swf member. This is the top-level SWF (Movie) containing either the definition or the code from which the MovieClip was created. The _url member and SWF version are dependent on the _swf. Exports are also sought in this Movie.
typedef std::map<std::string, std::string> gnash::MovieClip::MovieVariables |
typedef std::map<ObjectURI, TextFields, ObjectURI::LessThan> gnash::MovieClip::TextFieldIndex |
A container for textfields, indexed by their variable name.
typedef std::vector<TextField*> gnash::MovieClip::TextFields |
gnash::MovieClip::MovieClip | ( | as_object * | object, |
const movie_definition * | def, | ||
Movie * | root, | ||
DisplayObject * | parent | ||
) |
Construct a MovieClip instance.
def | Pointer to the movie_definition this object is an instance of (may be a top-level movie or a sprite). This may be 0 if there is no immutable definition. |
root | The "relative" _swf of this sprite, which is the instance of top-level sprite defined by the same SWF that also contained this sprite definition. Note that this can be different from the top-level movie accessible through the VM, in case this sprite was defined in an externally loaded movie. |
parent | Parent of the created instance in the display list. May be 0 for top-level movies (_level#). |
References gnash::as_environment::set_target().
Referenced by duplicateMovieClip().
|
virtual |
|
inline |
Add the given action buffer to the list of action buffers to be processed at the end of the next frame advance.
References gnash::key::a.
Referenced by gnash::SWF::DoActionTag::executeActions().
DisplayObject * gnash::MovieClip::add_display_object | ( | const SWF::PlaceObject2Tag * | tag, |
DisplayList & | dlist | ||
) |
Place a DisplayObject or mask to the DisplayList.
This method instantiates the given DisplayObject definition and places it on the stage at the given depth.
If the specified depth is already occupied, it results a no-ops. Otherwise, a new DisplayObject will be created and onload handler will be triggerred.
tag | A swf defined placement tag (PlaceObject, or PlaceObject2, or PlaceObject3). No ownership transfer, the tag is still owned by the movie_definition class. |
dlist | The display list to add the DisplayObject to. |
References _, gnash::swf_event::action(), gnash::DisplayObject::add_event_handler(), gnash::DisplayObject::construct(), gnash::SWF::DefinitionTag::createDisplayObject(), gnash::swf_event::event(), gnash::SWF::PlaceObject2Tag::getBlendMode(), gnash::SWF::PlaceObject2Tag::getClipDepth(), gnash::SWF::PlaceObject2Tag::getCxform(), gnash::SWF::DisplayListTag::getDepth(), gnash::DisplayList::getDisplayObjectAtDepth(), gnash::SWF::PlaceObject2Tag::getEventHandlers(), gnash::getGlobal(), gnash::SWF::PlaceObject2Tag::getID(), gnash::SWF::PlaceObject2Tag::getMatrix(), gnash::SWF::PlaceObject2Tag::getName(), gnash::DisplayObject::getNextUnnamedInstanceName(), gnash::getObject(), gnash::SWF::PlaceObject2Tag::getRatio(), gnash::getURI(), gnash::getVM(), gnash::SWF::PlaceObject2Tag::hasBlendMode(), gnash::SWF::PlaceObject2Tag::hasName(), gnash::key::i, IF_VERBOSE_MALFORMED_SWF, gnash::DisplayObject::isDestroyed(), gnash::isReferenceable(), gnash::log_swferror(), gnash::key::n, gnash::DisplayList::placeDisplayObject(), gnash::DisplayObject::set_clip_depth(), gnash::DisplayObject::set_name(), gnash::DisplayObject::set_ratio(), gnash::DisplayObject::setBlendMode(), gnash::DisplayObject::setCxForm(), and gnash::DisplayObject::setMatrix().
Referenced by gnash::SWF::PlaceObject2Tag::executeState().
|
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.
Add drawable.
Implements gnash::InteractiveObject.
References gnash::DisplayObjectContainer::_displayList, gnash::geometry::SnappingRanges2d< T >::add(), gnash::DisplayList::add_invalidated_bounds(), gnash::DisplayObject::childInvalidated(), gnash::SWFRect::expand_to_transformed_rect(), gnash::DynamicShape::getBounds(), gnash::getCxForm(), gnash::SWFRect::getRange(), gnash::getWorldMatrix(), gnash::DisplayObject::invalidated(), gnash::invisible(), gnash::DisplayObject::m_old_invalidated_ranges, and gnash::DisplayObject::visible().
DisplayObject * gnash::MovieClip::addDisplayListObject | ( | DisplayObject * | obj, |
int | depth | ||
) |
Attach a DisplayObject at the specified depth.
References gnash::DisplayObjectContainer::_displayList, gnash::DisplayObject::construct(), gnash::DisplayList::placeDisplayObject(), and gnash::DisplayObject::set_invalidated().
Referenced by gnash::registerMovieClipNative(), and gnash::registerTextFieldNative().
|
virtual |
Advance to the next frame of the MovieClip.
Actions will be executed or pushed to the queue as necessary.
Reimplemented in gnash::SWFMovie, gnash::Movie, and gnash::BitmapMovie.
References _, gnash::DisplayObjectContainer::_displayList, gnash::event_id::ENTER_FRAME, get_frame_count(), get_loaded_frames(), gnash::DisplayObject::getTarget(), gnash::DisplayObject::getTargetPath(), IF_VERBOSE_ACTION, IF_VERBOSE_MALFORMED_SWF, gnash::log_action(), gnash::log_debug(), LOG_ONCE, gnash::log_swferror(), PLAYSTATE_PLAY, gnash::movie_root::PRIORITY_DOACTION, queueEvent(), queueLoad(), gnash::SWF::ControlTag::TAG_ACTION, gnash::SWF::ControlTag::TAG_DLIST, and gnash::DisplayObject::unloaded().
Referenced by gnash::BitmapMovie::advance(), gnash::SWFMovie::advance(), and gnash::movie_root::testInvariant().
void gnash::MovieClip::attachCharacter | ( | DisplayObject & | newch, |
int | depth, | ||
as_object * | initObject | ||
) |
Attach the given DisplayObject instance to current display list.
newch | The DisplayObject instance to attach. |
depth | The depth to assign to the instance. |
References gnash::DisplayObjectContainer::_displayList, gnash::DisplayObject::construct(), and gnash::DisplayList::placeDisplayObject().
Referenced by gnash::registerMovieClipNative().
|
virtual |
Execute the actions for the specified frame.
The frame_spec could be an integer or a string.
References _, gnash::DisplayObjectContainer::_displayList, gnash::key::e, get_frame_number(), gnash::getObject(), gnash::getVM(), IF_VERBOSE_ASCODING_ERRORS, gnash::DisplayObject::isDestroyed(), and gnash::log_aserror().
void gnash::MovieClip::cleanupDisplayList | ( | ) |
Delete DisplayObjects removed from the stage from the display lists
References gnash::DisplayObjectContainer::_displayList, and gnash::DisplayList::removeUnloaded().
Referenced by gnash::movie_root::registerButton().
|
virtual |
Handle placement event.
This callback will (not known to be a problem):
(1) Register ourselves with the global instance list (2) Take note of our original target path (3) Register as listener of core broadcasters (4) Execute tags of frame 0
The callback will also (known to be bogus): (1) Construct this instance as an ActionScript object. See constructAsScriptObject() method, including constructing registered class and adding properties.
Reimplemented from gnash::DisplayObject.
Reimplemented in gnash::SWFMovie.
References gnash::DisplayObjectContainer::_displayList, gnash::movie_root::addLiveChar(), constructAsScriptObject(), gnash::as_object::copyProperties(), gnash::DisplayObject::get_event_handlers(), gnash::getObject(), gnash::DisplayObject::getTarget(), gnash::event_id::INITIALIZE, gnash::DisplayObject::isDynamic(), gnash::log_debug(), gnash::movie_root::PRIORITY_CONSTRUCT, gnash::movie_root::PRIORITY_INIT, gnash::movie_root::pushAction(), queueEvent(), queueLoad(), gnash::DisplayObject::saveOriginalTarget(), gnash::DisplayObject::stage(), gnash::SWF::ControlTag::TAG_ACTION, gnash::SWF::ControlTag::TAG_DLIST, and gnash::DisplayObject::unloaded().
Referenced by gnash::SWFMovie::construct(), duplicateMovieClip(), getLoadedMovie(), and gnash::movie_root::setLevel().
void gnash::MovieClip::constructAsScriptObject | ( | ) |
Construct this instance as an ActionScript object.
This method invokes the constructor associated with our definition, either MovieClip or any user-speficied one (see sprite_definition::registerClass). It will also invoke the onClipConstruct and onConstruct handlers.
References gnash::event_id::CONSTRUCT, gnash::as_function::construct(), get_environment(), gnash::getObject(), gnash::as_object::getOwnProperty(), gnash::VM::getPlayerVersion(), gnash::movie_root::getRegisteredClass(), gnash::getSWFVersion(), gnash::DisplayObject::getTarget(), gnash::Property::getValue(), gnash::getVM(), gnash::as_object::init_member(), gnash::log_debug(), notifyEvent(), gnash::DisplayObject::parent(), gnash::NSV::PROP_PROTOTYPE, gnash::as_object::set_prototype(), and gnash::DisplayObject::stage().
Referenced by construct().
|
virtual |
Mark this sprite as destroyed.
This is an override of DisplayObject::destroy()
A sprite 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.
When a sprite is destroyed, all its children are also destroyed.
Note: this function will release most memory associated with the sprite as no members or drawable should be needed anymore.
Reimplemented from gnash::DisplayObject.
References gnash::DisplayObjectContainer::_displayList, gnash::DisplayList::destroy(), and gnash::DisplayObject::destroy().
Referenced by gnash::movie_root::dropLevel(), and gnash::movie_root::registerButton().
Render this MovieClip.
Implements gnash::InteractiveObject.
References gnash::DisplayObject::clear_invalidated(), draw(), and gnash::DisplayObject::transform().
Referenced by gnash::movie_root::display().
Draw this MovieClip.
This is effectively the same as display(), but uses only the passed transform.
References gnash::DisplayObjectContainer::_displayList, gnash::DynamicShape::display(), gnash::DisplayList::display(), and gnash::DynamicShape::finalize().
Referenced by display(), and gnash::BitmapData_as::draw().
MovieClip * gnash::MovieClip::duplicateMovieClip | ( | const std::string & | newname, |
int | newdepth, | ||
as_object * | init_object = nullptr |
||
) |
Duplicate this sprite in its timeline.
Add the new DisplayObject at a the given depth to this sprite parent displaylist.
NOTE: the call will fail for the root movie (no parent). NOTE2: any DisplayObject at the given target depth will be replaced by the new DisplayObject NOTE3: event handlers will also be copied
newname | Name for the copy |
newdepth | Depth for the copy |
init_object | If not null, will be used to copy properties over. |
References _, gnash::DisplayObjectContainer::_displayList, gnash::NSV::CLASS_MOVIE_CLIP, construct(), gnash::DisplayObject::get_clip_depth(), gnash::DisplayObject::get_event_handlers(), gnash::DisplayObject::get_ratio(), gnash::getCxForm(), gnash::getGlobal(), gnash::getMatrix(), gnash::getObject(), gnash::getObjectWithPrototype(), gnash::DisplayObject::getTarget(), gnash::getURI(), gnash::getVM(), IF_VERBOSE_ASCODING_ERRORS, gnash::log_aserror(), gnash::log_error(), MovieClip(), gnash::key::o, gnash::DisplayObject::parent(), gnash::DisplayList::placeDisplayObject(), gnash::DisplayObject::set_clip_depth(), gnash::DisplayObject::set_event_handlers(), gnash::DisplayObject::set_name(), gnash::DisplayObject::set_ratio(), gnash::DisplayObject::setCxForm(), gnash::DisplayObject::setDynamic(), gnash::DisplayObject::setMatrix(), and gnash::DisplayObject::to_movie().
Referenced by gnash::SWF::SWFHandlers::execute(), and gnash::registerMovieClipNative().
void gnash::MovieClip::execute_action | ( | const action_buffer & | ab | ) |
Execute a single action buffer (DOACTION block)
References _, gnash::DisplayObjectContainer::_displayList, gnash::key::f, get_frame_count(), gnash::DisplayObject::getTargetPath(), IF_VERBOSE_ACTION, gnash::DisplayObject::isDestroyed(), gnash::log_action(), gnash::DisplayList::mergeDisplayList(), gnash::SWF::ControlTag::TAG_ACTION, and gnash::SWF::ControlTag::TAG_DLIST.
void gnash::MovieClip::execute_init_action_buffer | ( | const action_buffer & | a, |
int | cid | ||
) |
Execute the given init action buffer, if not done yet for the target DisplayObject id.
The action will normally be pushed on queue, but will be executed immediately if we are executing actions resulting from a callFame instead.
a | The action buffer to execute |
cid | The referenced DisplayObject id |
References gnash::DisplayObject::getTarget(), gnash::Movie::initializeCharacter(), gnash::log_debug(), gnash::movie_root::PRIORITY_INIT, gnash::movie_root::pushAction(), and gnash::DisplayObject::stage().
Referenced by gnash::SWF::DoInitActionTag::executeState().
|
virtual |
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 from gnash::DisplayObject.
References gnash::DisplayObjectContainer::_displayList, gnash::DisplayObject::visible(), and gnash::DisplayList::visitAll().
|
inline |
Return number of loaded bytes in the movie (not sprite!)
Referenced by gnash::moviecliploader_class_init(), gnash::movie_root::processInvoke(), and gnash::registerMovieClipNative().
|
inline |
Return total number of bytes in the movie (not sprite!)
Referenced by gnash::moviecliploader_class_init(), gnash::movie_root::processInvoke(), and gnash::registerMovieClipNative().
|
inline |
Return 0-based index to current frame.
Referenced by gnash::SWFMovie::advance(), gnash::Gui::advanceMovie(), gnash::SWF::SWFHandlers::execute(), gnash::registerMovieClipNative(), and gnash::DisplayObject::MaskRenderer::~MaskRenderer().
|
inlinevirtual |
Return a reference to the variable scope of this DisplayObject.
Reimplemented from gnash::DisplayObject.
References name.
Referenced by constructAsScriptObject(), notifyEvent(), gnash::movie_root::processInvoke(), and gnash::DumpGui::run().
|
inline |
bool gnash::MovieClip::get_frame_number | ( | const as_value & | frame_spec, |
size_t & | frameno | ||
) | const |
Parse frame spec and return a 0-based frame number.
If frame spec cannot be converted to !NAN and !Infinity number it will be converted to a string and considered a frame label (returns false if referring to an unknwown label).
frame_spec | The frame specification. |
frameno | The evaluated frame number (0-based) |
References gnash::getObject(), gnash::getVM(), gnash::isFinite(), gnash::as_value::to_string(), and gnash::toNumber().
Referenced by call_frame_actions(), and gnash::registerMovieClipNative().
|
inline |
References DSOEXPORT, gnash::key::r, and gnash::key::s.
Referenced by gnash::movie_root::display().
|
inline |
Return number of completely loaded frames of this sprite/movie.
Note: the number is also the last frame accessible (frames numberes are 1-based)
Referenced by advance(), gnash::SWF::SWFHandlers::execute(), goto_frame(), gnash::movie_root::processInvoke(), remove_display_object(), and gnash::DisplayObject::MaskRenderer::~MaskRenderer().
|
virtual |
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 from gnash::DisplayObject.
Referenced by gnash::SWF::ExportAssetsTag::executeState(), gnash::SWF::ImportAssetsTag::executeState(), gnash::SWF::DefinitionTag::executeState(), and gnash::registerMovieClipNative().
|
virtual |
Return the _root ActionScript property of this sprite.
Relative or absolute is determined by the _lockroot property, see getLockRoot and setLockRoot. May return this.
Reimplemented from gnash::DisplayObject.
References gnash::DisplayObject::getAsRoot(), getDefinitionVersion(), getLockRoot(), gnash::movie_root::getRootMovie(), gnash::key::p, gnash::DisplayObject::parent(), gnash::DisplayObject::stage(), and gnash::Movie::version().
|
virtual |
Get the composite bounds of all component drawing elements.
Implements gnash::InteractiveObject.
References gnash::DisplayObjectContainer::_displayList, gnash::SWFRect::expand_to_rect(), gnash::key::f, gnash::as_object::get_member(), gnash::DynamicShape::getBounds(), gnash::getObject(), gnash::getVM(), gnash::NSV::PROP_ENABLED, gnash::toBool(), and gnash::DisplayList::visitAll().
Referenced by gnash::registerMovieClipNative().
|
virtual |
Return the version of the SWF this MovieClip was parsed from.
Reimplemented from gnash::DisplayObject.
References gnash::Movie::version().
Referenced by getAsRoot(), gnash::TextField::getDefinitionVersion(), and gnash::registerMovieClipNative().
|
inline |
DisplayObject * gnash::MovieClip::getDisplayListObject | ( | const ObjectURI & | uri | ) |
Search for a named object on the DisplayList.
These are properties, but not attached as genuine members to the MovieClip object. They take priority over DisplayObject magic properties and inherited properties, but not over own properties.
name | Object identifier. This function handles case-sensitivity. |
References gnash::DisplayObjectContainer::_displayList, gnash::caseless(), gnash::DisplayList::getDisplayObjectByName(), gnash::getObject(), gnash::getStringTable(), and gnash::isReferenceable().
Referenced by gnash::getDisplayObjectProperty(), and pathElement().
DisplayObject * gnash::MovieClip::getDisplayObjectAtDepth | ( | int | depth | ) |
Return the DisplayObject at given depth in our DisplayList.
References gnash::DisplayObjectContainer::_displayList, and gnash::DisplayList::getDisplayObjectAtDepth().
Referenced by gnash::registerMovieClipNative().
|
inline |
References DSOEXPORT.
Referenced by gnash::DisplayObject::MaskRenderer::~MaskRenderer().
|
virtual |
Accept a loaded Movie.
Reimplemented from gnash::DisplayObject.
References gnash::DisplayObjectContainer::_displayList, construct(), gnash::ObjectURI::empty(), gnash::DisplayObject::get_clip_depth(), gnash::DisplayObject::get_depth(), gnash::DisplayObject::get_event_handlers(), gnash::DisplayObject::get_name(), getLockRoot(), gnash::key::p, gnash::DisplayObject::parent(), gnash::DisplayList::replaceDisplayObject(), gnash::movie_root::replaceLevel(), gnash::DisplayObject::set_clip_depth(), gnash::DisplayObject::set_event_handlers(), gnash::DisplayObject::set_name(), gnash::DisplayObject::set_parent(), setLockRoot(), gnash::DisplayObject::stage(), gnash::DisplayObject::staticDepthOffset, and gnash::DisplayObject::to_movie().
|
inline |
Return true if getAsRoot() should return the relative root, false otherwise.
Referenced by getAsRoot(), getLoadedMovie(), and gnash::registerMovieClipNative().
|
inline |
Return the next highest available depth.
Placing an object at the depth returned by this function should result in a DisplayObject that is displayd above all others
Referenced by gnash::registerMovieClipNative().
Get TextField variables.
This handles special properties of MovieClip.
TODO: this is unlikely to be the best way of doing it, and it would simplify things if this function could be dropped.
The only genuine special properties are DisplayList members. These are accessible as properties and are enumerated, but not ownProperties of a MovieClip. The TextField variables should probably be handled in a more generic way.
References gnash::key::e, gnash::TextField::get_text_value(), gnash::TextField::getTextDefined(), gnash::key::i, and test::uri.
Referenced by gnash::getDisplayObjectProperty().
void gnash::MovieClip::goto_frame | ( | size_t | target_frame_number | ) |
Set the sprite state at the specified frame number.
0-based frame numbers!! (in contrast to ActionScript and Flash MX)
References _, gnash::DisplayObjectContainer::_displayList, get_loaded_frames(), gnash::DisplayObject::getTargetPath(), IF_VERBOSE_ASCODING_ERRORS, gnash::log_aserror(), gnash::log_debug(), gnash::log_error(), PLAYSTATE_STOP, setPlayState(), gnash::SWF::ControlTag::TAG_ACTION, and gnash::SWF::ControlTag::TAG_DLIST.
Referenced by gnash::SWF::SWFHandlers::execute(), goto_labeled_frame(), and gnash::registerMovieClipNative().
bool gnash::MovieClip::goto_labeled_frame | ( | const std::string & | label | ) |
Look up the labeled frame, and jump to it.
References _, goto_frame(), IF_VERBOSE_MALFORMED_SWF, and gnash::log_swferror().
Referenced by gnash::SWF::SWFHandlers::execute().
|
inline |
Direct access to the Graphics object for drawing.
References DSOEXPORT, and test::v.
Referenced by gnash::registerMovieClipNative().
|
virtual |
Set focus to this MovieClip.
Reimplemented from gnash::DisplayObject.
References gnash::as_object::get_member(), gnash::getObject(), gnash::getSWFVersion(), gnash::getVM(), mouseEnabled(), gnash::NSV::PROP_FOCUS_ENABLED, and gnash::toBool().
void gnash::MovieClip::loadVariables | ( | const std::string & | urlstr, |
VariablesMethod | sendVarsMethod | ||
) |
Load url-encoded variables from the given url, optionally sending variables from this timeline too.
A LoadVariablesThread will be started to load and parse variables and added to the _loadVariableRequests. Then, at every ::advance_sprite any completed threads will be processed (see processCompletedLoadVariableRequests)
NOTE: the given url will be security-checked
urlstr | The url to load variables from. |
sendVarsMethod | The VariablesMethod to use. If METHOD_NONE, no data will be sent. |
References _, gnash::StreamProvider::baseURL(), gnash::LoadVariablesThread::completed(), gnash::event_id::DATA, gnash::getObject(), gnash::getRunResources(), gnash::getURLEncodedVars(), gnash::LoadVariablesThread::getValues(), gnash::log_error(), METHOD_GET, METHOD_NONE, METHOD_POST, notifyEvent(), gnash::movie_root::runResources(), setVariables(), gnash::DisplayObject::stage(), gnash::RunResources::streamProvider(), and url.
Referenced by gnash::registerMovieClipNative().
|
protectedvirtual |
Mark sprite-specific reachable resources.
sprite-specific reachable resources are:
Canvas for dynamic drawing (_drawable)
Reimplemented from gnash::DisplayObject.
References gnash::DisplayObjectContainer::_displayList, gnash::key::e, gnash::renderer::opengl::for_each(), gnash::key::i, gnash::as_environment::markReachableResources(), gnash::GcResource::setReachable(), and gnash::DisplayList::visitAll().
|
virtual |
Return true if we have any mouse event handlers.
NOTE: this function currently does not consider general mouse event handlers MOUSE_MOVE, MOUSE
Implements gnash::InteractiveObject.
References gnash::arraySize(), gnash::event_id::DRAG_OUT, gnash::event_id::DRAG_OVER, gnash::DisplayObject::hasEventHandler(), gnash::key::i, gnash::event_id::PRESS, gnash::event_id::RELEASE, gnash::event_id::RELEASE_OUTSIDE, gnash::event_id::ROLL_OUT, and gnash::event_id::ROLL_OVER.
Referenced by handleFocus(), pointInHitableShape(), pointInVisibleShape(), and topmostMouseEntity().
|
inlinevirtual |
Called when a mouse event affects this MovieClip.
Implements gnash::InteractiveObject.
void gnash::MovieClip::move_display_object | ( | const SWF::PlaceObject2Tag * | tag, |
DisplayList & | dlist | ||
) |
Proxy of DisplayList::moveDisplayObject()
References gnash::SWF::PlaceObject2Tag::getCxform(), gnash::SWF::DisplayListTag::getDepth(), gnash::SWF::PlaceObject2Tag::getMatrix(), gnash::SWF::PlaceObject2Tag::getRatio(), gnash::SWF::PlaceObject2Tag::hasCxform(), gnash::SWF::PlaceObject2Tag::hasMatrix(), gnash::SWF::PlaceObject2Tag::hasRatio(), and gnash::DisplayList::moveDisplayObject().
Referenced by gnash::SWF::PlaceObject2Tag::executeState(), and replace_display_object().
void gnash::MovieClip::notifyEvent | ( | const event_id & | id | ) |
Dispatch event handler(s), if any.
This handles key, mouse, and specific MovieClip events. TODO: split this sensibly.
References gnash::event_id::ENTER_FRAME, gnash::DisplayObject::get_depth(), get_environment(), gnash::DisplayObject::get_event_handler(), gnash::DisplayObject::get_event_handlers(), gnash::getObject(), gnash::DisplayObject::getTarget(), gnash::event_id::INITIALIZE, gnash::isButtonEvent(), gnash::DisplayObject::isDynamic(), gnash::isKeyEvent(), gnash::event_id::LOAD, gnash::log_debug(), gnash::DisplayObject::parent(), gnash::sendEvent(), gnash::DisplayObject::stage(), and gnash::DisplayObject::unloaded().
Referenced by constructAsScriptObject(), and loadVariables().
|
virtual |
Called instead of display() when the DisplayObject is not visible on stage. Used to clear the invalidated flags.
Reimplemented from gnash::DisplayObject.
References gnash::DisplayObjectContainer::_displayList, gnash::DisplayObject::childInvalidated(), gnash::DisplayObject::clear_invalidated(), and gnash::DisplayList::omit_display().
Overridden to look in DisplayList for a match.
Reimplemented from gnash::DisplayObject.
References getDisplayListObject(), gnash::getObject(), gnash::getVM(), gnash::as_value::is_object(), gnash::as_value::is_sprite(), gnash::DisplayObject::pathElement(), gnash::as_value::toDisplayObject(), and gnash::toObject().
|
inlineprotected |
References gnash::SWF::ControlTag::TAG_ACTION, and gnash::SWF::ControlTag::TAG_DLIST.
Referenced by gnash::BitmapMovie::BitmapMovie().
|
virtual |
return true if the given point is located in a(this) hitable sprite.
all sprites except mouse-insensitive dynamic masks are hitable. _visible property is ignored for hitable DisplayObjects.
References gnash::DisplayObjectContainer::_displayList, gnash::DisplayObject::getMask(), gnash::DisplayObject::isDynamicMask(), mouseEnabled(), gnash::DisplayObject::pointInShape(), and gnash::DisplayList::visitBackward().
Referenced by gnash::registerMovieClipNative().
|
virtual |
Return true if the given point falls in this DisplayObject's shape.
Point coordinates are in world TWIPS
The default implementation warns about a missing override and invokes pointInBounds().
Reimplemented from gnash::InteractiveObject.
References gnash::DisplayObjectContainer::_displayList, and gnash::DisplayList::visitBackward().
|
virtual |
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 from gnash::DisplayObject.
References gnash::DisplayObjectContainer::_displayList, gnash::DynamicShape::getBounds(), gnash::DisplayObject::getMask(), gnash::DisplayObject::getTarget(), gnash::getWorldMatrix(), gnash::SWFMatrix::invert(), gnash::DisplayObject::isDynamicMask(), gnash::log_debug(), mouseEnabled(), gnash::SWFRect::point_test(), gnash::DisplayObject::pointInShape(), gnash::DynamicShape::pointTestLocal(), gnash::SWFMatrix::transform(), gnash::DisplayObject::visible(), gnash::DisplayList::visitBackward(), gnash::geometry::Point2d::x, x, gnash::geometry::Point2d::y, and y.
Referenced by topmostMouseEntity().
void gnash::MovieClip::queueAction | ( | const action_buffer & | buf | ) |
Queue the given action buffer.
The action will be pushed on the current global list (see movie_root).
References gnash::movie_root::pushAction(), and gnash::DisplayObject::stage().
void gnash::MovieClip::queueEvent | ( | const event_id & | id, |
int | lvl | ||
) |
Queue event in the global action queue.
notifyEvent(id) will be called by execution of the queued action
References gnash::movie_root::pushAction(), and gnash::DisplayObject::stage().
Referenced by advance(), construct(), queueLoad(), and unloadChildren().
void gnash::MovieClip::queueLoad | ( | ) |
References gnash::getObject(), gnash::getSWFVersion(), gnash::event_id::LOAD, gnash::DisplayObject::parent(), gnash::movie_root::PRIORITY_DOACTION, and queueEvent().
Referenced by advance(), construct(), and gnash::movie_root::testInvariant().
void gnash::MovieClip::remove_display_object | ( | const SWF::PlaceObject2Tag * | tag, |
DisplayList & | dlist | ||
) |
Proxy of DisplayList::removeDisplayObject()
References gnash::SWF::DisplayListTag::getDepth(), gnash::DisplayList::removeDisplayObject(), and gnash::DisplayObject::set_invalidated().
Referenced by gnash::SWF::PlaceObject2Tag::executeState(), removeMovieClip(), and gnash::TextField::removeTextField().
void gnash::MovieClip::remove_display_object | ( | int | depth, |
int | |||
) |
Remove the object at the specified depth.
NOTE: (1)the id parameter is currently unused, but required to avoid breaking of inheritance from movie.h. (2)the id might be used for specifying a DisplayObject in the depth(think about multiple DisplayObjects within the same depth, not tested and a rare case)
References gnash::DisplayObjectContainer::_displayList, get_loaded_frames(), gnash::DisplayList::removeDisplayObject(), and gnash::DisplayObject::set_invalidated().
void gnash::MovieClip::removeMovieClip | ( | ) |
Remove this sprite from the stage.
This function is intended to be called by effect of a removeMovieClip() ActionScript call and implements the checks required for this specific case.
Callers are:
The removal will not occur if the depth of this DisplayObjects is not in the "dynamic" range [0..1048575] as described at the following URL:
http://www.senocular.com/flash/tutorials/depths/?page=2
A testcases for this behaviour can be found in
testsuite/misc-ming.all/displaylist_depths_test.swf
References _, gnash::movie_root::dropLevel(), gnash::DisplayObject::get_depth(), gnash::DisplayObject::getTarget(), IF_VERBOSE_ASCODING_ERRORS, gnash::log_aserror(), gnash::key::p, gnash::DisplayObject::parent(), remove_display_object(), and gnash::DisplayObject::stage().
Referenced by gnash::SWF::SWFHandlers::execute(), and gnash::registerMovieClipNative().
void gnash::MovieClip::replace_display_object | ( | const SWF::PlaceObject2Tag * | tag, |
DisplayList & | dlist | ||
) |
Proxy of DisplayList::replaceDisplayObject()
References _, gnash::DisplayObject::construct(), gnash::SWF::DefinitionTag::createDisplayObject(), gnash::SWF::PlaceObject2Tag::getCxform(), gnash::SWF::DisplayListTag::getDepth(), gnash::DisplayList::getDisplayObjectAtDepth(), gnash::getGlobal(), gnash::SWF::PlaceObject2Tag::getID(), gnash::SWF::PlaceObject2Tag::getMatrix(), gnash::SWF::PlaceObject2Tag::getName(), gnash::DisplayObject::getNextUnnamedInstanceName(), gnash::getObject(), gnash::SWF::PlaceObject2Tag::getRatio(), gnash::getURI(), gnash::getVM(), gnash::SWF::PlaceObject2Tag::hasCxform(), gnash::SWF::PlaceObject2Tag::hasMatrix(), gnash::SWF::PlaceObject2Tag::hasName(), gnash::SWF::PlaceObject2Tag::hasRatio(), gnash::isReferenceable(), gnash::log_error(), move_display_object(), gnash::DisplayList::replaceDisplayObject(), gnash::DisplayObject::set_name(), gnash::DisplayObject::set_ratio(), gnash::DisplayObject::setCxForm(), and gnash::DisplayObject::setMatrix().
Referenced by gnash::SWF::PlaceObject2Tag::executeState().
void gnash::MovieClip::set_background_color | ( | const rgba & | color | ) |
Set a TextField variable to this timeline.
A TextField variable is a variable that acts as a setter/getter for a TextField 'text' member.
References name.
Referenced by gnash::TextField::getDefinitionVersion().
|
inline |
Referenced by gnash::movie_root::mouseClick().
|
inline |
Set whether getAsRoot() should return the relative root, false otherwise. True for relative root.
Referenced by getLoadedMovie(), and gnash::registerMovieClipNative().
void gnash::MovieClip::setPlayState | ( | PlayState | s | ) |
Stop or play the sprite.
If stopped, any stream sound associated with this sprite will also be stopped.
References PLAYSTATE_STOP, gnash::key::s, and gnash::key::t.
Referenced by gnash::Gui::advanceMovie(), gnash::SWF::SWFHandlers::execute(), goto_frame(), and gnash::registerMovieClipNative().
void gnash::MovieClip::setStreamSoundId | ( | int | id | ) |
Set the currently playing m_sound_stream_id.
References gnash::log_debug(), gnash::movie_root::runResources(), gnash::RunResources::soundHandler(), gnash::DisplayObject::stage(), gnash::movie_root::stopStream(), and gnash::sound::sound_handler::stopStreamingSound().
Referenced by gnash::SWF::StreamSoundBlockTag::executeActions().
TODO: this is also unlikely to be the best way to do it.
References gnash::getObject(), gnash::getSWFVersion(), gnash::as_value::to_string(), and test::uri.
Referenced by gnash::as_object::set_member().
void gnash::MovieClip::setVariables | ( | const MovieVariables & | vars | ) |
Set all variables in the given map with their corresponding values.
References gnash::getObject(), gnash::getURI(), gnash::getVM(), and gnash::as_object::set_member().
Referenced by gnash::MovieLoader::clear(), gnash::movie_root::init(), and loadVariables().
|
inline |
Swap depth of the given DisplayObjects in the DisplayList.
See DisplayList::swapDepths for more info
Referenced by gnash::registerMovieClipNative().
|
inlinevirtual |
Reimplemented from gnash::DisplayObject.
Referenced by gnash::SWF::SWFHandlers::execute().
|
virtual |
Return the topmost entity that the given point covers that can receive mouse events. NULL if none. Coords are in parent's frame.
Implements gnash::InteractiveObject.
References gnash::DisplayObjectContainer::_displayList, gnash::getMatrix(), gnash::getWorldMatrix(), gnash::SWFMatrix::invert(), gnash::key::m, mouseEnabled(), gnash::key::p, gnash::DisplayObject::parent(), pointInVisibleShape(), gnash::SWFMatrix::transform(), gnash::DisplayObject::visible(), gnash::DisplayList::visitAll(), gnash::geometry::Point2d::x, and gnash::geometry::Point2d::y.
|
virtual |
ActionScript property of Buttons and MovieClips altering mouse handling.
Reimplemented from gnash::InteractiveObject.
References gnash::as_object::get_member(), gnash::getObject(), gnash::getURI(), gnash::getVM(), and gnash::toBool().
|
protectedvirtual |
Unload all contents in the displaylist and this instance.
Return true if there was an unloadHandler.
Reimplemented from gnash::DisplayObject.
References gnash::DisplayObjectContainer::_displayList, gnash::DynamicShape::clear(), gnash::DisplayObject::getTargetPath(), gnash::DisplayObject::hasEventHandler(), gnash::log_debug(), gnash::movie_root::PRIORITY_DOACTION, queueEvent(), gnash::movie_root::removeQueuedConstructor(), gnash::DisplayObject::stage(), gnash::event_id::UNLOAD, gnash::DisplayList::unload(), and gnash::DisplayObject::unloaded().
void gnash::MovieClip::unloadMovie | ( | ) |
Remove the 'contents' of the MovieClip, but leave properties and event handlers intact.
References _, LOG_ONCE, and gnash::log_unimpl().
Referenced by gnash::registerMovieClipNative().
|
virtual |
Enumerate child DisplayObjects.
See DisplayObject::enumerateNonProperties for more info.
Reimplemented from gnash::DisplayObject.
References gnash::DisplayObjectContainer::_displayList, and gnash::DisplayList::visitAll().