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
qwaylandtextinputmanager.cpp
Go to the documentation of this file.
1// Copyright (C) 2017-2016 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com
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 "qwaylandtextinput.h"
11
13
17
18void QWaylandTextInputManagerPrivate::zwp_text_input_manager_v2_get_text_input(Resource *resource, uint32_t id, struct ::wl_resource *seatResource)
19{
21 QWaylandCompositor *compositor = static_cast<QWaylandCompositor *>(q->extensionContainer());
22 QWaylandSeat *seat = QWaylandSeat::fromSeatResource(seatResource);
24 if (!textInput)
25 textInput = new QWaylandTextInput(seat, compositor);
26 textInput->add(resource->client(), id, wl_resource_get_version(resource->handle));
27 QWaylandClient *client = QWaylandClient::fromWlClient(compositor, resource->client());
28 QWaylandClient::TextInputProtocols p = client->textInputProtocols();
30 if (!textInput->isInitialized())
31 textInput->initialize();
32}
33
65
70
72{
74
77 if (!compositor) {
78 qWarning() << "Failed to find QWaylandCompositor when initializing QWaylandTextInputManager";
79 return;
80 }
81 d->init(compositor->display(), 1);
82}
83
85{
86 return QWaylandTextInputManagerPrivate::interface();
87}
88
90{
91 return QWaylandTextInputManagerPrivate::interfaceName();
92}
93
95
96#include "moc_qwaylandtextinputmanager.cpp"
\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 QWaylandTextInput * 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_v2_get_text_input(Resource *resource, uint32_t id, struct ::wl_resource *seatResource) override
\qmltype TextInputManager \instantiates QWaylandTextInputManager \inqmlmodule QtWayland....
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 qWarning
Definition qlogging.h:166
static QOpenGLCompositor * compositor
GLdouble GLdouble GLdouble GLdouble q
Definition qopenglext.h:259
GLfloat GLfloat p
[1]