summaryrefslogtreecommitdiffstats
path: root/tests/auto/client/shared/fractionalscalev1.h
blob: 1ae2fad1f1f8118304fced9fdffa779b57dc309e (plain)
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
// Copyright (C) 2022 David Edmundson <davidedmundson@kde.org>
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only

#ifndef MOCKCOMPOSITOR_FRACTIONALSCALE_H
#define MOCKCOMPOSITOR_FRACTIONALSCALE_H

#include "coreprotocol.h"
#include <qwayland-server-fractional-scale-v1.h>

namespace MockCompositor {

class FractionalScale;

class FractionalScaleManager : public Global, public QtWaylandServer::wp_fractional_scale_manager_v1
{
    Q_OBJECT
public:
    explicit FractionalScaleManager(CoreCompositor *compositor, int version = 1);
    QList<FractionalScale *> m_fractionalScales;

protected:
    void wp_fractional_scale_manager_v1_get_fractional_scale(Resource *resource, uint32_t id, wl_resource *surface) override;
};

class FractionalScale : public QObject, public QtWaylandServer::wp_fractional_scale_v1
{
    Q_OBJECT
public:
    explicit FractionalScale(Surface *surface, wl_client *client, int id, int version);
    Surface *m_surface;

protected:
    void wp_fractional_scale_v1_destroy_resource(Resource *resource) override;
    void wp_fractional_scale_v1_destroy(Resource *resource) override;
};

}

#endif