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.
16 #include "kgamecanvas.h"
17 #include "positioninfo.h"
20 #include "animationfactory.h"
33 class ChessTable
: public KGameCanvasWidget
{
35 KGameCanvasTiledPixmap
* m_wallpaper
;
39 PiecePool
* m_pools
[2];
40 MoveList::Table
* m_movelist
;
43 ClickableCanvas
* m_current
;
44 ClickableCanvas
* m_mousegrab
;
47 ClickableCanvas
* eventItemAt(QPoint pos
);
49 void layout(bool force_reload
= false);
51 AnimationSettings m_anim_settings
;
53 ChessTable(QWidget
* parent
= 0);
56 inline Board
* board() const { return m_board
; }
57 inline PiecePool
* pool(int index
) const { return m_pools
[index
]; }
58 inline MoveList::Table
* moveListTable() const { return m_movelist
; }
59 inline Clock
* clock(int index
) const { return m_clocks
[index
]; }
60 inline InfoDisplay
* info() const { return m_info
; }
67 void setEntity(const boost::shared_ptr
<UserEntity
>& entity
);
69 void displayMessage(const QString
&);
71 virtual void resizeEvent(QResizeEvent
*);
72 virtual void mouseReleaseEvent(QMouseEvent
*);
73 virtual void mousePressEvent(QMouseEvent
*);
74 virtual void mouseMoveEvent(QMouseEvent
*);
75 virtual void enterEvent (QEvent
* event
);
76 virtual void leaveEvent (QEvent
* event
);
78 void settingsChanged(); //called by GraphicalInfo, for better theme change
79 const AnimationSettings
& animationSettings() const;
81 void updateTurn(int color
);
82 void changeClock(int color
);
83 void updateTime(int white
, int black
);
84 void setPlayers(const Player
&, const Player
&);
88 void message(const QString
&);
89 void error(ErrorCode
);
92 #endif // CHESSTABLE_H