2 * Grace - GRaphing, Advanced Computation and Exploration of data
4 * Home page: http://plasma-gate.weizmann.ac.il/Grace/
6 * Copyright (c) 2012 Grace Development Team
8 * Maintained by Evgeny Stambulchik
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
37 #include <X11/Intrinsic.h>
38 #endif /* MOTIF_GUI */
41 #include "qtgui/qtinc.h"
45 typedef void (*Timer_CBProc
)(void *anydata
);
47 unsigned long timer_id
;
48 unsigned long interval
;
52 Timer_CBdata
*CreateTimer(unsigned long interval
, Timer_CBProc cbproc
, void *anydata
);
53 void TimerStart(Timer_CBdata
*cbdata
);
56 void WidgetManage(Widget w
);
57 void WidgetUnmanage(Widget w
);
58 int WidgetIsManaged(Widget w
);
59 void *WidgetGetUserData(Widget w
);
60 void WidgetSetUserData(Widget w
, void *udata
);
61 void WidgetSetSensitive(Widget w
, int onoff
);
62 void WidgetSetFocus(Widget w
);
63 void WidgetSetWidth(Widget w
, unsigned int width
);
64 void WidgetSetHeight(Widget w
, unsigned int height
);
65 void WidgetSetSize(Widget w
, unsigned int width
, unsigned int height
);
66 void WidgetGetSize(Widget w
, unsigned int *width
, unsigned int *height
);
68 typedef void (*Key_CBProc
)(void *anydata
);
77 void AddWidgetKeyPressCB(Widget w
, int key
, Key_CBProc cbproc
, void *anydata
);
78 void AddWidgetKeyPressCB2(Widget w
, int modifiers
, int key
, Key_CBProc cbproc
, void *anydata
);
80 void AddWidgetButtonPressCB(Widget w
, int button
, Key_CBProc cbproc
, void *anydata
);
87 typedef struct _Widget_CBData Widget_CBData
;
88 typedef void (*Widget_CBProc
)(Widget_CBData
*wcbdata
);
89 struct _Widget_CBData
{
95 void AddWidgetCB(Widget w
, const char *callback
, Widget_CBProc cbproc
, void *anydata
);
98 Widget
CreateDialogWindow(Widget parent
, const char *s
);
101 Widget
CreateDialog(Widget parent
, const char *s
);
102 void DialogRaise(Widget form
);
103 void DialogClose(Widget form
);
104 void DialogSetResizable(Widget form
, int onoff
);
106 /* File selection box */
107 Widget
CreateFileSelectionBox(Widget parent
);
109 /* File selection filter */
110 void CreateFileSelectionFilter(Widget parent
, Widget fsb
);
112 /* File selection dialog */
117 FSBStructure
*CreateFSBDialog(Widget parent
, char *s
);
119 typedef int (*FSB_CBProc
)(
121 char *, /* filename */
122 void * /* data the application registered */
124 void AddFSBDialogCB(FSBStructure
*fsbp
, FSB_CBProc cbproc
, void *anydata
);
125 void FSBDialogSetPattern(FSBStructure
*fsb
, char *pattern
);
126 void FSBDialogSetDirectory(FSBStructure
*fsb
, char *directory
);
129 Widget
CreateVContainer(Widget parent
);
130 Widget
CreateHContainer(Widget parent
);
133 Widget
CreateForm(Widget parent
);
134 void FormAddHChild(Widget form
, Widget child
);
135 void FormAddVChild(Widget form
, Widget child
);
136 void FormFixateHChild(Widget w
);
137 void FormFixateVChild(Widget w
);
140 Widget
CreateGrid(Widget parent
, int ncols
, int nrows
);
141 void PlaceGridChild(Widget grid
, Widget w
, int col
, int row
);
144 Widget
CreateFrame(Widget parent
, char *s
);
146 /* Scrolled window */
147 Widget
CreateScrolledWindow(Widget parent
);
150 Widget
CreatePanedWindow(Widget parent
);
151 void PanedWindowSetMinWidth(Widget w
, unsigned int width
);
154 Widget
CreateTab(Widget parent
);
155 Widget
CreateTabPage(Widget parent
, char *s
);
156 void SelectTabPage(Widget tab
, Widget w
);
159 Widget
CreateSeparator(Widget parent
);
162 Widget
CreateLabel(Widget parent
, char *s
);
163 void LabelSetString(Widget w
, char *s
);
164 void LabelSetPixmap(Widget w
, Pixmap pixmap
);
167 Widget
CreateLineTextEdit(Widget parent
, int len
);
168 Widget
CreateMultiLineTextEdit(Widget parent
, int nrows
);
169 char *TextEditGetString(Widget w
);
170 void TextEditSetString(Widget w
, char *s
);
180 void TextInsertString(TextStructure
*cst
, int pos
, char *s
);
181 int TextGetCursorPos(TextStructure
*cst
);
182 void TextSetCursorPos(TextStructure
*cst
, int pos
);
183 int TextGetLastPosition(TextStructure
*cst
);
184 void TextSetLength(TextStructure
*cst
, int len
);
185 void TextSetEditable(TextStructure
*cst
, int onoff
);
188 typedef void (*Button_CBProc
)(
190 void * /* data the application registered */
192 Widget
CreateButton(Widget parent
, char *label
);
193 Widget
CreateBitmapButton(Widget parent
,
194 int width
, int height
, const unsigned char *bits
);
198 Widget
CreateArrowButton(Widget parent
, int arrow_type
);
201 typedef void (*TB_CBProc
)(
203 int onoff
, /* True/False */
204 void * /* data the application registered */
206 Widget
CreateToggleButton(Widget parent
, char *s
);
207 int ToggleButtonGetState(Widget w
);
208 void ToggleButtonSetState(Widget w
, int value
);
211 Widget
CreateScale(Widget parent
, char *s
, int min
, int max
, int delta
);
212 void ScaleSetValue(Widget w
, int value
);
213 int ScaleGetValue(Widget w
);
220 ComboBoxStructure
*CreateComboBox(Widget parent
);
223 typedef struct _OptionStructure OptionStructure
;
228 unsigned long background
;
229 unsigned long foreground
;
231 OptionStructure
*CreateOptionChoice(Widget parent
, char *labelstr
, int ncols
,
232 int nchoices
, LabelOptionItem
*items
);
233 void UpdateOptionChoice(OptionStructure
*optp
, int nchoices
, LabelOptionItem
*items
);
234 OptionStructure
*CreateLabelOptionChoice(Widget parent
, char *labelstr
, int ncols
,
235 int nchoices
, LabelOptionItem
*items
);
236 OptionStructure
*CreateLabelOptionChoiceVA(Widget parent
, char *labelstr
, ...);
237 void UpdateLabelOptionChoice(OptionStructure
*optp
, int nchoices
, LabelOptionItem
*items
);
241 unsigned char *bitmap
;
243 OptionStructure
*CreateBitmapOptionChoice(Widget parent
, char *labelstr
, int ncols
,
244 int nchoices
, int width
, int height
, BitmapOptionItem
*items
);
245 OptionStructure
*CreateCharOptionChoice(Widget parent
, char *s
);
246 void UpdateCharOptionChoice(OptionStructure
*opt
, int font
);
247 void SetOptionChoice(OptionStructure
*opt
, int value
);
248 int GetOptionChoice(OptionStructure
*opt
);
249 void OptionChoiceSetColorUpdate(OptionStructure
*opt
, int update
);
251 typedef void (*OC_CBProc
)(
252 OptionStructure
*opt
,
253 int value
, /* value */
254 void * /* data the application registered */
258 OptionStructure
*opt
;
263 struct _OptionStructure
{
265 int ncols
; /* preferred number of columns */
268 LabelOptionItem
*items
;
275 void AddOptionChoiceCB(OptionStructure
*opt
, OC_CBProc cbproc
, void *anydata
);
278 Widget
CreatePopupMenu(Widget parent
);
279 void PopupMenuShow(Widget w
, void *data
);
280 Widget
CreateMenuBar(Widget parent
);
281 Widget
CreateMenu(Widget parent
, char *label
, char mnemonic
, int help
);
282 Widget
CreateMenuButton(Widget parent
, char *label
, char mnemonic
,
283 Button_CBProc cb
, void *data
);
284 Widget
CreateMenuButtonA(Widget parent
, char *label
, char mnemonic
,
285 char *accelerator
, char* acceleratorText
, Button_CBProc cb
, void *data
);
286 Widget
CreateMenuHelpButton(Widget parent
, char *label
, char mnemonic
,
287 Widget form
, char *ha
);
288 Widget
CreateMenuToggle(Widget parent
, char *label
, char mnemonic
,
289 TB_CBProc cb
, void *data
);
290 Widget
CreateMenuSeparator(Widget parent
);
292 #endif /* __WIDGETS_H_ */