aboutsummaryrefslogtreecommitdiffstats
path: root/src/wm_client.cpp
diff options
context:
space:
mode:
authorKazumasa Mitsunari <knimitz@witz-inc.co.jp>2018-08-20 14:44:55 +0900
committerKazumasa Mitsunari <knimitz@witz-inc.co.jp>2018-08-20 14:44:55 +0900
commit741a9924776e40293b91eff00ec91d5a72f5da7f (patch)
treec13a72d475bcc36a7875129b043e1f0c7d058cb6 /src/wm_client.cpp
parent9d8002a41299d8755ed548f96be89eefe660c1bd (diff)
Add setRole
Change-Id: I6ddf6e1b3b3667493c5a0dd68047d1b72c8b0da9 Signed-off-by: Kazumasa Mitsunari <knimitz@witz-inc.co.jp>
Diffstat (limited to 'src/wm_client.cpp')
-rw-r--r--src/wm_client.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/wm_client.cpp b/src/wm_client.cpp
index 79922fa..47d0c2d 100644
--- a/src/wm_client.cpp
+++ b/src/wm_client.cpp
@@ -49,7 +49,7 @@ WMClient::WMClient(const string &appid, unsigned layer, unsigned surface, const
#else
afb_event ev = afb_daemon_make_event(x.c_str());
#endif
- event2list[x] = ev;
+ evname2afb_event[x] = ev;
}
}
@@ -57,7 +57,7 @@ WMClient::WMClient(const string &appid, const string &role)
: id(appid),
layer(0),
role2surface(0),
- event2list(0)
+ evname2afb_event(0)
{
role2surface[role] = INVALID_SURFACE_ID;
for (auto x : kWMEvents)
@@ -67,14 +67,10 @@ WMClient::WMClient(const string &appid, const string &role)
#else
afb_event ev = afb_daemon_make_event(x.c_str());
#endif
- event2list[x] = ev;
+ evname2afb_event[x] = ev;
}
}
-WMClient::~WMClient()
-{
-}
-
string WMClient::appID() const
{
return this->id;
@@ -196,7 +192,7 @@ bool WMClient::subscribe(afb_req req, const string &evname)
HMI_DEBUG("wm", "error is only enabeled for now");
return false;
}
- int ret = afb_req_subscribe(req, this->event2list[evname]);
+ int ret = afb_req_subscribe(req, this->evname2afb_event[evname]);
if (ret)
{
HMI_DEBUG("wm", "Failed to subscribe %s", evname.c_str());
@@ -207,7 +203,7 @@ bool WMClient::subscribe(afb_req req, const string &evname)
void WMClient::emitError(WM_CLIENT_ERROR_EVENT ev)
{
- if (!afb_event_is_valid(this->event2list[kKeyError])){
+ if (!afb_event_is_valid(this->evname2afb_event[kKeyError])){
HMI_ERROR("wm", "event err is not valid");
return;
}
@@ -216,7 +212,7 @@ void WMClient::emitError(WM_CLIENT_ERROR_EVENT ev)
json_object_object_add(j, kKeyErrorDesc, json_object_new_string(kErrorDescription[ev].c_str()));
HMI_DEBUG("wm", "error: %d, description:%s", ev, kErrorDescription[ev].c_str());
- int ret = afb_event_push(this->event2list[kKeyError], j);
+ int ret = afb_event_push(this->evname2afb_event[kKeyError], j);
if (ret != 0)
{
HMI_DEBUG("wm", "afb_event_push failed: %m");