forked from enlightenment/efl
elua: do not generate entirely new list types
This commit is contained in:
parent
22d03089fc
commit
65bf6cd6ac
|
@ -277,14 +277,17 @@ local List_Base = util.Readonly_Object:clone {
|
||||||
}
|
}
|
||||||
M.List_Base = List_Base
|
M.List_Base = List_Base
|
||||||
|
|
||||||
M.gen_list_type = function(tp)
|
M.Ptr_List = List_Base:clone {
|
||||||
return List_Base:clone {
|
__ctor = function(self, selfmt, ptrtype, list, freefunc)
|
||||||
data_get = function(self, ptr)
|
List_Base.__ctor(self, selfmt, list, freefunc)
|
||||||
ptr = List_Base.data_get(self, ptr)
|
selfmt.ptrtype = ptrtype
|
||||||
return ffi.cast(tp, ptr)
|
end,
|
||||||
end
|
|
||||||
}
|
data_get = function(self, ptr)
|
||||||
end
|
ptr = List_Base.data_get(self, ptr)
|
||||||
|
return ffi.cast(dgetmt(self).ptrtype, ptr)
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
M.String_List = List_Base:clone {
|
M.String_List = List_Base:clone {
|
||||||
data_get = function(self, ptr)
|
data_get = function(self, ptr)
|
||||||
|
|
|
@ -104,6 +104,8 @@ local util = require("util")
|
||||||
|
|
||||||
local list = require("eina.list")
|
local list = require("eina.list")
|
||||||
|
|
||||||
|
local Ptr_List = list.Ptr_List
|
||||||
|
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
local eolian
|
local eolian
|
||||||
|
@ -162,8 +164,6 @@ M.function_scope = {
|
||||||
PROTECTED = 1
|
PROTECTED = 1
|
||||||
}
|
}
|
||||||
|
|
||||||
local Eolian_Parameters_List = list.gen_list_type("Eolian_Function_Parameter*")
|
|
||||||
|
|
||||||
M.Function = ffi.metatype("Eolian_Function", {
|
M.Function = ffi.metatype("Eolian_Function", {
|
||||||
__index = {
|
__index = {
|
||||||
type_get = function(self)
|
type_get = function(self)
|
||||||
|
@ -201,17 +201,17 @@ M.Function = ffi.metatype("Eolian_Function", {
|
||||||
end,
|
end,
|
||||||
|
|
||||||
property_keys_list_get = function(self)
|
property_keys_list_get = function(self)
|
||||||
return Eolian_Parameters_List(
|
return Ptr_List("Eolian_Function_Parameter*",
|
||||||
eolian.eolian_property_keys_list_get(self)):to_array()
|
eolian.eolian_property_keys_list_get(self)):to_array()
|
||||||
end,
|
end,
|
||||||
|
|
||||||
property_values_list_get = function(self)
|
property_values_list_get = function(self)
|
||||||
return Eolian_Parameters_List(
|
return Ptr_List("Eolian_Function_Parameter*",
|
||||||
eolian.eolian_property_values_list_get(self)):to_array()
|
eolian.eolian_property_values_list_get(self)):to_array()
|
||||||
end,
|
end,
|
||||||
|
|
||||||
parameters_list_get = function(self)
|
parameters_list_get = function(self)
|
||||||
return Eolian_Parameters_List(
|
return Ptr_List("Eolian_Function_Parameter*",
|
||||||
eolian.eolian_parameters_list_get(self)):to_array()
|
eolian.eolian_parameters_list_get(self)):to_array()
|
||||||
end,
|
end,
|
||||||
|
|
||||||
|
@ -354,10 +354,6 @@ M.class_type = {
|
||||||
INTERFACE = 4
|
INTERFACE = 4
|
||||||
}
|
}
|
||||||
|
|
||||||
local Eolian_Functions_List = list.gen_list_type("Eolian_Function*")
|
|
||||||
local Eolian_Implements_List = list.gen_list_type("Eolian_Implement*")
|
|
||||||
local Eolian_Events_List = list.gen_list_type("Eolian_Event*")
|
|
||||||
|
|
||||||
M.Class = ffi.metatype("Eolian_Class", {
|
M.Class = ffi.metatype("Eolian_Class", {
|
||||||
__index = {
|
__index = {
|
||||||
file_get = function(self)
|
file_get = function(self)
|
||||||
|
@ -417,7 +413,7 @@ M.Class = ffi.metatype("Eolian_Class", {
|
||||||
end,
|
end,
|
||||||
|
|
||||||
functions_list_get = function(self, func_type)
|
functions_list_get = function(self, func_type)
|
||||||
return Eolian_Functions_List(
|
return Ptr_List("Eolian_Function*",
|
||||||
eolian.eolian_class_functions_list_get(self, func_type))
|
eolian.eolian_class_functions_list_get(self, func_type))
|
||||||
:to_array()
|
:to_array()
|
||||||
end,
|
end,
|
||||||
|
@ -430,12 +426,12 @@ M.Class = ffi.metatype("Eolian_Class", {
|
||||||
end,
|
end,
|
||||||
|
|
||||||
implements_list_get = function(self)
|
implements_list_get = function(self)
|
||||||
return Eolian_Implements_List(
|
return Ptr_List("Eolian_Implement*",
|
||||||
eolian.eolian_class_implements_list_get(self)):to_array()
|
eolian.eolian_class_implements_list_get(self)):to_array()
|
||||||
end,
|
end,
|
||||||
|
|
||||||
events_list_get = function(self)
|
events_list_get = function(self)
|
||||||
return Eolian_Events_List(
|
return Ptr_List("Eolian_Event*",
|
||||||
eolian.eolian_class_events_list_get(self)):to_array()
|
eolian.eolian_class_events_list_get(self)):to_array()
|
||||||
end,
|
end,
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue