ttChooser_stubs.C.src 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673
  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: ttChooser_stubs.C.src /main/3 1995/11/06 17:14:10 rswiston $
  7. /*** DTB_USER_CODE_END ^^^ Add file header above ^^^ ***/
  8. /*
  9. * File: ttChooser_stubs.c
  10. * Contains: Module callbacks and connection functions
  11. *
  12. * This file was generated by dtcodegen, from module ttChooser
  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 "ttChooser_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 <stdio.h>
  39. #include <sstream>
  40. #include <Xm/TextF.h>
  41. #include <Xm/List.h>
  42. #include "DtTt.h"
  43. void
  44. _DtTtChooserSet(
  45. _DtTtChooserAction choice,
  46. void * entity
  47. )
  48. {
  49. DtbTtChooserChooserInfo instance = &dtb_tt_chooser_chooser;
  50. if (! instance->initialized) {
  51. dtb_tt_chooser_chooser_initialize(
  52. instance, dtb_ttsnoop_ttsnoop_win.ttsnoopWin );
  53. }
  54. char *okString;
  55. char *title;
  56. char *valueLabel;
  57. char *valuesLabel;
  58. switch (choice) {
  59. case _DtTtChooserNone:
  60. return;
  61. case _DtTtChooserMessageOpen:
  62. okString = "Open";
  63. title = "Open Tt_message";
  64. break;
  65. case _DtTtChooserMessageCreateStandard:
  66. okString = "Create";
  67. title = "Create Standard Tt_message";
  68. break;
  69. case _DtTtChooserMessageOpSet:
  70. okString = "Set";
  71. title = "tt_message_op_set";
  72. break;
  73. case _DtTtChooserMessageHandlerSet:
  74. okString = "Set";
  75. title = "tt_message_handler_set";
  76. break;
  77. case _DtTtChooserMessageDestroy:
  78. okString = "Destroy";
  79. title = "tt_message_destroy";
  80. break;
  81. case _DtTtChooserPatternOpen:
  82. okString = "Open";
  83. title = "Open Tt_pattern";
  84. break;
  85. case _DtTtChooserPatternOpAdd:
  86. okString = "Add";
  87. title = "tt_pattern_op_add";
  88. break;
  89. case _DtTtChooserPatternSenderAdd:
  90. okString = "Add";
  91. title = "tt_pattern_sender_add";
  92. break;
  93. case _DtTtChooserPatternDestroy:
  94. okString = "Destroy";
  95. title = "tt_pattern_destroy";
  96. break;
  97. case _DtTtChooserDtSessionQuit:
  98. okString = "Quit";
  99. title = "ttdt_session_quit";
  100. break;
  101. case _DtTtChooserDtFileDeleted:
  102. okString = "Send";
  103. title = "ttdt_file_event(,TTDT_DELETED)";
  104. break;
  105. case _DtTtChooserDtFileModified:
  106. okString = "Send";
  107. title = "ttdt_file_event(,TTDT_MODIFIED)";
  108. break;
  109. case _DtTtChooserDtFileReverted:
  110. okString = "Send";
  111. title = "ttdt_file_event(,TTDT_REVERTED)";
  112. break;
  113. case _DtTtChooserDtFileMoved:
  114. okString = "Send";
  115. title = "ttdt_file_event(,TTDT_MOVED)";
  116. break;
  117. case _DtTtChooserDtFileSaved:
  118. okString = "Send";
  119. title = "ttdt_file_event(,TTDT_SAVED)";
  120. break;
  121. case _DtTtChooserDtFileQuit:
  122. okString = "Quit";
  123. title = "ttdt_file_quit";
  124. break;
  125. case _DtTtChooserProcidSetDefault:
  126. okString = "Set";
  127. title = "tt_default_procid_set";
  128. break;
  129. case _DtTtChooserProcidSuspend:
  130. okString = "Remove";
  131. title = "XtRemoveInput";
  132. break;
  133. case _DtTtChooserProcidResume:
  134. okString = "Add";
  135. title = "XtAppAddInput";
  136. break;
  137. case _DtTtChooserDtProcidClose:
  138. okString = "Close";
  139. title = "ttdt_close";
  140. break;
  141. }
  142. DtTtType type;
  143. switch (choice) {
  144. case _DtTtChooserNone:
  145. return;
  146. case _DtTtChooserMessageOpSet:
  147. case _DtTtChooserPatternOpAdd:
  148. case _DtTtChooserMessageCreateStandard:
  149. valueLabel = "Op:";
  150. valuesLabel = "Standard Op";
  151. type = DTTT_OP;
  152. break;
  153. case _DtTtChooserMessageOpen:
  154. case _DtTtChooserMessageDestroy:
  155. valueLabel = "Tt_message:";
  156. valuesLabel = "Tt_message";
  157. type = DTTT_MESSAGE;
  158. break;
  159. case _DtTtChooserPatternOpen:
  160. case _DtTtChooserPatternDestroy:
  161. valueLabel = "Tt_pattern:";
  162. valuesLabel = "Tt_pattern";
  163. type = DTTT_PATTERN;
  164. break;
  165. case _DtTtChooserDtSessionQuit:
  166. valueLabel = "Tt_pattern *:";
  167. valuesLabel = "Desktop-joined session";
  168. type = DTTT_DTSESSION;
  169. break;
  170. case _DtTtChooserDtFileDeleted:
  171. case _DtTtChooserDtFileModified:
  172. case _DtTtChooserDtFileReverted:
  173. case _DtTtChooserDtFileMoved:
  174. case _DtTtChooserDtFileSaved:
  175. case _DtTtChooserDtFileQuit:
  176. valueLabel = "Tt_pattern *:";
  177. valuesLabel = "Desktop-joined file";
  178. type = DTTT_DTFILE;
  179. break;
  180. case _DtTtChooserMessageHandlerSet:
  181. case _DtTtChooserPatternSenderAdd:
  182. case _DtTtChooserProcidSetDefault:
  183. case _DtTtChooserProcidSuspend:
  184. case _DtTtChooserProcidResume:
  185. case _DtTtChooserDtProcidClose:
  186. valueLabel = "Procid:";
  187. valuesLabel = "Procid";
  188. type = DTTT_PROCID;
  189. break;
  190. }
  191. DtTtSetLabel( instance->chooserOkButton, okString );
  192. DtTtSetLabel( instance->chooserText_label, valueLabel );
  193. int itemCount;
  194. XmString *items = _DtTtChoices( type, &itemCount );
  195. XtVaSetValues( instance->chooserList,
  196. XmNitemCount, itemCount,
  197. XmNitems, items,
  198. NULL );
  199. XmListDeselectAllItems( instance->chooserList );
  200. XmTextFieldSetString( instance->chooserText, 0 );
  201. XtVaSetValues( instance->chooser, XmNtitle, title, NULL );
  202. std::ostringstream valuesStream;
  203. valuesStream << itemCount << " " << valuesLabel;
  204. if (itemCount != 1) valuesStream << "s";
  205. valuesStream << ends;
  206. DtTtSetLabel( instance->chooserList_label, valuesStream.str().c_str() );
  207. // Remember dialog mode, entity
  208. XtVaSetValues( instance->chooserOkButton, XmNuserData, choice, NULL );
  209. XtVaSetValues( instance->chooserCancelButton, XmNuserData, entity, NULL );
  210. XtManageChild( instance->chooser_shellform );
  211. }
  212. /*** DTB_USER_CODE_END
  213. ***
  214. *** End of user code section
  215. ***
  216. **************************************************************************/
  217. void
  218. ttChooser_chooserCancelButton_CB1(
  219. Widget widget,
  220. XtPointer clientData,
  221. XtPointer callData
  222. )
  223. {
  224. /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
  225. /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
  226. DtbTtChooserChooserInfo instance = (DtbTtChooserChooserInfo)clientData;
  227. if (!(instance->initialized))
  228. {
  229. dtb_tt_chooser_chooser_initialize(instance, dtb_ttsnoop_ttsnoop_win.ttsnoopWin);
  230. }
  231. XtUnmanageChild(instance->chooser_shellform);
  232. /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
  233. /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
  234. }
  235. void
  236. choiceSelected(
  237. Widget widget,
  238. XtPointer clientData,
  239. XtPointer callData
  240. )
  241. {
  242. /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
  243. /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
  244. /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
  245. DtbTtChooserChooserInfo instance = (DtbTtChooserChooserInfo)clientData;
  246. XmListCallbackStruct *info = (XmListCallbackStruct *)callData;
  247. int choice;
  248. XtVaGetValues( instance->chooserOkButton, XmNuserData, &choice, NULL );
  249. DtTtType type;
  250. Boolean isString = False;
  251. switch ((_DtTtChooserAction)choice) {
  252. case _DtTtChooserNone:
  253. return;
  254. case _DtTtChooserMessageOpSet:
  255. case _DtTtChooserPatternOpAdd:
  256. case _DtTtChooserMessageCreateStandard:
  257. isString = True;
  258. type = DTTT_OP;
  259. break;
  260. case _DtTtChooserMessageOpen:
  261. case _DtTtChooserMessageDestroy:
  262. type = DTTT_MESSAGE;
  263. break;
  264. case _DtTtChooserPatternOpen:
  265. case _DtTtChooserPatternDestroy:
  266. type = DTTT_PATTERN;
  267. break;
  268. case _DtTtChooserDtSessionQuit:
  269. type = DTTT_DTSESSION;
  270. break;
  271. case _DtTtChooserDtFileDeleted:
  272. case _DtTtChooserDtFileModified:
  273. case _DtTtChooserDtFileReverted:
  274. case _DtTtChooserDtFileMoved:
  275. case _DtTtChooserDtFileSaved:
  276. case _DtTtChooserDtFileQuit:
  277. type = DTTT_DTFILE;
  278. break;
  279. case _DtTtChooserMessageHandlerSet:
  280. case _DtTtChooserPatternSenderAdd:
  281. case _DtTtChooserProcidSetDefault:
  282. case _DtTtChooserProcidSuspend:
  283. case _DtTtChooserProcidResume:
  284. case _DtTtChooserDtProcidClose:
  285. isString = True;
  286. type = DTTT_PROCID;
  287. break;
  288. }
  289. void *entity = DtTtNth( type, info->item_position - 1 );
  290. std::ostringstream entityName;
  291. if (isString) {
  292. entityName << (char *)entity << ends;
  293. } else {
  294. entityName << entity << ends;
  295. }
  296. XmTextFieldSetString( instance->chooserText, const_cast<char *>(entityName.str().c_str()) );
  297. /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
  298. }
  299. void
  300. choiceOkayed(
  301. Widget widget,
  302. XtPointer clientData,
  303. XtPointer callData
  304. )
  305. {
  306. /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
  307. /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
  308. /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
  309. DtbTtChooserChooserInfo instance = (DtbTtChooserChooserInfo)clientData;
  310. char *text = XmTextFieldGetString( instance->chooserText );
  311. int ival;
  312. XtVaGetValues( instance->chooserOkButton, XmNuserData, &ival, NULL );
  313. _DtTtChooserAction choice = (_DtTtChooserAction)ival;
  314. Widget label = dtb_ttsnoop_ttsnoop_win.ttsnoopWin_label;
  315. switch (choice) {
  316. int ival, fd;
  317. Tt_message msg;
  318. Tt_pattern pat;
  319. Tt_pattern *pats;
  320. Tt_status status;
  321. char *func, *procid;
  322. XtPointer xtPtr;
  323. XtInputId id;
  324. Widget newWidget;
  325. case _DtTtChooserNone:
  326. return;
  327. case _DtTtChooserMessageCreateStandard:
  328. msg = tttk_message_create( text );
  329. status = DtTtSetLabel( label, "tt_message_create()", msg );
  330. if (tt_is_err( status )) {
  331. break;
  332. }
  333. DtTtCreated( DTTT_MESSAGE, msg );
  334. newWidget = DtTtMessageWidgetCreate(
  335. dtb_ttsnoop_ttsnoop_win.ttsnoopWin, msg,
  336. DtTtMessageWidgetUpdate );
  337. status = tt_ptr_error( newWidget );
  338. if (tt_is_err( status )) {
  339. return;
  340. }
  341. XRaiseWindow( XtDisplay( newWidget ), XtWindow( newWidget ));
  342. XtUnmanageChild( instance->chooser_shellform );
  343. break;
  344. case _DtTtChooserMessageOpSet:
  345. XtVaGetValues( instance->chooserCancelButton,
  346. XmNuserData, &xtPtr, NULL );
  347. _DtTtMessageUpdate( (Tt_message)xtPtr, choice, text );
  348. XtUnmanageChild( instance->chooser_shellform );
  349. break;
  350. case _DtTtChooserPatternOpAdd:
  351. XtVaGetValues( instance->chooserCancelButton,
  352. XmNuserData, &xtPtr, NULL );
  353. _DtTtPatternUpdate( (Tt_pattern)xtPtr, choice, text );
  354. XtUnmanageChild( instance->chooser_shellform );
  355. break;
  356. case _DtTtChooserMessageHandlerSet:
  357. XtVaGetValues( instance->chooserCancelButton,
  358. XmNuserData, &xtPtr, NULL );
  359. _DtTtMessageUpdate( (Tt_message)xtPtr, choice, text );
  360. XtUnmanageChild( instance->chooser_shellform );
  361. break;
  362. case _DtTtChooserPatternSenderAdd:
  363. XtVaGetValues( instance->chooserCancelButton,
  364. XmNuserData, &xtPtr, NULL );
  365. _DtTtPatternUpdate( (Tt_pattern)xtPtr, choice, text );
  366. XtUnmanageChild( instance->chooser_shellform );
  367. break;
  368. case _DtTtChooserMessageOpen:
  369. case _DtTtChooserMessageDestroy:
  370. if (text == 0) {
  371. return;
  372. }
  373. ival = 0;
  374. sscanf( text, "%i", &ival );
  375. msg = (Tt_message) (intptr_t) ival;
  376. if (DtTtIndex( DTTT_MESSAGE, msg ) < 0) {
  377. return;
  378. }
  379. if (choice == _DtTtChooserMessageOpen) {
  380. Widget newWidget = DtTtMessageWidgetCreate(
  381. dtb_ttsnoop_ttsnoop_win.ttsnoopWin,
  382. msg, DtTtMessageWidgetUpdate );
  383. Tt_status status = tt_ptr_error( newWidget );
  384. if (tt_is_err( status )) {
  385. return;
  386. }
  387. XRaiseWindow( XtDisplay( newWidget ), XtWindow( newWidget ));
  388. } else {
  389. Widget msgWidget = DtTtMessageWidget( msg );
  390. Tt_status status = tttk_message_destroy( msg );
  391. if (status == TT_WRN_STOPPED) {
  392. DtTtSetLabel( label, "tttk_message_destroy()",
  393. status );
  394. return;
  395. }
  396. DtTtDestroyed( DTTT_MESSAGE, msg );
  397. if (msgWidget != 0) {
  398. XtDestroyWidget( msgWidget );
  399. }
  400. _DtTtChooserSet( _DtTtChooserMessageDestroy );
  401. }
  402. break;
  403. case _DtTtChooserPatternOpen:
  404. case _DtTtChooserPatternDestroy:
  405. if (text == 0) {
  406. return;
  407. }
  408. ival = 0;
  409. sscanf( text, "%i", &ival );
  410. pat = (Tt_pattern) (intptr_t) ival;
  411. if (DtTtIndex( DTTT_PATTERN, pat ) < 0) {
  412. return;
  413. }
  414. if (choice == _DtTtChooserPatternOpen) {
  415. Widget newWidget = DtTtPatternWidgetCreate(
  416. dtb_ttsnoop_ttsnoop_win.ttsnoopWin,
  417. pat, 0 );
  418. Tt_status status = tt_ptr_error( newWidget );
  419. if (tt_is_err( status )) {
  420. return;
  421. }
  422. XRaiseWindow( XtDisplay( newWidget ), XtWindow( newWidget ));
  423. } else {
  424. Widget patWidget = DtTtPatternWidget( pat );
  425. Tt_status status = tt_pattern_destroy( pat );
  426. if (status == TT_WRN_STOPPED) {
  427. DtTtSetLabel( label, "tt_pattern_destroy()",
  428. status );
  429. return;
  430. }
  431. DtTtDestroyed( DTTT_PATTERN, pat );
  432. if (patWidget != 0) {
  433. XtDestroyWidget( patWidget );
  434. }
  435. _DtTtChooserSet( _DtTtChooserPatternDestroy );
  436. }
  437. break;
  438. case _DtTtChooserDtSessionQuit:
  439. if (text == 0) {
  440. return;
  441. }
  442. ival = 0;
  443. sscanf( text, "%i", &ival );
  444. pats = (Tt_pattern *) (intptr_t) ival;
  445. if (DtTtIndex( DTTT_DTSESSION, pats ) < 0) {
  446. return;
  447. }
  448. text = (char *)tt_pattern_user( *pats, _DtTtPatsNameKey );
  449. if (tt_is_err( tt_ptr_error( text )) || text == 0) {
  450. return;
  451. }
  452. status = ttdt_session_quit( text, pats, 1 );
  453. DtTtSetLabel( label, "ttdt_session_quit()", status );
  454. if (status == TT_OK) {
  455. DtTtDestroyed( DTTT_DTSESSION, pats );
  456. }
  457. XtUnmanageChild( instance->chooser_shellform );
  458. break;
  459. case _DtTtChooserDtFileDeleted:
  460. case _DtTtChooserDtFileModified:
  461. case _DtTtChooserDtFileReverted:
  462. case _DtTtChooserDtFileMoved:
  463. case _DtTtChooserDtFileSaved:
  464. case _DtTtChooserDtFileQuit:
  465. if (text == 0) {
  466. return;
  467. }
  468. ival = 0;
  469. sscanf( text, "%i", &ival );
  470. pats = (Tt_pattern *) (intptr_t) ival;
  471. if (DtTtIndex( DTTT_DTFILE, pats ) < 0) {
  472. return;
  473. }
  474. switch ((_DtTtChooserAction)choice) {
  475. case _DtTtChooserDtFileModified:
  476. status = ttdt_file_event( 0, TTDT_MODIFIED, pats, 1 );
  477. func = "ttdt_file_event(,TTDT_MODIFIED)";
  478. break;
  479. case _DtTtChooserDtFileReverted:
  480. status = ttdt_file_event( 0, TTDT_REVERTED, pats, 1 );
  481. func = "ttdt_file_event(,TTDT_REVERTED)";
  482. break;
  483. case _DtTtChooserDtFileSaved:
  484. status = ttdt_file_event( 0, TTDT_SAVED, pats, 1 );
  485. func = "ttdt_file_event(,TTDT_SAVED)";
  486. break;
  487. case _DtTtChooserDtFileQuit:
  488. status = ttdt_file_quit( pats, 1 );
  489. func = "ttdt_file_quit()";
  490. if (status == TT_OK) {
  491. DtTtDestroyed( DTTT_DTFILE, pats );
  492. }
  493. break;
  494. }
  495. DtTtSetLabel( label, func, status );
  496. XtUnmanageChild( instance->chooser_shellform );
  497. case _DtTtChooserProcidSetDefault:
  498. status = tt_default_procid_set( text );
  499. DtTtSetLabel( label, "tt_default_procid_set()", status );
  500. XtUnmanageChild( instance->chooser_shellform );
  501. break;
  502. case _DtTtChooserProcidSuspend:
  503. ival = DtTtIndex( DTTT_PROCID, text );
  504. if (ival < 0) {
  505. return;
  506. }
  507. id = (XtInputId)DtTtNthClientDatum( DTTT_PROCID, ival );
  508. if (id != 0) {
  509. XtRemoveInput( id );
  510. DtTtSetLabel( label, "XtRemoveInput()" );
  511. }
  512. XtUnmanageChild( instance->chooser_shellform );
  513. break;
  514. case _DtTtChooserProcidResume:
  515. ival = DtTtIndex( DTTT_PROCID, text );
  516. if (ival < 0) {
  517. return;
  518. }
  519. fd = tt_procid_fd( text );
  520. if (tt_is_err( tt_int_error( fd ))) {
  521. return;
  522. }
  523. id = XtAppAddInput( XtWidgetToApplicationContext( label ),
  524. fd, (XtPointer)XtInputReadMask,
  525. tttk_Xt_input_handler, text );
  526. DtTtSetLabel( label, "XtAppAddInput()", (int)id );
  527. if (id != 0) {
  528. DtTtNthClientDatumSet( DTTT_PROCID, ival, (void *)id );
  529. }
  530. XtUnmanageChild( instance->chooser_shellform );
  531. break;
  532. case _DtTtChooserDtProcidClose:
  533. status = ttdt_close( text, 0, 1 );
  534. DtTtSetLabel( label, "ttdt_close()", status );
  535. ival = DtTtIndex( DTTT_PROCID, text );
  536. if (ival < 0) {
  537. return;
  538. }
  539. id = (XtInputId)DtTtNthClientDatum( DTTT_PROCID, ival );
  540. if (id != 0) {
  541. XtRemoveInput( id );
  542. }
  543. DtTtDestroyed( DTTT_PROCID, text );
  544. XtUnmanageChild( instance->chooser_shellform );
  545. break;
  546. }
  547. /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
  548. }
  549. void
  550. ttChooserHelp(
  551. Widget widget,
  552. XtPointer clientData,
  553. XtPointer callData
  554. )
  555. {
  556. /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
  557. /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
  558. /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
  559. DtbTtChooserChooserInfo instance = (DtbTtChooserChooserInfo)clientData;
  560. int ival;
  561. XtVaGetValues( instance->chooserOkButton, XmNuserData, &ival, NULL );
  562. _DtTtChooserAction choice = (_DtTtChooserAction)ival;
  563. Widget label = dtb_ttsnoop_ttsnoop_win.ttsnoopWin_label;
  564. switch (choice) {
  565. char *op;
  566. case _DtTtChooserNone:
  567. return;
  568. case _DtTtChooserMessageOpSet:
  569. case _DtTtChooserMessageCreateStandard:
  570. case _DtTtChooserPatternOpAdd:
  571. op = XmTextFieldGetString( instance->chooserText );
  572. if (op != 0) {
  573. _DtMan( label, op );
  574. }
  575. if (choice == _DtTtChooserMessageOpSet) {
  576. _DtMan( label, "tt_message_op_set" );
  577. } else {
  578. _DtMan( label, "tt_pattern_op_add" );
  579. }
  580. break;
  581. case _DtTtChooserMessageOpen:
  582. _DtMan( label, "tt_message_print" );
  583. break;
  584. case _DtTtChooserMessageHandlerSet:
  585. _DtMan( label, "tt_message_handler_set" );
  586. break;
  587. case _DtTtChooserMessageDestroy:
  588. _DtMan( label, "tt_message_destroy" );
  589. break;
  590. case _DtTtChooserPatternOpen:
  591. _DtMan( label, "tt_pattern_print" );
  592. break;
  593. case _DtTtChooserPatternSenderAdd:
  594. _DtMan( label, "tt_pattern_sender_add" );
  595. break;
  596. case _DtTtChooserPatternDestroy:
  597. _DtMan( label, "tt_pattern_destroy" );
  598. break;
  599. case _DtTtChooserDtSessionQuit:
  600. _DtMan( label, "ttdt_session_quit" );
  601. break;
  602. case _DtTtChooserDtFileDeleted:
  603. case _DtTtChooserDtFileModified:
  604. case _DtTtChooserDtFileReverted:
  605. case _DtTtChooserDtFileMoved:
  606. case _DtTtChooserDtFileSaved:
  607. _DtMan( label, "ttdt_file_event" );
  608. break;
  609. case _DtTtChooserDtFileQuit:
  610. _DtMan( label, "ttdt_file_quit" );
  611. break;
  612. case _DtTtChooserProcidSetDefault:
  613. _DtMan( label, "tt_default_procid_set" );
  614. break;
  615. case _DtTtChooserProcidSuspend:
  616. _DtMan( label, "XtRemoveInput" );
  617. break;
  618. case _DtTtChooserProcidResume:
  619. _DtMan( label, "XtAppAddInput" );
  620. break;
  621. case _DtTtChooserDtProcidClose:
  622. _DtMan( label, "ttdt_close" );
  623. break;
  624. }
  625. /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
  626. }
  627. /**************************************************************************
  628. *** DTB_USER_CODE_START
  629. ***
  630. *** All automatically-generated data and functions have been defined.
  631. ***
  632. *** Add new functions here, or at the top of the file.
  633. ***/
  634. /*** DTB_USER_CODE_END
  635. ***
  636. *** End of user code section
  637. ***
  638. **************************************************************************/