MythTV master
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
8// MythTV
10
11// X11
12#if defined(_X11_XLIB_H_) && !defined(Bool)
13#define Bool int
14#endif
15#include <X11/Xlib.h>
16#undef Bool // Interferes with moc file compilation
17
19{
20 public:
21
22 static MythXDisplay* OpenMythXDisplay(bool Warn = true);
23 static void SetQtX11Display (const QString &DisplayStr);
24 static bool DisplayIsRemote ();
25
26 MythXDisplay() = default;
28 Display* GetDisplay() { return m_disp; }
29 int GetScreen() const { return m_screenNum; }
30 void Lock() { m_lock.lock(); }
31 void Unlock() { m_lock.unlock(); }
32 Window GetRoot() const { return m_root; }
33 bool Open();
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 Window m_root { 0 };
42 QRecursiveMutex m_lock;
43};
44
45#endif
int GetScreen() const
Definition: mythxdisplay.h:29
Window GetRoot() const
Definition: mythxdisplay.h:32
MythXDisplay()=default
void Unlock()
Definition: mythxdisplay.h:31
QRecursiveMutex m_lock
Definition: mythxdisplay.h:42
static QString s_QtX11Display
Definition: mythxdisplay.h:37
Display * GetDisplay()
Definition: mythxdisplay.h:28
#define MUI_PUBLIC
Definition: mythuiexp.h:9