Commit graph

944 commits

Author SHA1 Message Date
Martin Gräßlin
809519f058 Add support for Modes in Output 2014-09-23 15:56:13 +02:00
Martin Gräßlin
eb9e5a178f Switch all auto tests to QTEST_GUILESS_MAIN
We don't need a QGuiApplication in the tests.
2014-09-23 12:00:17 +02:00
Martin Gräßlin
f72e4a4d6f Add a Client::EventQueue
The EventQueue is a wrapper for wl_event_queue. The usage is for the
case that the connection is in a different thread.

The EventQueue needs to be added to the Registry before Registry::create
is invoked. This ensures that the Registry gets added to the EventQueue
and all objects created by the Registry (and further down the tree)
will be added to the same EventQueue.

The auto-tests which already used a wl_event_queue are transited to the
EventQueue class. That's also the reason why there is no dedicated
unit test: the new code is sufficiently tested by the existing tests.
2014-09-23 11:55:07 +02:00
Martin Gräßlin
53b9b5b9b2 Add ::destroy to Client::Keyboard and Client::Pointer
This makes the API more consistent and allows to properly cleanup
Keyboard and Pointer if the connection dies. Like with Shell and
ShellSurface signals are emitted from Seat when the interface is
going to be released or destroyed. These are connected to the
methods of the created Pointer and Keyboard.
2014-09-22 13:12:08 +02:00
Martin Gräßlin
6ea3abc56d Add test case for Seat::destroy 2014-09-22 12:02:57 +02:00
Martin Gräßlin
ff9c6ea23d Add test case for operator cast in Client::Seat 2014-09-22 11:56:48 +02:00
Martin Gräßlin
d267cdca02 Add test case for operator cast in Client::Shell
One test also adjusted to get the operator cast in ShellSurface under
coverage.
2014-09-22 11:41:34 +02:00
Martin Gräßlin
bf1168db23 Add test case for ShellSurface::destroy 2014-09-22 11:33:13 +02:00
Martin Gräßlin
44a51fef8b Add test case for Surface::destroy 2014-09-22 11:14:05 +02:00
Martin Gräßlin
610e8ce484 Add test case for Registry::destroy 2014-09-22 11:08:14 +02:00
Martin Gräßlin
ca3b8b0cec Add test case for operator cast in Compositor 2014-09-22 11:03:46 +02:00
Martin Gräßlin
ebac7d3c03 Verify that Pointer isValid in the autotest 2014-09-22 11:02:16 +02:00
Martin Gräßlin
ba9270a887 Pass parent to Client::Keyboard in TestWaylandSeat
This ensures that the Keyboard doesn't leak in the test.
2014-09-22 11:00:02 +02:00
Martin Gräßlin
acb08e276d Add unit test for Client::Compositor::destroy 2014-09-22 10:24:21 +02:00
Martin Gräßlin
6f2d49e680 ShmPool returns QWeakPointer<Buffer> instead of Buffer*
The Buffers are exclusively hold by ShmPool. The user of a Buffer is not
supposed to delete it as a no longer used Buffer should be reused by the
ShmPool.

To make it obvious that the ownership of the pointer is not passed to the
user the return type is changed to QWeakPointer. This also allows the
ShmPool to destroy Buffers as needed.
2014-09-22 09:54:10 +02:00
Martin Gräßlin
aa26a42432 Do not include wayland-client-protocol.h in test_shm_pool.cpp
This should fix the build on CI system.
2014-09-22 09:01:24 +02:00
Martin Gräßlin
6394b6cd8c Add unit test for ShmPool
The unit test found a few problems which are now addressed
* getBuffer did not check the format when reusing a buffer
* creatBuffer used the wrong method on QSize to check whether it is empty
* destroy didn't call destroy on the Buffer. This is now added by moving
  the Buffer::Private in a dedicated header which can also be included
  from the ShmPool
2014-09-22 08:52:05 +02:00
Pier Luigi Fiorini
d8e4f5edf9 Add Review Board configuration 2014-09-21 11:33:11 +02:00
Martin Gräßlin
9ae04f2100 Extend test_wayland_surface to test frame rendered callback 2014-09-20 16:28:47 +02:00
Martin Gräßlin
c14bbe9c53 Change Client::ShmPool to return Client::Buffer* instead of wl_buffer* 2014-09-20 15:11:40 +02:00
Martin Gräßlin
e33c005118 Add support for Formats to Buffer and ShmPool
So far only ARGB32 and RGB32 are supported. The format is an optional
argument to all the createBuffer and getBuffer calls with a default
for ARGB32.
2014-09-19 14:53:03 +02:00
Martin Gräßlin
2bef3d08ef Check maximum supported version in Client::Registry
Ensure that we do not connect to a version which our client library
does not support. If we would allow higher versions we would run the
risk that the wayland library calls into not existing callbacks.
2014-09-19 10:54:09 +02:00
Martin Gräßlin
4d77c197a9 Add convenient create methods to Registry
These methods allow to create the Interface objects and set them up
directly.
2014-09-19 10:42:44 +02:00
Martin Gräßlin
4d70ace4df Add a Registry::create overload taking the ConnectionThread object
This means we don't need to pass the wl_display* around.
2014-09-19 09:52:50 +02:00
Martin Gräßlin
cdd2ab9b78 Do not install Server library
It's not yet used by KWin, so we don't need to expose it yet.
This gives us more time to fine tune the API.
2014-09-19 09:46:55 +02:00
Martin Gräßlin
e448b84a82 Add d-pointer to Server::SurfaceInterface
It also adds a
static SurfaceInterface *get(wl_resource*)
to SurfaceInterface which can find the SurfaceInterface for the
given wl_resource. This is needed for ShellSurfaceInterface which
can no longer just cast the wayland user data.
2014-09-19 07:06:31 +02:00
Martin Gräßlin
98ce3ec2b9 Add d-pointer to Server::ShellSurfaceInterface 2014-09-18 19:25:11 +02:00
Martin Gräßlin
b2f6704560 Add d-pointer to Server::ShellInterface 2014-09-18 18:51:35 +02:00
Martin Gräßlin
c2f89128d5 Add d-pointer to Server::KeyboardInterface 2014-09-18 17:14:50 +02:00
Martin Gräßlin
8eb325ee69 Add d-pointer to Server::PointerInterface 2014-09-18 16:58:23 +02:00
Martin Gräßlin
4b3f8ccc8d Add d-pointer to Server::SeatInterface 2014-09-18 16:35:28 +02:00
Martin Gräßlin
5a0ad8c648 Add d-pointer to Server::OutputInterface 2014-09-18 16:00:21 +02:00
Martin Gräßlin
2bee5b0e2b Add d-pointer to Server::Display 2014-09-18 15:40:22 +02:00
Martin Gräßlin
6fbb8462d4 Add d-pointer to Server::CompositorInterface 2014-09-18 15:31:01 +02:00
Martin Gräßlin
7de67ceb61 Add d-pointer to Server::BufferInterface 2014-09-18 15:21:25 +02:00
Martin Gräßlin
f2628cf831 s/kwin/kwayland in test names 2014-09-17 16:22:34 +02:00
Martin Gräßlin
9b8e9c2e89 Drop KWIN_ from include guards 2014-09-17 16:20:56 +02:00
Martin Gräßlin
677e8b66a7 Use namespace KWayland::Client instead of KWin::WaylandServer
It's no longer part of KWin.
2014-09-17 16:17:26 +02:00
Martin Gräßlin
a8c7c16c94 Use namespace KWayland::Server instead of KWin::WaylandServer
It's no longer part of KWin.
2014-09-17 16:10:38 +02:00
Martin Gräßlin
3c87cea7a8 Change to LGPLv2+
I'm the only copyright holder of the code in this repository, thus
I can change from GPL to LGPL!
2014-09-17 15:57:56 +02:00
Martin Gräßlin
8fee17fc79 Install library and headers 2014-09-17 15:47:42 +02:00
Martin Gräßlin
5e54a86d5e Generate export headers and use it in our headers
Auto tests are adjusted to link against the library instead of compiling
the source files.
2014-09-17 15:10:43 +02:00
Martin Gräßlin
e763d9acc0 Add a build system
Framework style build system which generates two libraries:
* KF5WaylandClient
* KF5WaylandServer

autotests are adjusted to compile again. They need to be changed to
use the libraries once the export header gets generated.
2014-09-17 14:35:33 +02:00
Martin Gräßlin
2dbf5e95cf Import server autotests 2014-09-17 13:25:46 +02:00
Martin Gräßlin
bc93c5c6a8 Move all files to autotests/server 2014-09-17 13:24:51 +02:00
Martin Gräßlin
3c89460dd9 Import client autotests 2014-09-17 13:23:48 +02:00
Martin Gräßlin
faa80cefb7 Move all files to autotests/client 2014-09-17 13:23:06 +02:00
Martin Gräßlin
0cd3cbcf79 Merge in server related commits 2014-09-17 13:22:00 +02:00
Martin Gräßlin
37c5318375 Move all files to src/server 2014-09-17 13:20:55 +02:00
Martin Gräßlin
8e54a479f9 Move files to src/client 2014-09-17 13:19:15 +02:00