app: add very c++-y layout parsing
[staging/windowmanager.git] / src / layout.hpp
1 //
2 // Created by mfritzsc on 6/27/17.
3 //
4
5 #ifndef TMCAGLWM_LAYOUT_HPP
6 #define TMCAGLWM_LAYOUT_HPP
7
8 #include <cstdint>
9 #include <string>
10
11 #include <json-c/json.h>
12
13 #include "wayland.hpp"
14
15 namespace wm {
16
17 // Areas and layouts are defined to have a name, let's just keep it this way,
18 // we will not copy them around anyway.
19 struct area {
20    std::string name;
21    genivi::rect rect;
22    uint32_t layer; // i.e. zorder?
23 };
24
25 struct layout {
26    static constexpr unsigned MAX_N_AREAS = 2;
27
28    std::string name;
29    uint32_t n_areas;
30    struct area areas[MAX_N_AREAS];
31 };
32
33 typedef std::vector<struct layout> layouts_type;
34
35 }  // namespace wm
36
37 #endif  // TMCAGLWM_LAYOUT_HPP