fix for als2019 8.0.0
[apps/agl-service-windowmanager.git] / src / wm_client.hpp
index 99ae499..fc171f4 100644 (file)
 #include <vector>
 #include <string>
 #include <unordered_map>
-#include "util.hpp"
 #include "wm_error.hpp"
 
 extern "C"
 {
+#define AFB_BINDING_VERSION 2
 #include <afb/afb-binding.h>
 }
 
 namespace wm
 {
 
+enum WM_CLIENT_ERROR_EVENT
+{
+    UNKNOWN_ERROR
+};
+
 class WMClient
 {
   public:
@@ -47,37 +52,41 @@ class WMClient
     std::string role() const;
     unsigned layerID() const;
     unsigned surfaceID() const;
-    void registerSurface(unsigned surface);
+    // void setRole(const std::string& role);
+    // void appendRole(const std::string& role);
     WMError addSurface(unsigned surface);
-    bool isSourceSizeSet();
-    void setSurfaceSizeCorrectly();
     bool removeSurfaceIfExist(unsigned surface);
+    // bool removeRole(const std::string& role);
+    std::vector<unsigned> renderOrder() const;
+    WMError setRenderOrder(const std::vector<std::string>& order);
+    std::string attachTmpServiceSurface(const std::string& from, const std::string& service_surface);
+    WMError attachServiceSurface(const std::string& service_surface, unsigned surface);
 
-    bool subscribe(afb_req_t req, const std::string &event_name);
-    void emitActive(bool active);
-    void emitVisible(bool visible);
-    void emitSyncDraw(const std::string& area, struct rect& r);
-    void emitFlushDraw();
-    void emitError(WMError error);
+#if GTEST_ENABLED
+    bool subscribe(afb_req req, const std::string &event_name);
+    void emitError(WM_CLIENT_ERROR_EVENT ev);
+#endif
 
     void dumpInfo();
 
   private:
     std::string id;
     unsigned layer;
-    bool is_source_set;
     std::string main_role;
     std::string area;
     unsigned surface; // currently, main application has only one surface.
     //std::vector<std::string> role_list;
+    std::vector<unsigned> surface_render_order;
+    std::unordered_map<std::string, unsigned> service2surfaces;
     std::unordered_map<std::string, unsigned> role2surface;
+    std::unordered_map<std::string, std::string> service2supplier;
 #if GTEST_ENABLED
     // This is for unit test. afb_make_event occurs sig11 if call not in afb-binding
     std::unordered_map<std::string, std::string> evname2afb_event;
 #else
-    std::unordered_map<std::string, afb_event_t> evname2afb_event;
+    std::unordered_map<std::string, struct afb_event> evname2afb_event;
 #endif
 };
 } // namespace wm
 
-#endif
+#endif
\ No newline at end of file