24 #ifndef CHESSPOSITIONWIDGET_H 25 #define CHESSPOSITIONWIDGET_H 28 #include <boost/shared_ptr.hpp> 29 #include <gtkmm/menu.h> 30 #include <gtkmm/uimanager.h> 31 #include <gtkmm/iconfactory.h> 32 #include <gtkmm/window.h> 112 widget_mode_type M_widget_mode;
114 sigc::signal<void, cwchess::Index const&, cwchess::ChessPosition const&> M_signal_picked_up;
116 sigc::signal<void, gint, gint, cwchess::ChessPosition const&> M_signal_dropped;
118 gint M_floating_piece_handle;
120 Glib::ustring M_clipboard_content;
122 bool M_trying_primary;
130 Glib::RefPtr<cwchess::Promotion> M_promotion;
132 sigc::signal<void, cwchess::Move const&, cwchess::ChessPosition const&, cwchess::ChessPosition const&> M_signal_moved;
134 sigc::signal<void, cwchess::Move const&, cwchess::ChessPosition const&> M_signal_illegal;
179 M_floating_piece_handle(-1), M_widget_mode(mode_edit_position), M_promotion(promotion), M_MenuPopup(NULL), M_drawable(drawable), M_trying_primary(false)
182 drawable->signal_realize().connect(sigc::mem_fun(
this,& ChessPositionWidget::initialize_menus));
188 void initialize_menus(
void);
189 bool popup_menu(GdkEventButton* event,
int col,
int row);
190 void popup_deactivated(
void);
191 void update_paste_status(
void);
194 virtual void on_menu_placepiece_black_pawn(
void);
195 virtual void on_menu_placepiece_black_rook(
void);
196 virtual void on_menu_placepiece_black_knight(
void);
197 virtual void on_menu_placepiece_black_bishop(
void);
198 virtual void on_menu_placepiece_black_queen(
void);
199 virtual void on_menu_placepiece_black_king(
void);
200 virtual void on_menu_placepiece_white_pawn(
void);
201 virtual void on_menu_placepiece_white_rook(
void);
202 virtual void on_menu_placepiece_white_knight(
void);
203 virtual void on_menu_placepiece_white_bishop(
void);
204 virtual void on_menu_placepiece_white_queen(
void);
205 virtual void on_menu_placepiece_white_king(
void);
206 virtual void on_menu_placepiece_nothing(
void);
207 virtual void on_menu_allow_en_passant_capture(
void);
208 virtual void on_menu_piece_has_moved(
void);
209 virtual void on_menu_copy_FEN(
void);
210 virtual void on_menu_paste_FEN(
void);
211 virtual void on_menu_swap_colors(
void);
212 virtual void on_menu_initial_position(
void);
213 virtual void on_menu_clear_board(
void);
214 virtual void on_menu_to_move_white(
void);
215 virtual void on_menu_to_move_black(
void);
216 virtual void on_clipboard_get(Gtk::SelectionData& selection_data, guint info);
217 virtual void on_clipboard_clear(
void);
218 virtual void on_clipboard_received(Glib::ustring
const& text);
219 virtual void on_clipboard_received_targets(Glib::StringArrayHandle
const& targets_array);
239 using ChessboardWidget::trackable;
254 using ChessPosition::set_half_move_clock;
255 using ChessPosition::set_full_move_number;
256 using ChessPosition::set_has_moved;
257 using ChessPosition::clear_has_moved;
260 void clear(
void) { ChessPosition::clear(); sync(); }
286 using ChessPosition::piece_at;
287 using ChessPosition::to_move;
288 using ChessPosition::half_move_clock;
289 using ChessPosition::full_move_number;
290 using ChessPosition::castle_flags;
291 using ChessPosition::en_passant;
292 using ChessPosition::all;
304 using ChessPosition::FEN;
305 using ChessPosition::candidates_table_offset;
306 using ChessPosition::candidates;
307 using ChessPosition::reachables;
308 using ChessPosition::defendables;
309 using ChessPosition::index_of_king;
310 using ChessPosition::check;
311 using ChessPosition::double_check;
312 using ChessPosition::moves;
313 using ChessPosition::legal;
325 using ChessPosition::piece_begin;
326 using ChessPosition::piece_end;
327 using ChessPosition::move_begin;
328 using ChessPosition::move_end;
534 virtual bool on_button_press(gint col, gint row, GdkEventButton
const* event) {
return false; }
552 virtual bool on_button_release(gint col, gint row, GdkEventButton
const* event) {
return false; }
582 sigc::signal<void, cwchess::Index const&, cwchess::ChessPosition const&>&
signal_picked_up(
void) {
return M_signal_picked_up; }
589 sigc::signal<void, gint, gint, cwchess::ChessPosition const&>&
signal_dropped(
void) {
return M_signal_dropped; }
604 sigc::signal<void, cwchess::Move const&, cwchess::ChessPosition const&, cwchess::ChessPosition const&>&
signal_moved(
void) {
return M_signal_moved; }
613 sigc::signal<void, cwchess::Move const&, cwchess::ChessPosition const&>&
signal_illegal(
void) {
return M_signal_illegal; }
617 protected_notdocumented:
618 virtual bool on_button_press_event(GdkEventButton* event);
619 virtual bool on_button_release_event(GdkEventButton* event);
627 #endif // CHESSPOSITIONWIDGET_H
A chess move in a particular chess position.
The index of a chess square.
int col(void) const
Returns the column.
ChessPosition(void)
Construct an uninitialized position.
int row(void) const
Returns the row.
A namespace for all gtkmm related objects.
A chess piece type including color.
This file contains the declaration of class ChessPosition.
std::string FEN(void) const
Return the FEN code for this position.
A color (black or white).
Color to_move(void) const
Return whose turn it is.