+void WMClient::emitVisible(bool visible)
+{
+ // error check
+ bool allow_send = false;
+ if(visible)
+ {
+ allow_send = afb_event_is_valid(this->evname2afb_event[kVisible]);
+ }
+ else
+ {
+ allow_send = afb_event_is_valid(this->evname2afb_event[kInvisible]);
+ }
+ if(allow_send)
+ {
+ this->area = area;
+ json_object* j = json_object_new_object();
+ json_object_object_add(j, kKeyRole, json_object_new_string(this->role().c_str()));
+ json_object_object_add(j, kKeyDrawingName, json_object_new_string(this->role().c_str()));
+
+ if(visible)
+ {
+ afb_event_push(this->evname2afb_event[kVisible], j);
+ }
+ else
+ {
+ afb_event_push(this->evname2afb_event[kInvisible], j);
+ }
+ }
+ else
+ {
+ HMI_ERROR("Failed to send %s", __func__);
+ }
+}
+
+void WMClient::emitActive(bool active)
+{
+ // error check
+ bool allow_send = false;
+ if(active)
+ {
+ allow_send = afb_event_is_valid(this->evname2afb_event[kActive]);
+ }
+ else
+ {
+ allow_send = afb_event_is_valid(this->evname2afb_event[kInactive]);
+ }
+ if(allow_send)
+ {
+ this->area = area;
+ json_object* j = json_object_new_object();
+ json_object_object_add(j, kKeyRole, json_object_new_string(this->role().c_str()));
+ json_object_object_add(j, kKeyDrawingName, json_object_new_string(this->role().c_str()));
+
+ if(active)
+ {
+ afb_event_push(this->evname2afb_event[kActive], j);
+ }
+ else
+ {
+ afb_event_push(this->evname2afb_event[kInactive], j);
+ }
+ }
+ else
+ {
+ HMI_ERROR("Failed to send %s", __func__);
+ }
+}
+
+void WMClient::emitSyncDraw(const string& area, struct rect& r)
+{
+ HMI_NOTICE("trace");
+ if(afb_event_is_valid(this->evname2afb_event[kSyncDraw]))
+ {
+ this->area = area;
+ json_object *j_rect = json_object_new_object();
+ json_object_object_add(j_rect, kKeyX, json_object_new_int(r.x));
+ json_object_object_add(j_rect, kKeyY, json_object_new_int(r.y));
+ json_object_object_add(j_rect, kKeyWidth, json_object_new_int(r.w));
+ json_object_object_add(j_rect, kKeyHeight, json_object_new_int(r.h));
+
+ json_object* j = json_object_new_object();
+ json_object_object_add(j, kKeyRole, json_object_new_string(this->role().c_str()));
+ json_object_object_add(j, kKeyDrawingName, json_object_new_string(this->role().c_str()));
+ json_object_object_add(j, kKeyDrawingArea, json_object_new_string(area.c_str()));
+ json_object_object_add(j, kKeyArea, json_object_new_string(this->role().c_str()));
+
+ json_object_object_add(j, kKeyDrawingRect, j_rect);
+ afb_event_push(this->evname2afb_event[kSyncDraw], j);
+ }
+ else
+ {
+ HMI_ERROR("Failed to send %s", __func__);
+ }
+}
+
+void WMClient::emitFlushDraw()