2 * frontend.h -- Interface exported by all XBoard front ends
4 * Copyright 1991 by Digital Equipment Corporation, Maynard,
7 * Enhancements Copyright 1992-2001, 2002, 2003, 2004, 2005, 2006,
8 * 2007, 2008, 2009 Free Software Foundation, Inc.
10 * Enhancements Copyright 2005 Alessandro Scotti
12 * The following terms apply to Digital Equipment Corporation's copyright
14 * ------------------------------------------------------------------------
17 * Permission to use, copy, modify, and distribute this software and its
18 * documentation for any purpose and without fee is hereby granted,
19 * provided that the above copyright notice appear in all copies and that
20 * both that copyright notice and this permission notice appear in
21 * supporting documentation, and that the name of Digital not be
22 * used in advertising or publicity pertaining to distribution of the
23 * software without specific, written prior permission.
25 * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
26 * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
27 * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
28 * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
29 * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
30 * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
32 * ------------------------------------------------------------------------
34 * The following terms apply to the enhanced version of XBoard
35 * distributed by the Free Software Foundation:
36 * ------------------------------------------------------------------------
38 * GNU XBoard is free software: you can redistribute it and/or modify
39 * it under the terms of the GNU General Public License as published by
40 * the Free Software Foundation, either version 3 of the License, or (at
41 * your option) any later version.
43 * GNU XBoard is distributed in the hope that it will be useful, but
44 * WITHOUT ANY WARRANTY; without even the implied warranty of
45 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
46 * General Public License for more details.
48 * You should have received a copy of the GNU General Public License
49 * along with this program. If not, see http://www.gnu.org/licenses/. *
51 *------------------------------------------------------------------------
52 ** See the file ChangeLog for a revision history. */
59 typedef VOIDSTAR ProcRef;
60 #define NoProc ((ProcRef) 0)
61 typedef VOIDSTAR InputSourceRef;
63 void ModeHighlight P((void));
64 void SetICSMode P((void));
65 void SetGNUMode P((void));
66 void SetNCPMode P((void));
67 void SetCmailMode P((void));
68 void SetTrainingModeOn P((void));
69 void SetTrainingModeOff P((void));
70 void SetUserThinkingEnables P((void));
71 void SetMachineThinkingEnables P((void));
72 void DisplayTitle P((String title));
73 void DisplayMessage P((String message, String extMessage));
74 void DisplayError P((String message, int error));
75 void DisplayMoveError P((String message));
77 /* If status == 0, we are exiting with a benign message, not an error */
78 void DisplayFatalError P((String message, int error, int status));
80 void DisplayInformation P((String message));
81 void DisplayNote P((String message));
82 void AskQuestion P((String title, String question, String replyPrefix,
84 void DisplayIcsInteractionTitle P((String title));
85 void DrawPosition P((int fullRedraw, Board board));
86 void ResetFrontEnd P((void));
87 void CommentPopUp P((String title, String comment));
88 void CommentPopDown P((void));
89 void EditCommentPopUp P((int index, String title, String text));
91 void RingBell P((void));
92 void PlayIcsWinSound P((void));
93 void PlayIcsLossSound P((void));
94 void PlayIcsDrawSound P((void));
95 void PlayIcsUnfinishedSound P((void));
96 void PlayAlarmSound P((void));
97 void EchoOn P((void));
98 void EchoOff P((void));
100 void Colorize P((ColorClass cc, int continuation));
102 char *UserName P((void));
103 char *HostName P((void));
105 int ClockTimerRunning P((void));
106 int StopClockTimer P((void));
107 void StartClockTimer P((long millisec));
108 void DisplayWhiteClock P((long timeRemaining, int highlight));
109 void DisplayBlackClock P((long timeRemaining, int highlight));
111 int LoadGameTimerRunning P((void));
112 int StopLoadGameTimer P((void));
113 void StartLoadGameTimer P((long millisec));
114 void AutoSaveGame P((void));
116 typedef void (*DelayedEventCallback) P((void));
117 void ScheduleDelayedEvent P((DelayedEventCallback cb, long millisec));
118 DelayedEventCallback GetDelayedEvent P((void));
119 void CancelDelayedEvent P((void));
121 int StartChildProcess P((char *cmdLine, char *dir, ProcRef *pr));
122 void DestroyChildProcess P((ProcRef pr, int/*boolean*/ signal));
123 void InterruptChildProcess P((ProcRef pr));
125 int OpenTelnet P((char *host, char *port, ProcRef *pr));
126 int OpenTCP P((char *host, char *port, ProcRef *pr));
127 int OpenCommPort P((char *name, ProcRef *pr));
128 int OpenLoopback P((ProcRef *pr));
129 int OpenRcmd P((char *host, char *user, char *cmd, ProcRef *pr));
131 typedef void (*InputCallback) P((InputSourceRef isr, VOIDSTAR closure,
132 char *buf, int count, int error));
133 /* pr == NoProc means the local keyboard */
134 InputSourceRef AddInputSource P((ProcRef pr, int lineByLine,
135 InputCallback func, VOIDSTAR closure));
136 void RemoveInputSource P((InputSourceRef isr));
138 /* pr == NoProc means the local display */
139 int OutputToProcess P((ProcRef pr, char *message, int count, int *outError));
140 int OutputToProcessDelayed P((ProcRef pr, char *message, int count,
141 int *outError, long msdelay));
143 void CmailSigHandlerCallBack P((InputSourceRef isr, VOIDSTAR closure,
144 char *buf, int count, int error));
146 extern ProcRef cmailPR;
148 /* these are in wgamelist.c */
149 void GameListPopUp P((FILE *fp, char *filename));
150 void GameListPopDown P((void));
151 void GameListHighlight P((int index));
152 void GameListDestroy P((void));
154 /* these are in wedittags.c */
155 void EditTagsPopUp P((char *tags));
156 void TagsPopUp P((char *tags, char *msg));
157 void TagsPopDown P((void));
159 void ICSInitScript P((void));
160 void StartAnalysisClock P((void));
161 void AnalysisPopUp P((char *title, char *label));
162 void AnalysisPopDown P((void));
164 void SetHighlights P((int fromX, int fromY, int toX, int toY));
165 void ClearHighlights P((void));
166 void SetPremoveHighlights P((int fromX, int fromY, int toX, int toY));
167 void ClearPremoveHighlights P((void));
169 void ShutDownFrontEnd P((void));
170 void BoardToTop P((void));
171 void AnimateMove P((Board board, int fromX, int fromY, int toX, int toY));
172 void HistorySet P((char movelist[][2*MOVE_LEN], int first, int last, int current));
173 void FreezeUI P((void));
174 void ThawUI P((void));
175 extern char *programName;
177 typedef struct FrontEndProgramStats_TAG {
187 } FrontEndProgramStats;
189 void SetProgramStats P(( FrontEndProgramStats * stats )); /* [AS] */