Add GNU LGPL headers to all .c .C and .h files
[oweals/cde.git] / cde / programs / dtappbuilder / src / ab / cgen_win_stubs.c
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
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)
10  * any later version.
11  *
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
16  * details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with these librararies and programs; if not, write
20  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21  * Floor, Boston, MA 02110-1301 USA
22  */
23 /*** DTB_USER_CODE_START vvv Add file header below vvv ***/
24 /*
25  *      $XConsortium: cgen_win_stubs.c /main/4 1996/04/18 13:17:43 drk $
26  *
27  * @(#)cgen_win_stubs.c 1.26 13 Apr 1995 cde_app_builder/src/ab
28  *
29  *      RESTRICTED CONFIDENTIAL INFORMATION:
30  *
31  *      The information in this document is subject to special
32  *      restrictions in a confidential disclosure agreement between
33  *      HP, IBM, Sun, USL, SCO and Univel.  Do not distribute this
34  *      document outside HP, IBM, Sun, USL, SCO, or Univel without
35  *      Sun's specific written approval.  This document and all copies
36  *      and derivative works thereof must be returned or destroyed at
37  *      Sun's request.
38  *
39  *      Copyright 1993 Sun Microsystems, Inc.  All rights reserved.
40  *
41  */
42
43 /*** DTB_USER_CODE_END   ^^^ Add file header above ^^^ ***/
44
45 /*
46  * File: cgen_win_stubs.c
47  * Contains: Module callbacks and connection functions
48  *
49  * This file was generated by dtcodegen, from module cgen_win
50  *
51  * Any text may be added between the DTB_USER_CODE_START and
52  * DTB_USER_CODE_END comments (even non-C code). Descriptive comments
53  * are provided only as an aid.
54  *
55  *  ** EDIT ONLY WITHIN SECTIONS MARKED WITH DTB_USER_CODE COMMENTS.  **
56  *  ** ALL OTHER MODIFICATIONS WILL BE OVERWRITTEN. DO NOT MODIFY OR  **
57  *  ** DELETE THE GENERATED COMMENTS!                                 **
58  */
59
60 #include <stdio.h>
61 #include <Xm/Xm.h>
62 #include "dtb_utils.h"
63 #include "dtbuilder.h"
64 #include "cgen_win_ui.h"
65
66
67 /**************************************************************************
68  *** DTB_USER_CODE_START
69  ***
70  *** All necessary header files have been included.
71  ***
72  *** Add include files, types, macros, externs, and user functions here.
73  ***/
74
75 #include <Dt/Term.h>
76
77 #include "dtbuilder.h"
78 #include "cgen_win_ui.h"
79 #include "cgen_props_ui.h"
80 #include "cgen_env_ui.h"
81
82 #include <ab_private/ab.h>
83 #include <ab_private/proj.h>
84 #include <ab_private/cgen.h>
85 #include <ab_private/obj_notify.h>
86 #include <ab_private/util.h>
87
88 #define public_entry_point() if (AB_cgen_win == NULL) { return 0; }
89 #include "dtb_utils.h"
90
91 /*
92  * End declarations of global widgets
93  */
94
95
96
97 /*** DTB_USER_CODE_END
98  ***
99  *** End of user code section
100  ***
101  **************************************************************************/
102
103
104
105 void 
106 cgen_win_help_pulldown_Using_Help_item_CB1(
107     Widget widget,
108     XtPointer clientData,
109     XtPointer callData
110 )
111 {
112     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
113     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
114     
115     dtb_show_help_volume_info("Help4Help", "_hometopic");
116     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
117     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
118 }
119
120
121 void 
122 cgen_win_help_pulldown_Overview_item_CB1(
123     Widget widget,
124     XtPointer clientData,
125     XtPointer callData
126 )
127 {
128     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
129     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
130     
131     dtb_show_help_volume_info("AppBuilder", "ABCodeGenerator");
132     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
133     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
134 }
135
136
137 void 
138 cgen_win_help_pulldown_Reference_item_CB1(
139     Widget widget,
140     XtPointer clientData,
141     XtPointer callData
142 )
143 {
144     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
145     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
146     
147     dtb_show_help_volume_info("AppBuilder", "ABCodeGenerator");
148     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
149     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
150 }
151
152
153 void 
154 cgen_win_help_pulldown_Tasks_item_CB1(
155     Widget widget,
156     XtPointer clientData,
157     XtPointer callData
158 )
159 {
160     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
161     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
162     
163     dtb_show_help_volume_info("AppBuilder", "ABBuildandRun");
164     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
165     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
166 }
167
168
169 void 
170 cgen_win_help_pulldown_On_Item_item_CB1(
171     Widget widget,
172     XtPointer clientData,
173     XtPointer callData
174 )
175 {
176     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
177     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
178     
179     dtb_do_onitem_help();
180     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
181     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
182 }
183
184
185 void 
186 cgenP_gen_codeCB(
187     Widget widget,
188     XtPointer clientData,
189     XtPointer callData
190 )
191 {
192     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
193
194     cgen_gen_code(CG_CMD_UNDEF);
195
196     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
197     
198     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
199     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
200 }
201
202
203 void 
204 cgenP_makeCB(
205     Widget widget,
206     XtPointer clientData,
207     XtPointer callData
208 )
209 {
210     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
211
212     cgen_make(CG_CMD_UNDEF);
213
214     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
215     
216     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
217     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
218 }
219
220
221 void 
222 cgenP_runCB(
223     Widget widget,
224     XtPointer clientData,
225     XtPointer callData
226 )
227 {
228     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
229
230     cgen_run(CG_CMD_UNDEF);
231
232     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
233     
234     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
235     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
236 }
237
238
239 void 
240 cgenP_make_runCB(
241     Widget widget,
242     XtPointer clientData,
243     XtPointer callData
244 )
245 {
246     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
247
248     cgen_make_run(CG_CMD_UNDEF);    
249
250     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
251     
252     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
253     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
254 }
255
256
257 void 
258 cgenP_abortCB(
259     Widget widget,
260     XtPointer clientData,
261     XtPointer callData
262 )
263 {
264     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
265
266     cgen_abort();
267
268     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
269     
270     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
271     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
272 }
273
274
275 void 
276 connP_set_insensitive(
277     Widget widget,
278     XtPointer clientData,
279     XtPointer callData
280 )
281 {
282     DtbCgenWinMainwindowInfo    dtbSource = (DtbCgenWinMainwindowInfo)callData;
283     
284     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
285     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
286     
287     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
288
289     /* widget is either the abort button or the abort menu item */
290     XtSetSensitive(widget, False);
291     
292     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
293 }
294
295
296 void 
297 cgenP_close_cgen_winCB(
298     Widget widget,
299     XtPointer clientData,
300     XtPointer callData
301 )
302 {
303     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
304
305     DtbCgenWinMainwindowInfo cgen_win =
306                         (DtbCgenWinMainwindowInfo)clientData;
307
308     ui_win_show(cgen_win->mainwindow, False, NULL);
309
310     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
311     
312     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
313     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
314 }
315
316
317 void 
318 connP_set_termp_inactive(
319     Widget widget,
320     XtPointer clientData,
321     XtPointer callData
322 )
323 {
324     DtbCgenWinMainwindowInfo    dtbSource = (DtbCgenWinMainwindowInfo)callData;
325     
326     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
327     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
328     
329     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
330
331     /* widget is the output term pane */
332     XtSetSensitive(widget, False);
333
334     /* Make the cursor stop blinking. */
335     XtVaSetValues(widget, DtNblinkRate, 0, NULL);
336
337     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
338 }
339
340
341 void 
342 connP_init_termp(
343     Widget widget,
344     XtPointer clientData,
345     XtPointer callData
346 )
347 {
348     DtbCgenWinMainwindowInfo    dtbSource = (DtbCgenWinMainwindowInfo)callData;
349     
350     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
351
352     STRING                      shell = NULL;
353
354     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
355     
356     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
357
358     /* Make the cursor stop blinking. */
359     XtVaSetValues(widget, DtNblinkRate, 0, NULL);
360
361     /* Set the input term pane shell to be the same as the
362      * user's $SHELL environment variable. 
363      */
364     shell = (STRING) getenv("SHELL");
365     XtVaSetValues(widget, DtNsubprocessCmd, shell, NULL);
366     
367     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
368 }
369
370
371 void 
372 cgenP_cd_to_projCB(
373     Widget widget,
374     XtPointer clientData,
375     XtPointer callData
376 )
377 {
378     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
379     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
380     
381     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
382
383     cgenP_sync_up_dir();
384     
385     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
386 }
387
388
389 void 
390 cgenP_generate_entire_projCB(
391     Widget widget,
392     XtPointer clientData,
393     XtPointer callData
394 )
395 {
396     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
397
398     /*
399      * generate code for the entire project this one time.
400      */
401     CG_GEN_FLAG orig_cmd_flag = CodeGenOptions.cmd_flag;
402
403     CodeGenOptions.cmd_flag = CG_GEN_PROJ_FLAG;
404     cgen_gen_code(CG_CMD_UNDEF);
405     CodeGenOptions.cmd_flag = orig_cmd_flag;
406
407     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
408     
409     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
410     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
411 }
412
413
414 void 
415 cgenP_show_cgen_optionsCB(
416     Widget widget,
417     XtPointer clientData,
418     XtPointer callData
419 )
420 {
421     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
422
423     if (AB_cgen_prop_dialog == (Widget) NULL)
424     {
425         /*
426          * Module initialization
427          */
428         dtbCgenPropsCgenPropsDlgInfo_clear(&dtb_cgen_props_cgen_props_dlg);
429         dtb_cgen_props_cgen_props_dlg_initialize(&dtb_cgen_props_cgen_props_dlg,
430                                                  AB_cgen_win);
431         AB_cgen_prop_dialog = dtb_cgen_props_cgen_props_dlg.cgen_props_dlg_shellform;
432         
433         XtVaSetValues(AB_cgen_prop_dialog,
434                       XmNuserData, dtb_cgen_props_cgen_props_dlg.module_list,
435                       NULL);
436
437         ab_register_window(AB_cgen_prop_dialog, AB_WIN_DIALOG, WindowHidden, 
438                 XtParent(AB_cgen_win), AB_WPOS_TILE_HORIZONTAL,
439                 cgenP_cancel_propsCB, (XtPointer)&dtb_cgen_props_cgen_props_dlg);
440
441         /* Update the project name for the prop sheet */
442         cgen_notify_props_new_proj(proj_get_project());
443
444         /* Initialize module list */
445         cgenP_init_props_module_list(dtb_cgen_props_cgen_props_dlg.module_list);
446
447         /* Add Rename and Destroy object callbacks to update module_list */
448         cgenP_prop_init();
449
450     }
451     ab_show_window(AB_cgen_prop_dialog);
452
453     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
454     
455     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
456     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
457 }
458
459
460 void 
461 cgenP_show_env_dlgCB(
462     Widget widget,
463     XtPointer clientData,
464     XtPointer callData
465 )
466 {
467     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
468
469     if (AB_cgen_env_dialog == (Widget) NULL)
470     {
471         dtbCgenEnvDialogInfo_clear(&dtb_cgen_env_dialog);
472         dtb_cgen_env_dialog_initialize(&dtb_cgen_env_dialog, AB_cgen_win);
473         AB_cgen_env_dialog = dtb_cgen_env_dialog.dialog_shellform;
474
475         ab_register_window(AB_cgen_env_dialog, AB_WIN_DIALOG, WindowHidden,
476                 XtParent(AB_cgen_win), AB_WPOS_TILE_HORIZONTAL,
477                 cgenP_cancel_envCB, (XtPointer)&dtb_cgen_env_dialog);
478
479     }
480     ab_show_window(AB_cgen_env_dialog);
481
482     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
483     
484     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
485     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
486 }
487
488
489
490 /**************************************************************************
491  *** DTB_USER_CODE_START
492  ***
493  *** All automatically-generated data and functions have been defined.
494  ***
495  *** Add new functions here, or at the top of the file.
496  ***/
497 /*** DTB_USER_CODE_END
498  ***
499  *** End of user code section
500  ***
501  **************************************************************************/
502
503