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
33static BOOL sample_shadow_input_synchronize_event(WINPR_ATTR_UNUSED rdpShadowSubsystem* subsystem,
34 WINPR_ATTR_UNUSED rdpShadowClient* client,
35 WINPR_ATTR_UNUSED UINT32 flags)
36{
37 WLog_WARN(TAG, "TODO: Implement!");
38 return TRUE;
39}
40
41static BOOL sample_shadow_input_keyboard_event(WINPR_ATTR_UNUSED rdpShadowSubsystem* subsystem,
42 WINPR_ATTR_UNUSED rdpShadowClient* client,
43 WINPR_ATTR_UNUSED UINT16 flags,
44 WINPR_ATTR_UNUSED UINT8 code)
45{
46 WLog_WARN(TAG, "TODO: Implement!");
47 return TRUE;
48}
49
50static BOOL sample_shadow_input_unicode_keyboard_event(
51 WINPR_ATTR_UNUSED rdpShadowSubsystem* subsystem, WINPR_ATTR_UNUSED rdpShadowClient* client,
52 WINPR_ATTR_UNUSED UINT16 flags, WINPR_ATTR_UNUSED UINT16 code)
53{
54 WLog_WARN(TAG, "TODO: Implement!");
55 return TRUE;
56}
57
58static BOOL sample_shadow_input_mouse_event(WINPR_ATTR_UNUSED rdpShadowSubsystem* subsystem,
59 WINPR_ATTR_UNUSED rdpShadowClient* client,
60 WINPR_ATTR_UNUSED UINT16 flags,
61 WINPR_ATTR_UNUSED UINT16 x, WINPR_ATTR_UNUSED UINT16 y)
62{
63 WLog_WARN(TAG, "TODO: Implement!");
64 return TRUE;
65}
66
67static BOOL sample_shadow_input_extended_mouse_event(
68 WINPR_ATTR_UNUSED rdpShadowSubsystem* subsystem, WINPR_ATTR_UNUSED rdpShadowClient* client,
69 WINPR_ATTR_UNUSED UINT16 flags, WINPR_ATTR_UNUSED UINT16 x, WINPR_ATTR_UNUSED UINT16 y)
70{
71 WLog_WARN(TAG, "TODO: Implement!");
72 return TRUE;
73}
74
75static UINT32 sample_shadow_enum_monitors(WINPR_ATTR_UNUSED MONITOR_DEF* monitors,
76 WINPR_ATTR_UNUSED UINT32 maxMonitors)
77{
78 WLog_WARN(TAG, "TODO: Implement!");
79 return 0;
80}
81
82static int sample_shadow_subsystem_init(rdpShadowSubsystem* arg)
83{
84 sampleShadowSubsystem* subsystem = (sampleShadowSubsystem*)arg;
85 WINPR_ASSERT(subsystem);
86
87 subsystem->base.numMonitors = sample_shadow_enum_monitors(subsystem->base.monitors, 16);
88
89 WLog_WARN(TAG, "TODO: Implement!");
90
91 MONITOR_DEF* virtualScreen = &(subsystem->base.virtualScreen);
92 virtualScreen->left = 0;
93 virtualScreen->top = 0;
94 virtualScreen->right = 0;
95 virtualScreen->bottom = 0;
96 virtualScreen->flags = 1;
97 return 1;
98}
99
100static int sample_shadow_subsystem_uninit(rdpShadowSubsystem* arg)
101{
102 sampleShadowSubsystem* subsystem = (sampleShadowSubsystem*)arg;
103
104 if (!subsystem)
105 return -1;
106
107 WLog_WARN(TAG, "TODO: Implement!");
108 return 1;
109}
110
111static int sample_shadow_subsystem_start(rdpShadowSubsystem* arg)
112{
113 sampleShadowSubsystem* subsystem = (sampleShadowSubsystem*)arg;
114
115 if (!subsystem)
116 return -1;
117
118 WLog_WARN(TAG, "TODO: Implement!");
119
120 return 1;
121}
122
123static int sample_shadow_subsystem_stop(rdpShadowSubsystem* arg)
124{
125 sampleShadowSubsystem* subsystem = (sampleShadowSubsystem*)arg;
126
127 if (!subsystem)
128 return -1;
129
130 WLog_WARN(TAG, "TODO: Implement!");
131
132 return 1;
133}
134
135static void sample_shadow_subsystem_free(rdpShadowSubsystem* arg)
136{
137 sampleShadowSubsystem* subsystem = (sampleShadowSubsystem*)arg;
138
139 if (!subsystem)
140 return;
141
142 sample_shadow_subsystem_uninit(arg);
143 free(subsystem);
144}
145
146static rdpShadowSubsystem* sample_shadow_subsystem_new(void)
147{
148 sampleShadowSubsystem* subsystem =
149 (sampleShadowSubsystem*)calloc(1, sizeof(sampleShadowSubsystem));
150
151 if (!subsystem)
152 return NULL;
153
154 subsystem->base.SynchronizeEvent = sample_shadow_input_synchronize_event;
155 subsystem->base.KeyboardEvent = sample_shadow_input_keyboard_event;
156 subsystem->base.UnicodeKeyboardEvent = sample_shadow_input_unicode_keyboard_event;
157 subsystem->base.MouseEvent = sample_shadow_input_mouse_event;
158 subsystem->base.ExtendedMouseEvent = sample_shadow_input_extended_mouse_event;
159 return &subsystem->base;
160}
161
162const char* ShadowSubsystemName(void)
163{
164 return "Sample";
165}
166
167int ShadowSubsystemEntry(RDP_SHADOW_ENTRY_POINTS* pEntryPoints)
168{
169 pEntryPoints->New = sample_shadow_subsystem_new;
170 pEntryPoints->Free = sample_shadow_subsystem_free;
171 pEntryPoints->Init = sample_shadow_subsystem_init;
172 pEntryPoints->Uninit = sample_shadow_subsystem_uninit;
173 pEntryPoints->Start = sample_shadow_subsystem_start;
174 pEntryPoints->Stop = sample_shadow_subsystem_stop;
175 pEntryPoints->EnumMonitors = sample_shadow_enum_monitors;
176 return 1;
177}