Commit 01021486ca506286999193ed995ca4a268ea182f

Authored by Perry Werneck
1 parent 046426df
Exists in master and in 1 other branch develop

Updating trace api.

.gitignore
... ... @@ -56,3 +56,4 @@ ValgrindOut.xml
56 56 *.patch
57 57 *.sh
58 58 *.conf
  59 +*.pdf
... ...
src/dialogs/print/convenience.c
... ... @@ -44,7 +44,7 @@
44 44 if(!(widget && GTK_IS_V3270(widget)))
45 45 return errno = EINVAL;
46 46  
47   - lib3270_trace_event(v3270_get_session(widget),"print action activated (type=%d)\n",(int) mode);
  47 + lib3270_write_event_trace(v3270_get_session(widget),"print action activated (type=%d)\n",(int) mode);
48 48  
49 49 if(!v3270_is_connected(widget))
50 50 return errno = ENOTCONN;
... ...
src/dialogs/print/print.c
... ... @@ -69,27 +69,27 @@
69 69 {
70 70 case GTK_PRINT_OPERATION_RESULT_ERROR:
71 71 debug("%s: Error on print operation",__FUNCTION__);
72   - lib3270_trace_event(operation->widget->host,"%s\n",_("Error on print operation"));
  72 + lib3270_write_event_trace(operation->widget->host,"%s\n",_("Error on print operation"));
73 73 break;
74 74  
75 75 case GTK_PRINT_OPERATION_RESULT_APPLY:
76 76 debug("%s: The print settings should be stored.",__FUNCTION__);
77   - lib3270_trace_event(operation->widget->host,"%s\n",_("The print settings should be stored."));
  77 + lib3270_write_event_trace(operation->widget->host,"%s\n",_("The print settings should be stored."));
78 78 break;
79 79  
80 80 case GTK_PRINT_OPERATION_RESULT_CANCEL:
81 81 debug("%s: The print operation has been canceled, the print settings should not be stored.", __FUNCTION__);
82   - lib3270_trace_event(operation->widget->host,"%s\n",_("The print operation has been canceled, the print settings should not be stored."));
  82 + lib3270_write_event_trace(operation->widget->host,"%s\n",_("The print operation has been canceled, the print settings should not be stored."));
83 83 break;
84 84  
85 85 case GTK_PRINT_OPERATION_RESULT_IN_PROGRESS:
86 86 debug("%s: The print operation is running",__FUNCTION__);
87   - lib3270_trace_event(operation->widget->host,"%s\n",_("The print operation is running"));
  87 + lib3270_write_event_trace(operation->widget->host,"%s\n",_("The print operation is running"));
88 88 break;
89 89  
90 90 default:
91 91 debug("Unexpected status %d in print operation",(int) result);
92   - lib3270_trace_event(operation->widget->host,_("Unexpected status %d in print operation"),(int) result);
  92 + lib3270_write_event_trace(operation->widget->host,_("Unexpected status %d in print operation"),(int) result);
93 93  
94 94 }
95 95  
... ...
src/terminal/drawing/draw.c
... ... @@ -40,6 +40,7 @@
40 40 #include <lib3270/session.h>
41 41 #include <lib3270/toggle.h>
42 42 #include <internals.h>
  43 + #include <lib3270/trace.h>
43 44  
44 45 #include <v3270.h>
45 46 #include <terminal.h>
... ... @@ -256,6 +257,7 @@ static void draw_small_text(cairo_t *cr, const GdkRectangle *rect, v3270FontInfo
256 257  
257 258 static gboolean draw_cg(cairo_t *cr, unsigned char chr, v3270FontInfo *font, GdkRectangle *rect)
258 259 {
  260 + // https://unicode.org/charts/PDF/U2300.pdf
259 261 static const struct CharList
260 262 {
261 263 unsigned char chr;
... ... @@ -350,25 +352,25 @@ void v3270_draw_char(cairo_t *cr, unsigned char chr, unsigned short attr, H3270
350 352 cairo_rel_line_to(cr,0,rect->height);
351 353 break;
352 354  
353   - case 0xd4: // CG 0xac, LR corner
  355 + case 0xd4: // CG 0xac, LR corner
354 356 cairo_move_to(cr,rect->x, rect->y+(rect->height/2));
355 357 cairo_rel_line_to(cr,rect->width/2,0);
356 358 cairo_rel_line_to(cr,0,-(rect->height/2));
357 359 break;
358 360  
359   - case 0xd5: // CG 0xad, UR corner
  361 + case 0xd5: // CG 0xad, UR corner
360 362 cairo_move_to(cr,rect->x, rect->y+(rect->height/2));
361 363 cairo_rel_line_to(cr,rect->width/2,0);
362 364 cairo_rel_line_to(cr,0,rect->height/2);
363 365 break;
364 366  
365   - case 0xc5: // CG 0xa4, UL corner
  367 + case 0xc5: // CG 0xa4, UL corner
366 368 cairo_move_to(cr,rect->x+rect->width,rect->y+(rect->height/2));
367 369 cairo_rel_line_to(cr,-(rect->width/2),0);
368 370 cairo_rel_line_to(cr,0,(rect->height/2));
369 371 break;
370 372  
371   - case 0xc4: // CG 0xa3, LL corner
  373 + case 0xc4: // CG 0xa3, LL corner
372 374 cairo_move_to(cr,rect->x+rect->width,rect->y+(rect->height/2));
373 375 cairo_rel_line_to(cr,-(rect->width/2),0);
374 376 cairo_rel_line_to(cr,0,-(rect->height/2));
... ... @@ -405,7 +407,10 @@ void v3270_draw_char(cairo_t *cr, unsigned char chr, unsigned short attr, H3270
405 407 default:
406 408  
407 409 if(!draw_cg(cr, chr, font, rect))
  410 + {
  411 + lib3270_write_screen_trace(session,"I don't known how to draw CG character %02x\n",(int) chr);
408 412 cairo_rectangle(cr, rect->x+1, rect->y+1, rect->width-2, rect->height-2);
  413 + }
409 414  
410 415 }
411 416 }
... ...
src/terminal/scroll.c
... ... @@ -45,15 +45,15 @@ gboolean v3270_scroll_event(GtkWidget *widget, GdkEventScroll *event)
45 45 {
46 46 v3270 * terminal = GTK_V3270(widget);
47 47  
48   - lib3270_trace_event(terminal->host,"scroll event direction=%d",(int) event->direction);
  48 + lib3270_write_event_trace(terminal->host,"scroll event direction=%d",(int) event->direction);
49 49  
50 50 if(lib3270_get_program_message(terminal->host) != LIB3270_MESSAGE_NONE || event->direction < 0 || event->direction > G_N_ELEMENTS(terminal->scroll))
51 51 {
52   - lib3270_trace_event(terminal->host," dropped (not available)\n");
  52 + lib3270_write_event_trace(terminal->host," dropped (not available)\n");
53 53 return FALSE;
54 54 }
55 55  
56   - lib3270_trace_event(terminal->host,"\n");
  56 + lib3270_write_event_trace(terminal->host,"\n");
57 57  
58 58 debug("%d %p", (int) event->direction, terminal->scroll[event->direction]);
59 59  
... ...