X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=winboard%2Fwinboard.h;h=6759f79b7bb80187b4a6ed5d77294cd370f6242f;hb=e70077aab0199817f37aef9ed0bdba1bbca93b45;hp=890e071353464b1112be59a76ee4fa3ce242d32d;hpb=2380bd9a886c088ba6040d99932c20cdf080fbbb;p=xboard.git diff --git a/winboard/winboard.h b/winboard/winboard.h index 890e071..6759f79 100644 --- a/winboard/winboard.h +++ b/winboard/winboard.h @@ -1,8 +1,13 @@ /* * WinBoard.h -- Definitions for Windows NT front end to XBoard * - * Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts. - * Enhancements Copyright 1992-97 Free Software Foundation, Inc. + * Copyright 1991 by Digital Equipment Corporation, Maynard, + * Massachusetts. + * + * Enhancements Copyright 1992-2001, 2002, 2003, 2004, 2005, 2006, + * 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. + * + * Enhancements Copyright 2005 Alessandro Scotti * * The following terms apply to Digital Equipment Corporation's copyright * interest in XBoard: @@ -26,24 +31,26 @@ * SOFTWARE. * ------------------------------------------------------------------------ * - * The following terms apply to the enhanced version of XBoard distributed - * by the Free Software Foundation: + * The following terms apply to the enhanced version of XBoard + * distributed by the Free Software Foundation: * ------------------------------------------------------------------------ - * This program is free software; you can redistribute it and/or modify + * + * GNU XBoard is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * the Free Software Foundation, either version 3 of the License, or (at + * your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU XBoard is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * ------------------------------------------------------------------------ - */ + * along with this program. If not, see http://www.gnu.org/licenses/. * + * + *------------------------------------------------------------------------ + ** See the file ChangeLog for a revision history. */ + #include "resource.h" #include @@ -52,6 +59,7 @@ typedef struct { char faceName[LF_FACESIZE]; float pointSize; BYTE bold, italic, underline, strikeout; + BYTE charset; } MyFontParams; typedef struct { @@ -77,6 +85,7 @@ typedef struct { typedef struct { char* name; void* data; + int flag; // [HGM] needed to indicate if data was malloc'ed or not } MySound; typedef struct { @@ -101,7 +110,7 @@ VOID ICSInitScript(VOID); BOOL CenterWindow(HWND hwndChild, HWND hwndParent); VOID ResizeEditPlusButtons(HWND hDlg, HWND hText, int sizeX, int sizeY, int newSizeX, int newSizeY); VOID PromotionPopup(HWND hwnd); -FILE *OpenFileDialog(HWND hWnd, BOOL write, char *defName, char *defExt, +FILE *OpenFileDialog(HWND hWnd, char *write, char *defName, char *defExt, char *nameFilt, char *dlgTitle, UINT *number, char fileTitle[MSG_SIZ], char fileName[MSG_SIZ]); VOID InputEvent(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); @@ -112,9 +121,7 @@ BOOL ChangeColor(HWND hwnd, COLORREF *which); VOID ChangeBoardSize(BoardSize newSize); BOOL APIENTRY MyCreateFont(HWND hwnd, MyFont *font); VOID ErrorPopDown(VOID); -VOID EnsureOnScreen(int *x, int *y); -typedef char GetFunc(void *getClosure); -VOID ParseArgs(GetFunc get, void *cl); +VOID EnsureOnScreen(int *x, int *y, int minX, int minY); HBITMAP DoLoadBitmap(HINSTANCE hinst, char *piece, int squareSize, char *suffix); COLORREF ParseColorName(char *name); @@ -125,7 +132,13 @@ VOID ParseFontName(char *name, MyFontParams *mfp); void InitComboStrings(HANDLE hwndCombo, char **cd); BOOLEAN MyLoadSound(MySound *ms); BOOLEAN MyPlaySound(MySound *ms); -VOID ExitArgError(char *msg, char *badArg); +VOID ExitArgError(char *msg, char *badArg, Boolean quit); +void SaveSettings(char* name); +BOOL BrowseForFolder( const char * title, char * path ); +VOID TourneyPopup(); +VOID LoadEnginePopUp(); +VOID LoadOptionsPopup(HWND hDlg); +VOID InitTextures(); /* Constants */ @@ -135,14 +148,14 @@ VOID ExitArgError(char *msg, char *badArg); #define CONSOLE_FONT 3 #define COMMENT_FONT 4 #define EDITTAGS_FONT 5 -#define NUM_FONTS 6 +#define MOVEHISTORY_FONT 6 +#define GAMELIST_FONT 7 +#define NUM_FONTS 8 /* Positions of some menu items. Origin is zero and separator lines count. */ /* It's gross that these are needed. */ -#define ACTION_POS 2 /* Posn of "Action" on menu bar */ -#define OPTIONS_POS 4 /* Posn of "Options" on menu bar */ -#define ICS_POS 4 /* Posn of "ICS " on Options menu */ -#define SOUNDS_POS 6 /* Posn of "Sounds" on Options menu */ +#define ACTION_POS 4 /* Posn of "Action" on menu bar */ +#define OPTIONS_POS 6 /* Posn of "Options" on menu bar */ /* end grossness */ extern MyFont *font[NUM_SIZES][NUM_FONTS]; @@ -163,18 +176,42 @@ extern MyFont *font[NUM_SIZES][NUM_FONTS]; #define COPY_TMP "wbcopy.tmp" #define PASTE_TMP "wbpaste.tmp" - -/* [AS] Layout management */ -typedef struct { - Boolean visible; - int x; - int y; - int width; - int height; -} WindowPlacement; - -VOID InitWindowPlacement( WindowPlacement * wp ); - -VOID RestoreWindowPlacement( HWND hWnd, WindowPlacement * wp ); - -VOID ReattachAfterMove( LPRECT lprcOldPos, int new_x, int new_y, HWND hWndChild, WindowPlacement * pwpChild ); + +/* variables */ +extern HINSTANCE hInst; +extern HWND hwndMain; +extern BoardSize boardSize; + +// [HGM] Some stuff to allo a platform-independent reference to windows +// This should be moved to frontend.h in due time + +typedef enum { + W_Main, W_Console, W_Comment, W_Tags, W_GameList, + W_MoveHist, W_EngineOut, NUM_WINDOWS +} WindowID; + +extern WindowPlacement placementTab[NUM_WINDOWS]; +extern HWND hwndTab[NUM_WINDOWS]; // this remains pure front-end. + +void Translate( HWND hDlg, int id); +VOID InitWindowPlacement( WindowPlacement * wp ); +VOID RestoreWindowPlacement( HWND hWnd, WindowPlacement * wp ); +VOID ReattachAfterMove( LPRECT lprcOldPos, int new_x, int new_y, HWND hWndChild, WindowPlacement * pwpChild ); +VOID ReattachAfterSize( LPRECT lprcOldPos, int new_w, int new_h, HWND hWndChild, WindowPlacement * pwpChild ); +BOOL GetActualPlacement( HWND hWnd, WindowPlacement * wp ); + +VOID MoveHistoryPopUp(); +VOID MoveHistoryPopDown(); +extern HWND moveHistoryDialog; + +VOID EvalGraphPopUp(); +VOID EvalGraphPopDown(); +extern HWND evalGraphDialog; + +extern HWND engineOutputDialog; + +VOID ShowGameListProc(void); +extern HWND gameListDialog; + +VOID EditTagsProc(void); +extern HWND editTagsDialog;