Fix warnings on FreeBSD
[oweals/cde.git] / cde / programs / ttsnoop / callbackChooser_stubs.C.src
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: callbackChooser_stubs.C.src /main/3 1995/11/06 17:12:25 rswiston $
7 /*** DTB_USER_CODE_END   ^^^ Add file header above ^^^ ***/
8
9 /*
10  * File: callbackChooser_stubs.c
11  * Contains: Module callbacks and connection functions
12  *
13  * This file was generated by dtcodegen, from module callbackChooser
14  *
15  * Any text may be added between the DTB_USER_CODE_START and
16  * DTB_USER_CODE_END comments (even non-C code). Descriptive comments
17  * are provided only as an aid.
18  *
19  *  ** EDIT ONLY WITHIN SECTIONS MARKED WITH DTB_USER_CODE COMMENTS.  **
20  *  ** ALL OTHER MODIFICATIONS WILL BE OVERWRITTEN. DO NOT MODIFY OR  **
21  *  ** DELETE THE GENERATED COMMENTS!                                 **
22  */
23
24 #include <stdlib.h>
25 #include <stdio.h>
26 #include <Xm/Xm.h>
27 #include "dtb_utils.h"
28 #include "callbackChooser_ui.h"
29
30 /*
31  * Header files for cross-module connections
32  */
33 #include "ttsnoop_ui.h"
34
35
36 /**************************************************************************
37  *** DTB_USER_CODE_START
38  ***
39  *** All necessary header files have been included.
40  ***
41  *** Add include files, types, macros, externs, and user functions here.
42  ***/
43
44 #if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
45 #include <fstream>
46 #include <strstream>
47 #else
48 #include <fstream.h>
49 #include <strstream.h>
50 #endif
51
52 #include "DtTt.h"
53
54 extern std::ofstream snoopStream;
55
56 typedef enum {
57         DoJustPrint,
58         DoReply,
59         DoFail,
60         DoReject,
61         DoAccept,
62         DoAbstain,
63         DoOpen
64 } What2Do;
65
66 static void
67 _DtTtMsgCbChooserSet(
68         void *entity,
69         int isMessage,
70         const char *title
71 )
72 {
73         DtbCallbackChooserCallbackChooserInfo instance =
74                 &dtb_callback_chooser_callback_chooser;
75         if (! instance->initialized) {
76                 dtb_callback_chooser_callback_chooser_initialize(
77                         instance, dtb_ttsnoop_ttsnoop_win.ttsnoopWin );
78         }
79         XtVaSetValues( instance->callbackChooser, XmNtitle, title, NULL );
80         XtPointer xtPtr = (XtPointer) (intptr_t) isMessage;
81         XtVaSetValues( instance->callbackAddButton, XmNuserData, xtPtr, NULL );
82         XtVaSetValues( instance->callbackAddCancelButton,
83                        XmNuserData, entity, NULL );
84         XtManageChild( instance->callbackChooser_shellform );
85 }
86
87 void
88 _DtTtMsgCbChooserSet(
89         Tt_pattern pat
90 )
91 {
92         _DtTtMsgCbChooserSet( pat, 0, "tt_pattern_callback_add" );
93 }
94
95 void
96 _DtTtMsgCbChooserSet(
97         Tt_message msg
98 )
99 {
100         _DtTtMsgCbChooserSet( msg, 1, "tt_message_callback_add" );
101 }
102
103 static Tt_callback_action
104 openIt(
105         Tt_message msg,
106         Tt_pattern pat
107 )
108 {
109         DtTtCreated( DTTT_MESSAGE, msg );
110         snoopIt( "Tt_message_callback", (void *) openIt, msg, pat, True );
111         Widget newWidget = DtTtMessageWidgetCreate(
112                             dtb_ttsnoop_ttsnoop_win.ttsnoopWin,
113                             msg, DtTtMessageWidgetUpdate );
114         if (! tt_is_err( tt_ptr_error( newWidget ) )) {
115                 XRaiseWindow( XtDisplay( newWidget ),
116                               XtWindow( newWidget ));
117         }
118         return TT_CALLBACK_PROCESSED;
119 }
120
121 static Tt_callback_action
122 ucb(
123         Tt_message msg,
124         Tt_pattern pat,
125         Tt_message_callback func,
126         What2Do action,
127         Boolean destroy,
128         Boolean cont
129 )
130 {
131         DtTtCreated( DTTT_MESSAGE, msg );
132         if (snoopStream.bad()) {
133                 return TT_CALLBACK_CONTINUE;
134         }
135         snoopStream << "(Tt_message_callback)" << func << "( ";
136         snoopStream << "(Tt_message)" << (void *)msg << ", ";
137         snoopStream << "(Tt_pattern)" << (void *)pat << " ): ";
138         char *msgString = tt_message_print( msg );
139         Tt_status status = tt_ptr_error( msgString );
140         if (status == TT_OK) {
141                 snoopStream << endl << msgString << endl;
142         } else {
143                 snoopStream << status << endl;
144         }
145         tt_free( msgString );
146         Tt_status (*actionFunc)(Tt_message) = 0;
147         char *actionFuncName = 0;
148         switch (action) {
149             default:
150             case DoJustPrint:
151                 break;
152             case DoReply:
153                 actionFunc = tt_message_reply;
154                 actionFuncName = "tt_message_reply";
155                 break;
156             case DoFail:
157                 actionFunc = tt_message_fail;
158                 actionFuncName = "tt_message_fail";
159                 break;
160             case DoReject:
161                 actionFunc = tt_message_reject;
162                 actionFuncName = "tt_message_reject";
163                 break;
164             case DoAccept:
165                 actionFunc = tt_message_accept;
166                 actionFuncName = "tt_message_accept";
167                 break;
168             case DoAbstain:
169                 destroy = 1;
170                 break;
171         }
172         if (actionFunc != 0) {
173                 snoopStream << func << "(): " << actionFuncName << "("
174                         << msg << ") = "
175                         << (*actionFunc)( msg ) << endl;
176         }
177         if (destroy) {
178                 status = tttk_message_destroy( msg );
179                 snoopStream << func << "(): tttk_message_destroy("
180                         << msg << ") = " << status << endl;
181                 if (status == TT_OK) {
182                         DtTtDestroyed( DTTT_MESSAGE, msg );
183                 }
184         }
185         Tt_callback_action val = TT_CALLBACK_PROCESSED;
186         if (cont) {
187                 val = TT_CALLBACK_CONTINUE;
188         }
189         snoopStream << func << "(): return " << val << endl;
190         return val;
191 }
192
193 static Tt_callback_action
194 mcbJustPrint_Cont( Tt_message m, Tt_pattern p ) {
195         return ucb( m, p, mcbJustPrint_Cont, DoJustPrint, 0, 0 ); }
196 static Tt_callback_action
197 mcbJustPrint_Done( Tt_message m, Tt_pattern p ) {
198         return ucb( m, p, mcbJustPrint_Done, DoJustPrint, 0, 1 ); }
199 static Tt_callback_action
200 mcbJustPrint_Destroy_Cont( Tt_message m, Tt_pattern p ) {
201         return ucb( m, p, mcbJustPrint_Destroy_Cont, DoJustPrint, 1, 0 ); }
202 static Tt_callback_action
203 mcbJustPrint_Destroy_Done( Tt_message m, Tt_pattern p ) {
204         return ucb( m, p, mcbJustPrint_Destroy_Done, DoJustPrint, 1, 1 ); }
205 static Tt_callback_action
206 mcbReply_Cont( Tt_message m, Tt_pattern p ) {
207         return ucb( m, p, mcbReply_Cont, DoReply, 0, 0 ); }
208 static Tt_callback_action
209 mcbReply_Done( Tt_message m, Tt_pattern p ) {
210         return ucb( m, p, mcbReply_Done, DoReply, 0, 1 ); }
211 static Tt_callback_action
212 mcbReply_Destroy_Cont( Tt_message m, Tt_pattern p ) {
213         return ucb( m, p, mcbReply_Destroy_Cont, DoReply, 1, 0 ); }
214 static Tt_callback_action
215 mcbReply_Destroy_Done( Tt_message m, Tt_pattern p ) {
216         return ucb( m, p, mcbReply_Destroy_Done, DoReply, 1, 1 ); }
217 static Tt_callback_action
218 mcbFail_Cont( Tt_message m, Tt_pattern p ) {
219         return ucb( m, p, mcbFail_Cont, DoFail, 0, 0 ); }
220 static Tt_callback_action
221 mcbFail_Done( Tt_message m, Tt_pattern p ) {
222         return ucb( m, p, mcbFail_Done, DoFail, 0, 1 ); }
223 static Tt_callback_action
224 mcbFail_Destroy_Cont( Tt_message m, Tt_pattern p ) {
225         return ucb( m, p, mcbFail_Destroy_Cont, DoFail, 1, 0 ); }
226 static Tt_callback_action
227 mcbFail_Destroy_Done( Tt_message m, Tt_pattern p ) {
228         return ucb( m, p, mcbFail_Destroy_Done, DoFail, 1, 1 ); }
229 static Tt_callback_action
230 mcbReject_Cont( Tt_message m, Tt_pattern p ) {
231         return ucb( m, p, mcbReject_Cont, DoReject, 0, 0 ); }
232 static Tt_callback_action
233 mcbReject_Done( Tt_message m, Tt_pattern p ) {
234         return ucb( m, p, mcbReject_Done, DoReject, 0, 1 ); }
235 static Tt_callback_action
236 mcbReject_Destroy_Cont( Tt_message m, Tt_pattern p ) {
237         return ucb( m, p, mcbReject_Destroy_Cont, DoReject, 1, 0 ); }
238 static Tt_callback_action
239 mcbReject_Destroy_Done( Tt_message m, Tt_pattern p ) {
240         return ucb( m, p, mcbReject_Destroy_Done, DoReject, 1, 1 ); }
241 static Tt_callback_action
242 mcbAccept_Cont( Tt_message m, Tt_pattern p ) {
243         return ucb( m, p, mcbAccept_Cont, DoAccept, 0, 0 ); }
244 static Tt_callback_action
245 mcbAccept_Done( Tt_message m, Tt_pattern p ) {
246         return ucb( m, p, mcbAccept_Done, DoAccept, 0, 1 ); }
247 static Tt_callback_action
248 mcbAccept_Destroy_Cont( Tt_message m, Tt_pattern p ) {
249         return ucb( m, p, mcbAccept_Destroy_Cont, DoAccept, 1, 0 ); }
250 static Tt_callback_action
251 mcbAccept_Destroy_Done( Tt_message m, Tt_pattern p ) {
252         return ucb( m, p, mcbAccept_Destroy_Done, DoAccept, 1, 1 ); }
253 static Tt_callback_action
254 mcbAbstain_Cont( Tt_message m, Tt_pattern p ) {
255         return ucb( m, p, mcbAbstain_Cont, DoAbstain, 0, 0 ); }
256 static Tt_callback_action
257 mcbAbstain_Done( Tt_message m, Tt_pattern p ) {
258         return ucb( m, p, mcbAbstain_Done, DoAbstain, 0, 1 ); }
259 static Tt_callback_action
260 mcbAbstain_Destroy_Cont( Tt_message m, Tt_pattern p ) {
261         return ucb( m, p, mcbAbstain_Destroy_Cont, DoAbstain, 1, 0 ); }
262 static Tt_callback_action
263 mcbAbstain_Destroy_Done( Tt_message m, Tt_pattern p ) {
264         return ucb( m, p, mcbAbstain_Destroy_Done, DoAbstain, 1, 1 ); }
265
266 Tt_message_callback callbacks[] = 
267 {
268         mcbJustPrint_Cont,
269         mcbJustPrint_Done,
270         mcbJustPrint_Destroy_Cont,
271         mcbJustPrint_Destroy_Done,
272         mcbReply_Cont,
273         mcbReply_Done,
274         mcbReply_Destroy_Cont,
275         mcbReply_Destroy_Done,
276         mcbFail_Cont,
277         mcbFail_Done,
278         mcbFail_Destroy_Cont,
279         mcbFail_Destroy_Done,
280         mcbReject_Cont,
281         mcbReject_Done,
282         mcbReject_Destroy_Cont,
283         mcbReject_Destroy_Done,
284         mcbAccept_Cont,
285         mcbAccept_Done,
286         mcbAccept_Destroy_Cont,
287         mcbAccept_Destroy_Done,
288         mcbAbstain_Cont,
289         mcbAbstain_Done,
290         mcbAbstain_Destroy_Cont,
291         mcbAbstain_Destroy_Done
292 };
293
294 /*** DTB_USER_CODE_END
295  ***
296  *** End of user code section
297  ***
298  **************************************************************************/
299
300
301
302 void 
303 callbackChooser_callbackAddCancelButton_CB1(
304     Widget widget,
305     XtPointer clientData,
306     XtPointer callData
307 )
308 {
309     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
310     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
311     
312     DtbCallbackChooserCallbackChooserInfo       instance = (DtbCallbackChooserCallbackChooserInfo)clientData;
313     
314     if (!(instance->initialized))
315     {
316         dtb_callback_chooser_callback_chooser_initialize(instance, dtb_ttsnoop_ttsnoop_win.ttsnoopWin);
317     }
318     XtUnmanageChild(instance->callbackChooser_shellform);
319     
320     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
321     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
322 }
323
324
325 void 
326 callbackChooser_msgActionChoice_Open_item_CB1(
327     Widget widget,
328     XtPointer clientData,
329     XtPointer callData
330 )
331 {
332     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
333     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
334     
335     DtbCallbackChooserCallbackChooserInfo       instance = (DtbCallbackChooserCallbackChooserInfo)clientData;
336     
337     if (!(instance->initialized))
338     {
339         dtb_callback_chooser_callback_chooser_initialize(instance, dtb_ttsnoop_ttsnoop_win.ttsnoopWin);
340     }
341
342     XtSetSensitive(instance->msgDestroyChoice, False);
343     
344     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
345     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
346 }
347
348
349 void 
350 callbackChooser_msgActionChoice_Open_item_CB2(
351     Widget widget,
352     XtPointer clientData,
353     XtPointer callData
354 )
355 {
356     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
357     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
358     
359     DtbCallbackChooserCallbackChooserInfo       instance = (DtbCallbackChooserCallbackChooserInfo)clientData;
360     
361     if (!(instance->initialized))
362     {
363         dtb_callback_chooser_callback_chooser_initialize(instance, dtb_ttsnoop_ttsnoop_win.ttsnoopWin);
364     }
365
366     XtSetSensitive(instance->msgReturnChoice, False);
367     
368     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
369     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
370 }
371
372
373 void 
374 callbackChooser_msgActionChoice_Print_item_CB1(
375     Widget widget,
376     XtPointer clientData,
377     XtPointer callData
378 )
379 {
380     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
381     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
382     
383     DtbCallbackChooserCallbackChooserInfo       instance = (DtbCallbackChooserCallbackChooserInfo)clientData;
384     
385     if (!(instance->initialized))
386     {
387         dtb_callback_chooser_callback_chooser_initialize(instance, dtb_ttsnoop_ttsnoop_win.ttsnoopWin);
388     }
389
390     XtSetSensitive(instance->msgDestroyChoice, True);
391     
392     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
393     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
394 }
395
396
397 void 
398 callbackChooser_msgActionChoice_Accept_item_CB1(
399     Widget widget,
400     XtPointer clientData,
401     XtPointer callData
402 )
403 {
404     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
405     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
406     
407     DtbCallbackChooserCallbackChooserInfo       instance = (DtbCallbackChooserCallbackChooserInfo)clientData;
408     
409     if (!(instance->initialized))
410     {
411         dtb_callback_chooser_callback_chooser_initialize(instance, dtb_ttsnoop_ttsnoop_win.ttsnoopWin);
412     }
413
414     XtSetSensitive(instance->msgDestroyChoice, True);
415     
416     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
417     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
418 }
419
420
421 void 
422 callbackChooser_msgActionChoice_Accept_item_CB2(
423     Widget widget,
424     XtPointer clientData,
425     XtPointer callData
426 )
427 {
428     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
429     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
430     
431     DtbCallbackChooserCallbackChooserInfo       instance = (DtbCallbackChooserCallbackChooserInfo)clientData;
432     
433     if (!(instance->initialized))
434     {
435         dtb_callback_chooser_callback_chooser_initialize(instance, dtb_ttsnoop_ttsnoop_win.ttsnoopWin);
436     }
437
438     XtSetSensitive(instance->msgReturnChoice, True);
439     
440     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
441     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
442 }
443
444
445 void 
446 callbackChooser_msgActionChoice_Print_item_CB2(
447     Widget widget,
448     XtPointer clientData,
449     XtPointer callData
450 )
451 {
452     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
453     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
454     
455     DtbCallbackChooserCallbackChooserInfo       instance = (DtbCallbackChooserCallbackChooserInfo)clientData;
456     
457     if (!(instance->initialized))
458     {
459         dtb_callback_chooser_callback_chooser_initialize(instance, dtb_ttsnoop_ttsnoop_win.ttsnoopWin);
460     }
461
462     XtSetSensitive(instance->msgReturnChoice, True);
463     
464     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
465     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
466 }
467
468
469 void 
470 callbackChooser_msgActionChoice_Abstain_item_CB1(
471     Widget widget,
472     XtPointer clientData,
473     XtPointer callData
474 )
475 {
476     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
477     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
478     
479     DtbCallbackChooserCallbackChooserInfo       instance = (DtbCallbackChooserCallbackChooserInfo)clientData;
480     
481     if (!(instance->initialized))
482     {
483         dtb_callback_chooser_callback_chooser_initialize(instance, dtb_ttsnoop_ttsnoop_win.ttsnoopWin);
484     }
485
486     XtSetSensitive(instance->msgReturnChoice, True);
487     
488     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
489     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
490 }
491
492
493 void 
494 callbackChooser_msgActionChoice_Abstain_item_CB2(
495     Widget widget,
496     XtPointer clientData,
497     XtPointer callData
498 )
499 {
500     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
501     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
502     
503     DtbCallbackChooserCallbackChooserInfo       instance = (DtbCallbackChooserCallbackChooserInfo)clientData;
504     
505     if (!(instance->initialized))
506     {
507         dtb_callback_chooser_callback_chooser_initialize(instance, dtb_ttsnoop_ttsnoop_win.ttsnoopWin);
508     }
509
510     XtSetSensitive(instance->msgDestroyChoice, True);
511     
512     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
513     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
514 }
515
516
517 void 
518 callbackChooser_msgActionChoice_Reply_item_CB1(
519     Widget widget,
520     XtPointer clientData,
521     XtPointer callData
522 )
523 {
524     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
525     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
526     
527     DtbCallbackChooserCallbackChooserInfo       instance = (DtbCallbackChooserCallbackChooserInfo)clientData;
528     
529     if (!(instance->initialized))
530     {
531         dtb_callback_chooser_callback_chooser_initialize(instance, dtb_ttsnoop_ttsnoop_win.ttsnoopWin);
532     }
533
534     XtSetSensitive(instance->msgDestroyChoice, True);
535     
536     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
537     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
538 }
539
540
541 void 
542 callbackChooser_msgActionChoice_Reply_item_CB2(
543     Widget widget,
544     XtPointer clientData,
545     XtPointer callData
546 )
547 {
548     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
549     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
550     
551     DtbCallbackChooserCallbackChooserInfo       instance = (DtbCallbackChooserCallbackChooserInfo)clientData;
552     
553     if (!(instance->initialized))
554     {
555         dtb_callback_chooser_callback_chooser_initialize(instance, dtb_ttsnoop_ttsnoop_win.ttsnoopWin);
556     }
557
558     XtSetSensitive(instance->msgReturnChoice, True);
559     
560     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
561     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
562 }
563
564
565 void 
566 callbackChooser_msgActionChoice_Reject_item_CB1(
567     Widget widget,
568     XtPointer clientData,
569     XtPointer callData
570 )
571 {
572     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
573     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
574     
575     DtbCallbackChooserCallbackChooserInfo       instance = (DtbCallbackChooserCallbackChooserInfo)clientData;
576     
577     if (!(instance->initialized))
578     {
579         dtb_callback_chooser_callback_chooser_initialize(instance, dtb_ttsnoop_ttsnoop_win.ttsnoopWin);
580     }
581
582     XtSetSensitive(instance->msgReturnChoice, True);
583     
584     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
585     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
586 }
587
588
589 void 
590 callbackChooser_msgActionChoice_Reject_item_CB2(
591     Widget widget,
592     XtPointer clientData,
593     XtPointer callData
594 )
595 {
596     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
597     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
598     
599     DtbCallbackChooserCallbackChooserInfo       instance = (DtbCallbackChooserCallbackChooserInfo)clientData;
600     
601     if (!(instance->initialized))
602     {
603         dtb_callback_chooser_callback_chooser_initialize(instance, dtb_ttsnoop_ttsnoop_win.ttsnoopWin);
604     }
605
606     XtSetSensitive(instance->msgDestroyChoice, True);
607     
608     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
609     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
610 }
611
612
613 void 
614 callbackChooser_msgActionChoice_Fail_item_CB1(
615     Widget widget,
616     XtPointer clientData,
617     XtPointer callData
618 )
619 {
620     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
621     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
622     
623     DtbCallbackChooserCallbackChooserInfo       instance = (DtbCallbackChooserCallbackChooserInfo)clientData;
624     
625     if (!(instance->initialized))
626     {
627         dtb_callback_chooser_callback_chooser_initialize(instance, dtb_ttsnoop_ttsnoop_win.ttsnoopWin);
628     }
629
630     XtSetSensitive(instance->msgDestroyChoice, True);
631     
632     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
633     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
634 }
635
636
637 void 
638 callbackChooser_msgActionChoice_Fail_item_CB2(
639     Widget widget,
640     XtPointer clientData,
641     XtPointer callData
642 )
643 {
644     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
645     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
646     
647     DtbCallbackChooserCallbackChooserInfo       instance = (DtbCallbackChooserCallbackChooserInfo)clientData;
648     
649     if (!(instance->initialized))
650     {
651         dtb_callback_chooser_callback_chooser_initialize(instance, dtb_ttsnoop_ttsnoop_win.ttsnoopWin);
652     }
653
654     XtSetSensitive(instance->msgReturnChoice, True);
655     
656     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
657     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
658 }
659
660
661 void 
662 callbackOkayed(
663     Widget widget,
664     XtPointer clientData,
665     XtPointer callData
666 )
667 {
668     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
669     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
670     
671     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
672     DtbCallbackChooserCallbackChooserInfo instance =
673             (DtbCallbackChooserCallbackChooserInfo)clientData;
674     Tt_message msg = 0;
675     Tt_pattern pat = 0;
676     XtPointer xtPtr = 0;
677     int isMessage = 0;
678     XtVaGetValues( instance->callbackAddButton, XmNuserData, &xtPtr, NULL );
679     isMessage = (int) (long) xtPtr;
680     XtVaGetValues( instance->callbackAddCancelButton, XmNuserData, &xtPtr, NULL );
681     msg = (Tt_message)xtPtr;
682     pat = (Tt_pattern)xtPtr;
683
684     What2Do action = DoOpen;
685     Widget actionWidget;
686     XtVaGetValues( instance->msgActionChoice,
687                    XmNmenuHistory, &actionWidget, NULL );
688     if (actionWidget == instance->msgActionChoice_items.Open_item) {
689             action = DoOpen;
690     } else if (actionWidget == instance->msgActionChoice_items.Print_item) {
691             action = DoJustPrint;
692     } else if (actionWidget == instance->msgActionChoice_items.Accept_item) {
693             action = DoAccept;
694     } else if (actionWidget == instance->msgActionChoice_items.Abstain_item) {
695             action = DoAbstain;
696     } else if (actionWidget == instance->msgActionChoice_items.Reply_item) {
697             action = DoReply;
698     } else if (actionWidget == instance->msgActionChoice_items.Reject_item) {
699             action = DoReject;
700     } else if (actionWidget == instance->msgActionChoice_items.Fail_item) {
701             action = DoFail;
702     }
703
704     int destroy = 0;
705     Boolean destroyBool;
706     XtVaGetValues( instance->msgDestroyChoice_items.Destroy_item,
707                    XmNset, &destroyBool, NULL );
708     if (destroyBool) {
709             destroy = 1;
710     }
711
712     Tt_callback_action returnVal = TT_CALLBACK_CONTINUE;
713     Widget returnWidget;
714     XtVaGetValues( instance->msgReturnChoice,
715                    XmNmenuHistory, &returnWidget, NULL );
716     if (returnWidget == instance->msgReturnChoice_items.PROCESSED_item) {
717             returnVal = TT_CALLBACK_PROCESSED;
718     }
719
720     Tt_message_callback func;
721     switch (action) {
722         case DoOpen:
723             func = openIt;
724             break;
725         case DoJustPrint:
726         case DoReply:
727         case DoFail:
728         case DoReject:
729         case DoAccept:
730         case DoAbstain:
731             func = callbacks[ ((int)action)*4 + destroy*2 + (int)returnVal ];
732             break;
733     }
734     if (isMessage) {
735             _DtTtMessageUpdate( msg, func );
736     } else {
737             _DtTtPatternUpdate( pat, func );
738     }
739     XtUnmanageChild( instance->callbackChooser_shellform );
740     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
741 }
742
743
744 void 
745 callbackHelp(
746     Widget widget,
747     XtPointer clientData,
748     XtPointer callData
749 )
750 {
751     /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
752     /*** DTB_USER_CODE_END   ^^^ Add C variables and code above ^^^ ***/
753     
754     /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
755     DtbCallbackChooserCallbackChooserInfo instance =
756             (DtbCallbackChooserCallbackChooserInfo)clientData;
757     XtPointer xtPtr = 0;
758     int isMessage = 0;
759     XtVaGetValues( instance->callbackAddButton, XmNuserData, &xtPtr, NULL );
760     isMessage = (int) (long) xtPtr;
761     Widget label = dtb_ttsnoop_ttsnoop_win.ttsnoopWin_label;
762     if (isMessage) {
763             _DtMan( label, "tt_message_callback_add" );
764     } else {
765             _DtMan( label, "tt_pattern_callback_add" );
766     }
767     /*** DTB_USER_CODE_END   ^^^ Add C code above ^^^ ***/
768 }
769
770
771
772 /**************************************************************************
773  *** DTB_USER_CODE_START
774  ***
775  *** All automatically-generated data and functions have been defined.
776  ***
777  *** Add new functions here, or at the top of the file.
778  ***/
779
780 /*** DTB_USER_CODE_END
781  ***
782  *** End of user code section
783  ***
784  **************************************************************************/
785
786