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
qwaylandpointer.h
Go to the documentation of this file.
1// Copyright (C) 2017 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QWAYLANDPOINTER_H
6#define QWAYLANDPOINTER_H
7
8#include <QtWaylandCompositor/QWaylandCompositorExtension>
9
10struct wl_resource;
11
12QT_BEGIN_NAMESPACE
13
14class QWaylandPointer;
15class QWaylandPointerPrivate;
16class QWaylandSeat;
17class QWaylandView;
18class QWaylandOutput;
19class QWaylandClient;
20
21class Q_WAYLANDCOMPOSITOR_EXPORT QWaylandPointer : public QWaylandObject
22{
23 Q_OBJECT
24 Q_DECLARE_PRIVATE(QWaylandPointer)
25 Q_PROPERTY(bool isButtonPressed READ isButtonPressed NOTIFY buttonPressedChanged)
26public:
27 QWaylandPointer(QWaylandSeat *seat, QObject *parent = nullptr);
28
29 QWaylandSeat *seat() const;
30 QWaylandCompositor *compositor() const;
31
32 QWaylandOutput *output() const;
33 void setOutput(QWaylandOutput *output);
34
35 virtual uint sendMousePressEvent(Qt::MouseButton button);
36 virtual uint sendMouseReleaseEvent(Qt::MouseButton button);
37 virtual void sendMouseMoveEvent(QWaylandView *view, const QPointF &localPos, const QPointF &outputSpacePos);
38 virtual void sendMouseWheelEvent(Qt::Orientation orientation, int delta);
39
40 QWaylandView *mouseFocus() const;
41 QPointF currentLocalPosition() const;
42 QPointF currentSpacePosition() const;
43
44 bool isButtonPressed() const;
45
46 virtual void addClient(QWaylandClient *client, uint32_t id, uint32_t version);
47
48 wl_resource *focusResource() const;
49
50 static uint32_t toWaylandButton(Qt::MouseButton button);
51 uint sendButton(struct wl_resource *resource, uint32_t time, Qt::MouseButton button, uint32_t state);
52Q_SIGNALS:
53 void outputChanged();
54 void buttonPressedChanged();
55
56private:
57 void enteredSurfaceDestroyed(void *data);
58 void pointerFocusChanged(QWaylandView *newFocus, QWaylandView *oldFocus);
59};
60
61QT_END_NAMESPACE
62
63#endif /*QWAYLANDPOINTER_H*/
\inmodule QtWaylandCompositor
Combined button and popup list for selecting options.