X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fwindow_manager.hpp;h=6811110e2da954f85b934fdc3f8764a48c17646d;hb=98472cfd1ecbc5667d8383c8ef1e1a8d538d9fc1;hp=3bf62c25a2e8202881416f6f855307a47d67200a;hpb=3ebdf4e37dd3993a48ff73e8ae01325ec033eb1f;p=apps%2Fagl-service-windowmanager.git diff --git a/src/window_manager.hpp b/src/window_manager.hpp index 3bf62c2..6811110 100644 --- a/src/window_manager.hpp +++ b/src/window_manager.hpp @@ -21,10 +21,6 @@ #include #include #include -#include "controller_hooks.hpp" -//#include "layers.hpp" -// #include "layout.hpp" -//#include "wayland_ivi_wm.hpp" #include "result.hpp" #include "pm_wrapper.hpp" #include "util.hpp" @@ -38,16 +34,6 @@ extern "C" struct json_object; -namespace wl -{ -struct display; -} - -namespace compositor -{ -struct controller; -} - namespace wm { @@ -143,6 +129,23 @@ struct id_allocator } }; +struct TmpClient +{ + std::string appid; + unsigned pid; +}; + +struct TmpService +{ + std::string appid; // Used to search who create service surface + std::string dest; // Used to attach service to destination application + std::string service;// The name of service surface + std::string uuid; // uuid + TmpService(const std::string& app, const std::string& dst, + const std::string& svc, const std::string& uuid) + : appid(app), dest(dst), service(svc), uuid(uuid) {} +}; + class WindowManager { public: @@ -169,29 +172,6 @@ class WindowManager Event_Val_Max = Event_Error, }; - const std::vector kListEventName{ - "active", - "inactive", - "visible", - "invisible", - "syncDraw", - "flushDraw", - "screenUpdated", - "error"}; - - struct controller_hooks chooks; - - // ID allocation and proxy methods for lookup - struct id_allocator id_alloc; - - std::map map_afb_event; - - // Surface are info (x, y, w, h) - rect_map area_info; - - // FOR CES DEMO - std::vector surface_bg; - explicit WindowManager(); ~WindowManager() = default; @@ -204,20 +184,20 @@ class WindowManager result api_request_surface(char const *appid, char const *role); char const *api_request_surface(char const *appid, char const *role, char const *ivi_id); - bool api_set_role(char const *appid, char const *role, unsigned pid); + bool api_set_role(char const *appid, char const *role); void api_activate_surface(char const *appid, char const *role, char const *drawing_area, const reply_func &reply); void api_deactivate_surface(char const *appid, char const *role, const reply_func &reply); void api_enddraw(char const *appid, char const *role); + bool api_client_set_render_order(const char *appid, const std::vector &render_order); + std::string api_client_attach_service_surface(const char* appid, const char* dest, const char* service_surface); result api_get_display_info(); result api_get_area_info(char const *role); - void api_ping(); void send_event(char const *evname, char const *label); void send_event(char const *evname, char const *label, char const *area, int x, int y, int w, int h); // Events from the compositor we are interested in - void surface_created(uint32_t surface_id); - void surface_removed(uint32_t surface_id); - void surface_properties(uint32_t surface_id, uint32_t pid); + void surface_created(unsigned pid, unsigned surface_id); + void surface_removed(unsigned surface_id); void removeClient(const std::string &appid); void exceptionProcessForTransition(); @@ -227,12 +207,21 @@ class WindowManager void timerHandler(); void startTransitionWrapper(std::vector &actions); void processError(WMError error); + std::string searchApp(unsigned pid, unsigned ppid, unsigned surface, json_object* resp); + void storeSurface(const std::string& appid, unsigned ppid, unsigned surface); - private: - int init_layers(); - void surface_set_layout(int surface_id, const std::string& area = ""); - void layout_commit(); + const std::vector kListEventName{ + "active", + "inactive", + "visible", + "invisible", + "syncDraw", + "flushDraw", + "screenUpdated", + "error"}; + std::map map_afb_event; + private: // WM Events to clients void emit_activated(char const *label); void emit_deactivated(char const *label); @@ -247,14 +236,10 @@ class WindowManager void deactivate(int id); WMError setRequest(const std::string &appid, const std::string &role, const std::string &area, Task task, unsigned *req_num); - WMError doTransition(unsigned sequence_number); WMError checkPolicy(unsigned req_num); WMError startTransition(unsigned req_num); WMError doEndDraw(unsigned req_num); - WMError layoutChange(const WMAction &action); - WMError visibilityChange(const WMAction &action); - WMError setSurfaceSize(unsigned surface, const std::string& area); void emitScreenUpdated(unsigned req_num); void setTimer(); @@ -266,12 +251,18 @@ class WindowManager const char *check_surface_exist(const char *role); private: - std::unordered_map area2size; std::unordered_map roleold2new; std::unordered_map rolenew2old; std::shared_ptr lc; PMWrapper pmw; + // ID allocation and proxy methods for lookup + struct id_allocator id_alloc; + // Surface are info (x, y, w, h) + rect_map area_info; + // FOR CES DEMO + std::unordered_map tmp_surface2app; + std::vector tmp_services; static const char* kDefaultOldRoleDb; };