Changeset View
Changeset View
Standalone View
Standalone View
xwl/clipboard.h
- This file was copied from xwl/xwayland.h.
Show All 11 Lines | |||||
12 | This program is distributed in the hope that it will be useful, | 12 | This program is distributed in the hope that it will be useful, | ||
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | GNU General Public License for more details. | 15 | GNU General Public License for more details. | ||
16 | 16 | | |||
17 | You should have received a copy of the GNU General Public License | 17 | You should have received a copy of the GNU General Public License | ||
18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
19 | *********************************************************************/ | 19 | *********************************************************************/ | ||
20 | #ifndef KWIN_XWL_XWAYLAND | 20 | #ifndef KWIN_XWL_CLIPBOARD | ||
21 | #define KWIN_XWL_XWAYLAND | 21 | #define KWIN_XWL_CLIPBOARD | ||
22 | 22 | | |||
23 | #include <QObject> | 23 | #include "selection.h" | ||
24 | 24 | | |||
25 | class QProcess; | 25 | namespace KWayland { | ||
26 | 26 | namespace Server { | |||
27 | class xcb_screen_t; | 27 | class DataDeviceInterface; | ||
28 | } | ||||
29 | } | ||||
28 | 30 | | |||
zzag: Please follow coding style. | |||||
29 | namespace KWin | 31 | namespace KWin | ||
30 | { | 32 | { | ||
31 | class ApplicationWaylandAbstract; | | |||
32 | | ||||
33 | namespace Xwl | 33 | namespace Xwl | ||
34 | { | 34 | { | ||
35 | 35 | | |||
36 | class Xwayland : public QObject | 36 | /* | ||
37 | * Represents the X clipboard, which is on Wayland side just called | ||||
38 | * @e selection. | ||||
39 | */ | ||||
40 | class Clipboard : public Selection | ||||
zzag: /** | |||||
37 | { | 41 | { | ||
38 | Q_OBJECT | 42 | Q_OBJECT | ||
39 | public: | 43 | public: | ||
40 | Xwayland(ApplicationWaylandAbstract *app, QObject *parent = nullptr); | 44 | explicit Clipboard(xcb_atom_t atom, QObject *parent); | ||
zzag: Why explicit? | |||||
41 | virtual ~Xwayland(); | | |||
42 | | ||||
43 | void init(); | | |||
44 | | ||||
45 | Q_SIGNALS: | | |||
46 | void criticalError(int code); | | |||
47 | 45 | | |||
48 | private: | 46 | private: | ||
49 | void createX11Connection(); | 47 | void doHandleXfixesNotify(xcb_xfixes_selection_notify_event_t *event) override; | ||
50 | void continueStartupWithX(); | 48 | void x11OffersChanged(const QVector<QString> &added, const QVector<QString> &removed) override; | ||
51 | 49 | /* | |||
52 | int m_xcbConnectionFd = -1; | 50 | * React to Wl selection change. | ||
53 | QProcess *m_xwaylandProcess = nullptr; | 51 | */ | ||
54 | QMetaObject::Connection m_xwaylandFailConnection; | 52 | void wlSelectionChanged(KWayland::Server::DataDeviceInterface *ddi); | ||
53 | /* | ||||
54 | * Check the current state of the selection and if a source needs | ||||
55 | * to be created or destroyed. | ||||
56 | */ | ||||
57 | void checkWlSource(); | ||||
55 | 58 | | |||
56 | ApplicationWaylandAbstract *m_app; | 59 | QMetaObject::Connection m_checkConnection; | ||
57 | }; | 60 | }; | ||
58 | 61 | | |||
59 | } | 62 | } | ||
60 | } | 63 | } | ||
61 | 64 | | |||
62 | #endif | 65 | #endif |
Please follow coding style.