From 63c655fab3274e1319b3f52c236178e00452fe89 Mon Sep 17 00:00:00 2001 From: Marcus Fritzsch Date: Wed, 28 Jun 2017 16:33:16 +0200 Subject: [PATCH] wayland: delete copy ctors and operators Signed-off-by: Marcus Fritzsch --- src/wayland.hpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/wayland.hpp b/src/wayland.hpp index 2321fff..3516f5e 100644 --- a/src/wayland.hpp +++ b/src/wayland.hpp @@ -19,6 +19,8 @@ template struct wayland_proxy { std::unique_ptr> proxy; + wayland_proxy(wayland_proxy const &) = delete; + wayland_proxy &operator=(wayland_proxy const &) = delete; wayland_proxy(void *p) : wayland_proxy(p, [](ProxyT *p) { wl_proxy_destroy(reinterpret_cast(p)); @@ -45,6 +47,8 @@ struct registry : public wayland_proxy { typedef std::function binder; std::unordered_map bindings; + registry(registry const &) = delete; + registry &operator=(registry const &) = delete; registry(struct wl_display *d); void add_global_handler(char const *iface, binder bind); @@ -64,6 +68,8 @@ struct display { std::unique_ptr d; struct registry r; + display(display const &) = delete; + display &operator=(display const &) = delete; display(); bool ok() const; void roundtrip(); @@ -83,6 +89,8 @@ struct output : wayland_proxy { int height{}; int refresh{}; + output(output const &) = delete; + output &operator=(output const &) = delete; output(struct wl_registry *r, uint32_t name, uint32_t v); // Events @@ -122,6 +130,8 @@ struct controller_child { struct controller *parent; uint32_t id; + controller_child(controller_child const &) = delete; + controller_child &operator=(controller_child const &) = delete; controller_child(struct controller *c, uint32_t i) : parent(c), id(i) {} virtual ~controller_child() {} }; @@ -141,6 +151,8 @@ struct surface : public wayland_proxy, int32_t visibility; float opacity; + surface(surface const &) = delete; + surface &operator=(surface const &) = delete; surface(uint32_t i, struct controller *c); // Requests @@ -172,6 +184,8 @@ struct layer : public wayland_proxy, int32_t visibility; float opacity; + layer(layer const &) = delete; + layer &operator=(layer const &) = delete; layer(uint32_t i, struct controller *c); layer(uint32_t i, int32_t w, int32_t h, struct controller *c); @@ -199,6 +213,8 @@ struct layer : public wayland_proxy, // struct screen : public wayland_proxy, controller_child { + screen(screen const &) = delete; + screen &operator=(screen const &) = delete; screen(uint32_t i, struct controller *c, struct ivi_controller_screen *p); void clear(); void add_layer(layer *l); -- 2.16.6