FreeRDP
Loading...
Searching...
No Matches
SdlContext Class Reference
Collaboration diagram for SdlContext:

Public Member Functions

 SdlContext (rdpContext *context)
 
 SdlContext (const SdlContext &other)=delete
 
 SdlContext (SdlContext &&other)=delete
 
SdlContextoperator= (const SdlContext &other)=delete
 
SdlContextoperator= (SdlContext &&other)=delete
 
BOOL update_resizeable (BOOL enable)
 
BOOL update_fullscreen (BOOL enter)
 
BOOL update_minimize ()
 
rdpContext * context () const
 
rdpClientContext * common () const
 
 SdlContext (rdpContext *context)
 
 SdlContext (const SdlContext &other)=delete
 
 SdlContext (SdlContext &&other)=delete
 
SdlContextoperator= (const SdlContext &other)=delete
 
SdlContextoperator= (SdlContext &&other)=delete
 
BOOL update_resizeable (BOOL enable)
 
BOOL update_fullscreen (BOOL enter)
 
BOOL update_minimize ()
 
rdpContext * context () const
 
rdpClientContext * common () const
 

Data Fields

wLog * log
 
bool fullscreen = false
 
bool resizeable = false
 
bool grab_mouse = false
 
bool grab_kbd = false
 
bool grab_kbd_enabled = true
 
std::map< Uint32, SdlWindowwindows
 
CriticalSection critical
 
std::thread thread
 
WinPREvent initialize
 
WinPREvent initialized
 
WinPREvent update_complete
 
WinPREvent windows_created
 
int exit_code = -1
 
sdlDispContext disp
 
sdlInput input
 
SDLSurfacePtr primary
 
SDLPixelFormatPtr primary_format
 
Uint32 sdl_pixel_format = 0
 
std::unique_ptr< SDLConnectionDialogconnection_dialog
 
std::atomic< bool > rdp_thread_running
 
sdlClip clip
 
SDL_PixelFormat sdl_pixel_format = SDL_PIXELFORMAT_UNKNOWN
 

Detailed Description

Definition at line 46 of file SDL2/sdl_freerdp.hpp.

Constructor & Destructor Documentation

◆ SdlContext()

SdlContext::SdlContext ( rdpContext *  context)
explicit

Definition at line 1745 of file SDL2/sdl_freerdp.cpp.

1746 : _context(context), log(WLog_Get(SDL_TAG)), update_complete(true), disp(this), input(this),
1747 primary(nullptr, SDL_FreeSurface), primary_format(nullptr, SDL_FreeFormat),
1748 rdp_thread_running(false)
1749{
1750 WINPR_ASSERT(context);
1751 grab_kbd_enabled = freerdp_settings_get_bool(context->settings, FreeRDP_GrabKeyboard);
1752}
FREERDP_API BOOL freerdp_settings_get_bool(const rdpSettings *settings, FreeRDP_Settings_Keys_Bool id)
Returns a boolean settings value.

Member Function Documentation

◆ common()

rdpClientContext * SdlContext::common ( ) const

Definition at line 1759 of file SDL2/sdl_freerdp.cpp.

1760{
1761 return reinterpret_cast<rdpClientContext*>(_context);
1762}

◆ context()

rdpContext * SdlContext::context ( ) const

Definition at line 1754 of file SDL2/sdl_freerdp.cpp.

1755{
1756 return _context;
1757}

◆ update_fullscreen()

BOOL SdlContext::update_fullscreen ( BOOL  enter)

Definition at line 1708 of file SDL2/sdl_freerdp.cpp.

1709{
1710 std::lock_guard<CriticalSection> lock(critical);
1711 for (const auto& window : windows)
1712 {
1713 if (!sdl_push_user_event(SDL_USEREVENT_WINDOW_FULLSCREEN, &window.second, enter))
1714 return FALSE;
1715 }
1716 fullscreen = enter;
1717 return TRUE;
1718}

◆ update_minimize()

BOOL SdlContext::update_minimize ( )

Definition at line 1720 of file SDL2/sdl_freerdp.cpp.

1721{
1722 std::lock_guard<CriticalSection> lock(critical);
1723 return sdl_push_user_event(SDL_USEREVENT_WINDOW_MINIMIZE);
1724}

◆ update_resizeable()

BOOL SdlContext::update_resizeable ( BOOL  enable)

Definition at line 1726 of file SDL2/sdl_freerdp.cpp.

1727{
1728 std::lock_guard<CriticalSection> lock(critical);
1729
1730 const auto settings = context()->settings;
1731 const BOOL dyn = freerdp_settings_get_bool(settings, FreeRDP_DynamicResolutionUpdate);
1732 const BOOL smart = freerdp_settings_get_bool(settings, FreeRDP_SmartSizing);
1733 BOOL use = (dyn && enable) || smart;
1734
1735 for (const auto& window : windows)
1736 {
1737 if (!sdl_push_user_event(SDL_USEREVENT_WINDOW_RESIZEABLE, &window.second, use))
1738 return FALSE;
1739 }
1740 resizeable = use;
1741
1742 return TRUE;
1743}

Field Documentation

◆ clip

sdlClip SdlContext::clip

Definition at line 81 of file SDL3/sdl_freerdp.hpp.

◆ connection_dialog

std::unique_ptr< SDLConnectionDialog > SdlContext::connection_dialog

Definition at line 87 of file SDL2/sdl_freerdp.hpp.

◆ critical

CriticalSection SdlContext::critical

Definition at line 71 of file SDL2/sdl_freerdp.hpp.

◆ disp

sdlDispContext SdlContext::disp

Definition at line 79 of file SDL2/sdl_freerdp.hpp.

◆ exit_code

int SdlContext::exit_code = -1

Definition at line 77 of file SDL2/sdl_freerdp.hpp.

◆ fullscreen

bool SdlContext::fullscreen = false

Definition at line 63 of file SDL2/sdl_freerdp.hpp.

◆ grab_kbd

bool SdlContext::grab_kbd = false

Definition at line 66 of file SDL2/sdl_freerdp.hpp.

◆ grab_kbd_enabled

bool SdlContext::grab_kbd_enabled = true

Definition at line 67 of file SDL2/sdl_freerdp.hpp.

◆ grab_mouse

bool SdlContext::grab_mouse = false

Definition at line 65 of file SDL2/sdl_freerdp.hpp.

◆ initialize

WinPREvent SdlContext::initialize

Definition at line 73 of file SDL2/sdl_freerdp.hpp.

◆ initialized

WinPREvent SdlContext::initialized

Definition at line 74 of file SDL2/sdl_freerdp.hpp.

◆ input

sdlInput SdlContext::input

Definition at line 80 of file SDL2/sdl_freerdp.hpp.

◆ log

wLog * SdlContext::log

Definition at line 60 of file SDL2/sdl_freerdp.hpp.

◆ primary

SDLSurfacePtr SdlContext::primary

Definition at line 82 of file SDL2/sdl_freerdp.hpp.

◆ primary_format

SDLPixelFormatPtr SdlContext::primary_format

Definition at line 83 of file SDL2/sdl_freerdp.hpp.

◆ rdp_thread_running

std::atomic< bool > SdlContext::rdp_thread_running

Definition at line 89 of file SDL2/sdl_freerdp.hpp.

◆ resizeable

bool SdlContext::resizeable = false

Definition at line 64 of file SDL2/sdl_freerdp.hpp.

◆ sdl_pixel_format [1/2]

Uint32 SdlContext::sdl_pixel_format = 0

Definition at line 85 of file SDL2/sdl_freerdp.hpp.

◆ sdl_pixel_format [2/2]

SDL_PixelFormat SdlContext::sdl_pixel_format = SDL_PIXELFORMAT_UNKNOWN

Definition at line 85 of file SDL3/sdl_freerdp.hpp.

◆ thread

std::thread SdlContext::thread

Definition at line 72 of file SDL2/sdl_freerdp.hpp.

◆ update_complete

WinPREvent SdlContext::update_complete

Definition at line 75 of file SDL2/sdl_freerdp.hpp.

◆ windows

std::map< Uint32, SdlWindow > SdlContext::windows

Definition at line 69 of file SDL2/sdl_freerdp.hpp.

◆ windows_created

WinPREvent SdlContext::windows_created

Definition at line 76 of file SDL2/sdl_freerdp.hpp.


The documentation for this class was generated from the following files: