summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarcus Fritzsch <marcus_fritzsch@mentor.com>2017-07-05 16:13:46 +0200
committerMarcus Fritzsch <marcus_fritzsch@mentor.com>2017-08-08 17:24:00 +0200
commit96e87229a885492201a9fe8d4e6afcc91a8775d5 (patch)
tree439938f9f4a73b1786c1a8ccf523c64b748d0bf2 /src
parent77fcaa36178e739044b8ce4e68388440c4379a74 (diff)
main: add layers and surfaces API calls
Signed-off-by: Marcus Fritzsch <marcus_fritzsch@mentor.com>
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp29
1 files changed, 28 insertions, 1 deletions
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