Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qwaylandtextinputmanagerv4.cpp
Go to the documentation of this file.
1// Copyright (C) 2021 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
6
7#include <QtWaylandCompositor/QWaylandCompositor>
8#include <QtWaylandCompositor/QWaylandSeat>
9
10#include "qwaylandtextinputv4.h"
11
13
15{
16}
17
18void QWaylandTextInputManagerV4Private::zwp_text_input_manager_v4_get_text_input(Resource *resource, uint32_t id, struct ::wl_resource *seatResource)
19{
20 qCDebug(qLcWaylandCompositorTextInput) << Q_FUNC_INFO;
21
23 QWaylandCompositor *compositor = static_cast<QWaylandCompositor *>(q->extensionContainer());
24 QWaylandSeat *seat = QWaylandSeat::fromSeatResource(seatResource);
26 if (!textInput) {
27 textInput = new QWaylandTextInputV4(seat, compositor);
28 }
29 textInput->add(resource->client(), id, wl_resource_get_version(resource->handle));
30 QWaylandClient *client = QWaylandClient::fromWlClient(compositor, resource->client());
31 QWaylandClient::TextInputProtocols p = client->textInputProtocols();
33 if (!textInput->isInitialized())
34 textInput->initialize();
35}
36
74{
75}
76
79{
80}
81
83{
84}
85
87{
88 qCDebug(qLcWaylandCompositorTextInput) << Q_FUNC_INFO;
89
91
94 if (!compositor) {
95 qWarning() << "Failed to find QWaylandCompositor when initializing QWaylandTextInputManagerV4";
96 return;
97 }
98 d->init(compositor->display(), 1);
99}
100
102{
103 return QWaylandTextInputManagerV4Private::interface();
104}
105
107{
108 return QWaylandTextInputManagerV4Private::interfaceName();
109}
110
\inmodule QtCore
Definition qbytearray.h:57
\qmltype WaylandClient \instantiates QWaylandClient \inqmlmodule QtWayland.Compositor
void setTextInputProtocols(TextInputProtocols p)
TextInputProtocols textInputProtocols() const
static QWaylandClient * fromWlClient(QWaylandCompositor *compositor, wl_client *wlClient)
Returns the QWaylandClient corresponding to the Wayland client wlClient and compositor.
static QWaylandTextInputV4 * findIn(QWaylandObject *container)
If any instance of the interface has been registered with container, this is returned.
virtual void initialize()
Initializes the QWaylandCompositorExtension.
\qmltype WaylandCompositor \instantiates QWaylandCompositor \inqmlmodule QtWayland....
\qmltype WaylandSeat \instantiates QWaylandSeat \inqmlmodule QtWayland.Compositor
static QWaylandSeat * fromSeatResource(struct ::wl_resource *resource)
Returns the QWaylandSeat corresponding to the resource.
void zwp_text_input_manager_v4_get_text_input(Resource *resource, uint32_t id, struct ::wl_resource *seatResource) override
Provides access to input methods in the compositor.
void initialize() override
Initializes the QWaylandCompositorExtension.
static const struct wl_interface * interface()
void add(::wl_client *client, uint32_t id, int version)
Combined button and popup list for selecting options.
#define Q_FUNC_INFO
#define qWarning
Definition qlogging.h:162
#define qCDebug(category,...)
static QOpenGLCompositor * compositor
GLdouble GLdouble GLdouble GLdouble q
Definition qopenglext.h:259
GLfloat GLfloat p
[1]