diff options
author | Arnon Gilboa <agilboa@redhat.com> | 2013-06-27 13:24:21 +0300 |
---|---|---|
committer | Arnon Gilboa <agilboa@redhat.com> | 2013-06-27 13:24:21 +0300 |
commit | f7968d50350dd23ea9df2de807bad2cfbfb64844 (patch) | |
tree | 9349aecd7155e457152539cd8266409d15e651e8 /vdagent | |
parent | 631c8623e36cb1d6ed33eecceab169f967a3d9ea (diff) |
cleanup dispatch_message()
Diffstat (limited to 'vdagent')
-rw-r--r-- | vdagent/vdagent.cpp | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/vdagent/vdagent.cpp b/vdagent/vdagent.cpp index 307b7da..af99961 100644 --- a/vdagent/vdagent.cpp +++ b/vdagent/vdagent.cpp @@ -1206,48 +1206,47 @@ bool VDAgent::init_vio_serial() void VDAgent::dispatch_message(VDAgentMessage* msg, uint32_t port) { - VDAgent* a = _singleton; bool res = true; switch (msg->type) { case VD_AGENT_MOUSE_STATE: - res = a->handle_mouse_event((VDAgentMouseState*)msg->data); + res = handle_mouse_event((VDAgentMouseState*)msg->data); break; case VD_AGENT_MONITORS_CONFIG: - res = a->handle_mon_config((VDAgentMonitorsConfig*)msg->data, port); + res = handle_mon_config((VDAgentMonitorsConfig*)msg->data, port); break; case VD_AGENT_CLIPBOARD: - a->handle_clipboard((VDAgentClipboard*)msg->data, msg->size - sizeof(VDAgentClipboard)); + handle_clipboard((VDAgentClipboard*)msg->data, msg->size - sizeof(VDAgentClipboard)); break; case VD_AGENT_CLIPBOARD_GRAB: - a->handle_clipboard_grab((VDAgentClipboardGrab*)msg->data, msg->size); + handle_clipboard_grab((VDAgentClipboardGrab*)msg->data, msg->size); break; case VD_AGENT_CLIPBOARD_REQUEST: - res = a->handle_clipboard_request((VDAgentClipboardRequest*)msg->data); + res = handle_clipboard_request((VDAgentClipboardRequest*)msg->data); if (!res) { VDAgentClipboard clipboard = {VD_AGENT_CLIPBOARD_NONE}; - res = a->write_message(VD_AGENT_CLIPBOARD, sizeof(clipboard), &clipboard); + res = write_message(VD_AGENT_CLIPBOARD, sizeof(clipboard), &clipboard); } break; case VD_AGENT_CLIPBOARD_RELEASE: - a->handle_clipboard_release(); + handle_clipboard_release(); break; case VD_AGENT_DISPLAY_CONFIG: - res = a->handle_display_config((VDAgentDisplayConfig*)msg->data, port); + res = handle_display_config((VDAgentDisplayConfig*)msg->data, port); break; case VD_AGENT_ANNOUNCE_CAPABILITIES: - res = a->handle_announce_capabilities((VDAgentAnnounceCapabilities*)msg->data, msg->size); + res = handle_announce_capabilities((VDAgentAnnounceCapabilities*)msg->data, msg->size); break; case VD_AGENT_CLIENT_DISCONNECTED: vd_printf("Client disconnected, agent to be restarted"); - a->set_control_event(CONTROL_STOP); + set_control_event(CONTROL_STOP); break; default: vd_printf("Unsupported message type %u size %u", msg->type, msg->size); } if (!res) { vd_printf("handling message type %u failed: %lu", msg->type, GetLastError()); - a->_running = false; + _running = false; } } |