diff --git a/include/flag.h b/include/flag.h index 0623ec526..e3d0a5143 100644 --- a/include/flag.h +++ b/include/flag.h @@ -322,12 +322,13 @@ struct instance_flags { #endif #endif uchar bouldersym; /* symbol for boulder display */ -#ifdef TTY_GRAPHICS +#if defined(TTY_GRAPHICS) || defined(CURSES_GRAPHICS) char prevmsg_window; /* type of old message window to use */ #endif #if defined(TTY_GRAPHICS) || defined(CURSES_GRAPHICS) boolean extmenu; /* extended commands use menu interface */ #endif + #ifdef MFLOPPY boolean checkspace; /* check disk space before writing files */ /* (in iflags to allow restore after moving diff --git a/include/wincurs.h b/include/wincurs.h index 55e7f1d22..be79256b7 100644 --- a/include/wincurs.h +++ b/include/wincurs.h @@ -259,9 +259,6 @@ extern void curses_del_menu(winid wid); extern void curses_status_init(void); extern void curses_status_update(int, genericptr_t, int, int, int, unsigned long *); -/* extern attr_t curses_color_attr(int nh_color, int bg_color); */ -/* extern void curses_update_stats(void); */ -/* extern void curses_decrement_highlight(void); */ /* cursinvt.c */ diff --git a/src/files.c b/src/files.c index 3dd137743..2fd0f89c1 100644 --- a/src/files.c +++ b/src/files.c @@ -3185,7 +3185,14 @@ int which_set; if (symset[which_set].name && (fuzzymatch(symset[which_set].name, "Default symbols", " -_", TRUE) - || !strcmpi(symset[which_set].name, "default"))) + || !strcmpi(symset[which_set].name, "default") +#ifdef CURSES_GRAPHICS + /* we don't maintain static symbols for curses + * the system defines these at runtime + */ + || !strcmpi(symset[which_set].name, "curses") +#endif + )) clear_symsetentry(which_set, TRUE); config_error_done(); return (symset[which_set].name == 0) ? 1 : 0; diff --git a/src/options.c b/src/options.c index 8be8cfcd3..51f0d6d8f 100644 --- a/src/options.c +++ b/src/options.c @@ -106,7 +106,7 @@ static struct Bool_Opt { #endif { "clicklook", &iflags.clicklook, FALSE, SET_IN_GAME }, { "cmdassist", &iflags.cmdassist, TRUE, SET_IN_GAME }, -#if defined(MICRO) || defined(WIN32) +#if defined(MICRO) || defined(WIN32) || defined(CURSES_GRAPHICS) { "color", &iflags.wc_color, TRUE, SET_IN_GAME }, /*WC*/ #else /* systems that support multiple terminals, many monochrome */ { "color", &iflags.wc_color, FALSE, SET_IN_GAME }, /*WC*/ @@ -3626,6 +3626,71 @@ boolean tinitial, tfrom_file; } #endif + /* WINCAP2 + * term_cols:amount */ + fullname = "term_cols"; + if (match_optname(opts, fullname, sizeof("term_cols")-1, TRUE)) { + op = string_for_opt(opts, negated); + iflags.wc2_term_cols = atoi(op); + if (negated) bad_negation(fullname, FALSE); + return retval; + } + + /* WINCAP2 + * term_rows:amount */ + fullname = "term_rows"; + if (match_optname(opts, fullname, sizeof("term_rows")-1, TRUE)) { + op = string_for_opt(opts, negated); + iflags.wc2_term_rows = atoi(op); + if (negated) bad_negation(fullname, FALSE); + return retval; + } + + /* WINCAP2 + * petattr:string */ + fullname = "petattr"; + if (match_optname(opts, fullname, sizeof("petattr")-1, TRUE)) { + op = string_for_opt(opts, negated); + if (op && !negated) { +#ifdef CURSES_GRAPHICS + iflags.wc2_petattr = curses_read_attrs(op); + if (!curses_read_attrs(op)) + config_error_add("Unknown %s parameter '%s'", fullname, opts); + return FALSE; +#else + /* non-curses windowports will not use this flag anyway + * but the above will not compile if we don't have curses. + * Just set it to a sensible default: */ + iflags.wc2_petattr = ATR_INVERSE +#endif + } else if (negated) bad_negation(fullname, TRUE); + return retval; + } + + /* WINCAP2 + * windowborders:n */ + fullname = "windowborders"; + if (match_optname(opts, fullname, sizeof("windowborders")-1, TRUE)) { + op = string_for_opt(opts, negated); + if (negated && op) bad_negation(fullname, TRUE); + else { + if (negated) + iflags.wc2_windowborders = 2; /* Off */ + else if (!op) + iflags.wc2_windowborders = 1; /* On */ + else /* Value supplied */ + iflags.wc2_windowborders = atoi(op); + if ((iflags.wc2_windowborders > 3) || + (iflags.wc2_windowborders < 1)) { + iflags.wc2_windowborders = 0; + config_error_add("Unknown %s parameter '%s'", fullname, opts); + return FALSE; + + } + } + return retval; + } + /* menustyle:traditional or combination or full or partial */ fullname = "menustyle"; if (match_optname(opts, fullname, 4, TRUE)) { diff --git a/sys/unix/Makefile.src b/sys/unix/Makefile.src index 07d5d5920..38523fd36 100644 --- a/sys/unix/Makefile.src +++ b/sys/unix/Makefile.src @@ -198,6 +198,14 @@ REGEXOBJ = posixregex.o WINTTYSRC = ../win/tty/getline.c ../win/tty/termcap.c ../win/tty/topl.c \ ../win/tty/wintty.c WINTTYOBJ = getline.o termcap.o topl.o wintty.o +# Files for curses interface +WINCURSESSRC = ../win/curses/cursmain.c ../win/curses/curswins.c \ + ../win/curses/cursmisc.c ../win/curses/cursdial.c \ + ../win/curses/cursstat.c ../win/curses/cursinit.c \ + ../win/curses/cursmesg.c ../win/curses/cursinvt.c +WINCURSESOBJ = cursmain.o curswins.o cursmisc.o cursdial.o cursstat.o \ + cursinit.o cursmesg.o cursinvt.o + # # Files for curses interface WINCURSESSRC = ../win/curses/cursmain.c ../win/curses/curswins.c \