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
......@@ -307,8 +307,8 @@ int cio_gettext(int sx, int sy, int ex, int ey, unsigned char *fill)
void textattr(unsigned char attr)
{
int attrs=A_NORMAL;
short colour;
chtype attrs=A_NORMAL;
int colour;
if (lastattr==attr)
return;
......@@ -327,6 +327,7 @@ void textattr(unsigned char attr)
#ifdef NCURSES_VERSION_MAJOR
color_set(colour,NULL);
#endif
/* bkgdset(colour); */
bkgdset(colour);
}
......@@ -366,7 +367,7 @@ int wherex(void)
void _putch(unsigned char ch, BOOL refresh_now)
{
int cha;
chtype cha;
if(!(mode&UIFC_IBM))
{
......@@ -527,9 +528,11 @@ void _putch(unsigned char ch, BOOL refresh_now)
cha=ch;
}
}
addch(cha);
if(ch == ' ')
addch(A_BOLD|' ');
else
addch(cha);
if(refresh_now)
refresh();
}
......@@ -537,7 +540,7 @@ void _putch(unsigned char ch, BOOL refresh_now)
int cprintf(char *fmat, ...)
{
va_list argptr;
char str[MAX_BFLN];
unsigned char str[MAX_BFLN];
int pos;
va_start(argptr,fmat);
......@@ -551,7 +554,7 @@ int cprintf(char *fmat, ...)
return(1);
}
void cputs(char *str)
void cputs(unsigned char *str)
{
int pos;
......@@ -585,6 +588,7 @@ void initciowrap(long inmode)
nonl();
keypad(stdscr, TRUE);
scrollok(stdscr,FALSE);
idcok(stdscr,FALSE);
raw();
/* Set up color pairs */
......
......@@ -61,7 +61,7 @@ int wherey(void);
int wherex(void);
void _putch(unsigned char ch, BOOL refresh_now);
int cprintf(char *fmat, ...);
void cputs(char *str);
void cputs(unsigned char *str);
void gotoxy(int x, int y);
void clrscr(void);
void initciowrap(long inmode);
......
/* $Id$ */
#include <ncurses.h>
#include <curses.h>
#ifndef ACS_SBSD
#define ACS_SBSD ACS_SBSS
......
......@@ -347,7 +347,7 @@ static void truncsp(char *str)
uint c;
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 */
str[c]=0;
}
......@@ -1178,7 +1178,7 @@ int uinput(int mode, int left, int top, char *prompt, char *str,
in_win[i++]=hclr|(bclr<<4);
if(plen) {
in_win[i++]=SP;
in_win[i++]=' ';
in_win[i++]=lclr|(bclr<<4);
}
......@@ -1193,7 +1193,7 @@ int uinput(int mode, int left, int top, char *prompt, char *str,
}
for(c=0;c<max+2;c++) {
in_win[i++]=SP;
in_win[i++]=' ';
in_win[i++]=lclr|(bclr<<4);
}
......@@ -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);
puttext(wherex()-1,y,wherex()+(j-i)-1,y,buf);
gotoxy(wherex()+(j-i),y);
putch(SP);
putch(' ');
gotoxy(wherex()-((j-i)+2),y);
i--;
j--;
......@@ -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);
puttext(wherex(),y,wherex()+(j-i)-1,y,buf);
gotoxy(wherex()+(j-i),y);
putch(SP);
putch(' ');
gotoxy(wherex()-((j-i)+1),y);
for(k=i;k<j;k++)
str[k]=str[k+1];
......@@ -1446,7 +1446,7 @@ int ugetstr(int left, int top, char *outstr, int max, long mode, int *lastkey)
}
if(mode&K_ALPHA && !isalpha(ch))
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)
ch=toupper(ch);
......@@ -1656,7 +1656,7 @@ void upop(char *str)
/* gettext(28,12,53,14,sav); */
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);
memset(buf,SP,25*3*2);
memset(buf,' ',25*3*2);
for(i=1;i<26*3*2;i+=2)
buf[i]=(hclr|(bclr<<4));
buf[0]='';
......@@ -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);
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)
tmp_buffer2[i]=(hclr|(bclr<<4));
tmp_buffer2[0]='';
......@@ -1830,7 +1830,7 @@ void showbuf(int mode, int left, int top, int width, int height, char *title, ch
_setcursortype(cursor);
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)
textbuf[i]=(hclr|(bclr<<4));
i=0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment