2 * WinBoard.h -- Definitions for Windows NT front end to XBoard
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 char faceName[LF_FACESIZE];
58 BYTE bold, italic, underline, strikeout;
69 SizeTiny, SizeTeeny, SizeDinky, SizePetite, SizeSlim, SizeSmall,
70 SizeMediocre, SizeMiddling, SizeAverage, SizeModerate, SizeMedium,
71 SizeBulky, SizeLarge, SizeBig, SizeHuge, SizeGiant, SizeColossal,
72 SizeTitanic, NUM_SIZES
94 BOOL InitApplication(HINSTANCE);
95 BOOL InitInstance(HINSTANCE, int, LPSTR);
96 LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
97 LRESULT CALLBACK About(HWND, UINT, WPARAM, LPARAM);
98 LRESULT CALLBACK BoardSizeDlg(HWND, UINT, WPARAM, LPARAM);
99 LRESULT CALLBACK ButtonProc(HWND, UINT, WPARAM, LPARAM);
100 VOID InitAppData(LPSTR);
101 VOID InitDrawingColors(VOID);
102 VOID InitDrawingSizes(BoardSize boardSize, int flags);
103 VOID InitMenuChecks(VOID);
104 VOID ICSInitScript(VOID);
105 BOOL CenterWindow(HWND hwndChild, HWND hwndParent);
106 VOID ResizeEditPlusButtons(HWND hDlg, HWND hText, int sizeX, int sizeY, int newSizeX, int newSizeY);
107 VOID PromotionPopup(HWND hwnd);
108 FILE *OpenFileDialog(HWND hWnd, char *write, char *defName, char *defExt,
109 char *nameFilt, char *dlgTitle, UINT *number,
110 char fileTitle[MSG_SIZ], char fileName[MSG_SIZ]);
111 VOID InputEvent(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
112 DWORD InputThread(LPVOID arg);
113 DWORD NonOvlInputThread(LPVOID arg);
114 DWORD SocketInputThread(LPVOID arg);
115 BOOL ChangeColor(HWND hwnd, COLORREF *which);
116 VOID ChangeBoardSize(BoardSize newSize);
117 BOOL APIENTRY MyCreateFont(HWND hwnd, MyFont *font);
118 VOID ErrorPopDown(VOID);
119 VOID EnsureOnScreen(int *x, int *y);
120 typedef char GetFunc(void *getClosure);
121 VOID ParseArgs(GetFunc get, void *cl);
123 DoLoadBitmap(HINSTANCE hinst, char *piece, int squareSize, char *suffix);
124 COLORREF ParseColorName(char *name);
125 void ParseAttribs(COLORREF *color, int *effects, char* argValue);
126 VOID CreateFontInMF(MyFont *mf);
127 VOID ChangedConsoleFont();
128 VOID ParseFontName(char *name, MyFontParams *mfp);
129 void InitComboStrings(HANDLE hwndCombo, char **cd);
130 BOOLEAN MyLoadSound(MySound *ms);
131 BOOLEAN MyPlaySound(MySound *ms);
132 VOID ExitArgError(char *msg, char *badArg);
137 #define MESSAGE_FONT 1
139 #define CONSOLE_FONT 3
140 #define COMMENT_FONT 4
141 #define EDITTAGS_FONT 5
142 #define MOVEHISTORY_FONT 6
145 /* Positions of some menu items. Origin is zero and separator lines count. */
146 /* It's gross that these are needed. */
147 #define ACTION_POS 2 /* Posn of "Action" on menu bar */
148 #define OPTIONS_POS 4 /* Posn of "Options" on menu bar */
149 #define ICS_POS 4 /* Posn of "ICS " on Options menu */
150 #define SOUNDS_POS 6 /* Posn of "Sounds" on Options menu */
153 extern MyFont *font[NUM_SIZES][NUM_FONTS];
155 #define WM_USER_Input (WM_USER + 4242)
156 #define WM_USER_Mouseleave (WM_USER + 4243)
157 #define WM_USER_GetConsoleBackground (WM_USER + 4244)
159 #define CLOCK_TIMER_ID 51
160 #define LOAD_GAME_TIMER_ID 52
161 #define ANALYSIS_TIMER_ID 53
162 #define MOUSE_TIMER_ID 54
163 #define DELAYED_TIMER_ID 55
165 #define SOLID_PIECE 0
166 #define OUTLINE_PIECE 1
167 #define WHITE_PIECE 2
169 /* Some definitions required by MSVC 4.1 */
170 #ifndef WM_MOUSEWHEEL
171 #define WM_MOUSEWHEEL 0x020A
174 #define SCF_DEFAULT 0x0000
175 #define SCF_ALL 0x0004
178 #define COPY_TMP "wbcopy.tmp"
179 #define PASTE_TMP "wbpaste.tmp"
181 /* [AS] Layout management */
190 VOID InitWindowPlacement( WindowPlacement * wp );
192 VOID RestoreWindowPlacement( HWND hWnd, WindowPlacement * wp );
194 VOID ReattachAfterMove( LPRECT lprcOldPos, int new_x, int new_y, HWND hWndChild, WindowPlacement * pwpChild );