Merge "Remove automatic code generation" into eel
[apps/agl-service-windowmanager-2017.git] / src / afb_binding_api.cpp
index 88616d5..735a572 100644 (file)
@@ -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 <json-c/json.h>
 
 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,6 +38,16 @@ 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<json_object *>(r);
+   }
+   return Ok(json_object_new_object());
+}
+
 binding_api::result_type binding_api::activatesurface(
    char const *drawing_name, char const *drawing_area) {
   HMI_DEBUG("wm", "%s drawing_name %s, drawing_area %s", __func__, drawing_name, drawing_area);
@@ -100,7 +107,7 @@ binding_api::result_type binding_api::debug_status() {
 binding_api::result_type binding_api::debug_terminate() {
    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());