123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781 |
- /*** DTB_USER_CODE_START vvv Add file header below vvv ***/
- //%% (c) Copyright 1993, 1994 Hewlett-Packard Company
- //%% (c) Copyright 1993, 1994 International Business Machines Corp.
- //%% (c) Copyright 1993, 1994 Sun Microsystems, Inc.
- //%% (c) Copyright 1993, 1994 Novell, Inc.
- //%% $XConsortium: callbackChooser_stubs.C.src /main/3 1995/11/06 17:12:25 rswiston $
- /*** DTB_USER_CODE_END ^^^ Add file header above ^^^ ***/
- /*
- * File: callbackChooser_stubs.c
- * Contains: Module callbacks and connection functions
- *
- * This file was generated by dtcodegen, from module callbackChooser
- *
- * Any text may be added between the DTB_USER_CODE_START and
- * DTB_USER_CODE_END comments (even non-C code). Descriptive comments
- * are provided only as an aid.
- *
- * ** EDIT ONLY WITHIN SECTIONS MARKED WITH DTB_USER_CODE COMMENTS. **
- * ** ALL OTHER MODIFICATIONS WILL BE OVERWRITTEN. DO NOT MODIFY OR **
- * ** DELETE THE GENERATED COMMENTS! **
- */
- #include <stdlib.h>
- #include <stdio.h>
- #include <Xm/Xm.h>
- #include "dtb_utils.h"
- #include "callbackChooser_ui.h"
- /*
- * Header files for cross-module connections
- */
- #include "ttsnoop_ui.h"
- /**************************************************************************
- *** DTB_USER_CODE_START
- ***
- *** All necessary header files have been included.
- ***
- *** Add include files, types, macros, externs, and user functions here.
- ***/
- #include <fstream>
- #include <sstream>
- #include "DtTt.h"
- extern std::ofstream snoopStream;
- typedef enum {
- DoJustPrint,
- DoReply,
- DoFail,
- DoReject,
- DoAccept,
- DoAbstain,
- DoOpen
- } What2Do;
- static void
- _DtTtMsgCbChooserSet(
- void *entity,
- int isMessage,
- const char *title
- )
- {
- DtbCallbackChooserCallbackChooserInfo instance =
- &dtb_callback_chooser_callback_chooser;
- if (! instance->initialized) {
- dtb_callback_chooser_callback_chooser_initialize(
- instance, dtb_ttsnoop_ttsnoop_win.ttsnoopWin );
- }
- XtVaSetValues( instance->callbackChooser, XmNtitle, title, NULL );
- XtPointer xtPtr = (XtPointer) (intptr_t) isMessage;
- XtVaSetValues( instance->callbackAddButton, XmNuserData, xtPtr, NULL );
- XtVaSetValues( instance->callbackAddCancelButton,
- XmNuserData, entity, NULL );
- XtManageChild( instance->callbackChooser_shellform );
- }
- void
- _DtTtMsgCbChooserSet(
- Tt_pattern pat
- )
- {
- _DtTtMsgCbChooserSet( pat, 0, "tt_pattern_callback_add" );
- }
- void
- _DtTtMsgCbChooserSet(
- Tt_message msg
- )
- {
- _DtTtMsgCbChooserSet( msg, 1, "tt_message_callback_add" );
- }
- static Tt_callback_action
- openIt(
- Tt_message msg,
- Tt_pattern pat
- )
- {
- DtTtCreated( DTTT_MESSAGE, msg );
- snoopIt( "Tt_message_callback", (void *) openIt, msg, pat, True );
- Widget newWidget = DtTtMessageWidgetCreate(
- dtb_ttsnoop_ttsnoop_win.ttsnoopWin,
- msg, DtTtMessageWidgetUpdate );
- if (! tt_is_err( tt_ptr_error( newWidget ) )) {
- XRaiseWindow( XtDisplay( newWidget ),
- XtWindow( newWidget ));
- }
- return TT_CALLBACK_PROCESSED;
- }
- static Tt_callback_action
- ucb(
- Tt_message msg,
- Tt_pattern pat,
- Tt_message_callback func,
- What2Do action,
- Boolean destroy,
- Boolean cont
- )
- {
- DtTtCreated( DTTT_MESSAGE, msg );
- if (snoopStream.bad()) {
- return TT_CALLBACK_CONTINUE;
- }
- snoopStream << "(Tt_message_callback)" << func << "( ";
- snoopStream << "(Tt_message)" << (void *)msg << ", ";
- snoopStream << "(Tt_pattern)" << (void *)pat << " ): ";
- char *msgString = tt_message_print( msg );
- Tt_status status = tt_ptr_error( msgString );
- if (status == TT_OK) {
- snoopStream << endl << msgString << endl;
- } else {
- snoopStream << status << endl;
- }
- tt_free( msgString );
- Tt_status (*actionFunc)(Tt_message) = 0;
- char *actionFuncName = 0;
- switch (action) {
- default:
- case DoJustPrint:
- break;
- case DoReply:
- actionFunc = tt_message_reply;
- actionFuncName = "tt_message_reply";
- break;
- case DoFail:
- actionFunc = tt_message_fail;
- actionFuncName = "tt_message_fail";
- break;
- case DoReject:
- actionFunc = tt_message_reject;
- actionFuncName = "tt_message_reject";
- break;
- case DoAccept:
- actionFunc = tt_message_accept;
- actionFuncName = "tt_message_accept";
- break;
- case DoAbstain:
- destroy = 1;
- break;
- }
- if (actionFunc != 0) {
- snoopStream << func << "(): " << actionFuncName << "("
- << msg << ") = "
- << (*actionFunc)( msg ) << endl;
- }
- if (destroy) {
- status = tttk_message_destroy( msg );
- snoopStream << func << "(): tttk_message_destroy("
- << msg << ") = " << status << endl;
- if (status == TT_OK) {
- DtTtDestroyed( DTTT_MESSAGE, msg );
- }
- }
- Tt_callback_action val = TT_CALLBACK_PROCESSED;
- if (cont) {
- val = TT_CALLBACK_CONTINUE;
- }
- snoopStream << func << "(): return " << val << endl;
- return val;
- }
- static Tt_callback_action
- mcbJustPrint_Cont( Tt_message m, Tt_pattern p ) {
- return ucb( m, p, mcbJustPrint_Cont, DoJustPrint, 0, 0 ); }
- static Tt_callback_action
- mcbJustPrint_Done( Tt_message m, Tt_pattern p ) {
- return ucb( m, p, mcbJustPrint_Done, DoJustPrint, 0, 1 ); }
- static Tt_callback_action
- mcbJustPrint_Destroy_Cont( Tt_message m, Tt_pattern p ) {
- return ucb( m, p, mcbJustPrint_Destroy_Cont, DoJustPrint, 1, 0 ); }
- static Tt_callback_action
- mcbJustPrint_Destroy_Done( Tt_message m, Tt_pattern p ) {
- return ucb( m, p, mcbJustPrint_Destroy_Done, DoJustPrint, 1, 1 ); }
- static Tt_callback_action
- mcbReply_Cont( Tt_message m, Tt_pattern p ) {
- return ucb( m, p, mcbReply_Cont, DoReply, 0, 0 ); }
- static Tt_callback_action
- mcbReply_Done( Tt_message m, Tt_pattern p ) {
- return ucb( m, p, mcbReply_Done, DoReply, 0, 1 ); }
- static Tt_callback_action
- mcbReply_Destroy_Cont( Tt_message m, Tt_pattern p ) {
- return ucb( m, p, mcbReply_Destroy_Cont, DoReply, 1, 0 ); }
- static Tt_callback_action
- mcbReply_Destroy_Done( Tt_message m, Tt_pattern p ) {
- return ucb( m, p, mcbReply_Destroy_Done, DoReply, 1, 1 ); }
- static Tt_callback_action
- mcbFail_Cont( Tt_message m, Tt_pattern p ) {
- return ucb( m, p, mcbFail_Cont, DoFail, 0, 0 ); }
- static Tt_callback_action
- mcbFail_Done( Tt_message m, Tt_pattern p ) {
- return ucb( m, p, mcbFail_Done, DoFail, 0, 1 ); }
- static Tt_callback_action
- mcbFail_Destroy_Cont( Tt_message m, Tt_pattern p ) {
- return ucb( m, p, mcbFail_Destroy_Cont, DoFail, 1, 0 ); }
- static Tt_callback_action
- mcbFail_Destroy_Done( Tt_message m, Tt_pattern p ) {
- return ucb( m, p, mcbFail_Destroy_Done, DoFail, 1, 1 ); }
- static Tt_callback_action
- mcbReject_Cont( Tt_message m, Tt_pattern p ) {
- return ucb( m, p, mcbReject_Cont, DoReject, 0, 0 ); }
- static Tt_callback_action
- mcbReject_Done( Tt_message m, Tt_pattern p ) {
- return ucb( m, p, mcbReject_Done, DoReject, 0, 1 ); }
- static Tt_callback_action
- mcbReject_Destroy_Cont( Tt_message m, Tt_pattern p ) {
- return ucb( m, p, mcbReject_Destroy_Cont, DoReject, 1, 0 ); }
- static Tt_callback_action
- mcbReject_Destroy_Done( Tt_message m, Tt_pattern p ) {
- return ucb( m, p, mcbReject_Destroy_Done, DoReject, 1, 1 ); }
- static Tt_callback_action
- mcbAccept_Cont( Tt_message m, Tt_pattern p ) {
- return ucb( m, p, mcbAccept_Cont, DoAccept, 0, 0 ); }
- static Tt_callback_action
- mcbAccept_Done( Tt_message m, Tt_pattern p ) {
- return ucb( m, p, mcbAccept_Done, DoAccept, 0, 1 ); }
- static Tt_callback_action
- mcbAccept_Destroy_Cont( Tt_message m, Tt_pattern p ) {
- return ucb( m, p, mcbAccept_Destroy_Cont, DoAccept, 1, 0 ); }
- static Tt_callback_action
- mcbAccept_Destroy_Done( Tt_message m, Tt_pattern p ) {
- return ucb( m, p, mcbAccept_Destroy_Done, DoAccept, 1, 1 ); }
- static Tt_callback_action
- mcbAbstain_Cont( Tt_message m, Tt_pattern p ) {
- return ucb( m, p, mcbAbstain_Cont, DoAbstain, 0, 0 ); }
- static Tt_callback_action
- mcbAbstain_Done( Tt_message m, Tt_pattern p ) {
- return ucb( m, p, mcbAbstain_Done, DoAbstain, 0, 1 ); }
- static Tt_callback_action
- mcbAbstain_Destroy_Cont( Tt_message m, Tt_pattern p ) {
- return ucb( m, p, mcbAbstain_Destroy_Cont, DoAbstain, 1, 0 ); }
- static Tt_callback_action
- mcbAbstain_Destroy_Done( Tt_message m, Tt_pattern p ) {
- return ucb( m, p, mcbAbstain_Destroy_Done, DoAbstain, 1, 1 ); }
- Tt_message_callback callbacks[] =
- {
- mcbJustPrint_Cont,
- mcbJustPrint_Done,
- mcbJustPrint_Destroy_Cont,
- mcbJustPrint_Destroy_Done,
- mcbReply_Cont,
- mcbReply_Done,
- mcbReply_Destroy_Cont,
- mcbReply_Destroy_Done,
- mcbFail_Cont,
- mcbFail_Done,
- mcbFail_Destroy_Cont,
- mcbFail_Destroy_Done,
- mcbReject_Cont,
- mcbReject_Done,
- mcbReject_Destroy_Cont,
- mcbReject_Destroy_Done,
- mcbAccept_Cont,
- mcbAccept_Done,
- mcbAccept_Destroy_Cont,
- mcbAccept_Destroy_Done,
- mcbAbstain_Cont,
- mcbAbstain_Done,
- mcbAbstain_Destroy_Cont,
- mcbAbstain_Destroy_Done
- };
- /*** DTB_USER_CODE_END
- ***
- *** End of user code section
- ***
- **************************************************************************/
- void
- callbackChooser_callbackAddCancelButton_CB1(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- DtbCallbackChooserCallbackChooserInfo instance = (DtbCallbackChooserCallbackChooserInfo)clientData;
-
- if (!(instance->initialized))
- {
- dtb_callback_chooser_callback_chooser_initialize(instance, dtb_ttsnoop_ttsnoop_win.ttsnoopWin);
- }
- XtUnmanageChild(instance->callbackChooser_shellform);
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- callbackChooser_msgActionChoice_Open_item_CB1(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- DtbCallbackChooserCallbackChooserInfo instance = (DtbCallbackChooserCallbackChooserInfo)clientData;
-
- if (!(instance->initialized))
- {
- dtb_callback_chooser_callback_chooser_initialize(instance, dtb_ttsnoop_ttsnoop_win.ttsnoopWin);
- }
- XtSetSensitive(instance->msgDestroyChoice, False);
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- callbackChooser_msgActionChoice_Open_item_CB2(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- DtbCallbackChooserCallbackChooserInfo instance = (DtbCallbackChooserCallbackChooserInfo)clientData;
-
- if (!(instance->initialized))
- {
- dtb_callback_chooser_callback_chooser_initialize(instance, dtb_ttsnoop_ttsnoop_win.ttsnoopWin);
- }
- XtSetSensitive(instance->msgReturnChoice, False);
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- callbackChooser_msgActionChoice_Print_item_CB1(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- DtbCallbackChooserCallbackChooserInfo instance = (DtbCallbackChooserCallbackChooserInfo)clientData;
-
- if (!(instance->initialized))
- {
- dtb_callback_chooser_callback_chooser_initialize(instance, dtb_ttsnoop_ttsnoop_win.ttsnoopWin);
- }
- XtSetSensitive(instance->msgDestroyChoice, True);
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- callbackChooser_msgActionChoice_Accept_item_CB1(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- DtbCallbackChooserCallbackChooserInfo instance = (DtbCallbackChooserCallbackChooserInfo)clientData;
-
- if (!(instance->initialized))
- {
- dtb_callback_chooser_callback_chooser_initialize(instance, dtb_ttsnoop_ttsnoop_win.ttsnoopWin);
- }
- XtSetSensitive(instance->msgDestroyChoice, True);
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- callbackChooser_msgActionChoice_Accept_item_CB2(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- DtbCallbackChooserCallbackChooserInfo instance = (DtbCallbackChooserCallbackChooserInfo)clientData;
-
- if (!(instance->initialized))
- {
- dtb_callback_chooser_callback_chooser_initialize(instance, dtb_ttsnoop_ttsnoop_win.ttsnoopWin);
- }
- XtSetSensitive(instance->msgReturnChoice, True);
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- callbackChooser_msgActionChoice_Print_item_CB2(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- DtbCallbackChooserCallbackChooserInfo instance = (DtbCallbackChooserCallbackChooserInfo)clientData;
-
- if (!(instance->initialized))
- {
- dtb_callback_chooser_callback_chooser_initialize(instance, dtb_ttsnoop_ttsnoop_win.ttsnoopWin);
- }
- XtSetSensitive(instance->msgReturnChoice, True);
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- callbackChooser_msgActionChoice_Abstain_item_CB1(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- DtbCallbackChooserCallbackChooserInfo instance = (DtbCallbackChooserCallbackChooserInfo)clientData;
-
- if (!(instance->initialized))
- {
- dtb_callback_chooser_callback_chooser_initialize(instance, dtb_ttsnoop_ttsnoop_win.ttsnoopWin);
- }
- XtSetSensitive(instance->msgReturnChoice, True);
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- callbackChooser_msgActionChoice_Abstain_item_CB2(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- DtbCallbackChooserCallbackChooserInfo instance = (DtbCallbackChooserCallbackChooserInfo)clientData;
-
- if (!(instance->initialized))
- {
- dtb_callback_chooser_callback_chooser_initialize(instance, dtb_ttsnoop_ttsnoop_win.ttsnoopWin);
- }
- XtSetSensitive(instance->msgDestroyChoice, True);
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- callbackChooser_msgActionChoice_Reply_item_CB1(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- DtbCallbackChooserCallbackChooserInfo instance = (DtbCallbackChooserCallbackChooserInfo)clientData;
-
- if (!(instance->initialized))
- {
- dtb_callback_chooser_callback_chooser_initialize(instance, dtb_ttsnoop_ttsnoop_win.ttsnoopWin);
- }
- XtSetSensitive(instance->msgDestroyChoice, True);
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- callbackChooser_msgActionChoice_Reply_item_CB2(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- DtbCallbackChooserCallbackChooserInfo instance = (DtbCallbackChooserCallbackChooserInfo)clientData;
-
- if (!(instance->initialized))
- {
- dtb_callback_chooser_callback_chooser_initialize(instance, dtb_ttsnoop_ttsnoop_win.ttsnoopWin);
- }
- XtSetSensitive(instance->msgReturnChoice, True);
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- callbackChooser_msgActionChoice_Reject_item_CB1(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- DtbCallbackChooserCallbackChooserInfo instance = (DtbCallbackChooserCallbackChooserInfo)clientData;
-
- if (!(instance->initialized))
- {
- dtb_callback_chooser_callback_chooser_initialize(instance, dtb_ttsnoop_ttsnoop_win.ttsnoopWin);
- }
- XtSetSensitive(instance->msgReturnChoice, True);
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- callbackChooser_msgActionChoice_Reject_item_CB2(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- DtbCallbackChooserCallbackChooserInfo instance = (DtbCallbackChooserCallbackChooserInfo)clientData;
-
- if (!(instance->initialized))
- {
- dtb_callback_chooser_callback_chooser_initialize(instance, dtb_ttsnoop_ttsnoop_win.ttsnoopWin);
- }
- XtSetSensitive(instance->msgDestroyChoice, True);
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- callbackChooser_msgActionChoice_Fail_item_CB1(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- DtbCallbackChooserCallbackChooserInfo instance = (DtbCallbackChooserCallbackChooserInfo)clientData;
-
- if (!(instance->initialized))
- {
- dtb_callback_chooser_callback_chooser_initialize(instance, dtb_ttsnoop_ttsnoop_win.ttsnoopWin);
- }
- XtSetSensitive(instance->msgDestroyChoice, True);
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- callbackChooser_msgActionChoice_Fail_item_CB2(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- DtbCallbackChooserCallbackChooserInfo instance = (DtbCallbackChooserCallbackChooserInfo)clientData;
-
- if (!(instance->initialized))
- {
- dtb_callback_chooser_callback_chooser_initialize(instance, dtb_ttsnoop_ttsnoop_win.ttsnoopWin);
- }
- XtSetSensitive(instance->msgReturnChoice, True);
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- callbackOkayed(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- DtbCallbackChooserCallbackChooserInfo instance =
- (DtbCallbackChooserCallbackChooserInfo)clientData;
- Tt_message msg = 0;
- Tt_pattern pat = 0;
- XtPointer xtPtr = 0;
- int isMessage = 0;
- XtVaGetValues( instance->callbackAddButton, XmNuserData, &xtPtr, NULL );
- isMessage = (int) (long) xtPtr;
- XtVaGetValues( instance->callbackAddCancelButton, XmNuserData, &xtPtr, NULL );
- msg = (Tt_message)xtPtr;
- pat = (Tt_pattern)xtPtr;
- What2Do action = DoOpen;
- Widget actionWidget;
- XtVaGetValues( instance->msgActionChoice,
- XmNmenuHistory, &actionWidget, NULL );
- if (actionWidget == instance->msgActionChoice_items.Open_item) {
- action = DoOpen;
- } else if (actionWidget == instance->msgActionChoice_items.Print_item) {
- action = DoJustPrint;
- } else if (actionWidget == instance->msgActionChoice_items.Accept_item) {
- action = DoAccept;
- } else if (actionWidget == instance->msgActionChoice_items.Abstain_item) {
- action = DoAbstain;
- } else if (actionWidget == instance->msgActionChoice_items.Reply_item) {
- action = DoReply;
- } else if (actionWidget == instance->msgActionChoice_items.Reject_item) {
- action = DoReject;
- } else if (actionWidget == instance->msgActionChoice_items.Fail_item) {
- action = DoFail;
- }
- int destroy = 0;
- Boolean destroyBool;
- XtVaGetValues( instance->msgDestroyChoice_items.Destroy_item,
- XmNset, &destroyBool, NULL );
- if (destroyBool) {
- destroy = 1;
- }
- Tt_callback_action returnVal = TT_CALLBACK_CONTINUE;
- Widget returnWidget;
- XtVaGetValues( instance->msgReturnChoice,
- XmNmenuHistory, &returnWidget, NULL );
- if (returnWidget == instance->msgReturnChoice_items.PROCESSED_item) {
- returnVal = TT_CALLBACK_PROCESSED;
- }
- Tt_message_callback func;
- switch (action) {
- case DoOpen:
- func = openIt;
- break;
- case DoJustPrint:
- case DoReply:
- case DoFail:
- case DoReject:
- case DoAccept:
- case DoAbstain:
- func = callbacks[ ((int)action)*4 + destroy*2 + (int)returnVal ];
- break;
- }
- if (isMessage) {
- _DtTtMessageUpdate( msg, func );
- } else {
- _DtTtPatternUpdate( pat, func );
- }
- XtUnmanageChild( instance->callbackChooser_shellform );
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- callbackHelp(
- Widget widget,
- XtPointer clientData,
- XtPointer callData
- )
- {
- /*** DTB_USER_CODE_START vvv Add C variables and code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C variables and code above ^^^ ***/
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- DtbCallbackChooserCallbackChooserInfo instance =
- (DtbCallbackChooserCallbackChooserInfo)clientData;
- XtPointer xtPtr = 0;
- int isMessage = 0;
- XtVaGetValues( instance->callbackAddButton, XmNuserData, &xtPtr, NULL );
- isMessage = (int) (long) xtPtr;
- Widget label = dtb_ttsnoop_ttsnoop_win.ttsnoopWin_label;
- if (isMessage) {
- _DtMan( label, "tt_message_callback_add" );
- } else {
- _DtMan( label, "tt_pattern_callback_add" );
- }
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- /**************************************************************************
- *** DTB_USER_CODE_START
- ***
- *** All automatically-generated data and functions have been defined.
- ***
- *** Add new functions here, or at the top of the file.
- ***/
- /*** DTB_USER_CODE_END
- ***
- *** End of user code section
- ***
- **************************************************************************/
|