kwin/autotests/mock_screens.h
Vlad Zahorodnii 68c675d00d 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.
2021-02-10 15:31:42 +00:00

46 lines
1 KiB
C++

/*
KWin - the KDE window manager
This file is part of the KDE project.
SPDX-FileCopyrightText: 2014 Martin Gräßlin <mgraesslin@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef KWIN_MOCK_SCREENS_H
#define KWIN_MOCK_SCREENS_H
#include "screens.h"
namespace KWin
{
class MockScreens : public Screens
{
Q_OBJECT
public:
explicit MockScreens(QObject *parent = nullptr);
~MockScreens() override;
QRect geometry(int screen) const override;
int number(const QPoint &pos) const override;
QString name(int screen) const override;
float refreshRate(int screen) const override;
QSize size(int screen) const override;
QSizeF physicalSize(int screen) const override;
void init() override;
bool isChanging() const;
void setGeometries(const QList<QRect> &geometries);
protected Q_SLOTS:
void updateCount() override;
void startChangedTimer();
private:
QList<QRect> m_scheduledGeometries;
QList<QRect> m_geometries;
QTimer *m_changedTimer;
};
}
#endif