X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fwm_client.hpp;h=fc171f492f6c21e3d6902b2d4a5aeb7afdb64a0d;hb=556884fe71a3577ffc9ba5ddf65029cf0ca699ee;hp=3ffa7863661f43b7b09c6fe628987f95f6d98307;hpb=ceb1049ca57b0fd0ce41e9eca631557ffa46993a;p=apps%2Fagl-service-windowmanager.git diff --git a/src/wm_client.hpp b/src/wm_client.hpp index 3ffa786..fc171f4 100644 --- a/src/wm_client.hpp +++ b/src/wm_client.hpp @@ -20,17 +20,22 @@ #include #include #include -#include "util.hpp" #include "wm_error.hpp" extern "C" { +#define AFB_BINDING_VERSION 2 #include } namespace wm { +enum WM_CLIENT_ERROR_EVENT +{ + UNKNOWN_ERROR +}; + class WMClient { public: @@ -47,39 +52,41 @@ class WMClient std::string role() const; unsigned layerID() const; unsigned surfaceID() const; - void registerSurface(unsigned surface); - std::string area() const {return this->app_area;}; - void setArea(const std::string area) {this->app_area = area;} + // 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 renderOrder() const; + WMError setRenderOrder(const std::vector& 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 app_area; + std::string area; unsigned surface; // currently, main application has only one surface. //std::vector role_list; + std::vector surface_render_order; + std::unordered_map service2surfaces; std::unordered_map role2surface; + std::unordered_map service2supplier; #if GTEST_ENABLED // This is for unit test. afb_make_event occurs sig11 if call not in afb-binding std::unordered_map evname2afb_event; #else - std::unordered_map evname2afb_event; + std::unordered_map evname2afb_event; #endif }; } // namespace wm -#endif +#endif \ No newline at end of file