Gnash  0.8.11dev
Public Types | Public Member Functions | Static Public Member Functions | List of all members
gnash::TextField Class Reference

An instance of a DefineEditTextTag. More...

#include <TextField.h>

Inheritance diagram for gnash::TextField:
gnash::InteractiveObject gnash::DisplayObject gnash::GcResource

Public Types

enum  TextAlignment { ALIGN_LEFT = 0, ALIGN_RIGHT, ALIGN_CENTER, ALIGN_JUSTIFY }
 Text alignment values. More...
 
enum  TextFormatDisplay { TEXTFORMAT_BLOCK = 0, TEXTFORMAT_INLINE = 1 }
 Text format display values. More...
 
enum  AutoSize { AUTOSIZE_NONE, AUTOSIZE_LEFT, AUTOSIZE_CENTER, AUTOSIZE_RIGHT }
 Possible autoSize values. More...
 
enum  TypeValue { typeInvalid, typeDynamic, typeInput }
 Possible type values. More...
 
typedef std::vector< size_t > LineStarts
 
- 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
 

Public Member Functions

 TextField (as_object *object, DisplayObject *parent, const SWF::DefineEditTextTag &def)
 Constructs a TextField as specified in a DefineEditText tag. More...
 
 TextField (as_object *object, DisplayObject *parent, SWFRect bounds)
 Constructs a TextField with default values and the specified bounds. More...
 
 ~TextField ()
 
bool mouseEnabled () const
 Returns true for now, TextField is always "Mouse-Enabled". More...
 
InteractiveObjecttopmostMouseEntity (std::int32_t x, std::int32_t y)
 Returns a pointer to the topmost InteractiveObject at (x,y) More...
 
virtual int getDefinitionVersion () const
 Return the version of the SWF this was parsed from. More...
 
void mouseEvent (const event_id &id)
 This function is called as a user-input handler. More...
 
void keyInput (key::code k)
 Handle user input from a key press. More...
 
const std::string & getVariableName () const
 
void set_variable_name (const std::string &newname)
 
void updateText (const std::string &s)
 Set our text to the given string by effect of an update of a. More...
 
std::string get_text_value () const
 Return value of our text. More...
 
std::string get_htmltext_value () const
 Return value of our htmlText. More...
 
bool getTextDefined () const
 Return true if text is defined. More...
 
size_t getCaretIndex () const
 
const std::pair< size_t, size_t > & getSelection () const
 Get a std::pair of size_t with start/end of selection. More...
 
void replaceSelection (const std::string &replace)
 Replace the current selection with the new text. More...
 
void setSelection (int start, int end)
 Set the current selection. More...
 
virtual void setWidth (double width)
 Override of DisplayObject::setWidth. More...
 
virtual void setHeight (double height)
 Override of DisplayObject::setHeight. More...
 
virtual void display (Renderer &renderer, const Transform &xform)
 Draw the dynamic string. More...
 
void add_invalidated_bounds (InvalidatedRanges &ranges, bool force)
 Add the DisplayObject's invalidated bounds to the given ranges list. More...
 
virtual SWFRect getBounds () const
 Get bounding SWFRect of this TextField. More...
 
bool pointInShape (std::int32_t x, std::int32_t y) const
 Return true if the given point falls in this DisplayObject's shape. More...
 
bool getDrawBackground () const
 Return true if the 'background' should be drawn. More...
 
void setDrawBackground (bool draw)
 Specify whether to draw the background. More...
 
rgba getBackgroundColor () const
 Return color of the background. More...
 
void setBackgroundColor (const rgba &col)
 Set color of the background. More...
 
bool getDrawBorder () const
 Return true if this TextField should have its border visible. More...
 
void setDrawBorder (bool draw)
 Specify whether to draw the border. More...
 
rgba getBorderColor () const
 Return color of the border. More...
 
void setBorderColor (const rgba &col)
 Set color of the border. More...
 
const rgbagetTextColor () const
 Return color of the text. More...
 
void setTextColor (const rgba &col)
 Set color of the text. More...
 
bool getEmbedFonts () const
 Return true if this TextField should use embedded font glyphs, false if it should use device font glyphs. More...
 
std::int32_t maxChars () const
 Get the current maxChars setting of the TextField. More...
 
void maxChars (std::int32_t max)
 Set the current maxChars setting of the TextField. More...
 
bool multiline () const
 Get the current multiline setting of the TextField. More...
 
void multiline (bool b)
 Set the current multiline setting of the TextField. More...
 
bool password () const
 Get the current password setting of the TextField. More...
 
void password (bool b)
 Set the current password setting of the TextField. More...
 
void setEmbedFonts (bool use)
 Set whether this TextField should use embedded font glyphs, or use device font glyphs. More...
 
AutoSize getAutoSize () const
 Get autoSize value. More...
 
TextAlignment getTextAlignment ()
 Return text TextAlignment. More...
 
void setAutoSize (AutoSize val)
 Set autoSize value. More...
 
void setType (TypeValue val)
 Set type (input or dynamic) More...
 
TypeValue getType () const
 Get type (input, dynamic or invalid) More...
 
bool isReadOnly () const
 Return true if this TextField is read-only. More...
 
bool doWordWrap () const
 Return true if text should continue to next available line when hitting end of bounding box. More...
 
void setWordWrap (bool on)
 Set wordWrap parameter. More...
 
bool doHtml () const
 Return true if HTML markup in text should be rendered. More...
 
void setHtml (bool on)
 Set html parameter. More...
 
bool isSelectable () const
 Return true if the TextField text is selectable. More...
 
void setSelectable (bool v)
 Set 'selectable' parameter. More...
 
virtual bool isSelectableTextField () const
 Return true if the TextField text is selectable. More...
 
void removeTextField ()
 Remove this textfield from the stage. More...
 
boost::intrusive_ptr< const FontsetFont (boost::intrusive_ptr< const Font > newfont)
 Set our font, return previously set one. More...
 
const FontgetFont ()
 
std::uint16_t getFontHeight () const
 
void setFontHeight (std::uint16_t h)
 
std::uint16_t getLeftMargin () const
 
void setLeftMargin (std::uint16_t h)
 
std::uint16_t getRightMargin () const
 
void setRightMargin (std::uint16_t h)
 
std::uint16_t getIndent () const
 
void setIndent (std::uint16_t h)
 
std::uint16_t getBlockIndent () const
 
void setBlockIndent (std::uint16_t h)
 
TextAlignment getAlignment () const
 
void setAlignment (TextAlignment h)
 
std::int16_t getLeading () const
 
void setLeading (std::int16_t h)
 
bool getUnderlined () const
 
TextFormatDisplay getDisplay () const
 
bool getBullet () const
 
const std::vector< int > & getTabStops () const
 
bool isRestrict () const
 
const std::string & getRestrict () const
 
size_t getScroll () const
 
size_t getMaxScroll () const
 
size_t getHScroll () const
 
size_t getMaxHScroll () const
 
size_t getBottomScroll () const
 
void setUnderlined (bool v)
 
void setTabStops (const std::vector< int > &tabStops)
 
void setBullet (bool b)
 
void setURL (std::string url)
 
void setTarget (std::string target)
 
void setRestrict (const std::string &restrict)
 
void setDisplay (TextFormatDisplay display)
 
void setScroll (size_t scroll)
 
void setMaxScroll (size_t maxScroll)
 
void setHScroll (size_t hScroll)
 
void setMaxHScroll (size_t maxHScroll)
 
void setbottomScroll (size_t bottomScroll)
 
size_t cursorRecord ()
 Returns the number of the record that the cursor is in. More...
 
void setTextFormat (TextFormat_as &tf)
 
const SWFRectgetTextBoundingBox () const
 
void setTextValue (const std::wstring &wstr)
 Set our text to the given string. More...
 
- Public Member Functions inherited from gnash::InteractiveObject
 InteractiveObject (as_object *object, DisplayObject *parent)
 
virtual ~InteractiveObject ()
 
virtual bool trackAsMenu ()
 ActionScript property of Buttons and MovieClips altering mouse handling. More...
 
virtual StaticTextgetStaticText (std::vector< const SWF::TextRecord *> &, size_t &)
 Allow extraction of static text. More...
 
- 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...
 
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...
 
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 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 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...
 
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)
 
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...
 

Static Public Member Functions

static TypeValue parseTypeValue (const std::string &val)
 Parse type string value. More...
 
static const char * typeValueName (TypeValue val)
 Return type value as a string. More...
 
- Static Public Member Functions inherited from gnash::DisplayObject
static as_value blendMode (const fn_call &fn)
 Getter-setter for blendMode. More...
 

Additional Inherited Members

- 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

An instance of a DefineEditTextTag.

Member Typedef Documentation

§ LineStarts

typedef std::vector<size_t> gnash::TextField::LineStarts

Member Enumeration Documentation

§ AutoSize

Possible autoSize values.

Enumerator
AUTOSIZE_NONE 

Do not automatically resize TextField as text grow/shrink.

AUTOSIZE_LEFT 

Expand TextField, anchor the top-left side.

AUTOSIZE_CENTER 

Expand TextField, anchor the horizontal center.

AUTOSIZE_RIGHT 

Expand TextField, anchor the top-right side.

§ TextAlignment

Text alignment values.

Enumerator
ALIGN_LEFT 
ALIGN_RIGHT 
ALIGN_CENTER 
ALIGN_JUSTIFY 

§ TextFormatDisplay

Text format display values.

Enumerator
TEXTFORMAT_BLOCK 
TEXTFORMAT_INLINE 

§ TypeValue

Possible type values.

Enumerator
typeInvalid 

Invalid value.

typeDynamic 

Do not accept input, text is only changed by variable name or assigning to the .text member

typeInput 

Accept user input.

Constructor & Destructor Documentation

§ TextField() [1/2]

gnash::TextField::TextField ( as_object object,
DisplayObject parent,
const SWF::DefineEditTextTag def 
)

Constructs a TextField as specified in a DefineEditText tag.

§ TextField() [2/2]

gnash::TextField::TextField ( as_object object,
DisplayObject parent,
SWFRect  bounds 
)

Constructs a TextField with default values and the specified bounds.

Notably, the default textHeight is 12pt (240 twips).

Parameters
parentA pointer to the DisplayObject parent of this TextField
boundsA SWFRect specifying the bounds of this TextField

References gnash::key::f, gnash::fontlib::get_default_font(), and setFont().

§ ~TextField()

gnash::TextField::~TextField ( )

Member Function Documentation

§ add_invalidated_bounds()

void gnash::TextField::add_invalidated_bounds ( InvalidatedRanges ranges,
bool  force 
)
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.

Implements gnash::InteractiveObject.

References gnash::geometry::SnappingRanges2d< T >::add(), gnash::SWFRect::expand_to_rect(), getBounds(), gnash::SWFRect::getRange(), gnash::getWorldMatrix(), gnash::DisplayObject::invalidated(), gnash::DisplayObject::m_old_invalidated_ranges, and gnash::SWFMatrix::transform().

§ cursorRecord()

size_t gnash::TextField::cursorRecord ( )

Returns the number of the record that the cursor is in.

References gnash::key::i.

Referenced by removeTextField().

§ display()

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

§ doHtml()

bool gnash::TextField::doHtml ( ) const
inline

Return true if HTML markup in text should be rendered.

Referenced by gnash::registerTextFieldNative(), and setFont().

§ doWordWrap()

bool gnash::TextField::doWordWrap ( ) const
inline

Return true if text should continue to next available line when hitting end of bounding box.

Referenced by gnash::registerTextFieldNative(), and setFont().

§ get_htmltext_value()

std::string gnash::TextField::get_htmltext_value ( ) const

§ get_text_value()

std::string gnash::TextField::get_text_value ( ) const

§ getAlignment()

TextAlignment gnash::TextField::getAlignment ( ) const
inline

Referenced by getTextAlignment().

§ getAutoSize()

AutoSize gnash::TextField::getAutoSize ( ) const
inline

Get autoSize value.

Referenced by gnash::registerTextFieldNative(), and setFont().

§ getBackgroundColor()

rgba gnash::TextField::getBackgroundColor ( ) const

Return color of the background.

Referenced by display(), and gnash::registerTextFieldNative().

§ getBlockIndent()

std::uint16_t gnash::TextField::getBlockIndent ( ) const
inline

§ getBorderColor()

rgba gnash::TextField::getBorderColor ( ) const

Return color of the border.

Referenced by display(), and gnash::registerTextFieldNative().

§ getBottomScroll()

size_t gnash::TextField::getBottomScroll ( ) const
inline

References gnash::key::b, url, and test::v.

Referenced by gnash::registerTextFieldNative().

§ getBounds()

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

Get bounding SWFRect of this TextField.

Implements gnash::InteractiveObject.

Referenced by add_invalidated_bounds(), setHeight(), and setWidth().

§ getBullet()

bool gnash::TextField::getBullet ( ) const
inline

§ getCaretIndex()

size_t gnash::TextField::getCaretIndex ( ) const
inline

§ getDefinitionVersion()

int gnash::TextField::getDefinitionVersion ( ) const
virtual

§ getDisplay()

TextFormatDisplay gnash::TextField::getDisplay ( ) const
inline

§ getDrawBackground()

bool gnash::TextField::getDrawBackground ( ) const

Return true if the 'background' should be drawn.

Referenced by display(), and gnash::registerTextFieldNative().

§ getDrawBorder()

bool gnash::TextField::getDrawBorder ( ) const

Return true if this TextField should have its border visible.

Referenced by display(), and gnash::registerTextFieldNative().

§ getEmbedFonts()

bool gnash::TextField::getEmbedFonts ( ) const
inline

Return true if this TextField should use embedded font glyphs, false if it should use device font glyphs.

Referenced by display(), and gnash::registerTextFieldNative().

§ getFont()

const Font* gnash::TextField::getFont ( )
inline

§ getFontHeight()

std::uint16_t gnash::TextField::getFontHeight ( ) const
inline

§ getHScroll()

size_t gnash::TextField::getHScroll ( ) const
inline

§ getIndent()

std::uint16_t gnash::TextField::getIndent ( ) const
inline

§ getLeading()

std::int16_t gnash::TextField::getLeading ( ) const
inline

§ getLeftMargin()

std::uint16_t gnash::TextField::getLeftMargin ( ) const
inline

§ getMaxHScroll()

size_t gnash::TextField::getMaxHScroll ( ) const
inline

§ getMaxScroll()

size_t gnash::TextField::getMaxScroll ( ) const
inline

§ getRestrict()

const std::string& gnash::TextField::getRestrict ( ) const
inline

§ getRightMargin()

std::uint16_t gnash::TextField::getRightMargin ( ) const
inline

§ getScroll()

size_t gnash::TextField::getScroll ( ) const
inline

§ getSelection()

const std::pair<size_t, size_t>& gnash::TextField::getSelection ( ) const
inline

Get a std::pair of size_t with start/end of selection.

Both start and end should invariably be within the range of the text.

References gnash::image::end(), height, gnash::setHeight(), start, and width.

Referenced by gnash::registerSelectionNative().

§ getTabStops()

const std::vector<int>& gnash::TextField::getTabStops ( ) const
inline

Referenced by setFont().

§ getTextAlignment()

TextField::TextAlignment gnash::TextField::getTextAlignment ( )

§ getTextBoundingBox()

const SWFRect& gnash::TextField::getTextBoundingBox ( ) const
inline

§ getTextColor()

const rgba& gnash::TextField::getTextColor ( ) const
inline

Return color of the text.

Referenced by gnash::registerTextFieldNative(), and setFont().

§ getTextDefined()

bool gnash::TextField::getTextDefined ( ) const
inline

Return true if text is defined.

Referenced by gnash::MovieClip::getTextFieldVariables().

§ getType()

TypeValue gnash::TextField::getType ( ) const
inline

Get type (input, dynamic or invalid)

Referenced by gnash::registerTextFieldNative().

§ getUnderlined()

bool gnash::TextField::getUnderlined ( ) const
inline

§ getVariableName()

const std::string& gnash::TextField::getVariableName ( ) const
inline

References gnash::key::s.

Referenced by gnash::registerTextFieldNative().

§ isReadOnly()

bool gnash::TextField::isReadOnly ( ) const
inline

Return true if this TextField is read-only.

Referenced by display(), and keyInput().

§ isRestrict()

bool gnash::TextField::isRestrict ( ) const
inline

§ isSelectable()

bool gnash::TextField::isSelectable ( ) const
inline

Return true if the TextField text is selectable.

Referenced by gnash::registerTextFieldNative().

§ isSelectableTextField()

virtual bool gnash::TextField::isSelectableTextField ( ) const
inlinevirtual

Return true if the TextField text is selectable.

Reimplemented from gnash::DisplayObject.

§ keyInput()

void gnash::TextField::keyInput ( key::code  k)

§ maxChars() [1/2]

std::int32_t gnash::TextField::maxChars ( ) const
inline

Get the current maxChars setting of the TextField.

Referenced by keyInput(), and gnash::registerTextFieldNative().

§ maxChars() [2/2]

void gnash::TextField::maxChars ( std::int32_t  max)
inline

Set the current maxChars setting of the TextField.

Parameters
maxThe maximum number of characters that can be input by the user (Does not restrict Scripts)

§ mouseEnabled()

bool gnash::TextField::mouseEnabled ( ) const
inlinevirtual

Returns true for now, TextField is always "Mouse-Enabled".

Implements gnash::InteractiveObject.

References gnash::key::k, x, and y.

§ mouseEvent()

void gnash::TextField::mouseEvent ( const event_id id)
virtual

§ multiline() [1/2]

bool gnash::TextField::multiline ( ) const
inline

Get the current multiline setting of the TextField.

Referenced by keyInput(), and gnash::registerTextFieldNative().

§ multiline() [2/2]

void gnash::TextField::multiline ( bool  b)
inline

Set the current multiline setting of the TextField.

Parameters
bIf true "Enter" key will be recognized (Does not restrict Scripts)

References gnash::key::b.

§ parseTypeValue()

TextField::TypeValue gnash::TextField::parseTypeValue ( const std::string &  val)
static

Parse type string value.

Parameters
valType value as a string (one of input or dynamic)
Returns
an TypeValue identifier. typeInvalid if invalid.

References typeDynamic, typeInput, and typeInvalid.

Referenced by gnash::registerTextFieldNative().

§ password() [1/2]

bool gnash::TextField::password ( ) const
inline

Get the current password setting of the TextField.

Referenced by gnash::registerTextFieldNative(), and setFont().

§ password() [2/2]

void gnash::TextField::password ( bool  b)
inline

Set the current password setting of the TextField.

Parameters
bIf true characters in the TextField will be displayed as (*)

References gnash::key::b.

§ pointInShape()

bool gnash::TextField::pointInShape ( std::int32_t  x,
std::int32_t  y 
) const
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::getWorldMatrix(), gnash::SWFMatrix::invert(), gnash::SWFRect::point_test(), gnash::SWFMatrix::transform(), gnash::geometry::Point2d::x, and gnash::geometry::Point2d::y.

§ removeTextField()

void gnash::TextField::removeTextField ( )

§ replaceSelection()

void gnash::TextField::replaceSelection ( const std::string &  replace)

Replace the current selection with the new text.

Parameters
replaceString to replace the current selection

References gnash::utf8::decodeCanonicalString(), gnash::image::end(), gnash::getObject(), gnash::getSWFVersion(), and start.

Referenced by gnash::registerTextFieldNative().

§ set_variable_name()

void gnash::TextField::set_variable_name ( const std::string &  newname)

Set the name of a variable associated to this TextField's displayed text. Calling this function will override any previous setting for the variable name.

References gnash::log_debug(), and updateText().

Referenced by gnash::registerTextFieldNative().

§ setAlignment()

void gnash::TextField::setAlignment ( TextAlignment  h)

§ setAutoSize()

void gnash::TextField::setAutoSize ( AutoSize  val)

Set autoSize value.

Parameters
valThe AutoSize to use

References gnash::DisplayObject::set_invalidated().

Referenced by gnash::registerTextFieldNative().

§ setBackgroundColor()

void gnash::TextField::setBackgroundColor ( const rgba col)

Set color of the background.

Use setDrawBackground to actually use this value.

Parameters
colRGBA Object with color information. TextField background will be drawn in this color

References gnash::DisplayObject::set_invalidated().

Referenced by gnash::registerTextFieldNative().

§ setBlockIndent()

void gnash::TextField::setBlockIndent ( std::uint16_t  h)

§ setBorderColor()

void gnash::TextField::setBorderColor ( const rgba col)

Set color of the border.

Use setDrawBorder to actually use this value.

Parameters
colRGBA Object with color information. TextField border will be drawn in this color.

References gnash::DisplayObject::set_invalidated().

Referenced by gnash::registerTextFieldNative().

§ setbottomScroll()

void gnash::TextField::setbottomScroll ( size_t  bottomScroll)
inline

§ setBullet()

void gnash::TextField::setBullet ( bool  b)

References gnash::key::b.

Referenced by setTextFormat().

§ setDisplay()

void gnash::TextField::setDisplay ( TextFormatDisplay  display)

§ setDrawBackground()

void gnash::TextField::setDrawBackground ( bool  draw)

Specify whether to draw the background.

Parameters
drawIf true the background of this TextField will be drawn

References gnash::DisplayObject::set_invalidated().

Referenced by gnash::registerTextFieldNative().

§ setDrawBorder()

void gnash::TextField::setDrawBorder ( bool  draw)

Specify whether to draw the border.

Parameters
drawIf true the border of this TextField will be drawn

References gnash::DisplayObject::set_invalidated().

Referenced by gnash::registerTextFieldNative().

§ setEmbedFonts()

void gnash::TextField::setEmbedFonts ( bool  use)

Set whether this TextField should use embedded font glyphs, or use device font glyphs.

Parameters
use

References gnash::DisplayObject::set_invalidated().

Referenced by gnash::registerTextFieldNative().

§ setFont()

boost::intrusive_ptr< const Font > gnash::TextField::setFont ( boost::intrusive_ptr< const Font newfont)

Set our font, return previously set one.

Parameters
newfontWill be stored in an intrusive_ptr

References _, gnash::SWF::TextRecord::addGlyph(), gnash::SWF::TextRecord::GlyphEntry::advance, AUTOSIZE_CENTER, AUTOSIZE_NONE, AUTOSIZE_RIGHT, gnash::SWF::TextRecord::clearGlyphs(), color, gnash::SWF::TextRecord::color(), gnash::colorFromHexString(), data, doHtml(), doWordWrap(), gnash::key::e, gnash::SWFRect::expand_to_point(), gnash::Font::get_advance(), gnash::fontlib::get_font(), gnash::Font::get_glyph_index(), gnash::Font::get_kerning_adjustment(), gnash::SWFRect::get_x_max(), gnash::SWFRect::get_x_min(), getAutoSize(), getBlockIndent(), gnash::SWF::TextRecord::getFont(), getFontHeight(), getIndent(), getLeading(), getLeftMargin(), getRightMargin(), getTabStops(), gnash::DisplayObject::getTarget(), getTextAlignment(), getTextColor(), getUnderlined(), gnash::SWF::TextRecord::glyphs(), gnash::SWFRect::height(), gnash::key::i, IF_VERBOSE_ASCODING_ERRORS, IF_VERBOSE_MALFORMED_SWF, gnash::SWF::TextRecord::GlyphEntry::index, gnash::Font::isBold(), gnash::Font::isItalic(), gnash::log_aserror(), gnash::log_debug(), gnash::log_error(), LOG_ONCE, gnash::log_swferror(), gnash::log_unimpl(), gnash::key::m, gnash::Font::name(), PADDING_TWIPS, password(), gnash::pixelsToTwips(), gnash::key::s, gnash::DisplayObject::set_invalidated(), gnash::SWFRect::set_to_rect(), gnash::SWFMatrix::set_x_translation(), setBlockIndent(), gnash::SWF::TextRecord::setColor(), gnash::SWF::TextRecord::setFont(), setIndent(), setLeading(), setLeftMargin(), setRightMargin(), setTabStops(), gnash::SWF::TextRecord::setTarget(), gnash::SWF::TextRecord::setTextHeight(), gnash::SWF::TextRecord::setUnderline(), gnash::SWF::TextRecord::setURL(), gnash::SWF::TextRecord::setXOffset(), gnash::SWF::TextRecord::setYOffset(), TEXTFORMAT_BLOCK, gnash::SWF::TextRecord::textHeight(), gnash::SWFMatrix::transform(), gnash::SWF::TextRecord::underline(), gnash::SWFRect::width(), width, x, gnash::SWF::TextRecord::xOffset(), y, and gnash::SWF::TextRecord::yOffset().

Referenced by gnash::registerTextFieldNative(), and TextField().

§ setFontHeight()

void gnash::TextField::setFontHeight ( std::uint16_t  h)

§ setHeight()

void gnash::TextField::setHeight ( double  height)
virtual

§ setHScroll()

void gnash::TextField::setHScroll ( size_t  hScroll)
inline

§ setHtml()

void gnash::TextField::setHtml ( bool  on)
inline

Set html parameter.

Parameters
onIf true HTML tags in the text will be parsed and rendered

Referenced by keyInput(), and gnash::registerTextFieldNative().

§ setIndent()

void gnash::TextField::setIndent ( std::uint16_t  h)

§ setLeading()

void gnash::TextField::setLeading ( std::int16_t  h)

§ setLeftMargin()

void gnash::TextField::setLeftMargin ( std::uint16_t  h)

§ setMaxHScroll()

void gnash::TextField::setMaxHScroll ( size_t  maxHScroll)
inline

§ setMaxScroll()

void gnash::TextField::setMaxScroll ( size_t  maxScroll)
inline

§ setRestrict()

void gnash::TextField::setRestrict ( const std::string &  restrict)

§ setRightMargin()

void gnash::TextField::setRightMargin ( std::uint16_t  h)

§ setScroll()

void gnash::TextField::setScroll ( size_t  scroll)
inline

§ setSelectable()

void gnash::TextField::setSelectable ( bool  v)
inline

Set 'selectable' parameter.

Parameters
vIf true text in this TextField will be selectable

References test::v.

Referenced by gnash::registerTextFieldNative().

§ setSelection()

void gnash::TextField::setSelection ( int  start,
int  end 
)

Set the current selection.

Parameters
startThe index of the beginning of the selection.
endThe index of the end of the selection. If start is greater than end, the values are swapped, ensuring end is never less than start.

References gnash::image::end(), and start.

Referenced by getTextAlignment(), and gnash::registerSelectionNative().

§ setTabStops()

void gnash::TextField::setTabStops ( const std::vector< int > &  tabStops)

§ setTarget()

void gnash::TextField::setTarget ( std::string  target)

§ setTextColor()

void gnash::TextField::setTextColor ( const rgba col)

Set color of the text.

Parameters
colRGBA Object with color information. Text in this TextField will be displayed in this color.

References gnash::key::_1, gnash::renderer::opengl::for_each(), gnash::DisplayObject::set_invalidated(), and gnash::SWF::TextRecord::setColor().

Referenced by gnash::registerTextFieldNative(), and setTextFormat().

§ setTextFormat()

void gnash::TextField::setTextFormat ( TextFormat_as tf)

§ setTextValue()

void gnash::TextField::setTextValue ( const std::wstring &  wstr)

Set our text to the given string.

This function will also update any registered variable

References gnash::utf8::encodeCanonicalString(), gnash::getObject(), gnash::getSWFVersion(), gnash::log_debug(), gnash::as_object::set_member(), and updateText().

Referenced by getDefinitionVersion(), keyInput(), and gnash::registerTextFieldNative().

§ setType()

void gnash::TextField::setType ( TypeValue  val)
inline

Set type (input or dynamic)

Parameters
valThe TypeValue to use, no-op if typeInvalid.

Referenced by gnash::registerTextFieldNative().

§ setUnderlined()

void gnash::TextField::setUnderlined ( bool  v)

§ setURL()

void gnash::TextField::setURL ( std::string  url)

§ setWidth()

void gnash::TextField::setWidth ( double  width)
virtual

§ setWordWrap()

void gnash::TextField::setWordWrap ( bool  on)

Set wordWrap parameter.

Parameters
onIf true text hitting bounding box limits will continue to next line. If false, either text will be truncated or bounding box expanded, depending on autoSize (see getAutoSize)

References gnash::DisplayObject::set_invalidated().

Referenced by gnash::registerTextFieldNative().

§ topmostMouseEntity()

InteractiveObject * gnash::TextField::topmostMouseEntity ( std::int32_t  x,
std::int32_t  y 
)
virtual

§ typeValueName()

const char * gnash::TextField::typeValueName ( TypeValue  val)
static

Return type value as a string.

Parameters
valType value (enum)
Returns
a C-string representation of the type value. The returns is never NULL.

References typeDynamic, and typeInput.

Referenced by gnash::registerTextFieldNative().

§ updateText()

void gnash::TextField::updateText ( const std::string &  s)

Set our text to the given string by effect of an update of a.

registered variable name This call only updates the text and is only meant to be called by ourselves or by MovieClip when a registered TextVariable is updated.

References gnash::utf8::decodeCanonicalString(), gnash::getObject(), gnash::getSWFVersion(), and gnash::DisplayObject::set_invalidated().

Referenced by set_variable_name(), and setTextValue().


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