q66 pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=0061d5a43747af20755b806a4f150dee68a9a0d3

commit 0061d5a43747af20755b806a4f150dee68a9a0d3
Author: Daniel Kolesa <[email protected]>
Date:   Wed Sep 24 11:51:11 2014 +0100

    elua: Eo metatype with method table redirection
---
 src/bindings/luajit/eo.lua | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/src/bindings/luajit/eo.lua b/src/bindings/luajit/eo.lua
index c80a568..e72db2a 100644
--- a/src/bindings/luajit/eo.lua
+++ b/src/bindings/luajit/eo.lua
@@ -181,6 +181,23 @@ M.__do_end = function()
                        -- only for cleanup (dtor)
 end
 
+local eo_methods = {
+}
+
+ffi.metatype("Eo", {
+    __index = function(self, key)
+        local v = rawget(eo_methods, key)
+        if v ~= nil then return v end
+        local cl = eo.eo_class_get(self)
+        if cl == nil then return nil end
+        local nm = eo.eo_class_name_get(cl)
+        if nm == nil then return nil end
+        local mt == classes[nm]
+        if mt == nil then return nil end
+        return mt[key]
+    end
+})
+
 M.Eo_Base = util.Object:clone {
 }
 

-- 


Reply via email to