X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=src%2Fmain.cpp;h=13e6ab2b71a09766f2f9ab016ca6c406f7b8b537;hb=96e87229a885492201a9fe8d4e6afcc91a8775d5;hp=e78b42f497d4e29f1806da34fa1535344704e214;hpb=77fcaa36178e739044b8ce4e68388440c4379a74;p=staging%2Fwindowmanager.git diff --git a/src/main.cpp b/src/main.cpp index e78b42f..13e6ab2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -228,8 +228,35 @@ void debug_status(struct afb_req req) noexcept { } } +void debug_surfaces(afb_req req) { + auto a = json_object_new_array(); + + if (!g_wayland->controller->surfaces.empty()) { + for (auto const &i : g_wayland->controller->surfaces) { + json_object_array_add(a, json_object_new_int(i.first)); + } + } + + afb_req_success(req, a, "surfaces"); +} + +void debug_layers(afb_req req) { + auto a = json_object_new_array(); + + if (!g_wayland->controller->layers.empty()) { + for (auto const &i : g_wayland->controller->layers) { + json_object_array_add(a, json_object_new_int(i.first)); + } + } + + afb_req_success(req, a, "surfaces"); +} + const struct afb_verb_v2 verbs[] = { - {"status", debug_status, NULL, NULL, AFB_SESSION_NONE_V2}, {}, + {"status", debug_status, NULL, NULL, AFB_SESSION_NONE_V2}, + {"layers", debug_layers, NULL, NULL, AFB_SESSION_NONE_V2}, + {"surfaces", debug_surfaces, NULL, NULL, AFB_SESSION_NONE_V2}, + {}, }; } // namespace