mirror of
https://github.com/hyprwm/hyprwayland-scanner.git
synced 2025-01-09 20:49:48 +01:00
add no iface
This commit is contained in:
parent
85f1334c51
commit
b860f59da9
1 changed files with 34 additions and 26 deletions
14
src/main.cpp
14
src/main.cpp
|
@ -10,6 +10,7 @@
|
|||
|
||||
bool waylandEnums = false;
|
||||
bool clientCode = false;
|
||||
bool noInterfaces = false;
|
||||
|
||||
struct SRequestArgument {
|
||||
std::string wlType;
|
||||
|
@ -761,6 +762,7 @@ void {}::{}({}) {{
|
|||
const auto MESSAGE_NAME_EVENTS = camelize(std::string{"_"} + "C_" + IFACE_NAME + "_events");
|
||||
|
||||
// message
|
||||
if (!noInterfaces) {
|
||||
if (iface.requests.size() > 0) {
|
||||
SOURCE += std::format(R"#(
|
||||
static const wl_message {}[] = {{
|
||||
|
@ -793,14 +795,15 @@ static const wl_message {}[] = {{
|
|||
|
||||
// iface
|
||||
SOURCE += std::format(R"#(
|
||||
const wl_interface {} = {{
|
||||
const wl_interface {} = {{false
|
||||
"{}", {},
|
||||
{}, {},
|
||||
{}, {},
|
||||
}};
|
||||
)#",
|
||||
IFACE_WL_NAME, iface.name, iface.version, iface.requests.size(), (iface.requests.size() > 0 ? MESSAGE_NAME_REQUESTS : "nullptr"), iface.events.size(),
|
||||
(iface.events.size() > 0 ? MESSAGE_NAME_EVENTS : "nullptr"));
|
||||
IFACE_WL_NAME, iface.name, iface.version, iface.requests.size(), (iface.requests.size() > 0 ? MESSAGE_NAME_REQUESTS : "nullptr"),
|
||||
iface.events.size(), (iface.events.size() > 0 ? MESSAGE_NAME_EVENTS : "nullptr"));
|
||||
}
|
||||
|
||||
// protocol body
|
||||
if (!clientCode) {
|
||||
|
@ -906,6 +909,11 @@ int main(int argc, char** argv, char** envp) {
|
|||
continue;
|
||||
}
|
||||
|
||||
if (curarg == "--no-interfaces") {
|
||||
noInterfaces = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (curarg == "--wayland-enums") {
|
||||
waylandEnums = true;
|
||||
continue;
|
||||
|
|
Loading…
Reference in a new issue