Commit graph

40 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
Albert Vaca Cintora
94903b6957 Actually fix the MacOS build 2023-07-31 23:04:08 +02:00
Alexander Lohnau
2e67f95017 Add explicit moc includes to cpp files
The rationale is explained in https://planet.kde.org/friedrich-kossebau-2023-06-28-include-also-moc-files-of-headers/

In case of KDEConnect, it impressively speeds up compilation. Before it
took 390 seconds on a clean build and with this change it took 330 seconds.
This is due to the mocs_compilation having to include the header files
and thus all their headers. Due to the lots of small plugins we have,
this means that the same headers must be compiled plenty of times.
When we include the moc files directly in the C++ file, they are already
available.
2023-07-30 07:27:45 +00:00
Albert Vaca Cintora
495e3019e4 Reduce number of optional dependencies
Change some optional dependencies from being optional to being mandatory
or being mandatory but behind on-by-default cmake flags. Eg: instead of
only compiling Wayland support if we find the appropriate libraries, we
always require the libraries unless the user specifies WITH_WAYLAND=OFF.

Optional libraries are hard to discover by packagers (since they don't
see an error once we add them) and create lots of possible build flavors
with a different features that can confuse users.
2023-07-19 17:08:03 +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
Weixuan Xiao
273c2e937a Just keep CMakeLists as it was
until Wayland supports macOS or Apple brings back X11
2019-07-21 22:49:07 +00:00
Nicolas Fella
5c16bfda5d Use K_PLUGIN_CLASS_WITH_JSON 2019-06-12 22:16:54 +02:00
Nicolas Fella
3b8fedea1a Replace http GNU urls with https 2019-03-23 17:29:26 +01:00
Nicolas Fella
48108cd316 Fix crashing devicetest
Summary:
When running the test m_impl will be nullptr leading to a crash. This is because when running as a test no platform is loaded.
The fancy way to solve this would be to have a TestImpl, but I think this is enough.

Test Plan: Test passes now

Reviewers: #kde_connect, apol

Reviewed By: #kde_connect, apol

Subscribers: kdeconnect, #kde_connect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D13629
2018-07-12 16:14:44 +02: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
6905234325 Fix Windows build 2018-04-09 18:23:54 +02:00
Albert Vaca
bda995b832 Make Qt X11Extras not a hard dependency
Should fix the CI build
2018-04-08 19:21:02 +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
Albert Vaca
60331ccbf1 Clazy says all this QStringLiteral and QLatin1String were missing/wrong 2016-11-26 16:21:29 +01:00
Albert Vaca
d6355ab0ce Detect left handed mouse configurations and swap faked buttons
BUG: 368953
2016-09-29 10:54:33 +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
David Edmundson
9ca9833e9c Handle strings and better utf8 in mousepad plugin 2015-09-08 10:27:41 +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
Albert Vaca Cintora
70e3aec278 Fixed potential array out of bounds crash 2015-04-04 10:17:08 -07:00
Aleix Pol
c7cee37330 Port away from KServiceTrader
Uses KPluginLoader+KPluginMetadata instead.
Describes plugins in json instead of desktop files. These desktop files are
then embedded into the .so file. All the plugins will be in a kdeconnect/
directory, and those will be the ones to look for.

Note it doesn't drop the KService dependency as KIOCore is a KDE Connect
dependency as well.

REVIEW: 123042
2015-03-19 16:36:53 +01:00
Albert Vaca
c7c1974ea9 Merge branch 'master' into frameworks
Conflicts:
	core/backends/lan/lanlinkprovider.cpp
	plugins/ping/pingplugin.h
	plugins/telephony/telephonyplugin.cpp
2015-01-10 20:14:01 -08:00
Albert Vaca
127a117c62 Added support for Ctrl, Alt and Shift combinations and F keys to keyboard. 2015-01-06 00:11:58 -08:00
Michael Hathaway
88a33ae242 Implemented drag'n drop in the mousepad plugin.
REVIEW: 121414
CCMAIL: michael@hathaways.me.uk
2014-12-10 23:40:28 -08: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
Albert Vaca
279dbe5598 Minor changes 2014-10-10 11:47:35 -07: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
Àlex Fiestas
677f650216 Removed K_EXPORT_PLUGIN, no longer needed
With kf5 this is not longer needed. removing it!
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
c32ff31516 Should not scroll if dy is 0 2014-06-29 17:52:07 +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