#else
+#include <sys/file.h>
#define DoSleep( n ) if( (n) >= 0) sleep(n)
#define SLASH '/'
void CopySomething()
{
- int ret;
-
/*
* Set both PRIMARY (the selection) and CLIPBOARD, since we don't
* have a notion of a game that is selected but not copied.
struct addrinfo hints;
struct addrinfo *ais, *ai;
int error;
- int s;
+ int s=0;
ChildProc *cp;
memset(&hints, 0, sizeof(hints));
typedef int (*FileProc) P((FILE *f, int n, char *title));
int PopDown P((int n));
+void NewTagsPopup P((char *text, char *msg));
+int AppendText P((Option *opt, char *s));
+int GenericPopUp P((Option *option, char *title, int dlgNr));
+void NewCommentPopup P((char *title, char *text, int index));
+void MarkMenu P((char *item, int dlgNr));
+void GetWidgetText P((Option *opt, char **buf));
+void ClearTextWidget P((Option *opt));
void InputBoxPopup P((void));
void CatchDeleteWindow(Widget w, String procname);
void PlaySound P((char *name));
String *prms, Cardinal *nprms));
void SetFilterProc P((Widget w, XEvent *event,
String *prms, Cardinal *nprms));
+int SaveGameListAsText P((FILE *f));
extern Widget gameListShell;
#endif /* _XGAMEL_H */
#include "common.h"
#include "frontend.h"
#include "backend.h"
+#include "xhistory.h"
+#include "xboard.h"
#include "gettext.h"
#ifdef ENABLE_NLS
# define N_(s) s
#endif
-// templates for calls into back-end
+// templates for calls into back-end (= history.c; should be moved to history.h header shared with it!)
void RefreshMemoContent P((void));
void MemoContentUpdated P((void));
void FindMoveByCharIndex P(( int char_index ));
+void MoveHistorySet P(( char movelist[][2*MOVE_LEN], int first, int last, int current, ChessProgramStats_Move * pvInfo ));
-int AppendText P((Option *opt, char *s));
-int GenericPopUp P((Option *option, char *title, int dlgNr));
-void MarkMenu P((char *item, int dlgNr));
-void GetWidgetText P((Option *opt, char **buf));
-
+// variables in xoptions.c
extern Option historyOptions[];
-extern Widget shells[10];
-extern Boolean shellUp[10];
// ------------- low-level front-end actions called by MoveHistory back-end -----------------
// the colorNr argument says 0 = font-default, 1 = gray
int AppendToHistoryMemo( char * text, int bold, int colorNr )
{
- Arg args[10];
return AppendText(&historyOptions[0], text); // for now ignore bold & color stuff, as Xaw cannot handle that
}
}
// duplicate of code in winboard.c, so an move to back-end!
+void EvalGraphSet P(( int first, int last, int current, ChessProgramStats_Move * pvInfo ));
+void MakeEngineOutputTitle P(());
+
void
HistorySet( char movelist[][2*MOVE_LEN], int first, int last, int current )
{
void HistoryShowProc P((Widget w, XEvent *event,
String *prms, Cardinal *nprms));
-void HistoryPopDown P((Widget w, XtPointer client_data,
- XtPointer call_data));
Boolean MoveHistoryIsUp P((void));
extern Widget historyShell;
{
int col, j, r, g, b, step = 10;
char *s, buf[MSG_SIZ]; // color string
- Arg args[5];
GetWidgetText(¤tOption[source], &s);
if(sscanf(s, "#%x", &col) != 1) return; // malformed
b = col & 0xFF; g = col & 0xFF00; r = col & 0xFF0000;
void NewCommentPopup(char *title, char *text, int index)
{
- Widget edit;
Arg args[16];
if(shells[1]) { // if already exists, alter title and content
XtOverrideTranslations(commentOptions[0].handle, XtParseTranslationTable(commentTranslations));
}
-static char *tagsText, *msgText;
+static char *tagsText;
int NewTagsCallback(int n)
{
void NewTagsPopup(char *text, char *msg)
{
- Widget edit;
Arg args[16];
char *title = bookUp ? _("Edit book") : _("Tags");
String *prms;
Cardinal *nprms;
{
- Arg args[2];
- String val;
+ char *val;
if(prms[0][0] == '1') {
GetWidgetText(&boxOptions[0], &val);
- TypeInDoneEvent((char*)val);
+ TypeInDoneEvent(val);
}
PopDown(0);
}
{
int r = n==2 ? -1 : rand() & (1<<30)-1;
char buf[MSG_SIZ];
- Arg args[2];
snprintf(buf, MSG_SIZ, "%d", r);
SetWidgetText(&shuffleOptions[1], buf, 0);
SetWidgetState(&shuffleOptions[0], True);