From 24cf55c95717828a33b7d0afbd8e19939ac959d0 Mon Sep 17 00:00:00 2001 From: vaxerski Date: Wed, 29 May 2024 22:25:22 +0200 Subject: [PATCH] core: forward declare all used ifaces --- src/main.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 654e2d2..0a307a3 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -255,6 +255,22 @@ 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()) { + HEADER += std::format("\nclass {};", camelize("C_" + arg.interface)); + } + } + } + + for (auto& rq : iface.events) { + for (auto& arg : rq.args) { + if (!arg.interface.empty()) { + HEADER += std::format("\nclass {};", camelize("C_" + arg.interface)); + } + } + } } HEADER += "\n\n#ifndef HYPRWAYLAND_SCANNER_NO_INTERFACES\n";