Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qhaikuwindow.h
Go to the documentation of this file.
1// Copyright (C) 2015 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Tobias Koenig <tobias.koenig@kdab.com>
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 QHAIKUWINDOW_H
5#define QHAIKUWINDOW_H
6
7#include <qpa/qplatformwindow.h>
8
9#include <Window.h>
10
12
13class HaikuWindowProxy : public QObject, public BWindow
14{
16
17public:
18 explicit HaikuWindowProxy(QWindow *window, const QRect &rect, QObject *parent = nullptr);
19
20 void FrameMoved(BPoint pos) override;
21 void FrameResized(float width, float height) override;
22 void WindowActivated(bool activated) override;
23 void Minimize(bool minimize) override;
24 void Zoom(BPoint pos, float width, float height) override;
25 bool QuitRequested() override;
26
27 void zoomByQt();
28
30 void moved(const QPoint &pos);
31 void resized(const QSize &size, bool zoomInProgress);
32 void windowActivated(bool activated);
33 void minimized(bool minimize);
34 void zoomed();
36
37private:
38 bool m_qtCalledZoom;
39 bool m_zoomInProgress;
40};
41
42class QHaikuWindow : public QObject, public QPlatformWindow
43{
45
46public:
47 explicit QHaikuWindow(QWindow *window);
48 virtual ~QHaikuWindow();
49
50 void setGeometry(const QRect &rect) override;
51 QMargins frameMargins() const override;
52 void setVisible(bool visible) override;
53
54 bool isExposed() const override;
55 bool isActive() const override;
56
57 WId winId() const override;
58 BWindow* nativeHandle() const;
59
60 void requestActivateWindow() override;
61 void setWindowState(Qt::WindowStates state) override;
62 void setWindowFlags(Qt::WindowFlags flags) override;
63
64 void setWindowTitle(const QString &title) override;
65
66 void propagateSizeHints() override;
67
68protected:
70
71private Q_SLOTS:
72 void haikuWindowMoved(const QPoint &pos);
73 void haikuWindowResized(const QSize &size, bool zoomInProgress);
74 void haikuWindowActivated(bool activated);
75 void haikuWindowMinimized(bool minimize);
76 void haikuWindowZoomed();
77 void haikuWindowQuitRequested();
78
79 void haikuMouseEvent(const QPoint &localPosition, const QPoint &globalPosition, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Qt::MouseEventSource source);
80 void haikuWheelEvent(const QPoint &localPosition, const QPoint &globalPosition, int delta, Qt::Orientation orientation, Qt::KeyboardModifiers modifiers);
81 void haikuKeyEvent(QEvent::Type type, int key, Qt::KeyboardModifiers modifiers, const QString &text);
82 void haikuEnteredView();
83 void haikuExitedView();
84 void haikuDrawRequest(const QRect &rect);
85
86private:
87 Qt::WindowStates m_windowState;
88};
89
91
92#endif
void minimized(bool minimize)
void windowActivated(bool activated)
bool QuitRequested() override
void Zoom(BPoint pos, float width, float height) override
void Minimize(bool minimize) override
void resized(const QSize &size, bool zoomInProgress)
void FrameMoved(BPoint pos) override
void WindowActivated(bool activated) override
void FrameResized(float width, float height) override
HaikuWindowProxy(QWindow *window, const QRect &rect, QObject *parent=nullptr)
void moved(const QPoint &pos)
Type
This enum type defines the valid event types in Qt.
Definition qcoreevent.h:51
void requestActivateWindow() override
Reimplement to let Qt be able to request activation/focus for a window.
bool isExposed() const override
Returns if this window is exposed in the windowing system.
void setVisible(bool visible) override
Reimplemented in subclasses to show the surface if visible is true, and hide it if visible is false.
BWindow * nativeHandle() const
void propagateSizeHints() override
Reimplement to propagate the size hints of the QWindow.
void setWindowTitle(const QString &title) override
Reimplement to set the window title to title.
virtual ~QHaikuWindow()
void setGeometry(const QRect &rect) override
This function is called by Qt whenever a window is moved or resized using the QWindow API.
void setWindowState(Qt::WindowStates state) override
Requests setting the window state of this surface to type.
HaikuWindowProxy * m_window
bool isActive() const override
Returns true if the window should appear active from a style perspective.
WId winId() const override
Reimplement in subclasses to return a handle to the native window.
QHaikuWindow(QWindow *window)
QMargins frameMargins() const override
void setWindowFlags(Qt::WindowFlags flags) override
Requests setting the window flags of this surface to flags.
\inmodule QtCore
Definition qmargins.h:24
\inmodule QtCore
Definition qobject.h:103
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:346
The QPlatformWindow class provides an abstraction for top-level windows.
QWindow * window() const
Returns the window which belongs to the QPlatformWindow.
\inmodule QtCore\reentrant
Definition qpoint.h:25
\inmodule QtCore\reentrant
Definition qrect.h:30
\inmodule QtCore
Definition qsize.h:25
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\inmodule QtGui
Definition qwindow.h:63
EGLImageKHR int int EGLuint64KHR * modifiers
QString text
rect
[4]
else opt state
[0]
Combined button and popup list for selecting options.
Orientation
Definition qnamespace.h:98
MouseEventSource
GLuint64 key
GLint GLsizei GLsizei height
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLint GLsizei width
GLenum type
GLbitfield flags
GLsizei GLsizei GLchar * source
#define Q_OBJECT
#define Q_SLOTS
#define Q_SIGNALS
QString title
[35]
aWidget window() -> setWindowTitle("New Window Title")
[2]