Permalink
Browse files

add three flash.text classes containgin constants to eliminate many '…

…pushing Undefined' type warnings
  • Loading branch information...
janimo committed Apr 20, 2011
1 parent ebda96e commit 56d430b746f4d4daf3e7d601bb35c491ce39d0f9
Showing with 47 additions and 2 deletions.
  1. +4 −2 scripting/abc.cpp
  2. +25 −0 scripting/flashtext.cpp
  3. +18 −0 scripting/flashtext.h
View
@@ -236,8 +236,10 @@ void ABCVm::registerClasses()
builtin->setVariableByQName("Font","flash.text",Class<Font>::getClass());
builtin->setVariableByQName("StyleSheet","flash.text",Class<StyleSheet>::getClass());
builtin->setVariableByQName("TextField","flash.text",Class<TextField>::getClass());
builtin->setVariableByQName("TextFieldType","flash.text",Class<ASObject>::getClass(QName("TextFieldType","flash.text")));
builtin->setVariableByQName("TextFormat","flash.text",Class<TextFormat>::getClass(QName("TextFormat","flash.text")));
builtin->setVariableByQName("TextFieldType","flash.text",Class<TextFieldType>::getClass());
builtin->setVariableByQName("TextFieldAutoSize","flash.text",Class<TextFieldAutoSize>::getClass());
builtin->setVariableByQName("TextFormat","flash.text",Class<TextFormat>::getClass());
builtin->setVariableByQName("TextFormatAlign","flash.text",Class<TextFormatAlign>::getClass());
builtin->setVariableByQName("XMLDocument","flash.xml",Class<XMLDocument>::getClass());
builtin->setVariableByQName("XMLNode","flash.xml",Class<XMLNode>::getClass());
View
@@ -28,6 +28,9 @@ SET_NAMESPACE("flash.text");
REGISTER_CLASS_NAME2(lightspark::Font,"Font","flash.text");
REGISTER_CLASS_NAME(TextField);
REGISTER_CLASS_NAME(TextFieldType);
REGISTER_CLASS_NAME(TextFieldAutoSize);
REGISTER_CLASS_NAME(TextFormatAlign);
REGISTER_CLASS_NAME(TextFormat);
REGISTER_CLASS_NAME(StyleSheet);
@@ -126,6 +129,28 @@ void TextField::Render(bool maskEnabled)
LOG(LOG_NOT_IMPLEMENTED,_("TextField::Render ") << text);
}
void TextFieldAutoSize ::sinit(Class_base* c)
{
c->setVariableByQName("CENTER","",Class<ASString>::getInstanceS("center"));
c->setVariableByQName("LEFT","",Class<ASString>::getInstanceS("left"));
c->setVariableByQName("NONE","",Class<ASString>::getInstanceS("none"));
c->setVariableByQName("RIGHT","",Class<ASString>::getInstanceS("right"));
}
void TextFieldType ::sinit(Class_base* c)
{
c->setVariableByQName("DYNAMIC","",Class<ASString>::getInstanceS("dynamic"));
c->setVariableByQName("INPUT","",Class<ASString>::getInstanceS("input"));
}
void TextFormatAlign ::sinit(Class_base* c)
{
c->setVariableByQName("CENTER","",Class<ASString>::getInstanceS("center"));
c->setVariableByQName("JUSTIFY","",Class<ASString>::getInstanceS("justify"));
c->setVariableByQName("LEFT","",Class<ASString>::getInstanceS("left"));
c->setVariableByQName("RIGHT","",Class<ASString>::getInstanceS("right"));
}
void TextFormat::sinit(Class_base* c)
{
c->setConstructor(NULL);
View
@@ -63,6 +63,24 @@ class TextFormat: public ASObject
static void buildTraits(ASObject* o);
};
class TextFieldType: public ASObject
{
public:
static void sinit(Class_base* c);
};
class TextFormatAlign: public ASObject
{
public:
static void sinit(Class_base* c);
};
class TextFieldAutoSize: public ASObject
{
public:
static void sinit(Class_base* c);
};
class StyleSheet: public EventDispatcher
{
private:

0 comments on commit 56d430b

Please sign in to comment.