KDEGames

kgamegraphicsviewrenderer.h
1/*
2 SPDX-FileCopyrightText: 2010-2012 Stefan Majewsky <majewsky@gmx.net>
3
4 SPDX-License-Identifier: LGPL-2.0-only
5*/
6
7#ifndef KGAMEGRAPHICSVIEWRENDERER_H
8#define KGAMEGRAPHICSVIEWRENDERER_H
9
10// own
11#include "kdegames_export.h"
12#include "kgamerenderer.h"
13
14class QGraphicsView;
15
16class KGameGraphicsViewRendererPrivate;
17
18class KDEGAMES_EXPORT KGameGraphicsViewRenderer : public KGameRenderer
19{
20 Q_OBJECT
21
22public:
23 explicit KGameGraphicsViewRenderer(KGameThemeProvider *prov, unsigned cacheSize = 0);
24 /// overload that allows to use KGameRenderer without a theme provider
25 /// (useful when there is only one theme)
26 /// @note Takes ownership of @a theme.
27 explicit KGameGraphicsViewRenderer(KGameTheme *theme, unsigned cacheSize = 0);
28 /// Deletes this KGameRenderer instance, as well as all clients using it.
29 ~KGameGraphicsViewRenderer() override;
30
31public:
32 /// @return the primary view which is used by newly created
33 /// KGameRenderedItem instances associated with this renderer
34 /// @see KGameRenderedItem::setPrimaryView
35 QGraphicsView *defaultPrimaryView() const;
36
37 /// Set the primary view which will be used by newly created
38 /// KGameRenderedItem instances associated with this renderer.
39 /// Calls to this method will have no effect on existing instances.
40 /// @see KGameRenderedItem::setPrimaryView
41 void setDefaultPrimaryView(QGraphicsView *view);
42
43private:
44 std::unique_ptr<KGameGraphicsViewRendererPrivate> const d_ptr;
45 Q_DECLARE_PRIVATE(KGameGraphicsViewRenderer)
46};
47
48#endif // KGAMEGRAPHICSVIEWRENDERER_H
Cache-enabled rendering of SVG themes.
A theme provider manages KGameTheme instances, and maintains a selection of the currentTheme().
A theme describes the visual appearance of a game.
Definition kgametheme.h:60
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 20 2024 11:50:49 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.