Add GNU LGPL headers to all .c .C and .h files
[oweals/cde.git] / cde / programs / dtappbuilder / src / ab / cgen_props_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_props_stubs.c /main/4 1996/04/18 13:17:49 drk $
26  *
27  * @(#)cgen_props_stubs.c       1.24 21 Mar 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_props_stubs.c
47  * Contains: Module callbacks and connection functions
48  *
49  * This file was generated by dtcodegen, from module cgen_props
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_props_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
76 #include <Xm/List.h>
77 #include <Xm/TextF.h>
78 #include <Xm/RowColumn.h>
79
80 #include "dtbuilder.h"
81 #include "cgen_props_ui.h"
82 #include "palette_ui.h"
83
84 #include <ab_private/objxm.h>
85 #include <ab_private/proj.h>
86 #include <ab_private/util.h>
87 #include <ab_private/cgen.h>
88 #include <ab_private/strlist.h>
89 #include "dtb_utils.h"
90
91 /*
92  * Definition of global widgets used by callbacks.
93  */
94 CGenOptions     CodeGenOptions = {
95                         CG_GEN_PROJ_FLAG, 
96                         False, 
97                         CG_VERBOSITY_NORMAL,
98                         NULL, 
99                         NULL, 
100                         NULL};
101 CG_GEN_FLAG     CodeGenCmd = CG_GEN_PROJ_FLAG;
102 CG_VERBOSITY    CodeGenVerbosityLevel = CG_VERBOSITY_NORMAL;
103
104
105 void 
106 cgenP_update_mod_listCB(
107     Widget widget,
108     XtPointer clientData,
109     XtPointer callData
110 )
111 {
112     STRING                  module_name = NULL;
113     int                     pos = 0;
114     XmListCallbackStruct    *list_info = (XmListCallbackStruct *)callData;
115
116     module_name = objxm_xmstr_to_str(list_info->item);
117     pos = XmListItemPos(widget, list_info->item);
118
119     /* Check if the list item has been selected or de-selected */
120     if (XmListPosSelected(widget, pos))
121     {
122         /* If it has been selected, add it to the module_list */
123         strlist_add_str(module_list, module_name, (void *)NULL);
124      }
125      else
126      {
127         /* If it has been de-selected, remove it from the module_list */
128         strlist_remove_str(module_list, module_name);
129      }
130 }
131
132
133
134 /*** DTB_USER_CODE_END
135  ***
136  *** End of user code section
137  ***
138  **************************************************************************/
139
140
141
142 void 
143 cgenP_set_gen_projCB(
144     Widget widget,
145     XtPointer clientData,
146     XtPointer callData
147 )
148 {
149     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
150
151     DtbCgenPropsCgenPropsDlgInfo props_dlg =
152                         (DtbCgenPropsCgenPropsDlgInfo)clientData;
153
154     CodeGenCmd = CG_GEN_PROJ_FLAG;
155     if (XtIsSensitive(props_dlg->module_list))
156     {
157         XtSetSensitive(props_dlg->module_list, False);
158         XtSetSensitive(props_dlg->module_list_scrolledwin, False);
159     }
160
161     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
162     
163     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
164     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
165 }
166
167
168 void 
169 cgenP_set_gen_mainCB(
170     Widget widget,
171     XtPointer clientData,
172     XtPointer callData
173 )
174 {
175     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
176
177     DtbCgenPropsCgenPropsDlgInfo props_dlg =
178                         (DtbCgenPropsCgenPropsDlgInfo)clientData;
179
180     CodeGenCmd = CG_GEN_MAIN_FLAG;
181     if (XtIsSensitive(props_dlg->module_list))
182     {
183         XtSetSensitive(props_dlg->module_list, False);
184         XtSetSensitive(props_dlg->module_list_scrolledwin, False);
185     }
186
187     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
188     
189     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
190     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
191 }
192
193
194 void 
195 cgenP_set_gen_specificCB(
196     Widget widget,
197     XtPointer clientData,
198     XtPointer callData
199 )
200 {
201     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
202
203     DtbCgenPropsCgenPropsDlgInfo props_dlg =
204                         (DtbCgenPropsCgenPropsDlgInfo)clientData;
205
206     CodeGenCmd = CG_GEN_SPECIFIC_FILES_FLAG;
207     if (!XtIsSensitive(props_dlg->module_list))
208     {
209         XtSetSensitive(props_dlg->module_list, True);
210         XtSetSensitive(props_dlg->module_list_scrolledwin, True);
211     }
212
213     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
214     
215     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
216     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
217 }
218
219
220 void 
221 cgenP_set_gen_specific_and_mainCB(
222     Widget widget,
223     XtPointer clientData,
224     XtPointer callData
225 )
226 {
227     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
228
229     DtbCgenPropsCgenPropsDlgInfo props_dlg =
230                         (DtbCgenPropsCgenPropsDlgInfo)clientData;
231
232     CodeGenCmd = CG_GEN_SPECIFIC_FILES_AND_MAIN_FLAG;
233     if (!XtIsSensitive(props_dlg->module_list))
234     {
235         XtSetSensitive(props_dlg->module_list, True);
236         XtSetSensitive(props_dlg->module_list_scrolledwin, True);
237     }
238
239     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
240     
241     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
242     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
243 }
244
245
246 void 
247 cgenP_set_normal_verbosityCB(
248     Widget widget,
249     XtPointer clientData,
250     XtPointer callData
251 )
252 {
253     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
254
255     CodeGenVerbosityLevel = CG_VERBOSITY_NORMAL;
256
257     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
258     
259     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
260     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
261 }
262
263
264 void 
265 cgenP_set_silent_verbosityCB(
266     Widget widget,
267     XtPointer clientData,
268     XtPointer callData
269 )
270 {
271     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
272
273     CodeGenVerbosityLevel = CG_VERBOSITY_SILENT; 
274
275     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
276     
277     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
278     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
279 }
280
281
282 void 
283 cgenP_set_verbose_verbosityCB(
284     Widget widget,
285     XtPointer clientData,
286     XtPointer callData
287 )
288 {
289     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
290
291     CodeGenVerbosityLevel = CG_VERBOSITY_VERBOSE;
292
293     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
294     
295     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
296     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
297 }
298
299
300 void 
301 cgenP_reset_default_propsCB(
302     Widget widget,
303     XtPointer clientData,
304     XtPointer callData
305 )
306 {
307     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
308     DtbCgenPropsCgenPropsDlgInfo props_dlg =
309                         (DtbCgenPropsCgenPropsDlgInfo)clientData;
310     int                 num_selected_mods = 0, i;
311     XmStringTable       gen_module_list   = NULL;
312     Widget              opmenu_label      = NULL;
313     XmString            lbl_str           = NULL;
314     
315
316     /* set the code generation flag */
317     CodeGenCmd = CG_GEN_PROJ_FLAG;
318     XtVaSetValues(props_dlg->cgen_flags_radiobox_items.Entire_Project_item,
319         XmNset, True, NULL);
320     XtVaSetValues(props_dlg->cgen_flags_radiobox_items.Main_Only_item, 
321         XmNset, False, NULL);
322     XtVaSetValues(props_dlg->cgen_flags_radiobox_items.Specific_Modules_Only_item,
323         XmNset, False, NULL);
324     XtVaSetValues(props_dlg->cgen_flags_radiobox_items.Specific_Modules_and_Main_item,
325         XmNset, False, NULL);
326
327     /* set the merge flag */
328     XtVaSetValues(props_dlg->merge_checkbox_items.Don_t_Merge_item,
329                   XmNset, False, NULL);
330
331     /* set the verbosity */
332     CodeGenVerbosityLevel = CG_VERBOSITY_NORMAL;
333     XtVaSetValues(props_dlg->verbosity_opmenu_items.Report_Normal_Messages_item,
334         XmNset, True, NULL);
335     XtVaSetValues(props_dlg->verbosity_opmenu_items.Be_Silent_item, 
336         XmNset, False, NULL);
337     XtVaSetValues(props_dlg->verbosity_opmenu_items.Be_Verbose_item, 
338         XmNset, False, NULL);
339     opmenu_label = XmOptionButtonGadget(props_dlg->verbosity_opmenu);
340     XtVaGetValues(props_dlg->verbosity_opmenu_items.Report_Normal_Messages_item,
341         XmNlabelString, &lbl_str, NULL);
342     XtVaSetValues(opmenu_label, XmNlabelString, lbl_str, NULL);
343     
344     /* deselect all in the module list */
345     XmListDeselectAllItems(props_dlg->module_list);
346     if (module_list != NULL)
347     {
348         strlist_destroy(module_list);
349         module_list = strlist_create();
350     }
351
352     /* clear the make args */
353     XmTextFieldSetString(props_dlg->make_textf, NULL);
354
355     /* clear the run time args */
356     XmTextFieldSetString(props_dlg->run_time_textf, NULL);
357     
358     /* set the sensitivity */
359     if (XtIsSensitive(props_dlg->module_list))
360     {
361         XtSetSensitive(props_dlg->module_list, False);
362         XtSetSensitive(props_dlg->module_list_scrolledwin, False);
363     }
364
365     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
366     
367     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
368     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
369 }
370
371
372 void 
373 cgenP_apply_propsCB(
374     Widget widget,
375     XtPointer clientData,
376     XtPointer callData
377 )
378 {
379     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
380
381     DtbCgenPropsCgenPropsDlgInfo props_dlg = 
382                         (DtbCgenPropsCgenPropsDlgInfo)clientData;
383     int                 i;
384     int                 num_selected_mods = 0;
385     Widget              merge_toggle;
386     Boolean             no_merge = False;
387     STRING              make_args = NULL;
388     STRING              run_args = NULL;
389
390     
391     if (CodeGenOptions.make_args != NULL)
392     {
393         free(CodeGenOptions.make_args);
394         CodeGenOptions.make_args = NULL;
395     }
396
397     if (CodeGenOptions.run_args != NULL)
398     {
399         free(CodeGenOptions.run_args);
400         CodeGenOptions.run_args = NULL;
401     }
402
403     if (CodeGenOptions.module_list != NULL)
404     {
405         strlist_destroy(CodeGenOptions.module_list);
406         CodeGenOptions.module_list = NULL;
407     }
408
409     merge_toggle = props_dlg->merge_checkbox_items.Don_t_Merge_item; 
410     XtVaGetValues(merge_toggle, XmNset, &no_merge, NULL);
411
412     CodeGenOptions.cmd_flag = CodeGenCmd;
413     CodeGenOptions.no_merge = no_merge;
414     CodeGenOptions.verbosity = CodeGenVerbosityLevel;
415     
416     make_args = XmTextFieldGetString(props_dlg->make_textf);
417     if (!util_strempty(make_args))
418         CodeGenOptions.make_args = strdup(make_args);
419
420     run_args = XmTextFieldGetString(props_dlg->run_time_textf);
421     if (!util_strempty(run_args))
422         CodeGenOptions.run_args = strdup(run_args);
423
424     if (CodeGenCmd == CG_GEN_SPECIFIC_FILES_FLAG ||
425         CodeGenCmd == CG_GEN_SPECIFIC_FILES_AND_MAIN_FLAG)
426     {
427         XtVaGetValues(props_dlg->module_list,
428                 XmNselectedItemCount,   &num_selected_mods,
429                 NULL);
430         if (num_selected_mods == 0)
431         {
432             dtb_cgen_props_no_sel_mod_msg_initialize(
433                 &dtb_cgen_props_no_sel_mod_msg);
434             (void)dtb_show_modal_message(
435                 dtb_cgen_props_cgen_props_dlg.cgen_props_dlg_shellform,
436                 &dtb_cgen_props_no_sel_mod_msg, NULL, NULL,NULL);
437         }
438         else
439         {
440             CodeGenOptions.module_list = strlist_dup(module_list);
441         }
442     }
443     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
444     
445     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
446     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
447 }
448
449
450 void 
451 cgenP_ok_propsCB(
452     Widget widget,
453     XtPointer clientData,
454     XtPointer callData
455 )
456 {
457     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
458     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
459     
460     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
461     cgenP_apply_propsCB(widget, clientData, callData);
462     ui_win_show(dtb_cgen_props_cgen_props_dlg.cgen_props_dlg_shellform,False,NULL);
463     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
464 }
465
466
467 void 
468 cgenP_reset_propsCB(
469     Widget widget,
470     XtPointer clientData,
471     XtPointer callData
472 )
473 {
474     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
475
476     DtbCgenPropsCgenPropsDlgInfo props_dlg =
477                         (DtbCgenPropsCgenPropsDlgInfo)clientData;
478     int                 num_selected_mods = 0, i, pos;
479     XmStringTable       gen_module_list = NULL;
480     XmString            mod = NULL;
481     Widget              opmenu_label = NULL;
482     XmString            lbl_str = NULL;
483
484     /* undo the user's generate code modifications */
485     switch (CodeGenCmd)
486     {
487         case CG_GEN_PROJ_FLAG:
488             XtVaSetValues(props_dlg->cgen_flags_radiobox_items.Entire_Project_item,
489                 XmNset, False, NULL);
490             break;
491
492         case CG_GEN_MAIN_FLAG:
493             XtVaSetValues(props_dlg->cgen_flags_radiobox_items.Main_Only_item, 
494                 XmNset, False, NULL);
495             break;
496
497         case CG_GEN_SPECIFIC_FILES_FLAG:
498             XtVaSetValues(props_dlg->cgen_flags_radiobox_items.Specific_Modules_Only_item,
499                 XmNset, False, NULL);
500             XmListDeselectAllItems(props_dlg->module_list);
501             break;
502
503         case CG_GEN_SPECIFIC_FILES_AND_MAIN_FLAG:
504             XtVaSetValues(props_dlg->cgen_flags_radiobox_items.Specific_Modules_and_Main_item,
505                 XmNset, False, NULL);
506             XmListDeselectAllItems(props_dlg->module_list);
507             break;
508         
509         default:
510             break;
511     }
512     
513     /* set the generate code options back + field sensitivity */
514     switch (CodeGenOptions.cmd_flag)
515     {
516         case CG_GEN_PROJ_FLAG:
517             XtVaSetValues(props_dlg->cgen_flags_radiobox_items.Entire_Project_item,
518                 XmNset, True, NULL);
519             CodeGenCmd = CG_GEN_PROJ_FLAG;
520             if (XtIsSensitive(props_dlg->module_list))
521             {
522                 XtSetSensitive(props_dlg->module_list, False);
523                 XtSetSensitive(props_dlg->module_list_scrolledwin, False);
524             }
525             break;
526
527         case CG_GEN_MAIN_FLAG:
528             XtVaSetValues(props_dlg->cgen_flags_radiobox_items.Main_Only_item, 
529                         XmNset, True, NULL);
530             CodeGenCmd = CG_GEN_MAIN_FLAG;
531             if (XtIsSensitive(props_dlg->module_list))
532             {
533                 XtSetSensitive(props_dlg->module_list, False);
534                 XtSetSensitive(props_dlg->module_list_scrolledwin, False);
535             }
536             break;
537
538         case CG_GEN_SPECIFIC_FILES_FLAG:
539             XtVaSetValues(props_dlg->cgen_flags_radiobox_items.Specific_Modules_Only_item,
540                 XmNset, True, NULL);
541             CodeGenCmd = CG_GEN_SPECIFIC_FILES_FLAG;
542             /* Select items that should be selected */
543             if (CodeGenOptions.module_list != NULL) 
544             {
545                 XmListDeselectAllItems(props_dlg->module_list);
546                 for (i=0; i<strlist_get_num_strs(CodeGenOptions.module_list); i++)
547                 {
548                     mod = objxm_str_to_xmstr(props_dlg->module_list,
549                         strlist_get_str(CodeGenOptions.module_list, i, (void **)NULL));
550                     pos = XmListItemPos(props_dlg->module_list, mod);
551                     if (!XmListPosSelected(props_dlg->module_list, pos)) 
552                     {
553                         XmListSelectItem(props_dlg->module_list,
554                                 mod, True); 
555                     }
556                 }
557             }
558             if (!XtIsSensitive(props_dlg->module_list))
559             {
560                 XtSetSensitive(props_dlg->module_list, True);
561                 XtSetSensitive(props_dlg->module_list_scrolledwin, True);
562             }
563             break;
564
565         case CG_GEN_SPECIFIC_FILES_AND_MAIN_FLAG:
566             XtVaSetValues(props_dlg->cgen_flags_radiobox_items.Specific_Modules_and_Main_item,
567                 XmNset, True, NULL);
568             CodeGenCmd = CG_GEN_SPECIFIC_FILES_AND_MAIN_FLAG;
569             /* Select items that should be selected */
570             if (CodeGenOptions.module_list != NULL) 
571             {
572                 XmListDeselectAllItems(props_dlg->module_list);
573                 for (i=0; i<strlist_get_num_strs(CodeGenOptions.module_list); i++)
574                 {
575                     mod = objxm_str_to_xmstr(props_dlg->module_list,
576                         strlist_get_str(CodeGenOptions.module_list, i, (void **)NULL));
577                     pos = XmListItemPos(props_dlg->module_list, mod);
578                     if (!XmListPosSelected(props_dlg->module_list, pos)) 
579                     {
580                         XmListSelectItem(props_dlg->module_list,
581                                 mod, True); 
582                     }
583                 }
584             }
585             if (!XtIsSensitive(props_dlg->module_list))
586             {
587                 XtSetSensitive(props_dlg->module_list, True);
588                 XtSetSensitive(props_dlg->module_list_scrolledwin, True);
589             }
590             break;
591         
592         default:
593             break;
594     }
595
596     /* undo the user's verbosity changes */
597     switch (CodeGenVerbosityLevel)
598     {
599         case CG_VERBOSITY_NORMAL:
600             XtVaSetValues(props_dlg->verbosity_opmenu_items.Report_Normal_Messages_item,
601                 XmNset, False, NULL);
602             break;
603
604         case CG_VERBOSITY_SILENT:
605             XtVaSetValues(props_dlg->verbosity_opmenu_items.Be_Silent_item, 
606                         XmNset, False, NULL);
607             break;
608
609         case CG_VERBOSITY_VERBOSE:
610             XtVaSetValues(props_dlg->verbosity_opmenu_items.Be_Verbose_item, 
611                         XmNset, False, NULL);
612             break;
613
614         default:
615             break;
616     }
617
618     /* set the verbosity back */
619     switch (CodeGenOptions.verbosity)
620     {
621         case CG_VERBOSITY_NORMAL:
622             CodeGenVerbosityLevel = CG_VERBOSITY_NORMAL;
623             XtVaSetValues(props_dlg->verbosity_opmenu_items.Report_Normal_Messages_item,
624                 XmNset, True, NULL);
625
626             /* set the option menu label string */
627             opmenu_label = XmOptionButtonGadget(props_dlg->verbosity_opmenu);
628             XtVaGetValues(props_dlg->verbosity_opmenu_items.Report_Normal_Messages_item,
629                 XmNlabelString, &lbl_str, NULL);
630             XtVaSetValues(opmenu_label, XmNlabelString, lbl_str, NULL);
631             break;
632
633         case CG_VERBOSITY_SILENT:
634             CodeGenVerbosityLevel = CG_VERBOSITY_SILENT;
635             XtVaSetValues(props_dlg->verbosity_opmenu_items.Be_Silent_item, 
636                 XmNset, True, NULL);
637
638             /* set the option menu label string */
639             opmenu_label = XmOptionButtonGadget(props_dlg->verbosity_opmenu);
640             XtVaGetValues(props_dlg->verbosity_opmenu_items.Be_Silent_item,
641                 XmNlabelString, &lbl_str, NULL);
642             XtVaSetValues(opmenu_label, XmNlabelString, lbl_str, NULL);
643             break;
644
645         case CG_VERBOSITY_VERBOSE:
646             CodeGenVerbosityLevel = CG_VERBOSITY_VERBOSE;
647             XtVaSetValues(props_dlg->verbosity_opmenu_items.Be_Verbose_item, 
648                 XmNset, True, NULL);
649
650             /* set the option menu label string */
651             opmenu_label = XmOptionButtonGadget(props_dlg->verbosity_opmenu);
652             XtVaGetValues(props_dlg->verbosity_opmenu_items.Be_Verbose_item,
653                 XmNlabelString, &lbl_str, NULL);
654             XtVaSetValues(opmenu_label, XmNlabelString, lbl_str, NULL);
655             break;
656
657         default:
658             break;
659     }
660
661     /* reset the merge option */
662     if (CodeGenOptions.no_merge)
663         XtVaSetValues(props_dlg->merge_checkbox_items.Don_t_Merge_item,
664                         XmNset, True, NULL);
665     else
666         XtVaSetValues(props_dlg->merge_checkbox_items.Don_t_Merge_item,
667                         XmNset, False, NULL);
668
669     /* reset the argument values */
670     XmTextFieldSetString(props_dlg->make_textf, CodeGenOptions.make_args);
671     XmTextFieldSetString(props_dlg->run_time_textf, CodeGenOptions.run_args);
672     
673     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
674     
675     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
676     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
677 }
678
679
680 void 
681 cgenP_add_update_list_cb(
682     Widget widget,
683     XtPointer clientData,
684     XtPointer callData
685 )
686 {
687     DtbCgenPropsCgenPropsDlgInfo        dtbSource = (DtbCgenPropsCgenPropsDlgInfo)callData;
688     
689     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
690
691     /* Work-around for not being able to add a ":select" callback
692      * on a list object.
693      */
694     XtAddCallback(dtbSource->module_list,
695                 XmNmultipleSelectionCallback, cgenP_update_mod_listCB,
696                 NULL); 
697
698     /* Initialize module_list global variable */
699     module_list = strlist_create();
700
701     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
702     
703     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
704     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
705 }
706
707
708 void 
709 cgenP_cancel_propsCB(
710     Widget widget,
711     XtPointer clientData,
712     XtPointer callData
713 )
714 {
715     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
716
717     cgenP_reset_default_propsCB(widget, clientData, callData);
718     XtPopdown(dtb_cgen_props_cgen_props_dlg.cgen_props_dlg);
719     
720     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
721     
722     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
723     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
724 }
725
726
727
728 /**************************************************************************
729  *** DTB_USER_CODE_START
730  ***
731  *** All automatically-generated data and functions have been defined.
732  ***
733  *** Add new functions here, or at the top of the file.
734  ***/
735 /*** DTB_USER_CODE_END
736  ***
737  *** End of user code section
738  ***
739  **************************************************************************/
740
741