Commit 5897edf115cf9da2a41c36eeb8dc0d97bd68a0f7

Authored by perry.werneck@gmail.com
1 parent 6f69d340

Limpando um pouco mais os fontes

actions.c
... ... @@ -52,9 +52,9 @@
52 52 #if defined(X3270_FT) /*[*/
53 53 #include "ftc.h"
54 54 #endif /*]*/
55   -#if defined(X3270_DISPLAY) /*[*/
56   -#include "keypadc.h"
57   -#endif /*]*/
  55 +// #if defined(X3270_DISPLAY)
  56 +// #include "keypadc.h"
  57 +//#endif
58 58 #if defined(X3270_DISPLAY) || defined(C3270) || defined(WC3270) /*[*/
59 59 #include "screenc.h"
60 60 #endif /*]*/
... ...
ansi.c
... ... @@ -44,7 +44,7 @@
44 44 #endif /*]*/
45 45  
46 46 #include "appres.h"
47   -#include "ctlr.h"
  47 +// #include "ctlr.h"
48 48 #if defined(X3270_DBCS) /*[*/
49 49 #include "3270ds.h"
50 50 #endif /*]*/
... ... @@ -714,8 +714,7 @@ ansi_erase_in_display(int nn, int ig2 unused)
714 714 ctlr_aclear(0, h3270.cursor_addr + 1, 1);
715 715 break;
716 716 case 2: /* all (without moving cursor) */
717   - if (h3270.cursor_addr == 0 && !h3270.is_altbuffer)
718   - scroll_save(h3270.rows, True);
  717 +// if (h3270.cursor_addr == 0 && !h3270.is_altbuffer) scroll_save(h3270.rows, True);
719 718 ctlr_aclear(0, h3270.rows * h3270.cols, 1);
720 719 break;
721 720 }
... ... @@ -1663,9 +1662,10 @@ ansi_scroll(void)
1663 1662 held_wrap = False;
1664 1663  
1665 1664 /* Save the top line */
1666   - if (scroll_top == 1 && scroll_bottom == h3270.rows) {
1667   - if (!h3270.is_altbuffer)
1668   - scroll_save(1, False);
  1665 + if (scroll_top == 1 && scroll_bottom == h3270.rows)
  1666 + {
  1667 +// if (!h3270.is_altbuffer)
  1668 +// scroll_save(1, False);
1669 1669 ctlr_scroll();
1670 1670 return;
1671 1671 }
... ... @@ -1720,7 +1720,7 @@ ansi_process(unsigned int c)
1720 1720 c &= 0xff;
1721 1721 ansi_ch = c;
1722 1722  
1723   - scroll_to_bottom();
  1723 +// scroll_to_bottom();
1724 1724  
1725 1725 #if defined(X3270_TRACE) /*[*/
1726 1726 if (toggled(SCREEN_TRACE))
... ...
childc.h
... ... @@ -17,10 +17,12 @@
17 17 * Global declarations for child.c.
18 18 */
19 19  
20   -#if defined(X3270_DISPLAY) || defined(C3270) /*[*/
  20 +/*
  21 +#if defined(X3270_DISPLAY) || defined(C3270)
21 22 LIB3270_INTERNAL int fork_child(void);
22 23 LIB3270_INTERNAL void child_ignore_output(void);
23   -#else /*][*/
  24 +#else
24 25 #define fork_child() fork()
25 26 #define child_ignore_output()
26   -#endif /*]*/
  27 +#endif
  28 +*/
... ...
ctlr.c
... ... @@ -42,7 +42,7 @@
42 42 #include <errno.h>
43 43 #include "3270ds.h"
44 44 #include "appres.h"
45   -#include "ctlr.h"
  45 +// #include "ctlr.h"
46 46 #include "screen.h"
47 47 #include "resources.h"
48 48  
... ... @@ -503,7 +503,7 @@ process_ds(unsigned char *buf, int buflen)
503 503 if (!buflen)
504 504 return PDS_OKAY_NO_OUTPUT;
505 505  
506   - scroll_to_bottom();
  506 +// scroll_to_bottom();
507 507  
508 508 trace_ds("< ");
509 509  
... ... @@ -2329,7 +2329,7 @@ ctlr_clear(H3270 *session, Boolean can_snap)
2329 2329 if (can_snap && !trace_skipping && toggled(SCREEN_TRACE))
2330 2330 trace_screen();
2331 2331 #endif /*]*/
2332   - scroll_save(session->maxROWS, ever_3270 ? False : True);
  2332 +// scroll_save(session->maxROWS, ever_3270 ? False : True);
2333 2333 }
2334 2334 #if defined(X3270_TRACE) /*[*/
2335 2335 trace_skipping = False;
... ... @@ -2389,7 +2389,7 @@ ctlr_add(int baddr, unsigned char c, unsigned char cs)
2389 2389 if (toggled(SCREEN_TRACE))
2390 2390 trace_screen();
2391 2391 #endif /*]*/
2392   - scroll_save(session->maxROWS, False);
  2392 +// scroll_save(session->maxROWS, False);
2393 2393 trace_primed = False;
2394 2394 }
2395 2395 /*
... ...
ctlr.h
... ... @@ -17,5 +17,7 @@
17 17 * External declarations for ctlr.c data structures.
18 18 */
19 19  
  20 + #warning Deprecated ctlr.h, please remove it
  21 +
20 22 // extern int buffer_addr; /**< buffer address */
21 23 // extern struct ea *ea_buf; /**< 3270 device buffer */
... ...
dialogc.h
... ... @@ -16,3 +16,5 @@
16 16 * dialogc.h
17 17 * Empty definitions for dialog.c.
18 18 */
  19 +
  20 +#warning deprecated dialogc.h
... ...
ft.c
... ... @@ -43,7 +43,7 @@
43 43 #include "ft_cutc.h"
44 44 #include "ft_dftc.h"
45 45 #include "ftc.h"
46   -#include "dialogc.h"
  46 +// #include "dialogc.h"
47 47 #include "hostc.h"
48 48 #if defined(C3270) || defined(WC3270)
49 49 #include "icmdc.h"
... ...
ft_cut.c
... ... @@ -44,7 +44,7 @@
44 44 // #include <lib3270/api.h>
45 45  
46 46 #include "appres.h"
47   -#include "ctlr.h"
  47 +// #include "ctlr.h"
48 48 #include "3270ds.h"
49 49  
50 50 #include "actionsc.h"
... ...
keypadc.h
... ... @@ -17,17 +17,14 @@
17 17 * Global declarations for keypad.c.
18 18 */
19 19  
20   -LIB3270_INTERNAL Boolean keypad_changed;
21   -
22   -#if defined(X3270_KEYPAD) /*[*/
  20 +// LIB3270_INTERNAL Boolean keypad_changed;
  21 +/*
  22 +#if defined(X3270_KEYPAD)
23 23  
24   -LIB3270_INTERNAL enum kp_placement {
25   - kp_right, kp_left, kp_bottom, kp_integral, kp_inside_right
26   -} kp_placement;
  24 +LIB3270_INTERNAL enum kp_placement { kp_right, kp_left, kp_bottom, kp_integral, kp_inside_right } kp_placement;
27 25  
28 26 LIB3270_INTERNAL void keypad_first_up(void);
29   -LIB3270_INTERNAL Widget keypad_init(Widget container, Dimension voffset,
30   - Dimension screen_width, Boolean floating, Boolean vert);
  27 +LIB3270_INTERNAL Widget keypad_init(Widget container, Dimension voffset, Dimension screen_width, Boolean floating, Boolean vert);
31 28 LIB3270_INTERNAL void keypad_move(void);
32 29 LIB3270_INTERNAL void keypad_placement_init(void);
33 30 LIB3270_INTERNAL void keypad_popup_init(void);
... ... @@ -37,7 +34,7 @@ LIB3270_INTERNAL void keypad_set_temp_keymap(XtTranslations trans);
37 34 LIB3270_INTERNAL void keypad_shift(void);
38 35 LIB3270_INTERNAL Dimension min_keypad_width(void);
39 36  
40   -#else /*][*/
  37 +#else
41 38  
42 39 #define keypad_qheight() 0
43 40 #define min_keypad_width() 0
... ... @@ -50,4 +47,5 @@ LIB3270_INTERNAL Dimension min_keypad_width(void);
50 47 #define keypad_set_temp_keymap(n)
51 48 #define keypad_shift()
52 49  
53   -#endif /*]*/
  50 +#endif
  51 +*/
... ...
kybd.c
... ... @@ -49,7 +49,7 @@
49 49 #include <fcntl.h>
50 50 #include "3270ds.h"
51 51 #include "appres.h"
52   -#include "ctlr.h"
  52 +// #include "ctlr.h"
53 53 #include "resources.h"
54 54  
55 55 #include "actionsc.h"
... ... @@ -58,7 +58,7 @@
58 58 #include "ctlrc.h"
59 59 #include "ftc.h"
60 60 #include "hostc.h"
61   -#include "keypadc.h"
  61 +// #include "keypadc.h"
62 62 #include "kybdc.h"
63 63 #include "popupsc.h"
64 64 #include "printc.h"
... ... @@ -232,7 +232,7 @@ static int enq_chk(void)
232 232 else
233 233 {
234 234 ta_head = ta;
235   - status_typeahead(True);
  235 + status_typeahead(&h3270,True);
236 236 }
237 237 ta_tail = ta;
238 238  
... ... @@ -263,7 +263,7 @@ static void enq_ta(XtActionProc fn, char *parm1, char *parm2)
263 263 ta_tail->next = ta;
264 264 else {
265 265 ta_head = ta;
266   - status_typeahead(True);
  266 + status_typeahead(&h3270,True);
267 267 }
268 268 ta_tail = ta;
269 269  
... ... @@ -282,7 +282,7 @@ Boolean run_ta(void)
282 282  
283 283 if ((ta_head = ta->next) == (struct ta *)NULL) {
284 284 ta_tail = (struct ta *)NULL;
285   - status_typeahead(False);
  285 + status_typeahead(&h3270,False);
286 286 }
287 287  
288 288 switch(ta->type)
... ... @@ -337,7 +337,7 @@ flush_ta(void)
337 337 any = True;
338 338 }
339 339 ta_head = ta_tail = (struct ta *) NULL;
340   - status_typeahead(False);
  340 + status_typeahead(&h3270,False);
341 341 return any;
342 342 }
343 343  
... ...
objects.h
... ... @@ -17,10 +17,10 @@
17 17 * x3270 object names.
18 18 */
19 19  
20   -#define ObjConfirmButton "confirmButton"
21   -#define ObjConfirm2Button "confirm2Button"
22   -#define ObjCancelButton "cancelButton"
  20 +// #define ObjConfirmButton "confirmButton"
  21 +// #define ObjConfirm2Button "confirm2Button"
  22 +// #define ObjCancelButton "cancelButton"
23 23 #define ObjDialog "dialog"
24   -#define ObjSmallLabel "smallLabel"
  24 +// #define ObjSmallLabel "smallLabel"
25 25 #define ObjNameLabel "nameLabel"
26 26 #define ObjDataLabel "dataLabel"
... ...
paste.c
... ... @@ -47,7 +47,7 @@
47 47 #include <fcntl.h>
48 48 #include "3270ds.h"
49 49 #include "appres.h"
50   -#include "ctlr.h"
  50 +// #include "ctlr.h"
51 51 #include "resources.h"
52 52  
53 53 #include "actionsc.h"
... ... @@ -56,7 +56,7 @@
56 56 #include "ctlrc.h"
57 57 #include "ftc.h"
58 58 #include "hostc.h"
59   -#include "keypadc.h"
  59 +// #include "keypadc.h"
60 60 #include "kybdc.h"
61 61 #include "popupsc.h"
62 62 #include "printc.h"
... ...
print.c
... ... @@ -39,7 +39,7 @@
39 39  
40 40 #include "appres.h"
41 41 #include "3270ds.h"
42   -#include "ctlr.h"
  42 +// #include "ctlr.h"
43 43  
44 44 #include "ctlrc.h"
45 45 #include "tablesc.h"
... ...
printer.c
... ... @@ -54,7 +54,7 @@
54 54 #include "appres.h"
55 55 #include "objects.h"
56 56 #include "resources.h"
57   -#include "ctlr.h"
  57 +// #include "ctlr.h"
58 58  
59 59 #include "charsetc.h"
60 60 #include "ctlrc.h"
... ...
savec.h
... ... @@ -14,6 +14,9 @@
14 14  
15 15 /* Non-display version of savec.h */
16 16  
  17 +/*
  18 +
17 19 #define save_yourself()
18 20  
19 21 LIB3270_INTERNAL char *command_string;
  22 +*/
... ...
screen.c
... ... @@ -40,7 +40,7 @@
40 40 #include "appres.h"
41 41 #include "3270ds.h"
42 42 #include "resources.h"
43   -#include "ctlr.h"
  43 +// #include "ctlr.h"
44 44  
45 45 #include "actionsc.h"
46 46 #include "ctlrc.h"
... ... @@ -708,7 +708,7 @@ LIB3270_EXPORT void lib3270_set_popup_handler(int (*handler)(H3270 *, LIB3270_NO
708 708 popup_handler = handler ? handler : logpopup;
709 709 }
710 710  
711   -LIB3270_EXPORT lib3270_popup_dialog(H3270 *session, LIB3270_NOTIFY id , const char *title, const char *message, const char *fmt, ...)
  711 +LIB3270_EXPORT void lib3270_popup_dialog(H3270 *session, LIB3270_NOTIFY id , const char *title, const char *message, const char *fmt, ...)
712 712 {
713 713 va_list args;
714 714  
... ...
screen.h
... ... @@ -14,9 +14,9 @@
14 14  
15 15 /* Non-display version of screen.h */
16 16  
17   -#define SELECTED(baddr) False
  17 +// #define SELECTED(baddr) False
18 18 LIB3270_INTERNAL int *char_width, *char_height;
19   -LIB3270_INTERNAL Boolean screen_has_changes;
  19 +// LIB3270_INTERNAL Boolean screen_has_changes;
20 20  
21 21 // LIB3270_INTERNAL void screen_update(H3270 *session, int bstart, int bend);
22 22  
... ...
scrollc.h
... ... @@ -14,5 +14,5 @@
14 14  
15 15 /* Non-display version of scrollc.h */
16 16  
17   -#define scroll_save(n, trim_blanks)
18   -#define scroll_to_bottom()
  17 +// #define scroll_save(n, trim_blanks)
  18 +// #define scroll_to_bottom()
... ...
selection.c
... ... @@ -28,7 +28,7 @@
28 28 */
29 29  
30 30 #include "globals.h"
31   - #include "ctlr.h"
  31 +// #include "ctlr.h"
32 32 #include "appres.h"
33 33 #include <lib3270.h>
34 34 #include <lib3270/session.h>
... ... @@ -347,3 +347,45 @@ LIB3270_EXPORT char * lib3270_get_selected(H3270 *hSession)
347 347 return realloc(ret,sz+1);
348 348 }
349 349  
  350 +LIB3270_EXPORT int lib3270_move_selection(H3270 *hSession, LIB3270_DIRECTION dir)
  351 +{
  352 + if(!hSession->selected || hSession->select.begin == hSession->select.end)
  353 + return ENOENT;
  354 +
  355 + switch(dir)
  356 + {
  357 + case LIB3270_DIR_UP:
  358 + if(hSession->select.begin <= hSession->cols)
  359 + return EINVAL;
  360 + hSession->select.begin -= hSession->cols;
  361 + hSession->select.end -= hSession->cols;
  362 + break;
  363 +
  364 + case LIB3270_DIR_DOWN:
  365 + if(hSession->select.end >= (hSession->cols * (hSession->rows-1)))
  366 + return EINVAL;
  367 + hSession->select.begin += hSession->cols;
  368 + hSession->select.end += hSession->cols;
  369 + break;
  370 +
  371 + case LIB3270_DIR_LEFT:
  372 + if( (hSession->select.begin % hSession->cols) < 1)
  373 + return EINVAL;
  374 + hSession->select.begin--;
  375 + hSession->select.end--;
  376 + break;
  377 +
  378 + case LIB3270_DIR_RIGHT:
  379 + if( (hSession->select.end % hSession->cols) >= hSession->cols)
  380 + return EINVAL;
  381 + hSession->select.begin++;
  382 + hSession->select.end++;
  383 + break;
  384 +
  385 + default:
  386 + return -1;
  387 + }
  388 +
  389 + update_selection(hSession);
  390 + return 0;
  391 +}
... ...
sf.c
... ... @@ -45,7 +45,7 @@
45 45 #include "3270ds.h"
46 46 #include "appres.h"
47 47 #include "screen.h"
48   -#include "ctlr.h"
  48 +// #include "ctlr.h"
49 49 #include "resources.h"
50 50  
51 51 #include "charsetc.h"
... ...
statusc.h
... ... @@ -34,7 +34,7 @@ LIB3270_INTERNAL void status_changed(H3270 *session, LIB3270_STATUS id);
34 34 LIB3270_INTERNAL void set_status(H3270 *session, OIA_FLAG id, Boolean on);
35 35  
36 36  
37   -#define status_typeahead(on) set_status(NULL,OIA_FLAG_TYPEAHEAD,on)
  37 +#define status_typeahead(h,on) set_status(h,OIA_FLAG_TYPEAHEAD,on)
38 38 #define status_kybdlock() status_changed(NULL,LIB3270_STATUS_KYBDLOCK)
39 39 #define status_syswait() status_changed(NULL,LIB3270_STATUS_SYSWAIT)
40 40 #define status_minus() status_changed(NULL,LIB3270_STATUS_MINUS)
... ...
trace_ds.c
... ... @@ -56,7 +56,7 @@
56 56 #include "appres.h"
57 57 #include "objects.h"
58 58 #include "resources.h"
59   -#include "ctlr.h"
  59 +// #include "ctlr.h"
60 60  
61 61 #include "charsetc.h"
62 62 #include "childc.h"
... ... @@ -422,7 +422,7 @@ create_tracefile_header(const char *mode)
422 422 clk = time((time_t *)0);
423 423 wtrace("Trace %s %s", mode, ctime(&clk));
424 424 wtrace(" Version: %s\n", build);
425   - save_yourself();
  425 +// save_yourself();
426 426 // wtrace(" Command: %s\n", command_string);
427 427 wtrace(" Model %s", h3270.model_name);
428 428 wtrace(", %s display", appres.mono ? "monochrome" : "color");
... ...