- : wayland_proxy(ivi_controller_layer_create(c->proxy, i, w, h)),
- controlled_entity(c, i),
- dst_rect{},
- src_rect{},
- size{},
- orientation{},
- visibility{},
- opacity{} {
- ivi_controller_layer_add_listener(this->proxy, &layer_listener, this);
+ : wayland_proxy(ivi_controller_layer_create(c->proxy.get(), i, w, h),
+ [c, i](ivi_controller_layer *l) {
+ logdebug("~layer layer %i @ %p", i, l);
+ c->remove_proxy_to_id_mapping(l);
+ ivi_controller_layer_destroy(l, 1);
+ }),
+ controller_child(c, i) {
+ this->parent->add_proxy_to_id_mapping(this->proxy.get(), i);
+ ivi_controller_layer_add_listener(this->proxy.get(), &layer_listener, this);
+}
+
+void layer::set_visibility(uint32_t visibility) {
+ ivi_controller_layer_set_visibility(this->proxy.get(), visibility);
+}
+
+void layer::set_opacity(wl_fixed_t opacity) {
+ ivi_controller_layer_set_opacity(this->proxy.get(), opacity);
+}
+
+void layer::set_source_rectangle(int32_t x, int32_t y, int32_t width,
+ int32_t height) {
+ ivi_controller_layer_set_source_rectangle(this->proxy.get(), x, y, width,
+ height);
+}
+
+void layer::set_destination_rectangle(int32_t x, int32_t y, int32_t width,
+ int32_t height) {
+ ivi_controller_layer_set_destination_rectangle(this->proxy.get(), x, y,
+ width, height);
+}
+
+void layer::set_configuration(int32_t width, int32_t height) {
+ ivi_controller_layer_set_configuration(this->proxy.get(), width, height);
+}
+
+void layer::set_orientation(int32_t orientation) {
+ ivi_controller_layer_set_orientation(this->proxy.get(), orientation);
+}
+
+void layer::screenshot(const char *filename) {
+ ivi_controller_layer_screenshot(this->proxy.get(), filename);
+}
+
+void layer::clear_surfaces() {
+ ivi_controller_layer_clear_surfaces(this->proxy.get());