From: Arun Persaud Date: Sat, 10 Oct 2009 17:52:33 +0000 (-0700) Subject: clean up xhistory a bit more X-Git-Tag: gtk-20091122~23 X-Git-Url: http://winboard.nl/cgi-bin?p=xboard.git;a=commitdiff_plain;h=e421d1eb5cd48a442a8366ef71ce9765ca216402 clean up xhistory a bit more still need to add mouse handling and highlights --- diff --git a/xhistory.c b/xhistory.c index ee865fd..1a29626 100644 --- a/xhistory.c +++ b/xhistory.c @@ -44,31 +44,12 @@ extern char *getenv(); # include #endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - #include "common.h" #include "frontend.h" #include "backend.h" #include "xboard.h" #include "xhistory.h" #include "gettext.h" -#include "gtk/gtk.h" #ifdef ENABLE_NLS # define _(s) gettext (s) @@ -78,28 +59,10 @@ extern char *getenv(); # define N_(s) s #endif -#define _LL_ 100 - -extern Widget formWidget, shellWidget, boardWidget, menuBarWidget; -extern Display *xDisplay; -extern int squareSize; -extern Pixmap xMarkPixmap; -extern char *layoutName; - extern GtkWidget *GUI_History; extern GtkListStore *LIST_MoveHistory; - -struct History{ - String *Nr,*white,*black; - int aNr; /* space actually alocated */ - Widget mvn,mvw,mvb,vbox,viewport,sh; - char Up; -}; - -struct History *hist=0; String dots=" ... "; -Position gameHistoryX, gameHistoryY; void HistoryPopDown(object, user_data) @@ -113,6 +76,7 @@ HistoryPopDown(object, user_data) void HistoryMoveProc(Widget w, XtPointer closure, XtPointer call_data) { int to; + /* XawListReturnStruct *R = (XawListReturnStruct *) call_data; if (w == hist->mvn || w == hist->mvw) { to=2*R->list_index-1; @@ -122,6 +86,7 @@ void HistoryMoveProc(Widget w, XtPointer closure, XtPointer call_data) to=2*R->list_index; ToNrEvent(to); } + */ } @@ -131,6 +96,9 @@ void HistorySet(char movelist[][2*MOVE_LEN],int first,int last,int current) char movewhite[2*MOVE_LEN],moveblack[2*MOVE_LEN],move[2*MOVE_LEN]; GtkTreeIter iter; + /* TODO need to add highlights for current move */ + /* TODO need to add navigation by keyboard or mouse (double click on move) */ + /* first clear everything, do we need this? */ gtk_list_store_clear(LIST_MoveHistory); @@ -194,23 +162,6 @@ void HistorySet(char movelist[][2*MOVE_LEN],int first,int last,int current) }; return; - - - if(current<0){ - // XawListUnhighlight(hist->mvw); - // XawListUnhighlight(hist->mvb); - } - else if((current%2)==0){ - // XawListHighlight(hist->mvw, current/2+1); - // XawListUnhighlight(hist->mvb); - } - else{ - // XawListUnhighlight(hist->mvw); - // if(current) XawListHighlight(hist->mvb, current/2+1); - // else XawListUnhighlight(hist->mvb); - } - -return; } void HistoryCreate() @@ -240,20 +191,9 @@ HistoryShowProc(object, user_data) GtkObject *object; gpointer user_data; { - if (!hist) - { - HistoryCreate(); - HistoryPopUp(); - } - else if (hist->Up) - { - HistoryPopDown(NULL,NULL); - } - else - { - HistoryPopUp(); - } - ToNrEvent(currentMove); + HistoryCreate(); + HistoryPopUp(); + //TODO: ToNrEvent(currentMove); return; }