* limitations under the License.
*/
-#ifndef WM_LAYERS_H
-#define WM_LAYERS_H
+#ifndef WM_LAYER_HPP
+#define WM_LAYER_HPP
#include <string>
#include <vector>
const std::unordered_map<std::string, std::string> popCurrentState();
const std::unordered_map<std::string, std::string> getCurrentState();
const std::vector<unsigned> getIviIdList();
+ void addLayer(unsigned layer);
+ void removeLayer(unsigned layer);
+ void setArea(const std::string& app, const std::string& area);
private:
std::vector<unsigned> render_order;
std::unordered_map<std::string, std::string> area2appid;
};
-class LayerSetting
+class WMLayer
{
public:
enum MANAGEMENT_TYPE
STACK
};
- explicit LayerSetting(const std::string& name, MANAGEMENT_TYPE type, unsigned begin, unsigned end);
- ~LayerSetting() = default;
+ explicit WMLayer(json_object* j, unsigned uuid);
+ ~WMLayer() = default;
- const std::string& layerName() { return this->name; }
- MANAGEMENT_TYPE layerType() { return this->type; };
- void setRoleList(const std::string& role);
- void appendArea(const std::string& area);
+ // Status & Setting API
+ unsigned getNewLayerID(const std::string& role);
unsigned idBegin() { return this->id_begin; }
unsigned idEnd() { return this->id_end; }
- unsigned getNewLayerID(const std::string& role);
+ unsigned getUuid() { return this->uuid; }
+ const std::string& layerName();
+ MANAGEMENT_TYPE layerType() { return this->type; }
+ void appendArea(const std::string& area);
void removeLayerID(unsigned id);
+ LayerState& getLayerState() { return tmp_state; }
+ WMError setLayerState(const LayerState& l);
+ bool hasLayerID(unsigned id);
+ bool hasRole(const std::string& role);
-/* unsigned getNewID(const std::string& role);
- void remove(unsigned ivi_layer_id);
- void clear();
- bool attach(unsigned ivi_layer_id, const std::string& area);
- void stack(unsigned ivi_layer_id, const std::string& area);
- bool updateRenderOrder(const std::vector<unsigned> list); */
+ // Manipulation
+ void addLayer(unsigned layer);
+ WMError commitChange();
private:
+ LayerState tmp_state;
+ LayerState state;
+ unsigned uuid;
std::string name = ""; // Layer name
MANAGEMENT_TYPE type;
std::string role_list;
unsigned id_end;
};
-class WMLayer
-{
- public:
- WMLayer();
- WMLayer(json_object* j);
- ~WMLayer() = default;
- unsigned getNewLayerID(const std::string& role);
- LayerState getLayerState() const { return before_state; }
- WMError setLayerState(const LayerState& l);
- bool checkIDBelongTo(unsigned id);
- private:
- LayerState before_state;
- LayerState state;
- std::unique_ptr<LayerSetting> setting;
-};
-
} // namespace wm
-#endif // WM_LAYERS_H
+#endif // WM_LAYER_HPP