Go to the documentation of this file.
23 #ifndef GNASH_BUTTON_H
24 #define GNASH_BUTTON_H
26 #include <boost/intrusive_ptr.hpp>
59 OVER_DOWN = FLAG_OVER | FLAG_DOWN,
84 virtual bool trackAsMenu();
92 void set_current_state(MouseState new_state);
101 virtual void mouseEvent(
const event_id& event);
104 virtual bool handleFocus();
108 virtual SWFRect getBounds()
const;
111 bool pointInShape(std::int32_t
x, std::int32_t
y)
const;
124 virtual void construct(
as_object* init =
nullptr);
128 virtual InfoTree::iterator getMovieInfo(InfoTree& tr,
129 InfoTree::iterator it);
135 virtual bool unloadChildren();
144 void markOwnResources()
const;
155 void getActiveCharacters(DisplayObjects& list,
bool includeUnloaded=
false);
163 void getActiveCharacters(ConstDisplayObjects& list)
const;
174 void get_active_records(ActiveRecords& list, MouseState state);
177 virtual int getDefinitionVersion()
const;
179 MouseState _mouseState;
181 const boost::intrusive_ptr<const SWF::DefineButtonTag> _def;
183 DisplayObjects _stateCharacters;
185 DisplayObjects _hitCharacters;
199 #endif // GNASH_BUTTON_H
int loopCount
Number of loops started by an execution of this tag.
Definition: SoundInfoRecord.h:66
void set_depth(int d)
Definition: DisplayObject.h:270
std::string name
Definition: LocalConnection_as.cpp:149
bool toBool(const as_value &v, const VM &vm)
Convert an as_value to boolean type.
Definition: VM.cpp:445
@ d
Definition: GnashKey.h:150
The base class for all ActionScript objects.
Definition: as_object.h:162
std::unique_ptr< ExecutableCode > get_event_handler(const event_id &id) const
Get the built-in function handlers code for the given event.
Definition: DisplayObject.cpp:434
Render a dynamic mask for a specified DisplayObject.
Definition: DisplayObject.h:969
static const int staticDepthOffset
Definition: DisplayObject.h:205
void log_debug(StringType msg, Args... args)
Definition: log.h:301
@ MOUSE_UP
Definition: event_id.h:77
std::int32_t y
Definition: BitmapData_as.cpp:435
@ i
Definition: GnashKey.h:155
#define LOG_ONCE(x)
Definition: log.h:49
#define _(String)
Definition: log.h:44
const ObjectURI & functionURI() const
Definition: event_id.cpp:68
bool isDestroyed() const
Return true if this DisplayObject was destroyed.
Definition: DisplayObject.h:807
A class to identify 'static' SWF events (system events).
Definition: event_id.h:53
void init_member(const std::string &name, const as_value &val, int flags=DefaultFlags)
Initialize a member value by string.
Definition: as_object.cpp:669
The AVM1 virtual machine.
Definition: VM.h:72
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:41
unsigned int inPoint
In point, 44100 for one second.
Definition: SoundInfoRecord.h:79
EventCode id() const
Return the identifier for this event type.
Definition: event_id.h:141
@ ROLL_OVER
Definition: event_id.h:65
const as_environment & _env
Definition: Array_as.cpp:682
SWFMatrix getWorldMatrix(const DisplayObject &d, bool includeRoot=true)
Get concatenated SWFMatrix (all ancestor transforms and our SWFMatrix)
Definition: DisplayObject.h:1131
virtual as_environment & get_environment()
Return a reference to the variable scope of this DisplayObject.
Definition: DisplayObject.h:233
@ PRIORITY_DOACTION
Frame actions, load handlers, unload handlers.
Definition: movie_root.h:539
DisplayObject(movie_root &mr, as_object *object, DisplayObject *parent)
Construct a DisplayObject.
Definition: DisplayObject.cpp:86
void registerButton(Button *listener)
Push a new DisplayObject listener for key events.
Definition: movie_root.cpp:1992
Base class for render handlers.
Definition: Renderer.h:189
@ m
Definition: GnashKey.h:159
InvalidatedRanges m_old_invalidated_ranges
Bounds of this DisplayObject instance before first invalidation since last call to clear_invalidated(...
Definition: DisplayObject.h:1029
@ s
Definition: GnashKey.h:165
void saveOriginalTarget()
Definition: DisplayObject.h:991
const Transform & transform() const
Definition: DisplayObject.h:292
Global_as & getGlobal(const as_environment &env)
Definition: as_environment.cpp:651
void pushAction(std::unique_ptr< ExecutableCode > code, size_t lvl)
Push an executable code to the ActionQueue.
Definition: movie_root.cpp:1496
void registerButtonNative(as_object &global)
Definition: Button.cpp:923
VM & getVM(const as_environment &env)
Definition: as_environment.h:222
#define UNUSED(x)
Definition: utility.h:113
void log_error(StringType msg, Args... args)
Definition: log.h:283
virtual void construct(as_object *=nullptr)
Callback invoked whenever a DisplayObject is placed on stage.
Definition: DisplayObject.h:763
as_object * createObject(const Global_as &gl)
Definition: Global_as.cpp:303
The base class for interactive objects.
Definition: InteractiveObject.h:45
Rectangle class, see swf defined rectangle record.
Definition: SWFRect.h:45
static const int DefaultFlags
The most common flags for built-in properties.
Definition: as_object.h:192
Definition: SoundInfoRecord.h:36
@ DRAG_OVER
Definition: event_id.h:67
@ ROLL_OUT
Definition: event_id.h:66
void for_each(C &container, R(T::*pmf)(const A &), const A &arg)
Definition: Renderer_ogl.cpp:690
@ RELEASE
Definition: event_id.h:63
std::int32_t x
The x coordinate.
Definition: Point2d.h:43
int get_depth() const
Definition: DisplayObject.h:268
as_object * createClass(Global_as::ASFunction ctor, as_object *prototype)
Create an ActionScript class.
Definition: Global_as.cpp:180
const RunResources & getRunResources(const as_object &o)
Get the RunResources from an as_object.
Definition: as_object.cpp:1142
void removeButton(Button *listener)
Remove a DisplayObject listener for key events.
Definition: movie_root.cpp:1986
#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
@ PROP_ENABLED
Definition: namedStrings.h:74
as_value emptyFunction(const fn_call &)
Definition: Global_as.h:256
virtual bool get_member(const ObjectURI &uri, as_value *val)
Get a property by name if it exists.
Definition: as_object.cpp:378
void registerNative(as_c_function_ptr fun, unsigned int x, unsigned int y)
Definition: VM.cpp:268
@ p
Definition: GnashKey.h:162
@ _1
Definition: GnashKey.h:95
void set_invalidated()
This function marks the DisplayObject as being modified in aspect and keeps track of current invalida...
Definition: DisplayObject.cpp:183
int m_sound_handler_id
Definition: sound_definition.h:65
@ PRESS
Definition: event_id.h:62
Definition: SWFMatrix.h:54
@ onlySWF8Up
Only visible by VM initialized for version 8 or higher.
Definition: PropFlags.h:54
ActionScript value type.
Definition: as_value.h:95
2D Point class
Definition: Point2d.h:39
bool unloaded() const
Return true if this DisplayObject was unloaded from the stage.
Definition: DisplayObject.h:785
unsigned int outPoint
Out point, 44100 for one second.
Definition: SoundInfoRecord.h:87
sound::SoundEnvelopes envelopes
Sound effects (envelopes) for this start of the sound.
Definition: SoundInfoRecord.h:93
void log_aserror(StringType msg, Args... args)
Definition: log.h:331
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
void add(const RangeType &range)
Add a Range to the set, merging when possible and appropriate.
Definition: snappingrange.h:250
@ MOUSE_DOWN
Definition: event_id.h:76
DSOTEXPORT std::pair< bool, bool > delProperty(const ObjectURI &uri)
Delete a property of this object, unless protected from deletion.
Definition: as_object.cpp:313
Sound mixer.
Definition: sound_handler.h:88
void button_class_init(as_object &global, const ObjectURI &uri)
Initialize the global Button class.
Definition: Button.cpp:910
as_object * getObject(const DisplayObject *d)
Return the as_object associated with a DisplayObject if it exists.
Definition: DisplayObject.h:1160
This class represents the 'Stage' and top-level movie.
Definition: movie_root.h:151
#define DSOTEXPORT
Definition: dsodefs.h:63
The Global object ultimately contains all objects in an ActionScript run.
Definition: Global_as.h:50
virtual void add_invalidated_bounds(InvalidatedRanges &ranges, bool force)
Add the DisplayObject's invalidated bounds to the given ranges list.
Definition: DisplayObject.cpp:226
uri
Definition: test.py:12
std::vector< SoundEnvelope > SoundEnvelopes
A vector of SoundEnvelope objects.
Definition: SoundEnvelope.h:60
@ c
Definition: GnashKey.h:149
bool stopPlayback
If true this tag actually stops the sound rather then playing it.
Definition: SoundInfoRecord.h:73
bool noMultiple
Definition: SoundInfoRecord.h:53
static const int removedDepthOffset
Definition: DisplayObject.h:222
virtual SWFRect getBounds() const =0
virtual bool pointInShape(std::int32_t x, std::int32_t y) const =0
Return true if the given point falls in this DisplayObject's shape.
ObjectURI getURI(const VM &vm, const std::string &str, bool lowerCaseHint=false)
Definition: VM.h:290
std::int32_t y
The y coordinate.
Definition: Point2d.h:46
sound::sound_handler * soundHandler() const
Get a pointer to a sound::sound_handler set by a hosting application.
Definition: RunResources.h:96
DisplayObject is the base class for all DisplayList objects.
Definition: DisplayObject.h:169
virtual void destroy()
Mark this DisplayObject as destroyed.
Definition: DisplayObject.cpp:677
bool unload()
Unload this instance from the stage.
Definition: DisplayObject.cpp:448
void sendEvent(as_object &o, const as_environment &env, const ObjectURI &name)
Send a system event.
Definition: as_object.cpp:1099
@ RELEASE_OUTSIDE
Definition: event_id.h:64
virtual InteractiveObject * topmostMouseEntity(std::int32_t, std::int32_t)
DisplayObjects are not a mouse entity by default.
Definition: DisplayObject.h:637
@ o
Definition: GnashKey.h:161
const SWFMatrix & getMatrix(const DisplayObject &o)
Get local transform SWFMatrix for this DisplayObject.
Definition: DisplayObject.h:1119
@ SWF
Definition: GnashKey.h:331
void log_unimpl(StringType msg, Args... args)
Definition: log.h:289
A URI for describing as_objects.
Definition: ObjectURI.h:45
bool invalidated() const
Return whether this DisplayObject has been invalidated or not.
Definition: DisplayObject.h:657
std::int32_t x
Definition: BitmapData_as.cpp:434
@ b
Definition: GnashKey.h:148
DSOEXPORT void expand_to_transformed_rect(const SWFMatrix &m, const SWFRect &r)
Definition: SWFRect.cpp:74
@ e
Definition: GnashKey.h:151
@ KEY_PRESS
Definition: event_id.h:69
movie_root & stage() const
Get the movie_root to which this DisplayObject belongs.
Definition: DisplayObject.h:981
bool visible() const
Definition: DisplayObject.h:623
@ DRAG_OUT
Definition: event_id.h:68
std::ostream & operator<<(std::ostream &o, const URL &u)
Definition: URL.cpp:447
void setReachable() const
Mark this resource as being reachable.
Definition: GC.h:92