summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
c2524e4)
relevant bits of it passed in to init_ucs(). (Actually I pass in all
of it in the Windows version, since it's a bit hairy in there.)
git-svn-id: svn://svn.tartarus.org/sgt/putty@2565
cda61777-01e9-0310-a592-
d414129be87e
static void link_font(WCHAR * line_tbl, WCHAR * font_tbl, WCHAR attr);
static void link_font(WCHAR * line_tbl, WCHAR * font_tbl, WCHAR attr);
+void init_ucs(Config *cfg)
{
int i, j;
int used_dtf = 0;
{
int i, j;
int used_dtf = 0;
tbuf[i] = i;
/* Decide on the Line and Font codepages */
tbuf[i] = i;
/* Decide on the Line and Font codepages */
- line_codepage = decode_codepage(cfg.line_codepage);
+ line_codepage = decode_codepage(cfg->line_codepage);
if (font_codepage <= 0) {
font_codepage=0;
dbcs_screenfont=0;
}
if (font_codepage <= 0) {
font_codepage=0;
dbcs_screenfont=0;
}
- if (cfg.vtmode == VT_OEMONLY) {
+ if (cfg->vtmode == VT_OEMONLY) {
font_codepage = 437;
dbcs_screenfont = 0;
if (line_codepage <= 0)
font_codepage = 437;
dbcs_screenfont = 0;
if (line_codepage <= 0)
if (font_codepage == 437)
unitab_font[0] = unitab_font[255] = 0xFFFF;
}
if (font_codepage == 437)
unitab_font[0] = unitab_font[255] = 0xFFFF;
}
- if (cfg.vtmode == VT_XWINDOWS)
+ if (cfg->vtmode == VT_XWINDOWS)
memcpy(unitab_font + 1, unitab_xterm_std,
sizeof(unitab_xterm_std));
memcpy(unitab_font + 1, unitab_xterm_std,
sizeof(unitab_xterm_std));
get_unitab(CP_OEMCP, unitab_oemcp, 1);
/* Collect CP437 ucs table for SCO acs */
get_unitab(CP_OEMCP, unitab_oemcp, 1);
/* Collect CP437 ucs table for SCO acs */
- if (cfg.vtmode == VT_OEMANSI || cfg.vtmode == VT_XWINDOWS)
+ if (cfg->vtmode == VT_OEMANSI || cfg->vtmode == VT_XWINDOWS)
memcpy(unitab_scoacs, unitab_oemcp, sizeof(unitab_scoacs));
else
get_unitab(437, unitab_scoacs, 1);
/* Collect line set ucs table */
if (line_codepage == font_codepage &&
memcpy(unitab_scoacs, unitab_oemcp, sizeof(unitab_scoacs));
else
get_unitab(437, unitab_scoacs, 1);
/* Collect line set ucs table */
if (line_codepage == font_codepage &&
- (dbcs_screenfont || cfg.vtmode == VT_POORMAN || font_codepage==0)) {
+ (dbcs_screenfont || cfg->vtmode == VT_POORMAN || font_codepage==0)) {
/* For DBCS and POOR fonts force direct to font */
used_dtf = 1;
/* For DBCS and POOR fonts force direct to font */
used_dtf = 1;
unitab_ctrl[i] = 0xFF;
/* Generate line->screen direct conversion links. */
unitab_ctrl[i] = 0xFF;
/* Generate line->screen direct conversion links. */
- if (cfg.vtmode == VT_OEMANSI || cfg.vtmode == VT_XWINDOWS)
+ if (cfg->vtmode == VT_OEMANSI || cfg->vtmode == VT_XWINDOWS)
link_font(unitab_scoacs, unitab_oemcp, ATTR_OEMCP);
link_font(unitab_line, unitab_font, ATTR_ACP);
link_font(unitab_scoacs, unitab_font, ATTR_ACP);
link_font(unitab_xterm, unitab_font, ATTR_ACP);
link_font(unitab_scoacs, unitab_oemcp, ATTR_OEMCP);
link_font(unitab_line, unitab_font, ATTR_ACP);
link_font(unitab_scoacs, unitab_font, ATTR_ACP);
link_font(unitab_xterm, unitab_font, ATTR_ACP);
- if (cfg.vtmode == VT_OEMANSI || cfg.vtmode == VT_XWINDOWS) {
+ if (cfg->vtmode == VT_OEMANSI || cfg->vtmode == VT_XWINDOWS) {
link_font(unitab_line, unitab_oemcp, ATTR_OEMCP);
link_font(unitab_xterm, unitab_oemcp, ATTR_OEMCP);
}
link_font(unitab_line, unitab_oemcp, ATTR_OEMCP);
link_font(unitab_xterm, unitab_oemcp, ATTR_OEMCP);
}
}
/* Last chance, if !unicode then try poorman links. */
}
/* Last chance, if !unicode then try poorman links. */
- if (cfg.vtmode != VT_UNICODE) {
+ if (cfg->vtmode != VT_UNICODE) {
static char poorman_scoacs[] =
"CueaaaaceeeiiiAAE**ooouuyOUc$YPsaiounNao?++**!<>###||||++||++++++--|-+||++--|-+----++++++++##||#aBTPEsyt******EN=+><++-=... n2* ";
static char poorman_latin1[] =
static char poorman_scoacs[] =
"CueaaaaceeeiiiAAE**ooouuyOUc$YPsaiounNao?++**!<>###||||++||++++++--|-+||++--|-+----++++++++##||#aBTPEsyt******EN=+><++-=... n2* ";
static char poorman_latin1[] =
inst->compound_text_atom = gdk_atom_intern("COMPOUND_TEXT", FALSE);
inst->utf8_string_atom = gdk_atom_intern("UTF8_STRING", FALSE);
inst->compound_text_atom = gdk_atom_intern("COMPOUND_TEXT", FALSE);
inst->utf8_string_atom = gdk_atom_intern("UTF8_STRING", FALSE);
- inst->direct_to_font = init_ucs(font_charset);
+ inst->direct_to_font = init_ucs(cfg.line_codepage, font_charset);
inst->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
inst->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
/*
* Exports from unicode.c.
*/
/*
* Exports from unicode.c.
*/
-int init_ucs(int font_charset);
+int init_ucs(char *line_codepage, int font_charset);
/*
* Spare function exported directly from uxnet.c.
/*
* Spare function exported directly from uxnet.c.
/*
* Return value is TRUE if pterm is to run in direct-to-font mode.
*/
/*
* Return value is TRUE if pterm is to run in direct-to-font mode.
*/
-int init_ucs(int font_charset)
+int init_ucs(char *linecharset, int font_charset)
* line_codepage should be decoded from the specification in
* cfg.
*/
* line_codepage should be decoded from the specification in
* cfg.
*/
- line_codepage = charset_from_mimeenc(cfg.line_codepage);
+ line_codepage = charset_from_mimeenc(linecharset);
if (line_codepage == CS_NONE)
if (line_codepage == CS_NONE)
- line_codepage = charset_from_xenc(cfg.line_codepage);
+ line_codepage = charset_from_xenc(linecharset);
/*
* If line_codepage is _still_ CS_NONE, we assume we're using
/*
* If line_codepage is _still_ CS_NONE, we assume we're using
}
fontflag[0] = fontflag[1] = fontflag[2] = 1;
}
fontflag[0] = fontflag[1] = fontflag[2] = 1;
}
static void another_font(int fontno)
}
static void another_font(int fontno)
/*
* Exports from unicode.c.
*/
/*
* Exports from unicode.c.
*/
+void init_ucs(Config *);