diff options
-rw-r--r-- | src/libwindowmanager.cpp | 30 | ||||
-rw-r--r-- | src/libwindowmanager.h | 2 |
2 files changed, 1 insertions, 31 deletions
diff --git a/src/libwindowmanager.cpp b/src/libwindowmanager.cpp index 6581189..395c580 100644 --- a/src/libwindowmanager.cpp +++ b/src/libwindowmanager.cpp @@ -62,7 +62,6 @@ class LibWindowmanager::Impl { void setSyncDrawHandler(sync_draw_handler f); void setFlushDrawHandler(flush_draw_handler f); void setScreenUpdatedHandler(screen_updated_handler f); - void setErrorHandler(error_handler f); int api_call(const char *verb, json_object *object, const std::function<void(bool, json_object *)> &onReply); @@ -98,7 +97,6 @@ private: sync_draw_handler _on_sync_draw; flush_draw_handler _on_flush_draw; screen_updated_handler _on_screen_updated; - error_handler _on_error; }; namespace { @@ -178,7 +176,7 @@ LibWindowmanager::Impl::Impl() : wsj1{}, loop{}, labels(), handlers(), _screen{0,0,0,0,0.0}, _on_visible(nullptr), _on_active(nullptr), _on_sync_draw(nullptr), _on_flush_draw(nullptr), - _on_screen_updated(nullptr), _on_error(nullptr) + _on_screen_updated(nullptr) {} LibWindowmanager::Impl::~Impl() { @@ -671,18 +669,6 @@ void LibWindowmanager::Impl::setScreenUpdatedHandler(screen_updated_handler f) { this->_on_screen_updated = f; } -void LibWindowmanager::Impl::setErrorHandler(error_handler f) { - struct json_object* j = json_object_new_object(); - json_object_object_add(j, "event", json_object_new_int(Event_Error)); - - int ret = afb_wsj1_call_j(this->wsj1, wmAPI, "wm_subscribe", j, _on_reply_static, this); - if (0 > ret) { - HMI_ERROR("libwm", "Failed to subscribe event"); - return; - } - this->_on_error = f; -} - namespace { std::pair<bool, LibWindowmanager::EventType> make_event_type(char const *et) { // Event have the form "$API/$EVENT", just try to find the first / and @@ -855,16 +841,6 @@ void LibWindowmanager::Impl::event(char const *et, json_object *object) { return _on_screen_updated(id_list); } break; - case Event_Error : - if(_on_error) { - // emit this case - json_object_object_get_ex(object, "error", &j_val); - int error = json_object_get_int(j_val); - json_object_object_get_ex(object, "errorDescription", &j_val); - const char* desc = json_object_get_string(j_val); - return _on_error(error, desc); - } - break; default : break; } @@ -1098,10 +1074,6 @@ void LibWindowmanager::setScreenUpdatedHandler(screen_updated_handler f) { return this->d->setScreenUpdatedHandler(f); } -void LibWindowmanager::setErrorHandler(error_handler f) { - return this->d->setErrorHandler(f); -} - struct Screen LibWindowmanager::getScreenInfo() { return this->d->getScreenInfo(); } diff --git a/src/libwindowmanager.h b/src/libwindowmanager.h index d3c9a39..237448f 100644 --- a/src/libwindowmanager.h +++ b/src/libwindowmanager.h @@ -66,7 +66,6 @@ public: using sync_draw_handler = std::function<void(const char*, const char*, Rect)>; using flush_draw_handler= std::function<void(const char*)>; using screen_updated_handler = std::function<void(const std::vector<std::string>&)>; - using error_handler = std::function<void(int err, const std::string&)>; /* DrawingArea name (usage: {layout}.{area}) */ const std::string kDefaultArea = "normal.full"; @@ -116,7 +115,6 @@ public: void setSyncDrawHandler (sync_draw_handler f); void setFlushDrawHandler (flush_draw_handler f); void setScreenUpdatedHandler(screen_updated_handler f); - void setErrorHandler (error_handler f); void set_event_handler(enum EventType et, handler_fun f); // Backward Compatible API |