* limitations under the License.
*/
-//
-// Created by mfritzsc on 7/11/17.
-//
-
#include "app.hpp"
#include "json_helper.hpp"
#include "layers.hpp"
try {
{
auto l = load_layer_map(
- this->config.get_string("layers.json").value().c_str());
+ this->config.get_string("layers.json").value().c_str());
if (l.is_ok()) {
this->layers = l.unwrap();
} else {
}
{
- auto l = load_layout(
- this->config.get_string("layout.json").value().c_str());
+ auto l =
+ load_layout(this->config.get_string("layout.json").value().c_str());
if (l.is_ok()) {
this->layouts = l.unwrap();
} else {
}
char const *App::activate_surface(uint32_t surface_id) {
- if (! this->controller->surface_exists(surface_id)) {
+ if (!this->controller->surface_exists(surface_id)) {
return "Surface does not exist";
}
auto &s = this->controller->surfaces[surface_id];
// Set all others invisible
- for (auto &i: this->controller->surfaces) {
+ for (auto &i : this->controller->surfaces) {
auto &si = this->controller->sprops[i.second->id];
if (si.visibility == 1 && si.id != s->id &&
int(si.id) != this->layers.main_surface) {
DB("surface_id is " << surface_id);
// We need to execute the surface setup after its creation.
- // XXX: perhaps move the late-tasks functionality to App?
this->add_task("surface_set_layout",
[surface_id, this] { this->surface_set_layout(surface_id); });
}
}
binding_api::result_type binding_api::demo_activate_surface(
- uint32_t surfaceid) {
+ uint32_t surfaceid) {
char const *e = this->app->activate_surface(surfaceid);
if (e) {
return Err<json_object *>(e);
}
binding_api::result_type binding_api::demo_activate_all() {
- for (auto &s: this->app->controller->surfaces) {
+ for (auto &s : this->app->controller->surfaces) {
s.second->set_visibility(1);
}
this->app->controller->commit_changes();