-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplatform.hxx
44 lines (34 loc) · 963 Bytes
/
platform.hxx
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
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
#ifndef PLATFORM_HXX
#define PLATFORM_HXX
#include <QObject>
#include <QImage>
#include <QPixmap>
#include <QGuiApplication>
#include <QDebug>
struct OpenWindow {
public:
QRect geometry;
QString name;
};
QDebug operator<<(QDebug, const OpenWindow &);
class Platform : public QObject {
Q_OBJECT
Q_DISABLE_COPY(Platform)
public:
Platform();
static void init();
template <class T>
static T* nativeObject() {
auto *guiApp = qobject_cast<QGuiApplication*>(QGuiApplication::instance());
return guiApp->nativeInterface<T>();
}
virtual QImage getCursorImage();
virtual QList<OpenWindow> getOpenWindows();
virtual QPixmap getScreenshot(QRect geometry);
virtual void waylandFullscreen();
};
extern Platform *platform;
#endif // PLATFORM_HXX