From 8558bda51548cde1f9e7d46526bdbcc2475fe8e6 Mon Sep 17 00:00:00 2001 From: Kazumasa Mitsunari Date: Wed, 14 Nov 2018 20:09:46 +0900 Subject: Improve window manager * Make sure there is no difference from the main line's line as much as possible * Fix timing issue of launcher and homescreen Change-Id: I39da579d62927278c308d56d53eed005b4284715 Signed-off-by: Kazumasa Mitsunari --- src/window_manager.hpp | 52 ++++++++++++++++---------------------------------- 1 file changed, 16 insertions(+), 36 deletions(-) (limited to 'src/window_manager.hpp') diff --git a/src/window_manager.hpp b/src/window_manager.hpp index c4ad0f5..18182b2 100644 --- a/src/window_manager.hpp +++ b/src/window_manager.hpp @@ -66,7 +66,6 @@ extern const char kKeyIds[]; struct id_allocator { unsigned next = 1; - // Surfaces that where requested but not yet created std::unordered_map id2name; std::unordered_map name2id; @@ -218,26 +217,27 @@ 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); - void api_activate_surface(char const *appid, char const *role, char const *drawing_area, const reply_func &reply); + void api_activate_window(char const *appid, char const *role, char const *drawing_area, const reply_func &reply); void api_activate_surface_for_slave(char const *appid, char const *drawing_name, char const *drawing_area, const reply_func &reply); void api_activate_surface_to_master(char const *appid, char const *drawing_name, char const *drawing_area, const reply_func &reply); - void api_deactivate_surface(char const *appid, char const *role, const reply_func &reply); + void api_deactivate_window(char const *appid, char const *role, const reply_func &reply); void api_deactivate_surface_for_slave(char const *appid, char const *drawing_name, const reply_func &reply); void api_deactivate_surface_to_master(char const *appid, char const *drawing_name, const reply_func &reply); void api_enddraw(char const *appid, char const *role); + int api_subscribe(afb_req req, int event_id); void api_enddraw_for_remote(char const *appid, char const *drawing_name); 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); result api_get_car_info(char const *label); - void send_event(char const *evname); - 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); + void send_event(const std::string& evname); + void send_event(const std::string& evname, const std::string& role); + void send_event(const std::string& evname, const std::string& role, const std::string& area, int x, int y, int w, int h); // Events from the compositor we are interested in void surface_created(unsigned pid, unsigned surface_id); @@ -257,37 +257,18 @@ class WindowManager std::string searchApp(unsigned pid, unsigned ppid, unsigned surface, json_object* resp); void storeSurface(const std::string& appid, unsigned ppid, unsigned surface); - const std::vector kListEventName{ - "active", - "inactive", - "visible", - "invisible", - "syncDraw", - "flushDraw", - "screenUpdated", - "headlampOff", - "headlampOn", - "parkingBrakeOff", - "parkingBrakeOn", - "lightstatusBrakeOff", - "lightstatusBrakeOn", - "carStop", - "carRun", - "error"}; - std::map map_afb_event; - WMConnection wmcon; private: // WM Events to clients - void emit_activated(char const *label); - void emit_deactivated(char const *label); - void emit_syncdraw(char const *label, char const *area, int x, int y, int w, int h); + void emit_activated(const std::string& role); + void emit_deactivated(const std::string& role); + void emit_syncdraw(const std::string& role, char const *area, int x, int y, int w, int h); void emit_syncdraw(const std::string &role, const std::string &area); - void emit_flushdraw(char const *label); - void emit_visible(char const *label, bool is_visible); - void emit_invisible(char const *label); - void emit_visible(char const *label); + void emit_flushdraw(const std::string& role); + void emit_visible(const std::string& role, bool is_visible); + void emit_invisible(const std::string& role); + void emit_visible(const std::string& role); void emitHeadlampOff(); void emitHeadlampOn(); void emitParkingBrakeOff(); @@ -322,6 +303,7 @@ class WindowManager const char *check_surface_exist(const char *role); private: + std::map map_afb_event; std::unordered_map roleold2new; std::unordered_map rolenew2old; std::shared_ptr lc; @@ -330,12 +312,10 @@ class WindowManager CarInfo crr_car_info; PMWrapper pmw; + rect_map area_info; + struct id_allocator id_alloc; // 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* kDefaultOldRolesConfig; -- cgit 1.2.3-korg