kodi
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
CWinSystemBase Class Referenceabstract
Inheritance diagram for CWinSystemBase:
Inheritance graph
[legend]
Collaboration diagram for CWinSystemBase:
Collaboration graph
[legend]

Public Member Functions

virtual CRenderSystemBaseGetRenderSystem ()
 
virtual const std::string GetName ()
 
virtual bool InitWindowSystem ()
 
virtual bool DestroyWindowSystem ()
 
virtual bool CreateNewWindow (const std::string &name, bool fullScreen, RESOLUTION_INFO &res)=0
 
virtual bool DestroyWindow ()
 
virtual bool ResizeWindow (int newWidth, int newHeight, int newLeft, int newTop)=0
 
virtual bool SetFullScreen (bool fullScreen, RESOLUTION_INFO &res, bool blankOtherDisplays)=0
 
virtual bool DisplayHardwareScalingEnabled ()
 
virtual void UpdateDisplayHardwareScaling (const RESOLUTION_INFO &resInfo)
 
virtual bool MoveWindow (int topLeft, int topRight)
 
virtual void FinishModeChange (RESOLUTION res)
 
virtual void FinishWindowResize (int newWidth, int newHeight)
 
virtual bool CenterWindow ()
 
virtual bool IsCreated ()
 
virtual void NotifyAppFocusChange (bool bGaining)
 
virtual void NotifyAppActiveChange (bool bActivated)
 
virtual void ShowOSMouse (bool show)
 
virtual bool HasCursor ()
 
virtual bool HasInertialGestures ()
 
virtual bool UseLimitedColor ()
 
virtual int NoOfBuffers ()
 
virtual void ForceFullScreen (const RESOLUTION_INFO &resInfo)
 Forces the window to fullscreen provided the window resolution. More...
 
virtual float GetDisplayLatency ()
 Get average display latency. More...
 
virtual float GetFrameLatencyAdjustment ()
 Get time that should be subtracted from the display latency for this frame in milliseconds. More...
 
virtual bool Minimize ()
 
virtual bool Restore ()
 
virtual bool Hide ()
 
virtual bool Show (bool raise=true)
 
virtual std::unique_ptr< CVideoSyncGetVideoSync (CVideoReferenceClock *clock)
 
virtual void OnMove (int x, int y)
 
virtual unsigned int GetScreenId (const std::string &screen)
 Get the screen ID provided the screen name. More...
 
virtual void MoveToScreen (unsigned int screenIdx)
 Window was requested to move to the given screen. More...
 
virtual void OnChangeScreen (unsigned int screenIdx)
 Used to signal the windowing system about the change of the current screen. More...
 
KODI::WINDOWING::COSScreenSaverManagerGetOSScreenSaver ()
 Get OS screen saver inhibit implementation if available. More...
 
unsigned int GetWidth ()
 
unsigned int GetHeight ()
 
virtual bool CanDoWindowed ()
 
bool IsFullScreen ()
 
virtual bool SupportsScreenMove ()
 Check if the windowing system supports moving windows across screens. More...
 
virtual void UpdateResolutions ()
 
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)
 
virtual std::string GetClipboardText (void)
 
virtual void Register (IDispResource *resource)=0
 
virtual void Unregister (IDispResource *resource)=0
 
void RegisterRenderLoop (IRenderLoop *client)
 
void UnregisterRenderLoop (IRenderLoop *client)
 
void DriveRenderLoop ()
 
virtual bool MessagePump ()
 
virtual CGraphicContextGetGfxContext () const
 
virtual void * GetHWContext ()
 Get OS specific hardware context. More...
 
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 float GetGuiSdrPeakLuminance () const
 
virtual bool HasSystemSdrPeakLuminance ()
 
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)
 
virtual std::vector< std::string > GetConnectedOutputs ()
 
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, int > GetDitherSettings ()
 Get dither settings. More...
 

Static Public Member Functions

static std::unique_ptr< CWinSystemBaseCreateWinSystem ()
 

Static Public Attributes

static const char * SETTING_WINSYSTEM_IS_HDR_DISPLAY = "winsystem.ishdrdisplay"
 

Protected Member Functions

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 ()
 

Protected Attributes

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
 

Member Function Documentation

◆ ForceFullScreen()

virtual void CWinSystemBase::ForceFullScreen ( const RESOLUTION_INFO resInfo)
inlinevirtual

Forces the window to fullscreen provided the window resolution.

Parameters
resInfo- the resolution info

Reimplemented in CWinSystemWin32, and CWinSystemWin10.

◆ GetDisplayLatency()

virtual float CWinSystemBase::GetDisplayLatency ( )
inlinevirtual

Get average display latency.

The latency should be measured as the time between finishing the rendering of a frame, i.e. calling PresentRender, and the rendered content becoming visible on the screen.

Returns
average display latency in seconds, or negative value if unknown

Reimplemented in KODI::WINDOWING::WAYLAND::CWinSystemWayland.

◆ GetDitherSettings()

std::pair< bool, int > CWinSystemBase::GetDitherSettings ( )

Get dither settings.

Returns
std::pair containing dither enabled (bool) and dither depth (int)

◆ GetFrameLatencyAdjustment()

virtual float CWinSystemBase::GetFrameLatencyAdjustment ( )
inlinevirtual

Get time that should be subtracted from the display latency for this frame in milliseconds.

Contrary to GetDisplayLatency, this value is calculated ad-hoc for the frame currently being rendered and not a value that is calculated/ averaged from past frames and their presentation times

Reimplemented in KODI::WINDOWING::WAYLAND::CWinSystemWayland, KODI::WINDOWING::X11::CWinSystemX11GLContext, and CWinSystemAndroidGLESContext.

◆ GetHWContext()

virtual void* CWinSystemBase::GetHWContext ( )
inlinevirtual

Get OS specific hardware context.

Returns
OS specific context or nullptr if OS not have
Note
This function is currently only related to Windows with DirectX, all other OS where use GL returns nullptr. Returned Windows class pointer is ID3D11DeviceContext1.

Reimplemented in CWinSystemWin32DX, and CWinSystemWin10DX.

◆ GetOSScreenSaver()

KODI::WINDOWING::COSScreenSaverManager * CWinSystemBase::GetOSScreenSaver ( )

Get OS screen saver inhibit implementation if available.

Returns
OS screen saver implementation that can be used with this windowing system or nullptr if unsupported. Lifetime of the returned object will usually end with DestroyWindowSystem, so do not use any more after calling that.

◆ GetScreenId()

virtual unsigned int CWinSystemBase::GetScreenId ( const std::string &  screen)
inlinevirtual

Get the screen ID provided the screen name.

Parameters
screenthe name of the screen as presented on the application display settings
Returns
the screen index as known by the windowing system implementation (or the default screen by default)

Reimplemented in CWinSystemOSX.

◆ MoveToScreen()

virtual void CWinSystemBase::MoveToScreen ( unsigned int  screenIdx)
inlinevirtual

Window was requested to move to the given screen.

Parameters
screenIdxthe screen index as known by the windowing system implementation

Reimplemented in CWinSystemOSX.

◆ OnChangeScreen()

virtual void CWinSystemBase::OnChangeScreen ( unsigned int  screenIdx)
inlinevirtual

Used to signal the windowing system about the change of the current screen.

Parameters
screenIdxthe screen index as known by the windowing system implementation

Reimplemented in CWinSystemOSX.

◆ SupportsScreenMove()

virtual bool CWinSystemBase::SupportsScreenMove ( )
inlinevirtual

Check if the windowing system supports moving windows across screens.

Returns
true if the windowing system supports moving windows across screens, false otherwise

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