-void controller::add_task(char const *name,
- std::function<void(struct controller *)> &&f) {
- this->pending.emplace_back(std::make_pair(name, f));
-}
-
-void controller::execute_pending() {
- if (!this->pending.empty()) {
- for (auto &t : this->pending) {
- logdebug("executing task '%s'", t.first);
- t.second(this);
- }
- this->pending.clear();
- ivi_controller_commit_changes(this->proxy.get());
- // XXX: No flush here...
- }
-}
-
-void controller::debug_dump_current_status() {
- if (!this->surfaces.empty()) {
- puts("Surfaces:");
- for (auto const &i : this->surfaces) {
- auto const &r = i.second->dst_rect;
- auto const &s = i.second->size;
- printf("%d [%ux%u] (%ux%u@%dx%d), ", i.first, s.w, s.h, r.w, r.h, r.x,
- r.y);
- }
- puts("\b\b ");
- }
-
- if (!this->layers.empty()) {
- puts("Layers:");
- for (auto const &i : this->layers) {
- auto const &r = i.second->dst_rect;
- auto const &s = i.second->size;
- printf("%d [%ux%u] (%ux%u@%dx%d), ", i.first, s.w, s.h, r.w, r.h, r.x,
- r.y);
- }
- puts("\b\b ");
- }
-}