MythTV
master
mythtv
libs
libmythui
platforms
mythxdisplay.h
Go to the documentation of this file.
1
#ifndef MYTHXDISPLAY_X_
2
#define MYTHXDISPLAY_X_
3
4
// Qt
5
#include <QString>
6
#include <QRecursiveMutex>
7
#include <QSize>
8
9
// MythTV
10
#include "
libmythui/mythuiexp.h
"
11
12
// X11
13
#include <X11/Xlib.h>
14
15
class
MUI_PUBLIC
MythXDisplay
16
{
17
public
:
18
19
static
MythXDisplay
* OpenMythXDisplay(
bool
Warn =
true
);
20
static
void
SetQtX11Display (
const
QString &DisplayStr);
21
static
bool
DisplayIsRemote ();
22
23
MythXDisplay
() =
default
;
24
~
MythXDisplay
();
25
Display*
GetDisplay
() {
return
m_disp; }
26
QString
GetDisplayName
()
const
{
return
m_displayName; }
27
int
GetScreen
()
const
{
return
m_screenNum; }
28
void
Lock
() { m_lock.lock(); }
29
void
Unlock
() { m_lock.unlock(); }
30
int
GetDepth
()
const
{
return
m_depth; }
31
Window
GetRoot
()
const
{
return
m_root; }
32
bool
Open();
33
QSize GetDisplayDimensions();
34
void
Sync(
bool
Flush =
false
);
35
36
private
:
37
static
inline
QString
s_QtX11Display
;
38
39
Display* m_disp {
nullptr
};
40
int
m_screenNum { 0 };
41
Screen* m_screen {
nullptr
};
42
int
m_depth { 0 };
43
Window m_root { 0 };
44
QRecursiveMutex
m_lock
;
45
QString
m_displayName
;
46
};
47
48
// These X11 defines conflict with the QT key event enum values
49
#undef KeyPress
50
#undef KeyRelease
51
52
#endif
MythXDisplay::Lock
void Lock()
Definition:
mythxdisplay.h:28
MUI_PUBLIC
#define MUI_PUBLIC
Definition:
mythuiexp.h:9
MythXDisplay::GetDisplay
Display * GetDisplay()
Definition:
mythxdisplay.h:25
MythXDisplay::GetScreen
int GetScreen() const
Definition:
mythxdisplay.h:27
MythXDisplay::m_displayName
QString m_displayName
Definition:
mythxdisplay.h:45
MythXDisplay::GetDepth
int GetDepth() const
Definition:
mythxdisplay.h:30
MythXDisplay::GetDisplayName
QString GetDisplayName() const
Definition:
mythxdisplay.h:26
MythXDisplay::s_QtX11Display
static QString s_QtX11Display
Definition:
mythxdisplay.h:37
MythXDisplay::m_lock
QRecursiveMutex m_lock
Definition:
mythxdisplay.h:44
MythXDisplay::Unlock
void Unlock()
Definition:
mythxdisplay.h:29
MythXDisplay
Definition:
mythxdisplay.h:15
MythXDisplay::GetRoot
Window GetRoot() const
Definition:
mythxdisplay.h:31
mythuiexp.h
Generated on Tue Jan 7 2025 03:18:37 for MythTV by
1.8.17