2 * WinBoard.h -- Definitions for Windows NT front end to XBoard
4 * Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts.
5 * Enhancements Copyright 1992-97 Free Software Foundation, Inc.
7 * The following terms apply to Digital Equipment Corporation's copyright
9 * ------------------------------------------------------------------------
12 * Permission to use, copy, modify, and distribute this software and its
13 * documentation for any purpose and without fee is hereby granted,
14 * provided that the above copyright notice appear in all copies and that
15 * both that copyright notice and this permission notice appear in
16 * supporting documentation, and that the name of Digital not be
17 * used in advertising or publicity pertaining to distribution of the
18 * software without specific, written prior permission.
20 * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
21 * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
22 * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
23 * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
24 * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
25 * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
27 * ------------------------------------------------------------------------
29 * The following terms apply to the enhanced version of XBoard distributed
30 * by the Free Software Foundation:
31 * ------------------------------------------------------------------------
32 * This program is free software; you can redistribute it and/or modify
33 * it under the terms of the GNU General Public License as published by
34 * the Free Software Foundation; either version 2 of the License, or
35 * (at your option) any later version.
37 * This program is distributed in the hope that it will be useful,
38 * but WITHOUT ANY WARRANTY; without even the implied warranty of
39 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
40 * GNU General Public License for more details.
42 * You should have received a copy of the GNU General Public License
43 * along with this program; if not, write to the Free Software
44 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
45 * ------------------------------------------------------------------------
52 char faceName[LF_FACESIZE];
54 BYTE bold, italic, underline, strikeout;
65 SizeTiny, SizeTeeny, SizeDinky, SizePetite, SizeSlim, SizeSmall,
66 SizeMediocre, SizeMiddling, SizeAverage, SizeModerate, SizeMedium,
67 SizeBulky, SizeLarge, SizeBig, SizeHuge, SizeGiant, SizeColossal,
68 SizeTitanic, NUM_SIZES
90 BOOL InitApplication(HINSTANCE);
91 BOOL InitInstance(HINSTANCE, int, LPSTR);
92 LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
93 LRESULT CALLBACK About(HWND, UINT, WPARAM, LPARAM);
94 LRESULT CALLBACK BoardSizeDlg(HWND, UINT, WPARAM, LPARAM);
95 LRESULT CALLBACK ButtonProc(HWND, UINT, WPARAM, LPARAM);
96 VOID InitAppData(LPSTR);
97 VOID InitDrawingColors(VOID);
98 VOID InitDrawingSizes(BoardSize boardSize, int flags);
99 VOID InitMenuChecks(VOID);
100 VOID ICSInitScript(VOID);
101 BOOL CenterWindow(HWND hwndChild, HWND hwndParent);
102 VOID ResizeEditPlusButtons(HWND hDlg, HWND hText, int sizeX, int sizeY, int newSizeX, int newSizeY);
103 VOID PromotionPopup(HWND hwnd);
104 FILE *OpenFileDialog(HWND hWnd, BOOL write, char *defName, char *defExt,
105 char *nameFilt, char *dlgTitle, UINT *number,
106 char fileTitle[MSG_SIZ], char fileName[MSG_SIZ]);
107 VOID InputEvent(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
108 DWORD InputThread(LPVOID arg);
109 DWORD NonOvlInputThread(LPVOID arg);
110 DWORD SocketInputThread(LPVOID arg);
111 BOOL ChangeColor(HWND hwnd, COLORREF *which);
112 VOID ChangeBoardSize(BoardSize newSize);
113 BOOL APIENTRY MyCreateFont(HWND hwnd, MyFont *font);
114 VOID ErrorPopDown(VOID);
115 VOID EnsureOnScreen(int *x, int *y);
116 typedef char GetFunc(void *getClosure);
117 VOID ParseArgs(GetFunc get, void *cl);
119 DoLoadBitmap(HINSTANCE hinst, char *piece, int squareSize, char *suffix);
120 COLORREF ParseColorName(char *name);
121 void ParseAttribs(COLORREF *color, int *effects, char* argValue);
122 VOID CreateFontInMF(MyFont *mf);
123 VOID ChangedConsoleFont();
124 VOID ParseFontName(char *name, MyFontParams *mfp);
125 void InitComboStrings(HANDLE hwndCombo, char **cd);
126 BOOLEAN MyLoadSound(MySound *ms);
127 BOOLEAN MyPlaySound(MySound *ms);
128 VOID ExitArgError(char *msg, char *badArg);
132 #define MESSAGE_FONT 1
134 #define CONSOLE_FONT 3
135 #define COMMENT_FONT 4
136 #define EDITTAGS_FONT 5
139 /* Positions of some menu items. Origin is zero and separator lines count. */
140 /* It's gross that these are needed. */
141 #define ACTION_POS 2 /* Posn of "Action" on menu bar */
142 #define OPTIONS_POS 4 /* Posn of "Options" on menu bar */
143 #define ICS_POS 4 /* Posn of "ICS " on Options menu */
144 #define SOUNDS_POS 6 /* Posn of "Sounds" on Options menu */
147 extern MyFont *font[NUM_SIZES][NUM_FONTS];
149 #define WM_USER_Input (WM_USER + 4242)
150 #define WM_USER_Mouseleave (WM_USER + 4243)
151 #define WM_USER_GetConsoleBackground (WM_USER + 4244)
153 #define CLOCK_TIMER_ID 51
154 #define LOAD_GAME_TIMER_ID 52
155 #define ANALYSIS_TIMER_ID 53
156 #define MOUSE_TIMER_ID 54
157 #define DELAYED_TIMER_ID 55
159 #define SOLID_PIECE 0
160 #define OUTLINE_PIECE 1
161 #define WHITE_PIECE 2
163 #define COPY_TMP "wbcopy.tmp"
164 #define PASTE_TMP "wbpaste.tmp"