Rename dispatchPropertyChangeEvent API
[apps/agl-service-windowmanager.git] / src / wm_layer_control.hpp
index 0be06c2..7a283b9 100644 (file)
@@ -45,6 +45,7 @@ class LayerControlCallbacks {
 
     // callback functions
     std::function<void(unsigned, unsigned)> surfaceCreated;
+    std::function<void(unsigned)> surfaceDestroyed;
     /* std::function<void(unsigned)> surfaceDestroyed;
     std::function<void(unsigned)> layerCreated;
     std::function<void(unsigned)> layerDestroyed; */
@@ -63,8 +64,10 @@ class LayerControl
     WMError init(const LayerControlCallbacks& cb);
     void createNewLayer(unsigned id);
     unsigned getNewLayerID(const std::string& role, std::string* layer_name);
+    std::shared_ptr<WMLayer> getWMLayer(unsigned layer);
+    std::shared_ptr<WMLayer> getWMLayer(std::string layer_name);
     struct rect getAreaSize(const std::string& area);
-    void setupArea(double scaling);
+    void setupArea(const rectangle& base_rct, double scaling);
     Screen getScreenInfo();
     double scale();
     // void setRenderOrder(const std::vector<unsigned> layer_render_order);
@@ -72,26 +75,34 @@ class LayerControl
     // std::vector<std::shared_ptr<WMLayer>>& getAllLayers();
     // std::vector<unsigned> getRenderOrder(const std::string& layer_name);
     WMError updateLayer(LayerState& layer_state);
-    WMError commitChange();
+    WMError renderLayers();
+    // WMError renderWMLayers();
     void undoUpdate();
     WMError layoutChange(const WMAction& action);
     WMError visibilityChange(const WMAction &action);
+    void terminateApp(const std::shared_ptr<WMClient> client);
 
     // Don't use this function.
     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);
+    void dispatchSurfacePropChangeEvent(unsigned id, struct ilmSurfaceProperties*, t_ilm_notification_mask);
+    void dispatchLayerPropChangeEvent(unsigned id, struct ilmLayerProperties*, t_ilm_notification_mask);
+
   private:
     WMError makeVisible(const std::shared_ptr<WMClient> client);
     WMError makeInvisible(const std::shared_ptr<WMClient> client);
+    bool moveForeGround(const std::shared_ptr<WMClient> client);
+    bool moveBackGround(const std::shared_ptr<WMClient> client);
     WMError loadLayerSetting(const std::string& path);
     WMError loadAreaDb(const std::string& path);
 
     std::vector<std::shared_ptr<WMLayer>> wm_layers;
+    std::unordered_map<unsigned, unsigned> lid2wmlid;
     std::unordered_map<std::string, struct rect> area2size;
     unsigned screenID;
     struct ilmScreenProperties screen_prop;
     double scaling;
+    int offset_x;
+    int offset_y;
     LayerControlCallbacks cb;
 };