518 lines
14 KiB
Plaintext
518 lines
14 KiB
Plaintext
/*** 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
|
|
***
|
|
**************************************************************************/
|
|
|
|
|