Make sending select-utf8-charset escape code configurable.
git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@611 db0b04b0-f4d1-0310-9a6d-de3e77497b0e
This commit is contained in:
parent
1d7ceb5ddf
commit
3c51941256
1
config.l
1
config.l
|
@ -94,6 +94,7 @@ commands { return TYPE_CMDQUEUE; }
|
|||
postcommands { return TYPE_POSTCMDQUEUE; }
|
||||
encoding { return TYPE_ENCODING; }
|
||||
locale { return TYPE_LOCALE; }
|
||||
utf8esc { return TYPE_UTF8ESC; }
|
||||
yes { yylval.i = 1; return TYPE_BOOL; }
|
||||
no { yylval.i = 0; return TYPE_BOOL; }
|
||||
dglstart { yylval.i = DGLTIME_DGLSTART; return TYPE_CMDQUEUENAME; }
|
||||
|
|
7
config.y
7
config.y
|
@ -59,7 +59,7 @@ static int sortmode_number(const char *sortmode_name) {
|
|||
%token TYPE_CMDQUEUE TYPE_DEFINE_MENU TYPE_BANNER_FILE TYPE_CURSOR
|
||||
%token TYPE_POSTCMDQUEUE
|
||||
%token TYPE_MAX_IDLE_TIME TYPE_MENU_MAX_IDLE_TIME TYPE_EXTRA_INFO_FILE
|
||||
%token TYPE_ENCODING TYPE_LOCALE
|
||||
%token TYPE_ENCODING TYPE_LOCALE TYPE_UTF8ESC
|
||||
%token <s> TYPE_VALUE
|
||||
%token <i> TYPE_NUMBER TYPE_CMDQUEUENAME
|
||||
%type <kt> KeyType
|
||||
|
@ -226,6 +226,9 @@ KeyPair: TYPE_CMDQUEUE '[' TYPE_CMDQUEUENAME ']'
|
|||
case TYPE_ALLOW_REGISTRATION:
|
||||
globalconfig.allow_registration = $<i>3;
|
||||
break;
|
||||
case TYPE_UTF8ESC:
|
||||
globalconfig.utf8esc = $<i>3;
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr, "%s:%d: token %s does not take a boolean, bailing out\n",
|
||||
config, line, lookup_token($1));
|
||||
|
@ -628,6 +631,7 @@ KeyType : TYPE_SUSER { $$ = TYPE_SUSER; }
|
|||
| TYPE_PATH_INPROGRESS { $$ = TYPE_PATH_INPROGRESS; }
|
||||
| TYPE_ENCODING { $$ = TYPE_ENCODING; }
|
||||
| TYPE_LOCALE { $$ = TYPE_LOCALE; }
|
||||
| TYPE_UTF8ESC { $$ = TYPE_UTF8ESC; }
|
||||
| TYPE_RC_FMT { $$ = TYPE_RC_FMT; }
|
||||
| TYPE_WATCH_SORTMODE { $$ = TYPE_WATCH_SORTMODE; }
|
||||
| TYPE_SERVER_ID { $$ = TYPE_SERVER_ID; }
|
||||
|
@ -664,6 +668,7 @@ const char* lookup_token (int t)
|
|||
case TYPE_WATCH_COLUMNS: return "watch_columns";
|
||||
case TYPE_SERVER_ID: return "server_id";
|
||||
case TYPE_LOCALE: return "locale";
|
||||
case TYPE_UTF8ESC: return "utf8esc";
|
||||
default: abort();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1061,7 +1061,7 @@ inprogressmenu (int gameid)
|
|||
break;
|
||||
|
||||
case 12: case 18: /* ^L, ^R */
|
||||
write(1, "\033%G", 3);
|
||||
if (globalconfig.utf8esc) write(1, "\033%G", 3);
|
||||
clear ();
|
||||
break;
|
||||
|
||||
|
@ -1099,7 +1099,7 @@ watchgame:
|
|||
clear ();
|
||||
refresh ();
|
||||
endwin ();
|
||||
write(1, "\033%G", 3);
|
||||
if (globalconfig.utf8esc) write(1, "\033%G", 3);
|
||||
#ifdef USE_SHMEM
|
||||
signals_block();
|
||||
if (games[idx]->is_in_shm) {
|
||||
|
@ -1610,7 +1610,7 @@ initcurses ()
|
|||
use_default_colors();
|
||||
init_pair(1, -1, -1);
|
||||
init_pair(2, COLOR_RED, -1);
|
||||
write(1, "\033%G", 3);
|
||||
if (globalconfig.utf8esc) write(1, "\033%G", 3);
|
||||
#endif
|
||||
clear();
|
||||
refresh();
|
||||
|
@ -2457,7 +2457,7 @@ runmenuloop(struct dg_menu *menu)
|
|||
term_resize_check();
|
||||
if (doclear) {
|
||||
doclear = 0;
|
||||
write(1, "\033%G", 3);
|
||||
if (globalconfig.utf8esc) write(1, "\033%G", 3);
|
||||
clear();
|
||||
}
|
||||
drawbanner(&ban, 1, 0);
|
||||
|
|
|
@ -226,6 +226,7 @@ struct dg_globalconfig
|
|||
int sortmode; /* default watching-screen sortmode */
|
||||
char *server_id; /* string for the server name or whatever */
|
||||
char *locale;
|
||||
int utf8esc; /* send select-utf8-charset escape code */
|
||||
|
||||
struct dg_cmdpart *cmdqueue[NUM_DGLTIMES];
|
||||
|
||||
|
|
|
@ -744,6 +744,7 @@ create_config ()
|
|||
globalconfig.shed_gid = (gid_t)-1;
|
||||
|
||||
globalconfig.sortmode = SORTMODE_USERNAME;
|
||||
globalconfig.utf8esc = 0;
|
||||
|
||||
if (config)
|
||||
{
|
||||
|
|
|
@ -77,6 +77,10 @@ shed_gid = 60
|
|||
# Locale. Leaving this out, dgamelaunch will not explicitly set locale.
|
||||
locale = "en_US.UTF-8"
|
||||
|
||||
# Should dgl send select-UTF8-charset escape code? (that is: ESC % G)
|
||||
# default is no.
|
||||
#utf8esc = yes
|
||||
|
||||
# Maximum time in seconds user can idle in the dgamelaunch menus
|
||||
# before dgl exits. Default value is 0, which disables the idling timer.
|
||||
# Does not apply to external programs or config editors.
|
||||
|
|
Loading…
Reference in New Issue