Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qfbscreen_p.h
Go to the documentation of this file.
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 QFBSCREEN_P_H
5#define QFBSCREEN_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <qpa/qplatformscreen.h>
19#include <QtCore/QSize>
20#include "qfbcursor_p.h"
21
23
24class QFbWindow;
25class QFbCursor;
26class QPainter;
27class QFbBackingStore;
28
29class QFbScreen : public QObject, public QPlatformScreen
30{
32
33public:
37 Q_DECLARE_FLAGS(Flags, Flag)
38
39 QFbScreen();
40 ~QFbScreen();
41
42 virtual bool initialize();
43
44 QRect geometry() const override { return mGeometry; }
45 int depth() const override { return mDepth; }
46 QImage::Format format() const override { return mFormat; }
47 QSizeF physicalSize() const override { return mPhysicalSize; }
48 QPlatformCursor *cursor() const override { return mCursor; }
49
50 QWindow *topWindow() const;
51 QWindow *topLevelAt(const QPoint & p) const override;
52
53 // compositor api
54 virtual void addWindow(QFbWindow *window);
55 virtual void removeWindow(QFbWindow *window);
56 virtual void raise(QFbWindow *window);
57 virtual void lower(QFbWindow *window);
58 virtual void topWindowChanged(QWindow *) {}
59 virtual int windowCount() const;
60 virtual Flags flags() const;
61
62 void addPendingBackingStore(QFbBackingStore *bs) { mPendingBackingStores << bs; }
63
64 void scheduleUpdate();
65
66public slots:
67 virtual void setDirty(const QRect &rect);
68 void setPhysicalSize(const QSize &size);
69 void setGeometry(const QRect &rect);
70
71protected:
72 virtual QRegion doRedraw();
73
75 bool event(QEvent *event) override;
76
77 QFbWindow *windowForId(WId wid) const;
78
82
85 int mDepth;
89
90private:
91 QPainter *mPainter;
92 QList<QFbBackingStore*> mPendingBackingStores;
93
94 friend class QFbWindow;
95};
96
97Q_DECLARE_OPERATORS_FOR_FLAGS(QFbScreen::Flags)
98
99QT_END_NAMESPACE
100
101#endif // QFBSCREEN_P_H
void resize(const QSize &size, const QRegion &region) override
void flush(QWindow *window, const QRegion &region, const QPoint &offset) override
Flushes the given region from the specified window.
QImage toImage() const override
Implemented in subclasses to return the content of the backingstore as a QImage.
void endPaint() override
This function is called after painting onto the surface has ended.
void beginPaint(const QRegion &) override
This function is called before painting onto the surface begins, with the region in which the paintin...
const QImage image()
QPaintDevice * paintDevice() override
Implement this function to return the appropriate paint device.
QFbBackingStore(QWindow *window)
QImage mScreenImage
Definition qfbscreen_p.h:88
QSizeF physicalSize() const override
Reimplement this function in subclass to return the physical size of the screen, in millimeters.
Definition qfbscreen_p.h:47
QPlatformCursor * cursor() const override
Reimplement this function in subclass to return the cursor of the screen.
Definition qfbscreen_p.h:48
QFbWindow * windowForId(WId wid) const
virtual int windowCount() const
virtual Flags flags() const
QRect geometry() const override
Reimplement in subclass to return the pixel geometry of the screen.
Definition qfbscreen_p.h:44
QList< QFbWindow * > mWindowStack
Definition qfbscreen_p.h:79
virtual void topWindowChanged(QWindow *)
Definition qfbscreen_p.h:58
int depth() const override
Reimplement in subclass to return current depth of the screen.
Definition qfbscreen_p.h:45
QWindow * topLevelAt(const QPoint &p) const override
Return the given top level window for a given position.
QImage::Format format() const override
Reimplement in subclass to return the image format which corresponds to the screen format.
Definition qfbscreen_p.h:46
bool event(QEvent *event) override
This virtual function receives events to an object and should return true if the event e was recogniz...
Definition qfbscreen.cpp:38
virtual bool initialize()
virtual void lower(QFbWindow *window)
Definition qfbscreen.cpp:91
QRegion mRepaintRegion
Definition qfbscreen_p.h:80
QWindow * topWindow() const
void initializeCompositor()
Definition qfbscreen.cpp:32
void setGeometry(const QRect &rect)
virtual void raise(QFbWindow *window)
Definition qfbscreen.cpp:79
virtual QRegion doRedraw()
void setPhysicalSize(const QSize &size)
QFbCursor * mCursor
Definition qfbscreen_p.h:83
void addPendingBackingStore(QFbBackingStore *bs)
Definition qfbscreen_p.h:62
QRect mGeometry
Definition qfbscreen_p.h:84
QImage::Format mFormat
Definition qfbscreen_p.h:86
bool mUpdatePending
Definition qfbscreen_p.h:81
virtual void removeWindow(QFbWindow *window)
Definition qfbscreen.cpp:70
QSizeF mPhysicalSize
Definition qfbscreen_p.h:87
virtual void addWindow(QFbWindow *window)
Definition qfbscreen.cpp:48
void scheduleUpdate()
QFbWindow(QWindow *window)
Definition qfbwindow.cpp:14
QFbBackingStore * backingStore() const
Definition qfbwindow_p.h:45
Qt::WindowFlags windowFlags() const
Definition qfbwindow.cpp:85
QFbScreen * platformScreen() const
Definition qfbwindow.cpp:24
void setVisible(bool visible) override
Reimplemented in subclasses to show the surface if visible is true, and hide it if visible is false.
Definition qfbwindow.cpp:42
QRect mOldGeometry
Definition qfbwindow_p.h:59
virtual void repaint(const QRegion &)
void setBackingStore(QFbBackingStore *store)
Definition qfbwindow_p.h:44
Qt::WindowFlags mWindowFlags
Definition qfbwindow_p.h:60
bool setKeyboardGrabEnabled(bool) override
Definition qfbwindow_p.h:52
WId winId() const override
Reimplement in subclasses to return a handle to the native window.
Definition qfbwindow_p.h:42
void setGeometry(const QRect &rect) override
This function is called by Qt whenever a window is moved or resized using the QWindow API.
Definition qfbwindow.cpp:29
void propagateSizeHints() override
Reimplement to propagate the size hints of the QWindow.
Definition qfbwindow_p.h:51
Qt::WindowStates mWindowState
Definition qfbwindow_p.h:61
bool setMouseGrabEnabled(bool) override
Definition qfbwindow_p.h:53
QFbBackingStore * mBackingStore
Definition qfbwindow_p.h:58
void lower() override
Reimplement to be able to let Qt lower windows to the bottom of the desktop.
Definition qfbwindow.cpp:96
void raise() override
Reimplement to be able to let Qt raise windows to the top of the desktop.
Definition qfbwindow.cpp:90
void setWindowFlags(Qt::WindowFlags type) override
Requests setting the window flags of this surface to flags.
Definition qfbwindow.cpp:80
void setWindowState(Qt::WindowStates state) override
Requests setting the window state of this surface to type.
Definition qfbwindow.cpp:74
WId mWindowId
Definition qfbwindow_p.h:63
friend class QPainter