1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QPLATFORMNATIVEINTERFACE_H
5#define QPLATFORMNATIVEINTERFACE_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is part of the QPA API and is not meant to be used
12// in applications. Usage of this API may make your code
13// source and binary incompatible with future versions of Qt.
14//
15
16#include <QtGui/qtguiglobal.h>
17#include <QtGui/qwindowdefs.h>
18#include <QtCore/QObject>
19#include <QtCore/QVariant>
20
21QT_BEGIN_NAMESPACE
22
23
24class QOpenGLContext;
25class QScreen;
26class QWindow;
27class QPlatformWindow;
28class QBackingStore;
29
30class Q_GUI_EXPORT QPlatformNativeInterface : public QObject
31{
32 Q_OBJECT
33 Q_MOC_INCLUDE(<qpa/qplatformwindow.h>)
34public:
35 virtual void *nativeResourceForIntegration(const QByteArray &resource);
36 virtual void *nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context);
37 virtual void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen);
38 virtual void *nativeResourceForWindow(const QByteArray &resource, QWindow *window);
39 virtual void *nativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore);
40#ifndef QT_NO_CURSOR
41 virtual void *nativeResourceForCursor(const QByteArray &resource, const QCursor &cursor);
42#endif
43
44 typedef void * (*NativeResourceForIntegrationFunction)();
45 typedef void * (*NativeResourceForContextFunction)(QOpenGLContext *context);
46 typedef void * (*NativeResourceForScreenFunction)(QScreen *screen);
47 typedef void * (*NativeResourceForWindowFunction)(QWindow *window);
48 typedef void * (*NativeResourceForBackingStoreFunction)(QBackingStore *backingStore);
49 virtual NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource);
50 virtual NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource);
51 virtual NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource);
52 virtual NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource);
53 virtual NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource);
54
55 virtual QFunctionPointer platformFunction(const QByteArray &function) const;
56
57 virtual QVariantMap windowProperties(QPlatformWindow *window) const;
58 virtual QVariant windowProperty(QPlatformWindow *window, const QString &name) const;
59 virtual QVariant windowProperty(QPlatformWindow *window, const QString &name, const QVariant &defaultValue) const;
60 virtual void setWindowProperty(QPlatformWindow *window, const QString &name, const QVariant &value);
61
62Q_SIGNALS:
63 void windowPropertyChanged(QPlatformWindow *window, const QString &propertyName);
64};
65
66QT_END_NAMESPACE
67
68#endif // QPLATFORMNATIVEINTERFACE_H
69

source code of qtbase/src/gui/kernel/qplatformnativeinterface.h