X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;ds=inline;f=src%2Fwindow_manager.hpp;h=7bd0802cd51c31460a9e119495f8e9d55d19a087;hb=494d3a09bdbc74c9005db421122cc60acb733443;hp=afafeb143eef8181e027c1bc2ad3c32d0ac99e59;hpb=5d36c79042c3f513392cb765940252acb860b7a9;p=apps%2Fagl-service-windowmanager.git diff --git a/src/window_manager.hpp b/src/window_manager.hpp index afafeb1..7bd0802 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,12 @@ struct id_allocator } }; +struct TmpClient +{ + std::string appid; + unsigned pid; +}; + class WindowManager { public: @@ -169,29 +161,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 +173,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(); @@ -228,13 +197,18 @@ class WindowManager void startTransitionWrapper(std::vector &actions); void processError(WMError error); - private: - optional lookup_id(char const *name); - optional lookup_name(int id); - 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); @@ -249,14 +223,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(); @@ -268,12 +238,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_apps; static const char* kDefaultOldRoleDb; };