// |_| |___/
display::display()
: d(std::unique_ptr<wl_display, void (*)(wl_display *)>(
- wl_display_connect(NULL), wl_display_disconnect)),
+ wl_display_connect(NULL),
+ [](wl_display *d) {
+ logdebug("wl::display %s @ %p", __func__, d);
+ wl_display_disconnect(d);
+ })),
r(std::make_unique<registry>(d.get())) {}
+display::~display() {}
+
bool display::ok() const {
return d.get() != nullptr && wl_display_get_error(d.get()) == 0;
}
}
registry::~registry() {
- wl_registry_destroy(this->proxy);
- this->proxy = nullptr;
+ logdebug("wl::registry %s @ %p", __func__, this->proxy);
}
void registry::add_global_handler(char const *iface, binder bind) {
void layer_opacity(void *data,
struct ivi_controller_layer *ivi_controller_layer,
wl_fixed_t opacity) {
- static_cast<layer *>(data)->opacity(opacity);
+ static_cast<layer *>(data)->opacity(wl_fixed_to_double(opacity));
}
void layer_source_rectangle(void *data,
logdebug("genivi::layer %s @ %p v %i", __func__, this->proxy, visibility);
}
-void layer::opacity(wl_fixed_t opacity) {
- logdebug("genivi::layer %s @ %p o %i", __func__, this->proxy, opacity);
+void layer::opacity(float opacity) {
+ logdebug("genivi::layer %s @ %p o %f", __func__, this->proxy, opacity);
}
void layer::source_rectangle(int32_t x, int32_t y, int32_t width,
void surface_opacity(void *data,
struct ivi_controller_surface *ivi_controller_surface,
wl_fixed_t opacity) {
- static_cast<surface *>(data)->opacity(opacity);
+ static_cast<surface *>(data)->opacity(wl_fixed_to_double(opacity));
}
void surface_source_rectangle(
logdebug("genivi::surface %s @ %p v %i", __func__, this->proxy, visibility);
}
-void surface::opacity(wl_fixed_t opacity) {
- logdebug("genivi::surface %s @ %p o %i", __func__, this->proxy, opacity);
+void surface::opacity(float opacity) {
+ logdebug("genivi::surface %s @ %p o %f", __func__, this->proxy, opacity);
}
void surface::source_rectangle(int32_t x, int32_t y, int32_t width,
std::unique_ptr<registry> r;
display();
+ ~display();
bool ok() const;
void roundtrip();
int dispatch();
// Events
void visibility(int32_t visibility);
- void opacity(wl_fixed_t opacity);
+ void opacity(float opacity);
void source_rectangle(int32_t x, int32_t y, int32_t width, int32_t height);
void destination_rectangle(int32_t x, int32_t y, int32_t width,
int32_t height);
// Events
void visibility(int32_t visibility);
- void opacity(wl_fixed_t opacity);
+ void opacity(float opacity);
void source_rectangle(int32_t x, int32_t y, int32_t width, int32_t height);
void destination_rectangle(int32_t x, int32_t y, int32_t width,
int32_t height);
void orientation(int32_t orientation);
void screen(struct wl_output *screen);
void destroyed();
+
+ // Requests
+ void set_visibility(uint32_t visibility);
+ void set_opacity(wl_fixed_t opacity);
+ void set_source_rectangle(int32_t x, int32_t y, int32_t width, int32_t height);
+ void set_destination_rectangle(int32_t x, int32_t y, int32_t width, int32_t height);
+ void set_configuration(int32_t width, int32_t height);
+ void set_orientation(int32_t orientation);
+ void screenshot(const char *filename);
+ void clear_surfaces();
+ void add_surface(struct surface *surface);
+ void remove_surface(struct surface *surface);
+ void set_render_order(struct wl_array *id_surfaces);
};
//