• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdegames API Reference
  • KDE Home
  • Contact Us
 

libkdegames

  • sources
  • kde-4.14
  • kdegames
  • libkdegames
kgamerendererclient.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright 2010 Stefan Majewsky <majewsky@gmx.net> *
3  * *
4  * This program is free software; you can redistribute it and/or modify *
5  * it under the terms of the GNU Library General Public License *
6  * version 2 as published by the Free Software Foundation *
7  * *
8  * This program is distributed in the hope that it will be useful, *
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
11  * GNU Library General Public License for more details. *
12  * *
13  * You should have received a copy of the GNU Library General Public *
14  * License along with this program; if not, write to the *
15  * Free Software Foundation, Inc., *
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
17  ***************************************************************************/
18 
19 #ifndef KGAMERENDERERCLIENT_H
20 #define KGAMERENDERERCLIENT_H
21 
22 #include <QtGui/QPixmap>
23 
24 #include <libkdegames_export.h>
25 
26 class KGameRendererClientPrivate;
27 class KGameRenderer;
28 class KGameRendererPrivate;
29 
30 #ifndef KDEGAMES_QCOLOR_QHASH
31 # define KDEGAMES_QCOLOR_QHASH
32  inline uint qHash(const QColor& color)
33  {
34  return color.rgba();
35  }
36 #endif // KDEGAMES_QCOLOR_QHASH
37 
50 class KDEGAMES_EXPORT KGameRendererClient
51 {
52  public:
55  KGameRendererClient(KGameRenderer* renderer, const QString& spriteKey);
56  virtual ~KGameRendererClient();
57 
59  KGameRenderer* renderer() const;
63  int frameCount() const;
64 
66  QString spriteKey() const;
68  void setSpriteKey(const QString& spriteKey);
70  int frame() const;
80  void setFrame(int frame);
82  QSize renderSize() const;
90  void setRenderSize(const QSize& renderSize);
92  QHash<QColor, QColor> customColors() const;
99  void setCustomColors(const QHash<QColor, QColor>& customColors);
100  protected:
104  virtual void receivePixmap(const QPixmap& pixmap) = 0;
105  private:
106  friend class KGameRendererClientPrivate;
107  friend class KGameRenderer;
108  friend class KGameRendererPrivate;
109  KGameRendererClientPrivate* const d;
110 };
111 
112 #endif // KGAMERENDERERCLIENT_H
KGameRendererPrivate
Definition: kgamerenderer_p.h:107
libkdegames_export.h
KDEGAMES_EXPORT
#define KDEGAMES_EXPORT
Definition: libkdegames_export.h:32
QHash< QColor, QColor >
KGameRenderer
Cache-enabled rendering of SVG themes.
Definition: kgamerenderer.h:94
QString
QColor
QPixmap
qHash
uint qHash(const QColor &color)
Definition: kgamerendererclient.h:32
QSize
KGameRendererClient
An object that receives pixmaps from a KGameRenderer.
Definition: kgamerendererclient.h:50
KGameRendererClientPrivate
Definition: kgamerenderer_p.h:163
QColor::rgba
QRgb rgba() const
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:18:42 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

libkdegames

Skip menu "libkdegames"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdegames API Reference

Skip menu "kdegames API Reference"
  • granatier
  • kapman
  • kblackbox
  • kgoldrunner
  • kigo
  • kmahjongg
  • KShisen
  • ksquares
  • libkdegames
  •   highscore
  •   libkdegamesprivate
  •     kgame
  • libkmahjongg
  • palapeli
  •   libpala

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal