2 // Created by mfritzsc on 7/11/17.
7 #include "json_helper.hpp"
10 #include <json-c/json.h>
15 : api{this}, display{}, controller{}
18 binding_api::result_type binding_api::register_surface(uint32_t appid,
20 logdebug("%s appid %u surfid %u", __func__, appid, surfid);
22 return Err<json_object *>("invalid appid");
25 if (surfid > 0xffff) {
26 return Err<json_object *>("invalid surfaceid");
29 return Ok(json_object_new_int((appid << 16) + surfid));
32 binding_api::result_type binding_api::debug_layers() {
33 logdebug("%s", __func__);
34 return Ok(to_json(this->app->controller->lprops));
37 binding_api::result_type binding_api::debug_surfaces() {
38 logdebug("%s", __func__);
39 return Ok(to_json(this->app->controller->sprops));
42 binding_api::result_type binding_api::debug_status() {
43 logdebug("%s", __func__);
44 json_object *jr = json_object_new_object();
45 json_object_object_add(jr, "surfaces", to_json(this->app->controller->sprops));
46 json_object_object_add(jr, "layers", to_json(this->app->controller->lprops));