mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-06 12:00:17 +02:00
Merge pull request #3126 from neobrain/feature_better_wayland_thunks64
Thunks/wayland: Add support for APIs required by zink and Super Meat Boy
This commit is contained in:
3 files changed
+201
-77
No files matched your search
@@ -26,6 +26,7 @@ extern "C" const wl_interface wl_surface_interface {};
|
|||||||
extern "C" const wl_interface wl_keyboard_interface {};
|
extern "C" const wl_interface wl_keyboard_interface {};
|
||||||
extern "C" const wl_interface wl_callback_interface {};
|
extern "C" const wl_interface wl_callback_interface {};
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <charconv>
|
#include <charconv>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
@@ -43,11 +44,13 @@ struct wl_proxy_private {
|
|||||||
// Other data members omitted
|
// Other data members omitted
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// See wayland-util.h for documentation on protocol message signatures
|
||||||
template<char> struct ArgType;
|
template<char> struct ArgType;
|
||||||
template<> struct ArgType<'s'> { using type = const char*; };
|
template<> struct ArgType<'s'> { using type = const char*; };
|
||||||
template<> struct ArgType<'u'> { using type = uint32_t; };
|
template<> struct ArgType<'u'> { using type = uint32_t; };
|
||||||
template<> struct ArgType<'i'> { using type = int32_t; };
|
template<> struct ArgType<'i'> { using type = int32_t; };
|
||||||
template<> struct ArgType<'o'> { using type = wl_proxy*; };
|
template<> struct ArgType<'o'> { using type = wl_proxy*; };
|
||||||
|
template<> struct ArgType<'n'> { using type = wl_proxy*; };
|
||||||
template<> struct ArgType<'a'> { using type = wl_array*; };
|
template<> struct ArgType<'a'> { using type = wl_array*; };
|
||||||
template<> struct ArgType<'f'> { using type = wl_fixed_t; };
|
template<> struct ArgType<'f'> { using type = wl_fixed_t; };
|
||||||
template<> struct ArgType<'h'> { using type = int32_t; }; // fd?
|
template<> struct ArgType<'h'> { using type = int32_t; }; // fd?
|
||||||
@@ -78,66 +81,111 @@ extern "C" int wl_proxy_add_listener(wl_proxy *proxy,
|
|||||||
auto& host_callbacks = proxy_listeners[proxy];
|
auto& host_callbacks = proxy_listeners[proxy];
|
||||||
|
|
||||||
for (int i = 0; i < ((wl_proxy_private*)proxy)->interface->event_count; ++i) {
|
for (int i = 0; i < ((wl_proxy_private*)proxy)->interface->event_count; ++i) {
|
||||||
auto signature = std::string_view { interface->events[i].signature };
|
auto signature_view = std::string_view { interface->events[i].signature };
|
||||||
|
|
||||||
// A leading number indicates the minimum protocol version
|
// A leading number indicates the minimum protocol version
|
||||||
uint32_t since_version = 0;
|
uint32_t since_version = 0;
|
||||||
auto [ptr, res] = std::from_chars(signature.begin(), signature.end(), since_version, 10);
|
auto [ptr, res] = std::from_chars(signature_view.begin(), signature_view.end(), since_version, 10);
|
||||||
signature = signature.substr(ptr - signature.begin());
|
std::string signature { ptr, &*signature_view.end() };
|
||||||
|
|
||||||
if (signature == "u") {
|
// ? just indicates that the argument may be null, so it doesn't change the signature
|
||||||
// E.g. wl_registry::global_remove
|
signature.erase(std::remove(signature.begin(), signature.end(), '?'), signature.end());
|
||||||
host_callbacks[i] = WaylandAllocateHostTrampolineForGuestListener<'u'>(callback[i]);
|
|
||||||
} else if (signature == "usu") {
|
if (signature == "") {
|
||||||
// E.g. wl_registry::global
|
|
||||||
host_callbacks[i] = WaylandAllocateHostTrampolineForGuestListener<'u', 's', 'u'>(callback[i]);
|
|
||||||
} else if (signature == "s") {
|
|
||||||
// E.g. wl_seat::name
|
|
||||||
host_callbacks[i] = WaylandAllocateHostTrampolineForGuestListener<'s'>(callback[i]);
|
|
||||||
} else if (signature == "") {
|
|
||||||
// E.g. xdg_toplevel::close
|
// E.g. xdg_toplevel::close
|
||||||
host_callbacks[i] = WaylandAllocateHostTrampolineForGuestListener<>(callback[i]);
|
host_callbacks[i] = WaylandAllocateHostTrampolineForGuestListener<>(callback[i]);
|
||||||
|
} else if (signature == "a") {
|
||||||
|
// E.g. xdg_toplevel::wm_capabilities
|
||||||
|
host_callbacks[i] = WaylandAllocateHostTrampolineForGuestListener<'a'>(callback[i]);
|
||||||
|
} else if (signature == "hu") {
|
||||||
|
// E.g. zwp_linux_dmabuf_feedback_v1::format_table
|
||||||
|
host_callbacks[i] = WaylandAllocateHostTrampolineForGuestListener<'h', 'u'>(callback[i]);
|
||||||
|
} else if (signature == "i") {
|
||||||
|
// E.g. wl_output_listener::scale
|
||||||
|
host_callbacks[i] = WaylandAllocateHostTrampolineForGuestListener<'i'>(callback[i]);
|
||||||
|
} else if (signature == "if") {
|
||||||
|
// E.g. wl_touch_listener::orientation
|
||||||
|
host_callbacks[i] = WaylandAllocateHostTrampolineForGuestListener<'i', 'f'>(callback[i]);
|
||||||
|
} else if (signature == "iff") {
|
||||||
|
// E.g. wl_touch_listener::shape
|
||||||
|
host_callbacks[i] = WaylandAllocateHostTrampolineForGuestListener<'i', 'f', 'f'>(callback[i]);
|
||||||
} else if (signature == "ii") {
|
} else if (signature == "ii") {
|
||||||
// E.g. xdg_toplevel::configure_bounds
|
// E.g. xdg_toplevel::configure_bounds
|
||||||
host_callbacks[i] = WaylandAllocateHostTrampolineForGuestListener<'i', 'i'>(callback[i]);
|
host_callbacks[i] = WaylandAllocateHostTrampolineForGuestListener<'i', 'i'>(callback[i]);
|
||||||
} else if (signature == "iia") {
|
} else if (signature == "iia") {
|
||||||
// E.g. xdg_toplevel::configure
|
// E.g. xdg_toplevel::configure
|
||||||
host_callbacks[i] = WaylandAllocateHostTrampolineForGuestListener<'i', 'i', 'a'>(callback[i]);
|
host_callbacks[i] = WaylandAllocateHostTrampolineForGuestListener<'i', 'i', 'a'>(callback[i]);
|
||||||
} else if (signature == "a") {
|
} else if (signature == "iiiiissi") {
|
||||||
// E.g. xdg_toplevel::wm_capabilities
|
// E.g. wl_output_listener::geometry
|
||||||
host_callbacks[i] = WaylandAllocateHostTrampolineForGuestListener<'a'>(callback[i]);
|
host_callbacks[i] = WaylandAllocateHostTrampolineForGuestListener<'i', 'i', 'i', 'i', 'i', 's', 's', 'i'>(callback[i]);
|
||||||
} else if (signature == "uoff") {
|
} else if (signature == "n") {
|
||||||
// E.g. wl_pointer_listener::enter
|
// E.g. wl_data_device_listener::data_offer
|
||||||
host_callbacks[i] = WaylandAllocateHostTrampolineForGuestListener<'u', 'o', 'f', 'f'>(callback[i]);
|
host_callbacks[i] = WaylandAllocateHostTrampolineForGuestListener<'n'>(callback[i]);
|
||||||
} else if (signature == "uo") {
|
} else if (signature == "o") {
|
||||||
// E.g. wl_pointer_listener::leave
|
// E.g. wl_data_device_listener::selection
|
||||||
host_callbacks[i] = WaylandAllocateHostTrampolineForGuestListener<'u', 'o'>(callback[i]);
|
host_callbacks[i] = WaylandAllocateHostTrampolineForGuestListener<'o'>(callback[i]);
|
||||||
|
} else if (signature == "u") {
|
||||||
|
// E.g. wl_registry::global_remove
|
||||||
|
host_callbacks[i] = WaylandAllocateHostTrampolineForGuestListener<'u'>(callback[i]);
|
||||||
} else if (signature == "uff") {
|
} else if (signature == "uff") {
|
||||||
// E.g. wl_pointer_listener::motion
|
// E.g. wl_pointer_listener::motion
|
||||||
host_callbacks[i] = WaylandAllocateHostTrampolineForGuestListener<'u', 'f', 'f'>(callback[i]);
|
host_callbacks[i] = WaylandAllocateHostTrampolineForGuestListener<'u', 'f', 'f'>(callback[i]);
|
||||||
} else if (signature == "uuuu") {
|
|
||||||
// E.g. wl_pointer_listener::button
|
|
||||||
host_callbacks[i] = WaylandAllocateHostTrampolineForGuestListener<'u', 'u', 'u', 'u'>(callback[i]);
|
|
||||||
} else if (signature == "uuf") {
|
|
||||||
// E.g. wl_pointer_listener::axis
|
|
||||||
host_callbacks[i] = WaylandAllocateHostTrampolineForGuestListener<'u', 'u', 'f'>(callback[i]);
|
|
||||||
} else if (signature == "uu") {
|
|
||||||
// E.g. wl_pointer_listener::axis_stop
|
|
||||||
host_callbacks[i] = WaylandAllocateHostTrampolineForGuestListener<'u', 'u'>(callback[i]);
|
|
||||||
} else if (signature == "ui") {
|
|
||||||
// E.g. wl_pointer_listener::axis_discrete
|
|
||||||
host_callbacks[i] = WaylandAllocateHostTrampolineForGuestListener<'u', 'i'>(callback[i]);
|
|
||||||
} else if (signature == "uhu") {
|
} else if (signature == "uhu") {
|
||||||
// E.g. wl_keyboard_listener::keymap
|
// E.g. wl_keyboard_listener::keymap
|
||||||
host_callbacks[i] = WaylandAllocateHostTrampolineForGuestListener<'u', 'h', 'u'>(callback[i]);
|
host_callbacks[i] = WaylandAllocateHostTrampolineForGuestListener<'u', 'h', 'u'>(callback[i]);
|
||||||
|
} else if (signature == "ui") {
|
||||||
|
// E.g. wl_pointer_listener::axis_discrete
|
||||||
|
host_callbacks[i] = WaylandAllocateHostTrampolineForGuestListener<'u', 'i'>(callback[i]);
|
||||||
|
} else if (signature == "uiff") {
|
||||||
|
// E.g. wl_touch_listener::motion
|
||||||
|
host_callbacks[i] = WaylandAllocateHostTrampolineForGuestListener<'u', 'i', 'f', 'f'>(callback[i]);
|
||||||
|
} else if (signature == "uiii") {
|
||||||
|
// E.g. wl_output_listener::mode
|
||||||
|
host_callbacks[i] = WaylandAllocateHostTrampolineForGuestListener<'u', 'i', 'i', 'i'>(callback[i]);
|
||||||
|
} else if (signature == "uo") {
|
||||||
|
// E.g. wl_pointer_listener::leave
|
||||||
|
host_callbacks[i] = WaylandAllocateHostTrampolineForGuestListener<'u', 'o'>(callback[i]);
|
||||||
} else if (signature == "uoa") {
|
} else if (signature == "uoa") {
|
||||||
// E.g. wl_keyboard_listener::enter
|
// E.g. wl_keyboard_listener::enter
|
||||||
host_callbacks[i] = WaylandAllocateHostTrampolineForGuestListener<'u', 'o', 'a'>(callback[i]);
|
host_callbacks[i] = WaylandAllocateHostTrampolineForGuestListener<'u', 'o', 'a'>(callback[i]);
|
||||||
|
} else if (signature == "uoff") {
|
||||||
|
// E.g. wl_pointer_listener::enter
|
||||||
|
host_callbacks[i] = WaylandAllocateHostTrampolineForGuestListener<'u', 'o', 'f', 'f'>(callback[i]);
|
||||||
|
} else if (signature == "uoffo") {
|
||||||
|
// E.g. wl_data_device_listener::enter
|
||||||
|
host_callbacks[i] = WaylandAllocateHostTrampolineForGuestListener<'u', 'o', 'f', 'f', 'o'>(callback[i]);
|
||||||
|
} else if (signature == "usu") {
|
||||||
|
// E.g. wl_registry::global
|
||||||
|
host_callbacks[i] = WaylandAllocateHostTrampolineForGuestListener<'u', 's', 'u'>(callback[i]);
|
||||||
|
} else if (signature == "uu") {
|
||||||
|
// E.g. wl_pointer_listener::axis_stop
|
||||||
|
host_callbacks[i] = WaylandAllocateHostTrampolineForGuestListener<'u', 'u'>(callback[i]);
|
||||||
|
} else if (signature == "uuf") {
|
||||||
|
// E.g. wl_pointer_listener::axis
|
||||||
|
host_callbacks[i] = WaylandAllocateHostTrampolineForGuestListener<'u', 'u', 'f'>(callback[i]);
|
||||||
|
} else if (signature == "uui") {
|
||||||
|
// E.g. wl_touch_listener::up
|
||||||
|
host_callbacks[i] = WaylandAllocateHostTrampolineForGuestListener<'u', 'u', 'i'>(callback[i]);
|
||||||
|
} else if (signature == "uuoiff") {
|
||||||
|
// E.g. wl_touch_listener::down
|
||||||
|
host_callbacks[i] = WaylandAllocateHostTrampolineForGuestListener<'u', 'u', 'o', 'i', 'f', 'f'>(callback[i]);
|
||||||
|
} else if (signature == "uuu") {
|
||||||
|
// E.g. zwp_linux_dmabuf_v1::modifier
|
||||||
|
host_callbacks[i] = WaylandAllocateHostTrampolineForGuestListener<'u', 'u', 'u'>(callback[i]);
|
||||||
|
} else if (signature == "uuuu") {
|
||||||
|
// E.g. wl_pointer_listener::button
|
||||||
|
host_callbacks[i] = WaylandAllocateHostTrampolineForGuestListener<'u', 'u', 'u', 'u'>(callback[i]);
|
||||||
} else if (signature == "uuuuu") {
|
} else if (signature == "uuuuu") {
|
||||||
// E.g. wl_keyboard_listener::modifiers
|
// E.g. wl_keyboard_listener::modifiers
|
||||||
host_callbacks[i] = WaylandAllocateHostTrampolineForGuestListener<'u', 'u', 'u', 'u', 'u'>(callback[i]);
|
host_callbacks[i] = WaylandAllocateHostTrampolineForGuestListener<'u', 'u', 'u', 'u', 'u'>(callback[i]);
|
||||||
|
} else if (signature == "s") {
|
||||||
|
// E.g. wl_seat::name
|
||||||
|
host_callbacks[i] = WaylandAllocateHostTrampolineForGuestListener<'s'>(callback[i]);
|
||||||
|
} else if (signature == "sii") {
|
||||||
|
// E.g. zwp_text_input_v3::preedit_string
|
||||||
|
host_callbacks[i] = WaylandAllocateHostTrampolineForGuestListener<'s', 'i', 'i'>(callback[i]);
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr, "Unknown wayland event signature descriptor %s\n", signature.data());
|
fprintf(stderr, "Unknown wayland signature descriptor \"%s\" for event \"%s\" in interface \"%s\"\n", signature.data(), interface->events[i].name, interface->name);
|
||||||
std::abort();
|
std::abort();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -213,6 +261,23 @@ static void wl_argument_from_va_list(const char *signature, wl_argument *args,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern "C" void wl_proxy_marshal(wl_proxy *proxy, uint32_t opcode, ...) {
|
||||||
|
wl_argument args[WL_CLOSURE_MAX_ARGS];
|
||||||
|
va_list ap;
|
||||||
|
|
||||||
|
va_start(ap, opcode);
|
||||||
|
#ifdef IS_32BIT_THUNK
|
||||||
|
// Must extract signature from host due to different data layout on 32-bit
|
||||||
|
#error Not implemented
|
||||||
|
#else
|
||||||
|
wl_argument_from_va_list(((wl_proxy_private*)proxy)->interface->methods[opcode].signature,
|
||||||
|
args, WL_CLOSURE_MAX_ARGS, ap);
|
||||||
|
#endif
|
||||||
|
va_end(ap);
|
||||||
|
|
||||||
|
wl_proxy_marshal_array(proxy, opcode, args);
|
||||||
|
}
|
||||||
|
|
||||||
extern "C" wl_proxy *wl_proxy_marshal_flags(wl_proxy *proxy, uint32_t opcode,
|
extern "C" wl_proxy *wl_proxy_marshal_flags(wl_proxy *proxy, uint32_t opcode,
|
||||||
const wl_interface *interface,
|
const wl_interface *interface,
|
||||||
uint32_t version,
|
uint32_t version,
|
||||||
|
|||||||
@@ -28,11 +28,13 @@ struct wl_proxy_private {
|
|||||||
// Other data members omitted
|
// Other data members omitted
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// See wayland-util.h for documentation on protocol message signatures
|
||||||
template<char> struct ArgType;
|
template<char> struct ArgType;
|
||||||
template<> struct ArgType<'s'> { using type = const char*; };
|
template<> struct ArgType<'s'> { using type = const char*; };
|
||||||
template<> struct ArgType<'u'> { using type = uint32_t; };
|
template<> struct ArgType<'u'> { using type = uint32_t; };
|
||||||
template<> struct ArgType<'i'> { using type = int32_t; };
|
template<> struct ArgType<'i'> { using type = int32_t; };
|
||||||
template<> struct ArgType<'o'> { using type = wl_proxy*; };
|
template<> struct ArgType<'o'> { using type = wl_proxy*; };
|
||||||
|
template<> struct ArgType<'n'> { using type = wl_proxy*; };
|
||||||
template<> struct ArgType<'a'> { using type = wl_array*; };
|
template<> struct ArgType<'a'> { using type = wl_array*; };
|
||||||
template<> struct ArgType<'f'> { using type = wl_fixed_t; };
|
template<> struct ArgType<'f'> { using type = wl_fixed_t; };
|
||||||
template<> struct ArgType<'h'> { using type = int32_t; }; // fd?
|
template<> struct ArgType<'h'> { using type = int32_t; }; // fd?
|
||||||
@@ -48,64 +50,109 @@ extern "C" int fexfn_impl_libwayland_client_wl_proxy_add_listener(struct wl_prox
|
|||||||
auto guest_interface = ((wl_proxy_private*)proxy)->interface;
|
auto guest_interface = ((wl_proxy_private*)proxy)->interface;
|
||||||
|
|
||||||
for (int i = 0; i < guest_interface->event_count; ++i) {
|
for (int i = 0; i < guest_interface->event_count; ++i) {
|
||||||
auto signature = std::string_view { guest_interface->events[i].signature };
|
auto signature_view = std::string_view { guest_interface->events[i].signature };
|
||||||
|
|
||||||
// A leading number indicates the minimum protocol version
|
// A leading number indicates the minimum protocol version
|
||||||
uint32_t since_version = 0;
|
uint32_t since_version = 0;
|
||||||
auto [ptr, res] = std::from_chars(signature.begin(), signature.end(), since_version, 10);
|
auto [ptr, res] = std::from_chars(signature_view.begin(), signature_view.end(), since_version, 10);
|
||||||
signature = signature.substr(ptr - signature.begin());
|
std::string signature { ptr, &*signature_view.end() };
|
||||||
|
|
||||||
if (signature == "u") {
|
// ? just indicates that the argument may be null, so it doesn't change the signature
|
||||||
// E.g. wl_registry::global_remove
|
signature.erase(std::remove(signature.begin(), signature.end(), '?'), signature.end());
|
||||||
WaylandFinalizeHostTrampolineForGuestListener<'u'>(callback[i]);
|
|
||||||
} else if (signature == "usu") {
|
if (signature == "") {
|
||||||
// E.g. wl_registry::global
|
// E.g. xdg_toplevel::close
|
||||||
WaylandFinalizeHostTrampolineForGuestListener<'u', 's', 'u'>(callback[i]);
|
WaylandFinalizeHostTrampolineForGuestListener<>(callback[i]);
|
||||||
} else if (signature == "s") {
|
} else if (signature == "a") {
|
||||||
// E.g. wl_seat::name
|
// E.g. xdg_toplevel::wm_capabilities
|
||||||
WaylandFinalizeHostTrampolineForGuestListener<'s'>(callback[i]);
|
WaylandFinalizeHostTrampolineForGuestListener<'a'>(callback[i]);
|
||||||
|
} else if (signature == "hu") {
|
||||||
|
// E.g. zwp_linux_dmabuf_feedback_v1::format_table
|
||||||
|
WaylandFinalizeHostTrampolineForGuestListener<'h', 'u'>(callback[i]);
|
||||||
|
} else if (signature == "i") {
|
||||||
|
// E.g. wl_output_listener::scale
|
||||||
|
WaylandFinalizeHostTrampolineForGuestListener<'i'>(callback[i]);
|
||||||
|
} else if (signature == "if") {
|
||||||
|
// E.g. wl_touch_listener::orientation
|
||||||
|
WaylandFinalizeHostTrampolineForGuestListener<'i', 'f'>(callback[i]);
|
||||||
|
} else if (signature == "iff") {
|
||||||
|
// E.g. wl_touch_listener::shape
|
||||||
|
WaylandFinalizeHostTrampolineForGuestListener<'i', 'f', 'f'>(callback[i]);
|
||||||
} else if (signature == "ii") {
|
} else if (signature == "ii") {
|
||||||
// E.g. xdg_toplevel::configure_bounds
|
// E.g. xdg_toplevel::configure_bounds
|
||||||
WaylandFinalizeHostTrampolineForGuestListener<'i', 'i'>(callback[i]);
|
WaylandFinalizeHostTrampolineForGuestListener<'i', 'i'>(callback[i]);
|
||||||
} else if (signature == "iia") {
|
} else if (signature == "iia") {
|
||||||
// E.g. xdg_toplevel::configure
|
// E.g. xdg_toplevel::configure
|
||||||
WaylandFinalizeHostTrampolineForGuestListener<'i', 'i', 'a'>(callback[i]);
|
WaylandFinalizeHostTrampolineForGuestListener<'i', 'i', 'a'>(callback[i]);
|
||||||
} else if (signature == "a") {
|
} else if (signature == "iiiiissi") {
|
||||||
// E.g. xdg_toplevel::wm_capabilities
|
// E.g. wl_output_listener::geometry
|
||||||
WaylandFinalizeHostTrampolineForGuestListener<'a'>(callback[i]);
|
WaylandFinalizeHostTrampolineForGuestListener<'i', 'i', 'i', 'i', 'i', 's', 's', 'i'>(callback[i]);
|
||||||
} else if (signature == "") {
|
} else if (signature == "n") {
|
||||||
// E.g. xdg_toplevel::close
|
// E.g. wl_data_device_listener::data_offer
|
||||||
WaylandFinalizeHostTrampolineForGuestListener<>(callback[i]);
|
WaylandFinalizeHostTrampolineForGuestListener<'n'>(callback[i]);
|
||||||
} else if (signature == "uoff") {
|
} else if (signature == "o") {
|
||||||
// E.g. wl_pointer_listener::enter
|
// E.g. wl_data_device_listener::selection
|
||||||
WaylandFinalizeHostTrampolineForGuestListener<'u', 'o', 'f', 'f'>(callback[i]);
|
WaylandFinalizeHostTrampolineForGuestListener<'o'>(callback[i]);
|
||||||
} else if (signature == "uo") {
|
} else if (signature == "u") {
|
||||||
// E.g. wl_pointer_listener::leave
|
// E.g. wl_registry::global_remove
|
||||||
WaylandFinalizeHostTrampolineForGuestListener<'u', 'o'>(callback[i]);
|
WaylandFinalizeHostTrampolineForGuestListener<'u'>(callback[i]);
|
||||||
} else if (signature == "uff") {
|
} else if (signature == "uff") {
|
||||||
// E.g. wl_pointer_listener::motion
|
// E.g. wl_pointer_listener::motion
|
||||||
WaylandFinalizeHostTrampolineForGuestListener<'u', 'f', 'f'>(callback[i]);
|
WaylandFinalizeHostTrampolineForGuestListener<'u', 'f', 'f'>(callback[i]);
|
||||||
} else if (signature == "uuuu") {
|
|
||||||
// E.g. wl_pointer_listener::button
|
|
||||||
WaylandFinalizeHostTrampolineForGuestListener<'u', 'u', 'u', 'u'>(callback[i]);
|
|
||||||
} else if (signature == "uuf") {
|
|
||||||
// E.g. wl_pointer_listener::axis
|
|
||||||
WaylandFinalizeHostTrampolineForGuestListener<'u', 'u', 'f'>(callback[i]);
|
|
||||||
} else if (signature == "uu") {
|
|
||||||
// E.g. wl_pointer_listener::axis_stop
|
|
||||||
WaylandFinalizeHostTrampolineForGuestListener<'u', 'u'>(callback[i]);
|
|
||||||
} else if (signature == "ui") {
|
|
||||||
// E.g. wl_pointer_listener::axis_discrete
|
|
||||||
WaylandFinalizeHostTrampolineForGuestListener<'u', 'i'>(callback[i]);
|
|
||||||
} else if (signature == "uhu") {
|
} else if (signature == "uhu") {
|
||||||
// E.g. wl_keyboard_listener::keymap
|
// E.g. wl_keyboard_listener::keymap
|
||||||
WaylandFinalizeHostTrampolineForGuestListener<'u', 'h', 'u'>(callback[i]);
|
WaylandFinalizeHostTrampolineForGuestListener<'u', 'h', 'u'>(callback[i]);
|
||||||
|
} else if (signature == "ui") {
|
||||||
|
// E.g. wl_pointer_listener::axis_discrete
|
||||||
|
WaylandFinalizeHostTrampolineForGuestListener<'u', 'i'>(callback[i]);
|
||||||
|
} else if (signature == "uiff") {
|
||||||
|
// E.g. wl_touch_listener::motion
|
||||||
|
WaylandFinalizeHostTrampolineForGuestListener<'u', 'i', 'f', 'f'>(callback[i]);
|
||||||
|
} else if (signature == "uiii") {
|
||||||
|
// E.g. wl_output_listener::mode
|
||||||
|
WaylandFinalizeHostTrampolineForGuestListener<'u', 'i', 'i', 'i'>(callback[i]);
|
||||||
|
} else if (signature == "uo") {
|
||||||
|
// E.g. wl_pointer_listener::leave
|
||||||
|
WaylandFinalizeHostTrampolineForGuestListener<'u', 'o'>(callback[i]);
|
||||||
} else if (signature == "uoa") {
|
} else if (signature == "uoa") {
|
||||||
// E.g. wl_keyboard_listener::enter
|
// E.g. wl_keyboard_listener::enter
|
||||||
WaylandFinalizeHostTrampolineForGuestListener<'u', 'o', 'a'>(callback[i]);
|
WaylandFinalizeHostTrampolineForGuestListener<'u', 'o', 'a'>(callback[i]);
|
||||||
|
} else if (signature == "uoff") {
|
||||||
|
// E.g. wl_pointer_listener::enter
|
||||||
|
WaylandFinalizeHostTrampolineForGuestListener<'u', 'o', 'f', 'f'>(callback[i]);
|
||||||
|
} else if (signature == "uoffo") {
|
||||||
|
// E.g. wl_data_device_listener::enter
|
||||||
|
WaylandFinalizeHostTrampolineForGuestListener<'u', 'o', 'f', 'f', 'o'>(callback[i]);
|
||||||
|
} else if (signature == "usu") {
|
||||||
|
// E.g. wl_registry::global
|
||||||
|
WaylandFinalizeHostTrampolineForGuestListener<'u', 's', 'u'>(callback[i]);
|
||||||
|
} else if (signature == "uu") {
|
||||||
|
// E.g. wl_pointer_listener::axis_stop
|
||||||
|
WaylandFinalizeHostTrampolineForGuestListener<'u', 'u'>(callback[i]);
|
||||||
|
} else if (signature == "uuf") {
|
||||||
|
// E.g. wl_pointer_listener::axis
|
||||||
|
WaylandFinalizeHostTrampolineForGuestListener<'u', 'u', 'f'>(callback[i]);
|
||||||
|
} else if (signature == "uui") {
|
||||||
|
// E.g. wl_touch_listener::up
|
||||||
|
WaylandFinalizeHostTrampolineForGuestListener<'u', 'u', 'i'>(callback[i]);
|
||||||
|
} else if (signature == "uuoiff") {
|
||||||
|
// E.g. wl_touch_listener::down
|
||||||
|
WaylandFinalizeHostTrampolineForGuestListener<'u', 'u', 'o', 'i', 'f', 'f'>(callback[i]);
|
||||||
|
} else if (signature == "uuu") {
|
||||||
|
// E.g. zwp_linux_dmabuf_v1::modifier
|
||||||
|
WaylandFinalizeHostTrampolineForGuestListener<'u', 'u', 'u'>(callback[i]);
|
||||||
|
} else if (signature == "uuuu") {
|
||||||
|
// E.g. wl_pointer_listener::button
|
||||||
|
WaylandFinalizeHostTrampolineForGuestListener<'u', 'u', 'u', 'u'>(callback[i]);
|
||||||
} else if (signature == "uuuuu") {
|
} else if (signature == "uuuuu") {
|
||||||
// E.g. wl_keyboard_listener::modifiers
|
// E.g. wl_keyboard_listener::modifiers
|
||||||
WaylandFinalizeHostTrampolineForGuestListener<'u', 'u', 'u', 'u', 'u'>(callback[i]);
|
WaylandFinalizeHostTrampolineForGuestListener<'u', 'u', 'u', 'u', 'u'>(callback[i]);
|
||||||
|
} else if (signature == "s") {
|
||||||
|
// E.g. wl_seat::name
|
||||||
|
WaylandFinalizeHostTrampolineForGuestListener<'s'>(callback[i]);
|
||||||
|
} else if (signature == "sii") {
|
||||||
|
// E.g. zwp_text_input_v3::preedit_string
|
||||||
|
WaylandFinalizeHostTrampolineForGuestListener<'s', 'i', 'i'>(callback[i]);
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr, "TODO: Unknown wayland event signature descriptor %s\n", signature.data());
|
fprintf(stderr, "TODO: Unknown wayland event signature descriptor %s\n", signature.data());
|
||||||
std::abort();
|
std::abort();
|
||||||
|
|||||||
@@ -12,24 +12,36 @@ struct fex_gen_type {};
|
|||||||
|
|
||||||
template<> struct fex_gen_config<wl_proxy_destroy> : fexgen::custom_guest_entrypoint {};
|
template<> struct fex_gen_config<wl_proxy_destroy> : fexgen::custom_guest_entrypoint {};
|
||||||
|
|
||||||
|
template<> struct fex_gen_config<wl_display_cancel_read> {};
|
||||||
template<> struct fex_gen_config<wl_display_connect> {};
|
template<> struct fex_gen_config<wl_display_connect> {};
|
||||||
template<> struct fex_gen_config<wl_display_flush> {};
|
|
||||||
template<> struct fex_gen_config<wl_display_create_queue> {};
|
template<> struct fex_gen_config<wl_display_create_queue> {};
|
||||||
template<> struct fex_gen_config<wl_display_disconnect> {};
|
template<> struct fex_gen_config<wl_display_disconnect> {};
|
||||||
template<> struct fex_gen_config<wl_display_dispatch> {};
|
template<> struct fex_gen_config<wl_display_dispatch> {};
|
||||||
template<> struct fex_gen_config<wl_display_dispatch_pending> {};
|
template<> struct fex_gen_config<wl_display_dispatch_pending> {};
|
||||||
template<> struct fex_gen_config<wl_display_dispatch_queue> {};
|
template<> struct fex_gen_config<wl_display_dispatch_queue> {};
|
||||||
template<> struct fex_gen_config<wl_display_dispatch_queue_pending> {};
|
template<> struct fex_gen_config<wl_display_dispatch_queue_pending> {};
|
||||||
|
template<> struct fex_gen_config<wl_display_flush> {};
|
||||||
|
template<> struct fex_gen_config<wl_display_prepare_read> {};
|
||||||
|
template<> struct fex_gen_config<wl_display_prepare_read_queue> {};
|
||||||
|
template<> struct fex_gen_config<wl_display_read_events> {};
|
||||||
template<> struct fex_gen_config<wl_display_roundtrip> {};
|
template<> struct fex_gen_config<wl_display_roundtrip> {};
|
||||||
template<> struct fex_gen_config<wl_display_roundtrip_queue> {};
|
template<> struct fex_gen_config<wl_display_roundtrip_queue> {};
|
||||||
template<> struct fex_gen_config<wl_display_get_fd> {};
|
template<> struct fex_gen_config<wl_display_get_fd> {};
|
||||||
template<> struct fex_gen_config<wl_proxy_get_version> {};
|
|
||||||
template<> struct fex_gen_config<wl_proxy_add_listener> : fexgen::custom_host_impl, fexgen::custom_guest_entrypoint {};
|
|
||||||
template<> struct fex_gen_config<wl_proxy_create_wrapper> {};
|
|
||||||
template<> struct fex_gen_config<wl_proxy_wrapper_destroy> {};
|
|
||||||
template<> struct fex_gen_config<wl_proxy_set_queue> {};
|
|
||||||
template<> struct fex_gen_config<wl_event_queue_destroy> {};
|
template<> struct fex_gen_config<wl_event_queue_destroy> {};
|
||||||
|
|
||||||
|
template<> struct fex_gen_config<wl_proxy_add_listener> : fexgen::custom_host_impl, fexgen::custom_guest_entrypoint {};
|
||||||
|
template<> struct fex_gen_config<wl_proxy_create> {};
|
||||||
|
template<> struct fex_gen_config<wl_proxy_create_wrapper> {};
|
||||||
|
template<> struct fex_gen_config<wl_proxy_get_tag> {};
|
||||||
|
template<> struct fex_gen_config<wl_proxy_get_user_data> {};
|
||||||
|
template<> struct fex_gen_config<wl_proxy_get_version> {};
|
||||||
|
template<> struct fex_gen_config<wl_proxy_set_queue> {};
|
||||||
|
template<> struct fex_gen_config<wl_proxy_set_tag> {};
|
||||||
|
template<> struct fex_gen_config<wl_proxy_set_user_data> {};
|
||||||
|
template<> struct fex_gen_config<wl_proxy_wrapper_destroy> {};
|
||||||
|
|
||||||
|
template<> struct fex_gen_config<wl_proxy_marshal_array> {};
|
||||||
// wl_proxy_marshal_array_flags is only available starting from Wayland 1.19.91
|
// wl_proxy_marshal_array_flags is only available starting from Wayland 1.19.91
|
||||||
#if WAYLAND_VERSION_MAJOR * 10000 + WAYLAND_VERSION_MINOR * 100 + WAYLAND_VERSION_MICRO >= 11991
|
#if WAYLAND_VERSION_MAJOR * 10000 + WAYLAND_VERSION_MINOR * 100 + WAYLAND_VERSION_MICRO >= 11991
|
||||||
template<> struct fex_gen_config<wl_proxy_marshal_array_flags> {};
|
template<> struct fex_gen_config<wl_proxy_marshal_array_flags> {};
|
||||||
|
|||||||
Reference in new issue
Block a user