Go to the documentation of this file.
22 #ifndef GNASH_TEXTFORMAT_H
23 #define GNASH_TEXTFORMAT_H
28 #include <boost/optional.hpp>
53 const boost::optional<bool>&
underlined()
const {
return _underline; }
56 const boost::optional<bool>&
bold()
const {
return _bold; }
59 const boost::optional<bool>&
italic()
const {
return _italic; }
62 const boost::optional<rgba>&
color()
const {
return _color; }
65 const boost::optional<bool>&
bullet()
const {
return _bullet; }
74 const boost::optional<std::vector<int> >&
tabStops()
const {
79 const boost::optional<std::uint16_t>&
indent()
const {
return _indent; }
82 const boost::optional<TextField::TextAlignment>&
align()
const {
return _align; }
85 const boost::optional<std::string>&
font()
const {
return _font; }
88 const boost::optional<std::string>&
target()
const {
return _target; }
91 const boost::optional<std::string>&
url()
const {
return _url; }
100 const boost::optional<std::uint16_t>&
leading()
const {
return _leading; }
103 const boost::optional<std::uint16_t>&
leftMargin()
const {
return _leftMargin; }
111 const boost::optional<std::uint16_t>&
size()
const {
return _pointSize; }
115 void targetSet(
const boost::optional<std::string>&
s) { _target=
s; }
117 void urlSet(
const boost::optional<std::string>&
s) { _url=
s; }
123 void boldSet(
const boost::optional<bool>&
x) { _bold =
x; }
127 void colorSet(
const boost::optional<rgba>&
x) { _color =
x; }
129 void indentSet(
const boost::optional<std::uint16_t>&
x) { _indent =
x; }
133 void alignSet(
const boost::optional<TextField::TextAlignment>&
x) { _align =
x; }
141 void leadingSet(
const boost::optional<std::uint16_t>&
x) { _leading =
x; }
149 void sizeSet(
const boost::optional<std::uint16_t>&
x) { _pointSize =
x; }
159 boost::optional<bool> _underline;
162 boost::optional<bool> _bold;
165 boost::optional<bool> _italic;
168 boost::optional<bool> _bullet;
178 boost::optional<TextField::TextAlignment> _align;
181 boost::optional<std::uint32_t> _blockIndent;
187 boost::optional<rgba> _color;
194 boost::optional<std::string> _font;
198 boost::optional<std::uint16_t> _indent;
202 boost::optional<std::uint16_t> _leading;
205 boost::optional<std::uint16_t> _leftMargin;
208 boost::optional<std::uint16_t> _rightMargin;
211 boost::optional<std::uint16_t> _pointSize;
214 boost::optional<std::vector<int> > _tabStops;
221 boost::optional<std::string> _target;
225 boost::optional<std::string> _url;
const boost::optional< bool > & bullet() const
Whether the text should have a bullet.
Definition: TextFormat_as.h:65
void fontSet(const boost::optional< std::string > &font)
Definition: TextFormat_as.h:131
double toNumber(const as_value &v, const VM &vm)
Convert an as_value to a double.
Definition: VM.cpp:451
void indentSet(const boost::optional< std::uint16_t > &x)
Definition: TextFormat_as.h:129
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
@ height
Definition: klash_part.cpp:329
std::int32_t toInt(const as_value &v, const VM &vm)
AS2-compatible conversion to 32bit integer.
Definition: VM.cpp:463
void alignSet(const boost::optional< TextField::TextAlignment > &x)
Definition: TextFormat_as.h:133
The base class for all ActionScript objects.
Definition: as_object.h:162
@ TEXTFORMAT_BLOCK
Definition: TextField.h:75
as_object * toObject(const as_value &v, VM &vm)
Convert an as_value to an object.
Definition: VM.cpp:457
@ T
Definition: GnashKey.h:132
void leftMarginSet(const boost::optional< std::uint16_t > &x)
Definition: TextFormat_as.h:143
Movie & getRootMovie()
Access the originating root movie (not necessarily _level0)
Definition: movie_root.h:303
void rightMarginSet(const boost::optional< std::uint16_t > &x)
Definition: TextFormat_as.h:145
const boost::optional< std::uint32_t > & blockIndent() const
The block indent.
Definition: TextFormat_as.h:94
void log_debug(StringType msg, Args... args)
Definition: log.h:301
#define LOG_ONCE(x)
Definition: log.h:49
@ ALIGN_RIGHT
Definition: TextField.h:67
std::int32_t pixelsToTwips(double a)
Definition: GnashNumeric.h:144
#define _(String)
Definition: log.h:44
const boost::optional< std::string > & font() const
Font name.
Definition: TextFormat_as.h:85
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
void textformat_class_init(as_object &global, const ObjectURI &uri)
Definition: TextFormat_as.cpp:374
The AVM1 virtual machine.
Definition: VM.h:72
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:41
const boost::optional< bool > & underlined() const
Return a Boolean value that indicates whether the text is underlined.
Definition: TextFormat_as.h:53
void underlinedSet(const boost::optional< bool > &x)
Definition: TextFormat_as.h:119
@ ALIGN_CENTER
Definition: TextField.h:68
void colorSet(const boost::optional< rgba > &x)
Definition: TextFormat_as.h:127
void leadingSet(const boost::optional< std::uint16_t > &x)
Definition: TextFormat_as.h:141
@ s
Definition: GnashKey.h:165
TextFormatDisplay
Text format display values.
Definition: TextField.h:74
The TextFormat_as Relay type stores text properties.
Definition: TextFormat_as.h:45
Global_as & getGlobal(const as_environment &env)
Definition: as_environment.cpp:651
double twipsToPixels(int i)
Definition: GnashNumeric.h:97
VM & getVM(const as_environment &env)
Definition: as_environment.h:222
void bulletSet(const boost::optional< bool > &x)
Definition: TextFormat_as.h:125
const boost::optional< rgba > & color() const
Return the color of text using this text format.
Definition: TextFormat_as.h:62
void log_error(StringType msg, Args... args)
Definition: log.h:283
const boost::optional< std::uint16_t > & size() const
Return a float that indicates the point size in twips.
Definition: TextFormat_as.h:111
as_object * createObject(const Global_as &gl)
Definition: Global_as.cpp:303
static const int DefaultFlags
The most common flags for built-in properties.
Definition: as_object.h:192
@ t
Definition: GnashKey.h:166
const boost::optional< std::uint16_t > & rightMargin() const
Indicates the right margin of the paragraph in twips.
Definition: TextFormat_as.h:106
void displaySet(TextField::TextFormatDisplay x)
These are not optional!
Definition: TextFormat_as.h:154
@ ALIGN_LEFT
Definition: TextField.h:66
Font * get_font(const std::string &name, bool bold, bool italic)
Definition: fontlib.cpp:50
@ a
Definition: GnashKey.h:147
This is the base class for type-specific object data.
Definition: Relay.h:50
as_object * createClass(Global_as::ASFunction ctor, as_object *prototype)
Create an ActionScript class.
Definition: Global_as.cpp:180
TextAlignment
Text alignment values.
Definition: TextField.h:65
virtual const movie_definition * definition() const =0
@ F
Definition: GnashKey.h:118
void italicSet(const boost::optional< bool > &x)
Definition: TextFormat_as.h:121
const boost::optional< std::string > & target() const
Definition: TextFormat_as.h:88
const boost::optional< bool > & bold() const
Return a Boolean value that indicates whether the text is boldface.
Definition: TextFormat_as.h:56
#define IF_VERBOSE_ASCODING_ERRORS(x)
Definition: log.h:397
const boost::optional< std::vector< int > > & tabStops() const
Definition: TextFormat_as.h:74
T * get(as_object *o)
Extract the DisplayObject attached to an object.
Definition: as_object.h:842
A case-insensitive string equality operator.
Definition: StringPredicates.h:42
void registerNative(as_c_function_ptr fun, unsigned int x, unsigned int y)
Definition: VM.cpp:268
const boost::optional< std::uint16_t > & indent() const
Indentation from left margin to the first character in the paragraph.
Definition: TextFormat_as.h:79
void boldSet(const boost::optional< bool > &x)
Definition: TextFormat_as.h:123
const boost::optional< std::uint16_t > & leftMargin() const
Indicates the left margin of the paragraph, in points.
Definition: TextFormat_as.h:103
@ TEXTFORMAT_INLINE
Definition: TextField.h:76
void urlSet(const boost::optional< std::string > &s)
Definition: TextFormat_as.h:117
void targetSet(const boost::optional< std::string > &s)
Setters.
Definition: TextFormat_as.h:115
void log_aserror(StringType msg, Args... args)
Definition: log.h:331
movie_root & getRoot(const as_environment &env)
Definition: as_environment.cpp:645
const boost::optional< std::uint16_t > & leading() const
Definition: TextFormat_as.h:100
@ f
Definition: GnashKey.h:152
An instance of a DefineEditTextTag.
Definition: TextField.h:57
The Global object ultimately contains all objects in an ActionScript run.
Definition: Global_as.h:50
void registerTextFormatNative(as_object &o)
Definition: TextFormat_as.cpp:241
int getSWFVersion(const as_environment &env)
Definition: as_environment.cpp:657
virtual std::uint16_t exportID(const std::string &) const
Get the id that corresponds to a symbol.
Definition: movie_definition.h:396
uri
Definition: test.py:12
boost::intrusive_ptr< Font > get_default_font()
Return a default device font.
Definition: fontlib.cpp:42
@ ALIGN_JUSTIFY
Definition: TextField.h:69
void blockIndentSet(const boost::optional< std::uint32_t > &x)
Definition: TextFormat_as.h:137
TextFormat_as()
Definition: TextFormat_as.cpp:216
void tabStopsSet(const std::vector< int > &tabStops)
Definition: TextFormat_as.h:151
void sizeSet(const boost::optional< std::uint16_t > &x)
Definition: TextFormat_as.h:149
const boost::optional< TextField::TextAlignment > & align() const
Paragraph alignment.
Definition: TextFormat_as.h:82
~TextFormat_as()
Definition: TextFormat_as.h:50
@ o
Definition: GnashKey.h:161
@ P
Definition: GnashKey.h:128
@ width
Definition: klash_part.cpp:329
void foreachArray(as_object &array, T &pred)
Definition: Array_as.h:78
void log_unimpl(StringType msg, Args... args)
Definition: log.h:289
A URI for describing as_objects.
Definition: ObjectURI.h:45
std::int32_t x
Definition: BitmapData_as.cpp:434
@ e
Definition: GnashKey.h:151
TextField::TextFormatDisplay display() const
The display type (block or inline).
Definition: TextFormat_as.h:70
const boost::optional< bool > & italic() const
Return a Boolean value that indicates whether the text is italicized.
Definition: TextFormat_as.h:59
const boost::optional< std::string > & url() const
Definition: TextFormat_as.h:91