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) {
}
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();
#ifndef TMCAGLWM_CONFIG_HPP
#define TMCAGLWM_CONFIG_HPP
-#include <map>
#include <experimental/optional>
+#include <map>
namespace wm {
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;
}
};
} // namespace wm
-
-#endif //TMCAGLWM_CONFIG_HPP
+#endif // TMCAGLWM_CONFIG_HPP
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;
}