X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fapp.cpp;h=307217e98850bf0d952362606d489d704ea0353f;hb=9f9abc58011121722a82759124d061a645cee112;hp=a5583ae19f7dceae254639f9d419978151cde02a;hpb=08b73681b0ea6206fc6dc96575ac3e8d6006bc70;p=apps%2Fagl-service-windowmanager.git diff --git a/src/app.cpp b/src/app.cpp index a5583ae..307217e 100644 --- a/src/app.cpp +++ b/src/app.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. @@ -44,12 +44,16 @@ namespace { using nlohmann::json; result file_to_json(char const *filename) { + json j; std::ifstream i(filename); if (i.fail()) { - return Err("Could not open config file"); + HMI_DEBUG("wm", "Could not open config file, so use default layer information"); + j = default_layers_json; } - json j; - i >> j; + else { + i >> j; + } + return Ok(j); } @@ -120,7 +124,7 @@ int App::init() { this->display->add_global_handler( "ivi_controller", [this](wl_registry *r, uint32_t name, uint32_t v) { this->controller = - std::make_unique(r, name, v); + std::make_unique(r, name, v); // Init controller hooks this->controller->chooks = &this->chooks; @@ -204,7 +208,7 @@ int App::init_layers() { auto &layers = c->layers; // Write output dimensions to ivi controller... - c->output_size = genivi::size{uint32_t(o->width), uint32_t(o->height)}; + c->output_size = compositor::size{uint32_t(o->width), uint32_t(o->height)}; // Clear scene layers.clear(); @@ -500,8 +504,7 @@ char const *App::api_deactivate_surface(char const *drawing_name) { return "No surface active"; } - // XXX: check against main_surface, main_surface_name is the configuration - // item. + // Check against main_surface, main_surface_name is the configuration item. if (*surface_id == this->layers.main_surface) { HMI_DEBUG("wm", "Refusing to deactivate main_surface %d", *surface_id); return nullptr; @@ -576,7 +579,6 @@ char const *App::api_enddraw(char const *drawing_name) { if (n && *n == drawing_name) { std::swap(this->pending_end_draw[i], this->pending_end_draw[iend - 1]); this->pending_end_draw.resize(iend - 1); - // XXX: Please tell the compositor to thaw the surface... this->activate(this->pending_end_draw[i]); this->layout_commit(); this->emit_flushdraw(drawing_name);