summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKazumasa Mitsunari <knimitz@witz-inc.co.jp>2018-08-09 19:46:19 +0900
committerKazumasa Mitsunari <knimitz@witz-inc.co.jp>2018-08-09 19:46:19 +0900
commite0ec2034617e118426536646fe84977b7c70929e (patch)
tree0e05146969b0dbf604ba112bd9743da93ea447b6
parentf23a7c0a595338a8d0d6503953394c8a1c7f5071 (diff)
Remove setErrorHandler
This function will not be added. Change-Id: I205692e5de6a1a6332d9ad32554744a1fdc0dc52 Signed-off-by: Kazumasa Mitsunari <knimitz@witz-inc.co.jp>
-rw-r--r--src/libwindowmanager.cpp30
-rw-r--r--src/libwindowmanager.h2
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