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
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;
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
61 void setWindowState(Qt::WindowStates state) override;
62 void setWindowFlags(Qt::WindowFlags flags) override;
63
64 void setWindowTitle(const QString &title) override;
65
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
90QT_END_NAMESPACE
91
92#endif
void MessageReceived(BMessage *message) override
void wheelEvent(const QPoint &localPosition, const QPoint &globalPosition, int delta, Qt::Orientation orientation, Qt::KeyboardModifiers modifiers)
void drawRequest(const QRect &rect)
void MouseUp(BPoint pos) override
void Draw(BRect updateRect) override
void MouseMoved(BPoint pos, uint32 code, const BMessage *dragMessage) override
void KeyDown(const char *bytes, int32 numBytes) override
void MouseDown(BPoint pos) override
void keyEvent(QEvent::Type type, int key, Qt::KeyboardModifiers modifiers, const QString &text)
void KeyUp(const char *bytes, int32 numBytes) override
void enteredView()
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
BView * nativeViewHandle() const
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.
QMargins frameMargins() const override
void setWindowFlags(Qt::WindowFlags flags) override
Requests setting the window flags of this surface to flags.