messageProps_stubs.C.src 68 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384
  1. /*** DTB_USER_CODE_START vvv Add file header below vvv ***/
  2. //%% (c) Copyright 1993, 1994 Hewlett-Packard Company
  3. //%% (c) Copyright 1993, 1994 International Business Machines Corp.
  4. //%% (c) Copyright 1993, 1994 Sun Microsystems, Inc.
  5. //%% (c) Copyright 1993, 1994 Novell, Inc.
  6. //%% $XConsortium: messageProps_stubs.C.src /main/4 1996/03/18 15:04:37 barstow $
  7. /*** DTB_USER_CODE_END ^^^ Add file header above ^^^ ***/
  8. /*
  9. * File: messageProps_stubs.c
  10. * Contains: Module callbacks and connection functions
  11. *
  12. * This file was generated by dtcodegen, from module messageProps
  13. *
  14. * Any text may be added between the DTB_USER_CODE_START and
  15. * DTB_USER_CODE_END comments (even non-C code). Descriptive comments
  16. * are provided only as an aid.
  17. *
  18. * ** EDIT ONLY WITHIN SECTIONS MARKED WITH DTB_USER_CODE COMMENTS. **
  19. * ** ALL OTHER MODIFICATIONS WILL BE OVERWRITTEN. DO NOT MODIFY OR **
  20. * ** DELETE THE GENERATED COMMENTS! **
  21. */
  22. #include <stdint.h>
  23. #include <stdio.h>
  24. #include <Xm/Xm.h>
  25. #include "dtb_utils.h"
  26. #include "messageProps_ui.h"
  27. /*
  28. * Header files for cross-module connections
  29. */
  30. #include "ttsnoop_ui.h"
  31. /**************************************************************************
  32. *** DTB_USER_CODE_START
  33. ***
  34. *** All necessary header files have been included.
  35. ***
  36. *** Add include files, types, macros, externs, and user functions here.
  37. ***/
  38. #include <sstream>
  39. #include <Xm/TextF.h>
  40. #include <Dt/SpinBox.h>
  41. #include "DtTt.h"
  42. int DtTtMsgWidgetKey = (int) (long) DtTtMessageWidget;
  43. int DtTtMsgUpdateCBKey = DtTtMsgWidgetKey + 1;
  44. int DtTtMsgInfoKey = DtTtMsgWidgetKey + 2;
  45. Tt_callback_action
  46. _DtMsgUpdateMarshall(
  47. Tt_message msg,
  48. Tt_pattern
  49. )
  50. {
  51. DtTtMessageUpdateCallback cb = (DtTtMessageUpdateCallback)
  52. tt_message_user( msg, DtTtMsgUpdateCBKey );
  53. Tt_status status = tt_ptr_error( cb );
  54. if (tt_is_err( status ) || (cb == 0)) {
  55. return TT_CALLBACK_CONTINUE;
  56. }
  57. Widget widget = DtTtMessageWidget( msg );
  58. status = tt_ptr_error( widget );
  59. if (tt_is_err( status ) || (widget == 0)) {
  60. return TT_CALLBACK_CONTINUE;
  61. }
  62. // XXX Just guessing. Store oldState with tt_message_user_set()
  63. Tt_state oldState = TT_SENT;
  64. if (tt_message_state( msg ) == TT_SENT) {
  65. oldState = TT_CREATED;
  66. }
  67. (*cb)( widget, msg, oldState, TT_OK, True );
  68. return TT_CALLBACK_CONTINUE;
  69. }
  70. Widget
  71. DtTtMessageWidget(
  72. Tt_message msg
  73. )
  74. {
  75. // Function address is cast to int and used as clientdata key
  76. return (Widget)tt_message_user( msg, DtTtMsgWidgetKey );
  77. }
  78. static Tt_message
  79. messageProps2Msg(
  80. DtbMessagePropsMessagePropsInfo instance
  81. )
  82. {
  83. Tt_message msg;
  84. XtVaGetValues( instance->messageProps_shellform,
  85. XmNuserData, &msg, NULL );
  86. return msg;
  87. }
  88. static Boolean
  89. _DtTtMessageUpdating(
  90. Tt_message msg
  91. )
  92. {
  93. void *updating = tt_message_user( msg, (int) (long) _DtTtMessageUpdating );
  94. if (tt_is_err( tt_ptr_error( updating ))) {
  95. return False;
  96. }
  97. return updating == (void *)True;
  98. }
  99. static void
  100. _DtTtMessageSetUpdating(
  101. Tt_message msg,
  102. Boolean updating
  103. )
  104. {
  105. tt_message_user_set( msg, (int) (long) _DtTtMessageUpdating,
  106. (void *) (intptr_t)updating );
  107. }
  108. typedef enum {
  109. _DtTtMessageRePrint,
  110. _DtTtMessageArgAdded,
  111. _DtTtMessageFullUpdate
  112. } _DtTtMessageUpdateLevel;
  113. static void
  114. _DtTtMessageWidgetUpdate(
  115. DtbMessagePropsMessagePropsInfo instance,
  116. Tt_message msg,
  117. _DtTtMessageUpdateLevel level
  118. )
  119. {
  120. char *printout = tt_message_print( msg ); // XXX when to free?
  121. Tt_status status = tt_ptr_error( printout );
  122. if (tt_is_err( status )) {
  123. printout = tt_status_message( status );
  124. }
  125. XtVaSetValues( instance->messageText, XmNvalue, printout, NULL );
  126. if (level == _DtTtMessageRePrint) {
  127. return;
  128. }
  129. int numArgs = tt_message_args_count( msg );
  130. #define SetArgMenuItemSensitive(n) \
  131. XtSetSensitive( instance->setArgButton_setArgButton_menu_items. \
  132. Arg_##n##_item, numArgs > n );
  133. SetArgMenuItemSensitive(0);
  134. SetArgMenuItemSensitive(1);
  135. SetArgMenuItemSensitive(2);
  136. SetArgMenuItemSensitive(3);
  137. SetArgMenuItemSensitive(4);
  138. SetArgMenuItemSensitive(5);
  139. SetArgMenuItemSensitive(6);
  140. SetArgMenuItemSensitive(7);
  141. SetArgMenuItemSensitive(8);
  142. SetArgMenuItemSensitive(9);
  143. SetArgMenuItemSensitive(10);
  144. SetArgMenuItemSensitive(11);
  145. SetArgMenuItemSensitive(12);
  146. SetArgMenuItemSensitive(13);
  147. SetArgMenuItemSensitive(14);
  148. SetArgMenuItemSensitive(15);
  149. #undef SetArgMenuItemSensitive
  150. XtSetSensitive( instance->setArgButton_setArgButton_menu_items.
  151. Arg_15_item2, numArgs > 16 );
  152. if (level == _DtTtMessageArgAdded) {
  153. return;
  154. }
  155. _DtTtMessageSetUpdating( msg, True );
  156. char *op = tt_message_op( msg );
  157. status = tt_ptr_error( op );
  158. if (! tt_is_err( status )) {
  159. XmTextFieldSetString( instance->opText, op );
  160. tt_free( op );
  161. }
  162. char *handler = tt_message_handler( msg );
  163. status = tt_ptr_error( handler );
  164. if (! tt_is_err( status )) {
  165. XmTextFieldSetString( instance->handlerText, handler );
  166. tt_free( handler );
  167. }
  168. char *file = tt_message_file( msg );
  169. status = tt_ptr_error( file );
  170. if (! tt_is_err( status )) {
  171. XmTextFieldSetString( instance->fileText, file );
  172. tt_free( file );
  173. }
  174. char *session = tt_message_session( msg );
  175. status = tt_ptr_error( session );
  176. if (! tt_is_err( status )) {
  177. XmTextFieldSetString( instance->sessionText, session );
  178. tt_free( session );
  179. }
  180. int val = tt_message_status( msg );
  181. XtVaSetValues( instance->statusBox, DtNposition, val, NULL );
  182. char *status_string = tt_status_string( (Tt_status)val );
  183. DtTtSetLabel( instance->statusLabel, status_string );
  184. tt_free( status_string );
  185. Widget choice;
  186. switch (tt_message_class( msg )) {
  187. case TT_CLASS_UNDEFINED:
  188. default:
  189. choice = instance->classChoice_items.UNDEFINED_item;
  190. break;
  191. case TT_NOTICE:
  192. choice = instance->classChoice_items.NOTICE_item;
  193. break;
  194. case TT_REQUEST:
  195. choice = instance->classChoice_items.REQUEST_item;
  196. break;
  197. case TT_OFFER:
  198. choice = instance->classChoice_items.OFFER_item;
  199. break;
  200. }
  201. XtVaSetValues( instance->classChoice, XmNmenuHistory, choice, NULL );
  202. switch (tt_message_address( msg )) {
  203. case TT_PROCEDURE:
  204. choice = instance->addressChoice_items.PROCEDURE_item;
  205. break;
  206. case TT_OBJECT:
  207. choice = instance->addressChoice_items.OBJECT_item;
  208. break;
  209. case TT_HANDLER:
  210. choice = instance->addressChoice_items.HANDLER_item;
  211. break;
  212. case TT_OTYPE:
  213. choice = instance->addressChoice_items.OTYPE_item;
  214. break;
  215. case TT_ADDRESS_LAST:
  216. default:
  217. choice = instance->addressChoice_items.ADDRESS_LAST_item;
  218. break;
  219. }
  220. XtVaSetValues( instance->addressChoice, XmNmenuHistory, choice, NULL );
  221. switch (tt_message_scope( msg )) {
  222. case TT_SCOPE_NONE:
  223. default:
  224. choice = instance->scopeChoice_items.SCOPE_NONE_item;
  225. break;
  226. case TT_SESSION:
  227. choice = instance->scopeChoice_items.SESSION_item;
  228. break;
  229. case TT_FILE:
  230. choice = instance->scopeChoice_items.FILE_item;
  231. break;
  232. case TT_BOTH:
  233. choice = instance->scopeChoice_items.BOTH_item;
  234. break;
  235. case TT_FILE_IN_SESSION:
  236. choice = instance->scopeChoice_items.FILE_IN_SESSION_item;
  237. break;
  238. }
  239. XtVaSetValues( instance->scopeChoice, XmNmenuHistory, choice, NULL );
  240. switch (tt_message_disposition( msg )) {
  241. case TT_DISCARD:
  242. default:
  243. choice = instance->dispositionChoice_items.DISCARD_item;
  244. break;
  245. case TT_QUEUE:
  246. choice = instance->dispositionChoice_items.QUEUE_item;
  247. break;
  248. case TT_START:
  249. choice = instance->dispositionChoice_items.START_item;
  250. break;
  251. case TT_QUEUE+TT_START:
  252. choice = instance->dispositionChoice_items.QUEUE_START_item;
  253. break;
  254. }
  255. XtVaSetValues( instance->dispositionChoice, XmNmenuHistory, choice, NULL);
  256. _DtTtMessageSetUpdating( msg, False );
  257. }
  258. void
  259. DtTtMessageWidgetUpdate(
  260. Widget propsWin,
  261. Tt_message msg,
  262. Tt_state oldState,
  263. Tt_status lastOperation,
  264. Boolean stillExists
  265. )
  266. {
  267. void *v = tt_message_user( msg, DtTtMsgInfoKey );
  268. Tt_status status = tt_ptr_error( v );
  269. if (tt_is_err( status ) || (v == 0)) {
  270. return;
  271. }
  272. DtbMessagePropsMessagePropsInfo instance =
  273. (DtbMessagePropsMessagePropsInfo)v;
  274. _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageFullUpdate );
  275. }
  276. void
  277. _DtTtMessageUpdate(
  278. Tt_message msg,
  279. _DtStringChooserAction choice,
  280. char * val
  281. )
  282. {
  283. DtbMessagePropsMessagePropsInfo instance;
  284. instance = (DtbMessagePropsMessagePropsInfo)
  285. tt_message_user( msg, DtTtMsgInfoKey );
  286. Tt_status status = tt_ptr_error( instance );
  287. if (tt_is_err( status ) || (instance == 0)) {
  288. return;
  289. }
  290. char *func;
  291. switch (choice) {
  292. case _DtStringChooseMessageOtype:
  293. status = tt_message_otype_set( msg, val );
  294. func = "tt_message_otype_set()";
  295. break;
  296. case _DtStringChooseMessageObject:
  297. status = tt_message_object_set( msg, val );
  298. func = "tt_message_object_set()";
  299. break;
  300. case _DtStringChooseMessageHandlerPtype:
  301. status = tt_message_handler_ptype_set( msg, val );
  302. func = "tt_message_handler_ptype_set()";
  303. break;
  304. case _DtStringChooseMessageSenderPtype:
  305. status = tt_message_sender_ptype_set( msg, val );
  306. func = "tt_message_sender_ptype_set()";
  307. break;
  308. case _DtStringChooseMessageStatusString:
  309. status = tt_message_status_string_set( msg, val );
  310. func = "tt_message_status_string_set()";
  311. break;
  312. case _DtStringChooseMessageArgValSet: {
  313. if (val == 0) {
  314. break;
  315. }
  316. int arg = atoi( val );
  317. if ((arg <= 15) || (arg+1 > tt_message_args_count( msg ))) {
  318. break;
  319. }
  320. Tt_mode mode = tt_message_arg_mode( msg, arg );
  321. char *vtype = tt_message_arg_type( msg, arg );
  322. if (tt_is_err( tt_ptr_error( vtype ))) {
  323. vtype = 0;
  324. }
  325. char *val = 0;
  326. int ival = 0;
  327. Boolean noValue = False;
  328. Tt_status status = tt_message_arg_ival( msg, arg, &ival );
  329. if (status == TT_ERR_NUM) {
  330. val = tt_message_arg_val( msg, arg );
  331. if (tt_is_err( tt_ptr_error( val ))) {
  332. val = 0;
  333. }
  334. if (val == 0) {
  335. noValue = True;
  336. }
  337. }
  338. _DtArgChooserSet( _DtArgChooseMessageArgSet, msg, arg,
  339. mode, noValue, vtype, val, ival );
  340. } return;
  341. default:
  342. return;
  343. }
  344. DtTtSetLabel( instance->messageFooterLabel, func, status );
  345. _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageRePrint );
  346. return;
  347. }
  348. void
  349. _DtTtMessageUpdate(
  350. Tt_message msg,
  351. _DtSessionChooserAction choice,
  352. char * session
  353. )
  354. {
  355. DtbMessagePropsMessagePropsInfo instance;
  356. instance = (DtbMessagePropsMessagePropsInfo)
  357. tt_message_user( msg, DtTtMsgInfoKey );
  358. Tt_status status = tt_ptr_error( instance );
  359. if (tt_is_err( status ) || (instance == 0)) {
  360. return;
  361. }
  362. char *func;
  363. switch (choice) {
  364. case _DtSessionChooseMessage:
  365. status = tt_message_session_set( msg, session );
  366. func = "tt_message_session_set()";
  367. session = tt_message_session( msg );
  368. if (! tt_is_err( tt_ptr_error( session ))) {
  369. _DtTtMessageSetUpdating( msg, True );
  370. XmTextFieldSetString( instance->sessionText, session );
  371. _DtTtMessageSetUpdating( msg, False );
  372. tt_free( session );
  373. }
  374. break;
  375. default:
  376. return;
  377. }
  378. DtTtSetLabel( instance->messageFooterLabel, func, status );
  379. _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageRePrint );
  380. return;
  381. }
  382. void
  383. _DtTtMessageUpdate(
  384. Tt_message msg,
  385. _DtFileChooserAction choice,
  386. char * file
  387. )
  388. {
  389. DtbMessagePropsMessagePropsInfo instance;
  390. instance = (DtbMessagePropsMessagePropsInfo)
  391. tt_message_user( msg, DtTtMsgInfoKey );
  392. Tt_status status = tt_ptr_error( instance );
  393. if (tt_is_err( status ) || (instance == 0)) {
  394. return;
  395. }
  396. char *func;
  397. switch (choice) {
  398. case _DtFileChooseMessageSet:
  399. status = tt_message_file_set( msg, file );
  400. func = "tt_message_file_set()";
  401. file = tt_message_file( msg );
  402. if (! tt_is_err( tt_ptr_error( file ))) {
  403. _DtTtMessageSetUpdating( msg, True );
  404. XmTextFieldSetString( instance->fileText, file );
  405. _DtTtMessageSetUpdating( msg, False );
  406. tt_free( file );
  407. }
  408. break;
  409. default:
  410. return;
  411. }
  412. DtTtSetLabel( instance->messageFooterLabel, func, status );
  413. _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageRePrint );
  414. return;
  415. }
  416. void
  417. _DtTtMessageUpdate(
  418. Tt_message msg,
  419. _DtTtChooserAction choice,
  420. char * string
  421. )
  422. {
  423. DtbMessagePropsMessagePropsInfo instance;
  424. instance = (DtbMessagePropsMessagePropsInfo)
  425. tt_message_user( msg, DtTtMsgInfoKey );
  426. Tt_status status = tt_ptr_error( instance );
  427. if (tt_is_err( status ) || (instance == 0)) {
  428. return;
  429. }
  430. char *func;
  431. switch (choice) {
  432. case _DtTtChooserMessageOpSet:
  433. status = tt_message_op_set( msg, string );
  434. func = "tt_message_op_set()";
  435. string = tt_message_op( msg );
  436. if (! tt_is_err( tt_ptr_error( string ))) {
  437. _DtTtMessageSetUpdating( msg, True );
  438. XmTextFieldSetString( instance->opText, string );
  439. _DtTtMessageSetUpdating( msg, False );
  440. tt_free( string );
  441. }
  442. break;
  443. case _DtTtChooserMessageHandlerSet:
  444. status = tt_message_handler_set( msg, string );
  445. func = "tt_message_handler_set()";
  446. string = tt_message_handler( msg );
  447. if (! tt_is_err( tt_ptr_error( string ))) {
  448. _DtTtMessageSetUpdating( msg, True );
  449. XmTextFieldSetString( instance->handlerText, string );
  450. _DtTtMessageSetUpdating( msg, False );
  451. tt_free( string );
  452. }
  453. break;
  454. default:
  455. return;
  456. }
  457. DtTtSetLabel( instance->messageFooterLabel, func, status );
  458. _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageRePrint );
  459. return;
  460. }
  461. void
  462. _DtTtMessageUpdate(
  463. Tt_message msg,
  464. _DtArgChooserAction choice,
  465. int nth,
  466. Tt_mode mode,
  467. char * vtype,
  468. char * val,
  469. int ival
  470. )
  471. {
  472. DtbMessagePropsMessagePropsInfo instance;
  473. instance = (DtbMessagePropsMessagePropsInfo)
  474. tt_message_user( msg, DtTtMsgInfoKey );
  475. Tt_status status = tt_ptr_error( instance );
  476. if (tt_is_err( status ) || (instance == 0)) {
  477. return;
  478. }
  479. char *func;
  480. switch (choice) {
  481. case _DtArgChooseMessageArgAdd:
  482. status = tt_message_arg_add( msg, mode, vtype, val );
  483. func = "tt_message_arg_add()";
  484. break;
  485. case _DtArgChooseMessageIArgAdd:
  486. status = tt_message_iarg_add( msg, mode, vtype, ival );
  487. func = "tt_message_iarg_add()";
  488. break;
  489. case _DtArgChooseMessageArgSet:
  490. status = tt_message_arg_val_set( msg, nth, val );
  491. func = "tt_message_arg_val_set()";
  492. break;
  493. case _DtArgChooseMessageIArgSet:
  494. status = tt_message_arg_ival_set( msg, nth, ival );
  495. func = "tt_message_arg_ival_set()";
  496. break;
  497. case _DtArgChooseMessageContextSet:
  498. status = tt_message_context_set( msg, vtype, val );
  499. func = "tt_message_context_set()";
  500. break;
  501. case _DtArgChooseMessageIContextSet:
  502. status = tt_message_icontext_set( msg, vtype, ival );
  503. func = "tt_message_icontext_set()";
  504. break;
  505. default:
  506. return;
  507. }
  508. DtTtSetLabel( instance->messageFooterLabel, func, status );
  509. _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageArgAdded );
  510. return;
  511. }
  512. void
  513. _DtTtMessageUpdate(
  514. Tt_message msg,
  515. Tt_message_callback cb
  516. )
  517. {
  518. DtbMessagePropsMessagePropsInfo instance;
  519. instance = (DtbMessagePropsMessagePropsInfo)
  520. tt_message_user( msg, DtTtMsgInfoKey );
  521. Tt_status status = tt_ptr_error( instance );
  522. if (tt_is_err( status ) || (instance == 0)) {
  523. return;
  524. }
  525. status = tt_message_callback_add( msg, cb );
  526. DtTtSetLabel( instance->messageFooterLabel,
  527. "tt_message_callback_add()", status );
  528. return;
  529. }
  530. Widget
  531. DtTtMessageWidgetCreate(
  532. Widget parent,
  533. Tt_message msg,
  534. DtTtMessageUpdateCallback notifyProc
  535. )
  536. {
  537. DtbMessagePropsMessagePropsInfoRec *instance;
  538. Widget widget = DtTtMessageWidget( msg );
  539. Tt_status status = tt_ptr_error( widget );
  540. if (tt_is_err( status ) || (widget != 0)) {
  541. instance = (DtbMessagePropsMessagePropsInfoRec *)
  542. tt_message_user( msg, DtTtMsgInfoKey );
  543. status = tt_ptr_error( instance );
  544. if (tt_is_err( status ) || (instance != 0)) {
  545. XtManageChild( instance->messageProps_shellform );
  546. }
  547. return widget;
  548. }
  549. instance = new DtbMessagePropsMessagePropsInfoRec;
  550. if (instance == 0) {
  551. return (Widget)tt_error_pointer( TT_ERR_NOMEM );
  552. }
  553. // XXX delete instance in widget destroy proc
  554. status = tt_message_user_set( msg, DtTtMsgInfoKey, instance );
  555. if (tt_is_err( status )) {
  556. delete instance;
  557. return (Widget)tt_error_pointer( status );
  558. }
  559. dtbMessagePropsMessagePropsInfo_clear( instance );
  560. dtb_message_props_message_props_initialize( instance, parent );
  561. widget = instance->messageProps;
  562. XtVaSetValues( instance->messageProps_shellform, XmNuserData, msg, NULL );
  563. status = tt_message_user_set( msg, DtTtMsgWidgetKey, widget );
  564. if (tt_is_err( status )) {
  565. XtDestroyWidget( widget );
  566. delete instance;
  567. return (Widget)tt_error_pointer( status );
  568. }
  569. if (notifyProc != 0) {
  570. status = tt_message_user_set( msg, DtTtMsgUpdateCBKey,
  571. (void *) notifyProc );
  572. if (tt_is_err( status )) {
  573. XtDestroyWidget( widget );
  574. return (Widget)tt_error_pointer( status );
  575. }
  576. status = tt_message_callback_add( msg, _DtMsgUpdateMarshall );
  577. if (tt_is_err( status )) {
  578. XtDestroyWidget( widget );
  579. return (Widget)tt_error_pointer( status );
  580. }
  581. }
  582. std::ostringstream labelStream;
  583. labelStream << "Tt_message " << (void *)msg;
  584. XtVaSetValues( instance->messageProps,
  585. XmNtitle, labelStream.str().c_str(),
  586. NULL );
  587. _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageFullUpdate );
  588. XtManageChild( instance->messageProps_shellform );
  589. return widget;
  590. }
  591. static void
  592. _DtTtMessageDispositionSet(
  593. DtbMessagePropsMessagePropsInfo instance,
  594. Tt_disposition disposition
  595. )
  596. {
  597. Tt_message msg = messageProps2Msg( instance );
  598. if (msg == 0) {
  599. return;
  600. }
  601. Tt_status status = tt_message_disposition_set( msg, disposition );
  602. DtTtSetLabel( instance->messageFooterLabel,
  603. "tt_message_disposition_set()", status );
  604. _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageRePrint );
  605. }
  606. /*** DTB_USER_CODE_END
  607. ***
  608. *** End of user code section
  609. ***
  610. **************************************************************************/
  611. void
  612. messageProps_msgCloseButton_CB1(
  613. Widget widget,
  614. XtPointer clientData,
  615. XtPointer callData
  616. )
  617. {
  618. /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
  619. /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
  620. DtbMessagePropsMessagePropsInfo instance = (DtbMessagePropsMessagePropsInfo)clientData;
  621. if (!(instance->initialized))
  622. {
  623. dtb_message_props_message_props_initialize(instance, dtb_ttsnoop_ttsnoop_win.ttsnoopWin);
  624. }
  625. XtUnmanageChild(instance->messageProps_shellform);
  626. /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
  627. /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
  628. }
  629. void
  630. setClassUndefined(
  631. Widget widget,
  632. XtPointer clientData,
  633. XtPointer callData
  634. )
  635. {
  636. /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
  637. /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
  638. /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
  639. DtbMessagePropsMessagePropsInfo instance =
  640. (DtbMessagePropsMessagePropsInfo)clientData;
  641. Tt_message msg = messageProps2Msg( instance );
  642. if (msg == 0) {
  643. return;
  644. }
  645. Tt_status status = tt_message_class_set( msg, TT_CLASS_UNDEFINED );
  646. DtTtSetLabel( instance->messageFooterLabel,
  647. "tt_message_class_set()", status );
  648. _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageRePrint );
  649. /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
  650. }
  651. void
  652. setClassNotice(
  653. Widget widget,
  654. XtPointer clientData,
  655. XtPointer callData
  656. )
  657. {
  658. /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
  659. /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
  660. /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
  661. DtbMessagePropsMessagePropsInfo instance =
  662. (DtbMessagePropsMessagePropsInfo)clientData;
  663. Tt_message msg = messageProps2Msg( instance );
  664. if (msg == 0) {
  665. return;
  666. }
  667. Tt_status status = tt_message_class_set( msg, TT_NOTICE );
  668. DtTtSetLabel( instance->messageFooterLabel,
  669. "tt_message_class_set()", status );
  670. _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageRePrint );
  671. /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
  672. }
  673. void
  674. setClassRequest(
  675. Widget widget,
  676. XtPointer clientData,
  677. XtPointer callData
  678. )
  679. {
  680. /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
  681. /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
  682. /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
  683. DtbMessagePropsMessagePropsInfo instance =
  684. (DtbMessagePropsMessagePropsInfo)clientData;
  685. Tt_message msg = messageProps2Msg( instance );
  686. if (msg == 0) {
  687. return;
  688. }
  689. Tt_status status = tt_message_class_set( msg, TT_REQUEST );
  690. DtTtSetLabel( instance->messageFooterLabel,
  691. "tt_message_class_set()", status );
  692. _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageRePrint );
  693. /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
  694. }
  695. void
  696. setClassOffer(
  697. Widget widget,
  698. XtPointer clientData,
  699. XtPointer callData
  700. )
  701. {
  702. /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
  703. /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
  704. /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
  705. DtbMessagePropsMessagePropsInfo instance =
  706. (DtbMessagePropsMessagePropsInfo)clientData;
  707. Tt_message msg = messageProps2Msg( instance );
  708. if (msg == 0) {
  709. return;
  710. }
  711. Tt_status status = tt_message_class_set( msg, TT_OFFER );
  712. DtTtSetLabel( instance->messageFooterLabel,
  713. "tt_message_class_set()", status );
  714. _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageRePrint );
  715. /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
  716. }
  717. void
  718. setAddressLast(
  719. Widget widget,
  720. XtPointer clientData,
  721. XtPointer callData
  722. )
  723. {
  724. /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
  725. /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
  726. /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
  727. DtbMessagePropsMessagePropsInfo instance =
  728. (DtbMessagePropsMessagePropsInfo)clientData;
  729. Tt_message msg = messageProps2Msg( instance );
  730. if (msg == 0) {
  731. return;
  732. }
  733. Tt_status status = tt_message_address_set( msg, TT_ADDRESS_LAST );
  734. DtTtSetLabel( instance->messageFooterLabel,
  735. "tt_message_address_set()", status );
  736. _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageRePrint );
  737. /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
  738. }
  739. void
  740. setAddressProcedure(
  741. Widget widget,
  742. XtPointer clientData,
  743. XtPointer callData
  744. )
  745. {
  746. /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
  747. /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
  748. /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
  749. DtbMessagePropsMessagePropsInfo instance =
  750. (DtbMessagePropsMessagePropsInfo)clientData;
  751. Tt_message msg = messageProps2Msg( instance );
  752. if (msg == 0) {
  753. return;
  754. }
  755. Tt_status status = tt_message_address_set( msg, TT_PROCEDURE );
  756. DtTtSetLabel( instance->messageFooterLabel,
  757. "tt_message_address_set()", status );
  758. _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageRePrint );
  759. /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
  760. }
  761. void
  762. setAddressObject(
  763. Widget widget,
  764. XtPointer clientData,
  765. XtPointer callData
  766. )
  767. {
  768. /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
  769. /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
  770. /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
  771. DtbMessagePropsMessagePropsInfo instance =
  772. (DtbMessagePropsMessagePropsInfo)clientData;
  773. Tt_message msg = messageProps2Msg( instance );
  774. if (msg == 0) {
  775. return;
  776. }
  777. Tt_status status = tt_message_address_set( msg, TT_OBJECT );
  778. DtTtSetLabel( instance->messageFooterLabel,
  779. "tt_message_address_set()", status );
  780. _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageRePrint );
  781. /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
  782. }
  783. void
  784. setAddressHandler(
  785. Widget widget,
  786. XtPointer clientData,
  787. XtPointer callData
  788. )
  789. {
  790. /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
  791. /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
  792. /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
  793. DtbMessagePropsMessagePropsInfo instance =
  794. (DtbMessagePropsMessagePropsInfo)clientData;
  795. Tt_message msg = messageProps2Msg( instance );
  796. if (msg == 0) {
  797. return;
  798. }
  799. Tt_status status = tt_message_address_set( msg, TT_HANDLER );
  800. DtTtSetLabel( instance->messageFooterLabel,
  801. "tt_message_address_set()", status );
  802. _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageRePrint );
  803. /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
  804. }
  805. void
  806. setAddressOtype(
  807. Widget widget,
  808. XtPointer clientData,
  809. XtPointer callData
  810. )
  811. {
  812. /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
  813. /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
  814. /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
  815. DtbMessagePropsMessagePropsInfo instance =
  816. (DtbMessagePropsMessagePropsInfo)clientData;
  817. Tt_message msg = messageProps2Msg( instance );
  818. if (msg == 0) {
  819. return;
  820. }
  821. Tt_status status = tt_message_address_set( msg, TT_OTYPE );
  822. DtTtSetLabel( instance->messageFooterLabel,
  823. "tt_message_address_set()", status );
  824. _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageRePrint );
  825. /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
  826. }
  827. void
  828. setScopeNone(
  829. Widget widget,
  830. XtPointer clientData,
  831. XtPointer callData
  832. )
  833. {
  834. /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
  835. /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
  836. /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
  837. DtbMessagePropsMessagePropsInfo instance =
  838. (DtbMessagePropsMessagePropsInfo)clientData;
  839. Tt_message msg = messageProps2Msg( instance );
  840. if (msg == 0) {
  841. return;
  842. }
  843. Tt_status status = tt_message_scope_set( msg, TT_SCOPE_NONE );
  844. DtTtSetLabel( instance->messageFooterLabel,
  845. "tt_message_scope_set()", status );
  846. _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageRePrint );
  847. /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
  848. }
  849. void
  850. setScopeSession(
  851. Widget widget,
  852. XtPointer clientData,
  853. XtPointer callData
  854. )
  855. {
  856. /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
  857. /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
  858. /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
  859. DtbMessagePropsMessagePropsInfo instance =
  860. (DtbMessagePropsMessagePropsInfo)clientData;
  861. Tt_message msg = messageProps2Msg( instance );
  862. if (msg == 0) {
  863. return;
  864. }
  865. Tt_status status = tt_message_scope_set( msg, TT_SESSION );
  866. DtTtSetLabel( instance->messageFooterLabel,
  867. "tt_message_scope_set()", status );
  868. _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageRePrint );
  869. /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
  870. }
  871. void
  872. setScopeFile(
  873. Widget widget,
  874. XtPointer clientData,
  875. XtPointer callData
  876. )
  877. {
  878. /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
  879. /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
  880. /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
  881. DtbMessagePropsMessagePropsInfo instance =
  882. (DtbMessagePropsMessagePropsInfo)clientData;
  883. Tt_message msg = messageProps2Msg( instance );
  884. if (msg == 0) {
  885. return;
  886. }
  887. Tt_status status = tt_message_scope_set( msg, TT_FILE );
  888. DtTtSetLabel( instance->messageFooterLabel,
  889. "tt_message_scope_set()", status );
  890. _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageRePrint );
  891. /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
  892. }
  893. void
  894. setScopeBoth(
  895. Widget widget,
  896. XtPointer clientData,
  897. XtPointer callData
  898. )
  899. {
  900. /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
  901. /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
  902. /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
  903. DtbMessagePropsMessagePropsInfo instance =
  904. (DtbMessagePropsMessagePropsInfo)clientData;
  905. Tt_message msg = messageProps2Msg( instance );
  906. if (msg == 0) {
  907. return;
  908. }
  909. Tt_status status = tt_message_scope_set( msg, TT_BOTH );
  910. DtTtSetLabel( instance->messageFooterLabel,
  911. "tt_message_scope_set()", status );
  912. _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageRePrint );
  913. /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
  914. }
  915. void
  916. setScopeFileInSession(
  917. Widget widget,
  918. XtPointer clientData,
  919. XtPointer callData
  920. )
  921. {
  922. /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
  923. /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
  924. /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
  925. DtbMessagePropsMessagePropsInfo instance =
  926. (DtbMessagePropsMessagePropsInfo)clientData;
  927. Tt_message msg = messageProps2Msg( instance );
  928. if (msg == 0) {
  929. return;
  930. }
  931. Tt_status status = tt_message_scope_set( msg, TT_FILE_IN_SESSION );
  932. DtTtSetLabel( instance->messageFooterLabel,
  933. "tt_message_scope_set()", status );
  934. _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageRePrint );
  935. /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
  936. }
  937. void
  938. setOp(
  939. Widget widget,
  940. XtPointer clientData,
  941. XtPointer callData
  942. )
  943. {
  944. /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
  945. /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
  946. /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
  947. DtbMessagePropsMessagePropsInfo instance =
  948. (DtbMessagePropsMessagePropsInfo)clientData;
  949. Tt_message msg = messageProps2Msg( instance );
  950. if ((msg == 0) || _DtTtMessageUpdating( msg )) {
  951. return;
  952. }
  953. char *op = XmTextFieldGetString( instance->opText );
  954. if ((op != 0) && (op[0] == '\0')) {
  955. XtFree( op );
  956. op = 0;
  957. }
  958. Tt_status status = tt_message_op_set( msg, op );
  959. if (op != 0) {
  960. XtFree( op );
  961. }
  962. DtTtSetLabel( instance->messageFooterLabel,
  963. "tt_message_op_set()", status );
  964. _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageRePrint );
  965. /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
  966. }
  967. void
  968. msgSend(
  969. Widget widget,
  970. XtPointer clientData,
  971. XtPointer callData
  972. )
  973. {
  974. /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
  975. /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
  976. /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
  977. DtbMessagePropsMessagePropsInfo instance =
  978. (DtbMessagePropsMessagePropsInfo)clientData;
  979. Tt_message msg = messageProps2Msg( instance );
  980. if (msg == 0) {
  981. return;
  982. }
  983. Tt_status status = tt_message_send( msg );
  984. DtTtSetLabel( instance->messageFooterLabel,
  985. "tt_message_send()", status );
  986. _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageFullUpdate );
  987. /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
  988. }
  989. void
  990. msgSendOnExit(
  991. Widget widget,
  992. XtPointer clientData,
  993. XtPointer callData
  994. )
  995. {
  996. /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
  997. /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
  998. /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
  999. DtbMessagePropsMessagePropsInfo instance =
  1000. (DtbMessagePropsMessagePropsInfo)clientData;
  1001. Tt_message msg = messageProps2Msg( instance );
  1002. if (msg == 0) {
  1003. return;
  1004. }
  1005. Tt_status status = tt_message_send_on_exit( msg );
  1006. DtTtSetLabel( instance->messageFooterLabel,
  1007. "tt_message_send_on_exit()", status );
  1008. _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageFullUpdate );
  1009. /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
  1010. }
  1011. void
  1012. msgAccept(
  1013. Widget widget,
  1014. XtPointer clientData,
  1015. XtPointer callData
  1016. )
  1017. {
  1018. /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
  1019. /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
  1020. /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
  1021. DtbMessagePropsMessagePropsInfo instance =
  1022. (DtbMessagePropsMessagePropsInfo)clientData;
  1023. Tt_message msg = messageProps2Msg( instance );
  1024. if (msg == 0) {
  1025. return;
  1026. }
  1027. Tt_status status = tt_message_accept( msg );
  1028. DtTtSetLabel( instance->messageFooterLabel,
  1029. "tt_message_accept()", status );
  1030. _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageFullUpdate );
  1031. /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
  1032. }
  1033. void
  1034. msgReject(
  1035. Widget widget,
  1036. XtPointer clientData,
  1037. XtPointer callData
  1038. )
  1039. {
  1040. /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
  1041. /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
  1042. /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
  1043. DtbMessagePropsMessagePropsInfo instance =
  1044. (DtbMessagePropsMessagePropsInfo)clientData;
  1045. Tt_message msg = messageProps2Msg( instance );
  1046. if (msg == 0) {
  1047. return;
  1048. }
  1049. Tt_status status = tt_message_send_on_exit( msg );
  1050. DtTtSetLabel( instance->messageFooterLabel,
  1051. "tt_message_send_on_exit()", status );
  1052. _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageFullUpdate );
  1053. /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
  1054. }
  1055. void
  1056. msgReply(
  1057. Widget widget,
  1058. XtPointer clientData,
  1059. XtPointer callData
  1060. )
  1061. {
  1062. /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
  1063. /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
  1064. /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
  1065. DtbMessagePropsMessagePropsInfo instance =
  1066. (DtbMessagePropsMessagePropsInfo)clientData;
  1067. Tt_message msg = messageProps2Msg( instance );
  1068. if (msg == 0) {
  1069. return;
  1070. }
  1071. Tt_status status = tt_message_reply( msg );
  1072. DtTtSetLabel( instance->messageFooterLabel,
  1073. "tt_message_reply()", status );
  1074. _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageFullUpdate );
  1075. /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
  1076. }
  1077. void
  1078. msgFail(
  1079. Widget widget,
  1080. XtPointer clientData,
  1081. XtPointer callData
  1082. )
  1083. {
  1084. /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
  1085. /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
  1086. /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
  1087. DtbMessagePropsMessagePropsInfo instance =
  1088. (DtbMessagePropsMessagePropsInfo)clientData;
  1089. Tt_message msg = messageProps2Msg( instance );
  1090. if (msg == 0) {
  1091. return;
  1092. }
  1093. Tt_status status = tt_message_fail( msg );
  1094. DtTtSetLabel( instance->messageFooterLabel,
  1095. "tt_message_fail()", status );
  1096. _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageFullUpdate );
  1097. /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
  1098. }
  1099. void
  1100. msgDestroy(
  1101. Widget widget,
  1102. XtPointer clientData,
  1103. XtPointer callData
  1104. )
  1105. {
  1106. /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
  1107. /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
  1108. /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
  1109. DtbMessagePropsMessagePropsInfo instance =
  1110. (DtbMessagePropsMessagePropsInfo)clientData;
  1111. Tt_message msg = messageProps2Msg( instance );
  1112. if (msg == 0) {
  1113. return;
  1114. }
  1115. Tt_status status = tttk_message_destroy( msg );
  1116. DtTtSetLabel( instance->messageFooterLabel,
  1117. "tttk_message_destroy()", status );
  1118. switch (status) {
  1119. case TT_OK:
  1120. DtTtDestroyed( DTTT_MESSAGE, msg );
  1121. XtDestroyWidget( instance->messageProps );
  1122. delete instance;
  1123. break;
  1124. default:
  1125. _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageFullUpdate );
  1126. break;
  1127. }
  1128. /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
  1129. }
  1130. void
  1131. msgDtAccept(
  1132. Widget widget,
  1133. XtPointer clientData,
  1134. XtPointer callData
  1135. )
  1136. {
  1137. /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
  1138. /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
  1139. /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
  1140. DtbMessagePropsMessagePropsInfo instance =
  1141. (DtbMessagePropsMessagePropsInfo)clientData;
  1142. Tt_message msg = messageProps2Msg( instance );
  1143. if (msg == 0) {
  1144. return;
  1145. }
  1146. Tt_pattern *pats = ttdt_message_accept( msg, 0, 0, instance->messageProps,
  1147. 1, 1 );
  1148. Tt_status status = tt_ptr_error( pats );
  1149. DtTtSetLabel( instance->messageFooterLabel,
  1150. "ttdt_message_accept()", status );
  1151. if ((status == TT_OK) && (pats != 0)) {
  1152. while (*pats != 0) {
  1153. DtTtCreated( DTTT_PATTERN, *pats );
  1154. pats++;
  1155. }
  1156. }
  1157. _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageFullUpdate );
  1158. /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
  1159. }
  1160. void
  1161. msgSubcontractManage(
  1162. Widget widget,
  1163. XtPointer clientData,
  1164. XtPointer callData
  1165. )
  1166. {
  1167. /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
  1168. /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
  1169. /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
  1170. DtbMessagePropsMessagePropsInfo instance =
  1171. (DtbMessagePropsMessagePropsInfo)clientData;
  1172. Tt_message msg = messageProps2Msg( instance );
  1173. if (msg == 0) {
  1174. return;
  1175. }
  1176. Tt_pattern *pats = ttdt_subcontract_manage( msg, 0,
  1177. instance->messageProps, 0 );
  1178. Tt_status status = tt_ptr_error( pats );
  1179. DtTtSetLabel( instance->messageFooterLabel,
  1180. "ttdt_subcontract_manage()", status );
  1181. if (status == TT_OK) {
  1182. while (*pats != 0) {
  1183. DtTtCreated( DTTT_PATTERN, *pats );
  1184. pats++;
  1185. }
  1186. }
  1187. _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageFullUpdate );
  1188. /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
  1189. }
  1190. void
  1191. msgClone(
  1192. Widget widget,
  1193. XtPointer clientData,
  1194. XtPointer callData
  1195. )
  1196. {
  1197. /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
  1198. /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
  1199. /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
  1200. DtbMessagePropsMessagePropsInfo instance =
  1201. (DtbMessagePropsMessagePropsInfo)clientData;
  1202. Tt_message msg = messageProps2Msg( instance );
  1203. if (msg == 0) {
  1204. return;
  1205. }
  1206. msg = tt_message_copy( msg );
  1207. Tt_status status = DtTtSetLabel( instance->messageProps_footer,
  1208. "tt_message_copy()", msg );
  1209. if (tt_is_err( status )) {
  1210. return;
  1211. }
  1212. DtTtCreated( DTTT_MESSAGE, msg );
  1213. Widget newWidget = DtTtMessageWidgetCreate(
  1214. dtb_ttsnoop_ttsnoop_win.ttsnoopWin, msg,
  1215. DtTtMessageWidgetUpdate );
  1216. status = tt_ptr_error( newWidget );
  1217. if (tt_is_err( status )) {
  1218. return;
  1219. }
  1220. XRaiseWindow( XtDisplay( newWidget ), XtWindow( newWidget ));
  1221. /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
  1222. }
  1223. void
  1224. msgStatusNotice(
  1225. Widget widget,
  1226. XtPointer clientData,
  1227. XtPointer callData
  1228. )
  1229. {
  1230. /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
  1231. /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
  1232. /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
  1233. DtbMessagePropsMessagePropsInfo instance =
  1234. (DtbMessagePropsMessagePropsInfo)clientData;
  1235. Tt_message msg = messageProps2Msg( instance );
  1236. if (msg == 0) {
  1237. return;
  1238. }
  1239. char *sender = tt_message_sender( msg );
  1240. Tt_message msg2 = tttk_message_create( msg, TT_NOTICE,
  1241. tt_message_scope( msg ), sender, "Status", 0 );
  1242. tt_free( sender );
  1243. Tt_status status = DtTtSetLabel( instance->messageProps_footer,
  1244. "tttk_message_create()", msg2 );
  1245. if (tt_is_err( status )) {
  1246. return;
  1247. }
  1248. tt_message_arg_add( msg2, TT_IN, Tttk_string, 0 );
  1249. tt_message_arg_add( msg2, TT_IN, Tttk_string, 0 );
  1250. tt_message_arg_add( msg2, TT_IN, Tttk_string, 0 );
  1251. tt_message_arg_add( msg2, TT_IN, Tttk_string, 0 );
  1252. char *commission = tt_message_id( msg );
  1253. tt_message_arg_add( msg2, TT_IN, Tttk_message_id, commission );
  1254. tt_free( commission );
  1255. DtTtCreated( DTTT_MESSAGE, msg2 );
  1256. Widget newWidget = DtTtMessageWidgetCreate(
  1257. dtb_ttsnoop_ttsnoop_win.ttsnoopWin, msg2,
  1258. DtTtMessageWidgetUpdate );
  1259. status = tt_ptr_error( newWidget );
  1260. if (tt_is_err( status )) {
  1261. return;
  1262. }
  1263. XRaiseWindow( XtDisplay( newWidget ), XtWindow( newWidget ));
  1264. /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
  1265. }
  1266. void
  1267. msgGenAction(
  1268. Widget widget,
  1269. XtPointer clientData,
  1270. XtPointer callData
  1271. )
  1272. {
  1273. /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
  1274. /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
  1275. /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
  1276. std::ostringstream action;
  1277. DtbMessagePropsMessagePropsInfo instance =
  1278. (DtbMessagePropsMessagePropsInfo)clientData;
  1279. Tt_message msg = messageProps2Msg( instance );
  1280. if (msg == 0) {
  1281. return;
  1282. }
  1283. char *op = tt_message_op( msg );
  1284. action << "ACTION Send_" << op << "\n{\n\tLABEL\tSend_" << op << "\n";
  1285. action << "\tTYPE\tTT_MSG\n";
  1286. action << "\tTT_CLASS\t" << tt_message_class( msg ) << "\n";
  1287. action << "\tTT_SCOPE\t" << tt_message_scope( msg ) << "\n";
  1288. action << "\tTT_OPERATION\t" << op << "\n";
  1289. tt_free( op );
  1290. char *file = tt_message_file( msg );
  1291. Tt_status status = tt_ptr_error( file );
  1292. if ((! tt_is_err( status )) && (file != 0)) {
  1293. action << "\tTT_FILE\t" << file << "\n";
  1294. tt_free( file );
  1295. }
  1296. int args = tt_message_args_count( msg );
  1297. for (int arg = 0; arg < args; arg++) {
  1298. action << "\tTT_ARG" << arg << "_MODE\t";
  1299. action << tt_message_arg_mode( msg, arg ) << "\n";
  1300. char *vtype = tt_message_arg_type( msg, arg );
  1301. action << "\tTT_ARG" << arg << "_VTYPE\t" << vtype << "\n";
  1302. int ival;
  1303. status = tt_message_arg_ival( msg, arg, &ival );
  1304. switch (status) {
  1305. char *val;
  1306. case TT_OK:
  1307. action << "\tTT_ARG" << arg << "_REP_TYPE\t"
  1308. "TT_REP_INTEGER\n";
  1309. action << "\tTT_ARG" << arg << "_VALUE\t" << ival << "\n";
  1310. break;
  1311. case TT_ERR_NUM:
  1312. val = tt_message_arg_val( msg, arg );
  1313. status = tt_ptr_error( val );
  1314. if (tt_is_err( status ) || (val == 0)) {
  1315. continue;
  1316. }
  1317. action << "\tTT_ARG" << arg << "_VALUE\t" << val << "\n";
  1318. tt_free( val );
  1319. break;
  1320. }
  1321. }
  1322. // XXX emit commented warnings for e.g. TT_OFFER, TT_HANDLER
  1323. action << "}\n";
  1324. // XtVaSetValues( instance->messageText, XmNvalue, action.str().c_str(), 0 );
  1325. _DtOpen( instance->messageFooterLabel, (void *)action.str().c_str(),
  1326. action.str().size(), "actio" );
  1327. /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
  1328. }
  1329. void
  1330. msgGenC(
  1331. Widget widget,
  1332. XtPointer clientData,
  1333. XtPointer callData
  1334. )
  1335. {
  1336. /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
  1337. /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
  1338. /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
  1339. std::ostringstream code;
  1340. DtbMessagePropsMessagePropsInfo instance =
  1341. (DtbMessagePropsMessagePropsInfo)clientData;
  1342. Tt_message msg = messageProps2Msg( instance );
  1343. if (msg == 0) {
  1344. return;
  1345. }
  1346. code << "#include <Tt/tt_c.h>\n";
  1347. code << "#include <Tt/tttk.h>\n";
  1348. char *op = tt_message_op( msg );
  1349. if (tt_message_class( msg ) != TT_NOTICE) {
  1350. code << "\nTt_callback_action\nprocess_" << op << "_reply(";
  1351. code << " Tt_message msg, Tt_message pat );\n";
  1352. }
  1353. code << "\nTt_message\n";
  1354. code << "create_" << op << "(\n";
  1355. code << "\tTt_message context\n)\n{\n";
  1356. code << "\tTt_message msg;\n";
  1357. code << "\tmsg = tttk_message_create( context";
  1358. code << ", " << tt_message_class( msg );
  1359. code << ", " << tt_message_scope( msg ) << ",\n\t\t\t";
  1360. Tt_address address = tt_message_address( msg );
  1361. switch (address) {
  1362. char *handler;
  1363. case TT_PROCEDURE:
  1364. default:
  1365. code << "0, ";
  1366. break;
  1367. case TT_HANDLER:
  1368. handler = tt_message_handler( msg );
  1369. code << "\"" << handler << "\",\n";
  1370. tt_free( handler );
  1371. break;
  1372. }
  1373. if (op == 0) {
  1374. code << "(char *)0";
  1375. } else {
  1376. code << "\"" << op << "\"";
  1377. }
  1378. code << ", ";
  1379. if (tt_message_class( msg ) == TT_NOTICE) {
  1380. code << "0 ";
  1381. } else {
  1382. code << "\n\t\t\tprocess_" << op << "_reply ";
  1383. }
  1384. code << ");\n";
  1385. switch (address) {
  1386. default:
  1387. code << "\ttt_message_address_set( msg, " << address << " );\n";
  1388. break;
  1389. case TT_PROCEDURE:
  1390. case TT_HANDLER:
  1391. // set properly by tttk_message_create();
  1392. break;
  1393. }
  1394. int args = tt_message_args_count( msg );
  1395. if (tt_is_err( tt_int_error( args ))) {
  1396. args = 0;
  1397. }
  1398. for (int arg = 0; arg < args; arg++) {
  1399. Tt_mode mode = tt_message_arg_mode( msg, arg );
  1400. char *vtype = tt_message_arg_type( msg, arg );
  1401. int ival;
  1402. Tt_status status = tt_message_arg_ival( msg, arg, &ival );
  1403. switch (status) {
  1404. char *val;
  1405. case TT_OK:
  1406. code << "\ttt_message_iarg_add( msg, " << mode << ", ";
  1407. code << '"' << vtype << "\", " << ival << " );\n";
  1408. break;
  1409. case TT_ERR_NUM:
  1410. val = tt_message_arg_val( msg, arg );
  1411. code << "\ttt_message_arg_add( msg, " << mode << ", ";
  1412. code << '"' << vtype << "\", ";
  1413. if (val == 0) {
  1414. code << "(char *)0";
  1415. } else {
  1416. code << "\"" << val << "\"";
  1417. }
  1418. code << ");\n";
  1419. tt_free( val );
  1420. break;
  1421. }
  1422. tt_free( vtype );
  1423. }
  1424. int stat = tt_message_status( msg );
  1425. if (stat != 0) {
  1426. code << "\ttt_message_status_set( msg, " << stat << " );\n";
  1427. }
  1428. code << "\treturn msg;\n";
  1429. code << "}\n";
  1430. if (tt_message_class( msg ) != TT_NOTICE) {
  1431. code << "\nstatic Tt_callback_action\n";
  1432. code << "process_" << op << "_reply(\n";
  1433. code << "\tTt_message msg,\n";
  1434. code << "\tTt_message pat\n";
  1435. code << ")\n{\n";
  1436. code << "\tswitch (tt_message_state(msg)) {\n";
  1437. code << "\t\tcase TT_SENT:\t/* handler is in this process */\n";
  1438. code << "\t\tcase TT_STARTED:/* intermediate state */\n";
  1439. code << "\t\tcase TT_QUEUED:\t/* intermediate state */\n";
  1440. code << "\t\tdefault:\t/* unknown state */\n";
  1441. code << "\t\t\treturn TT_CALLBACK_CONTINUE;\n";
  1442. if (tt_message_class(msg) == TT_REQUEST) {
  1443. code << "\t\tcase TT_HANDLED:\n";
  1444. code << "\t\t\t/* ... */\n";
  1445. code << "\t\t\tbreak;\n";
  1446. code << "\t\tcase TT_FAILED: {\n";
  1447. code << "\t\t\tint status;\n";
  1448. code << "\t\t\tchar *string;\n";
  1449. code << "\t\t\tstatus = tt_message_status( msg );\n";
  1450. code << "\t\t\tstring = "
  1451. "tt_message_status_string( msg );\n";
  1452. code << "\t\t\t/* ... */\n";
  1453. code << "\t\t\t} break;\n";
  1454. } else {
  1455. code << "\t\tcase TT_RETURNED:\n";
  1456. code << "\t\t\t/* ... */\n";
  1457. code << "\t\t\tbreak;\n";
  1458. }
  1459. code << "\t}\n";
  1460. code << "\ttt_message_destroy( msg );\n";
  1461. code << "\treturn TT_CALLBACK_PROCESSED;\n";
  1462. code << "}\n";
  1463. }
  1464. tt_free( op );
  1465. // XtVaSetValues( instance->messageText, XmNvalue, code.str().c_str(), 0 );
  1466. _DtOpen( instance->messageFooterLabel, (void *)code.str().c_str(),
  1467. code.str().size(), "msgC" );
  1468. /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
  1469. }
  1470. void
  1471. setHandler(
  1472. Widget widget,
  1473. XtPointer clientData,
  1474. XtPointer callData
  1475. )
  1476. {
  1477. /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
  1478. /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
  1479. /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
  1480. DtbMessagePropsMessagePropsInfo instance =
  1481. (DtbMessagePropsMessagePropsInfo)clientData;
  1482. Tt_message msg = messageProps2Msg( instance );
  1483. if ((msg == 0) || _DtTtMessageUpdating( msg )) {
  1484. return;
  1485. }
  1486. char *handler = XmTextFieldGetString( instance->handlerText );
  1487. if ((handler != 0) && (handler[0] == '\0')) {
  1488. XtFree( handler );
  1489. handler = 0;
  1490. }
  1491. Tt_status status = tt_message_handler_set( msg, handler );
  1492. if (handler != 0) {
  1493. XtFree( handler );
  1494. }
  1495. DtTtSetLabel( instance->messageFooterLabel,
  1496. "tt_message_handler_set()", status );
  1497. _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageRePrint );
  1498. /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
  1499. }
  1500. void
  1501. setSession(
  1502. Widget widget,
  1503. XtPointer clientData,
  1504. XtPointer callData
  1505. )
  1506. {
  1507. /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
  1508. /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
  1509. /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
  1510. DtbMessagePropsMessagePropsInfo instance =
  1511. (DtbMessagePropsMessagePropsInfo)clientData;
  1512. Tt_message msg = messageProps2Msg( instance );
  1513. if ((msg == 0) || _DtTtMessageUpdating( msg )) {
  1514. return;
  1515. }
  1516. char *session = XmTextFieldGetString( instance->sessionText );
  1517. if ((session != 0) && (session[0] == '\0')) {
  1518. XtFree( session );
  1519. session = 0;
  1520. }
  1521. Tt_status status = tt_message_session_set( msg, session );
  1522. if (session != 0) {
  1523. XtFree( session );
  1524. }
  1525. DtTtSetLabel( instance->messageFooterLabel,
  1526. "tt_message_session_set()", status );
  1527. _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageRePrint );
  1528. /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
  1529. }
  1530. void
  1531. setFile(
  1532. Widget widget,
  1533. XtPointer clientData,
  1534. XtPointer callData
  1535. )
  1536. {
  1537. /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
  1538. /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
  1539. /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
  1540. DtbMessagePropsMessagePropsInfo instance =
  1541. (DtbMessagePropsMessagePropsInfo)clientData;
  1542. Tt_message msg = messageProps2Msg( instance );
  1543. if ((msg == 0) || _DtTtMessageUpdating( msg )) {
  1544. return;
  1545. }
  1546. char *file = XmTextFieldGetString( instance->fileText );
  1547. if ((file != 0) && (file[0] == '\0')) {
  1548. XtFree( file );
  1549. file = 0;
  1550. }
  1551. Tt_status status = tt_message_file_set( msg, file );
  1552. if (file != 0) {
  1553. XtFree( file );
  1554. }
  1555. DtTtSetLabel( instance->messageFooterLabel,
  1556. "tt_message_file_set()", status );
  1557. _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageRePrint );
  1558. /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
  1559. }
  1560. void
  1561. setStatus(
  1562. Widget widget,
  1563. XtPointer clientData,
  1564. XtPointer callData
  1565. )
  1566. {
  1567. /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
  1568. /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
  1569. /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
  1570. DtbMessagePropsMessagePropsInfo instance =
  1571. (DtbMessagePropsMessagePropsInfo)clientData;
  1572. Tt_message msg = messageProps2Msg( instance );
  1573. if ((msg == 0) || _DtTtMessageUpdating( msg )) {
  1574. return;
  1575. }
  1576. int val;
  1577. XtVaGetValues( instance->statusBox, DtNposition, &val, NULL );
  1578. XmString statusName = DtTtStatusString( (Tt_status)val );
  1579. XtVaSetValues( instance->statusLabel, XmNlabelString, statusName, NULL );
  1580. XmStringFree( statusName );
  1581. Tt_status status = tt_message_status_set( msg, val );
  1582. DtTtSetLabel( instance->messageFooterLabel,
  1583. "tt_message_status_set()", status );
  1584. _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageRePrint );
  1585. /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
  1586. }
  1587. void
  1588. msgHelp(
  1589. Widget widget,
  1590. XtPointer clientData,
  1591. XtPointer callData
  1592. )
  1593. {
  1594. /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
  1595. /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
  1596. /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
  1597. dtb_do_onitem_help();
  1598. /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
  1599. }
  1600. void
  1601. msgPattern(
  1602. Widget widget,
  1603. XtPointer clientData,
  1604. XtPointer callData
  1605. )
  1606. {
  1607. /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
  1608. /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
  1609. /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
  1610. DtbMessagePropsMessagePropsInfo instance =
  1611. (DtbMessagePropsMessagePropsInfo)clientData;
  1612. Tt_message msg = messageProps2Msg( instance );
  1613. if (msg == 0) {
  1614. return;
  1615. }
  1616. Tt_pattern pat = tt_message_pattern( msg );
  1617. Tt_status status = DtTtSetLabel( instance->messageFooterLabel,
  1618. "tt_message_pattern()", pat );
  1619. if (tt_is_err( status ) || (pat == 0)) {
  1620. return;
  1621. }
  1622. Widget newWidget = DtTtPatternWidgetCreate(
  1623. dtb_ttsnoop_ttsnoop_win.ttsnoopWin,
  1624. pat, 0 );
  1625. status = tt_ptr_error( newWidget );
  1626. if (tt_is_err( status )) {
  1627. return;
  1628. }
  1629. XRaiseWindow( XtDisplay( newWidget ), XtWindow( newWidget ));
  1630. /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
  1631. }
  1632. void
  1633. msgPrint(
  1634. Widget widget,
  1635. XtPointer clientData,
  1636. XtPointer callData
  1637. )
  1638. {
  1639. /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
  1640. /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
  1641. /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
  1642. DtbMessagePropsMessagePropsInfo instance =
  1643. (DtbMessagePropsMessagePropsInfo)clientData;
  1644. Tt_message msg = messageProps2Msg( instance );
  1645. if (msg == 0) {
  1646. return;
  1647. }
  1648. _DtTtMessageWidgetUpdate( instance, msg, _DtTtMessageRePrint );
  1649. DtTtSetLabel( instance->messageFooterLabel,
  1650. "tt_message_print()", TT_OK );
  1651. /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
  1652. }
  1653. void
  1654. genPattern(
  1655. Widget widget,
  1656. XtPointer clientData,
  1657. XtPointer callData
  1658. )
  1659. {
  1660. /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
  1661. /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
  1662. /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
  1663. DtbMessagePropsMessagePropsInfo instance =
  1664. (DtbMessagePropsMessagePropsInfo)clientData;
  1665. Tt_message msg = messageProps2Msg( instance );
  1666. if (msg == 0) {
  1667. return;
  1668. }
  1669. Tt_pattern pat = tt_pattern_create();
  1670. tt_pattern_category_set( pat, TT_OBSERVE );
  1671. tt_pattern_class_add( pat, tt_message_class( msg ));
  1672. tt_pattern_scope_add( pat, tt_message_scope( msg ));
  1673. tt_pattern_address_add( pat, tt_message_address( msg ));
  1674. char *op = tt_message_op( msg );
  1675. if ((! tt_is_err( tt_ptr_error( op ))) && (op != 0)) {
  1676. tt_pattern_op_add( pat, op );
  1677. tt_free( op );
  1678. }
  1679. // skip file, sender, sender_ptype, otype, object, opnum, contexts
  1680. char *session = tt_message_session( msg );
  1681. if ((! tt_is_err( tt_ptr_error( session ))) && (session != 0)) {
  1682. tt_pattern_session_add( pat, session );
  1683. tt_free( session );
  1684. }
  1685. int args = tt_message_args_count( msg );
  1686. if (tt_int_error( args ) == TT_OK) {
  1687. for (int arg = 0; arg < args; arg++) {
  1688. Tt_mode mode = tt_message_arg_mode( msg, arg );
  1689. char *vtype = tt_message_arg_type( msg, arg );
  1690. // skip arg value
  1691. tt_pattern_arg_add( pat, mode, vtype, 0 );
  1692. tt_free( vtype );
  1693. }
  1694. }
  1695. DtTtCreated( DTTT_PATTERN, pat );
  1696. Widget newWidget = DtTtPatternWidgetCreate(
  1697. dtb_ttsnoop_ttsnoop_win.ttsnoopWin, pat, 0 );
  1698. if (tt_is_err( tt_ptr_error( newWidget ))) {
  1699. return;
  1700. }
  1701. XRaiseWindow( XtDisplay( newWidget ), XtWindow( newWidget ));
  1702. /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
  1703. }
  1704. void
  1705. genObserver(
  1706. Widget widget,
  1707. XtPointer clientData,
  1708. XtPointer callData
  1709. )
  1710. {
  1711. /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
  1712. /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
  1713. /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
  1714. std::ostringstream ptype;
  1715. DtbMessagePropsMessagePropsInfo instance =
  1716. (DtbMessagePropsMessagePropsInfo)clientData;
  1717. Tt_message msg = messageProps2Msg( instance );
  1718. if (msg == 0) {
  1719. return;
  1720. }
  1721. ptype << "ptype Acme_Calc {\n\tstart \"acalc\";\n";
  1722. ptype << "\t/*\n";
  1723. ptype << "\thandle_push:\n";
  1724. ptype << "\thandle_rotate:\n";
  1725. switch (tt_message_class(msg)) {
  1726. case TT_REQUEST:
  1727. ptype << "\tobserve:\n";
  1728. ptype << "\t*/\n";
  1729. ptype << "\thandle:\n";
  1730. break;
  1731. case TT_OFFER:
  1732. case TT_NOTICE:
  1733. default:
  1734. ptype << "\thandle:\n";
  1735. ptype << "\t*/\n";
  1736. ptype << "\tobserve:\n";
  1737. break;
  1738. }
  1739. ptype << "\t\t";
  1740. switch (tt_message_scope(msg)) {
  1741. case TT_FILE:
  1742. ptype << "file ";
  1743. break;
  1744. case TT_FILE_IN_SESSION:
  1745. case TT_BOTH:
  1746. case TT_SESSION:
  1747. default:
  1748. ptype << "session ";
  1749. break;
  1750. }
  1751. char *op = tt_message_op( msg );
  1752. ptype << op << "(\n";
  1753. tt_free( op );
  1754. int args = tt_message_args_count( msg );
  1755. if (tt_is_err( tt_int_error( args ))) {
  1756. args = 0;
  1757. }
  1758. for (int arg = 0; arg < args; arg++) {
  1759. ptype << "\t\t\t\t";
  1760. switch (tt_message_arg_mode( msg, arg )) {
  1761. case TT_IN: ptype << "in "; break;
  1762. case TT_OUT: ptype << "out "; break;
  1763. default:
  1764. case TT_INOUT: ptype << "inout"; break;
  1765. }
  1766. char *vtype = tt_message_arg_type( msg, arg );
  1767. ptype << " " << vtype << "\targ" << arg;
  1768. if (arg < args - 1) {
  1769. ptype << ",";
  1770. }
  1771. ptype << "\n";
  1772. }
  1773. ptype << "\t\t\t) => start opnum=1;\n";
  1774. ptype << "};\n";
  1775. // XXX contexts
  1776. // XtVaSetValues( instance->messageText, XmNvalue, ptype.str().c_str(), 0 );
  1777. _DtOpen( instance->messageFooterLabel, (void *)ptype.str().c_str(),
  1778. ptype.str().size(), "ptype" );
  1779. /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
  1780. }
  1781. void
  1782. sessionSet(
  1783. Widget widget,
  1784. XtPointer clientData,
  1785. XtPointer callData
  1786. )
  1787. {
  1788. /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
  1789. /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
  1790. /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
  1791. DtbMessagePropsMessagePropsInfo instance =
  1792. (DtbMessagePropsMessagePropsInfo)clientData;
  1793. Tt_message msg = messageProps2Msg( instance );
  1794. if ((msg == 0) || _DtTtMessageUpdating( msg )) {
  1795. return;
  1796. }
  1797. _DtSessionChooserSet( _DtSessionChooseMessage, msg );
  1798. /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
  1799. }
  1800. void
  1801. msgFileSet(
  1802. Widget widget,
  1803. XtPointer clientData,
  1804. XtPointer callData
  1805. )
  1806. {
  1807. /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
  1808. /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
  1809. /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
  1810. DtbMessagePropsMessagePropsInfo instance =
  1811. (DtbMessagePropsMessagePropsInfo)clientData;
  1812. Tt_message msg = messageProps2Msg( instance );
  1813. if ((msg == 0) || _DtTtMessageUpdating( msg )) {
  1814. return;
  1815. }
  1816. _DtFileChooserSet( _DtFileChooseMessageSet, msg );
  1817. /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
  1818. }
  1819. void
  1820. msgArgAdd(
  1821. Widget widget,
  1822. XtPointer clientData,
  1823. XtPointer callData
  1824. )
  1825. {
  1826. /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
  1827. /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
  1828. /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
  1829. DtbMessagePropsMessagePropsInfo instance =
  1830. (DtbMessagePropsMessagePropsInfo)clientData;
  1831. Tt_message msg = messageProps2Msg( instance );
  1832. if ((msg == 0) || _DtTtMessageUpdating( msg )) {
  1833. return;
  1834. }
  1835. _DtArgChooserSet( _DtArgChooseMessageArgAdd, msg );
  1836. /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
  1837. }
  1838. void
  1839. msgContextSet(
  1840. Widget widget,
  1841. XtPointer clientData,
  1842. XtPointer callData
  1843. )
  1844. {
  1845. /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
  1846. /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
  1847. /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
  1848. DtbMessagePropsMessagePropsInfo instance =
  1849. (DtbMessagePropsMessagePropsInfo)clientData;
  1850. Tt_message msg = messageProps2Msg( instance );
  1851. if ((msg == 0) || _DtTtMessageUpdating( msg )) {
  1852. return;
  1853. }
  1854. _DtArgChooserSet( _DtArgChooseMessageContextSet, msg );
  1855. /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
  1856. }
  1857. void
  1858. setArg(
  1859. Widget widget,
  1860. XtPointer clientData,
  1861. XtPointer callData
  1862. )
  1863. {
  1864. /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
  1865. /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
  1866. /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
  1867. DtbMessagePropsMessagePropsInfo instance =
  1868. (DtbMessagePropsMessagePropsInfo)clientData;
  1869. Tt_message msg = messageProps2Msg( instance );
  1870. if ((msg == 0) || _DtTtMessageUpdating( msg )) {
  1871. return;
  1872. }
  1873. int arg;
  1874. MessagePropsSetArgButtonMenuItems items =
  1875. &instance->setArgButton_setArgButton_menu_items;
  1876. if (widget == items->Arg_0_item) {
  1877. arg = 0;
  1878. } else if (widget == items->Arg_1_item) {
  1879. arg = 1;
  1880. } else if (widget == items->Arg_2_item) {
  1881. arg = 2;
  1882. } else if (widget == items->Arg_3_item) {
  1883. arg = 3;
  1884. } else if (widget == items->Arg_4_item) {
  1885. arg = 4;
  1886. } else if (widget == items->Arg_5_item) {
  1887. arg = 5;
  1888. } else if (widget == items->Arg_6_item) {
  1889. arg = 6;
  1890. } else if (widget == items->Arg_7_item) {
  1891. arg = 7;
  1892. } else if (widget == items->Arg_8_item) {
  1893. arg = 8;
  1894. } else if (widget == items->Arg_9_item) {
  1895. arg = 9;
  1896. } else if (widget == items->Arg_10_item) {
  1897. arg = 10;
  1898. } else if (widget == items->Arg_11_item) {
  1899. arg = 11;
  1900. } else if (widget == items->Arg_12_item) {
  1901. arg = 12;
  1902. } else if (widget == items->Arg_13_item) {
  1903. arg = 13;
  1904. } else if (widget == items->Arg_14_item) {
  1905. arg = 14;
  1906. } else if (widget == items->Arg_15_item) {
  1907. arg = 15;
  1908. } else if (widget == items->Arg_15_item2) {
  1909. _DtStringChooserSet( _DtStringChooseMessageArgValSet, msg,
  1910. "16" );
  1911. return;
  1912. } else {
  1913. return;
  1914. }
  1915. Tt_mode mode = tt_message_arg_mode( msg, arg );
  1916. char *vtype = tt_message_arg_type( msg, arg );
  1917. if (tt_is_err( tt_ptr_error( vtype ))) {
  1918. vtype = 0;
  1919. }
  1920. char *val = 0;
  1921. int ival = 0;
  1922. Boolean noValue = False;
  1923. Tt_status status = tt_message_arg_ival( msg, arg, &ival );
  1924. if (status == TT_ERR_NUM) {
  1925. val = tt_message_arg_val( msg, arg );
  1926. if (tt_is_err( tt_ptr_error( val ))) {
  1927. val = 0;
  1928. }
  1929. if (val == 0) {
  1930. noValue = True;
  1931. }
  1932. }
  1933. _DtArgChooserSet( _DtArgChooseMessageArgSet, msg, arg, mode, noValue,
  1934. vtype, val, ival );
  1935. /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
  1936. }
  1937. void
  1938. setDISCARD(
  1939. Widget widget,
  1940. XtPointer clientData,
  1941. XtPointer callData
  1942. )
  1943. {
  1944. /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
  1945. /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
  1946. /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
  1947. DtbMessagePropsMessagePropsInfo instance =
  1948. (DtbMessagePropsMessagePropsInfo)clientData;
  1949. _DtTtMessageDispositionSet( instance, TT_DISCARD );
  1950. /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
  1951. }
  1952. void
  1953. setQUEUE(
  1954. Widget widget,
  1955. XtPointer clientData,
  1956. XtPointer callData
  1957. )
  1958. {
  1959. /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
  1960. /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
  1961. /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
  1962. DtbMessagePropsMessagePropsInfo instance =
  1963. (DtbMessagePropsMessagePropsInfo)clientData;
  1964. _DtTtMessageDispositionSet( instance, TT_QUEUE );
  1965. /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
  1966. }
  1967. void
  1968. setSTART(
  1969. Widget widget,
  1970. XtPointer clientData,
  1971. XtPointer callData
  1972. )
  1973. {
  1974. /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
  1975. /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
  1976. /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
  1977. DtbMessagePropsMessagePropsInfo instance =
  1978. (DtbMessagePropsMessagePropsInfo)clientData;
  1979. _DtTtMessageDispositionSet( instance, TT_START );
  1980. /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
  1981. }
  1982. void
  1983. setQUEUESTART(
  1984. Widget widget,
  1985. XtPointer clientData,
  1986. XtPointer callData
  1987. )
  1988. {
  1989. /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
  1990. /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
  1991. /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
  1992. DtbMessagePropsMessagePropsInfo instance =
  1993. (DtbMessagePropsMessagePropsInfo)clientData;
  1994. _DtTtMessageDispositionSet( instance, (Tt_disposition)(TT_QUEUE+TT_START));
  1995. /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
  1996. }
  1997. void
  1998. msgSetObject(
  1999. Widget widget,
  2000. XtPointer clientData,
  2001. XtPointer callData
  2002. )
  2003. {
  2004. /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
  2005. /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
  2006. /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
  2007. DtbMessagePropsMessagePropsInfo instance =
  2008. (DtbMessagePropsMessagePropsInfo)clientData;
  2009. Tt_message msg = messageProps2Msg( instance );
  2010. if ((msg == 0) || _DtTtMessageUpdating( msg )) {
  2011. return;
  2012. }
  2013. _DtStringChooserSet( _DtStringChooseMessageObject, msg,
  2014. tt_message_object( msg ));
  2015. /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
  2016. }
  2017. void
  2018. msgSetOtype(
  2019. Widget widget,
  2020. XtPointer clientData,
  2021. XtPointer callData
  2022. )
  2023. {
  2024. /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
  2025. /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
  2026. /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
  2027. DtbMessagePropsMessagePropsInfo instance =
  2028. (DtbMessagePropsMessagePropsInfo)clientData;
  2029. Tt_message msg = messageProps2Msg( instance );
  2030. if ((msg == 0) || _DtTtMessageUpdating( msg )) {
  2031. return;
  2032. }
  2033. _DtStringChooserSet( _DtStringChooseMessageOtype, msg,
  2034. tt_message_otype( msg ));
  2035. /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
  2036. }
  2037. void
  2038. msgSetHandlerPtype(
  2039. Widget widget,
  2040. XtPointer clientData,
  2041. XtPointer callData
  2042. )
  2043. {
  2044. /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
  2045. /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
  2046. /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
  2047. DtbMessagePropsMessagePropsInfo instance =
  2048. (DtbMessagePropsMessagePropsInfo)clientData;
  2049. Tt_message msg = messageProps2Msg( instance );
  2050. if ((msg == 0) || _DtTtMessageUpdating( msg )) {
  2051. return;
  2052. }
  2053. _DtStringChooserSet( _DtStringChooseMessageHandlerPtype, msg,
  2054. tt_message_handler_ptype( msg ));
  2055. /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
  2056. }
  2057. void
  2058. msgSetSenderPtype(
  2059. Widget widget,
  2060. XtPointer clientData,
  2061. XtPointer callData
  2062. )
  2063. {
  2064. /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
  2065. /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
  2066. /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
  2067. DtbMessagePropsMessagePropsInfo instance =
  2068. (DtbMessagePropsMessagePropsInfo)clientData;
  2069. Tt_message msg = messageProps2Msg( instance );
  2070. if ((msg == 0) || _DtTtMessageUpdating( msg )) {
  2071. return;
  2072. }
  2073. _DtStringChooserSet( _DtStringChooseMessageSenderPtype, msg,
  2074. tt_message_sender_ptype( msg ));
  2075. /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
  2076. }
  2077. void
  2078. chooseOp(
  2079. Widget widget,
  2080. XtPointer clientData,
  2081. XtPointer callData
  2082. )
  2083. {
  2084. /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
  2085. /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
  2086. /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
  2087. DtbMessagePropsMessagePropsInfo instance =
  2088. (DtbMessagePropsMessagePropsInfo)clientData;
  2089. Tt_message msg = messageProps2Msg( instance );
  2090. if ((msg == 0) || _DtTtMessageUpdating( msg )) {
  2091. return;
  2092. }
  2093. _DtTtChooserSet( _DtTtChooserMessageOpSet, msg );
  2094. /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
  2095. }
  2096. void
  2097. addCallback(
  2098. Widget widget,
  2099. XtPointer clientData,
  2100. XtPointer callData
  2101. )
  2102. {
  2103. /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
  2104. /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
  2105. /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
  2106. DtbMessagePropsMessagePropsInfo instance =
  2107. (DtbMessagePropsMessagePropsInfo)clientData;
  2108. Tt_message msg = messageProps2Msg( instance );
  2109. if ((msg == 0) || _DtTtMessageUpdating( msg )) {
  2110. return;
  2111. }
  2112. _DtTtMsgCbChooserSet( msg );
  2113. /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
  2114. }
  2115. void
  2116. chooseHandler(
  2117. Widget widget,
  2118. XtPointer clientData,
  2119. XtPointer callData
  2120. )
  2121. {
  2122. /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
  2123. /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
  2124. /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
  2125. DtbMessagePropsMessagePropsInfo instance =
  2126. (DtbMessagePropsMessagePropsInfo)clientData;
  2127. Tt_message msg = messageProps2Msg( instance );
  2128. if ((msg == 0) || _DtTtMessageUpdating( msg )) {
  2129. return;
  2130. }
  2131. _DtStringChooserSet( _DtStringChooseMessageStatusString, msg,
  2132. tt_message_status_string( msg ));
  2133. /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
  2134. }
  2135. void
  2136. msgSetStatusString(
  2137. Widget widget,
  2138. XtPointer clientData,
  2139. XtPointer callData
  2140. )
  2141. {
  2142. /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
  2143. /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
  2144. /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
  2145. DtbMessagePropsMessagePropsInfo instance =
  2146. (DtbMessagePropsMessagePropsInfo)clientData;
  2147. Tt_message msg = messageProps2Msg( instance );
  2148. if ((msg == 0) || _DtTtMessageUpdating( msg )) {
  2149. return;
  2150. }
  2151. _DtStringChooserSet( _DtStringChooseMessageStatusString, msg,
  2152. tt_message_object( msg ));
  2153. /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
  2154. }
  2155. /**************************************************************************
  2156. *** DTB_USER_CODE_START
  2157. ***
  2158. *** All automatically-generated data and functions have been defined.
  2159. ***
  2160. *** Add new functions here, or at the top of the file.
  2161. ***/
  2162. /*** DTB_USER_CODE_END
  2163. ***
  2164. *** End of user code section
  2165. ***
  2166. **************************************************************************/