X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafb_binding_api.cpp;h=3c755242e67b9d8cb311cac8da010a1d408edd0b;hb=c392fff74872af6d4f165ff3f854d19f390ec0ee;hp=b608a8ac2ecdb8f14fd75e417a0b19227a791b28;hpb=c0f383d989821c61872aaa38932fa7719dc97120;p=apps%2Fagl-service-windowmanager-2017.git diff --git a/src/afb_binding_api.cpp b/src/afb_binding_api.cpp index b608a8a..3c75524 100644 --- a/src/afb_binding_api.cpp +++ b/src/afb_binding_api.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017 Mentor Graphics Development (Deutschland) GmbH + * Copyright (c) 2017 TOYOTA MOTOR CORPORATION * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,12 +26,9 @@ using json = nlohmann::json; #include namespace wm { -// _ _ _ _ _ _ _ -// | |__ (_)_ __ __| (_)_ __ __ _ __ _ _ __ (_) (_)_ __ ___ _ __ | | -// | '_ \| | '_ \ / _` | | '_ \ / _` | / _` | '_ \| | | | '_ ` _ \| '_ \| | -// | |_) | | | | | (_| | | | | | (_| | | (_| | |_) | | | | | | | | | |_) | | -// |_.__/|_|_| |_|\__,_|_|_| |_|\__, |___\__,_| .__/|_| |_|_| |_| |_| .__/|_| -// |___/_____| |_| |_| +/** + * binding_api impl + */ binding_api::result_type binding_api::requestsurface( char const *drawing_name) { auto r = this->app->api_request_surface(drawing_name); @@ -43,53 +40,53 @@ binding_api::result_type binding_api::requestsurface( binding_api::result_type binding_api::activatesurface( char const *drawing_name, char const *drawing_area) { - logdebug("%s drawing_name %s", __func__, drawing_name); + HMI_DEBUG("wm", "%s drawing_name %s, drawing_area %s", __func__, drawing_name, drawing_area); auto r = this->app->api_activate_surface(drawing_name, drawing_area); if (r != nullptr) { - logdebug("%s failed with error: %s", __func__, r); + HMI_DEBUG("wm", "%s failed with error: %s", __func__, r); return Err(r); } return Ok(json_object_new_object()); } binding_api::result_type binding_api::deactivatesurface(char const* drawing_name) { - logdebug("%s drawing_name %s", __func__, drawing_name); + HMI_DEBUG("wm", "%s drawing_name %s", __func__, drawing_name); auto r = this->app->api_deactivate_surface(drawing_name); if (r != nullptr) { - logdebug("%s failed with error: %s", __func__, r); + HMI_DEBUG("wm", "%s failed with error: %s", __func__, r); return Err(r); } return Ok(json_object_new_object()); } binding_api::result_type binding_api::enddraw(char const* drawing_name) { - logdebug("%s drawing_name %s", __func__, drawing_name); + HMI_DEBUG("wm", "%s drawing_name %s", __func__, drawing_name); auto r = this->app->api_enddraw(drawing_name); if (r != nullptr) { - logdebug("%s failed with error: %s", __func__, r); + HMI_DEBUG("wm", "%s failed with error: %s", __func__, r); return Err(r); } return Ok(json_object_new_object()); } binding_api::result_type binding_api::list_drawing_names() { - logdebug("%s", __func__); + HMI_DEBUG("wm", "%s", __func__); json j = this->app->id_alloc.name2id; return Ok(json_tokener_parse(j.dump().c_str())); } binding_api::result_type binding_api::debug_layers() { - logdebug("%s", __func__); + HMI_DEBUG("wm", "%s", __func__); return Ok(json_tokener_parse(this->app->layers.to_json().dump().c_str())); } binding_api::result_type binding_api::debug_surfaces() { - logdebug("%s", __func__); + HMI_DEBUG("wm", "%s", __func__); return Ok(to_json(this->app->controller->sprops)); } binding_api::result_type binding_api::debug_status() { - logdebug("%s", __func__); + HMI_DEBUG("wm", "%s", __func__); json_object *jr = json_object_new_object(); json_object_object_add(jr, "surfaces", to_json(this->app->controller->sprops)); @@ -98,9 +95,9 @@ binding_api::result_type binding_api::debug_status() { } binding_api::result_type binding_api::debug_terminate() { - logdebug("%s", __func__); + HMI_DEBUG("wm", "%s", __func__); if (getenv("WINMAN_DEBUG_TERMINATE") != nullptr) { - raise(SIGKILL); // XXX afb-daemon kills it's pgroup using TERM, which + raise(SIGKILL); // afb-daemon kills it's pgroup using TERM, which // doesn't play well with perf } return Ok(json_object_new_object());