File indexing completed on 2024-05-19 04:07:54

0001 /*
0002     SPDX-FileCopyrightText: 2015 Jakob Gruber <jakob.gruber@gmail.com>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #ifndef PIXMAPITEM_H
0008 #define PIXMAPITEM_H
0009 
0010 #include <QGraphicsPixmapItem>
0011 
0012 #include "reloadableitem.h"
0013 #include "src/logic/settings.h"
0014 
0015 class PixmapItem : public QGraphicsPixmapItem, public ReloadableItem
0016 {
0017 public:
0018     PixmapItem(Renderer::Resource resource, int x, int y, QGraphicsItem *parent = nullptr);
0019     void reload(const QSize &size) override;
0020 
0021 protected:
0022     const Renderer::Resource m_resource;
0023 };
0024 
0025 class BackgroundItem : public QObject, public PixmapItem
0026 {
0027     Q_OBJECT
0028 public:
0029     BackgroundItem(Renderer::Resource resource, int x, int y, QGraphicsItem *parent = nullptr);
0030 
0031 private Q_SLOTS:
0032     void settingChanged(Settings::SettingsType type);
0033 };
0034 
0035 class StreakHBackgroundItem : public PixmapItem
0036 {
0037 public:
0038     StreakHBackgroundItem(Renderer::Resource resource,int y, QGraphicsItem *parent = nullptr);
0039     void reload(const QSize &size) override;
0040 };
0041 
0042 class StreakVBackgroundItem : public PixmapItem
0043 {
0044 public:
0045     StreakVBackgroundItem(Renderer::Resource resource,int x, QGraphicsItem *parent = nullptr);
0046     void reload(const QSize &size) override;
0047 };
0048 
0049 #endif // PIXMAPITEM_H