+namespace {
+
+void surface_visibility(void *data,
+ struct ivi_controller_surface *ivi_controller_surface,
+ int32_t visibility) {
+ static_cast<surface *>(data)->visibility(visibility);
+}
+
+void surface_opacity(void *data,
+ struct ivi_controller_surface *ivi_controller_surface,
+ wl_fixed_t opacity) {
+ static_cast<surface *>(data)->opacity(wl_fixed_to_double(opacity));
+}
+
+void surface_source_rectangle(
+ void *data, struct ivi_controller_surface *ivi_controller_surface, int32_t x,
+ int32_t y, int32_t width, int32_t height) {
+ static_cast<surface *>(data)->source_rectangle(x, y, width, height);
+}
+
+void surface_destination_rectangle(
+ void *data, struct ivi_controller_surface *ivi_controller_surface, int32_t x,
+ int32_t y, int32_t width, int32_t height) {
+ static_cast<surface *>(data)->destination_rectangle(x, y, width, height);
+}
+
+void surface_configuration(
+ void *data, struct ivi_controller_surface *ivi_controller_surface,
+ int32_t width, int32_t height) {
+ static_cast<surface *>(data)->configuration(width, height);
+}
+
+void surface_orientation(void *data,
+ struct ivi_controller_surface *ivi_controller_surface,
+ int32_t orientation) {
+ static_cast<surface *>(data)->orientation(orientation);
+}
+
+void surface_pixelformat(void *data,
+ struct ivi_controller_surface *ivi_controller_surface,
+ int32_t pixelformat) {
+ static_cast<surface *>(data)->pixelformat(pixelformat);
+}
+
+void surface_layer(void *data,
+ struct ivi_controller_surface *ivi_controller_surface,
+ struct ivi_controller_layer *layer) {
+ static_cast<surface *>(data)->layer(layer);
+}
+
+void surface_stats(void *data,
+ struct ivi_controller_surface *ivi_controller_surface,
+ uint32_t redraw_count, uint32_t frame_count,
+ uint32_t update_count, uint32_t pid,
+ const char *process_name) {
+ static_cast<surface *>(data)->stats(redraw_count, frame_count, update_count,
+ pid, process_name);
+}
+
+void surface_destroyed(void *data,
+ struct ivi_controller_surface *ivi_controller_surface) {
+ static_cast<surface *>(data)->destroyed();
+}
+
+void surface_content(void *data,
+ struct ivi_controller_surface *ivi_controller_surface,
+ int32_t content_state) {
+ static_cast<surface *>(data)->content(content_state);
+}
+
+static constexpr ivi_controller_surface_listener surface_listener = {
+ surface_visibility,
+ surface_opacity,
+ surface_source_rectangle,
+ surface_destination_rectangle,
+ surface_configuration,
+ surface_orientation,
+ surface_pixelformat,
+ surface_layer,
+ surface_stats,
+ surface_destroyed,
+ surface_content,
+};
+}
+