#include #include template struct fex_gen_config { unsigned version = 0; }; template struct fex_gen_type {}; // Function, parameter index, parameter type [optional] template struct fex_gen_param {}; template<> struct fex_gen_type : fexgen::opaque_type {}; template<> struct fex_gen_type : fexgen::opaque_type {}; template<> struct fex_gen_type : fexgen::opaque_type {}; // Passed over Wayland's wire protocol for some functions template<> struct fex_gen_type : fexgen::emit_layout_wrappers {}; #ifdef IS_32BIT_THUNK // wl_interface and wl_message reference each other through pointers template<> struct fex_gen_type : fexgen::emit_layout_wrappers {}; template<> struct fex_gen_config<&wl_interface::methods> : fexgen::custom_repack {}; template<> struct fex_gen_config<&wl_interface::events> : fexgen::custom_repack {}; template<> struct fex_gen_type : fexgen::emit_layout_wrappers {}; template<> struct fex_gen_config<&wl_message::types> : fexgen::custom_repack {}; #else template<> struct fex_gen_type : fexgen::assume_compatible_data_layout {}; #endif template<> struct fex_gen_config : fexgen::custom_guest_entrypoint {}; template<> struct fex_gen_config {}; template<> struct fex_gen_config {}; template<> struct fex_gen_config {}; template<> struct fex_gen_config {}; template<> struct fex_gen_config {}; template<> struct fex_gen_config {}; template<> struct fex_gen_config {}; template<> struct fex_gen_config {}; template<> struct fex_gen_config {}; template<> struct fex_gen_config {}; template<> struct fex_gen_config {}; template<> struct fex_gen_config {}; template<> struct fex_gen_config {}; template<> struct fex_gen_config {}; template<> struct fex_gen_config {}; template<> struct fex_gen_config {}; template<> struct fex_gen_config {}; template<> struct fex_gen_config {}; template<> struct fex_gen_config : fexgen::custom_host_impl, fexgen::custom_guest_entrypoint {}; // Callback table template<> struct fex_gen_param : fexgen::ptr_passthrough {}; // User-provided data pointer (not used in caller-provided callback) template<> struct fex_gen_param : fexgen::assume_compatible_data_layout {}; template<> struct fex_gen_config : fexgen::custom_host_impl {}; template<> struct fex_gen_param : fexgen::ptr_passthrough {}; template<> struct fex_gen_config {}; template<> struct fex_gen_config {}; template<> struct fex_gen_config {}; template<> struct fex_gen_config {}; template<> struct fex_gen_config {}; template<> struct fex_gen_config {}; template<> struct fex_gen_config {}; template<> struct fex_gen_config {}; template<> struct fex_gen_config {}; // TODO: This has a void* parameter. Why does 32-bit accept this without annotations? template<> struct fex_gen_config {}; template<> struct fex_gen_config {}; template<> struct fex_gen_config : fexgen::custom_host_impl {}; template<> struct fex_gen_param : fexgen::ptr_passthrough {}; template<> struct fex_gen_config : fexgen::custom_host_impl {}; template<> struct fex_gen_param : fexgen::ptr_passthrough {}; template<> struct fex_gen_param : fexgen::ptr_passthrough {}; template<> struct fex_gen_config : fexgen::custom_host_impl {}; template<> struct fex_gen_param : fexgen::ptr_passthrough {}; template<> struct fex_gen_param : fexgen::ptr_passthrough {}; // 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 template<> struct fex_gen_config : fexgen::custom_host_impl {}; template<> struct fex_gen_param : fexgen::ptr_passthrough {}; template<> struct fex_gen_param : fexgen::ptr_passthrough {}; #endif // Guest notifies host about its interface. Host returns its corresponding interface pointer void fex_wl_exchange_interface_pointer(wl_interface*, const char* name); template<> struct fex_gen_config : fexgen::custom_host_impl {}; template<> struct fex_gen_param : fexgen::ptr_passthrough {}; // This is equivalent to reading proxy->interface->methods[opcode].signature on 64-bit. // On 32-bit, the data layout differs between host and guest however, so we let the host extract the data. void fex_wl_get_method_signature(wl_proxy*, uint32_t opcode, char*); template<> struct fex_gen_config : fexgen::custom_host_impl {}; int fex_wl_get_interface_event_count(wl_proxy*); template<> struct fex_gen_config : fexgen::custom_host_impl {}; void fex_wl_get_interface_event_name(wl_proxy*, int, char*); template<> struct fex_gen_config : fexgen::custom_host_impl {}; void fex_wl_get_interface_event_signature(wl_proxy*, int, char*); template<> struct fex_gen_config : fexgen::custom_host_impl {};