File indexing completed on 2024-04-21 04:02:05

0001 /******************************************************************************
0002 *   KBlocks, a falling blocks game by KDE                                     *
0003 *   SPDX-FileCopyrightText: 2010-2021 Julian Helfferich <julian.helfferich@mailbox.org> *
0004 *                                                                             *
0005 *   SPDX-License-Identifier: GPL-2.0-or-later
0006 ******************************************************************************/
0007 #ifndef GRAPHICSINTERFACE_H
0008 #define GRAPHICSINTERFACE_H
0009 
0010 class QSize;
0011 class QString;
0012 class QSvgRenderer;
0013 class KGameTheme;
0014 
0015 enum class BackgroundLocation {
0016     Stretch,
0017     TopLeft,
0018     Center
0019 };
0020 
0021 class GraphicsInterface
0022 {
0023 public:
0024     GraphicsInterface()
0025         : m_Block_Size{},
0026           m_View_Size_Width{},
0027           m_View_Size_Height{},
0028           m_PlayArea_OffsetPoint_X{},
0029           m_PlayArea_OffsetPoint_Y{},
0030           m_PlayArea_NumberOfBlocks_X{},
0031           m_PlayArea_NumberOfBlocks_Y{},
0032           m_PreviewArea_CenterPoint_X{},
0033           m_PreviewArea_CenterPoint_Y{},
0034           m_BackgroundLocation{}
0035     {}
0036     virtual ~GraphicsInterface() = default;
0037 
0038 public:
0039     virtual bool loadTheme(const KGameTheme *theme) = 0;
0040     virtual void readThemeValues(const KGameTheme *theme) = 0;
0041     virtual QSvgRenderer *renderer() const = 0;
0042 
0043     int m_Block_Size;
0044     int m_View_Size_Width;
0045     int m_View_Size_Height;
0046     int m_PlayArea_OffsetPoint_X;
0047     int m_PlayArea_OffsetPoint_Y;
0048     int m_PlayArea_NumberOfBlocks_X;
0049     int m_PlayArea_NumberOfBlocks_Y;
0050     int m_PreviewArea_CenterPoint_X;
0051     int m_PreviewArea_CenterPoint_Y;
0052 
0053     BackgroundLocation m_BackgroundLocation;
0054 };
0055 
0056 #endif // GRAPHICSINTERFACE_H