Commit 68c675d0 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

Make source code more relocatable

Occasionally, I see complaints about the file organization of kwin,
which is fair enough.

This change makes the source code more relocatable by removing relative
paths from includes.

CMAKE_CURRENT_SOURCE_DIR was added to the interface include directories
of kwin library. This means that as long as you link against kwin target,
the real location of the source code of the library doesn't matter.

With autotests, things are not as convenient as with kwin target. Some
tests use cpp files from kwin core. If we move all source code in a src/
directory, they will need to be adjusted, but mostly only in build
scripts.
parent fb7f507d
......@@ -7,15 +7,16 @@
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "kwin_wayland_test.h"
#include "../../platform.h"
#include "../../pluginmanager.h"
#include "../../composite.h"
#include "../../effects.h"
#include "../../wayland_server.h"
#include "../../workspace.h"
#include "../../xcbutils.h"
#include "../../xwl/xwayland.h"
#include "../../inputmethod.h"
#include "composite.h"
#include "effects.h"
#include "inputmethod.h"
#include "platform.h"
#include "pluginmanager.h"
#include "wayland_server.h"
#include "workspace.h"
#include "xcbutils.h"
#include "xwl/xwayland.h"
#include <KPluginMetaData>
......
......@@ -9,7 +9,7 @@
#ifndef KWIN_WAYLAND_TEST_H
#define KWIN_WAYLAND_TEST_H
#include "../../main.h"
#include "main.h"
// Qt
#include <QtTest>
......
......@@ -13,7 +13,7 @@
#include "screens.h"
#include "wayland_server.h"
#include "workspace.h"
#include "../../xwl/databridge.h"
#include "xwl/databridge.h"
#include <KWaylandServer/datadevice_interface.h>
......
......@@ -2,6 +2,7 @@ include_directories(${Libinput_INCLUDE_DIRS})
add_library(LibInputTestObjects STATIC ../../libinput/device.cpp ../../libinput/events.cpp mock_libinput.cpp)
target_link_libraries(LibInputTestObjects Qt::Test Qt::Widgets Qt::DBus Qt::Gui KF5::ConfigCore)
target_include_directories(LibInputTestObjects PUBLIC ${CMAKE_SOURCE_DIR})
########################################################
# Test Devices
......
......@@ -8,8 +8,10 @@
*/
#include "mock_libinput.h"
#include "mock_udev.h"
#include "../../libinput/context.h"
#include "../../udev.h"
#include "libinput/context.h"
#include "udev.h"
#include <QtTest>
Q_LOGGING_CATEGORY(KWIN_CORE, "kwin_core", QtWarningMsg)
......
......@@ -7,7 +7,7 @@
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "mock_libinput.h"
#include "../../libinput/device.h"
#include "libinput/device.h"
#include <config-kwin.h>
#include <KSharedConfig>
......
......@@ -7,8 +7,9 @@
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "mock_libinput.h"
#include "../../libinput/device.h"
#include "../../libinput/events.h"
#include "libinput/device.h"
#include "libinput/events.h"
#include <QtTest>
......
......@@ -7,8 +7,9 @@
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "mock_libinput.h"
#include "../../libinput/device.h"
#include "../input_event.h"
#include "libinput/device.h"
#include "input_event.h"
#include <QtTest>
......
......@@ -7,8 +7,9 @@
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "mock_libinput.h"
#include "../../libinput/device.h"
#include "../../libinput/events.h"
#include "libinput/device.h"
#include "libinput/events.h"
#include <QtTest>
......
......@@ -6,7 +6,8 @@
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "../../udev.h"
#include "udev.h"
#include "mock_udev.h"
udev *udev::s_mockUdev = nullptr;
......
......@@ -7,8 +7,9 @@
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "mock_libinput.h"
#include "../../libinput/device.h"
#include "../../libinput/events.h"
#include "libinput/device.h"
#include "libinput/events.h"
#include <QtTest>
......
......@@ -7,8 +7,9 @@
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "mock_libinput.h"
#include "../../libinput/device.h"
#include "../../libinput/events.h"
#include "libinput/device.h"
#include "libinput/events.h"
#include <QtTest>
......
......@@ -7,8 +7,9 @@
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "mock_libinput.h"
#include "../../libinput/device.h"
#include "../../libinput/events.h"
#include "libinput/device.h"
#include "libinput/events.h"
#include <QtTest>
......
......@@ -11,7 +11,8 @@
#include <QX11Info>
#include "../testutils.h"
#include "../../libkwineffects/kwinxrenderutils.h"
#include "kwinxrenderutils.h"
class BlendPictureTest : public QObject
{
......
......@@ -9,7 +9,7 @@
#ifndef KWIN_MOCK_SCREENS_H
#define KWIN_MOCK_SCREENS_H
#include "../screens.h"
#include "screens.h"
namespace KWin
{
......
......@@ -6,8 +6,9 @@
*/
#include "onscreennotificationtest.h"
#include "../onscreennotification.h"
#include "../input.h"
#include "onscreennotification.h"
#include "input.h"
#include <KSharedConfig>
#include <KConfigGroup>
......
......@@ -6,8 +6,8 @@
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "../abstract_opengl_context_attribute_builder.h"
#include "../egl_context_attribute_builder.h"
#include "abstract_opengl_context_attribute_builder.h"
#include "egl_context_attribute_builder.h"
#include <QtTest>
#include <epoxy/egl.h>
......
......@@ -9,7 +9,7 @@
#ifndef KWIN_MOCK_TABBOX_CLIENT_H
#define KWIN_MOCK_TABBOX_CLIENT_H
#include "../../tabbox/tabboxhandler.h"
#include "tabbox/tabboxhandler.h"
#include <QIcon>
#include <QUuid>
......
......@@ -9,7 +9,7 @@
#ifndef KWIN_MOCK_TABBOX_HANDLER_H
#define KWIN_MOCK_TABBOX_HANDLER_H
#include "../../tabbox/tabboxhandler.h"
#include "tabbox/tabboxhandler.h"
namespace KWin
{
class MockTabBoxHandler : public TabBox::TabBoxHandler
......
......@@ -8,7 +8,7 @@
*/
// KWin
#include "../../tabbox/desktopchain.h"
#include "tabbox/desktopchain.h"
#include <QTest>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment