2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these libraries and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 /* util.h 1.5 - Fujitsu source for CDEnext 96/09/18 13:59:22 */
24 /* $XConsortium: util.h /main/5 1996/09/19 19:42:11 cde-fuj $ */
26 * (c) Copyright 1995 FUJITSU LIMITED
27 * This is source code modified by FUJITSU LIMITED under the Joint
28 * Development Agreement for the CDEnext PST.
29 * This is unpublished proprietary source code of FUJITSU LIMITED
33 #include <Xm/XmStrDefs.h>
36 #define RowMarginWidth 11
37 #define MarginHeight 11
39 #define MinimumSpace 4
41 /***** Exclusive Set *****/
42 typedef struct _ToggleButt {
52 #define EXARGS( clientdata, name, sensitive, cb, set ){ \
55 (XtPointer) clientdata, \
57 (XtArgVal) sensitive, \
58 (XtCallbackProc) cb, \
62 typedef struct _RadioButt {
72 #define EXCLUSIVE(a) { 0, a, XtNumber(a), 0, 0, 0 }
74 #define ExclusiveItems ToggleButt
75 #define Exclusive RadioButt
77 #define SetItemLabel(b,n,l) (b)->items[(n)].label = (l)
79 /***** PushButton Set *****/
81 typedef struct _ButtonItems {
90 #define BTNARGS( cb, clientdata, mnumonic, sensitive, deflt ) { \
92 (XtCallbackProc) cb, \
93 (XtPointer) clientdata, \
94 (XtArgVal) mnumonic, \
95 (XtArgVal) sensitive, \
99 typedef struct _Button {
105 #define BUTTONS( items ) { 0, items, XtNumber(items) }
107 /***** MenuButton Set *****/
109 typedef struct _menuButtonItems {
115 #define MENUBTNARGS( mnumonic ) { \
121 typedef struct _MButton {
122 menuButtonItems *items;
126 #define MBUTTONS(items) {items,XtNumber((items))}
129 /***** NoticeButton Set *****/
131 typedef struct _NoticeButton {
136 #define NBTNARGS( cb, clientdata, mnumonic, sensitive, deflt) { \
141 typedef struct _NButton {
146 #define NBUTTONS(items) {items,XtNumber((items))}
149 /***** TextField Set *****/
151 typedef struct _TextField {
158 /***** Function Type *****/
160 #define D_WARNING XmDIALOG_WARNING
161 #define D_QUESTION XmDIALOG_QUESTION
162 #define D_ERROR XmDIALOG_ERROR
163 #define D_TEMPLATE XmDIALOG_TEMPLATE
164 #define L_VERTICAL XmVERTICAL
165 #define L_HORIZONTAL XmHORIZONTAL
169 #define AddLeftAttachWidget( w, ref, offset ) XtVaSetValues( w, \
170 XmNleftAttachment, XmATTACH_WIDGET, \
171 XmNleftWidget, ref, \
172 XmNleftOffset, offset, \
175 #define AddLeftAttachForm( w, offset ) XtVaSetValues( w, \
176 XmNleftAttachment, XmATTACH_FORM, \
177 XmNleftOffset, offset, \
180 #define AddTopAttachWidget( w, ref, offset ) XtVaSetValues( w, \
181 XmNtopAttachment, XmATTACH_WIDGET, \
183 XmNtopOffset, offset, \
186 #define AddTopAttachForm( w, offset ) XtVaSetValues( w, \
187 XmNtopAttachment, XmATTACH_FORM, \
188 XmNtopOffset, offset, \
191 #define AddRightAttachWidget( w, ref, offset ) XtVaSetValues( w, \
192 XmNrightAttachment, XmATTACH_WIDGET, \
193 XmNrightWidget, ref, \
194 XmNrightOffset, offset, \
197 #define AddRightAttachForm( w, offset ) XtVaSetValues( w, \
198 XmNrightAttachment, XmATTACH_FORM, \
199 XmNrightOffset, offset, \
202 #define AddBottomAttachForm( w, offset ) XtVaSetValues( w, \
203 XmNbottomAttachment, XmATTACH_FORM, \
204 XmNbottomOffset, offset, \
206 #endif /* USE_MACRO */
209 extern Widget CreateDrawingArea(Widget owner,
215 extern Widget CreateDialogAndButtons(Widget owner,
221 extern String GetTextFieldValue(TextField *textf);
222 extern Widget CreateTemplateDialog(Widget w,
228 extern Widget CreateScrollBase(Widget owner,
236 Widget CreateCaptionFrame(Widget owner,
241 void CreateTextField(Widget owner,
246 void CreateMenuButtons(Widget owner, Button *buttons, int buttons_cnt);
247 Widget GuiInitialize(XtAppContext *app,
251 void AddLeftAttachWidget(Widget w, Widget ref, int offset);
252 void AddLeftAttachForm(Widget w, int offset);
253 void AddTopAttachWidget(Widget w, Widget ref, int offset);
254 void AddTopAttachForm(Widget w, int offset);
255 void AddRightAttachWidget(Widget w, Widget ref, int offset);
256 void AddRightAttachForm(Widget w, int offset);
257 void AddBottomAttachForm(Widget w, int offset);
258 void PopupDialog(Widget w);
259 void PopdownDialog(Widget w);
260 void ForcePopdownDialog(Widget w);
261 void SetLabelString(Widget w, String str);
262 void SetFooterString(Widget w, String str);
263 void PopupNotice(Widget owner,
269 void AddDeleteProc(Widget w, void (*delcb)());
270 Widget CreateMenuBarAndFooterMessageForm(Widget owner,
276 Widget GetMenuWidget(MButton *buttons, int buttons_num);
277 Widget CreateForm(Widget owner, String name);
278 Widget CreateLabel(Widget owner, String name, String str);
279 Widget CreateFrame(Widget owner,
283 Widget CreateRowColumn(Widget owner,
289 Widget CreateScrollBar(Widget owner,