19#include <freerdp/config.h>
21#include <winpr/assert.h>
22#include <winpr/cast.h>
30#include "shadow_lobby.h"
32BOOL shadow_client_init_lobby(rdpShadowServer* server)
38 rdpShadowSurface* lobby = server->lobby;
43 EnterCriticalSection(&lobby->lock);
46 rdtkSurface* surface =
nullptr;
47 rdtkEngine* engine = rdtk_engine_new();
52 rdtk_surface_new(engine, lobby->data, WINPR_ASSERTING_INT_CAST(uint16_t, lobby->width),
53 WINPR_ASSERTING_INT_CAST(uint16_t, lobby->height), lobby->scanline);
60 WINPR_ASSERT(lobby->width <= UINT16_MAX);
61 WINPR_ASSERT(lobby->height <= UINT16_MAX);
62 invalidRect.right = (UINT16)lobby->width;
63 invalidRect.bottom = (UINT16)lobby->height;
64 if (server->shareSubRect)
67 if (!rectangles_intersection(&invalidRect, &(server->subRect), &invalidRect))
72 const int width = invalidRect.right - invalidRect.left;
73 const int height = invalidRect.bottom - invalidRect.top;
74 WINPR_ASSERT(width <= UINT16_MAX);
75 WINPR_ASSERT(width >= 0);
76 WINPR_ASSERT(height <= UINT16_MAX);
77 WINPR_ASSERT(height >= 0);
79 if (rdtk_surface_fill(surface, invalidRect.left, invalidRect.top, (UINT16)width, (UINT16)height,
83 if (rdtk_label_draw(surface, invalidRect.left, invalidRect.top, (UINT16)width, (UINT16)height,
84 nullptr,
"Welcome", 0, 0) < 0)
90 if (!region16_union_rect(&(lobby->invalidRegion), &(lobby->invalidRegion), &invalidRect))
97 rdtk_surface_free(surface);
98 rdtk_engine_free(engine);
101 LeaveCriticalSection(&lobby->lock);