Commit 99d54a6cba1582d0f702c4175cda29f139f1ffac
1 parent
22716b63
Exists in
master
and in
3 other branches
Adjustments on screen size changes.
Showing
5 changed files
with
39 additions
and
3 deletions
Show diff stats
src/core/ctlr.c
| @@ -24,8 +24,6 @@ | @@ -24,8 +24,6 @@ | ||
| 24 | * | 24 | * |
| 25 | * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) | 25 | * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) |
| 26 | * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) | 26 | * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) |
| 27 | - * licinio@bb.com.br (Licínio Luis Branco) | ||
| 28 | - * kraucer@bb.com.br (Kraucer Fernandes Mazuco) | ||
| 29 | * | 27 | * |
| 30 | */ | 28 | */ |
| 31 | 29 | ||
| @@ -565,12 +563,13 @@ void ctlr_erase(H3270 *session, int alt) | @@ -565,12 +563,13 @@ void ctlr_erase(H3270 *session, int alt) | ||
| 565 | if (alt) | 563 | if (alt) |
| 566 | { | 564 | { |
| 567 | // Going from 24x80 to maximum. | 565 | // Going from 24x80 to maximum. |
| 568 | - session->cbk.display(session); | 566 | + lib3270_write_screen_trace(session,"Going from 24x80 to %dx%d",session->max.rows,session->max.cols); |
| 569 | set_viewsize(session,session->max.rows,session->max.cols); | 567 | set_viewsize(session,session->max.rows,session->max.cols); |
| 570 | } | 568 | } |
| 571 | else | 569 | else |
| 572 | { | 570 | { |
| 573 | // Going from maximum to 24x80. | 571 | // Going from maximum to 24x80. |
| 572 | + lib3270_write_screen_trace(session,"Going from %dx%d to 24x80",session->max.rows,session->max.cols); | ||
| 574 | if (session->max.rows > 24 || session->max.cols > 80) | 573 | if (session->max.rows > 24 || session->max.cols > 80) |
| 575 | { | 574 | { |
| 576 | if(session->vcontrol) | 575 | if(session->vcontrol) |
| @@ -587,6 +586,7 @@ void ctlr_erase(H3270 *session, int alt) | @@ -587,6 +586,7 @@ void ctlr_erase(H3270 *session, int alt) | ||
| 587 | } | 586 | } |
| 588 | 587 | ||
| 589 | session->screen_alt = alt; | 588 | session->screen_alt = alt; |
| 589 | + session->cbk.display(session); | ||
| 590 | 590 | ||
| 591 | } | 591 | } |
| 592 | 592 |
src/core/screen.c
| @@ -266,6 +266,16 @@ LIB3270_EXPORT unsigned int lib3270_get_height(const H3270 *h) | @@ -266,6 +266,16 @@ LIB3270_EXPORT unsigned int lib3270_get_height(const H3270 *h) | ||
| 266 | return h->view.rows; | 266 | return h->view.rows; |
| 267 | } | 267 | } |
| 268 | 268 | ||
| 269 | +LIB3270_EXPORT unsigned int lib3270_get_max_width(const H3270 *h) | ||
| 270 | +{ | ||
| 271 | + return h->max.cols; | ||
| 272 | +} | ||
| 273 | + | ||
| 274 | +LIB3270_EXPORT unsigned int lib3270_get_max_height(const H3270 *h) | ||
| 275 | +{ | ||
| 276 | + return h->max.rows; | ||
| 277 | +} | ||
| 278 | + | ||
| 269 | void update_model_info(H3270 *session, unsigned int model, unsigned int cols, unsigned int rows) | 279 | void update_model_info(H3270 *session, unsigned int model, unsigned int cols, unsigned int rows) |
| 270 | { | 280 | { |
| 271 | if(model == session->model_num && session->max.rows == rows && session->max.cols == cols) | 281 | if(model == session->model_num && session->max.rows == rows && session->max.cols == cols) |
src/core/trace_ds.c
| @@ -236,6 +236,17 @@ LIB3270_EXPORT void lib3270_write_nettrace(H3270 *session, const char *fmt, ...) | @@ -236,6 +236,17 @@ LIB3270_EXPORT void lib3270_write_nettrace(H3270 *session, const char *fmt, ...) | ||
| 236 | va_end(args); | 236 | va_end(args); |
| 237 | } | 237 | } |
| 238 | 238 | ||
| 239 | +LIB3270_EXPORT void lib3270_write_screen_trace(H3270 *session, const char *fmt, ...) | ||
| 240 | +{ | ||
| 241 | + va_list args; | ||
| 242 | + | ||
| 243 | + if(!lib3270_get_toggle(session,LIB3270_TOGGLE_SCREEN_TRACE)) | ||
| 244 | + return; | ||
| 245 | + | ||
| 246 | + va_start(args, fmt); | ||
| 247 | + session->trace.handler(session,session->trace.userdata,fmt, args); | ||
| 248 | + va_end(args); | ||
| 249 | +} | ||
| 239 | 250 | ||
| 240 | LIB3270_EXPORT void lib3270_trace_event(H3270 *session, const char *fmt, ...) | 251 | LIB3270_EXPORT void lib3270_trace_event(H3270 *session, const char *fmt, ...) |
| 241 | { | 252 | { |
src/include/lib3270.h
| @@ -437,6 +437,8 @@ | @@ -437,6 +437,8 @@ | ||
| 437 | */ | 437 | */ |
| 438 | LIB3270_EXPORT unsigned int lib3270_get_width(const H3270 *h); | 438 | LIB3270_EXPORT unsigned int lib3270_get_width(const H3270 *h); |
| 439 | 439 | ||
| 440 | + LIB3270_EXPORT unsigned int lib3270_get_max_width(const H3270 *h); | ||
| 441 | + | ||
| 440 | /** | 442 | /** |
| 441 | * Get current screen width in rows. | 443 | * Get current screen width in rows. |
| 442 | * | 444 | * |
| @@ -447,6 +449,8 @@ | @@ -447,6 +449,8 @@ | ||
| 447 | */ | 449 | */ |
| 448 | LIB3270_EXPORT unsigned int lib3270_get_height(const H3270 *h); | 450 | LIB3270_EXPORT unsigned int lib3270_get_height(const H3270 *h); |
| 449 | 451 | ||
| 452 | + LIB3270_EXPORT unsigned int lib3270_get_max_height(const H3270 *h); | ||
| 453 | + | ||
| 450 | LIB3270_EXPORT unsigned int lib3270_get_length(const H3270 *h); | 454 | LIB3270_EXPORT unsigned int lib3270_get_length(const H3270 *h); |
| 451 | 455 | ||
| 452 | /** | 456 | /** |
src/include/lib3270/trace.h
| @@ -97,6 +97,17 @@ | @@ -97,6 +97,17 @@ | ||
| 97 | */ | 97 | */ |
| 98 | LIB3270_EXPORT void lib3270_write_nettrace(H3270 *session, const char *fmt, ...) LIB3270_AS_PRINTF(2,3); | 98 | LIB3270_EXPORT void lib3270_write_nettrace(H3270 *session, const char *fmt, ...) LIB3270_AS_PRINTF(2,3); |
| 99 | 99 | ||
| 100 | + /** | ||
| 101 | + * @brief Write on trace file. | ||
| 102 | + * | ||
| 103 | + * Write text on trace file, if screen trace is enabled. | ||
| 104 | + * | ||
| 105 | + * @param fmt String format. | ||
| 106 | + * @param ... Arguments. | ||
| 107 | + * | ||
| 108 | + */ | ||
| 109 | + LIB3270_EXPORT void lib3270_write_screen_trace(H3270 *session, const char *fmt, ...) LIB3270_AS_PRINTF(2,3); | ||
| 110 | + | ||
| 100 | /** | 111 | /** |
| 101 | * @brief Write on trace file. | 112 | * @brief Write on trace file. |
| 102 | * | 113 | * |