SYCL: Avoid using no_init read accessor in rocFFT
[alexxy/gromacs.git] / src / programs / view / xdlgitem.h
1 /*
2  * This file is part of the GROMACS molecular simulation package.
3  *
4  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
5  * Copyright (c) 2001-2004, The GROMACS development team.
6  * Copyright (c) 2013,2014,2019,2021, by the GROMACS development team, led by
7  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
8  * and including many others, as listed in the AUTHORS file in the
9  * top-level source directory and at http://www.gromacs.org.
10  *
11  * GROMACS is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU Lesser General Public License
13  * as published by the Free Software Foundation; either version 2.1
14  * of the License, or (at your option) any later version.
15  *
16  * GROMACS is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19  * Lesser General Public License for more details.
20  *
21  * You should have received a copy of the GNU Lesser General Public
22  * License along with GROMACS; if not, see
23  * http://www.gnu.org/licenses, or write to the Free Software Foundation,
24  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
25  *
26  * If you want to redistribute modifications to GROMACS, please
27  * consider that scientific software is very special. Version
28  * control is crucial - bugs must be traceable. We will be happy to
29  * consider code for inclusion in the official distribution, but
30  * derived work must not be called official GROMACS. Details are found
31  * in the README & COPYING files - if they are missing, get the
32  * official version at http://www.gromacs.org.
33  *
34  * To help us fund GROMACS development, we humbly ask that you cite
35  * the research papers on the package. Check out http://www.gromacs.org.
36  */
37
38 #ifndef _xdlgitem_h
39 #define _xdlgitem_h
40
41 #include "Xstuff.h"
42 #include "x11.h"
43 #include "xutil.h"
44
45 typedef enum
46 {
47     edlgBN,
48     edlgRB,
49     edlgGB,
50     edlgCB,
51     edlgPM,
52     edlgST,
53     edlgET,
54     edlgNR
55 } edlgitem;
56 #define XCARET 2
57
58 enum
59 {
60     ITEMOK,
61     RBPRESSED,
62     BNPRESSED,
63     CBPRESSED,
64     ETCHANGED,
65     HELPPRESSED,
66     ENTERPRESSED
67 };
68
69 typedef int t_id;
70
71 typedef struct
72 {
73     bool bDefault; /* This is the default button */
74 } t_button;
75
76 typedef struct
77 {
78     bool bSelect; /* Is this rb selected ? */
79 } t_radiobutton;
80
81 typedef struct
82 {
83     bool bChecked; /* Is this cb checked ? */
84 } t_checkbox;
85
86 typedef struct
87 {
88     Pixmap pm; /* The pixmap bits */
89 } t_pixmap;
90
91 typedef struct
92 {
93     int    nlines;
94     char** lines;
95 } t_statictext;
96
97 typedef struct
98 {
99     int buflen, strbegin; /* Length of the screen buf and begin of string  */
100     int pos;              /* Current length of the string and pos of caret */
101     /* Pos is relative to strbegin, and is the pos   */
102     /* in the window.                                */
103     bool  bChanged;
104     char* buf;
105 } t_edittext;
106
107 typedef struct
108 {
109     int   nitems;
110     t_id* item;
111 } t_groupbox;
112
113
114 typedef struct t_dlgitem
115 {
116     t_windata win;
117     t_id      ID, GroupID;
118     bool      bUseMon;
119     char *    set, *get, *help;
120     edlgitem  type;
121     int (*WndProc)(t_x11* x11, struct t_dlgitem* dlgitem, XEvent* event);
122     union
123     {
124         t_button      button;
125         t_radiobutton radiobutton;
126         t_groupbox    groupbox;
127         t_checkbox    checkbox;
128         t_pixmap      pixmap;
129         t_statictext  statictext;
130         t_edittext    edittext;
131     } u;
132 } t_dlgitem;
133
134 /*****************************
135  *
136  * Routines to create dialog items, all items have an id
137  * which you can use to extract info. It is possible to have
138  * multiple items with the same id but it may then not be possible
139  * to extract information.
140  * All routines take the position relative to the parent dlg
141  * and the size and border width.
142  * If the width and height are set to zero initially, they will
143  * be calculated and set by the routine. With the dlgitem manipulation
144  * routines listed below, the application can then move the items around
145  * on the dlg box, and if wished resize them.
146  *
147  ****************************/
148 extern t_dlgitem*
149 CreateButton(t_x11* x11, const char* szLab, bool bDef, t_id id, t_id groupid, int x0, int y0, int w, int h, int bw);
150
151 extern t_dlgitem*
152 CreateRadioButton(t_x11* x11, const char* szLab, bool bSet, t_id id, t_id groupid, int x0, int y0, int w, int h, int bw);
153
154 extern t_dlgitem*
155 CreateGroupBox(t_x11* x11, const char* szLab, t_id id, int nitems, t_id items[], int x0, int y0, int w, int h, int bw);
156
157 extern t_dlgitem* CreateCheckBox(t_x11*      x11,
158                                  const char* szLab,
159                                  bool        bCheckedInitial,
160                                  t_id        id,
161                                  t_id        groupid,
162                                  int         x0,
163                                  int         y0,
164                                  int         w,
165                                  int         h,
166                                  int         bw);
167
168 extern t_dlgitem* CreatePixmap(Pixmap pm, t_id id, t_id groupid, int x0, int y0, int w, int h, int bw);
169
170 extern t_dlgitem* CreateStaticText(t_x11*             x11,
171                                    int                nlines,
172                                    const char* const* lines,
173                                    t_id               id,
174                                    t_id               groupid,
175                                    int                x0,
176                                    int                y0,
177                                    int                w,
178                                    int                h,
179                                    int                bw);
180
181 extern t_dlgitem* CreateEditText(t_x11*      x11,
182                                  const char* title,
183                                  int         screenbuf,
184                                  char*       buf,
185                                  t_id        id,
186                                  t_id        groupid,
187                                  int         x0,
188                                  int         y0,
189                                  int         w,
190                                  int         h,
191                                  int         bw);
192
193 extern void SetDlgitemOpts(t_dlgitem* dlgitem, bool bUseMon, char* set, char* get, char* help);
194
195 #endif /* _xdlgitem_h */