clang-tidy the place up
[staging/windowmanager.git] / src / wayland.cpp
1 #include <utility>
2
3 #include "wayland.hpp"
4
5 //                                                                  _
6 //  _ __   __ _ _ __ ___   ___  ___ _ __   __ _  ___ ___  __      _| |
7 // | '_ \ / _` | '_ ` _ \ / _ \/ __| '_ \ / _` |/ __/ _ \ \ \ /\ / / |
8 // | | | | (_| | | | | | |  __/\__ \ |_) | (_| | (_|  __/  \ V  V /| |
9 // |_| |_|\__,_|_| |_| |_|\___||___/ .__/ \__,_|\___\___|   \_/\_/ |_|
10 //                                 |_|
11 namespace wl {
12
13 //      _ _           _
14 //   __| (_)___ _ __ | | __ _ _   _
15 //  / _` | / __| '_ \| |/ _` | | | |
16 // | (_| | \__ \ |_) | | (_| | |_| |
17 //  \__,_|_|___/ .__/|_|\__,_|\__, |
18 //             |_|            |___/
19 display::display()
20    : d(std::unique_ptr<struct wl_display, void (*)(struct wl_display *)>(
21         wl_display_connect(nullptr),
22 #ifdef DEBUG_OUTPUT
23         [](struct wl_display *d) {
24            logdebug("wl::display ~display @ %p", d);
25            wl_display_disconnect(d);
26         })),
27 #else
28         &wl_display_disconnect)),
29 #endif
30      r(d.get()) {
31 }
32
33 display::~display() = default;
34
35 bool display::ok() const { return d && wl_display_get_error(d.get()) == 0; }
36
37 void display::roundtrip() { wl_display_roundtrip(this->d.get()); }
38
39 int display::dispatch() { return wl_display_dispatch(this->d.get()); }
40
41 void display::flush() { wl_display_flush(this->d.get()); }
42
43 int display::get_fd() const { return wl_display_get_fd(this->d.get()); }
44
45 //                 _     _
46 //  _ __ ___  __ _(_)___| |_ _ __ _   _
47 // | '__/ _ \/ _` | / __| __| '__| | | |
48 // | | |  __/ (_| | \__ \ |_| |  | |_| |
49 // |_|  \___|\__, |_|___/\__|_|   \__, |
50 //           |___/                |___/
51 namespace {
52 void registry_global(void *data, struct wl_registry * /*r*/, uint32_t name,
53                      char const *iface, uint32_t v) {
54    static_cast<struct registry *>(data)->global(name, iface, v);
55 }
56
57 void registry_global_remove(void *data, struct wl_registry * /*r*/,
58                             uint32_t name) {
59    static_cast<struct registry *>(data)->global_remove(name);
60 }
61
62 constexpr struct wl_registry_listener registry_listener = {
63    registry_global, registry_global_remove};
64 }  // namespace
65
66 registry::registry(struct wl_display *d)
67    : wayland_proxy(d == nullptr ? nullptr : wl_display_get_registry(d)) {
68    if (this->proxy != nullptr) {
69       wl_registry_add_listener(this->proxy, &registry_listener, this);
70 }
71 }
72
73 registry::~registry() {
74    logdebug("wl::registry %s @ %p", __func__, this->proxy);
75 }
76
77 void registry::add_global_handler(char const *iface, binder bind) {
78    this->bindings[iface] = std::move(bind);
79 }
80
81 void registry::global(uint32_t name, char const *iface, uint32_t v) {
82    auto b = this->bindings.find(iface);
83    if (b != this->bindings.end()) {
84       b->second(this->proxy, name, v);
85    }
86    logdebug("wl::registry @ %p global n %u i %s v %u", this->proxy, name, iface,
87             v);
88 }
89
90 void registry::global_remove(uint32_t /*name*/) {}
91
92 //              _               _
93 //   ___  _   _| |_ _ __  _   _| |_
94 //  / _ \| | | | __| '_ \| | | | __|
95 // | (_) | |_| | |_| |_) | |_| | |_
96 //  \___/ \__,_|\__| .__/ \__,_|\__|
97 //                 |_|
98 namespace {
99 void output_geometry(void *data, struct wl_output * /*wl_output*/, int32_t x,
100                      int32_t y, int32_t physical_width, int32_t physical_height,
101                      int32_t subpixel, const char *make, const char *model,
102                      int32_t transform) {
103    static_cast<struct output *>(data)->geometry(
104       x, y, physical_width, physical_height, subpixel, make, model, transform);
105 }
106
107 void output_mode(void *data, struct wl_output * /*wl_output*/, uint32_t flags,
108                  int32_t width, int32_t height, int32_t refresh) {
109    static_cast<struct output *>(data)->mode(flags, width, height, refresh);
110 }
111
112 void output_done(void *data, struct wl_output * /*wl_output*/) {
113    static_cast<struct output *>(data)->done();
114 }
115
116 void output_scale(void *data, struct wl_output * /*wl_output*/,
117                   int32_t factor) {
118    static_cast<struct output *>(data)->scale(factor);
119 }
120
121 constexpr struct wl_output_listener output_listener = {
122    output_geometry, output_mode, output_done, output_scale};
123 }  // namespace
124
125 output::output(struct wl_registry *r, uint32_t name, uint32_t v)
126    : wayland_proxy(wl_registry_bind(r, name, &wl_output_interface, v)) {
127    wl_output_add_listener(this->proxy, &output_listener, this);
128 }
129
130 void output::geometry(int32_t x, int32_t y, int32_t pw, int32_t ph,
131                       int32_t subpel, char const *make, char const *model,
132                       int32_t tx) {
133    logdebug(
134       "wl::output %s @ %p x %i y %i w %i h %i spel %x make %s model %s tx %i",
135       __func__, this->proxy, x, y, pw, ph, subpel, make, model, tx);
136 }
137
138 void output::mode(uint32_t flags, int32_t w, int32_t h, int32_t r) {
139    logdebug("wl::output %s @ %p f %x w %i h %i r %i", __func__, this->proxy,
140             flags, w, h, r);
141    if ((flags & WL_OUTPUT_MODE_CURRENT) != 0u) {
142       this->width = w;
143       this->height = h;
144       this->refresh = r;
145    }
146 }
147
148 void output::done() {
149    logdebug("wl::output %s @ %p done", __func__, this->proxy);
150 }
151
152 void output::scale(int32_t factor) {
153    logdebug("wl::output %s @ %p f %i", __func__, this->proxy, factor);
154 }
155 }  // namespace wl
156
157 //  _ __   __ _ _ __ ___   ___  ___ _ __   __ _  ___ ___
158 // | '_ \ / _` | '_ ` _ \ / _ \/ __| '_ \ / _` |/ __/ _ \
159 // | | | | (_| | | | | | |  __/\__ \ |_) | (_| | (_|  __/
160 // |_| |_|\__,_|_| |_| |_|\___||___/ .__/ \__,_|\___\___|
161 //                                 |_|
162 //                   _       _
163 //   __ _  ___ _ __ (_)_   _(_)
164 //  / _` |/ _ \ '_ \| \ \ / / |
165 // | (_| |  __/ | | | |\ V /| |
166 //  \__, |\___|_| |_|_| \_/ |_|
167 //  |___/
168 namespace genivi {
169
170 //                  _             _ _
171 //   ___ ___  _ __ | |_ _ __ ___ | | | ___ _ __
172 //  / __/ _ \| '_ \| __| '__/ _ \| | |/ _ \ '__|
173 // | (_| (_) | | | | |_| | | (_) | | |  __/ |
174 //  \___\___/|_| |_|\__|_|  \___/|_|_|\___|_|
175 //
176 namespace {
177 void controller_screen(void *data, struct ivi_controller * /*ivi_controller*/,
178                        uint32_t id_screen,
179                        struct ivi_controller_screen *screen) {
180    static_cast<struct controller *>(data)->controller_screen(id_screen, screen);
181 }
182
183 void controller_layer(void *data, struct ivi_controller * /*ivi_controller*/,
184                       uint32_t id_layer) {
185    static_cast<struct controller *>(data)->controller_layer(id_layer);
186 }
187
188 void controller_surface(void *data, struct ivi_controller * /*ivi_controller*/,
189                         uint32_t id_surface) {
190    static_cast<struct controller *>(data)->controller_surface(id_surface);
191 }
192
193 void controller_error(void *data, struct ivi_controller * /*ivi_controller*/,
194                       int32_t object_id, int32_t object_type,
195                       int32_t error_code, const char *error_text) {
196    static_cast<struct controller *>(data)->controller_error(
197       object_id, object_type, error_code, error_text);
198 }
199
200 constexpr struct ivi_controller_listener listener = {
201    controller_screen, controller_layer, controller_surface, controller_error};
202 }  // namespace
203
204 controller::controller(struct wl_registry *r, uint32_t name, uint32_t version)
205    : wayland_proxy(
206         wl_registry_bind(r, name, &ivi_controller_interface, version)),
207      surface_proxy_to_id{},
208      surfaces{},
209      layer_proxy_to_id{},
210      layers{},
211      screen_proxy_to_id{},
212      screens{},
213      pending{},
214      output_size{} {
215    ivi_controller_add_listener(this->proxy, &listener, this);
216 }
217
218 controller::~controller() = default;
219
220 void controller::layer_create(uint32_t id, int32_t w, int32_t h) {
221    this->layers[id] = std::make_unique<layer>(id, w, h, this);
222 }
223
224 void controller::surface_create(uint32_t id) {
225    this->surfaces[id] = std::make_unique<surface>(id, this);
226 }
227
228 void controller::controller_screen(uint32_t id,
229                                    struct ivi_controller_screen *screen) {
230    logdebug("genivi::controller @ %p screen %u (%x) @ %p", this->proxy, id, id,
231             screen);
232    this->screens[id] = std::make_unique<struct screen>(id, this, screen);
233 }
234
235 void controller::controller_layer(uint32_t id) {
236    logdebug("genivi::controller @ %p layer %u (%x)", this->proxy, id, id);
237    auto &l = this->layers[id] = std::make_unique<struct layer>(id, this);
238    l->clear_surfaces();
239 }
240
241 void controller::controller_surface(uint32_t id) {
242    logdebug("genivi::controller @ %p surface %u (%x)", this->proxy, id, id);
243    this->surfaces[id] = std::make_unique<struct surface>(id, this);
244
245    add_task("fullscreen surface", [id](struct controller *c) {
246       auto &s = c->surfaces[id];
247       s->set_destination_rectangle(0, 0, c->output_size.w, c->output_size.h);
248       s->set_visibility(1);
249       uint32_t lid = id == 0x16180 ? 1000 : 100;
250       c->layers[lid]->add_surface(s.get());
251       logdebug("Surface %u now fullscreen on layer %u", id, lid);
252    });
253 }
254
255 void controller::controller_error(int32_t object_id, int32_t object_type,
256                                   int32_t error_code, const char *error_text) {
257    logdebug("genivi::controller @ %p error o %i t %i c %i text %s", this->proxy,
258             object_id, object_type, error_code, error_text);
259 }
260
261 //  _
262 // | | __ _ _   _  ___ _ __
263 // | |/ _` | | | |/ _ \ '__|
264 // | | (_| | |_| |  __/ |
265 // |_|\__,_|\__, |\___|_|
266 //          |___/
267 namespace {
268 void layer_visibility(void *data,
269                       struct ivi_controller_layer * /*ivi_controller_layer*/,
270                       int32_t visibility) {
271    static_cast<struct layer *>(data)->parent->layer_visibility(
272       static_cast<struct layer *>(data)->id, visibility);
273 }
274
275 void layer_opacity(void *data,
276                    struct ivi_controller_layer * /*ivi_controller_layer*/,
277                    wl_fixed_t opacity) {
278    static_cast<struct layer *>(data)->parent->layer_opacity(
279       static_cast<struct layer *>(data)->id,
280       float(wl_fixed_to_double(opacity)));
281 }
282
283 void layer_source_rectangle(
284    void *data, struct ivi_controller_layer * /*ivi_controller_layer*/,
285    int32_t x, int32_t y, int32_t width, int32_t height) {
286    static_cast<struct layer *>(data)->parent->layer_source_rectangle(
287       static_cast<struct layer *>(data)->id, x, y, width, height);
288 }
289
290 void layer_destination_rectangle(
291    void *data, struct ivi_controller_layer * /*ivi_controller_layer*/,
292    int32_t x, int32_t y, int32_t width, int32_t height) {
293    static_cast<struct layer *>(data)->parent->layer_destination_rectangle(
294       static_cast<struct layer *>(data)->id, x, y, width, height);
295 }
296
297 void layer_configuration(void *data,
298                          struct ivi_controller_layer * /*ivi_controller_layer*/,
299                          int32_t width, int32_t height) {
300    static_cast<struct layer *>(data)->parent->layer_configuration(
301       static_cast<struct layer *>(data)->id, width, height);
302 }
303
304 void layer_orientation(void *data,
305                        struct ivi_controller_layer * /*ivi_controller_layer*/,
306                        int32_t orientation) {
307    static_cast<struct layer *>(data)->parent->layer_orientation(
308       static_cast<struct layer *>(data)->id, orientation);
309 }
310
311 void layer_screen(void *data,
312                   struct ivi_controller_layer * /*ivi_controller_layer*/,
313                   struct wl_output *screen) {
314    static_cast<struct layer *>(data)->parent->layer_screen(
315       static_cast<struct layer *>(data)->id, screen);
316 }
317
318 void layer_destroyed(void *data,
319                      struct ivi_controller_layer * /*ivi_controller_layer*/) {
320    static_cast<struct layer *>(data)->parent->layer_destroyed(
321       static_cast<struct layer *>(data)->id);
322 }
323
324 constexpr struct ivi_controller_layer_listener layer_listener = {
325    layer_visibility,       layer_opacity,
326    layer_source_rectangle, layer_destination_rectangle,
327    layer_configuration,    layer_orientation,
328    layer_screen,           layer_destroyed,
329 };
330 }  // namespace
331
332 layer::layer(uint32_t i, struct controller *c) : layer(i, 0, 0, c) {}
333
334 layer::layer(uint32_t i, int32_t w, int32_t h, struct controller *c)
335    : wayland_proxy(ivi_controller_layer_create(c->proxy, i, w, h)),
336      controller_child(c, i),
337      dst_rect{},
338      src_rect{},
339      size{},
340      orientation{},
341      visibility{},
342      opacity{} {
343    this->parent->add_proxy_to_id_mapping(this->proxy, i);
344    ivi_controller_layer_add_listener(this->proxy, &layer_listener, this);
345 }
346
347 layer::~layer() {
348    logdebug("%s layer %i @ %p", __func__, this->id, this->proxy);
349    this->parent->remove_proxy_to_id_mapping(this->proxy);
350    ivi_controller_layer_destroy(this->proxy, 1);
351    this->proxy = nullptr;
352 }
353
354 void controller::layer_visibility(uint32_t id, int32_t visibility) {
355    logdebug("genivi::layer %s @ %p v %i", __func__, this->proxy, visibility);
356    this->layers[id]->visibility = visibility;
357 }
358
359 void controller::layer_opacity(uint32_t id, float opacity) {
360    logdebug("genivi::layer %s @ %p o %f", __func__, this->proxy, opacity);
361    this->layers[id]->opacity = opacity;
362 }
363
364 void controller::layer_source_rectangle(uint32_t id, int32_t x, int32_t y,
365                                         int32_t width, int32_t height) {
366    logdebug("genivi::layer %s @ %p x %i y %i w %i h %i", __func__, this->proxy,
367             x, y, width, height);
368    this->layers[id]->src_rect = rect{uint32_t(width), uint32_t(height), x, y};
369 }
370
371 void controller::layer_destination_rectangle(uint32_t id, int32_t x, int32_t y,
372                                              int32_t width, int32_t height) {
373    logdebug("genivi::layer %s @ %p x %i y %i w %i h %i", __func__, this->proxy,
374             x, y, width, height);
375    this->layers[id]->dst_rect = rect{uint32_t(width), uint32_t(height), x, y};
376 }
377
378 void controller::layer_configuration(uint32_t id, int32_t width,
379                                      int32_t height) {
380    logdebug("genivi::layer %s @ %p w %i h %i", __func__, this->proxy, width,
381             height);
382    this->layers[id]->size = size{uint32_t(width), uint32_t(height)};
383 }
384
385 void controller::layer_orientation(uint32_t id, int32_t orientation) {
386    logdebug("genivi::layer %s @ %p o %i", __func__, this->proxy, orientation);
387    this->layers[id]->orientation = orientation;
388 }
389
390 void controller::layer_screen(uint32_t /*id*/, struct wl_output *screen) {
391    logdebug("genivi::layer %s @ %p s %p", __func__, this->proxy, screen);
392 }
393
394 void controller::layer_destroyed(uint32_t id) {
395    logdebug("genivi::layer %s @ %p", __func__, this->proxy);
396    add_task("remove layer",
397             [id](struct controller *c) { c->layers.erase(id); });
398 }
399
400 //                  __
401 //  ___ _   _ _ __ / _| __ _  ___ ___
402 // / __| | | | '__| |_ / _` |/ __/ _ \
403 // \__ \ |_| | |  |  _| (_| | (_|  __/
404 // |___/\__,_|_|  |_|  \__,_|\___\___|
405 //
406 namespace {
407
408 void surface_visibility(
409    void *data, struct ivi_controller_surface * /*ivi_controller_surface*/,
410    int32_t visibility) {
411    static_cast<struct surface *>(data)->parent->surface_visibility(
412       static_cast<struct surface *>(data)->id, visibility);
413 }
414
415 void surface_opacity(void *data,
416                      struct ivi_controller_surface * /*ivi_controller_surface*/,
417                      wl_fixed_t opacity) {
418    static_cast<struct surface *>(data)->parent->surface_opacity(
419       static_cast<struct surface *>(data)->id,
420       float(wl_fixed_to_double(opacity)));
421 }
422
423 void surface_source_rectangle(
424    void *data, struct ivi_controller_surface * /*ivi_controller_surface*/,
425    int32_t x, int32_t y, int32_t width, int32_t height) {
426    static_cast<struct surface *>(data)->parent->surface_source_rectangle(
427       static_cast<struct surface *>(data)->id, x, y, width, height);
428 }
429
430 void surface_destination_rectangle(
431    void *data, struct ivi_controller_surface * /*ivi_controller_surface*/,
432    int32_t x, int32_t y, int32_t width, int32_t height) {
433    static_cast<struct surface *>(data)->parent->surface_destination_rectangle(
434       static_cast<struct surface *>(data)->id, x, y, width, height);
435 }
436
437 void surface_configuration(
438    void *data, struct ivi_controller_surface * /*ivi_controller_surface*/,
439    int32_t width, int32_t height) {
440    static_cast<struct surface *>(data)->parent->surface_configuration(
441       static_cast<struct surface *>(data)->id, width, height);
442 }
443
444 void surface_orientation(
445    void *data, struct ivi_controller_surface * /*ivi_controller_surface*/,
446    int32_t orientation) {
447    static_cast<struct surface *>(data)->parent->surface_orientation(
448       static_cast<struct surface *>(data)->id, orientation);
449 }
450
451 void surface_pixelformat(
452    void *data, struct ivi_controller_surface * /*ivi_controller_surface*/,
453    int32_t pixelformat) {
454    static_cast<struct surface *>(data)->parent->surface_pixelformat(
455       static_cast<struct surface *>(data)->id, pixelformat);
456 }
457
458 void surface_layer(void *data,
459                    struct ivi_controller_surface * /*ivi_controller_surface*/,
460                    struct ivi_controller_layer *layer) {
461    static_cast<struct surface *>(data)->parent->surface_layer(
462       static_cast<struct surface *>(data)->id, layer);
463 }
464
465 void surface_stats(void *data,
466                    struct ivi_controller_surface * /*ivi_controller_surface*/,
467                    uint32_t redraw_count, uint32_t frame_count,
468                    uint32_t update_count, uint32_t pid,
469                    const char *process_name) {
470    static_cast<struct surface *>(data)->parent->surface_stats(
471       static_cast<struct surface *>(data)->id, redraw_count, frame_count,
472       update_count, pid, process_name);
473 }
474
475 void surface_destroyed(
476    void *data, struct ivi_controller_surface * /*ivi_controller_surface*/) {
477    static_cast<struct surface *>(data)->parent->surface_destroyed(
478       static_cast<struct surface *>(data)->id);
479 }
480
481 void surface_content(void *data,
482                      struct ivi_controller_surface * /*ivi_controller_surface*/,
483                      int32_t content_state) {
484    static_cast<struct surface *>(data)->parent->surface_content(
485       static_cast<struct surface *>(data)->id, content_state);
486 }
487
488 constexpr struct ivi_controller_surface_listener surface_listener = {
489    surface_visibility,
490    surface_opacity,
491    surface_source_rectangle,
492    surface_destination_rectangle,
493    surface_configuration,
494    surface_orientation,
495    surface_pixelformat,
496    surface_layer,
497    surface_stats,
498    surface_destroyed,
499    surface_content,
500 };
501 }  // namespace
502
503 surface::surface(uint32_t i, struct controller *c)
504    : wayland_proxy(ivi_controller_surface_create(c->proxy, i)),
505      controller_child(c, i),
506      dst_rect{},
507      src_rect{},
508      size{},
509      orientation{},
510      visibility{},
511      opacity{1.f} {
512    this->parent->add_proxy_to_id_mapping(this->proxy, i);
513    ivi_controller_surface_add_listener(this->proxy, &surface_listener, this);
514 }
515
516 surface::~surface() {
517    logdebug("%s surface %i @ %p", __func__, this->id, this->proxy);
518    this->parent->remove_proxy_to_id_mapping(this->proxy);
519    ivi_controller_surface_destroy(this->proxy, 1);
520    this->proxy = nullptr;
521 }
522
523 void controller::surface_visibility(uint32_t id, int32_t visibility) {
524    logdebug("genivi::surface %s @ %p v %i", __func__, this->proxy, visibility);
525    this->surfaces[id]->visibility = visibility;
526 }
527
528 void controller::surface_opacity(uint32_t id, float opacity) {
529    logdebug("genivi::surface %s @ %p o %f", __func__, this->proxy, opacity);
530    this->surfaces[id]->opacity = opacity;
531 }
532
533 void controller::surface_source_rectangle(uint32_t id, int32_t x, int32_t y,
534                                           int32_t width, int32_t height) {
535    logdebug("genivi::surface %s @ %p x %i y %i w %i h %i", __func__,
536             this->proxy, x, y, width, height);
537    this->surfaces[id]->src_rect = rect{uint32_t(width), uint32_t(height), x, y};
538 }
539
540 void controller::surface_destination_rectangle(uint32_t id, int32_t x,
541                                                int32_t y, int32_t width,
542                                                int32_t height) {
543    logdebug("genivi::surface %s @ %p x %i y %i w %i h %i", __func__,
544             this->proxy, x, y, width, height);
545    this->surfaces[id]->dst_rect = rect{uint32_t(width), uint32_t(height), x, y};
546 }
547
548 void controller::surface_configuration(uint32_t id, int32_t width,
549                                        int32_t height) {
550    logdebug("genivi::surface %s @ %p w %i h %i", __func__, this->proxy, width,
551             height);
552    this->surfaces[id]->size = size{uint32_t(width), uint32_t(height)};
553 }
554
555 void controller::surface_orientation(uint32_t id, int32_t orientation) {
556    logdebug("genivi::surface %s @ %p o %i", __func__, this->proxy, orientation);
557    this->surfaces[id]->orientation = orientation;
558 }
559
560 void controller::surface_pixelformat(uint32_t /*id*/, int32_t pixelformat) {
561    logdebug("genivi::surface %s @ %p f %i", __func__, this->proxy, pixelformat);
562 }
563
564 void controller::surface_layer(uint32_t /*id*/,
565                                struct ivi_controller_layer *layer) {
566    logdebug("genivi::surface %s @ %p l %u @ %p", __func__, this->proxy,
567             this->layer_proxy_to_id[uintptr_t(layer)], layer);
568 }
569
570 void controller::surface_stats(uint32_t /*id*/, uint32_t redraw_count,
571                                uint32_t frame_count, uint32_t update_count,
572                                uint32_t pid, const char *process_name) {
573    logdebug("genivi::surface %s @ %p r %u f %u u %u pid %u p %s", __func__,
574             this->proxy, redraw_count, frame_count, update_count, pid,
575             process_name);
576 }
577
578 void controller::surface_destroyed(uint32_t id) {
579    logdebug("genivi::surface %s @ %p", __func__, this->proxy);
580    this->surfaces.erase(id);
581 }
582
583 void controller::surface_content(uint32_t id, int32_t content_state) {
584    logdebug("genivi::surface %s @ %p s %i", __func__, this->proxy,
585             content_state);
586    if (content_state == IVI_CONTROLLER_SURFACE_CONTENT_STATE_CONTENT_REMOVED) {
587       add_task("remove surface",
588                [id](struct controller *c) { c->surfaces.erase(id); });
589    }
590 }
591
592 //
593 //  ___  ___ _ __ ___  ___ _ __
594 // / __|/ __| '__/ _ \/ _ \ '_ \
595 // \__ \ (__| | |  __/  __/ | | |
596 // |___/\___|_|  \___|\___|_| |_|
597 //
598 screen::screen(uint32_t i, struct controller *c,
599                struct ivi_controller_screen *p)
600    : wayland_proxy(p), controller_child(c, i) {
601    logdebug("genivi::screen @ %p id %u", p, i);
602 }
603 }  // namespace genivi