Commit 2bc1baf7c48492683c458847d2b450c357da5c14

Authored by perry.werneck@gmail.com
1 parent 362ade02
Exists in master and in 1 other branch develop

Melhorando indicação de status da conexão SSL

Showing 4 changed files with 50 additions and 19 deletions   Show diff stats
negotiated.xbm 0 → 100644
@@ -0,0 +1,14 @@ @@ -0,0 +1,14 @@
  1 +#define negotiated_width 32
  2 +#define negotiated_height 32
  3 +static unsigned char negotiated_bits[] = {
  4 + 0x00, 0xfc, 0x3f, 0x00, 0x00, 0xfe, 0x7f, 0x00, 0x00, 0x07, 0xe0, 0x00,
  5 + 0x80, 0x03, 0xc0, 0x01, 0xc0, 0xf1, 0x8f, 0x03, 0xc0, 0xf8, 0x1f, 0x03,
  6 + 0xc0, 0x1c, 0x38, 0x03, 0xc0, 0x0c, 0x30, 0x03, 0xc0, 0x0c, 0x30, 0x03,
  7 + 0xc0, 0x0c, 0x30, 0x03, 0xc0, 0x0c, 0x30, 0x03, 0xc0, 0x0c, 0x30, 0x03,
  8 + 0xc0, 0x0c, 0x30, 0x03, 0xc0, 0x0c, 0x30, 0x03, 0xf0, 0xff, 0xff, 0x0f,
  9 + 0xf0, 0xff, 0xff, 0x0f, 0x30, 0x00, 0x00, 0x0c, 0x30, 0x00, 0x00, 0x0c,
  10 + 0x30, 0x00, 0x00, 0x0c, 0x30, 0x00, 0x00, 0x0c, 0x30, 0x00, 0x00, 0x0c,
  11 + 0x30, 0x00, 0x00, 0x0c, 0x30, 0x00, 0x00, 0x0c, 0x30, 0x00, 0x00, 0x0c,
  12 + 0x30, 0x00, 0x00, 0x0c, 0x30, 0x00, 0x00, 0x0c, 0x30, 0x00, 0x00, 0x0c,
  13 + 0x30, 0x00, 0x00, 0x0c, 0x30, 0x00, 0x00, 0x0c, 0x30, 0x00, 0x00, 0x0c,
  14 + 0xf0, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0x0f };
@@ -52,6 +52,7 @@ static void draw_cursor_position(cairo_t *cr, GdkRectangle *rect, struct v3270_m @@ -52,6 +52,7 @@ static void draw_cursor_position(cairo_t *cr, GdkRectangle *rect, struct v3270_m
52 52
53 #include "locked.xbm" 53 #include "locked.xbm"
54 #include "unlocked.xbm" 54 #include "unlocked.xbm"
  55 + #include "negotiated.xbm"
55 56
56 /*--[ Implement ]------------------------------------------------------------------------------------*/ 57 /*--[ Implement ]------------------------------------------------------------------------------------*/
57 58
@@ -334,8 +335,16 @@ void v3270_draw_ssl_status(cairo_t *cr, H3270 *host, struct v3270_metrics *metri @@ -334,8 +335,16 @@ void v3270_draw_ssl_status(cairo_t *cr, H3270 *host, struct v3270_metrics *metri
334 bits = (unsigned char *) unlocked_bits; 335 bits = (unsigned char *) unlocked_bits;
335 break; 336 break;
336 337
337 - case LIB3270_SSL_SECURE: /**< Connection secure */  
338 - gdk_cairo_set_source_color(cr,color+V3270_COLOR_OIA_FOREGROUND); 338 + case LIB3270_SSL_NEGOTIATED: /**< Connection secure, no CA or self-signed */
  339 + gdk_cairo_set_source_color(cr,color+V3270_COLOR_OIA_STATUS_WARNING);
  340 + width = negotiated_width;
  341 + height = negotiated_height;
  342 + bits = (unsigned char *) negotiated_bits;
  343 + break;
  344 +
  345 +
  346 + case LIB3270_SSL_SECURE: /**< Connection secure with CA check */
  347 + gdk_cairo_set_source_color(cr,color+V3270_COLOR_OIA_STATUS_OK);
339 width = locked_width; 348 width = locked_width;
340 height = locked_height; 349 height = locked_height;
341 bits = (unsigned char *) locked_bits; 350 bits = (unsigned char *) locked_bits;
@@ -343,9 +352,9 @@ void v3270_draw_ssl_status(cairo_t *cr, H3270 *host, struct v3270_metrics *metri @@ -343,9 +352,9 @@ void v3270_draw_ssl_status(cairo_t *cr, H3270 *host, struct v3270_metrics *metri
343 352
344 case LIB3270_SSL_NEGOTIATING: /**< Negotiating SSL */ 353 case LIB3270_SSL_NEGOTIATING: /**< Negotiating SSL */
345 gdk_cairo_set_source_color(cr,color+V3270_COLOR_OIA_STATUS_WARNING); 354 gdk_cairo_set_source_color(cr,color+V3270_COLOR_OIA_STATUS_WARNING);
346 - width = locked_width;  
347 - height = locked_height;  
348 - bits = (unsigned char *) locked_bits; 355 + width = unlocked_width;
  356 + height = unlocked_height;
  357 + bits = (unsigned char *) unlocked_bits;
349 break; 358 break;
350 359
351 default: 360 default:
1 -#define unlocked_width 32  
2 -#define unlocked_height 32  
3 -static unsigned char unlocked_bits[] = {  
4 - 0x00, 0x00, 0xff, 0x0f, 0x00, 0x80, 0xff, 0x1f, 0x00, 0xc0, 0x01, 0x38,  
5 - 0x00, 0xe0, 0x00, 0x70, 0x00, 0x70, 0xfc, 0xe3, 0x00, 0x30, 0xfe, 0xc7,  
6 - 0x00, 0x30, 0x07, 0xce, 0x00, 0x30, 0x03, 0xcc, 0x00, 0x30, 0x03, 0xcc,  
7 - 0x00, 0x30, 0x03, 0xcc, 0x00, 0x30, 0x03, 0xcc, 0x00, 0x30, 0x03, 0xcc,  
8 - 0x00, 0x30, 0x03, 0xfc, 0x00, 0x30, 0x03, 0xfc, 0xff, 0xff, 0x3f, 0x00,  
9 - 0xff, 0xff, 0x3f, 0x00, 0x33, 0x33, 0x33, 0x00, 0x33, 0x33, 0x33, 0x00,  
10 - 0xcf, 0xcc, 0x3c, 0x00, 0xcf, 0xcc, 0x3c, 0x00, 0x33, 0x33, 0x33, 0x00,  
11 - 0x33, 0x33, 0x33, 0x00, 0xcf, 0xcc, 0x3c, 0x00, 0xcf, 0xcc, 0x3c, 0x00,  
12 - 0x33, 0x33, 0x33, 0x00, 0x33, 0x33, 0x33, 0x00, 0xcf, 0xcc, 0x3c, 0x00,  
13 - 0xcf, 0xcc, 0x3c, 0x00, 0x33, 0x33, 0x33, 0x00, 0x33, 0x33, 0x33, 0x00,  
14 - 0xff, 0xff, 0x3f, 0x00, 0xff, 0xff, 0x3f, 0x00 }; 1 +#define unlocked_width 32
  2 +#define unlocked_height 32
  3 +static unsigned char unlocked_bits[] = {
  4 + 0x00, 0x00, 0xff, 0x0f, 0x00, 0x80, 0xff, 0x1f, 0x00, 0xc0, 0x01, 0x38,
  5 + 0x00, 0xe0, 0x00, 0x70, 0x00, 0x70, 0xfc, 0xe3, 0x00, 0x30, 0xfe, 0xc7,
  6 + 0x00, 0x30, 0x07, 0xce, 0x00, 0x30, 0x03, 0xcc, 0x00, 0x30, 0x03, 0xcc,
  7 + 0x00, 0x30, 0x03, 0xcc, 0x00, 0x30, 0x03, 0xcc, 0x00, 0x30, 0x03, 0xcc,
  8 + 0x00, 0x30, 0x03, 0xfc, 0x00, 0x30, 0x03, 0xfc, 0xff, 0xff, 0x3f, 0x00,
  9 + 0xff, 0xff, 0x3f, 0x00, 0x03, 0x00, 0x30, 0x00, 0x03, 0x00, 0x30, 0x00,
  10 + 0x03, 0x00, 0x30, 0x00, 0x03, 0x00, 0x30, 0x00, 0x03, 0x00, 0x30, 0x00,
  11 + 0x03, 0x00, 0x30, 0x00, 0x03, 0x00, 0x30, 0x00, 0x03, 0x00, 0x30, 0x00,
  12 + 0x03, 0x00, 0x30, 0x00, 0x03, 0x00, 0x30, 0x00, 0x03, 0x00, 0x30, 0x00,
  13 + 0x03, 0x00, 0x30, 0x00, 0x03, 0x00, 0x30, 0x00, 0x03, 0x00, 0x30, 0x00,
  14 + 0xff, 0xff, 0x3f, 0x00, 0xff, 0xff, 0x3f, 0x00 };
@@ -1167,6 +1167,7 @@ void v3270_set_colors(GtkWidget *widget, const gchar *colors) @@ -1167,6 +1167,7 @@ void v3270_set_colors(GtkWidget *widget, const gchar *colors)
1167 "#00FF00," // V3270_COLOR_OIA 1167 "#00FF00," // V3270_COLOR_OIA
1168 "#7890F0," // V3270_COLOR_OIA_SEPARATOR 1168 "#7890F0," // V3270_COLOR_OIA_SEPARATOR
1169 "#FFFFFF," // V3270_COLOR_OIA_STATUS_OK 1169 "#FFFFFF," // V3270_COLOR_OIA_STATUS_OK
  1170 + "#FFFF00," // V3270_COLOR_OIA_STATUS_WARNING
1170 "#FF0000"; // V3270_COLOR_OIA_STATUS_INVALID 1171 "#FF0000"; // V3270_COLOR_OIA_STATUS_INVALID
1171 1172
1172 } 1173 }
@@ -1228,8 +1229,15 @@ void v3270_set_color_table(GdkColor *table, const gchar *colors) @@ -1228,8 +1229,15 @@ void v3270_set_color_table(GdkColor *table, const gchar *colors)
1228 1229
1229 clr = g_strsplit(colors,",",V3270_COLOR_COUNT+1); 1230 clr = g_strsplit(colors,",",V3270_COLOR_COUNT+1);
1230 cnt = g_strv_length(clr); 1231 cnt = g_strv_length(clr);
  1232 +
1231 switch(cnt) 1233 switch(cnt)
1232 { 1234 {
  1235 + case 28: // Version 4 string
  1236 + for(f=0;f < 28;f++)
  1237 + gdk_color_parse(clr[f],table+f);
  1238 + table[V3270_COLOR_OIA_STATUS_INVALID] = table[V3270_COLOR_OIA_STATUS_WARNING];
  1239 + break;
  1240 +
1233 case V3270_COLOR_COUNT: // Complete string 1241 case V3270_COLOR_COUNT: // Complete string
1234 for(f=0;f < V3270_COLOR_COUNT;f++) 1242 for(f=0;f < V3270_COLOR_COUNT;f++)
1235 gdk_color_parse(clr[f],table+f); 1243 gdk_color_parse(clr[f],table+f);