Gnash  0.8.11dev
Public Member Functions | List of all members
gnash::StaticText Class Reference

Static text fields, SWF-defined with read-only text. More...

#include <StaticText.h>

Inheritance diagram for gnash::StaticText:
gnash::DisplayObject gnash::GcResource

Public Member Functions

 StaticText (movie_root &mr, as_object *object, const SWF::DefineTextTag *def, DisplayObject *parent)
 
virtual StaticTextgetStaticText (std::vector< const SWF::TextRecord *> &to, size_t &numChars)
 Return a pointer to this if our definition contains any static text. More...
 
virtual void display (Renderer &renderer, const Transform &xform)
 Render the DisplayObject. More...
 
void setSelected (size_t pos, bool selected)
 
const boost::dynamic_bitset & getSelected () const
 Return a bitset showing which DisplayObjects (by index) are selected. More...
 
void setSelectionColor (std::uint32_t color)
 
virtual SWFRect getBounds () const
 
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...
 
const rgbaselectionColor () const
 
- Public Member Functions inherited from gnash::DisplayObject
 DisplayObject (movie_root &mr, as_object *object, DisplayObject *parent)
 Construct a DisplayObject. More...
 
virtual ~DisplayObject ()
 
virtual as_environmentget_environment ()
 Return a reference to the variable scope of this DisplayObject. More...
 
virtual void visitNonProperties (KeyVisitor &) const
 Enumerate any non-proper properties. More...
 
DisplayObjectparent () const
 Return the parent of this DisplayObject, or NULL if the DisplayObject has no parent. More...
 
void set_parent (DisplayObject *parent)
 Set the parent of this DisplayObject. More...
 
virtual MovieClipto_movie ()
 
int get_depth () const
 
void set_depth (int d)
 
int getVolume () const
 Get sound volume for this DisplayObject. More...
 
void setVolume (int vol)
 Set sound volume for this DisplayObject. More...
 
int getWorldVolume () const
 Get concatenated sound volume for this DisplayObject. More...
 
virtual int getDefinitionVersion () const
 DisplayObjects can return the version of the SWF they were parsed from. More...
 
const Transformtransform () 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
 
DisplayObjectgetMask () 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 ObjectURIget_name () const
 
std::unique_ptr< ExecutableCodeget_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...
 
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 Movieget_root () const
 Return the relative root of this DisplayObject. More...
 
virtual MovieClipgetAsRoot ()
 Return the _root ActionScript property of this DisplayObject. More...
 
virtual as_objectpathElement (const ObjectURI &uri)
 
bool get_accept_anim_moves () const
 Return true if PlaceObjects tag are allowed to move this DisplayObject. More...
 
bool isDynamic () const
 Was this DisplayObject dynamically created ? More...
 
void setDynamic ()
 Mark this DisplayObject as dynamically created. More...
 
void transformedByScript ()
 Call this function when the sprite has been transformed due to ActionScript code. More...
 
void set_visible (bool visible)
 Set whether this DisplayObject should be rendered. More...
 
bool visible () const
 
bool hasEventHandler (const event_id &id) const
 Return true if an handler for the given event is defined. More...
 
virtual InteractiveObjecttopmostMouseEntity (std::int32_t, std::int32_t)
 DisplayObjects are not a mouse entity by default. More...
 
virtual const DisplayObjectfindDropTarget (std::int32_t x, std::int32_t y, DisplayObject *dragging) const
 Point coordinates in global twips. More...
 
bool invalidated () const
 Return whether this DisplayObject has been invalidated or not. More...
 
bool childInvalidated () const
 Return whether this DisplayObject has and invalidated child or not. More...
 
virtual void update ()
 Notify a change in the DisplayObject's appearance. More...
 
void set_invalidated ()
 This function marks the DisplayObject as being modified in aspect and keeps track of current invalidated bounds the first time it's called after each call to clear_invalidated(). More...
 
void set_invalidated (const char *debug_file, int debug_line)
 
void extend_invalidated_bounds (const InvalidatedRanges &ranges)
 
void set_child_invalidated ()
 
void clear_invalidated ()
 
virtual void add_invalidated_bounds (InvalidatedRanges &ranges, bool force)
 Add the DisplayObject's invalidated bounds to the given ranges list. More...
 
virtual void omit_display ()
 
virtual void construct (as_object *=nullptr)
 Callback invoked whenever a DisplayObject is placed on stage. More...
 
bool unload ()
 Unload this instance from the stage. More...
 
virtual void getLoadedMovie (Movie *newMovie)
 Accept a loaded Movie. More...
 
bool unloaded () const
 Return true if this DisplayObject was unloaded from the stage. More...
 
virtual void destroy ()
 Mark this DisplayObject as destroyed. More...
 
bool isDestroyed () const
 Return true if this DisplayObject was destroyed. More...
 
bool boundsInClippingArea (Renderer &renderer) const
 
std::string getTargetPath () const
 Return full path to this object, in slash notation. More...
 
const std::string & getOrigTarget () const
 
std::string DSOEXPORT getTarget () const
 Return full path to this object, in dot notation. More...
 
virtual bool isSelectableTextField () const
 Return true if this DisplayObject is a selectable TextField. More...
 
bool DSOEXPORT allowHandCursor () const
 Return true if this DisplayObject allows turning the cursor into an hand shape when it happens to be the one receiving mouse events. More...
 
ObjectURI getNextUnnamedInstanceName ()
 Used to assign a name to unnamed instances. More...
 
BlendMode getBlendMode () const
 
void setBlendMode (BlendMode bm)
 
virtual bool handleFocus ()
 Set the current focus to this DisplayObject. More...
 
virtual void killFocus ()
 Some DisplayObjects require actions on losing focus. More...
 
double rotation () const
 
double scaleX () const
 
double scaleY () const
 
as_objectobject () const
 
virtual void markReachableResources () const
 Mark all reachable resources. More...
 
virtual void markOwnResources () const
 Called by markReachableResources() More...
 
boost::tribool focusRect () const
 
void focusRect (boost::tribool focus)
 
- Public Member Functions inherited from gnash::GcResource
 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...
 

Additional Inherited Members

- Public Types inherited from gnash::DisplayObject
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, BufferListEvents
 
- Static Public Member Functions inherited from gnash::DisplayObject
static as_value blendMode (const fn_call &fn)
 Getter-setter for blendMode. More...
 
- Static Public Attributes inherited from gnash::DisplayObject
static const int lowerAccessibleBound = -16384
 See also http://www.kirupa.com/developer/actionscript/depths2.htm. More...
 
static const int upperAccessibleBound = 2130690044
 
static const int staticDepthOffset = lowerAccessibleBound
 
static const int removedDepthOffset = -32769
 
static const int noClipDepthValue = -1000000
 
- Protected Member Functions inherited from gnash::DisplayObject
virtual bool unloadChildren ()
 
movie_rootstage () const
 Get the movie_root to which this DisplayObject belongs. More...
 
void saveOriginalTarget ()
 
const Eventsget_event_handlers () const
 
void set_event_handlers (const Events &copyfrom)
 
as_objectgetPathElementSeparator (string_table::key key)
 look for '.', 'this', '..', '_parent', '_level0' and '_root' More...
 
- Protected Member Functions inherited from gnash::GcResource
virtual ~GcResource ()
 Delete this resource. More...
 
- Protected Attributes inherited from gnash::DisplayObject
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...
 

Detailed Description

Static text fields, SWF-defined with read-only text.

StaticText objects hold mutable selection and color information.

Constructor & Destructor Documentation

§ StaticText()

gnash::StaticText::StaticText ( movie_root mr,
as_object object,
const SWF::DefineTextTag def,
DisplayObject parent 
)
inline

Member Function Documentation

§ display()

void gnash::StaticText::display ( Renderer renderer,
const Transform xform 
)
virtual

Render the DisplayObject.

All DisplayObjects must have a display() function.

Implements gnash::DisplayObject.

References gnash::DisplayObject::clear_invalidated(), and gnash::DisplayObject::transform().

§ getBounds()

virtual SWFRect gnash::StaticText::getBounds ( ) const
inlinevirtual

Implements gnash::DisplayObject.

References x, and y.

§ getSelected()

const boost::dynamic_bitset& gnash::StaticText::getSelected ( ) const
inline

Return a bitset showing which DisplayObjects (by index) are selected.

Note: mutable information is meaningless until the StaticText is queried with getStaticText(). This is because under normal circumstances there is no need for it. Note also: the size() member of boost::dynamic_bitset returns 0 before getStaticText() is called; afterwards it is equivalent to the number of DisplayObjects in the StaticText's definition.

References color.

§ getStaticText()

StaticText * gnash::StaticText::getStaticText ( std::vector< const SWF::TextRecord *> &  to,
size_t &  numChars 
)
virtual

Return a pointer to this if our definition contains any static text.

This is non-const because a TextSnapshot needs to add selection and color information to this StaticText. It also resets selection.

Parameters
toA vector of pointers to TextRecords containing text.
numCharsThe total number of DisplayObjects in all TextRecords is written to this variable. Note: This function always removes any existing selection and resizes the bitset to the number of DisplayObjects in all TextRecords.

Reimplemented from gnash::DisplayObject.

§ pointInShape()

bool gnash::StaticText::pointInShape ( std::int32_t  x,
std::int32_t  y 
) const
virtual

Return true if the given point falls in this DisplayObject's shape.

Parameters
xPoint x coordinate in world space
yPoint y coordinate in world space
Returns
Whether (x, y) is within the DisplayObject's bounds.

Implements gnash::DisplayObject.

References _, LOG_ONCE, gnash::log_unimpl(), and gnash::DisplayObject::pointInBounds().

§ selectionColor()

const rgba& gnash::StaticText::selectionColor ( ) const
inline

§ setSelected()

void gnash::StaticText::setSelected ( size_t  pos,
bool  selected 
)
inline

§ setSelectionColor()

void gnash::StaticText::setSelectionColor ( std::uint32_t  color)

The documentation for this class was generated from the following files: