*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2019, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
#include "xdlgitem.h"
-#define DLG_SHOW (1<<0)
-#define DLG_HIDE (1<<1)
-#define DLG_SHOWANDHIDE (DLG_SHOW | DLG_HIDE)
-#define DLG_SYSTEMMODAL (1<<2)
-#define DLG_APPLMODAL (1<<3)
-#define DLG_HIDEONBUTTON (1<<4)
-#define DLG_FREEONBUTTON (1<<5)
-
-enum {
- DLG_SET, DLG_EXIT
+#define DLG_SHOW (1 << 0)
+#define DLG_HIDE (1 << 1)
+#define DLG_SHOWANDHIDE (DLG_SHOW | DLG_HIDE)
+#define DLG_SYSTEMMODAL (1 << 2)
+#define DLG_APPLMODAL (1 << 3)
+#define DLG_HIDEONBUTTON (1 << 4)
+#define DLG_FREEONBUTTON (1 << 5)
+
+enum
+{
+ DLG_SET,
+ DLG_EXIT
};
-typedef void DlgCallback (t_x11 *x11, int dlg_mess, int item_id,
- char *set, void *data);
+typedef void DlgCallback(t_x11* x11, int dlg_mess, int item_id, char* set, void* data);
/* User function that can be called by the dialog box. All setting of
* check-boxes and radio-buttons etc., is done by the dialog manager,
* the user can let himself be informed about mouse activity also.
*/
-typedef struct {
- t_x11 *x11; /* All about X */
- t_windata win; /* The position and size of the window */
- char *title; /* Window name */
- Window wDad; /* The parent window */
- unsigned int xmax, ymax; /* Dimensions of parent window */
- unsigned long flags; /* Flags for display */
- unsigned long fg, bg; /* The colours */
- bool bPop; /* Should we pop the mouse back */
- bool bGrab; /* Have we grabbed the mouse ? */
- int nitem; /* The number of items */
- t_dlgitem **dlgitem; /* The array of item pointers */
- DlgCallback *cb; /* User call back function */
- void *data; /* User data */
+typedef struct
+{
+ t_x11* x11; /* All about X */
+ t_windata win; /* The position and size of the window */
+ char* title; /* Window name */
+ Window wDad; /* The parent window */
+ unsigned int xmax, ymax; /* Dimensions of parent window */
+ unsigned long flags; /* Flags for display */
+ unsigned long fg, bg; /* The colours */
+ bool bPop; /* Should we pop the mouse back */
+ bool bGrab; /* Have we grabbed the mouse ? */
+ int nitem; /* The number of items */
+ t_dlgitem** dlgitem; /* The array of item pointers */
+ DlgCallback* cb; /* User call back function */
+ void* data; /* User data */
} t_dlg;
/*****************************
* cb and data may be NULL.
*
****************************/
-t_dlg *CreateDlg(t_x11 *x11, Window Parent, const char *title,
- int x0, int y0, int w, int h, int bw,
- DlgCallback *cb, void *data);
+t_dlg* CreateDlg(t_x11* x11, Window Parent, const char* title, int x0, int y0, int w, int h, int bw, DlgCallback* cb, void* data);
/*****************************
*
* the item itself may not be freed until the dlg is done with
*
****************************/
-void AddDlgItem(t_dlg *dlg, t_dlgitem *item);
+void AddDlgItem(t_dlg* dlg, t_dlgitem* item);
-void AddDlgItems(t_dlg *dlg, int nitem, t_dlgitem *item[]);
+void AddDlgItems(t_dlg* dlg, int nitem, t_dlgitem* item[]);
/*****************************
*
* false will mean most of the time, that item id was not found
*
****************************/
-bool QueryDlgItemSize(t_dlg *dlg, t_id id, int *w, int *h);
+bool QueryDlgItemSize(t_dlg* dlg, t_id id, int* w, int* h);
-bool QueryDlgItemPos(t_dlg *dlg, t_id id, int *x0, int *y0);
+bool QueryDlgItemPos(t_dlg* dlg, t_id id, int* x0, int* y0);
-int QueryDlgItemX(t_dlg *dlg, t_id id);
+int QueryDlgItemX(t_dlg* dlg, t_id id);
-int QueryDlgItemY(t_dlg *dlg, t_id id);
+int QueryDlgItemY(t_dlg* dlg, t_id id);
-int QueryDlgItemW(t_dlg *dlg, t_id id);
+int QueryDlgItemW(t_dlg* dlg, t_id id);
-int QueryDlgItemH(t_dlg *dlg, t_id id);
+int QueryDlgItemH(t_dlg* dlg, t_id id);
-bool SetDlgItemSize(t_dlg *dlg, t_id id, int w, int h);
+bool SetDlgItemSize(t_dlg* dlg, t_id id, int w, int h);
-bool SetDlgItemPos(t_dlg *dlg, t_id id, int x0, int y0);
+bool SetDlgItemPos(t_dlg* dlg, t_id id, int x0, int y0);
-void SetDlgSize(t_dlg *dlg, int w, int h, bool bAutoPosition);
+void SetDlgSize(t_dlg* dlg, int w, int h, bool bAutoPosition);
/*****************************
*
* after dlg is exec'ed
*
****************************/
-bool IsCBChecked(t_dlg *dlg, t_id id);
+bool IsCBChecked(t_dlg* dlg, t_id id);
-t_id RBSelected(t_dlg *dlg, int gid);
+t_id RBSelected(t_dlg* dlg, int gid);
-int EditTextLen(t_dlg *dlg, t_id id);
+int EditTextLen(t_dlg* dlg, t_id id);
-char *EditText(t_dlg *dlg, t_id id);
+char* EditText(t_dlg* dlg, t_id id);
/*****************************
*
* Routines to do internal things
*
****************************/
-t_dlgitem *FindWin(t_dlg *dlg, Window win);
+t_dlgitem* FindWin(t_dlg* dlg, Window win);
-t_dlgitem *FindItem(t_dlg *dlg, t_id id);
+t_dlgitem* FindItem(t_dlg* dlg, t_id id);
-void HelpDlg(t_dlg *dlg);
+void HelpDlg(t_dlg* dlg);
-void HelpNow(t_dlg *dlg, t_dlgitem *dlgitem);
+void HelpNow(t_dlg* dlg, t_dlgitem* dlgitem);
-void NoHelp(t_dlg *dlg);
+void NoHelp(t_dlg* dlg);
/*****************************
*
* return value is the ID of the button
*
****************************/
-void ShowDlg(t_dlg *dlg);
+void ShowDlg(t_dlg* dlg);
-void HideDlg(t_dlg *dlg);
+void HideDlg(t_dlg* dlg);
-void FreeDlgItem(t_dlg *dlg, t_id id);
+void FreeDlgItem(t_dlg* dlg, t_id id);
-void FreeDlg(t_dlg *dlg);
+void FreeDlg(t_dlg* dlg);
-#endif /* _xdlg_h */
+#endif /* _xdlg_h */