Signed-off-by: Marcus Fritzsch <marcus_fritzsch@mentor.com>
try {
{
auto l = load_layer_map(
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 {
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 {
if (l.is_ok()) {
this->layouts = l.unwrap();
} else {
}
char const *App::activate_surface(uint32_t surface_id) {
}
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";
}
return "Surface does not exist";
}
auto &s = this->controller->surfaces[surface_id];
// Set all others invisible
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) {
auto &si = this->controller->sprops[i.second->id];
if (si.visibility == 1 && si.id != s->id &&
int(si.id) != this->layers.main_surface) {
}
binding_api::result_type binding_api::demo_activate_surface(
}
binding_api::result_type binding_api::demo_activate_surface(
char const *e = this->app->activate_surface(surfaceid);
if (e) {
return Err<json_object *>(e);
char const *e = this->app->activate_surface(surfaceid);
if (e) {
return Err<json_object *>(e);
}
binding_api::result_type binding_api::demo_activate_all() {
}
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();
s.second->set_visibility(1);
}
this->app->controller->commit_changes();
#include <memory>
#include "afb_binding_api.hpp"
#include <memory>
#include "afb_binding_api.hpp"
#include "controller_hooks.hpp"
#include "layers.hpp"
#include "layout.hpp"
#include "result.hpp"
#include "wayland.hpp"
#include "controller_hooks.hpp"
#include "layers.hpp"
#include "layout.hpp"
#include "result.hpp"
#include "wayland.hpp"
namespace wl {
struct display;
namespace wl {
struct display;
#ifndef TMCAGLWM_CONFIG_HPP
#define TMCAGLWM_CONFIG_HPP
#ifndef TMCAGLWM_CONFIG_HPP
#define TMCAGLWM_CONFIG_HPP
#include <experimental/optional>
#include <experimental/optional>
optional<int> get_int(char const *s) {
auto i = this->cfg.find(s);
optional<int> get_int(char const *s) {
auto i = this->cfg.find(s);
- return i != this->cfg.end() ? optional<int>(std::stoi(i->second)) : nullopt;
+ return i != this->cfg.end() ? optional<int>(std::stoi(i->second))
+ : nullopt;
-
-#endif //TMCAGLWM_CONFIG_HPP
+#endif // TMCAGLWM_CONFIG_HPP
json layer_map::to_json() const {
json j{};
json layer_map::to_json() const {
json j{};
- for (auto const &i: this->mapping) {
+ for (auto const &i : this->mapping) {
j.push_back(i.to_json());
}
return j;
j.push_back(i.to_json());
}
return j;
static const constexpr rect full_rect = rect{-1, -1, 0, 0};
static const constexpr rect full_rect = rect{-1, -1, 0, 0};
-inline bool operator == (struct rect a, struct rect b) {
+inline bool operator==(struct rect a, struct rect b) {
return a.w == b.w && a.h == b.h && a.x == b.x && a.y == b.y;
}
return a.w == b.w && a.h == b.h && a.x == b.x && a.y == b.y;
}