mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-14 08:24:16 +09:00
[warnings] fix clang-tidy issues in clients
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
*/
|
||||
|
||||
#include <cassert>
|
||||
#include <utility>
|
||||
|
||||
#include "sdl_button.hpp"
|
||||
|
||||
@@ -27,8 +28,8 @@ static const SDL_Color buttonhighlightcolor = { 0xcd, 0xca, 0x35, 0x60 };
|
||||
static const SDL_Color buttonmouseovercolor = { 0x66, 0xff, 0x66, 0x60 };
|
||||
static const SDL_Color buttonfontcolor = { 0xd1, 0xcf, 0xcd, 0xff };
|
||||
|
||||
SdlButton::SdlButton(SDL_Renderer* renderer, const std::string& label, int id, const SDL_Rect& rect)
|
||||
: SdlWidget(renderer, rect, false), _name(label), _id(id)
|
||||
SdlButton::SdlButton(SDL_Renderer* renderer, std::string label, int id, SDL_Rect rect)
|
||||
: SdlWidget(renderer, rect, false), _name(std::move(label)), _id(id)
|
||||
{
|
||||
assert(renderer);
|
||||
|
||||
@@ -36,7 +37,7 @@ SdlButton::SdlButton(SDL_Renderer* renderer, const std::string& label, int id, c
|
||||
}
|
||||
|
||||
SdlButton::SdlButton(SdlButton&& other) noexcept
|
||||
: SdlWidget(std::move(other)), _name(std::move(other._name)), _id(std::move(other._id))
|
||||
: SdlWidget(std::move(other)), _name(std::move(other._name)), _id(other._id)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
class SdlButton : public SdlWidget
|
||||
{
|
||||
public:
|
||||
SdlButton(SDL_Renderer* renderer, const std::string& label, int id, const SDL_Rect& rect);
|
||||
SdlButton(SDL_Renderer* renderer, std::string label, int id, SDL_Rect rect);
|
||||
SdlButton(SdlButton&& other) noexcept;
|
||||
~SdlButton() override = default;
|
||||
|
||||
@@ -20,7 +20,6 @@ class SdlButton : public SdlWidget
|
||||
private:
|
||||
SdlButton(const SdlButton& other) = delete;
|
||||
|
||||
private:
|
||||
std::string _name;
|
||||
int _id;
|
||||
};
|
||||
|
||||
@@ -29,7 +29,6 @@ class SdlButtonList
|
||||
SdlButtonList(const SdlButtonList& other) = delete;
|
||||
SdlButtonList(SdlButtonList&& other) = delete;
|
||||
|
||||
private:
|
||||
std::vector<SdlButton> _list;
|
||||
SdlButton* _highlighted = nullptr;
|
||||
size_t _highlight_index = 0;
|
||||
|
||||
@@ -64,7 +64,6 @@ class SDLConnectionDialog
|
||||
MSG_DISCARD
|
||||
};
|
||||
|
||||
private:
|
||||
bool createWindow();
|
||||
void destroyWindow();
|
||||
|
||||
@@ -72,21 +71,19 @@ class SDLConnectionDialog
|
||||
|
||||
bool setModal();
|
||||
|
||||
bool clearWindow(SDL_Renderer* renderer);
|
||||
static bool clearWindow(SDL_Renderer* renderer);
|
||||
|
||||
bool update(SDL_Renderer* renderer);
|
||||
|
||||
bool show(MsgType type, const char* fmt, va_list ap);
|
||||
bool show(MsgType type);
|
||||
|
||||
std::string print(const char* fmt, va_list ap);
|
||||
static std::string print(const char* fmt, va_list ap);
|
||||
bool setTimer(Uint32 timeoutMS = 15000);
|
||||
void resetTimer();
|
||||
|
||||
private:
|
||||
static Uint32 timeout(Uint32 intervalMS, void* _this);
|
||||
|
||||
private:
|
||||
struct widget_cfg_t
|
||||
{
|
||||
SDL_Color fgcolor = {};
|
||||
@@ -94,7 +91,6 @@ class SDLConnectionDialog
|
||||
SdlWidget widget;
|
||||
};
|
||||
|
||||
private:
|
||||
rdpContext* _context = nullptr;
|
||||
SDL_Window* _window = nullptr;
|
||||
SDL_Renderer* _renderer = nullptr;
|
||||
@@ -121,9 +117,8 @@ class SDLConnectionDialogHider
|
||||
|
||||
private:
|
||||
SDLConnectionDialog* get(freerdp* instance);
|
||||
SDLConnectionDialog* get(rdpContext* context);
|
||||
static SDLConnectionDialog* get(rdpContext* context);
|
||||
|
||||
private:
|
||||
SDLConnectionDialog* _dialog = nullptr;
|
||||
bool _visible = false;
|
||||
};
|
||||
|
||||
@@ -333,14 +333,14 @@ static char* sdl_pem_cert(const char* pem)
|
||||
{
|
||||
rdpCertificate* cert = freerdp_certificate_new_from_pem(pem);
|
||||
if (!cert)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
char* fp = freerdp_certificate_get_fingerprint(cert);
|
||||
char* start = freerdp_certificate_get_validity(cert, TRUE);
|
||||
char* end = freerdp_certificate_get_validity(cert, FALSE);
|
||||
freerdp_certificate_free(cert);
|
||||
|
||||
char* str = NULL;
|
||||
char* str = nullptr;
|
||||
size_t slen = 0;
|
||||
winpr_asprintf(&str, &slen,
|
||||
"Valid from: %s\n"
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include <cassert>
|
||||
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include <SDL.h>
|
||||
#include <SDL_ttf.h>
|
||||
@@ -39,10 +40,9 @@ static const SDL_Color labelfontcolor = { 0xd1, 0xcf, 0xcd, 0xff };
|
||||
static const Uint32 vpadding = 5;
|
||||
static const Uint32 hpadding = 10;
|
||||
|
||||
SdlInputWidget::SdlInputWidget(SDL_Renderer* renderer, const std::string& label,
|
||||
const std::string& initial, Uint32 flags, size_t offset,
|
||||
size_t width, size_t height)
|
||||
: _flags(flags), _text(initial), _text_label(label),
|
||||
SdlInputWidget::SdlInputWidget(SDL_Renderer* renderer, std::string label, std::string initial,
|
||||
Uint32 flags, size_t offset, size_t width, size_t height)
|
||||
: _flags(flags), _text(std::move(initial)), _text_label(std::move(label)),
|
||||
_label(renderer,
|
||||
{ 0, static_cast<int>(offset * (height + vpadding)), static_cast<int>(width),
|
||||
static_cast<int>(height) },
|
||||
@@ -56,7 +56,7 @@ SdlInputWidget::SdlInputWidget(SDL_Renderer* renderer, const std::string& label,
|
||||
}
|
||||
|
||||
SdlInputWidget::SdlInputWidget(SdlInputWidget&& other) noexcept
|
||||
: _flags(std::move(other._flags)), _text(std::move(other._text)),
|
||||
: _flags(other._flags), _text(std::move(other._text)),
|
||||
_text_label(std::move(other._text_label)), _label(std::move(other._label)),
|
||||
_input(std::move(other._input)), _highlight(other._highlight), _mouseover(other._mouseover)
|
||||
{
|
||||
|
||||
@@ -34,9 +34,8 @@ class SdlInputWidget
|
||||
SDL_INPUT_READONLY = 2
|
||||
};
|
||||
|
||||
public:
|
||||
SdlInputWidget(SDL_Renderer* renderer, const std::string& label, const std::string& initial,
|
||||
Uint32 flags, size_t offset, size_t width, size_t height);
|
||||
SdlInputWidget(SDL_Renderer* renderer, std::string label, std::string initial, Uint32 flags,
|
||||
size_t offset, size_t width, size_t height);
|
||||
SdlInputWidget(SdlInputWidget&& other) noexcept;
|
||||
|
||||
bool fill_label(SDL_Renderer* renderer, SDL_Color color);
|
||||
@@ -62,7 +61,6 @@ class SdlInputWidget
|
||||
private:
|
||||
SdlInputWidget(const SdlInputWidget& other) = delete;
|
||||
|
||||
private:
|
||||
Uint32 _flags;
|
||||
std::string _text;
|
||||
std::string _text_label;
|
||||
|
||||
@@ -24,19 +24,16 @@ class SdlInputWidgetList
|
||||
SdlInputWidgetList(const SdlInputWidgetList& other) = delete;
|
||||
SdlInputWidgetList(SdlInputWidgetList&& other) = delete;
|
||||
|
||||
private:
|
||||
enum
|
||||
{
|
||||
INPUT_BUTTON_ACCEPT = 1,
|
||||
INPUT_BUTTON_CANCEL = -2
|
||||
};
|
||||
|
||||
private:
|
||||
ssize_t next(ssize_t current);
|
||||
[[nodiscard]] bool valid(ssize_t current) const;
|
||||
SdlInputWidget* get(ssize_t index);
|
||||
|
||||
private:
|
||||
SDL_Window* _window;
|
||||
SDL_Renderer* _renderer;
|
||||
std::vector<SdlInputWidget> _list;
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include <cassert>
|
||||
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include <SDL.h>
|
||||
#include <SDL_ttf.h>
|
||||
@@ -35,9 +36,8 @@ static const SDL_Color labelbackgroundcolor = { 0x69, 0x66, 0x63, 0xff };
|
||||
static const SDL_Color labelhighlightcolor = { 0xcd, 0xca, 0x35, 0x60 };
|
||||
static const SDL_Color labelfontcolor = { 0xd1, 0xcf, 0xcd, 0xff };
|
||||
|
||||
SdlSelectWidget::SdlSelectWidget(SDL_Renderer* renderer, const std::string& label,
|
||||
const SDL_Rect& rect)
|
||||
: SdlWidget(renderer, rect, true), _text(label), _mouseover(false), _highlight(false)
|
||||
SdlSelectWidget::SdlSelectWidget(SDL_Renderer* renderer, std::string label, SDL_Rect rect)
|
||||
: SdlWidget(renderer, rect, true), _text(std::move(label)), _mouseover(false), _highlight(false)
|
||||
{
|
||||
update_text(renderer);
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
class SdlSelectWidget : public SdlWidget
|
||||
{
|
||||
public:
|
||||
SdlSelectWidget(SDL_Renderer* renderer, const std::string& label, const SDL_Rect& rect);
|
||||
SdlSelectWidget(SDL_Renderer* renderer, std::string label, SDL_Rect rect);
|
||||
SdlSelectWidget(SdlSelectWidget&& other) noexcept;
|
||||
~SdlSelectWidget() override = default;
|
||||
|
||||
@@ -39,7 +39,6 @@ class SdlSelectWidget : public SdlWidget
|
||||
private:
|
||||
SdlSelectWidget(const SdlSelectWidget& other) = delete;
|
||||
|
||||
private:
|
||||
std::string _text;
|
||||
bool _mouseover;
|
||||
bool _highlight;
|
||||
|
||||
@@ -21,20 +21,17 @@ class SdlSelectList
|
||||
SdlSelectList(const SdlSelectList& other) = delete;
|
||||
SdlSelectList(SdlSelectList&& other) = delete;
|
||||
|
||||
private:
|
||||
enum
|
||||
{
|
||||
INPUT_BUTTON_ACCEPT = 0,
|
||||
INPUT_BUTTON_CANCEL = -2
|
||||
};
|
||||
|
||||
private:
|
||||
ssize_t get_index(const SDL_MouseButtonEvent& button);
|
||||
bool update_text();
|
||||
void reset_mouseover();
|
||||
void reset_highlight();
|
||||
|
||||
private:
|
||||
SDL_Window* _window;
|
||||
SDL_Renderer* _renderer;
|
||||
std::vector<SdlSelectWidget> _list;
|
||||
|
||||
@@ -41,8 +41,7 @@ static const SDL_Color backgroundcolor = { 0x38, 0x36, 0x35, 0xff };
|
||||
|
||||
static const Uint32 hpadding = 10;
|
||||
|
||||
SdlWidget::SdlWidget(SDL_Renderer* renderer, const SDL_Rect& rect, bool input)
|
||||
: _rect(rect), _input(input)
|
||||
SdlWidget::SdlWidget(SDL_Renderer* renderer, SDL_Rect rect, bool input) : _rect(rect), _input(input)
|
||||
{
|
||||
assert(renderer);
|
||||
|
||||
@@ -59,7 +58,7 @@ SdlWidget::SdlWidget(SDL_Renderer* renderer, const SDL_Rect& rect, bool input)
|
||||
}
|
||||
|
||||
#if defined(WITH_SDL_IMAGE_DIALOGS)
|
||||
SdlWidget::SdlWidget(SDL_Renderer* renderer, const SDL_Rect& rect, SDL_RWops* ops) : _rect(rect)
|
||||
SdlWidget::SdlWidget(SDL_Renderer* renderer, SDL_Rect rect, SDL_RWops* ops) : _rect(rect)
|
||||
{
|
||||
if (ops)
|
||||
{
|
||||
@@ -71,8 +70,8 @@ SdlWidget::SdlWidget(SDL_Renderer* renderer, const SDL_Rect& rect, SDL_RWops* op
|
||||
#endif
|
||||
|
||||
SdlWidget::SdlWidget(SdlWidget&& other) noexcept
|
||||
: _font(std::move(other._font)), _image(other._image), _rect(std::move(other._rect)),
|
||||
_input(other._input), _wrap(other._wrap), _text_width(other._text_width)
|
||||
: _font(other._font), _image(other._image), _rect(other._rect), _input(other._input),
|
||||
_wrap(other._wrap), _text_width(other._text_width)
|
||||
{
|
||||
other._font = nullptr;
|
||||
other._image = nullptr;
|
||||
|
||||
@@ -48,9 +48,9 @@ typedef SSIZE_T ssize_t;
|
||||
class SdlWidget
|
||||
{
|
||||
public:
|
||||
SdlWidget(SDL_Renderer* renderer, const SDL_Rect& rect, bool input);
|
||||
SdlWidget(SDL_Renderer* renderer, SDL_Rect rect, bool input);
|
||||
#if defined(WITH_SDL_IMAGE_DIALOGS)
|
||||
SdlWidget(SDL_Renderer* renderer, const SDL_Rect& rect, SDL_RWops* ops);
|
||||
SdlWidget(SDL_Renderer* renderer, SDL_Rect rect, SDL_RWops* ops);
|
||||
#endif
|
||||
SdlWidget(SdlWidget&& other) noexcept;
|
||||
virtual ~SdlWidget();
|
||||
@@ -61,11 +61,10 @@ class SdlWidget
|
||||
bool update_text(SDL_Renderer* renderer, const std::string& text, SDL_Color fgcolor,
|
||||
SDL_Color bgcolor);
|
||||
|
||||
bool wrap() const;
|
||||
[[nodiscard]] bool wrap() const;
|
||||
bool set_wrap(bool wrap = true, size_t width = 0);
|
||||
const SDL_Rect& rect() const;
|
||||
[[nodiscard]] const SDL_Rect& rect() const;
|
||||
|
||||
public:
|
||||
#define widget_log_error(res, what) SdlWidget::error_ex(res, what, __FILE__, __LINE__, __func__)
|
||||
static bool error_ex(Uint32 res, const char* what, const char* file, size_t line,
|
||||
const char* fkt);
|
||||
@@ -78,7 +77,6 @@ class SdlWidget
|
||||
SDL_Texture* render_text_wrapped(SDL_Renderer* renderer, const std::string& text,
|
||||
SDL_Color fgcolor, SDL_Rect& src, SDL_Rect& dst);
|
||||
|
||||
private:
|
||||
TTF_Font* _font = nullptr;
|
||||
SDL_Texture* _image = nullptr;
|
||||
SDL_Rect _rect;
|
||||
|
||||
@@ -62,7 +62,7 @@ void sdl_OnChannelDisconnectedEventHandler(void* context, const ChannelDisconnec
|
||||
WINPR_ASSERT(sdl);
|
||||
WINPR_ASSERT(e);
|
||||
|
||||
// TODO: Set resizeable depending on disp channel and /dynamic-resolution
|
||||
// TODO(nin): Set resizeable depending on disp channel and /dynamic-resolution
|
||||
if (strcmp(e->name, RAIL_SVC_CHANNEL_NAME) == 0)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ class sdlDispContext
|
||||
BOOL uninit(DispClientContext* disp);
|
||||
|
||||
#if SDL_VERSION_ATLEAST(2, 0, 10)
|
||||
BOOL handle_display_event(const SDL_DisplayEvent* ev);
|
||||
static BOOL handle_display_event(const SDL_DisplayEvent* ev);
|
||||
#endif
|
||||
|
||||
BOOL handle_window_event(const SDL_WindowEvent* ev);
|
||||
@@ -54,14 +54,12 @@ class sdlDispContext
|
||||
|
||||
BOOL addTimer();
|
||||
|
||||
private:
|
||||
static UINT DisplayControlCaps(DispClientContext* disp, UINT32 maxNumMonitors,
|
||||
UINT32 maxMonitorAreaFactorA, UINT32 maxMonitorAreaFactorB);
|
||||
static void OnActivated(void* context, const ActivatedEventArgs* e);
|
||||
static void OnGraphicsReset(void* context, const GraphicsResetEventArgs* e);
|
||||
static Uint32 SDLCALL OnTimer(Uint32 interval, void* param);
|
||||
|
||||
private:
|
||||
SdlContext* _sdl = nullptr;
|
||||
DispClientContext* _disp = nullptr;
|
||||
int _eventBase = -1;
|
||||
|
||||
@@ -211,9 +211,9 @@ static const struct sdl_exit_code_map_t sdl_exit_code_map[] = {
|
||||
|
||||
static const struct sdl_exit_code_map_t* sdl_map_entry_by_code(int exit_code)
|
||||
{
|
||||
for (size_t x = 0; x < ARRAYSIZE(sdl_exit_code_map); x++)
|
||||
for (const auto& x : sdl_exit_code_map)
|
||||
{
|
||||
const struct sdl_exit_code_map_t* cur = &sdl_exit_code_map[x];
|
||||
const struct sdl_exit_code_map_t* cur = &x;
|
||||
if (cur->code == exit_code)
|
||||
return cur;
|
||||
}
|
||||
@@ -230,9 +230,9 @@ static void sdl_hide_connection_dialog(SdlContext* sdl)
|
||||
|
||||
static const struct sdl_exit_code_map_t* sdl_map_entry_by_error(DWORD error)
|
||||
{
|
||||
for (size_t x = 0; x < ARRAYSIZE(sdl_exit_code_map); x++)
|
||||
for (const auto& x : sdl_exit_code_map)
|
||||
{
|
||||
const struct sdl_exit_code_map_t* cur = &sdl_exit_code_map[x];
|
||||
const struct sdl_exit_code_map_t* cur = &x;
|
||||
if (cur->error == error)
|
||||
return cur;
|
||||
}
|
||||
@@ -335,7 +335,7 @@ class SdlEventUpdateTriggerGuard
|
||||
};
|
||||
|
||||
static bool sdl_draw_to_window_rect(SdlContext* sdl, SdlWindow& window, SDL_Surface* surface,
|
||||
SDL_Point offset, const SDL_Rect& srcRect)
|
||||
SDL_Point offset, SDL_Rect srcRect)
|
||||
{
|
||||
SDL_Rect dstRect = { offset.x + srcRect.x, offset.y + srcRect.y, srcRect.w, srcRect.h };
|
||||
return window.blit(surface, srcRect, dstRect);
|
||||
@@ -358,7 +358,7 @@ static bool sdl_draw_to_window_rect(SdlContext* sdl, SdlWindow& window, SDL_Surf
|
||||
}
|
||||
|
||||
static bool sdl_draw_to_window_scaled_rect(SdlContext* sdl, SdlWindow& window, SDL_Surface* surface,
|
||||
const SDL_Rect& srcRect)
|
||||
SDL_Rect srcRect)
|
||||
{
|
||||
SDL_Rect dstRect = srcRect;
|
||||
sdl_scale_coordinates(sdl, window.id(), &dstRect.x, &dstRect.y, FALSE, TRUE);
|
||||
@@ -1347,7 +1347,7 @@ terminate:
|
||||
/* Optional global initializer.
|
||||
* Here we just register a signal handler to print out stack traces
|
||||
* if available. */
|
||||
static BOOL sdl_client_global_init(void)
|
||||
static BOOL sdl_client_global_init()
|
||||
{
|
||||
#if defined(_WIN32)
|
||||
WSADATA wsaData = { 0 };
|
||||
@@ -1367,7 +1367,7 @@ static BOOL sdl_client_global_init(void)
|
||||
}
|
||||
|
||||
/* Optional global tear down */
|
||||
static void sdl_client_global_uninit(void)
|
||||
static void sdl_client_global_uninit()
|
||||
{
|
||||
#if defined(_WIN32)
|
||||
WSACleanup();
|
||||
|
||||
@@ -83,7 +83,6 @@ class SdlContext
|
||||
|
||||
std::atomic<bool> rdp_thread_running;
|
||||
|
||||
public:
|
||||
BOOL update_resizeable(BOOL enable);
|
||||
BOOL update_fullscreen(BOOL enter);
|
||||
|
||||
|
||||
@@ -30,13 +30,13 @@
|
||||
#include <freerdp/log.h>
|
||||
#define TAG CLIENT_TAG("SDL.kbd")
|
||||
|
||||
typedef struct
|
||||
using scancode_entry_t = struct
|
||||
{
|
||||
Uint32 sdl;
|
||||
const char* sdl_name;
|
||||
UINT32 rdp;
|
||||
const char* rdp_name;
|
||||
} scancode_entry_t;
|
||||
};
|
||||
|
||||
#define STR(x) #x
|
||||
#define ENTRY(x, y) \
|
||||
@@ -292,7 +292,7 @@ static const scancode_entry_t map[] = {
|
||||
#endif
|
||||
};
|
||||
|
||||
static UINT32 sdl_get_kbd_flags(void)
|
||||
static UINT32 sdl_get_kbd_flags()
|
||||
{
|
||||
UINT32 flags = 0;
|
||||
|
||||
@@ -623,9 +623,10 @@ BOOL sdlInput::mouse_grab(Uint32 windowID, SDL_bool enable)
|
||||
return it->second.grabMouse(enable);
|
||||
}
|
||||
|
||||
sdlInput::sdlInput(SdlContext* sdl) : _sdl(sdl), _lastWindowID(UINT32_MAX)
|
||||
sdlInput::sdlInput(SdlContext* sdl)
|
||||
: _sdl(sdl), _lastWindowID(UINT32_MAX), _hotkeyModmask(prefToMask())
|
||||
{
|
||||
_hotkeyModmask = prefToMask();
|
||||
|
||||
_hotkeyFullscreen = prefKeyValue("SDL_Fullscreen", SDL_SCANCODE_RETURN);
|
||||
_hotkeyResizable = prefKeyValue("SDL_Resizeable", SDL_SCANCODE_R);
|
||||
_hotkeyGrab = prefKeyValue("SDL_Grab", SDL_SCANCODE_G);
|
||||
|
||||
@@ -45,7 +45,6 @@ class sdlInput
|
||||
BOOL mouse_focus(Uint32 windowID);
|
||||
BOOL mouse_grab(Uint32 windowID, SDL_bool enable);
|
||||
|
||||
public:
|
||||
static BOOL keyboard_set_indicators(rdpContext* context, UINT16 led_flags);
|
||||
static BOOL keyboard_set_ime_status(rdpContext* context, UINT16 imeId, UINT32 imeState,
|
||||
UINT32 imeConvMode);
|
||||
@@ -61,7 +60,6 @@ class sdlInput
|
||||
uint32_t remapScancode(uint32_t scancode);
|
||||
void remapInitialize();
|
||||
|
||||
private:
|
||||
SdlContext* _sdl;
|
||||
Uint32 _lastWindowID;
|
||||
std::map<uint32_t, uint32_t> _remapList;
|
||||
|
||||
@@ -38,20 +38,20 @@
|
||||
#include "sdl_monitor.hpp"
|
||||
#include "sdl_freerdp.hpp"
|
||||
|
||||
typedef struct
|
||||
using MONITOR_INFO = struct
|
||||
{
|
||||
RECTANGLE_16 area;
|
||||
RECTANGLE_16 workarea;
|
||||
BOOL primary;
|
||||
} MONITOR_INFO;
|
||||
};
|
||||
|
||||
typedef struct
|
||||
using VIRTUAL_SCREEN = struct
|
||||
{
|
||||
int nmonitors;
|
||||
RECTANGLE_16 area;
|
||||
RECTANGLE_16 workarea;
|
||||
MONITOR_INFO* monitors;
|
||||
} VIRTUAL_SCREEN;
|
||||
};
|
||||
|
||||
/* See MSDN Section on Multiple Display Monitors: http://msdn.microsoft.com/en-us/library/dd145071
|
||||
*/
|
||||
@@ -292,7 +292,7 @@ static BOOL sdl_detect_single_window(SdlContext* sdl, UINT32* pMaxWidth, UINT32*
|
||||
if (freerdp_settings_get_uint32(settings, FreeRDP_NumMonitorIds) == 0)
|
||||
{
|
||||
const size_t id =
|
||||
(sdl->windows.size() > 0) ? sdl->windows.begin()->second.displayIndex() : 0;
|
||||
(!sdl->windows.empty()) ? sdl->windows.begin()->second.displayIndex() : 0;
|
||||
if (!freerdp_settings_set_pointer_len(settings, FreeRDP_MonitorIds, &id, 1))
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -30,14 +30,14 @@
|
||||
|
||||
#define TAG CLIENT_TAG("SDL.pointer")
|
||||
|
||||
typedef struct
|
||||
using sdlPointer = struct
|
||||
{
|
||||
rdpPointer pointer;
|
||||
SDL_Cursor* cursor;
|
||||
SDL_Surface* image;
|
||||
size_t size;
|
||||
void* data;
|
||||
} sdlPointer;
|
||||
};
|
||||
|
||||
static BOOL sdl_Pointer_New(rdpContext* context, rdpPointer* pointer)
|
||||
{
|
||||
|
||||
@@ -36,7 +36,7 @@ class CriticalSection
|
||||
void unlock();
|
||||
|
||||
private:
|
||||
CRITICAL_SECTION _section;
|
||||
CRITICAL_SECTION _section{};
|
||||
};
|
||||
|
||||
class WinPREvent
|
||||
|
||||
@@ -27,7 +27,7 @@ SdlWindow::SdlWindow(const std::string& title, Sint32 startupX, Sint32 startupY,
|
||||
{
|
||||
}
|
||||
|
||||
SdlWindow::SdlWindow(SdlWindow&& other)
|
||||
SdlWindow::SdlWindow(SdlWindow&& other) noexcept
|
||||
: _window(other._window), _offset_x(other._offset_x), _offset_y(other._offset_y)
|
||||
{
|
||||
other._window = nullptr;
|
||||
@@ -180,7 +180,7 @@ bool SdlWindow::fill(Uint8 r, Uint8 g, Uint8 b, Uint8 a)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SdlWindow::blit(SDL_Surface* surface, const SDL_Rect& srcRect, SDL_Rect& dstRect)
|
||||
bool SdlWindow::blit(SDL_Surface* surface, SDL_Rect srcRect, SDL_Rect& dstRect)
|
||||
{
|
||||
auto screen = SDL_GetWindowSurface(_window);
|
||||
if (!screen || !surface)
|
||||
|
||||
@@ -27,7 +27,7 @@ class SdlWindow
|
||||
public:
|
||||
SdlWindow(const std::string& title, Sint32 startupX, Sint32 startupY, Sint32 width,
|
||||
Sint32 height, Uint32 flags);
|
||||
SdlWindow(SdlWindow&& other);
|
||||
SdlWindow(SdlWindow&& other) noexcept;
|
||||
~SdlWindow();
|
||||
|
||||
[[nodiscard]] Uint32 id() const;
|
||||
@@ -49,7 +49,7 @@ class SdlWindow
|
||||
void fullscreen(bool use);
|
||||
|
||||
bool fill(Uint8 r = 0x00, Uint8 g = 0x00, Uint8 b = 0x00, Uint8 a = 0xff);
|
||||
bool blit(SDL_Surface* surface, const SDL_Rect& src, SDL_Rect& dst);
|
||||
bool blit(SDL_Surface* surface, SDL_Rect src, SDL_Rect& dst);
|
||||
void updateSurface();
|
||||
|
||||
private:
|
||||
@@ -57,6 +57,5 @@ class SdlWindow
|
||||
Sint32 _offset_x = 0;
|
||||
Sint32 _offset_y = 0;
|
||||
|
||||
private:
|
||||
SdlWindow(const SdlWindow& other) = delete;
|
||||
};
|
||||
|
||||
@@ -75,8 +75,8 @@ class SchemeHandler : public QWebEngineUrlSchemeHandler
|
||||
bool webview_impl_run(const std::string& title, const std::string& url, std::string& code)
|
||||
{
|
||||
int argc = 1;
|
||||
const auto vendor = QString::fromUtf8(FREERDP_VENDOR_STRING);
|
||||
const auto product = QString::fromUtf8(FREERDP_PRODUCT_STRING);
|
||||
const auto vendor = QLatin1String(FREERDP_VENDOR_STRING);
|
||||
const auto product = QLatin1String(FREERDP_PRODUCT_STRING);
|
||||
QWebEngineUrlScheme::registerScheme(QWebEngineUrlScheme("ms-appx-web"));
|
||||
|
||||
std::string wtitle = title;
|
||||
|
||||
@@ -27,12 +27,12 @@ namespace fs = std::experimental::filesystem;
|
||||
#error Could not find system header "<filesystem>" or "<experimental/filesystem>"
|
||||
#endif
|
||||
|
||||
const std::string SDLResourceManager::typeFonts()
|
||||
std::string SDLResourceManager::typeFonts()
|
||||
{
|
||||
return "fonts";
|
||||
}
|
||||
|
||||
const std::string SDLResourceManager::typeImages()
|
||||
std::string SDLResourceManager::typeImages()
|
||||
{
|
||||
return "images";
|
||||
}
|
||||
|
||||
@@ -33,8 +33,8 @@ class SDLResourceManager
|
||||
SDLResourceManager operator=(const SDLResourceManager& other) = delete;
|
||||
SDLResourceManager& operator=(SDLResourceManager&& other) = delete;
|
||||
|
||||
static const std::string typeFonts();
|
||||
static const std::string typeImages();
|
||||
static std::string typeFonts();
|
||||
static std::string typeImages();
|
||||
|
||||
protected:
|
||||
static void insert(const std::string& type, const std::string& id,
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include <fstream>
|
||||
#if __has_include(<filesystem>)
|
||||
#include <filesystem>
|
||||
#include <utility>
|
||||
namespace fs = std::filesystem;
|
||||
#elif __has_include(<experimental/filesystem>)
|
||||
#include <experimental/filesystem>
|
||||
@@ -102,7 +103,7 @@ std::vector<std::string> SdlPref::get_array(const std::string& key,
|
||||
return values;
|
||||
}
|
||||
|
||||
SdlPref::SdlPref(const std::string& file) : _name(file), _config(get())
|
||||
SdlPref::SdlPref(std::string file) : _name(std::move(file)), _config(get())
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ class SdlPref
|
||||
std::string _name;
|
||||
WINPR_JSONPtr _config;
|
||||
|
||||
SdlPref(const std::string& file);
|
||||
explicit SdlPref(std::string file);
|
||||
|
||||
WINPR_JSON* get_item(const std::string& key);
|
||||
WINPR_JSONPtr get();
|
||||
|
||||
@@ -5715,9 +5715,9 @@ static BOOL freerdp_client_load_static_channel_addin(rdpChannels* channels, rdpS
|
||||
const char* name, void* data)
|
||||
{
|
||||
PVIRTUALCHANNELENTRY entry = NULL;
|
||||
PVIRTUALCHANNELENTRYEX entryEx = NULL;
|
||||
entryEx = (PVIRTUALCHANNELENTRYEX)(void*)freerdp_load_channel_addin_entry(
|
||||
name, NULL, NULL, FREERDP_ADDIN_CHANNEL_STATIC | FREERDP_ADDIN_CHANNEL_ENTRYEX);
|
||||
PVIRTUALCHANNELENTRYEX entryEx =
|
||||
(PVIRTUALCHANNELENTRYEX)(void*)freerdp_load_channel_addin_entry(
|
||||
name, NULL, NULL, FREERDP_ADDIN_CHANNEL_STATIC | FREERDP_ADDIN_CHANNEL_ENTRYEX);
|
||||
|
||||
if (!entryEx)
|
||||
entry = freerdp_load_channel_addin_entry(name, NULL, NULL, FREERDP_ADDIN_CHANNEL_STATIC);
|
||||
|
||||
Reference in New Issue
Block a user