Commit b4b905a191d3b6642963ef8ad6d8a32fc86f0245

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

Extendendo tratamento de charset para a classe base para implementação de extens…

…ões, incluindo novos métodos no plugin rexx
@@ -195,7 +195,7 @@ static gunichar v3270_accessible_get_character_at_offset(AtkText *atk_text, gint @@ -195,7 +195,7 @@ static gunichar v3270_accessible_get_character_at_offset(AtkText *atk_text, gint
195 gchar * utfstring = g_convert_with_fallback( text, 195 gchar * utfstring = g_convert_with_fallback( text,
196 -1, 196 -1,
197 "UTF-8", 197 "UTF-8",
198 - lib3270_get_charset(host), 198 + lib3270_get_display_charset(host),
199 " ", 199 " ",
200 NULL, 200 NULL,
201 &bytes_written, 201 &bytes_written,
@@ -390,7 +390,7 @@ static gchar * v3270_accessible_get_text_at_offset(AtkText *atk_text, gint offse @@ -390,7 +390,7 @@ static gchar * v3270_accessible_get_text_at_offset(AtkText *atk_text, gint offse
390 gchar * utfchar = g_convert_with_fallback( text, 390 gchar * utfchar = g_convert_with_fallback( text,
391 -1, 391 -1,
392 "UTF-8", 392 "UTF-8",
393 - lib3270_get_charset(host), 393 + lib3270_get_display_charset(host),
394 " ", 394 " ",
395 NULL, 395 NULL,
396 &bytes_written, 396 &bytes_written,
@@ -433,7 +433,7 @@ static gchar * v3270_accessible_get_text(AtkText *atk_text, gint start_pos, gint @@ -433,7 +433,7 @@ static gchar * v3270_accessible_get_text(AtkText *atk_text, gint start_pos, gint
433 gsize bytes_written; 433 gsize bytes_written;
434 GError * error = NULL; 434 GError * error = NULL;
435 435
436 - utftext = g_convert_with_fallback(text,-1,"UTF-8",lib3270_get_charset(host)," ",NULL,&bytes_written, &error); 436 + utftext = g_convert_with_fallback(text,-1,"UTF-8",lib3270_get_display_charset(host)," ",NULL,&bytes_written, &error);
437 437
438 if(error) 438 if(error)
439 { 439 {
@@ -275,7 +275,7 @@ void v3270_draw_char(cairo_t *cr, unsigned char chr, unsigned short attr, H3270 @@ -275,7 +275,7 @@ void v3270_draw_char(cairo_t *cr, unsigned char chr, unsigned short attr, H3270
275 } 275 }
276 else if(chr) 276 else if(chr)
277 { 277 {
278 - gchar *utf = g_convert((char *) &chr, 1, "UTF-8", lib3270_get_charset(session), NULL, NULL, NULL); 278 + gchar *utf = g_convert((char *) &chr, 1, "UTF-8", lib3270_get_display_charset(session), NULL, NULL, NULL);
279 279
280 if(utf) 280 if(utf)
281 { 281 {
@@ -247,7 +247,7 @@ @@ -247,7 +247,7 @@
247 247
248 host = GTK_V3270(widget)->host; 248 host = GTK_V3270(widget)->host;
249 249
250 - utf = g_convert((char *) str, -1, lib3270_get_charset(host), "UTF-8", NULL, NULL, NULL); 250 + utf = g_convert((char *) str, -1, lib3270_get_display_charset(host), "UTF-8", NULL, NULL, NULL);
251 251
252 if(utf) 252 if(utf)
253 { 253 {
@@ -259,7 +259,7 @@ @@ -259,7 +259,7 @@
259 259
260 void v3270_key_commit(GtkIMContext *imcontext, gchar *str, v3270 *widget) 260 void v3270_key_commit(GtkIMContext *imcontext, gchar *str, v3270 *widget)
261 { 261 {
262 - gchar *utf = g_convert((char *) str, -1, lib3270_get_charset(widget->host), "UTF-8", NULL, NULL, NULL); 262 + gchar *utf = g_convert((char *) str, -1, lib3270_get_display_charset(widget->host), "UTF-8", NULL, NULL, NULL);
263 263
264 if(utf) 264 if(utf)
265 { 265 {
@@ -70,7 +70,7 @@ static void clipboard_get(GtkClipboard *clipboard, GtkSelectionData *selection, @@ -70,7 +70,7 @@ static void clipboard_get(GtkClipboard *clipboard, GtkSelectionData *selection,
70 } 70 }
71 else 71 else
72 { 72 {
73 - gchar * text = g_convert(widget->selection.text, -1, "UTF-8", lib3270_get_charset(widget->host), NULL, NULL, NULL); 73 + gchar * text = g_convert(widget->selection.text, -1, "UTF-8", lib3270_get_display_charset(widget->host), NULL, NULL, NULL);
74 gtk_selection_data_set_text(selection,text,-1); 74 gtk_selection_data_set_text(selection,text,-1);
75 g_free(text); 75 g_free(text);
76 } 76 }
@@ -104,7 +104,7 @@ gchar * v3270_get_text(GtkWidget *widget, int offset, int len) @@ -104,7 +104,7 @@ gchar * v3270_get_text(GtkWidget *widget, int offset, int len)
104 if(!str) 104 if(!str)
105 return NULL; 105 return NULL;
106 106
107 - text = g_convert(str, -1, "UTF-8", lib3270_get_charset(terminal->host), NULL, NULL, NULL); 107 + text = g_convert(str, -1, "UTF-8", lib3270_get_display_charset(terminal->host), NULL, NULL, NULL);
108 108
109 lib3270_free(str); 109 lib3270_free(str);
110 return text; 110 return text;
@@ -226,7 +226,7 @@ gchar * v3270_get_selected(GtkWidget *widget, gboolean cut) @@ -226,7 +226,7 @@ gchar * v3270_get_selected(GtkWidget *widget, gboolean cut)
226 text = update_selected_text(widget,cut); 226 text = update_selected_text(widget,cut);
227 227
228 if(text) 228 if(text)
229 - return g_convert(text, -1, "UTF-8", lib3270_get_charset(GTK_V3270(widget)->host), NULL, NULL, NULL); 229 + return g_convert(text, -1, "UTF-8", lib3270_get_display_charset(GTK_V3270(widget)->host), NULL, NULL, NULL);
230 230
231 return NULL; 231 return NULL;
232 } 232 }
@@ -242,7 +242,7 @@ gchar * v3270_get_copy(GtkWidget *widget) @@ -242,7 +242,7 @@ gchar * v3270_get_copy(GtkWidget *widget)
242 text = update_selected_text(widget,FALSE); 242 text = update_selected_text(widget,FALSE);
243 243
244 if(text) 244 if(text)
245 - return g_convert(text, -1, "UTF-8", lib3270_get_charset(GTK_V3270(widget)->host), NULL, NULL, NULL); 245 + return g_convert(text, -1, "UTF-8", lib3270_get_display_charset(GTK_V3270(widget)->host), NULL, NULL, NULL);
246 246
247 return NULL; 247 return NULL;
248 } 248 }
@@ -266,7 +266,7 @@ void v3270_set_copy(GtkWidget *widget, const gchar *text) @@ -266,7 +266,7 @@ void v3270_set_copy(GtkWidget *widget, const gchar *text)
266 266
267 /* Received text, replace the selection buffer */ 267 /* Received text, replace the selection buffer */
268 terminal->table = 0; 268 terminal->table = 0;
269 - isotext = g_convert(text, -1, lib3270_get_charset(terminal->host), "UTF-8", NULL, NULL, NULL); 269 + isotext = g_convert(text, -1, lib3270_get_display_charset(terminal->host), "UTF-8", NULL, NULL, NULL);
270 270
271 if(!isotext) 271 if(!isotext)
272 { 272 {
@@ -350,7 +350,7 @@ void v3270_paste_string(GtkWidget *widget, const gchar *text, const gchar *encod @@ -350,7 +350,7 @@ void v3270_paste_string(GtkWidget *widget, const gchar *text, const gchar *encod
350 { 350 {
351 gchar * buffer = NULL; 351 gchar * buffer = NULL;
352 H3270 * session = v3270_get_session(widget); 352 H3270 * session = v3270_get_session(widget);
353 - const gchar * charset = lib3270_get_charset(session); 353 + const gchar * charset = lib3270_get_display_charset(session);
354 gboolean next; 354 gboolean next;
355 355
356 if(!text) 356 if(!text)
@@ -504,7 +504,7 @@ gchar * v3270_get_region(GtkWidget *widget, gint start_pos, gint end_pos, gboole @@ -504,7 +504,7 @@ gchar * v3270_get_region(GtkWidget *widget, gint start_pos, gint end_pos, gboole
504 if(!str) 504 if(!str)
505 return NULL; 505 return NULL;
506 506
507 - utftext = g_convert(str, -1, "UTF-8", lib3270_get_charset(GTK_V3270(widget)->host), NULL, NULL, NULL); 507 + utftext = g_convert(str, -1, "UTF-8", lib3270_get_display_charset(GTK_V3270(widget)->host), NULL, NULL, NULL);
508 508
509 lib3270_free(str); 509 lib3270_free(str);
510 510
@@ -765,7 +765,7 @@ static void changed(H3270 *session, int offset, int len) @@ -765,7 +765,7 @@ static void changed(H3270 *session, int offset, int len)
765 gchar * utfchar = g_convert_with_fallback( text, 765 gchar * utfchar = g_convert_with_fallback( text,
766 -1, 766 -1,
767 "UTF-8", 767 "UTF-8",
768 - lib3270_get_charset(session), 768 + lib3270_get_display_charset(session),
769 " ", 769 " ",
770 NULL, 770 NULL,
771 &bytes_written, 771 &bytes_written,