Commit 6c280698d327b952cb489d052cfeb5c71497731e
1 parent
cc72c79a
Exists in
master
and in
5 other branches
Incluindo opção para mostrar o charset atual
Showing
3 changed files
with
62 additions
and
0 deletions
Show diff stats
src/include/lib3270/action_table.h
src/lib3270/charset.c
| ... | ... | @@ -243,6 +243,66 @@ LIB3270_EXPORT const char * lib3270_get_charset(H3270 *hSession) |
| 243 | 243 | return hSession->charset.display ? hSession->charset.display : "ISO-8859-1"; |
| 244 | 244 | } |
| 245 | 245 | |
| 246 | +LIB3270_ACTION( charsettable ) | |
| 247 | +{ | |
| 248 | + static const char * hChars = "0123456789ABCDEF"; | |
| 249 | + | |
| 250 | + int f; | |
| 251 | + int margin_left = 5; | |
| 252 | + int row; | |
| 253 | + int chr; | |
| 254 | + int r; | |
| 255 | + | |
| 256 | + CHECK_SESSION_HANDLE(hSession); | |
| 257 | + | |
| 258 | + trace("%s","Showing charset table"); | |
| 259 | + | |
| 260 | + (void) memset((char *) hSession->ea_buf, 0, hSession->rows*hSession->cols*sizeof(struct lib3270_ea)); | |
| 261 | + | |
| 262 | + int col = margin_left; | |
| 263 | + for(f=4;f<=0x0f;f++) | |
| 264 | + { | |
| 265 | + col += 2; | |
| 266 | + hSession->ea_buf[col].fg = LIB3270_ATTR_COLOR_BLUE; | |
| 267 | + hSession->ea_buf[col].bg = LIB3270_ATTR_COLOR_BLACK; | |
| 268 | + hSession->ea_buf[col].cs = 0; | |
| 269 | + hSession->ea_buf[col].cc = hSession->charset.asc2ebc[(int) hChars[f]]; | |
| 270 | + hSession->ea_buf[col].gr = 0; | |
| 271 | + } | |
| 272 | + | |
| 273 | + row = margin_left+hSession->maxCOLS; | |
| 274 | + for(f=0;f<=0x0f;f++) | |
| 275 | + { | |
| 276 | + hSession->ea_buf[row].fg = LIB3270_ATTR_COLOR_BLUE; | |
| 277 | + hSession->ea_buf[row].bg = LIB3270_ATTR_COLOR_BLACK; | |
| 278 | + hSession->ea_buf[row].cs = 0; | |
| 279 | + hSession->ea_buf[row].cc = hSession->charset.asc2ebc[(int) hChars[f]]; | |
| 280 | + hSession->ea_buf[row].gr = 0; | |
| 281 | + | |
| 282 | + row += hSession->maxCOLS; | |
| 283 | + } | |
| 284 | + | |
| 285 | + chr = 0x40; | |
| 286 | + | |
| 287 | + for(f=0;f<0x0c;f++) | |
| 288 | + { | |
| 289 | + row = (margin_left+hSession->maxCOLS)+(f*2)+2; | |
| 290 | + for(r=0;r<=0x0f;r++) | |
| 291 | + { | |
| 292 | + hSession->ea_buf[row].fg = LIB3270_ATTR_COLOR_WHITE; | |
| 293 | + hSession->ea_buf[row].bg = LIB3270_ATTR_COLOR_BLACK; | |
| 294 | + hSession->ea_buf[row].cs = 0; | |
| 295 | + hSession->ea_buf[row].cc = chr++; | |
| 296 | + hSession->ea_buf[row].gr = 0; | |
| 297 | + row += hSession->maxCOLS; | |
| 298 | + } | |
| 299 | + } | |
| 300 | + | |
| 301 | + hSession->display(hSession); | |
| 302 | + | |
| 303 | + return 0; | |
| 304 | +} | |
| 305 | + | |
| 246 | 306 | /*ISO-8859-1 |
| 247 | 307 | |
| 248 | 308 | #include "resources.h" | ... | ... |
ui/99debug.xml
| ... | ... | @@ -46,6 +46,7 @@ |
| 46 | 46 | |
| 47 | 47 | <menu name='debugmenu' label='Debug' > |
| 48 | 48 | <menuitem action='testpattern' group='offline' label='Show test pattern' /> |
| 49 | + <menuitem action='charsettable' group='offline' label='Display current charset' /> | |
| 49 | 50 | <menuitem action='reload' label='Reload buffer contents' /> |
| 50 | 51 | <menuitem action='toggle' id='gdkdebug' label='Debug window updates' /> |
| 51 | 52 | </menu> | ... | ... |