Gnash
0.8.11dev
|
An instance of a DefineEditTextTag. More...
#include <TextField.h>
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 |
![]() | |
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, BufferList > | Events |
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... | |
InteractiveObject * | topmostMouseEntity (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 rgba & | getTextColor () 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 Font > | setFont (boost::intrusive_ptr< const Font > newfont) |
Set our font, return previously set one. More... | |
const Font * | getFont () |
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 SWFRect & | getTextBoundingBox () const |
void | setTextValue (const std::wstring &wstr) |
Set our text to the given string. More... | |
![]() | |
InteractiveObject (as_object *object, DisplayObject *parent) | |
virtual | ~InteractiveObject () |
virtual bool | trackAsMenu () |
ActionScript property of Buttons and MovieClips altering mouse handling. More... | |
virtual StaticText * | getStaticText (std::vector< const SWF::TextRecord *> &, size_t &) |
Allow extraction of static text. More... | |
![]() | |
DisplayObject (movie_root &mr, as_object *object, DisplayObject *parent) | |
Construct a DisplayObject. More... | |
virtual | ~DisplayObject () |
virtual as_environment & | get_environment () |
Return a reference to the variable scope of this DisplayObject. More... | |
virtual void | visitNonProperties (KeyVisitor &) const |
Enumerate any non-proper properties. More... | |
DisplayObject * | parent () 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 MovieClip * | to_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 Transform & | transform () 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 |
DisplayObject * | getMask () 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 ObjectURI & | get_name () const |
std::unique_ptr< ExecutableCode > | get_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 Movie * | get_root () const |
Return the relative root of this DisplayObject. More... | |
virtual MovieClip * | getAsRoot () |
Return the _root ActionScript property of this DisplayObject. More... | |
virtual as_object * | pathElement (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 DisplayObject * | findDropTarget (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_object * | object () 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) |
![]() | |
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 as_value | blendMode (const fn_call &fn) |
Getter-setter for blendMode. More... | |
Additional Inherited Members | |
![]() | |
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 |
![]() | |
virtual bool | unloadChildren () |
movie_root & | stage () const |
Get the movie_root to which this DisplayObject belongs. More... | |
void | saveOriginalTarget () |
const Events & | get_event_handlers () const |
void | set_event_handlers (const Events ©from) |
as_object * | getPathElementSeparator (string_table::key key) |
look for '.', 'this', '..', '_parent', '_level0' and '_root' More... | |
![]() | |
virtual | ~GcResource () |
Delete this resource. More... | |
![]() | |
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... | |
An instance of a DefineEditTextTag.
typedef std::vector<size_t> gnash::TextField::LineStarts |
gnash::TextField::TextField | ( | as_object * | object, |
DisplayObject * | parent, | ||
const SWF::DefineEditTextTag & | def | ||
) |
Constructs a TextField as specified in a DefineEditText tag.
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).
parent | A pointer to the DisplayObject parent of this TextField |
bounds | A SWFRect specifying the bounds of this TextField |
References gnash::key::f, gnash::fontlib::get_default_font(), and setFont().
gnash::TextField::~TextField | ( | ) |
|
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().
size_t gnash::TextField::cursorRecord | ( | ) |
Returns the number of the record that the cursor is in.
References gnash::key::i.
Referenced by removeTextField().
Draw the dynamic string.
Implements gnash::InteractiveObject.
References gnash::DisplayObject::clear_invalidated(), gnash::Transform::colorTransform, gnash::SWFMatrix::concatenate_translation(), gnash::SWF::TextRecord::displayRecords(), gnash::Renderer::draw_poly(), gnash::SWFRect::get_x_max(), gnash::SWFRect::get_x_min(), gnash::SWFRect::get_y_max(), gnash::SWFRect::get_y_min(), getBackgroundColor(), getBorderColor(), getDrawBackground(), getDrawBorder(), getEmbedFonts(), getFontHeight(), gnash::SWFRect::height(), gnash::key::i, gnash::SWFRect::is_null(), isReadOnly(), gnash::log_debug(), gnash::Transform::matrix, PADDING_TWIPS, gnash::SWFCxForm::transform(), and gnash::DisplayObject::transform().
Referenced by setDisplay().
|
inline |
Return true if HTML markup in text should be rendered.
Referenced by gnash::registerTextFieldNative(), and setFont().
|
inline |
Return true if text should continue to next available line when hitting end of bounding box.
Referenced by gnash::registerTextFieldNative(), and setFont().
std::string gnash::TextField::get_htmltext_value | ( | ) | const |
Return value of our htmlText.
References gnash::utf8::encodeCanonicalString(), gnash::getObject(), and gnash::getSWFVersion().
Referenced by gnash::registerTextFieldNative().
std::string gnash::TextField::get_text_value | ( | ) | const |
Return value of our text.
References gnash::utf8::encodeCanonicalString(), gnash::getObject(), and gnash::getSWFVersion().
Referenced by gnash::MovieClip::getTextFieldVariables(), and gnash::registerTextFieldNative().
|
inline |
Referenced by getTextAlignment().
|
inline |
Get autoSize value.
Referenced by gnash::registerTextFieldNative(), and setFont().
rgba gnash::TextField::getBackgroundColor | ( | ) | const |
Return color of the background.
Referenced by display(), and gnash::registerTextFieldNative().
|
inline |
Referenced by gnash::registerTextFieldNative(), and setFont().
rgba gnash::TextField::getBorderColor | ( | ) | const |
Return color of the border.
Referenced by display(), and gnash::registerTextFieldNative().
|
inline |
References gnash::key::b, url, and test::v.
Referenced by gnash::registerTextFieldNative().
|
inlinevirtual |
Get bounding SWFRect of this TextField.
Implements gnash::InteractiveObject.
Referenced by add_invalidated_bounds(), setHeight(), and setWidth().
|
inline |
|
inline |
Referenced by gnash::registerSelectionNative().
|
virtual |
Return the version of the SWF this was parsed from.
TODO: work out what this means for dynamic TextFields.
Reimplemented from gnash::DisplayObject.
References _, gnash::utf8::decodeCanonicalString(), gnash::utf8::encodeCanonicalString(), gnash::findObject(), gnash::DisplayObject::get_environment(), gnash::as_object::get_member(), gnash::DisplayObject::get_root(), gnash::MovieClip::getDefinitionVersion(), gnash::getObject(), gnash::getSWFVersion(), gnash::getURI(), gnash::getVM(), IF_VERBOSE_MALFORMED_SWF, gnash::log_debug(), gnash::log_error(), gnash::log_swferror(), gnash::parsePath(), path, gnash::key::q, gnash::as_object::set_member(), gnash::MovieClip::set_textfield_variable(), setTextValue(), gnash::as_environment::target(), and gnash::as_value::to_string().
|
inline |
bool gnash::TextField::getDrawBackground | ( | ) | const |
Return true if the 'background' should be drawn.
Referenced by display(), and gnash::registerTextFieldNative().
bool gnash::TextField::getDrawBorder | ( | ) | const |
Return true if this TextField should have its border visible.
Referenced by display(), and gnash::registerTextFieldNative().
|
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().
|
inline |
Referenced by gnash::registerTextFieldNative().
|
inline |
References gnash::key::h.
Referenced by display(), gnash::registerTextFieldNative(), and setFont().
|
inline |
Referenced by gnash::registerTextFieldNative().
|
inline |
Referenced by gnash::registerTextFieldNative(), and setFont().
|
inline |
Referenced by gnash::registerTextFieldNative(), removeTextField(), and setFont().
|
inline |
Referenced by gnash::registerTextFieldNative(), and setFont().
|
inline |
Referenced by gnash::registerTextFieldNative().
|
inline |
Referenced by gnash::registerTextFieldNative().
|
inline |
Referenced by gnash::registerTextFieldNative().
|
inline |
Referenced by gnash::registerTextFieldNative(), setFont(), and setTextFormat().
|
inline |
Referenced by gnash::registerTextFieldNative().
|
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().
|
inline |
Referenced by setFont().
TextField::TextAlignment gnash::TextField::getTextAlignment | ( | ) |
Return text TextAlignment.
References ALIGN_CENTER, ALIGN_LEFT, ALIGN_RIGHT, AUTOSIZE_CENTER, AUTOSIZE_LEFT, AUTOSIZE_RIGHT, gnash::callMethod(), getAlignment(), gnash::getObject(), gnash::NSV::PROP_BROADCAST_MESSAGE, gnash::DisplayObject::set_invalidated(), and setSelection().
Referenced by gnash::registerTextFieldNative(), and setFont().
|
inline |
Referenced by gnash::registerTextFieldNative().
|
inline |
Return color of the text.
Referenced by gnash::registerTextFieldNative(), and setFont().
|
inline |
Return true if text is defined.
Referenced by gnash::MovieClip::getTextFieldVariables().
|
inline |
Get type (input, dynamic or invalid)
Referenced by gnash::registerTextFieldNative().
|
inline |
Referenced by gnash::registerTextFieldNative(), and setFont().
|
inline |
References gnash::key::s.
Referenced by gnash::registerTextFieldNative().
|
inline |
Return true if this TextField is read-only.
Referenced by display(), and keyInput().
|
inline |
Referenced by gnash::registerTextFieldNative().
|
inline |
Return true if the TextField text is selectable.
Referenced by gnash::registerTextFieldNative().
|
inlinevirtual |
Return true if the TextField text is selectable.
Reimplemented from gnash::DisplayObject.
void gnash::TextField::keyInput | ( | key::code | k | ) |
Handle user input from a key press.
References gnash::key::ASCII, gnash::key::BACKSPACE, gnash::key::c, gnash::key::codeMap, gnash::key::DELETEKEY, gnash::key::DOWN, gnash::key::END, gnash::key::ENTER, gnash::key::HOME, gnash::key::INSERT, isReadOnly(), gnash::key::LEFT, maxChars(), multiline(), gnash::key::PGDN, gnash::key::PGUP, gnash::key::RIGHT, gnash::key::s, gnash::DisplayObject::set_invalidated(), setHtml(), setTextValue(), gnash::key::t, and gnash::key::UP.
Referenced by gnash::movie_root::keyEvent().
|
inline |
Get the current maxChars setting of the TextField.
Referenced by keyInput(), and gnash::registerTextFieldNative().
|
inline |
Set the current maxChars setting of the TextField.
max | The maximum number of characters that can be input by the user (Does not restrict Scripts) |
|
inlinevirtual |
Returns true for now, TextField is always "Mouse-Enabled".
Implements gnash::InteractiveObject.
References gnash::key::k, x, and y.
|
virtual |
This function is called as a user-input handler.
Implements gnash::InteractiveObject.
References gnash::SWFMatrix::get_x_translation(), gnash::SWFMatrix::get_y_translation(), gnash::getMatrix(), gnash::SWF::TextRecord::getTarget(), gnash::SWF::TextRecord::getURL(), gnash::movie_root::getURL(), gnash::event_id::id(), gnash::key::m, gnash::MovieClip::METHOD_NONE, gnash::movie_root::mousePosition(), gnash::event_id::PRESS, and gnash::DisplayObject::stage().
|
inline |
Get the current multiline setting of the TextField.
Referenced by keyInput(), and gnash::registerTextFieldNative().
|
inline |
Set the current multiline setting of the TextField.
b | If true "Enter" key will be recognized (Does not restrict Scripts) |
References gnash::key::b.
|
static |
Parse type string value.
val | Type value as a string (one of input or dynamic) |
References typeDynamic, typeInput, and typeInvalid.
Referenced by gnash::registerTextFieldNative().
|
inline |
Get the current password setting of the TextField.
Referenced by gnash::registerTextFieldNative(), and setFont().
|
inline |
Set the current password setting of the TextField.
b | If true characters in the TextField will be displayed as (*) |
References gnash::key::b.
|
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.
void gnash::TextField::removeTextField | ( | ) |
Remove this textfield from the stage.
This is to implement TextField.removeTextField, will basically forward the request to its parent. Eventually this and MovieClip::removeMovieClip will be merged in a single function to be later used also for AS3 removeChild().
References _, cursorRecord(), gnash::Renderer::drawLine(), gnash::DisplayObject::get_depth(), getLeading(), gnash::DisplayObject::getTarget(), gnash::SWF::TextRecord::glyphs(), gnash::key::h, gnash::key::i, gnash::log_debug(), gnash::log_error(), gnash::key::p, gnash::DisplayObject::parent(), gnash::MovieClip::remove_display_object(), gnash::SWF::TextRecord::textHeight(), gnash::DisplayObject::to_movie(), gnash::typeName(), x, gnash::SWF::TextRecord::xOffset(), y, and gnash::SWF::TextRecord::yOffset().
Referenced by gnash::registerTextFieldNative().
void gnash::TextField::replaceSelection | ( | const std::string & | replace | ) |
Replace the current selection with the new text.
replace | String to replace the current selection |
References gnash::utf8::decodeCanonicalString(), gnash::image::end(), gnash::getObject(), gnash::getSWFVersion(), and start.
Referenced by gnash::registerTextFieldNative().
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().
void gnash::TextField::setAlignment | ( | TextAlignment | h | ) |
References gnash::key::h, and gnash::DisplayObject::set_invalidated().
Referenced by setTextFormat().
void gnash::TextField::setAutoSize | ( | AutoSize | val | ) |
Set autoSize value.
val | The AutoSize to use |
References gnash::DisplayObject::set_invalidated().
Referenced by gnash::registerTextFieldNative().
void gnash::TextField::setBackgroundColor | ( | const rgba & | col | ) |
Set color of the background.
Use setDrawBackground to actually use this value.
col | RGBA Object with color information. TextField background will be drawn in this color |
References gnash::DisplayObject::set_invalidated().
Referenced by gnash::registerTextFieldNative().
void gnash::TextField::setBlockIndent | ( | std::uint16_t | h | ) |
References gnash::key::h, and gnash::DisplayObject::set_invalidated().
Referenced by setFont(), and setTextFormat().
void gnash::TextField::setBorderColor | ( | const rgba & | col | ) |
Set color of the border.
Use setDrawBorder to actually use this value.
col | RGBA Object with color information. TextField border will be drawn in this color. |
References gnash::DisplayObject::set_invalidated().
Referenced by gnash::registerTextFieldNative().
|
inline |
void gnash::TextField::setBullet | ( | bool | b | ) |
References gnash::key::b.
Referenced by setTextFormat().
void gnash::TextField::setDisplay | ( | TextFormatDisplay | display | ) |
References display(), and gnash::DisplayObject::set_invalidated().
Referenced by setTextFormat().
void gnash::TextField::setDrawBackground | ( | bool | draw | ) |
Specify whether to draw the background.
draw | If true the background of this TextField will be drawn |
References gnash::DisplayObject::set_invalidated().
Referenced by gnash::registerTextFieldNative().
void gnash::TextField::setDrawBorder | ( | bool | draw | ) |
Specify whether to draw the border.
draw | If true the border of this TextField will be drawn |
References gnash::DisplayObject::set_invalidated().
Referenced by gnash::registerTextFieldNative().
void gnash::TextField::setEmbedFonts | ( | bool | use | ) |
Set whether this TextField should use embedded font glyphs, or use device font glyphs.
use |
References gnash::DisplayObject::set_invalidated().
Referenced by gnash::registerTextFieldNative().
boost::intrusive_ptr< const Font > gnash::TextField::setFont | ( | boost::intrusive_ptr< const Font > | newfont | ) |
Set our font, return previously set one.
newfont | Will 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().
void gnash::TextField::setFontHeight | ( | std::uint16_t | h | ) |
References gnash::key::h, and gnash::DisplayObject::set_invalidated().
Referenced by setTextFormat().
|
virtual |
Override of DisplayObject::setHeight.
TextField height currently behaves differently from MovieClip height
Reimplemented from gnash::DisplayObject.
References gnash::SWFRect::get_x_max(), gnash::SWFRect::get_x_min(), gnash::SWFRect::get_y_min(), getBounds(), and gnash::SWFRect::set_to_rect().
|
inline |
Referenced by gnash::registerTextFieldNative().
|
inline |
Set html parameter.
on | If true HTML tags in the text will be parsed and rendered |
Referenced by keyInput(), and gnash::registerTextFieldNative().
void gnash::TextField::setIndent | ( | std::uint16_t | h | ) |
References gnash::key::h, and gnash::DisplayObject::set_invalidated().
Referenced by setFont(), and setTextFormat().
void gnash::TextField::setLeading | ( | std::int16_t | h | ) |
References gnash::key::h, and gnash::DisplayObject::set_invalidated().
Referenced by setFont(), and setTextFormat().
void gnash::TextField::setLeftMargin | ( | std::uint16_t | h | ) |
References gnash::key::h, and gnash::DisplayObject::set_invalidated().
Referenced by setFont(), and setTextFormat().
|
inline |
|
inline |
void gnash::TextField::setRestrict | ( | const std::string & | restrict | ) |
References _, gnash::key::i, gnash::log_error(), gnash::key::p, and gnash::key::q.
Referenced by gnash::registerTextFieldNative().
void gnash::TextField::setRightMargin | ( | std::uint16_t | h | ) |
References gnash::key::h, and gnash::DisplayObject::set_invalidated().
Referenced by setFont(), and setTextFormat().
|
inline |
Referenced by gnash::registerTextFieldNative().
|
inline |
Set 'selectable' parameter.
v | If true text in this TextField will be selectable |
References test::v.
Referenced by gnash::registerTextFieldNative().
void gnash::TextField::setSelection | ( | int | start, |
int | end | ||
) |
Set the current selection.
start | The index of the beginning of the selection. |
end | The 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().
void gnash::TextField::setTabStops | ( | const std::vector< int > & | tabStops | ) |
References gnash::key::i, gnash::pixelsToTwips(), and gnash::DisplayObject::set_invalidated().
Referenced by setFont(), and setTextFormat().
void gnash::TextField::setTarget | ( | std::string | target | ) |
References gnash::DisplayObject::set_invalidated().
Referenced by setTextFormat().
void gnash::TextField::setTextColor | ( | const rgba & | col | ) |
Set color of the text.
col | RGBA 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().
void gnash::TextField::setTextFormat | ( | TextFormat_as & | tf | ) |
References gnash::TextFormat_as::align(), ALIGN_CENTER, ALIGN_JUSTIFY, ALIGN_LEFT, ALIGN_RIGHT, gnash::TextFormat_as::blockIndent(), gnash::TextFormat_as::bullet(), gnash::TextFormat_as::color(), gnash::TextFormat_as::display(), gnash::key::f, getRightMargin(), gnash::key::i, gnash::TextFormat_as::indent(), gnash::TextFormat_as::leading(), gnash::TextFormat_as::leftMargin(), gnash::log_debug(), PADDING_TWIPS, gnash::TextFormat_as::rightMargin(), setAlignment(), setBlockIndent(), setBullet(), setDisplay(), setFontHeight(), setIndent(), setLeading(), setLeftMargin(), setRightMargin(), setTabStops(), setTarget(), setTextColor(), setUnderlined(), setURL(), gnash::SWF::TextRecord::setXOffset(), gnash::TextFormat_as::size(), gnash::TextFormat_as::tabStops(), gnash::TextFormat_as::target(), gnash::TextFormat_as::underlined(), gnash::TextFormat_as::url(), gnash::SWFRect::width(), width, x, and gnash::SWF::TextRecord::xOffset().
Referenced by gnash::registerTextFieldNative().
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().
|
inline |
Set type (input or dynamic)
val | The TypeValue to use, no-op if typeInvalid. |
Referenced by gnash::registerTextFieldNative().
void gnash::TextField::setUnderlined | ( | bool | v | ) |
References gnash::DisplayObject::set_invalidated(), and test::v.
Referenced by setTextFormat().
void gnash::TextField::setURL | ( | std::string | url | ) |
References gnash::DisplayObject::set_invalidated(), and url.
Referenced by setTextFormat().
|
virtual |
Override of DisplayObject::setWidth.
TextField width currently behaves differently from MovieClip width
Reimplemented from gnash::DisplayObject.
References gnash::SWFRect::get_x_min(), gnash::SWFRect::get_y_max(), gnash::SWFRect::get_y_min(), getBounds(), and gnash::SWFRect::set_to_rect().
void gnash::TextField::setWordWrap | ( | bool | on | ) |
Set wordWrap parameter.
on | If 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().
|
virtual |
Returns a pointer to the topmost InteractiveObject at (x,y)
x | x-coordinate |
y | y-coordinate |
Implements gnash::InteractiveObject.
References gnash::getMatrix(), gnash::SWFMatrix::invert(), gnash::key::m, gnash::key::p, gnash::SWFRect::point_test(), gnash::SWFMatrix::transform(), gnash::DisplayObject::visible(), gnash::geometry::Point2d::x, and gnash::geometry::Point2d::y.
|
static |
Return type value as a string.
val | Type value (enum) |
References typeDynamic, and typeInput.
Referenced by gnash::registerTextFieldNative().
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().