Skip to content

Commit

Permalink
core: fix external type usage
Browse files Browse the repository at this point in the history
  • Loading branch information
vaxerski committed May 29, 2024
1 parent 24cf55c commit 6fdc0ce
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
Expand Down Expand Up @@ -255,7 +260,7 @@ struct wl_resource;
for (auto& iface : XMLDATA.ifaces) {
const auto IFACE_CLASS_NAME_CAMEL = camelize("C_" + iface.name);
HEADER += std::format("\nclass {};", IFACE_CLASS_NAME_CAMEL);

for (auto& rq : iface.requests) {
for (auto& arg : rq.args) {
if (!arg.interface.empty()) {
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 6fdc0ce

Please sign in to comment.