diff --git a/src/include/lib3270/session.h b/src/include/lib3270/session.h index af0e8f9..702caf1 100644 --- a/src/include/lib3270/session.h +++ b/src/include/lib3270/session.h @@ -191,6 +191,7 @@ void (*configure)(H3270 *session, unsigned short rows, unsigned short cols); void (*update)(H3270 *session, int baddr, unsigned char c, unsigned short attr, unsigned char cursor); void (*changed)(H3270 *session, int offset, int len); + void (*display)(H3270 *session); void (*update_cursor)(H3270 *session, unsigned short row, unsigned short col, unsigned char c, unsigned short attr); void (*update_oia)(H3270 *session, LIB3270_FLAG id, unsigned char on); diff --git a/src/lib3270/api.h b/src/lib3270/api.h index efcec27..463f28c 100644 --- a/src/lib3270/api.h +++ b/src/lib3270/api.h @@ -388,7 +388,7 @@ /* Screen calls */ // LOCAL_EXTERN void screen_resume(H3270 *session); // LOCAL_EXTERN void screen_suspend(H3270 *session); - LOCAL_EXTERN void screen_disp(H3270 *session); +// LOCAL_EXTERN void screen_disp(H3270 *session); #include diff --git a/src/lib3270/ctlr.c b/src/lib3270/ctlr.c index 81c4bd7..84a1a7b 100644 --- a/src/lib3270/ctlr.c +++ b/src/lib3270/ctlr.c @@ -459,7 +459,7 @@ void ctlr_erase(H3270 *session, int alt) kybd_inhibit(False); ctlr_clear(session,True); - screen_erase(session); + session->erase(session); if(alt == session->screen_alt) return; @@ -467,7 +467,7 @@ void ctlr_erase(H3270 *session, int alt) if (alt) { /* Going from 24x80 to maximum. */ - screen_disp(session); + session->display(session); set_viewsize(session,session->maxROWS,session->maxCOLS); } else @@ -478,7 +478,7 @@ void ctlr_erase(H3270 *session, int alt) if(session->vcontrol) { ctlr_blanks(); - screen_disp(session); + session->display(session); } set_viewsize(session,24,80); } @@ -2574,7 +2574,7 @@ void ctlr_scroll(void) /* Clear the last line. */ (void) memset((char *) &h3270.ea_buf[qty], 0, h3270.cols * sizeof(struct ea)); - screen_disp(&h3270); + h3270.display(&h3270); } #endif /*]*/ @@ -2672,7 +2672,7 @@ ctlr_shrink(void) h3270.ea_buf[baddr].cc = h3270.vcontrol ? EBC_space : EBC_null; } ALL_CHANGED; - screen_disp(&h3270); + h3270.display(&h3270); } #if defined(X3270_DBCS) /*[*/ diff --git a/src/lib3270/kybd.c b/src/lib3270/kybd.c index e1d912a..575f435 100644 --- a/src/lib3270/kybd.c +++ b/src/lib3270/kybd.c @@ -1721,7 +1721,7 @@ LIB3270_ACTION( delete ) if (!hSession->ea_buf[baddr].fa) cursor_move(hSession,baddr); } - screen_disp(hSession); + hSession->display(hSession); return 0; } @@ -1753,7 +1753,7 @@ LIB3270_ACTION( backspace ) DEC_BA(baddr); cursor_move(hSession,baddr); } - screen_disp(hSession); + hSession->display(hSession); return 0; } @@ -1815,7 +1815,7 @@ do_erase(void) cursor_move(&h3270,baddr); (void) do_delete(); } - screen_disp(&h3270); + h3270.display(&h3270); } LIB3270_ACTION( erase ) @@ -2261,7 +2261,7 @@ LIB3270_ACTION( dup ) #endif if (key_Character(EBC_dup, False, False, NULL)) { - screen_disp(hSession); + hSession->display(hSession); cursor_move(hSession,next_unprotected(hSession,hSession->cursor_addr)); } } @@ -2527,7 +2527,7 @@ LIB3270_ACTION( eraseeol ) h3270.ea_buf[h3270.cursor_addr].cc = EBC_si; } (void) ctlr_dbcs_postprocess(); - screen_disp(&h3270); + h3270.display(&h3270); return 0; } @@ -2582,7 +2582,7 @@ LIB3270_ACTION( eraseeof ) h3270.ea_buf[hSession->cursor_addr].cc = EBC_si; } (void) ctlr_dbcs_postprocess(); - screen_disp(hSession); + hSession->display(hSession); return 0; } @@ -2637,7 +2637,7 @@ LIB3270_ACTION( eraseinput ) ctlr_clear(hSession,True); cursor_move(hSession,0); } - screen_disp(hSession); + hSession->display(hSession); return 0; } @@ -2704,7 +2704,7 @@ LIB3270_ACTION( deleteword ) else do_erase(); } - screen_disp(hSession); + hSession->display(hSession); return 0; } @@ -2752,7 +2752,7 @@ LIB3270_ACTION( deletefield ) ctlr_add(baddr, EBC_null, 0); INC_BA(baddr); } - screen_disp(hSession); + hSession->display(hSession); return 0; } @@ -3321,7 +3321,7 @@ LIB3270_EXPORT int lib3270_emulate_input(H3270 *session, char *s, int len, int p break; } - screen_disp(session); + session->display(session); return len; } diff --git a/src/lib3270/screen.c b/src/lib3270/screen.c index fe8ec5e..7260ed9 100644 --- a/src/lib3270/screen.c +++ b/src/lib3270/screen.c @@ -80,7 +80,6 @@ static int (*popup_handler)(H3270 *, void *, LIB3270_NOTIFY, const char *, const enum ts { TS_AUTO, TS_ON, TS_OFF }; -static void screen_update(H3270 *session, int bstart, int bend); static void status_connect(H3270 *session, int ignored, void *dunno); static void status_3270_mode(H3270 *session, int ignored, void *dunno); // static void status_printer(H3270 *session, int on, void *dunno); @@ -290,7 +289,7 @@ LIB3270_EXPORT int lib3270_get_contents(H3270 *h, int first, int last, unsigned } /* Display what's in the buffer. */ -static void screen_update(H3270 *session, int bstart, int bend) +void screen_update(H3270 *session, int bstart, int bend) { int baddr; unsigned short a; @@ -368,12 +367,6 @@ static void screen_update(H3270 *session, int bstart, int bend) trace("%s ends",__FUNCTION__); } -void screen_disp(H3270 *session) -{ - CHECK_SESSION_HANDLE(session); - screen_update(session,0,session->rows*session->cols); -} - LIB3270_EXPORT int lib3270_get_cursor_address(H3270 *h) { CHECK_SESSION_HANDLE(h); @@ -476,7 +469,7 @@ void status_reset(H3270 *session) status_changed(session,LIB3270_STATUS_BLANK); } - screen_disp(session); + session->display(session); } @@ -789,7 +782,7 @@ LIB3270_ACTION( testpattern ) hSession->ea_buf[f].cc = pat[row].cc[pos++]; } - screen_disp(hSession); + hSession->display(hSession); return 0; } diff --git a/src/lib3270/screen.h b/src/lib3270/screen.h index 8717769..d0e1edc 100644 --- a/src/lib3270/screen.h +++ b/src/lib3270/screen.h @@ -16,10 +16,7 @@ // #define SELECTED(baddr) False LIB3270_INTERNAL int *char_width, *char_height; -// LIB3270_INTERNAL Boolean screen_has_changes; - -// LIB3270_INTERNAL void screen_update(H3270 *session, int bstart, int bend); +LIB3270_INTERNAL void screen_update(H3270 *session, int bstart, int bend); LIB3270_INTERNAL void status_connecting(H3270 *session, Boolean on); -// LIB3270_INTERNAL void status_resolving(H3270 *session, Boolean on); diff --git a/src/lib3270/screenc.h b/src/lib3270/screenc.h index 8ca4d2d..ab6cf68 100644 --- a/src/lib3270/screenc.h +++ b/src/lib3270/screenc.h @@ -22,17 +22,17 @@ #define display_widthMM() 100 #define display_width() 1 // #define screen_obscured() False -#define screen_scroll() screen_disp() +// #define screen_scroll() screen_disp() #define screen_132() /* */ #define screen_80() /* */ -#define screen_erase(x) x->erase(x) +// #define screen_erase(x) x->erase(x) // LIB3270_INTERNAL void screen_erase(H3270 *session); -LIB3270_INTERNAL void screen_changed(H3270 *session, int bstart, int bend); +// LIB3270_INTERNAL void screen_changed(H3270 *session, int bstart, int bend); LIB3270_INTERNAL int screen_init(H3270 *session); // LIB3270_INTERNAL void screen_flip(void); -LIB3270_INTERNAL FILE *start_pager(void); +// LIB3270_INTERNAL FILE *start_pager(void); LIB3270_INTERNAL Boolean screen_new_display_charsets(char *cslist, char *csname); LIB3270_INTERNAL void mcursor_set(H3270 *session,LIB3270_CURSOR m); diff --git a/src/lib3270/session.c b/src/lib3270/session.c index 13eb8f3..21482a4 100644 --- a/src/lib3270/session.c +++ b/src/lib3270/session.c @@ -139,6 +139,12 @@ static void update_ssl(H3270 *session, LIB3270_SSL_STATE state) { } +static void screen_disp(H3270 *session) +{ + CHECK_SESSION_HANDLE(session); + screen_update(session,0,session->rows*session->cols); +} + static void lib3270_session_init(H3270 *hSession, const char *model) { int ovc, ovr; @@ -148,6 +154,23 @@ static void lib3270_session_init(H3270 *hSession, const char *model) memset(hSession,0,sizeof(H3270)); hSession->sz = sizeof(H3270); + // Default calls + hSession->update = update_char; + hSession->update_model = update_model; + hSession->update_cursor = update_cursor; + hSession->set_selection = nop_char; + hSession->ctlr_done = nop; + hSession->changed = changed; + hSession->erase = screen_disp; + hSession->suspend = nop; + hSession->resume = screen_disp; + hSession->update_oia = update_oia; + hSession->update_selection = update_selection; + hSession->cursor = set_cursor; + hSession->message = message; + hSession->update_ssl = update_ssl; + hSession->display = screen_disp; + // Set the defaults. hSession->extended = 1; hSession->typeahead = 1; @@ -156,6 +179,16 @@ static void lib3270_session_init(H3270 *hSession, const char *model) hSession->icrnl = 1; hSession->onlcr = 1; hSession->host_charset = "bracket"; + hSession->sock = -1; + hSession->model_num = -1; + hSession->cstate = LIB3270_NOT_CONNECTED; + hSession->oia_status = -1; + + +#ifdef _WIN32 + hSession->sockEvent = NULL; +#endif // _WIN32 + /* #if !defined(_WIN32) @@ -173,31 +206,6 @@ static void lib3270_session_init(H3270 *hSession, const char *model) // Initialize toggles initialize_toggles(hSession); - // Dummy calls to avoid "ifs" - hSession->update = update_char; - hSession->update_model = update_model; - hSession->update_cursor = update_cursor; - hSession->set_selection = nop_char; - hSession->ctlr_done = nop; - hSession->changed = changed; - hSession->erase = screen_disp; - hSession->suspend = nop; - hSession->resume = screen_disp; - hSession->update_oia = update_oia; - hSession->update_selection = update_selection; - hSession->cursor = set_cursor; - hSession->message = message; - hSession->update_ssl = update_ssl; - hSession->sock = -1; - -#ifdef _WIN32 - hSession->sockEvent = NULL; -#endif // _WIN32 - - hSession->model_num = -1; - hSession->cstate = NOT_CONNECTED; - hSession->oia_status = -1; - strncpy(hSession->full_model_name,"IBM-",LIB3270_FULL_MODEL_NAME_LENGTH); hSession->model_name = &hSession->full_model_name[4]; diff --git a/src/lib3270/toggles.c b/src/lib3270/toggles.c index ec9072c..f296f6c 100644 --- a/src/lib3270/toggles.c +++ b/src/lib3270/toggles.c @@ -140,7 +140,7 @@ LIB3270_EXPORT int lib3270_toggle(H3270 *session, LIB3270_TOGGLE ix) static void toggle_monocase(H3270 *session, struct lib3270_toggle *t, LIB3270_TOGGLE_TYPE tt) { - screen_disp(session); + session->display(session); } /* diff --git a/src/pw3270/filetransfer.c b/src/pw3270/filetransfer.c index 64db05f..a4dc93d 100644 --- a/src/pw3270/filetransfer.c +++ b/src/pw3270/filetransfer.c @@ -538,7 +538,7 @@ static void run_ft_dialog(GObject *action, GtkWidget *widget, struct ftdialog *d g_object_set_data(G_OBJECT(ftdialog),"progress",progress); gtk_container_set_border_width(GTK_CONTAINER(frame),3); - gtk_container_set_border_width(GTK_CONTAINER(table),6); +// gtk_container_set_border_width(GTK_CONTAINER(table),6); for(f=0;f<2;f++) { @@ -572,6 +572,7 @@ static void run_ft_dialog(GObject *action, GtkWidget *widget, struct ftdialog *d entry[pos] = gtk_label_new(_("N/A" )); gtk_misc_set_alignment(GTK_MISC(entry[f]),0,0); + gtk_table_attach(GTK_TABLE(table),entry[pos],3,4,f,f+1,GTK_EXPAND,GTK_FILL,2,2); gtk_label_set_mnemonic_widget(GTK_LABEL(label),entry[pos++]); -- libgit2 0.21.2