123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517 |
- /*** 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: argChooser_stubs.C.src /main/3 1995/11/06 17:12:12 rswiston $
- /*** DTB_USER_CODE_END ^^^ Add file header above ^^^ ***/
- /*
- * File: argChooser_stubs.c
- * Contains: Module callbacks and connection functions
- *
- * This file was generated by dtcodegen, from module argChooser
- *
- * 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 <stdio.h>
- #include <Xm/Xm.h>
- #include "dtb_utils.h"
- #include "argChooser_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 <Xm/Text.h>
- #include <Xm/TextF.h>
- #include <Dt/SpinBox.h>
- #include "DtTt.h"
- void
- _DtArgChooserSet(
- _DtArgChooserAction choice,
- void * entity,
- int nth,
- Tt_mode mode,
- Boolean noValue,
- char * vtype,
- char * val,
- int ival
- )
- {
- DtbArgChooserArgChooserInfo instance =
- &dtb_arg_chooser_arg_chooser;
- if (! instance->initialized) {
- dtb_arg_chooser_arg_chooser_initialize(
- instance, dtb_ttsnoop_ttsnoop_win.ttsnoopWin );
- }
- Widget modeChoice;
- switch (mode) {
- default:
- case TT_IN:
- modeChoice = instance->modeChoice_items.IN_item;
- break;
- case TT_OUT:
- modeChoice = instance->modeChoice_items.OUT_item;
- break;
- case TT_INOUT:
- modeChoice = instance->modeChoice_items.INOUT_item;
- break;
- }
- XtVaSetValues( instance->modeChoice, XmNmenuHistory, modeChoice, NULL );
- Widget valType = instance->argValTypeChoice_items.None_item;
- if (! noValue) {
- if (val != 0) {
- valType = instance->
- argValTypeChoice_items.char_item;
- } else {
- valType = instance->
- argValTypeChoice_items.int_item;
- }
- }
- XtVaSetValues( instance->argValTypeChoice, XmNmenuHistory, valType, NULL);
- XmTextFieldSetString( instance->vtypeText, vtype );
- XtVaSetValues( instance->argIvalBox, DtNposition, ival, NULL );
- XtVaSetValues( instance->argValText, XmNvalue, val, NULL );
- _DtArgChooserSet( choice, entity, nth );
- }
- void
- _DtArgChooserSet(
- _DtArgChooserAction choice,
- void * entity,
- int nth
- )
- {
- Boolean vtypeActive = True;
- Boolean modeActive = True;
- char *vtypeLabel = "vtype:";
- char *okString;
- char *title;
- switch (choice) {
- case _DtArgChoosePatternArgAdd:
- case _DtArgChoosePatternIArgAdd:
- okString = "Add";
- title = "tt_pattern_arg_add";
- break;
- case _DtArgChoosePatternContextAdd:
- case _DtArgChoosePatternIContextAdd:
- okString = "Add";
- title = "tt_pattern_context_add";
- modeActive = False;
- vtypeLabel = "slot:";
- break;
- case _DtArgChooseMessageArgAdd:
- case _DtArgChooseMessageIArgAdd:
- okString = "Add";
- title = "tt_message_arg_add";
- break;
- case _DtArgChooseMessageArgSet:
- case _DtArgChooseMessageIArgSet:
- okString = "Set";
- title = "tt_message_arg_val_set";
- vtypeActive = False;
- modeActive = False;
- break;
- case _DtArgChooseMessageContextSet:
- case _DtArgChooseMessageIContextSet:
- okString = "Set";
- title = "tt_message_context_set";
- modeActive = False;
- vtypeLabel = "slot:";
- break;
- default:
- return;
- }
- DtbArgChooserArgChooserInfo instance =
- &dtb_arg_chooser_arg_chooser;
- if (! instance->initialized) {
- dtb_arg_chooser_arg_chooser_initialize(
- instance, dtb_ttsnoop_ttsnoop_win.ttsnoopWin );
- }
- DtTtSetLabel( instance->argChooserOkButton, okString );
- XtVaSetValues( instance->argChooser, XmNtitle, title, NULL );
- DtTtSetLabel( instance->vtypeText_label, vtypeLabel );
- XtSetSensitive( instance->vtypeText, vtypeActive );
- XtSetSensitive( instance->modeChoice, modeActive );
- // Remember dialog mode, entity, nth
- XtVaSetValues( instance->argChooserOkButton, XmNuserData, choice, NULL );
- XtVaSetValues( instance->argChooserCancelButton,
- XmNuserData, entity, NULL );
- XtVaSetValues( instance->argChooserHelpButton, XmNuserData, nth, NULL );
- if (vtypeActive) {
- // Pre-select vtype text
- XmTextPosition last =
- XmTextFieldGetLastPosition( instance->vtypeText );
- Time when = XtLastTimestampProcessed(
- XtDisplay( instance->vtypeText ));
- XmTextFieldSetSelection( instance->vtypeText, 0, last, when );
- }
- XtManageChild( instance->argChooser_shellform );
- }
- /*** DTB_USER_CODE_END
- ***
- *** End of user code section
- ***
- **************************************************************************/
- void
- argChooser_argValTypeChoice_None_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 ^^^ ***/
-
- DtbArgChooserArgChooserInfo instance = (DtbArgChooserArgChooserInfo)clientData;
-
- if (!(instance->initialized))
- {
- dtb_arg_chooser_arg_chooser_initialize(instance, dtb_ttsnoop_ttsnoop_win.ttsnoopWin);
- }
- XtSetSensitive(instance->argIvalBox, False);
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- argChooser_argValTypeChoice_char_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 ^^^ ***/
-
- DtbArgChooserArgChooserInfo instance = (DtbArgChooserArgChooserInfo)clientData;
-
- if (!(instance->initialized))
- {
- dtb_arg_chooser_arg_chooser_initialize(instance, dtb_ttsnoop_ttsnoop_win.ttsnoopWin);
- }
- XtSetSensitive(instance->argIvalBox, False);
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- argChooser_argValTypeChoice_int_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 ^^^ ***/
-
- DtbArgChooserArgChooserInfo instance = (DtbArgChooserArgChooserInfo)clientData;
-
- if (!(instance->initialized))
- {
- dtb_arg_chooser_arg_chooser_initialize(instance, dtb_ttsnoop_ttsnoop_win.ttsnoopWin);
- }
- XtSetSensitive(instance->argIvalBox, True);
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- argChooser_argChooserOkButton_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 ^^^ ***/
-
- DtbArgChooserArgChooserInfo instance = (DtbArgChooserArgChooserInfo)clientData;
-
- if (!(instance->initialized))
- {
- dtb_arg_chooser_arg_chooser_initialize(instance, dtb_ttsnoop_ttsnoop_win.ttsnoopWin);
- }
- XtUnmanageChild(instance->argChooser_shellform);
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- argChooser_argChooserCancelButton_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 ^^^ ***/
-
- DtbArgChooserArgChooserInfo instance = (DtbArgChooserArgChooserInfo)clientData;
-
- if (!(instance->initialized))
- {
- dtb_arg_chooser_arg_chooser_initialize(instance, dtb_ttsnoop_ttsnoop_win.ttsnoopWin);
- }
- XtUnmanageChild(instance->argChooser_shellform);
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- argChooser_argValTypeChoice_None_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 ^^^ ***/
-
- DtbArgChooserArgChooserInfo instance = (DtbArgChooserArgChooserInfo)clientData;
-
- if (!(instance->initialized))
- {
- dtb_arg_chooser_arg_chooser_initialize(instance, dtb_ttsnoop_ttsnoop_win.ttsnoopWin);
- }
- XtSetSensitive(instance->argValText, False);
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- argChooser_argValTypeChoice_int_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 ^^^ ***/
-
- DtbArgChooserArgChooserInfo instance = (DtbArgChooserArgChooserInfo)clientData;
-
- if (!(instance->initialized))
- {
- dtb_arg_chooser_arg_chooser_initialize(instance, dtb_ttsnoop_ttsnoop_win.ttsnoopWin);
- }
- XtSetSensitive(instance->argValText, False);
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- argChooser_argValTypeChoice_char_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 ^^^ ***/
-
- DtbArgChooserArgChooserInfo instance = (DtbArgChooserArgChooserInfo)clientData;
-
- if (!(instance->initialized))
- {
- dtb_arg_chooser_arg_chooser_initialize(instance, dtb_ttsnoop_ttsnoop_win.ttsnoopWin);
- }
- XtSetSensitive(instance->argValText, True);
-
- /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- argOkayed(
- 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 ***/
- DtbArgChooserArgChooserInfo instance =
- (DtbArgChooserArgChooserInfo)clientData;
- int nth = 0;
- Tt_message msg = 0;
- Tt_pattern pat = 0;
- _DtArgChooserAction choice = _DtArgChooseNone;
- XtPointer pval;
- XtVaGetValues( instance->argChooserOkButton, XmNuserData, &pval, NULL );
- choice = (_DtArgChooserAction) (long) pval;
- XtVaGetValues( instance->argChooserCancelButton, XmNuserData, &pval, NULL );
- msg = (Tt_message)pval;
- pat = (Tt_pattern)pval;
- XtVaGetValues( instance->argChooserHelpButton, XmNuserData, &pval, NULL );
- nth = (int) (long) pval;
- char *vtype = XmTextFieldGetString( instance->vtypeText );
- if ((vtype != 0) && (vtype[0] == '\0')) {
- XtFree( vtype );
- vtype = 0;
- }
- Widget modeWidget;
- XtVaGetValues( instance->modeChoice, XmNmenuHistory, &modeWidget, NULL );
- Tt_mode mode = TT_IN;
- if (modeWidget == instance->modeChoice_items.OUT_item) {
- mode = TT_OUT;
- } else if (modeWidget == instance->modeChoice_items.INOUT_item) {
- mode = TT_INOUT;
- }
- char *val = 0;
- int ival = 0;
- Widget valTypeWidget;
- XtVaGetValues( instance->argValTypeChoice,
- XmNmenuHistory, &valTypeWidget, NULL );
- if (valTypeWidget == instance->argValTypeChoice_items.char_item) {
- val = XmTextGetString( instance->argValText );
- } else if (valTypeWidget == instance->argValTypeChoice_items.int_item) {
- // see _DtArgChooserAction invariant in DtTt.h
- choice = (_DtArgChooserAction)(choice + 1);
- XtVaGetValues( instance->argIvalBox, DtNposition, &ival, NULL );
- }
- switch (choice) {
- Tt_status status;
- case _DtArgChooseMessageArgAdd:
- case _DtArgChooseMessageIArgAdd:
- case _DtArgChooseMessageArgSet:
- case _DtArgChooseMessageIArgSet:
- case _DtArgChooseMessageContextSet:
- case _DtArgChooseMessageIContextSet:
- _DtTtMessageUpdate( msg, choice, nth, mode, vtype, val, ival );
- case _DtArgChoosePatternArgAdd:
- case _DtArgChoosePatternIArgAdd:
- case _DtArgChoosePatternContextAdd:
- case _DtArgChoosePatternIContextAdd:
- _DtTtPatternUpdate( pat, choice, mode, vtype, val, ival );
- break;
- default:
- break;
- }
- if (vtype != 0) XtFree( vtype );
- if (val != 0) XtFree( val );
- XtUnmanageChild(instance->argChooser_shellform);
- /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
- }
- void
- argHelp(
- 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 ***/
- DtbArgChooserArgChooserInfo instance =
- (DtbArgChooserArgChooserInfo)clientData;
- XtPointer val;
- XtVaGetValues( instance->argChooserOkButton, XmNuserData, &val, NULL );
- _DtArgChooserAction choice = (_DtArgChooserAction) (long) val;
- Widget label = dtb_ttsnoop_ttsnoop_win.ttsnoopWin_label;
- switch (choice) {
- case _DtArgChoosePatternArgAdd:
- case _DtArgChoosePatternIArgAdd:
- _DtMan( label, "tt_pattern_arg_add" );
- break;
- case _DtArgChoosePatternContextAdd:
- case _DtArgChoosePatternIContextAdd:
- _DtMan( label, "tt_pattern_context_add" );
- break;
- case _DtArgChooseMessageArgAdd:
- case _DtArgChooseMessageIArgAdd:
- _DtMan( label, "tt_message_arg_add" );
- break;
- case _DtArgChooseMessageArgSet:
- case _DtArgChooseMessageIArgSet:
- _DtMan( label, "tt_message_arg_val_set" );
- break;
- case _DtArgChooseMessageContextSet:
- case _DtArgChooseMessageIContextSet:
- _DtMan( label, "tt_message_context_set" );
- break;
- default:
- break;
- }
- /*** 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
- ***
- **************************************************************************/
|