Changeset View
Changeset View
Standalone View
Standalone View
events/x11/x11eventsplugin.cpp
- This file was copied from krfb/events.h.
1 | /* | 1 | /* This file is part of the KDE project | ||
---|---|---|---|---|---|
2 | This file is part of the KDE project | 2 | Copyright (C) 2016 Oleg Chernovskiy <kanedias@xaker.ru> | ||
3 | | ||||
4 | Copyright (C) 2010 Collabora Ltd. | | |||
5 | @author George Kiagiadakis <george.kiagiadakis@collabora.co.uk> | | |||
6 | Copyright (C) 2007 Alessandro Praduroux <pradu@pradu.it> | | |||
7 | Copyright (C) 2001-2003 by Tim Jansen <tim@tjansen.de> | | |||
8 | 3 | | |||
9 | This program is free software; you can redistribute it and/or | 4 | This program is free software; you can redistribute it and/or | ||
10 | modify it under the terms of the GNU General Public | 5 | modify it under the terms of the GNU General Public | ||
11 | License as published by the Free Software Foundation; either | 6 | License as published by the Free Software Foundation; either | ||
12 | version 2 of the License, or (at your option) any later version. | 7 | version 2 of the License, or (at your option) any later version. | ||
13 | 8 | | |||
14 | This program is distributed in the hope that it will be useful, | 9 | This program is distributed in the hope that it will be useful, | ||
15 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
17 | General Public License for more details. | 12 | General Public License for more details. | ||
18 | 13 | | |||
19 | You should have received a copy of the GNU General Public License | 14 | You should have received a copy of the GNU General Public License | ||
20 | along with this program; see the file COPYING. If not, write to | 15 | along with this program; see the file COPYING. If not, write to | ||
21 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 16 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
22 | Boston, MA 02110-1301, USA. | 17 | Boston, MA 02110-1301, USA. | ||
23 | */ | 18 | */ | ||
24 | 19 | | |||
25 | #ifndef EVENTS_H | 20 | #include "x11eventsplugin.h" | ||
26 | #define EVENTS_H | 21 | | ||
22 | #include "x11events.h" | ||||
27 | 23 | | |||
28 | #include "rfb.h" | 24 | #include <KPluginFactory> | ||
25 | #include <QX11Info> | ||||
29 | 26 | | |||
30 | class EventHandler | 27 | K_PLUGIN_FACTORY_WITH_JSON(X11EventsPluginFactory, "krfb_events_x11.json", | ||
28 | registerPlugin<X11EventsPlugin>();) | ||||
29 | | ||||
30 | X11EventsPlugin::X11EventsPlugin(QObject *parent, const QVariantList &args) | ||||
31 | : EventsPlugin(parent, args) | ||||
31 | { | 32 | { | ||
32 | public: | 33 | } | ||
33 | static void handleKeyboard(bool down, rfbKeySym key); | 34 | | ||
34 | static void handlePointer(int buttonMask, int x, int y); | 35 | EventHandler *X11EventsPlugin::eventHandler() | ||
35 | }; | 36 | { | ||
37 | // works only under X11 | ||||
38 | if(!QX11Info::isPlatformX11()) | ||||
39 | return nullptr; | ||||
40 | | ||||
41 | return new X11EventHandler(); | ||||
42 | } | ||||
43 | | ||||
44 | #include "x11eventsplugin.moc" | ||||
36 | 45 | | |||
37 | #endif | |