-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathx11support.h
74 lines (64 loc) · 2.97 KB
/
x11support.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#ifndef X11SUPPORT_H
#define X11SUPPORT_H
#include <QtCore/QVector>
#include <QtCore/QMap>
#include <QtCore/QObject>
#include <QtGui/QIcon>
#include <QtGui/QPixmap>
class X11Support: public QObject
{
Q_OBJECT
public:
X11Support();
~X11Support();
void onX11Event(XEvent* event);
static X11Support* instance()
{
return m_instance;
}
static unsigned long rootWindow();
static unsigned long atom(const QString& name);
static void removeWindowProperty(unsigned long window, const QString& name);
static void setWindowPropertyCardinalArray(unsigned long window, const QString& name, const QVector<unsigned long>& values);
static void setWindowPropertyCardinal(unsigned long window, const QString& name, unsigned long value);
static void setWindowPropertyVisualId(unsigned long window, const QString& name, unsigned long value);
static unsigned long getWindowPropertyCardinal(unsigned long window, const QString& name);
static unsigned long getWindowPropertyWindow(unsigned long window, const QString& name);
static QVector<unsigned long> getWindowPropertyWindowsArray(unsigned long window, const QString& name);
static QVector<unsigned long> getWindowPropertyAtomsArray(unsigned long window, const QString& name);
static QString getWindowPropertyUTF8String(unsigned long window, const QString& name);
static QString getWindowPropertyLatin1String(unsigned long window, const QString& name);
static QString getWindowName(unsigned long window);
static QIcon getWindowIcon(unsigned long window);
static bool getWindowUrgency(unsigned long window);
static void registerForWindowPropertyChanges(unsigned long window);
static void registerForTrayIconUpdates(unsigned long window);
static void activateWindow(unsigned long window);
static void minimizeWindow(unsigned long window);
static void closeWindow(unsigned long window);
static void destroyWindow(unsigned long window);
static void killClient(unsigned long window);
static bool makeSystemTray(unsigned long window);
static void freeSystemTray();
static unsigned long getARGBVisualId();
static void redirectWindow(unsigned long window);
static void unredirectWindow(unsigned long window);
static QPixmap getWindowPixmap(unsigned long window);
static void resizeWindow(unsigned long window, int width, int height);
static void moveWindow(unsigned long window, int x, int y);
static void mapWindow(unsigned long window);
static void reparentWindow(unsigned long window, unsigned long parent);
static void setWindowBackgroundBlack(unsigned long window);
signals:
void windowClosed(unsigned long window);
void windowReconfigured(unsigned long window, int x, int y, int width, int height);
void windowDamaged(unsigned long window);
void windowPropertyChanged(unsigned long window, unsigned long atom);
void clientMessageReceived(unsigned long window, unsigned long atom, void* data);
private:
static unsigned long systemTrayAtom();
static X11Support* m_instance;
int m_damageEventBase;
QMap<QString, unsigned long> m_cachedAtoms;
};
#endif