1 /*------------------------------------------------------------\
2 | |
3 | This file is part of the Alliance CAD System Copyright |
4 | (C) Laboratoire LIP6 - D�partement ASIM Universite P&M Curie|
5 | |
6 | Home page : http://www-asim.lip6.fr/alliance/ |
7 | E-mail : mailto:alliance-users@asim.lip6.fr |
8 | |
9 | This progam is free software; you can redistribute it |
10 | and/or modify it under the terms of the GNU General Public |
11 | License as published by the Free Software Foundation; |
12 | either version 2 of the License, or (at your option) any |
13 | later version. |
14 | |
15 | Alliance VLSI CAD System is distributed in the hope that |
16 | it will be useful, but WITHOUT ANY WARRANTY; |
17 | without even the implied warranty of MERCHANTABILITY or |
18 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
19 | Public License for more details. |
20 | |
21 | You should have received a copy of the GNU General Public |
22 | License along with the GNU C Library; see the file COPYING. |
23 | If not, write to the Free Software Foundation, Inc., |
24 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
25 | |
26 \------------------------------------------------------------*/
27
28 /*------------------------------------------------------------\
29 | |
30 | Tool : GRAAL |
31 | |
32 | File : Panel.c |
33 | |
34 | Author : Jacomme Ludovic |
35 | |
36 | Date : 28.03.95 |
37 | |
38 \------------------------------------------------------------*/
39
40 /*------------------------------------------------------------\
41 | |
42 | Include Files |
43 | |
44 \------------------------------------------------------------*/
45
46 # include <stdio.h>
47 # include <X11/Intrinsic.h>
48 # include <Xm/Xm.h>
49 # include <Xm/Frame.h>
50 # include <Xm/Form.h>
51 # include <Xm/List.h>
52 # include <Xm/Text.h>
53 # include <Xm/TextF.h>
54 # include <Xm/PushB.h>
55 # include <Xm/DialogS.h>
56 # include <Xm/Label.h>
57 # include <Xm/LabelG.h>
58
59 # include "mut.h"
60 # include "mph.h"
61 # include "rds.h"
62 # include "rpr.h"
63 # include "GSB.h"
64 # include "GTB.h"
65 # include "GMX.h"
66 # include "GMH.h"
67
68 # include "GMH_panel.h"
69 # include "GME_dialog.h"
70 # include "LIP6bw.h"
71
72 /*------------------------------------------------------------\
73 | |
74 | Constants |
75 | |
76 \------------------------------------------------------------*/
77 /*------------------------------------------------------------\
78 | |
79 | Types |
80 | |
81 \------------------------------------------------------------*/
82 /*------------------------------------------------------------\
83 | |
84 | Variables |
85 | |
86 \------------------------------------------------------------*/
87
88 GraalPanelItem GraalHelpPresentPanel =
89
90 {
91 "Graal present",
92 1,
93 0,
94 GRAAL_HELP_PRESENT_X,
95 GRAAL_HELP_PRESENT_Y,
96 700,
97 360,
98 1,
99 1,
100 (Widget)NULL,
101 (Widget)NULL,
102 (Widget)NULL,
103 (Widget)NULL,
104 0,
105 (GraalPanelButtonItem *)NULL
106 };
107
108 int GraalHelpPresentDefaultValues[ 5 ] =
109
110 {
111 GRAAL_HELP_PRESENT_X,
112 GRAAL_HELP_PRESENT_Y,
113 700, 360, 0
114 };
115
116
117
118 /*------------------------------------------------------------\
119 | |
120 | Functions |
121 | |
122 \------------------------------------------------------------*/
123 /*------------------------------------------------------------\
124 | |
125 | GraalBuildPresentPanel |
126 | |
127 \------------------------------------------------------------*/
128
GraalBuildPresentPanel()129 void GraalBuildPresentPanel()
130
131 {
132 Widget PanelLabel;
133 Widget PanelButton;
134 Pixmap PanelPixmap;
135 XmString PanelString;
136 XmString PanelString1;
137 XmString PanelString2;
138 XmFontList PanelFontList;
139 XFontStruct *PanelFont;
140 Display *PanelDisplay;
141 char Buffer[ 64 ];
142 Arg Args[3];
143
144 rdsbegin();
145
146 PanelDisplay = XtDisplay( GraalMainWindow );
147 PanelFont = XLoadQueryFont( PanelDisplay, "-*-helvetica-bold-o-*--24-*" );
148 PanelFontList = XmFontListCreate( PanelFont, "Panel_charset1" );
149 PanelFont = XLoadQueryFont( PanelDisplay, "-*-helvetica-bold-r-*--18-*" );
150 PanelFontList = XmFontListAdd( PanelFontList, PanelFont, "Panel_charset2" );
151 PanelFont = XLoadQueryFont( PanelDisplay, "-*-helvetica-bold-r-*--12-*" );
152 PanelFontList = XmFontListAdd( PanelFontList, PanelFont, "Panel_charset4" );
153
154 XtSetArg( Args[0], XmNshadowType , XmSHADOW_ETCHED_IN );
155 XtSetArg( Args[1], XmNdeleteResponse, XmDO_NOTHING );
156 XtSetArg( Args[2], XmNtitle , "Graal present" );
157
158 GraalHelpPresentPanel.PANEL =
159
160 XmCreateFormDialog( GraalMainWindow, GraalHelpPresentPanel.TITLE, Args, 3);
161
162 XtAddCallback( GraalHelpPresentPanel.PANEL, XmNdestroyCallback,
163 GraalDestroyDialogCallback, NULL );
164
165 GraalHelpPresentPanel.PANEL_FORM =
166
167 XtVaCreateManagedWidget( "",
168 xmFormWidgetClass,
169 GraalHelpPresentPanel.PANEL,
170 XmNtopAttachment , XmATTACH_FORM,
171 XmNbottomAttachment , XmATTACH_FORM,
172 XmNleftAttachment , XmATTACH_FORM,
173 XmNrightAttachment , XmATTACH_FORM,
174 NULL
175 );
176
177 GraalHelpPresentPanel.FRAME =
178
179 XtVaCreateManagedWidget( "",
180 xmFrameWidgetClass,
181 GraalHelpPresentPanel.PANEL_FORM,
182 XmNtopAttachment , XmATTACH_POSITION,
183 XmNtopPosition , 05,
184 XmNbottomAttachment, XmATTACH_POSITION,
185 XmNbottomPosition , 95,
186 XmNleftAttachment , XmATTACH_POSITION,
187 XmNleftPosition , 05,
188 XmNrightAttachment , XmATTACH_POSITION,
189 XmNrightPosition , 95,
190 NULL
191 );
192
193 GraalHelpPresentPanel.FORM =
194
195 XtVaCreateManagedWidget( "",
196 xmFormWidgetClass,
197 GraalHelpPresentPanel.FRAME,
198 XmNtopAttachment , XmATTACH_POSITION,
199 XmNtopPosition , 05,
200 XmNbottomAttachment, XmATTACH_POSITION,
201 XmNbottomPosition , 95,
202 XmNleftAttachment , XmATTACH_POSITION,
203 XmNleftPosition , 05,
204 XmNrightAttachment , XmATTACH_POSITION,
205 XmNrightPosition , 95,
206 NULL
207 );
208
209 PanelPixmap = GraalCreatePixmap( GraalMainWindow,
210 LIP6bw_bits,
211 LIP6bw_width,
212 LIP6bw_height);
213
214
215 PanelLabel = XtVaCreateManagedWidget( "",
216 xmLabelGadgetClass,
217 GraalHelpPresentPanel.FORM,
218 XmNlabelType , XmPIXMAP,
219 XmNlabelPixmap , PanelPixmap,
220 NULL
221 );
222
223 sprintf( Buffer, "ALLIANCE CAD SYSTEM %s\n", ALLIANCE_VERSION );
224
225 PanelString = XmStringCreateLtoR( Buffer, "Panel_charset2" );
226
227 PanelLabel = XtVaCreateManagedWidget( "",
228 xmLabelWidgetClass,
229 GraalHelpPresentPanel.FORM,
230 XmNfontList , PanelFontList,
231 XmNlabelString , PanelString,
232 XmNtopAttachment , XmATTACH_POSITION,
233 XmNtopPosition , 15,
234 XmNrightAttachment , XmATTACH_POSITION,
235 XmNrightPosition , 75,
236 XmNleftAttachment , XmATTACH_POSITION,
237 XmNleftPosition , 25,
238 NULL
239 );
240 XmStringFree( PanelString );
241
242 PanelString1 = XmStringCreateLtoR( "Graal" , "Panel_charset1" );
243 PanelString2 = XmStringCreateLtoR( "\n( Click On IT )", "Panel_charset4" );
244 PanelString = XmStringConcat( PanelString1, PanelString2 );
245
246 PanelButton = XtVaCreateManagedWidget( "",
247 xmPushButtonWidgetClass,
248 GraalHelpPresentPanel.FORM,
249 XmNfontList , PanelFontList,
250 XmNlabelString , PanelString,
251 XmNshadowThickness , 3,
252 XmNtopAttachment , XmATTACH_WIDGET,
253 XmNtopWidget , PanelLabel,
254 XmNtopOffset , 5,
255 XmNrightAttachment , XmATTACH_POSITION,
256 XmNrightPosition , 60,
257 XmNleftAttachment , XmATTACH_POSITION,
258 XmNleftPosition , 40,
259 NULL
260 );
261 XmStringFree( PanelString );
262 XmStringFree( PanelString1 );
263 XmStringFree( PanelString2 );
264
265 XtAddCallback( PanelButton,
266 XmNactivateCallback,
267 GraalExitDialogCallback, NULL );
268
269 sprintf( Buffer, "\nGraphic layout editor\nVersion %s", VERSION );
270
271 PanelString = XmStringCreateLtoR( Buffer, "Panel_charset2" );
272
273 PanelLabel = XtVaCreateManagedWidget( "",
274 xmLabelWidgetClass,
275 GraalHelpPresentPanel.FORM,
276 XmNfontList , PanelFontList,
277 XmNlabelString , PanelString,
278 XmNtopAttachment , XmATTACH_WIDGET,
279 XmNtopWidget , PanelButton,
280 XmNtopOffset , 5,
281 XmNrightAttachment , XmATTACH_POSITION,
282 XmNrightPosition , 75,
283 XmNleftAttachment , XmATTACH_POSITION,
284 XmNleftPosition , 25,
285 NULL
286 );
287 XmStringFree( PanelString );
288
289 PanelString = XmStringCreateLtoR( "copyright \251 1996-2004 ASIM, \
290 CAO-VLSI Team\nWritten by Ludovic Jacomme and Frederic Venot\nE-mail : alliance-users@asim.lip6.fr", "Panel_charset4" );
291
292 PanelLabel = XtVaCreateManagedWidget( "",
293 xmLabelWidgetClass,
294 GraalHelpPresentPanel.FORM,
295 XmNfontList , PanelFontList,
296 XmNlabelString , PanelString,
297 XmNtopAttachment , XmATTACH_WIDGET,
298 XmNtopWidget , PanelLabel,
299 XmNtopOffset , 5,
300 XmNrightAttachment , XmATTACH_FORM,
301 XmNleftAttachment , XmATTACH_FORM,
302 NULL
303 );
304 XmStringFree( PanelString );
305
306 rdsend();
307 }
308
309 /*------------------------------------------------------------\
310 | |
311 | GraalEnterPresentPanel |
312 | |
313 \------------------------------------------------------------*/
314
GraalEnterPresentPanel()315 void GraalEnterPresentPanel()
316
317 {
318 rdsbegin();
319
320 GraalEnterPanel( &GraalHelpPresentPanel );
321
322 GraalLimitedLoop( GraalHelpPresentPanel.PANEL );
323
324 GraalExitPanel( &GraalHelpPresentPanel );
325
326 rdsend();
327 }
328