22 #include <freerdp/config.h>
24 #include <winpr/assert.h>
28 #include "sf_ainput.h"
30 #include <freerdp/server/server-common.h>
31 #include <freerdp/server/ainput.h>
33 #include <freerdp/log.h>
34 #define TAG SERVER_TAG("sample.ainput")
41 static UINT sf_peer_ainput_mouse_event(ainput_server_context* context, UINT64 timestamp,
42 UINT64 flags, INT32 x, INT32 y)
45 WINPR_ASSERT(context);
47 WLog_WARN(TAG,
"not implemented: 0x%08" PRIx64
", 0x%08" PRIx64
", %" PRId32
"x%" PRId32,
48 timestamp, flags, x, y);
52 void sf_peer_ainput_init(testPeerContext* context)
54 WINPR_ASSERT(context);
56 context->ainput = ainput_server_context_new(context->vcm);
57 WINPR_ASSERT(context->ainput);
59 context->ainput->rdpcontext = &context->_p;
60 context->ainput->data = context;
62 context->ainput->MouseEvent = sf_peer_ainput_mouse_event;
65 BOOL sf_peer_ainput_start(testPeerContext* context)
67 if (!context || !context->ainput || !context->ainput->Open)
70 return context->ainput->Open(context->ainput) == CHANNEL_RC_OK;
73 BOOL sf_peer_ainput_stop(testPeerContext* context)
75 if (!context || !context->ainput || !context->ainput->Close)
78 return context->ainput->Close(context->ainput) == CHANNEL_RC_OK;
81 BOOL sf_peer_ainput_running(testPeerContext* context)
83 if (!context || !context->ainput || !context->ainput->IsOpen)
86 return context->ainput->IsOpen(context->ainput);
89 void sf_peer_ainput_uninit(testPeerContext* context)
91 ainput_server_context_free(context->ainput);