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 ^^^ ***/
10 * File: ttsnoop_stubs.c
11 * Contains: Module callbacks and connection functions
13 * This file was generated by dtcodegen, from module ttsnoop
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.
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! **
26 #include "dtb_utils.h"
27 #include "ttsnoop_ui.h"
30 /**************************************************************************
31 *** DTB_USER_CODE_START
33 *** All necessary header files have been included.
35 *** Add include files, types, macros, externs, and user functions here.
40 #if defined(linux) || defined(CSRG_BASED)
45 #include <strstream.h>
48 #include "apiTracer_ui.h"
51 extern "C" { const char *_tt_lib_version; };
53 extern std::ofstream snoopStream;
54 extern unsigned int globalSaveLines;
55 extern char * traceScript;
56 extern const char * globalVersionString;
57 extern Tt_pattern snoopPat;
58 extern Boolean snoopPatIsRegistered;
60 /*** DTB_USER_CODE_END
62 *** End of user code section
64 **************************************************************************/
69 ttsnoop_Help_menu_On_Item_item_CB1(
75 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
76 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
79 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
80 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
91 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
92 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
94 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
95 DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
96 std::ostrstream tttraceCmd;
97 tttraceCmd << "unset TT_TRACE_SCRIPT; dtterm -sb -sl ";
98 tttraceCmd << globalSaveLines;
99 tttraceCmd << " -title tttrace -geometry 120x24 -e tttrace &";
100 DtTtSetLabel( instance->ttsnoopWin_label, "tttrace" );
101 system( tttraceCmd.str() );
102 delete tttraceCmd.str();
103 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
110 XtPointer clientData,
114 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
115 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
117 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
118 DtbApiTracerTracerInfo instance = &dtb_api_tracer_tracer;
119 if (!(instance->initialized))
121 dtb_api_tracer_tracer_initialize(
122 instance, dtb_ttsnoop_ttsnoop_win.ttsnoopWin);
124 DtTtSetLabel( instance->cancelButton, "Stop" );
125 XtManageChild(instance->tracer_shellform);
126 tt_trace_control( 0 );
127 putenv( traceScript );
128 tt_trace_control( 1 );
129 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
136 XtPointer clientData,
140 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
141 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
143 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
144 DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
145 Tt_message msg = tt_message_create();
146 Tt_status status = DtTtSetLabel( instance->ttsnoopWin_label,
147 "tt_message_create()", msg );
148 if (tt_is_err( status )) {
151 DtTtCreated( DTTT_MESSAGE, msg );
152 Widget newWidget = DtTtMessageWidgetCreate( instance->ttsnoopWin, msg,
153 DtTtMessageWidgetUpdate );
154 status = tt_ptr_error( newWidget );
155 if (tt_is_err( status )) {
158 XRaiseWindow( XtDisplay( newWidget ), XtWindow( newWidget ));
159 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
166 XtPointer clientData,
170 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
171 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
173 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
174 DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
175 Tt_message msg = tt_message_receive();
176 Tt_status status = DtTtSetLabel( instance->ttsnoopWin_label,
177 "tt_message_receive()", msg );
178 if (tt_is_err( status )) {
184 DtTtCreated( DTTT_MESSAGE, msg );
185 Widget newWidget = DtTtMessageWidgetCreate( instance->ttsnoopWin, msg,
186 DtTtMessageWidgetUpdate );
187 status = tt_ptr_error( newWidget );
188 if (tt_is_err( status )) {
191 XRaiseWindow( XtDisplay( newWidget ), XtWindow( newWidget ));
192 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
199 XtPointer clientData,
203 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
204 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
206 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
207 _DtTtChooserSet( _DtTtChooserMessageOpen );
208 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
215 XtPointer clientData,
219 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
220 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
222 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
223 _DtTtChooserSet( _DtTtChooserMessageDestroy );
224 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
231 XtPointer clientData,
235 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
236 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
238 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
239 DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
240 _DtMan( instance->ttsnoopWin_label, "ttsnoop" );
241 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
248 XtPointer clientData,
252 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
253 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
255 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
256 DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
257 _DtMan( instance->ttsnoopWin_label, "tttrace" );
258 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
265 XtPointer clientData,
269 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
270 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
272 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
273 DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
274 _DtMan( instance->ttsnoopWin_label, "ttsession" );
275 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
282 XtPointer clientData,
286 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
287 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
289 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
290 DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
291 _DtMan( instance->ttsnoopWin_label, "tt_type_comp" );
292 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
299 XtPointer clientData,
303 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
304 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
306 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
307 DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
308 _DtMan( instance->ttsnoopWin_label, "rpc.ttdbserverd" );
309 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
316 XtPointer clientData,
320 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
321 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
323 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
324 DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
325 _DtMan( instance->ttsnoopWin_label, "tttracefile" );
326 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
333 XtPointer clientData,
337 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
338 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
340 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
341 DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
342 _DtMan( instance->ttsnoopWin_label, "Tttt_c" );
343 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
350 XtPointer clientData,
354 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
355 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
357 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
358 DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
359 _DtMan( instance->ttsnoopWin_label, "Tttttk" );
360 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
367 XtPointer clientData,
371 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
372 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
374 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
375 DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
376 char *buf = "news:alt.soft-sys.tooltalk";
377 _DtOpen( instance->ttsnoopWin_label, buf, strlen(buf), "altTT" );
378 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
385 XtPointer clientData,
389 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
390 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
392 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
393 _DtFileChooserSet( _DtFileChooseTypesLoad, 0 );
394 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
401 XtPointer clientData,
405 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
406 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
408 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
409 DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
410 Tt_message msg = ttdt_file_notice( 0, TTDT_SAVED, TT_BOTH,
411 "/etc/tt/types.xdr", 0 );
412 Tt_status status = DtTtSetLabel( instance->ttsnoopWin_label,
413 "ttdt_file_notice()", msg );
414 if (tt_is_err( status )) {
417 status = tt_message_send( msg );
418 if (tt_is_err( status )) {
419 DtTtSetLabel( instance->ttsnoopWin_label, "tt_message_send()",
422 DtTtCreated( DTTT_MESSAGE, msg );
423 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
430 XtPointer clientData,
434 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
435 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
437 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
438 DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
439 _DtOpen( instance->ttsnoopWin_label, "tt_type_comp -p", "types" );
440 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
447 XtPointer clientData,
451 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
452 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
454 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
455 DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
456 _DtOpen( instance->ttsnoopWin_label, "tt_type_comp -P", "types" );
457 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
464 XtPointer clientData,
468 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
469 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
471 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
472 DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
473 Tt_pattern pat = tt_pattern_create();
474 Tt_status status = DtTtSetLabel( instance->ttsnoopWin_label,
475 "tt_pattern_create()", pat );
476 if (tt_is_err( status )) {
479 DtTtCreated( DTTT_PATTERN, pat );
480 Widget newWidget = DtTtPatternWidgetCreate( instance->ttsnoopWin, pat, 0 );
481 status = tt_ptr_error( newWidget );
482 if (tt_is_err( status )) {
485 XRaiseWindow( XtDisplay( newWidget ), XtWindow( newWidget ));
486 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
493 XtPointer clientData,
497 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
498 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
500 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
501 _DtTtChooserSet( _DtTtChooserPatternOpen );
502 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
509 XtPointer clientData,
513 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
514 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
516 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
517 _DtTtChooserSet( _DtTtChooserPatternDestroy );
518 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
525 XtPointer clientData,
529 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
530 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
532 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
533 _DtStringChooserSet( _DtStringChoosePtype2Declare, 0 );
534 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
541 XtPointer clientData,
545 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
546 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
548 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
549 _DtStringChooserSet( _DtStringChooseMediaPtype2Declare, 0 );
550 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
557 XtPointer clientData,
561 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
562 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
564 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
565 _DtStringChooserSet( _DtStringChoosePtype2UnDeclare, 0 );
566 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
573 XtPointer clientData,
577 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
578 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
580 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
581 _DtStringChooserSet( _DtStringChoosePtype2SetDefault, 0 );
582 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
589 XtPointer clientData,
593 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
594 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
596 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
597 _DtStringChooserSet( _DtStringChoosePtype2Exists, 0 );
598 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
605 XtPointer clientData,
609 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
610 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
612 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
613 _DtStringChooserSet( _DtStringChooseSystem, 0 );
614 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
621 XtPointer clientData,
625 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
626 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
628 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
629 _DtFileChooserSet( _DtFileChooseChdir, 0 );
630 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
637 XtPointer clientData,
641 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
642 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
644 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
645 _DtStringChooserSet( _DtStringChoosePutenv, 0 );
646 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
653 XtPointer clientData,
657 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
658 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
660 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
661 DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
662 std::ostrstream advice;
663 advice << "pause(); /* kill -CONT " << getpid() << " */";
664 DtTtSetLabel( instance->ttsnoopWin_label, advice.str() );
668 // run "(if dterror.ds blah blah; then kill -CONT pid; fi)&"
670 std::ostrstream script;
671 script << "(if dterror.ds ";
673 script << "\"kill -CONT " << getpid() << "\" ";
674 // arg 2: window title
675 script << "\"pause()\" ";
676 // arg 3: confirmation button label
677 script << "CONT; then ";
678 // After confirmation, invoke kill(1)
679 script << "kill -CONT " << getpid() << "; fi)&";
680 system( script.str() );
683 // Run the event loop a few laps, to paint the footer
684 tttk_block_while( XtWidgetToApplicationContext( widget ), 0, 50 );
687 DtTtSetLabel( instance->ttsnoopWin_label, " " );
688 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
695 XtPointer clientData,
699 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
700 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
702 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
704 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
711 XtPointer clientData,
715 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
716 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
718 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
719 DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
720 _DtOpen( instance->ttsnoopWin_label,
721 "dttypes -db ACTION -w fld_name TYPE fld_value TT_MSG", "actns" );
722 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
729 XtPointer clientData,
733 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
734 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
736 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
737 _DtSessionChooserSet( _DtSessionChooseJoin, 0 );
738 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
745 XtPointer clientData,
749 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
750 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
752 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
753 _DtSessionChooserSet( _DtSessionChooseDtJoin, 0 );
754 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
761 XtPointer clientData,
765 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
766 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
768 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
769 _DtSessionChooserSet( _DtSessionChooseQuit, 0 );
770 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
777 XtPointer clientData,
781 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
782 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
784 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
785 _DtSessionChooserSet( _DtSessionChooseDefault, 0 );
786 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
793 XtPointer clientData,
797 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
798 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
800 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
801 _DtFileChooserSet( _DtFileChooseJoin, 0 );
802 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
809 XtPointer clientData,
813 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
814 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
816 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
817 _DtFileChooserSet( _DtFileChooseDtJoin, 0 );
818 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
825 XtPointer clientData,
829 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
830 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
832 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
833 _DtFileChooserSet( _DtFileChooseQuit, 0 );
834 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
841 XtPointer clientData,
845 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
846 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
848 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
849 _DtFileChooserSet( _DtFileChooseDefault, 0 );
850 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
857 XtPointer clientData,
861 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
862 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
864 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
865 DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
866 Tt_status status = tt_default_file_set( 0 );
867 DtTtSetLabel( instance->ttsnoopWin_label, "tt_default_file_set( 0 )",
869 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
876 XtPointer clientData,
880 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
881 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
883 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
884 _DtTtChooserSet( _DtTtChooserDtFileSaved );
885 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
892 XtPointer clientData,
896 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
897 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
899 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
900 _DtTtChooserSet( _DtTtChooserDtFileModified );
901 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
908 XtPointer clientData,
912 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
913 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
915 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
916 _DtTtChooserSet( _DtTtChooserDtFileReverted );
917 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
924 XtPointer clientData,
928 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
929 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
931 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
932 _DtFileChooserSet( _DtFileChooseGetModified, 0 );
933 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
940 XtPointer clientData,
944 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
945 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
947 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
948 _DtFileChooserSet( _DtFileChooseSave, 0 );
949 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
956 XtPointer clientData,
960 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
961 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
963 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
964 _DtFileChooserSet( _DtFileChooseRevert, 0 );
965 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
972 XtPointer clientData,
976 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
977 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
979 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
980 _DtFileChooserSet( _DtFileChooseNetfile, 0 );
981 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
988 XtPointer clientData,
992 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
993 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
995 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
996 _DtStringChooserSet( _DtStringChooseNetfile2File, 0 );
997 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
1004 XtPointer clientData,
1008 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
1009 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
1011 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
1012 _DtTtChooserSet( _DtTtChooserDtFileQuit );
1013 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
1020 XtPointer clientData,
1024 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
1025 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
1027 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
1028 _DtTtChooserSet( _DtTtChooserDtFileMoved );
1029 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
1036 XtPointer clientData,
1040 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
1041 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
1043 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
1044 _DtTtChooserSet( _DtTtChooserDtFileDeleted );
1045 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
1052 XtPointer clientData,
1056 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
1057 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
1059 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
1060 _DtTtChooserSet( _DtTtChooserDtSessionQuit );
1061 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
1068 XtPointer clientData,
1072 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
1073 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
1075 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
1076 DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
1077 char *procid = tt_open();
1078 Widget label = instance->ttsnoopWin_label;
1079 DtTtSetLabel( label, "tt_open()", procid );
1081 Tt_status status = tt_int_error( fd );
1082 if (tt_is_err( status )) {
1083 DtTtSetLabel( instance->ttsnoopWin_label, "tt_fd()", status );
1086 XtInputId id = XtAppAddInput( XtWidgetToApplicationContext( label ),
1087 fd, (XtPointer)XtInputReadMask,
1088 tttk_Xt_input_handler, procid );
1089 DtTtCreated( DTTT_PROCID, procid, (void *)id );
1090 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
1097 XtPointer clientData,
1101 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
1102 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
1104 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
1105 DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
1106 char *procid = tt_default_procid();
1107 Tt_status status = DtTtSetLabel( instance->ttsnoopWin_label,
1108 "tt_default_procid()", procid );
1109 if (tt_is_err( status )) {
1112 status = tt_close();
1113 DtTtSetLabel( instance->ttsnoopWin_label, "tt_close()", status );
1114 int nth = DtTtIndex( DTTT_PROCID, procid );
1118 XtInputId id = (XtInputId)DtTtNthClientDatum( DTTT_PROCID, nth );
1120 XtRemoveInput( id );
1122 DtTtDestroyed( DTTT_PROCID, procid );
1124 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
1131 XtPointer clientData,
1135 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
1136 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
1138 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
1139 _DtTtChooserSet( _DtTtChooserProcidSetDefault );
1140 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
1147 XtPointer clientData,
1151 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
1152 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
1154 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
1155 _DtTtChooserSet( _DtTtChooserProcidSuspend );
1156 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
1163 XtPointer clientData,
1167 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
1168 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
1170 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
1171 _DtTtChooserSet( _DtTtChooserProcidResume );
1172 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
1179 XtPointer clientData,
1183 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
1184 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
1186 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
1187 DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
1189 char *procid = ttdt_open( &fd, "Ttsnoop", "CDE", globalVersionString, 1 );
1190 Widget label = instance->ttsnoopWin_label;
1191 DtTtSetLabel( label, "ttdt_open()", procid );
1192 if (! tt_is_err( tt_ptr_error( procid ) )) {
1194 id = XtAppAddInput( XtWidgetToApplicationContext( label ),
1195 fd, (XtPointer)XtInputReadMask,
1196 tttk_Xt_input_handler, procid );
1197 DtTtCreated( DTTT_PROCID, procid, (void *)id );
1199 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
1206 XtPointer clientData,
1210 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
1211 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
1213 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
1214 _DtTtChooserSet( _DtTtChooserDtProcidClose );
1215 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
1222 XtPointer clientData,
1226 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
1227 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
1229 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
1230 char *val = tt_default_procid();
1231 snoopStream << "tt_default_procid() = " << (void *)val;
1232 if (tt_is_err( tt_ptr_error( val ))) {
1233 snoopStream << tt_ptr_error( val );
1234 } else if (val != 0) {
1237 snoopStream << endl;
1239 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
1246 XtPointer clientData,
1250 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
1251 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
1253 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
1254 char *val = tt_default_ptype();
1255 snoopStream << "tt_default_ptype() = " << (void *)val;
1256 if (tt_is_err( tt_ptr_error( val ))) {
1257 snoopStream << tt_ptr_error( val );
1258 } else if (val != 0) {
1261 snoopStream << endl;
1263 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
1270 XtPointer clientData,
1274 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
1275 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
1277 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
1278 char *val = tt_default_session();
1279 snoopStream << "tt_default_session() = " << (void *)val;
1280 if (tt_is_err( tt_ptr_error( val ))) {
1281 snoopStream << tt_ptr_error( val );
1282 } else if (val != 0) {
1285 snoopStream << endl;
1287 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
1294 XtPointer clientData,
1298 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
1299 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
1301 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
1302 char *val = tt_default_file();
1303 snoopStream << "tt_default_file() = " << (void *)val;
1304 if (tt_is_err( tt_ptr_error( val ))) {
1305 snoopStream << tt_ptr_error( val );
1306 } else if (val != 0) {
1309 snoopStream << endl;
1311 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
1318 XtPointer clientData,
1322 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
1323 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
1325 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
1326 DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
1327 if (snoopPat == 0) {
1328 DtTtSetLabel( instance->ttsnoopWin_label, "Tt_pattern == 0" );
1330 instance->menubar_Snoop_item_Snoop_menu_items.Off_item,
1336 if (snoopPatIsRegistered) {
1337 status = tt_pattern_unregister( snoopPat );
1338 func = "tt_pattern_unregister(";
1340 status = tt_pattern_register( snoopPat );
1341 func = "tt_pattern_register(";
1343 if (! tt_is_err( status )) {
1344 snoopPatIsRegistered = ! snoopPatIsRegistered;
1346 std::ostrstream stream;
1347 stream << func << (void *)snoopPat << ")" << ends;
1348 DtTtSetLabel( instance->ttsnoopWin_label, stream.str(), status );
1349 delete stream.str();
1350 DtTtSetLabel( instance->menubar_Snoop_item_Snoop_menu_items.Off_item,
1351 snoopPatIsRegistered ? "Off" : "On" );
1352 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
1359 XtPointer clientData,
1363 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
1364 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
1366 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
1367 snoopStream << "ttsnoop: " << globalVersionString << endl;
1368 snoopStream << "tt_c.h: " << TT_VERSION << endl;
1369 snoopStream << "libtt: " << _tt_lib_version << endl;
1370 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
1375 createStandardMessage(
1377 XtPointer clientData,
1381 /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
1382 /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
1384 /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
1385 _DtTtChooserSet( _DtTtChooserMessageCreateStandard );
1386 /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
1391 /**************************************************************************
1392 *** DTB_USER_CODE_START
1394 *** All automatically-generated data and functions have been defined.
1396 *** Add new functions here, or at the top of the file.
1399 /*** DTB_USER_CODE_END
1401 *** End of user code section
1403 **************************************************************************/