/*
 * whistory.h -- Game list window for WinBoard
 * $Id: wgamelist.h,v 2.1 2003/10/27 19:21:02 mann Exp $
 *
 * Copyright 1995 Free Software Foundation, Inc.
 *
 * ------------------------------------------------------------------------
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 * ------------------------------------------------------------------------
 */

static int FlagB(int line);
static int FlagW(int line);
// static int FlagComment(int line);
static int FlagMoveNum(int line);
static void SetBWFlag(int line);
static void SetBFlag(int line);
static void SetWFlag(int line);
static void SetCommentFlag(int line);
static void SetMoveNumFlag(int movenum, int line);
static void AddMoveW(int movenum, char movelist[][2*MOVE_LEN]);
static void AddMoveB(int movenum, char movelist[][2*MOVE_LEN]);
static void AddMoveWB(int movenum, char movelist[][2*MOVE_LEN]);
static void DeleteLastLine();
static int HasComment(int movenum);
static void AddComment(int movenum);
static void AddMove(int movenum, char movelist[][2*MOVE_LEN]);
// static void InitHistory();
void InitHistory();
static void HighlightLine(int current_move);
void HistorySet(char movelist[][2*MOVE_LEN], int first, int last, int current);
static void HistoryClick(int n);
//static void CheckListSelection();
int CheckListSelection();
void ReinitHistory();
LRESULT CALLBACK HistoryDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
BOOLEAN IsHistoryWindUp();
HWND HistoryDialog();
VOID HistoryPopUp();
VOID HistoryPopDown(void);
VOID HistoryHighlight(int index);
VOID HistoryDestroy();
VOID ShowHistoryProc();

//
extern int historyX, historyY, historyW, historyH;

extern HWND historyDialog;	// identificador del recuadro

typedef struct
{
  HWND dialog;
  char up;
  char moveblack;
  unsigned long flags[MAX_MOVES];
  int  idletimer;

  int lastline;
  int lastselected;
  int lastmove; 
  char last_has_tactic;
  char last_has_mate;

  int firstM;// necessary?
  int currentM;
  int process_click;
} History;

extern History listOfMoves;

