diff --git a/channels/rdpei/client/rdpei_main.c b/channels/rdpei/client/rdpei_main.c index 08ba4bca4..d0b17377d 100644 --- a/channels/rdpei/client/rdpei_main.c +++ b/channels/rdpei/client/rdpei_main.c @@ -35,7 +35,6 @@ #include #include -#include #include "rdpei_common.h" @@ -119,20 +118,6 @@ const char* RDPEI_EVENTID_STRINGS[] = "EVENTID_DISMISS_HOVERING_CONTACT" }; -BOOL rdpei_push_event(RDPEI_CHANNEL_CALLBACK* callback, wMessage* event) -{ - int status; - - status = callback->channel_mgr->PushEvent(callback->channel_mgr, event); - - if (status) - { - DEBUG_WARN("response error %d", status); - return FALSE; - } - - return TRUE; -} int rdpei_add_frame(RdpeiClientContext* context) { int i; @@ -394,34 +379,20 @@ int rdpei_recv_sc_ready_pdu(RDPEI_CHANNEL_CALLBACK* callback, wStream* s) int rdpei_recv_suspend_touch_pdu(RDPEI_CHANNEL_CALLBACK* callback, wStream* s) { - wMessage* event; - BOOL status; + RdpeiClientContext* rdpei = (RdpeiClientContext*) callback->plugin->pInterface; - event = freerdp_event_new(RdpeiChannel_Class, RdpeiChannel_SuspendTouch, NULL, NULL); - - status = rdpei_push_event(callback, event); - - if (!status) - { - return -1; - } + if (rdpei->SuspendTouch) + rdpei->SuspendTouch(rdpei); return 0; } int rdpei_recv_resume_touch_pdu(RDPEI_CHANNEL_CALLBACK* callback, wStream* s) { - wMessage* event; - BOOL status; + RdpeiClientContext* rdpei = (RdpeiClientContext*) callback->plugin->pInterface; - event = freerdp_event_new(RdpeiChannel_Class, RdpeiChannel_ResumeTouch, NULL, NULL); - - status = rdpei_push_event(callback, event); - - if (!status) - { - return -1; - } + if (rdpei->ResumeTouch) + rdpei->ResumeTouch(rdpei); return 0; } diff --git a/include/freerdp/client/rdpei.h b/include/freerdp/client/rdpei.h index d7881b11c..76b889829 100644 --- a/include/freerdp/client/rdpei.h +++ b/include/freerdp/client/rdpei.h @@ -70,6 +70,9 @@ typedef int (*pcRdpeiTouchBegin)(RdpeiClientContext* context, int externalId, in typedef int (*pcRdpeiTouchUpdate)(RdpeiClientContext* context, int externalId, int x, int y); typedef int (*pcRdpeiTouchEnd)(RdpeiClientContext* context, int externalId, int x, int y); +typedef int (*pcRdpeiSuspendTouch)(RdpeiClientContext* context); +typedef int (*pcRdpeiResumeTouch)(RdpeiClientContext* context); + struct _rdpei_client_context { void* handle; @@ -82,6 +85,9 @@ struct _rdpei_client_context pcRdpeiTouchBegin TouchBegin; pcRdpeiTouchUpdate TouchUpdate; pcRdpeiTouchEnd TouchEnd; + + pcRdpeiSuspendTouch SuspendTouch; + pcRdpeiResumeTouch ResumeTouch; }; #endif /* FREERDP_CHANNEL_CLIENT_RDPEI_H */ diff --git a/libfreerdp/utils/event.c b/libfreerdp/utils/event.c index 003736058..d8cd80d80 100644 --- a/libfreerdp/utils/event.c +++ b/libfreerdp/utils/event.c @@ -146,16 +146,6 @@ static wMessage* freerdp_rail_event_new(UINT16 event_type) return event; } -static wMessage* freerdp_rdpei_event_new(UINT16 event_type) -{ - wMessage* event; - - event = (wMessage*) malloc(sizeof(wMessage)); - ZeroMemory(event, sizeof(wMessage)); - - return event; -} - wMessage* freerdp_event_new(UINT16 event_class, UINT16 event_type, MESSAGE_FREE_FN on_event_free_callback, void* user_data) { @@ -179,10 +169,6 @@ wMessage* freerdp_event_new(UINT16 event_class, UINT16 event_type, case RailChannel_Class: event = freerdp_rail_event_new(event_type); break; - - case RdpeiChannel_Class: - event = freerdp_rdpei_event_new(event_type); - break; } if (event) @@ -235,11 +221,6 @@ static void freerdp_rail_event_free(wMessage* event) } -static void freerdp_rdpei_event_free(wMessage* event) -{ - -} - void freerdp_event_free(wMessage* event) { if (event) @@ -260,10 +241,6 @@ void freerdp_event_free(wMessage* event) case RailChannel_Class: freerdp_rail_event_free(event); break; - - case RdpeiChannel_Class: - freerdp_rdpei_event_free(event); - break; } free(event);