#include <sprite_instance.h>
Inheritance diagram for gnash::sprite_instance:
Public Types | |
typedef std::list< action_buffer * > | ActionList |
typedef std::vector< execute_tag * > | PlayList |
enum | mouse_state { UP = 0, DOWN, OVER } |
enum | play_state { PLAY, STOP } |
Public Member Functions | |
sprite_instance (movie_definition *def, movie_root *r, character *parent, int id) | |
virtual | ~sprite_instance () |
virtual void | has_keypress_event () |
virtual int | add_interval_timer (void *timer) |
virtual void | clear_interval_timer (int x) |
virtual void | do_something (void *timer) |
Interval timer timeout executor. | |
movie_root * | get_root () |
sprite_instance * | get_root_movie () |
Get a pointer to the root sprite. | |
movie_definition * | get_movie_definition () |
Return the sprite_definition (or movie_definition) from which this sprite_instance has been created. | |
float | get_width () const |
Returns local, untransformed width of this character in TWIPS. | |
float | get_height () const |
Returns local, untransformed height of this character in TWIPS. | |
size_t | get_current_frame () const |
size_t | get_frame_count () const |
size_t | get_loaded_frames () const |
Return number of completely loaded frames of this sprite/movie. | |
size_t | get_bytes_total () const |
size_t | get_bytes_loaded () const |
const rect & | get_frame_size () const |
void | set_play_state (play_state s) |
Stop or play the sprite. | |
play_state | get_play_state () const |
character * | get_character (int character_id) |
float | get_background_alpha () const |
float | get_pixel_scale () const |
virtual void | get_mouse_state (int *x, int *y, int *buttons) |
void | set_background_color (const rgba &color) |
float | get_timer () const |
void | restart () |
virtual bool | has_looped () const |
virtual bool | get_accept_anim_moves () const |
int | transition (int a, int b) const |
virtual bool | can_handle_mouse_event () |
Return true if we have any mouse event handlers. | |
virtual character * | get_topmost_mouse_entity (float x, float y) |
Return the topmost entity that the given point covers that can receive mouse events. NULL if none. Coords are in parent's frame. | |
virtual void | advance (float delta_time) |
virtual void | advance_sprite (float delta_time) |
void | execute_frame_tags (size_t frame, bool state_only=false) |
void | execute_frame_tags_reverse (size_t frame) |
execute_tag * | find_previous_replace_or_add_tag (int frame, int depth, int id) |
void | execute_remove_tags (int frame) |
void | do_actions () |
Take care of this frame's actions. | |
void | goto_frame (size_t target_frame_number) |
Set the sprite state at the specified frame number. | |
size_t | get_frame_number (const as_value &frame_spec) const |
Parse frame spec and return frame number. Frame spec can either be a number of a string (label). | |
bool | goto_labeled_frame (const char *label) |
Look up the labeled frame, and jump to it. | |
void | display () |
Display (render?) this Sprite/MovieClip, unless invisible. | |
void | swap_characters (character *ch1, character *ch2) |
character * | get_character_at_depth (int depth) |
character * | add_empty_movieclip (const char *name, int depth) |
character * | add_display_object (uint16_t character_id, const char *name, const std::vector< swf_event * > &event_handlers, uint16_t depth, bool replace_if_depth_is_occupied, const cxform &color_transform, const matrix &matrix, float ratio, uint16_t clip_depth) |
Add an object to the DisplayList. | |
void | move_display_object (uint16_t depth, bool use_cxform, const cxform &color_xform, bool use_matrix, const matrix &mat, float ratio, uint16_t clip_depth) |
void | replace_display_object (uint16_t character_id, const char *name, uint16_t depth, bool use_cxform, const cxform &color_transform, bool use_matrix, const matrix &mat, float ratio, uint16_t clip_depth) |
void | replace_display_object (character *ch, const char *name, uint16_t depth, bool use_cxform, const cxform &color_transform, bool use_matrix, const matrix &mat, float ratio, uint16_t clip_depth) |
void | remove_display_object (uint16_t depth, int) |
Remove the object at the specified depth. | |
void | add_action_buffer (action_buffer *a) |
int | get_id_at_depth (int depth) |
sprite_instance * | to_movie () |
Cast to a sprite, or return NULL. | |
virtual void | set_variable (const char *path_to_var, const char *new_value) |
Set the named variable to the value. | |
virtual void | set_variable (const char *path_to_var, const wchar_t *new_value) |
Set the named variable to the wide value. | |
virtual const char * | get_variable (const char *path_to_var) const |
Returns address to static buffer. NOT THREAD SAFE! | |
bool | get_member (const tu_stringi &name, as_value *val) |
virtual void | set_member (const tu_stringi &name, const as_value &val) |
Set the named member to the value. | |
virtual character * | get_relative_target (const std::string &name) |
Overridden to look in DisplayList for a match. | |
virtual void | call_frame_actions (const as_value &frame_spec) |
Execute the actions for the specified frame. | |
virtual void | set_drag_state (const drag_state &st) |
virtual void | stop_drag () |
virtual void | get_drag_state (drag_state *st) |
void | clone_display_object (const std::string &name, const std::string &newname, uint16_t depth) |
void | remove_display_object (const tu_string &name) |
Remove the object with the specified name. | |
virtual bool | on_event (const event_id &id) |
Dispatch event handler(s), if any. | |
virtual void | on_event_xmlsocket_onxml () |
virtual void | on_event_interval_timer () |
virtual void | on_event_load_progress () |
Do the events that happen as a MovieClip (swf 7 only) loads. | |
virtual const char * | call_method_args (const char *method_name, const char *method_arg_fmt, va_list args) |
Call a method with a list of arguments. | |
virtual void | attach_display_callback (const char *path_to_object, void(*callback)(void *), void *user_ptr) |
as_environment & | get_environment () |
Return a reference to the variable scope of this character. | |
void | set_textfield_variable (const std::string &name, edit_text_character *ch) |
Set a TextField variable to this timeline. | |
void | get_invalidated_bounds (rect *bounds, bool force) |
const DisplayList & | getDisplayList () const |
int | getNextHighestDepth () const |
Return the next highest available depth. | |
void | testInvariant () const |
virtual void | set_sound_stream_id (int id) |
Set the current m_sound_stream_id. | |
virtual int | get_sound_stream_id () |
Get the current m_sound_stream_id. | |
Protected Attributes | |
boost::intrusive_ptr< movie_definition > | m_def |
This is either sprite_definition (for sprites defined by DefineSprite tag) or movie_def_impl (for the top-level movie). | |
bool | m_on_event_load_called |
Instance of this class are also known as "timelines". This means that they define a variable scope (see the as_environment member) and are divided into "frames"
|
|
|
|
|
|
|
|
|
|
|
|
|
Add the given action buffer to the list of action buffers to be processed at the end of the next frame advance. |
|
Add an object to the DisplayList.
|
|
|
|
Reimplemented in gnash::movie_root. |
|
Reimplemented from gnash::character. Reimplemented in gnash::movie_instance, and gnash::movie_root. |
|
|
|
|
|
Execute the actions for the specified frame. The frame_spec could be an integer or a string. |
|
Call a method with a list of arguments.
Reimplemented in gnash::movie_root. |
|
Return true if we have any mouse event handlers.
Implements gnash::character. |
|
Reimplemented in gnash::movie_root. |
|
Duplicate the object with the specified name and add it with a new name at a new depth. |
|
Display (render?) this Sprite/MovieClip, unless invisible.
Reimplemented from gnash::character. Reimplemented in gnash::movie_root. |
|
Take care of this frame's actions.
|
|
Interval timer timeout executor.
Reimplemented in gnash::movie_root. |
|
Execute the tags associated with the specified frame. frame is 0-based |
|
Execute the tags associated with the specified frame, IN REVERSE. I.e. if it's an "add" tag, then we do a "remove" instead. Only relevant to the display-list manipulation tags: add, move, remove, replace. frame is 0-based |
|
Execute any remove-object tags associated with the specified frame. frame is 0-based |
|
|
|
Reimplemented from gnash::character. |
|
Reimplemented in gnash::movie_root. |
|
Return number of loaded bytes in the movie (not sprite!) |
|
Return total number of bytes in the movie (not sprite!) |
|
Reimplemented in gnash::movie_root. |
|
|
|
Reimplemented from gnash::character. Reimplemented in gnash::movie_root. |
|
|
|
Return a reference to the variable scope of this character. TODO: make const/return const& ? Reimplemented from gnash::character. |
|
|
|
Parse frame spec and return frame number. Frame spec can either be a number of a string (label).
|
|
|
|
Returns local, untransformed height of this character in TWIPS.
Reimplemented from gnash::character. |
|
For debugging -- return the id of the character at the specified depth. Return -1 if nobody's home. |
|
Checks if the character instance is still enclosed in the given bounds. Otherwise it will expand them to surround the character. It is used to determine what area needs to be re-rendered. The coordinates are world coordinates. Only instances with m_invalidated flag set are checked unless force is set. Implements gnash::character. Reimplemented in gnash::movie_root. |
|
Return number of completely loaded frames of this sprite/movie. Note: the number is also the last frame accessible (frames numberes are 1-based) |
|
FIXME: use a contextual 'target' member FIXME: add a valid 'url' member. Currently the verbatim "gnash" value is assigned to it. The 'url' member should be inherited by parent *unless* we loaded an external resource into this movieclip. Reimplemented from gnash::as_object. Reimplemented in gnash::movie_root. |
|
Reimplemented from gnash::character. Reimplemented in gnash::movie_root. |
|
Return the sprite_definition (or movie_definition) from which this sprite_instance has been created.
Reimplemented from gnash::character. Reimplemented in gnash::movie_root. |
|
These have been moved down from movie.h to remove that file from the inheritance chain. It is probably still a misdesign to require these functions for all characters. Reimplemented from gnash::character. Reimplemented in gnash::movie_root. |
|
Reimplemented in gnash::movie_root. |
|
Overridden to look in DisplayList for a match.
Reimplemented from gnash::character. |
|
Reimplemented from gnash::character. |
|
Get a pointer to the root sprite.
Reimplemented from gnash::character. Reimplemented in gnash::movie_root. |
|
Get the current m_sound_stream_id.
|
|
Reimplemented in gnash::movie_root. |
|
Return the topmost entity that the given point covers that can receive mouse events. NULL if none. Coords are in parent's frame.
Reimplemented from gnash::character. |
|
Returns address to static buffer. NOT THREAD SAFE!
Reimplemented in gnash::movie_root. |
|
Returns local, untransformed width of this character in TWIPS.
Reimplemented from gnash::character. |
|
|
|
Return the next highest available depth. Placing an object at the depth returned by this function should result in a character that is displayd above all others |
|
Set the sprite state at the specified frame number. 0-based frame numbers!! (in contrast to ActionScript and Flash MX) Reimplemented from gnash::character. Reimplemented in gnash::movie_root. |
|
Look up the labeled frame, and jump to it.
Reimplemented in gnash::movie_root. |
|
Reimplemented from gnash::character. |
|
Reimplemented from gnash::character. Reimplemented in gnash::movie_root. |
|
Updates the transform properties of the object at the specified depth. |
|
Dispatch event handler(s), if any.
Reimplemented from gnash::character. |
|
Do the events that (appear to) happen on a specified interval. |
|
Do the events that happen as a MovieClip (swf 7 only) loads.
|
|
Do the events that happen when there is XML data waiting on the XML socket connection. FIXME: unimplemented |
|
Remove the object with the specified name. @ what happens if the we have multiple objects with the same name ? |
|
Remove the object at the specified depth. NOTE: the id parameter is unused, but currently required to avoid break of inheritance from movie.h |
|
|
|
|
|
Reimplemented from gnash::character. Reimplemented in gnash::movie_root. |
|
Reimplemented in gnash::movie_root. |
|
|
|
Set the named member to the value. Return true if we have that member; false otherwise. Reimplemented from gnash::as_object. Reimplemented in gnash::movie_root. |
|
Stop or play the sprite.
|
|
Set the current m_sound_stream_id.
|
|
Set a TextField variable to this timeline. A TextField variable is a variable that acts as a setter/getter for a TextField 'text' member. |
|
Set the named variable to the wide value.
Reimplemented in gnash::movie_root. |
|
Set the named variable to the value.
Reimplemented in gnash::movie_root. |
|
Reimplemented in gnash::movie_root. |
|
|
|
|
|
Cast to a sprite, or return NULL.
Reimplemented from gnash::as_object. |
|
Combine the flags to avoid a conditional. It would be faster with a macro. |
|
This is either sprite_definition (for sprites defined by DefineSprite tag) or movie_def_impl (for the top-level movie).
|
|
|