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    :                  Message.c                        |
33 |                                                             |
34 | Author  :                Jacomme Ludovic                    |
35 |                                                             |
36 | Date    :                  28.03.95                         |
37 |                                                             |
38 \------------------------------------------------------------*/
39 /*------------------------------------------------------------\
40 |                                                             |
41 |                         Include Files                       |
42 |                                                             |
43 \------------------------------------------------------------*/
44 
45 # include <stdio.h>
46 # include <Xm/Xm.h>
47 # include <Xm/PushBG.h>
48 # include <Xm/CascadeBG.h>
49 
50 
51 # include "mut.h"
52 # include "mph.h"
53 # include "rds.h"
54 # include "rpr.h"
55 # include "rfm.h"
56 # include "GRM.h"
57 # include "GMX.h"
58 # include "GTB.h"
59 # include "GSB.h"
60 # include "GME.h"
61 # include "GME_modify.h"
62 # include "GME_message.h"
63 
64 /*------------------------------------------------------------\
65 |                                                             |
66 |                           Constants                         |
67 |                                                             |
68 \------------------------------------------------------------*/
69 /*------------------------------------------------------------\
70 |                                                             |
71 |                            Types                            |
72 |                                                             |
73 \------------------------------------------------------------*/
74 /*------------------------------------------------------------\
75 |                                                             |
76 |                          Variables                          |
77 |                                                             |
78 \------------------------------------------------------------*/
79 
80   static char MessageBuffer[ 512 ];
81 
82 /*------------------------------------------------------------\
83 |                                                             |
84 |                          Functions                          |
85 |                                                             |
86 \------------------------------------------------------------*/
87 /*------------------------------------------------------------\
88 |                                                             |
89 |                 GraalPromptSelectPointIdentify              |
90 |                                                             |
91 \------------------------------------------------------------*/
92 
GraalPromptSelectPointIdentify()93 void GraalPromptSelectPointIdentify()
94 
95 {
96   rdsbegin();
97 
98   GraalDisplayMessage( GRAAL_MESSAGE_MODE  , "Identify" );
99   GraalDisplayMessage( GRAAL_MESSAGE_INFO  , "Select object" );
100   GraalDisplayMessage( GRAAL_MESSAGE_PROMPT, "Enter select point" );
101 
102   rdsend();
103 }
104 
105 /*------------------------------------------------------------\
106 |                                                             |
107 |                GraalPromptSelectWindowIdentify              |
108 |                                                             |
109 \------------------------------------------------------------*/
110 
GraalPromptSelectWindowIdentify()111 void GraalPromptSelectWindowIdentify()
112 
113 {
114   rdsbegin();
115 
116   GraalDisplayMessage( GRAAL_MESSAGE_MODE, "Identify" );
117   GraalDisplayMessage( GRAAL_MESSAGE_INFO, "Select window" );
118 
119   switch ( GraalCountEventEdit )
120   {
121     case 0 :
122 
123       GraalDisplayMessage( GRAAL_MESSAGE_PROMPT, "Enter first corner" );
124 
125     break;
126 
127     case 1 :
128 
129       GraalDisplayMessage( GRAAL_MESSAGE_PROMPT, "Enter next corner" );
130   }
131 
132   rdsend();
133 }
134 
135 /*------------------------------------------------------------\
136 |                                                             |
137 |                 GraalPromptSelectPointCopy                  |
138 |                                                             |
139 \------------------------------------------------------------*/
140 
GraalPromptSelectPointCopy()141 void GraalPromptSelectPointCopy()
142 
143 {
144   rdsbegin();
145 
146   GraalDisplayMessage( GRAAL_MESSAGE_MODE  , "Copy" );
147   GraalDisplayMessage( GRAAL_MESSAGE_INFO  , "Select object" );
148   GraalDisplayMessage( GRAAL_MESSAGE_PROMPT, "Enter select point" );
149 
150   rdsend();
151 }
152 
153 /*------------------------------------------------------------\
154 |                                                             |
155 |                GraalPromptSelectWindowCopy                  |
156 |                                                             |
157 \------------------------------------------------------------*/
158 
GraalPromptSelectWindowCopy()159 void GraalPromptSelectWindowCopy()
160 
161 {
162   rdsbegin();
163 
164   GraalDisplayMessage( GRAAL_MESSAGE_MODE, "Copy" );
165   GraalDisplayMessage( GRAAL_MESSAGE_INFO, "Select window" );
166 
167   switch ( GraalCountEventEdit )
168   {
169     case 0 :
170 
171       GraalDisplayMessage( GRAAL_MESSAGE_PROMPT, "Enter first corner" );
172 
173     break;
174 
175     case 1 :
176 
177       GraalDisplayMessage( GRAAL_MESSAGE_PROMPT, "Enter next corner" );
178   }
179 
180   rdsend();
181 }
182 
183 /*------------------------------------------------------------\
184 |                                                             |
185 |                  GraalPromptEditCopy                        |
186 |                                                             |
187 \------------------------------------------------------------*/
188 
GraalPromptEditCopy()189 void GraalPromptEditCopy()
190 
191 {
192   rdsbegin();
193 
194   GraalDisplayMessage( GRAAL_MESSAGE_MODE, "Copy" );
195   GraalDisplayMessage( GRAAL_MESSAGE_INFO, "Select vector" );
196 
197   switch ( GraalCountEventEdit )
198   {
199     case 0 :
200 
201       GraalDisplayMessage( GRAAL_MESSAGE_PROMPT, "Enter source point" );
202 
203     break;
204 
205     case 1 :
206 
207       GraalDisplayMessage( GRAAL_MESSAGE_PROMPT, "Enter target point" );
208   }
209 
210   rdsend();
211 }
212 
213 /*------------------------------------------------------------\
214 |                                                             |
215 |                 GraalPromptSelectPointMove                  |
216 |                                                             |
217 \------------------------------------------------------------*/
218 
GraalPromptSelectPointMove()219 void GraalPromptSelectPointMove()
220 
221 {
222   rdsbegin();
223 
224   GraalDisplayMessage( GRAAL_MESSAGE_MODE  , "Move" );
225   GraalDisplayMessage( GRAAL_MESSAGE_INFO  , "Select object" );
226   GraalDisplayMessage( GRAAL_MESSAGE_PROMPT, "Enter select point" );
227 
228   rdsend();
229 }
230 
231 /*------------------------------------------------------------\
232 |                                                             |
233 |                GraalPromptSelectWindowMove                  |
234 |                                                             |
235 \------------------------------------------------------------*/
236 
GraalPromptSelectWindowMove()237 void GraalPromptSelectWindowMove()
238 
239 {
240   rdsbegin();
241 
242   GraalDisplayMessage( GRAAL_MESSAGE_MODE, "Move" );
243   GraalDisplayMessage( GRAAL_MESSAGE_INFO, "Select window" );
244 
245   switch ( GraalCountEventEdit )
246   {
247     case 0 :
248 
249       GraalDisplayMessage( GRAAL_MESSAGE_PROMPT, "Enter first corner" );
250 
251     break;
252 
253     case 1 :
254 
255       GraalDisplayMessage( GRAAL_MESSAGE_PROMPT, "Enter next corner" );
256   }
257 
258   rdsend();
259 }
260 
261 /*------------------------------------------------------------\
262 |                                                             |
263 |                  GraalPromptEditMove                        |
264 |                                                             |
265 \------------------------------------------------------------*/
266 
GraalPromptEditMove()267 void GraalPromptEditMove()
268 
269 {
270   rdsbegin();
271 
272   GraalDisplayMessage( GRAAL_MESSAGE_MODE, "Move" );
273   GraalDisplayMessage( GRAAL_MESSAGE_INFO, "Select vector" );
274 
275   switch ( GraalCountEventEdit )
276   {
277     case 0 :
278 
279       GraalDisplayMessage( GRAAL_MESSAGE_PROMPT, "Enter source point" );
280 
281     break;
282 
283     case 1 :
284 
285       GraalDisplayMessage( GRAAL_MESSAGE_PROMPT, "Enter target point" );
286   }
287 
288   rdsend();
289 }
290 
291 /*------------------------------------------------------------\
292 |                                                             |
293 |                 GraalPromptSelectPointDelete                |
294 |                                                             |
295 \------------------------------------------------------------*/
296 
GraalPromptSelectPointDelete()297 void GraalPromptSelectPointDelete()
298 
299 {
300   rdsbegin();
301 
302   GraalDisplayMessage( GRAAL_MESSAGE_MODE  , "Delete" );
303   GraalDisplayMessage( GRAAL_MESSAGE_INFO  , "Select object" );
304   GraalDisplayMessage( GRAAL_MESSAGE_PROMPT, "Enter select point" );
305 
306   rdsend();
307 }
308 
309 /*------------------------------------------------------------\
310 |                                                             |
311 |                GraalPromptSelectWindowDelete                |
312 |                                                             |
313 \------------------------------------------------------------*/
314 
GraalPromptSelectWindowDelete()315 void GraalPromptSelectWindowDelete()
316 
317 {
318   rdsbegin();
319 
320   GraalDisplayMessage( GRAAL_MESSAGE_MODE, "Delete" );
321   GraalDisplayMessage( GRAAL_MESSAGE_INFO, "Select window" );
322 
323   switch ( GraalCountEventEdit )
324   {
325     case 0 :
326 
327       GraalDisplayMessage( GRAAL_MESSAGE_PROMPT, "Enter first corner" );
328 
329     break;
330 
331     case 1 :
332 
333       GraalDisplayMessage( GRAAL_MESSAGE_PROMPT, "Enter next corner" );
334   }
335 
336   rdsend();
337 }
338 
339 /*------------------------------------------------------------\
340 |                                                             |
341 |                 GraalPromptSelectPointStretch               |
342 |                                                             |
343 \------------------------------------------------------------*/
344 
GraalPromptSelectPointStretch()345 void GraalPromptSelectPointStretch()
346 
347 {
348   rdsbegin();
349 
350   GraalDisplayMessage( GRAAL_MESSAGE_MODE  , "Stretch" );
351   GraalDisplayMessage( GRAAL_MESSAGE_INFO  , "Select object" );
352   GraalDisplayMessage( GRAAL_MESSAGE_PROMPT, "Enter select point" );
353 
354   rdsend();
355 }
356 
357 /*------------------------------------------------------------\
358 |                                                             |
359 |                GraalPromptSelectWindowStretch               |
360 |                                                             |
361 \------------------------------------------------------------*/
362 
GraalPromptSelectWindowStretch()363 void GraalPromptSelectWindowStretch()
364 
365 {
366   rdsbegin();
367 
368   GraalDisplayMessage( GRAAL_MESSAGE_MODE, "Stretch" );
369   GraalDisplayMessage( GRAAL_MESSAGE_INFO, "Select window" );
370 
371   switch ( GraalCountEventEdit )
372   {
373     case 0 :
374 
375       GraalDisplayMessage( GRAAL_MESSAGE_PROMPT, "Enter first corner" );
376 
377     break;
378 
379     case 1 :
380 
381       GraalDisplayMessage( GRAAL_MESSAGE_PROMPT, "Enter next corner" );
382   }
383 
384   rdsend();
385 }
386 
387 /*------------------------------------------------------------\
388 |                                                             |
389 |                  GraalPromptEditStretch                     |
390 |                                                             |
391 \------------------------------------------------------------*/
392 
GraalPromptEditStretch()393 void GraalPromptEditStretch()
394 
395 {
396   rdsbegin();
397 
398   GraalDisplayMessage( GRAAL_MESSAGE_MODE, "Stretch" );
399   GraalDisplayMessage( GRAAL_MESSAGE_INFO, "Select vector" );
400 
401   switch ( GraalCountEventEdit )
402   {
403     case 0 :
404 
405       GraalDisplayMessage( GRAAL_MESSAGE_PROMPT, "Enter source point" );
406 
407     break;
408 
409     case 1 :
410 
411       GraalDisplayMessage( GRAAL_MESSAGE_PROMPT, "Enter target point" );
412   }
413 
414   rdsend();
415 }
416 
417 /*------------------------------------------------------------\
418 |                                                             |
419 |                 GraalPromptSelectPointModify                |
420 |                                                             |
421 \------------------------------------------------------------*/
422 
GraalPromptSelectPointModify()423 void GraalPromptSelectPointModify()
424 
425 {
426   rdsbegin();
427 
428   GraalDisplayMessage( GRAAL_MESSAGE_MODE  , "Modify" );
429   GraalDisplayMessage( GRAAL_MESSAGE_INFO  , "Select object" );
430   GraalDisplayMessage( GRAAL_MESSAGE_PROMPT, "Enter select point" );
431 
432   rdsend();
433 }
434 
435 /*------------------------------------------------------------\
436 |                                                             |
437 |                GraalPromptSelectWindowModify                |
438 |                                                             |
439 \------------------------------------------------------------*/
440 
GraalPromptSelectWindowModify()441 void GraalPromptSelectWindowModify()
442 
443 {
444   rdsbegin();
445 
446   GraalDisplayMessage( GRAAL_MESSAGE_MODE, "Modify" );
447   GraalDisplayMessage( GRAAL_MESSAGE_INFO, "Select window" );
448 
449   switch ( GraalCountEventEdit )
450   {
451     case 0 :
452 
453       GraalDisplayMessage( GRAAL_MESSAGE_PROMPT, "Enter first corner" );
454 
455     break;
456 
457     case 1 :
458 
459       GraalDisplayMessage( GRAAL_MESSAGE_PROMPT, "Enter next corner" );
460   }
461 
462   rdsend();
463 }
464 
465 /*------------------------------------------------------------\
466 |                                                             |
467 |                    GraalPromptModifySegment                 |
468 |                                                             |
469 \------------------------------------------------------------*/
470 
GraalPromptModifySegment()471 void GraalPromptModifySegment()
472 
473 {
474   rdsbegin();
475 
476   GraalDisplayMessage( GRAAL_MESSAGE_MODE, "Modify Segment" );
477 
478   sprintf( MessageBuffer, "Layer: %s   Width: %.2f  Name: %s",
479          GRAAL_SEGMENT_NAME_TABLE[ (int)GraalSegmentMLayer ][0] ,
480            GraalSegmentMWidth,
481            ( GraalSegmentMName ) ? GraalSegmentMName : "none" );
482 
483   GraalDisplayMessage( GRAAL_MESSAGE_INFO, MessageBuffer );
484   GraalDisplayMessage( GRAAL_MESSAGE_PROMPT, "Enter new properties for this segment" );
485 
486   rdsend();
487 }
488 
489 /*------------------------------------------------------------\
490 |                                                             |
491 |                    GraalPromptModifyConnector               |
492 |                                                             |
493 \------------------------------------------------------------*/
494 
GraalPromptModifyConnector()495 void GraalPromptModifyConnector()
496 
497 {
498   rdsbegin();
499 
500   GraalDisplayMessage( GRAAL_MESSAGE_MODE, "Modify Connector" );
501 
502   sprintf( MessageBuffer, "Layer: %s   Width: %.2f  Orient: %s   Name: %s",
503            GRAAL_CONNECTOR_NAME_TABLE[ (int)GraalConnectorMLayer ][0],
504            GraalConnectorMWidth,
505            GRAAL_ORIENT_NAME_TABLE[ (int)GraalConnectorMOrient ][0],
506            ( GraalConnectorMName ) ? GraalConnectorMName : "none" );
507 
508   GraalDisplayMessage( GRAAL_MESSAGE_INFO, MessageBuffer );
509   GraalDisplayMessage( GRAAL_MESSAGE_PROMPT, "Enter new properties for this connector" );
510 
511   rdsend();
512 }
513 
514 /*------------------------------------------------------------\
515 |                                                             |
516 |                    GraalPromptModifyReference               |
517 |                                                             |
518 \------------------------------------------------------------*/
519 
GraalPromptModifyReference()520 void GraalPromptModifyReference()
521 
522 {
523   rdsbegin();
524 
525   GraalDisplayMessage( GRAAL_MESSAGE_MODE, "Modify Reference" );
526 
527   if ( GraalReferenceMName != (char *)NULL )
528   {
529     sprintf( MessageBuffer, "Type: %s   Name: %s",
530              GRAAL_REFERENCE_NAME_TABLE[(int)GraalReferenceMType][0],
531              GraalReferenceMName );
532   }
533   else
534   {
535     sprintf( MessageBuffer, "Type: %s   Name: none",
536              GRAAL_REFERENCE_NAME_TABLE[(int)GraalReferenceMType][0] );
537   }
538 
539   GraalDisplayMessage( GRAAL_MESSAGE_INFO, MessageBuffer );
540   GraalDisplayMessage( GRAAL_MESSAGE_PROMPT, "Enter new properties for this reference" );
541 
542   rdsend();
543 }
544 
545 /*------------------------------------------------------------\
546 |                                                             |
547 |                      GraalPromptModifyVia                   |
548 |                                                             |
549 \------------------------------------------------------------*/
550 
GraalPromptModifyVia()551 void GraalPromptModifyVia()
552 
553 {
554   rdsbegin();
555 
556   GraalDisplayMessage( GRAAL_MESSAGE_MODE, "Modify Via" );
557 
558   sprintf( MessageBuffer, "Type: %s  Name: %s",
559            GRAAL_VIA_NAME_TABLE[ (int)GraalViaMType ][0],
560            GraalViaMName ? GraalViaMName : "none" );
561 
562   GraalDisplayMessage( GRAAL_MESSAGE_INFO, MessageBuffer );
563   GraalDisplayMessage( GRAAL_MESSAGE_PROMPT, "Enter new properties for this via" );
564 
565   rdsend();
566 }
567 
568 /*------------------------------------------------------------\
569 |                                                             |
570 |                      GraalPromptModifyBigVia                |
571 |                                                             |
572 \------------------------------------------------------------*/
573 
GraalPromptModifyBigVia()574 void GraalPromptModifyBigVia()
575 
576 {
577   rdsbegin();
578 
579   GraalDisplayMessage( GRAAL_MESSAGE_MODE, "Modify big Via" );
580 
581   sprintf( MessageBuffer, "Type: %s  Name: %s",
582            GRAAL_BIGVIA_NAME_TABLE[ (int)GraalViaMType ][0],
583            GraalViaMName ? GraalViaMName : "none" );
584 
585   GraalDisplayMessage( GRAAL_MESSAGE_INFO, MessageBuffer );
586   GraalDisplayMessage( GRAAL_MESSAGE_PROMPT, "Enter new properties for this big via" );
587 
588   rdsend();
589 }
590 
591 /*------------------------------------------------------------\
592 |                                                             |
593 |                      GraalPromptModifyTransistor            |
594 |                                                             |
595 \------------------------------------------------------------*/
596 
GraalPromptModifyTransistor()597 void GraalPromptModifyTransistor()
598 
599 {
600   rdsbegin();
601 
602   GraalDisplayMessage( GRAAL_MESSAGE_MODE, "Modify Transistor" );
603 
604   if ( GraalTransistorMName == (char *)NULL )
605   {
606     sprintf( MessageBuffer, "Type: %s   Width: %.2f  Name: None",
607              GRAAL_TRANSISTOR_NAME_TABLE[ (int)GraalTransistorMType ][0],
608              GraalTransistorMWidth );
609   }
610   else
611   {
612     sprintf( MessageBuffer, "Type: %s   Width: %.2f  Name: %s",
613              GRAAL_TRANSISTOR_NAME_TABLE[ (int)GraalTransistorMType ][0],
614              GraalTransistorMWidth, GraalTransistorMName );
615   }
616 
617   GraalDisplayMessage( GRAAL_MESSAGE_INFO, MessageBuffer );
618   GraalDisplayMessage( GRAAL_MESSAGE_PROMPT, "Enter new properties for this transistor" );
619 
620   rdsend();
621 }
622 
623 /*------------------------------------------------------------\
624 |                                                             |
625 |                      GraalPromptModifyInstance              |
626 |                                                             |
627 \------------------------------------------------------------*/
628 
GraalPromptModifyInstance()629 void GraalPromptModifyInstance()
630 
631 {
632   rdsbegin();
633 
634   GraalDisplayMessage( GRAAL_MESSAGE_MODE, "Modify Instance" );
635 
636   sprintf( MessageBuffer, "Symmetry: %s   Model: %s   Name: %s",
637            GRAAL_SYMMETRY_NAME_TABLE[ (int)GraalInstanceMSym ][0],
638            GraalInstanceMModel, GraalInstanceMName  );
639 
640   GraalDisplayMessage( GRAAL_MESSAGE_INFO, MessageBuffer );
641   GraalDisplayMessage( GRAAL_MESSAGE_PROMPT, "Enter new properties for this instance" );
642 
643   rdsend();
644 }
645