*/
#include "wayland_ivi_wm.hpp"
-#include "hmi-debug.h"
/**
* namespace wl
int display::read_events()
{
- ST();
+ ;
while (wl_display_prepare_read(this->d.get()) == -1)
{
- STN(pending_events_dispatch);
if (wl_display_dispatch_pending(this->d.get()) == -1)
{
return -1;
{
b->second(this->proxy.get(), name, v);
}
- HMI_DEBUG("wm", "wl::registry @ %p global n %u i %s v %u", this->proxy.get(), name,
+ HMI_DEBUG("wl::registry @ %p global n %u i %s v %u", this->proxy.get(), name,
iface, v);
}
void output::mode(uint32_t flags, int32_t w, int32_t h, int32_t r)
{
- HMI_DEBUG("wm", "wl::output %s @ %p f %x w %i h %i r %i", __func__,
+ HMI_DEBUG("wl::output %s @ %p f %x w %i h %i r %i", __func__,
this->proxy.get(), flags, w, h, r);
if ((flags & WL_OUTPUT_MODE_CURRENT) != 0u)
{
void output::done()
{
- HMI_DEBUG("wm", "wl::output %s @ %p done", __func__, this->proxy.get());
+ HMI_DEBUG("wl::output %s @ %p done", __func__, this->proxy.get());
// Pivot and flipped
if (this->transform == WL_OUTPUT_TRANSFORM_90 ||
this->transform == WL_OUTPUT_TRANSFORM_270 ||
void output::scale(int32_t factor)
{
- HMI_DEBUG("wm", "wl::output %s @ %p f %i", __func__, this->proxy.get(), factor);
+ HMI_DEBUG("wl::output %s @ %p f %i", __func__, this->proxy.get(), factor);
}
} // namespace wl
struct ivi_wm_screen *ivi_wm_screen,
uint32_t layer_id)
{
- HMI_DEBUG("wm", "added layer_id:%d", layer_id);
+ HMI_DEBUG("added layer_id:%d", layer_id);
}
void connector_name(void *data,
struct ivi_wm_screen *ivi_wm_screen,
const char *process_name)
{
- HMI_DEBUG("wm", "process_name:%s", process_name);
+ HMI_DEBUG("process_name:%s", process_name);
}
void screen_error(void *data,
uint32_t error,
const char *message)
{
- HMI_DEBUG("wm", "screen error:%d message:%s", error, message);
+ HMI_DEBUG("screen error:%d message:%s", error, message);
}
constexpr struct ivi_wm_screen_listener screen_listener = {
void surface::set_visibility(uint32_t visibility)
{
- HMI_DEBUG("wm", "compositor::surface id:%d v:%d", this->id, visibility);
+ HMI_DEBUG("compositor::surface id:%d v:%d", this->id, visibility);
ivi_wm_set_surface_visibility(this->parent->proxy.get(), this->id, 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)
{
: wayland_proxy(ivi_wm_create_screen(c->proxy.get(), o)),
controller_child(c, i)
{
- HMI_DEBUG("wm", "compositor::screen @ %p id %u o %p", this->proxy.get(), i, o);
+ HMI_DEBUG("compositor::screen @ %p id %u o %p", this->proxy.get(), i, o);
// Add listener for screen
ivi_wm_screen_add_listener(this->proxy.get(), &screen_listener, this);
void screen::screen_created(struct screen *screen, uint32_t id)
{
- HMI_DEBUG("wm", "compositor::screen @ %p screen %u (%x) @ %p", this->proxy.get(),
+ HMI_DEBUG("compositor::screen @ %p screen %u (%x) @ %p", this->proxy.get(),
id, id, screen);
this->id = id;
this->parent->screens[id] = screen;
for (i = 0; i < ro.size(); i++)
{
- HMI_DEBUG("wm", "compositor::screen @ %p add layer %u", this->proxy.get(), ro[i]);
+ HMI_DEBUG("compositor::screen @ %p add layer %u", this->proxy.get(), ro[i]);
// Add the layer to screen render order at nearest z-position
ivi_wm_screen_add_layer(this->proxy.get(), ro[i]);
}
void controller::layer_created(uint32_t id)
{
- HMI_DEBUG("wm", "compositor::controller @ %p layer %u (%x)", this->proxy.get(), id, id);
+ HMI_DEBUG("compositor::controller @ %p layer %u (%x)", this->proxy.get(), id, id);
if (this->layers.find(id) != this->layers.end())
{
- HMI_DEBUG("wm", "WindowManager has created layer %u (%x) already", id, id);
+ HMI_DEBUG("WindowManager has created layer %u (%x) already", id, id);
}
else
{
void controller::layer_error_detected(uint32_t object_id,
uint32_t error_code, const char *error_text)
{
- HMI_DEBUG("wm", "compositor::controller @ %p error o %d c %d text %s",
+ HMI_DEBUG("compositor::controller @ %p error o %d c %d text %s",
this->proxy.get(), object_id, error_code, error_text);
}
void controller::surface_visibility_changed(uint32_t id, int32_t visibility)
{
- HMI_DEBUG("wm", "compositor::surface %s @ %d v %i", __func__, id,
+ HMI_DEBUG("compositor::surface %s @ %d v %i", __func__, id,
visibility);
this->sprops[id].visibility = visibility;
this->chooks->surface_visibility(id, visibility);
void controller::surface_opacity_changed(uint32_t id, float opacity)
{
- HMI_DEBUG("wm", "compositor::surface %s @ %d o %f",
+ HMI_DEBUG("compositor::surface %s @ %d o %f",
__func__, id, opacity);
this->sprops[id].opacity = opacity;
}
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__,
+ HMI_DEBUG("compositor::surface %s @ %d x %i y %i w %i h %i", __func__,
id, x, y, width, height);
this->sprops[id].src_rect = rect{width, height, x, y};
}
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__,
+ HMI_DEBUG("compositor::surface %s @ %d x %i y %i w %i h %i", __func__,
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(uint32_t id, int32_t width,
int32_t height)
{
- HMI_DEBUG("wm", "compositor::surface %s @ %d w %i h %i", __func__, id,
+ HMI_DEBUG("compositor::surface %s @ %d w %i h %i", __func__, id,
width, 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(uint32_t layer_id, uint32_t surface_id)
{
- HMI_DEBUG("wm", "compositor::surface %s @ %d l %u",
+ HMI_DEBUG("compositor::surface %s @ %d l %u",
__func__, layer_id, 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",
+ HMI_DEBUG("compositor::surface %s @ %d f %u pid %u",
__func__, surface_id, frame_count, pid);
+ this->sprops[surface_id].pid = pid;
}
void controller::surface_created(uint32_t id)
{
- HMI_DEBUG("wm", "compositor::controller @ %p surface %u (%x)", this->proxy.get(), id,
+ HMI_DEBUG("compositor::controller @ %p surface %u (%x)", this->proxy.get(), id,
id);
if (this->surfaces.find(id) == this->surfaces.end())
{
void controller::surface_destroyed(uint32_t surface_id)
{
- HMI_DEBUG("wm", "compositor::surface %s @ %d", __func__, surface_id);
+ HMI_DEBUG("compositor::surface %s @ %d", __func__, surface_id);
this->chooks->surface_removed(surface_id);
this->sprops.erase(surface_id);
this->surfaces.erase(surface_id);
void controller::surface_error_detected(uint32_t object_id,
uint32_t error_code, const char *error_text)
{
- HMI_DEBUG("wm", "compositor::controller @ %p error o %d c %d text %s",
+ HMI_DEBUG("compositor::controller @ %p error o %d c %d text %s",
this->proxy.get(), object_id, error_code, error_text);
}
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);
+ HMI_DEBUG("compositor::layer %s @ %d v %i", __func__, layer_id, visibility);
this->lprops[layer_id].visibility = visibility;
}
void controller::layer_opacity_changed(uint32_t layer_id, float opacity)
{
- HMI_DEBUG("wm", "compositor::layer %s @ %d o %f", __func__, layer_id, opacity);
+ HMI_DEBUG("compositor::layer %s @ %d o %f", __func__, layer_id, opacity);
this->lprops[layer_id].opacity = opacity;
}
int32_t x, int32_t y,
int32_t width, int32_t height)
{
- HMI_DEBUG("wm", "compositor::layer %s @ %d x %i y %i w %i h %i",
+ HMI_DEBUG("compositor::layer %s @ %d x %i y %i w %i h %i",
__func__, layer_id, x, y, width, height);
this->lprops[layer_id].src_rect = rect{width, height, x, y};
}
int32_t x, int32_t y,
int32_t width, int32_t height)
{
- HMI_DEBUG("wm", "compositor::layer %s @ %d x %i y %i w %i h %i",
+ HMI_DEBUG("compositor::layer %s @ %d x %i y %i w %i h %i",
__func__, layer_id, x, y, width, height);
this->lprops[layer_id].dst_rect = rect{width, height, x, y};
}
void controller::layer_destroyed(uint32_t layer_id)
{
- HMI_DEBUG("wm", "compositor::layer %s @ %d", __func__, layer_id);
+ HMI_DEBUG("compositor::layer %s @ %d", __func__, layer_id);
this->lprops.erase(layer_id);
this->layers.erase(layer_id);
}
void controller::add_proxy_to_sid_mapping(struct ivi_wm *p,
uint32_t id)
{
- HMI_DEBUG("wm", "Add surface proxy mapping for %p (%u)", p, id);
+ HMI_DEBUG("Add surface proxy mapping for %p (%u)", p, id);
this->surface_proxy_to_id[uintptr_t(p)] = id;
this->sprops[id].id = id;
}
void controller::remove_proxy_to_sid_mapping(struct ivi_wm *p)
{
- HMI_DEBUG("wm", "Remove surface proxy mapping for %p", p);
+ HMI_DEBUG("Remove surface proxy mapping for %p", p);
this->surface_proxy_to_id.erase(uintptr_t(p));
}
void controller::add_proxy_to_lid_mapping(struct ivi_wm *p,
uint32_t id)
{
- HMI_DEBUG("wm", "Add layer proxy mapping for %p (%u)", p, id);
+ HMI_DEBUG("Add layer proxy mapping for %p (%u)", p, id);
this->layer_proxy_to_id[uintptr_t(p)] = id;
this->lprops[id].id = id;
}
void controller::remove_proxy_to_lid_mapping(struct ivi_wm *p)
{
- HMI_DEBUG("wm", "Remove layer proxy mapping for %p", p);
+ HMI_DEBUG("Remove layer proxy mapping for %p", p);
this->layer_proxy_to_id.erase(uintptr_t(p));
}
void controller::add_proxy_to_id_mapping(struct wl_output *p, uint32_t id)
{
- HMI_DEBUG("wm", "Add screen proxy mapping for %p (%u)", p, id);
+ HMI_DEBUG("Add screen proxy mapping for %p (%u)", p, id);
this->screen_proxy_to_id[uintptr_t(p)] = id;
}
void controller::remove_proxy_to_id_mapping(struct wl_output *p)
{
- HMI_DEBUG("wm", "Remove screen proxy mapping for %p", p);
+ HMI_DEBUG("Remove screen proxy mapping for %p", p);
this->screen_proxy_to_id.erase(uintptr_t(p));
}