MCPcopy Create free account
hub / github.com/LibreSprite/LibreSprite / getScriptObject

Method getScriptObject

src/script/engine.h:63–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61
62 template<typename Type>
63 ScriptObject* getScriptObject(Type* obj, bool own = false) {
64 if (!obj) {
65 return nullptr;
66 }
67 if (auto it = m_ObjToScriptObj.find(obj); it != m_ObjToScriptObj.end() && it->second->handle) {
68 return it->second->script;
69 }
70 inject<ScriptObject> sobj{typeid(obj).name()};
71 if (!sobj) {
72 return nullptr;
73 }
74 sobj->setWrapped(obj->handle(), own);
75 return registerScriptObject(std::move(sobj));
76 }
77
78 ScriptObject* create(const std::string& name) {
79 inject<ScriptObject> sobj{name};

Callers 8

addPaletteMethod · 0.80
SpriteScriptObjectMethod · 0.80
layerMethod · 0.80
LayerScriptObjectMethod · 0.80
DocumentScriptObjectMethod · 0.80
CelScriptObjectMethod · 0.80
AppScriptObjectMethod · 0.80
openMethod · 0.80

Calls 4

setWrappedMethod · 0.80
endMethod · 0.45
nameMethod · 0.45
handleMethod · 0.45

Tested by

no test coverage detected