Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
KWin
Commits
306f242a
Commit
306f242a
authored
Apr 29, 2020
by
Aleix Pol Gonzalez
🐧
Browse files
Port namespaces and includes
parent
5d4cd7dc
Changes
189
Hide whitespace changes
Inline
Side-by-side
src/wayland/CMakeLists.txt
View file @
306f242a
...
...
@@ -303,7 +303,7 @@ ecm_generate_export_header(KWaylandServer
BASE_NAME
KWaylandServer
EXPORT_FILE_NAME
KWayland
/
Server/kwaylandserver_export.h
KWaylandServer/kwaylandserver_export.h
GROUP_BASE_NAME KF
VERSION
${
PROJECT_VERSION
}
DEPRECATED_BASE_VERSION 0
...
...
@@ -330,7 +330,7 @@ set_target_properties(KWaylandServer PROPERTIES VERSION ${KWAYLANDSERVER_VERSI
install
(
TARGETS KWaylandServer EXPORT KWaylandServerTargets
${
KF5_INSTALL_TARGETS_DEFAULT_ARGS
}
)
set
(
SERVER_LIB_HEADERS
${
CMAKE_CURRENT_BINARY_DIR
}
/KWayland
/
Server/kwaylandserver_export.h
${
CMAKE_CURRENT_BINARY_DIR
}
/KWaylandServer/kwaylandserver_export.h
appmenu_interface.h
blur_interface.h
buffer_interface.h
...
...
src/wayland/appmenu_interface.cpp
View file @
306f242a
...
...
@@ -14,9 +14,7 @@
#include
<wayland-appmenu-server-protocol.h>
namespace
KWayland
{
namespace
Server
namespace
KWaylandServer
{
class
AppMenuManagerInterface
::
Private
:
public
Global
::
Private
{
...
...
@@ -198,5 +196,3 @@ SurfaceInterface* AppMenuInterface::surface() const {
}
}
//namespace
}
src/wayland/appmenu_interface.h
View file @
306f242a
...
...
@@ -9,11 +9,9 @@
#include
"global.h"
#include
"resource.h"
#include
<KWayland
/
Server/kwaylandserver_export.h>
#include
<KWaylandServer/kwaylandserver_export.h>
namespace
KWayland
{
namespace
Server
namespace
KWaylandServer
{
class
Display
;
...
...
@@ -42,7 +40,7 @@ Q_SIGNALS:
/**
* Emitted whenever a new AppmenuInterface is created.
**/
void
appMenuCreated
(
KWayland
::
Server
::
AppMenuInterface
*
);
void
appMenuCreated
(
KWaylandServer
::
AppMenuInterface
*
);
private:
explicit
AppMenuManagerInterface
(
Display
*
display
,
QObject
*
parent
=
nullptr
);
...
...
@@ -86,7 +84,7 @@ Q_SIGNALS:
/**
* Emitted when the address changes or is first received
*/
void
addressChanged
(
KWayland
::
Server
::
AppMenuInterface
::
InterfaceAddress
);
void
addressChanged
(
KWaylandServer
::
AppMenuInterface
::
InterfaceAddress
);
private:
explicit
AppMenuInterface
(
AppMenuManagerInterface
*
parent
,
SurfaceInterface
*
s
,
wl_resource
*
parentResource
);
...
...
@@ -96,7 +94,6 @@ private:
Private
*
d_func
()
const
;
};
}
}
#endif
src/wayland/autotests/client/test_compositor.cpp
View file @
306f242a
...
...
@@ -29,8 +29,8 @@ private Q_SLOTS:
void
testCast
();
private:
KWayland
::
Server
::
Display
*
m_display
;
KWayland
::
Server
::
CompositorInterface
*
m_compositorInterface
;
KWaylandServer
::
Display
*
m_display
;
KWaylandServer
::
CompositorInterface
*
m_compositorInterface
;
KWayland
::
Client
::
ConnectionThread
*
m_connection
;
KWayland
::
Client
::
Compositor
*
m_compositor
;
QThread
*
m_thread
;
...
...
@@ -50,7 +50,7 @@ TestCompositor::TestCompositor(QObject *parent)
void
TestCompositor
::
init
()
{
using
namespace
KWayland
::
Server
;
using
namespace
KWaylandServer
;
delete
m_display
;
m_display
=
new
Display
(
this
);
m_display
->
setSocketName
(
s_socketName
);
...
...
src/wayland/autotests/client/test_datadevice.cpp
View file @
306f242a
...
...
@@ -45,10 +45,10 @@ private Q_SLOTS:
void
testDestroy
();
private:
KWayland
::
Server
::
Display
*
m_display
=
nullptr
;
KWayland
::
Server
::
DataDeviceManagerInterface
*
m_dataDeviceManagerInterface
=
nullptr
;
KWayland
::
Server
::
CompositorInterface
*
m_compositorInterface
=
nullptr
;
KWayland
::
Server
::
SeatInterface
*
m_seatInterface
=
nullptr
;
KWaylandServer
::
Display
*
m_display
=
nullptr
;
KWaylandServer
::
DataDeviceManagerInterface
*
m_dataDeviceManagerInterface
=
nullptr
;
KWaylandServer
::
CompositorInterface
*
m_compositorInterface
=
nullptr
;
KWaylandServer
::
SeatInterface
*
m_seatInterface
=
nullptr
;
KWayland
::
Client
::
ConnectionThread
*
m_connection
=
nullptr
;
KWayland
::
Client
::
DataDeviceManager
*
m_dataDeviceManager
=
nullptr
;
KWayland
::
Client
::
Compositor
*
m_compositor
=
nullptr
;
...
...
@@ -61,8 +61,8 @@ static const QString s_socketName = QStringLiteral("kwayland-test-wayland-datade
void
TestDataDevice
::
init
()
{
qRegisterMetaType
<
KWayland
::
Server
::
DataSourceInterface
*>
();
using
namespace
KWayland
::
Server
;
qRegisterMetaType
<
KWaylandServer
::
DataSourceInterface
*>
();
using
namespace
KWaylandServer
;
delete
m_display
;
m_display
=
new
Display
(
this
);
m_display
->
setSocketName
(
s_socketName
);
...
...
@@ -165,9 +165,9 @@ void TestDataDevice::cleanup()
void
TestDataDevice
::
testCreate
()
{
using
namespace
KWayland
::
Client
;
using
namespace
KWayland
::
Server
;
using
namespace
KWaylandServer
;
QSignalSpy
dataDeviceCreatedSpy
(
m_dataDeviceManagerInterface
,
SIGNAL
(
dataDeviceCreated
(
KWayland
::
Server
::
DataDeviceInterface
*
)));
QSignalSpy
dataDeviceCreatedSpy
(
m_dataDeviceManagerInterface
,
SIGNAL
(
dataDeviceCreated
(
KWaylandServer
::
DataDeviceInterface
*
)));
QVERIFY
(
dataDeviceCreatedSpy
.
isValid
());
QScopedPointer
<
DataDevice
>
dataDevice
(
m_dataDeviceManager
->
getDataDevice
(
m_seat
));
...
...
@@ -211,10 +211,10 @@ void TestDataDevice::testDrag_data()
void
TestDataDevice
::
testDrag
()
{
using
namespace
KWayland
::
Client
;
using
namespace
KWayland
::
Server
;
using
namespace
KWaylandServer
;
QScopedPointer
<
Pointer
>
pointer
(
m_seat
->
createPointer
());
QSignalSpy
dataDeviceCreatedSpy
(
m_dataDeviceManagerInterface
,
SIGNAL
(
dataDeviceCreated
(
KWayland
::
Server
::
DataDeviceInterface
*
)));
QSignalSpy
dataDeviceCreatedSpy
(
m_dataDeviceManagerInterface
,
SIGNAL
(
dataDeviceCreated
(
KWaylandServer
::
DataDeviceInterface
*
)));
QVERIFY
(
dataDeviceCreatedSpy
.
isValid
());
QScopedPointer
<
DataDevice
>
dataDevice
(
m_dataDeviceManager
->
getDataDevice
(
m_seat
));
...
...
@@ -225,7 +225,7 @@ void TestDataDevice::testDrag()
auto
deviceInterface
=
dataDeviceCreatedSpy
.
first
().
first
().
value
<
DataDeviceInterface
*>
();
QVERIFY
(
deviceInterface
);
QSignalSpy
dataSourceCreatedSpy
(
m_dataDeviceManagerInterface
,
SIGNAL
(
dataSourceCreated
(
KWayland
::
Server
::
DataSourceInterface
*
)));
QSignalSpy
dataSourceCreatedSpy
(
m_dataDeviceManagerInterface
,
SIGNAL
(
dataSourceCreated
(
KWaylandServer
::
DataSourceInterface
*
)));
QVERIFY
(
dataDeviceCreatedSpy
.
isValid
());
QScopedPointer
<
DataSource
>
dataSource
(
m_dataDeviceManager
->
createDataSource
());
...
...
@@ -236,7 +236,7 @@ void TestDataDevice::testDrag()
auto
sourceInterface
=
dataSourceCreatedSpy
.
first
().
first
().
value
<
DataSourceInterface
*>
();
QVERIFY
(
sourceInterface
);
QSignalSpy
surfaceCreatedSpy
(
m_compositorInterface
,
SIGNAL
(
surfaceCreated
(
KWayland
::
Server
::
SurfaceInterface
*
)));
QSignalSpy
surfaceCreatedSpy
(
m_compositorInterface
,
SIGNAL
(
surfaceCreated
(
KWaylandServer
::
SurfaceInterface
*
)));
QVERIFY
(
surfaceCreatedSpy
.
isValid
());
QScopedPointer
<
Surface
>
surface
(
m_compositor
->
createSurface
());
...
...
@@ -294,10 +294,10 @@ void TestDataDevice::testDragInternally_data()
void
TestDataDevice
::
testDragInternally
()
{
using
namespace
KWayland
::
Client
;
using
namespace
KWayland
::
Server
;
using
namespace
KWaylandServer
;
QScopedPointer
<
Pointer
>
pointer
(
m_seat
->
createPointer
());
QSignalSpy
dataDeviceCreatedSpy
(
m_dataDeviceManagerInterface
,
SIGNAL
(
dataDeviceCreated
(
KWayland
::
Server
::
DataDeviceInterface
*
)));
QSignalSpy
dataDeviceCreatedSpy
(
m_dataDeviceManagerInterface
,
SIGNAL
(
dataDeviceCreated
(
KWaylandServer
::
DataDeviceInterface
*
)));
QVERIFY
(
dataDeviceCreatedSpy
.
isValid
());
QScopedPointer
<
DataDevice
>
dataDevice
(
m_dataDeviceManager
->
getDataDevice
(
m_seat
));
...
...
@@ -308,7 +308,7 @@ void TestDataDevice::testDragInternally()
auto
deviceInterface
=
dataDeviceCreatedSpy
.
first
().
first
().
value
<
DataDeviceInterface
*>
();
QVERIFY
(
deviceInterface
);
QSignalSpy
surfaceCreatedSpy
(
m_compositorInterface
,
SIGNAL
(
surfaceCreated
(
KWayland
::
Server
::
SurfaceInterface
*
)));
QSignalSpy
surfaceCreatedSpy
(
m_compositorInterface
,
SIGNAL
(
surfaceCreated
(
KWaylandServer
::
SurfaceInterface
*
)));
QVERIFY
(
surfaceCreatedSpy
.
isValid
());
QScopedPointer
<
Surface
>
surface
(
m_compositor
->
createSurface
());
...
...
@@ -361,10 +361,10 @@ void TestDataDevice::testDragInternally()
void
TestDataDevice
::
testSetSelection
()
{
using
namespace
KWayland
::
Client
;
using
namespace
KWayland
::
Server
;
using
namespace
KWaylandServer
;
QScopedPointer
<
Pointer
>
pointer
(
m_seat
->
createPointer
());
QSignalSpy
dataDeviceCreatedSpy
(
m_dataDeviceManagerInterface
,
SIGNAL
(
dataDeviceCreated
(
KWayland
::
Server
::
DataDeviceInterface
*
)));
QSignalSpy
dataDeviceCreatedSpy
(
m_dataDeviceManagerInterface
,
SIGNAL
(
dataDeviceCreated
(
KWaylandServer
::
DataDeviceInterface
*
)));
QVERIFY
(
dataDeviceCreatedSpy
.
isValid
());
QScopedPointer
<
DataDevice
>
dataDevice
(
m_dataDeviceManager
->
getDataDevice
(
m_seat
));
...
...
@@ -375,7 +375,7 @@ void TestDataDevice::testSetSelection()
auto
deviceInterface
=
dataDeviceCreatedSpy
.
first
().
first
().
value
<
DataDeviceInterface
*>
();
QVERIFY
(
deviceInterface
);
QSignalSpy
dataSourceCreatedSpy
(
m_dataDeviceManagerInterface
,
SIGNAL
(
dataSourceCreated
(
KWayland
::
Server
::
DataSourceInterface
*
)));
QSignalSpy
dataSourceCreatedSpy
(
m_dataDeviceManagerInterface
,
SIGNAL
(
dataSourceCreated
(
KWaylandServer
::
DataSourceInterface
*
)));
QVERIFY
(
dataDeviceCreatedSpy
.
isValid
());
QScopedPointer
<
DataSource
>
dataSource
(
m_dataDeviceManager
->
createDataSource
());
...
...
@@ -388,7 +388,7 @@ void TestDataDevice::testSetSelection()
QVERIFY
(
sourceInterface
);
// everything setup, now we can test setting the selection
QSignalSpy
selectionChangedSpy
(
deviceInterface
,
SIGNAL
(
selectionChanged
(
KWayland
::
Server
::
DataSourceInterface
*
)));
QSignalSpy
selectionChangedSpy
(
deviceInterface
,
SIGNAL
(
selectionChanged
(
KWaylandServer
::
DataSourceInterface
*
)));
QVERIFY
(
selectionChangedSpy
.
isValid
());
QSignalSpy
selectionClearedSpy
(
deviceInterface
,
SIGNAL
(
selectionCleared
()));
QVERIFY
(
selectionClearedSpy
.
isValid
());
...
...
@@ -446,7 +446,7 @@ void TestDataDevice::testSendSelectionOnSeat()
{
// this test verifies that the selection is sent when setting a focused keyboard
using
namespace
KWayland
::
Client
;
using
namespace
KWayland
::
Server
;
using
namespace
KWaylandServer
;
// first add keyboard support to Seat
QSignalSpy
keyboardChangedSpy
(
m_seat
,
&
Seat
::
hasKeyboardChanged
);
QVERIFY
(
keyboardChangedSpy
.
isValid
());
...
...
@@ -503,7 +503,7 @@ void TestDataDevice::testReplaceSource()
{
// this test verifies that replacing a data source cancels the previous source
using
namespace
KWayland
::
Client
;
using
namespace
KWayland
::
Server
;
using
namespace
KWaylandServer
;
// first add keyboard support to Seat
QSignalSpy
keyboardChangedSpy
(
m_seat
,
&
Seat
::
hasKeyboardChanged
);
QVERIFY
(
keyboardChangedSpy
.
isValid
());
...
...
src/wayland/autotests/client/test_datasource.cpp
View file @
306f242a
...
...
@@ -35,8 +35,8 @@ private Q_SLOTS:
void
testDestroy
();
private:
KWayland
::
Server
::
Display
*
m_display
=
nullptr
;
KWayland
::
Server
::
DataDeviceManagerInterface
*
m_dataDeviceManagerInterface
=
nullptr
;
KWaylandServer
::
Display
*
m_display
=
nullptr
;
KWaylandServer
::
DataDeviceManagerInterface
*
m_dataDeviceManagerInterface
=
nullptr
;
KWayland
::
Client
::
ConnectionThread
*
m_connection
=
nullptr
;
KWayland
::
Client
::
DataDeviceManager
*
m_dataDeviceManager
=
nullptr
;
KWayland
::
Client
::
EventQueue
*
m_queue
=
nullptr
;
...
...
@@ -47,7 +47,7 @@ static const QString s_socketName = QStringLiteral("kwayland-test-wayland-dataso
void
TestDataSource
::
init
()
{
using
namespace
KWayland
::
Server
;
using
namespace
KWaylandServer
;
delete
m_display
;
m_display
=
new
Display
(
this
);
m_display
->
setSocketName
(
s_socketName
);
...
...
@@ -116,10 +116,10 @@ void TestDataSource::cleanup()
void
TestDataSource
::
testOffer
()
{
using
namespace
KWayland
::
Client
;
using
namespace
KWayland
::
Server
;
using
namespace
KWaylandServer
;
qRegisterMetaType
<
KWayland
::
Server
::
DataSourceInterface
*>
();
QSignalSpy
dataSourceCreatedSpy
(
m_dataDeviceManagerInterface
,
SIGNAL
(
dataSourceCreated
(
KWayland
::
Server
::
DataSourceInterface
*
)));
qRegisterMetaType
<
KWaylandServer
::
DataSourceInterface
*>
();
QSignalSpy
dataSourceCreatedSpy
(
m_dataDeviceManagerInterface
,
SIGNAL
(
dataSourceCreated
(
KWaylandServer
::
DataSourceInterface
*
)));
QVERIFY
(
dataSourceCreatedSpy
.
isValid
());
QScopedPointer
<
DataSource
>
dataSource
(
m_dataDeviceManager
->
createDataSource
());
...
...
@@ -180,9 +180,9 @@ void TestDataSource::testTargetAccepts_data()
void
TestDataSource
::
testTargetAccepts
()
{
using
namespace
KWayland
::
Client
;
using
namespace
KWayland
::
Server
;
using
namespace
KWaylandServer
;
QSignalSpy
dataSourceCreatedSpy
(
m_dataDeviceManagerInterface
,
SIGNAL
(
dataSourceCreated
(
KWayland
::
Server
::
DataSourceInterface
*
)));
QSignalSpy
dataSourceCreatedSpy
(
m_dataDeviceManagerInterface
,
SIGNAL
(
dataSourceCreated
(
KWaylandServer
::
DataSourceInterface
*
)));
QVERIFY
(
dataSourceCreatedSpy
.
isValid
());
QScopedPointer
<
DataSource
>
dataSource
(
m_dataDeviceManager
->
createDataSource
());
...
...
@@ -205,9 +205,9 @@ void TestDataSource::testTargetAccepts()
void
TestDataSource
::
testRequestSend
()
{
using
namespace
KWayland
::
Client
;
using
namespace
KWayland
::
Server
;
using
namespace
KWaylandServer
;
QSignalSpy
dataSourceCreatedSpy
(
m_dataDeviceManagerInterface
,
SIGNAL
(
dataSourceCreated
(
KWayland
::
Server
::
DataSourceInterface
*
)));
QSignalSpy
dataSourceCreatedSpy
(
m_dataDeviceManagerInterface
,
SIGNAL
(
dataSourceCreated
(
KWaylandServer
::
DataSourceInterface
*
)));
QVERIFY
(
dataSourceCreatedSpy
.
isValid
());
QScopedPointer
<
DataSource
>
dataSource
(
m_dataDeviceManager
->
createDataSource
());
...
...
@@ -238,7 +238,7 @@ void TestDataSource::testRequestSendOnUnbound()
{
// this test verifies that the server doesn't crash when requesting a send on an unbound DataSource
using
namespace
KWayland
::
Client
;
using
namespace
KWayland
::
Server
;
using
namespace
KWaylandServer
;
QSignalSpy
dataSourceCreatedSpy
(
m_dataDeviceManagerInterface
,
&
DataDeviceManagerInterface
::
dataSourceCreated
);
QVERIFY
(
dataSourceCreatedSpy
.
isValid
());
...
...
@@ -259,9 +259,9 @@ void TestDataSource::testRequestSendOnUnbound()
void
TestDataSource
::
testCancel
()
{
using
namespace
KWayland
::
Client
;
using
namespace
KWayland
::
Server
;
using
namespace
KWaylandServer
;
QSignalSpy
dataSourceCreatedSpy
(
m_dataDeviceManagerInterface
,
SIGNAL
(
dataSourceCreated
(
KWayland
::
Server
::
DataSourceInterface
*
)));
QSignalSpy
dataSourceCreatedSpy
(
m_dataDeviceManagerInterface
,
SIGNAL
(
dataSourceCreated
(
KWaylandServer
::
DataSourceInterface
*
)));
QVERIFY
(
dataSourceCreatedSpy
.
isValid
());
QScopedPointer
<
DataSource
>
dataSource
(
m_dataDeviceManager
->
createDataSource
());
...
...
@@ -281,9 +281,9 @@ void TestDataSource::testCancel()
void
TestDataSource
::
testServerGet
()
{
using
namespace
KWayland
::
Client
;
using
namespace
KWayland
::
Server
;
using
namespace
KWaylandServer
;
QSignalSpy
dataSourceCreatedSpy
(
m_dataDeviceManagerInterface
,
SIGNAL
(
dataSourceCreated
(
KWayland
::
Server
::
DataSourceInterface
*
)));
QSignalSpy
dataSourceCreatedSpy
(
m_dataDeviceManagerInterface
,
SIGNAL
(
dataSourceCreated
(
KWaylandServer
::
DataSourceInterface
*
)));
QVERIFY
(
dataSourceCreatedSpy
.
isValid
());
QScopedPointer
<
DataSource
>
dataSource
(
m_dataDeviceManager
->
createDataSource
());
...
...
src/wayland/autotests/client/test_drag_drop.cpp
View file @
306f242a
...
...
@@ -41,13 +41,13 @@ private Q_SLOTS:
private:
KWayland
::
Client
::
Surface
*
createSurface
();
KWayland
::
Server
::
SurfaceInterface
*
getServerSurface
();
KWaylandServer
::
SurfaceInterface
*
getServerSurface
();
KWayland
::
Server
::
Display
*
m_display
=
nullptr
;
KWayland
::
Server
::
CompositorInterface
*
m_compositorInterface
=
nullptr
;
KWayland
::
Server
::
DataDeviceManagerInterface
*
m_dataDeviceManagerInterface
=
nullptr
;
KWayland
::
Server
::
SeatInterface
*
m_seatInterface
=
nullptr
;
KWayland
::
Server
::
ShellInterface
*
m_shellInterface
=
nullptr
;
KWaylandServer
::
Display
*
m_display
=
nullptr
;
KWaylandServer
::
CompositorInterface
*
m_compositorInterface
=
nullptr
;
KWaylandServer
::
DataDeviceManagerInterface
*
m_dataDeviceManagerInterface
=
nullptr
;
KWaylandServer
::
SeatInterface
*
m_seatInterface
=
nullptr
;
KWaylandServer
::
ShellInterface
*
m_shellInterface
=
nullptr
;
KWayland
::
Client
::
ConnectionThread
*
m_connection
=
nullptr
;
KWayland
::
Client
::
Compositor
*
m_compositor
=
nullptr
;
KWayland
::
Client
::
EventQueue
*
m_queue
=
nullptr
;
...
...
@@ -67,7 +67,7 @@ static const QString s_socketName = QStringLiteral("kwayland-test-wayland-drag-n
void
TestDragAndDrop
::
init
()
{
using
namespace
KWayland
::
Server
;
using
namespace
KWaylandServer
;
using
namespace
KWayland
::
Client
;
delete
m_display
;
m_display
=
new
Display
(
this
);
...
...
@@ -189,9 +189,9 @@ KWayland::Client::Surface *TestDragAndDrop::createSurface()
return
s
;
}
KWayland
::
Server
::
SurfaceInterface
*
TestDragAndDrop
::
getServerSurface
()
KWaylandServer
::
SurfaceInterface
*
TestDragAndDrop
::
getServerSurface
()
{
using
namespace
KWayland
::
Server
;
using
namespace
KWaylandServer
;
QSignalSpy
surfaceCreatedSpy
(
m_compositorInterface
,
&
CompositorInterface
::
surfaceCreated
);
if
(
!
surfaceCreatedSpy
.
isValid
())
{
return
nullptr
;
...
...
@@ -205,7 +205,7 @@ KWayland::Server::SurfaceInterface *TestDragAndDrop::getServerSurface()
void
TestDragAndDrop
::
testPointerDragAndDrop
()
{
// this test verifies the very basic drag and drop on one surface, an enter, a move and the drop
using
namespace
KWayland
::
Server
;
using
namespace
KWaylandServer
;
using
namespace
KWayland
::
Client
;
// first create a window
QScopedPointer
<
Surface
>
s
(
createSurface
());
...
...
@@ -298,7 +298,7 @@ void TestDragAndDrop::testPointerDragAndDrop()
void
TestDragAndDrop
::
testTouchDragAndDrop
()
{
// this test verifies the very basic drag and drop on one surface, an enter, a move and the drop
using
namespace
KWayland
::
Server
;
using
namespace
KWaylandServer
;
using
namespace
KWayland
::
Client
;
// first create a window
QScopedPointer
<
Surface
>
s
(
createSurface
());
...
...
@@ -398,7 +398,7 @@ void TestDragAndDrop::testTouchDragAndDrop()
void
TestDragAndDrop
::
testDragAndDropWithCancelByDestroyDataSource
()
{
// this test simulates the problem from BUG 389221
using
namespace
KWayland
::
Server
;
using
namespace
KWaylandServer
;
using
namespace
KWayland
::
Client
;
// first create a window
QScopedPointer
<
Surface
>
s
(
createSurface
());
...
...
@@ -490,7 +490,7 @@ void TestDragAndDrop::testDragAndDropWithCancelByDestroyDataSource()
void
TestDragAndDrop
::
testPointerEventsIgnored
()
{
// this test verifies that all pointer events are ignored on the focused Pointer device during drag
using
namespace
KWayland
::
Server
;
using
namespace
KWaylandServer
;
using
namespace
KWayland
::
Client
;
// first create a window
QScopedPointer
<
Surface
>
s
(
createSurface
());
...
...
src/wayland/autotests/client/test_error.cpp
View file @
306f242a
...
...
@@ -24,7 +24,7 @@
#include
<errno.h>
// For EPROTO
using
namespace
KWayland
::
Client
;
using
namespace
KWayland
::
Server
;
using
namespace
KWaylandServer
;
class
ErrorTest
:
public
QObject
{
...
...
src/wayland/autotests/client/test_fake_input.cpp
View file @
306f242a
...
...
@@ -17,7 +17,7 @@
#include
<linux/input.h>
using
namespace
KWayland
::
Client
;
using
namespace
KWayland
::
Server
;
using
namespace
KWaylandServer
;
Q_DECLARE_METATYPE
(
Qt
::
MouseButton
)
...
...
src/wayland/autotests/client/test_idle.cpp
View file @
306f242a
...
...
@@ -17,7 +17,7 @@
#include
"../../src/server/seat_interface.h"
using
namespace
KWayland
::
Client
;
using
namespace
KWayland
::
Server
;
using
namespace
KWaylandServer
;
class
IdleTest
:
public
QObject
{
...
...
src/wayland/autotests/client/test_plasma_virtual_desktop.cpp
View file @
306f242a
...
...
@@ -43,11 +43,11 @@ private Q_SLOTS:
void
testRemoveRequested
();
private:
KWayland
::
Server
::
Display
*
m_display
;
KWayland
::
Server
::
CompositorInterface
*
m_compositorInterface
;
KWayland
::
Server
::
PlasmaVirtualDesktopManagementInterface
*
m_plasmaVirtualDesktopManagementInterface
;
KWayland
::
Server
::
PlasmaWindowManagementInterface
*
m_windowManagementInterface
;
KWayland
::
Server
::
PlasmaWindowInterface
*
m_windowInterface
;
KWaylandServer
::
Display
*
m_display
;
KWaylandServer
::
CompositorInterface
*
m_compositorInterface
;
KWaylandServer
::
PlasmaVirtualDesktopManagementInterface
*
m_plasmaVirtualDesktopManagementInterface
;
KWaylandServer
::
PlasmaWindowManagementInterface
*
m_windowManagementInterface
;
KWaylandServer
::
PlasmaWindowInterface
*
m_windowInterface
;
KWayland
::
Client
::
ConnectionThread
*
m_connection
;
KWayland
::
Client
::
Compositor
*
m_compositor
;
...
...
@@ -74,7 +74,7 @@ TestVirtualDesktop::TestVirtualDesktop(QObject *parent)
void
TestVirtualDesktop
::
init
()
{
using
namespace
KWayland
::
Server
;
using
namespace
KWaylandServer
;
delete
m_display
;
m_display
=
new
Display
(
this
);
m_display
->
setSocketName
(
s_socketName
);
...
...
@@ -183,7 +183,7 @@ void TestVirtualDesktop::testCreate()
//on this createDesktop bind() isn't called already, the desktopadded signals will be sent after bind happened
KWayland
::
Server
::
PlasmaVirtualDesktopInterface
*
desktop1Int
=
m_plasmaVirtualDesktopManagementInterface
->
createDesktop
(
QStringLiteral
(
"0-1"
));
KWaylandServer
::
PlasmaVirtualDesktopInterface
*
desktop1Int
=
m_plasmaVirtualDesktopManagementInterface
->
createDesktop
(
QStringLiteral
(
"0-1"
));
desktop1Int
->
setName
(
"Desktop 1"
);
desktopCreatedSpy
.
wait
();
...
...
@@ -206,7 +206,7 @@ void TestVirtualDesktop::testCreate()
//on those createDesktop the bind will already be done
KWayland
::
Server
::
PlasmaVirtualDesktopInterface
*
desktop2Int
=
m_plasmaVirtualDesktopManagementInterface
->
createDesktop
(
QStringLiteral
(
"0-2"
));
KWaylandServer
::
PlasmaVirtualDesktopInterface
*
desktop2Int
=
m_plasmaVirtualDesktopManagementInterface
->
createDesktop
(
QStringLiteral
(
"0-2"
));
desktop2Int
->
setName
(
"Desktop 2"
);
desktopCreatedSpy
.
wait
();
arguments
=
desktopCreatedSpy
.
takeFirst
();
...
...
@@ -214,7 +214,7 @@ void TestVirtualDesktop::testCreate()
QCOMPARE
(
arguments
.
at
(
1
).
toUInt
(),
(
quint32
)
1
);
QCOMPARE
(
m_plasmaVirtualDesktopManagement
->
desktops
().
length
(),
2
);
KWayland
::
Server
::
PlasmaVirtualDesktopInterface
*
desktop3Int
=
m_plasmaVirtualDesktopManagementInterface
->
createDesktop
(
QStringLiteral
(
"0-3"
));
KWaylandServer
::
PlasmaVirtualDesktopInterface
*
desktop3Int
=
m_plasmaVirtualDesktopManagementInterface
->
createDesktop
(
QStringLiteral
(
"0-3"
));
desktop3Int
->
setName
(
"Desktop 3"
);
desktopCreatedSpy
.
wait
();
arguments
=
desktopCreatedSpy
.
takeFirst
();
...
...
@@ -300,7 +300,7 @@ void TestVirtualDesktop::testDestroy()
//rebuild some desktops
testCreate
();
KWayland
::
Server
::
PlasmaVirtualDesktopInterface
*
desktop1Int
=
m_plasmaVirtualDesktopManagementInterface
->
desktops
().
first
();
KWaylandServer
::
PlasmaVirtualDesktopInterface
*
desktop1Int
=
m_plasmaVirtualDesktopManagementInterface
->
desktops
().
first
();
KWayland
::
Client
::
PlasmaVirtualDesktop
*
desktop1
=
m_plasmaVirtualDesktopManagement
->
desktops
().
first
();
...
...
@@ -337,16 +337,16 @@ void TestVirtualDesktop::testActivate()
//rebuild some desktops
testCreate
();
KWayland
::
Server
::
PlasmaVirtualDesktopInterface
*
desktop1Int
=
m_plasmaVirtualDesktopManagementInterface
->
desktops
().
first
();
KWaylandServer
::
PlasmaVirtualDesktopInterface
*
desktop1Int
=
m_plasmaVirtualDesktopManagementInterface
->
desktops
().
first
();
KWayland
::
Client
::
PlasmaVirtualDesktop
*
desktop1
=
m_plasmaVirtualDesktopManagement
->
desktops
().
first
();
QVERIFY
(
desktop1
->
isActive
());
QVERIFY
(
desktop1Int
->
isActive
());
KWayland
::
Server
::
PlasmaVirtualDesktopInterface
*
desktop2Int
=
m_plasmaVirtualDesktopManagementInterface
->
desktops
()[
1
];
KWaylandServer
::
PlasmaVirtualDesktopInterface
*
desktop2Int
=
m_plasmaVirtualDesktopManagementInterface
->
desktops
()[
1
];
KWayland
::
Client
::
PlasmaVirtualDesktop
*
desktop2
=
m_plasmaVirtualDesktopManagement
->
desktops
()[
1
];
QVERIFY
(
!
desktop2Int
->
isActive
());
QSignalSpy
requestActivateSpy
(
desktop2Int
,
&
KWayland
::
Server
::
PlasmaVirtualDesktopInterface
::
activateRequested
);
QSignalSpy
requestActivateSpy
(
desktop2Int
,
&
KWaylandServer
::
PlasmaVirtualDesktopInterface
::
activateRequested
);
QSignalSpy
activatedSpy
(
desktop2
,
&
KWayland
::
Client
::
PlasmaVirtualDesktop
::
activated
);
desktop2
->
requestActivate
();
...
...
@@ -386,7 +386,7 @@ void TestVirtualDesktop::testEnterLeaveDesktop()
{
testCreate
();
QSignalSpy
enterRequestedSpy
(
m_windowInterface
,
&
KWayland
::
Server
::
PlasmaWindowInterface
::
enterPlasmaVirtualDesktopRequested
);
QSignalSpy
enterRequestedSpy
(
m_windowInterface
,
&
KWaylandServer
::
PlasmaWindowInterface
::
enterPlasmaVirtualDesktopRequested
);
m_window
->
requestEnterVirtualDesktop
(
QStringLiteral
(
"0-1"
));
enterRequestedSpy
.
wait
();
...
...
@@ -420,7 +420,7 @@ void TestVirtualDesktop::testEnterLeaveDesktop()
QCOMPARE
(
m_window
->
plasmaVirtualDesktops
().
length
(),
2
);
//remove a desktop
QSignalSpy
leaveRequestedSpy
(
m_windowInterface
,
&
KWayland
::
Server
::
PlasmaWindowInterface
::
leavePlasmaVirtualDesktopRequested
);
QSignalSpy
leaveRequestedSpy
(
m_windowInterface
,
&
KWaylandServer
::
PlasmaWindowInterface
::
leavePlasmaVirtualDesktopRequested
);
m_window
->
requestLeaveVirtualDesktop
(
QStringLiteral
(
"0-1"
));
leaveRequestedSpy
.
wait
();
...
...
@@ -484,7 +484,7 @@ void TestVirtualDesktop::testCreateRequested()
//rebuild some desktops
testCreate
();
QSignalSpy
desktopCreateRequestedSpy
(
m_plasmaVirtualDesktopManagementInterface
,
&
KWayland
::
Server
::
PlasmaVirtualDesktopManagementInterface
::
desktopCreateRequested
);
QSignalSpy
desktopCreateRequestedSpy
(
m_plasmaVirtualDesktopManagementInterface
,
&
KWaylandServer
::
PlasmaVirtualDesktopManagementInterface
::
desktopCreateRequested
);
QSignalSpy
desktopCreatedSpy
(
m_plasmaVirtualDesktopManagement
,
&
PlasmaVirtualDesktopManagement
::
desktopCreated
);
//listen for createdRequested
...
...
@@ -495,7 +495,7 @@ void TestVirtualDesktop::testCreateRequested()
//actually create
m_plasmaVirtualDesktopManagementInterface
->
createDesktop
(
QStringLiteral
(
"0-4"
),
1
);
KWayland
::
Server
::
PlasmaVirtualDesktopInterface
*
desktopInt
=
m_plasmaVirtualDesktopManagementInterface
->
desktops
().
at
(
1
);
KWaylandServer
::
PlasmaVirtualDesktopInterface
*
desktopInt
=
m_plasmaVirtualDesktopManagementInterface
->
desktops
().
at
(
1
);
QCOMPARE
(
desktopInt
->
id
(),
QStringLiteral
(
"0-4"
));
desktopInt
->
setName
(
QStringLiteral
(
"Desktop"
));
...
...
@@ -521,7 +521,7 @@ void TestVirtualDesktop::testRemoveRequested()
//rebuild some desktops
testCreate
();
QSignalSpy
desktopRemoveRequestedSpy
(
m_plasmaVirtualDesktopManagementInterface
,
&
KWayland
::
Server
::
PlasmaVirtualDesktopManagementInterface
::
desktopRemoveRequested
);
QSignalSpy
desktopRemoveRequestedSpy
(
m_plasmaVirtualDesktopManagementInterface
,
&
KWaylandServer
::
PlasmaVirtualDesktopManagementInterface
::
desktopRemoveRequested
);
//request a remove, just check the request arrived, ignore the request.
m_plasmaVirtualDesktopManagement
->
requestRemoveVirtualDesktop
(
QStringLiteral
(
"0-1"
));
...
...
src/wayland/autotests/client/test_plasma_window_model.cpp
View file @
306f242a
...
...
@@ -19,20 +19,20 @@
#include
<linux/input.h>
using
namespace
KWayland
::
Client
;
using
namespace
KWayland
::
Server
;
using
namespace
KWaylandServer
;
Q_DECLARE_METATYPE
(
Qt
::
MouseButton
)
typedef
void
(
KWayland
::
Client
::
PlasmaWindow
::*
ClientWindowSignal
)();
Q_DECLARE_METATYPE
(
ClientWindowSignal
)
typedef
void
(
KWayland
::
Server
::
PlasmaWindowInterface
::*
ServerWindowBoolSetter
)(
bool
);
typedef
void
(
KWaylandServer
::
PlasmaWindowInterface
::*
ServerWindowBoolSetter
)(
bool
);
Q_DECLARE_METATYPE
(
ServerWindowBoolSetter
)
typedef
void
(
KWayland
::
Server
::
PlasmaWindowInterface
::*
ServerWindowStringSetter
)(
const
QString
&
);
typedef
void
(
KWaylandServer
::
PlasmaWindowInterface
::*
ServerWindowStringSetter
)(
const
QString
&
);
Q_DECLARE_METATYPE
(
ServerWindowStringSetter
)
typedef
void
(
KWayland
::
Server
::
PlasmaWindowInterface
::*
ServerWindowQuint32Setter
)(
quint32
);
typedef
void
(
KWaylandServer
::
PlasmaWindowInterface
::*
ServerWindowQuint32Setter
)(
quint32
);
Q_DECLARE_METATYPE
(
ServerWindowQuint32Setter
)
typedef
void
(
KWayland
::
Server
::
PlasmaWindowInterface
::*
ServerWindowVoidSetter
)();
typedef
void
(
KWaylandServer
::
PlasmaWindowInterface
::*
ServerWindowVoidSetter
)();
Q_DECLARE_METATYPE
(
ServerWindowVoidSetter
)
typedef
void
(
KWayland
::
Server
::
PlasmaWindowInterface
::*
ServerWindowIconSetter
)(
const
QIcon
&
);
typedef
void
(
KWaylandServer
::
PlasmaWindowInterface
::*
ServerWindowIconSetter
)(
const
QIcon
&
);
Q_DECLARE_METATYPE
(
ServerWindowIconSetter
)
class
PlasmaWindowModelTest
:
public
QObject
...
...
@@ -84,7 +84,7 @@ private:
Display
*
m_display
=
nullptr
;
PlasmaWindowManagementInterface
*
m_pwInterface
=
nullptr
;
PlasmaWindowManagement
*
m_pw
=
nullptr
;
KWayland
::
Server
::
PlasmaVirtualDesktopManagementInterface
*
m_plasmaVirtualDesktopManagementInterface
=
nullptr
;
KWaylandServer
::
PlasmaVirtualDesktopManagementInterface
*
m_plasmaVirtualDesktopManagementInterface
=
nullptr
;
ConnectionThread
*
m_connection
=
nullptr
;
QThread
*
m_thread
=
nullptr
;
EventQueue
*
m_queue
=
nullptr
;
...
...
src/wayland/autotests/client/test_plasmashell.cpp
View file @
306f242a
...
...
@@ -18,7 +18,7 @@
using
namespace
KWayland
::
Client
;
using
namespace
KWayland
::
Server
;
using
namespace
KWaylandServer
;
class
TestPlasmaShell
:
public
QObject
...
...
@@ -140,7 +140,7 @@ void TestPlasmaShell::cleanup()
void
TestPlasmaShell
::
testRole_data
()
{
QTest
::
addColumn
<
KWayland
::
Client
::
PlasmaShellSurface
::
Role
>
(
"clientRole"
);
QTest
::
addColumn
<
KWayland
::
Server
::
PlasmaShellSurfaceInterface
::
Role
>
(
"serverRole"
);