2 // Created by m on 7/27/17.
5 #ifndef TMCAGLWM_LAYERS_H
6 #define TMCAGLWM_LAYERS_H
13 #include "wayland.hpp"
18 using json = nlohmann::json;
20 // Min and max surface ID mapped to this layer
23 // A more or less descriptive name?
24 std::string name = "";
25 // The actual layer ID
27 // The rectangular region surfaces are allowed to draw on
28 // this layer, note however, width and hieght of the rect
29 // can be negative, in which case they specify that
30 // the actual value is computed using MAX + 1 - w
31 // That is; allow us to specify dimensions dependent on
32 // e.g. screen dimension, w/o knowing the actual screen size.
34 // XXX perhaps a zorder is needed here?
36 explicit layer(nlohmann::json const &j);
38 bool operator<(struct layer const &rhs) const {
39 return this->id_max < rhs.id_max;
45 // Actually, we shouldn't need a struct here ... but let's just keep it at that
46 // for now, to contain its mapping type and the _single_ useful method.
48 using json = nlohmann::json;
50 typedef std::set<struct layer> storage_type;
51 typedef std::vector<unsigned int> layers_type;
56 optional<int> get_layer_id(int surface_id);
57 optional<genivi::rect> get_layer_rect(int surface_id);
58 layers_type::size_type get_layers_count() const {
59 return this->layers.size();
65 struct result<struct layer_map> to_layer_map(nlohmann::json const &j);
69 #endif // TMCAGLWM_LAYERS_H