4874066423
There are a few benefits to using smart pointers from the standard library: - std::unique_ptr has move semantics. With move semantics, transfer of ownership can be properly expressed - std::shared_ptr is more efficient than QSharedPointer - more developers are used to them, making contributions for newcomers easier We're also already using a mix of both; because Qt shared pointers provide no benefits, porting to standard smart pointers improves consistency in the code base. Because of that, this commit ports most of the uses of QSharedPointer to std::shared_ptr, and some uses of QScopedPointer to std::unique_ptr
44 lines
850 B
C++
44 lines
850 B
C++
/*
|
|
KWin - the KDE window manager
|
|
This file is part of the KDE project.
|
|
|
|
SPDX-FileCopyrightText: 2021 Xaver Hugl <xaver.hugl@gmail.com>
|
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
*/
|
|
#pragma once
|
|
|
|
#include <QPoint>
|
|
#include <QSize>
|
|
|
|
#include "kwin_export.h"
|
|
#include "output.h"
|
|
|
|
namespace KWin
|
|
{
|
|
|
|
class KWIN_EXPORT OutputChangeSet
|
|
{
|
|
public:
|
|
bool enabled;
|
|
QPoint pos;
|
|
float scale;
|
|
QSize modeSize;
|
|
uint32_t refreshRate;
|
|
Output::Transform transform;
|
|
uint32_t overscan;
|
|
Output::RgbRange rgbRange;
|
|
RenderLoop::VrrPolicy vrrPolicy;
|
|
};
|
|
|
|
class KWIN_EXPORT OutputConfiguration
|
|
{
|
|
public:
|
|
std::shared_ptr<OutputChangeSet> changeSet(Output *output);
|
|
std::shared_ptr<OutputChangeSet> constChangeSet(Output *output) const;
|
|
|
|
private:
|
|
QMap<Output *, std::shared_ptr<OutputChangeSet>> m_properties;
|
|
};
|
|
|
|
}
|