2 Copyright (c) 2006 Paolo Capriotti <p.capriotti@sns.it>
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 "canvas/widget.h"
17 #include "positioninfo.h"
32 class ChessTable
: public Canvas::Widget
{
34 Canvas::TiledPixmap
* m_background
;
38 PiecePool
* m_pools
[2];
39 MoveList::Table
* m_movelist
;
42 ClickableCanvas
* m_current
;
43 ClickableCanvas
* m_mousegrab
;
46 ClickableCanvas
* eventItemAt(QPoint pos
);
48 void layout(bool force_reload
= false);
51 ChessTable(QWidget
* parent
= 0);
54 inline Board
* board() const { return m_board
; }
55 inline PiecePool
* pool(int index
) const { return m_pools
[index
]; }
56 inline MoveList::Table
* moveListTable() const { return m_movelist
; }
57 inline Clock
* clock() const { return m_clock
; }
58 inline InfoDisplay
* info() const { return m_info
; }
65 void setEntity(const boost::shared_ptr
<UserEntity
>& entity
);
67 void displayMessage(const QString
&);
69 virtual void resizeEvent(QResizeEvent
*);
70 virtual void mouseReleaseEvent(QMouseEvent
*);
71 virtual void mousePressEvent(QMouseEvent
*);
72 virtual void mouseMoveEvent(QMouseEvent
*);
73 virtual void enterEvent (QEvent
* event
);
74 virtual void leaveEvent (QEvent
* event
);
76 void settingsChanged(); //called by GraphicalInfo, for better theme change
79 void updateTurn(int color
);
80 void changeClock(int color
);
81 void updateTime(int white
, int black
);
82 void setPlayers(const Player
&, const Player
&);
86 void message(const QString
&);
87 void error(ErrorCode
);
90 #endif // CHESSTABLE_H