forked from enlightenment/efl
eolian-cxx: Workaround for multiple callbacks without corresponding void*data
Added workaround for generating classes with methods that have more than one callback but doesn't have a corresponding void* data parameter. E.g., elm_box.eo.
This commit is contained in:
parent
d21e400425
commit
401cc81355
|
@ -234,8 +234,9 @@ inline unsigned int
|
|||
parameters_count_callbacks(parameters_container_type const& parameters)
|
||||
{
|
||||
unsigned int r = 0u;
|
||||
for (eo_parameter const& param : parameters)
|
||||
if(type_is_callback(param.type))
|
||||
for (auto first = parameters.begin(), last = parameters.end()
|
||||
; first != last ; ++first)
|
||||
if(type_is_callback(first->type) && first + 1 != last)
|
||||
++r;
|
||||
return r;
|
||||
}
|
||||
|
|
|
@ -250,7 +250,7 @@ operator<<(std::ostream& out, inheritance_call_constructor_arguments const& x)
|
|||
for (i=0; i<n; i++)
|
||||
{
|
||||
if(i!=0) out << ", ";
|
||||
out << "args.get<" << i << ">()";
|
||||
out << "::efl::eolian::to_c(args.get<" << i << ">())";
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
|
|
@ -28,11 +28,11 @@ operator<<(std::ostream& out, parameters_declaration const& x)
|
|||
{
|
||||
if (it != first)
|
||||
out << ", ";
|
||||
if (type_is_callback((*it).type))
|
||||
if (type_is_callback((*it).type) && it+1 != last)
|
||||
{
|
||||
out << "F && " << (*it).name;
|
||||
assert(it+1 != last);
|
||||
++it; // skip next.
|
||||
out << "F && " << (*it).name;
|
||||
assert(it+1 != last);
|
||||
++it; // skip next.
|
||||
}
|
||||
else
|
||||
out << reinterpret_type((*it).type) << " " << (*it).name;
|
||||
|
@ -80,12 +80,19 @@ operator<<(std::ostream& out, parameters_list const& x)
|
|||
{
|
||||
if (it != first)
|
||||
out << ", ";
|
||||
out << to_c((*it).type, (*it).name);
|
||||
if (type_is_callback((*it).type))
|
||||
{
|
||||
out << ", _tmp_f";
|
||||
++it; // skip next
|
||||
if(it + 1 != last)
|
||||
{
|
||||
out << to_c((*it).type, (*it).name)
|
||||
<< ", _tmp_f";
|
||||
++it; // skip next
|
||||
}
|
||||
else
|
||||
out << it->name;
|
||||
}
|
||||
else
|
||||
out << to_c((*it).type, (*it).name);
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue