26 #ifndef WAYLAND_CLIENT_HPP 27 #define WAYLAND_CLIENT_HPP 36 #include <wayland-version.hpp> 37 #include <wayland-client-core.h> 38 #include <wayland-util.hpp> 79 virtual ~events_base_t() { }
138 wl_proxy *proxy =
nullptr;
139 detail::proxy_data_t *data =
nullptr;
141 friend class detail::argument_t;
142 friend struct detail::proxy_data_t;
145 static int c_dispatcher(
const void *implementation,
void *target,
146 uint32_t opcode,
const wl_message *message,
150 proxy_t marshal_single(uint32_t opcode,
const wl_interface *interface,
151 std::vector<detail::argument_t> v, std::uint32_t version = 0);
155 const wl_interface *
interface = nullptr;
158 std::function<proxy_t(proxy_t)> copy_constructor;
168 template <
typename...T>
169 void marshal(uint32_t opcode, T...args)
171 std::vector<detail::argument_t> v = { detail::argument_t(args)... };
172 marshal_single(opcode, NULL, v);
176 template <
typename...T>
177 proxy_t marshal_constructor(uint32_t opcode,
const wl_interface *interface,
180 std::vector<detail::argument_t> v = { detail::argument_t(args)... };
181 return marshal_single(opcode, interface, v);
185 template <
typename...T>
186 proxy_t marshal_constructor_versioned(uint32_t opcode,
const wl_interface *interface,
187 uint32_t version, T...args)
189 std::vector<detail::argument_t> v = { detail::argument_t(args)... };
190 return marshal_single(opcode, interface, v, version);
194 void set_destroy_opcode(uint32_t destroy_opcode);
201 void set_events(std::shared_ptr<detail::events_base_t> events,
202 int(*dispatcher)(uint32_t, std::vector<detail::any>, std::shared_ptr<detail::events_base_t>));
205 std::shared_ptr<detail::events_base_t> get_events();
210 struct construct_proxy_wrapper_tag {};
212 proxy_t(
const proxy_t &wrapped_proxy, construct_proxy_wrapper_tag);
265 uint32_t get_id()
const;
270 std::string get_class()
const;
284 uint32_t get_version()
const;
307 wl_proxy *c_ptr()
const;
313 bool proxy_has_object()
const;
319 operator bool()
const;
323 bool operator==(
const proxy_t &right)
const;
327 bool operator!=(
const proxy_t &right)
const;
334 void proxy_release();
366 bool is_finalized()
const;
390 read_intent(wl_display *display, wl_event_queue *event_queue =
nullptr);
396 wl_event_queue *event_queue =
nullptr;
397 bool finalized =
false;
668 int dispatch_pending();
680 int get_error()
const;
696 std::tuple<int, bool> flush();
719 operator wl_display*()
const;
727 #include <wayland-client-protocol.hpp> Represents a connection to the compositor and acts as a proxy to the display singleton object...
Represents an intention to read from the display file descriptor.
void set_log_handler(log_handler handler)
Set C library log handler.
Represents a protocol object on the client side.
Refcounted wrapper for C objects.
wrapper_type get_wrapper_type() const
Get the type of a proxy object.
std::function< void(std::string)> log_handler
Type for functions that handle log messages.
A queue for proxy_t object events.