Projects
Essentials
lightspark
Sign Up
Log In
Username
Password
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 122
View file
lightspark.spec
Changed
@@ -20,7 +20,7 @@ %bcond_without librtmp Name: lightspark -Version: 0.7.2.99+git20161023.1408 +Version: 0.7.2.99+git20161029.1519 Release: 0 Summary: Modern, free, open-source flash player implementation License: LGPL-3.0+
View file
lightspark.tar.xz/src/allclasses.h
Changed
@@ -295,7 +295,10 @@ REGISTER_CLASS_NAME(KeyboardType,"flash.ui") REGISTER_CLASS_NAME(KeyLocation,"flash.ui") REGISTER_CLASS_NAME(Mouse,"flash.ui") +REGISTER_CLASS_NAME(MouseCursor,"flash.ui") +REGISTER_CLASS_NAME(MouseCursorData,"flash.ui") REGISTER_CLASS_NAME(Multitouch,"flash.ui") +REGISTER_CLASS_NAME(MultitouchInputMode,"flash.ui") REGISTER_CLASS_NAME(ContextMenu,"flash.ui") REGISTER_CLASS_NAME(ContextMenuItem,"flash.ui") REGISTER_CLASS_NAME(ContextMenuBuiltInItems,"flash.ui")
View file
lightspark.tar.xz/src/backends/image.cpp
Changed
@@ -293,7 +293,10 @@ LOG(LOG_ERROR,"Couldn't initialize png read struct"); return NULL; } - png_set_read_fn(pngPtr,(void*)inData, ReadPNGDataFromBuffer); + png_image_buffer b; + b.data = inData; + b.curpos = 0; + png_set_read_fn(pngPtr,(void*)&b, ReadPNGDataFromBuffer); return decodePNGImpl(pngPtr, width, height); }
View file
lightspark.tar.xz/src/parsing/tags.cpp
Changed
@@ -774,7 +774,8 @@ TokenContainer::FromShaperecordListToShapeVector(sr,tokens,fillStyles,glyphMatrix); - curPos.x += FontAdvanceTable[i]; + if (FontFlagsHasLayout) + curPos.x += FontAdvanceTable[i]; found = true; break; } @@ -827,7 +828,19 @@ _R<BitmapContainer> BitmapTag::getBitmap() const { return bitmap; } - +void BitmapTag::loadBitmap(uint8_t* inData, int datasize) +{ + if (datasize < 4) + return; + else if((inData[0]&0x80) && inData[1]=='P' && inData[2]=='N' && inData[3]=='G') + bitmap->fromPNG(inData,datasize); + else if(inData[0]==0xff && inData[1]==0xd8 && inData[2]==0xff) + bitmap->fromJPEG(inData,datasize); + else if(inData[0]=='G' && inData[1]=='I' && inData[2]=='F' && inData[3]=='8') + LOG(LOG_ERROR,"GIF image found, not yet supported, ID :"<<getId()); + else + LOG(LOG_ERROR,"unknown image format for ID "<<getId()); +} DefineBitsLosslessTag::DefineBitsLosslessTag(RECORDHEADER h, istream& in, int version, RootMovieClip* root):BitmapTag(h,root),BitmapColorTableSize(0) { int dest=in.tellg(); @@ -1371,8 +1384,11 @@ PlaceFlagHasFilterList=UB(1,bs); in >> Depth; - if(PlaceFlagHasClassName || (PlaceFlagHasImage && PlaceFlagHasCharacter)) - throw ParseException("ClassName in PlaceObject3 not yet supported"); + if(PlaceFlagHasClassName) + { + in >> ClassName; + LOG(LOG_NOT_IMPLEMENTED,"ClassName in PlaceObject3 not yet supported:"<<ClassName); + } if(PlaceFlagHasCharacter) in >> CharacterId; @@ -1629,7 +1645,7 @@ tmpp++; } } - SoundData->append(tmp, in.gcount()); + SoundData->append(tmpp, soundDataLength); SoundData->markFinished(); } @@ -1833,7 +1849,7 @@ int dataSize=Header.getLength()-2; uint8_t *inData=new(nothrow) uint8_t[dataSize]; in.read((char*)inData,dataSize); - bitmap->fromJPEG(inData,dataSize,JPEGTablesTag::getJPEGTables(),JPEGTablesTag::getJPEGTableSize()); + loadBitmap(inData,dataSize); delete[] inData; } @@ -1845,8 +1861,7 @@ int dataSize=Header.getLength()-2; uint8_t* inData=new(nothrow) uint8_t[dataSize]; in.read((char*)inData,dataSize); - - bitmap->fromJPEG(inData,dataSize); + loadBitmap(inData,dataSize); delete[] inData; } @@ -1859,8 +1874,7 @@ uint8_t* inData=new(nothrow) uint8_t[dataSize]; in.read((char*)inData,dataSize); - //TODO: check header. Could also be PNG or GIF - bitmap->fromJPEG(inData,dataSize); + loadBitmap(inData,dataSize); delete[] inData; //Read alpha data (if any)
View file
lightspark.tar.xz/src/parsing/tags.h
Changed
@@ -556,6 +556,7 @@ { protected: _R<BitmapContainer> bitmap; + void loadBitmap(uint8_t* inData, int datasize); public: BitmapTag(RECORDHEADER h,RootMovieClip* root); ASObject* instance(Class_base* c=NULL) const;
View file
lightspark.tar.xz/src/scripting/abc.cpp
Changed
@@ -511,7 +511,10 @@ builtin->registerBuiltin("ContextMenuItem","flash.ui",Class<ContextMenuItem>::getRef(m_sys)); builtin->registerBuiltin("ContextMenuBuiltInItems","flash.ui",Class<ContextMenuBuiltInItems>::getRef(m_sys)); builtin->registerBuiltin("Mouse","flash.ui",Class<Mouse>::getRef(m_sys)); + builtin->registerBuiltin("MouseCursor","flash.ui",Class<MouseCursor>::getRef(m_sys)); + builtin->registerBuiltin("MouseCursorData","flash.ui",Class<MouseCursorData>::getRef(m_sys)); builtin->registerBuiltin("Multitouch","flash.ui",Class<Multitouch>::getRef(m_sys)); + builtin->registerBuiltin("MultitouchInputMode","flash.ui",Class<MultitouchInputMode>::getRef(m_sys)); builtin->registerBuiltin("Accelerometer", "flash.sensors",Class<Accelerometer>::getRef(m_sys));
View file
lightspark.tar.xz/src/scripting/flash/display/BitmapContainer.cpp
Changed
@@ -85,6 +85,14 @@ assert_and_throw((int32_t)w >= 0 && (int32_t)h >= 0); return fromRGB(rgb, (int32_t)w, (int32_t)h, RGB24); } +bool BitmapContainer::fromPNG(uint8_t* data, int len) +{ + /* flash uses signed values for width and height */ + uint32_t w,h; + uint8_t *rgb=ImageDecoder::decodePNG(data,len, &w, &h); + assert_and_throw((int32_t)w >= 0 && (int32_t)h >= 0); + return fromRGB(rgb, (int32_t)w, (int32_t)h, RGB24); +} bool BitmapContainer::fromPalette(uint8_t* inData, uint32_t w, uint32_t h, uint32_t inStride, uint8_t* palette, unsigned numColors, unsigned paletteBPP) {
View file
lightspark.tar.xz/src/scripting/flash/display/BitmapContainer.h
Changed
@@ -50,6 +50,7 @@ bool fromJPEG(uint8_t* data, int len, const uint8_t *tablesData=NULL, int tablesLen=0); bool fromJPEG(std::istream& s); bool fromPNG(std::istream& s); + bool fromPNG(uint8_t* data, int len); bool fromPalette(uint8_t* inData, uint32_t width, uint32_t height, uint32_t inStride, uint8_t* palette, unsigned numColors, unsigned paletteBPP); // Clip sourceRect coordinates to this BitmapContainer. The // output coordinates can be used to access pixels in data
View file
lightspark.tar.xz/src/scripting/flash/display/DisplayObject.cpp
Changed
@@ -674,6 +674,12 @@ * behaviour, even though the documentation states that only * the main class should have non-null loaderInfo. */ _NR<RootMovieClip> r=th->getRoot(); + if (r.isNull()) + { + // if this DisplayObject is not yet added to the stage we just use the mainclip + r = _MR(obj->getSystemState()->mainClip); + r->incRef(); + } if(r.isNull() || r->loaderInfo.isNull()) return obj->getSystemState()->getUndefinedRef();
View file
lightspark.tar.xz/src/scripting/flash/display/flashdisplay.cpp
Changed
@@ -784,7 +784,7 @@ return false; Locker l(mutexDisplayList); - list<_R<DisplayObject>>::const_iterator it=dynamicDisplayList.begin(); + std::vector<_R<DisplayObject>>::const_iterator it=dynamicDisplayList.begin(); for(;it!=dynamicDisplayList.end();++it) { number_t txmin,txmax,tymin,tymax; @@ -846,7 +846,7 @@ { Locker l(mutexDisplayList); //Now draw also the display list - list<_R<DisplayObject>>::const_iterator it=dynamicDisplayList.begin(); + std::vector<_R<DisplayObject>>::const_iterator it=dynamicDisplayList.begin(); for(;it!=dynamicDisplayList.end();++it) { //Skip the drawing of masks @@ -874,7 +874,7 @@ _NR<DisplayObject> ret = NullRef; //Test objects added at runtime, in reverse order Locker l(mutexDisplayList); - list<_R<DisplayObject>>::const_reverse_iterator j=dynamicDisplayList.rbegin(); + std::vector<_R<DisplayObject>>::const_reverse_iterator j=dynamicDisplayList.rbegin(); for(;j!=dynamicDisplayList.rend();++j) { //Don't check masks @@ -1489,6 +1489,7 @@ c->setDeclaredMethodByQName("removeChildAt","",Class<IFunction>::getFunction(c->getSystemState(),removeChildAt),NORMAL_METHOD,true); c->setDeclaredMethodByQName("addChildAt","",Class<IFunction>::getFunction(c->getSystemState(),addChildAt),NORMAL_METHOD,true); c->setDeclaredMethodByQName("swapChildren","",Class<IFunction>::getFunction(c->getSystemState(),swapChildren),NORMAL_METHOD,true); + c->setDeclaredMethodByQName("swapChildrenAt","",Class<IFunction>::getFunction(c->getSystemState(),swapChildrenAt),NORMAL_METHOD,true); c->setDeclaredMethodByQName("contains","",Class<IFunction>::getFunction(c->getSystemState(),contains),NORMAL_METHOD,true); c->setDeclaredMethodByQName("mouseChildren","",Class<IFunction>::getFunction(c->getSystemState(),_setMouseChildren),SETTER_METHOD,true); c->setDeclaredMethodByQName("mouseChildren","",Class<IFunction>::getFunction(c->getSystemState(),_getMouseChildren),GETTER_METHOD,true); @@ -1674,7 +1675,7 @@ void DisplayObjectContainer::dumpDisplayList(unsigned int level) { tiny_string indent(std::string(2*level, ' ')); - list<_R<DisplayObject> >::const_iterator it=dynamicDisplayList.begin(); + std::vector<_R<DisplayObject>>::const_iterator it=dynamicDisplayList.begin(); for(;it!=dynamicDisplayList.end();++it) { Vector2f pos = (*it)->getXY(); @@ -1701,13 +1702,13 @@ //Notify childern //Make a copy of display list, and release the mutex //before calling setOnStage - list<_R<DisplayObject>> displayListCopy; + std::vector<_R<DisplayObject>> displayListCopy; { Locker l(mutexDisplayList); displayListCopy.assign(dynamicDisplayList.begin(), dynamicDisplayList.end()); } - list<_R<DisplayObject>>::const_iterator it=displayListCopy.begin(); + std::vector<_R<DisplayObject>>::const_iterator it=displayListCopy.begin(); for(;it!=displayListCopy.end();++it) (*it)->setOnStage(staged); } @@ -1743,7 +1744,7 @@ { DisplayObject::requestInvalidation(q); Locker l(mutexDisplayList); - list<_R<DisplayObject>>::const_iterator it=dynamicDisplayList.begin(); + std::vector<_R<DisplayObject>>::const_iterator it=dynamicDisplayList.begin(); for(;it!=dynamicDisplayList.end();++it) (*it)->requestInvalidation(q); } @@ -1761,6 +1762,7 @@ child->getParent()->_removeChild(child); } this->incRef(); + child->incRef(); child->setParent(_MR(this)); { Locker l(mutexDisplayList); @@ -1769,7 +1771,7 @@ dynamicDisplayList.push_back(child); else { - list<_R<DisplayObject>>::iterator it=dynamicDisplayList.begin(); + std::vector<_R<DisplayObject>>::iterator it=dynamicDisplayList.begin(); for(unsigned int i=0;i<index;i++) ++it; dynamicDisplayList.insert(it,child); @@ -1785,7 +1787,7 @@ { Locker l(mutexDisplayList); - list<_R<DisplayObject>>::iterator it=find(dynamicDisplayList.begin(),dynamicDisplayList.end(),child); + std::vector<_R<DisplayObject>>::iterator it=find(dynamicDisplayList.begin(),dynamicDisplayList.end(),child); if(it==dynamicDisplayList.end()) return false; dynamicDisplayList.erase(it); @@ -1803,7 +1805,7 @@ if(d==this) return true; - list<_R<DisplayObject>>::const_iterator it=dynamicDisplayList.begin(); + std::vector<_R<DisplayObject>>::const_iterator it=dynamicDisplayList.begin(); for(;it!=dynamicDisplayList.end();++it) { if(*it==d) @@ -1926,7 +1928,7 @@ Locker l(th->mutexDisplayList); if(index>=int(th->dynamicDisplayList.size()) || index<0) throw Class<RangeError>::getInstanceS(obj->getSystemState(),"removeChildAt: invalid index", 2025); - list<_R<DisplayObject>>::iterator it=th->dynamicDisplayList.begin(); + std::vector<_R<DisplayObject>>::iterator it=th->dynamicDisplayList.begin(); for(int32_t i=0;i<index;i++) ++it; child=(*it).getPtr(); @@ -1959,17 +1961,21 @@ return NULL; Locker l(th->mutexDisplayList); - th->dynamicDisplayList.remove(child); //remove from old position - list<_R<DisplayObject>>::iterator it=th->dynamicDisplayList.begin(); + child->incRef(); + th->dynamicDisplayList.erase(th->dynamicDisplayList.begin()+curIndex); //remove from old position + + std::vector<_R<DisplayObject>>::iterator it=th->dynamicDisplayList.begin(); int i = 0; for(;it != th->dynamicDisplayList.end(); ++it) if(i++ == index) { + child->incRef(); th->dynamicDisplayList.insert(it, child); return NULL; } + child->incRef(); th->dynamicDisplayList.push_back(child); return NULL; } @@ -2000,8 +2006,8 @@ { Locker l(th->mutexDisplayList); - std::list<_R<DisplayObject>>::iterator it1=find(th->dynamicDisplayList.begin(),th->dynamicDisplayList.end(),child1); - std::list<_R<DisplayObject>>::iterator it2=find(th->dynamicDisplayList.begin(),th->dynamicDisplayList.end(),child2); + std::vector<_R<DisplayObject>>::iterator it1=find(th->dynamicDisplayList.begin(),th->dynamicDisplayList.end(),child1); + std::vector<_R<DisplayObject>>::iterator it2=find(th->dynamicDisplayList.begin(),th->dynamicDisplayList.end(),child2); if(it1==th->dynamicDisplayList.end() || it2==th->dynamicDisplayList.end()) throw Class<ArgumentError>::getInstanceS(obj->getSystemState(),"Argument is not child of this object", 2025); @@ -2014,13 +2020,36 @@ return NULL; } +ASFUNCTIONBODY(DisplayObjectContainer,swapChildrenAt) +{ + DisplayObjectContainer* th=static_cast<DisplayObjectContainer*>(obj); + int index1; + int index2; + ARG_UNPACK(index1)(index2); + + if (index1 < 0 || index1 > (int)th->dynamicDisplayList.size() || + index2 < 0 || index2 > (int)th->dynamicDisplayList.size()) + throwError<RangeError>(kParamRangeError); + if (index1 == index2) + { + return NULL; + } + + { + Locker l(th->mutexDisplayList); + std::iter_swap(th->dynamicDisplayList.begin() + index1, th->dynamicDisplayList.begin() + index2); + } + + return NULL; +} + //Only from VM context ASFUNCTIONBODY(DisplayObjectContainer,getChildByName) { DisplayObjectContainer* th=static_cast<DisplayObjectContainer*>(obj); assert_and_throw(argslen==1); const tiny_string& wantedName=args[0]->toString(); - list<_R<DisplayObject>>::iterator it=th->dynamicDisplayList.begin(); + std::vector<_R<DisplayObject>>::iterator it=th->dynamicDisplayList.begin(); ASObject* ret=NULL; for(;it!=th->dynamicDisplayList.end();++it) { @@ -2045,7 +2074,7 @@ unsigned int index=args[0]->toInt(); if(index>=th->dynamicDisplayList.size()) throw Class<RangeError>::getInstanceS(obj->getSystemState(),"getChildAt: invalid index", 2025); - list<_R<DisplayObject>>::iterator it=th->dynamicDisplayList.begin(); + std::vector<_R<DisplayObject>>::iterator it=th->dynamicDisplayList.begin(); for(unsigned int i=0;i<index;i++) ++it; @@ -2055,7 +2084,7 @@ int DisplayObjectContainer::getChildIndex(_R<DisplayObject> child) { - list<_R<DisplayObject>>::const_iterator it = dynamicDisplayList.begin();
View file
lightspark.tar.xz/src/scripting/flash/display/flashdisplay.h
Changed
@@ -92,7 +92,7 @@ protected: void requestInvalidation(InvalidateQueue* q); //This is shared between RenderThread and VM - std::list < _R<DisplayObject> > dynamicDisplayList; + std::vector < _R<DisplayObject> > dynamicDisplayList; //The lock should only be taken when doing write operations //As the RenderThread only reads, it's safe to read without the lock mutable Mutex mutexDisplayList; @@ -131,6 +131,7 @@ ASFUNCTION(_getMouseChildren); ASFUNCTION(_setMouseChildren); ASFUNCTION(swapChildren); + ASFUNCTION(swapChildrenAt); }; /* This is really ugly, but the parent of the current
View file
lightspark.tar.xz/src/scripting/flash/geom/flashgeom.cpp
Changed
@@ -917,7 +917,10 @@ return ret; } -Transform::Transform(Class_base* c, _R<DisplayObject> o):ASObject(c),owner(o) +Transform::Transform(Class_base* c):ASObject(c),perspectiveProjection(Class<PerspectiveProjection>::getInstanceSNoArgs(c->getSystemState())) +{ +} +Transform::Transform(Class_base* c, _R<DisplayObject> o):ASObject(c),owner(o),perspectiveProjection(Class<PerspectiveProjection>::getInstanceSNoArgs(c->getSystemState())) { } @@ -936,7 +939,11 @@ c->setDeclaredMethodByQName("matrix","",Class<IFunction>::getFunction(c->getSystemState(),_getMatrix),GETTER_METHOD,true); c->setDeclaredMethodByQName("matrix","",Class<IFunction>::getFunction(c->getSystemState(),_setMatrix),SETTER_METHOD,true); c->setDeclaredMethodByQName("concatenatedMatrix","",Class<IFunction>::getFunction(c->getSystemState(),_getConcatenatedMatrix),GETTER_METHOD,true); + REGISTER_GETTER_SETTER(c, perspectiveProjection); + REGISTER_GETTER_SETTER(c, matrix3D); } +ASFUNCTIONBODY_GETTER_SETTER_NOT_IMPLEMENTED(Transform, perspectiveProjection); +ASFUNCTIONBODY_GETTER_SETTER_NOT_IMPLEMENTED(Transform, matrix3D); ASFUNCTIONBODY(Transform,_constructor) { @@ -1717,6 +1724,7 @@ void Matrix3D::sinit(Class_base* c) { CLASS_SETUP(c, ASObject, _constructor, CLASS_SEALED); + c->setDeclaredMethodByQName("clone","",Class<IFunction>::getFunction(c->getSystemState(),clone),NORMAL_METHOD,true); } ASFUNCTIONBODY(Matrix3D,_constructor) @@ -1725,11 +1733,23 @@ LOG(LOG_NOT_IMPLEMENTED,"Matrix3D is not implemented"); return NULL; } +ASFUNCTIONBODY(Matrix3D,clone) +{ + //Matrix3D * th=static_cast<Matrix3D*>(obj); + LOG(LOG_NOT_IMPLEMENTED,"Matrix3D.clone is not implemented"); + return Class<Matrix3D>::getInstanceS(obj->getSystemState()); +} void PerspectiveProjection::sinit(Class_base* c) { CLASS_SETUP(c, ASObject, _constructor, CLASS_SEALED); + REGISTER_GETTER_SETTER(c, fieldOfView); + REGISTER_GETTER_SETTER(c, focalLength); + REGISTER_GETTER_SETTER(c, projectionCenter); } +ASFUNCTIONBODY_GETTER_SETTER_NOT_IMPLEMENTED(PerspectiveProjection, fieldOfView); +ASFUNCTIONBODY_GETTER_SETTER_NOT_IMPLEMENTED(PerspectiveProjection, focalLength); +ASFUNCTIONBODY_GETTER_SETTER_NOT_IMPLEMENTED(PerspectiveProjection, projectionCenter); ASFUNCTIONBODY(PerspectiveProjection,_constructor) {
View file
lightspark.tar.xz/src/scripting/flash/geom/flashgeom.h
Changed
@@ -186,12 +186,14 @@ }; class DisplayObject; +class PerspectiveProjection; +class Matrix3D; class Transform: public ASObject { private: _NR<DisplayObject> owner; public: - Transform(Class_base* c):ASObject(c){}; + Transform(Class_base* c); Transform(Class_base* c, _R<DisplayObject> o); ASFUNCTION(_constructor); static void sinit(Class_base* c); @@ -202,7 +204,9 @@ ASFUNCTION(_getMatrix); ASFUNCTION(_setMatrix); ASFUNCTION(_getConcatenatedMatrix); - + ASPROPERTY_GETTER_SETTER(_NR<PerspectiveProjection>, perspectiveProjection); + ASPROPERTY_GETTER_SETTER(_NR<Matrix3D>, matrix3D); + }; class Vector3D: public ASObject @@ -254,14 +258,18 @@ static void sinit(Class_base* c); ASFUNCTION(_constructor); + ASFUNCTION(clone); }; class PerspectiveProjection: public ASObject { public: - PerspectiveProjection(Class_base* c):ASObject(c){} + PerspectiveProjection(Class_base* c):ASObject(c),fieldOfView(0),focalLength(0) {} static void sinit(Class_base* c); ASFUNCTION(_constructor); + ASPROPERTY_GETTER_SETTER(number_t, fieldOfView); + ASPROPERTY_GETTER_SETTER(number_t, focalLength); + ASPROPERTY_GETTER_SETTER(_NR<Point>, projectionCenter); }; }
View file
lightspark.tar.xz/src/scripting/flash/ui/Mouse.cpp
Changed
@@ -36,6 +36,7 @@ c->setDeclaredMethodByQName("cursor","",Class<IFunction>::getFunction(c->getSystemState(),setCursor),SETTER_METHOD,false); c->setDeclaredMethodByQName("supportsCursor","",Class<IFunction>::getFunction(c->getSystemState(),getSupportsCursor),GETTER_METHOD,false); c->setDeclaredMethodByQName("supportsNativeCursor","",Class<IFunction>::getFunction(c->getSystemState(),getSupportsNativeCursor),GETTER_METHOD,false); + c->setDeclaredMethodByQName("registerCursor","",Class<IFunction>::getFunction(c->getSystemState(),registerCursor),NORMAL_METHOD,false); } ASFUNCTIONBODY(Mouse, hide) @@ -73,3 +74,38 @@ { return abstract_b(getSys(),false); // until registerCursor() is implemented } + +ASFUNCTIONBODY(Mouse, registerCursor) +{ + tiny_string cursorName; + _NR<MouseCursorData> mousecursordata; + ARG_UNPACK(cursorName) (mousecursordata); + LOG(LOG_NOT_IMPLEMENTED,"Mouse.registerCursor is not implemented"); + return NULL; +} +void MouseCursor::sinit(Class_base* c) +{ + CLASS_SETUP(c, ASObject, _constructorNotInstantiatable, CLASS_FINAL | CLASS_SEALED); + c->setVariableByQName("ARROW","",abstract_s(c->getSystemState(),"arrow"),CONSTANT_TRAIT); + c->setVariableByQName("AUTO","",abstract_s(c->getSystemState(),"auto"),CONSTANT_TRAIT); + c->setVariableByQName("BUTTON","",abstract_s(c->getSystemState(),"button"),CONSTANT_TRAIT); + c->setVariableByQName("HAND","",abstract_s(c->getSystemState(),"hand"),CONSTANT_TRAIT); + c->setVariableByQName("IBEAM","",abstract_s(c->getSystemState(),"ibeam"),CONSTANT_TRAIT); +} +void MouseCursorData::sinit(Class_base* c) +{ + CLASS_SETUP(c, ASObject, _constructor, CLASS_FINAL | CLASS_SEALED); + REGISTER_GETTER_SETTER(c, data); + REGISTER_GETTER_SETTER(c, frameRate); + REGISTER_GETTER_SETTER(c, hotSpot); + +} +ASFUNCTIONBODY_GETTER_SETTER(MouseCursorData, data); +ASFUNCTIONBODY_GETTER_SETTER(MouseCursorData, frameRate); +ASFUNCTIONBODY_GETTER_SETTER(MouseCursorData, hotSpot); + +ASFUNCTIONBODY(MouseCursorData,_constructor) +{ + LOG(LOG_NOT_IMPLEMENTED,"MouseCursorData is not implemented"); + return NULL; +}
View file
lightspark.tar.xz/src/scripting/flash/ui/Mouse.h
Changed
@@ -21,6 +21,8 @@ #define SCRIPTING_FLASH_UI_MOUSE_H 1 #include "asobject.h" +#include "scripting/flash/geom/flashgeom.h" +#include "scripting/toplevel/Vector.h" namespace lightspark { @@ -36,6 +38,25 @@ ASFUNCTION(setCursor); ASFUNCTION(getSupportsCursor); ASFUNCTION(getSupportsNativeCursor); + ASFUNCTION(registerCursor); +}; + +class MouseCursor : public ASObject +{ +public: + MouseCursor(Class_base* c):ASObject(c){} + static void sinit(Class_base* c); +}; + +class MouseCursorData : public ASObject +{ +public: + MouseCursorData(Class_base* c):ASObject(c),frameRate(0){} + static void sinit(Class_base* c); + ASFUNCTION(_constructor); + ASPROPERTY_GETTER_SETTER(_NR<Vector>,data); + ASPROPERTY_GETTER_SETTER(number_t,frameRate); + ASPROPERTY_GETTER_SETTER(_NR<Point>,hotSpot); }; };
View file
lightspark.tar.xz/src/scripting/flash/ui/Multitouch.cpp
Changed
@@ -31,18 +31,14 @@ void Multitouch::sinit(Class_base* c) { CLASS_SETUP(c, ASObject, _constructorNotInstantiatable, CLASS_FINAL | CLASS_SEALED); - c->setDeclaredMethodByQName("inputMode","",Class<IFunction>::getFunction(c->getSystemState(),getInputMode),GETTER_METHOD,false); c->setDeclaredMethodByQName("maxTouchPoints","",Class<IFunction>::getFunction(c->getSystemState(),getMaxTouchPoints),GETTER_METHOD,false); c->setDeclaredMethodByQName("supportedGestures","",Class<IFunction>::getFunction(c->getSystemState(),getSupportedGestures),GETTER_METHOD,false); c->setDeclaredMethodByQName("supportsGestureEvents","",Class<IFunction>::getFunction(c->getSystemState(),getSupportsGestureEvents),GETTER_METHOD,false); c->setDeclaredMethodByQName("supportsTouchEvents","",Class<IFunction>::getFunction(c->getSystemState(),getSupportsTouchEvents),GETTER_METHOD,false); + REGISTER_GETTER_SETTER(c, inputMode); } -ASFUNCTIONBODY(Multitouch, getInputMode) -{ - LOG(LOG_NOT_IMPLEMENTED,"Multitouch not supported"); - return abstract_s(getSys(),"gesture"); -} +ASFUNCTIONBODY_GETTER_SETTER(Multitouch, inputMode); ASFUNCTIONBODY(Multitouch, getMaxTouchPoints) { @@ -65,3 +61,11 @@ LOG(LOG_NOT_IMPLEMENTED,"Multitouch not supported"); return abstract_b(getSys(),false); } + +void MultitouchInputMode::sinit(Class_base* c) +{ + CLASS_SETUP(c, ASObject, _constructorNotInstantiatable, CLASS_FINAL | CLASS_SEALED); + c->setVariableByQName("GESTURE","",abstract_s(c->getSystemState(),"gesture"),CONSTANT_TRAIT); + c->setVariableByQName("NONE","",abstract_s(c->getSystemState(),"none"),CONSTANT_TRAIT); + c->setVariableByQName("TOUCH_POINT","",abstract_s(c->getSystemState(),"touchPoint"),CONSTANT_TRAIT); +}
View file
lightspark.tar.xz/src/scripting/flash/ui/Multitouch.h
Changed
@@ -27,15 +27,20 @@ class Multitouch : public ASObject { public: - Multitouch(Class_base* c):ASObject(c){} + Multitouch(Class_base* c):ASObject(c),inputMode("gesture") {} static void sinit(Class_base* c); - ASFUNCTION(getInputMode); + ASPROPERTY_GETTER_SETTER(tiny_string,inputMode); ASFUNCTION(getMaxTouchPoints); ASFUNCTION(getSupportedGestures); ASFUNCTION(getSupportsGestureEvents); ASFUNCTION(getSupportsTouchEvents); }; - +class MultitouchInputMode : public ASObject +{ +public: + MultitouchInputMode(Class_base* c):ASObject(c){} + static void sinit(Class_base* c); +}; } #endif /* SCRIPTING_FLASH_UI_MULTITOUCH_H */
View file
lightspark.tar.xz/src/scripting/toplevel/XML.cpp
Changed
@@ -107,17 +107,22 @@ c->prototype->setVariableByQName("valueOf","",Class<IFunction>::getFunction(c->getSystemState(),valueOf),DYNAMIC_TRAIT); c->setDeclaredMethodByQName("valueOf",AS3,Class<IFunction>::getFunction(c->getSystemState(),valueOf),NORMAL_METHOD,true); c->setDeclaredMethodByQName("toXMLString",AS3,Class<IFunction>::getFunction(c->getSystemState(),toXMLString),NORMAL_METHOD,true); - c->prototype->setVariableByQName("nodeKind","",Class<IFunction>::getFunction(c->getSystemState(),nodeKind),DYNAMIC_TRAIT); c->setDeclaredMethodByQName("nodeKind",AS3,Class<IFunction>::getFunction(c->getSystemState(),nodeKind),NORMAL_METHOD,true); + c->prototype->setVariableByQName("nodeKind","",Class<IFunction>::getFunction(c->getSystemState(),nodeKind),DYNAMIC_TRAIT); + c->setDeclaredMethodByQName("nodeKind",AS3,Class<IFunction>::getFunction(c->getSystemState(),nodeKind),NORMAL_METHOD,true); c->setDeclaredMethodByQName("child",AS3,Class<IFunction>::getFunction(c->getSystemState(),child),NORMAL_METHOD,true); + c->prototype->setVariableByQName("child","",Class<IFunction>::getFunction(c->getSystemState(),child),DYNAMIC_TRAIT); c->setDeclaredMethodByQName("children",AS3,Class<IFunction>::getFunction(c->getSystemState(),children),NORMAL_METHOD,true); c->setDeclaredMethodByQName("childIndex",AS3,Class<IFunction>::getFunction(c->getSystemState(),childIndex),NORMAL_METHOD,true); c->setDeclaredMethodByQName("contains",AS3,Class<IFunction>::getFunction(c->getSystemState(),contains),NORMAL_METHOD,true); c->setDeclaredMethodByQName("attribute",AS3,Class<IFunction>::getFunction(c->getSystemState(),attribute),NORMAL_METHOD,true); + c->prototype->setVariableByQName("attribute","",Class<IFunction>::getFunction(c->getSystemState(),attribute),DYNAMIC_TRAIT); c->setDeclaredMethodByQName("attributes",AS3,Class<IFunction>::getFunction(c->getSystemState(),attributes),NORMAL_METHOD,true); c->setDeclaredMethodByQName("length",AS3,Class<IFunction>::getFunction(c->getSystemState(),length),NORMAL_METHOD,true); c->setDeclaredMethodByQName("localName",AS3,Class<IFunction>::getFunction(c->getSystemState(),localName),NORMAL_METHOD,true); + c->prototype->setVariableByQName("localName","",Class<IFunction>::getFunction(c->getSystemState(),localName),DYNAMIC_TRAIT); c->setDeclaredMethodByQName("name",AS3,Class<IFunction>::getFunction(c->getSystemState(),name),NORMAL_METHOD,true); c->setDeclaredMethodByQName("namespace",AS3,Class<IFunction>::getFunction(c->getSystemState(),_namespace),NORMAL_METHOD,true); + c->prototype->setVariableByQName("namespace","",Class<IFunction>::getFunction(c->getSystemState(),_namespace),DYNAMIC_TRAIT); c->setDeclaredMethodByQName("normalize",AS3,Class<IFunction>::getFunction(c->getSystemState(),_normalize),NORMAL_METHOD,true); c->setDeclaredMethodByQName("descendants",AS3,Class<IFunction>::getFunction(c->getSystemState(),descendants),NORMAL_METHOD,true); c->setDeclaredMethodByQName("appendChild",AS3,Class<IFunction>::getFunction(c->getSystemState(),_appendChild),NORMAL_METHOD,true); @@ -128,6 +133,7 @@ c->prototype->setVariableByQName("hasComplexContent",AS3,Class<IFunction>::getFunction(c->getSystemState(),_hasComplexContent),DYNAMIC_TRAIT); c->setDeclaredMethodByQName("text",AS3,Class<IFunction>::getFunction(c->getSystemState(),text),NORMAL_METHOD,true); c->setDeclaredMethodByQName("elements",AS3,Class<IFunction>::getFunction(c->getSystemState(),elements),NORMAL_METHOD,true); + c->prototype->setVariableByQName("elements","",Class<IFunction>::getFunction(c->getSystemState(),elements),DYNAMIC_TRAIT); c->setDeclaredMethodByQName("setLocalName",AS3,Class<IFunction>::getFunction(c->getSystemState(),_setLocalName),NORMAL_METHOD,true); c->setDeclaredMethodByQName("setName",AS3,Class<IFunction>::getFunction(c->getSystemState(),_setName),NORMAL_METHOD,true); c->setDeclaredMethodByQName("setNamespace",AS3,Class<IFunction>::getFunction(c->getSystemState(),_setNamespace),NORMAL_METHOD,true);
View file
lightspark.tar.xz/tools/pygil
Changed
@@ -14,17 +14,17 @@ #These regexp are used for finding important pieces in the source sinit = re.compile('.*void\s*(\w*)::sinit\(.*') rconstructor = re.compile('[^/]*ASFUNCTIONBODY\( *([^,]*), *\_constructor\)') -#looks like builtin->registerBuiltin("Capabilities","flash.system",Class<Capabilities>::getRef()); -rclass = re.compile('.*builtin->registerBuiltin\( *"([^"]*)", *"([^"]*)", *Class<([^>]*)>::getRef\(\)\)') -rtemplateclass = re.compile('.*builtin->registerBuiltin\( *"([^"]*)", *"([^"]*)", *_MR\(Template<([^>]*)>::getTemplate\(\)\)\)') -rinterfaceclass = re.compile('.*builtin->registerBuiltin\( *"([^"]*)", *"([^"]*)", *InterfaceClass<([^>]*)>::getRef\(\)\)') +#looks like builtin->registerBuiltin("Capabilities","flash.system",Class<Capabilities>::getRef(m_sys)); +rclass = re.compile('.*builtin->registerBuiltin\( *"([^"]*)", *"([^"]*)", *Class<([^>]*)>::getRef\(m\_sys\)\)') +rtemplateclass = re.compile('.*builtin->registerBuiltin\( *"([^"]*)", *"([^"]*)", *_MR\(Template<([^>]*)>::getTemplate\(m\_sys\)\)\)') +rinterfaceclass = re.compile('.*builtin->registerBuiltin\( *"([^"]*)", *"([^"]*)", *InterfaceClass<([^>]*)>::getRef\(m\_sys\)\)') #looks like builtin->registerBuiltin("Socket","flash.net",Class<ASObject>::getStubClass(QName("Socket","flash.net"))); rstupclass = re.compile('.*builtin->registerBuiltin\( *"([^"]*)", *"([^"]*)", *Class<ASObject>::getStubClass\(QName.*') #the line may start with anything but a comment character -rget = re.compile('[^/]*->setDeclaredMethodByQName\( *"([^"]*)", *([^,]*),[^,]*, *GETTER_METHOD, *([^ ]*)') -rset = re.compile('[^/]*->setDeclaredMethodByQName\( *"([^"]*)", *([^,]*),[^,]*, *SETTER_METHOD, *([^ ]*)') -rmet = re.compile('[^/]*->setDeclaredMethodByQName\( *"([^"]*)", *([^,]*),[^,]*,(\w\),)* *NORMAL_METHOD, *([^ ]*)') -rmet2 = re.compile('[^/]*->prototype->setVariableByQName\( *"([^"]*)", *([^,]*),[^,]*,(\w\),)* *[A-Z]*\_TRAIT') +rget = re.compile('[^/]*->setDeclaredMethodByQName\( *"([^"]*)", *([^,]*),[^,]*,[^,]*, *GETTER_METHOD, *([^ ]*)') +rset = re.compile('[^/]*->setDeclaredMethodByQName\( *"([^"]*)", *([^,]*),[^,]*,[^,]*, *SETTER_METHOD, *([^ ]*)') +rmet = re.compile('[^/]*->setDeclaredMethodByQName\( *"([^"]*)", *([^,]*),[^,]*,[^,]*,(\w\),)* *NORMAL_METHOD, *([^ ]*)') +rmet2 = re.compile('[^/]*->prototype->setVariableByQName\( *"([^"]*)", *([^,]*),[^,]*,[^,]*,(\w\),)* *[A-Z]*\_TRAIT') rget2 = re.compile('.*REGISTER_GETTER\([^,]*, *(.*)\)') rset2 = re.compile('.*REGISTER_SETTER\([^,]*, *(.*)\)') rgetset2 = re.compile('.*REGISTER_GETTER_SETTER\([^,]*, *(.*)\)')
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.