27#include <freerdp/settings_types.h>
32 [[nodiscard]]
static SdlWindow create(SDL_DisplayID
id,
const std::string& title, Uint32 flags,
33 Uint32 width = 0, Uint32 height = 0);
35 [[nodiscard]]
static SdlWindow create(SDL_DisplayID
id,
const std::string& title, Uint32 flags,
36 const SDL_Rect& rect);
38 [[nodiscard]]
static SdlWindow createPopup(SDL_Window* parent,
const SDL_Rect& rect,
39 bool transparent,
bool tooltip =
false);
40 [[nodiscard]]
static rdpMonitor query(SDL_DisplayID
id,
bool forceAsPrimary =
false);
49 [[nodiscard]] SDL_WindowID id()
const;
50 [[nodiscard]] SDL_DisplayID displayIndex()
const;
51 [[nodiscard]] SDL_Rect rect()
const;
52 [[nodiscard]] SDL_Rect bounds()
const;
53 [[nodiscard]] SDL_Window* window()
const;
54 [[nodiscard]] SDL_Renderer* renderer()
const;
56 [[nodiscard]] Sint32 offsetX()
const;
57 void setOffsetX(Sint32 x);
59 void setOffsetY(Sint32 y);
60 [[nodiscard]] Sint32 offsetY()
const;
62 [[nodiscard]]
rdpMonitor monitor(
bool isPrimary)
const;
65 [[nodiscard]]
float scale()
const;
66 [[nodiscard]] SDL_DisplayOrientation orientation()
const;
68 [[nodiscard]]
bool grabKeyboard(
bool enable);
69 [[nodiscard]]
bool grabMouse(
bool enable);
70 void setBordered(
bool bordered);
72 void resizeable(
bool use);
73 void fullscreen(
bool enter,
bool forceOriginalDisplay);
76 [[nodiscard]]
bool resizeToScale();
77 [[nodiscard]]
bool resize(
const SDL_Point& size);
79 [[nodiscard]]
bool drawRect(SDL_Surface* surface, SDL_Point offset,
const SDL_Rect& srcRect);
80 [[nodiscard]]
bool drawRects(SDL_Surface* surface, SDL_Point offset,
81 const std::vector<SDL_Rect>& rects = {});
82 [[nodiscard]]
bool drawScaledRect(SDL_Surface* surface,
const SDL_FPoint& scale,
83 const SDL_Rect& srcRect);
85 [[nodiscard]]
bool drawScaledRects(SDL_Surface* surface,
const SDL_FPoint& scale,
86 const std::vector<SDL_Rect>& rects = {});
88 [[nodiscard]]
bool fill(Uint8 r = 0x00, Uint8 g = 0x00, Uint8 b = 0x00, Uint8 a = 0xff);
90 [[nodiscard]]
bool blit(SDL_Surface* surface,
const SDL_Rect& src, SDL_Rect& dst);
92 bool paintResizeFrame(SDL_Surface* surface, SDL_Point off,
bool contentChanged,
93 const SDL_Rect& inset = { 0, 0, 0, 0 },
bool fillRevealed =
true,
94 bool dashedBorder =
true);
98 SdlWindow(SDL_DisplayID
id,
const std::string& title,
const SDL_Rect& rect, Uint32 flags);
99 SdlWindow(SDL_Window* parent,
const SDL_Rect& rect,
bool transparent,
bool tooltip);
101 [[nodiscard]]
static bool fill(SDL_Window* window, Uint8 r = 0x00, Uint8 g = 0x00,
102 Uint8 b = 0x00, Uint8 a = 0xff);
103 [[nodiscard]]
static rdpMonitor query(SDL_Window* window, SDL_DisplayID
id,
104 bool forceAsPrimary =
false);
105 [[nodiscard]]
static SDL_Rect rect(SDL_Window* window,
bool forceAsPrimary =
false);
106 [[nodiscard]]
static SDL_Rect rect(SDL_DisplayID
id,
bool forceAsPrimary =
false);
108 [[nodiscard]]
static bool tryFallback(
bool isFullscreen);
118 [[nodiscard]]
static enum HighDPIMode isHighDPIWindowsMode(SDL_Window* window);
121 void ensureRenderTarget();
122 bool ensureGdiTexture(SDL_Surface* surface);
124 SDL_Window* _window =
nullptr;
125 SDL_Renderer* _renderer =
nullptr;
126 SDL_Texture* _renderTarget =
nullptr;
127 SDL_Texture* _gdiTexture =
nullptr;
128 int _gdiTextureW = 0;
129 int _gdiTextureH = 0;
132 SDL_DisplayID _displayID = 0;
133 Sint32 _offset_x = 0;
134 Sint32 _offset_y = 0;