12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384 |
- /*** 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: messageProps_stubs.C.src /main/4 1996/03/18 15:04:37 barstow $
- /*** DTB_USER_CODE_END ^^^ Add file header above ^^^ ***/
- /*
- * File: messageProps_stubs.c
- * Contains: Module callbacks and connection functions
- *
- * This file was generated by dtcodegen, from module messageProps
- *
- * 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 <stdint.h>
- #include <stdio.h>
- #include <Xm/Xm.h>
- #include "dtb_utils.h"
- #include "messageProps_ui.h"
- /*
- * Header files for cross-module connections
- */
- #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 <sstream>
- #include <Xm/TextF.h>
- #include <Dt/SpinBox.h>
- #include "DtTt.h"
- int DtTtMsgWidgetKey = (int) (long) DtTtMessageWidget;
- int DtTtMsgUpdateCBKey = DtTtMsgWidgetKey + 1;
- int DtTtMsgInfoKey = DtTtMsgWidgetKey + 2;
- Tt_callback_action
- _DtMsgUpdateMarshall(
- Tt_message msg,
- Tt_pattern
- )
- {
- DtTtMessageUpdateCallback cb = (DtTtMessageUpdateCallback)
- tt_message_user( msg, DtTtMsgUpdateCBKey );
- Tt_status status = tt_ptr_error( cb );
- if (tt_is_err( status ) || (cb == 0)) {
- return TT_CALLBACK_CONTINUE;
- }
- Widget widget = DtTtMessageWidget( msg );
- status = tt_ptr_error( widget );
- if (tt_is_err( status ) || (widget == 0)) {
- return TT_CALLBACK_CONTINUE;
- }
- // XXX Just guessing. Store oldState with tt_message_user_set()
- Tt_state oldState = TT_SENT;
- if (tt_message_state( msg ) == TT_SENT) {
- oldState = TT_CREATED;
- }
- (*cb)( widget, msg, oldState, TT_OK, True );
- return TT_CALLBACK_CONTINUE;
- }
- Widget
- DtTtMessageWidget(
- Tt_message msg
- )
- {
- // Function address is cast to int and used as clientdata key
- return (Widget)tt_message_user( msg, DtTtMsgWidgetKey );
- }
- static Tt_message
- messageProps2Msg(
- DtbMessagePropsMessagePropsInfo instance
- )
- {
- Tt_message msg;
- XtVaGetValues( instance->messageProps_shellform,
- XmNuserData, &msg, NULL );
- return msg;
- }
- static Boolean
- _DtTtMessageUpdating(
- Tt_message msg
- )
- {
- void *updating = tt_message_user( msg, (int) (long) _DtTtMessageUpdating );
- if (tt_is_err( tt_ptr_error( updating ))) {
- return False;
- }
- return updating == (void *)True;
- }
- static void
- _DtTtMessageSetUpdating(
- Tt_message msg,
- Boolean updating
- )
- {
- tt_message_user_set( msg, (int) (long) _DtTtMessageUpdating,
- (void *) (intptr_t)updating );
- }
- typedef enum {
- _DtTtMessageRePrint,
- _DtTtMessageArgAdded,
- _DtTtMessageFullUpdate
- } _DtTtMessageUpdateLevel;
- static void
- _DtTtMessageWidgetUpdate(
- DtbMessagePropsMessagePropsInfo instance,
- Tt_message msg,
- _DtTtMessageUpdateLevel level
- )
- {
- char *printout = tt_message_print( msg ); // XXX when to free?
- Tt_status status = tt_ptr_error( printout );
- if (tt_is_err( status )) {
- printout = tt_status_message( status );
- }
- XtVaSetValues( instance->messageText, XmNvalue, printout, NULL );
- if (level == _DtTtMessageRePrint) {
- return;
- }
- int numArgs = tt_message_args_count( msg );
- #define SetArgMenuItemSensitive(n) \
- XtSetSensitive( instance->setArgButton_setArgButton_menu_items. \
- Arg_##n##_item, numArgs > n );
- SetArgMenuItemSensitive(0);
- SetArgMenuItemSensitive(1);
- SetArgMenuItemSensitive(2);
- SetArgMenuItemSensitive(3);
- SetArgMenuItemSensitive(4);
- SetArgMenuItemSensitive(5);
- SetArgMenuItemSensitive(6);
- SetArgMenuItemSensitive(7);
- SetArgMenuItemSensitive(8);
- SetArgMenuItemSensitive(9);
- SetArgMenuItemSensitive(10);
- SetArgMenuItemSensitive(11);
- SetArgMenuItemSensitive(12);
- SetArgMenuItemSensitive(13);
- SetArgMenuItemSensitive(14);
- SetArgMenuItemSensitive(15);
- #undef SetArgMenuItemSensitive
- XtSetSensitive( instance->setArgButton_setArgButton_menu_items.
- Arg_15_item2, numArgs > 16 );
- if (level == _DtTtMessageArgAdded) {
- return;
- }
- _DtTtMessageSetUpdating( msg, True );
- char *op = tt_message_op( msg );
- status = tt_ptr_error( op );
- if (! tt_is_err( status )) {
- XmTextFieldSetString( instance->opText, op );
- tt_free( op );
- }
- char *handler = tt_message_handler( msg );
- status = tt_ptr_error( handler );
- if (! tt_is_err( status )) {
- XmTextFieldSetString( instance->handlerText, handler );
- tt_free( handler );
- }
- char *file = tt_message_file( msg );
- status = tt_ptr_error( file );
- if (! tt_is_err( status )) {
- XmTextFieldSetString( instance->fileText, file );
- tt_free( file );
- }
- char *session = tt_message_session( msg );
- status = tt_ptr_error( session );
- if (! tt_is_err( status )) {
- XmTextFieldSetString( instance->sessionText, session );
- tt_free( session );
- }
- int val = tt_message_status( msg );
- XtVaSetValues( instance->statusBox, DtNposition, val, NULL );
- char *status_string = tt_status_string( (Tt_status)val );
- DtTtSetLabel( instance->statusLabel, status_string );
- tt_free( status_string );
- Widget choice;
- switch (tt_message_class( msg )) {
- case TT_CLASS_UNDEFINED:
- default:
- choice = instance->classChoice_items.UNDEFINED_item;
- break;
- case TT_NOTICE:
- choice = instance->classChoice_items.NOTICE_item;
- break;
- case TT_REQUEST:
- choice = instance->classChoice_items.REQUEST_item;
- break;
- case TT_OFFER:
- choice = instance->classChoice_items.OFFER_item;
- break;
- }
- XtVaSetValues( instance->classChoice, XmNmenuHistory, choice, NULL );
- switch (tt_message_address( msg )) {
- case TT_PROCEDURE:
- choice = instance->addressChoice_items.PROCEDURE_item;
- break;
- case TT_OBJECT:
- choice = instance->addressChoice_items.OBJECT_item;
- break;
- case TT_HANDLER:
- choice = instance->addressChoice_items.HANDLER_item;
- break;
- case TT_OTYPE:
- choice = instance->addressChoice_items.OTYPE_item;
- break;
- case TT_ADDRESS_LAST:
- default:
- choice = instance->addressChoice_items.ADDRESS_LAST_item;
- break;
- }
- XtVaSetValues( instance->addressChoice, XmNmenuHistory, choice, NULL );
- switch (tt_message_scope( msg )) {
- case TT_SCOPE_NONE:
- default:
- choice = instance->scopeChoice_items.SCOPE_NONE_item;
- break;
- case TT_SESSION:
- choice = instance->scopeChoice_items.SESSION_item;
- break;
- case TT_FILE:
- choice = instance->scopeChoice_items.FILE_item;
- break;
- case TT_BOTH:
- choice = instance->scopeChoice_items.BOTH_item;
- break;
- case TT_FILE_IN_SESSION:
- choice = instance->scopeChoice_items.FILE_IN_SESSION_item;
- break;
- }
- XtVaSetValues( instance->scopeChoice, XmNmenuHistory, choice, NULL );
- switch (tt_message_disposition( msg )) {
- case TT_DISCARD:
- default:
- choice = instance->dispositionChoice_items.DISCARD_item;
- break;
- case TT_QUEUE:
- choice = instance->dispositionChoice_items.QUEUE_item;
- break;
- case TT_START:
- choice = instance->dispositionChoice_items.START_item;
- break;
- case TT_QUEUE+TT_START:
- choice = instance->dispositionChoice_items.QUEUE_START_item;
- break;
- }
- XtVaSetValues( instance->dispositionChoice, XmNmenuHistory, choice, NULL);
- _DtTtMessageSetUpdating( msg, False );
- }
- void
- DtTtMessageWidgetUpdate(
- Widget propsWin,
- Tt_message msg,
- Tt_state oldState,
- Tt_status lastOperation,
- Boolean stillExists
- )
- {
- void *v = tt_message_user( msg, DtTtMsgInfoKey );
- Tt_status status = tt_ptr_error( v );
- if (tt_is_err( status ) || (v == 0)) {
- return;
- }
- DtbMessagePropsMessagePropsInfo instance =
- (DtbMessagePropsMessagePropsInfo)v;
- _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageFullUpdate );
- }
- void
- _DtTtMessageUpdate(
- Tt_message msg,
- _DtStringChooserAction choice,
- char * val
- )
- {
- DtbMessagePropsMessagePropsInfo instance;
- instance = (DtbMessagePropsMessagePropsInfo)
- tt_message_user( msg, DtTtMsgInfoKey );
- Tt_status status = tt_ptr_error( instance );
- if (tt_is_err( status ) || (instance == 0)) {
- return;
- }
- char *func;
- switch (choice) {
- case _DtStringChooseMessageOtype:
- status = tt_message_otype_set( msg, val );
- func = "tt_message_otype_set()";
- break;
- case _DtStringChooseMessageObject:
- status = tt_message_object_set( msg, val );
- func = "tt_message_object_set()";
- break;
- case _DtStringChooseMessageHandlerPtype:
- status = tt_message_handler_ptype_set( msg, val );
- func = "tt_message_handler_ptype_set()";
- break;
- case _DtStringChooseMessageSenderPtype:
- status = tt_message_sender_ptype_set( msg, val );
- func = "tt_message_sender_ptype_set()";
- break;
- case _DtStringChooseMessageStatusString:
- status = tt_message_status_string_set( msg, val );
- func = "tt_message_status_string_set()";
- break;
- case _DtStringChooseMessageArgValSet: {
- if (val == 0) {
- break;
- }
- int arg = atoi( val );
- if ((arg <= 15) || (arg+1 > tt_message_args_count( msg ))) {
- break;
- }
- Tt_mode mode = tt_message_arg_mode( msg, arg );
- char *vtype = tt_message_arg_type( msg, arg );
- if (tt_is_err( tt_ptr_error( vtype ))) {
- vtype = 0;
- }
- char *val = 0;
- int ival = 0;
- Boolean noValue = False;
- Tt_status status = tt_message_arg_ival( msg, arg, &ival );
- if (status == TT_ERR_NUM) {
- val = tt_message_arg_val( msg, arg );
- if (tt_is_err( tt_ptr_error( val ))) {
- val = 0;
- }
- if (val == 0) {
- noValue = True;
- }
- }
- _DtArgChooserSet( _DtArgChooseMessageArgSet, msg, arg,
- mode, noValue, vtype, val, ival );
- } return;
- default:
- return;
- }
- DtTtSetLabel( instance->messageFooterLabel, func, status );
- _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageRePrint );
- return;
- }
- void
- _DtTtMessageUpdate(
- Tt_message msg,
- _DtSessionChooserAction choice,
- char * session
- )
- {
- DtbMessagePropsMessagePropsInfo instance;
- instance = (DtbMessagePropsMessagePropsInfo)
- tt_message_user( msg, DtTtMsgInfoKey );
- Tt_status status = tt_ptr_error( instance );
- if (tt_is_err( status ) || (instance == 0)) {
- return;
- }
- char *func;
- switch (choice) {
- case _DtSessionChooseMessage:
- status = tt_message_session_set( msg, session );
- func = "tt_message_session_set()";
- session = tt_message_session( msg );
- if (! tt_is_err( tt_ptr_error( session ))) {
- _DtTtMessageSetUpdating( msg, True );
- XmTextFieldSetString( instance->sessionText, session );
- _DtTtMessageSetUpdating( msg, False );
- tt_free( session );
- }
- break;
- default:
- return;
- }
- DtTtSetLabel( instance->messageFooterLabel, func, status );
- _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageRePrint );
- return;
- }
- void
- _DtTtMessageUpdate(
- Tt_message msg,
- _DtFileChooserAction choice,
- char * file
- )
- {
- DtbMessagePropsMessagePropsInfo instance;
- instance = (DtbMessagePropsMessagePropsInfo)
- tt_message_user( msg, DtTtMsgInfoKey );
- Tt_status status = tt_ptr_error( instance );
- if (tt_is_err( status ) || (instance == 0)) {
- return;
- }
- char *func;
- switch (choice) {
- case _DtFileChooseMessageSet:
- status = tt_message_file_set( msg, file );
- func = "tt_message_file_set()";
- file = tt_message_file( msg );
- if (! tt_is_err( tt_ptr_error( file ))) {
- _DtTtMessageSetUpdating( msg, True );
- XmTextFieldSetString( instance->fileText, file );
- _DtTtMessageSetUpdating( msg, False );
- tt_free( file );
- }
- break;
- default:
- return;
- }
- DtTtSetLabel( instance->messageFooterLabel, func, status );
- _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageRePrint );
- return;
- }
- void
- _DtTtMessageUpdate(
- Tt_message msg,
- _DtTtChooserAction choice,
- char * string
- )
- {
- DtbMessagePropsMessagePropsInfo instance;
- instance = (DtbMessagePropsMessagePropsInfo)
- tt_message_user( msg, DtTtMsgInfoKey );
- Tt_status status = tt_ptr_error( instance );
- if (tt_is_err( status ) || (instance == 0)) {
- return;
- }
- char *func;
- switch (choice) {
- case _DtTtChooserMessageOpSet:
- status = tt_message_op_set( msg, string );
- func = "tt_message_op_set()";
- string = tt_message_op( msg );
- if (! tt_is_err( tt_ptr_error( string ))) {
- _DtTtMessageSetUpdating( msg, True );
- XmTextFieldSetString( instance->opText, string );
- _DtTtMessageSetUpdating( msg, False );
- tt_free( string );
- }
- break;
- case _DtTtChooserMessageHandlerSet:
- status = tt_message_handler_set( msg, string );
- func = "tt_message_handler_set()";
- string = tt_message_handler( msg );
- if (! tt_is_err( tt_ptr_error( string ))) {
- _DtTtMessageSetUpdating( msg, True );
- XmTextFieldSetString( instance->handlerText, string );
- _DtTtMessageSetUpdating( msg, False );
- tt_free( string );
- }
- break;
- default:
- return;
- }
- DtTtSetLabel( instance->messageFooterLabel, func, status );
- _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageRePrint );
- return;
- }
- void
- _DtTtMessageUpdate(
- Tt_message msg,
- _DtArgChooserAction choice,
- int nth,
- Tt_mode mode,
- char * vtype,
- char * val,
- int ival
- )
- {
- DtbMessagePropsMessagePropsInfo instance;
- instance = (DtbMessagePropsMessagePropsInfo)
- tt_message_user( msg, DtTtMsgInfoKey );
- Tt_status status = tt_ptr_error( instance );
- if (tt_is_err( status ) || (instance == 0)) {
- return;
- }
- char *func;
- switch (choice) {
- case _DtArgChooseMessageArgAdd:
- status = tt_message_arg_add( msg, mode, vtype, val );
- func = "tt_message_arg_add()";
- break;
- case _DtArgChooseMessageIArgAdd:
- status = tt_message_iarg_add( msg, mode, vtype, ival );
- func = "tt_message_iarg_add()";
- break;
- case _DtArgChooseMessageArgSet:
- status = tt_message_arg_val_set( msg, nth, val );
- func = "tt_message_arg_val_set()";
- break;
- case _DtArgChooseMessageIArgSet:
- status = tt_message_arg_ival_set( msg, nth, ival );
- func = "tt_message_arg_ival_set()";
- break;
- case _DtArgChooseMessageContextSet:
- status = tt_message_context_set( msg, vtype, val );
- func = "tt_message_context_set()";
- break;
- case _DtArgChooseMessageIContextSet:
- status = tt_message_icontext_set( msg, vtype, ival );
- func = "tt_message_icontext_set()";
- break;
- default:
- return;
- }
- DtTtSetLabel( instance->messageFooterLabel, func, status );
- _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageArgAdded );
- return;
- }
- void
- _DtTtMessageUpdate(
- Tt_message msg,
- Tt_message_callback cb
- )
- {
- DtbMessagePropsMessagePropsInfo instance;
- instance = (DtbMessagePropsMessagePropsInfo)
- tt_message_user( msg, DtTtMsgInfoKey );
- Tt_status status = tt_ptr_error( instance );
- if (tt_is_err( status ) || (instance == 0)) {
- return;
- }
- status = tt_message_callback_add( msg, cb );
- DtTtSetLabel( instance->messageFooterLabel,
- "tt_message_callback_add()", status );
- return;
- }
- Widget
- DtTtMessageWidgetCreate(
- Widget parent,
- Tt_message msg,
- DtTtMessageUpdateCallback notifyProc
- )
- {
- DtbMessagePropsMessagePropsInfoRec *instance;
- Widget widget = DtTtMessageWidget( msg );
- Tt_status status = tt_ptr_error( widget );
- if (tt_is_err( status ) || (widget != 0)) {
- instance = (DtbMessagePropsMessagePropsInfoRec *)
- tt_message_user( msg, DtTtMsgInfoKey );
- status = tt_ptr_error( instance );
- if (tt_is_err( status ) || (instance != 0)) {
- XtManageChild( instance->messageProps_shellform );
- }
- return widget;
- }
- instance = new DtbMessagePropsMessagePropsInfoRec;
- if (instance == 0) {
- return (Widget)tt_error_pointer( TT_ERR_NOMEM );
- }
- // XXX delete instance in widget destroy proc
- status = tt_message_user_set( msg, DtTtMsgInfoKey, instance );
- if (tt_is_err( status )) {
- delete instance;
- return (Widget)tt_error_pointer( status );
- }
- dtbMessagePropsMessagePropsInfo_clear( instance );
- dtb_message_props_message_props_initialize( instance, parent );
- widget = instance->messageProps;
- XtVaSetValues( instance->messageProps_shellform, XmNuserData, msg, NULL );
- status = tt_message_user_set( msg, DtTtMsgWidgetKey, widget );
- if (tt_is_err( status )) {
- XtDestroyWidget( widget );
- delete instance;
- return (Widget)tt_error_pointer( status );
- }
- if (notifyProc != 0) {
- status = tt_message_user_set( msg, DtTtMsgUpdateCBKey,
- (void *) notifyProc );
- if (tt_is_err( status )) {
- XtDestroyWidget( widget );
- return (Widget)tt_error_pointer( status );
- }
- status = tt_message_callback_add( msg, _DtMsgUpdateMarshall );
- if (tt_is_err( status )) {
- XtDestroyWidget( widget );
- return (Widget)tt_error_pointer( status );
- }
- }
- std::ostringstream labelStream;
- labelStream << "Tt_message " << (void *)msg;
- XtVaSetValues( instance->messageProps,
- XmNtitle, labelStream.str().c_str(),
- NULL );
- _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageFullUpdate );
- XtManageChild( instance->messageProps_shellform );
- return widget;
- }
- static void
- _DtTtMessageDispositionSet(
- DtbMessagePropsMessagePropsInfo instance,
- Tt_disposition disposition
- )
- {
- Tt_message msg = messageProps2Msg( instance );
- if (msg == 0) {
- return;
- }
- Tt_status status = tt_message_disposition_set( msg, disposition );
- DtTtSetLabel( instance->messageFooterLabel,
- "tt_message_disposition_set()", status );
- _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageRePrint );
- }
- /*** DTB_USER_CODE_END
- ***
- *** End of user code section
- ***
- **************************************************************************/
- void
- messageProps_msgCloseButton_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 ^^^ ***/
-
- DtbMessagePropsMessagePropsInfo instance = (DtbMessagePropsMessagePropsInfo)clientData;
-
- if (!(instance->initialized))
- {
- dtb_message_props_message_props_initialize(instance, dtb_ttsnoop_ttsnoop_win.ttsnoopWin);
- }
- XtUnmanageChild(instance->messageProps_shellform);
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- setClassUndefined(
- 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 ***/
- DtbMessagePropsMessagePropsInfo instance =
- (DtbMessagePropsMessagePropsInfo)clientData;
- Tt_message msg = messageProps2Msg( instance );
- if (msg == 0) {
- return;
- }
- Tt_status status = tt_message_class_set( msg, TT_CLASS_UNDEFINED );
- DtTtSetLabel( instance->messageFooterLabel,
- "tt_message_class_set()", status );
- _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageRePrint );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- setClassNotice(
- 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 ***/
- DtbMessagePropsMessagePropsInfo instance =
- (DtbMessagePropsMessagePropsInfo)clientData;
- Tt_message msg = messageProps2Msg( instance );
- if (msg == 0) {
- return;
- }
- Tt_status status = tt_message_class_set( msg, TT_NOTICE );
- DtTtSetLabel( instance->messageFooterLabel,
- "tt_message_class_set()", status );
- _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageRePrint );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- setClassRequest(
- 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 ***/
- DtbMessagePropsMessagePropsInfo instance =
- (DtbMessagePropsMessagePropsInfo)clientData;
- Tt_message msg = messageProps2Msg( instance );
- if (msg == 0) {
- return;
- }
- Tt_status status = tt_message_class_set( msg, TT_REQUEST );
- DtTtSetLabel( instance->messageFooterLabel,
- "tt_message_class_set()", status );
- _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageRePrint );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- setClassOffer(
- 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 ***/
- DtbMessagePropsMessagePropsInfo instance =
- (DtbMessagePropsMessagePropsInfo)clientData;
- Tt_message msg = messageProps2Msg( instance );
- if (msg == 0) {
- return;
- }
- Tt_status status = tt_message_class_set( msg, TT_OFFER );
- DtTtSetLabel( instance->messageFooterLabel,
- "tt_message_class_set()", status );
- _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageRePrint );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- setAddressLast(
- 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 ***/
- DtbMessagePropsMessagePropsInfo instance =
- (DtbMessagePropsMessagePropsInfo)clientData;
- Tt_message msg = messageProps2Msg( instance );
- if (msg == 0) {
- return;
- }
- Tt_status status = tt_message_address_set( msg, TT_ADDRESS_LAST );
- DtTtSetLabel( instance->messageFooterLabel,
- "tt_message_address_set()", status );
- _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageRePrint );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- setAddressProcedure(
- 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 ***/
- DtbMessagePropsMessagePropsInfo instance =
- (DtbMessagePropsMessagePropsInfo)clientData;
- Tt_message msg = messageProps2Msg( instance );
- if (msg == 0) {
- return;
- }
- Tt_status status = tt_message_address_set( msg, TT_PROCEDURE );
- DtTtSetLabel( instance->messageFooterLabel,
- "tt_message_address_set()", status );
- _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageRePrint );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- setAddressObject(
- 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 ***/
- DtbMessagePropsMessagePropsInfo instance =
- (DtbMessagePropsMessagePropsInfo)clientData;
- Tt_message msg = messageProps2Msg( instance );
- if (msg == 0) {
- return;
- }
- Tt_status status = tt_message_address_set( msg, TT_OBJECT );
- DtTtSetLabel( instance->messageFooterLabel,
- "tt_message_address_set()", status );
- _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageRePrint );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- setAddressHandler(
- 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 ***/
- DtbMessagePropsMessagePropsInfo instance =
- (DtbMessagePropsMessagePropsInfo)clientData;
- Tt_message msg = messageProps2Msg( instance );
- if (msg == 0) {
- return;
- }
- Tt_status status = tt_message_address_set( msg, TT_HANDLER );
- DtTtSetLabel( instance->messageFooterLabel,
- "tt_message_address_set()", status );
- _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageRePrint );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- setAddressOtype(
- 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 ***/
- DtbMessagePropsMessagePropsInfo instance =
- (DtbMessagePropsMessagePropsInfo)clientData;
- Tt_message msg = messageProps2Msg( instance );
- if (msg == 0) {
- return;
- }
- Tt_status status = tt_message_address_set( msg, TT_OTYPE );
- DtTtSetLabel( instance->messageFooterLabel,
- "tt_message_address_set()", status );
- _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageRePrint );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- setScopeNone(
- 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 ***/
- DtbMessagePropsMessagePropsInfo instance =
- (DtbMessagePropsMessagePropsInfo)clientData;
- Tt_message msg = messageProps2Msg( instance );
- if (msg == 0) {
- return;
- }
- Tt_status status = tt_message_scope_set( msg, TT_SCOPE_NONE );
- DtTtSetLabel( instance->messageFooterLabel,
- "tt_message_scope_set()", status );
- _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageRePrint );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- setScopeSession(
- 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 ***/
- DtbMessagePropsMessagePropsInfo instance =
- (DtbMessagePropsMessagePropsInfo)clientData;
- Tt_message msg = messageProps2Msg( instance );
- if (msg == 0) {
- return;
- }
- Tt_status status = tt_message_scope_set( msg, TT_SESSION );
- DtTtSetLabel( instance->messageFooterLabel,
- "tt_message_scope_set()", status );
- _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageRePrint );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- setScopeFile(
- 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 ***/
- DtbMessagePropsMessagePropsInfo instance =
- (DtbMessagePropsMessagePropsInfo)clientData;
- Tt_message msg = messageProps2Msg( instance );
- if (msg == 0) {
- return;
- }
- Tt_status status = tt_message_scope_set( msg, TT_FILE );
- DtTtSetLabel( instance->messageFooterLabel,
- "tt_message_scope_set()", status );
- _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageRePrint );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- setScopeBoth(
- 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 ***/
- DtbMessagePropsMessagePropsInfo instance =
- (DtbMessagePropsMessagePropsInfo)clientData;
- Tt_message msg = messageProps2Msg( instance );
- if (msg == 0) {
- return;
- }
- Tt_status status = tt_message_scope_set( msg, TT_BOTH );
- DtTtSetLabel( instance->messageFooterLabel,
- "tt_message_scope_set()", status );
- _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageRePrint );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- setScopeFileInSession(
- 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 ***/
- DtbMessagePropsMessagePropsInfo instance =
- (DtbMessagePropsMessagePropsInfo)clientData;
- Tt_message msg = messageProps2Msg( instance );
- if (msg == 0) {
- return;
- }
- Tt_status status = tt_message_scope_set( msg, TT_FILE_IN_SESSION );
- DtTtSetLabel( instance->messageFooterLabel,
- "tt_message_scope_set()", status );
- _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageRePrint );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- setOp(
- 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 ***/
- DtbMessagePropsMessagePropsInfo instance =
- (DtbMessagePropsMessagePropsInfo)clientData;
- Tt_message msg = messageProps2Msg( instance );
- if ((msg == 0) || _DtTtMessageUpdating( msg )) {
- return;
- }
- char *op = XmTextFieldGetString( instance->opText );
- if ((op != 0) && (op[0] == '\0')) {
- XtFree( op );
- op = 0;
- }
- Tt_status status = tt_message_op_set( msg, op );
- if (op != 0) {
- XtFree( op );
- }
- DtTtSetLabel( instance->messageFooterLabel,
- "tt_message_op_set()", status );
- _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageRePrint );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- msgSend(
- 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 ***/
- DtbMessagePropsMessagePropsInfo instance =
- (DtbMessagePropsMessagePropsInfo)clientData;
- Tt_message msg = messageProps2Msg( instance );
- if (msg == 0) {
- return;
- }
- Tt_status status = tt_message_send( msg );
- DtTtSetLabel( instance->messageFooterLabel,
- "tt_message_send()", status );
- _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageFullUpdate );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- msgSendOnExit(
- 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 ***/
- DtbMessagePropsMessagePropsInfo instance =
- (DtbMessagePropsMessagePropsInfo)clientData;
- Tt_message msg = messageProps2Msg( instance );
- if (msg == 0) {
- return;
- }
- Tt_status status = tt_message_send_on_exit( msg );
- DtTtSetLabel( instance->messageFooterLabel,
- "tt_message_send_on_exit()", status );
- _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageFullUpdate );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- msgAccept(
- 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 ***/
- DtbMessagePropsMessagePropsInfo instance =
- (DtbMessagePropsMessagePropsInfo)clientData;
- Tt_message msg = messageProps2Msg( instance );
- if (msg == 0) {
- return;
- }
- Tt_status status = tt_message_accept( msg );
- DtTtSetLabel( instance->messageFooterLabel,
- "tt_message_accept()", status );
- _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageFullUpdate );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- msgReject(
- 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 ***/
- DtbMessagePropsMessagePropsInfo instance =
- (DtbMessagePropsMessagePropsInfo)clientData;
- Tt_message msg = messageProps2Msg( instance );
- if (msg == 0) {
- return;
- }
- Tt_status status = tt_message_send_on_exit( msg );
- DtTtSetLabel( instance->messageFooterLabel,
- "tt_message_send_on_exit()", status );
- _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageFullUpdate );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- msgReply(
- 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 ***/
- DtbMessagePropsMessagePropsInfo instance =
- (DtbMessagePropsMessagePropsInfo)clientData;
- Tt_message msg = messageProps2Msg( instance );
- if (msg == 0) {
- return;
- }
- Tt_status status = tt_message_reply( msg );
- DtTtSetLabel( instance->messageFooterLabel,
- "tt_message_reply()", status );
- _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageFullUpdate );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- msgFail(
- 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 ***/
- DtbMessagePropsMessagePropsInfo instance =
- (DtbMessagePropsMessagePropsInfo)clientData;
- Tt_message msg = messageProps2Msg( instance );
- if (msg == 0) {
- return;
- }
- Tt_status status = tt_message_fail( msg );
- DtTtSetLabel( instance->messageFooterLabel,
- "tt_message_fail()", status );
- _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageFullUpdate );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- msgDestroy(
- 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 ***/
- DtbMessagePropsMessagePropsInfo instance =
- (DtbMessagePropsMessagePropsInfo)clientData;
- Tt_message msg = messageProps2Msg( instance );
- if (msg == 0) {
- return;
- }
- Tt_status status = tttk_message_destroy( msg );
- DtTtSetLabel( instance->messageFooterLabel,
- "tttk_message_destroy()", status );
- switch (status) {
- case TT_OK:
- DtTtDestroyed( DTTT_MESSAGE, msg );
- XtDestroyWidget( instance->messageProps );
- delete instance;
- break;
- default:
- _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageFullUpdate );
- break;
- }
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- msgDtAccept(
- 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 ***/
- DtbMessagePropsMessagePropsInfo instance =
- (DtbMessagePropsMessagePropsInfo)clientData;
- Tt_message msg = messageProps2Msg( instance );
- if (msg == 0) {
- return;
- }
- Tt_pattern *pats = ttdt_message_accept( msg, 0, 0, instance->messageProps,
- 1, 1 );
- Tt_status status = tt_ptr_error( pats );
- DtTtSetLabel( instance->messageFooterLabel,
- "ttdt_message_accept()", status );
- if ((status == TT_OK) && (pats != 0)) {
- while (*pats != 0) {
- DtTtCreated( DTTT_PATTERN, *pats );
- pats++;
- }
- }
- _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageFullUpdate );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- msgSubcontractManage(
- 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 ***/
- DtbMessagePropsMessagePropsInfo instance =
- (DtbMessagePropsMessagePropsInfo)clientData;
- Tt_message msg = messageProps2Msg( instance );
- if (msg == 0) {
- return;
- }
- Tt_pattern *pats = ttdt_subcontract_manage( msg, 0,
- instance->messageProps, 0 );
- Tt_status status = tt_ptr_error( pats );
- DtTtSetLabel( instance->messageFooterLabel,
- "ttdt_subcontract_manage()", status );
- if (status == TT_OK) {
- while (*pats != 0) {
- DtTtCreated( DTTT_PATTERN, *pats );
- pats++;
- }
- }
- _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageFullUpdate );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- msgClone(
- 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 ***/
- DtbMessagePropsMessagePropsInfo instance =
- (DtbMessagePropsMessagePropsInfo)clientData;
- Tt_message msg = messageProps2Msg( instance );
- if (msg == 0) {
- return;
- }
- msg = tt_message_copy( msg );
- Tt_status status = DtTtSetLabel( instance->messageProps_footer,
- "tt_message_copy()", msg );
- if (tt_is_err( status )) {
- return;
- }
- DtTtCreated( DTTT_MESSAGE, msg );
- Widget newWidget = DtTtMessageWidgetCreate(
- dtb_ttsnoop_ttsnoop_win.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
- msgStatusNotice(
- 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 ***/
- DtbMessagePropsMessagePropsInfo instance =
- (DtbMessagePropsMessagePropsInfo)clientData;
- Tt_message msg = messageProps2Msg( instance );
- if (msg == 0) {
- return;
- }
- char *sender = tt_message_sender( msg );
- Tt_message msg2 = tttk_message_create( msg, TT_NOTICE,
- tt_message_scope( msg ), sender, "Status", 0 );
- tt_free( sender );
- Tt_status status = DtTtSetLabel( instance->messageProps_footer,
- "tttk_message_create()", msg2 );
- if (tt_is_err( status )) {
- return;
- }
- tt_message_arg_add( msg2, TT_IN, Tttk_string, 0 );
- tt_message_arg_add( msg2, TT_IN, Tttk_string, 0 );
- tt_message_arg_add( msg2, TT_IN, Tttk_string, 0 );
- tt_message_arg_add( msg2, TT_IN, Tttk_string, 0 );
- char *commission = tt_message_id( msg );
- tt_message_arg_add( msg2, TT_IN, Tttk_message_id, commission );
- tt_free( commission );
- DtTtCreated( DTTT_MESSAGE, msg2 );
- Widget newWidget = DtTtMessageWidgetCreate(
- dtb_ttsnoop_ttsnoop_win.ttsnoopWin, msg2,
- 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
- msgGenAction(
- 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 ***/
- std::ostringstream action;
- DtbMessagePropsMessagePropsInfo instance =
- (DtbMessagePropsMessagePropsInfo)clientData;
- Tt_message msg = messageProps2Msg( instance );
- if (msg == 0) {
- return;
- }
- char *op = tt_message_op( msg );
- action << "ACTION Send_" << op << "\n{\n\tLABEL\tSend_" << op << "\n";
- action << "\tTYPE\tTT_MSG\n";
- action << "\tTT_CLASS\t" << tt_message_class( msg ) << "\n";
- action << "\tTT_SCOPE\t" << tt_message_scope( msg ) << "\n";
- action << "\tTT_OPERATION\t" << op << "\n";
- tt_free( op );
- char *file = tt_message_file( msg );
- Tt_status status = tt_ptr_error( file );
- if ((! tt_is_err( status )) && (file != 0)) {
- action << "\tTT_FILE\t" << file << "\n";
- tt_free( file );
- }
- int args = tt_message_args_count( msg );
- for (int arg = 0; arg < args; arg++) {
- action << "\tTT_ARG" << arg << "_MODE\t";
- action << tt_message_arg_mode( msg, arg ) << "\n";
- char *vtype = tt_message_arg_type( msg, arg );
- action << "\tTT_ARG" << arg << "_VTYPE\t" << vtype << "\n";
- int ival;
- status = tt_message_arg_ival( msg, arg, &ival );
- switch (status) {
- char *val;
- case TT_OK:
- action << "\tTT_ARG" << arg << "_REP_TYPE\t"
- "TT_REP_INTEGER\n";
- action << "\tTT_ARG" << arg << "_VALUE\t" << ival << "\n";
- break;
- case TT_ERR_NUM:
- val = tt_message_arg_val( msg, arg );
- status = tt_ptr_error( val );
- if (tt_is_err( status ) || (val == 0)) {
- continue;
- }
- action << "\tTT_ARG" << arg << "_VALUE\t" << val << "\n";
- tt_free( val );
- break;
- }
- }
- // XXX emit commented warnings for e.g. TT_OFFER, TT_HANDLER
- action << "}\n";
- // XtVaSetValues( instance->messageText, XmNvalue, action.str().c_str(), 0 );
- _DtOpen( instance->messageFooterLabel, (void *)action.str().c_str(),
- action.str().size(), "actio" );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- msgGenC(
- 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 ***/
- std::ostringstream code;
- DtbMessagePropsMessagePropsInfo instance =
- (DtbMessagePropsMessagePropsInfo)clientData;
- Tt_message msg = messageProps2Msg( instance );
- if (msg == 0) {
- return;
- }
- code << "#include <Tt/tt_c.h>\n";
- code << "#include <Tt/tttk.h>\n";
- char *op = tt_message_op( msg );
- if (tt_message_class( msg ) != TT_NOTICE) {
- code << "\nTt_callback_action\nprocess_" << op << "_reply(";
- code << " Tt_message msg, Tt_message pat );\n";
- }
- code << "\nTt_message\n";
- code << "create_" << op << "(\n";
- code << "\tTt_message context\n)\n{\n";
- code << "\tTt_message msg;\n";
- code << "\tmsg = tttk_message_create( context";
- code << ", " << tt_message_class( msg );
- code << ", " << tt_message_scope( msg ) << ",\n\t\t\t";
- Tt_address address = tt_message_address( msg );
- switch (address) {
- char *handler;
- case TT_PROCEDURE:
- default:
- code << "0, ";
- break;
- case TT_HANDLER:
- handler = tt_message_handler( msg );
- code << "\"" << handler << "\",\n";
- tt_free( handler );
- break;
- }
- if (op == 0) {
- code << "(char *)0";
- } else {
- code << "\"" << op << "\"";
- }
- code << ", ";
- if (tt_message_class( msg ) == TT_NOTICE) {
- code << "0 ";
- } else {
- code << "\n\t\t\tprocess_" << op << "_reply ";
- }
- code << ");\n";
- switch (address) {
- default:
- code << "\ttt_message_address_set( msg, " << address << " );\n";
- break;
- case TT_PROCEDURE:
- case TT_HANDLER:
- // set properly by tttk_message_create();
- break;
- }
- int args = tt_message_args_count( msg );
- if (tt_is_err( tt_int_error( args ))) {
- args = 0;
- }
- for (int arg = 0; arg < args; arg++) {
- Tt_mode mode = tt_message_arg_mode( msg, arg );
- char *vtype = tt_message_arg_type( msg, arg );
- int ival;
- Tt_status status = tt_message_arg_ival( msg, arg, &ival );
- switch (status) {
- char *val;
- case TT_OK:
- code << "\ttt_message_iarg_add( msg, " << mode << ", ";
- code << '"' << vtype << "\", " << ival << " );\n";
- break;
- case TT_ERR_NUM:
- val = tt_message_arg_val( msg, arg );
- code << "\ttt_message_arg_add( msg, " << mode << ", ";
- code << '"' << vtype << "\", ";
- if (val == 0) {
- code << "(char *)0";
- } else {
- code << "\"" << val << "\"";
- }
- code << ");\n";
- tt_free( val );
- break;
- }
- tt_free( vtype );
- }
- int stat = tt_message_status( msg );
- if (stat != 0) {
- code << "\ttt_message_status_set( msg, " << stat << " );\n";
- }
- code << "\treturn msg;\n";
- code << "}\n";
- if (tt_message_class( msg ) != TT_NOTICE) {
- code << "\nstatic Tt_callback_action\n";
- code << "process_" << op << "_reply(\n";
- code << "\tTt_message msg,\n";
- code << "\tTt_message pat\n";
- code << ")\n{\n";
- code << "\tswitch (tt_message_state(msg)) {\n";
- code << "\t\tcase TT_SENT:\t/* handler is in this process */\n";
- code << "\t\tcase TT_STARTED:/* intermediate state */\n";
- code << "\t\tcase TT_QUEUED:\t/* intermediate state */\n";
- code << "\t\tdefault:\t/* unknown state */\n";
- code << "\t\t\treturn TT_CALLBACK_CONTINUE;\n";
- if (tt_message_class(msg) == TT_REQUEST) {
- code << "\t\tcase TT_HANDLED:\n";
- code << "\t\t\t/* ... */\n";
- code << "\t\t\tbreak;\n";
- code << "\t\tcase TT_FAILED: {\n";
- code << "\t\t\tint status;\n";
- code << "\t\t\tchar *string;\n";
- code << "\t\t\tstatus = tt_message_status( msg );\n";
- code << "\t\t\tstring = "
- "tt_message_status_string( msg );\n";
- code << "\t\t\t/* ... */\n";
- code << "\t\t\t} break;\n";
- } else {
- code << "\t\tcase TT_RETURNED:\n";
- code << "\t\t\t/* ... */\n";
- code << "\t\t\tbreak;\n";
- }
- code << "\t}\n";
- code << "\ttt_message_destroy( msg );\n";
- code << "\treturn TT_CALLBACK_PROCESSED;\n";
- code << "}\n";
- }
- tt_free( op );
- // XtVaSetValues( instance->messageText, XmNvalue, code.str().c_str(), 0 );
- _DtOpen( instance->messageFooterLabel, (void *)code.str().c_str(),
- code.str().size(), "msgC" );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- setHandler(
- 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 ***/
- DtbMessagePropsMessagePropsInfo instance =
- (DtbMessagePropsMessagePropsInfo)clientData;
- Tt_message msg = messageProps2Msg( instance );
- if ((msg == 0) || _DtTtMessageUpdating( msg )) {
- return;
- }
- char *handler = XmTextFieldGetString( instance->handlerText );
- if ((handler != 0) && (handler[0] == '\0')) {
- XtFree( handler );
- handler = 0;
- }
- Tt_status status = tt_message_handler_set( msg, handler );
- if (handler != 0) {
- XtFree( handler );
- }
- DtTtSetLabel( instance->messageFooterLabel,
- "tt_message_handler_set()", status );
- _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageRePrint );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- setSession(
- 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 ***/
- DtbMessagePropsMessagePropsInfo instance =
- (DtbMessagePropsMessagePropsInfo)clientData;
- Tt_message msg = messageProps2Msg( instance );
- if ((msg == 0) || _DtTtMessageUpdating( msg )) {
- return;
- }
- char *session = XmTextFieldGetString( instance->sessionText );
- if ((session != 0) && (session[0] == '\0')) {
- XtFree( session );
- session = 0;
- }
- Tt_status status = tt_message_session_set( msg, session );
- if (session != 0) {
- XtFree( session );
- }
- DtTtSetLabel( instance->messageFooterLabel,
- "tt_message_session_set()", status );
- _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageRePrint );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- setFile(
- 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 ***/
- DtbMessagePropsMessagePropsInfo instance =
- (DtbMessagePropsMessagePropsInfo)clientData;
- Tt_message msg = messageProps2Msg( instance );
- if ((msg == 0) || _DtTtMessageUpdating( msg )) {
- return;
- }
- char *file = XmTextFieldGetString( instance->fileText );
- if ((file != 0) && (file[0] == '\0')) {
- XtFree( file );
- file = 0;
- }
- Tt_status status = tt_message_file_set( msg, file );
- if (file != 0) {
- XtFree( file );
- }
- DtTtSetLabel( instance->messageFooterLabel,
- "tt_message_file_set()", status );
- _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageRePrint );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- setStatus(
- 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 ***/
- DtbMessagePropsMessagePropsInfo instance =
- (DtbMessagePropsMessagePropsInfo)clientData;
- Tt_message msg = messageProps2Msg( instance );
- if ((msg == 0) || _DtTtMessageUpdating( msg )) {
- return;
- }
- int val;
- XtVaGetValues( instance->statusBox, DtNposition, &val, NULL );
- XmString statusName = DtTtStatusString( (Tt_status)val );
- XtVaSetValues( instance->statusLabel, XmNlabelString, statusName, NULL );
- XmStringFree( statusName );
- Tt_status status = tt_message_status_set( msg, val );
- DtTtSetLabel( instance->messageFooterLabel,
- "tt_message_status_set()", status );
- _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageRePrint );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- msgHelp(
- 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 ***/
- dtb_do_onitem_help();
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- msgPattern(
- 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 ***/
- DtbMessagePropsMessagePropsInfo instance =
- (DtbMessagePropsMessagePropsInfo)clientData;
- Tt_message msg = messageProps2Msg( instance );
- if (msg == 0) {
- return;
- }
- Tt_pattern pat = tt_message_pattern( msg );
- Tt_status status = DtTtSetLabel( instance->messageFooterLabel,
- "tt_message_pattern()", pat );
- if (tt_is_err( status ) || (pat == 0)) {
- return;
- }
- Widget newWidget = DtTtPatternWidgetCreate(
- dtb_ttsnoop_ttsnoop_win.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
- msgPrint(
- 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 ***/
- DtbMessagePropsMessagePropsInfo instance =
- (DtbMessagePropsMessagePropsInfo)clientData;
- Tt_message msg = messageProps2Msg( instance );
- if (msg == 0) {
- return;
- }
- _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageRePrint );
- DtTtSetLabel( instance->messageFooterLabel,
- "tt_message_print()", TT_OK );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- genPattern(
- 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 ***/
- DtbMessagePropsMessagePropsInfo instance =
- (DtbMessagePropsMessagePropsInfo)clientData;
- Tt_message msg = messageProps2Msg( instance );
- if (msg == 0) {
- return;
- }
- Tt_pattern pat = tt_pattern_create();
- tt_pattern_category_set( pat, TT_OBSERVE );
- tt_pattern_class_add( pat, tt_message_class( msg ));
- tt_pattern_scope_add( pat, tt_message_scope( msg ));
- tt_pattern_address_add( pat, tt_message_address( msg ));
- char *op = tt_message_op( msg );
- if ((! tt_is_err( tt_ptr_error( op ))) && (op != 0)) {
- tt_pattern_op_add( pat, op );
- tt_free( op );
- }
- // skip file, sender, sender_ptype, otype, object, opnum, contexts
- char *session = tt_message_session( msg );
- if ((! tt_is_err( tt_ptr_error( session ))) && (session != 0)) {
- tt_pattern_session_add( pat, session );
- tt_free( session );
- }
- int args = tt_message_args_count( msg );
- if (tt_int_error( args ) == TT_OK) {
- for (int arg = 0; arg < args; arg++) {
- Tt_mode mode = tt_message_arg_mode( msg, arg );
- char *vtype = tt_message_arg_type( msg, arg );
- // skip arg value
- tt_pattern_arg_add( pat, mode, vtype, 0 );
- tt_free( vtype );
- }
- }
- DtTtCreated( DTTT_PATTERN, pat );
- Widget newWidget = DtTtPatternWidgetCreate(
- dtb_ttsnoop_ttsnoop_win.ttsnoopWin, pat, 0 );
- if (tt_is_err( tt_ptr_error( newWidget ))) {
- return;
- }
- XRaiseWindow( XtDisplay( newWidget ), XtWindow( newWidget ));
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- genObserver(
- 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 ***/
- std::ostringstream ptype;
- DtbMessagePropsMessagePropsInfo instance =
- (DtbMessagePropsMessagePropsInfo)clientData;
- Tt_message msg = messageProps2Msg( instance );
- if (msg == 0) {
- return;
- }
- ptype << "ptype Acme_Calc {\n\tstart \"acalc\";\n";
- ptype << "\t/*\n";
- ptype << "\thandle_push:\n";
- ptype << "\thandle_rotate:\n";
- switch (tt_message_class(msg)) {
- case TT_REQUEST:
- ptype << "\tobserve:\n";
- ptype << "\t*/\n";
- ptype << "\thandle:\n";
- break;
- case TT_OFFER:
- case TT_NOTICE:
- default:
- ptype << "\thandle:\n";
- ptype << "\t*/\n";
- ptype << "\tobserve:\n";
- break;
- }
- ptype << "\t\t";
- switch (tt_message_scope(msg)) {
- case TT_FILE:
- ptype << "file ";
- break;
- case TT_FILE_IN_SESSION:
- case TT_BOTH:
- case TT_SESSION:
- default:
- ptype << "session ";
- break;
- }
- char *op = tt_message_op( msg );
- ptype << op << "(\n";
- tt_free( op );
- int args = tt_message_args_count( msg );
- if (tt_is_err( tt_int_error( args ))) {
- args = 0;
- }
- for (int arg = 0; arg < args; arg++) {
- ptype << "\t\t\t\t";
- switch (tt_message_arg_mode( msg, arg )) {
- case TT_IN: ptype << "in "; break;
- case TT_OUT: ptype << "out "; break;
- default:
- case TT_INOUT: ptype << "inout"; break;
- }
- char *vtype = tt_message_arg_type( msg, arg );
- ptype << " " << vtype << "\targ" << arg;
- if (arg < args - 1) {
- ptype << ",";
- }
- ptype << "\n";
- }
- ptype << "\t\t\t) => start opnum=1;\n";
- ptype << "};\n";
- // XXX contexts
- // XtVaSetValues( instance->messageText, XmNvalue, ptype.str().c_str(), 0 );
- _DtOpen( instance->messageFooterLabel, (void *)ptype.str().c_str(),
- ptype.str().size(), "ptype" );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- sessionSet(
- 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 ***/
- DtbMessagePropsMessagePropsInfo instance =
- (DtbMessagePropsMessagePropsInfo)clientData;
- Tt_message msg = messageProps2Msg( instance );
- if ((msg == 0) || _DtTtMessageUpdating( msg )) {
- return;
- }
- _DtSessionChooserSet( _DtSessionChooseMessage, msg );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- msgFileSet(
- 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 ***/
- DtbMessagePropsMessagePropsInfo instance =
- (DtbMessagePropsMessagePropsInfo)clientData;
- Tt_message msg = messageProps2Msg( instance );
- if ((msg == 0) || _DtTtMessageUpdating( msg )) {
- return;
- }
- _DtFileChooserSet( _DtFileChooseMessageSet, msg );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- msgArgAdd(
- 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 ***/
- DtbMessagePropsMessagePropsInfo instance =
- (DtbMessagePropsMessagePropsInfo)clientData;
- Tt_message msg = messageProps2Msg( instance );
- if ((msg == 0) || _DtTtMessageUpdating( msg )) {
- return;
- }
- _DtArgChooserSet( _DtArgChooseMessageArgAdd, msg );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- msgContextSet(
- 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 ***/
- DtbMessagePropsMessagePropsInfo instance =
- (DtbMessagePropsMessagePropsInfo)clientData;
- Tt_message msg = messageProps2Msg( instance );
- if ((msg == 0) || _DtTtMessageUpdating( msg )) {
- return;
- }
- _DtArgChooserSet( _DtArgChooseMessageContextSet, msg );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- setArg(
- 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 ***/
- DtbMessagePropsMessagePropsInfo instance =
- (DtbMessagePropsMessagePropsInfo)clientData;
- Tt_message msg = messageProps2Msg( instance );
- if ((msg == 0) || _DtTtMessageUpdating( msg )) {
- return;
- }
- int arg;
- MessagePropsSetArgButtonMenuItems items =
- &instance->setArgButton_setArgButton_menu_items;
- if (widget == items->Arg_0_item) {
- arg = 0;
- } else if (widget == items->Arg_1_item) {
- arg = 1;
- } else if (widget == items->Arg_2_item) {
- arg = 2;
- } else if (widget == items->Arg_3_item) {
- arg = 3;
- } else if (widget == items->Arg_4_item) {
- arg = 4;
- } else if (widget == items->Arg_5_item) {
- arg = 5;
- } else if (widget == items->Arg_6_item) {
- arg = 6;
- } else if (widget == items->Arg_7_item) {
- arg = 7;
- } else if (widget == items->Arg_8_item) {
- arg = 8;
- } else if (widget == items->Arg_9_item) {
- arg = 9;
- } else if (widget == items->Arg_10_item) {
- arg = 10;
- } else if (widget == items->Arg_11_item) {
- arg = 11;
- } else if (widget == items->Arg_12_item) {
- arg = 12;
- } else if (widget == items->Arg_13_item) {
- arg = 13;
- } else if (widget == items->Arg_14_item) {
- arg = 14;
- } else if (widget == items->Arg_15_item) {
- arg = 15;
- } else if (widget == items->Arg_15_item2) {
- _DtStringChooserSet( _DtStringChooseMessageArgValSet, msg,
- "16" );
- return;
- } else {
- return;
- }
- Tt_mode mode = tt_message_arg_mode( msg, arg );
- char *vtype = tt_message_arg_type( msg, arg );
- if (tt_is_err( tt_ptr_error( vtype ))) {
- vtype = 0;
- }
- char *val = 0;
- int ival = 0;
- Boolean noValue = False;
- Tt_status status = tt_message_arg_ival( msg, arg, &ival );
- if (status == TT_ERR_NUM) {
- val = tt_message_arg_val( msg, arg );
- if (tt_is_err( tt_ptr_error( val ))) {
- val = 0;
- }
- if (val == 0) {
- noValue = True;
- }
- }
- _DtArgChooserSet( _DtArgChooseMessageArgSet, msg, arg, mode, noValue,
- vtype, val, ival );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- setDISCARD(
- 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 ***/
- DtbMessagePropsMessagePropsInfo instance =
- (DtbMessagePropsMessagePropsInfo)clientData;
- _DtTtMessageDispositionSet( instance, TT_DISCARD );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- setQUEUE(
- 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 ***/
- DtbMessagePropsMessagePropsInfo instance =
- (DtbMessagePropsMessagePropsInfo)clientData;
- _DtTtMessageDispositionSet( instance, TT_QUEUE );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- setSTART(
- 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 ***/
- DtbMessagePropsMessagePropsInfo instance =
- (DtbMessagePropsMessagePropsInfo)clientData;
- _DtTtMessageDispositionSet( instance, TT_START );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- setQUEUESTART(
- 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 ***/
- DtbMessagePropsMessagePropsInfo instance =
- (DtbMessagePropsMessagePropsInfo)clientData;
- _DtTtMessageDispositionSet( instance, (Tt_disposition)(TT_QUEUE+TT_START));
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- msgSetObject(
- 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 ***/
- DtbMessagePropsMessagePropsInfo instance =
- (DtbMessagePropsMessagePropsInfo)clientData;
- Tt_message msg = messageProps2Msg( instance );
- if ((msg == 0) || _DtTtMessageUpdating( msg )) {
- return;
- }
- _DtStringChooserSet( _DtStringChooseMessageObject, msg,
- tt_message_object( msg ));
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- msgSetOtype(
- 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 ***/
- DtbMessagePropsMessagePropsInfo instance =
- (DtbMessagePropsMessagePropsInfo)clientData;
- Tt_message msg = messageProps2Msg( instance );
- if ((msg == 0) || _DtTtMessageUpdating( msg )) {
- return;
- }
- _DtStringChooserSet( _DtStringChooseMessageOtype, msg,
- tt_message_otype( msg ));
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- msgSetHandlerPtype(
- 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 ***/
- DtbMessagePropsMessagePropsInfo instance =
- (DtbMessagePropsMessagePropsInfo)clientData;
- Tt_message msg = messageProps2Msg( instance );
- if ((msg == 0) || _DtTtMessageUpdating( msg )) {
- return;
- }
- _DtStringChooserSet( _DtStringChooseMessageHandlerPtype, msg,
- tt_message_handler_ptype( msg ));
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- msgSetSenderPtype(
- 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 ***/
- DtbMessagePropsMessagePropsInfo instance =
- (DtbMessagePropsMessagePropsInfo)clientData;
- Tt_message msg = messageProps2Msg( instance );
- if ((msg == 0) || _DtTtMessageUpdating( msg )) {
- return;
- }
- _DtStringChooserSet( _DtStringChooseMessageSenderPtype, msg,
- tt_message_sender_ptype( msg ));
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- chooseOp(
- 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 ***/
- DtbMessagePropsMessagePropsInfo instance =
- (DtbMessagePropsMessagePropsInfo)clientData;
- Tt_message msg = messageProps2Msg( instance );
- if ((msg == 0) || _DtTtMessageUpdating( msg )) {
- return;
- }
- _DtTtChooserSet( _DtTtChooserMessageOpSet, msg );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- addCallback(
- 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 ***/
- DtbMessagePropsMessagePropsInfo instance =
- (DtbMessagePropsMessagePropsInfo)clientData;
- Tt_message msg = messageProps2Msg( instance );
- if ((msg == 0) || _DtTtMessageUpdating( msg )) {
- return;
- }
- _DtTtMsgCbChooserSet( msg );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- chooseHandler(
- 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 ***/
- DtbMessagePropsMessagePropsInfo instance =
- (DtbMessagePropsMessagePropsInfo)clientData;
- Tt_message msg = messageProps2Msg( instance );
- if ((msg == 0) || _DtTtMessageUpdating( msg )) {
- return;
- }
- _DtStringChooserSet( _DtStringChooseMessageStatusString, msg,
- tt_message_status_string( msg ));
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- msgSetStatusString(
- 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 ***/
- DtbMessagePropsMessagePropsInfo instance =
- (DtbMessagePropsMessagePropsInfo)clientData;
- Tt_message msg = messageProps2Msg( instance );
- if ((msg == 0) || _DtTtMessageUpdating( msg )) {
- return;
- }
- _DtStringChooserSet( _DtStringChooseMessageStatusString, msg,
- tt_message_object( msg ));
- /*** 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
- ***
- **************************************************************************/
|