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
qwldatadevicemanager_p.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:critical reason:network-protocol
4
5#ifndef WLDATADEVICEMANAGER_H
6#define WLDATADEVICEMANAGER_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtCore/QList>
20#include <QtCore/QMap>
21#include <QtGui/QClipboard>
22#include <QtCore/QMimeData>
23
24#include <QtWaylandCompositor/QWaylandCompositor>
25
26#include <QtWaylandCompositor/private/qwayland-server-wayland.h>
27#include <QtWaylandCompositor/private/qtwaylandcompositorglobal_p.h>
28
30
31QT_BEGIN_NAMESPACE
32
33class QSocketNotifier;
34
35namespace QtWayland {
36
37class DataDevice;
38class DataSource;
39
41{
43
44public:
46
49
50 struct wl_display *display() const;
51
52 void sourceDestroyed(DataSource *source);
53
54 void overrideSelection(const QMimeData &mimeData);
55 bool offerFromCompositorToClient(wl_resource *clientDataDeviceResource);
56 void offerRetainedSelection(wl_resource *clientDataDeviceResource);
57
58protected:
59 void data_device_manager_create_data_source(Resource *resource, uint32_t id) override;
60 void data_device_manager_get_data_device(Resource *resource, uint32_t id, struct ::wl_resource *seat) override;
61
62private Q_SLOTS:
63 void readFromClient(int fd);
64
65private:
66 void retain();
67 void finishReadFromClient(bool exhausted = false);
68
69 QWaylandCompositor *m_compositor = nullptr;
70 QList<DataDevice *> m_data_device_list;
71
72 DataSource *m_current_selection_source = nullptr;
73
74 QMimeData m_retainedData;
75 QSocketNotifier *m_retainedReadNotifier = nullptr;
76 QList<QSocketNotifier *> m_obsoleteRetainedReadNotifiers;
77 int m_retainedReadIndex = 0;
78 QByteArray m_retainedReadBuf;
79
80 bool m_compositorOwnsSelection = false;
81
82
83 static void comp_accept(struct wl_client *client,
84 struct wl_resource *resource,
85 uint32_t time,
86 const char *type);
87 static void comp_receive(struct wl_client *client,
88 struct wl_resource *resource,
89 const char *mime_type,
90 int32_t fd);
91 static void comp_destroy(struct wl_client *client,
92 struct wl_resource *resource);
93
94 static const struct wl_data_offer_interface compositor_offer_interface;
95};
96
97}
98
99QT_END_NAMESPACE
100
101#endif // WLDATADEVICEMANAGER_H
bool offerFromCompositorToClient(wl_resource *clientDataDeviceResource)
struct wl_display * display() const
void overrideSelection(const QMimeData &mimeData)
void sourceDestroyed(DataSource *source)
void offerRetainedSelection(wl_resource *clientDataDeviceResource)
void setCurrentSelectionSource(DataSource *source)
DataDevice(QWaylandSeat *seat)
void sourceDestroyed(DataSource *source)
void setFocus(QWaylandClient *client)
void data_offer_receive(Resource *resource, const QString &mime_type, int32_t fd) override
DataOffer(DataSource *data_source, QtWaylandServer::wl_data_device::Resource *target)
void data_offer_destroy_resource(Resource *resource) override
void data_offer_accept(Resource *resource, uint32_t serial, const QString &mime_type) override
void data_offer_destroy(Resource *resource) override
void send(const QString &mimeType, int fd)
uint32_t time() const
void setManager(DataDeviceManager *mgr)
void data_source_destroy_resource(Resource *resource) override
void data_source_offer(Resource *resource, const QString &mime_type) override
void setDevice(DataDevice *device)
void accept(const QString &mimeType)
void data_source_destroy(Resource *resource) override
QList< QString > mimeTypes() const
Combined button and popup list for selecting options.
QT_REQUIRE_CONFIG(animation)
QT_REQUIRE_CONFIG(wayland_datadevice)