1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396 |
- /*** DTB_USER_CODE_START vvv Add file header below vvv ***/
- //%% (c) Copyright 1993, 1994 Hewlett-Packard Company
- //%% (c) Copyright 1993, 1994 International Business Machines Corp.
- //%% (c) Copyright 1993, 1994 Sun Microsystems, Inc.
- //%% (c) Copyright 1993, 1994 Novell, Inc.
- //%% $XConsortium: ttsnoop_stubs.C.src /main/3 1995/11/06 17:14:48 rswiston $
- /*** DTB_USER_CODE_END ^^^ Add file header above ^^^ ***/
- /*
- * File: ttsnoop_stubs.c
- * Contains: Module callbacks and connection functions
- *
- * This file was generated by dtcodegen, from module ttsnoop
- *
- * Any text may be added between the DTB_USER_CODE_START and
- * DTB_USER_CODE_END comments (even non-C code). Descriptive comments
- * are provided only as an aid.
- *
- * ** EDIT ONLY WITHIN SECTIONS MARKED WITH DTB_USER_CODE COMMENTS. **
- * ** ALL OTHER MODIFICATIONS WILL BE OVERWRITTEN. DO NOT MODIFY OR **
- * ** DELETE THE GENERATED COMMENTS! **
- */
- #include <stdio.h>
- #include <Xm/Xm.h>
- #include "dtb_utils.h"
- #include "ttsnoop_ui.h"
- /**************************************************************************
- *** DTB_USER_CODE_START
- ***
- *** All necessary header files have been included.
- ***
- *** Add include files, types, macros, externs, and user functions here.
- ***/
- #include <unistd.h>
- #include <fstream>
- #include <sstream>
- #include "apiTracer_ui.h"
- #include "DtTt.h"
- extern "C" { const char *_tt_lib_version; };
- extern std::ofstream snoopStream;
- extern unsigned int globalSaveLines;
- extern std::string traceScript;
- extern const char * globalVersionString;
- extern Tt_pattern snoopPat;
- extern Boolean snoopPatIsRegistered;
- /*** DTB_USER_CODE_END
- ***
- *** End of user code section
- ***
- **************************************************************************/
- void
- ttsnoop_Help_menu_On_Item_item_CB1(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- dtb_do_onitem_help();
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- fork_tttrace(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
- std::ostringstream tttraceCmd;
- tttraceCmd << "unset TT_TRACE_SCRIPT; dtterm -sb -sl ";
- tttraceCmd << globalSaveLines;
- tttraceCmd << " -title tttrace -geometry 120x24 -e tttrace &";
- DtTtSetLabel( instance->ttsnoopWin_label, "tttrace" );
- system( tttraceCmd.str().c_str() );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- turnOnTracing(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- DtbApiTracerTracerInfo instance = &dtb_api_tracer_tracer;
- if (!(instance->initialized))
- {
- dtb_api_tracer_tracer_initialize(
- instance, dtb_ttsnoop_ttsnoop_win.ttsnoopWin);
- }
- DtTtSetLabel( instance->cancelButton, "Stop" );
- XtManageChild(instance->tracer_shellform);
- tt_trace_control( 0 );
- putenv( const_cast<char *>(traceScript.c_str()) );
- tt_trace_control( 1 );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- createMessage(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
- Tt_message msg = tt_message_create();
- Tt_status status = DtTtSetLabel( instance->ttsnoopWin_label,
- "tt_message_create()", msg );
- if (tt_is_err( status )) {
- return;
- }
- DtTtCreated( DTTT_MESSAGE, msg );
- Widget newWidget = DtTtMessageWidgetCreate( instance->ttsnoopWin, msg,
- DtTtMessageWidgetUpdate );
- status = tt_ptr_error( newWidget );
- if (tt_is_err( status )) {
- return;
- }
- XRaiseWindow( XtDisplay( newWidget ), XtWindow( newWidget ));
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- receiveMessage(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
- Tt_message msg = tt_message_receive();
- Tt_status status = DtTtSetLabel( instance->ttsnoopWin_label,
- "tt_message_receive()", msg );
- if (tt_is_err( status )) {
- return;
- }
- if (msg == 0) {
- return;
- }
- DtTtCreated( DTTT_MESSAGE, msg );
- Widget newWidget = DtTtMessageWidgetCreate( instance->ttsnoopWin, msg,
- DtTtMessageWidgetUpdate );
- status = tt_ptr_error( newWidget );
- if (tt_is_err( status )) {
- return;
- }
- XRaiseWindow( XtDisplay( newWidget ), XtWindow( newWidget ));
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- openMessage(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- _DtTtChooserSet( _DtTtChooserMessageOpen );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- destroyMessage(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- _DtTtChooserSet( _DtTtChooserMessageDestroy );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- help_ttsnoop(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
- _DtMan( instance->ttsnoopWin_label, "ttsnoop" );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- help_tttrace(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
- _DtMan( instance->ttsnoopWin_label, "tttrace" );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- help_ttsession(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
- _DtMan( instance->ttsnoopWin_label, "ttsession" );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- help_tt_type_comp(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
- _DtMan( instance->ttsnoopWin_label, "tt_type_comp" );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- help_dbserver(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
- _DtMan( instance->ttsnoopWin_label, "rpc.ttdbserverd" );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- help_tttracefile(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
- _DtMan( instance->ttsnoopWin_label, "tttracefile" );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- help_tt_c(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
- _DtMan( instance->ttsnoopWin_label, "Tttt_c" );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- help_tttk(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
- _DtMan( instance->ttsnoopWin_label, "Tttttk" );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- helpUsenet(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
- char *buf = "news:alt.soft-sys.tooltalk";
- _DtOpen( instance->ttsnoopWin_label, buf, strlen(buf), "altTT" );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- sessionTypesLoad(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- _DtFileChooserSet( _DtFileChooseTypesLoad, 0 );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- sessionTypesReload(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
- Tt_message msg = ttdt_file_notice( 0, TTDT_SAVED, TT_BOTH,
- "/etc/tt/types.xdr", 0 );
- Tt_status status = DtTtSetLabel( instance->ttsnoopWin_label,
- "ttdt_file_notice()", msg );
- if (tt_is_err( status )) {
- return;
- }
- status = tt_message_send( msg );
- if (tt_is_err( status )) {
- DtTtSetLabel( instance->ttsnoopWin_label, "tt_message_send()",
- status );
- }
- DtTtCreated( DTTT_MESSAGE, msg );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- dumpSource(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
- _DtOpen( instance->ttsnoopWin_label, "tt_type_comp -p", "types" );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- typesEnumerate(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
- _DtOpen( instance->ttsnoopWin_label, "tt_type_comp -P", "types" );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- createPattern(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
- Tt_pattern pat = tt_pattern_create();
- Tt_status status = DtTtSetLabel( instance->ttsnoopWin_label,
- "tt_pattern_create()", pat );
- if (tt_is_err( status )) {
- return;
- }
- DtTtCreated( DTTT_PATTERN, pat );
- Widget newWidget = DtTtPatternWidgetCreate( instance->ttsnoopWin, pat, 0 );
- status = tt_ptr_error( newWidget );
- if (tt_is_err( status )) {
- return;
- }
- XRaiseWindow( XtDisplay( newWidget ), XtWindow( newWidget ));
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- openPattern(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- _DtTtChooserSet( _DtTtChooserPatternOpen );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- destroyPattern(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- _DtTtChooserSet( _DtTtChooserPatternDestroy );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- ptypeDeclare(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- _DtStringChooserSet( _DtStringChoosePtype2Declare, 0 );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- mediaPtypeDeclare(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- _DtStringChooserSet( _DtStringChooseMediaPtype2Declare, 0 );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- ptypeUnDeclare(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- _DtStringChooserSet( _DtStringChoosePtype2UnDeclare, 0 );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- ptypeSetDefault(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- _DtStringChooserSet( _DtStringChoosePtype2SetDefault, 0 );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- ptypeExists(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- _DtStringChooserSet( _DtStringChoosePtype2Exists, 0 );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- libcSystem(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- _DtStringChooserSet( _DtStringChooseSystem, 0 );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- libcChdir(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- _DtFileChooserSet( _DtFileChooseChdir, 0 );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- libcPutenv(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- _DtStringChooserSet( _DtStringChoosePutenv, 0 );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- libcPause(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
- std::ostringstream advice;
- advice << "pause(); /* kill -CONT " << getpid() << " */";
- DtTtSetLabel( instance->ttsnoopWin_label, advice.str().c_str() );
- //
- // run "(if dterror.ds blah blah; then kill -CONT pid; fi)&"
- //
- std::ostringstream script;
- script << "(if dterror.ds ";
- // arg 1: text
- script << "\"kill -CONT " << getpid() << "\" ";
- // arg 2: window title
- script << "\"pause()\" ";
- // arg 3: confirmation button label
- script << "CONT; then ";
- // After confirmation, invoke kill(1)
- script << "kill -CONT " << getpid() << "; fi)&";
- system( script.str().c_str() );
- // Run the event loop a few laps, to paint the footer
- tttk_block_while( XtWidgetToApplicationContext( widget ), 0, 50 );
- pause();
- DtTtSetLabel( instance->ttsnoopWin_label, " " );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- libcExit(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- exit( 0 );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- msgActions(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
- _DtOpen( instance->ttsnoopWin_label,
- "dttypes -db ACTION -w fld_name TYPE fld_value TT_MSG", "actns" );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- sessionJoin(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- _DtSessionChooserSet( _DtSessionChooseJoin, 0 );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- dtSessionJoin(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- _DtSessionChooserSet( _DtSessionChooseDtJoin, 0 );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- sessionQuit(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- _DtSessionChooserSet( _DtSessionChooseQuit, 0 );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- sessionSetDefault(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- _DtSessionChooserSet( _DtSessionChooseDefault, 0 );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- fileJoin(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- _DtFileChooserSet( _DtFileChooseJoin, 0 );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- fileDesktopJoin(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- _DtFileChooserSet( _DtFileChooseDtJoin, 0 );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- fileQuit(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- _DtFileChooserSet( _DtFileChooseQuit, 0 );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- fileSetDefault(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- _DtFileChooserSet( _DtFileChooseDefault, 0 );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- fileUnSetDefault(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
- Tt_status status = tt_default_file_set( 0 );
- DtTtSetLabel( instance->ttsnoopWin_label, "tt_default_file_set( 0 )",
- status );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- fileSaved(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- _DtTtChooserSet( _DtTtChooserDtFileSaved );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- fileModified(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- _DtTtChooserSet( _DtTtChooserDtFileModified );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- fileReverted(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- _DtTtChooserSet( _DtTtChooserDtFileReverted );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- fileGetModified(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- _DtFileChooserSet( _DtFileChooseGetModified, 0 );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- fileSave(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- _DtFileChooserSet( _DtFileChooseSave, 0 );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- fileRevert(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- _DtFileChooserSet( _DtFileChooseRevert, 0 );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- fileNetfile(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- _DtFileChooserSet( _DtFileChooseNetfile, 0 );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- netfileFile(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- _DtStringChooserSet( _DtStringChooseNetfile2File, 0 );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- fileDesktopQuit(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- _DtTtChooserSet( _DtTtChooserDtFileQuit );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- fileMoved(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- _DtTtChooserSet( _DtTtChooserDtFileMoved );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- fileDeleted(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- _DtTtChooserSet( _DtTtChooserDtFileDeleted );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- dtSessionQuit(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- _DtTtChooserSet( _DtTtChooserDtSessionQuit );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- procidOpen(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
- char *procid = tt_open();
- Widget label = instance->ttsnoopWin_label;
- DtTtSetLabel( label, "tt_open()", procid );
- int fd = tt_fd();
- Tt_status status = tt_int_error( fd );
- if (tt_is_err( status )) {
- DtTtSetLabel( instance->ttsnoopWin_label, "tt_fd()", status );
- return;
- }
- XtInputId id = XtAppAddInput( XtWidgetToApplicationContext( label ),
- fd, (XtPointer)XtInputReadMask,
- tttk_Xt_input_handler, procid );
- DtTtCreated( DTTT_PROCID, procid, (void *)id );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- procidClose(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
- char *procid = tt_default_procid();
- Tt_status status = DtTtSetLabel( instance->ttsnoopWin_label,
- "tt_default_procid()", procid );
- if (tt_is_err( status )) {
- return;
- }
- status = tt_close();
- DtTtSetLabel( instance->ttsnoopWin_label, "tt_close()", status );
- int nth = DtTtIndex( DTTT_PROCID, procid );
- if (nth < 0) {
- return;
- }
- XtInputId id = (XtInputId)DtTtNthClientDatum( DTTT_PROCID, nth );
- if (id != 0) {
- XtRemoveInput( id );
- }
- DtTtDestroyed( DTTT_PROCID, procid );
- tt_free( procid );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- procidSetDefault(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- _DtTtChooserSet( _DtTtChooserProcidSetDefault );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- procidSuspend(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- _DtTtChooserSet( _DtTtChooserProcidSuspend );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- procidResume(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- _DtTtChooserSet( _DtTtChooserProcidResume );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- procidDtOpen(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
- int fd;
- char *procid = ttdt_open( &fd, "Ttsnoop", "CDE", globalVersionString, 1 );
- Widget label = instance->ttsnoopWin_label;
- DtTtSetLabel( label, "ttdt_open()", procid );
- if (! tt_is_err( tt_ptr_error( procid ) )) {
- XtInputId id;
- id = XtAppAddInput( XtWidgetToApplicationContext( label ),
- fd, (XtPointer)XtInputReadMask,
- tttk_Xt_input_handler, procid );
- DtTtCreated( DTTT_PROCID, procid, (void *)id );
- }
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- procidDtClose(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- _DtTtChooserSet( _DtTtChooserDtProcidClose );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- procidDefault(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- char *val = tt_default_procid();
- snoopStream << "tt_default_procid() = " << (void *)val;
- if (tt_is_err( tt_ptr_error( val ))) {
- snoopStream << tt_ptr_error( val );
- } else if (val != 0) {
- snoopStream << val;
- }
- snoopStream << endl;
- tt_free( val );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- ptypeDefault(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- char *val = tt_default_ptype();
- snoopStream << "tt_default_ptype() = " << (void *)val;
- if (tt_is_err( tt_ptr_error( val ))) {
- snoopStream << tt_ptr_error( val );
- } else if (val != 0) {
- snoopStream << val;
- }
- snoopStream << endl;
- tt_free( val );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- sessionDefault(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- char *val = tt_default_session();
- snoopStream << "tt_default_session() = " << (void *)val;
- if (tt_is_err( tt_ptr_error( val ))) {
- snoopStream << tt_ptr_error( val );
- } else if (val != 0) {
- snoopStream << val;
- }
- snoopStream << endl;
- tt_free( val );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- fileDefault(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- char *val = tt_default_file();
- snoopStream << "tt_default_file() = " << (void *)val;
- if (tt_is_err( tt_ptr_error( val ))) {
- snoopStream << tt_ptr_error( val );
- } else if (val != 0) {
- snoopStream << val;
- }
- snoopStream << endl;
- tt_free( val );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- toggleSnooping(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- DtbTtsnoopTtsnoopWinInfo instance = (DtbTtsnoopTtsnoopWinInfo)clientData;
- if (snoopPat == 0) {
- DtTtSetLabel( instance->ttsnoopWin_label, "Tt_pattern == 0" );
- XtSetSensitive(
- instance->menubar_Snoop_item_Snoop_menu_items.Off_item,
- False );
- return;
- }
- Tt_status status;
- char *func;
- if (snoopPatIsRegistered) {
- status = tt_pattern_unregister( snoopPat );
- func = "tt_pattern_unregister(";
- } else {
- status = tt_pattern_register( snoopPat );
- func = "tt_pattern_register(";
- }
- if (! tt_is_err( status )) {
- snoopPatIsRegistered = ! snoopPatIsRegistered;
- }
- std::ostringstream stream;
- stream << func << (void *)snoopPat << ")" << ends;
- DtTtSetLabel( instance->ttsnoopWin_label, stream.str().c_str(), status );
- DtTtSetLabel( instance->menubar_Snoop_item_Snoop_menu_items.Off_item,
- snoopPatIsRegistered ? "Off" : "On" );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- printVersion(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- snoopStream << "ttsnoop: " << globalVersionString << endl;
- snoopStream << "tt_c.h: " << TT_VERSION << endl;
- snoopStream << "libtt: " << _tt_lib_version << endl;
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- createStandardMessage(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- _DtTtChooserSet( _DtTtChooserMessageCreateStandard );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- /**************************************************************************
- *** DTB_USER_CODE_START
- ***
- *** All automatically-generated data and functions have been defined.
- ***
- *** Add new functions here, or at the top of the file.
- ***/
- /*** DTB_USER_CODE_END
- ***
- *** End of user code section
- ***
- **************************************************************************/
|