KWin
Loading...
Searching...
No Matches
textinput_v2_p.h
Go to the documentation of this file.
1/*
2 SPDX-FileCopyrightText: 2016 Martin Gräßlin <mgraesslin@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5*/
6#pragma once
7
8#include "clientconnection.h"
9#include "textinput_v2.h"
10
11#include <QList>
12#include <QPointer>
13#include <QRect>
14#include <QSet>
15
16#include <qwayland-server-text-input-unstable-v2.h>
17
18namespace KWin
19{
20class TextInputManagerV2InterfacePrivate : public QtWaylandServer::zwp_text_input_manager_v2
21{
22public:
24
26
27protected:
28 void zwp_text_input_manager_v2_destroy(Resource *resource) override;
29 void zwp_text_input_manager_v2_get_text_input(Resource *resource, uint32_t id, wl_resource *seat) override;
30};
31
32class TextInputV2InterfacePrivate : public QtWaylandServer::zwp_text_input_v2
33{
34public:
36
37 void sendEnter(SurfaceInterface *surface, quint32 serial);
38 void sendLeave(quint32 serial, SurfaceInterface *surface);
39 void preEdit(const QString &text, const QString &commit);
40 void preEditStyling(uint32_t index, uint32_t length, uint32_t style);
41 void commitString(const QString &text);
42 void deleteSurroundingText(quint32 beforeLength, quint32 afterLength);
43 void setTextDirection(Qt::LayoutDirection direction);
44 void setPreEditCursor(qint32 index);
45 void setCursorPosition(qint32 index, qint32 anchor);
46 void keysymPressed(quint32 keysym, quint32 modifiers);
47 void keysymReleased(quint32 keysym, quint32 modifiers);
49 void sendLanguage();
50 void sendModifiersMap();
51
52 QList<Resource *> textInputsForClient(ClientConnection *client) const;
54 {
55 return inputInterface->d.get();
56 }
57
62 SeatInterface *seat = nullptr;
63 QPointer<SurfaceInterface> surface;
67 bool inputPanelVisible = false;
69 QString language;
70 QByteArray modifiersMap;
72 QSet<SurfaceInterface *> m_enabledSurfaces;
73
74protected:
75 void zwp_text_input_v2_enable(Resource *resource, wl_resource *surface) override;
76 void zwp_text_input_v2_disable(Resource *resource, wl_resource *surface) override;
77 void zwp_text_input_v2_show_input_panel(Resource *resource) override;
78 void zwp_text_input_v2_hide_input_panel(Resource *resource) override;
79 void zwp_text_input_v2_set_surrounding_text(Resource *resource, const QString &text, int32_t cursor, int32_t anchor) override;
80 void zwp_text_input_v2_set_content_type(Resource *resource, uint32_t hint, uint32_t purpose) override;
81 void zwp_text_input_v2_set_cursor_rectangle(Resource *resource, int32_t x, int32_t y, int32_t width, int32_t height) override;
82 void zwp_text_input_v2_set_preferred_language(Resource *resource, const QString &language) override;
83 void zwp_text_input_v2_update_state(Resource *resource, uint32_t serial, uint32_t reason) override;
84};
85
86}
Convenient Class which represents a wl_client.
Class holding the Wayland server display loop.
Definition display.h:34
Represents a Seat on the Wayland Display.
Definition seat.h:134
Resource representing a wl_surface.
Definition surface.h:80
Represent the Global for the interface.
void zwp_text_input_manager_v2_destroy(Resource *resource) override
TextInputManagerV2InterfacePrivate(TextInputManagerV2Interface *_q, Display *display)
void zwp_text_input_manager_v2_get_text_input(Resource *resource, uint32_t id, wl_resource *seat) override
TextInputManagerV2Interface * q
Represents a generic Resource for a text input object.
void sendEnter(SurfaceInterface *surface, quint32 serial)
void zwp_text_input_v2_show_input_panel(Resource *resource) override
void keysymReleased(quint32 keysym, quint32 modifiers)
void zwp_text_input_v2_disable(Resource *resource, wl_resource *surface) override
QSet< SurfaceInterface * > m_enabledSurfaces
QPointer< SurfaceInterface > surface
void deleteSurroundingText(quint32 beforeLength, quint32 afterLength)
void preEditStyling(uint32_t index, uint32_t length, uint32_t style)
void setTextDirection(Qt::LayoutDirection direction)
void zwp_text_input_v2_set_cursor_rectangle(Resource *resource, int32_t x, int32_t y, int32_t width, int32_t height) override
void zwp_text_input_v2_enable(Resource *resource, wl_resource *surface) override
TextInputContentPurpose contentPurpose
void preEdit(const QString &text, const QString &commit)
void zwp_text_input_v2_set_preferred_language(Resource *resource, const QString &language) override
void zwp_text_input_v2_set_surrounding_text(Resource *resource, const QString &text, int32_t cursor, int32_t anchor) override
void zwp_text_input_v2_update_state(Resource *resource, uint32_t serial, uint32_t reason) override
static TextInputV2InterfacePrivate * get(TextInputV2Interface *inputInterface)
void sendLeave(quint32 serial, SurfaceInterface *surface)
void keysymPressed(quint32 keysym, quint32 modifiers)
void setCursorPosition(qint32 index, qint32 anchor)
TextInputV2InterfacePrivate(SeatInterface *seat, TextInputV2Interface *_q)
QList< Resource * > textInputsForClient(ClientConnection *client) const
void commitString(const QString &text)
void zwp_text_input_v2_set_content_type(Resource *resource, uint32_t hint, uint32_t purpose) override
TextInputContentHints contentHints
void zwp_text_input_v2_hide_input_panel(Resource *resource) override
TextInputContentPurpose
Definition textinput.h:72