mirror of
https://github.com/hyprwm/hyprwayland-scanner.git
synced 2024-11-26 01:45:57 +01:00
source: fix missed defines
This commit is contained in:
parent
4dc342bc1d
commit
f2e8642342
1 changed files with 20 additions and 0 deletions
20
src/main.cpp
20
src/main.cpp
|
@ -277,6 +277,7 @@ void parseSource() {
|
||||||
SOURCE += std::format(R"#(#define private public
|
SOURCE += std::format(R"#(#define private public
|
||||||
#include "{}.hpp"
|
#include "{}.hpp"
|
||||||
#undef private
|
#undef private
|
||||||
|
#define F std::function
|
||||||
)#",
|
)#",
|
||||||
PROTO_DATA.fileName);
|
PROTO_DATA.fileName);
|
||||||
|
|
||||||
|
@ -506,7 +507,26 @@ void {}::onDestroyCalled() {{
|
||||||
)#",
|
)#",
|
||||||
IFACE_CLASS_NAME_CAMEL, IFACE_CLASS_NAME_CAMEL, IFACE_NAME + "_interface", IFACE_CLASS_NAME_CAMEL, IFACE_VTABLE_NAME, IFACE_CLASS_NAME_CAMEL,
|
IFACE_CLASS_NAME_CAMEL, IFACE_CLASS_NAME_CAMEL, IFACE_NAME + "_interface", IFACE_CLASS_NAME_CAMEL, IFACE_VTABLE_NAME, IFACE_CLASS_NAME_CAMEL,
|
||||||
IFACE_CLASS_NAME_CAMEL, IFACE_CLASS_NAME_CAMEL);
|
IFACE_CLASS_NAME_CAMEL, IFACE_CLASS_NAME_CAMEL);
|
||||||
|
|
||||||
|
for (auto& rq : iface.requests) {
|
||||||
|
std::string args = ", ";
|
||||||
|
for (auto& arg : rq.args) {
|
||||||
|
args += arg.CType + ", ";
|
||||||
|
}
|
||||||
|
|
||||||
|
args.pop_back();
|
||||||
|
args.pop_back();
|
||||||
|
|
||||||
|
SOURCE += std::format(R"#(
|
||||||
|
void {}::{}(F<void(wl_client*, wl_resource*{})> handler) {{
|
||||||
|
requests.{} = handler;
|
||||||
|
}}
|
||||||
|
)#",
|
||||||
|
IFACE_CLASS_NAME_CAMEL, camelize("set_" + rq.name), args, camelize(rq.name));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SOURCE += "\n#undef F\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char** argv, char** envp) {
|
int main(int argc, char** argv, char** envp) {
|
||||||
|
|
Loading…
Reference in a new issue