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
qwaylandtextinputmanagerv3.cpp
Go to the documentation of this file.
1// Copyright (C) 2021 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
6
7#include <QtWaylandCompositor/QWaylandCompositor>
8#include <QtWaylandCompositor/QWaylandSeat>
9
10#include "qwaylandtextinputv3.h"
11
13
17
18void QWaylandTextInputManagerV3Private::zwp_text_input_manager_v3_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 QWaylandTextInputV3(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
76
81
85
87{
88 qCDebug(qLcWaylandCompositorTextInput) << Q_FUNC_INFO;
89
91
94 if (!compositor) {
95 qWarning() << "Failed to find QWaylandCompositor when initializing QWaylandTextInputManagerV3";
96 return;
97 }
98 d->init(compositor->display(), 1);
99}
100
102{
103 return QWaylandTextInputManagerV3Private::interface();
104}
105
107{
108 return QWaylandTextInputManagerV3Private::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 QWaylandTextInputV3 * 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_v3_get_text_input(Resource *resource, uint32_t id, struct ::wl_resource *seatResource) override
Provides access to input methods in the compositor.
static const struct wl_interface * interface()
void initialize() override
Initializes the QWaylandCompositorExtension.
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:166
#define qCDebug(category,...)
static QOpenGLCompositor * compositor
GLdouble GLdouble GLdouble GLdouble q
Definition qopenglext.h:259
GLfloat GLfloat p
[1]