Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
CWinSystemWin32 Class Referenceabstract

#include <WinSystemWin32.h>

Inheritance diagram for CWinSystemWin32:
CWinSystemBase CWinSystemWin32DX

Public Member Functions

 CWinSystemWin32 ()
 
virtual ~CWinSystemWin32 ()
 
bool InitWindowSystem () override
 
bool DestroyWindowSystem () override
 
bool ResizeWindow (int newWidth, int newHeight, int newLeft, int newTop) override
 
void FinishWindowResize (int newWidth, int newHeight) override
 
void ForceFullScreen (const RESOLUTION_INFO &resInfo) override
 Forces the window to fullscreen provided the window resolution.
 
void UpdateResolutions () override
 
bool CenterWindow () override
 
virtual void NotifyAppFocusChange (bool bGaining) override
 
void ShowOSMouse (bool show) override
 
bool HasInertialGestures () override
 
bool Minimize () override
 
bool Restore () override
 
bool Hide () override
 
bool Show (bool raise=true) override
 
std::string GetClipboardText () override
 
bool UseLimitedColor () override
 
float GetGuiSdrPeakLuminance () const override
 Max luminance for GUI SDR content in HDR mode.
 
bool HasSystemSdrPeakLuminance () override
 Test support of the OS for a SDR max luminance in HDR mode setting.
 
std::unique_ptr< CVideoSyncGetVideoSync (CVideoReferenceClock *clock) override
 
bool SetFullScreen (bool fullScreen, RESOLUTION_INFO &res, bool blankOtherDisplays) override
 
std::vector< std::string > GetConnectedOutputs () override
 
HWND GetHwnd () const
 
bool IsAlteringWindow () const
 
void SetAlteringWindow (bool altering)
 
bool IsTogglingHDR () const
 
void SetTogglingHDR (bool toggling)
 
virtual bool DPIChanged (WORD dpi, RECT windowRect) const
 
bool IsMinimized () const
 
void SetMinimized (bool minimized)
 
void CacheSystemSdrPeakLuminance ()
 Cache the system HDR/SDR balance for use during rendering, instead of querying the API for each frame.
 
void SetSizeMoveMode (bool mode)
 
bool IsInSizeMoveMode () const
 
bool MessagePump () override
 
- Public Member Functions inherited from CWinSystemBase
 CWinSystemBase ()
 
virtual ~CWinSystemBase ()
 
virtual CRenderSystemBaseGetRenderSystem ()
 
virtual const std::string GetName ()
 
virtual bool DestroyWindow ()
 
virtual bool DisplayHardwareScalingEnabled ()
 
virtual void UpdateDisplayHardwareScaling (const RESOLUTION_INFO &resInfo)
 
virtual bool MoveWindow (int topLeft, int topRight)
 
virtual void FinishModeChange (RESOLUTION res)
 
virtual bool IsCreated ()
 
virtual void NotifyAppActiveChange (bool bActivated)
 
virtual bool HasCursor ()
 
virtual int NoOfBuffers ()
 
virtual float GetDisplayLatency ()
 Get average display latency.
 
virtual float GetFrameLatencyAdjustment ()
 Get time that should be subtracted from the display latency for this frame in milliseconds.
 
virtual void OnMove (int x, int y)
 
virtual unsigned int GetScreenId (const std::string &screen)
 Get the screen ID provided the screen name.
 
virtual void MoveToScreen (unsigned int screenIdx)
 Window was requested to move to the given screen.
 
virtual void OnChangeScreen (unsigned int screenIdx)
 Used to signal the windowing system about the change of the current screen.
 
KODI::WINDOWING::COSScreenSaverManagerGetOSScreenSaver ()
 Get OS screen saver inhibit implementation if available.
 
unsigned int GetWidth ()
 
unsigned int GetHeight ()
 
virtual bool CanDoWindowed ()
 
bool IsFullScreen ()
 
virtual bool SupportsScreenMove ()
 Check if the windowing system supports moving windows across screens.
 
void SetWindowResolution (int width, int height)
 
std::vector< RESOLUTION_WHRScreenResolutions (float refreshrate)
 
std::vector< REFRESHRATERefreshRates (int width, int height, uint32_t dwFlags)
 
REFRESHRATE DefaultRefreshRate (const std::vector< REFRESHRATE > &rates)
 
virtual bool HasCalibration (const RESOLUTION_INFO &resInfo)
 
void RegisterRenderLoop (IRenderLoop *client)
 
void UnregisterRenderLoop (IRenderLoop *client)
 
void DriveRenderLoop ()
 
virtual CGraphicContextGetGfxContext () const
 
virtual voidGetHWContext ()
 Get OS specific hardware context.
 
std::shared_ptr< CDPMSSupportGetDPMSManager ()
 
virtual bool SetHDR (const VideoPicture *videoPicture)
 Set the HDR metadata. Passing nullptr as the parameter should disable HDR.
 
virtual bool IsHDRDisplay ()
 
virtual HDR_STATUS ToggleHDR ()
 
virtual HDR_STATUS GetOSHDRStatus ()
 
virtual CHDRCapabilities GetDisplayHDRCapabilities () const
 
virtual bool SupportsVideoSuperResolution ()
 System supports Video Super Resolution HW upscaler i.e.: "NVIDIA RTX Video Super Resolution" or "Intel Video Super Resolution".
 
virtual DEBUG_INFO_RENDER GetDebugInfo ()
 Gets debug info from video renderer for use in "Debug Info OSD" (Alt + O)
 
bool IsHDRDisplaySettingEnabled ()
 Return true when HDR display is available and enabled in settings.
 
bool IsVideoSuperResolutionSettingEnabled ()
 Return true when "Video Super Resolution" is supported and enabled in settings.
 
bool IsHighPrecisionProcessingSettingEnabled ()
 Return true when setting "High Precision Processing" is enabled.
 
std::pair< bool, intGetDitherSettings ()
 Get dither settings.
 
virtual bool BindTextureUploadContext ()
 Binds a shared context to the current thread, in order to upload textures asynchronously.
 
virtual bool UnbindTextureUploadContext ()
 Unbinds the shared context.
 
virtual bool HasContext ()
 Checks if a graphics context is already bound to the current thread.
 

Protected Member Functions

bool CreateNewWindow (const std::string &name, bool fullScreen, RESOLUTION_INFO &res) override=0
 
virtual void UpdateStates (bool fullScreen)
 
WINDOW_STATE GetState (bool fullScreen) const
 
virtual void SetDeviceFullScreen (bool fullScreen, RESOLUTION_INFO &res)=0
 
virtual void ReleaseBackBuffer ()=0
 
virtual void CreateBackBuffer ()=0
 
virtual void ResizeDeviceBuffers ()=0
 
virtual bool IsStereoEnabled ()=0
 
virtual void OnScreenChange (HMONITOR monitor)=0
 
virtual void AdjustWindow (bool forceResize=false)
 
void CenterCursor () const
 
virtual void Register (IDispResource *resource)
 
virtual void Unregister (IDispResource *resource)
 
virtual bool ChangeResolution (const RESOLUTION_INFO &res, bool forceChange=false)
 
virtual bool CreateBlankWindows ()
 
virtual bool BlankNonActiveMonitors (bool bBlank)
 
MONITOR_DETAILSGetDisplayDetails (const std::string &name)
 
MONITOR_DETAILSGetDisplayDetails (HMONITOR handle)
 
void RestoreDesktopResolution (MONITOR_DETAILS *details)
 
RECT ScreenRect (HMONITOR handle)
 
void GetConnectedDisplays (std::vector< MONITOR_DETAILS > &outputs)
 
void OnDisplayLost ()
 
void OnDisplayReset ()
 
void OnDisplayBack ()
 
void ResolutionChanged ()
 
RECT GetScreenWorkArea (HMONITOR handle) const
 
RECT GetNcAreaOffsets (DWORD dwStyle, BOOL bMenu, DWORD dwExStyle) const
 
- Protected Member Functions inherited from CWinSystemBase
void UpdateDesktopResolution (RESOLUTION_INFO &newRes, const std::string &output, int width, int height, float refreshRate, uint32_t dwFlags)
 
void UpdateDesktopResolution (RESOLUTION_INFO &newRes, const std::string &output, int width, int height, int screenWidth, int screenHeight, float refreshRate, uint32_t dwFlags)
 
virtual std::unique_ptr< KODI::WINDOWING::IOSScreenSaverGetOSScreenSaverImpl ()
 

Static Protected Member Functions

static bool AddResolution (const RESOLUTION_INFO &res)
 Adds a resolution to the list of resolutions if we don't already have it.
 
static void SetForegroundWindowInternal (HWND hWnd)
 
static RECT GetVirtualScreenRect ()
 

Protected Attributes

HWND m_hWnd
 
HMONITOR m_hMonitor
 
std::vector< HWND > m_hBlankWindows
 
HINSTANCE m_hInstance
 
HICON m_hIcon
 
bool m_ValidWindowedPosition
 
bool m_IsAlteringWindow
 
bool m_IsTogglingHDR {false}
 
CCriticalSection m_resourceSection
 
std::vector< IDispResource * > m_resources
 
bool m_delayDispReset
 
XbmcThreads::EndTime m_dispResetTimer
 
WINDOW_STATE m_state
 
WINDOW_FULLSCREEN_STATE m_fullscreenState
 
WINDOW_WINDOW_STATE m_windowState
 
DWORD m_windowStyle
 
DWORD m_windowExStyle
 
bool m_inFocus
 
bool m_bMinimized
 
bool m_bSizeMoveEnabled = false
 
bool m_bFirstResChange = true
 
std::unique_ptr< CIRServerSuitem_irss
 
std::vector< MONITOR_DETAILSm_displays
 
NOTIFYICONDATA m_trayIcon = {}
 
bool m_validSystemSdrPeakLuminance {false}
 
float m_systemSdrPeakLuminance {.0f}
 
- Protected Attributes inherited from CWinSystemBase
int m_nWidth = 0
 
int m_nHeight = 0
 
int m_nTop = 0
 
int m_nLeft = 0
 
bool m_bWindowCreated = false
 
bool m_bFullScreen = false
 
bool m_bBlankOtherDisplay = false
 
float m_fRefreshRate = 0.0f
 
std::unique_ptr< KODI::WINDOWING::COSScreenSaverManagerm_screenSaverManager
 
CCriticalSection m_renderLoopSection
 
std::vector< IRenderLoop * > m_renderLoopClients
 
std::unique_ptr< IWinEventsm_winEvents
 
std::unique_ptr< CGraphicContextm_gfxContext
 
std::shared_ptr< CDPMSSupportm_dpms
 

Static Protected Attributes

static const char * SETTING_WINDOW_TOP = "window.top"
 
static const char * SETTING_WINDOW_LEFT = "window.left"
 

Additional Inherited Members

- Static Public Member Functions inherited from CWinSystemBase
static std::unique_ptr< CWinSystemBaseCreateWinSystem ()
 
- Static Public Attributes inherited from CWinSystemBase
static const char * SETTING_WINSYSTEM_IS_HDR_DISPLAY = "winsystem.ishdrdisplay"
 

Constructor & Destructor Documentation

◆ CWinSystemWin32()

CWinSystemWin32::CWinSystemWin32 ( )

◆ ~CWinSystemWin32()

CWinSystemWin32::~CWinSystemWin32 ( )
virtual

Member Function Documentation

◆ AddResolution()

bool CWinSystemWin32::AddResolution ( const RESOLUTION_INFO & res)
staticprotected

Adds a resolution to the list of resolutions if we don't already have it.

Parameters
resresolution to add.

◆ AdjustWindow()

void CWinSystemWin32::AdjustWindow ( bool forceResize = false)
protectedvirtual

◆ BlankNonActiveMonitors()

bool CWinSystemWin32::BlankNonActiveMonitors ( bool bBlank)
protectedvirtual

◆ CacheSystemSdrPeakLuminance()

void CWinSystemWin32::CacheSystemSdrPeakLuminance ( )

Cache the system HDR/SDR balance for use during rendering, instead of querying the API for each frame.

◆ CenterCursor()

void CWinSystemWin32::CenterCursor ( ) const
protected

◆ CenterWindow()

bool CWinSystemWin32::CenterWindow ( )
overridevirtual

Reimplemented from CWinSystemBase.

◆ ChangeResolution()

bool CWinSystemWin32::ChangeResolution ( const RESOLUTION_INFO & res,
bool forceChange = false )
protectedvirtual

Reimplemented in CWinSystemWin32DX.

◆ CreateBackBuffer()

virtual void CWinSystemWin32::CreateBackBuffer ( )
protectedpure virtual

Implemented in CWinSystemWin32DX.

◆ CreateBlankWindows()

bool CWinSystemWin32::CreateBlankWindows ( )
protectedvirtual

◆ CreateNewWindow()

bool CWinSystemWin32::CreateNewWindow ( const std::string & name,
bool fullScreen,
RESOLUTION_INFO & res )
overrideprotectedpure virtual

Implements CWinSystemBase.

Implemented in CWinSystemWin32DX.

◆ DestroyWindowSystem()

bool CWinSystemWin32::DestroyWindowSystem ( )
overridevirtual

Reimplemented from CWinSystemBase.

◆ DPIChanged()

bool CWinSystemWin32::DPIChanged ( WORD dpi,
RECT windowRect ) const
virtual

Reimplemented in CWinSystemWin32DX.

◆ FinishWindowResize()

void CWinSystemWin32::FinishWindowResize ( int newWidth,
int newHeight )
overridevirtual

Reimplemented from CWinSystemBase.

◆ ForceFullScreen()

void CWinSystemWin32::ForceFullScreen ( const RESOLUTION_INFO & resInfo)
overridevirtual

Forces the window to fullscreen provided the window resolution.

Parameters
resInfo- the resolution info

Reimplemented from CWinSystemBase.

◆ GetClipboardText()

std::string CWinSystemWin32::GetClipboardText ( void )
overridevirtual

Reimplemented from CWinSystemBase.

◆ GetConnectedDisplays()

void CWinSystemWin32::GetConnectedDisplays ( std::vector< MONITOR_DETAILS > & outputs)
protected

◆ GetConnectedOutputs()

std::vector< std::string > CWinSystemWin32::GetConnectedOutputs ( )
overridevirtual

Reimplemented from CWinSystemBase.

◆ GetDisplayDetails() [1/2]

MONITOR_DETAILS * CWinSystemWin32::GetDisplayDetails ( const std::string & name)
protected

◆ GetDisplayDetails() [2/2]

MONITOR_DETAILS * CWinSystemWin32::GetDisplayDetails ( HMONITOR handle)
protected

◆ GetGuiSdrPeakLuminance()

float CWinSystemWin32::GetGuiSdrPeakLuminance ( ) const
overridevirtual

Max luminance for GUI SDR content in HDR mode.

Returns
Max luminance in nits, lower than 10000.

Reimplemented from CWinSystemBase.

◆ GetHwnd()

HWND CWinSystemWin32::GetHwnd ( ) const
inline

◆ GetNcAreaOffsets()

RECT CWinSystemWin32::GetNcAreaOffsets ( DWORD dwStyle,
BOOL bMenu,
DWORD dwExStyle ) const
protected

Retrieve size of the title bar and borders Add to coordinates to convert client coordinates to window coordinates Substract from coordinates to convert from window coordinates to client coordinates

◆ GetScreenWorkArea()

RECT CWinSystemWin32::GetScreenWorkArea ( HMONITOR handle) const
protected

Retrieve the work area of the screen (exclude task bar and other occlusions)

◆ GetState()

WINDOW_STATE CWinSystemWin32::GetState ( bool fullScreen) const
protected

◆ GetVideoSync()

std::unique_ptr< CVideoSync > CWinSystemWin32::GetVideoSync ( CVideoReferenceClock * clock)
overridevirtual

Reimplemented from CWinSystemBase.

◆ GetVirtualScreenRect()

RECT CWinSystemWin32::GetVirtualScreenRect ( )
staticprotected

◆ HasInertialGestures()

bool CWinSystemWin32::HasInertialGestures ( )
inlineoverridevirtual

Reimplemented from CWinSystemBase.

◆ HasSystemSdrPeakLuminance()

bool CWinSystemWin32::HasSystemSdrPeakLuminance ( )
overridevirtual

Test support of the OS for a SDR max luminance in HDR mode setting.

Returns
true when the OS supports that setting, false otherwise

Reimplemented from CWinSystemBase.

◆ Hide()

bool CWinSystemWin32::Hide ( )
overridevirtual

Reimplemented from CWinSystemBase.

◆ InitWindowSystem()

bool CWinSystemWin32::InitWindowSystem ( )
overridevirtual

Reimplemented from CWinSystemBase.

◆ IsAlteringWindow()

bool CWinSystemWin32::IsAlteringWindow ( ) const
inline

◆ IsInSizeMoveMode()

bool CWinSystemWin32::IsInSizeMoveMode ( ) const
inline

◆ IsMinimized()

bool CWinSystemWin32::IsMinimized ( ) const
inline

◆ IsStereoEnabled()

virtual bool CWinSystemWin32::IsStereoEnabled ( )
protectedpure virtual

Implemented in CWinSystemWin32DX.

◆ IsTogglingHDR()

bool CWinSystemWin32::IsTogglingHDR ( ) const
inline

◆ MessagePump()

bool CWinSystemWin32::MessagePump ( )
overridevirtual

Reimplemented from CWinSystemBase.

◆ Minimize()

bool CWinSystemWin32::Minimize ( )
overridevirtual

Reimplemented from CWinSystemBase.

◆ NotifyAppFocusChange()

void CWinSystemWin32::NotifyAppFocusChange ( bool bGaining)
overridevirtual

Reimplemented from CWinSystemBase.

◆ OnDisplayBack()

void CWinSystemWin32::OnDisplayBack ( )
protected

◆ OnDisplayLost()

void CWinSystemWin32::OnDisplayLost ( )
protected

◆ OnDisplayReset()

void CWinSystemWin32::OnDisplayReset ( )
protected

◆ OnScreenChange()

virtual void CWinSystemWin32::OnScreenChange ( HMONITOR monitor)
protectedpure virtual

Implemented in CWinSystemWin32DX.

◆ Register()

void CWinSystemWin32::Register ( IDispResource * resource)
protectedvirtual

Implements CWinSystemBase.

Reimplemented in CWinSystemWin32DX.

◆ ReleaseBackBuffer()

virtual void CWinSystemWin32::ReleaseBackBuffer ( )
protectedpure virtual

Implemented in CWinSystemWin32DX.

◆ ResizeDeviceBuffers()

virtual void CWinSystemWin32::ResizeDeviceBuffers ( )
protectedpure virtual

Implemented in CWinSystemWin32DX.

◆ ResizeWindow()

bool CWinSystemWin32::ResizeWindow ( int newWidth,
int newHeight,
int newLeft,
int newTop )
overridevirtual

Implements CWinSystemBase.

Reimplemented in CWinSystemWin32DX.

◆ ResolutionChanged()

void CWinSystemWin32::ResolutionChanged ( )
protected

◆ Restore()

bool CWinSystemWin32::Restore ( )
overridevirtual

Reimplemented from CWinSystemBase.

◆ RestoreDesktopResolution()

void CWinSystemWin32::RestoreDesktopResolution ( MONITOR_DETAILS * details)
protected

◆ ScreenRect()

RECT CWinSystemWin32::ScreenRect ( HMONITOR handle)
protected

◆ SetAlteringWindow()

void CWinSystemWin32::SetAlteringWindow ( bool altering)
inline

◆ SetDeviceFullScreen()

virtual void CWinSystemWin32::SetDeviceFullScreen ( bool fullScreen,
RESOLUTION_INFO & res )
protectedpure virtual

Implemented in CWinSystemWin32DX.

◆ SetForegroundWindowInternal()

void CWinSystemWin32::SetForegroundWindowInternal ( HWND hWnd)
staticprotected

◆ SetFullScreen()

bool CWinSystemWin32::SetFullScreen ( bool fullScreen,
RESOLUTION_INFO & res,
bool blankOtherDisplays )
overridevirtual

Implements CWinSystemBase.

Reimplemented in CWinSystemWin32DX.

◆ SetMinimized()

void CWinSystemWin32::SetMinimized ( bool minimized)

◆ SetSizeMoveMode()

void CWinSystemWin32::SetSizeMoveMode ( bool mode)
inline

◆ SetTogglingHDR()

void CWinSystemWin32::SetTogglingHDR ( bool toggling)

◆ Show()

bool CWinSystemWin32::Show ( bool raise = true)
overridevirtual

Reimplemented from CWinSystemBase.

◆ ShowOSMouse()

void CWinSystemWin32::ShowOSMouse ( bool show)
overridevirtual

Reimplemented from CWinSystemBase.

◆ Unregister()

void CWinSystemWin32::Unregister ( IDispResource * resource)
protectedvirtual

Implements CWinSystemBase.

Reimplemented in CWinSystemWin32DX.

◆ UpdateResolutions()

void CWinSystemWin32::UpdateResolutions ( )
overridevirtual

Reimplemented from CWinSystemBase.

◆ UpdateStates()

void CWinSystemWin32::UpdateStates ( bool fullScreen)
protectedvirtual

◆ UseLimitedColor()

bool CWinSystemWin32::UseLimitedColor ( )
overridevirtual

Reimplemented from CWinSystemBase.

Member Data Documentation

◆ m_bFirstResChange

bool CWinSystemWin32::m_bFirstResChange = true
protected

◆ m_bMinimized

bool CWinSystemWin32::m_bMinimized
protected

◆ m_bSizeMoveEnabled

bool CWinSystemWin32::m_bSizeMoveEnabled = false
protected

◆ m_delayDispReset

bool CWinSystemWin32::m_delayDispReset
protected

◆ m_displays

std::vector<MONITOR_DETAILS> CWinSystemWin32::m_displays
protected

◆ m_dispResetTimer

XbmcThreads::EndTime CWinSystemWin32::m_dispResetTimer
protected

◆ m_fullscreenState

WINDOW_FULLSCREEN_STATE CWinSystemWin32::m_fullscreenState
protected

◆ m_hBlankWindows

std::vector<HWND> CWinSystemWin32::m_hBlankWindows
protected

◆ m_hIcon

HICON CWinSystemWin32::m_hIcon
protected

◆ m_hInstance

HINSTANCE CWinSystemWin32::m_hInstance
protected

◆ m_hMonitor

HMONITOR CWinSystemWin32::m_hMonitor
protected

◆ m_hWnd

HWND CWinSystemWin32::m_hWnd
protected

◆ m_inFocus

bool CWinSystemWin32::m_inFocus
protected

◆ m_irss

std::unique_ptr<CIRServerSuite> CWinSystemWin32::m_irss
protected

◆ m_IsAlteringWindow

bool CWinSystemWin32::m_IsAlteringWindow
protected

◆ m_IsTogglingHDR

bool CWinSystemWin32::m_IsTogglingHDR {false}
protected

◆ m_resources

std::vector<IDispResource*> CWinSystemWin32::m_resources
protected

◆ m_resourceSection

CCriticalSection CWinSystemWin32::m_resourceSection
protected

◆ m_state

WINDOW_STATE CWinSystemWin32::m_state
protected

◆ m_systemSdrPeakLuminance

float CWinSystemWin32::m_systemSdrPeakLuminance {.0f}
protected

◆ m_trayIcon

NOTIFYICONDATA CWinSystemWin32::m_trayIcon = {}
protected

◆ m_validSystemSdrPeakLuminance

bool CWinSystemWin32::m_validSystemSdrPeakLuminance {false}
protected

◆ m_ValidWindowedPosition

bool CWinSystemWin32::m_ValidWindowedPosition
protected

◆ m_windowExStyle

DWORD CWinSystemWin32::m_windowExStyle
protected

◆ m_windowState

WINDOW_WINDOW_STATE CWinSystemWin32::m_windowState
protected

◆ m_windowStyle

DWORD CWinSystemWin32::m_windowStyle
protected

◆ SETTING_WINDOW_LEFT

const char * CWinSystemWin32::SETTING_WINDOW_LEFT = "window.left"
staticprotected

◆ SETTING_WINDOW_TOP

const char * CWinSystemWin32::SETTING_WINDOW_TOP = "window.top"
staticprotected

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