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

kigo

  • sources
  • kde-4.14
  • kdegames
  • kigo
  • src
  • gui
  • graphicsview
gamescene.h
Go to the documentation of this file.
1 /*
2  Copyright 2008 Sascha Peilicke <sasch.pe@gmx.de>
3 
4  This program is free software; you can redistribute it and/or
5  modify it under the terms of the GNU General Public License as
6  published by the Free Software Foundation; either version 2 of
7  the License or (at your option) version 3 or any later version
8  accepted by the membership of KDE e.V. (or its successor approved
9  by the membership of KDE e.V.), which shall act as a proxy
10  defined in Section 14 of version 3 of the license.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20 
21 #ifndef KIGO_GAMESCENE_H
22 #define KIGO_GAMESCENE_H
23 
24 #include <KGamePopupItem>
25 
26 #include <QGraphicsScene>
27 
28 namespace Kigo {
29 
30 class Game;
31 
43 class GameScene : public QGraphicsScene
44 {
45  Q_OBJECT
46 
47 public:
48  explicit GameScene(Game *game, QObject *parent = 0);
49 
50 signals:
51  void cursorPixmapChanged(const QPixmap &);
52 
53 public slots:
54  void resizeScene(int width, int height);
55  void showLabels(bool show);
56  void showHint(bool show);
57  void showMoveNumbers(bool show);
58  void showMessage(const QString &message, int msecs = 2000);
59  void showPlacementMarker(bool show);
60  void showTerritory(bool show);
61 
62 private slots:
63  void updateStoneItems();
64  void updateHintItems();
65  void updateTerritoryItems();
66  void changeBoardSize(int size);
67  void hideHint() { showHint(false); }
68  void themeChanged();
69 
70 private:
71  void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
72  void mousePressEvent(QGraphicsSceneMouseEvent *event);
73  void drawBackground(QPainter *painter, const QRectF &);
74 
75  Game *m_game;
76 
77  KGamePopupItem m_gamePopup;
78  bool m_showLabels;
79  bool m_showHint;
80  bool m_showMoveNumbers;
81  bool m_showPlacementMarker;
82  bool m_showTerritory;
83  QRectF m_boardRect;
84  QRectF m_mouseRect;
85  QRectF m_gridRect;
86  int m_cellSize;
87  QSize m_stonePixmapSize;
88  QSize m_placementMarkerPixmapSize;
89  int m_boardSize;
90  QGraphicsPixmapItem *m_placementMarkerItem;
91 
92  QList<QGraphicsPixmapItem *> m_stoneItems;
93  QList<QGraphicsPixmapItem *> m_hintItems;
94  QList<QGraphicsPixmapItem *> m_territoryItems;
95 };
96 
97 } // End of namespace Kigo
98 
99 #endif
Kigo::GameScene
This class provides a graphical representation of the go game using QGraphicsScene.
Definition: gamescene.h:43
QGraphicsScene
Kigo::GameScene::GameScene
GameScene(Game *game, QObject *parent=0)
Definition: gamescene.cpp:36
QGraphicsPixmapItem
Kigo::GameScene::cursorPixmapChanged
void cursorPixmapChanged(const QPixmap &)
QGraphicsScene::height
qreal height() const
Kigo::GameScene::showTerritory
void showTerritory(bool show)
Definition: gamescene.cpp:112
Kigo::GameScene::showHint
void showHint(bool show)
Definition: gamescene.cpp:85
QObject
QGraphicsSceneMouseEvent
QPainter
Kigo::GameScene::resizeScene
void resizeScene(int width, int height)
Definition: gamescene.cpp:53
QString
QList< QGraphicsPixmapItem * >
QPixmap
QSize
Kigo::GameScene::showPlacementMarker
void showPlacementMarker(bool show)
Definition: gamescene.cpp:97
Kigo::GameScene::showMoveNumbers
void showMoveNumbers(bool show)
Definition: gamescene.cpp:91
QGraphicsScene::event
virtual bool event(QEvent *event)
QRectF
Kigo::Game
The Game class implements the Go game and acts as a wrapper around a remote Go Game game implementing...
Definition: game.h:60
QObject::parent
QObject * parent() const
Kigo::GameScene::showLabels
void showLabels(bool show)
Definition: gamescene.cpp:79
Kigo::GameScene::showMessage
void showMessage(const QString &message, int msecs=2000)
Definition: gamescene.cpp:102
QGraphicsScene::width
qreal width() const
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:18:29 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kigo

Skip menu "kigo"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

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