21 #ifndef FREERDP_INT_AINPUT_COMMON_H
22 #define FREERDP_INT_AINPUT_COMMON_H
24 #include <winpr/string.h>
26 #include <freerdp/channels/ainput.h>
28 static INLINE
const char* ainput_flags_to_string(UINT64 flags,
char* buffer,
size_t size)
30 char number[32] = { 0 };
32 if (flags & AINPUT_FLAGS_HAVE_REL)
33 winpr_str_append(
"AINPUT_FLAGS_HAVE_REL", buffer, size,
"|");
34 if (flags & AINPUT_FLAGS_WHEEL)
35 winpr_str_append(
"AINPUT_FLAGS_WHEEL", buffer, size,
"|");
36 if (flags & AINPUT_FLAGS_MOVE)
37 winpr_str_append(
"AINPUT_FLAGS_MOVE", buffer, size,
"|");
38 if (flags & AINPUT_FLAGS_DOWN)
39 winpr_str_append(
"AINPUT_FLAGS_DOWN", buffer, size,
"|");
40 if (flags & AINPUT_FLAGS_REL)
41 winpr_str_append(
"AINPUT_FLAGS_REL", buffer, size,
"|");
42 if (flags & AINPUT_FLAGS_BUTTON1)
43 winpr_str_append(
"AINPUT_FLAGS_BUTTON1", buffer, size,
"|");
44 if (flags & AINPUT_FLAGS_BUTTON2)
45 winpr_str_append(
"AINPUT_FLAGS_BUTTON2", buffer, size,
"|");
46 if (flags & AINPUT_FLAGS_BUTTON3)
47 winpr_str_append(
"AINPUT_FLAGS_BUTTON3", buffer, size,
"|");
48 if (flags & AINPUT_XFLAGS_BUTTON1)
49 winpr_str_append(
"AINPUT_XFLAGS_BUTTON1", buffer, size,
"|");
50 if (flags & AINPUT_XFLAGS_BUTTON2)
51 winpr_str_append(
"AINPUT_XFLAGS_BUTTON2", buffer, size,
"|");
53 _snprintf(number,
sizeof(number),
"[0x%08" PRIx64
"]", flags);
54 winpr_str_append(number, buffer, size,
" ");