+// _ _ _ _ ____
+// __| | ___| |__ _ _ __ _ ___| |_ __ _| |_ _ _ ___ / /\ \
+// / _` |/ _ \ '_ \| | | |/ _` | / __| __/ _` | __| | | / __| | | |
+// | (_| | __/ |_) | |_| | (_| | \__ \ || (_| | |_| |_| \__ \ | | |
+// \__,_|\___|_.__/ \__,_|\__, |___|___/\__\__,_|\__|\__,_|___/ | | |
+// |___/_____| \_\/_/
+void debug_status(struct afb_req req) {
+ // Quick and dirty, dump current surfaces and layers
+ AFB_REQ_DEBUG(req, "status");
+
+ auto o = json_object_new_object();
+ json_object_object_add(o, "surfaces",
+ to_json(g_afb_instance->controller->sprops));
+ json_object_object_add(o, "layers", to_json(g_afb_instance->controller->lprops));
+// json_object_object_add(o, "screens",
+// to_json(g_afb_instance->controller->screens));
+
+ afb_req_success(req, o, "status");
+}
+
+void debug_surfaces(afb_req req) {
+ afb_req_success(req, to_json(g_afb_instance->controller->sprops), "surfaces");
+}
+
+void debug_layers(afb_req req) {
+ afb_req_success(req, to_json(g_afb_instance->controller->lprops), "layers");
+}
+
+// Dummy register_surface implementation
+void register_surface(afb_req req) {
+ AFB_DEBUG("register_surface");
+
+ auto jo = afb_req_json(req);
+ json_object *jappid;
+ if (! json_object_object_get_ex(jo, "appid", &jappid)) {
+ afb_req_fail(req, "failed", "register_surface needs 'appid' integer argument");
+ return;