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, 2010, 2011, 2012, 2013, 2014, 2015, 2016 Free
9 * Software Foundation, Inc.
11 * Enhancements Copyright 2005 Alessandro Scotti
13 * The following terms apply to Digital Equipment Corporation's copyright
15 * ------------------------------------------------------------------------
18 * Permission to use, copy, modify, and distribute this software and its
19 * documentation for any purpose and without fee is hereby granted,
20 * provided that the above copyright notice appear in all copies and that
21 * both that copyright notice and this permission notice appear in
22 * supporting documentation, and that the name of Digital not be
23 * used in advertising or publicity pertaining to distribution of the
24 * software without specific, written prior permission.
26 * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
27 * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
28 * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
29 * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
30 * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
31 * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
33 * ------------------------------------------------------------------------
35 * The following terms apply to the enhanced version of XBoard
36 * distributed by the Free Software Foundation:
37 * ------------------------------------------------------------------------
39 * GNU XBoard is free software: you can redistribute it and/or modify
40 * it under the terms of the GNU General Public License as published by
41 * the Free Software Foundation, either version 3 of the License, or (at
42 * your option) any later version.
44 * GNU XBoard is distributed in the hope that it will be useful, but
45 * WITHOUT ANY WARRANTY; without even the implied warranty of
46 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
47 * General Public License for more details.
49 * You should have received a copy of the GNU General Public License
50 * along with this program. If not, see http://www.gnu.org/licenses/. *
52 *------------------------------------------------------------------------
53 ** See the file ChangeLog for a revision history. */
60 char *T_ P((char *s));
61 void ModeHighlight P((void));
62 void SetICSMode P((void));
63 void SetGNUMode P((void));
64 void SetNCPMode P((void));
65 void SetCmailMode P((void));
66 void SetTrainingModeOn P((void));
67 void SetTrainingModeOff P((void));
68 void SetUserThinkingEnables P((void));
69 void SetMachineThinkingEnables P((void));
70 void DisplayTitle P((String title));
71 void DisplayMessage P((String message, String extMessage));
72 void DisplayMoveError P((String message));
74 void DisplayNote P((String message));
76 void DisplayInformation P((String message));
77 void AskQuestion P((String title, String question, String replyPrefix,
79 void DisplayIcsInteractionTitle P((String title));
80 void ParseArgsFromString P((char *p));
81 void ParseArgsFromFile P((FILE *f));
82 void DrawPosition P((int fullRedraw, Board board));
83 void DrawPositionX P((int fullRedraw, Board board));
84 void ResetFrontEnd P((void));
85 void NotifyFrontendLogin P((void));
86 void CommentPopUp P((String title, String comment));
87 void CommentPopDown P((void));
88 void EditCommentPopUp P((int index, String title, String text));
89 void ErrorPopDown P((void));
90 int EventToSquare P((int x, int limit));
91 void DrawSeekAxis P(( int x, int y, int xTo, int yTo ));
92 void DrawSeekBackground P(( int left, int top, int right, int bottom ));
93 void DrawSeekText P((char *buf, int x, int y));
94 void DrawSeekDot P((int x, int y, int color));
95 void PopUpMoveDialog P((char first));
97 void RingBell P((void));
99 void PlayIcsWinSound P((void));
100 void PlayIcsLossSound P((void));
101 void PlayIcsDrawSound P((void));
102 void PlayIcsUnfinishedSound P((void));
103 void PlayAlarmSound P((void));
104 void PlayTellSound P((void));
105 int PlaySoundFile P((char *name));
106 void PlaySoundByColor P((void));
107 void EchoOn P((void));
108 void EchoOff P((void));
110 void Colorize P((ColorClass cc, int continuation));
111 char *InterpretFileName P((char *name, char *dir));
112 void DoSleep P((int n));
113 void DoEvents P((void));
115 char *UserName P((void));
116 char *HostName P((void));
118 int ClockTimerRunning P((void));
119 int StopClockTimer P((void));
120 void StartClockTimer P((long millisec));
121 void DisplayWhiteClock P((long timeRemaining, int highlight));
122 void DisplayBlackClock P((long timeRemaining, int highlight));
123 void UpdateLogos P((int display));
125 int LoadGameTimerRunning P((void));
126 int StopLoadGameTimer P((void));
127 void StartLoadGameTimer P((long millisec));
128 void AutoSaveGame P((void));
129 Boolean ParseSettingsFile P((char *name, char **addr));
131 void ScheduleDelayedEvent P((DelayedEventCallback cb, long millisec));
132 DelayedEventCallback GetDelayedEvent P((void));
133 void CancelDelayedEvent P((void));
134 // [HGM] mouse: next six used by mouse handler, which was moved to backend
135 extern int fromX, fromY, toX, toY;
136 void PromotionPopUp P((char choice));
137 void DragPieceBegin P((int x, int y, Boolean instantly));
138 void DragPieceEnd P((int x, int y));
139 void DragPieceMove P((int x, int y));
140 void LeftClick P((ClickType c, int x, int y));
141 int RightClick P((ClickType c, int x, int y, int *col, int *row));
142 void Wheel P((int dir, int x, int y));
144 int StartChildProcess P((char *cmdLine, char *dir, ProcRef *pr));
145 void DestroyChildProcess P((ProcRef pr, int/*boolean*/ signal));
146 void InterruptChildProcess P((ProcRef pr));
147 char *BufferCommandOutput P((char *command, int size));
148 void RunCommand P((char *buf));
150 int OpenTelnet P((char *host, char *port, ProcRef *pr));
151 int OpenTCP P((char *host, char *port, ProcRef *pr));
152 int OpenCommPort P((char *name, ProcRef *pr));
153 int OpenLoopback P((ProcRef *pr));
154 int OpenRcmd P((char *host, char *user, char *cmd, ProcRef *pr));
156 typedef void (*InputCallback) P((InputSourceRef isr, VOIDSTAR closure,
157 char *buf, int count, int error));
158 /* pr == NoProc means the local keyboard */
159 InputSourceRef AddInputSource P((ProcRef pr, int lineByLine,
160 InputCallback func, VOIDSTAR closure));
161 void RemoveInputSource P((InputSourceRef isr));
163 /* pr == NoProc means the local display */
164 int OutputToProcess P((ProcRef pr, char *message, int count, int *outError));
165 int OutputToProcessDelayed P((ProcRef pr, char *message, int count,
166 int *outError, long msdelay));
168 void CmailSigHandlerCallBack P((InputSourceRef isr, VOIDSTAR closure,
169 char *buf, int count, int error));
171 extern ProcRef cmailPR;
172 extern int shiftKey, controlKey;
173 extern char dataDir[], manDir[];
175 /* in xgamelist.c or winboard.c */
176 void GLT_ClearList();
177 void GLT_DeSelectList();
178 void GLT_AddToList( char *name );
179 Boolean GLT_GetFromList( int index, char *name );
181 extern char lpUserGLT[];
182 extern char *homeDir;
184 /* these are in wgamelist.c */
185 void GameListPopUp P((FILE *fp, char *filename));
186 void GameListPopDown P((void));
187 void GameListHighlight P((int index));
188 void GameListDestroy P((void));
189 void GameListUpdate P((void));
190 FILE *GameFile P((void));
192 /* these are in wedittags.c */
193 void EditTagsPopUp P((char *tags, char **dest));
194 void TagsPopUp P((char *tags, char *msg));
195 void TagsPopDown P((void));
197 void ParseIcsTextColors P((void));
198 int ICSInitScript P((void));
199 void StartAnalysisClock P((void));
200 void EngineOutputPopUp P((void));
201 void EgineOutputPopDown P((void));
203 void SetHighlights P((int fromX, int fromY, int toX, int toY));
204 void ClearHighlights P((void));
205 void SetPremoveHighlights P((int fromX, int fromY, int toX, int toY));
206 void ClearPremoveHighlights P((void));
208 void AnimateAtomicCapture P((Board board, int fromX, int fromY, int toX, int toY));
209 void ShutDownFrontEnd P((void));
210 void BoardToTop P((void));
211 void AnimateMove P((Board board, int fromX, int fromY, int toX, int toY));
212 void HistorySet P((char movelist[][2*MOVE_LEN], int first, int last, int current));
213 void FreezeUI P((void));
214 void ThawUI P((void));
215 void ChangeDragPiece P((ChessSquare piece));
216 void CopyFENToClipboard P((void));
217 extern char *programName;
218 extern int commentUp;
219 extern char *engineListFile;
220 extern char *firstChessProgramNames;
221 extern char *icsTextMenuString;
224 void GreyRevert P((Boolean grey));
225 void EnableNamedMenuItem P((char *menuRef, int state));
227 typedef struct FrontEndProgramStats_TAG {
237 } FrontEndProgramStats;
239 void SetProgramStats P(( FrontEndProgramStats * stats )); /* [AS] */
241 void EngineOutputPopUp P((void));
242 void EngineOutputPopDown P((void));
243 int EngineOutputIsUp P((void));
244 int EngineOutputDialogExists P((void));
245 void EvalGraphPopUp P((void));
246 Boolean EvalGraphIsUp P((void));
247 int EvalGraphDialogExists P((void));
248 void SlavePopUp P((void));
249 void ActivateTheme P((int new));
250 char *Col2Text P((int n));
251 char *Shorten P((char *s));
253 /* these are in xhistory.c */
254 Boolean MoveHistoryIsUp P((void));
255 void HistoryPopUp P((void));
256 void FindMoveByCharIndex P(( int char_index ));
258 #endif /* XB_FRONTEND */