X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafb_binding_api.cpp;h=735a572411975885af2c237e48d3d65ab569b5f7;hb=25abec6a1ff6661283976f202f1ac43b2eb4f455;hp=b608a8ac2ecdb8f14fd75e417a0b19227a791b28;hpb=eb7fc4eb593d723f1ac2ed4e5b523afd34e992ac;p=apps%2Fagl-service-windowmanager.git diff --git a/src/afb_binding_api.cpp b/src/afb_binding_api.cpp index b608a8a..735a572 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); @@ -41,55 +38,65 @@ binding_api::result_type binding_api::requestsurface( return Ok(json_object_new_int(r.unwrap())); } +binding_api::result_type binding_api::requestsurfacexdg( + char const *drawing_name, char const *ivi_id) { + auto r = this->app->api_request_surface(drawing_name, ivi_id); + if (r != nullptr) { + 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::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 +105,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());