File: fakeoutput.cpp

package info (click to toggle)
kwin 4%3A6.5.4-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 53,376 kB
  • sloc: cpp: 240,899; javascript: 2,225; xml: 2,096; ansic: 775; sh: 37; python: 15; makefile: 8
file content (104 lines) | stat: -rw-r--r-- 2,098 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/*
    KWin - the KDE window manager
    This file is part of the KDE project.

    SPDX-FileCopyrightText: 2022 Xaver Hugl <xaver.hugl@gmail.com>

    SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "fakeoutput.h"

FakeOutput::FakeOutput()
{
    setMode(QSize(1024, 720), 60000);
}

bool FakeOutput::testPresentation(const std::shared_ptr<KWin::OutputFrame> &frame)
{
    return false;
}

bool FakeOutput::present(const QList<KWin::OutputLayer *> &layersToUpdate, const std::shared_ptr<KWin::OutputFrame> &frame)
{
    return false;
}

KWin::RenderLoop *FakeOutput::renderLoop() const
{
    return nullptr;
}

void FakeOutput::setMode(QSize size, uint32_t refreshRate)
{
    auto mode = std::make_shared<KWin::OutputMode>(size, refreshRate);

    State state = m_state;
    state.modes = {mode};
    state.currentMode = mode;
    setState(state);
}

void FakeOutput::setTransform(KWin::OutputTransform transform)
{
    State state = m_state;
    state.transform = transform;
    setState(state);
}

void FakeOutput::moveTo(const QPoint &pos)
{
    State state = m_state;
    state.position = pos;
    setState(state);
}

void FakeOutput::setScale(qreal scale)
{
    State state = m_state;
    state.scale = scale;
    setState(state);
}

void FakeOutput::setSubPixel(SubPixel subPixel)
{
    setInformation({
        .subPixel = subPixel,
    });
}

void FakeOutput::setDpmsSupported(bool supported)
{
    setInformation({
        .capabilities = supported ? Capability::Dpms : Capabilities(),
    });
}

void FakeOutput::setPhysicalSize(QSize size)
{
    setInformation({
        .physicalSize = size,
    });
}

void FakeOutput::setName(const QString &name)
{
    Information info = m_information;
    info.name = name;
    setInformation(info);
}

void FakeOutput::setManufacturer(const QString &manufacturer)
{
    Information info = m_information;
    info.manufacturer = manufacturer;
    setInformation(info);
}

void FakeOutput::setModel(const QString &model)
{
    Information info = m_information;
    info.model = model;
    setInformation(info);
}

#include "moc_fakeoutput.cpp"