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