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

#include <mythxdisplay.h>

Collaboration diagram for MythXDisplay:
Collaboration graph
[legend]

Public Member Functions

 MythXDisplay ()=default
 
 ~MythXDisplay ()
 
Display * GetDisplay ()
 
QString GetDisplayName () const
 
int GetScreen () const
 
void Lock ()
 
void Unlock ()
 
int GetDepth () const
 
Window GetRoot () const
 
bool Open ()
 Open the display. More...
 
QSize GetDisplayDimensions ()
 Return the size of the X Display in millimeters. 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 }
 
Screen * m_screen { nullptr }
 
int m_depth { 0 }
 
Window m_root { 0 }
 
QRecursiveMutex m_lock
 
QString m_displayName
 

Static Private Attributes

static QString s_QtX11Display
 

Detailed Description

Definition at line 15 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

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

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

◆ GetDisplayName()

QString MythXDisplay::GetDisplayName ( ) const
inline

Definition at line 26 of file mythxdisplay.h.

◆ GetScreen()

int MythXDisplay::GetScreen ( ) const
inline

Definition at line 27 of file mythxdisplay.h.

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

◆ Lock()

void MythXDisplay::Lock ( )
inline

Definition at line 28 of file mythxdisplay.h.

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

◆ Unlock()

void MythXDisplay::Unlock ( )
inline

◆ GetDepth()

int MythXDisplay::GetDepth ( ) const
inline

Definition at line 30 of file mythxdisplay.h.

◆ GetRoot()

Window MythXDisplay::GetRoot ( ) const
inline

Definition at line 31 of file mythxdisplay.h.

Referenced by MythDisplayX11::GetEDID().

◆ Open()

bool MythXDisplay::Open ( )

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

◆ GetDisplayDimensions()

QSize MythXDisplay::GetDisplayDimensions ( )

Return the size of the X Display in millimeters.

This corresponds to the size of the desktop, not necessarily to the size of single screen.

Definition at line 112 of file mythxdisplay.cpp.

◆ Sync()

void MythXDisplay::Sync ( bool  Flush = false)

Member Data Documentation

◆ s_QtX11Display

QString MythXDisplay::s_QtX11Display
inlinestaticprivate

Definition at line 37 of file mythxdisplay.h.

Referenced by Open(), and SetQtX11Display().

◆ m_disp

Display* MythXDisplay::m_disp { nullptr }
private

Definition at line 39 of file mythxdisplay.h.

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

◆ m_screenNum

int MythXDisplay::m_screenNum { 0 }
private

Definition at line 40 of file mythxdisplay.h.

Referenced by GetDisplayDimensions(), and Open().

◆ m_screen

Screen* MythXDisplay::m_screen { nullptr }
private

Definition at line 41 of file mythxdisplay.h.

Referenced by Open().

◆ m_depth

int MythXDisplay::m_depth { 0 }
private

Definition at line 42 of file mythxdisplay.h.

Referenced by Open().

◆ m_root

Window MythXDisplay::m_root { 0 }
private

Definition at line 43 of file mythxdisplay.h.

Referenced by Open().

◆ m_lock

QRecursiveMutex MythXDisplay::m_lock
private

Definition at line 44 of file mythxdisplay.h.

◆ m_displayName

QString MythXDisplay::m_displayName
private

Definition at line 45 of file mythxdisplay.h.

Referenced by Open().


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