aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@samsung.com>2014-09-24 13:49:39 +0100
committerDaniel Kolesa <d.kolesa@samsung.com>2014-09-24 13:49:58 +0100
commit15d9fec0e00cc4b2a632f43711f629c8f9683da3 (patch)
tree004aadf02bf702d03f1f4571f17bce10dd49337c
parentEdje cmake: Add a way to define edje compilation target. (diff)
downloadefl-15d9fec0e00cc4b2a632f43711f629c8f9683da3.tar.gz
elua: class unregister + keep track of Eo_Class
-rw-r--r--src/bindings/luajit/eo.lua18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/bindings/luajit/eo.lua b/src/bindings/luajit/eo.lua
index a74bee43d8..741c4bcee7 100644
--- a/src/bindings/luajit/eo.lua
+++ b/src/bindings/luajit/eo.lua
@@ -104,6 +104,8 @@ ffi.cdef [[
void eo_key_data_del(const char *key);
Eina_Iterator *eo_children_iterator_new(void);
+
+ const Eo_Class *eo_base_class_get(void);
]]
local cutil = require("cutil")
@@ -116,9 +118,11 @@ local eo
local init = function()
eo = util.lib_load("eo")
eo.eo_init()
+ M.class_register("Eo.Base", M.Base, eo.eo_base_class_get())
end
local shutdown = function()
+ M.class_unregister("Eo.Base")
eo.eo_shutdown()
util.lib_unload("eo")
end
@@ -132,16 +136,27 @@ local getfuncname = function(info)
end
local classes = {}
+local eo_classes = {}
M.class_get = function(name)
return classes[name]
end
-M.class_register = function(name, val)
+M.eo_class_get = function(name)
+ return eo_classes[name]
+end
+
+M.class_register = function(name, val, addr)
classes[name] = val
+ eo_classes[name] = addr
return val
end
+M.class_unregister = function(name)
+ classes[name] = nil
+ eo_classes[name] = nil
+end
+
M.__ctor_common = function(self, klass, parent, ctor, loff, ...)
local info = getinfo(2 + (loff or 0), "nlSf")
local source = info.source
@@ -192,6 +207,5 @@ ffi.metatype("Eo", {
M.Base = util.Object:clone {
}
-M.class_register("Eo.Base", M.Base)
return M