Go to the documentation of this file.
64 #ifndef GNASH_MOVIE_ROOT_H
65 #define GNASH_MOVIE_ROOT_H
74 #include <forward_list>
78 #include <boost/ptr_container/ptr_deque.hpp>
79 #include <boost/noncopyable.hpp>
80 #include <boost/any.hpp>
81 #include <boost/optional.hpp>
107 #ifndef GNASH_PARANOIA_LEVEL
108 # define GNASH_PARANOIA_LEVEL 1
113 class ExecutableCode;
158 _stream(std::move(
s)),
162 void setReachable()
const;
164 std::unique_ptr<IOChannel> _stream;
170 typedef std::bitset<key::KEYCOUNT>
Keys;
197 MovieClip* getLevel(
unsigned int num)
const;
205 void setLevel(
unsigned int num,
Movie* movie);
216 void replaceLevel(
unsigned int num,
Movie* external_movie);
232 void swapLevels(
MovieClip* sp,
int depth);
243 void dropLevel(
int depth);
252 void setDimensions(
size_t w,
size_t h);
255 size_t getStageWidth()
const;
258 size_t getStageHeight()
const;
270 DSOEXPORT bool mouseMoved(std::int32_t
x, std::int32_t
y);
296 std::pair<std::int32_t, std::int32_t> mousePosition()
const;
322 std::uint32_t addIntervalTimer(std::unique_ptr<Timer> timer);
340 void addLoadableObject(
as_object* obj, std::unique_ptr<IOChannel> str);
349 bool clearIntervalTimer(std::uint32_t
x);
351 void set_background_color(
const rgba&
color);
353 void set_background_alpha(
float alpha);
372 int timeToNextFrame()
const;
391 return ++_unnamedInstance;
395 void registerButton(
Button* listener);
398 void removeButton(
Button* listener);
441 bool testInvariant()
const;
446 DISPLAYSTATE_FULLSCREEN
494 void setStageAlignment(
short s);
498 void setAllowScriptAccess(AllowScriptAccessMode mode);
501 AllowScriptAccessMode getAllowScriptAccess();
503 typedef std::pair<StageHorizontalAlign, StageVerticalAlign>
StageAlign;
511 bool getShowMenuState()
const;
515 void setShowMenuState(
bool state);
524 std::string getStageAlignMode()
const;
530 void setStageDisplayState(
const DisplayState ds);
549 typedef std::array<boost::ptr_deque<ExecutableCode>, PRIORITY_SIZE>
553 void pushAction(std::unique_ptr<ExecutableCode>
code,
size_t lvl);
570 void markReachableResources()
const;
583 #if GNASH_PARANOIA_LEVEL > 1
584 assert(std::find(_liveChars.begin(), _liveChars.end(), ch) ==
587 _liveChars.push_front(ch);
604 void disableScripts();
617 void flushHigherPriorityActionQueues();
619 DisplayObject* findCharacterByTarget(
const std::string& tgtstr)
const;
642 _movieLoader.loadMovie(
url, target,
data, method, handler);
658 void getURL(
const std::string& urlstr,
const std::string& target,
663 return _lastKeyEvent;
667 return _unreleasedKeys;
719 _fsCommandHandler = handler;
723 DSOEXPORT void handleFsCommand(
const std::string& cmd,
724 const std::string& arg)
const;
733 _interfaceHandler = handler;
767 void setScriptLimits(std::uint16_t recursion, std::uint16_t timeout);
772 return _recursionLimit;
779 return _timeoutLimit;
783 typedef tree<std::pair<std::string, std::string> > InfoTree;
784 void getMovieInfo(InfoTree& tr, InfoTree::iterator it);
785 void getCharacterTree(InfoTree& tr, InfoTree::iterator it);
803 void addExternalCallback(
const std::string&
name,
as_object* callback,
808 std::string callExternalCallback(
const std::string &
name,
809 const std::vector<as_value>& args);
811 std::string callExternalJavascript(
const std::string &
name,
812 const std::vector<as_value>& args);
820 void removeQueuedConstructor(
MovieClip* target);
830 bool queryInterface(
const std::string& what)
const;
843 void setStreamBlock(
int id,
int block);
851 void stopStream(
int id);
878 void setRootMovie(
Movie* movie);
881 bool notify_mouse_listeners(
const event_id& event);
886 bool fire_mouse_event();
892 void executeAdvanceCallbacks();
895 void executeTimers();
898 void cleanupAndCollect();
916 std::int32_t
y)
const;
920 void cleanupDisplayList();
923 void advanceLiveChars();
928 void setInvalidated() { _invalidated =
true; }
934 void clearInvalidated() { _invalidated =
false; }
944 bool isInvalidated() {
return _invalidated; }
950 size_t minPopulatedPriorityQueue()
const;
955 size_t processActionQueue(
size_t lvl);
957 bool processingActions()
const {
958 return (_processingActionLevel < PRIORITY_SIZE);
961 const DisplayObject* findDropTarget(std::int32_t
x, std::int32_t
y,
962 DisplayObject* dragging)
const;
964 void handleActionLimitHit(
const std::string& ref);
966 typedef std::forward_list<Button*> ButtonListeners;
967 ButtonListeners _buttonListeners;
971 const RunResources& _runResources;
978 HostInterface* _interfaceHandler;
981 FsCallback* _fsCommandHandler;
989 typedef std::forward_list<MovieClip*> LiveChars;
992 LiveChars _liveChars;
994 ActionQueue _actionQueue;
997 void processActionQueue();
1001 size_t _stageHeight;
1003 rgba m_background_color;
1004 bool m_background_color_set;
1006 std::int32_t _mouseX;
1007 std::int32_t _mouseY;
1009 MouseButtonState _mouseButtonState;
1012 typedef std::set<ActiveRelay*> ObjectCallbacks;
1013 ObjectCallbacks _objectCallbacks;
1015 LoadCallbacks _loadCallbacks;
1017 typedef std::map<std::uint32_t, std::unique_ptr<Timer>> TimerMap;
1019 TimerMap _intervalTimers;
1021 size_t _lastTimerId;
1024 Keys _unreleasedKeys;
1029 DisplayObject* _currentFocus;
1032 boost::optional<DragState> _dragState;
1034 typedef std::map<int, MovieClip*> Levels;
1043 typedef std::map<const SWF::DefinitionTag*, as_function*> RegisteredClasses;
1044 RegisteredClasses _registeredClasses;
1056 bool _disableScripts;
1057 int _processingActionLevel;
1072 std::bitset<4u> _alignMode;
1074 AllowScriptAccessMode _allowScriptAccess;
1080 ScaleMode _scaleMode;
1083 DisplayState _displayState;
1086 std::uint16_t _recursionLimit;
1089 std::uint16_t _timeoutLimit;
1092 size_t _movieAdvancementDelay;
1095 size_t _lastMovieAdvancement;
1098 size_t _unnamedInstance;
1100 MovieLoader _movieLoader;
1102 struct SoundStream {
1103 SoundStream(
int i,
int b) : id(
i), block(
b) {}
1108 boost::optional<SoundStream> _timelineSound;
1120 bool isLevelTarget(
int version,
const std::string&
name,
unsigned int& levelno);
1124 template<
typename T>
1128 if (!_interfaceHandler) {
1129 log_error(
"Hosting application registered no callback for "
1130 "messages, can't call %s(%s)");
1135 return boost::any_cast<T>(_interfaceHandler->
call(
e));
1137 catch (
const boost::bad_any_cast&) {
1138 log_error(
_(
"Unexpected type from host interface when requesting "
1146 #endif // GNASH_MOVIE_ROOT_H
virtual void construct(as_object *initObj=nullptr)
Handle placement event.
Definition: MovieClip.cpp:1711
@ KEY
Definition: GnashKey.h:332
Abstract base class for FS handlers.
Definition: HostInterface.h:200
bool isLevelTarget(int version, const std::string &name, unsigned int &levelno)
Return true if the given string can be interpreted as a _level name.
Definition: movie_root.cpp:2387
bool isNativeType(const as_object *obj, T *&relay)
Check whether the object is an instance of a known type.
Definition: as_object.h:875
void setConstantPool(const ConstantPool *pool)
Definition: VM.h:247
void removeAdvanceCallback(ActiveRelay *obj)
Definition: movie_root.cpp:1464
static DSOEXPORT size_t writeBrowser(int fd, const std::string &xml)
Definition: ExternalInterface.cpp:326
bool clearIntervalTimer(std::uint32_t x)
Remove timer identified by given integer.
Definition: movie_root.cpp:828
boost::variant< HostMessage, CustomMessage > Message
Definition: HostInterface.h:213
virtual bool isAS3() const
True if the SWFMovie should use AVM2.
Definition: movie_definition.h:410
@ l
Definition: GnashKey.h:158
void set_depth(int d)
Definition: DisplayObject.h:270
virtual void exit()=0
Instruct the hosting application to exit.
void dropLevel(int depth)
Drop level at given depth.
Definition: movie_root.cpp:462
void setDragState(const DragState &st)
Definition: movie_root.cpp:743
const char * textEncodingName(TextEncoding enc)
Return name of a text encoding.
Definition: utf8.cpp:262
DSOEXPORT void registerFSCommandCallback(FsCallback *handler)
Definition: movie_root.h:718
void display()
Definition: movie_root.cpp:998
const SWFRect & get_frame_size() const
Definition: MovieClip.h:195
@ PROP_ON_KILL_FOCUS
Definition: namedStrings.h:159
std::string name
Definition: LocalConnection_as.cpp:149
void setSWFVersion(int v)
Set SWF version of the currently executing code.
Definition: VM.cpp:74
std::string callExternalJavascript(const std::string &name, const std::vector< as_value > &args)
Definition: movie_root.cpp:1895
std::uint32_t addIntervalTimer(std::unique_ptr< Timer > timer)
Add an interval timer.
Definition: movie_root.cpp:813
pixel_iterator< T > begin(GnashImage &im)
Definition: ImageIterators.h:191
@ EXTERNALINTERFACE_PAN
Definition: HostInterface.h:176
bool processInvoke(ExternalInterface::invoke_t *)
Definition: movie_root.cpp:1571
The base class for all ActionScript objects.
Definition: as_object.h:162
void destroy()
Mark this sprite as destroyed.
Definition: MovieClip.cpp:2041
@ PROP_uBYTES_TOTAL
Definition: namedStrings.h:141
Definition: Renderer.h:540
@ QUALITY_BEST
Definition: GnashEnums.h:39
std::pair< std::int32_t, std::int32_t > mousePosition() const
Use this to retrieve the last state of the mouse.
Definition: movie_root.cpp:736
@ PROP_uBYTES_LOADED
Definition: namedStrings.h:142
Renderer * renderer() const
Definition: RunResources.h:112
virtual size_t widthPixels() const =0
void callInterface(const HostInterface::Message &e) const
Call the hosting application without expecting a reply.
Definition: movie_root.cpp:2516
as_object * toObject(const as_value &v, VM &vm)
Convert an as_value to an object.
Definition: VM.cpp:457
size_t getStageHeight() const
Notional height of the stage, actual value depending on scaleMode.
Definition: movie_root.cpp:1213
@ T
Definition: GnashKey.h:132
Movie & getRootMovie()
Access the originating root movie (not necessarily _level0)
Definition: movie_root.h:303
std::int32_t get_x_max() const
Get the x coordinate of the right-down corner.
Definition: SWFRect.h:122
int getHostFD() const
Definition: movie_root.h:701
static const int staticDepthOffset
Definition: DisplayObject.h:205
Definition: GnashException.h:182
A class used to virtualize time flow.
Definition: VirtualClock.h:34
void setDimensions(size_t w, size_t h)
Change stage size.
Definition: movie_root.cpp:561
Immutable data representing the definition of a movie display element.
Definition: DefinitionTag.h:48
ScaleMode getStageScaleMode() const
Returns the Stage object's align mode.
Definition: movie_root.h:521
DSOEXPORT bool mouseMoved(std::int32_t x, std::int32_t y)
Inform the Stage that the mouse has moved.
Definition: movie_root.cpp:582
int getScriptsRecursionLimit() const
Definition: rc.h:353
@ PROP_BROADCAST_MESSAGE
Definition: namedStrings.h:139
void log_debug(StringType msg, Args... args)
Definition: log.h:301
static DSOEXPORT std::string makeInvoke(const std::string &method, const std::vector< as_value > &args)
Definition: ExternalInterface.cpp:302
@ MOUSE_UP
Definition: event_id.h:77
std::int32_t y
Definition: BitmapData_as.cpp:435
@ i
Definition: GnashKey.h:155
as_object * getPathElement(as_object &o, const ObjectURI &uri)
Resolve the given relative path component.
Definition: as_object.cpp:1089
DSOEXPORT bool mouseWheel(int delta)
Inform the Stage that a mouse wheel has moved.
Definition: movie_root.cpp:659
#define LOG_ONCE(x)
Definition: log.h:49
A basic RGBA type.
Definition: RGBA.h:36
@ STAGE_ALIGN_L
Definition: movie_root.h:473
virtual const std::string & get_url() const =0
Return the URL of the SWF stream this definition has been read from.
AllowScriptAccessMode getAllowScriptAccess()
Gets the current Access Mode for ExternalInterface.
Definition: movie_root.cpp:1243
virtual void mouseEvent(const event_id &id)=0
Called whenever a mouse event affects this InteractiveObject.
bool operator()(const LevelMovie &d1, const LevelMovie &d2) const
Definition: movie_root.h:129
std::int32_t pixelsToTwips(double a)
Definition: GnashNumeric.h:144
as_value getVariable(const as_environment &env, const std::string &varname, const as_environment::ScopeStack &scope, as_object **retTarget)
Return the (possibly undefined) value of the named var.
Definition: as_environment.cpp:289
#define _(String)
Definition: log.h:44
as_object & owner() const
Return the as_object that this Relay is attached to.
Definition: Relay.h:108
Provides information about timeline context.
Definition: as_environment.h:51
What is being dragged and how.
Definition: DragState.h:36
A class to identify 'static' SWF events (system events).
Definition: event_id.h:53
size_t get_loaded_frames() const
Return number of completely loaded frames of this sprite/movie.
Definition: MovieClip.h:176
The AVM1 virtual machine.
Definition: VM.h:72
MovieClip * LevelMovie
Definition: movie_root.h:128
virtual void display(Renderer &renderer, const Transform &xform)
Render this MovieClip.
Definition: MovieClip.cpp:1205
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:41
Global_as * getGlobal() const
Get a pointer to this VM's _global Object.
Definition: VM.cpp:149
~movie_root()
Definition: movie_root.cpp:190
bool is_null() const
returns true if this is a NULL rectangle
Definition: SWFRect.h:75
DSOEXPORT void setVariables(const MovieVariables &vars)
Set all variables in the given map with their corresponding values.
Definition: MovieClip.cpp:1936
Abstract base class for hosting app handler.
Definition: HostInterface.h:208
std::int32_t get_y_max() const
Get the y coordinate of the right-down corner.
Definition: SWFRect.h:136
SWFMatrix getWorldMatrix(const DisplayObject &d, bool includeRoot=true)
Get concatenated SWFMatrix (all ancestor transforms and our SWFMatrix)
Definition: DisplayObject.h:1131
DisplayObject * getFocus()
Get the DisplayObject having focus.
Definition: movie_root.cpp:1084
@ PRIORITY_DOACTION
Frame actions, load handlers, unload handlers.
Definition: movie_root.h:539
size_t getStageWidth() const
Notional width of the stage, actual value depending on scaleMode.
Definition: movie_root.cpp:1197
@ STAGE_V_ALIGN_C
Definition: movie_root.h:466
#define GNASH_REPORT_FUNCTION
Definition: log.h:452
@ encUNSPECIFIED
Definition: utf8.h:115
Definition: movie_root.h:127
void registerButton(Button *listener)
Push a new DisplayObject listener for key events.
Definition: movie_root.cpp:1992
void setAllowScriptAccess(AllowScriptAccessMode mode)
The mode is one of never, always, with sameDomain the default.
Definition: movie_root.cpp:1237
Base class for render handlers.
Definition: Renderer.h:189
void setReachable() const
Definition: MovieLoader.cpp:461
int frnd(float f)
Definition: GnashNumeric.h:91
Garbage collector singleton.
Definition: GC.h:165
@ s
Definition: GnashKey.h:165
@ SCRIPT_ACCESS_NEVER
Definition: movie_root.h:481
@ STAGE_H_ALIGN_R
Definition: movie_root.h:461
void setMatrix(const SWFMatrix &m, bool updateCache=false)
Set local transform SWFMatrix for this DisplayObject.
Definition: DisplayObject.cpp:395
size_t get_bytes_loaded() const
Definition: MovieClip.h:190
void markReachableResources() const
Mark all reachable resources (for GC)
Definition: movie_root.cpp:1753
@ EXTERNALINTERFACE_STOPPLAY
Definition: HostInterface.h:180
DSOEXPORT bool mouseClick(bool press)
Inform the Stage that a mouse click has occurred.
Definition: movie_root.cpp:678
@ PRIORITY_CONSTRUCT
Construct event handlers.
Definition: movie_root.h:537
void clear()
Drop all requests and kill the thread.
Definition: MovieLoader.cpp:152
std::string DSOEXPORT getTarget() const
Return full path to this object, in dot notation.
Definition: DisplayObject.cpp:621
@ EXTERNALINTERFACE_ZOOM
Definition: HostInterface.h:181
static std::string toXML(const as_value &obj)
Convert an AS object to an XML string.
Definition: ExternalInterface.h:51
#define __FUNCTION__
Definition: log.h:437
Global_as & getGlobal(const as_environment &env)
Definition: as_environment.cpp:651
void log_network(StringType msg, Args... args)
Definition: log.h:277
void pushAction(std::unique_ptr< ExecutableCode > code, size_t lvl)
Push an executable code to the ActionQueue.
Definition: movie_root.cpp:1496
virtual Movie * createMovie(Global_as &, DisplayObject *=nullptr)
Create a movie instance from a def.
Definition: movie_definition.h:143
A MovieClip is a container for DisplayObjects.
Definition: MovieClip.h:84
@ STAGE_ALIGN_R
Definition: movie_root.h:475
GC & gc()
Definition: movie_root.h:822
@ STAGE_H_ALIGN_L
Definition: movie_root.h:460
virtual int get_version() const =0
Client program's interface to the definition of a movie or sprite.
Definition: movie_definition.h:96
@ CLASS_STAGE
Definition: namedStrings.h:241
void log_error(StringType msg, Args... args)
Definition: log.h:283
AllowScriptAccessMode
The possibile values of AllowScriptAccess.
Definition: movie_root.h:480
StageAlign getStageAlignment() const
Definition: movie_root.cpp:1251
void setStageScaleMode(ScaleMode sm)
Sets the Stage object's align mode.
Definition: movie_root.cpp:1303
@ k
Definition: GnashKey.h:157
@ SCRIPT_ACCESS_SAME_DOMAIN
Definition: movie_root.h:482
The base class for interactive objects.
Definition: InteractiveObject.h:45
Movie * init(movie_definition *def, const MovieClip::MovieVariables &variables)
Initialize movie_root with a parsed movie definition.
Definition: movie_root.cpp:200
@ encUTF8
Definition: utf8.h:116
Rectangle class, see swf defined rectangle record.
Definition: SWFRect.h:45
void setDropTarget(const std::string &tgt)
Definition: MovieClip.h:230
void setLevel(unsigned int num, Movie *movie)
Put the given movie at the given level.
Definition: movie_root.cpp:316
const VGfloat color[4]
Definition: testr_gtk.cpp:82
Abstract class to allow the GC to store "roots" into a container.
Definition: GC.h:56
as_value callMethod(fn_call::Args &args, as_object *obj, const ObjectURI &uri)
Call a member function of this object in an AS-compatible way.
Definition: Global_as.h:219
void write(SimpleBuffer &buf, const std::string &str)
Write a string to an AMF buffer.
Definition: AMF.cpp:161
void setReachable() const
Definition: movie_root.cpp:2433
bool queryInterface(const std::string &what) const
Ask the host interface a question.
Definition: movie_root.cpp:246
ExternalCallbackInstances _externalCallbackInstances
Definition: movie_root.h:793
void for_each(C &container, R(T::*pmf)(const A &), const A &arg)
Definition: Renderer_ogl.cpp:690
virtual bool handleFocus()
Set the current focus to this DisplayObject.
Definition: DisplayObject.h:910
int getControlFD() const
Definition: movie_root.h:705
@ a
Definition: GnashKey.h:147
void markReachableResources() const
Mark all reachable resources (for GC)
Definition: VM.cpp:161
@ SHOW_MENU
Definition: HostInterface.h:117
std::int32_t x
The x coordinate.
Definition: Point2d.h:43
int get_depth() const
Definition: DisplayObject.h:268
std::int32_t get_x_min() const
Get the x coordinate of the left-up corner.
Definition: SWFRect.h:115
bool advance()
Definition: movie_root.cpp:848
@ STAGE_ALIGN_T
Definition: movie_root.h:474
void removeButton(Button *listener)
Remove a DisplayObject listener for key events.
Definition: movie_root.cpp:1986
void setStageDisplayState(const DisplayState ds)
Definition: movie_root.cpp:1341
virtual size_t heightPixels() const =0
const unsigned char codeMap[KEYCOUNT][TYPES]
Definition: GnashKey.h:337
virtual const movie_definition * definition() const =0
@ SET_DISPLAYSTATE
Definition: HostInterface.h:124
DisplayState
The possible values of Stage.displayState.
Definition: movie_root.h:444
DSOEXPORT as_value invoke(const as_value &method, const as_environment &env, as_object *this_ptr, fn_call::Args &args, as_object *super=nullptr, const movie_definition *callerDef=nullptr)
Call an as_value on an as_object.
Definition: Global_as.h:166
@ EXTERNALINTERFACE_ISPLAYING
Definition: HostInterface.h:175
DSOTEXPORT std::string to_string(int version=7) const
Get a std::string representation for this value.
Definition: as_value.cpp:205
A class to contain transferable arguments for a fn_call.
Definition: fn_call.h:57
virtual MovieClip * to_movie()
Definition: DisplayObject.h:266
@ EXTERNALINTERFACE_PLAY
Definition: HostInterface.h:177
void executeAndReset()
Execute associated function and reset state.
Definition: Timers.cpp:93
bool processLoad()
Definition: movie_root.cpp:2439
StageVerticalAlign
The possible vertical position of the Stage.
Definition: movie_root.h:465
#define IF_VERBOSE_ASCODING_ERRORS(x)
Definition: log.h:397
code
Definition: GnashKey.h:44
void transform(geometry::Point2d &p) const
Transform a given point by our SWFMatrix.
Definition: SWFMatrix.cpp:99
void fuzzyCollect()
Run the collector, if worth it.
Definition: GC.h:210
A native type that requires periodic updates from the core (movie_root).
Definition: Relay.h:80
std::map< std::string, as_object * > ExternalCallbackInstances
Definition: movie_root.h:791
std::uint16_t getRecursionLimit() const
Definition: movie_root.h:771
@ h
Definition: GnashKey.h:154
A case-insensitive string equality operator.
Definition: StringPredicates.h:42
const char * stripBOM(const char *in, size_t &size, TextEncoding &encoding)
Interpret (and skip) Byte Order Mark in input stream.
Definition: utf8.cpp:208
VM & getVM()
Return the VM used by this movie_root.
Definition: movie_root.h:356
@ PRIORITY_SIZE
Last element used to easy computation of size...
Definition: movie_root.h:541
std::vector< as_object * > ScopeStack
A stack of objects used for variables/members lookup.
Definition: as_environment.h:55
void set_undefined()
Set to undefined.
Definition: as_value.cpp:519
bool setFocus(DisplayObject *to)
Set the DisplayObject having focus.
Definition: movie_root.cpp:1090
std::bitset< key::KEYCOUNT > Keys
Definition: movie_root.h:170
std::uint16_t getTimeoutLimit() const
Definition: movie_root.h:777
short stringToStageAlign(const std::string &str)
Definition: movie_root.cpp:2406
void setStreamBlock(int id, int block)
Set the current stream block for the driving streaming sound.
Definition: movie_root.cpp:259
ActionPriorityLevel
Action priority levels.
Definition: movie_root.h:533
void reset()
Reset stage to its initial state.
Definition: movie_root.cpp:519
void cleanupDisplayList()
Definition: MovieClip.cpp:2010
@ INVALID
Definition: GnashKey.h:45
const std::string & getURLOpenerFormat() const
Get the URL opener command format.
Definition: rc.h:239
void addLoadableObject(as_object *obj, std::unique_ptr< IOChannel > str)
Register an object for loading data to.
Definition: movie_root.cpp:1452
@ p
Definition: GnashKey.h:162
void processCompletedRequests()
Process all completed movie load requests.
Definition: MovieLoader.cpp:329
Definition: ExternalInterface.h:44
DSOEXPORT void registerEventCallback(HostInterface *handler)
Definition: movie_root.h:732
@ SCALEMODE_NOSCALE
Definition: movie_root.h:452
@ q
Definition: GnashKey.h:163
int getSWFVersion() const
Get SWF version context for the currently running actions.
Definition: VM.h:106
int qualityLevel() const
Definition: rc.h:109
as_object * to_object(VM &vm) const
Return value as an object, converting primitive values as needed.
Definition: as_value.cpp:453
geometry::Point2d point
Definition: Point2d.h:143
@ STAGE_H_ALIGN_C
Definition: movie_root.h:459
@ _1
Definition: GnashKey.h:95
@ KEYCOUNT
Definition: GnashKey.h:326
void setStageAlignment(short s)
Definition: movie_root.cpp:1229
void set_invalidated()
This function marks the DisplayObject as being modified in aspect and keeps track of current invalida...
Definition: DisplayObject.cpp:183
unsigned long int elapsed() const
Return number of milliseconds elapsed since start.
Definition: SystemClock.cpp:47
Class to group together per-run and external resources for Gnash.
Definition: RunResources.h:54
@ DISPLAYSTATE_FULLSCREEN
Definition: movie_root.h:446
Definition: SWFMatrix.h:54
ActionScript value type.
Definition: as_value.h:95
2D Point class
Definition: Point2d.h:39
virtual void reset()
Discard all sound inputs (slots and aux streamers) and clear scheduling.
Definition: sound_handler.cpp:812
void registerClass(const SWF::DefinitionTag *sprite, as_function *cls)
Register an actionscript class for construction of a MovieClip.
Definition: movie_root.cpp:280
A top-level, standalone Movie that can be loaded and played.
Definition: Movie.h:47
size_t nextUnnamedInstance()
Get a unique number for unnamed instances.
Definition: movie_root.h:390
bool unloaded() const
Return true if this DisplayObject was unloaded from the stage.
Definition: DisplayObject.h:785
DisplayObject * getActiveEntityUnderPointer() const
Return the topmost active entity under the pointer.
Definition: movie_root.cpp:1143
VariablesMethod
The various methods for sending data in requests.
Definition: MovieClip.h:419
@ STAGE_V_ALIGN_T
Definition: movie_root.h:467
void swapLevels(MovieClip *sp, int depth)
Swap depth of a level (or two)
Definition: movie_root.cpp:382
@ SCALEMODE_SHOWALL
Definition: movie_root.h:451
DSOEXPORT bool keyEvent(key::code k, bool down)
Tell the movie when the user pressed or released a key.
Definition: movie_root.cpp:593
AlignMode
The possible elements of a Stage.alignMode.
Definition: movie_root.h:472
virtual void killFocus()
Some DisplayObjects require actions on losing focus.
Definition: DisplayObject.h:917
void replaceLevel(unsigned int num, Movie *external_movie)
Replace an existing level with a new movie.
Definition: movie_root.cpp:494
void setShowMenuState(bool state)
Definition: movie_root.cpp:1277
void addExternalCallback(const std::string &name, as_object *callback, as_object *instance)
Add an ExternalInterface callback object with an associated name.
Definition: movie_root.cpp:1849
Global code (out of any function)
Definition: ExecutableCode.h:63
std::string getTargetPath() const
Return full path to this object, in slash notation.
Definition: DisplayObject.cpp:567
void disableScripts()
Call this method for disabling run of actions.
Definition: movie_root.cpp:180
void log_aserror(StringType msg, Args... args)
Definition: log.h:331
int timeToNextFrame() const
Return the number of milliseconds available before it's time to advance the timeline again.
Definition: movie_root.cpp:990
std::uint8_t m_a
Definition: RGBA.h:113
@ QUALITY_HIGH
Definition: GnashEnums.h:38
void clear_invalidated()
Definition: DisplayObject.h:720
DisplayObject * parent() const
Return the parent of this DisplayObject, or NULL if the DisplayObject has no parent.
Definition: DisplayObject.h:252
bool getShowMenuState() const
Definition: movie_root.cpp:1269
void addLiveChar(MovieClip *ch)
Register a newly born advanceable DisplayObject to the list of DisplayObjects to be advanced on next ...
Definition: movie_root.h:580
An ActionScript limit exception.
Definition: GnashException.h:136
@ CLASS_SELECTION
Definition: namedStrings.h:235
size_t get_bytes_total() const
Definition: MovieClip.h:183
@ PROP_ON_DATA
Definition: namedStrings.h:150
@ MOUSE_DOWN
Definition: event_id.h:76
Sound mixer.
Definition: sound_handler.h:88
std::string url
Definition: gnash.cpp:59
const DisplayObject * getEntityUnderPointer() const
Return the topmost non-dragging entity under the pointer.
Definition: movie_root.cpp:1155
@ KEY_DOWN
Definition: event_id.h:79
std::list< LoadCallback > LoadCallbacks
Definition: movie_root.h:168
as_object * getObject(const DisplayObject *d)
Return the as_object associated with a DisplayObject if it exists.
Definition: DisplayObject.h:1160
@ f
Definition: GnashKey.h:152
TextEncoding
Definition: utf8.h:114
unsigned long int getTime() const
Get the number of milliseconds since VM was started.
Definition: VM.cpp:155
@ UPDATE_STAGE
Definition: HostInterface.h:110
@ STAGE_ALIGN_B
Definition: movie_root.h:476
pixel_iterator< T > end(GnashImage &im)
Definition: ImageIterators.h:198
void setHostFD(int fd)
Definition: movie_root.h:686
static RcInitFile & getDefaultInstance()
Return the default instance of RC file.
Definition: rc.cpp:61
An instance of a DefineEditTextTag.
Definition: TextField.h:57
void markReachableResources() const
Mark reachable resources (for the GC)
Definition: ExecutableCode.h:47
This class represents the 'Stage' and top-level movie.
Definition: movie_root.h:151
std::string getStageAlignMode() const
Definition: movie_root.cpp:1291
virtual bool set_member(const ObjectURI &uri, const as_value &val, bool ifFound=false)
Set a member value.
Definition: as_object.cpp:583
Built-in forms of communication with the host application.
Definition: HostInterface.h:86
void loadMovie(const std::string &url, const std::string &target, const std::string &data, MovieClip::VariablesMethod method, as_object *handler=nullptr)
Queue a request for loading a movie.
Definition: movie_root.h:638
@ RESIZE_STAGE
Definition: HostInterface.h:104
uri
Definition: test.py:12
void stopStream(int id)
Notify the stage that a sound stream has stopped.
Definition: movie_root.cpp:273
@ c
Definition: GnashKey.h:149
void setQuality(Quality q)
Definition: Renderer.h:211
@ PRIORITY_INIT
Init actions, Init event handlers.
Definition: movie_root.h:535
@ STAGE_V_ALIGN_B
Definition: movie_root.h:468
void flushHigherPriorityActionQueues()
Definition: movie_root.cpp:1428
Definition: movie_root.h:154
virtual size_t get_width_pixels() const =0
Frame width in pixels.
@ EXTERNALINTERFACE_SETZOOMRECT
Definition: HostInterface.h:179
void stop_drag()
Definition: movie_root.h:307
@ SCALEMODE_EXACTFIT
Definition: movie_root.h:453
virtual void setReachable()
Mark any other reachable resources, and finally mark our owner.
Definition: Relay.cpp:36
#define DSOEXPORT
Definition: dsodefs.h:55
void keyInput(key::code k)
Handle user input from a key press.
Definition: TextField.cpp:527
const Keys & unreleasedKeys() const
Definition: movie_root.h:666
void foreachSecond(T begin, T end, U op)
Call a functor on the second element of each element in a range.
Definition: GnashAlgorithm.h:73
ObjectURI getURI(const VM &vm, const std::string &str, bool lowerCaseHint=false)
Definition: VM.h:290
@ CLASS_MOUSE
Definition: namedStrings.h:226
std::map< std::string, as_object * > ExternalCallbackMethods
Definition: movie_root.h:790
std::int32_t y
The y coordinate.
Definition: Point2d.h:46
std::pair< StageHorizontalAlign, StageVerticalAlign > StageAlign
Definition: movie_root.h:503
std::string callExternalCallback(const std::string &name, const std::vector< as_value > &args)
Definition: movie_root.cpp:1921
Quality
Definition: GnashEnums.h:35
DisplayObject is the base class for all DisplayList objects.
Definition: DisplayObject.h:169
sound::sound_handler * soundHandler() const
Get a pointer to a sound::sound_handler set by a hosting application.
Definition: RunResources.h:96
std::array< boost::ptr_deque< ExecutableCode >, PRIORITY_SIZE > ActionQueue
A number of queues of code to execute.
Definition: movie_root.h:550
void advanceMovie()
Entry point for movie advancement.
Definition: movie_root.cpp:960
A code segment.
Definition: action_buffer.h:50
ExternalCallbackMethods _externalCallbackMethods
Definition: movie_root.h:792
DisplayState getStageDisplayState() const
Returns the Stage object's align mode.
Definition: movie_root.h:527
bool unload()
Unload this instance from the stage.
Definition: DisplayObject.cpp:448
Quality getQuality() const
Get the current display quality.
Definition: movie_root.h:490
@ EXTERNALINTERFACE_REWIND
Definition: HostInterface.h:178
void setQuality(Quality q)
Set the current display quality of the entire SWF.
Definition: movie_root.cpp:1164
A system-clock based virtual clock.
Definition: SystemClock.h:37
virtual as_environment & get_environment()
Return a reference to the variable scope of this DisplayObject.
Definition: MovieClip.h:509
DSOEXPORT void add_invalidated_bounds(InvalidatedRanges &ranges, bool force)
Definition: movie_root.cpp:1358
static DSOEXPORT std::unique_ptr< invoke_t > ExternalEventCheck(int fd)
Definition: ExternalInterface.cpp:142
Uniform Resource Locator.
Definition: URL.h:35
virtual boost::any call(const Message &e)=0
Pass a message to the hosting application with an optional return.
LoadCallback(std::unique_ptr< IOChannel > s, as_object *o)
Definition: movie_root.h:156
virtual float get_frame_rate() const =0
@ o
Definition: GnashKey.h:161
const SWFMatrix & getMatrix(const DisplayObject &o)
Get local transform SWFMatrix for this DisplayObject.
Definition: DisplayObject.h:1119
bool testInvariant() const
Definition: movie_root.cpp:2527
@ PROP_ON_SET_FOCUS
Definition: namedStrings.h:177
ScaleMode
The possibile values of Stage.scaleMode.
Definition: movie_root.h:450
void setControlFD(int fd)
Definition: movie_root.h:693
void log_unimpl(StringType msg, Args... args)
Definition: log.h:289
void removeQueuedConstructor(MovieClip *target)
Removes a queued constructor from the execution queue.
Definition: movie_root.cpp:1489
A URI for describing as_objects.
Definition: ObjectURI.h:45
@ KEY_UP
Definition: event_id.h:80
MovieClip * getLevel(unsigned int num) const
Return the movie at the given level (0 if unloaded level).
Definition: movie_root.cpp:508
@ DISPLAYSTATE_NORMAL
Definition: movie_root.h:445
std::int32_t x
Definition: BitmapData_as.cpp:434
bool isReferenceable(const DisplayObject &d)
Returns true if the DisplayObject is referenceable in ActionScript.
Definition: DisplayObject.h:1149
StageHorizontalAlign
The possible horizonal positions of the Stage.
Definition: movie_root.h:458
const RunResources & runResources() const
Definition: movie_root.h:788
@ MOUSE_MOVE
Definition: event_id.h:78
std::map< std::string, std::string > MovieVariables
Definition: MovieClip.h:93
@ CLASS_KEY
Definition: namedStrings.h:220
const std::string & functionName() const
Definition: event_id.cpp:36
@ b
Definition: GnashKey.h:148
SimpleBuffer data
Definition: LocalConnection_as.cpp:151
SafeStack< as_value > & getStack()
Accessor for the VM's stack.
Definition: VM.h:88
@ e
Definition: GnashKey.h:151
@ KEY_PRESS
Definition: event_id.h:69
as_function * getRegisteredClass(const SWF::DefinitionTag *sprite) const
Get the actionscript class for constructing a MovieClip.
Definition: movie_root.cpp:286
@ QUERY
Definition: HostInterface.h:172
virtual size_t get_height_pixels() const =0
Frame height in pixels.
void addAdvanceCallback(ActiveRelay *obj)
Definition: movie_root.cpp:1458
std::int32_t get_y_min() const
Get the y coordinate of the left-up corner.
Definition: SWFRect.h:129
void clear()
Clean up the font library.
Definition: fontlib.cpp:36
void setWorld()
Resets to one range with world flags.
Definition: snappingrange.h:303
static DSOEXPORT std::string readBrowser(int fd)
Definition: ExternalInterface.cpp:336
A simple buffer of bytes.
Definition: SimpleBuffer.h:38
bool visible() const
Definition: DisplayObject.h:623
int getScriptsTimeout() const
Definition: rc.h:349
ActionScript Function, either builtin or SWF-defined.
Definition: as_function.h:63
void markReachableResources() const
Mark all reachable resources (for GC)
Definition: Timers.cpp:124
void setReachable() const
Mark this resource as being reachable.
Definition: GC.h:92
bool scriptsDisabled() const
Return true if scripts execution is disabled.
Definition: movie_root.h:607
key::code lastKeyEvent() const
Definition: movie_root.h:662
Return a pointer to a type.
Definition: GnashAlgorithm.h:32
DisplayObject * getDraggingCharacter() const
Return the DisplayObject currently being dragged, if any.
Definition: movie_root.cpp:1149
movie_root(VirtualClock &clock, const RunResources &runResources)
Default constructor.
Definition: movie_root.cpp:135