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 : Motif.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 <Xm/Xm.h>
48 # include <Xm/Form.h>
49 # include <Xm/Frame.h>
50 # include <Xm/MainW.h>
51
52 # include "mut.h"
53 # include "mph.h"
54 # include "rds.h"
55 # include "rpr.h"
56 # include "GTB.h"
57 # include "GSB.h"
58 # include "GMX.h"
59 # include "GMS.h"
60 # include "GMV.h"
61 # include "GMF.h"
62
63 # include "GMX_motif.h"
64 # include "GMX_graphic.h"
65 # include "GMX_event.h"
66 # include "GMX_message.h"
67 # include "GMX_menu.h"
68 # include "GMX_color.h"
69 # include "GMX_panel.h"
70 # include "GMX_dialog.h"
71
72 /*------------------------------------------------------------\
73 | |
74 | Constants |
75 | |
76 \------------------------------------------------------------*/
77 /*------------------------------------------------------------\
78 | |
79 | Types |
80 | |
81 \------------------------------------------------------------*/
82 /*------------------------------------------------------------\
83 | |
84 | Variables |
85 | |
86 \------------------------------------------------------------*/
87
88 XtAppContext GraalApplication;
89 Widget GraalTopLevel;
90 Widget GraalMainWindow;
91 Widget GraalMainForm;
92
93 static String GraalFallBacks [] =
94
95 {
96 "*.GraalMainWindow.iconName : Graal",
97 "*GraalMenuBar*fontList : -*-helvetica-bold-r-*--14-*",
98 "*foreground : black",
99 "*background : gray",
100 "*fontList : -*-helvetica-medium-r-*--12-*",
101 "*pathMode : XmPATH_MODE_RELATIVE",
102 NULL
103 };
104
105 static char GraalTopLevelTitle[ 128 ] = "Graal : ";
106
107 /*------------------------------------------------------------\
108 | |
109 | Functions |
110 | |
111 \------------------------------------------------------------*/
112 /*------------------------------------------------------------\
113 | |
114 | GraalChangeTopLevelTitle |
115 | |
116 \------------------------------------------------------------*/
117
GraalChangeTopLevelTitle(Title)118 void GraalChangeTopLevelTitle( Title )
119
120 char *Title;
121 {
122 rdsbegin();
123
124 if ( Title != (char *)NULL )
125 {
126 strcpy( GraalTopLevelTitle + 8, Title );
127 }
128 else
129 {
130 GraalTopLevelTitle[ 8 ] = '\0';
131 }
132
133 XtVaSetValues( GraalTopLevel, XmNtitle, GraalTopLevelTitle, NULL );
134
135 rdsend();
136 }
137
138 /*------------------------------------------------------------\
139 | |
140 | GraalInitializeRessources |
141 | |
142 \------------------------------------------------------------*/
143
GraalInitializeRessources(argc,argv)144 void GraalInitializeRessources( argc, argv )
145
146 int *argc;
147 char *argv[];
148 {
149 Arg Args[ 2 ];
150
151 rdsbegin();
152
153 GraalTopLevel = XtVaAppInitialize(
154 &GraalApplication,
155 "graal.xrdb",
156 NULL,
157 0,
158 argc,
159 argv,
160 GraalFallBacks,
161 NULL
162 );
163 GraalLoadTopLevelConfig();
164
165 GraalInitializeColorMap();
166
167 GraalMainWindow = XtVaCreateManagedWidget( "GraalMainWindow",
168 xmMainWindowWidgetClass,
169 GraalTopLevel,
170 NULL);
171
172 GraalMainForm = XtVaCreateManagedWidget( "GraalMainForm",
173 xmFormWidgetClass,
174 GraalMainWindow,
175 XmNfractionBase,
176 200,
177 NULL );
178 GraalInitializeMenu();
179 GraalInitializeMessage();
180 GraalInitializePanel();
181 GraalInitializeGraphic();
182 GraalInitializeEvent();
183 GraalBuildPanelMap();
184 GraalInitializeMapEvent();
185 GraalInitializeColors();
186 GraalInitializeGraphicContext();
187 GraalInitializeDialog();
188 GraalBuildPanelLibrary();
189 GraalInitializeIcon();
190
191 XtSetArg( Args[0], XmNallowShellResize, True );
192 XtSetArg( Args[1], XmNdeleteResponse, XmDO_NOTHING );
193
194 XtSetValues( GraalTopLevel, Args, 2 );
195
196 XtRealizeWidget( GraalTopLevel );
197
198 rdsend();
199 }
200