X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=dialogs.h;h=95dd442cd40272261690740830d07e27b8981ad7;hb=4bfad947161d93ce1b566093211bd05f368bdffe;hp=74bc021a5937a922a5937b3d13f5908f2250593e;hpb=4dc77c6e72e3ec99cd8a57c9442b7511c47d3dca;p=xboard.git diff --git a/dialogs.h b/dialogs.h index 74bc021..95dd442 100644 --- a/dialogs.h +++ b/dialogs.h @@ -31,14 +31,13 @@ // int min X/E (2) (3) (1) (1) (1) (1) (3) (1) (4) // int max X/E (w) (w) (w) (w) (w) (w) (w) (w) // void* handle X/E X/E X/E X/E X/E X X X X X -// void* target X X X X C X X C C +// void* target X X X X/C C X X C C // char* textValue E X/E * // char ** choice X/E * X // enum type X/E X/E X/E X/E X X X X X X X X // char[] name X/E X/E X/E X/E X X X X X // File and Path options are like String (but get a browse button added in the dialog), and Slider -// is like Spin. Menu can be PopUp or PopDown; both need the COMBO_CALLBACK bit (1) set, and the -// latter also uses the min flags for positioning the menu button. +// is like Spin. Menu can be PopUp or PopDown; both need the COMBO_CALLBACK bit (3) set! // (h) or (w) means the field optionally (when non-null) specifies the height or width of the main // control element (excluding accompanying description texts). [w] means the width is written there. // C specifies the 'target' is a user-supplied callback function, which will be executed when the @@ -52,7 +51,7 @@ #define T_WRAP (1 << 3) #define T_TOP (1 << 4) -/* Flags Option.min used (3) for ComboBox (-combo): */ +/* Flags Option.min used (3) for ComboBox (-combo) and menus (PopUp, PopDown): */ #define COMBO_CALLBACK (1 << 0) #define NO_GETTEXT (1 << 2) @@ -73,25 +72,48 @@ #define RR (L2R|R2R) /* 0x30 = entirely to right */ #define LR (L2L|R2R) /* 0x90 = absorb all horizontal size change */ -/* Flags for Option.min used (3) for EndMark: */ +/* Flags for Option.min used (4) for EndMark: */ #define NO_OK (1 << 1) #define NO_CANCEL (1 << 2) #define MODAL 1 #define NONMODAL 0 +/* Board widget numbers, MUST correspond to mainOptions array */ + +#define W_MENU 0 // main menu bar +#define W_ENGIN 6 // engine menu +#define W_TITLE 10 +#define W_WHITE 12 +#define W_BLACK 13 +#define W_SMALL 15 // title in small layout +#define W_MESSG 16 +#define W_BUTTON 17 // button bar +#define W_PAUSE 20 +#define W_BOARD 24 +#define W_MENUW 25 +#define W_MENUB 26 +#define W_DROP 27 // drop (popup) menu + + + typedef enum { // identifier of dialogs done by GenericPopup TransientDlg=0, // transient: grabs mouse events and is destroyed at pop-down (so other dialog can use this ID next time) -CommentDlg, TagsDlg, TextMenuDlg, InputBoxDlg, NoDlg, BrowserDlg, HistoryDlg, // persistent: no grab and reused +CommentDlg, TagsDlg, TextMenuDlg, InputBoxDlg, ChatDlg, DummyDlg, HistoryDlg, // persistent: no grab and reused +GameListDlg, +EngOutDlg, +EvalGraphDlg, PromoDlg, // this and beyond are destroyed at pop-down ErrorDlg, AskDlg, // this and beyond do grab mouse events (and are destroyed) FatalDlg, BoardWindow, +BrowserDlg, NrOfDialogs // dummy for total } DialogClass; typedef Option *PointerCallback(int n, int x, int y); +typedef void ListBoxCallback(int n, int selected); typedef void ButtonCallback(int n); typedef int OKCallback(int n); @@ -102,17 +124,19 @@ extern int values[]; extern ChessProgramState *currentCps; extern int dialogError; extern ButtonCallback *comboCallback; +extern void *userLogo; -extern WindowPlacement wpComment, wpTags, wpMoveHistory; +extern WindowPlacement wpComment, wpTags, wpMoveHistory, wpMain; extern char *marked[]; extern Boolean shellUp[]; extern Option textOptions[], typeOptions[]; int DialogExists P((DialogClass n)); -int GenericPopUp P((Option *option, char *title, DialogClass dlgNr, DialogClass parent, int modal)); +int GenericPopUp P((Option *option, char *title, DialogClass dlgNr, DialogClass parent, int modal, int topLevel)); int GenericReadout P((Option *currentOption, int selected)); int PopDown P((DialogClass n)); +void MarkMenu P((char *item, int dlgNr)); int AppendText P((Option *opt, char *s)); void SetColor P((char *colorName, Option *box)); void ColorChanged P((Widget w, XtPointer data, XEvent *event, Boolean *b)); @@ -122,6 +146,7 @@ void GetWidgetText P((Option *opt, char **buf)); void SetWidgetText P((Option *opt, char *buf, int n)); void GetWidgetState P((Option *opt, int *state)); void SetWidgetState P((Option *opt, int state)); +void SetWidgetLabel P((Option *opt, char *buf)); void SetDialogTitle P((DialogClass dlg, char *title)); void LoadListBox P((Option *opt, char *emptyText)); void HighlightListBoxItem P((Option *opt, int nr)); @@ -135,14 +160,32 @@ int ReadScroll P((Option *opt, float *top, float *bottom)); void SetScroll P((Option *opt, float f)); void AddHandler P((Option *opt, int nr)); void SendText P((int n)); +void DisplayLogos P((void *left, void *right)); +void Browse P((DialogClass dlg, char *label, char *proposed, char *ext, + Boolean pathFlag, char *mode, char **name, FILE **fp)); void InitDrawingParams P(()); // in xboard.c +void DrawLogo P((void *handle, void *logo)); void ErrorPopUp P((char *title, char *text, int modal)); int ShiftKeys P((void)); +void SetClockIcon P((int color)); +void DelayedLoad P((void)); +void DisplayTimerLabel P((Option *opt, char *color, long timer, int highlight)); +void SetWindowTitle P((char *text, char *title, char *icon)); +void SetupDropMenu P((void)); +Option *BoardPopUp P((int squareSize, int lineGap, void *clockFontThingy)); int SetCurrentComboSelection P((Option *opt)); void BoxAutoPopUp P((char *buf)); void IcsKey P((int n)); void ICSInputBoxPopUp P((void)); +void LoadOptionsPopUp P((DialogClass parent)); +void GameListOptionsPopUp P((DialogClass parent)); +void RefreshColor P((int source, int n)); +void SendString P((char *p)); + +// in ngamelist.c +int GameListClicks P((int direction)); +void SetFilter P((void));