aboutsummaryrefslogtreecommitdiffstats
path: root/src/wm_layer_control.hpp
diff options
context:
space:
mode:
authorKazumasa Mitsunari <knimitz@witz-inc.co.jp>2018-08-27 11:13:14 +0900
committerKazumasa Mitsunari <knimitz@witz-inc.co.jp>2018-08-27 19:16:45 +0900
commit0b011c00b0c8aa847a4d0aa460a335c5eae8f010 (patch)
tree2d1df8540d3abf618927ce598a73a14a990ac7f1 /src/wm_layer_control.hpp
parent2275abc95f65c364acefa36b6b2079caad305756 (diff)
Update wm_layer
Change-Id: Id4b9fe2ec6603e8ab0ad5cfa9b0af6dce3b1d149 Signed-off-by: Kazumasa Mitsunari <knimitz@witz-inc.co.jp>
Diffstat (limited to 'src/wm_layer_control.hpp')
-rw-r--r--src/wm_layer_control.hpp28
1 files changed, 24 insertions, 4 deletions
diff --git a/src/wm_layer_control.hpp b/src/wm_layer_control.hpp
index d8d3273..ad6bf53 100644
--- a/src/wm_layer_control.hpp
+++ b/src/wm_layer_control.hpp
@@ -18,6 +18,7 @@
#include <memory>
#include <vector>
#include <unordered_map>
+#include <functional>
#include <ilm/ilm_control.h>
#include "wm_error.hpp"
#include "util.hpp"
@@ -28,31 +29,50 @@ class Screen : public rectangle {
};
+class LayerControlCallbacks {
+ public:
+ LayerControlCallbacks() {};
+ virtual ~LayerControlCallbacks() = default;
+ LayerControlCallbacks(const LayerControlCallbacks &obj) = default;
+
+ // callback functions
+ virtual void test(unsigned i) { HMI_DEBUG("test %d", i); }
+ std::function<void(unsigned)> surfaceCreated;
+ /* std::function<void(unsigned)> surfaceDestroyed;
+ std::function<void(unsigned)> layerCreated;
+ std::function<void(unsigned)> layerDestroyed; */
+};
+
class WMLayer;
+class LayerState;
class LayerControl
{
public:
explicit LayerControl(const std::string& root);
~LayerControl() = default;
- WMError init();
+ WMError init(const LayerControlCallbacks& cb);
unsigned getNewLayerID(const std::string& role);
// void setRenderOrder(const std::vector<unsigned> layer_render_order);
// std::vector<unsigned> getAllRenderOrder();
// std::vector<std::shared_ptr<WMLayer>>& getAllLayers();
// std::vector<unsigned> getRenderOrder(const std::string& layer_name);
- WMError updateLayer(WMLayer& wm_layer);
- void commitChange();
+ WMError updateLayer(LayerState& layer_state);
+ WMError commitChange();
void undoUpdate();
// Don't use this function.
- void dispatchILMEvent(ilmObjectType object, t_ilm_uint id, t_ilm_bool created);
+ void dispatchCreateEvent(ilmObjectType object, unsigned id, bool created);
+ void dispatchPropertyChangeEvent(unsigned id, struct ilmSurfaceProperties*, t_ilm_notification_mask);
+ void dispatchPropertyChangeEvent(unsigned id, struct ilmLayerProperties*, t_ilm_notification_mask);
private:
WMError loadLayerSetting(const std::string& path);
WMError loadAreaDb(const std::string& path);
+
std::vector<std::shared_ptr<WMLayer>> wm_layers;
std::unordered_map<std::string, struct rect> area2size;
unsigned screenID;
struct ilmScreenProperties screen_prop;
+ LayerControlCallbacks cb;
};
} // namespace wm \ No newline at end of file