Commit e6624bf6f3f3fc8f793df0d298c6e0a2d9540488
1 parent
a9a89020
Exists in
master
and in
5 other branches
Implementando função de conversão do buffer de terminal para HTML
Showing
7 changed files
with
24 additions
and
13 deletions
Show diff stats
src/lib3270/Makefile.in
@@ -174,7 +174,7 @@ fallbacks.c: $(BINDIR)/mkfb@EXEEXT@ X3270.xad | @@ -174,7 +174,7 @@ fallbacks.c: $(BINDIR)/mkfb@EXEEXT@ X3270.xad | ||
174 | $(BINDIR)/mkfb@EXEEXT@: mkfb.c Makefile | 174 | $(BINDIR)/mkfb@EXEEXT@: mkfb.c Makefile |
175 | @echo " CCLD `basename $@`" | 175 | @echo " CCLD `basename $@`" |
176 | @$(MKDIR) `dirname $@` | 176 | @$(MKDIR) `dirname $@` |
177 | - @$(HOST_CC) -g -o $@ -D_WIN32 mkfb.c | 177 | + @$(HOST_CC) -g -o $@ mkfb.c |
178 | 178 | ||
179 | clean: | 179 | clean: |
180 | @rm -fr .obj | 180 | @rm -fr .obj |
src/lib3270/api.h
@@ -295,7 +295,7 @@ | @@ -295,7 +295,7 @@ | ||
295 | #define COLOR_ATTR_INTENSIFY LIB3270_ATTR_INTENSIFY | 295 | #define COLOR_ATTR_INTENSIFY LIB3270_ATTR_INTENSIFY |
296 | 296 | ||
297 | // #define CHAR_ATTR_CG LIB3270_ATTR_CG | 297 | // #define CHAR_ATTR_CG LIB3270_ATTR_CG |
298 | - #define CHAR_ATTR_MARKER LIB3270_ATTR_MARKER | 298 | +// #define CHAR_ATTR_MARKER LIB3270_ATTR_MARKER |
299 | 299 | ||
300 | #define CHAR_ATTR_UNCONVERTED LIB3270_ATTR_CG | 300 | #define CHAR_ATTR_UNCONVERTED LIB3270_ATTR_CG |
301 | 301 |
src/lib3270/html.c
@@ -89,7 +89,10 @@ | @@ -89,7 +89,10 @@ | ||
89 | struct html_info | 89 | struct html_info |
90 | { | 90 | { |
91 | int szText; | 91 | int szText; |
92 | + | ||
93 | + unsigned char fa; /**< field attribute, it nonzero */ | ||
92 | char * text; | 94 | char * text; |
95 | + int maxlength; | ||
93 | unsigned short fg; | 96 | unsigned short fg; |
94 | unsigned short bg; | 97 | unsigned short bg; |
95 | }; | 98 | }; |
@@ -195,7 +198,6 @@ | @@ -195,7 +198,6 @@ | ||
195 | if((option && LIB3270_HTML_OPTION_ALL) || (session->text[baddr+col].attr & LIB3270_ATTR_SELECTED)) | 198 | if((option && LIB3270_HTML_OPTION_ALL) || (session->text[baddr+col].attr & LIB3270_ATTR_SELECTED)) |
196 | { | 199 | { |
197 | cr++; | 200 | cr++; |
198 | - update_colors(&info,session->text[baddr+col].attr); | ||
199 | 201 | ||
200 | if(session->text[baddr+col].attr & LIB3270_ATTR_CG) | 202 | if(session->text[baddr+col].attr & LIB3270_ATTR_CG) |
201 | { | 203 | { |
@@ -221,6 +223,7 @@ | @@ -221,6 +223,7 @@ | ||
221 | { 0x00, NULL } | 223 | { 0x00, NULL } |
222 | }; | 224 | }; |
223 | 225 | ||
226 | + update_colors(&info,session->text[baddr+col].attr); | ||
224 | append_char(&info, xlat, session->text[baddr+col].chr); | 227 | append_char(&info, xlat, session->text[baddr+col].chr); |
225 | 228 | ||
226 | } | 229 | } |
@@ -237,10 +240,17 @@ | @@ -237,10 +240,17 @@ | ||
237 | { 0x00, NULL } | 240 | { 0x00, NULL } |
238 | }; | 241 | }; |
239 | 242 | ||
240 | - append_char(&info, xlat, session->text[baddr+col].chr); | ||
241 | - | 243 | + if((session->text[baddr+col].attr & LIB3270_ATTR_MARKER)) |
244 | + { | ||
245 | + update_colors(&info,session->text[baddr+col].attr); | ||
246 | + append_string(&info,"|"); | ||
247 | + } | ||
248 | + else | ||
249 | + { | ||
250 | + update_colors(&info,session->text[baddr+col].attr); | ||
251 | + append_char(&info, xlat, session->text[baddr+col].chr); | ||
252 | + } | ||
242 | } | 253 | } |
243 | - | ||
244 | } | 254 | } |
245 | } | 255 | } |
246 | 256 |
src/lib3270/mkfb.c
@@ -41,11 +41,12 @@ | @@ -41,11 +41,12 @@ | ||
41 | 41 | ||
42 | #ifdef _WIN32 | 42 | #ifdef _WIN32 |
43 | #include <windows.h> | 43 | #include <windows.h> |
44 | - #include <sys/stat.h> | ||
45 | - #include <fcntl.h> | ||
46 | #define tmpfile w32_tmpfile | 44 | #define tmpfile w32_tmpfile |
47 | #endif // _WIN32 | 45 | #endif // _WIN32 |
48 | 46 | ||
47 | +#include <sys/stat.h> | ||
48 | +#include <fcntl.h> | ||
49 | + | ||
49 | #include <stdio.h> | 50 | #include <stdio.h> |
50 | #include <string.h> | 51 | #include <string.h> |
51 | #include <ctype.h> | 52 | #include <ctype.h> |
src/lib3270/proxy.c
@@ -520,6 +520,7 @@ proxy_telnet(int fd, char *host, unsigned short port) | @@ -520,6 +520,7 @@ proxy_telnet(int fd, char *host, unsigned short port) | ||
520 | static int proxy_socks4(int fd, char *host, unsigned short port, int force_a) | 520 | static int proxy_socks4(int fd, char *host, unsigned short port, int force_a) |
521 | { | 521 | { |
522 | popup_an_error(NULL,"%s", _( "Unsupported socks 4 proxy" ) ); | 522 | popup_an_error(NULL,"%s", _( "Unsupported socks 4 proxy" ) ); |
523 | + return 0; | ||
523 | } | 524 | } |
524 | #else | 525 | #else |
525 | static int proxy_socks4(int fd, char *host, unsigned short port, int force_a) | 526 | static int proxy_socks4(int fd, char *host, unsigned short port, int force_a) |
src/lib3270/screen.c
@@ -220,10 +220,10 @@ static unsigned short calc_attrs(H3270 *session, int baddr, int fa_addr, int fa) | @@ -220,10 +220,10 @@ static unsigned short calc_attrs(H3270 *session, int baddr, int fa_addr, int fa) | ||
220 | a |= LIB3270_ATTR_UNDERLINE; | 220 | a |= LIB3270_ATTR_UNDERLINE; |
221 | } | 221 | } |
222 | 222 | ||
223 | - if(h3270.m3279 && (gr & (GR_BLINK | GR_UNDERLINE)) && !(gr & GR_REVERSE) && !bg) | 223 | + if(session->m3279 && (gr & (GR_BLINK | GR_UNDERLINE)) && !(gr & GR_REVERSE) && !bg) |
224 | a |= LIB3270_ATTR_BACKGROUND_INTENSITY; | 224 | a |= LIB3270_ATTR_BACKGROUND_INTENSITY; |
225 | 225 | ||
226 | - if(!h3270.m3279 && ((gr & GR_INTENSIFY) || FA_IS_HIGH(fa))) | 226 | + if(!session->m3279 && ((gr & GR_INTENSIFY) || FA_IS_HIGH(fa))) |
227 | a |= LIB3270_ATTR_INTENSIFY; | 227 | a |= LIB3270_ATTR_INTENSIFY; |
228 | 228 | ||
229 | if (gr & GR_REVERSE) | 229 | if (gr & GR_REVERSE) |
@@ -313,7 +313,7 @@ void screen_update(H3270 *session, int bstart, int bend) | @@ -313,7 +313,7 @@ void screen_update(H3270 *session, int bstart, int bend) | ||
313 | fa_addr = baddr; | 313 | fa_addr = baddr; |
314 | fa = session->ea_buf[baddr].fa; | 314 | fa = session->ea_buf[baddr].fa; |
315 | a = calc_attrs(session, baddr, baddr, fa); | 315 | a = calc_attrs(session, baddr, baddr, fa); |
316 | - addch(session,baddr,' ',(attr = COLOR_GREEN)|CHAR_ATTR_MARKER,&first,&last); | 316 | + addch(session,baddr,' ',(attr = COLOR_GREEN)|LIB3270_ATTR_MARKER,&first,&last); |
317 | } | 317 | } |
318 | else if (FA_IS_ZERO(fa)) | 318 | else if (FA_IS_ZERO(fa)) |
319 | { | 319 | { |
src/pw3270/window.c
@@ -150,10 +150,9 @@ | @@ -150,10 +150,9 @@ | ||
150 | static void pw3270_class_init(pw3270Class *klass) | 150 | static void pw3270_class_init(pw3270Class *klass) |
151 | { | 151 | { |
152 | // GObjectClass * gobject_class = G_OBJECT_CLASS(klass); | 152 | // GObjectClass * gobject_class = G_OBJECT_CLASS(klass); |
153 | -// GtkWidgetClass * widget_class = GTK_WIDGET_CLASS(klass); | ||
154 | - | ||
155 | 153 | ||
156 | #if GTK_CHECK_VERSION(3,0,0) | 154 | #if GTK_CHECK_VERSION(3,0,0) |
155 | + GtkWidgetClass * widget_class = GTK_WIDGET_CLASS(klass); | ||
157 | widget_class->destroy = pw3270_destroy; | 156 | widget_class->destroy = pw3270_destroy; |
158 | #else | 157 | #else |
159 | { | 158 | { |