diff --git a/ansi.c b/ansi.c index 5530fef..0edae4f 100644 --- a/ansi.c +++ b/ansi.c @@ -1825,7 +1825,7 @@ ansi_send_pa(int nn) net_sends(fn_buf); } -void toggle_lineWrap(H3270 *session, struct toggle *t unused, LIB3270_TOGGLE_TYPE type unused) +void toggle_lineWrap(H3270 *session, struct lib3270_toggle *t unused, LIB3270_TOGGLE_TYPE type unused) { if (toggled(LIB3270_TOGGLE_LINE_WRAP)) wraparound_mode = 1; diff --git a/ansic.h b/ansic.h index 21343a2..9a2c19e 100644 --- a/ansic.h +++ b/ansic.h @@ -29,7 +29,7 @@ LIB3270_INTERNAL void ansi_send_pa(int nn); LIB3270_INTERNAL void ansi_send_pf(int nn); LIB3270_INTERNAL void ansi_send_right(void); LIB3270_INTERNAL void ansi_send_up(void); -LIB3270_INTERNAL void toggle_lineWrap(H3270 *session, struct toggle *t, LIB3270_TOGGLE_TYPE type); +LIB3270_INTERNAL void toggle_lineWrap(H3270 *session, struct lib3270_toggle *t, LIB3270_TOGGLE_TYPE type); #else /*][*/ diff --git a/appres.h b/appres.h index cd36ff0..f3c13f8 100644 --- a/appres.h +++ b/appres.h @@ -24,18 +24,21 @@ /* Toggles */ +/* struct toggle { - char value; /* toggle value */ -// char changed; /* has the value changed since init */ -// Widget w[2]; /* the menu item widgets */ -// const char *label[2]; /* labels */ - void (*upcall)(H3270 *, struct toggle *, LIB3270_TOGGLE_TYPE); /* change value */ + char value; // toggle value +// char changed; // has the value changed since init +// Widget w[2]; // the menu item widgets +// const char *label[2]; // labels + void (*upcall)(H3270 *, struct toggle *, LIB3270_TOGGLE_TYPE); // change value // void (*callback)(H3270 *, int, LIB3270_TOGGLE_TYPE); }; -#define toggled(ix) (appres.toggle[ix].value) // #define toggle_toggle(t) { (t)->value = !(t)->value; } +*/ + +#define toggled(ix) lib3270_get_toggle(NULL,ix) /* Application resources */ @@ -184,7 +187,7 @@ typedef struct { char *proxy; /* Toggles */ - struct toggle toggle[N_TOGGLES]; +// struct toggle toggle[N_TOGGLES]; /* #if defined(X3270_DISPLAY) // Simple widget resources @@ -234,4 +237,4 @@ extern AppRes appres; #define N_( x ) x #define MSG_( c, s ) s -void toggle_rectselect(H3270 *session, struct toggle *t, LIB3270_TOGGLE_TYPE tt); +void toggle_rectselect(H3270 *session, struct lib3270_toggle *t, LIB3270_TOGGLE_TYPE tt); diff --git a/ctlr.c b/ctlr.c index c111fcc..f3a0793 100644 --- a/ctlr.c +++ b/ctlr.c @@ -2798,30 +2798,9 @@ static void ticking_stop(H3270 *session) } /* -void toggle_showTiming(H3270 *session, struct toggle *t unused, LIB3270_TOGGLE_TYPE tt unused) -{ - if (!toggled(SHOW_TIMING)) - status_untiming(&h3270); -} -*/ - - -/* * No-op toggle. */ -void -toggle_nop(H3270 *session, struct toggle *t unused, LIB3270_TOGGLE_TYPE tt unused) +void toggle_nop(H3270 *session, struct lib3270_toggle *t unused, LIB3270_TOGGLE_TYPE tt unused) { } -/* -int ctlr_get_rows(void) -{ - return h3270.rows; -} - -int ctlr_get_cols(void) -{ - return h3270.cols; -} -*/ diff --git a/ctlrc.h b/ctlrc.h index c869462..2a5b71c 100644 --- a/ctlrc.h +++ b/ctlrc.h @@ -62,18 +62,18 @@ LIB3270_INTERNAL void ctlr_set_rows_cols(H3270 *session, int mn, int ovc, int ov LIB3270_INTERNAL void ctlr_erase(H3270 *session, int alt); LIB3270_INTERNAL void ticking_start(H3270 *session, Boolean anyway); -LIB3270_INTERNAL void toggle_nop(H3270 *session, struct toggle *t, LIB3270_TOGGLE_TYPE tt); -LIB3270_INTERNAL void toggle_showTiming(struct toggle *t, LIB3270_TOGGLE_TYPE tt); +LIB3270_INTERNAL void toggle_nop(H3270 *session, struct lib3270_toggle *t, LIB3270_TOGGLE_TYPE tt); +LIB3270_INTERNAL void toggle_showTiming(struct lib3270_toggle *t, LIB3270_TOGGLE_TYPE tt); enum dbcs_state { DBCS_NONE = 0, /* position is not DBCS */ - DBCS_LEFT, /* position is left half of DBCS character */ - DBCS_RIGHT, /* position is right half of DBCS character */ - DBCS_SI, /* position is SI terminating DBCS subfield */ - DBCS_SB, /* position is SBCS character after the SI */ + DBCS_LEFT, /* position is left half of DBCS character */ + DBCS_RIGHT, /* position is right half of DBCS character */ + DBCS_SI, /* position is SI terminating DBCS subfield */ + DBCS_SB, /* position is SBCS character after the SI */ DBCS_LEFT_WRAP, /* position is left half of split DBCS */ DBCS_RIGHT_WRAP, /* position is right half of split DBCS */ - DBCS_DEAD /* position is dead left-half DBCS */ + DBCS_DEAD /* position is dead left-half DBCS */ }; #define IS_LEFT(d) ((d) == DBCS_LEFT || (d) == DBCS_LEFT_WRAP) #define IS_RIGHT(d) ((d) == DBCS_RIGHT || (d) == DBCS_RIGHT_WRAP) diff --git a/glue.c b/glue.c index fddd25c..ce012ca 100644 --- a/glue.c +++ b/glue.c @@ -127,7 +127,7 @@ static void initialize(void) h3270.selected = 0; h3270.select.begin = h3270.select.end = 0; - initialize_toggles(&h3270,appres.toggle); +// initialize_toggles(&h3270); #if defined(_WIN32) (void) get_version_info(); @@ -148,11 +148,13 @@ static void initialize(void) appres.modified_sel = False; appres.apl_mode = False; -#if defined(C3270) || defined(TCL3270) /*[*/ -// appres.scripted = False; -#else /*][*/ +/* +#if defined(C3270) || defined(TCL3270) + appres.scripted = False; +#else appres.scripted = True; -#endif /*]*/ +#endif +*/ appres.numeric_lock = False; // appres.secure = False; @@ -193,9 +195,11 @@ static void initialize(void) appres.trace_dir = "/tmp"; #endif /*]*/ -#if defined(X3270_DISPLAY) || defined(WC3270) /*[*/ +/* +#if defined(X3270_DISPLAY) || defined(WC3270) appres.trace_monitor = True; -#endif /*]*/ +#endif +*/ #endif /*]*/ @@ -227,17 +231,23 @@ static void initialize(void) appres.dft_buffer_size = DFT_BUF; #endif /*]*/ -#if defined(C3270) && !defined(LIB3270) /*[*/ +/* +#if defined(C3270) && !defined(LIB3270) appres.toggle[CURSOR_POS].value = True; -#endif /*]*/ +#endif +*/ -#if defined(X3270_SCRIPT) || defined(TCL3270) /*[*/ +/* +#if defined(X3270_SCRIPT) || defined(TCL3270) appres.toggle[AID_WAIT].value = True; -#endif /*]*/ +#endif +*/ -#if defined(C3270) && defined(X3270_SCRIPT) /*[*/ +/* +#if defined(C3270) && defined(X3270_SCRIPT) appres.plugin_command = "x3270hist.pl"; -#endif /*]*/ +#endif +*/ #if defined(C3270) && defined(_WIN32) /*[*/ appres.highlight_underline = True; diff --git a/init.c b/init.c index bdb35ce..2884655 100644 --- a/init.c +++ b/init.c @@ -49,7 +49,7 @@ void lib3270_session_free(H3270 *h) if(lib3270_connected(h)) lib3270_disconnect(h); - shutdown_toggles(h,appres.toggle); + shutdown_toggles(h); // Release state change callbacks for(f=0;fsz = sizeof(H3270); + // Initialize toggles + initialize_toggles(hSession); + // Dummy calls to avoid "ifs" hSession->update = update_char; hSession->update_model = update_model; diff --git a/kybd.c b/kybd.c index 07bb3ea..2fed494 100644 --- a/kybd.c +++ b/kybd.c @@ -2274,11 +2274,11 @@ LIB3270_ACTION( dup ) if (kybdlock) { ENQUEUE_ACTION(lib3270_enter); - return; + return 0; } #if defined(X3270_ANSI) if (IN_ANSI) - return; + return 0; #endif if (key_Character(EBC_dup, False, False, NULL)) cursor_move(next_unprotected(hSession->cursor_addr)); diff --git a/lib3270.cbp b/lib3270.cbp index 492c3f5..cf9c572 100644 --- a/lib3270.cbp +++ b/lib3270.cbp @@ -7,8 +7,8 @@