From aeb391fdd6aa3ad64aa28989a181475387a7d68a Mon Sep 17 00:00:00 2001 From: perry.werneck@gmail.com Date: Wed, 15 Feb 2012 20:06:29 +0000 Subject: [PATCH] Mais ajustes nos toggles para multi-sessao --- latest/src/include/lib3270.h | 2 +- latest/src/include/lib3270/api.h | 2 +- latest/src/lib/appres.h | 62 ++++++++++++-------------------------------------------------- latest/src/lib/globals.h | 2 -- latest/src/lib/glue.c | 4 ++-- latest/src/lib/toggles.c | 95 +++++++++++++++++++++++++++++++++++++++++------------------------------------------------------ latest/src/lib/togglesc.h | 2 ++ 7 files changed, 59 insertions(+), 110 deletions(-) diff --git a/latest/src/include/lib3270.h b/latest/src/include/lib3270.h index 8357d51..5756754 100644 --- a/latest/src/include/lib3270.h +++ b/latest/src/include/lib3270.h @@ -378,7 +378,7 @@ * @return 0 if the toggle is disabled, non zero if enabled. * */ - LIB3270_EXPORT unsigned char lib3270_get_toogle(H3270 *h, LIB3270_TOGGLE ix); + LIB3270_EXPORT unsigned char lib3270_get_toggle(H3270 *h, LIB3270_TOGGLE ix); /** * Check if the active connection is secure. diff --git a/latest/src/include/lib3270/api.h b/latest/src/include/lib3270/api.h index 7ba93c6..c94f693 100644 --- a/latest/src/include/lib3270/api.h +++ b/latest/src/include/lib3270/api.h @@ -586,7 +586,7 @@ LIB3270_EXPORT SCRIPT_STATE status_script(SCRIPT_STATE state); - #define Toggled(ix) lib3270_get_toogle(NULL,ix) + #define Toggled(ix) lib3270_get_toggle(NULL,ix) #define CallAndWait(c,h,p) lib3270_call_thread(c,h,p) LIB3270_EXPORT void RunPendingEvents(int wait); diff --git a/latest/src/lib/appres.h b/latest/src/lib/appres.h index 6f8996b..7b71fdd 100644 --- a/latest/src/lib/appres.h +++ b/latest/src/lib/appres.h @@ -20,47 +20,7 @@ * tcl3270. */ -#if defined(LIB3270) - #include -#else - #define MONOCASE 0 - #define ALT_CURSOR 1 - #define CURSOR_BLINK 2 - #define SHOW_TIMING 3 - #define CURSOR_POS 4 - - #if defined(X3270_TRACE) /*[*/ - #define DS_TRACE 5 - #endif /*]*/ - - #define SCROLL_BAR 6 - - #if defined(X3270_ANSI) /*[*/ - #define LINE_WRAP 7 - #endif /*]*/ - - #define BLANK_FILL 8 - - #if defined(X3270_TRACE) /*[*/ - #define SCREEN_TRACE 9 - #define EVENT_TRACE 10 - #endif /*]*/ - - #define MARGINED_PASTE 11 - #define RECTANGLE_SELECT 12 - - #if defined(X3270_DISPLAY) /*[*/ - #define CROSSHAIR 13 - #define VISIBLE_CONTROL 14 - #endif /*]*/ - - #if defined(X3270_SCRIPT) || defined(TCL3270) /*[*/ - #define AID_WAIT 15 - #endif /*]*/ - - #define N_TOGGLES 16 - -#endif +#include /* Toggles */ @@ -149,7 +109,8 @@ typedef struct { char *compose_map; char *printer_lu; #endif /*]*/ -#if defined(X3270_DISPLAY) /*[*/ +/* +#if defined(X3270_DISPLAY) char *efontname; char *fixed_size; char *debug_font; @@ -168,11 +129,12 @@ typedef struct { char *char_class; int modified_sel_color; int visual_select_color; -#if defined(X3270_DBCS) /*[*/ +#if defined(X3270_DBCS) char *input_method; char *preedit_type; -#endif /*]*/ -#endif /*]*/ +#endif +#endif +*/ #if defined(X3270_DBCS) /*[*/ char *local_encoding; #endif /*]*/ @@ -220,14 +182,14 @@ typedef struct { /* Toggles */ struct toggle toggle[N_TOGGLES]; - -#if defined(X3270_DISPLAY) /*[*/ - /* Simple widget resources */ +/* +#if defined(X3270_DISPLAY) + // Simple widget resources Cursor normal_mcursor; Cursor wait_mcursor; Cursor locked_mcursor; -#endif /*]*/ - +#endif +*/ #if defined(X3270_ANSI) /*[*/ /* Line-mode TTY parameters */ char icrnl; diff --git a/latest/src/lib/globals.h b/latest/src/lib/globals.h index 96c71c7..cea630d 100644 --- a/latest/src/lib/globals.h +++ b/latest/src/lib/globals.h @@ -349,6 +349,4 @@ enum state_change /* Library internal calls */ -LIB3270_INTERNAL void initialize_toggles(void); -LIB3270_INTERNAL void shutdown_toggles(void); diff --git a/latest/src/lib/glue.c b/latest/src/lib/glue.c index 7006374..90983c6 100644 --- a/latest/src/lib/glue.c +++ b/latest/src/lib/glue.c @@ -145,7 +145,7 @@ const char *toggle_names[N_TOGGLES] = void lib3270_session_free(H3270 *h) { - + shutdown_toggles(h,appres.toggle); } void lib3270_session_init(H3270 *hSession, const char *model) @@ -284,7 +284,7 @@ static void initialize(void) Trace("Initializing library (calls: %d)",init_calls); #endif - initialize_toggles(); + initialize_toggles(&h3270,appres.toggle); #if defined(_WIN32) (void) get_version_info(); diff --git a/latest/src/lib/toggles.c b/latest/src/lib/toggles.c index 044c644..ee2cb8f 100644 --- a/latest/src/lib/toggles.c +++ b/latest/src/lib/toggles.c @@ -84,7 +84,7 @@ LIB3270_EXPORT int lib3270_register_tchange(H3270 *h, LIB3270_TOGGLE_ID ix, void return 0; } -LIB3270_EXPORT unsigned char lib3270_get_toogle(H3270 *session, LIB3270_TOGGLE ix) +LIB3270_EXPORT unsigned char lib3270_get_toggle(H3270 *session, LIB3270_TOGGLE ix) { CHECK_SESSION_HANDLE(session); @@ -159,59 +159,43 @@ LIB3270_EXPORT int lib3270_toggle(H3270 *session, LIB3270_TOGGLE_ID ix) /* * Called from system initialization code to handle initial toggle settings. */ -void -initialize_toggles(void) +void initialize_toggles(H3270 *session, struct toggle *toggle) { int f; -#if defined(LIB3270) for(f=0;f