X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fwayland_ivi_wm.cpp;h=8b04c644cf65d87c4c6c8bab9321cfd1e23cc0fd;hb=a79b572a5f26d6ecdd97dff159c40bad330e1c4c;hp=75ecbbdf8cd7c5b748cdff0121a7bd4bc3eef406;hpb=8ab10aaafc6fb3dc7bbad755dce9b4bdaa41f287;p=apps%2Fagl-service-windowmanager.git diff --git a/src/wayland_ivi_wm.cpp b/src/wayland_ivi_wm.cpp index 75ecbbd..8b04c64 100644 --- a/src/wayland_ivi_wm.cpp +++ b/src/wayland_ivi_wm.cpp @@ -216,31 +216,31 @@ void surface_visibility_changed( void *data, struct ivi_wm * /*ivi_wm*/, uint32_t surface_id, int32_t visibility) { - auto s = static_cast(data); - s->parent->surface_visibility_changed(s, visibility); + auto c = static_cast(data); + c->surface_visibility_changed(surface_id, visibility); } void surface_opacity_changed(void *data, struct ivi_wm * /*ivi_wm*/, uint32_t surface_id, wl_fixed_t opacity) { - auto s = static_cast(data); - s->parent->surface_opacity_changed(s, float(wl_fixed_to_double(opacity))); + auto c = static_cast(data); + c->surface_opacity_changed(surface_id, float(wl_fixed_to_double(opacity))); } void surface_source_rectangle_changed( void *data, struct ivi_wm * /*ivi_wm*/, uint32_t surface_id, int32_t x, int32_t y, int32_t width, int32_t height) { - auto s = static_cast(data); - s->parent->surface_source_rectangle_changed(s, x, y, width, height); + auto c = static_cast(data); + c->surface_source_rectangle_changed(surface_id, x, y, width, height); } void surface_destination_rectangle_changed( void *data, struct ivi_wm * /*ivi_wm*/, uint32_t surface_id, int32_t x, int32_t y, int32_t width, int32_t height) { - auto s = static_cast(data); - s->parent->surface_destination_rectangle_changed(s, x, y, width, height); + auto c = static_cast(data); + c->surface_destination_rectangle_changed(surface_id, x, y, width, height); } void surface_created(void *data, struct ivi_wm * /*ivi_wm*/, @@ -252,8 +252,8 @@ void surface_created(void *data, struct ivi_wm * /*ivi_wm*/, void surface_destroyed( void *data, struct ivi_wm * /*ivi_wm*/, uint32_t surface_id) { - auto s = static_cast(data); - s->parent->surface_destroyed(s, surface_id); + auto c = static_cast(data); + c->surface_destroyed(surface_id); } void surface_error_detected(void *data, struct ivi_wm * /*ivi_wm*/, uint32_t object_id, @@ -267,52 +267,52 @@ void surface_size_changed( void *data, struct ivi_wm * /*ivi_wm*/, uint32_t surface_id, int32_t width, int32_t height) { - auto s = static_cast(data); - s->parent->surface_size_changed(s, width, height); + auto c = static_cast(data); + c->surface_size_changed(surface_id, width, height); } void surface_stats_received(void *data, struct ivi_wm * /*ivi_wm*/, uint32_t surface_id, uint32_t frame_count, uint32_t pid) { - auto s = static_cast(data); - s->parent->surface_stats_received(s, surface_id, frame_count, pid); + auto c = static_cast(data); + c->surface_stats_received(surface_id, frame_count, pid); } void surface_added_to_layer(void *data, struct ivi_wm * /*ivi_wm*/, uint32_t layer_id, uint32_t surface_id) { - auto s = static_cast(data); - s->parent->surface_added_to_layer(s, layer_id, surface_id); + auto c = static_cast(data); + c->surface_added_to_layer(layer_id, surface_id); } void layer_visibility_changed(void *data, struct ivi_wm * /*ivi_wm*/, uint32_t layer_id, int32_t visibility) { - auto l = static_cast(data); - l->parent->layer_visibility_changed(l, layer_id, visibility); + auto c = static_cast(data); + c->layer_visibility_changed(layer_id, visibility); } void layer_opacity_changed(void *data, struct ivi_wm * /*ivi_wm*/, uint32_t layer_id, wl_fixed_t opacity) { - auto l = static_cast(data); - l->parent->layer_opacity_changed(l, layer_id, float(wl_fixed_to_double(opacity))); + auto c = static_cast(data); + c->layer_opacity_changed(layer_id, float(wl_fixed_to_double(opacity))); } void layer_source_rectangle_changed( void *data, struct ivi_wm * /*ivi_wm*/, uint32_t layer_id, int32_t x, int32_t y, int32_t width, int32_t height) { - auto l = static_cast(data); - l->parent->layer_source_rectangle_changed(l, layer_id, x, y, width, height); + auto c = static_cast(data); + c->layer_source_rectangle_changed(layer_id, x, y, width, height); } void layer_destination_rectangle_changed( void *data, struct ivi_wm * /*ivi_wm*/, uint32_t layer_id, int32_t x, int32_t y, int32_t width, int32_t height) { - auto l = static_cast(data); - l->parent->layer_destination_rectangle_changed(l, layer_id, x, y, width, height); + auto c = static_cast(data); + c->layer_destination_rectangle_changed(layer_id, x, y, width, height); } void layer_created(void *data, struct ivi_wm * /*ivi_wm*/, @@ -323,8 +323,8 @@ void layer_created(void *data, struct ivi_wm * /*ivi_wm*/, void layer_destroyed(void *data, struct ivi_wm * /*ivi_wm*/, uint32_t layer_id) { - auto l = static_cast(data); - l->parent->layer_destroyed(l, layer_id); + auto c = static_cast(data); + c->layer_destroyed(layer_id); } void layer_error_detected(void *data, struct ivi_wm * /*ivi_wm*/, uint32_t object_id, @@ -435,11 +435,6 @@ void layer::set_visibility(uint32_t visibility) ivi_wm_set_layer_visibility(this->parent->proxy.get(), this->id, visibility); } -void layer::set_source_rectangle(int32_t x, int32_t y, int32_t width, int32_t height) -{ - ivi_wm_set_layer_source_rectangle(this->parent->proxy.get(), this->id, x, y, width, height); -} - void layer::set_destination_rectangle(int32_t x, int32_t y, int32_t width, int32_t height) { @@ -536,6 +531,11 @@ void controller::create_screen(struct wl_output *output) this->screen = std::make_unique(0, this, output); } +void controller::get_surface_properties(uint32_t surface_id, int param) +{ + ivi_wm_surface_get(this->proxy.get(), surface_id, param); +} + void controller::layer_created(uint32_t id) { HMI_DEBUG("wm", "compositor::controller @ %p layer %u (%x)", this->proxy.get(), id, id); @@ -556,56 +556,56 @@ void controller::layer_error_detected(uint32_t object_id, this->proxy.get(), object_id, error_code, error_text); } -void controller::surface_visibility_changed(struct surface *s, int32_t visibility) +void controller::surface_visibility_changed(uint32_t id, int32_t visibility) { - HMI_DEBUG("wm", "compositor::surface %s @ %d v %i", __func__, s->id, + HMI_DEBUG("wm", "compositor::surface %s @ %d v %i", __func__, id, visibility); - this->sprops[s->id].visibility = visibility; - this->chooks->surface_visibility(s->id, visibility); + this->sprops[id].visibility = visibility; + this->chooks->surface_visibility(id, visibility); } -void controller::surface_opacity_changed(struct surface *s, float opacity) +void controller::surface_opacity_changed(uint32_t id, float opacity) { - HMI_DEBUG("wm", "compositor::surface %s @ %d o %f", __func__, s->id, - opacity); - this->sprops[s->id].opacity = opacity; + HMI_DEBUG("wm", "compositor::surface %s @ %d o %f", + __func__, id, opacity); + this->sprops[id].opacity = opacity; } -void controller::surface_source_rectangle_changed(struct surface *s, int32_t x, +void controller::surface_source_rectangle_changed(uint32_t id, int32_t x, int32_t y, int32_t width, int32_t height) { HMI_DEBUG("wm", "compositor::surface %s @ %d x %i y %i w %i h %i", __func__, - s->id, x, y, width, height); - this->sprops[s->id].src_rect = rect{width, height, x, y}; + id, x, y, width, height); + this->sprops[id].src_rect = rect{width, height, x, y}; } -void controller::surface_destination_rectangle_changed(struct surface *s, int32_t x, +void controller::surface_destination_rectangle_changed(uint32_t id, int32_t x, int32_t y, int32_t width, int32_t height) { HMI_DEBUG("wm", "compositor::surface %s @ %d x %i y %i w %i h %i", __func__, - s->id, x, y, width, height); - this->sprops[s->id].dst_rect = rect{width, height, x, y}; - this->chooks->surface_destination_rectangle(s->id, x, y, width, height); + id, x, y, width, height); + this->sprops[id].dst_rect = rect{width, height, x, y}; + this->chooks->surface_destination_rectangle(id, x, y, width, height); } -void controller::surface_size_changed(struct surface *s, int32_t width, +void controller::surface_size_changed(uint32_t id, int32_t width, int32_t height) { - HMI_DEBUG("wm", "compositor::surface %s @ %d w %i h %i", __func__, s->id, + HMI_DEBUG("wm", "compositor::surface %s @ %d w %i h %i", __func__, id, width, height); - this->sprops[s->id].size = size{uint32_t(width), uint32_t(height)}; + this->sprops[id].size = size{uint32_t(width), uint32_t(height)}; + this->surfaces[id]->set_source_rectangle(0, 0, width, height); } -void controller::surface_added_to_layer(struct surface *s, - uint32_t layer_id, uint32_t surface_id) +void controller::surface_added_to_layer(uint32_t layer_id, uint32_t surface_id) { HMI_DEBUG("wm", "compositor::surface %s @ %d l %u", __func__, layer_id, surface_id); } -void controller::surface_stats_received(struct surface *s, uint32_t surface_id, +void controller::surface_stats_received(uint32_t surface_id, uint32_t frame_count, uint32_t pid) { HMI_DEBUG("wm", "compositor::surface %s @ %d f %u pid %u", @@ -621,23 +621,16 @@ void controller::surface_created(uint32_t id) this->surfaces[id] = std::make_unique(id, this); this->chooks->surface_created(id); - // TODO: If Clipping is necessary, this process should be modified. - { - // Set surface type:IVI_WM_SURFACE_TYPE_DESKTOP) - // for resizing wayland surface when switching from split to full surface. - ivi_wm_set_surface_type(this->proxy.get(), id, IVI_WM_SURFACE_TYPE_DESKTOP); - - // Set source reactangle even if we should not need to set it - // for enable setting for destination region. - this->surfaces[id]->set_source_rectangle(0, 0, this->output_size.w, this->output_size.h); + // Set surface type:IVI_WM_SURFACE_TYPE_DESKTOP) + // for resizing wayland surface when switching from split to full surface. + ivi_wm_set_surface_type(this->proxy.get(), id, IVI_WM_SURFACE_TYPE_DESKTOP); - // Flush display - this->display->flush(); - } + // Flush display + this->display->flush(); } } -void controller::surface_destroyed(struct surface *s, uint32_t surface_id) +void controller::surface_destroyed(uint32_t surface_id) { HMI_DEBUG("wm", "compositor::surface %s @ %d", __func__, surface_id); this->chooks->surface_removed(surface_id); @@ -652,19 +645,19 @@ void controller::surface_error_detected(uint32_t object_id, this->proxy.get(), object_id, error_code, error_text); } -void controller::layer_visibility_changed(struct layer *l, uint32_t layer_id, int32_t visibility) +void controller::layer_visibility_changed(uint32_t layer_id, int32_t visibility) { HMI_DEBUG("wm", "compositor::layer %s @ %d v %i", __func__, layer_id, visibility); this->lprops[layer_id].visibility = visibility; } -void controller::layer_opacity_changed(struct layer *l, uint32_t layer_id, float opacity) +void controller::layer_opacity_changed(uint32_t layer_id, float opacity) { HMI_DEBUG("wm", "compositor::layer %s @ %d o %f", __func__, layer_id, opacity); this->lprops[layer_id].opacity = opacity; } -void controller::layer_source_rectangle_changed(struct layer *l, uint32_t layer_id, +void controller::layer_source_rectangle_changed(uint32_t layer_id, int32_t x, int32_t y, int32_t width, int32_t height) { @@ -673,7 +666,7 @@ void controller::layer_source_rectangle_changed(struct layer *l, uint32_t layer_ this->lprops[layer_id].src_rect = rect{width, height, x, y}; } -void controller::layer_destination_rectangle_changed(struct layer *l, uint32_t layer_id, +void controller::layer_destination_rectangle_changed(uint32_t layer_id, int32_t x, int32_t y, int32_t width, int32_t height) { @@ -682,27 +675,7 @@ void controller::layer_destination_rectangle_changed(struct layer *l, uint32_t l this->lprops[layer_id].dst_rect = rect{width, height, x, y}; } -void controller::layer_configuration(struct layer *l, int32_t width, - int32_t height) -{ - HMI_DEBUG("wm", "compositor::layer %s @ %d w %i h %i", __func__, l->id, - width, height); - this->lprops[l->id].size = size{uint32_t(width), uint32_t(height)}; -} - -void controller::layer_orientation(struct layer *l, int32_t orientation) -{ - HMI_DEBUG("wm", "compositor::layer %s @ %d o %i", __func__, l->id, - orientation); - this->lprops[l->id].orientation = orientation; -} - -void controller::layer_screen(struct layer *l, struct wl_output *screen) -{ - HMI_DEBUG("wm", "compositor::layer %s @ %d s %p", __func__, l->id, screen); -} - -void controller::layer_destroyed(struct layer *l, uint32_t layer_id) +void controller::layer_destroyed(uint32_t layer_id) { HMI_DEBUG("wm", "compositor::layer %s @ %d", __func__, layer_id); this->lprops.erase(layer_id);