20 #include <freerdp/config.h>
22 #include <winpr/assert.h>
24 #include <freerdp/client/rail.h>
25 #include <freerdp/client/cliprdr.h>
26 #include <freerdp/client/disp.h>
28 #include "sdl_channels.hpp"
29 #include "sdl_freerdp.hpp"
30 #include "sdl_disp.hpp"
32 void sdl_OnChannelConnectedEventHandler(
void* context,
const ChannelConnectedEventArgs* e)
34 auto sdl = get_context(context);
39 if (strcmp(e->name, RAIL_SVC_CHANNEL_NAME) == 0)
42 else if (strcmp(e->name, CLIPRDR_SVC_CHANNEL_NAME) == 0)
44 auto clip =
reinterpret_cast<CliprdrClientContext*
>(e->pInterface);
46 clip->custom = context;
48 else if (strcmp(e->name, DISP_DVC_CHANNEL_NAME) == 0)
50 auto disp =
reinterpret_cast<DispClientContext*
>(e->pInterface);
55 freerdp_client_OnChannelConnectedEventHandler(context, e);
58 void sdl_OnChannelDisconnectedEventHandler(
void* context,
const ChannelDisconnectedEventArgs* e)
60 auto sdl = get_context(context);
66 if (strcmp(e->name, RAIL_SVC_CHANNEL_NAME) == 0)
69 else if (strcmp(e->name, CLIPRDR_SVC_CHANNEL_NAME) == 0)
71 auto clip =
reinterpret_cast<CliprdrClientContext*
>(e->pInterface);
73 clip->custom =
nullptr;
75 else if (strcmp(e->name, DISP_DVC_CHANNEL_NAME) == 0)
77 auto disp =
reinterpret_cast<DispClientContext*
>(e->pInterface);
79 sdl->disp.uninit(disp);
82 freerdp_client_OnChannelDisconnectedEventHandler(context, e);