49 SdlOverlay(
const SdlOverlay& other) =
delete;
50 SdlOverlay(SdlOverlay&& other) =
delete;
51 ~SdlOverlay() =
default;
52 SdlOverlay& operator=(
const SdlOverlay& other) =
delete;
53 SdlOverlay& operator=(SdlOverlay&& other) =
delete;
55 [[nodiscard]]
bool visible()
const;
58 [[nodiscard]]
bool show(
bool on);
65 [[nodiscard]]
bool update(
int windowWidth,
int windowHeight,
const char* rendererName);
69 [[nodiscard]]
const std::vector<sdl::overlay::Row>&
left()
const;
70 [[nodiscard]]
const std::vector<sdl::overlay::Row>& right()
const;
71 [[nodiscard]] uint64_t generation()
const;
74 [[nodiscard]]
bool arm();
75 [[nodiscard]]
static uint64_t onTimer(rdpContext* context,
void* userdata,
76 FreeRDP_TimerID timerID, uint64_t timestamp,
78 [[nodiscard]]
bool read(rdpContext* context, uint64_t timestamp);
79 void clientRows(
const char* rendererName);
82 std::atomic<bool> _visible =
false;
83 std::atomic<bool> _armed =
false;
87 std::optional<sdl::overlay::Reading> _pending;
88 std::chrono::steady_clock::time_point _since;
89 bool _restart =
false;
92 std::optional<sdl::overlay::Names> _names;
93 std::optional<sdl::overlay::Reading> _prev;
94 std::vector<sdl::overlay::Row> _client;
95 std::vector<sdl::overlay::Row> _left;
96 std::vector<sdl::overlay::Row> _right;
97 uint64_t _generation = 0;
102class SdlOverlayPainter
105 explicit SdlOverlayPainter(SDL_Renderer* renderer);
106 SdlOverlayPainter(
const SdlOverlayPainter& other) =
delete;
107 SdlOverlayPainter(SdlOverlayPainter&& other) =
delete;
108 ~SdlOverlayPainter();
109 SdlOverlayPainter& operator=(
const SdlOverlayPainter& other) =
delete;
110 SdlOverlayPainter& operator=(SdlOverlayPainter&& other) =
delete;
113 void draw(
const SdlOverlay& overlay,
int width,
int height,
float scale);
118 TTF_Text* label =
nullptr;
119 TTF_Text* value =
nullptr;
123 [[nodiscard]]
bool rebuild(
const SdlOverlay& overlay,
float scale);
124 [[nodiscard]] std::vector<Cell> cells(
const std::vector<sdl::overlay::Row>& rows);
126 [[nodiscard]] SDL_FPoint panelSize(
const std::vector<Cell>& list,
float& labelWidth)
const;
128 SDL_Renderer* _renderer;
129 TTF_TextEngine* _engine =
nullptr;
130 TTF_Font* _font =
nullptr;
132 uint64_t _generation = UINT64_MAX;
133 std::vector<Cell> _left;
134 std::vector<Cell> _right;