Commit graph

24 commits

Author SHA1 Message Date
Alexander Lohnau
1631ada5b3 Simplify KDEConnectPlugin::recievePacket
- We do not need the return type. If a plugin declares it can handle the
  packet it should do so. We don't have any fallback logic in place and
  the packet types are namespaced with the plugin IDs anyway.

- Provide a default implementation with a warning, not all plugins need
  to overwrite this
2023-08-03 20:49:44 +02:00
Alexander Lohnau
75a8db1ec5 Use pragma once in plugins
For non-library code, this is simpler and more concise
2023-07-22 20:51:19 +00:00
Nicolas Fella
a918ffc0cb Add and make use of ECM's clang-format integration 2022-09-11 23:21:58 +00:00
Nicolas Fella
87db95b22f Convert license headers to SPDX expressions 2020-08-17 09:48:10 +00:00
Nicolas Fella
3b8fedea1a Replace http GNU urls with https 2019-03-23 17:29:26 +01:00
Nicolas Fella
3c4aa590f1 Enable desktop2desktop keyboard input
Summary:
Fixes T6701

The reason it did not work before is that the "Keyboard" did not report itself as available.

Test Plan:
Type in plasmoid on one Desktop, see text on another.
Note that no ack packets are sent, so the text does not appear in the original input text field. I want to await the discussion in D12670 before doing that

Reviewers: apol

Reviewed By: apol

Subscribers: mtijink, kdeconnect

Tags: #kde_connect

Maniphest Tasks: T6701

Differential Revision: https://phabricator.kde.org/D12812
2018-05-12 17:52:07 +02:00
Albert Vaca
f1f19eb01b Split platform-specific code from mousepad plugin
Summary:
Windows no longer needs a separate plugin, and X11 and Wayland are now in
separate files instead of having lots of ifdefs.

Test Plan: Tested on X11, Wayland and Windows.

Reviewers: #kde_connect, apol, nicolasfella

Reviewed By: #kde_connect, apol, nicolasfella

Subscribers: apol, nicolasfella

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D11692
2018-04-04 22:38:16 +02:00
Albert Vaca
f47f517827 Rename NetworkPackage -> NetworkPacket
Summary: KDE Connect, now with correct naming!

Test Plan: It still builds.

Reviewers: #kde_connect, apol, nicolasfella

Reviewed By: #kde_connect, apol, nicolasfella

Subscribers: nicolasfella

Differential Revision: https://phabricator.kde.org/D11036
2018-03-05 20:03:23 +01:00
Jean Vincent
72535ecf48 Make member variable names, & placement and * placement more coherent
Summary:
Change all member variables to the form m_fooBar because it is the preferred form in Qt (it was half and half between this and mFooBar, and a minority didn't have anything).
Place all references and pointers on the side of the type since it is the majority.

Basically:
 - mFoo -> m_foo
 - foo -> m_foo (if it is a member variable)
 - Type &ref -> Type& ref
 - Type *ptr -> Type* ptr

Reviewers: #kde_connect, nicolasfella, albertvaka

Reviewed By: #kde_connect, nicolasfella, albertvaka

Subscribers: albertvaka, #kde_connect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D7312
2017-09-03 21:45:08 +02:00
Aleix Pol
596e4484f4 Clean up use of virtual and override keywords
Only use virtual when actually virtual, to override just use override.
2016-06-20 19:22:29 +02:00
Albert Vaca
73f5996f14 Consistent naming of _REQUEST package type macros 2016-06-03 00:47:03 +02:00
Aleix Pol
e7578cc129 Refactor capabilities together with Albert
He is committing a similar patch to kdeconnect-android
2016-05-31 17:16:01 +02:00
Aleix Pol
d58f6314fe run Clang Modernize
Minus the auto change
2015-09-08 10:47:37 +02:00
Martin Gräßlin
2506f0e78a [mousepad] Integrate with KWayland for fake input support
KWayland provides a FakeInput interface which KWin as a compositor
supports. This can be used to fake input events on Wayland. As it's
a KWin specific interface it won't work with other Wayland compositors.

If the compositor does not support the required interface, the
module just doesn't do anything. Support in the implementation is
completely optional.

Adding fake input events circumvents the Wayland security model.
Because of that the interface is designed in a way that the security
decision can be done by the compositor and can be delegated to the
user.

On first input event kdeconnect tries to "authenticate" with the
compositor. This gives the compositor the possibility to e.g. ask
the user whether it should be allowed. It's not done on startup or
of load module as that would show such a message way to early and
the user would not be able to connect it with his action on the
smartphone.

REVIEW: 124238
2015-07-09 10:48:00 +02:00
Martin Gräßlin
415412e15d [mousepad] Split X11 implementation into dedicated method 2015-07-09 10:48:00 +02:00
Martin Gräßlin
ab5438d338 [mousepad] Use QX11Info to get the Display
Don't open a second Display, we can use the one used by Qt.
Advantages are: we are on the correct Display, we don't open a Display
connection on e.g. Wayland (it would succeed but not work as a connection
to Xwayland would be opened) and we can drop the copy of fixx11h.

It's also a prerequisite to properly split the implementation to support
Wayland in a later change.

REVIEW: 124230
2015-07-03 09:43:01 +02:00
Aleix Pol
21ab5a4f81 Merge branch 'master' into frameworks
Mostly kDebug -> qCDebug
Also some KCmdLineArgs -> QCommandLineParser

Conflicts:
	cli/kdeconnect-cli.cpp
	core/CMakeLists.txt
	core/backends/lan/lanlinkprovider.cpp
	core/daemon.cpp
	core/pluginloader.cpp
	interfaces/CMakeLists.txt
	kio/kiokdeconnect.cpp
	plugins/mousepad/CMakeLists.txt
	plugins/mousepad/mousepadplugin.h
	plugins/mpriscontrol/mpriscontrolplugin.cpp
	plugins/sftp/sftpplugin.cpp
2014-11-04 19:12:29 +01:00
Àlex Fiestas
dbea3171bd Make kdeconnect core compile without KDELibs4Support
This meant to add a lot of dependencies to each plugin since we had
KDELibs4support as PUBLIC link meaning that anything linking against
kdeconnectcore was linking at the same time to mostly all frameworks.

Now each plugin has more or less its dependencies in the CMake some
still depend on KDELibs4Support.

For the mousepad plugin I needed to add a fixX11.h file that basically
undefines/defines again some stuff xlib has that conflcits with normal
C++ and Qt.

Before it was not conflicting because some lib within KDELibs4Support
was including this file, but now we have to do it ourselves.
2014-09-22 02:40:51 +02:00
Albert Vaca
ea5d9c8eca MousePad: Added support for any UTF character and more special keys.
I've also removed modifiers like Shift and Ctrl by now.

LibFakeKey is now a dependency of this plugin, as it allows us to send UTF
characters as X11 keys in a simple and convenient way. Internally it uses a
convention in Xlib, that allows to pass UTF characters as keycodes just by
adding 0x01000000 to the keycode number.

CCMAIL: saiarcot895@gmail.com
2014-08-14 21:35:23 +02:00
Saikrishna Arcot
05fdbe0e5b Add support for receiving keyboard entries.
This patch gets the keyboard entries from the Android client and passes
along the keycode.

REVIEW: 119254
2014-08-14 18:01:31 +02:00
Aleix Pol
a8fb015a22 Fix compilation after merge 2014-07-02 01:39:38 +02:00
Albert Vaca
9cba780f75 Added right and middle click, even though it's not implemented in Android yet
CCMAIL: ahmedibrahimkhali@gmail.com
2014-06-29 17:30:24 +02:00
Ahmed Ibrahim Khalil
178fcc128d Implemented scrolling, by sending scroll down or scroll up button events,
according to the difference value.

REVIEW: 119006
2014-06-29 17:22:31 +02:00
Ahmed Ibrahim Khalil
d14b4411cd Implementation of mousepad plugin
CCMAIL: ahmedibrahimkhali@gmail.com
2014-06-27 15:43:34 +02:00