X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=include%2Flibhomescreen.hpp;h=5720368dfdd58a1f679a79b837f63042420940a2;hb=06a2777ce769346ba85aee9f38ccb237a2d72915;hp=06e9ad8e4e379dc6b78e7aba922f081f0d219068;hpb=46f7c260dd5e79116e7c6571cacbda1b89495c9e;p=src%2Flibhomescreen.git diff --git a/include/libhomescreen.hpp b/include/libhomescreen.hpp index 06e9ad8..5720368 100644 --- a/include/libhomescreen.hpp +++ b/include/libhomescreen.hpp @@ -35,26 +35,26 @@ public: LibHomeScreen(); ~LibHomeScreen(); - LibHomeScreen(const LibHomeScreen &) = delete; - LibHomeScreen &operator=(const LibHomeScreen &) = delete; + LibHomeScreen(const LibHomeScreen &) = delete; + LibHomeScreen &operator=(const LibHomeScreen &) = delete; - using handler_func = std::function; + using handler_func = std::function; - enum EventType { - Event_TapShortcut = 1, - Event_OnScreenMessage - }; + enum EventType { + Event_TapShortcut = 1, + Event_OnScreenMessage + }; - static const std::vector api_list; - static const std::vector event_list; + static const std::vector api_list; + static const std::vector event_list; /* Method */ - int init(const int port, const std::string& token); + int init(const int port, const std::string& token); - int tapShortcut(const char* application_name); - int onScreenMessage(const char* display_message); + int tapShortcut(const char* application_name); + int onScreenMessage(const char* display_message); - void set_event_handler(enum EventType et, handler_func f); + void set_event_handler(enum EventType et, handler_func f); void registerCallback( void (*event_cb)(const std::string& event, struct json_object* event_contents), @@ -68,8 +68,7 @@ public: private: int initialize_websocket(); - int runEventloop(); - + void (*onEvent)(const std::string& event, struct json_object* event_contents); void (*onReply)(struct json_object* reply); void (*onHangup)(void); @@ -82,7 +81,7 @@ private: int mport = 2000; std::string mtoken = "hs"; - std::map handlers; + std::map handlers; public: /* Don't use/ Internal only */