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