22#include <freerdp/config.h>
24#include <winpr/assert.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")
42static UINT sf_peer_ainput_mouse_event(WINPR_ATTR_UNUSED ainput_server_context* context,
43 UINT64 timestamp, UINT64 flags, INT32 x, INT32 y)
46 WINPR_ASSERT(context);
48 WLog_WARN(TAG,
"not implemented: 0x%08" PRIx64
", 0x%08" PRIx64
", %" PRId32
"x%" PRId32,
49 timestamp, flags, x, y);
53void sf_peer_ainput_init(testPeerContext* context)
55 WINPR_ASSERT(context);
57 context->ainput = ainput_server_context_new(context->vcm);
58 WINPR_ASSERT(context->ainput);
60 context->ainput->rdpcontext = &context->_p;
61 context->ainput->data = context;
63 context->ainput->MouseEvent = sf_peer_ainput_mouse_event;
66BOOL sf_peer_ainput_start(testPeerContext* context)
68 if (!context || !context->ainput || !context->ainput->Open)
71 return context->ainput->Open(context->ainput) == CHANNEL_RC_OK;
74BOOL sf_peer_ainput_stop(testPeerContext* context)
76 if (!context || !context->ainput || !context->ainput->Close)
79 return context->ainput->Close(context->ainput) == CHANNEL_RC_OK;
82BOOL sf_peer_ainput_running(testPeerContext* context)
84 if (!context || !context->ainput || !context->ainput->IsOpen)
87 return context->ainput->IsOpen(context->ainput);
90void sf_peer_ainput_uninit(testPeerContext* context)
92 ainput_server_context_free(context->ainput);