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 | 174 | $(BINDIR)/mkfb@EXEEXT@: mkfb.c Makefile |
175 | 175 | @echo " CCLD `basename $@`" |
176 | 176 | @$(MKDIR) `dirname $@` |
177 | - @$(HOST_CC) -g -o $@ -D_WIN32 mkfb.c | |
177 | + @$(HOST_CC) -g -o $@ mkfb.c | |
178 | 178 | |
179 | 179 | clean: |
180 | 180 | @rm -fr .obj | ... | ... |
src/lib3270/api.h
... | ... | @@ -295,7 +295,7 @@ |
295 | 295 | #define COLOR_ATTR_INTENSIFY LIB3270_ATTR_INTENSIFY |
296 | 296 | |
297 | 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 | 300 | #define CHAR_ATTR_UNCONVERTED LIB3270_ATTR_CG |
301 | 301 | ... | ... |
src/lib3270/html.c
... | ... | @@ -89,7 +89,10 @@ |
89 | 89 | struct html_info |
90 | 90 | { |
91 | 91 | int szText; |
92 | + | |
93 | + unsigned char fa; /**< field attribute, it nonzero */ | |
92 | 94 | char * text; |
95 | + int maxlength; | |
93 | 96 | unsigned short fg; |
94 | 97 | unsigned short bg; |
95 | 98 | }; |
... | ... | @@ -195,7 +198,6 @@ |
195 | 198 | if((option && LIB3270_HTML_OPTION_ALL) || (session->text[baddr+col].attr & LIB3270_ATTR_SELECTED)) |
196 | 199 | { |
197 | 200 | cr++; |
198 | - update_colors(&info,session->text[baddr+col].attr); | |
199 | 201 | |
200 | 202 | if(session->text[baddr+col].attr & LIB3270_ATTR_CG) |
201 | 203 | { |
... | ... | @@ -221,6 +223,7 @@ |
221 | 223 | { 0x00, NULL } |
222 | 224 | }; |
223 | 225 | |
226 | + update_colors(&info,session->text[baddr+col].attr); | |
224 | 227 | append_char(&info, xlat, session->text[baddr+col].chr); |
225 | 228 | |
226 | 229 | } |
... | ... | @@ -237,10 +240,17 @@ |
237 | 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 | 41 | |
42 | 42 | #ifdef _WIN32 |
43 | 43 | #include <windows.h> |
44 | - #include <sys/stat.h> | |
45 | - #include <fcntl.h> | |
46 | 44 | #define tmpfile w32_tmpfile |
47 | 45 | #endif // _WIN32 |
48 | 46 | |
47 | +#include <sys/stat.h> | |
48 | +#include <fcntl.h> | |
49 | + | |
49 | 50 | #include <stdio.h> |
50 | 51 | #include <string.h> |
51 | 52 | #include <ctype.h> | ... | ... |
src/lib3270/proxy.c
... | ... | @@ -520,6 +520,7 @@ proxy_telnet(int fd, char *host, unsigned short port) |
520 | 520 | static int proxy_socks4(int fd, char *host, unsigned short port, int force_a) |
521 | 521 | { |
522 | 522 | popup_an_error(NULL,"%s", _( "Unsupported socks 4 proxy" ) ); |
523 | + return 0; | |
523 | 524 | } |
524 | 525 | #else |
525 | 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 | 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 | 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 | 227 | a |= LIB3270_ATTR_INTENSIFY; |
228 | 228 | |
229 | 229 | if (gr & GR_REVERSE) |
... | ... | @@ -313,7 +313,7 @@ void screen_update(H3270 *session, int bstart, int bend) |
313 | 313 | fa_addr = baddr; |
314 | 314 | fa = session->ea_buf[baddr].fa; |
315 | 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 | 318 | else if (FA_IS_ZERO(fa)) |
319 | 319 | { | ... | ... |
src/pw3270/window.c
... | ... | @@ -150,10 +150,9 @@ |
150 | 150 | static void pw3270_class_init(pw3270Class *klass) |
151 | 151 | { |
152 | 152 | // GObjectClass * gobject_class = G_OBJECT_CLASS(klass); |
153 | -// GtkWidgetClass * widget_class = GTK_WIDGET_CLASS(klass); | |
154 | - | |
155 | 153 | |
156 | 154 | #if GTK_CHECK_VERSION(3,0,0) |
155 | + GtkWidgetClass * widget_class = GTK_WIDGET_CLASS(klass); | |
157 | 156 | widget_class->destroy = pw3270_destroy; |
158 | 157 | #else |
159 | 158 | { | ... | ... |