/src/FreeRDP/channels/ainput/common/ainput_common.h
Line | Count | Source (jump to first uncovered line) |
1 | | /** |
2 | | * FreeRDP: A Remote Desktop Protocol Implementation |
3 | | * Audio Input Redirection Virtual Channel |
4 | | * |
5 | | * Copyright 2022 Armin Novak <anovak@thincast.com> |
6 | | * Copyright 2022 Thincast Technologies GmbH |
7 | | * |
8 | | * Licensed under the Apache License, Version 2.0 (the "License"); |
9 | | * you may not use this file except in compliance with the License. |
10 | | * You may obtain a copy of the License at |
11 | | * |
12 | | * http://www.apache.org/licenses/LICENSE-2.0 |
13 | | * |
14 | | * Unless required by applicable law or agreed to in writing, software |
15 | | * distributed under the License is distributed on an "AS IS" BASIS, |
16 | | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
17 | | * See the License for the specific language governing permissions and |
18 | | * limitations under the License. |
19 | | */ |
20 | | |
21 | | #ifndef FREERDP_INT_AINPUT_COMMON_H |
22 | | #define FREERDP_INT_AINPUT_COMMON_H |
23 | | |
24 | | #include <winpr/string.h> |
25 | | |
26 | | #include <freerdp/channels/ainput.h> |
27 | | |
28 | | static INLINE const char* ainput_flags_to_string(UINT64 flags, char* buffer, size_t size) |
29 | 0 | { |
30 | 0 | char number[32] = { 0 }; |
31 | |
|
32 | 0 | if (flags & AINPUT_FLAGS_HAVE_REL) |
33 | 0 | winpr_str_append("AINPUT_FLAGS_HAVE_REL", buffer, size, "|"); |
34 | 0 | if (flags & AINPUT_FLAGS_WHEEL) |
35 | 0 | winpr_str_append("AINPUT_FLAGS_WHEEL", buffer, size, "|"); |
36 | 0 | if (flags & AINPUT_FLAGS_MOVE) |
37 | 0 | winpr_str_append("AINPUT_FLAGS_MOVE", buffer, size, "|"); |
38 | 0 | if (flags & AINPUT_FLAGS_DOWN) |
39 | 0 | winpr_str_append("AINPUT_FLAGS_DOWN", buffer, size, "|"); |
40 | 0 | if (flags & AINPUT_FLAGS_REL) |
41 | 0 | winpr_str_append("AINPUT_FLAGS_REL", buffer, size, "|"); |
42 | 0 | if (flags & AINPUT_FLAGS_BUTTON1) |
43 | 0 | winpr_str_append("AINPUT_FLAGS_BUTTON1", buffer, size, "|"); |
44 | 0 | if (flags & AINPUT_FLAGS_BUTTON2) |
45 | 0 | winpr_str_append("AINPUT_FLAGS_BUTTON2", buffer, size, "|"); |
46 | 0 | if (flags & AINPUT_FLAGS_BUTTON3) |
47 | 0 | winpr_str_append("AINPUT_FLAGS_BUTTON3", buffer, size, "|"); |
48 | 0 | if (flags & AINPUT_XFLAGS_BUTTON1) |
49 | 0 | winpr_str_append("AINPUT_XFLAGS_BUTTON1", buffer, size, "|"); |
50 | 0 | if (flags & AINPUT_XFLAGS_BUTTON2) |
51 | 0 | winpr_str_append("AINPUT_XFLAGS_BUTTON2", buffer, size, "|"); |
52 | |
|
53 | 0 | _snprintf(number, sizeof(number), "[0x%08" PRIx64 "]", flags); |
54 | 0 | winpr_str_append(number, buffer, size, " "); |
55 | |
|
56 | 0 | return buffer; |
57 | 0 | } |
58 | | |
59 | | #endif /* FREERDP_INT_AINPUT_COMMON_H */ |