Public Member Functions | Protected Member Functions | List of all members
MyChessboardWidget Class Reference
Inheritance diagram for MyChessboardWidget:
Inheritance graph
[legend]

Public Member Functions

void on_menu_mode_editposition (void)
 
void on_menu_mode_editgame (void)
 
void on_menu_mode_showcandidates (void)
 
void on_menu_mode_showreachables (void)
 
void on_menu_mode_showattacked (void)
 
void on_menu_mode_showdefendables (void)
 
void on_menu_mode_showdefended_black (void)
 
void on_menu_mode_showdefended_white (void)
 
void on_menu_mode_showmoves (void)
 
void on_menu_mode_placepieces (void)
 
void picked_up (cwchess::Index const& index, cwchess::ChessPosition const& chess_position)
 
void dropped (gint col, gint row, cwchess::ChessPosition const& chess_position)
 
void moved (cwchess::Move const& move, cwchess::ChessPosition const& previous_position, cwchess::ChessPosition const& current_position)
 
void illegal (cwchess::Move const& move, cwchess::ChessPosition const& chess_position)
 
 MyChessboardWidget (Gtk::Window* drawable)
 
- Public Member Functions inherited from cwmm::ChessPositionWidget
 ChessPositionWidget (Gtk::Window* drawable, Glib::RefPtr< cwchess::Promotion > promotion=Glib::RefPtr< cwchess::Promotion >(new cwchess::Promotion))
 Constructor. More...
 
void clear (void)
 See cwchess::ChessPosition::clear.
 
void initial_position (void)
 See cwchess::ChessPosition::initial_position.
 
bool skip_move (void)
 See cwchess::ChessPosition::skip_move.
 
void to_move (cwchess::Color const& color)
 See cwchess::ChessPosition::to_move.
 
bool set_en_passant (cwchess::Index const& index)
 See cwchess::ChessPosition::set_en_passant.
 
void swap_colors (void)
 See cwchess::ChessPosition::swap_colors.
 
bool place (cwchess::Code const& code, cwchess::Index const& index)
 See cwchess::ChessPosition::place.
 
bool load_FEN (std::string const& FEN)
 See cwchess::ChessPosition::load_FEN.
 
bool execute (cwchess::Move const& move)
 See cwchess::ChessPosition::execute.
 
void set_position (cwchess::ChessPosition const& chess_position)
 
void clipboard_paste (void)
 Paste a position from the clipboard.
 
ChessPosition const&  get_position (void) const
 Return a const reference to the current position.
 
void clipboard_copy (void) const
 Copy a position to the clipboard.
 
virtual void on_cursor_left_chessboard (gint prev_col, gint prev_row)
 Called when the mouse pointer left the chessboard. More...
 
virtual void on_cursor_entered_square (gint prev_col, gint prev_row, gint col, gint row)
 Called when the mouse pointer entered a new square. More...
 
sigc::signal< void, cwchess::Index const& , cwchess::ChessPosition const & >&  signal_picked_up (void)
 Return handler for events signaling that the user picked up a piece. More...
 
sigc::signal< void, gint, gint, cwchess::ChessPosition const & >&  signal_dropped (void)
 Return handler for events signaling that the user dropped a piece. More...
 
sigc::signal< void, cwchess::Move const& , cwchess::ChessPosition const& , cwchess::ChessPosition const & >&  signal_moved (void)
 Return handler for events signaling that the user did a (legal) chess move. More...
 
sigc::signal< void, cwchess::Move const& , cwchess::ChessPosition const & >&  signal_illegal (void)
 Return handler for events signaling that the user attempted an illegal move. More...
 
widget_mode_type get_widget_mode (void) const
 Return the current widget mode.
 
void set_widget_mode (widget_mode_type widget_mode)
 Set the widget mode.
 
- Public Member Functions inherited from cwmm::ChessboardWidget
 ChessboardWidget (void)
 Create a ChessboardWidget object.
 
virtual ~ChessboardWidget ()
 Destructor.
 
gint sside (void) const
 The side of a square in pixels.
 
gint top_left_a1_x (void) const
 The x coordinate of the top-left pixel of square a1. More...
 
gint top_left_a1_y (void) const
 The y coordinate of the top-left pixel of square a1. More...
 
void set_square (gint col, gint row, code_t code)
 Change the piece on a square. More...
 
code_t get_square (gint col, gint row) const
 Get what is currently on a square. More...
 
void set_draw_border (gboolean draw)
 Set the boolean which determines whether or not the chessboard widget draws a border around the chessboard. More...
 
gboolean get_draw_border (void) const
 Get the boolean that determines whether or not the chessboard widget draws a border around the chessboard. More...
 
void set_draw_turn_indicators (gboolean draw)
 Set the boolean which determines whether or not to draw turn indicators. More...
 
gboolean get_draw_turn_indicators (void) const
 Get the boolean which determines whether or not to draw turn indicators. More...
 
void set_active_turn_indicator (gboolean white)
 Set the color of the active turn indicator. More...
 
gboolean get_active_turn_indicator (void) const
 Get the boolean which determines whether whites or black turn indicator is active. More...
 
void set_flip_board (gboolean flip)
 Set the boolean which determines whether white is playing bottom up or top down. More...
 
gboolean get_flip_board (void) const
 Get the boolean which determines whether white is playing bottom up or top down. More...
 
void set_calc_board_border_width (gint(*new_calc_board_border_width)(CwChessboard const* , gint))
 Set the calc_board_border_width function. More...
 
void set_dark_square_color (GdkColor const& color)
 Set the color of the dark squares. More...
 
void set_light_square_color (GdkColor const& color)
 Set the color of the light squares. More...
 
void set_border_color (GdkColor const& color)
 Set the color of the border around the chessboard. More...
 
void set_white_fill_color (GdkColor const& color)
 Set the fill color of the white chess pieces. More...
 
void set_white_line_color (GdkColor const& color)
 Set the line color of the white chess pieces. More...
 
void set_black_fill_color (GdkColor const& color)
 Set the fill color of the black chess pieces. More...
 
void set_black_line_color (GdkColor const& color)
 Set the line color of the black chess pieces. More...
 
void get_dark_square_color (GdkColor& color) const
 Retrieve the current background color of the dark squares. More...
 
void get_light_square_color (GdkColor& color) const
 Retrieve the current background color of the light squares. More...
 
void get_border_color (GdkColor& color) const
 Retrieve the current color of the border around the chessboard. More...
 
void get_white_fill_color (GdkColor& color) const
 Retrieve the current fill color of the white chess pieces. More...
 
void get_white_line_color (GdkColor& color) const
 Retrieve the current line color of the white chess pieces. More...
 
void get_black_fill_color (GdkColor& color) const
 Retrieve the current fill color of the black chess pieces. More...
 
void get_black_line_color (GdkColor& color) const
 Retrieve the current line color of the black chess pieces. More...
 
ColorHandle allocate_color_handle_rgb (gdouble red, gdouble green, gdouble blue)
 Allocate a new ColorHandle. More...
 
ColorHandle allocate_color_handle (GdkColor const& color)
 Allocate a new CwChessboardColorHandle. More...
 
void free_color_handle (ColorHandle handle)
 Free up the color handle handle, so it can be reused. More...
 
void set_background_color (gint col, gint row, ColorHandle handle)
 Set the background color of the square at col, row. More...
 
ColorHandle get_background_color (gint col, gint row) const
 Get the current background color handle. More...
 
void set_background_colors (ColorHandle const* handles)
 Set new background colors of any number of squares. More...
 
void get_background_colors (ColorHandle* handles) const
 Get all background colors handles. More...
 
gint add_floating_piece (code_t code, gdouble x, gdouble y, gboolean pointer_device)
 Add a new floating chess piece. More...
 
void move_floating_piece (gint handle, gdouble x, gdouble y)
 Move a floating chess piece to a new position. More...
 
void remove_floating_piece (gint handle)
 Remove a floating piece. More...
 
code_t get_floating_piece (gint handle) const
 Determine what piece a given floating piece is. More...
 
void enable_hud_layer (guint hud)
 Active a HUD layer. More...
 
void disable_hud_layer (guint hud)
 Disable the HUD layer again. More...
 
void set_marker_color (gint col, gint row, ColorHandle mahandle)
 Change the color of the marker. More...
 
ColorHandle get_marker_color (gint col, gint row) const
 Get marker color. More...
 
void set_marker_thickness (gdouble thickness)
 Set the marker thickness. More...
 
gdouble get_marker_thickness (void) const
 Get the current marker thickness as fraction of sside. More...
 
void set_marker_level (gboolean below)
 Choose whether markers should be drawn below or above HUD layer 0. More...
 
void show_cursor (void)
 Show the cursor. More...
 
void hide_cursor (void)
 Hide the cursor. More...
 
void set_cursor_thickness (gdouble thickness)
 Set the thickness of the cursor. More...
 
gdouble get_cursor_thickness (void) const
 Get the current cursor thickness as fraction of sside. More...
 
void set_cursor_color (GdkColor const& color)
 Set the color of the cursor. More...
 
void get_cursor_color (GdkColor& color) const
 Get the current cursor color. More...
 
gpointer add_arrow (gint begin_col, gint begin_row, gint end_col, gint end_row, GdkColor const& color)
 Draw an arrow on the board. More...
 
void remove_arrow (gpointer ptr)
 Remove a previously added arrow. More...
 
void colrow2xy (gint col, gint row, gint& x, gint& y) const
 Convert a (col, row) pair to the top-left coordinates of the corresponding square, relative to the top-left of the widget. More...
 
gint x2col (gdouble x) const
 Convert an x-coordinate to the column number that it matches. More...
 
gint y2row (gdouble y) const
 Convert a y-coordinate to the row number that it matches. More...
 

Protected Member Functions

virtual void draw_hud_layer (cairo_t* cr, gint sside, guint hud)
 Draw the HUD layer. More...
 
virtual bool on_button_press (gint col, gint row, GdkEventButton const* event)
 Called when a mouse button is pressed while the mouse is on the chessboard. More...
 
virtual bool on_button_release (gint col, gint row, GdkEventButton const* event)
 Called when a mouse button is released. More...
 
- Protected Member Functions inherited from cwmm::ChessPositionWidget
virtual void on_menu_placepiece_black_pawn (void)
 
virtual void on_menu_placepiece_black_rook (void)
 
virtual void on_menu_placepiece_black_knight (void)
 
virtual void on_menu_placepiece_black_bishop (void)
 
virtual void on_menu_placepiece_black_queen (void)
 
virtual void on_menu_placepiece_black_king (void)
 
virtual void on_menu_placepiece_white_pawn (void)
 
virtual void on_menu_placepiece_white_rook (void)
 
virtual void on_menu_placepiece_white_knight (void)
 
virtual void on_menu_placepiece_white_bishop (void)
 
virtual void on_menu_placepiece_white_queen (void)
 
virtual void on_menu_placepiece_white_king (void)
 
virtual void on_menu_placepiece_nothing (void)
 
virtual void on_menu_allow_en_passant_capture (void)
 
virtual void on_menu_piece_has_moved (void)
 
virtual void on_menu_copy_FEN (void)
 
virtual void on_menu_paste_FEN (void)
 
virtual void on_menu_swap_colors (void)
 
virtual void on_menu_initial_position (void)
 
virtual void on_menu_clear_board (void)
 
virtual void on_menu_to_move_white (void)
 
virtual void on_menu_to_move_black (void)
 
virtual void on_clipboard_get (Gtk::SelectionData& selection_data, guint info)
 
virtual void on_clipboard_clear (void)
 
virtual void on_clipboard_received (Glib::ustring const& text)
 
virtual void on_clipboard_received_targets (Glib::StringArrayHandle const& targets_array)
 
- Protected Member Functions inherited from cwchess::ChessPosition
void reset_en_passant (void)
 
 ChessPosition (void)
 Construct an uninitialized position.
 
void clear (void)
 Clear the board. More...
 
void initial_position (void)
 Set up the initial position.
 
bool skip_move (void)
 Skip a move. More...
 
void to_move (Color const& color)
 Explicitly set whose turn it is. More...
 
void set_half_move_clock (int count)
 Explicitly set the number of half moves since the last pawn move or capture. More...
 
void set_full_move_number (int move)
 Explicitly set the move number. More...
 
bool set_en_passant (Index const& index)
 Explicity set the en passant information. More...
 
void swap_colors (void)
 Swap colors. More...
 
bool place (Code const& code, Index const& index)
 Place a piece on the board. More...
 
void set_has_moved (Index const& index)
 Specifically specify that a king or rook has already moved. More...
 
void clear_has_moved (Index const& index)
 Specifically specify that a king or rook didn't move yet. More...
 
bool load_FEN (std::string const& FEN)
 Read a FEN code. More...
 
Piece piece_at (Index const& index) const
 Return the Piece on the square index.
 
Piece piece_at (int col, int row) const
 Return the Piece on the square col, row.
 
Color to_move (void) const
 Return whose turn it is.
 
unsigned int half_move_clock (void) const
 Return the half move clock.
 
unsigned int full_move_number (void) const
 Return the full move number.
 
CastleFlags const&  castle_flags (void) const
 Return the castle flag object.
 
EnPassant const&  en_passant (void) const
 Return the en passant object.
 
BitBoard const&  all (Code const& code) const
 Return a BitBoard with bits set for all code, where code may not be 'nothing'.
 
BitBoard const&  all (Color const& color) const
 Return a BitBoard with bits set for all pieces of color color.
 
std::string FEN (void) const
 Return the FEN code for this position.
 
int candidates_table_offset (Type const& type) const
 Return the offset into the candidates_table for type type. More...
 
BitBoard candidates (Index const& index) const
 Return a BitBoard with bits set for all squares that are candidates to move to. More...
 
BitBoard reachables (Index const& index, bool attacked_squares=false) const
 Return a BitBoard with bits set for each square that a piece can reach in one move. More...
 
BitBoard defendables (Code const& code, Index const& index, bool& battery) const
 Return a BitBoard with bits set for each square that a piece defends, or would defend if an exchange was going on there. More...
 
Index index_of_king (Color const& color) const
 Return the index of the king with color color.
 
bool check (void) const
 Return true if the king is in check.
 
bool check (Color const& color) const
 Return true if the king of color color is in check.
 
bool double_check (Color const& color) const
 Return true if the king of color color is in double check.
 
bool has_moved (Index const& index)
 Return true if the king or rook on index has moved or not. More...
 
BitBoard moves (Index const& index) const
 Return a BitBoard with bits set for each square the piece at index can legally go to. More...
 
bool legal (Move const& move) const
 Return true if the move is a legal move.
 
PieceIterator piece_begin (Color const& color) const
 Return an iterator to the first piece of color color. More...
 
PieceIterator piece_end (void) const
 Return an iterator one beyond the last piece.
 
PieceIterator piece_begin (Code const& code) const
 Return an iterator to the first piece with code code. More...
 
MoveIterator move_begin (Index const& index) const
 Return an iterator to the first move of the piece at index index.
 
MoveIterator move_end (void) const
 Return an iterator one beyond the last move.
 
bool execute (Move const& move)
 Execute move move.
 
- Protected Member Functions inherited from cwmm::ChessboardWidget
virtual void draw_pawn (cairo_t* cr, gdouble x, gdouble y, gdouble sside, gboolean white)
 Called to draw a pawn. More...
 
virtual void draw_rook (cairo_t* cr, gdouble x, gdouble y, gdouble sside, gboolean white)
 Called to draw a rook. More...
 
virtual void draw_knight (cairo_t* cr, gdouble x, gdouble y, gdouble sside, gboolean white)
 Called to draw a knight. More...
 
virtual void draw_bishop (cairo_t* cr, gdouble x, gdouble y, gdouble sside, gboolean white)
 Called to draw a bishop. More...
 
virtual void draw_queen (cairo_t* cr, gdouble x, gdouble y, gdouble sside, gboolean white)
 Called to draw a queen. More...
 
virtual void draw_king (cairo_t* cr, gdouble x, gdouble y, gdouble sside, gboolean white)
 Called to draw a king. More...
 
virtual gboolean draw_hud_square (cairo_t* cr, gint col, gint row, gint sside, guint hud)
 Draw a single HUD square at col, row. More...
 
virtual void draw_border (void)
 Draw the border around the chessboard. More...
 
virtual void draw_turn_indicator (gboolean white, gboolean on)
 Draw the indicator that indicates whose turn it is. More...
 
 ChessboardWidget (void)
 Create a ChessboardWidget object.
 
virtual ~ChessboardWidget ()
 Destructor.
 
gint sside (void) const
 The side of a square in pixels.
 
gint top_left_a1_x (void) const
 The x coordinate of the top-left pixel of square a1. More...
 
gint top_left_a1_y (void) const
 The y coordinate of the top-left pixel of square a1. More...
 
void set_square (gint col, gint row, code_t code)
 Change the piece on a square. More...
 
code_t get_square (gint col, gint row) const
 Get what is currently on a square. More...
 
void set_draw_border (gboolean draw)
 Set the boolean which determines whether or not the chessboard widget draws a border around the chessboard. More...
 
gboolean get_draw_border (void) const
 Get the boolean that determines whether or not the chessboard widget draws a border around the chessboard. More...
 
void set_draw_turn_indicators (gboolean draw)
 Set the boolean which determines whether or not to draw turn indicators. More...
 
gboolean get_draw_turn_indicators (void) const
 Get the boolean which determines whether or not to draw turn indicators. More...
 
void set_active_turn_indicator (gboolean white)
 Set the color of the active turn indicator. More...
 
gboolean get_active_turn_indicator (void) const
 Get the boolean which determines whether whites or black turn indicator is active. More...
 
void set_flip_board (gboolean flip)
 Set the boolean which determines whether white is playing bottom up or top down. More...
 
gboolean get_flip_board (void) const
 Get the boolean which determines whether white is playing bottom up or top down. More...
 
void set_calc_board_border_width (gint(*new_calc_board_border_width)(CwChessboard const* , gint))
 Set the calc_board_border_width function. More...
 
void set_dark_square_color (GdkColor const& color)
 Set the color of the dark squares. More...
 
void set_light_square_color (GdkColor const& color)
 Set the color of the light squares. More...
 
void set_border_color (GdkColor const& color)
 Set the color of the border around the chessboard. More...
 
void set_white_fill_color (GdkColor const& color)
 Set the fill color of the white chess pieces. More...
 
void set_white_line_color (GdkColor const& color)
 Set the line color of the white chess pieces. More...
 
void set_black_fill_color (GdkColor const& color)
 Set the fill color of the black chess pieces. More...
 
void set_black_line_color (GdkColor const& color)
 Set the line color of the black chess pieces. More...
 
void get_dark_square_color (GdkColor& color) const
 Retrieve the current background color of the dark squares. More...
 
void get_light_square_color (GdkColor& color) const
 Retrieve the current background color of the light squares. More...
 
void get_border_color (GdkColor& color) const
 Retrieve the current color of the border around the chessboard. More...
 
void get_white_fill_color (GdkColor& color) const
 Retrieve the current fill color of the white chess pieces. More...
 
void get_white_line_color (GdkColor& color) const
 Retrieve the current line color of the white chess pieces. More...
 
void get_black_fill_color (GdkColor& color) const
 Retrieve the current fill color of the black chess pieces. More...
 
void get_black_line_color (GdkColor& color) const
 Retrieve the current line color of the black chess pieces. More...
 
ColorHandle allocate_color_handle_rgb (gdouble red, gdouble green, gdouble blue)
 Allocate a new ColorHandle. More...
 
ColorHandle allocate_color_handle (GdkColor const& color)
 Allocate a new CwChessboardColorHandle. More...
 
void free_color_handle (ColorHandle handle)
 Free up the color handle handle, so it can be reused. More...
 
void set_background_color (gint col, gint row, ColorHandle handle)
 Set the background color of the square at col, row. More...
 
ColorHandle get_background_color (gint col, gint row) const
 Get the current background color handle. More...
 
void set_background_colors (ColorHandle const* handles)
 Set new background colors of any number of squares. More...
 
void get_background_colors (ColorHandle* handles) const
 Get all background colors handles. More...
 
gint add_floating_piece (code_t code, gdouble x, gdouble y, gboolean pointer_device)
 Add a new floating chess piece. More...
 
void move_floating_piece (gint handle, gdouble x, gdouble y)
 Move a floating chess piece to a new position. More...
 
void remove_floating_piece (gint handle)
 Remove a floating piece. More...
 
code_t get_floating_piece (gint handle) const
 Determine what piece a given floating piece is. More...
 
void enable_hud_layer (guint hud)
 Active a HUD layer. More...
 
void disable_hud_layer (guint hud)
 Disable the HUD layer again. More...
 
void set_marker_color (gint col, gint row, ColorHandle mahandle)
 Change the color of the marker. More...
 
ColorHandle get_marker_color (gint col, gint row) const
 Get marker color. More...
 
void set_marker_thickness (gdouble thickness)
 Set the marker thickness. More...
 
gdouble get_marker_thickness (void) const
 Get the current marker thickness as fraction of sside. More...
 
void set_marker_level (gboolean below)
 Choose whether markers should be drawn below or above HUD layer 0. More...
 
void show_cursor (void)
 Show the cursor. More...
 
void hide_cursor (void)
 Hide the cursor. More...
 
void set_cursor_thickness (gdouble thickness)
 Set the thickness of the cursor. More...
 
gdouble get_cursor_thickness (void) const
 Get the current cursor thickness as fraction of sside. More...
 
void set_cursor_color (GdkColor const& color)
 Set the color of the cursor. More...
 
void get_cursor_color (GdkColor& color) const
 Get the current cursor color. More...
 
gpointer add_arrow (gint begin_col, gint begin_row, gint end_col, gint end_row, GdkColor const& color)
 Draw an arrow on the board. More...
 
void remove_arrow (gpointer ptr)
 Remove a previously added arrow. More...
 
void colrow2xy (gint col, gint row, gint& x, gint& y) const
 Convert a (col, row) pair to the top-left coordinates of the corresponding square, relative to the top-left of the widget. More...
 
gint x2col (gdouble x) const
 Convert an x-coordinate to the column number that it matches. More...
 
gint y2row (gdouble y) const
 Convert a y-coordinate to the row number that it matches. More...
 

Additional Inherited Members

- Public Types inherited from cwmm::ChessPositionWidget
typedef CwChessboardColorHandle ColorHandle
 
typedef CwChessboardCode code_t
 
typedef unsigned int widget_mode_type
 The type of the builtin widget modes.
 
- Public Types inherited from cwmm::ChessboardWidget
typedef CwChessboardColorHandle ColorHandle
 A color handle used for background markers. More...
 
typedef CwChessboardCode code_t
 A code to specify a chess piece. More...
 
- Static Public Member Functions inherited from cwmm::ChessboardWidget
static gboolean is_inside_board (gint col, gint row)
 Test if a given column and row are on the chessboard. More...
 
- Static Public Attributes inherited from cwmm::ChessPositionWidget
static widget_mode_type const mode_edit_position = 0
 The value used for the 'Edit Position' mode.
 
static widget_mode_type const mode_edit_game = 1
 The value used for the 'Edit Game' mode.
 
static widget_mode_type const mode_disabled = 2
 The value used for the 'Widget disabled' mode.
 
- Protected Types inherited from cwmm::ChessboardWidget
typedef CwChessboardColorHandle ColorHandle
 A color handle used for background markers. More...
 
typedef CwChessboardCode code_t
 A code to specify a chess piece. More...
 
- Static Protected Member Functions inherited from cwmm::ChessboardWidget
static gboolean is_inside_board (gint col, gint row)
 Test if a given column and row are on the chessboard. More...
 
- Protected Attributes inherited from cwmm::ChessPositionWidget
cwchess::Index M_placepiece_index
 The square that a new piece is being placed on with the popup menu, in 'Edit Position' mode.
 
Gtk::Window*  M_drawable
 A pointer to a drawable used for it's colormap (for the icons in the popup menu).
 
Gtk::Menu*  M_MenuPopup
 An instance of the popup menu to place new pieces.
 
Glib::RefPtr< Gtk::UIManager > M_refUIManager
 Reference to a UIManager.
 
Glib::RefPtr< Gtk::ActionGroup > M_refActionGroup
 Reference to a ActionGroup.
 
Glib::RefPtr< Gtk::IconFactory > M_refIconFactory
 Reference to a IconFactory.
 
Glib::RefPtr< Gtk::RadioAction > M_refToMoveWhite_action
 Reference to RadioAction for ToMoveWhite.
 
Glib::RefPtr< Gtk::RadioAction > M_refToMoveBlack_action
 Reference to RadioAction for ToMoveBlack.
 
Glib::RefPtr< Gtk::ToggleAction > M_refPieceHasMoved_action
 Reference to ToggleAction for PieceHasMoved.
 
Glib::RefPtr< Gtk::ToggleAction > M_refAllowEnPassantCapture_action
 Reference to ToggleAction for AllowEnPassantCapture.
 
sigc::connection M_PieceHasMoved_connection
 The HasMoved ToggleAction connection.
 
sigc::connection M_AllowEnPassantCapture_connection
 The AllowEnPassantCapture ToggleAction connection.
 
- Protected Attributes inherited from cwmm::CwChessboardPtr
CwChessboard*  M_chessboard
 

Detailed Description

Definition at line 56 of file tstcpp.cc.

Member Function Documentation

void MyChessboardWidget::draw_hud_layer ( cairo_t*   cr,
gint  sside,
guint  hud 
)
protectedvirtual

Draw the HUD layer.

This is a layer in between the background (existing of the 64 squares with a single color) and the layer with the pieces. It can be used to add some texture to the background.

If the HUD layer is active, then this function is called whenever the widget is resized.

Parameters
cr: A cairo drawing context.
sside: The size of one side of a square, in pixels.
hud: The HUD index number, see the detailed documentation on the main page for more info.

The default calls cw_chessboard_default_draw_hud_layer.

See also
enable_hud_layer, disable_hud_layer

Reimplemented from cwmm::ChessboardWidget.

Definition at line 405 of file tstcpp.cc.

References cwchess::white.

bool MyChessboardWidget::on_button_press ( gint  col,
gint  row,
GdkEventButton const*   event 
)
protectedvirtual

Called when a mouse button is pressed while the mouse is on the chessboard.

Parameters
col: The column of the square the mouse is on.
row: The row of the square the mouse is on.
event: The button press event.

Useful members of the event are:

  • event->button : The number of the button that is pressed.
  • event->type : GDK_BUTTON_PRESS for a normal click, GDK_2BUTTON_PRESS for a double click.
  • event->x, event->y : The exact pixel coordinates where was clicked.

The default does nothing but return false.

This function should normally return false. If it returns true then the event is considered to be completely handled and nothing else will be done.

In case of a double click, this function is called three times. First with event->type == GDK_BUTTON_PRESS, followed by a call to on_button_release. Next again with event->type == GDK_BUTTON_PRESS and then with event->type == GDK_2BUTTON_PRESS. Finally on_button_release will be called a second time. Therefore, a call to this function with event->type == GDK_BUTTON_PRESS and a subsequent on_button_release at the same coordinates should be a non-operation (if you want to use double clicks too).

Reimplemented from cwmm::ChessPositionWidget.

Definition at line 305 of file tstcpp.cc.

References cwmm::ChessboardWidget::enable_hud_layer(), cwmm::ChessboardWidget::set_marker_color(), and cwmm::ChessboardWidget::show_cursor().

bool MyChessboardWidget::on_button_release ( gint  col,
gint  row,
GdkEventButton const*   event 
)
protectedvirtual

Called when a mouse button is released.

Parameters
col: The column of the square the mouse is on, or -1 if the mouse is outside the chessboard.
row: The row of the square the mouse is on, or -1 if the mouse is outside the chessboard.
event: The button release event.

Useful members of the event are:

  • event->button : The number of the button that is released.
  • event->x, event->y : The exact pixel coordinates where it is released.

The default does nothing but return false.

This function should normally return false. If it returns true then the event is considered to be completely handled and nothing else will be done.

Reimplemented from cwmm::ChessPositionWidget.

Definition at line 354 of file tstcpp.cc.

References cwmm::ChessboardWidget::add_arrow(), cwchess::Index::col(), cwmm::ChessPositionWidget::get_widget_mode(), cwmm::ChessboardWidget::hide_cursor(), cwmm::ChessboardWidget::is_inside_board(), cwmm::ChessPositionWidget::mode_edit_game, cwmm::ChessPositionWidget::mode_edit_position, cwchess::Index::row(), cwmm::ChessboardWidget::set_marker_color(), and cwmm::ChessboardWidget::show_cursor().


The documentation for this class was generated from the following file:

Copyright © 2006 - 2010 Carlo Wood.  All rights reserved.