Commit 2f31b6cee0fc316300faa9a82d95fd668f0de7c2
1 parent
d63525e8
Exists in
master
and in
5 other branches
Incluindo opcao para preservar o numero de linhas da tela definido pelo usuario …
…quando o host muda para 80x25
Showing
5 changed files
with
26 additions
and
16 deletions
Show diff stats
src/include/lib3270.h
@@ -110,6 +110,7 @@ | @@ -110,6 +110,7 @@ | ||
110 | LIB3270_TOGGLE_KP_ALTERNATIVE, /**< Keypad +/- move to next/previous field */ | 110 | LIB3270_TOGGLE_KP_ALTERNATIVE, /**< Keypad +/- move to next/previous field */ |
111 | LIB3270_TOGGLE_BEEP, /**< Beep on errors */ | 111 | LIB3270_TOGGLE_BEEP, /**< Beep on errors */ |
112 | LIB3270_TOGGLE_VIEW_FIELD, /**< View Field attribute */ | 112 | LIB3270_TOGGLE_VIEW_FIELD, /**< View Field attribute */ |
113 | + LIB3270_TOGGLE_ALTSCREEN, /**< auto resize on altscreen */ | ||
113 | 114 | ||
114 | // LIB3270_TOGGLE_ALT_CURSOR, | 115 | // LIB3270_TOGGLE_ALT_CURSOR, |
115 | // LIB3270_TOGGLE_AID_WAIT, | 116 | // LIB3270_TOGGLE_AID_WAIT, |
src/lib3270/ctlr.c
@@ -129,9 +129,6 @@ void ctlr_init(H3270 *session, unsigned cmask unused) | @@ -129,9 +129,6 @@ void ctlr_init(H3270 *session, unsigned cmask unused) | ||
129 | */ | 129 | */ |
130 | void ctlr_reinit(H3270 *session, unsigned cmask) | 130 | void ctlr_reinit(H3270 *session, unsigned cmask) |
131 | { | 131 | { |
132 | -// static struct ea *real_ea_buf = NULL; | ||
133 | -// static struct ea *real_aea_buf = NULL; | ||
134 | - | ||
135 | if (cmask & MODEL_CHANGE) | 132 | if (cmask & MODEL_CHANGE) |
136 | { | 133 | { |
137 | /* Allocate buffers */ | 134 | /* Allocate buffers */ |
@@ -177,7 +174,7 @@ int lib3270_set_model(H3270 *hSession, int model) | @@ -177,7 +174,7 @@ int lib3270_set_model(H3270 *hSession, int model) | ||
177 | 174 | ||
178 | ctlr_set_rows_cols(hSession,model,hSession->ov_cols,hSession->ov_rows); | 175 | ctlr_set_rows_cols(hSession,model,hSession->ov_cols,hSession->ov_rows); |
179 | ctlr_reinit(hSession,MODEL_CHANGE); | 176 | ctlr_reinit(hSession,MODEL_CHANGE); |
180 | - | 177 | + screen_update(hSession,0,hSession->rows*hSession->cols); |
181 | return 0; | 178 | return 0; |
182 | } | 179 | } |
183 | 180 | ||
@@ -402,9 +399,9 @@ LIB3270_EXPORT int lib3270_get_next_unprotected(H3270 *hSession, int baddr0) | @@ -402,9 +399,9 @@ LIB3270_EXPORT int lib3270_get_next_unprotected(H3270 *hSession, int baddr0) | ||
402 | return 0; | 399 | return 0; |
403 | } | 400 | } |
404 | 401 | ||
405 | -/* | ||
406 | - * Perform an erase command, which may include changing the (virtual) screen | ||
407 | - * size. | 402 | +/** |
403 | + * Perform an erase command, which may include changing the (virtual) screen size. | ||
404 | + * | ||
408 | */ | 405 | */ |
409 | void ctlr_erase(H3270 *session, int alt) | 406 | void ctlr_erase(H3270 *session, int alt) |
410 | { | 407 | { |
@@ -421,6 +418,7 @@ void ctlr_erase(H3270 *session, int alt) | @@ -421,6 +418,7 @@ void ctlr_erase(H3270 *session, int alt) | ||
421 | { | 418 | { |
422 | /* Going from 24x80 to maximum. */ | 419 | /* Going from 24x80 to maximum. */ |
423 | session->display(session); | 420 | session->display(session); |
421 | + | ||
424 | set_viewsize(session,session->maxROWS,session->maxCOLS); | 422 | set_viewsize(session,session->maxROWS,session->maxCOLS); |
425 | } | 423 | } |
426 | else | 424 | else |
@@ -433,7 +431,11 @@ void ctlr_erase(H3270 *session, int alt) | @@ -433,7 +431,11 @@ void ctlr_erase(H3270 *session, int alt) | ||
433 | ctlr_blanks(session); | 431 | ctlr_blanks(session); |
434 | session->display(session); | 432 | session->display(session); |
435 | } | 433 | } |
436 | - set_viewsize(session,24,80); | 434 | + |
435 | + if(lib3270_get_toggle(session,LIB3270_TOGGLE_ALTSCREEN)) | ||
436 | + set_viewsize(session,24,80); | ||
437 | + else | ||
438 | + set_viewsize(session,session->maxROWS,80); | ||
437 | } | 439 | } |
438 | } | 440 | } |
439 | 441 | ||
@@ -441,7 +443,6 @@ void ctlr_erase(H3270 *session, int alt) | @@ -441,7 +443,6 @@ void ctlr_erase(H3270 *session, int alt) | ||
441 | 443 | ||
442 | } | 444 | } |
443 | 445 | ||
444 | - | ||
445 | /* | 446 | /* |
446 | * Interpret an incoming 3270 command. | 447 | * Interpret an incoming 3270 command. |
447 | */ | 448 | */ |
@@ -466,7 +467,7 @@ enum pds process_ds(H3270 *hSession, unsigned char *buf, int buflen) | @@ -466,7 +467,7 @@ enum pds process_ds(H3270 *hSession, unsigned char *buf, int buflen) | ||
466 | case CMD_EWA: /* erase/write alternate */ | 467 | case CMD_EWA: /* erase/write alternate */ |
467 | case SNA_CMD_EWA: | 468 | case SNA_CMD_EWA: |
468 | trace_ds(hSession,"EraseWriteAlternate"); | 469 | trace_ds(hSession,"EraseWriteAlternate"); |
469 | - ctlr_erase(hSession,True); | 470 | + ctlr_erase(hSession,1); |
470 | if ((rv = ctlr_write(hSession,buf, buflen, True)) < 0) | 471 | if ((rv = ctlr_write(hSession,buf, buflen, True)) < 0) |
471 | return rv; | 472 | return rv; |
472 | return PDS_OKAY_NO_OUTPUT; | 473 | return PDS_OKAY_NO_OUTPUT; |
@@ -475,7 +476,7 @@ enum pds process_ds(H3270 *hSession, unsigned char *buf, int buflen) | @@ -475,7 +476,7 @@ enum pds process_ds(H3270 *hSession, unsigned char *buf, int buflen) | ||
475 | case CMD_EW: /* erase/write */ | 476 | case CMD_EW: /* erase/write */ |
476 | case SNA_CMD_EW: | 477 | case SNA_CMD_EW: |
477 | trace_ds(hSession,"EraseWrite"); | 478 | trace_ds(hSession,"EraseWrite"); |
478 | - ctlr_erase(hSession,False); | 479 | + ctlr_erase(hSession,0); |
479 | if ((rv = ctlr_write(hSession,buf, buflen, True)) < 0) | 480 | if ((rv = ctlr_write(hSession,buf, buflen, True)) < 0) |
480 | return rv; | 481 | return rv; |
481 | return PDS_OKAY_NO_OUTPUT; | 482 | return PDS_OKAY_NO_OUTPUT; |
src/lib3270/sf.c
@@ -403,12 +403,12 @@ static enum pds sf_erase_reset(H3270 *hSession, unsigned char buf[], int buflen) | @@ -403,12 +403,12 @@ static enum pds sf_erase_reset(H3270 *hSession, unsigned char buf[], int buflen) | ||
403 | { | 403 | { |
404 | case SF_ER_DEFAULT: | 404 | case SF_ER_DEFAULT: |
405 | trace_ds(hSession," Default\n"); | 405 | trace_ds(hSession," Default\n"); |
406 | - ctlr_erase(hSession,False); | 406 | + ctlr_erase(hSession,0); |
407 | break; | 407 | break; |
408 | 408 | ||
409 | case SF_ER_ALT: | 409 | case SF_ER_ALT: |
410 | trace_ds(hSession," Alternate\n"); | 410 | trace_ds(hSession," Alternate\n"); |
411 | - ctlr_erase(hSession,True); | 411 | + ctlr_erase(hSession,1); |
412 | break; | 412 | break; |
413 | 413 | ||
414 | default: | 414 | default: |
src/lib3270/toggles.c
@@ -78,6 +78,8 @@ static const char *toggle_names[LIB3270_TOGGLE_COUNT] = | @@ -78,6 +78,8 @@ static const char *toggle_names[LIB3270_TOGGLE_COUNT] = | ||
78 | "kpalternative", /**< Keypad +/- move to next/previous field */ | 78 | "kpalternative", /**< Keypad +/- move to next/previous field */ |
79 | "beep", /**< Beep on errors */ | 79 | "beep", /**< Beep on errors */ |
80 | "fieldattr", /**< View Field attribute */ | 80 | "fieldattr", /**< View Field attribute */ |
81 | + "altscreen", /**< auto resize on altscreen */ | ||
82 | + | ||
81 | 83 | ||
82 | }; | 84 | }; |
83 | 85 | ||
@@ -141,6 +143,12 @@ LIB3270_EXPORT int lib3270_toggle(H3270 *session, LIB3270_TOGGLE ix) | @@ -141,6 +143,12 @@ LIB3270_EXPORT int lib3270_toggle(H3270 *session, LIB3270_TOGGLE ix) | ||
141 | return (int) t->value; | 143 | return (int) t->value; |
142 | } | 144 | } |
143 | 145 | ||
146 | +static void toggle_altscreen(H3270 *session, struct lib3270_toggle *t, LIB3270_TOGGLE_TYPE tt) | ||
147 | +{ | ||
148 | + if(!session->screen_alt) | ||
149 | + set_viewsize(session,t->value ? 24 : session->maxROWS,80); | ||
150 | +} | ||
151 | + | ||
144 | static void toggle_monocase(H3270 *session, struct lib3270_toggle *t, LIB3270_TOGGLE_TYPE tt) | 152 | static void toggle_monocase(H3270 *session, struct lib3270_toggle *t, LIB3270_TOGGLE_TYPE tt) |
145 | { | 153 | { |
146 | session->display(session); | 154 | session->display(session); |
@@ -165,6 +173,7 @@ void initialize_toggles(H3270 *session) | @@ -165,6 +173,7 @@ void initialize_toggles(H3270 *session) | ||
165 | 173 | ||
166 | session->toggle[LIB3270_TOGGLE_RECTANGLE_SELECT].upcall = toggle_rectselect; | 174 | session->toggle[LIB3270_TOGGLE_RECTANGLE_SELECT].upcall = toggle_rectselect; |
167 | session->toggle[LIB3270_TOGGLE_MONOCASE].upcall = toggle_monocase; | 175 | session->toggle[LIB3270_TOGGLE_MONOCASE].upcall = toggle_monocase; |
176 | + session->toggle[LIB3270_TOGGLE_ALTSCREEN].upcall = toggle_altscreen; | ||
168 | 177 | ||
169 | /* | 178 | /* |
170 | #if defined(X3270_TRACE) | 179 | #if defined(X3270_TRACE) |
@@ -183,13 +192,11 @@ void initialize_toggles(H3270 *session) | @@ -183,13 +192,11 @@ void initialize_toggles(H3270 *session) | ||
183 | LIB3270_TOGGLE_CURSOR_BLINK, | 192 | LIB3270_TOGGLE_CURSOR_BLINK, |
184 | LIB3270_TOGGLE_CURSOR_POS, | 193 | LIB3270_TOGGLE_CURSOR_POS, |
185 | LIB3270_TOGGLE_BEEP, | 194 | LIB3270_TOGGLE_BEEP, |
195 | + LIB3270_TOGGLE_ALTSCREEN, | ||
186 | }; | 196 | }; |
187 | 197 | ||
188 | for(f=0;f< (sizeof(active_by_default)/sizeof(active_by_default[0])); f++) | 198 | for(f=0;f< (sizeof(active_by_default)/sizeof(active_by_default[0])); f++) |
189 | - { | ||
190 | session->toggle[active_by_default[f]].value = True; | 199 | session->toggle[active_by_default[f]].value = True; |
191 | - } | ||
192 | - | ||
193 | 200 | ||
194 | for(f=0;f<LIB3270_TOGGLE_COUNT;f++) | 201 | for(f=0;f<LIB3270_TOGGLE_COUNT;f++) |
195 | { | 202 | { |
ui/00default.xml
@@ -120,6 +120,7 @@ | @@ -120,6 +120,7 @@ | ||
120 | <menuitem action='toggle' id='Monocase' label='Monocase' /> | 120 | <menuitem action='toggle' id='Monocase' label='Monocase' /> |
121 | <menuitem action='toggle' id='CursorPos' label='Track Cursor' /> | 121 | <menuitem action='toggle' id='CursorPos' label='Track Cursor' /> |
122 | <menuitem action='toggle' id='FullScreen' key='<alt>Home' label='Full Screen' /> | 122 | <menuitem action='toggle' id='FullScreen' key='<alt>Home' label='Full Screen' /> |
123 | + <menuitem action='toggle' id='AltScreen' label='Resize on alternate screen' /> | ||
123 | <menuitem action='toggle' id='MarginedPaste' label='Paste with left margin' /> | 124 | <menuitem action='toggle' id='MarginedPaste' label='Paste with left margin' /> |
124 | <menuitem action='toggle' id='CrossHair' key='<alt>x' label='Cross Hair Cursor' /> | 125 | <menuitem action='toggle' id='CrossHair' key='<alt>x' label='Cross Hair Cursor' /> |
125 | <menuitem action='toggle' id='BlankFill' label='Blank Fill' /> | 126 | <menuitem action='toggle' id='BlankFill' label='Blank Fill' /> |