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