Initial import of the CDE 2.1.30 sources from the Open Group.

This commit is contained in:
Peter Howkins
2012-03-10 18:21:40 +00:00
commit 83b6996daa
18978 changed files with 3945623 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
! $XConsortium: Dtcalc /main/4 1996/09/04 16:55:07 mustafa $
!######################################################################
!#
!# Dtcalc
!#
!# Common Desktop Environment (CDE)
!#
!# Application Defaults for the CDE Desktop Calculator
!#
!# (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.
!#
!######################################################################
#include "Dt"
Dtcalc*enableButtonTab: True
Dtcalc*basePD*menuAccelerator: <KeyDown>Return
Dtcalc*popup*menuAccelerator: <KeyUp>F4
Dtcalc*menu*menuAccelerator: <KeyUp>F4
Dtcalc*blinkRate: 0
!#
!# The calculator defines the resource XmNcolumns twice:
!# 1. For the number of columns in the Display Text area. This text widget
!# is dynamic and grows or shrinks as text is placed in the Display area.
!# This is the "display" resource.
!# 2. For the number of columns in the ASCII converter dialog.
!# This is the "aframe" resource.
!#
!# Since for Multi-byte languages this could be different then 1, this is put
!# in the app-defaults file of the calculator.
!#
Dtcalc*display.columns: %|nls-5-#1#|
Dtcalc*aframe*columns: %|nls-6-#1#|

View File

@@ -0,0 +1,45 @@
XCOMM $TOG: Imakefile /main/11 1997/09/05 11:28:15 samborn $
DEFINES = -DCDE_INSTALLATION_TOP=\"$(CDE_INSTALLATION_TOP)\"
INCLUDES = -I.
#if defined (SunArchitecture)
DEPLIBS = $(DEPDTSVCLIB) $(DEPTTLIB) $(DEPXMLIB) $(DEPXTOOLLIB) $(DEPXPLIB) $(DEPXLIB)
LOCAL_LIBRARIES = $(DTSVCLIB) $(TTLIB) $(XMLIB) $(XTOOLLIB) $(XPLIB) $(XLIB)
#else
DEPLIBS = $(DEPDTHELPLIB) $(DEPDTSVCLIB) $(DEPTTLIB) $(DEPXMLIB) $(DEPXTOOLLIB) $(DEPXPLIB) $(DEPXLIB)
LOCAL_LIBRARIES = $(DTHELPLIB) $(DTSVCLIB) $(TTLIB) $(XMLIB) $(XTOOLLIB) $(XPLIB) $(XLIB)
#endif /* SunArchitecture*/
SYS_LIBRARIES = -lm
#ifdef RsArchitecture
SYS_LIBRARIES = -lmsaa -liconv
#endif
#if defined (SunArchitecture)
SYS_LIBRARIES = -lintl -lsunmath -lm -ldl
#endif
#if defined (USLArchitecture)
SYS_LIBRARIES = -lm -lgen
#endif
#if defined (UXPArchitecture)
SYS_LIBRARIES = -lm -lgen
#endif
#if defined(HPOSFArchitecture)
#endif
SRCS = calctool.c ds_common.c ds_popup.c \
ds_widget.c ds_xlib.c functions.c \
help.c motif.c mp.c \
text.c version.c
OBJS = calctool.o ds_common.o ds_popup.o \
ds_widget.o ds_xlib.o functions.o \
help.o motif.o mp.o \
text.o version.o
ComplexProgramTarget(dtcalc)

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,771 @@
/* $XConsortium: calctool.h /main/7 1996/10/29 14:10:36 mustafa $ */
/* *
* calctool.h *
* Contains the none user interface includes for the Desktop *
* Calculator. *
* *
* (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. *
*/
#include <locale.h>
#include <X11/Intrinsic.h>
#include <Dt/UserMsg.h>
#include <Dt/DtNlUtils.h>
#ifdef __osf__
/* Undefine DEC so the enum value DEC works */
#ifdef DEC
#undef DEC
#endif /* DEC */
#endif /* __osf__ */
#ifdef XGETTEXT
#define MSGFILE_LABEL "dtcalc.label"
#define MSGFILE_MESSAGE "dtcalc.message"
#else
extern char *MSGFILE_LABEL ;
extern char *MSGFILE_MESSAGE ;
#endif
#define DGET(s) (s)
#define LGET(s) (char *) dgettext(MSGFILE_LABEL, s)
#define MGET(s) (char *) dgettext(MSGFILE_MESSAGE, s)
#define dgettext(f, s) (s)
#define bindtextdomain(f, s)
#ifndef NO_MESSAGE_CATALOG
# ifdef __ultrix
# define _CLIENT_CAT_NAME "dtcalc.cat"
# else /* __ultrix */
# define _CLIENT_CAT_NAME "dtcalc"
# endif /* __ultrix */
extern char *_DtGetMessage(char *filename, int set, int n, char *s);
# define GETMESSAGE(set, number, string)\
(_DtGetMessage(_CLIENT_CAT_NAME, set, number, string))
#else
# define GETMESSAGE(set, number, string)\
string
#endif
#if !(defined(sun) && (_XOPEN_VERSION==3))
#ifndef DOMAIN
#define DOMAIN 1
#endif
#ifndef SING
#define SING 2
#endif
#ifndef OVERFLOW
#define OVERFLOW 3
#endif
#ifndef UNDERFLOW
#define UNDERFLOW 4
#endif
#ifndef TLOSS
#define TLOSS 5
#endif
#ifndef PLOSS
#define PLOSS 6
#endif
#ifndef HUGE
#define HUGE MAXFLOAT
#endif
#endif /* sun */
/* For all function declarations, if ANSI then use a prototype. */
#if defined(__STDC__)
#define P(args) args
#else /* ! __STDC__ */
#define P(args) ()
#endif /* STDC */
#ifdef hpux
#define HIL_PC101_KBD 1
#define HIL_ITF_KBD 2
#define SERIAL_PC101_KBD 3
#define FIRST_HIL_KBD 0xC0
#define LAST_HIL_KBD 0xDF
#define LED_BITS 0x30
#define PS2_DIN_NAME "PS2_DIN_KEYBOARD"
#endif
extern char *getenv P((const char *)) ;
extern char *mktemp P((char *)) ;
extern double drand48 P(()) ;
#define MEM 1
#define FIN 2
#define FIN_EPSILON 1.0e-10
#define MAX_FIN_ITER 1000
#define MP_SIZE 150 /* Size of the multiple precision values. */
#define FCLOSE (void) fclose /* To make lint happy. */
#define FPRINTF (void) fprintf
#define FPUTS (void) fputs
#define FREE (void) free
#define MEMCPY (void) memcpy
#define MKTEMP (void) mktemp
#define REWIND (void) rewind
#define SPRINTF (void) sprintf
#define SSCANF (void) sscanf
#define STRCPY (void) strcpy
#define STRNCAT (void) strncat
#define UNLINK (void) unlink
/* Various pseudo events used by the dtcalc program. */
#define KEYBOARD_DOWN 100 /* Keyboard character was pressed. */
#define KEYBOARD_UP 101 /* Keyboard character was released. */
#define LASTEVENTPLUSONE 102 /* Not one of the above. */
#define F4_PRESS 103
#define ARROW 104
#define TAB 105
#define CONTROL 106
#define SHIFT 107
#define SPACE 108
#define ESCAPE 109
#define META 110
#define ALT 111
#define NUM_LOCK 77
enum base_type { BIN, OCT, DEC, HEX } ; /* Base definitions. */
/* Command line options (for saving). */
enum cmd_type { CMD_ACC, CMD_MODE, CMD_BASE, CMD_DISP, CMD_MENU_BAR,
CMD_SESSION, CMD_TRIG, CMD_DUMMY } ;
/* Frame/Canvas/Pixwin types. */
enum fcp_type { FCP_KEY, FCP_REG, FCP_MODE, FCP_FIN_REG } ;
/* Help string types. */
enum help_type { H_ACC, H_BASE, H_CON, H_EXCH,
H_FUN, H_MODE, H_NUM,
H_RCL, H_STO, H_TRIG,
H_ABUT, H_AFRAME, H_APANEL,
H_APPEARANCE, H_APPLY, H_ATEXT, H_CFCBUT,
H_CFDESC, H_CFFRAME, H_CFNO, H_CFPANEL,
H_CFVAL, H_DEF, H_DISPLAY, H_PFRAME,
H_PPANEL, H_RESET, H_STYLE, H_DUMMY } ;
/* Pseudo panel items. */
enum item_type { BASEITEM, TTYPEITEM, NUMITEM, HYPITEM,
INVITEM, OPITEM, MODEITEM, DISPLAYITEM } ;
/* Motif labels for various items. */
enum label_type { L_LCALC, L_UCALC, L_CONNO, L_NEWCON, L_FUNNO,
L_NEWFUN, L_MEMT, L_PROPT, L_DESC, L_VALUE,
L_CONB, L_FUNB, L_FINMEMT, L_DUMMY } ;
/* Popup menu types. */
enum menu_type { M_ACC, M_BASE, M_CON, M_EXCH, M_FUN, M_MODE,
M_NUM, M_RCL, M_STO, M_TRIG, M_NONE
} ;
/* Message string types. */
enum mess_type { MESS_PARAM, MESS_CON, MESS_DUMMY } ;
/* Calculator modes. */
enum mode_type { FINANCIAL, LOGICAL, SCIENTIFIC } ;
enum mp_type { MP_ADD2A, MP_ADD2B, MP_PART1, MP_ASIN, /* MP error types. */
MP_ATAN, MP_CHKC,
MP_CHKD, MP_CHKE, MP_CHKF, MP_CHKG,
MP_CHKH, MP_CHKI, MP_CHKJ, MP_CHKL,
MP_CHKM, MP_CHKN, MP_CMD, MP_CMR,
MP_CQM, MP_DIVA, MP_DIVB, MP_DIVIA,
MP_DIVIB, MP_EXPA, MP_EXPB, MP_EXP1,
MP_LNA, MP_LNB, MP_LNSA,
MP_LNSB, MP_LNSC, MP_MULA, MP_MULB,
MP_MULC, MP_MUL2A, MP_MUL2B, MP_MULQ,
MP_NZRA, MP_NZRB, MP_NZRC,
MP_OVFL, MP_PI, MP_PWRA,
MP_PWRB, MP_PWR2A, MP_PWR2B, MP_RECA,
MP_RECB, MP_RECC, MP_RECD, MP_ROOTA,
MP_ROOTB, MP_ROOTC, MP_ROOTD,
MP_ROOTE, MP_ROOTF, MP_SETB,
MP_SETC, MP_SETD, MP_SETE, MP_SIN,
MP_SIN1, MP_SQRT, MP_TAN, MP_DUMMY } ;
enum num_type { ENG, FIX, SCI } ; /* Number display mode. */
enum op_type { OP_SET, OP_CLEAR, OP_NOP } ; /* Operation item settings. */
enum opt_type { O_ACCVAL, O_ACCRANGE, O_BASE, O_DISPLAY,
O_MODE, O_TRIG, O_SESSION, O_DUMMY } ;
enum prop_type { P_CHAR, P_ASCIIT, P_DUMMY } ;
/* Resources. */
enum res_type { R_ACCURACY, R_BASE, R_DISPLAY, R_MODE, R_FREGS,
R_REGS, R_TRIG, R_BEEP, R_ICON, R_WORKSPACE,
R_HEIGHT, R_WIDTH, R_X, R_Y, R_DISPLAYED,
R_REG0, R_REG1, R_REG2, R_REG3, R_REG4,
R_REG5, R_REG6, R_REG7, R_REG8, R_REG9,
R_FREG0, R_FREG1, R_FREG2, R_FREG3, R_FREG4,
R_FREG5, R_MENUBAR, R_KEYS, R_DUMMY } ;
enum trig_type { DEG, GRAD, RAD } ; /* Trigonometric types. */
/* Usage message types. */
enum usage_type { USAGE1, USAGE2, USAGE3, U_DUMMY } ;
enum var_type { V_CANCEL,
V_CLR, V_CONFIRM, V_CONTINUE,
V_CONWNAME, V_ERROR,
V_FUNWNAME, V_HYP, V_INV,
V_INVCON, V_LCON, V_LFUN,
V_NOCHANGE, V_NUMSTACK, V_OPSTACK, V_OWRITE,
V_RANGE, V_TRUE, V_UCON, V_UFUN,
V_NORSAVE, V_DUMMY } ;
/* Abbreviations for the dtcalc keyboard and menu equivalents. */
#define KEY_BLNKD buttons[0].value /* q */
#define KEY_FUN buttons[1].value /* F */
#define KEY_CON buttons[2].value /* # */
#define KEY_KEYS buttons[3].value /* k */
#define KEY_INT buttons[4].value /* CTL('i') */
#define KEY_FRAC buttons[5].value /* CTL('f') */
#define KEY_ABS buttons[6].value /* CTL('u') */
#define KEY_EXP buttons[7].value /* E */
#define KEY_ACC buttons[8].value /* A */
#define KEY_STO buttons[9].value /* S */
#define KEY_RCL buttons[10].value /* R */
#define KEY_EXCH buttons[11].value /* X */
#define KEY_BLNK1 buttons[12].value /* q */
#define KEY_BLNK2 buttons[13].value /* q */
#define KEY_BLNK3 buttons[14].value /* q */
#define KEY_BLNK4 buttons[15].value /* q */
#define KEY_BLNK5 buttons[16].value /* q */
#define KEY_BLNK6 buttons[17].value /* q */
#define KEY_BLNK7 buttons[18].value /* q */
#define KEY_BLNK8 buttons[19].value /* q */
#define KEY_BLNK9 buttons[20].value /* q */
#define KEY_BLNKA buttons[21].value /* q */
#define KEY_BLNKB buttons[22].value /* q */
#define KEY_BLNKC buttons[23].value /* q */
#define KEY_REC buttons[24].value /* r */
#define KEY_SQR buttons[25].value /* @ */
#define KEY_SQRT buttons[26].value /* s */
#define KEY_PER buttons[27].value /* % */
#define KEY_LPAR buttons[28].value /* ( */
#define KEY_RPAR buttons[29].value /* ) */
#define KEY_BSP buttons[30].value /* CTL('h') */
#define KEY_CLR buttons[31].value /* del */
#define KEY_D buttons[32].value /* d */
#define KEY_E buttons[33].value /* e */
#define KEY_F buttons[34].value /* f */
#define KEY_CHS buttons[35].value /* C */
#define KEY_A buttons[36].value /* a */
#define KEY_B buttons[37].value /* b */
#define KEY_C buttons[38].value /* c */
#define KEY_MUL buttons[39].value /* x */
#define KEY_7 buttons[40].value /* 7 */
#define KEY_8 buttons[41].value /* 8 */
#define KEY_9 buttons[42].value /* 9 */
#define KEY_DIV buttons[43].value /* / */
#define KEY_4 buttons[44].value /* 4 */
#define KEY_5 buttons[45].value /* 5 */
#define KEY_6 buttons[46].value /* 6 */
#define KEY_SUB buttons[47].value /* - */
#define KEY_1 buttons[48].value /* 1 */
#define KEY_2 buttons[49].value /* 2 */
#define KEY_3 buttons[50].value /* 3 */
#define KEY_ADD buttons[51].value /* + */
#define KEY_0 buttons[52].value /* 0 */
#define KEY_PNT buttons[53].value /* . */
#define KEY_EQ buttons[54].value /* = */
#define KEY_QUIT buttons[55].value /* q */
/* these are the extra definitions for MODE, BASE, and DISP */
#define KEY_BASE buttons[56].value /* B */
#define KEY_DISP buttons[57].value /* D */
#define KEY_MODE buttons[58].value /* M */
#define KEY_TRIG buttons[59].value /* T */
#define ACC_START 0 /* 0 */
#define ACC_END 9 /* 9 */
#define MEM_START 10 /* 0 */
#define MEM_END 19 /* 9 */
#define BASE_BIN menu_entries[20].val /* b */
#define BASE_OCT menu_entries[21].val /* o */
#define BASE_DEC menu_entries[22].val /* d */
#define BASE_HEX menu_entries[23].val /* h */
#define DISP_ENG menu_entries[24].val /* e */
#define DISP_FIX menu_entries[25].val /* f */
#define DISP_SCI menu_entries[26].val /* s */
#define TRIG_DEG menu_entries[27].val /* d */
#define TRIG_GRA menu_entries[28].val /* g */
#define TRIG_RAD menu_entries[29].val /* r */
#define MODE_BAS menu_entries[30].val /* b */
#define MODE_FIN menu_entries[31].val /* f */
#define MODE_LOG menu_entries[32].val /* l */
#define MODE_SCI menu_entries[33].val /* s */
#define KEY_TERM mode_buttons[0].value /* T */
#define KEY_RATE mode_buttons[1].value /* CTL('r') */
#define KEY_PV mode_buttons[2].value /* p */
#define KEY_PMT mode_buttons[3].value /* P */
#define KEY_FV mode_buttons[4].value /* v */
#define KEY_PYR mode_buttons[5].value /* y */
#define KEY_FCLR mode_buttons[6].value /* L */
#define KEY_CTRM mode_buttons[7].value /* CTL('t') */
#define KEY_DDB mode_buttons[8].value /* CTL('d') */
#define KEY_SLN mode_buttons[9].value /* CTL('s') */
#define KEY_SYD mode_buttons[10].value /* CTL('y') */
#define KEY_LSFT mode_buttons[16].value /* < */
#define KEY_RSFT mode_buttons[17].value /* > */
#define KEY_16 mode_buttons[18].value /* [ */
#define KEY_32 mode_buttons[19].value /* ] */
#define KEY_OR mode_buttons[20].value /* | */
#define KEY_AND mode_buttons[21].value /* & */
#define KEY_NOT mode_buttons[22].value /* ~ */
#define KEY_XOR mode_buttons[23].value /* ^ */
#define KEY_XNOR mode_buttons[24].value /* n */
#define KEY_INV mode_buttons[32].value /* i */
#define KEY_HYP mode_buttons[33].value /* h */
#define KEY_ETOX mode_buttons[34].value /* { */
#define KEY_TTOX mode_buttons[35].value /* } */
#define KEY_YTOX mode_buttons[36].value /* y */
#define KEY_FACT mode_buttons[37].value /* ! */
#define KEY_COS mode_buttons[38].value /* CTL('c') */
#define KEY_SIN mode_buttons[39].value /* CTL('s') */
#define KEY_TAN mode_buttons[40].value /* CTL('t') */
#define KEY_LN mode_buttons[41].value /* N */
#define KEY_LOG mode_buttons[42].value /* G */
#define KEY_RAND mode_buttons[43].value /* ? */
#define BCOLS 4 /* No of columns of buttons. */
#define BROWS 14 /* No of rows of buttons. */
#define CALC_CANCEL 1 /* Cancel button pressed on notice. */
#define CALC_CONFIRM 2 /* Confirm button pressed on notice. */
#define CTL(n) n - 96 /* Generate control character value. */
#define EQUAL(a, b) !strncmp(a, b, strlen(b))
#define EXTRA 4 /* Extra useful character definitions. */
#define INC { argc-- ; argv++ ; }
#define IS_KEY(v, n) (v == n)
#ifndef LINT_CAST
#ifdef lint
#define LINT_CAST(arg) (arg ? 0 : 0)
#else
#define LINT_CAST(arg) (arg)
#endif /*lint*/
#endif /*LINT_CAST*/
#define MAXCMDS (int) CMD_DUMMY /* Max. no. of command line opts. */
#define MAX_DIGITS 41 /* Maximum displayable number of digits. */
/* Maximum number of various graphics pieces. */
#define MAXFCP 3 /* Max no of frames/canvases/pixwins. */
#define MAXHELP (int) H_DUMMY /* Max. no. help strings. */
#define MAXIMAGES 3 /* Maximum number of button images. */
#define MAXITEMS 8 /* Maximum number of panel items. */
#define MAXLABELS (int) L_DUMMY /* Max no. Motif label strings. */
#define MAXMENUS 13 /* Maximum number of popup menus. */
#define MAXMESS (int) MESS_DUMMY /* Max. no. message strings. */
#define MAXMPERRS (int) MP_DUMMY /* Max. no. MP error types. */
#ifndef MAXLINE
#define MAXLINE 256 /* Length of character strings. */
#endif /*MAXLINE*/
#define MAXBASES 4 /* Max. no. of numeric bases. */
#define MAXDISPMODES 3 /* Max. no. of display modes. */
#define MAXENTRIES 55 /* Max. no. of menu entries. */
#define MAXMODES 3 /* Max. no. of calculator modes. */
#define MAXOPTS (int) O_DUMMY /* Max. no. option types. */
#define MAXPSTRS (int) P_DUMMY /* Max. no. property strings. */
#define MAXREGS 10 /* Max. no. of memory registers. */
#define FINREGS 6 /* Max. no. of Fin. memory regs. */
#define MAXRESOURCES (int) R_DUMMY /* Max. number. of X resources. */
#define MAXSTACK 256 /* Parenthese stack size. */
#define MAXTRIGMODES 3 /* Max. no. of trig. modes. */
#define MAXUSAGE (int) U_DUMMY /* Max. no. usage strings. */
#define MAXVKEYS 6 /* No. of valid keys after error. */
#define MAXVMESS (int) V_DUMMY /* Max. no. various messages. */
#define MCOLS 8 /* No. of columns of "special" keys. */
#define MROWS 2 /* No. of rows of "special" keys. */
#define MODEKEYS MCOLS * MROWS
#define MAXCOLS BCOLS
#define MAXROWS BROWS
#ifndef MIN
#define MIN(x,y) ((x) < (y) ? (x) : (y))
#endif /*MIN*/
#define NOBUTTONS BROWS * BCOLS
#ifndef RCNAME
#define RCNAME ".dtcalcrc"
#endif /*RCNAME*/
#define TITEMS NOBUTTONS + EXTRA /* Total definitions. */
#ifndef TRUE /* Boolean definitions. */
#define TRUE 1
#endif /*TRUE*/
#ifndef FALSE
#define FALSE 0
#endif /*FALSE*/
typedef unsigned long BOOLEAN ;
struct button {
char *str ; /* Button display string. */
char *str2 ; /* Button display string, with key. */
char value ; /* Unique button keyboard equivalent. */
enum op_type opdisp ; /* Is button selected during operation? */
enum menu_type mtype ; /* Type of popup menu (if any). */
char *resname ; /* Button resource name. */
void (*func)() ; /* Function to obey on button press. */
} ;
struct menu_entry {
char *str ; /* Menu entry string to be displayed. */
char val ; /* Value when selected. */
} ;
struct menu {
char *title ; /* Menu title. */
int total ; /* Number of menu entries. */
int mindex ; /* Index into menu string array. */
int defval ; /* Default menu item position (from 1). */
} ;
struct calcVars { /* Calctool variables and options. */
char *appname ; /* Application name for resources. */
char con_names[MAXREGS][MAXLINE] ; /* Selectable constant names. */
char cur_op ; /* Current arithmetic operation. */
char current ; /* Current button/character pressed. */
char display[MAXLINE] ; /* Current calculator display. */
char *exp_posn ; /* Position of the exponent sign. */
char fnum[MAX_DIGITS+1] ; /* Scratchpad for fixed numbers. */
char fun_names[MAXREGS][MAXLINE] ; /* Function names from .dtcalcrc. */
char fun_vals[MAXREGS][MAXLINE] ; /* Function defs from .dtcalcrc. */
char *iconlabel ; /* The dtcalc icon label. */
char old_cal_value ; /* Previous calculation operator. */
char *progname ; /* Name of this program. */
char pstr[5] ; /* Current button text string. */
char *selection ; /* Current [Get] selection. */
char *shelf ; /* PUT selection shelf contents. */
char snum[MAX_DIGITS+1] ; /* Scratchpad for scientific numbers. */
char *titleline ; /* Value of titleline (if present). */
char *workspaces ; /* workspace names calc is in */
int x;
int y;
int width;
int height;
int MPcon_vals[MAXREGS][MP_SIZE] ; /* Selectable constants. */
int MPdebug ; /* If set, debug info. to stderr. */
int MPerrors ; /* If set, output errors to stderr. */
int MPdisp_val[MP_SIZE] ; /* Value of the current display. */
int MPlast_input[MP_SIZE] ; /* Previous number input by user. */
int MPmvals[MAXREGS][MP_SIZE] ; /* Memory register values. */
double MPfvals[FINREGS] ; /* Financial Memory register values. */
int *MPnumstack[MAXSTACK] ; /* Numeric stack for parens. */
int MPresult[MP_SIZE] ; /* Current calculator total value. */
int MPtresults[3][MP_SIZE] ; /* Current trigonometric results. */
enum base_type base ; /* Current base: BIN, OCT, DEC or HEX. */
enum fcp_type curwin ; /* Window current event occured in. */
enum fcp_type pending_win ; /* Window that pending op came from. */
enum mode_type modetype ; /* Current calculator mode. */
enum mode_type pending_mode ; /* Mode for pending op. */
enum num_type dtype ; /* Number display mode. */
enum trig_type ttype ; /* Trig. type (deg, grad or rad). */
BOOLEAN num_lock; /* Indicator of the state of NUM_LOCK */
int accuracy ; /* Number of digits precision (Max 9). */
int beep ; /* Indicates whether there is a beep sound on error. */
int column ; /* Column number of current key/mouse press. */
int cur_ch ; /* Current character if keyboard event. */
int error ; /* Indicates some kind of display error. */
int event_type ; /* Type of event being currently processed. */
int hasicon ; /* Set if user gave icon name on command line. */
int hyperbolic ; /* If set, trig functions will be hyperbolic. */
int iconic ; /* Set if window is currently iconic. */
int inverse ; /* If set, trig and log functions will be inversed. */
int ismenu ; /* Set when do_pending called via a popup menu. */
int key_exp ; /* Set if entering exponent number. */
int new_input ; /* New number input since last op. */
int noparens ; /* Count of left brackets still to be matched. */
int numsptr ; /* Pointer into the parenthese numeric stack. */
int opsptr ; /* Pointer into the parentheses operand stack. */
int opstack[MAXSTACK] ; /* Stack containing parentheses input. */
int pending ; /* Set for command depending on multiple presses. */
int pending_n ; /* Offset into function table for pending op. */
int pending_op ; /* Arithmetic operation for pending command. */
int pointed ; /* Whether a decimal point has been given. */
int row ; /* Row number of current key/mouse press. */
int rstate ; /* Indicates if memory register frame is displayed. */
int frstate ; /* Indicates if financial memory register
frame is displayed. */
int show_paren ; /* Set if we wish to show DISPLAYITEM during parens. */
int started ; /* Set just before window is displayed. */
int toclear ; /* Indicates if display should be cleared. */
int tstate ; /* Indicates current button set being displayed. */
int funstate ; /* whether the last key pressed was a fin. func. key*/
int defState ; /* Set when calculator has just been cleared */
#ifdef hpux
int keybdID;
#endif
} CalcVars ;
typedef struct calcVars *Vars ;
/* Structure, resource definitions, for View's optional parameters. */
typedef struct
{
short menuBar;
int accuracy;
char *base;
char *display;
char *mode;
char *trigType;
char *session;
} ApplicationArgs, *ApplicationArgsPtr;
ApplicationArgs application_args;
/* MP definitions. */
#define C_abs(x) ((x) >= 0 ? (x) : -(x))
#define dabs(x) (double) C_abs(x)
#define min(a, b) ((a) <= (b) ? (a) : (b))
#define max(a, b) ((a) >= (b) ? (a) : (b))
#define dmax(a, b) (double) max(a, b)
#define dmin(a, b) (double) min(a, b)
BOOLEAN ibool P((double)) ;
BOOLEAN ibool2 P((double)) ;
char *convert P((char *)) ;
char *get_resource P((enum res_type)) ;
char *make_eng_sci P((int *)) ;
char *make_fixed P((int *, int)) ;
char *make_number P((int *, BOOLEAN)) ;
double mppow_di P((double *, int *)) ;
double mppow_ri P((float *, int *)) ;
double setbool P((BOOLEAN)) ;
int char_val P((int)) ;
int get_bool_resource P((enum res_type, int *)) ;
int get_index P((int)) ;
int get_int_resource P((enum res_type, int *)) ;
int get_str_resource P((enum res_type, char *)) ;
int main P((int, char **)) ;
void beep P(()) ;
void check_ow_beep P(()) ;
void clear_display P(()) ;
void doerr P((char *)) ;
void do_accuracy P(()) ;
void do_ascii P(()) ;
void do_base P(()) ;
void set_base P(()) ;
void do_business P(()) ;
void do_calc P(()) ;
void do_dtcalc P((int, char **)) ;
void do_clear P(()) ;
void do_constant P(()) ;
void do_delete P(()) ;
void do_exchange P(()) ;
void do_expno P(()) ;
void do_factorial P((int *, int *)) ;
void do_frame P(()) ;
void do_function P(()) ;
void do_immed P(()) ;
void do_keys P(()) ;
void do_mode P(()) ;
void do_none P(()) ;
void do_number P(()) ;
void do_numtype P(()) ;
void do_paren P(()) ;
void do_nothing P(()) ;
void do_pending P(()) ;
void do_point P(()) ;
void do_portion P(()) ;
double do_round P((double, int)) ;
void do_shift P(()) ;
void do_sto_rcl P(()) ;
void do_trig P(()) ;
void do_trigtype P(()) ;
void draw_button P((int, enum fcp_type, int, int, int)) ;
void get_display P(()) ;
void get_key_val P((char *, char *)) ;
void get_label P((int)) ;
void get_options P((int, char **)) ;
void getparam P((char *, char **, char *)) ;
void get_rcfile P((char *)) ;
void grey_button P((int, int, int)) ;
void grey_buttons P((enum base_type)) ;
void handle_menu_selection P((int, int)) ;
void handle_selection P(()) ;
void initialise P(()) ;
void init_cmdline_opts P(()) ;
void init_graphics P(()) ;
void init_options P(()) ;
void init_text P(()) ;
void init_vars P(()) ;
void key_init P(()) ;
void load_resources P(()) ;
void make_frames P(()) ;
void make_items P(()) ;
void make_modewin P(()) ;
void make_fin_registers P(()) ;
void make_registers P((int)) ;
void MPstr_to_num P((char *, enum base_type, int *)) ;
void paren_disp P((int)) ;
void process_event P((int)) ;
void process_item P((int)) ;
void process_parens P((int)) ;
void process_stack P((int, int, int)) ;
void process_str P((char *, enum menu_type)) ;
void push_num P((int *)) ;
void push_op P((int)) ;
void put_resource P((enum res_type, char *)) ;
void read_rcfiles P(()) ;
void read_resources P(()) ;
void redraw_buttons P(()) ;
void save_cmdline P((int, char **)) ;
void save_pending_values P((int)) ;
void save_resources P((char *)) ;
void blank_display P(()) ;
void set_item P((enum item_type, char *)) ;
void set_title P((enum fcp_type, char *)) ;
void show_ascii_frame P(()) ;
void show_display P((int *)) ;
void srand48 P(()) ;
void start_tool P(()) ;
void switch_hands P((int)) ;
void usage P((char *)) ;
void win_display P((enum fcp_type, int)) ;
void write_cmdline P(()) ;
void write_rcfile P((enum menu_type, int, int, char *, char *)) ;
void write_resources P((char *)) ;
void RestoreSession P(()) ;
void TimerEvent P(( XtPointer, XtIntervalId *)) ;
void ErrDialog P(( char *, Widget ));
/* MP routines not found in the Brent FORTRAN package. */
void mpacos P((int *, int *)) ;
void mpacosh P((int *, int *)) ;
void mpasinh P((int *, int *)) ;
void mpatanh P((int *, int *)) ;
void mplog10 P((int *, int *)) ;
/* Brent MP routines in mp.c. */
int mpcmpi P((int *, int *)) ;
int mpcmpr P((int *, float *)) ;
int mpcomp P((int *, int *)) ;
int pow_ii P((int *, int *)) ;
int mpeq P((int *, int *)) ;
int mpge P((int *, int *)) ;
int mpgt P((int *, int *)) ;
int mple P((int *, int *)) ;
int mplt P((int *, int *)) ;
void mpabs P((int *, int *)) ;
void mpadd P((int *, int *, int *)) ;
void mpadd2 P((int *, int *, int *, int *, int *)) ;
void mpadd3 P((int *, int *, int *, int *, int *)) ;
void mpaddi P((int *, int *, int *)) ;
void mpaddq P((int *, int *, int *, int *)) ;
void mpart1 P((int *, int *)) ;
void mpasin P((int *, int *)) ;
void mpatan P((int *, int *)) ;
void mpcdm P((double *, int *)) ;
void mpchk P((int *, int *)) ;
void mpcim P((int *, int *)) ;
void mpcmd P((int *, double *)) ;
void mpcmf P((int *, int *)) ;
void mpcmi P((int *, int *)) ;
void mpcmim P((int *, int *)) ;
void mpcmr P((int *, float *)) ;
void mpcos P((int *, int *)) ;
void mpcosh P((int *, int *)) ;
void mpcqm P((int *, int *, int *)) ;
void mpcrm P((float *, int *)) ;
void mpdiv P((int *, int *, int *)) ;
void mpdivi P((int *, int *, int *)) ;
void mperr P(()) ;
void mpexp P((int *, int *)) ;
void mpexp1 P((int *, int *)) ;
void mpext P((int *, int *, int *)) ;
void mpgcd P((int *, int *)) ;
void mpln P((int *, int *)) ;
void mplns P((int *, int *)) ;
void mpmaxr P((int *)) ;
void mpmlp P((int *, int *, int *, int *)) ;
void mpmul P((int *, int *, int *)) ;
void mpmul2 P((int *, int *, int *, int *)) ;
void mpmuli P((int *, int *, int *)) ;
void mpmulq P((int *, int *, int *, int *)) ;
void mpneg P((int *, int *)) ;
void mpnzr P((int *, int *, int *, int *)) ;
void mpovfl P((int *)) ;
void mppi P((int *)) ;
void mppwr P((int *, int *, int *)) ;
void mppwr2 P((int *, int *, int *)) ;
void mprec P((int *, int *)) ;
void mproot P((int *, int *, int *)) ;
void mpset P((int *, int *, int *)) ;
void mpsin P((int *, int *)) ;
void mpsin1 P((int *, int *, int *)) ;
void mpsinh P((int *, int *)) ;
void mpsqrt P((int *, int *)) ;
void mpstr P((int *, int *)) ;
void mpsub P((int *, int *, int *)) ;
void mptanh P((int *, int *)) ;
void mpunfl P((int *)) ;
/* Help routines */
void Help P((char *, char *)) ;
void HelpRequestCB P(()) ;
void HelpModeCB P(()) ;
void HelpCloseCB P(()) ;
void HelpHyperlinkCB P(()) ;
void DisplayHelp P((char *, char *)) ;
void CenterMsgCB P(()) ;
void HelpHelp P(()) ;
void SetWmHnts P(()) ;
void _DtmapCB P((Widget, XtPointer, XtPointer)) ;
void set_option_menu P((int, int)) ;

View File

@@ -0,0 +1,39 @@
/* $XConsortium: ds_common.c /main/3 1995/11/01 12:39:41 rswiston $ */
/* *
* ds_common.c *
* Contains some common functions used throughout the Desktop *
* Calculator. *
* *
* (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. *
*/
#include <stdio.h>
#include "ds_common.h"
#define FREE (void) free
#define STRCPY (void) strcpy
void
read_str(str, value)
char **str, *value ;
{
if (*str != NULL) FREE(*str) ;
if (value != NULL && strlen(value))
{
*str = (char *) malloc((unsigned) (strlen(value) + 1)) ;
STRCPY(*str, value) ;
}
else *str = NULL ;
}
char *
set_bool(value)
int value ;
{
return((value) ? "true" : "false") ;
}

View File

@@ -0,0 +1,31 @@
/* $XConsortium: ds_common.h /main/3 1995/11/01 12:39:51 rswiston $ */
/* *
* ds_common.h *
* Contains the NO_PROTO defines for functions is ds_common.h. *
* *
* (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. *
*/
#ifndef _ds_common_h
#define _ds_common_h
#include <X11/Xlib.h>
#include <X11/Xresource.h>
#include <X11/Intrinsic.h>
/* For all function declarations, if ANSI then use a prototype. */
#if defined(__STDC__)
#define P(args) args
#else /* ! __STDC__ */
#define P(args) ()
#endif /* STDC */
char *set_bool P((int)) ;
void read_str P((char **, char *)) ;
#endif /*_ds_common_h*/

View File

@@ -0,0 +1,205 @@
/* $XConsortium: ds_popup.c /main/5 1996/03/25 18:18:07 ageorge $ */
/* *
* ds_popup.c *
* Contains some common functions used by the popups throughout *
* the Desktop Calculator. *
* *
* (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. *
*/
#include <Xm/Xm.h>
#include <Xm/XmP.h>
#include <Xm/VendorSEP.h>
/* Copied from BaseClassI.h */
extern XmWidgetExtData _XmGetWidgetExtData(
Widget widget,
#if NeedWidePrototypes
unsigned int extType) ;
#else
unsigned char extType) ;
#endif /* NeedWidePrototypes */
#include <X11/ShellP.h>
#include <X11/Shell.h>
#include "calctool.h"
#include "motif.h"
void _DtChildPosition P((Widget, Widget, Position *, Position *)) ;
/* ARGSUSED */
void
_DtmapCB(
Widget w,
XtPointer client_data,
XtPointer call_data )
{
Arg args[2];
Widget parent;
Position newX, newY;
parent = (Widget)client_data;
if (parent)
{
_DtChildPosition(w, parent, &newX, &newY);
XtSetArg(args[0], XmNx, newX);
XtSetArg(args[1], XmNy, newY);
XtSetValues(w, args, 2);
XSync(X->dpy, False);
}
}
/*
*/
void
_DtMappedCB(
Widget w,
XtPointer client_data,
XtPointer call_data )
{
_DtmapCB(w, client_data, call_data);
XtRemoveCallback(w, XmNmapCallback, (XtCallbackProc)_DtMappedCB,
client_data);
}
/*
* This is the generic function for registering the map callback.
*/
void
_DtGenericMapWindow (
Widget shell,
Widget parent )
{
XtAddCallback (parent, XmNmapCallback,
(XtCallbackProc)_DtMappedCB, (XtPointer) shell);
}
/*
* _DtChildPosition:
* Choose a position for a popup window ("child") so that the main
* window ("parent") is not obscured. The child will be positioned
* to the right, below, left, or above the parent, depending on where
* there is the most space.
*/
void
_DtChildPosition(
Widget w,
Widget parent,
Position *newX,
Position *newY)
{
Position pY, pX;
XmVendorShellExtObject vendorExt;
XmWidgetExtData extData;
int xOffset, yOffset;
int pHeight, myHeight, sHeight;
int pWidth, myWidth, sWidth;
enum { posRight, posBelow, posLeft, posAbove } pos;
int space;
/* get x, y offsets for the parent's window frame */
extData = _XmGetWidgetExtData(parent, XmSHELL_EXTENSION);
if (extData)
{
vendorExt = (XmVendorShellExtObject)extData->widget;
xOffset = vendorExt->vendor.xOffset;
yOffset = vendorExt->vendor.yOffset;
}
else
xOffset = yOffset = 0;
/* get size/position of screen, parent, and widget */
sHeight = HeightOfScreen(XtScreen(parent));;
sWidth = WidthOfScreen(XtScreen(parent));
pX = XtX(parent) - xOffset;
pY = XtY(parent) - yOffset;
pHeight = XtHeight(parent) + yOffset + xOffset;
pWidth = XtWidth(parent) + 2*xOffset;
myHeight = XtHeight(w) + yOffset + xOffset;
myWidth = XtWidth(w) + 2*xOffset;
/*
* Determine how much space would be left if the child was positioned
* to the right, below, left, or above the parent. Choose the child
* positioning so that the maximum space is left.
*/
pos = posBelow;
space = sHeight - (pY + pHeight + myHeight);
if (pY - myHeight > space)
{
pos = posAbove;
space = pY - myHeight;
}
if(space <= 0)
{
pos = posRight;
sWidth - (pX + pWidth + myWidth);
if (pX - myWidth > space)
{
pos = posLeft;
space = pX - myWidth;
}
}
/* Given relative positioning, determine x, y coordinates for the child */
switch (pos)
{
case posRight:
*newX = pX + pWidth - 5;
*newY = pY + (pHeight - myHeight)/2;
break;
case posBelow:
*newX = pX + (pWidth - myWidth)/2;
*newY = pY + pHeight;
break;
case posLeft:
*newX = pX - myWidth + 10;
*newY = pY + (pHeight - myHeight)/2;
break;
case posAbove:
*newX = pX + (pWidth - myWidth)/2;
*newY = pY - myHeight;
break;
}
/*
* Defect 177440, put HelpDialog within the monitor
*/
if ( *newX < 0 )
*newX = 0;
if ( *newY < 0 )
*newY = 0;
if ( ( *newX + myWidth ) > sWidth ) {
Position _tmp;
_tmp = sWidth - myWidth;
if ( _tmp >= 0 )
*newX = _tmp;
}
if ( ( *newY + myHeight ) > sHeight ) {
Position _tmp;
_tmp = sHeight - myHeight;
if ( _tmp >= 0 )
*newY = _tmp;
}
}

View File

@@ -0,0 +1,44 @@
/* $XConsortium: ds_popup.h /main/3 1995/11/01 12:40:17 rswiston $ */
/* *
* ds_popup.h *
* Contains the NO_PROTO defines for functions is ds_popup.h. *
* *
* (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. *
*/
#ifndef _ds_popup_h
#define _ds_popup_h
#include <X11/Xlib.h>
#include <X11/Intrinsic.h>
#include <Xm/Xm.h>
/* For all function declarations, if ANSI then use a prototype. */
#if defined(__STDC__)
#define P(args) args
#else /* ! __STDC__ */
#define P(args) ()
#endif /* STDC */
/* Location ops for ds_position_popup(). */
enum ds_location_op {
DS_POPUP_RIGHT, /* Place popup to right of baseframe */
DS_POPUP_LEFT, /* Place popup to left of baseframe */
DS_POPUP_ABOVE, /* Place popup above baseframe */
DS_POPUP_BELOW, /* Place popup below baseframe */
DS_POPUP_LOR, /* Place popup to right or left of baseframe */
DS_POPUP_AOB, /* Place popup above or below baseframe */
DS_POPUP_CENTERED /* Center popup within baseframe */
} ;
int ds_position_popup P((Widget, Widget, enum ds_location_op)) ;
int ds_force_popup_on_screen P((Widget, int *, int *)) ;
void ds_get_screen_size P((Widget, int *, int *)) ;
#endif /*!_ds_popup_h*/

View File

@@ -0,0 +1,69 @@
/* $XConsortium: ds_widget.c /main/5 1996/09/23 11:20:59 mustafa $ */
/* *
* ds_widet.c *
* Contains some common functions which create some Xm widget which *
* are used throughout the Desktop Calculator. *
* *
* (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. *
*/
#include <stdio.h>
#include <limits.h>
#include "ds_widget.h"
#ifndef LINT_CAST
#ifdef lint
#define LINT_CAST(arg) (arg ? 0 : 0)
#else
#define LINT_CAST(arg) (arg)
#endif /*lint*/
#endif /*LINT_CAST*/
struct tW_struct *
make_textW(owner, label)
Widget owner ;
char *label ;
{
struct tW_struct *w ;
w = (struct tW_struct *) LINT_CAST(calloc(1, sizeof(struct tW_struct))) ;
w->manager = XtVaCreateManagedWidget("manager",
xmRowColumnWidgetClass,
owner,
XmNorientation, XmHORIZONTAL,
XmNnumColumns, 1,
NULL) ;
w->label = XtVaCreateManagedWidget(label,
xmLabelWidgetClass,
w->manager,
XmNalignment, XmALIGNMENT_BEGINNING,
NULL) ;
w->textfield = XtVaCreateManagedWidget("textfield",
xmTextFieldWidgetClass,
w->manager,
XmNmaxLength, INT_MAX,
NULL) ;
return(w) ;
}
void
set_text_str(w, ttype, str)
struct tW_struct *w ;
enum text_type ttype ;
char *str ;
{
XmString cstr ;
switch (ttype)
{
case T_LABEL : cstr = XmStringCreateLocalized(str) ;
XtVaSetValues(w->label, XmNlabelString, cstr, 0) ;
XmStringFree(cstr) ;
break ;
case T_VALUE : XmTextFieldSetString(w->textfield, str) ;
}
}

View File

@@ -0,0 +1,71 @@
/* $XConsortium: ds_widget.h /main/3 1995/11/01 12:40:37 rswiston $ */
/* *
* ds_widget.h *
* Contains the NO_PROTO defines for functions is ds_widget.h. *
* *
* (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. *
*/
#ifndef _ds_widget_h
#define _ds_widget_h
#include <X11/Xlib.h>
#include <X11/Xresource.h>
#include <X11/Intrinsic.h>
#include <Xm/Xm.h>
#include <Xm/Label.h>
#include <Xm/Separator.h>
#include <Xm/RowColumn.h>
#include <Xm/ToggleB.h>
#include <Xm/PushB.h>
#include <Xm/TextF.h>
/* For all function declarations, if ANSI then use a prototype. */
#if defined(__STDC__)
#define P(args) args
#else /* ! __STDC__ */
#define P(args) ()
#endif /* STDC */
enum choice_type { CH_ACTIVE, CH_VALUE } ; /* Choice operations. */
/* Text widget operations. */
enum text_type { T_ACTIVE, T_CARET, T_LABEL, T_VALUE } ;
struct cW_struct { /* Choice widget structure. */
Widget lmanager ; /* xmRowColumnWidget Class. */
Widget label ; /* xmLabelWidgetClass. */
Widget cmanager ; /* xmRowColumnWidgetClass. */
Widget *choices ; /* xmToggleButtonWidgetClass. */
int maxno ; /* Number of choice elements. */
int isexclusive ; /* Exclusive choice. */
void (*func)() ; /* Callback (if any) for this choice. */
} ;
struct tW_struct { /* Text widget structure. */
Widget manager ; /* xmRowColumnWidgetClass. */
Widget label ; /* xmLabelWidgetClass. */
Widget textfield ; /* xmTextWidgetClass. */
} ;
int get_choice P((struct cW_struct *, enum choice_type)) ;
struct cW_struct *make_choiceW P((Widget, char *, char **, int, int,
int, void (*)())) ;
struct tW_struct *make_textW P((Widget, char *)) ;
Widget make_butW P((Widget, char *)) ;
Widget make_labelW P((Widget, char *)) ;
Widget make_manW P((char *, Widget, int, int)) ;
Widget make_toggleW P((Widget, char *)) ;
void set_choice P((struct cW_struct *, enum choice_type, int)) ;
void set_choice_help P((struct cW_struct *, char *)) ;
void set_text_help P((struct tW_struct *, char *)) ;
void set_text_str P((struct tW_struct *, enum text_type, char *)) ;
#endif /*_ds_widget_h*/

View File

@@ -0,0 +1,278 @@
/* $XConsortium: ds_xlib.c /main/3 1995/11/01 12:40:45 rswiston $ */
/* *
* ds_xlib.c *
* Contains some common functions which use the xlib library used *
* throughout the Desktop Calculator. *
* *
* (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. *
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/param.h>
#include <sys/stat.h>
#include "ds_xlib.h"
#include <X11/Xutil.h>
#include <X11/StringDefs.h>
#include <Xm/Xm.h>
#include <Xm/Protocols.h>
#define FREE (void) free
#define FPRINTF (void) fprintf
#define GETHOSTNAME (void) gethostname
#define SPRINTF (void) sprintf
#define STRCPY (void) strcpy
#define EQUAL(a, b) !strncmp(a, b, strlen(b))
#define MAXLINE 120 /* Maximum length for character strings. */
/* Function: ds_beep()
*
* Purpose: Ring the bell (at base volume).
*
* Parameters: display connection to the X server.
* (returned from XOpenDisplay).
*
* Returns: None.
*/
void
ds_beep(display)
Display *display ;
{
XBell(display, 0) ;
}
/* Function: ds_get_resource()
*
* Purpose: Get an X resource from the server.
*
* Parameters: rDB X resources database.
*
* appname application name.
*
* resource X resource string to search for.
*
* Returns: resource string, or NULL if not found.
*
* Note: The first character of the appname and resource strings may
* be modified.
*/
char *
ds_get_resource(rDB, appname, resource)
XrmDatabase rDB ; /* Resources database. */
char *appname ; /* Application name. */
char *resource ; /* X resource to search for. */
{
char app[MAXLINE], res[MAXLINE] ;
char cstr[MAXLINE], nstr[MAXLINE], str[MAXLINE] ;
char *str_type[20] ;
XrmValue value ;
STRCPY(app, appname) ;
STRCPY(res, resource) ;
if (isupper(app[0])) app[0] = tolower(app[0]) ;
SPRINTF(nstr, "%s.%s", app, res) ;
if (islower(res[0])) res[0] = toupper(res[0]) ;
if (islower(app[0])) app[0] = toupper(app[0]) ;
SPRINTF(cstr, "%s.%s", app, res) ;
if (XrmGetResource(rDB, nstr, cstr, str_type, &value) == 0)
return((char *) NULL) ;
else return(value.addr) ;
}
/* Function: ds_load_resources()
*
* Purpose: Get the resource databases. These are looked for in the
* following ways:
*
* Classname file in the app-defaults directory.
*
* Classname file in the directory specified by the
* XUSERFILESEARCHPATH or XAPPLRESDIR environment variable.
*
* Property set using xrdb, accessible through the
* XResourceManagerString macro or, if that is empty, the
* ~/.Xdefaults file.
*
* XENVIRONMENT environment variable or, if not set,
* .Xdefaults-hostname file.
*
* DTCALCDEF environment variable or, if not set, the
* ~/.dtcalcdef file
*
* Parameters: display connection to the X server.
* (returned from XOpenDisplay).
*
* Returns: X combined resources database.
*/
XrmDatabase
ds_load_resources(display)
Display *display ;
{
XrmDatabase db, rDB ;
char *home, name[MAXPATHLEN], *ptr ;
int len ;
rDB = NULL ;
home = getenv("HOME") ;
XrmInitialize() ;
/* Merge server defaults, created by xrdb. If nor defined, use ~/.Xdefaults. */
if (XResourceManagerString(display) != NULL)
db = XrmGetStringDatabase(XResourceManagerString(display)) ;
else
{
SPRINTF(name, "%s/.Xdefaults", home) ;
db = XrmGetFileDatabase(name) ;
}
XrmMergeDatabases(db, &rDB) ;
/* Open XENVIRONMENT file or, if not defined, the .Xdefaults, and merge
* into existing database.
*/
if ((ptr = getenv("XENVIRONMENT")) == NULL)
{
SPRINTF(name, "%s/.Xdefaults-", home) ;
len = strlen(name) ;
GETHOSTNAME(name+len, 1024-len) ;
db = XrmGetFileDatabase(name) ;
}
else db = XrmGetFileDatabase(ptr) ;
XrmMergeDatabases(db, &rDB) ;
/* Finally merge in Dtcalc defaults via DTCALCDEF or, if not
* defined, the ~/.dtcalcdef file.
*/
if ((ptr = getenv("DTCALCDEF")) == NULL)
{
SPRINTF(name, "%s/.dtcalcdef", home) ;
db = XrmGetFileDatabase(name) ;
}
else db = XrmGetFileDatabase(ptr) ;
XrmMergeDatabases(db, &rDB) ;
return(rDB) ;
}
/* Function: ds_put_resource()
*
* Purpose: Adds an X resource string (name and value) to a resources
* database.
*
* Parameters: rDB X resources database.
*
* appname application name.
*
* rstr X resource string name.
*
* rval X resource string value.
*
* Returns: None.
*
* Note: The first character of the appname and resource strings may
* be modified.
*/
void
ds_put_resource(rDB, appname, rstr, rval)
XrmDatabase *rDB ;
char *appname, *rstr, *rval ;
{
char app[MAXLINE], resource[MAXLINE] ;
STRCPY(app, appname) ;
if (isupper(app[0])) app[0] = tolower(app[0]) ;
SPRINTF(resource, "%s.%s", app, rstr) ;
XrmPutStringResource(rDB, resource, rval) ;
}
/* Function: ds_save_cmdline()
*
* Purpose: Save away the application command line options.
*
* Parameters: display connection to the X server.
* (returned from XOpenDisplay).
*
* w The id of the applications main window.
*
* argc Number of command line options.
*
* argv An array of command line options.
*
* Returns: None.
*/
void
ds_save_cmdline(display, w, argc, argv)
Display *display ;
Window w ;
int argc ;
char **argv ;
{
XSetCommand(display, w, argv, argc) ;
}
/* Function: ds_save_resources()
*
* Purpose: Save away the resources database to the file given by the
* DTCALCDEF environment variable (if set), or
* to $HOME/.dtcalcdef.
*
* Parameters: rDB X resources database to save.
*
* Returns: 1 if cannot access resource database to write.
* 0 on successful completion.
*/
int
ds_save_resources(rDB, filename)
XrmDatabase rDB ;
char *filename;
{
char *home;
struct stat statbuf ;
if(filename == NULL)
{
if ((filename = getenv("DTCALCDEF")) == NULL)
{
home = getenv("HOME") ;
filename = (char*) calloc(1, strlen(home) + 18) ;
SPRINTF(filename, "%s/.dtcalcdef", home) ;
}
}
/* If file exists but user does not have access. */
if (stat(filename, &statbuf) != -1 && access(filename, W_OK) != 0)
{
FREE(filename) ;
return(1) ;
}
/* If file does not exist this call will create it. */
XrmPutFileDatabase(rDB, filename) ;
FREE(filename) ;
return(0) ;
}

View File

@@ -0,0 +1,47 @@
/* $XConsortium: ds_xlib.h /main/3 1995/11/01 12:40:54 rswiston $ */
/* *
* ds_xlib.h *
* Contains the NO_PROTO defines for functions is ds_xlib.h. *
* *
* (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. *
*/
#ifndef _ds_xlib_h
#define _ds_xlib_h
#include <X11/Xlib.h>
#include <X11/Xresource.h>
#include <X11/Intrinsic.h>
#include <Xm/Xm.h>
/* For all function declarations, if ANSI then use a prototype. */
#if defined(__STDC__)
#define P(args) args
#else /* ! __STDC__ */
#define P(args) ()
#endif /* STDC */
/* Function declarations. */
char *ds_get_resource P((XrmDatabase, char *, char *)) ;
int ds_get_choice_value P((Widget)) ;
int ds_get_strwidth P((XFontStruct *, char *)) ;
int ds_save_resources P((XrmDatabase, char *)) ;
void ds_add_help P((Widget, char *)) ;
void ds_beep P((Display *)) ;
void ds_get_geometry_size P((char *, int *, int *)) ;
void ds_get_frame_size P((Widget, int *, int *, int *, int *)) ;
void ds_put_resource P((XrmDatabase *, char *, char *, char *)) ;
void ds_save_cmdline P((Display *, Window, int, char **)) ;
void ds_set_choice_value P((Widget, int)) ;
void ds_set_frame_size P((Widget, int, int, int, int)) ;
XrmDatabase ds_load_resources P((Display *)) ;
#endif /*_ds_xlib_h*/

View File

@@ -0,0 +1,145 @@
.\" $XConsortium: dtcalc.man /main/2 1995/07/17 10:50:28 drk $
.TH DTCALC 1X "" "" "" ""
.ds ]W CDE 1.0 (2/94)
.na
.SH NAME
\fBdtcalc \(em The Common Desktop Environment Calculator.\fP
.sp 1
.SH SYNOPSIS
\fBdtcalc\fP
[-a accuracy] [-m mode] [-b numeric_base] [-notation display_notation]
[-trig trigonometric_type] [-session session_file] [-no_menu_bar]
.sp 1
.SH DESCRIPTION
The \fIDtcalc\fP program is a calculator for use within the Common
Desktop Environment. It provides an easy to use interface designed to
give access to common arithmetic and financial calculations.
.P
The calculator is designed to operate in much the same way as many
hand-held calculators. It provides three modes of operation: scientific,
financial, and logical. The default operation is scientific, but with
the easy to use GUI changing to the modes of operation are easy. When
the operation mode is changed, a number of the keys change for the new
operations.
.P
.P
.P
.sp 1
.SH OPTIONS
\fIDtcalc\fP defines a number of command-line options which allow the user
to configure how the calculator displays itself. Command-line options have a
higher precedence then resources. By using command-line options
a user can override anything specified in a resource file.
.IP "\fB-a \fP\fI<accuracy>\fP"
.br
This is the initial number of digits displayed after the numeric point.
This value must be in the range 0 to 9. The default value is 2.
.IP "\fB-m \fP\fI<mode>\fP"
.br
This determines which mode the calculator will display itself in.
There are three modes of operation: scientific, financial, or logical.
Some of the calculator keys change when it changes between different
modes.
.IP "\fB-b \fP\fI<numeric_base>\fP"
.br
This determines which numeric base the calculator will use when it does
calculations. There are four bases the calculator supports: binary (base 2),
octal (base 8), decimal (base 10), or hexidecimal (base 16). The default
is decimal.
.IP "\fB-notation \fP\fI<display_notation>\fP"
.br
This determines how the answers are to be display on the calculator.
There are three ways of displaying answers on the calculator: scientific,
engineering, and fixed. The default is fixed.
.IP "\fB-trig \fP\fI<trigonometric_type>\fP"
.br
This determines how answers are presented when the calculator is in
scientific mode. There are three trigonometric ways to present the answers:
degrees, radians, or gradients. The default is degrees.
.IP "\fB-no_menu_bar\fP"
.br
This option makes the calculator come up with no menubar.
.IP "\fB-session \fP\fI<session_file>\fP"
.br
This option takes the name of a session file as an additional parameter.
\fIDtcalc\fP is run with the specified session file name. This session
file is a file that was previously saved by \fIdtcalc\fP during a session
shutdown.
.sp 1
.SH RESOURCES
.P
The Calculator supports a number of resources which make it much more
configurable. Following is the list of supported resources and their default
values.
.sp 2
.TS
center;
CB sss
lB lB lB lB
l l l l .
Client Resource Set
Name Class Type Default
_
postMenuBar PostMenuBar Boolean True
accuracy accuracy int 2
base Base string decimal
display Display string fixed
mode Mode string scientific
trigType TrigType string degrees
.TE
.ps
.sp 1
.IP "\fBDtcalc*postMenuBar:\fP"
Specifies wheither the menu bar should appear or not.
.IP "\fBDtcalc*accuracy:\fP"
Specifies wheither the menu bar should appear or not.
.IP "\fBDtcalc*base:\fP"
This resource allows the user to change the default for the numeric base
the calculator uses when it does its calculations. The default is "decimal"
which is base 10. Possible values are:
.br
.sp 1
\fBbinary (or bin):\fP do calculations in base 2.
.br
.sp 1
\fBoctal (or oct):\fP do calculations in base 8.
.br
.sp 1
\fBdecimal (or dec):\fP do calculations in base 10.
.br
.sp 1
\fBhexidecimal (or hex):\fP do calculations in base 16.
.IP "\fBDtcalc*display:\fP"
This resource allows the user to change the default for the way answers are
display on the calculator. The default is "fixed". Possible values are:
.br
.sp 1
\fBfixed (or fix):\fP display in fixed mode.
.br
.sp 1
\fBscientific (or sci):\fP display in scientific mode.
.br
.sp 1
\fBengineering (or eng):\fP display in engineering mode.
.br
.sp 1
\fBhexidecimal:\fP do calculations in base 16.
.sp 2
.SH FEATURES
.P
.IP "\fBMemory Register\fP"
.IP "\fBFinancial Register\fP"
.IP "\fBASCII Converter\fP"
.IP "\fBFunctions\fP"
.IP "\fBConstants\fP"
.IP "\fBHelp\fP"
.IP "\fBPopup Menu Support\fP"
.SH COPYRIGHT
(c) Copyright 1994 Hewlett-Packard Company
.IP
(c) Copyright 1994 International Business Machines Corp.
.IP
(c) Copyright 1994 Sun Microsystems, Inc.
.sp 1
.SH ORIGIN
Hewlett-Packard Company, WTD-CV.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

564
cde/programs/dtcalc/help.c Normal file
View File

@@ -0,0 +1,564 @@
/* $XConsortium: help.c /main/4 1996/03/25 13:12:20 ageorge $ */
/* *
* help.c *
* Contains all support for help in the Calculator. *
* *
* (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. *
*/
#include <Xm/Xm.h>
#include <Xm/XmP.h>
#include <Xm/MwmUtil.h>
#include <Xm/MessageB.h>
#include <Dt/Dt.h>
#include <Dt/HelpDialog.h>
#include "calctool.h"
#include "motif.h"
#define DIALOG_MWM_FUNC MWM_FUNC_MOVE | MWM_FUNC_CLOSE
extern char *base_str[] ; /* Strings for each base value. */
extern char *dtype_str[] ; /* Strings for each display mode value. */
extern char *mode_str[] ; /* Strings for each mode value. */
extern char *ttype_str[] ; /* Strings for each trig type value. */
extern Vars v ; /* Calctool variables and options. */
extern struct button buttons[] ; /* Calculator button values. */
extern Boolean ignore_event;
extern XtIntervalId timerId;
extern void _DtChildPosition P((Widget, Widget, Position *, Position *)) ;
typedef struct _helpStruct {
struct _helpStruct *pNext;
struct _helpStruct *pPrev;
Widget dialog;
Boolean inUse;
} HelpStruct;
static Widget GetHelpDialog P(()) ;
static void UnmanageCB P(()) ;
void
Help(helpVolume, locationId)
char *helpVolume;
char *locationId;
{
Arg args[10];
Position newX, newY;
int n;
if(X->helpDialog == NULL)
{
n = 0;
XtSetArg(args[n], DtNhelpType, DtHELP_TYPE_TOPIC); n++;
XtSetArg(args[n], DtNhelpVolume, helpVolume); n++;
XtSetArg(args[n], DtNlocationId, locationId); n++;
XtSetArg(args[n], XmNtitle, GETMESSAGE(4, 1, "Calculator - Help")); n++;
X->helpDialog = DtCreateHelpDialog(X->mainWin, "helpDlg", args, n);
DtWsmRemoveWorkspaceFunctions(X->dpy,
XtWindow(XtParent(X->helpDialog)));
XtAddCallback(X->helpDialog, DtNhyperLinkCallback,
(XtCallbackProc)HelpHyperlinkCB, NULL);
XtAddCallback(X->helpDialog, DtNcloseCallback,
(XtCallbackProc)HelpCloseCB, NULL);
}
else
{
n = 0;
XtSetArg(args[n], DtNhelpType, DtHELP_TYPE_TOPIC); n++;
XtSetArg(args[n], DtNhelpVolume, helpVolume); n++;
XtSetArg(args[n], DtNlocationId, locationId); n++;
XtSetValues(X->helpDialog, args, n);
}
XtSetMappedWhenManaged(XtParent(X->helpDialog), False);
XSync(X->dpy, False);
XtManageChild(X->helpDialog) ;
_DtChildPosition(X->helpDialog, X->kframe, &newX, &newY);
XtSetArg(args[0], XmNx, newX);
XtSetArg(args[1], XmNy, newY);
XtSetValues(X->helpDialog, args, 2);
XtSetMappedWhenManaged(XtParent(X->helpDialog), True);
XSync(X->dpy, False);
XtMapWidget(XtParent(X->helpDialog));
X->helpMapped = True;
}
void
HelpCloseCB(widget, client_data, call_data)
Widget widget;
caddr_t client_data, call_data;
{
HelpStruct *pHelpCache = (HelpStruct *)client_data;
HelpStruct *pHelp;
for (pHelp = pHelpCache; pHelp != (HelpStruct *)NULL && pHelp->dialog !=widget;
pHelp = pHelp->pNext);
if (pHelp != (HelpStruct *)NULL)
{
pHelp->inUse = False;
}
XtUnmapWidget(XtParent(widget));
X->helpMapped = False;
}
void
HelpHyperlinkCB(widget, client_data, call_data)
Widget widget;
caddr_t client_data, call_data;
{
DtHelpDialogCallbackStruct *pHyper = (DtHelpDialogCallbackStruct *) call_data;
switch(pHyper->hyperType)
{
case DtHELP_LINK_TOPIC:
DisplayHelp(pHyper->helpVolume, pHyper->locationId);
break;
default:
;
}
}
void
HelpRequestCB(widget, client_data, call_data)
Widget widget;
caddr_t client_data, call_data;
{
char *helpVolume, *locationId;
int topic;
topic = ((int) client_data) & 0xFFFF;
helpVolume = HELP_VOLUME;
if(topic < 56)
{
switch (topic)
{
case 0:
locationId = HELP_BLANK_STR;
break;
case 8:
locationId = HELP_ACC_STR;
break;
case 12:
if(v->modetype == LOGICAL)
locationId = HELP_LSHIFT_STR;
else
locationId = buttons[topic].str;
break;
case 13:
if(v->modetype == LOGICAL)
locationId = HELP_RSHIFT_STR;
else if(v->modetype == FINANCIAL)
locationId = HELP_INT_STR;
else
locationId = buttons[topic].str;
break;
case 14:
if(v->modetype == LOGICAL)
locationId = HELP_TRUNC16_STR;
else if(v->modetype == SCIENTIFIC)
locationId = HELP_ETOX_STR;
else
locationId = buttons[topic].str;
break;
case 15:
if(v->modetype == LOGICAL)
locationId = HELP_TRUNC32_STR;
else if(v->modetype == SCIENTIFIC)
locationId = HELP_TENTOX_STR;
else
locationId = buttons[topic].str;
break;
case 16:
if(v->modetype == SCIENTIFIC)
locationId = HELP_YTOX_STR;
else
locationId = buttons[topic].str;
break;
case 17:
if(v->modetype == SCIENTIFIC)
locationId = HELP_XFACT_STR;
else if(v->modetype == FINANCIAL)
locationId = HELP_PAYPYR_STR;
else
locationId = buttons[topic].str;
break;
case 21:
if(v->modetype == LOGICAL)
locationId = HELP_BLANK_STR;
else
locationId = buttons[topic].str;
break;
case 22:
if(v->modetype == LOGICAL)
locationId = HELP_BLANK_STR;
else
locationId = buttons[topic].str;
break;
case 23:
if(v->modetype == LOGICAL || v->modetype == FINANCIAL)
locationId = HELP_BLANK_STR;
else
locationId = buttons[topic].str;
break;
case 24:
locationId = HELP_RECIP_STR;
break;
case 25:
locationId = HELP_SQUARE_STR;
break;
case 26:
locationId = HELP_SQRT_STR;
break;
case 27:
locationId = HELP_PERCENT_STR;
break;
case 28:
locationId = HELP_LPAREN_STR;
break;
case 29:
locationId = HELP_RPAREN_STR;
break;
case 35:
locationId = HELP_CHGSIGN_STR;
break;
case 39:
locationId = HELP_TIMES_STR;
break;
case 40:
locationId = HELP_SEVEN_STR;
break;
case 41:
locationId = HELP_EIGHT_STR;
break;
case 42:
locationId = HELP_NINE_STR;
break;
case 43:
locationId = HELP_DIVIDE_STR;
break;
case 44:
locationId = HELP_FOUR_STR;
break;
case 45:
locationId = HELP_FIVE_STR;
break;
case 46:
locationId = HELP_SIX_STR;
break;
case 47:
locationId = HELP_MINUS_STR;
break;
case 48:
locationId = HELP_ONE_STR;
break;
case 49:
locationId = HELP_TWO_STR;
break;
case 50:
locationId = HELP_THREE_STR;
break;
case 51:
locationId = HELP_PLUS_STR;
break;
case 52:
locationId = HELP_ZERO_STR;
break;
case 53:
locationId = HELP_DECIMAL_STR;
break;
case 54:
locationId = HELP_EQUAL_STR;
break;
default:
locationId = buttons[topic].str;
}
}
else
{
switch (topic)
{
case HELP_HELP_MENU:
locationId = HELP_HELP_MENU_STR;
break;
case HELP_INTRODUCTION:
locationId = HELP_INTRODUCTION_STR;
break;
case HELP_TABLEOFCONTENTS:
locationId = HELP_TABLEOFCONTENTS_STR;
break;
case HELP_TASKS:
locationId = HELP_TASKS_STR;
break;
case HELP_REFERENCE:
locationId = HELP_REFERENCE_STR;
break;
case HELP_ITEM:
locationId = HELP_ITEM_STR;
break;
case HELP_USING:
locationId = HELP_USING_STR;
helpVolume = HELP_USING_HELP_VOLUME;
break;
case HELP_VERSION:
locationId = HELP_VERSION_STR;
break;
case HELP_ASCII:
locationId = HELP_ASCII_STR;
break;
case HELP_CONSTANT:
locationId = HELP_CONSTANT_STR;
break;
case HELP_FUNCTION:
locationId = HELP_FUNCTION_STR;
break;
case HELP_DISPLAY:
locationId = HELP_DISPLAY_STR;
break;
case HELP_MODELINE:
locationId = HELP_MODELINE_STR;
break;
case HELP_MODE:
locationId = mode_str[(int) v->modetype];
break;
case HELP_BASE:
locationId = base_str[(int) v->base];
break;
case HELP_NOTATION:
locationId = dtype_str[(int) v->dtype];
break;
case HELP_TRIG:
locationId = ttype_str[(int) v->ttype];
break;
case HELP_MENUBAR:
locationId = HELP_MENUBAR_STR;
break;
default:
locationId = HELP_INTRODUCTION_STR;
}
}
Help(helpVolume, locationId);
ignore_event = True;
timerId = XtAppAddTimeOut (XtWidgetToApplicationContext (X->kframe), 300,
(XtTimerCallbackProc) TimerEvent, (XtPointer) NULL);
}
void
HelpModeCB(w, client_data, call_data)
Widget w;
caddr_t client_data, call_data;
{
Widget widget;
char *errorMsg, *tmp;
switch(DtHelpReturnSelectedWidgetId(X->mainWin, (Cursor)NULL, &widget))
{
case DtHELP_SELECT_VALID:
while (!XtIsShell(widget))
{
if(XtHasCallbacks(widget, XmNhelpCallback) == XtCallbackHasSome)
{
XtCallCallbacks(widget, XmNhelpCallback,
(XtPointer)client_data);
return;
}
widget = XtParent(widget);
}
break;
case DtHELP_SELECT_INVALID:
errorMsg = GETMESSAGE(4, 2, "You must select an item within Calculator");
tmp = XtNewString(errorMsg);
ErrDialog((char *) tmp, X->mainWin);
XtFree(tmp);
break;
}
}
void
DisplayHelp( helpVolume, locationId)
char *helpVolume;
char *locationId;
{
Arg args[10];
int n;
X->helpDialog = GetHelpDialog();
n = 0;
XtSetArg(args[n], DtNhelpType, DtHELP_TYPE_TOPIC); n++;
XtSetArg(args[n], DtNhelpVolume, helpVolume); n++;
XtSetArg(args[n], DtNlocationId, locationId); n++;
XtSetValues(X->helpDialog, args, n);
XtManageChild(X->helpDialog);
XtMapWidget(XtParent(X->helpDialog));
X->helpMapped = True;
}
static Widget
GetHelpDialog()
{
static HelpStruct *pHelpCache;
HelpStruct *pHelp;
Arg args[5];
int n;
if(pHelpCache == (HelpStruct *)NULL)
{
pHelp = pHelpCache = (HelpStruct *)XtMalloc(sizeof(HelpStruct));
pHelp->pNext = (HelpStruct *)NULL;
pHelp->pPrev = (HelpStruct *)NULL;
pHelp->inUse = True;
XtSetArg(args[0], XmNtitle, GETMESSAGE(4, 1, "Calculator - Help"));
pHelp->dialog = DtCreateHelpDialog(X->mainWin, "helpDlg", args, 1);
DtWsmRemoveWorkspaceFunctions(X->dpy,
XtWindow(XtParent(pHelp->dialog)));
XtAddCallback(pHelp->dialog, DtNhyperLinkCallback,
(XtCallbackProc)HelpHyperlinkCB, NULL);
XtAddCallback(pHelp->dialog, DtNcloseCallback,
(XtCallbackProc)HelpCloseCB, pHelpCache);
return pHelp->dialog;
}
else
{
for(pHelp = pHelpCache;
pHelp != (HelpStruct *)NULL;
pHelp = pHelp->pNext)
{
if(pHelp->inUse == False)
{
pHelp->inUse = True;
return pHelp->dialog;
}
}
pHelp = (HelpStruct *) XtMalloc(sizeof(HelpStruct));
pHelpCache->pPrev = pHelp;
pHelp->pNext = pHelpCache;
pHelpCache = pHelp;
pHelp->pPrev = (HelpStruct *)NULL;
pHelp->inUse = True;
XtSetArg(args[0], XmNtitle, GETMESSAGE(4, 1, "Calculator - Help"));
pHelp->dialog = DtCreateHelpDialog(X->mainWin, "helpDlg", args, 1);
DtWsmRemoveWorkspaceFunctions(X->dpy,
XtWindow(XtParent(pHelp->dialog)));
XtAddCallback(pHelp->dialog, DtNhyperLinkCallback,
(XtCallbackProc)HelpHyperlinkCB, NULL);
XtAddCallback(pHelp->dialog, DtNcloseCallback,
(XtCallbackProc)HelpCloseCB, pHelpCache);
return pHelp->dialog;
}
}
void
ErrDialog( errString, visualParent )
char *errString ;
Widget visualParent ;
{
int n;
Arg args[10];
XmString label, ok;
label = XmStringCreateLocalized(errString) ;
X->errParent = visualParent;
if (X->errDialog == NULL)
{
ok = XmStringCreateLocalized(GETMESSAGE(4, 4, "OK"));
n = 0;
XtSetArg (args[n], XmNokLabelString, ok); n++;
XtSetArg (args[n], XmNmessageString, label); n++;
XtSetArg (args[n], XmNmwmFunctions, DIALOG_MWM_FUNC); n++;
XtSetArg (args[n], XmNautoUnmanage, FALSE); n++;
XtSetArg (args[n], XmNdefaultPosition, FALSE); n++;
X->errDialog = XmCreateErrorDialog (X->mainWin, "ErroNotice", args, n);
XtAddCallback (X->errDialog, XmNokCallback, UnmanageCB, NULL);
XtAddCallback (X->errDialog, XmNmapCallback, CenterMsgCB, NULL);
XtUnmanageChild (XmMessageBoxGetChild (X->errDialog,
XmDIALOG_CANCEL_BUTTON));
XtUnmanageChild (XmMessageBoxGetChild (X->errDialog, XmDIALOG_HELP_BUTTON));
n = 0;
XtSetArg (args[n], XmNmwmInputMode,
MWM_INPUT_PRIMARY_APPLICATION_MODAL);n++;
XtSetArg (args[n], XmNuseAsyncGeometry, TRUE); n++;
XtSetArg (args[n], XmNtitle, GETMESSAGE(4, 3, "Error")); n++;
XtSetValues (XtParent(X->errDialog), args, n);
}
else
{
XtSetArg (args[0], XmNmessageString, label);
XtSetValues (X->errDialog, args, 1);
}
XmStringFree (label);
XtManageChild(X->errDialog);
}
static void
UnmanageCB(widget, client_data, call_data)
Widget widget;
XtPointer client_data, call_data;
{
XtUnmanageChild(widget);
}
void
CenterMsgCB (widget, client_data, call_data)
Widget widget;
XtPointer client_data, call_data;
{
int n;
Position newX, newY;
Arg args[4];
Widget shell;
shell = (Widget)client_data;
if (shell == NULL)
{
if (!X->errParent || !XtParent(X->errParent) ||
!XtIsManaged(X->errParent))
shell = X->mainWin;
else
shell = XtParent(X->errParent);
}
else
shell = XtParent (shell);
newX = XtX(shell) + XtWidth(shell)/2 - XtWidth(widget)/2;
newY = XtY(shell) + XtHeight(shell)/2 - XtHeight(widget)/2;
if (newX < 0) newX = 0;
if (newY < 0) newY = 0;
n = 0;
XtSetArg (args[n], XmNx, newX); n++;
XtSetArg (args[n], XmNy, newY); n++;
XtSetValues(widget, args, n);
}

4712
cde/programs/dtcalc/motif.c Normal file

File diff suppressed because it is too large Load Diff

158
cde/programs/dtcalc/motif.h Normal file
View File

@@ -0,0 +1,158 @@
/* $XConsortium: motif.h /main/4 1995/11/01 12:42:00 rswiston $ */
/* *
* motif.h *
* Contains the user interface headers for the Desktop *
* Calculator. *
* *
* (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. *
*/
typedef struct Xobject { /* Motif/Xlib graphics object. */
Pixmap icon, iconmask ;
Widget menubar, mainWin, kFrame;
Widget kframe, mframe[MAXMODES], rframe, frframe, Aframe, CFframe, Pframe ;
Widget textForm, textFrame;
Widget kbuttons[BROWS][BCOLS];
Widget Apanel, Api_butOK, Api_butClose, Api_butHelp ;
Widget kkeyboard, kpanel, modeline, modeFrame, notice ;
Widget menus[MAXMENUS], modevals[MAXITEMS], registers[MAXREGS];
Widget fregisters[FINREGS], fregistersvals[FINREGS];
Widget Papply, Pdefaults, Ppanel, Preset ;
Widget CFpanel, CFpi_butOK, CFpi_butClose, CFpi_butHelp ;
Widget popupMenu, asciiConv, enterFun, enterConst, Close;
Widget helpDialog; /* the help dialog box .....*/
Widget errParent, errDialog;
Widget baseWidgArry[4], numWidgArry[3], ttypeWidgArry[3];
struct cW_struct *Pappearance, *Pdisplay;
struct tW_struct *Api_text, *CFpi_cftext, *CFpi_dtext, *CFpi_vtext ;
enum menu_type CFtype ;
Atom clipboard ;
Atom length_atom ;
Display *dpy ; /* Display ids of dtcalc frames. */
Window root ;
XtAppContext app ;
XEvent *event ; /* Current X event being processed. */
XrmDatabase dtcalcDB ; /* Dtcalc resources database. */
XrmDatabase rDB ; /* Combined resources database. */
char *home ; /* Pointer to user's home directory. */
char *iconfont ; /* Font to use for icon label. */
char *cfval ; /* Constant/Function number. */
char *dval ; /* Constant/Function description. */
char *vval ; /* Constant/Function value. */
short helpMapped;
/* Data for holding information about the server's keyboard mapping. */
int kcmin ; /* Minimum keycode. */
int kcmax ; /* Maximum keycode. */
int keysyms_per_key ; /* Keysyms per keycode. */
unsigned char *kparray ; /* Array indicating if key is on keypad. */
enum menu_type mtype ;
int cfexists ; /* Constant/function already exists? */
int cfno ; /* Current constant/function number. */
int mrec[MAXMENUS] ;
int screen ; /* Default graphics display screen. */
} XObject ;
typedef struct Xobject *XVars ;
XVars X ;
#ifndef CDE_INSTALLATION_TOP
#define CDE_INSTALLATION_TOP "/usr/dt"
#endif
#define CALC_ICON_NAME CDE_INSTALLATION_TOP "/appconfig/icons/C/Dtcalc.l.pm"
#define CALC_ICON_NAME_BM CDE_INSTALLATION_TOP "/appconfig/icons/C/Dtcalc.l.bm"
#define HELP_HELP_MENU 710
#define HELP_INTRODUCTION 711
#define HELP_TABLEOFCONTENTS 712
#define HELP_TASKS 713
#define HELP_REFERENCE 714
#define HELP_ITEM 715
#define HELP_USING 716
#define HELP_VERSION 717
#define HELP_ASCII 718
#define HELP_CONSTANT 719
#define HELP_FUNCTION 720
#define HELP_DISPLAY 721
#define HELP_MODELINE 722
#define HELP_MODE 723
#define HELP_BASE 724
#define HELP_NOTATION 725
#define HELP_TRIG 726
#define HELP_MENUBAR 727
#define HELP_USING_HELP_VOLUME "Help4Help"
#define HELP_VOLUME "Calculator"
#define HELP_HELP_MENU_STR "helpMenu"
#define HELP_INTRODUCTION_STR "_HOMETOPIC"
#define HELP_TABLEOFCONTENTS_STR "TableOfContents"
#define HELP_TASKS_STR "Tasks"
#define HELP_REFERENCE_STR "Reference"
#define HELP_ITEM_STR "onItem"
#define HELP_USING_STR "_HOMETOPIC"
#define HELP_VERSION_STR "_COPYRIGHT"
#define HELP_ASCII_STR "asciiHelp"
#define HELP_CONSTANT_STR "constantHelp"
#define HELP_FUNCTION_STR "functionHelp"
#define HELP_DISPLAY_STR "display"
#define HELP_MODELINE_STR "modeline"
#define HELP_MENUBAR_STR "popup"
#define HELP_BLANK_STR "blank"
#define HELP_ACC_STR "calcAccuracy"
#define HELP_LSHIFT_STR "shiftleft"
#define HELP_RSHIFT_STR "shiftright"
#define HELP_TRUNC16_STR "trunc16"
#define HELP_TRUNC32_STR "trunc32"
#define HELP_INT_STR "ipercentYr"
#define HELP_PAYPYR_STR "PperYR"
#define HELP_ETOX_STR "e2thex"
#define HELP_TENTOX_STR "ten2thex"
#define HELP_YTOX_STR "y2thex"
#define HELP_XFACT_STR "xfactorial"
#define HELP_RECIP_STR "reciprocalx"
#define HELP_SQUARE_STR "xsquared"
#define HELP_SQRT_STR "calcSqrt"
#define HELP_PERCENT_STR "calcpercent"
#define HELP_LPAREN_STR "leftparen"
#define HELP_RPAREN_STR "rightparen"
#define HELP_CHGSIGN_STR "plusorminus"
#define HELP_TIMES_STR "times"
#define HELP_SEVEN_STR "seven"
#define HELP_EIGHT_STR "eight"
#define HELP_NINE_STR "nine"
#define HELP_DIVIDE_STR "calcdivide"
#define HELP_FOUR_STR "four"
#define HELP_FIVE_STR "five"
#define HELP_SIX_STR "six"
#define HELP_MINUS_STR "minus"
#define HELP_ONE_STR "one"
#define HELP_TWO_STR "two"
#define HELP_THREE_STR "three"
#define HELP_PLUS_STR "plus"
#define HELP_ZERO_STR "zero"
#define HELP_DECIMAL_STR "period"
#define HELP_EQUAL_STR "equal"
#define NORMAL_RESTORE 0
#define HOME_RESTORE 1
#define CURRENT_RESTORE 2
#define MAX_PATH 1024

4423
cde/programs/dtcalc/mp.c Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,9 @@
/* $XConsortium: patchlevel.h /main/3 1995/11/01 12:42:21 rswiston $ */
/* *
* (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. *
*/
#define PATCHLEVEL 1

836
cde/programs/dtcalc/text.c Normal file
View File

@@ -0,0 +1,836 @@
/* $XConsortium: text.c /main/5 1996/03/25 13:13:06 ageorge $ */
/* *
* text.c *
* Contains all the text initializationf for the Calulator *
* *
* (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. *
*/
#include <stdio.h>
#include <string.h>
#include "calctool.h"
#include "ds_common.h"
extern struct button buttons[] ; /* Calculator button values. */
extern struct button mode_buttons[] ; /* Special "mode" buttons. */
extern struct menu cmenus[] ; /* Calculator menus. */
extern struct menu_entry menu_entries[] ; /* All the menu strings. */
extern Vars v ; /* Calctool variables and options. */
void init_mess P(()) ;
/* The following are all the strings used by the dtcalc program.
* They are initialised in init_text() to the local language equivalents.
*/
char *base_str[MAXBASES] ;
char *calc_res[MAXRESOURCES] ;
char *cmdstr[MAXCMDS] ;
char *dtype_str[MAXDISPMODES] ;
char *lstrs[MAXLABELS] ;
char *mess[MAXMESS] ;
char *mode_str[MAXMODES] ;
char *mpstrs[MAXMPERRS] ;
char *opts[MAXOPTS] ;
char *pstrs[MAXPSTRS] ;
char *ttype_str[MAXTRIGMODES] ;
char *ustrs[MAXUSAGE] ;
char *vstrs[MAXVMESS] ;
void
init_cmdline_opts() /* Initialize command line option strings. */
{
cmdstr[(int) CMD_ACC] = "-a" ;
cmdstr[(int) CMD_MODE] = "-m" ;
cmdstr[(int) CMD_BASE] = "-b" ;
cmdstr[(int) CMD_TRIG] = "-trig" ;
cmdstr[(int) CMD_DISP] = "-notation" ;
cmdstr[(int) CMD_MENU_BAR] = "-no_menu_bar" ;
cmdstr[(int) CMD_SESSION] = "-session" ;
}
void
init_text() /* Setup text strings depending upon language. */
{
int i ;
init_mess();
/* Some notes for translators:
*
* Text in the label strings below, should be left justified. It will
* automatically be centre justified in the buttons, but various
* calculations depend on the text starting on the left.
*
* The original English V3 version was written with fixed (upto) four
* character button labels. I've tried to extend this to allow any sized
* labels, however the following conditions apply:
*
* - If the label won't fit in the button, then as much as possible will be
* shown, with the last character being '>'. If you enlarge the calculator,
* probably more of the label will show.
*
* - If the last character of the label is a '.', and this is not the first
* character of the label (ie, the numeric point label), then dtcalc
* knows that this signifies that this label should have two more '.'
* characters appended to it (ie, "Mem." becomes "Mem...").
*
* - If a dtcalc button has a menu item glyph associated with it, the
* width of this glyph is taken into consideration, and the amount of
* the label that can be displayed is adjusted accordingly.
*/
i = 0 ;
read_str(&buttons[i++].str, LGET("")) ; /* Row 1.*/
read_str(&buttons[i++].str, LGET(GETMESSAGE(3, 5, "Functions"))) ;
read_str(&buttons[i++].str, LGET(GETMESSAGE(3, 6, "Constants"))) ;
read_str(&buttons[i++].str, LGET(GETMESSAGE(3, 7, "Keys"))) ;
read_str(&buttons[i++].str, LGET(GETMESSAGE(3, 8, "Int"))) ; /* Row 2. */
read_str(&buttons[i++].str, LGET(GETMESSAGE(3, 9, "Frac"))) ;
read_str(&buttons[i++].str, LGET(GETMESSAGE(3, 10, "Abs"))) ;
read_str(&buttons[i++].str, LGET(GETMESSAGE(3, 11, "Exp"))) ;
read_str(&buttons[i++].str, LGET(GETMESSAGE(3, 12, "Accuracy"))) ; /* Row 3.*/
read_str(&buttons[i++].str, LGET(GETMESSAGE(3, 13, "Store"))) ;
read_str(&buttons[i++].str, LGET(GETMESSAGE(3, 14, "Recall"))) ;
read_str(&buttons[i++].str, LGET(GETMESSAGE(3, 15, "Exchange"))) ;
read_str(&buttons[i++].str, LGET("")) ; /* Row 4. */
read_str(&buttons[i++].str, LGET("")) ;
read_str(&buttons[i++].str, LGET("")) ;
read_str(&buttons[i++].str, LGET("")) ;
read_str(&buttons[i++].str, LGET("")) ; /* Row 5. */
read_str(&buttons[i++].str, LGET("")) ;
read_str(&buttons[i++].str, LGET("")) ;
read_str(&buttons[i++].str, LGET("")) ;
read_str(&buttons[i++].str, LGET("")) ; /* Row 6. */
read_str(&buttons[i++].str, LGET("")) ;
read_str(&buttons[i++].str, LGET("")) ;
read_str(&buttons[i++].str, LGET("")) ;
read_str(&buttons[i++].str, LGET(GETMESSAGE(3, 16, "1/x"))) ; /* Row 7. */
read_str(&buttons[i++].str, LGET(GETMESSAGE(3, 17, "x^2"))) ;
read_str(&buttons[i++].str, LGET(GETMESSAGE(3, 19, "Sqrt"))) ;
read_str(&buttons[i++].str, LGET(GETMESSAGE(3, 18, "%"))) ;
read_str(&buttons[i++].str, LGET(GETMESSAGE(3, 20, "("))) ; /* Row 8. */
read_str(&buttons[i++].str, LGET(GETMESSAGE(3, 21, ")"))) ;
read_str(&buttons[i++].str, LGET(GETMESSAGE(3, 22, "Bsp"))) ;
read_str(&buttons[i++].str, LGET(GETMESSAGE(3, 23, "Clr"))) ;
read_str(&buttons[i++].str, LGET(GETMESSAGE(3, 24, "D"))) ; /* Row 9. */
read_str(&buttons[i++].str, LGET(GETMESSAGE(3, 25, "E"))) ;
read_str(&buttons[i++].str, LGET(GETMESSAGE(3, 26, "F"))) ;
read_str(&buttons[i++].str, LGET(GETMESSAGE(3, 27, "+/-"))) ;
read_str(&buttons[i++].str, LGET(GETMESSAGE(3, 28, "A"))) ; /* Row 10. */
read_str(&buttons[i++].str, LGET(GETMESSAGE(3, 29, "B"))) ;
read_str(&buttons[i++].str, LGET(GETMESSAGE(3, 30, "C"))) ;
read_str(&buttons[i++].str, LGET(GETMESSAGE(3, 31, "X"))) ;
read_str(&buttons[i++].str, LGET(GETMESSAGE(3, 32, "7"))) ; /* Row 11. */
read_str(&buttons[i++].str, LGET(GETMESSAGE(3, 33, "8"))) ;
read_str(&buttons[i++].str, LGET(GETMESSAGE(3, 34, "9"))) ;
read_str(&buttons[i++].str, LGET(GETMESSAGE(3, 35, "/"))) ;
read_str(&buttons[i++].str, LGET(GETMESSAGE(3, 36, "4"))) ; /* Row 12. */
read_str(&buttons[i++].str, LGET(GETMESSAGE(3, 37, "5"))) ;
read_str(&buttons[i++].str, LGET(GETMESSAGE(3, 38, "6"))) ;
read_str(&buttons[i++].str, LGET(GETMESSAGE(3, 39, "-"))) ;
read_str(&buttons[i++].str, LGET(GETMESSAGE(3, 40, "1"))) ; /* Row 13. */
read_str(&buttons[i++].str, LGET(GETMESSAGE(3, 41, "2"))) ;
read_str(&buttons[i++].str, LGET(GETMESSAGE(3, 42, "3"))) ;
read_str(&buttons[i++].str, LGET(GETMESSAGE(3, 43, "+"))) ;
read_str(&buttons[i++].str, LGET(GETMESSAGE(3, 44, "0"))) ; /* Row 14. */
read_str(&buttons[i++].str, LGET(GETMESSAGE(3, 45, "."))) ;
read_str(&buttons[i++].str, LGET(GETMESSAGE(3, 46, "="))) ;
read_str(&buttons[i++].str, LGET(GETMESSAGE(3, 47, "Quit"))) ;
/* the three extra defs */
read_str(&buttons[i++].str, LGET(GETMESSAGE(3, 48, "Base"))) ;
read_str(&buttons[i++].str, LGET(GETMESSAGE(3, 49, "Disp"))) ;
read_str(&buttons[i++].str, LGET(GETMESSAGE(3, 50, "Mode"))) ;
read_str(&buttons[i++].str, LGET(GETMESSAGE(3, 51, "Trig"))) ;
i = 0 ;
read_str(&buttons[i++].str2, LGET("")) ;
read_str(&buttons[i++].str2, LGET(GETMESSAGE(3, 52, "F - Funcs"))) ;
read_str(&buttons[i++].str2, LGET(GETMESSAGE(3, 53, "# - Const"))) ;
read_str(&buttons[i++].str2, LGET(GETMESSAGE(3, 54, "k - Keys"))) ;
read_str(&buttons[i++].str2, LGET(GETMESSAGE(3, 55, "I - Int"))) ;
/* CTL('f') */
read_str(&buttons[i++].str2, LGET(GETMESSAGE(3, 56, "^f - Frac"))) ;
/* CTL('u') */
read_str(&buttons[i++].str2, LGET(GETMESSAGE(3, 57, "^u - Abs"))) ;
read_str(&buttons[i++].str2, LGET(GETMESSAGE(3, 58, "E - Exp"))) ;
read_str(&buttons[i++].str2, LGET(GETMESSAGE(3, 59, "A - Acc"))) ;
read_str(&buttons[i++].str2, LGET(GETMESSAGE(3, 60, "S - Sto"))) ;
read_str(&buttons[i++].str2, LGET(GETMESSAGE(3, 61, "R - Rcl"))) ;
read_str(&buttons[i++].str2, LGET(GETMESSAGE(3, 62, "X - Xchg"))) ;
read_str(&buttons[i++].str2, LGET("")) ;
read_str(&buttons[i++].str2, LGET("")) ;
read_str(&buttons[i++].str2, LGET("")) ;
read_str(&buttons[i++].str2, LGET("")) ;
read_str(&buttons[i++].str2, LGET("")) ;
read_str(&buttons[i++].str2, LGET("")) ;
read_str(&buttons[i++].str2, LGET("")) ;
read_str(&buttons[i++].str2, LGET("")) ;
read_str(&buttons[i++].str2, LGET("")) ;
read_str(&buttons[i++].str2, LGET("")) ;
read_str(&buttons[i++].str2, LGET("")) ;
read_str(&buttons[i++].str2, LGET("")) ;
read_str(&buttons[i++].str2, LGET(GETMESSAGE(3, 63, "r - 1/x"))) ;
read_str(&buttons[i++].str2, LGET(GETMESSAGE(3, 64, "@ - x^2"))) ;
read_str(&buttons[i++].str2, LGET(GETMESSAGE(3, 66, "s - Sqrt"))) ;
read_str(&buttons[i++].str2, LGET(GETMESSAGE(3, 65, "%"))) ;
read_str(&buttons[i++].str2, LGET(GETMESSAGE(3, 67, "("))) ;
read_str(&buttons[i++].str2, LGET(GETMESSAGE(3, 68, ")"))) ;
/* CTL('h') */
read_str(&buttons[i++].str2, LGET(GETMESSAGE(3, 69, "^h - Bsp"))) ;
/* del */
/* #ifdef hpux */
#ifdef HP_EXTENSIONS
if(v->keybdID == HIL_ITF_KBD)
read_str(&buttons[i++].str2, LGET(GETMESSAGE(3, 512, "clr disp"))) ;
else
read_str(&buttons[i++].str2, LGET(GETMESSAGE(3, 70, "del - Clr"))) ;
#else
read_str(&buttons[i++].str2, LGET(GETMESSAGE(3, 70, "del - Clr"))) ;
#endif
read_str(&buttons[i++].str2, LGET(GETMESSAGE(3, 71, "d"))) ;
read_str(&buttons[i++].str2, LGET(GETMESSAGE(3, 72, "e"))) ;
read_str(&buttons[i++].str2, LGET(GETMESSAGE(3, 73, "f"))) ;
read_str(&buttons[i++].str2, LGET(GETMESSAGE(3, 74, "C - +/-"))) ;
read_str(&buttons[i++].str2, LGET(GETMESSAGE(3, 75, "a"))) ;
read_str(&buttons[i++].str2, LGET(GETMESSAGE(3, 76, "b"))) ;
read_str(&buttons[i++].str2, LGET(GETMESSAGE(3, 77, "c"))) ;
read_str(&buttons[i++].str2, LGET(GETMESSAGE(3, 78, "x"))) ;
read_str(&buttons[i++].str2, LGET(GETMESSAGE(3, 79, "7"))) ;
read_str(&buttons[i++].str2, LGET(GETMESSAGE(3, 80, "8"))) ;
read_str(&buttons[i++].str2, LGET(GETMESSAGE(3, 81, "9"))) ;
read_str(&buttons[i++].str2, LGET(GETMESSAGE(3, 82, "/"))) ;
read_str(&buttons[i++].str2, LGET(GETMESSAGE(3, 83, "4"))) ;
read_str(&buttons[i++].str2, LGET(GETMESSAGE(3, 84, "5"))) ;
read_str(&buttons[i++].str2, LGET(GETMESSAGE(3, 85, "6"))) ;
read_str(&buttons[i++].str2, LGET(GETMESSAGE(3, 86, "-"))) ;
read_str(&buttons[i++].str2, LGET(GETMESSAGE(3, 87, "1"))) ;
read_str(&buttons[i++].str2, LGET(GETMESSAGE(3, 88, "2"))) ;
read_str(&buttons[i++].str2, LGET(GETMESSAGE(3, 89, "3"))) ;
read_str(&buttons[i++].str2, LGET(GETMESSAGE(3, 90, "+"))) ;
read_str(&buttons[i++].str2, LGET(GETMESSAGE(3, 91, "0"))) ;
read_str(&buttons[i++].str2, LGET(GETMESSAGE(3, 92, "."))) ;
read_str(&buttons[i++].str2, LGET(GETMESSAGE(3, 93, "="))) ;
read_str(&buttons[i++].str2, LGET(GETMESSAGE(3, 94, "q - Quit"))) ;
read_str(&buttons[i++].str2, LGET(GETMESSAGE(3, 95, "B"))) ;
read_str(&buttons[i++].str2, LGET(GETMESSAGE(3, 96, "D"))) ;
read_str(&buttons[i++].str2, LGET(GETMESSAGE(3, 97, "M"))) ;
read_str(&buttons[i++].str2, LGET(GETMESSAGE(3, 98, "T"))) ;
i = 0 ;
get_key_val(&buttons[i++].value, LGET("")) ;
get_key_val(&buttons[i++].value, LGET(GETMESSAGE(3, 452, "F"))) ;
get_key_val(&buttons[i++].value, LGET(GETMESSAGE(3, 453, "#"))) ;
get_key_val(&buttons[i++].value, LGET(GETMESSAGE(3, 454, "k"))) ;
get_key_val(&buttons[i++].value, LGET(GETMESSAGE(3, 455, "I"))) ;
/* CTL('f') */
get_key_val(&buttons[i++].value, LGET(GETMESSAGE(3, 456, "\006"))) ;
/* CTL('u') */
get_key_val(&buttons[i++].value, LGET(GETMESSAGE(3, 457, "\025"))) ;
get_key_val(&buttons[i++].value, LGET(GETMESSAGE(3, 458, "E"))) ;
get_key_val(&buttons[i++].value, LGET(GETMESSAGE(3, 459, "A"))) ;
get_key_val(&buttons[i++].value, LGET(GETMESSAGE(3, 460, "S"))) ;
get_key_val(&buttons[i++].value, LGET(GETMESSAGE(3, 461, "R"))) ;
get_key_val(&buttons[i++].value, LGET(GETMESSAGE(3, 462, "X"))) ;
get_key_val(&buttons[i++].value, LGET("")) ;
get_key_val(&buttons[i++].value, LGET("")) ;
get_key_val(&buttons[i++].value, LGET("")) ;
get_key_val(&buttons[i++].value, LGET("")) ;
get_key_val(&buttons[i++].value, LGET("")) ;
get_key_val(&buttons[i++].value, LGET("")) ;
get_key_val(&buttons[i++].value, LGET("")) ;
get_key_val(&buttons[i++].value, LGET("")) ;
get_key_val(&buttons[i++].value, LGET("")) ;
get_key_val(&buttons[i++].value, LGET("")) ;
get_key_val(&buttons[i++].value, LGET("")) ;
get_key_val(&buttons[i++].value, LGET("")) ;
get_key_val(&buttons[i++].value, LGET(GETMESSAGE(3, 463, "r"))) ;
get_key_val(&buttons[i++].value, LGET(GETMESSAGE(3, 464, "@"))) ;
get_key_val(&buttons[i++].value, LGET(GETMESSAGE(3, 466, "s"))) ;
get_key_val(&buttons[i++].value, LGET(GETMESSAGE(3, 465, "%"))) ;
get_key_val(&buttons[i++].value, LGET(GETMESSAGE(3, 67, "("))) ;
get_key_val(&buttons[i++].value, LGET(GETMESSAGE(3, 68, ")"))) ;
/* CTL('h') */
get_key_val(&buttons[i++].value, LGET(GETMESSAGE(3, 467, "\010"))) ;
/* del */
#ifdef hpux
if(v->keybdID == HIL_ITF_KBD)
get_key_val(&buttons[i++].value, LGET(GETMESSAGE(3, 513, "\013"))) ;
else
get_key_val(&buttons[i++].value, LGET(GETMESSAGE(3, 468, "\177"))) ;
#else
get_key_val(&buttons[i++].value, LGET(GETMESSAGE(3, 468, "\177"))) ;
#endif
get_key_val(&buttons[i++].value, LGET(GETMESSAGE(3, 469, "d"))) ;
get_key_val(&buttons[i++].value, LGET(GETMESSAGE(3, 470, "e"))) ;
get_key_val(&buttons[i++].value, LGET(GETMESSAGE(3, 471, "f"))) ;
get_key_val(&buttons[i++].value, LGET(GETMESSAGE(3, 472, "C"))) ;
get_key_val(&buttons[i++].value, LGET(GETMESSAGE(3, 473, "a"))) ;
get_key_val(&buttons[i++].value, LGET(GETMESSAGE(3, 474, "b"))) ;
get_key_val(&buttons[i++].value, LGET(GETMESSAGE(3, 475, "c"))) ;
get_key_val(&buttons[i++].value, LGET(GETMESSAGE(3, 476, "x"))) ;
get_key_val(&buttons[i++].value, LGET(GETMESSAGE(3, 79, "7"))) ;
get_key_val(&buttons[i++].value, LGET(GETMESSAGE(3, 80, "8"))) ;
get_key_val(&buttons[i++].value, LGET(GETMESSAGE(3, 81, "9"))) ;
get_key_val(&buttons[i++].value, LGET(GETMESSAGE(3, 82, "/"))) ;
get_key_val(&buttons[i++].value, LGET(GETMESSAGE(3, 83, "4"))) ;
get_key_val(&buttons[i++].value, LGET(GETMESSAGE(3, 84, "5"))) ;
get_key_val(&buttons[i++].value, LGET(GETMESSAGE(3, 85, "6"))) ;
get_key_val(&buttons[i++].value, LGET(GETMESSAGE(3, 86, "-"))) ;
get_key_val(&buttons[i++].value, LGET(GETMESSAGE(3, 87, "1"))) ;
get_key_val(&buttons[i++].value, LGET(GETMESSAGE(3, 88, "2"))) ;
get_key_val(&buttons[i++].value, LGET(GETMESSAGE(3, 89, "3"))) ;
get_key_val(&buttons[i++].value, LGET(GETMESSAGE(3, 90, "+"))) ;
get_key_val(&buttons[i++].value, LGET(GETMESSAGE(3, 91, "0"))) ;
get_key_val(&buttons[i++].value, LGET(GETMESSAGE(3, 92, "."))) ;
get_key_val(&buttons[i++].value, LGET(GETMESSAGE(3, 93, "="))) ;
get_key_val(&buttons[i++].value, LGET(GETMESSAGE(3, 477, "q"))) ;
get_key_val(&buttons[i++].value, LGET(GETMESSAGE(3, 95, "B"))) ;
get_key_val(&buttons[i++].value, LGET(GETMESSAGE(3, 96, "D"))) ;
get_key_val(&buttons[i++].value, LGET(GETMESSAGE(3, 97, "M"))) ;
get_key_val(&buttons[i++].value, LGET(GETMESSAGE(3, 98, "T"))) ;
calc_res[(int) R_ACCURACY] = DGET("accuracy") ;
calc_res[(int) R_BASE] = DGET("base") ;
calc_res[(int) R_DISPLAY] = DGET("display") ;
calc_res[(int) R_MODE] = DGET("mode") ;
calc_res[(int) R_REGS] = DGET("showRegisters") ;
calc_res[(int) R_TRIG] = DGET("trigType") ;
calc_res[(int) R_BEEP] = DGET("beep") ;
calc_res[(int) R_ICON] = DGET("iconify") ;
calc_res[(int) R_WORKSPACE] = DGET("workspace") ;
calc_res[(int) R_WIDTH] = DGET("width") ;
calc_res[(int) R_HEIGHT] = DGET("height") ;
calc_res[(int) R_X] = DGET("x") ;
calc_res[(int) R_Y] = DGET("y") ;
calc_res[(int) R_DISPLAYED] = DGET("displayed") ;
calc_res[(int) R_REG0] = DGET("register0") ;
calc_res[(int) R_REG1] = DGET("register1") ;
calc_res[(int) R_REG2] = DGET("register2") ;
calc_res[(int) R_REG3] = DGET("register3") ;
calc_res[(int) R_REG4] = DGET("register4") ;
calc_res[(int) R_REG5] = DGET("register5") ;
calc_res[(int) R_REG6] = DGET("register6") ;
calc_res[(int) R_REG7] = DGET("register7") ;
calc_res[(int) R_REG8] = DGET("register8") ;
calc_res[(int) R_REG9] = DGET("register9") ;
calc_res[(int) R_FREG0] = DGET("fregister0") ;
calc_res[(int) R_FREG1] = DGET("fregister1") ;
calc_res[(int) R_FREG2] = DGET("fregister2") ;
calc_res[(int) R_FREG3] = DGET("fregister3") ;
calc_res[(int) R_FREG4] = DGET("fregister4") ;
calc_res[(int) R_FREG5] = DGET("fregister5") ;
calc_res[(int) R_MENUBAR] = DGET("postMenuBar") ;
calc_res[(int) R_KEYS] = DGET("keys") ;
STRCPY(v->con_names[0], LGET(GETMESSAGE(3, 119, "kilometers per hour <=> miles per hour."))) ;
STRCPY(v->con_names[1], LGET(GETMESSAGE(3, 120, "square root of 2."))) ;
STRCPY(v->con_names[2], LGET(GETMESSAGE(3, 121, "e."))) ;
STRCPY(v->con_names[3], LGET(GETMESSAGE(3, 122, "pi."))) ;
STRCPY(v->con_names[4], LGET(GETMESSAGE(3, 123, "centimeters <=> inch."))) ;
STRCPY(v->con_names[5], LGET(GETMESSAGE(3, 124, "degrees in a radian."))) ;
STRCPY(v->con_names[6], LGET(GETMESSAGE(3, 125, "2 ^ 20."))) ;
STRCPY(v->con_names[7], LGET(GETMESSAGE(3, 126, "grams <=> ounce."))) ;
STRCPY(v->con_names[8], LGET(GETMESSAGE(3, 127, "kilojoules <=> British thermal units."))) ;
STRCPY(v->con_names[9], LGET(GETMESSAGE(3, 128, "cubic centimeters <=> cubic inches."))) ;
/* Keyboard equivalents for the dtcalc menu entries. */
i = 0 ;
/* 00 */ get_key_val(&menu_entries[i++].val, LGET("0")) ; /* ACC */
/* 01 */ get_key_val(&menu_entries[i++].val, LGET("1")) ;
/* 02 */ get_key_val(&menu_entries[i++].val, LGET("2")) ;
/* 03 */ get_key_val(&menu_entries[i++].val, LGET("3")) ;
/* 04 */ get_key_val(&menu_entries[i++].val, LGET("4")) ;
/* 05 */ get_key_val(&menu_entries[i++].val, LGET("5")) ;
/* 06 */ get_key_val(&menu_entries[i++].val, LGET("6")) ;
/* 07 */ get_key_val(&menu_entries[i++].val, LGET("7")) ;
/* 08 */ get_key_val(&menu_entries[i++].val, LGET("8")) ;
/* 09 */ get_key_val(&menu_entries[i++].val, LGET("9")) ;
/* 10 */ get_key_val(&menu_entries[i++].val, LGET("0")) ; /* EXCH, RCL, STO */
/* 11 */ get_key_val(&menu_entries[i++].val, LGET("1")) ;
/* 12 */ get_key_val(&menu_entries[i++].val, LGET("2")) ;
/* 13 */ get_key_val(&menu_entries[i++].val, LGET("3")) ;
/* 14 */ get_key_val(&menu_entries[i++].val, LGET("4")) ;
/* 15 */ get_key_val(&menu_entries[i++].val, LGET("5")) ;
/* 16 */ get_key_val(&menu_entries[i++].val, LGET("6")) ;
/* 17 */ get_key_val(&menu_entries[i++].val, LGET("7")) ;
/* 18 */ get_key_val(&menu_entries[i++].val, LGET("8")) ;
/* 19 */ get_key_val(&menu_entries[i++].val, LGET("9")) ;
/* 35 */ get_key_val(&menu_entries[i++].val, LGET("b")) ; /* BASE */
/* 36 */ get_key_val(&menu_entries[i++].val, LGET("o")) ;
/* 37 */ get_key_val(&menu_entries[i++].val, LGET("d")) ;
/* 38 */ get_key_val(&menu_entries[i++].val, LGET("h")) ;
/* 39 */ get_key_val(&menu_entries[i++].val, LGET("e")) ; /* Display type. */
/* 40 */ get_key_val(&menu_entries[i++].val, LGET("f")) ;
/* 41 */ get_key_val(&menu_entries[i++].val, LGET("s")) ;
/* 42 */ get_key_val(&menu_entries[i++].val, LGET("d")) ; /* Trig. type. */
/* 43 */ get_key_val(&menu_entries[i++].val, LGET("g")) ;
/* 44 */ get_key_val(&menu_entries[i++].val, LGET("r")) ;
/* 45 */ get_key_val(&menu_entries[i++].val, LGET("b")) ; /* MODE */
/* 46 */ get_key_val(&menu_entries[i++].val, LGET("f")) ;
/* 47 */ get_key_val(&menu_entries[i++].val, LGET("l")) ;
/* 48 */ get_key_val(&menu_entries[i++].val, LGET("s")) ;
/* 49 */ get_key_val(&menu_entries[i++].val, LGET("\020")) ;
i = 0 ;
/* Financial */
read_str(&mode_buttons[i++].str, LGET(GETMESSAGE(3, 208, "Term"))) ;
read_str(&mode_buttons[i++].str, LGET(GETMESSAGE(3, 209, "i%Yr"))) ;
read_str(&mode_buttons[i++].str, LGET(GETMESSAGE(3, 210, "Pv"))) ;
read_str(&mode_buttons[i++].str, LGET(GETMESSAGE(3, 211, "Pmt"))) ;
read_str(&mode_buttons[i++].str, LGET(GETMESSAGE(3, 212, "Fv"))) ;
read_str(&mode_buttons[i++].str, LGET(GETMESSAGE(3, 515, "P/YR"))) ;
read_str(&mode_buttons[i++].str, LGET(GETMESSAGE(3, 213, "CLRfregs"))) ;
read_str(&mode_buttons[i++].str, LGET(GETMESSAGE(3, 214, "Ctrm"))) ;
read_str(&mode_buttons[i++].str, LGET(GETMESSAGE(3, 215, "Ddb"))) ;
read_str(&mode_buttons[i++].str, LGET(GETMESSAGE(3, 216, "Sln"))) ;
read_str(&mode_buttons[i++].str, LGET(GETMESSAGE(3, 217, "Syd"))) ;
read_str(&mode_buttons[i++].str, " ") ;
read_str(&mode_buttons[i++].str, " ") ;
read_str(&mode_buttons[i++].str, " ") ;
read_str(&mode_buttons[i++].str, " ") ;
read_str(&mode_buttons[i++].str, " ") ;
/* Logical. */
read_str(&mode_buttons[i++].str, LGET(GETMESSAGE(3, 218, "<"))) ;
read_str(&mode_buttons[i++].str, LGET(GETMESSAGE(3, 219, ">"))) ;
read_str(&mode_buttons[i++].str, LGET(GETMESSAGE(3, 220, "&16"))) ;
read_str(&mode_buttons[i++].str, LGET(GETMESSAGE(3, 221, "&32"))) ;
read_str(&mode_buttons[i++].str, LGET(GETMESSAGE(3, 222, "Or"))) ;
read_str(&mode_buttons[i++].str, LGET(GETMESSAGE(3, 223, "And"))) ;
read_str(&mode_buttons[i++].str, LGET(GETMESSAGE(3, 224, "Not"))) ;
read_str(&mode_buttons[i++].str, LGET(GETMESSAGE(3, 225, "Xor"))) ;
read_str(&mode_buttons[i++].str, LGET(GETMESSAGE(3, 226, "Xnor"))) ;
read_str(&mode_buttons[i++].str, " ") ;
read_str(&mode_buttons[i++].str, " ") ;
read_str(&mode_buttons[i++].str, " ") ;
read_str(&mode_buttons[i++].str, " ") ;
read_str(&mode_buttons[i++].str, " ") ;
read_str(&mode_buttons[i++].str, " ") ;
read_str(&mode_buttons[i++].str, " ") ;
/* Scientific. */
read_str(&mode_buttons[i++].str, LGET(GETMESSAGE(3, 228, "Inv"))) ;
read_str(&mode_buttons[i++].str, LGET(GETMESSAGE(3, 227, "Hyp"))) ;
read_str(&mode_buttons[i++].str, LGET(GETMESSAGE(3, 229, "e^x"))) ;
read_str(&mode_buttons[i++].str, LGET(GETMESSAGE(3, 230, "10^x"))) ;
read_str(&mode_buttons[i++].str, LGET(GETMESSAGE(3, 231, "y^x"))) ;
read_str(&mode_buttons[i++].str, LGET(GETMESSAGE(3, 232, "x!"))) ;
read_str(&mode_buttons[i++].str, LGET(GETMESSAGE(3, 233, "Cos"))) ;
read_str(&mode_buttons[i++].str, LGET(GETMESSAGE(3, 234, "Sin"))) ;
read_str(&mode_buttons[i++].str, LGET(GETMESSAGE(3, 235, "Tan"))) ;
read_str(&mode_buttons[i++].str, LGET(GETMESSAGE(3, 236, "Ln"))) ;
read_str(&mode_buttons[i++].str, LGET(GETMESSAGE(3, 237, "Log"))) ;
read_str(&mode_buttons[i++].str, LGET(GETMESSAGE(3, 238, "Rand"))) ;
read_str(&mode_buttons[i++].str, " ") ;
read_str(&mode_buttons[i++].str, " ") ;
read_str(&mode_buttons[i++].str, " ") ;
read_str(&mode_buttons[i++].str, " ") ;
/* Keyboard equivalents for the three dtcalc mode window buttons. */
i = 0 ;
/* Financial */
read_str(&mode_buttons[i++].str2, LGET(GETMESSAGE(3, 239, "T - Term"))) ;
/* CTL('r') */
read_str(&mode_buttons[i++].str2, LGET(GETMESSAGE(3, 240, "^r - i%Yr"))) ;
read_str(&mode_buttons[i++].str2, LGET(GETMESSAGE(3, 241, "p - Pv"))) ;
read_str(&mode_buttons[i++].str2, LGET(GETMESSAGE(3, 242, "P - Pmt"))) ;
read_str(&mode_buttons[i++].str2, LGET(GETMESSAGE(3, 243, "v - Fv"))) ;
read_str(&mode_buttons[i++].str2, LGET(GETMESSAGE(3, 516, "y - P/YR"))) ;
read_str(&mode_buttons[i++].str2, LGET(GETMESSAGE(3, 244, "L - Clrgs"))) ;
/* CTL('t') */
read_str(&mode_buttons[i++].str2, LGET(GETMESSAGE(3, 245, "^t - Ctrm"))) ;
/* CTL('d') */
read_str(&mode_buttons[i++].str2, LGET(GETMESSAGE(3, 246, "^d - Ddb")));
/* CTL('s') */
read_str(&mode_buttons[i++].str2, LGET(GETMESSAGE(3, 247, "^s - Sln")));
/* CTL('y') */
read_str(&mode_buttons[i++].str2, LGET(GETMESSAGE(3, 248, "^y - Syd")));
read_str(&mode_buttons[i++].str2, " ") ;
read_str(&mode_buttons[i++].str2, " ") ;
read_str(&mode_buttons[i++].str2, " ") ;
read_str(&mode_buttons[i++].str2, " ") ;
read_str(&mode_buttons[i++].str2, " ") ;
/* Logical. */
read_str(&mode_buttons[i++].str2, LGET(GETMESSAGE(3, 249, "<"))) ;
read_str(&mode_buttons[i++].str2, LGET(GETMESSAGE(3, 250, ">"))) ;
read_str(&mode_buttons[i++].str2, LGET(GETMESSAGE(3, 251, "[ - &16"))) ;
read_str(&mode_buttons[i++].str2, LGET(GETMESSAGE(3, 252, "] - &32"))) ;
read_str(&mode_buttons[i++].str2, LGET(GETMESSAGE(3, 253, "| - Or"))) ;
read_str(&mode_buttons[i++].str2, LGET(GETMESSAGE(3, 254, "& - And"))) ;
read_str(&mode_buttons[i++].str2, LGET(GETMESSAGE(3, 255, "~ - Not"))) ;
read_str(&mode_buttons[i++].str2, LGET(GETMESSAGE(3, 256, "^ - Xor"))) ;
read_str(&mode_buttons[i++].str2, LGET(GETMESSAGE(3, 257, "n - Xnor"))) ;
read_str(&mode_buttons[i++].str2, " ") ;
read_str(&mode_buttons[i++].str2, " ") ;
read_str(&mode_buttons[i++].str2, " ") ;
read_str(&mode_buttons[i++].str2, " ") ;
read_str(&mode_buttons[i++].str2, " ") ;
read_str(&mode_buttons[i++].str2, " ") ;
read_str(&mode_buttons[i++].str2, " ") ;
/* Scientific. */
read_str(&mode_buttons[i++].str2, LGET(GETMESSAGE(3, 259, "i - Inv"))) ;
read_str(&mode_buttons[i++].str2, LGET(GETMESSAGE(3, 258, "h - Hyp"))) ;
read_str(&mode_buttons[i++].str2, LGET(GETMESSAGE(3, 260, "{ - e^x"))) ;
read_str(&mode_buttons[i++].str2, LGET(GETMESSAGE(3, 261, "} - 10^x"))) ;
read_str(&mode_buttons[i++].str2, LGET(GETMESSAGE(3, 262, "y - y^x"))) ;
read_str(&mode_buttons[i++].str2, LGET(GETMESSAGE(3, 263, "! - x!"))) ;
/* CTL('c') */
read_str(&mode_buttons[i++].str2, LGET(GETMESSAGE(3, 264, "^c - Cos")));
/* CTL('s') */
read_str(&mode_buttons[i++].str2, LGET(GETMESSAGE(3, 265, "^s - Sin")));
/* CTL('t') */
read_str(&mode_buttons[i++].str2, LGET(GETMESSAGE(3, 266, "^t - Tan")));
read_str(&mode_buttons[i++].str2, LGET(GETMESSAGE(3, 267, "N - Ln"))) ;
read_str(&mode_buttons[i++].str2, LGET(GETMESSAGE(3, 268, "G - Log"))) ;
read_str(&mode_buttons[i++].str2, LGET(GETMESSAGE(3, 269, "? - Rand"))) ;
read_str(&mode_buttons[i++].str2, " ") ;
read_str(&mode_buttons[i++].str2, " ") ;
read_str(&mode_buttons[i++].str2, " ") ;
read_str(&mode_buttons[i++].str2, " ") ;
i = 0 ;
/* Financial */
get_key_val(&mode_buttons[i++].value, LGET(GETMESSAGE(3, 480, "T"))) ;
/* CTL('r') */
get_key_val(&mode_buttons[i++].value, LGET(GETMESSAGE(3, 481, "\022"))) ;
get_key_val(&mode_buttons[i++].value, LGET(GETMESSAGE(3, 482, "p"))) ;
get_key_val(&mode_buttons[i++].value, LGET(GETMESSAGE(3, 483, "P"))) ;
get_key_val(&mode_buttons[i++].value, LGET(GETMESSAGE(3, 484, "v"))) ;
get_key_val(&mode_buttons[i++].value, LGET(GETMESSAGE(5, 517, "y"))) ;
get_key_val(&mode_buttons[i++].value, LGET(GETMESSAGE(3, 485, "L"))) ;
/* CTL('t') */
get_key_val(&mode_buttons[i++].value, LGET(GETMESSAGE(3, 486, "\024"))) ;
/* CTL('d') */
get_key_val(&mode_buttons[i++].value, LGET(GETMESSAGE(3, 487, "\004"))) ;
/* CTL('s') */
get_key_val(&mode_buttons[i++].value, LGET(GETMESSAGE(3, 488, "\023"))) ;
/* CTL('y') */
get_key_val(&mode_buttons[i++].value, LGET(GETMESSAGE(3, 489, "\031"))) ;
get_key_val(&mode_buttons[i++].value, " ") ;
get_key_val(&mode_buttons[i++].value, " ") ;
get_key_val(&mode_buttons[i++].value, " ") ;
get_key_val(&mode_buttons[i++].value, " ") ;
get_key_val(&mode_buttons[i++].value, " ") ;
/* Logical. */
get_key_val(&mode_buttons[i++].value, LGET(GETMESSAGE(3, 249, "<"))) ;
get_key_val(&mode_buttons[i++].value, LGET(GETMESSAGE(3, 250, ">"))) ;
get_key_val(&mode_buttons[i++].value, LGET(GETMESSAGE(3, 490, "["))) ;
get_key_val(&mode_buttons[i++].value, LGET(GETMESSAGE(3, 491, "]"))) ;
get_key_val(&mode_buttons[i++].value, LGET(GETMESSAGE(3, 492, "|"))) ;
get_key_val(&mode_buttons[i++].value, LGET(GETMESSAGE(3, 493, "&"))) ;
get_key_val(&mode_buttons[i++].value, LGET(GETMESSAGE(3, 494, "~"))) ;
get_key_val(&mode_buttons[i++].value, LGET(GETMESSAGE(3, 495, "^"))) ;
get_key_val(&mode_buttons[i++].value, LGET(GETMESSAGE(3, 496, "n"))) ;
get_key_val(&mode_buttons[i++].value, " ") ;
get_key_val(&mode_buttons[i++].value, " ") ;
get_key_val(&mode_buttons[i++].value, " ") ;
get_key_val(&mode_buttons[i++].value, " ") ;
get_key_val(&mode_buttons[i++].value, " ") ;
get_key_val(&mode_buttons[i++].value, " ") ;
get_key_val(&mode_buttons[i++].value, " ") ;
/* Scientific. */
get_key_val(&mode_buttons[i++].value, LGET(GETMESSAGE(3, 501, "i"))) ;
get_key_val(&mode_buttons[i++].value, LGET(GETMESSAGE(3, 500, "h"))) ;
get_key_val(&mode_buttons[i++].value, LGET(GETMESSAGE(3, 502, "{"))) ;
get_key_val(&mode_buttons[i++].value, LGET(GETMESSAGE(3, 503, "}"))) ;
get_key_val(&mode_buttons[i++].value, LGET(GETMESSAGE(3, 504, "y"))) ;
get_key_val(&mode_buttons[i++].value, LGET(GETMESSAGE(3, 505, "!"))) ;
/* CTL('c') */
get_key_val(&mode_buttons[i++].value, LGET(GETMESSAGE(3, 506, "\003"))) ;
/* CTL('s') */
get_key_val(&mode_buttons[i++].value, LGET(GETMESSAGE(3, 507, "\023"))) ;
/* CTL('t') */
get_key_val(&mode_buttons[i++].value, LGET(GETMESSAGE(3, 508, "\024"))) ;
get_key_val(&mode_buttons[i++].value, LGET(GETMESSAGE(3, 509, "N"))) ;
get_key_val(&mode_buttons[i++].value, LGET(GETMESSAGE(3, 510, "G"))) ;
get_key_val(&mode_buttons[i++].value, LGET(GETMESSAGE(3, 511, "?"))) ;
get_key_val(&mode_buttons[i++].value, " ") ;
get_key_val(&mode_buttons[i++].value, " ") ;
get_key_val(&mode_buttons[i++].value, " ") ;
get_key_val(&mode_buttons[i++].value, " ") ;
}
void
init_mess() /* Setup text strings depending upon language. */
{
int i ;
base_str[(int) BIN] = XtNewString(LGET(GETMESSAGE(2, 1, "Bin"))) ; /* Base values. */
base_str[(int) OCT] = XtNewString(LGET(GETMESSAGE(2, 2, "Oct"))) ;
base_str[(int) DEC] = XtNewString(LGET(GETMESSAGE(2, 3, "Dec"))) ;
base_str[(int) HEX] = XtNewString(LGET(GETMESSAGE(2, 4, "Hex"))) ;
i = 0 ;
cmenus[i++].title = XtNewString(LGET(GETMESSAGE(3, 107, "Accuracy"))) ; /* ACC */
cmenus[i++].title = XtNewString(LGET(GETMESSAGE(3, 108, "Numeric base"))) ; /* BASE TYPE */
cmenus[i++].title = XtNewString(LGET(GETMESSAGE(3, 109, "Constants"))) ; /* CON */
cmenus[i++].title = XtNewString(LGET(GETMESSAGE(3, 110, "Exchange"))) ; /* EXCH */
cmenus[i++].title = XtNewString(LGET(GETMESSAGE(3, 111, "Functions"))) ; /* FUN */
cmenus[i++].title = XtNewString(LGET(GETMESSAGE(3, 113, "Mode"))) ; /* MODE */
cmenus[i++].title = XtNewString(LGET(GETMESSAGE(3, 114, "Display type"))) ; /* NUM TYPE */
cmenus[i++].title = XtNewString(LGET(GETMESSAGE(3, 115, "Retrieve"))) ; /* RCL */
cmenus[i++].title = XtNewString(LGET(GETMESSAGE(3, 117, "Store"))) ; /* STO */
cmenus[i++].title = XtNewString(LGET(GETMESSAGE(3, 118, "Trigonometric type"))) ;/* TRIG TYPE */
/* Display mode. */
dtype_str[(int) ENG] = XtNewString(LGET(GETMESSAGE(2, 5, "ENG"))) ;
dtype_str[(int) FIX] = XtNewString(LGET(GETMESSAGE(2, 6, "FIX"))) ;
dtype_str[(int) SCI] = XtNewString(LGET(GETMESSAGE(2, 7, "SCI"))) ;
/* Labels for various Motif items. */
lstrs[(int) L_CONNO] = XtNewString(LGET(GETMESSAGE(3, 132, "Constant no:"))) ;
lstrs[(int) L_FUNNO] = XtNewString(LGET(GETMESSAGE(3, 133, "Function no:"))) ;
lstrs[(int) L_LCALC] = XtNewString(LGET(GETMESSAGE(3, 134, "calculator"))) ;
lstrs[(int) L_NEWCON] = XtNewString(LGET(GETMESSAGE(3, 135, "New Constant"))) ;
lstrs[(int) L_NEWFUN] = XtNewString(LGET(GETMESSAGE(3, 136, "New Function"))) ;
lstrs[(int) L_UCALC] = XtNewString(LGET(GETMESSAGE(2, 12, "Calculator"))) ;
lstrs[(int) L_MEMT] = XtNewString(LGET(GETMESSAGE(3, 137, "Memory Registers"))) ;
lstrs[(int) L_FINMEMT] = XtNewString(LGET(GETMESSAGE(3, 518, "Financial Registers"))) ;
lstrs[(int) L_PROPT] = XtNewString(LGET(GETMESSAGE(3, 139, "Calculator properties"))) ;
lstrs[(int) L_DESC] = XtNewString(LGET(GETMESSAGE(3, 140, "Description:"))) ;
lstrs[(int) L_VALUE] = XtNewString(LGET(GETMESSAGE(3, 141, "Value:"))) ;
lstrs[(int) L_CONB] = XtNewString(LGET(GETMESSAGE(3, 142, "Enter Constant"))) ;
lstrs[(int) L_FUNB] = XtNewString(LGET(GETMESSAGE(3, 143, "Enter Function"))) ;
/* Message strings. */
mess[(int) MESS_PARAM] = XtNewString(MGET(GETMESSAGE(3, 148, "%s\n"))) ;
mess[(int) MESS_CON] = XtNewString(MGET(GETMESSAGE(3, 149, "%s %1d already exists."))) ;
i = 0 ;
/* ACC */
/* 00 */ menu_entries[i++].str = XtNewString(LGET(GETMESSAGE(3, 153, "0 radix places"))) ;
/* 01 */ menu_entries[i++].str = XtNewString(LGET(GETMESSAGE(3, 154, "1 radix places"))) ;
/* 02 */ menu_entries[i++].str = XtNewString(LGET(GETMESSAGE(3, 155, "2 radix places"))) ;
/* 03 */ menu_entries[i++].str = XtNewString(LGET(GETMESSAGE(3, 156, "3 radix places"))) ;
/* 04 */ menu_entries[i++].str = XtNewString(LGET(GETMESSAGE(3, 157, "4 radix places"))) ;
/* 05 */ menu_entries[i++].str = XtNewString(LGET(GETMESSAGE(3, 158, "5 radix places"))) ;
/* 06 */ menu_entries[i++].str = XtNewString(LGET(GETMESSAGE(3, 159, "6 radix places"))) ;
/* 07 */ menu_entries[i++].str = XtNewString(LGET(GETMESSAGE(3, 160, "7 radix places"))) ;
/* 08 */ menu_entries[i++].str = XtNewString(LGET(GETMESSAGE(3, 161, "8 radix places"))) ;
/* 09 */ menu_entries[i++].str = XtNewString(LGET(GETMESSAGE(3, 162, "9 radix places"))) ;
/* EXCH, RCL, STO */
/* 10 */ menu_entries[i++].str = XtNewString(LGET(GETMESSAGE(3, 163, "Register 0"))) ;
/* 11 */ menu_entries[i++].str = XtNewString(LGET(GETMESSAGE(3, 164, "Register 1"))) ;
/* 12 */ menu_entries[i++].str = XtNewString(LGET(GETMESSAGE(3, 165, "Register 2"))) ;
/* 13 */ menu_entries[i++].str = XtNewString(LGET(GETMESSAGE(3, 166, "Register 3"))) ;
/* 14 */ menu_entries[i++].str = XtNewString(LGET(GETMESSAGE(3, 167, "Register 4"))) ;
/* 15 */ menu_entries[i++].str = XtNewString(LGET(GETMESSAGE(3, 168, "Register 5"))) ;
/* 16 */ menu_entries[i++].str = XtNewString(LGET(GETMESSAGE(3, 169, "Register 6"))) ;
/* 17 */ menu_entries[i++].str = XtNewString(LGET(GETMESSAGE(3, 170, "Register 7"))) ;
/* 18 */ menu_entries[i++].str = XtNewString(LGET(GETMESSAGE(3, 171, "Register 8"))) ;
/* 19 */ menu_entries[i++].str = XtNewString(LGET(GETMESSAGE(3, 172, "Register 9"))) ;
/* BASE */
/* 20 */ menu_entries[i++].str = XtNewString(LGET(GETMESSAGE(3, 188, "Binary"))) ;
/* 21 */ menu_entries[i++].str = XtNewString(LGET(GETMESSAGE(3, 189, "Octal"))) ;
/* 22 */ menu_entries[i++].str = XtNewString(LGET(GETMESSAGE(3, 190, "Decimal"))) ;
/* 23 */ menu_entries[i++].str = XtNewString(LGET(GETMESSAGE(3, 191, "Hexadecimal"))) ;
/* Display type. */
/* 24 */ menu_entries[i++].str = XtNewString(LGET(GETMESSAGE(3, 192, "Engineering"))) ;
/* 25 */ menu_entries[i++].str = XtNewString(LGET(GETMESSAGE(3, 193, "Fixed point"))) ;
/* 26 */ menu_entries[i++].str = XtNewString(LGET(GETMESSAGE(3, 194, "Scientific"))) ;
/* Trig. type. */
/* 27 */ menu_entries[i++].str = XtNewString(LGET(GETMESSAGE(3, 195, "Degrees"))) ;
/* 28 */ menu_entries[i++].str = XtNewString(LGET(GETMESSAGE(3, 196, "Gradients"))) ;
/* 29 */ menu_entries[i++].str = XtNewString(LGET(GETMESSAGE(3, 197, "Radians"))) ;
/* MODE */
/* 30 */ menu_entries[i++].str = XtNewString(LGET(GETMESSAGE(3, 198, "Basic"))) ;
/* 31 */ menu_entries[i++].str = XtNewString(LGET(GETMESSAGE(3, 199, "Financial"))) ;
/* 32 */ menu_entries[i++].str = XtNewString(LGET(GETMESSAGE(3, 200, "Logical"))) ;
/* 33 */ menu_entries[i++].str = XtNewString(LGET(GETMESSAGE(3, 201, "Scientific"))) ;
/* 34 */ menu_entries[i++].str = XtNewString(LGET(GETMESSAGE(3, 203, "Term:"))) ;
/* 35 */ menu_entries[i++].str = XtNewString(LGET(GETMESSAGE(3, 204, "i%Yr:"))) ;
/* 36 */ menu_entries[i++].str = XtNewString(LGET(GETMESSAGE(3, 205, "Present Value:"))) ;
/* 37 */ menu_entries[i++].str = XtNewString(LGET(GETMESSAGE(3, 206, "Payment:"))) ;
/* 38 */ menu_entries[i++].str = XtNewString(LGET(GETMESSAGE(3, 207, "Future Value:"))) ;
/* 39 */ menu_entries[i++].str = XtNewString(LGET(GETMESSAGE(3, 514, "Payments/Year:"))) ;
mode_str[(int) FINANCIAL] = XtNewString(LGET(GETMESSAGE(3, 270, "FINANCIAL"))) ;
mode_str[(int) LOGICAL] = XtNewString(LGET(GETMESSAGE(3, 271, "LOGICAL"))) ;
mode_str[(int) SCIENTIFIC] = XtNewString(LGET(GETMESSAGE(3, 272, "SCIENTIFIC"))) ;
/* MP errors (visible with the -E command line option. */
mpstrs[(int) MP_ADD2A] = XtNewString(LGET(GETMESSAGE(3, 273, "*** SIGN NOT 0, +1 OR -1 IN MPADD2 CALL.\n"))) ;
mpstrs[(int) MP_ADD2B] = XtNewString(LGET(GETMESSAGE(3, 274, "POSSIBLE OVERWRITING PROBLEM ***\n"))) ;
mpstrs[(int) MP_PART1] = XtNewString(LGET(GETMESSAGE(3, 275, "*** N .LE. 1 IN CALL TO MPART1 ***\n"))) ;
mpstrs[(int) MP_ASIN] = XtNewString(LGET(GETMESSAGE(3, 276, "*** ABS(X) .GT. 1 IN CALL TO MPASIN ***\n"))) ;
mpstrs[(int) MP_ATAN] = XtNewString(LGET(GETMESSAGE(3, 277, "*** ERROR OCCURRED IN MPATAN, RESULT INCORRECT ***\n"))) ;
mpstrs[(int) MP_CHKC] = XtNewString(MGET(GETMESSAGE(3, 278, "*** B = %d ILLEGAL IN CALL TO MPCHK.\n"))) ;
mpstrs[(int) MP_CHKD] = XtNewString(LGET(GETMESSAGE(3, 279, "PERHAPS NOT SET BEFORE CALL TO AN MP ROUTINE ***\n"))) ;
mpstrs[(int) MP_CHKE] = XtNewString(MGET(GETMESSAGE(3, 280, "*** T = %d ILLEGAL IN CALL TO MPCHK.\n"))) ;
mpstrs[(int) MP_CHKF] = XtNewString(LGET(GETMESSAGE(3, 279, "PERHAPS NOT SET BEFORE CALL TO AN MP ROUTINE ***\n"))) ;
mpstrs[(int) MP_CHKG] = XtNewString(LGET(GETMESSAGE(3, 282, "*** M .LE. T IN CALL TO MPCHK.\n"))) ;
mpstrs[(int) MP_CHKH] = XtNewString(LGET(GETMESSAGE(3, 279, "PERHAPS NOT SET BEFORE CALL TO AN MP ROUTINE ***\n"))) ;
mpstrs[(int) MP_CHKI] = XtNewString(LGET(GETMESSAGE(3, 284, "*** B TOO LARGE IN CALL TO MPCHK ***\n"))) ;
mpstrs[(int) MP_CHKJ] = XtNewString(LGET(GETMESSAGE(3, 285, "*** MXR TOO SMALL OR NOT SET TO DIM(R) BEFORE CALL "))) ;
mpstrs[(int) MP_CHKL] = XtNewString(LGET(GETMESSAGE(3, 286, "TO AN MP ROUTINE ***\n"))) ;
mpstrs[(int) MP_CHKM] = XtNewString(MGET(GETMESSAGE(3, 287, "*** MXR SHOULD BE AT LEAST %d*T + %d = %d ***\n"))) ;
mpstrs[(int) MP_CHKN] = XtNewString(MGET(GETMESSAGE(3, 288, "*** ACTUALLY MXR = %d, AND T = %d ***\n"))) ;
mpstrs[(int) MP_CMD] = XtNewString(LGET(GETMESSAGE(3, 289, "*** FLOATING-POINT OVER/UNDER-FLOW IN MPCMD ***\n"))) ;
mpstrs[(int) MP_CMR] = XtNewString(LGET(GETMESSAGE(3, 290, "*** FLOATING-POINT OVER/UNDER-FLOW IN MPCMR ***\n"))) ;
mpstrs[(int) MP_CQM] = XtNewString(LGET(GETMESSAGE(3, 291, "*** J = 0 IN CALL TO MPCQM ***\n"))) ;
mpstrs[(int) MP_DIVA] = XtNewString(LGET(GETMESSAGE(3, 292, "*** ATTEMPTED DIVISION BY ZERO IN CALL TO MPDIV ***\n"))) ;
mpstrs[(int) MP_DIVB] = XtNewString(LGET(GETMESSAGE(3, 293, "*** OVERFLOW OCCURRED IN MPDIV ***\n"))) ;
mpstrs[(int) MP_DIVIA] = XtNewString(LGET(GETMESSAGE(3, 294, "*** ATTEMPTED DIVISION BY ZERO IN CALL TO MPDIVI ***\n"))) ;
mpstrs[(int) MP_DIVIB] = XtNewString(LGET(GETMESSAGE(3, 295, "*** INTEGER OVERFLOW IN MPDIVI, B TOO LARGE ***\n"))) ;
mpstrs[(int) MP_EXPA] = XtNewString(LGET(GETMESSAGE(3, 296, "*** OVERFLOW IN SUBROUTINE MPEXP ***\n"))) ;
mpstrs[(int) MP_EXPB] = XtNewString(LGET(GETMESSAGE(3, 297, "*** ERROR OCCURRED IN MPEXP, RESULT INCORRECT ***\n"))) ;
mpstrs[(int) MP_EXP1] = XtNewString(LGET(GETMESSAGE(3, 298, "*** ABS(X) NOT LESS THAN 1 IN CALL TO MPEXP1 ***\n"))) ;
mpstrs[(int) MP_LNA] = XtNewString(LGET(GETMESSAGE(3, 299, "*** X NONPOSITIVE IN CALL TO MPLN ***\n"))) ;
mpstrs[(int) MP_LNB] = XtNewString(LGET(GETMESSAGE(3, 300, "*** ERROR IN MPLN, ITERATION NOT CONVERGING ***\n"))) ;
mpstrs[(int) MP_LNSA] = XtNewString(LGET(GETMESSAGE(3, 301, "*** ABS(X) .GE. 1/B IN CALL TO MPLNS ***\n"))) ;
mpstrs[(int) MP_LNSB] = XtNewString(LGET(GETMESSAGE(3, 302, "*** ERROR OCCURRED IN MPLNS.\n"))) ;
mpstrs[(int) MP_LNSC] = XtNewString(LGET(GETMESSAGE(3, 303, "NEWTON ITERATION NOT CONVERGING PROPERLY ***\n"))) ;
mpstrs[(int) MP_MULA] = XtNewString(LGET(GETMESSAGE(3, 304, "*** INTEGER OVERFLOW IN MPMUL, B TOO LARGE ***\n"))) ;
mpstrs[(int) MP_MULB] = XtNewString(LGET(GETMESSAGE(3, 305, "*** ILLEGAL BASE B DIGIT IN CALL TO MPMUL.\n"))) ;
mpstrs[(int) MP_MULC] = XtNewString(LGET(GETMESSAGE(3, 306, "POSSIBLE OVERWRITING PROBLEM ***\n"))) ;
mpstrs[(int) MP_MUL2A] = XtNewString(LGET(GETMESSAGE(3, 307, "*** OVERFLOW OCCURRED IN MPMUL2 ***\n"))) ;
mpstrs[(int) MP_MUL2B] = XtNewString(LGET(GETMESSAGE(3, 308, "*** INTEGER OVERFLOW IN MPMUL2, B TOO LARGE ***\n"))) ;
mpstrs[(int) MP_MULQ] = XtNewString(LGET(GETMESSAGE(3, 309, "*** ATTEMPTED DIVISION BY ZERO IN MPMULQ ***\n"))) ;
mpstrs[(int) MP_NZRA] = XtNewString(LGET(GETMESSAGE(3, 310, "*** SIGN NOT 0, +1 OR -1 IN CALL TO MPNZR.\n"))) ;
mpstrs[(int) MP_NZRB] = XtNewString(LGET(GETMESSAGE(3, 311, "POSSIBLE OVERWRITING PROBLEM ***\n"))) ;
mpstrs[(int) MP_NZRC] = XtNewString(LGET(GETMESSAGE(3, 312, "*** OVERFLOW OCCURRED IN MPNZR ***\n"))) ;
mpstrs[(int) MP_OVFL] = XtNewString(LGET(GETMESSAGE(3, 313, "*** CALL TO MPOVFL, MP OVERFLOW OCCURRED ***\n"))) ;
mpstrs[(int) MP_PI] = XtNewString(LGET(GETMESSAGE(3, 314, "*** ERROR OCCURRED IN MPPI, RESULT INCORRECT ***\n"))) ;
mpstrs[(int) MP_PWRA] = XtNewString(LGET(GETMESSAGE(3, 315, "*** ATTEMPT TO RAISE ZERO TO NEGATIVE POWER IN\n"))) ;
mpstrs[(int) MP_PWRB] = XtNewString(LGET(GETMESSAGE(3, 316, "CALL TO SUBROUTINE MPPWR ***\n"))) ;
mpstrs[(int) MP_PWR2A] = XtNewString(LGET(GETMESSAGE(3, 317, "*** X NEGATIVE IN CALL TO MPPWR2 ***\n"))) ;
mpstrs[(int) MP_PWR2B] = XtNewString(LGET(GETMESSAGE(3, 318, "*** X ZERO AND Y NONPOSITIVE IN CALL TO MPPWR2 ***\n"))) ;
mpstrs[(int) MP_RECA] = XtNewString(LGET(GETMESSAGE(3, 319, "*** ATTEMPTED DIVISION BY ZERO IN CALL TO MPREC ***\n"))) ;
mpstrs[(int) MP_RECB] = XtNewString(LGET(GETMESSAGE(3, 320, "*** ERROR OCCURRED IN MPREC, NEWTON ITERATION\n"))) ;
mpstrs[(int) MP_RECC] = XtNewString(LGET(GETMESSAGE(3, 321, "NOT CONVERGING PROPERLY ***\n"))) ;
mpstrs[(int) MP_RECD] = XtNewString(LGET(GETMESSAGE(3, 322, "*** OVERFLOW OCCURRED IN MPREC ***\n"))) ;
mpstrs[(int) MP_ROOTA] = XtNewString(LGET(GETMESSAGE(3, 323, "*** N = 0 IN CALL TO MPROOT ***\n"))) ;
mpstrs[(int) MP_ROOTB] = XtNewString(LGET(GETMESSAGE(3, 324, "*** ABS(N) TOO LARGE IN CALL TO MPROOT ***\n"))) ;
mpstrs[(int) MP_ROOTC] = XtNewString(LGET(GETMESSAGE(3, 325, "*** X = 0 AND N NEGATIVE IN CALL TO MPROOT ***\n"))) ;
mpstrs[(int) MP_ROOTD] = XtNewString(LGET(GETMESSAGE(3, 326, "*** X NEGATIVE AND N EVEN IN CALL TO MPROOT ***\n"))) ;
mpstrs[(int) MP_ROOTE] = XtNewString(LGET(GETMESSAGE(3, 327, "*** ERROR OCCURRED IN MPROOT, NEWTON ITERATION\n"))) ;
mpstrs[(int) MP_ROOTF] = XtNewString(LGET(GETMESSAGE(3, 328, "NOT CONVERGING PROPERLY ***\n"))) ;
mpstrs[(int) MP_SETB] = XtNewString(LGET(GETMESSAGE(3, 329, "*** IDECPL .LE. 0 IN CALL TO MPSET ***\n"))) ;
mpstrs[(int) MP_SETC] = XtNewString(LGET(GETMESSAGE(3, 330, "ITMAX2 TOO SMALL IN CALL TO MPSET ***\n"))) ;
mpstrs[(int) MP_SETD] = XtNewString(LGET(GETMESSAGE(3, 331, "*** INCREASE ITMAX2 AND DIMENSIONS OF MP ARRAYS \n"))) ;
mpstrs[(int) MP_SETE] = XtNewString(MGET(GETMESSAGE(3, 332, "TO AT LEAST %d ***\n"))) ;
mpstrs[(int) MP_SIN] = XtNewString(LGET(GETMESSAGE(3, 333, "*** ERROR OCCURRED IN MPSIN, RESULT INCORRECT ***\n"))) ;
mpstrs[(int) MP_SIN1] = XtNewString(LGET(GETMESSAGE(3, 334, "*** ABS(X) .GT. 1 IN CALL TO MPSIN1 ***\n"))) ;
mpstrs[(int) MP_SQRT] = XtNewString(LGET(GETMESSAGE(3, 335, "*** X NEGATIVE IN CALL TO SUBROUTINE MPSQRT ***\n"))) ;
mpstrs[(int) MP_TAN] = XtNewString(LGET(GETMESSAGE(3, 336, "*** TAN(X) TOO LARGE IN CALL TO MPTAN ***\n"))) ;
/* Command line options. */
opts[(int) O_ACCVAL] = XtNewString(LGET(GETMESSAGE(3, 337, "Calculator: -a needs accuracy value of 0-9."))) ;
opts[(int) O_ACCRANGE] = XtNewString(MGET(GETMESSAGE(3, 338, "Calculator: accuracy should be in the range 0-9\nWill set accuracy to the default: 2.\n")));
opts[(int) O_BASE] = XtNewString(MGET(GETMESSAGE(3, 339, "Calculator: base should be binary, octal, decimal or hexadecimal.\nWill set base to the default: decimal.\n"))) ;
opts[(int) O_DISPLAY] = XtNewString(MGET(GETMESSAGE(3, 340, "Calculator: invalid display mode [%s]\n"))) ;
opts[(int) O_MODE] = XtNewString(MGET(GETMESSAGE(3, 341, "Calculator: invalid mode [%s]\nWill set mode to its default: scientific\n"))) ;
opts[(int) O_TRIG] = XtNewString(MGET(GETMESSAGE(3, 342, "Calculator: invalid trig. mode [%s]\n"))) ;
opts[(int) O_SESSION] = XtNewString(MGET(GETMESSAGE(3, 343, "Calculator: invalid session file.\n"))) ;
pstrs[(int) P_CHAR] = XtNewString(LGET(GETMESSAGE(3, 351, "Character:"))) ;
pstrs[(int) P_ASCIIT] = XtNewString(LGET(GETMESSAGE(3, 352, "Get ASCII"))) ;
/* Trig. type values. */
ttype_str[(int) DEG] = XtNewString(LGET(GETMESSAGE(3, 353, "Deg"))) ;
ttype_str[(int) GRAD] = XtNewString(LGET(GETMESSAGE(3, 354, "Grad"))) ;
ttype_str[(int) RAD] = XtNewString(LGET(GETMESSAGE(3, 355, "Rad"))) ;
/* Usage message. */
ustrs[(int) USAGE1] = XtNewString(MGET(GETMESSAGE(3, 356, "Calculator (dtcalc) version 1.%1d\n\n"))) ;
ustrs[(int) USAGE2] = XtNewString(MGET(GETMESSAGE(3, 357, "Usage: dtcalc [-a accuracy] [-m mode] [-b base] [-no_menu_bar] [-?]\n"))) ;
ustrs[(int) USAGE3] = XtNewString(LGET(GETMESSAGE(3, 358, "\t [-notation display_notation] [-trig trignometric_type] [-session session_file]\n"))) ;
/* Various strings. */
vstrs[(int) V_CANCEL] = XtNewString(LGET(GETMESSAGE(3, 361, "Cancel"))) ;
vstrs[(int) V_CONFIRM] = XtNewString(LGET(GETMESSAGE(3, 362, "Confirm"))) ;
vstrs[(int) V_CONTINUE] = XtNewString(LGET(GETMESSAGE(3, 363, "Continue"))) ;
vstrs[(int) V_CONWNAME] = XtNewString(LGET(GETMESSAGE(3, 142, "Enter Constant"))) ;
vstrs[(int) V_ERROR] = XtNewString(LGET(GETMESSAGE(3, 364, "Error"))) ;
vstrs[(int) V_FUNWNAME] = XtNewString(LGET(GETMESSAGE(3, 143, "Enter Function"))) ;
vstrs[(int) V_CLR] = XtNewString(LGET(GETMESSAGE(3, 370, "CLR"))) ;
vstrs[(int) V_HYP] = XtNewString(LGET(GETMESSAGE(3, 371, "HYP"))) ;
vstrs[(int) V_INV] = XtNewString(LGET(GETMESSAGE(3, 372, "INV"))) ;
vstrs[(int) V_INVCON] = XtNewString(LGET(GETMESSAGE(3, 373, "Invalid constant value"))) ;
vstrs[(int) V_LCON] = XtNewString(LGET(GETMESSAGE(3, 374, "Invalid constant number."))) ;
vstrs[(int) V_LFUN] = XtNewString(LGET(GETMESSAGE(3, 375, "Invalid function number."))) ;
vstrs[(int) V_NOCHANGE] = XtNewString(LGET(GETMESSAGE(3, 377, "Constant not changed."))) ;
vstrs[(int) V_NUMSTACK] = XtNewString(LGET(GETMESSAGE(3, 378, "Numeric stack error"))) ;
vstrs[(int) V_OPSTACK] = XtNewString(LGET(GETMESSAGE(3, 379, "Operand stack error"))) ;
vstrs[(int) V_OWRITE] = XtNewString(LGET(GETMESSAGE(3, 380, "Okay to overwrite?"))) ;
vstrs[(int) V_RANGE] = XtNewString(LGET(GETMESSAGE(3, 381, "Must be in the range 0 - 9"))) ;
vstrs[(int) V_TRUE] = LGET("true") ;
vstrs[(int) V_UCON] = XtNewString(LGET(GETMESSAGE(3, 383, "Constant"))) ;
vstrs[(int) V_UFUN] = XtNewString(LGET(GETMESSAGE(3, 384, "Function"))) ;
vstrs[(int) V_NORSAVE] = XtNewString(LGET(GETMESSAGE(3, 385, "Unable to save defaults.\n"))) ;
}

View File

@@ -0,0 +1,23 @@
/* $XConsortium: version.c /main/5 1996/08/30 15:28:16 drk $
*
* (c) Copyright 1996 Digital Equipment Corporation.
* (c) Copyright 1993,1994,1996 Hewlett-Packard Company.
* (c) Copyright 1993,1994,1996 International Business Machines Corp.
* (c) Copyright 1993,1994,1996 Sun Microsystems, Inc.
* (c) Copyright 1993,1994,1996 Novell, Inc.
* (c) Copyright 1996 FUJITSU LIMITED.
* (c) Copyright 1996 Hitachi.
*/
#include <include/hpversion.h>
#ifndef lint
version_tag("dtcalc: $XConsortium: version.c /main/5 1996/08/30 15:28:16 drk $")
#endif /* lint */