MythTV  master
Public Member Functions | Static Public Member Functions | Private 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 (void)
 
QString GetDisplayName (void) const
 
int GetScreen (void) const
 
void Lock (void)
 
void Unlock (void)
 
int GetDepth (void) const
 
Window GetRoot (void) const
 
bool Open (void)
 Open the display. More...
 
QSize GetDisplayDimensions (void)
 Return the size of the X Display in millimeters. More...
 
void Sync (bool Flush=false)
 
void StartLog (void)
 
bool StopLog (void)
 

Static Public Member Functions

static MythXDisplayOpenMythXDisplay (bool Warn=true)
 
static void SetQtX11Display (const QString &Display)
 

Private Member Functions

bool CheckErrors (Display *Disp=nullptr)
 
void CheckOrphanedErrors (void)
 

Private Attributes

Display * m_disp { nullptr }
 
int m_screenNum { 0 }
 
Screen * m_screen { nullptr }
 
int m_depth { 0 }
 
Window m_root { 0 }
 
QMutex m_lock { QMutex::Recursive }
 
QString m_displayName { }
 

Static Private Attributes

static QString s_QtX11Display
 

Detailed Description

Definition at line 21 of file mythxdisplay.h.

Constructor & Destructor Documentation

◆ MythXDisplay()

MythXDisplay::MythXDisplay ( )
default

Referenced by OpenMythXDisplay().

◆ ~MythXDisplay()

MythXDisplay::~MythXDisplay ( )

Definition at line 61 of file mythxdisplay.cpp.

Member Function Documentation

◆ OpenMythXDisplay()

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

◆ SetQtX11Display()

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

Definition at line 56 of file mythxdisplay.cpp.

Referenced by MythDisplay::ConfigureQtGUI().

◆ GetDisplay()

Display* MythXDisplay::GetDisplay ( void  )
inline

◆ GetDisplayName()

QString MythXDisplay::GetDisplayName ( void  ) const
inline

Definition at line 31 of file mythxdisplay.h.

◆ GetScreen()

int MythXDisplay::GetScreen ( void  ) const
inline

Definition at line 32 of file mythxdisplay.h.

Referenced by MythVDPAUHelper::MythVDPAUHelper().

◆ Lock()

void MythXDisplay::Lock ( void  )
inline

Definition at line 33 of file mythxdisplay.h.

Referenced by MythXLocker::MythXLocker().

◆ Unlock()

void MythXDisplay::Unlock ( void  )
inline

Definition at line 34 of file mythxdisplay.h.

Referenced by MythXLocker::~MythXLocker().

◆ GetDepth()

int MythXDisplay::GetDepth ( void  ) const
inline

Definition at line 35 of file mythxdisplay.h.

◆ GetRoot()

Window MythXDisplay::GetRoot ( void  ) const
inline

◆ 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 84 of file mythxdisplay.cpp.

Referenced by MythDisplayX11::IsAvailable().

◆ GetDisplayDimensions()

QSize MythXDisplay::GetDisplayDimensions ( void  )

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 110 of file mythxdisplay.cpp.

◆ Sync()

void MythXDisplay::Sync ( bool  Flush = false)

◆ StartLog()

void MythXDisplay::StartLog ( void  )

Definition at line 123 of file mythxdisplay.cpp.

◆ StopLog()

bool MythXDisplay::StopLog ( void  )

Definition at line 132 of file mythxdisplay.cpp.

Referenced by ~MythXDisplay().

◆ CheckErrors()

bool MythXDisplay::CheckErrors ( Display *  Disp = nullptr)
private

Definition at line 144 of file mythxdisplay.cpp.

Referenced by CheckOrphanedErrors(), and StopLog().

◆ CheckOrphanedErrors()

void MythXDisplay::CheckOrphanedErrors ( void  )
private

Definition at line 179 of file mythxdisplay.cpp.

Referenced by CheckErrors().

Member Data Documentation

◆ s_QtX11Display

QString MythXDisplay::s_QtX11Display
staticprivate

Definition at line 47 of file mythxdisplay.h.

Referenced by Open(), and SetQtX11Display().

◆ m_disp

Display* MythXDisplay::m_disp { nullptr }
private

◆ m_screenNum

int MythXDisplay::m_screenNum { 0 }
private

Definition at line 50 of file mythxdisplay.h.

Referenced by GetDisplayDimensions(), and Open().

◆ m_screen

Screen* MythXDisplay::m_screen { nullptr }
private

Definition at line 51 of file mythxdisplay.h.

Referenced by Open().

◆ m_depth

int MythXDisplay::m_depth { 0 }
private

Definition at line 52 of file mythxdisplay.h.

Referenced by Open().

◆ m_root

Window MythXDisplay::m_root { 0 }
private

Definition at line 53 of file mythxdisplay.h.

Referenced by Open().

◆ m_lock

QMutex MythXDisplay::m_lock { QMutex::Recursive }
private

Definition at line 54 of file mythxdisplay.h.

◆ m_displayName

QString MythXDisplay::m_displayName { }
private

Definition at line 55 of file mythxdisplay.h.

Referenced by Open().


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