Skip to content
Snippets Groups Projects
Commit 2512c12c authored by deuce's avatar deuce
Browse files

Use curses.h instead of ncurses.h

When _putch() is called to display a space, use a BOLD space.  Don't ask me why,
but this fixes an issue with every curses other than ncurses (growl)
Remove use if SP macro in uifc32.c (It's just silly.)
parent 0080298d
Branches
Tags
No related merge requests found
...@@ -307,8 +307,8 @@ int cio_gettext(int sx, int sy, int ex, int ey, unsigned char *fill) ...@@ -307,8 +307,8 @@ int cio_gettext(int sx, int sy, int ex, int ey, unsigned char *fill)
void textattr(unsigned char attr) void textattr(unsigned char attr)
{ {
int attrs=A_NORMAL; chtype attrs=A_NORMAL;
short colour; int colour;
if (lastattr==attr) if (lastattr==attr)
return; return;
...@@ -327,6 +327,7 @@ void textattr(unsigned char attr) ...@@ -327,6 +327,7 @@ void textattr(unsigned char attr)
#ifdef NCURSES_VERSION_MAJOR #ifdef NCURSES_VERSION_MAJOR
color_set(colour,NULL); color_set(colour,NULL);
#endif #endif
/* bkgdset(colour); */
bkgdset(colour); bkgdset(colour);
} }
...@@ -366,7 +367,7 @@ int wherex(void) ...@@ -366,7 +367,7 @@ int wherex(void)
void _putch(unsigned char ch, BOOL refresh_now) void _putch(unsigned char ch, BOOL refresh_now)
{ {
int cha; chtype cha;
if(!(mode&UIFC_IBM)) if(!(mode&UIFC_IBM))
{ {
...@@ -528,7 +529,9 @@ void _putch(unsigned char ch, BOOL refresh_now) ...@@ -528,7 +529,9 @@ void _putch(unsigned char ch, BOOL refresh_now)
} }
} }
if(ch == ' ')
addch(A_BOLD|' ');
else
addch(cha); addch(cha);
if(refresh_now) if(refresh_now)
refresh(); refresh();
...@@ -537,7 +540,7 @@ void _putch(unsigned char ch, BOOL refresh_now) ...@@ -537,7 +540,7 @@ void _putch(unsigned char ch, BOOL refresh_now)
int cprintf(char *fmat, ...) int cprintf(char *fmat, ...)
{ {
va_list argptr; va_list argptr;
char str[MAX_BFLN]; unsigned char str[MAX_BFLN];
int pos; int pos;
va_start(argptr,fmat); va_start(argptr,fmat);
...@@ -551,7 +554,7 @@ int cprintf(char *fmat, ...) ...@@ -551,7 +554,7 @@ int cprintf(char *fmat, ...)
return(1); return(1);
} }
void cputs(char *str) void cputs(unsigned char *str)
{ {
int pos; int pos;
...@@ -585,6 +588,7 @@ void initciowrap(long inmode) ...@@ -585,6 +588,7 @@ void initciowrap(long inmode)
nonl(); nonl();
keypad(stdscr, TRUE); keypad(stdscr, TRUE);
scrollok(stdscr,FALSE); scrollok(stdscr,FALSE);
idcok(stdscr,FALSE);
raw(); raw();
/* Set up color pairs */ /* Set up color pairs */
......
...@@ -61,7 +61,7 @@ int wherey(void); ...@@ -61,7 +61,7 @@ int wherey(void);
int wherex(void); int wherex(void);
void _putch(unsigned char ch, BOOL refresh_now); void _putch(unsigned char ch, BOOL refresh_now);
int cprintf(char *fmat, ...); int cprintf(char *fmat, ...);
void cputs(char *str); void cputs(unsigned char *str);
void gotoxy(int x, int y); void gotoxy(int x, int y);
void clrscr(void); void clrscr(void);
void initciowrap(long inmode); void initciowrap(long inmode);
......
/* $Id$ */ /* $Id$ */
#include <ncurses.h> #include <curses.h>
#ifndef ACS_SBSD #ifndef ACS_SBSD
#define ACS_SBSD ACS_SBSS #define ACS_SBSD ACS_SBSS
......
...@@ -347,7 +347,7 @@ static void truncsp(char *str) ...@@ -347,7 +347,7 @@ static void truncsp(char *str)
uint c; uint c;
c=strlen(str); c=strlen(str);
while(c && (uchar)str[c-1]<=SP) c--; while(c && (uchar)str[c-1]<=' ') c--;
if(str[c]!=0) /* don't write to string constants */ if(str[c]!=0) /* don't write to string constants */
str[c]=0; str[c]=0;
} }
...@@ -1178,7 +1178,7 @@ int uinput(int mode, int left, int top, char *prompt, char *str, ...@@ -1178,7 +1178,7 @@ int uinput(int mode, int left, int top, char *prompt, char *str,
in_win[i++]=hclr|(bclr<<4); in_win[i++]=hclr|(bclr<<4);
if(plen) { if(plen) {
in_win[i++]=SP; in_win[i++]=' ';
in_win[i++]=lclr|(bclr<<4); in_win[i++]=lclr|(bclr<<4);
} }
...@@ -1193,7 +1193,7 @@ int uinput(int mode, int left, int top, char *prompt, char *str, ...@@ -1193,7 +1193,7 @@ int uinput(int mode, int left, int top, char *prompt, char *str,
} }
for(c=0;c<max+2;c++) { for(c=0;c<max+2;c++) {
in_win[i++]=SP; in_win[i++]=' ';
in_win[i++]=lclr|(bclr<<4); in_win[i++]=lclr|(bclr<<4);
} }
...@@ -1370,7 +1370,7 @@ int ugetstr(int left, int top, char *outstr, int max, long mode, int *lastkey) ...@@ -1370,7 +1370,7 @@ int ugetstr(int left, int top, char *outstr, int max, long mode, int *lastkey)
gettext(wherex(),y,wherex()+(j-i),y,buf); gettext(wherex(),y,wherex()+(j-i),y,buf);
puttext(wherex()-1,y,wherex()+(j-i)-1,y,buf); puttext(wherex()-1,y,wherex()+(j-i)-1,y,buf);
gotoxy(wherex()+(j-i),y); gotoxy(wherex()+(j-i),y);
putch(SP); putch(' ');
gotoxy(wherex()-((j-i)+2),y); gotoxy(wherex()-((j-i)+2),y);
i--; i--;
j--; j--;
...@@ -1387,7 +1387,7 @@ int ugetstr(int left, int top, char *outstr, int max, long mode, int *lastkey) ...@@ -1387,7 +1387,7 @@ int ugetstr(int left, int top, char *outstr, int max, long mode, int *lastkey)
gettext(wherex()+1,y,wherex()+(j-i),y,buf); gettext(wherex()+1,y,wherex()+(j-i),y,buf);
puttext(wherex(),y,wherex()+(j-i)-1,y,buf); puttext(wherex(),y,wherex()+(j-i)-1,y,buf);
gotoxy(wherex()+(j-i),y); gotoxy(wherex()+(j-i),y);
putch(SP); putch(' ');
gotoxy(wherex()-((j-i)+1),y); gotoxy(wherex()-((j-i)+1),y);
for(k=i;k<j;k++) for(k=i;k<j;k++)
str[k]=str[k+1]; str[k]=str[k+1];
...@@ -1446,7 +1446,7 @@ int ugetstr(int left, int top, char *outstr, int max, long mode, int *lastkey) ...@@ -1446,7 +1446,7 @@ int ugetstr(int left, int top, char *outstr, int max, long mode, int *lastkey)
} }
if(mode&K_ALPHA && !isalpha(ch)) if(mode&K_ALPHA && !isalpha(ch))
continue; continue;
if((ch>=SP || (ch==1 && mode&K_MSG)) && i<max && (!ins || j<max) && isprint(ch)) if((ch>=' ' || (ch==1 && mode&K_MSG)) && i<max && (!ins || j<max) && isprint(ch))
{ {
if(mode&K_UPPER) if(mode&K_UPPER)
ch=toupper(ch); ch=toupper(ch);
...@@ -1656,7 +1656,7 @@ void upop(char *str) ...@@ -1656,7 +1656,7 @@ void upop(char *str)
/* gettext(28,12,53,14,sav); */ /* gettext(28,12,53,14,sav); */
gettext((api->scrn_width-26+1)/2+1,(api->scrn_len-3+1)/2+1 gettext((api->scrn_width-26+1)/2+1,(api->scrn_len-3+1)/2+1
,(api->scrn_width+26-1)/2+1,(api->scrn_len+3-1)/2+1,sav); ,(api->scrn_width+26-1)/2+1,(api->scrn_len+3-1)/2+1,sav);
memset(buf,SP,25*3*2); memset(buf,' ',25*3*2);
for(i=1;i<26*3*2;i+=2) for(i=1;i<26*3*2;i+=2)
buf[i]=(hclr|(bclr<<4)); buf[i]=(hclr|(bclr<<4));
buf[0]=''; buf[0]='';
...@@ -1746,7 +1746,7 @@ void showbuf(int mode, int left, int top, int width, int height, char *title, ch ...@@ -1746,7 +1746,7 @@ void showbuf(int mode, int left, int top, int width, int height, char *title, ch
gettext(1,1,api->scrn_width,api->scrn_len,tmp_buffer); gettext(1,1,api->scrn_width,api->scrn_len,tmp_buffer);
if(!is_redraw) { if(!is_redraw) {
memset(tmp_buffer2,SP,width*height*2); memset(tmp_buffer2,' ',width*height*2);
for(i=1;i<width*height*2;i+=2) for(i=1;i<width*height*2;i+=2)
tmp_buffer2[i]=(hclr|(bclr<<4)); tmp_buffer2[i]=(hclr|(bclr<<4));
tmp_buffer2[0]=''; tmp_buffer2[0]='';
...@@ -1830,7 +1830,7 @@ void showbuf(int mode, int left, int top, int width, int height, char *title, ch ...@@ -1830,7 +1830,7 @@ void showbuf(int mode, int left, int top, int width, int height, char *title, ch
_setcursortype(cursor); _setcursortype(cursor);
return; return;
} }
memset(textbuf,SP,(width-2-pad-pad)*lines*2); memset(textbuf,' ',(width-2-pad-pad)*lines*2);
for(i=1;i<(width-2-pad-pad)*lines*2;i+=2) for(i=1;i<(width-2-pad-pad)*lines*2;i+=2)
textbuf[i]=(hclr|(bclr<<4)); textbuf[i]=(hclr|(bclr<<4));
i=0; i=0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment