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;
44 rdtkEngine* engine = rdtk_engine_new();
48 EnterCriticalSection(&lobby->lock);
49 rdtkSurface* surface =
50 rdtk_surface_new(engine, lobby->data, WINPR_ASSERTING_INT_CAST(uint16_t, lobby->width),
51 WINPR_ASSERTING_INT_CAST(uint16_t, lobby->height), lobby->scanline);
58 WINPR_ASSERT(lobby->width <= UINT16_MAX);
59 WINPR_ASSERT(lobby->height <= UINT16_MAX);
60 invalidRect.right = (UINT16)lobby->width;
61 invalidRect.bottom = (UINT16)lobby->height;
62 if (server->shareSubRect)
65 if (!rectangles_intersection(&invalidRect, &(server->subRect), &invalidRect))
70 const int width = invalidRect.right - invalidRect.left;
71 const int height = invalidRect.bottom - invalidRect.top;
72 WINPR_ASSERT(width <= UINT16_MAX);
73 WINPR_ASSERT(width >= 0);
74 WINPR_ASSERT(height <= UINT16_MAX);
75 WINPR_ASSERT(height >= 0);
77 if (rdtk_surface_fill(surface, invalidRect.left, invalidRect.top, (UINT16)width, (UINT16)height,
81 if (rdtk_label_draw(surface, invalidRect.left, invalidRect.top, (UINT16)width, (UINT16)height,
82 nullptr,
"Welcome", 0, 0) < 0)
88 if (!region16_union_rect(&(lobby->invalidRegion), &(lobby->invalidRegion), &invalidRect))
95 rdtk_surface_free(surface);
96 rdtk_engine_free(engine);
99 LeaveCriticalSection(&lobby->lock);