MythTV master
Public Member Functions | Static Public Member Functions | Private Attributes | Static Private Attributes | List of all members
MythXDisplay Class Reference

#include <libmythui/platforms/mythxdisplay.h>

Collaboration diagram for MythXDisplay:
[legend]

Public Member Functions

 MythXDisplay ()=default
 
 ~MythXDisplay ()
 
Display * GetDisplay ()
 
int GetScreen () const
 
void Lock ()
 
void Unlock ()
 
Window GetRoot () const
 
bool Open ()
 Open the display. More...
 
void Sync (bool Flush=false)
 

Static Public Member Functions

static MythXDisplayOpenMythXDisplay (bool Warn=true)
 
static void SetQtX11Display (const QString &DisplayStr)
 
static bool DisplayIsRemote ()
 Determine if we are running a remote X11 session. More...
 

Private Attributes

Display * m_disp { nullptr }
 
int m_screenNum { 0 }
 
Window m_root { 0 }
 
QRecursiveMutex m_lock
 

Static Private Attributes

static QString s_QtX11Display
 

Detailed Description

Definition at line 14 of file mythxdisplay.h.

Constructor & Destructor Documentation

◆ MythXDisplay()

MythXDisplay::MythXDisplay ( )
default

Referenced by OpenMythXDisplay().

◆ ~MythXDisplay()

MythXDisplay::~MythXDisplay ( )

Definition at line 67 of file mythxdisplay.cpp.

Member Function Documentation

◆ DisplayIsRemote()

bool MythXDisplay::DisplayIsRemote ( )
static

Determine if we are running a remote X11 session.

Definition at line 43 of file mythxdisplay.cpp.

Referenced by MythRenderOpenGL::Create().

◆ GetDisplay()

Display * MythXDisplay::GetDisplay ( void  )
inline

◆ GetRoot()

Window MythXDisplay::GetRoot ( ) const
inline

Definition at line 28 of file mythxdisplay.h.

Referenced by MythDisplayX11::GetEDID().

◆ GetScreen()

int MythXDisplay::GetScreen ( ) const
inline

Definition at line 25 of file mythxdisplay.h.

Referenced by MythNVControl::GetDisplayID(), and MythVDPAUHelper::MythVDPAUHelper().

◆ Lock()

void MythXDisplay::Lock ( void  )
inline

Definition at line 26 of file mythxdisplay.h.

Referenced by MythVDPAUHelper::MythVDPAUHelper(), MythXLocker::MythXLocker(), and Sync().

◆ Open()

bool MythXDisplay::Open ( void  )

Open the display.

Note
If the '-display' command line argument is not set both this function and Qt's xcb platform plugin will pass a null string to XOpenDisplay - which will in turn use the DISPLAY environment variable to determince which X11 connection to open. If the '-display' command line argument is used, we set s_QtX11Display and the argument is also passed through to the xcb platform plugin by Qt (via the QApplication constructor). So in all cases, the following code should open the same display that is in use by Qt (and avoids linking to QX11Extras or including private Qt platform headers).

Definition at line 86 of file mythxdisplay.cpp.

Referenced by MythDisplayX11::IsAvailable().

◆ OpenMythXDisplay()

MythXDisplay * MythXDisplay::OpenMythXDisplay ( bool  Warn = true)
static

◆ SetQtX11Display()

void MythXDisplay::SetQtX11Display ( const QString &  DisplayStr)
static

Definition at line 37 of file mythxdisplay.cpp.

Referenced by MythDisplay::ConfigureQtGUI().

◆ Sync()

void MythXDisplay::Sync ( bool  Flush = false)

◆ Unlock()

void MythXDisplay::Unlock ( void  )
inline

Member Data Documentation

◆ m_disp

Display* MythXDisplay::m_disp { nullptr }
private

Definition at line 35 of file mythxdisplay.h.

Referenced by Open(), Sync(), and ~MythXDisplay().

◆ m_lock

QRecursiveMutex MythXDisplay::m_lock
private

Definition at line 38 of file mythxdisplay.h.

◆ m_root

Window MythXDisplay::m_root { 0 }
private

Definition at line 37 of file mythxdisplay.h.

Referenced by Open().

◆ m_screenNum

int MythXDisplay::m_screenNum { 0 }
private

Definition at line 36 of file mythxdisplay.h.

Referenced by Open().

◆ s_QtX11Display

QString MythXDisplay::s_QtX11Display
inlinestaticprivate

Definition at line 33 of file mythxdisplay.h.

Referenced by Open(), and SetQtX11Display().


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