FreeRDP
Loading...
Searching...
No Matches
sample_shadow.c
1
20#include <winpr/crt.h>
21#include <winpr/synch.h>
22#include <winpr/sysinfo.h>
23
24#include <freerdp/log.h>
25#include <freerdp/codec/color.h>
26#include <freerdp/codec/region.h>
27#include <freerdp/server/server-common.h>
28
29#include "sample_shadow.h"
30
31#define TAG SERVER_TAG("shadow.sample")
32
33WINPR_ATTR_NODISCARD
34static BOOL sample_shadow_input_synchronize_event(WINPR_ATTR_UNUSED rdpShadowSubsystem* subsystem,
35 WINPR_ATTR_UNUSED rdpShadowClient* client,
36 WINPR_ATTR_UNUSED UINT32 flags)
37{
38 WLog_WARN(TAG, "TODO: Implement!");
39 return TRUE;
40}
41
42WINPR_ATTR_NODISCARD
43static BOOL sample_shadow_input_keyboard_event(WINPR_ATTR_UNUSED rdpShadowSubsystem* subsystem,
44 WINPR_ATTR_UNUSED rdpShadowClient* client,
45 WINPR_ATTR_UNUSED UINT16 flags,
46 WINPR_ATTR_UNUSED UINT8 code)
47{
48 WLog_WARN(TAG, "TODO: Implement!");
49 return TRUE;
50}
51
52WINPR_ATTR_NODISCARD
53static BOOL sample_shadow_input_unicode_keyboard_event(
54 WINPR_ATTR_UNUSED rdpShadowSubsystem* subsystem, WINPR_ATTR_UNUSED rdpShadowClient* client,
55 WINPR_ATTR_UNUSED UINT16 flags, WINPR_ATTR_UNUSED UINT16 code)
56{
57 WLog_WARN(TAG, "TODO: Implement!");
58 return TRUE;
59}
60
61WINPR_ATTR_NODISCARD
62static BOOL sample_shadow_input_mouse_event(WINPR_ATTR_UNUSED rdpShadowSubsystem* subsystem,
63 WINPR_ATTR_UNUSED rdpShadowClient* client,
64 WINPR_ATTR_UNUSED UINT16 flags,
65 WINPR_ATTR_UNUSED UINT16 x, WINPR_ATTR_UNUSED UINT16 y)
66{
67 WLog_WARN(TAG, "TODO: Implement!");
68 return TRUE;
69}
70
71WINPR_ATTR_NODISCARD
72static BOOL sample_shadow_input_extended_mouse_event(
73 WINPR_ATTR_UNUSED rdpShadowSubsystem* subsystem, WINPR_ATTR_UNUSED rdpShadowClient* client,
74 WINPR_ATTR_UNUSED UINT16 flags, WINPR_ATTR_UNUSED UINT16 x, WINPR_ATTR_UNUSED UINT16 y)
75{
76 WLog_WARN(TAG, "TODO: Implement!");
77 return TRUE;
78}
79
80WINPR_ATTR_NODISCARD
81static UINT32 sample_shadow_enum_monitors(WINPR_ATTR_UNUSED MONITOR_DEF* monitors,
82 WINPR_ATTR_UNUSED UINT32 maxMonitors)
83{
84 WLog_WARN(TAG, "TODO: Implement!");
85 return 0;
86}
87
88WINPR_ATTR_NODISCARD
89static int sample_shadow_subsystem_init(rdpShadowSubsystem* arg)
90{
91 sampleShadowSubsystem* subsystem = (sampleShadowSubsystem*)arg;
92 WINPR_ASSERT(subsystem);
93
94 subsystem->base.numMonitors = sample_shadow_enum_monitors(subsystem->base.monitors, 16);
95
96 WLog_WARN(TAG, "TODO: Implement!");
97
98 MONITOR_DEF* virtualScreen = &(subsystem->base.virtualScreen);
99 virtualScreen->left = 0;
100 virtualScreen->top = 0;
101 virtualScreen->right = 0;
102 virtualScreen->bottom = 0;
103 virtualScreen->flags = 1;
104 return 1;
105}
106
107WINPR_ATTR_NODISCARD
108static int sample_shadow_subsystem_uninit(rdpShadowSubsystem* arg)
109{
110 sampleShadowSubsystem* subsystem = (sampleShadowSubsystem*)arg;
111
112 if (!subsystem)
113 return -1;
114
115 WLog_WARN(TAG, "TODO: Implement!");
116 return 1;
117}
118
119WINPR_ATTR_NODISCARD
120static int sample_shadow_subsystem_start(rdpShadowSubsystem* arg)
121{
122 sampleShadowSubsystem* subsystem = (sampleShadowSubsystem*)arg;
123
124 if (!subsystem)
125 return -1;
126
127 WLog_WARN(TAG, "TODO: Implement!");
128
129 return 1;
130}
131
132WINPR_ATTR_NODISCARD
133static int sample_shadow_subsystem_stop(rdpShadowSubsystem* arg)
134{
135 sampleShadowSubsystem* subsystem = (sampleShadowSubsystem*)arg;
136
137 if (!subsystem)
138 return -1;
139
140 WLog_WARN(TAG, "TODO: Implement!");
141
142 return 1;
143}
144
145static void sample_shadow_subsystem_free(rdpShadowSubsystem* arg)
146{
147 sampleShadowSubsystem* subsystem = (sampleShadowSubsystem*)arg;
148
149 if (!subsystem)
150 return;
151
152 sample_shadow_subsystem_uninit(arg);
153 free(subsystem);
154}
155
156WINPR_ATTR_MALLOC(sample_shadow_subsystem_free, 1)
157WINPR_ATTR_NODISCARD
158static rdpShadowSubsystem* sample_shadow_subsystem_new(void)
159{
160 sampleShadowSubsystem* subsystem =
161 (sampleShadowSubsystem*)calloc(1, sizeof(sampleShadowSubsystem));
162
163 if (!subsystem)
164 return nullptr;
165
166 subsystem->base.SynchronizeEvent = sample_shadow_input_synchronize_event;
167 subsystem->base.KeyboardEvent = sample_shadow_input_keyboard_event;
168 subsystem->base.UnicodeKeyboardEvent = sample_shadow_input_unicode_keyboard_event;
169 subsystem->base.MouseEvent = sample_shadow_input_mouse_event;
170 subsystem->base.ExtendedMouseEvent = sample_shadow_input_extended_mouse_event;
171 return &subsystem->base;
172}
173
174const char* ShadowSubsystemName(void)
175{
176 return "Sample";
177}
178
179int ShadowSubsystemEntry(RDP_SHADOW_ENTRY_POINTS* pEntryPoints)
180{
181 pEntryPoints->New = sample_shadow_subsystem_new;
182 pEntryPoints->Free = sample_shadow_subsystem_free;
183 pEntryPoints->Init = sample_shadow_subsystem_init;
184 pEntryPoints->Uninit = sample_shadow_subsystem_uninit;
185 pEntryPoints->Start = sample_shadow_subsystem_start;
186 pEntryPoints->Stop = sample_shadow_subsystem_stop;
187 pEntryPoints->EnumMonitors = sample_shadow_enum_monitors;
188 return 1;
189}