elua: event ffi generation
authorDaniel Kolesa <quaker66@gmail.com>
Tue, 22 Apr 2014 13:09:17 +0000 (14:09 +0100)
committerDaniel Kolesa <d.kolesa@samsung.com>
Tue, 10 Jun 2014 14:48:48 +0000 (15:48 +0100)
src/bin/elua/modules/lualian.lua

index 84c8e067cbcf51ce71b046a67d44cfea05822eee..b0bf1a8df49ff01c8c6df39366464692662c0e56 100644 (file)
@@ -335,14 +335,19 @@ local Property = Method:clone {
 }
 
 local Event = Node:clone {
-    __ctor = function(self, event)
-        self.event = event
+    __ctor = function(self, ename, etype, edesc)
+        self.ename = ename
+        self.etype = etype
+        self.edesc = edesc
     end,
 
     generate = function(self, s, last)
     end,
 
     gen_ffi = function(self, s)
+        s:write("    extern const Eo_Event_Description _",
+            self.parent_node.cname:upper(), "_EVENT_",
+            self.ename:gsub("%W", "_"):upper(), ";\n")
     end,
 
     gen_ctor = function(self, s)
@@ -507,7 +512,8 @@ local gen_contents = function(classn)
     -- events
     local events = eolian.class_events_list_get(classn)
     for i, v in ipairs(events) do
-        cnt[#cnt + 1] = Event(v)
+        local en, et, ed = v:information_get()
+        cnt[#cnt + 1] = Event(en, et, ed)
     end
     return cnt
 end