Convert uses of XKeycodeToKeysym (deprecated) to XkbKeycodeToKeysym
[oweals/cde.git] / cde / programs / ttsnoop / ttsnoop_stubs.C.src
1 /*** DTB_USER_CODE_START vvv Add file header below vvv ***/
2 //%%  (c) Copyright 1993, 1994 Hewlett-Packard Company
3 //%%  (c) Copyright 1993, 1994 International Business Machines Corp.
4 //%%  (c) Copyright 1993, 1994 Sun Microsystems, Inc.
5 //%%  (c) Copyright 1993, 1994 Novell, Inc.
6 //%%  $XConsortium: ttsnoop_stubs.C.src /main/3 1995/11/06 17:14:48 rswiston $
7 /*** DTB_USER_CODE_END   ^^^ Add file header above ^^^ ***/
8
9 /*
10  * File: ttsnoop_stubs.c
11  * Contains: Module callbacks and connection functions
12  *
13  * This file was generated by dtcodegen, from module ttsnoop
14  *
15  * Any text may be added between the DTB_USER_CODE_START and
16  * DTB_USER_CODE_END comments (even non-C code). Descriptive comments
17  * are provided only as an aid.
18  *
19  *  ** EDIT ONLY WITHIN SECTIONS MARKED WITH DTB_USER_CODE COMMENTS.  **
20  *  ** ALL OTHER MODIFICATIONS WILL BE OVERWRITTEN. DO NOT MODIFY OR  **
21  *  ** DELETE THE GENERATED COMMENTS!                                 **
22  */
23
24 #include <stdio.h>
25 #include <Xm/Xm.h>
26 #include "dtb_utils.h"
27 #include "ttsnoop_ui.h"
28
29
30 /**************************************************************************
31  *** DTB_USER_CODE_START
32  ***
33  *** All necessary header files have been included.
34  ***
35  *** Add include files, types, macros, externs, and user functions here.
36  ***/
37
38 #include <unistd.h>
39
40 #include <fstream>
41 #include <sstream>
42
43 #include "apiTracer_ui.h"
44 #include "DtTt.h"
45
46 extern "C" { const char *_tt_lib_version; };
47
48 extern std::ofstream    snoopStream;
49 extern unsigned int     globalSaveLines;
50 extern std::string      traceScript;
51 extern const char *     globalVersionString;
52 extern Tt_pattern       snoopPat;
53 extern Boolean          snoopPatIsRegistered;
54
55 /*** DTB_USER_CODE_END
56  ***
57  *** End of user code section
58  ***
59  **************************************************************************/
60
61
62
63 void 
64 ttsnoop_Help_menu_On_Item_item_CB1(
65     Widget widget,
66     XtPointer clientData,
67     XtPointer callData
68 )
69 {
70     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
71     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
72     
73     dtb_do_onitem_help();
74     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
75     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
76 }
77
78
79 void 
80 fork_tttrace(
81     Widget widget,
82     XtPointer clientData,
83     XtPointer callData
84 )
85 {
86     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
87     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
88     
89     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
90     DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
91     std::ostringstream tttraceCmd;
92     tttraceCmd << "unset TT_TRACE_SCRIPT; dtterm -sb -sl ";
93     tttraceCmd << globalSaveLines;
94     tttraceCmd << " -title tttrace -geometry 120x24 -e tttrace &";
95     DtTtSetLabel( instance->ttsnoopWin_label, "tttrace" );
96     system( tttraceCmd.str().c_str() );
97     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
98 }
99
100
101 void 
102 turnOnTracing(
103     Widget widget,
104     XtPointer clientData,
105     XtPointer callData
106 )
107 {
108     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
109     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
110     
111     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
112     DtbApiTracerTracerInfo instance = &dtb_api_tracer_tracer;
113     if (!(instance->initialized))
114     {
115         dtb_api_tracer_tracer_initialize(
116                 instance, dtb_ttsnoop_ttsnoop_win.ttsnoopWin);
117     }
118     DtTtSetLabel( instance->cancelButton, "Stop" );
119     XtManageChild(instance->tracer_shellform);
120     tt_trace_control( 0 );
121     putenv( const_cast<char *>(traceScript.c_str()) );
122     tt_trace_control( 1 );
123     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
124 }
125
126
127 void 
128 createMessage(
129     Widget widget,
130     XtPointer clientData,
131     XtPointer callData
132 )
133 {
134     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
135     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
136     
137     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
138     DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
139     Tt_message msg = tt_message_create();
140     Tt_status status = DtTtSetLabel( instance->ttsnoopWin_label,
141                                      "tt_message_create()", msg );
142     if (tt_is_err( status )) {
143             return;
144     }
145     DtTtCreated( DTTT_MESSAGE, msg );
146     Widget newWidget = DtTtMessageWidgetCreate( instance->ttsnoopWin, msg,
147                                                 DtTtMessageWidgetUpdate );
148     status = tt_ptr_error( newWidget );
149     if (tt_is_err( status )) {
150             return;
151     }
152     XRaiseWindow( XtDisplay( newWidget ), XtWindow( newWidget ));
153     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
154 }
155
156
157 void 
158 receiveMessage(
159     Widget widget,
160     XtPointer clientData,
161     XtPointer callData
162 )
163 {
164     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
165     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
166     
167     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
168     DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
169     Tt_message msg = tt_message_receive();
170     Tt_status status = DtTtSetLabel( instance->ttsnoopWin_label,
171                                      "tt_message_receive()", msg );
172     if (tt_is_err( status )) {
173             return;
174     }
175     if (msg == 0) {
176             return;
177     }
178     DtTtCreated( DTTT_MESSAGE, msg );
179     Widget newWidget = DtTtMessageWidgetCreate( instance->ttsnoopWin, msg,
180                                                 DtTtMessageWidgetUpdate );
181     status = tt_ptr_error( newWidget );
182     if (tt_is_err( status )) {
183             return;
184     }
185     XRaiseWindow( XtDisplay( newWidget ), XtWindow( newWidget ));
186     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
187 }
188
189
190 void 
191 openMessage(
192     Widget widget,
193     XtPointer clientData,
194     XtPointer callData
195 )
196 {
197     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
198     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
199     
200     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
201     _DtTtChooserSet( _DtTtChooserMessageOpen );
202     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
203 }
204
205
206 void 
207 destroyMessage(
208     Widget widget,
209     XtPointer clientData,
210     XtPointer callData
211 )
212 {
213     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
214     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
215     
216     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
217     _DtTtChooserSet( _DtTtChooserMessageDestroy );
218     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
219 }
220
221
222 void 
223 help_ttsnoop(
224     Widget widget,
225     XtPointer clientData,
226     XtPointer callData
227 )
228 {
229     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
230     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
231     
232     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
233     DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
234     _DtMan( instance->ttsnoopWin_label, "ttsnoop" );
235     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
236 }
237
238
239 void 
240 help_tttrace(
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     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
248     
249     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
250     DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
251     _DtMan( instance->ttsnoopWin_label, "tttrace" );
252     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
253 }
254
255
256 void 
257 help_ttsession(
258     Widget widget,
259     XtPointer clientData,
260     XtPointer callData
261 )
262 {
263     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
264     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
265     
266     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
267     DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
268     _DtMan( instance->ttsnoopWin_label, "ttsession" );
269     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
270 }
271
272
273 void 
274 help_tt_type_comp(
275     Widget widget,
276     XtPointer clientData,
277     XtPointer callData
278 )
279 {
280     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
281     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
282     
283     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
284     DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
285     _DtMan( instance->ttsnoopWin_label, "tt_type_comp" );
286     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
287 }
288
289
290 void 
291 help_dbserver(
292     Widget widget,
293     XtPointer clientData,
294     XtPointer callData
295 )
296 {
297     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
298     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
299     
300     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
301     DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
302     _DtMan( instance->ttsnoopWin_label, "rpc.ttdbserverd" );
303     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
304 }
305
306
307 void 
308 help_tttracefile(
309     Widget widget,
310     XtPointer clientData,
311     XtPointer callData
312 )
313 {
314     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
315     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
316     
317     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
318     DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
319     _DtMan( instance->ttsnoopWin_label, "tttracefile" );
320     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
321 }
322
323
324 void 
325 help_tt_c(
326     Widget widget,
327     XtPointer clientData,
328     XtPointer callData
329 )
330 {
331     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
332     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
333     
334     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
335     DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
336     _DtMan( instance->ttsnoopWin_label, "Tttt_c" );
337     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
338 }
339
340
341 void 
342 help_tttk(
343     Widget widget,
344     XtPointer clientData,
345     XtPointer callData
346 )
347 {
348     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
349     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
350     
351     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
352     DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
353     _DtMan( instance->ttsnoopWin_label, "Tttttk" );
354     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
355 }
356
357
358 void 
359 helpUsenet(
360     Widget widget,
361     XtPointer clientData,
362     XtPointer callData
363 )
364 {
365     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
366     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
367     
368     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
369     DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
370     char *buf = "news:alt.soft-sys.tooltalk";
371     _DtOpen( instance->ttsnoopWin_label, buf, strlen(buf), "altTT" );
372     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
373 }
374
375
376 void 
377 sessionTypesLoad(
378     Widget widget,
379     XtPointer clientData,
380     XtPointer callData
381 )
382 {
383     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
384     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
385     
386     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
387     _DtFileChooserSet( _DtFileChooseTypesLoad, 0 );
388     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
389 }
390
391
392 void 
393 sessionTypesReload(
394     Widget widget,
395     XtPointer clientData,
396     XtPointer callData
397 )
398 {
399     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
400     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
401     
402     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
403     DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
404     Tt_message msg = ttdt_file_notice( 0, TTDT_SAVED, TT_BOTH,
405                                        "/etc/tt/types.xdr", 0 );
406     Tt_status status = DtTtSetLabel( instance->ttsnoopWin_label,
407                                      "ttdt_file_notice()", msg );
408     if (tt_is_err( status )) {
409             return;
410     }
411     status = tt_message_send( msg );
412     if (tt_is_err( status )) {
413             DtTtSetLabel( instance->ttsnoopWin_label, "tt_message_send()",
414                           status );
415     }
416     DtTtCreated( DTTT_MESSAGE, msg );
417     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
418 }
419
420
421 void 
422 dumpSource(
423     Widget widget,
424     XtPointer clientData,
425     XtPointer callData
426 )
427 {
428     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
429     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
430     
431     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
432     DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
433     _DtOpen( instance->ttsnoopWin_label, "tt_type_comp -p", "types" );
434     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
435 }
436
437
438 void 
439 typesEnumerate(
440     Widget widget,
441     XtPointer clientData,
442     XtPointer callData
443 )
444 {
445     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
446     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
447     
448     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
449     DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
450     _DtOpen( instance->ttsnoopWin_label, "tt_type_comp -P", "types" );
451     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
452 }
453
454
455 void 
456 createPattern(
457     Widget widget,
458     XtPointer clientData,
459     XtPointer callData
460 )
461 {
462     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
463     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
464     
465     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
466     DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
467     Tt_pattern pat = tt_pattern_create();
468     Tt_status status = DtTtSetLabel( instance->ttsnoopWin_label,
469                                      "tt_pattern_create()", pat );
470     if (tt_is_err( status )) {
471             return;
472     }
473     DtTtCreated( DTTT_PATTERN, pat );
474     Widget newWidget = DtTtPatternWidgetCreate( instance->ttsnoopWin, pat, 0 );
475     status = tt_ptr_error( newWidget );
476     if (tt_is_err( status )) {
477             return;
478     }
479     XRaiseWindow( XtDisplay( newWidget ), XtWindow( newWidget ));
480     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
481 }
482
483
484 void 
485 openPattern(
486     Widget widget,
487     XtPointer clientData,
488     XtPointer callData
489 )
490 {
491     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
492     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
493     
494     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
495     _DtTtChooserSet( _DtTtChooserPatternOpen );
496     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
497 }
498
499
500 void 
501 destroyPattern(
502     Widget widget,
503     XtPointer clientData,
504     XtPointer callData
505 )
506 {
507     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
508     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
509     
510     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
511     _DtTtChooserSet( _DtTtChooserPatternDestroy );
512     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
513 }
514
515
516 void 
517 ptypeDeclare(
518     Widget widget,
519     XtPointer clientData,
520     XtPointer callData
521 )
522 {
523     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
524     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
525     
526     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
527     _DtStringChooserSet( _DtStringChoosePtype2Declare, 0 );
528     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
529 }
530
531
532 void 
533 mediaPtypeDeclare(
534     Widget widget,
535     XtPointer clientData,
536     XtPointer callData
537 )
538 {
539     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
540     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
541     
542     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
543     _DtStringChooserSet( _DtStringChooseMediaPtype2Declare, 0 );
544     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
545 }
546
547
548 void 
549 ptypeUnDeclare(
550     Widget widget,
551     XtPointer clientData,
552     XtPointer callData
553 )
554 {
555     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
556     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
557     
558     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
559     _DtStringChooserSet( _DtStringChoosePtype2UnDeclare, 0 );
560     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
561 }
562
563
564 void 
565 ptypeSetDefault(
566     Widget widget,
567     XtPointer clientData,
568     XtPointer callData
569 )
570 {
571     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
572     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
573     
574     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
575     _DtStringChooserSet( _DtStringChoosePtype2SetDefault, 0 );
576     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
577 }
578
579
580 void 
581 ptypeExists(
582     Widget widget,
583     XtPointer clientData,
584     XtPointer callData
585 )
586 {
587     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
588     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
589     
590     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
591     _DtStringChooserSet( _DtStringChoosePtype2Exists, 0 );
592     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
593 }
594
595
596 void 
597 libcSystem(
598     Widget widget,
599     XtPointer clientData,
600     XtPointer callData
601 )
602 {
603     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
604     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
605     
606     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
607     _DtStringChooserSet( _DtStringChooseSystem, 0 );
608     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
609 }
610
611
612 void 
613 libcChdir(
614     Widget widget,
615     XtPointer clientData,
616     XtPointer callData
617 )
618 {
619     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
620     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
621     
622     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
623     _DtFileChooserSet( _DtFileChooseChdir, 0 );
624     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
625 }
626
627
628 void 
629 libcPutenv(
630     Widget widget,
631     XtPointer clientData,
632     XtPointer callData
633 )
634 {
635     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
636     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
637     
638     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
639     _DtStringChooserSet( _DtStringChoosePutenv, 0 );
640     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
641 }
642
643
644 void 
645 libcPause(
646     Widget widget,
647     XtPointer clientData,
648     XtPointer callData
649 )
650 {
651     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
652     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
653     
654     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
655     DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
656     std::ostringstream advice;
657     advice << "pause(); /* kill -CONT " << getpid() << " */";
658     DtTtSetLabel( instance->ttsnoopWin_label, advice.str().c_str() );
659
660     //
661     // run "(if dterror.ds blah blah; then kill -CONT pid; fi)&"
662     //
663     std::ostringstream script;
664     script << "(if dterror.ds ";
665     // arg 1: text
666     script << "\"kill -CONT " << getpid() << "\" ";
667     // arg 2: window title
668     script << "\"pause()\" ";
669     // arg 3: confirmation button label
670     script << "CONT; then ";
671     // After confirmation, invoke kill(1)
672     script << "kill -CONT " << getpid() << "; fi)&";
673     system( script.str().c_str() );
674
675     // Run the event loop a few laps, to paint the footer
676     tttk_block_while( XtWidgetToApplicationContext( widget ), 0, 50 );
677
678     pause();
679     DtTtSetLabel( instance->ttsnoopWin_label, " " );
680     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
681 }
682
683
684 void 
685 libcExit(
686     Widget widget,
687     XtPointer clientData,
688     XtPointer callData
689 )
690 {
691     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
692     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
693     
694     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
695     exit( 0 );
696     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
697 }
698
699
700 void 
701 msgActions(
702     Widget widget,
703     XtPointer clientData,
704     XtPointer callData
705 )
706 {
707     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
708     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
709     
710     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
711     DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
712     _DtOpen( instance->ttsnoopWin_label,
713              "dttypes -db ACTION -w fld_name TYPE fld_value TT_MSG", "actns" );
714     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
715 }
716
717
718 void 
719 sessionJoin(
720     Widget widget,
721     XtPointer clientData,
722     XtPointer callData
723 )
724 {
725     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
726     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
727     
728     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
729     _DtSessionChooserSet( _DtSessionChooseJoin, 0 );
730     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
731 }
732
733
734 void 
735 dtSessionJoin(
736     Widget widget,
737     XtPointer clientData,
738     XtPointer callData
739 )
740 {
741     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
742     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
743     
744     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
745     _DtSessionChooserSet( _DtSessionChooseDtJoin, 0 );
746     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
747 }
748
749
750 void 
751 sessionQuit(
752     Widget widget,
753     XtPointer clientData,
754     XtPointer callData
755 )
756 {
757     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
758     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
759     
760     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
761     _DtSessionChooserSet( _DtSessionChooseQuit, 0 );
762     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
763 }
764
765
766 void 
767 sessionSetDefault(
768     Widget widget,
769     XtPointer clientData,
770     XtPointer callData
771 )
772 {
773     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
774     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
775     
776     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
777     _DtSessionChooserSet( _DtSessionChooseDefault, 0 );
778     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
779 }
780
781
782 void 
783 fileJoin(
784     Widget widget,
785     XtPointer clientData,
786     XtPointer callData
787 )
788 {
789     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
790     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
791     
792     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
793     _DtFileChooserSet( _DtFileChooseJoin, 0 );
794     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
795 }
796
797
798 void 
799 fileDesktopJoin(
800     Widget widget,
801     XtPointer clientData,
802     XtPointer callData
803 )
804 {
805     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
806     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
807     
808     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
809     _DtFileChooserSet( _DtFileChooseDtJoin, 0 );
810     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
811 }
812
813
814 void 
815 fileQuit(
816     Widget widget,
817     XtPointer clientData,
818     XtPointer callData
819 )
820 {
821     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
822     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
823     
824     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
825     _DtFileChooserSet( _DtFileChooseQuit, 0 );
826     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
827 }
828
829
830 void 
831 fileSetDefault(
832     Widget widget,
833     XtPointer clientData,
834     XtPointer callData
835 )
836 {
837     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
838     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
839     
840     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
841     _DtFileChooserSet( _DtFileChooseDefault, 0 );
842     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
843 }
844
845
846 void 
847 fileUnSetDefault(
848     Widget widget,
849     XtPointer clientData,
850     XtPointer callData
851 )
852 {
853     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
854     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
855     
856     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
857     DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
858     Tt_status status = tt_default_file_set( 0 );
859     DtTtSetLabel( instance->ttsnoopWin_label, "tt_default_file_set( 0 )",
860                   status );
861     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
862 }
863
864
865 void 
866 fileSaved(
867     Widget widget,
868     XtPointer clientData,
869     XtPointer callData
870 )
871 {
872     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
873     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
874     
875     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
876     _DtTtChooserSet( _DtTtChooserDtFileSaved );
877     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
878 }
879
880
881 void 
882 fileModified(
883     Widget widget,
884     XtPointer clientData,
885     XtPointer callData
886 )
887 {
888     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
889     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
890     
891     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
892     _DtTtChooserSet( _DtTtChooserDtFileModified );
893     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
894 }
895
896
897 void 
898 fileReverted(
899     Widget widget,
900     XtPointer clientData,
901     XtPointer callData
902 )
903 {
904     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
905     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
906     
907     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
908     _DtTtChooserSet( _DtTtChooserDtFileReverted );
909     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
910 }
911
912
913 void 
914 fileGetModified(
915     Widget widget,
916     XtPointer clientData,
917     XtPointer callData
918 )
919 {
920     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
921     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
922     
923     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
924     _DtFileChooserSet( _DtFileChooseGetModified, 0 );
925     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
926 }
927
928
929 void 
930 fileSave(
931     Widget widget,
932     XtPointer clientData,
933     XtPointer callData
934 )
935 {
936     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
937     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
938     
939     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
940     _DtFileChooserSet( _DtFileChooseSave, 0 );
941     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
942 }
943
944
945 void 
946 fileRevert(
947     Widget widget,
948     XtPointer clientData,
949     XtPointer callData
950 )
951 {
952     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
953     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
954     
955     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
956     _DtFileChooserSet( _DtFileChooseRevert, 0 );
957     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
958 }
959
960
961 void 
962 fileNetfile(
963     Widget widget,
964     XtPointer clientData,
965     XtPointer callData
966 )
967 {
968     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
969     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
970     
971     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
972     _DtFileChooserSet( _DtFileChooseNetfile, 0 );
973     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
974 }
975
976
977 void 
978 netfileFile(
979     Widget widget,
980     XtPointer clientData,
981     XtPointer callData
982 )
983 {
984     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
985     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
986     
987     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
988     _DtStringChooserSet( _DtStringChooseNetfile2File, 0 );
989     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
990 }
991
992
993 void 
994 fileDesktopQuit(
995     Widget widget,
996     XtPointer clientData,
997     XtPointer callData
998 )
999 {
1000     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
1001     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
1002     
1003     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
1004     _DtTtChooserSet( _DtTtChooserDtFileQuit );
1005     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
1006 }
1007
1008
1009 void 
1010 fileMoved(
1011     Widget widget,
1012     XtPointer clientData,
1013     XtPointer callData
1014 )
1015 {
1016     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
1017     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
1018     
1019     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
1020     _DtTtChooserSet( _DtTtChooserDtFileMoved );
1021     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
1022 }
1023
1024
1025 void 
1026 fileDeleted(
1027     Widget widget,
1028     XtPointer clientData,
1029     XtPointer callData
1030 )
1031 {
1032     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
1033     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
1034     
1035     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
1036     _DtTtChooserSet( _DtTtChooserDtFileDeleted );
1037     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
1038 }
1039
1040
1041 void 
1042 dtSessionQuit(
1043     Widget widget,
1044     XtPointer clientData,
1045     XtPointer callData
1046 )
1047 {
1048     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
1049     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
1050     
1051     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
1052     _DtTtChooserSet( _DtTtChooserDtSessionQuit );
1053     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
1054 }
1055
1056
1057 void 
1058 procidOpen(
1059     Widget widget,
1060     XtPointer clientData,
1061     XtPointer callData
1062 )
1063 {
1064     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
1065     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
1066     
1067     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
1068     DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
1069     char *procid = tt_open();
1070     Widget label = instance->ttsnoopWin_label;
1071     DtTtSetLabel( label, "tt_open()", procid );
1072     int fd = tt_fd();
1073     Tt_status status = tt_int_error( fd );
1074     if (tt_is_err( status )) {
1075             DtTtSetLabel( instance->ttsnoopWin_label, "tt_fd()", status );
1076             return;
1077     }
1078     XtInputId id = XtAppAddInput( XtWidgetToApplicationContext( label ),
1079                                   fd, (XtPointer)XtInputReadMask,
1080                                   tttk_Xt_input_handler, procid );
1081     DtTtCreated( DTTT_PROCID, procid, (void *)id );
1082     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
1083 }
1084
1085
1086 void 
1087 procidClose(
1088     Widget widget,
1089     XtPointer clientData,
1090     XtPointer callData
1091 )
1092 {
1093     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
1094     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
1095     
1096     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
1097     DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
1098     char *procid = tt_default_procid();
1099     Tt_status status = DtTtSetLabel( instance->ttsnoopWin_label,
1100                                      "tt_default_procid()", procid );
1101     if (tt_is_err( status )) {
1102             return;
1103     }
1104     status = tt_close();
1105     DtTtSetLabel( instance->ttsnoopWin_label, "tt_close()", status );
1106     int nth = DtTtIndex( DTTT_PROCID, procid );
1107     if (nth < 0) {
1108             return;
1109     }
1110     XtInputId id = (XtInputId)DtTtNthClientDatum( DTTT_PROCID, nth );
1111     if (id != 0) {
1112             XtRemoveInput( id );
1113     }
1114     DtTtDestroyed( DTTT_PROCID, procid );
1115     tt_free( procid );
1116     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
1117 }
1118
1119
1120 void 
1121 procidSetDefault(
1122     Widget widget,
1123     XtPointer clientData,
1124     XtPointer callData
1125 )
1126 {
1127     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
1128     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
1129     
1130     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
1131     _DtTtChooserSet( _DtTtChooserProcidSetDefault );
1132     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
1133 }
1134
1135
1136 void 
1137 procidSuspend(
1138     Widget widget,
1139     XtPointer clientData,
1140     XtPointer callData
1141 )
1142 {
1143     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
1144     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
1145     
1146     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
1147     _DtTtChooserSet( _DtTtChooserProcidSuspend );
1148     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
1149 }
1150
1151
1152 void 
1153 procidResume(
1154     Widget widget,
1155     XtPointer clientData,
1156     XtPointer callData
1157 )
1158 {
1159     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
1160     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
1161     
1162     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
1163     _DtTtChooserSet( _DtTtChooserProcidResume );
1164     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
1165 }
1166
1167
1168 void 
1169 procidDtOpen(
1170     Widget widget,
1171     XtPointer clientData,
1172     XtPointer callData
1173 )
1174 {
1175     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
1176     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
1177     
1178     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
1179     DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
1180     int fd;
1181     char *procid = ttdt_open( &fd, "Ttsnoop", "CDE", globalVersionString, 1 );
1182     Widget label = instance->ttsnoopWin_label;
1183     DtTtSetLabel( label, "ttdt_open()", procid );
1184     if (! tt_is_err( tt_ptr_error( procid ) )) {
1185             XtInputId id;
1186             id = XtAppAddInput( XtWidgetToApplicationContext( label ),
1187                                 fd, (XtPointer)XtInputReadMask,
1188                                 tttk_Xt_input_handler, procid );
1189             DtTtCreated( DTTT_PROCID, procid, (void *)id );
1190     }
1191     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
1192 }
1193
1194
1195 void 
1196 procidDtClose(
1197     Widget widget,
1198     XtPointer clientData,
1199     XtPointer callData
1200 )
1201 {
1202     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
1203     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
1204     
1205     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
1206     _DtTtChooserSet( _DtTtChooserDtProcidClose );
1207     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
1208 }
1209
1210
1211 void 
1212 procidDefault(
1213     Widget widget,
1214     XtPointer clientData,
1215     XtPointer callData
1216 )
1217 {
1218     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
1219     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
1220     
1221     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
1222     char *val = tt_default_procid();
1223     snoopStream << "tt_default_procid() = " << (void *)val;
1224     if (tt_is_err( tt_ptr_error( val ))) {
1225             snoopStream << tt_ptr_error( val );
1226     } else if (val != 0) {
1227             snoopStream << val;
1228     }
1229     snoopStream << endl;
1230     tt_free( val );
1231     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
1232 }
1233
1234
1235 void 
1236 ptypeDefault(
1237     Widget widget,
1238     XtPointer clientData,
1239     XtPointer callData
1240 )
1241 {
1242     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
1243     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
1244     
1245     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
1246     char *val = tt_default_ptype();
1247     snoopStream << "tt_default_ptype() = " << (void *)val;
1248     if (tt_is_err( tt_ptr_error( val ))) {
1249             snoopStream << tt_ptr_error( val );
1250     } else if (val != 0) {
1251             snoopStream << val;
1252     }
1253     snoopStream << endl;
1254     tt_free( val );
1255     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
1256 }
1257
1258
1259 void 
1260 sessionDefault(
1261     Widget widget,
1262     XtPointer clientData,
1263     XtPointer callData
1264 )
1265 {
1266     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
1267     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
1268     
1269     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
1270     char *val = tt_default_session();
1271     snoopStream << "tt_default_session() = " << (void *)val;
1272     if (tt_is_err( tt_ptr_error( val ))) {
1273             snoopStream << tt_ptr_error( val );
1274     } else if (val != 0) {
1275             snoopStream << val;
1276     }
1277     snoopStream << endl;
1278     tt_free( val );
1279     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
1280 }
1281
1282
1283 void 
1284 fileDefault(
1285     Widget widget,
1286     XtPointer clientData,
1287     XtPointer callData
1288 )
1289 {
1290     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
1291     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
1292     
1293     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
1294     char *val = tt_default_file();
1295     snoopStream << "tt_default_file() = " << (void *)val;
1296     if (tt_is_err( tt_ptr_error( val ))) {
1297             snoopStream << tt_ptr_error( val );
1298     } else if (val != 0) {
1299             snoopStream << val;
1300     }
1301     snoopStream << endl;
1302     tt_free( val );
1303     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
1304 }
1305
1306
1307 void 
1308 toggleSnooping(
1309     Widget widget,
1310     XtPointer clientData,
1311     XtPointer callData
1312 )
1313 {
1314     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
1315     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
1316     
1317     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
1318     DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
1319     if (snoopPat == 0) {
1320             DtTtSetLabel( instance->ttsnoopWin_label, "Tt_pattern == 0" );
1321             XtSetSensitive(
1322                 instance->menubar_Snoop_item_Snoop_menu_items.Off_item,
1323                 False );
1324             return;
1325     }
1326     Tt_status status;
1327     char *func;
1328     if (snoopPatIsRegistered) {
1329             status = tt_pattern_unregister( snoopPat );
1330             func = "tt_pattern_unregister(";
1331     } else {
1332             status = tt_pattern_register( snoopPat );
1333             func = "tt_pattern_register(";
1334     }
1335     if (! tt_is_err( status )) {
1336             snoopPatIsRegistered = ! snoopPatIsRegistered;
1337     }
1338     std::ostringstream stream;
1339     stream << func << (void *)snoopPat << ")" << ends;
1340     DtTtSetLabel( instance->ttsnoopWin_label, stream.str().c_str(), status );
1341     DtTtSetLabel( instance->menubar_Snoop_item_Snoop_menu_items.Off_item,
1342                   snoopPatIsRegistered ? "Off" : "On" );
1343     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
1344 }
1345
1346
1347 void 
1348 printVersion(
1349     Widget widget,
1350     XtPointer clientData,
1351     XtPointer callData
1352 )
1353 {
1354     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
1355     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
1356     
1357     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
1358     snoopStream << "ttsnoop: " << globalVersionString << endl;
1359     snoopStream << "tt_c.h: " << TT_VERSION << endl;
1360     snoopStream << "libtt: " << _tt_lib_version << endl;
1361     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
1362 }
1363
1364
1365 void 
1366 createStandardMessage(
1367     Widget widget,
1368     XtPointer clientData,
1369     XtPointer callData
1370 )
1371 {
1372     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
1373     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
1374     
1375     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
1376     _DtTtChooserSet( _DtTtChooserMessageCreateStandard );
1377     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
1378 }
1379
1380
1381
1382 /**************************************************************************
1383  *** DTB_USER_CODE_START
1384  ***
1385  *** All automatically-generated data and functions have been defined.
1386  ***
1387  *** Add new functions here, or at the top of the file.
1388  ***/
1389
1390 /*** DTB_USER_CODE_END
1391  ***
1392  *** End of user code section
1393  ***
1394  **************************************************************************/
1395
1396