+void debug_surfaces(afb_req req) {
+ CHECK_WAYLAND();
+
+ 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) {
+ CHECK_WAYLAND();
+
+ 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");
+}
+