2 Copyright (c) 2006 Paolo Capriotti <p.capriotti@gmail.com>
3 (c) 2006 Maurizio Monge <maurizio.monge@kdemail.net>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
17 #include "kgamecanvas.h"
18 #include "positioninfo.h"
21 #include "animationfactory.h"
34 class ChessTable
: public KGameCanvasWidget
{
36 KGameCanvasPixmap
* m_wallpaper
;
37 QPixmap m_background_pixmap
;
41 PiecePool
* m_pools
[2];
42 MoveList::Table
* m_movelist
;
45 ClickableCanvas
* m_current
;
46 ClickableCanvas
* m_mousegrab
;
49 ClickableCanvas
* eventItemAt(QPoint pos
);
51 void layout(bool force_reload
= false);
52 void renderWallpaper();
54 AnimationSettings m_anim_settings
;
57 ChessTable(QWidget
* parent
= 0);
60 inline Board
* board() const { return m_board
; }
61 inline PiecePool
* pool(int index
) const { return m_pools
[index
]; }
62 inline MoveList::Table
* moveListTable() const { return m_movelist
; }
63 inline Clock
* clock(int index
) const { return m_clocks
[index
]; }
64 inline InfoDisplay
* info() const { return m_info
; }
71 void setEntity(const boost::shared_ptr
<UserEntity
>& entity
);
73 void displayMessage(const QString
&);
75 virtual void resizeEvent(QResizeEvent
*);
76 virtual void mouseReleaseEvent(QMouseEvent
*);
77 virtual void mousePressEvent(QMouseEvent
*);
78 virtual void mouseMoveEvent(QMouseEvent
*);
79 virtual void enterEvent (QEvent
* event
);
80 virtual void leaveEvent (QEvent
* event
);
82 void settingsChanged(); //called by GraphicalInfo, for better theme change
83 const AnimationSettings
& animationSettings() const;
85 void updateTurn(int color
);
86 void changeClock(int color
);
87 void updateTime(int white
, int black
);
88 void setPlayers(const Player
&, const Player
&);
92 void message(const QString
&);
93 void error(ErrorCode
);
96 #endif // CHESSTABLE_H