core: fix external type usage

This commit is contained in:
Vaxry 2024-05-29 22:31:08 +02:00
parent 24cf55c957
commit 6fdc0ceac9

View file

@ -115,8 +115,13 @@ std::string WPTypeToCType(const SRequestArgument& arg, bool event /* events pass
}
// iface
if (!arg.interface.empty() && event)
return camelize("C_" + arg.interface + "*");
if (!arg.interface.empty() && event) {
for (auto& i : XMLDATA.ifaces) {
if (i.name == arg.interface)
return camelize("C_" + arg.interface + "*");
}
return "wl_resource*";
}
return "uint32_t";
}
@ -372,7 +377,7 @@ class {} {{
HEADER += std::format(" void {}({});\n", camelize("send_" + ev.name), args);
}
// dangerous ones
// dangerous ones
for (auto& ev : iface.events) {
std::string args = "";
for (auto& arg : ev.args) {