Replaced a part of color attributes from int type to vattr type
This commit is contained in:
@@ -267,7 +267,7 @@ void CfgColorname()
|
||||
ptr = strskip_wht(ptr);
|
||||
|
||||
Node cn;
|
||||
int color = atoi(ptr);
|
||||
vattr color = atoi(ptr);
|
||||
|
||||
// color was given
|
||||
*ptr = NUL;
|
||||
@@ -291,7 +291,7 @@ void CfgColorname()
|
||||
|
||||
strxcpy(cn.name, val, sizeof(cn.name));
|
||||
|
||||
CFG->colorname.push_back(std::pair<Node, int>(cn, color));
|
||||
CFG->colorname.push_back(std::pair<Node, vattr>(cn, color));
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
@@ -233,72 +233,72 @@ const word CRC_SCERROR = 0xAB65;
|
||||
// ------------------------------------------------------------------
|
||||
// Get color value
|
||||
|
||||
int GetColor(char* ink) {
|
||||
|
||||
vattr GetColor(char* ink)
|
||||
{
|
||||
word crc;
|
||||
int color=0;
|
||||
vattr color = BLACK|_BLACK;
|
||||
|
||||
crc = strCrc16(strupr(ink));
|
||||
switch(crc) {
|
||||
// Black is the default
|
||||
case CRC_BLACK:
|
||||
color = 0;
|
||||
color = BLACK|_BLACK;
|
||||
break;
|
||||
case CRC_BLUE:
|
||||
color = 1;
|
||||
color = BLUE|_BLACK;
|
||||
break;
|
||||
case CRC_GREEN:
|
||||
color = 2;
|
||||
color = GREEN|_BLACK;
|
||||
break;
|
||||
case CRC_CYAN:
|
||||
color = 3;
|
||||
color = CYAN|_BLACK;
|
||||
break;
|
||||
case CRC_RED:
|
||||
color = 4;
|
||||
color = RED|_BLACK;
|
||||
break;
|
||||
case CRC_MAGENTA:
|
||||
color = 5;
|
||||
color = MAGENTA|_BLACK;
|
||||
break;
|
||||
case CRC_BROWN:
|
||||
color = 6;
|
||||
color = BROWN|_BLACK;
|
||||
break;
|
||||
case CRC_LGRAY:
|
||||
case CRC_LGREY:
|
||||
case CRC_LIGHTGRAY:
|
||||
case CRC_LIGHTGREY:
|
||||
color = 7;
|
||||
color = LGREY|_BLACK;
|
||||
break;
|
||||
case CRC_DGRAY:
|
||||
case CRC_DGREY:
|
||||
case CRC_DARKGRAY:
|
||||
case CRC_DARKGREY:
|
||||
color = 8;
|
||||
color = DGREY|_BLACK;
|
||||
break;
|
||||
case CRC_LBLUE:
|
||||
case CRC_LIGHTBLUE:
|
||||
color = 9;
|
||||
color = LBLUE|_BLACK;
|
||||
break;
|
||||
case CRC_LGREEN:
|
||||
case CRC_LIGHTGREEN:
|
||||
color = 10;
|
||||
color = LGREEN|_BLACK;
|
||||
break;
|
||||
case CRC_LCYAN:
|
||||
case CRC_LIGHTCYAN:
|
||||
color = 11;
|
||||
color = LCYAN|_BLACK;
|
||||
break;
|
||||
case CRC_LRED:
|
||||
case CRC_LIGHTRED:
|
||||
color = 12;
|
||||
color = LRED|_BLACK;
|
||||
break;
|
||||
case CRC_LMAGENTA:
|
||||
case CRC_LIGHTMAGENTA:
|
||||
color = 13;
|
||||
color = LMAGENTA|_BLACK;
|
||||
break;
|
||||
case CRC_YELLOW:
|
||||
color = 14;
|
||||
color = YELLOW|_BLACK;
|
||||
break;
|
||||
case CRC_WHITE:
|
||||
color = 15;
|
||||
color = WHITE|_BLACK;
|
||||
break;
|
||||
case CRC_UNDERLINE:
|
||||
color = UNDERLINE;
|
||||
@@ -320,7 +320,7 @@ int GetColor(char* ink) {
|
||||
// ------------------------------------------------------------------
|
||||
// Evaluates a color string
|
||||
|
||||
int MakeColor(char* colors) {
|
||||
vattr MakeColor(char* colors) {
|
||||
|
||||
static int paper=0;
|
||||
int ink=0, blink;
|
||||
@@ -356,10 +356,10 @@ int MakeColor(char* colors) {
|
||||
|
||||
void GetColors(char* value) {
|
||||
|
||||
word crc;
|
||||
Win* wptr;
|
||||
int attr;
|
||||
char buf[256];
|
||||
word crc;
|
||||
Win* wptr;
|
||||
vattr attr;
|
||||
char buf[256];
|
||||
char* win;
|
||||
char* colors;
|
||||
char* part=NULL;
|
||||
|
@@ -562,8 +562,8 @@ struct MLst {
|
||||
time32_t arrived;
|
||||
time32_t received;
|
||||
char goldmark;
|
||||
int colorby;
|
||||
int colorto;
|
||||
vattr colorby;
|
||||
vattr colorto;
|
||||
};
|
||||
|
||||
|
||||
@@ -877,9 +877,9 @@ struct SaveUtil {
|
||||
// Window structure
|
||||
|
||||
struct Win {
|
||||
int btype; // Border type
|
||||
int c[16]; // Colors
|
||||
int w; // Window handle
|
||||
int btype; // Border type
|
||||
vattr c[16]; // Colors
|
||||
int w; // Window handle
|
||||
};
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
@@ -467,7 +467,7 @@ public:
|
||||
|
||||
void SelMaskPick::open() {
|
||||
|
||||
window.openxy(ypos, xpos, ylen+2, xlen+2, btype, battr, 7);
|
||||
window.openxy(ypos, xpos, ylen+2, xlen+2, btype, battr, LGREY);
|
||||
window.title(title, tattr);
|
||||
window.shadow(C_SHADOW);
|
||||
update();
|
||||
|
@@ -190,7 +190,7 @@ public:
|
||||
int beepyourmail;
|
||||
int carboncopylist; // cclist;
|
||||
Win color[16];
|
||||
std::vector< std::pair<Node, int> > colorname;
|
||||
std::vector< std::pair<Node, vattr> > colorname;
|
||||
Path confirmfile; // goldedcfm;
|
||||
int confirmresponse;
|
||||
Path cookiepath;
|
||||
|
@@ -192,7 +192,7 @@ void Area::DelMsgs(GMsg* msg) {
|
||||
if(delask) {
|
||||
if(msg->attr.uns() and not (msg->attr.rcv() or msg->attr.del())) {
|
||||
AA->LoadMsg(msg, msgno, CFG->dispmargin-(int)CFG->switches.get(disppagebar));
|
||||
w_progress(MODE_QUIT, 0, 0, 0, NULL);
|
||||
w_progress(MODE_QUIT, BLACK|_BLACK, 0, 0, NULL);
|
||||
HeaderView->Use(AA, msg);
|
||||
HeaderView->Paint();
|
||||
BodyView->Use(AA, msg, topline);
|
||||
@@ -213,7 +213,7 @@ void Area::DelMsgs(GMsg* msg) {
|
||||
}
|
||||
if(msg->attr.lok() and not dellocked and not deletethis) {
|
||||
AA->LoadMsg(msg, msgno, CFG->dispmargin-(int)CFG->switches.get(disppagebar));
|
||||
w_progress(MODE_QUIT, 0, 0, 0, NULL);
|
||||
w_progress(MODE_QUIT, BLACK|_BLACK, 0, 0, NULL);
|
||||
HeaderView->Use(AA, msg);
|
||||
HeaderView->Paint();
|
||||
BodyView->Use(AA, msg, topline);
|
||||
@@ -238,7 +238,7 @@ void Area::DelMsgs(GMsg* msg) {
|
||||
isreadmark = false;
|
||||
Mark.ResetAll();
|
||||
}
|
||||
w_progress(MODE_QUIT, 0, 0, 0, NULL);
|
||||
w_progress(MODE_QUIT, BLACK|_BLACK, 0, 0, NULL);
|
||||
}
|
||||
}
|
||||
if(n == 0) {
|
||||
|
@@ -85,7 +85,7 @@ inline bool isstylechar(char c) {
|
||||
return (c == '*') or (c == '/') or (c == '_') or (c == '#');
|
||||
}
|
||||
|
||||
void Container::StyleCodeHighlight(const char* text, int row, int col, bool dohide, int color) {
|
||||
void Container::StyleCodeHighlight(const char* text, int row, int col, bool dohide, vattr color) {
|
||||
|
||||
uint sclen = 0;
|
||||
const char* txptr = text;
|
||||
|
@@ -31,13 +31,13 @@
|
||||
|
||||
class Container {
|
||||
|
||||
virtual void prints(int, int, int, const char*) = 0;
|
||||
virtual void prints(int, int, vattr, const char*) = 0;
|
||||
|
||||
public:
|
||||
|
||||
virtual ~Container() { }
|
||||
|
||||
void StyleCodeHighlight(const char* text, int row, int col, bool dohide, int color);
|
||||
void StyleCodeHighlight(const char* text, int row, int col, bool dohide, vattr color);
|
||||
};
|
||||
|
||||
|
||||
|
@@ -262,7 +262,7 @@ static void WriteMsgs(GMsg* msg) {
|
||||
|
||||
remove(fname);
|
||||
}
|
||||
w_progress(MODE_QUIT, 0, 0, 0, NULL);
|
||||
w_progress(MODE_QUIT, BLACK|_BLACK, 0, 0, NULL);
|
||||
}
|
||||
else if(source == WRITE_CURRENT) {
|
||||
if(target & WRITE_FILE) {
|
||||
|
@@ -147,7 +147,7 @@ void Cleanup(void) {
|
||||
}
|
||||
|
||||
// Reset border color
|
||||
if(C_BACKB != 0)
|
||||
if (C_BACKB != (BLACK|_BLACK))
|
||||
gvid->setoverscan(gvid->orig.color.overscan);
|
||||
|
||||
wcloseall(); // Close all windows
|
||||
@@ -215,7 +215,7 @@ void Cleanup(void) {
|
||||
// ------------------------------------------------------------------
|
||||
// Multipurpose DOS shell function
|
||||
|
||||
int ShellToDos(char* command, char* message, int cls, int cursor, int pause) {
|
||||
int ShellToDos(char* command, char* message, vattr cls, int cursor, int pause) {
|
||||
|
||||
int error = 0;
|
||||
|
||||
@@ -292,11 +292,11 @@ int ShellToDos(char* command, char* message, int cls, int cursor, int pause) {
|
||||
gvid->setmode(gvid->orig.screen.mode);
|
||||
|
||||
// Clear screen
|
||||
if(cls)
|
||||
if (cls != (BLACK|_BLACK))
|
||||
vclrscr(cls);
|
||||
|
||||
// Reset border color
|
||||
if(C_BACKB != 0)
|
||||
if (C_BACKB != (BLACK|_BLACK))
|
||||
gvid->setoverscan(gvid->orig.color.overscan);
|
||||
|
||||
// Turn on the blinking attributes
|
||||
@@ -314,10 +314,9 @@ int ShellToDos(char* command, char* message, int cls, int cursor, int pause) {
|
||||
#endif
|
||||
|
||||
// Return cursor into 1st column
|
||||
if(cls) puts("");
|
||||
if (cls != (BLACK|_BLACK)) puts("");
|
||||
// Write message on screen
|
||||
if(*message)
|
||||
puts(message);
|
||||
if(*message) puts(message);
|
||||
|
||||
// Turn on cursor
|
||||
int yy, xx;
|
||||
@@ -405,7 +404,7 @@ int ShellToDos(char* command, char* message, int cls, int cursor, int pause) {
|
||||
gvid->setintensity(CFG->intensecolors);
|
||||
|
||||
// Restore border color
|
||||
if(C_BACKB != 0)
|
||||
if (C_BACKB != (BLACK|_BLACK))
|
||||
gvid->setoverscan(C_BACKB);
|
||||
|
||||
// Set palette if changes were specified
|
||||
|
@@ -130,7 +130,7 @@ void IEclass::setlinetype(Line* __line) {
|
||||
// ------------------------------------------------------------------
|
||||
// Zero-based
|
||||
|
||||
int IEclass::dispchar(vchar __ch, int attr) {
|
||||
vattr IEclass::dispchar(vchar __ch, vattr attr) {
|
||||
|
||||
if(__ch == NUL) // possible if line empty
|
||||
__ch = ' ';
|
||||
@@ -141,10 +141,10 @@ int IEclass::dispchar(vchar __ch, int attr) {
|
||||
__ch = EDIT->CharSpace();
|
||||
}
|
||||
|
||||
int atr;
|
||||
vattr atr;
|
||||
vchar chr;
|
||||
editwin.getc(crow, ccol, &atr, &chr);
|
||||
editwin.printc(crow, ccol, attr == -1 ? atr : attr, __ch);
|
||||
editwin.printc(crow, ccol, attr == DEFATTR ? atr : attr, __ch);
|
||||
return atr;
|
||||
}
|
||||
|
||||
@@ -186,7 +186,7 @@ void IEclass::scrolldown(int __scol, int __srow, int __ecol, int __erow, int __l
|
||||
// ------------------------------------------------------------------
|
||||
// Zero-based
|
||||
|
||||
void IEclass::prints(int wrow, int wcol, int atr, const char* str) {
|
||||
void IEclass::prints(int wrow, int wcol, vattr atr, const char* str) {
|
||||
|
||||
editwin.prints(wrow, wcol, atr, str);
|
||||
}
|
||||
@@ -290,7 +290,7 @@ void IEclass::dispstringsc(char *__buf, uint __beg, uint __end, uint __row, uint
|
||||
{
|
||||
char savechar = __buf[bend];
|
||||
__buf[bend] = NUL;
|
||||
StyleCodeHighlight(__buf+bbeg, __row, __col+bbeg-__beg, false, -1);
|
||||
StyleCodeHighlight(__buf+bbeg, __row, __col+bbeg-__beg, false, DEFATTR);
|
||||
__buf[bend] = savechar;
|
||||
|
||||
bbeg = bend; bend += scpos;
|
||||
@@ -313,7 +313,7 @@ void IEclass::dispstringsc(char *__buf, uint __beg, uint __end, uint __row, uint
|
||||
}
|
||||
|
||||
if (bbeg < bend)
|
||||
StyleCodeHighlight(__buf+bbeg, __row, __col+bbeg-__beg, false, -1);
|
||||
StyleCodeHighlight(__buf+bbeg, __row, __col+bbeg-__beg, false, DEFATTR);
|
||||
}
|
||||
|
||||
|
||||
@@ -414,7 +414,7 @@ void IEclass::dispstring(Line* line, uint __row)
|
||||
dispstringsc(_buf, 0, begblock, __row, mincol, savechar);
|
||||
}
|
||||
else
|
||||
StyleCodeHighlight(_buf, __row, mincol, false, -1);
|
||||
StyleCodeHighlight(_buf, __row, mincol, false, DEFATTR);
|
||||
|
||||
_buf[begblock] = savechar;
|
||||
}
|
||||
@@ -443,7 +443,7 @@ void IEclass::dispstring(Line* line, uint __row)
|
||||
dispstringsc(_buf, endblock, maxcol+1, __row, mincol+endblock, 0);
|
||||
}
|
||||
else
|
||||
StyleCodeHighlight(_buf+endblock, __row, mincol+endblock, false, -1);
|
||||
StyleCodeHighlight(_buf+endblock, __row, mincol+endblock, false, DEFATTR);
|
||||
}
|
||||
|
||||
GFTRK(NULL);
|
||||
@@ -2913,7 +2913,7 @@ int IEclass::Start(int __mode, uint* __position, GMsg* __msg) {
|
||||
gotorowcol(col, row);
|
||||
batch_mode = 0;
|
||||
|
||||
int backattr = 0;
|
||||
vattr backattr = BLACK|_BLACK;
|
||||
if(blockcol == -1) {
|
||||
backattr = dispchar(currline->txt.c_str()[col], C_READC);
|
||||
gotorowcol(col, row);
|
||||
|
@@ -295,7 +295,7 @@ protected:
|
||||
void cursoroff ();
|
||||
void cursoron ();
|
||||
void deleteline (bool zapquotesbelow = false);
|
||||
int dispchar (vchar __ch, int attr=-1);
|
||||
vattr dispchar (vchar __ch, vattr attr = DEFATTR);
|
||||
void dispins ();
|
||||
void dispdl ();
|
||||
void displine (Line* __line, uint __row);
|
||||
@@ -320,7 +320,7 @@ protected:
|
||||
int isempty (Line* __line=NULL);
|
||||
void killkillbuf ();
|
||||
void killpastebuf ();
|
||||
void prints (int wrow, int wcol, int atr, const char* str);
|
||||
void prints (int wrow, int wcol, vattr atr, const char* str);
|
||||
int reflowok (char* __qstr);
|
||||
void refresh (Line* __currline, uint __row);
|
||||
void savefile (int __status);
|
||||
|
@@ -949,7 +949,7 @@ void IEclass::editimport(Line* __line, char* __filename, bool imptxt) {
|
||||
isPipe = YES;
|
||||
mktemp(strxcpy(tmpfile, AddPath(CFG->temppath, "GIXXXXXX"), sizeof(Path)));
|
||||
strxmerge(cmdline, sizeof(Path), filenamebuf.c_str()+1, " > ", tmpfile, NULL);
|
||||
ShellToDos(cmdline, "", NO, NO);
|
||||
ShellToDos(cmdline, "", BLACK|_BLACK, NO);
|
||||
filenamebuf = tmpfile;
|
||||
fileselected = true;
|
||||
} else {
|
||||
|
@@ -608,7 +608,7 @@ void CreateFileMsgs(int mode, GMsg* msg) {
|
||||
msg->TextToLines(CFG->dispmargin);
|
||||
|
||||
if(specfiles > 1)
|
||||
w_progress(MODE_QUIT, 0, 0, 0, NULL);
|
||||
w_progress(MODE_QUIT, BLACK|_BLACK, 0, 0, NULL);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -83,7 +83,7 @@ void FindHdr(GMsg* msg, int& topline, int& keyok) {
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
bool SearchHighlight(const Line*, int, int, int) {
|
||||
bool SearchHighlight(const Line*, int, int, vattr) {
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -181,7 +181,7 @@ bool FindString(GMsg* msg, const char* prompt, int what) {
|
||||
AA->set_lastread(last);
|
||||
}
|
||||
|
||||
w_progress(MODE_QUIT, 0, 0, 0, NULL);
|
||||
w_progress(MODE_QUIT, BLACK|_BLACK, 0, 0, NULL);
|
||||
|
||||
if(breakloop)
|
||||
HandleGEvent(EVTT_BREAKLOOP);
|
||||
|
@@ -46,9 +46,9 @@ Subj information = "";
|
||||
|
||||
Area* AA = NULL;
|
||||
|
||||
char m_title[80]; // Menu title string
|
||||
int m_titlepos; // Menu title position
|
||||
int m_titleattr; // Menu title color
|
||||
char m_title[80]; // Menu title string
|
||||
int m_titlepos; // Menu title position
|
||||
vattr m_titleattr; // Menu title color
|
||||
|
||||
int AreaKeys = 0;
|
||||
int ReadKeys = 0;
|
||||
|
@@ -100,9 +100,9 @@ extern Subj information;
|
||||
|
||||
extern Area* AA;
|
||||
|
||||
extern char m_title[];
|
||||
extern int m_titlepos;
|
||||
extern int m_titleattr;
|
||||
extern char m_title[];
|
||||
extern int m_titlepos;
|
||||
extern vattr m_titleattr;
|
||||
|
||||
extern int AreaKeys, ReadKeys, ListKeys, NodeKeys, EditKeys, FileKeys, AddressbookKeys, HeaderKeys;
|
||||
extern std::list<CmdKey>::iterator AreaKey, ReadKey, ListKey, NodeKey, EditKey, FileKey, AddressbookKey, HeaderKey;
|
||||
|
@@ -786,7 +786,7 @@ void Initialize(int argc, char* argv[]) {
|
||||
|
||||
gvid->setintensity(CFG->intensecolors);
|
||||
|
||||
if(C_BACKB != 0)
|
||||
if (C_BACKB != (BLACK|_BLACK))
|
||||
gvid->setoverscan(C_BACKB);
|
||||
|
||||
vcurhide();
|
||||
|
@@ -210,8 +210,8 @@ void GMsgList::ReadMlst(int n) {
|
||||
strcpy(ml->re, msg.re);
|
||||
|
||||
{ Addr zero;
|
||||
ml->colorby = GetColorName(ml->by, msg.orig, -1);
|
||||
ml->colorto = GetColorName(ml->to, AA->isnet() ? msg.dest : zero, -1);
|
||||
ml->colorby = GetColorName(ml->by, msg.orig, DEFATTR);
|
||||
ml->colorto = GetColorName(ml->to, AA->isnet() ? msg.dest : zero, DEFATTR);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -294,7 +294,7 @@ void GMsgList::print_line(uint idx, uint pos, bool isbar) {
|
||||
|
||||
update_marks(ml);
|
||||
|
||||
int wattr_, hattr_, mattr_;
|
||||
vattr wattr_, hattr_, mattr_;
|
||||
if(isbar) {
|
||||
wattr_ = sattr;
|
||||
hattr_ = sattr;
|
||||
@@ -353,16 +353,16 @@ void GMsgList::print_line(uint idx, uint pos, bool isbar) {
|
||||
if (ml->high & (MLST_HIGH_BOOK|MLST_HIGH_MARK))
|
||||
window.prints(pos, 5, mattr_, ml->marks);
|
||||
|
||||
if ((ml->high & MLST_HIGH_FROM) || (ml->colorby != -1))
|
||||
if ((ml->high & MLST_HIGH_FROM) || (ml->colorby != DEFATTR))
|
||||
{
|
||||
int color = ((ml->colorby != -1) && !isbar) ? ml->colorby : hattr_;
|
||||
vattr color = ((ml->colorby != DEFATTR) && !isbar) ? ml->colorby : hattr_;
|
||||
window.printns(pos, bycol, color, ml->by, bysiz);
|
||||
}
|
||||
|
||||
if (((ml->high & MLST_HIGH_TO) || (ml->colorto != -1)) &&
|
||||
if (((ml->high & MLST_HIGH_TO) || (ml->colorto != DEFATTR)) &&
|
||||
!AA->Msglistwidesubj())
|
||||
{
|
||||
int color = ((ml->colorto != -1) && !isbar) ? ml->colorto : hattr_;
|
||||
vattr color = ((ml->colorto != DEFATTR) && !isbar) ? ml->colorto : hattr_;
|
||||
window.printns(pos, tocol, color, ml->to, tosiz);
|
||||
}
|
||||
|
||||
@@ -733,7 +733,7 @@ public:
|
||||
|
||||
void GThreadlist::open() {
|
||||
|
||||
window.openxy(ypos, xpos, ylen+2, xlen+2, btype, battr, 7);
|
||||
window.openxy(ypos, xpos, ylen+2, xlen+2, btype, battr, LGREY);
|
||||
update_title();
|
||||
|
||||
center(CFG->displistcursor);
|
||||
@@ -886,7 +886,7 @@ void GThreadlist::print_line(uint idx, uint pos, bool isbar) {
|
||||
AA->LoadMsg(&msg, t.msgno, CFG->dispmargin-(int)CFG->switches.get(disppagebar));
|
||||
}
|
||||
|
||||
int attrh, attrw;
|
||||
vattr attrh, attrw;
|
||||
if(msg.attr.uns() and not msg.attr.rcv() and not msg.attr.del()) {
|
||||
attrw = C_MENUW_UNSENT;
|
||||
attrh = C_MENUQ_UNSENTHIGH;
|
||||
@@ -950,7 +950,7 @@ void GThreadlist::print_line(uint idx, uint pos, bool isbar) {
|
||||
window.prints(pos, 8, isbar ? (sattr|ACSET) : (wattr|ACSET), buf);
|
||||
}
|
||||
|
||||
int attr = attrw;
|
||||
vattr attr = attrw;
|
||||
|
||||
for(std::vector<Node>::iterator x = CFG->username.begin(); x != CFG->username.end(); x++)
|
||||
if(strieql(msg.By(), x->name)) {
|
||||
|
@@ -32,7 +32,7 @@
|
||||
void GMnuAsk::AskInit(int __row, int __col, char* __title, int __help) {
|
||||
|
||||
Init();
|
||||
SetColor(C_ASKW, C_ASKQ, C_ASKN, C_ASKS, CFG->switches.get(screenshadows) ? C_SHADOW : -1);
|
||||
SetColor(C_ASKW, C_ASKQ, C_ASKN, C_ASKS, CFG->switches.get(screenshadows) ? C_SHADOW : DEFATTR);
|
||||
SetTitle(__title, C_ASKT);
|
||||
SetBorder(W_BASK, C_ASKB);
|
||||
SetPos(__row, __col);
|
||||
@@ -884,7 +884,7 @@ int GMenuEditHeader::Run(int mode, GMsg* msg) {
|
||||
if(EDIT->Menu()) {
|
||||
|
||||
Init();
|
||||
SetColor(C_MENUW, C_MENUQ, C_MENUN, C_MENUS, CFG->switches.get(screenshadows) ? C_SHADOW : -1);
|
||||
SetColor(C_MENUW, C_MENUQ, C_MENUN, C_MENUS, CFG->switches.get(screenshadows) ? C_SHADOW : DEFATTR);
|
||||
SetTitle(LNG->MsgOptions, C_MENUT);
|
||||
SetBorder(W_BMENU, C_MENUB);
|
||||
SetPos(6, 0);
|
||||
@@ -1014,7 +1014,7 @@ int GMenuNavigate::Run() {
|
||||
|
||||
Begin(M_HORZ);
|
||||
SetBorder(W_BASK, C_ASKB);
|
||||
SetColor(C_ASKW, C_ASKQ, C_ASKN, C_ASKS, CFG->switches.get(screenshadows) ? C_SHADOW : -1);
|
||||
SetColor(C_ASKW, C_ASKQ, C_ASKN, C_ASKS, CFG->switches.get(screenshadows) ? C_SHADOW : DEFATTR);
|
||||
Item(TAG_MAIN, LNG->MMMain);
|
||||
BeginPullDown();
|
||||
Item(TAG_MAIN_SHELL, LNG->MMShell);
|
||||
@@ -1095,7 +1095,7 @@ int GMenuSChecker::Run(CSpellChecker &schecker, const char *word)
|
||||
}
|
||||
|
||||
Init();
|
||||
SetColor(C_ASKW, C_ASKQ, C_ASKN, C_ASKS, CFG->switches.get(screenshadows) ? C_SHADOW : -1);
|
||||
SetColor(C_ASKW, C_ASKQ, C_ASKN, C_ASKS, CFG->switches.get(screenshadows) ? C_SHADOW : DEFATTR);
|
||||
SetTitle(title.c_str(), C_ASKT, TLEFT);
|
||||
SetPos(6, 0, title.length()+2, 0);
|
||||
SetBorder(W_BASK, C_ASKB);
|
||||
|
@@ -209,7 +209,7 @@ void MarkMsgs_Txt(int item, char* markstring) {
|
||||
}
|
||||
}
|
||||
|
||||
w_progress(MODE_QUIT, 0, 0, 0, NULL);
|
||||
w_progress(MODE_QUIT, BLACK|_BLACK, 0, 0, NULL);
|
||||
|
||||
ResetMsg(msg);
|
||||
throw_free(msg);
|
||||
|
@@ -49,20 +49,20 @@ class NodelistBrowser {
|
||||
|
||||
public:
|
||||
|
||||
int ypos; // Window Starting Row
|
||||
int xpos; // Window Starting Column
|
||||
int ylen; // Window Height
|
||||
int xlen; // Window Width
|
||||
int btype; // Window Border Type
|
||||
int battr; // Window Border Color
|
||||
int wattr; // Window Color
|
||||
int tattr; // Window Title Color
|
||||
int sattr; // Window Selection Bar Color
|
||||
int hattr; // Window Highlight Color
|
||||
int loattr; // Window LoAttr Color
|
||||
int sbattr; // Window Scrollbar Color
|
||||
char* title; // Window Title
|
||||
int helpcat; // Window Help Category
|
||||
int ypos; // Window Starting Row
|
||||
int xpos; // Window Starting Column
|
||||
int ylen; // Window Height
|
||||
int xlen; // Window Width
|
||||
int btype; // Window Border Type
|
||||
vattr battr; // Window Border Color
|
||||
vattr wattr; // Window Color
|
||||
vattr tattr; // Window Title Color
|
||||
vattr sattr; // Window Selection Bar Color
|
||||
vattr hattr; // Window Highlight Color
|
||||
vattr loattr; // Window LoAttr Color
|
||||
vattr sbattr; // Window Scrollbar Color
|
||||
char* title; // Window Title
|
||||
int helpcat; // Window Help Category
|
||||
|
||||
int pos; // Display Pos (1 to maxpos)
|
||||
int maxpos; // Display Pos
|
||||
|
@@ -77,11 +77,11 @@ void LoadLanguage(const char* file);
|
||||
// ------------------------------------------------------------------
|
||||
// GCMISC prototypes
|
||||
|
||||
int ReadHelpCfg(int force);
|
||||
int GetColor(char* ink);
|
||||
int MakeColor(char* colors);
|
||||
void GetColors(char* value);
|
||||
void ReadXlatTables();
|
||||
int ReadHelpCfg(int force);
|
||||
vattr GetColor(char* ink);
|
||||
vattr MakeColor(char* colors);
|
||||
void GetColors(char* value);
|
||||
void ReadXlatTables();
|
||||
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
@@ -118,7 +118,7 @@ void SaveLines(int mode, const char* savefile, GMsg* msg, int margin, bool clip=
|
||||
// GEDOSS prototypes
|
||||
|
||||
void Cleanup(void);
|
||||
int ShellToDos(char* command, char* message, int cls, int cursor, int pause=NO);
|
||||
int ShellToDos(char* command, char* message, vattr cls, int cursor, int pause=NO);
|
||||
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
@@ -142,7 +142,7 @@ void FileSelect(GMsg* msg, char* title, FileSpec* fspec);
|
||||
bool FindString(GMsg* msg, const char* prompt, int what);
|
||||
void FindAll(GMsg* msg, int& topline, int& keyok);
|
||||
void FindHdr(GMsg* msg, int& topline, int& keyok);
|
||||
bool SearchHighlight(const Line* line, int row, int width, int highlight_color);
|
||||
bool SearchHighlight(const Line* line, int row, int width, vattr highlight_color);
|
||||
void SearchExit();
|
||||
void AdvancedSearch(GMsg* msg, int& topline, int& keyok);
|
||||
|
||||
@@ -405,21 +405,21 @@ int ReadCfg(const char* cfg, int ignoreunknown=false);
|
||||
void ScanMsgTxtForAddr(GMsg* msg);
|
||||
gkey SearchKey(gkey key, std::list<CmdKey>::iterator keys, int totkeys);
|
||||
int SearchTaglist(Echo* taglist, char* tag);
|
||||
void set_title(const char* t, int p, int a);
|
||||
void set_title(const char* t, int p, vattr a);
|
||||
void title_shadow();
|
||||
void update_statusline(const char* info);
|
||||
void update_statuslinef(const char* format, const char *token, ...) __attribute__ ((format (printf, 1, 3)));
|
||||
void update_statuslines();
|
||||
void w_info(const char* info=NULL);
|
||||
void w_infof(const char* format, ...) __attribute__ ((format (printf, 1, 2)));
|
||||
void w_progress(int mode, int attr, long pos, long size, const char* title);
|
||||
void w_progress(int mode, vattr attr, long pos, long size, const char* title);
|
||||
void w_shadow();
|
||||
void ZonegateIt(ftn_addr& gate, ftn_addr& orig, ftn_addr& dest);
|
||||
char* strtmp(const char* str);
|
||||
int quotecolor(const char* line);
|
||||
vattr quotecolor(const char* line);
|
||||
void doinvalidate(char* text, const char* find, const char* replace, bool is_tearline = false);
|
||||
bool find(const std::vector<const char *> &vec, const char *str);
|
||||
int GetColorName(const char *name, Addr &addr, int color);
|
||||
vattr GetColorName(const char *name, Addr &addr, vattr color);
|
||||
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
@@ -567,7 +567,7 @@ int ExternUtil(GMsg *msg, ExtUtil *extutil) {
|
||||
pauseval = 1;
|
||||
|
||||
ShellToDos(cmdline, "",
|
||||
extutil->options & EXTUTIL_CLS ? LGREY|_BLACK : 0,
|
||||
extutil->options & EXTUTIL_CLS ? LGREY|_BLACK : BLACK|_BLACK,
|
||||
extutil->options & EXTUTIL_CURSOR,
|
||||
pauseval
|
||||
);
|
||||
@@ -777,7 +777,7 @@ void ReadPeekURLs(GMsg* msg) {
|
||||
pauseval = 1;
|
||||
|
||||
ShellToDos(cmdline, "",
|
||||
CFG->urlhandler.options & EXTUTIL_CLS ? LGREY|_BLACK : 0,
|
||||
CFG->urlhandler.options & EXTUTIL_CLS ? LGREY|_BLACK : BLACK|_BLACK,
|
||||
CFG->urlhandler.options & EXTUTIL_CURSOR,
|
||||
pauseval
|
||||
);
|
||||
@@ -827,7 +827,7 @@ void UUDecode(GMsg* msg) {
|
||||
SaveLines(overwrite ? MODE_WRITE : MODE_APPEND, infile, msg, 79);
|
||||
}
|
||||
if(AA->Mark.Count())
|
||||
w_progress(MODE_QUIT, 0, 0, 0, NULL);
|
||||
w_progress(MODE_QUIT, BLACK|_BLACK, 0, 0, NULL);
|
||||
}
|
||||
else if(source == WRITE_CURRENT) {
|
||||
AA->LoadMsg(msg, msg->msgno, 79);
|
||||
@@ -903,7 +903,7 @@ void Make_Userlist(const char* userlist) {
|
||||
}
|
||||
}
|
||||
throw_free(crclist);
|
||||
w_progress(MODE_QUIT, 0, 0, 0, NULL);
|
||||
w_progress(MODE_QUIT, BLACK|_BLACK, 0, 0, NULL);
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
@@ -982,7 +982,7 @@ void make_pathreport(const char* reportfile) {
|
||||
fp.printf("%s\n", path.c_str());
|
||||
}
|
||||
}
|
||||
w_progress(MODE_QUIT, 0, 0, 0, NULL);
|
||||
w_progress(MODE_QUIT, BLACK|_BLACK, 0, 0, NULL);
|
||||
fp.fclose();
|
||||
ResetMsg(msg);
|
||||
throw_free(msg);
|
||||
|
@@ -429,9 +429,9 @@ void search_mgr_form::select(gstrarray& menu, const char* title) {
|
||||
|
||||
GMnu m;
|
||||
m.Init();
|
||||
m.SetColor(7, 7, 7, 112, 8);
|
||||
m.SetTitle(title, 14);
|
||||
m.SetBorder(0, 7);
|
||||
m.SetColor(LGREY, LGREY, LGREY, _LGREY, DGREY);
|
||||
m.SetTitle(title, YELLOW);
|
||||
m.SetBorder(0, LGREY);
|
||||
m.SetPos(srow, scol);
|
||||
m.SetMask(0);
|
||||
m.Begin();
|
||||
@@ -520,20 +520,20 @@ bool search_mgr_form::validate() {
|
||||
|
||||
void AdvancedSearch(GMsg*, int&, int&) {
|
||||
|
||||
int patterns = 9;
|
||||
int width = 77;
|
||||
int height = patterns+11;
|
||||
int widths[3] = { 55, 5, 7 };
|
||||
int field_widths[3] = { 100, 5, 7 };
|
||||
int border_type = BT_SINGLE;
|
||||
int title_color = YELLOW | _BLUE;
|
||||
int heading_color = YELLOW | _BLUE;
|
||||
int window_color = LGREY | _BLUE;
|
||||
int border_color = LBLUE | _BLUE;
|
||||
int edit_color = YELLOW | _BLUE;
|
||||
int idle_color = LGREY | _BLUE;
|
||||
int active_color = WHITE | _BLUE;
|
||||
int shadow_color = DGREY | _BLACK;
|
||||
int patterns = 9;
|
||||
int width = 77;
|
||||
int height = patterns+11;
|
||||
int widths[3] = { 55, 5, 7 };
|
||||
int field_widths[3] = { 100, 5, 7 };
|
||||
int border_type = BT_SINGLE;
|
||||
vattr title_color = YELLOW | _BLUE;
|
||||
vattr heading_color = YELLOW | _BLUE;
|
||||
vattr window_color = LGREY | _BLUE;
|
||||
vattr border_color = LBLUE | _BLUE;
|
||||
vattr edit_color = YELLOW | _BLUE;
|
||||
vattr idle_color = LGREY | _BLUE;
|
||||
vattr active_color = WHITE | _BLUE;
|
||||
vattr shadow_color = DGREY | _BLACK;
|
||||
|
||||
widths[0] = width - 3*2 - 2 - 5 - 7 - 2;
|
||||
|
||||
|
@@ -167,7 +167,7 @@ void guserbase::unlock() {
|
||||
|
||||
void guserbase::open() {
|
||||
|
||||
window.openxy(ypos, xpos, ylen+2, xlen+2, btype, battr, 7);
|
||||
window.openxy(ypos, xpos, ylen+2, xlen+2, btype, battr, LGREY);
|
||||
cwidth = (xlen-28) / 2;
|
||||
|
||||
window.message(LNG->UserHeaderName, TP_BORD, 3, tattr);
|
||||
|
@@ -253,7 +253,7 @@ void w_infof(const char* format, ...) {
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
void w_progress(int mode, int attr, long pos, long size, const char* title) {
|
||||
void w_progress(int mode, vattr attr, long pos, long size, const char* title) {
|
||||
|
||||
static int wh = -1;
|
||||
static long prev_pos = 0;
|
||||
@@ -313,7 +313,7 @@ int maketitle_and_status(char *dir) {
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
void set_title(const char* t, int p, int a) {
|
||||
void set_title(const char* t, int p, vattr a) {
|
||||
|
||||
strcpy(m_title, t);
|
||||
m_titlepos = p;
|
||||
@@ -490,7 +490,7 @@ bool is_quote2(Line* line, const char* ptr)
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
int quotecolor(const char* line) {
|
||||
vattr quotecolor(const char* line) {
|
||||
|
||||
char buf[MAXQUOTELEN];
|
||||
uint len;
|
||||
|
@@ -283,9 +283,9 @@ void ScreenBlankIdle() {
|
||||
if(blanked and (whb == -1)) {
|
||||
wascurhid = vcurhidden();
|
||||
vcurhide();
|
||||
if(C_BACKB != 0)
|
||||
gvid->setoverscan(0);
|
||||
whb = wopen(0,0,MAXROW-1,MAXCOL-1, 5, 7, 7);
|
||||
if (C_BACKB != (BLACK|_BLACK))
|
||||
gvid->setoverscan(BLACK|_BLACK);
|
||||
whb = wopen(0,0,MAXROW-1,MAXCOL-1, 5, LGREY, LGREY);
|
||||
if(CFG->screenblankertype == BLANK_SLIDEWIN)
|
||||
whh = wopen_(ry, rx, windowheight, blankmsglen+2, W_BINFO, C_INFOB, C_INFOW);
|
||||
lastmoved = gkbd.tickvalue;
|
||||
@@ -300,7 +300,7 @@ void ScreenBlankIdle() {
|
||||
wactiv_(whb);
|
||||
wclose();
|
||||
whb = -1;
|
||||
if(C_BACKB != 0)
|
||||
if (C_BACKB != (BLACK|_BLACK))
|
||||
gvid->setoverscan(C_BACKB);
|
||||
if(wascurhid)
|
||||
vcurhide();
|
||||
@@ -330,7 +330,7 @@ void ScreenBlankIdle() {
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
int GetColorName(const char *name, Addr &addr, int color)
|
||||
vattr GetColorName(const char *name, Addr &addr, vattr color)
|
||||
{
|
||||
bool addr_valid = addr.valid();
|
||||
bool name_valid = (name != NULL);
|
||||
@@ -338,7 +338,7 @@ int GetColorName(const char *name, Addr &addr, int color)
|
||||
if (!addr_valid && !name_valid)
|
||||
return color;
|
||||
|
||||
std::vector< std::pair<Node, int> >::iterator it;
|
||||
std::vector< std::pair<Node, vattr> >::iterator it;
|
||||
for (it = CFG->colorname.begin(); it != CFG->colorname.end(); it++)
|
||||
{
|
||||
if (addr_valid && addr.match(it->first.addr))
|
||||
|
@@ -214,7 +214,7 @@ void GMsgHeaderView::Paint() {
|
||||
strsetsz(buf, nodegenerated ? namewidth : (namewidth+nodewidth));
|
||||
|
||||
window.prints(2, 0, window_color, LNG->From);
|
||||
int color = ((msg->foundwhere&GFIND_FROM) or msg->attr.fmu() or (msg->attr.loc() and CFG->switches.get(displocalhigh))) ? highlight_color : from_color;
|
||||
vattr color = ((msg->foundwhere&GFIND_FROM) or msg->attr.fmu() or (msg->attr.loc() and CFG->switches.get(displocalhigh))) ? highlight_color : from_color;
|
||||
color = GetColorName(msg->By(), msg->orig, color);
|
||||
window.prints(2, CFG->disphdrnameset.pos, color, buf);
|
||||
|
||||
@@ -451,7 +451,7 @@ void GMsgBodyView::Use(Area *areaptr, GMsg *msgptr, int startline) {
|
||||
|
||||
scrollbar_visible = CFG->switches.get(disppagebar) ? (msg->lines > height) : false;
|
||||
visible_width = scrollbar_visible ? width-1 : width;
|
||||
window.set_scrollbar_color(scrollbar_visible ? scrollbar_color : -1);
|
||||
window.set_scrollbar_color(scrollbar_visible ? scrollbar_color : DEFATTR);
|
||||
}
|
||||
|
||||
|
||||
@@ -463,7 +463,7 @@ void GMsgBodyView::PaintLine(int row, Line *line) {
|
||||
int vrow = gwin.active->srow + row;
|
||||
uint llen = line->txt.length();
|
||||
|
||||
int color = (line->type & GLINE_HIGH) ? highlight_color : line->color;
|
||||
vattr color = (line->type & GLINE_HIGH) ? highlight_color : line->color;
|
||||
|
||||
// Trim line if it longer than should be. This actually happens in very rare
|
||||
// cases, but always when hex dump displayed.
|
||||
@@ -475,16 +475,16 @@ void GMsgBodyView::PaintLine(int row, Line *line) {
|
||||
// Print it
|
||||
if(not SearchHighlight(line, vrow, visible_width, highlight_color)) {
|
||||
if(line->type & GLINE_ORIG and strneql(line->txt.c_str(), " * Origin: ", 11)) {
|
||||
vputs(vrow, 0, color, " * Origin: ");
|
||||
prints(vrow, 0, color, " * Origin: ");
|
||||
StyleCodeHighlight(line->txt.c_str()+11, vrow, 11, not AA->attr().hex() and AA->adat->hidestylies, color);
|
||||
}
|
||||
else
|
||||
StyleCodeHighlight(line->txt.c_str(), vrow, 0, not AA->attr().hex() and AA->adat->hidestylies, color);
|
||||
int tlen = strlen(line->txt.c_str());
|
||||
vputns(vrow, tlen, color, "", visible_width-tlen);
|
||||
printns(vrow, tlen, color, "", visible_width-tlen);
|
||||
}
|
||||
else
|
||||
vputns(vrow, 0, color, line->txt.c_str(), visible_width);
|
||||
printns(vrow, 0, color, line->txt.c_str(), visible_width);
|
||||
}
|
||||
|
||||
|
||||
@@ -676,11 +676,18 @@ void GMsgBodyView::UpdateScrollbar() {
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
void GMsgBodyView::prints(int wrow, int wcol, int atr, const char* str) {
|
||||
|
||||
void GMsgBodyView::prints(int wrow, int wcol, vattr atr, const char* str)
|
||||
{
|
||||
vputs(wrow, wcol, atr, str);
|
||||
}
|
||||
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
void GMsgBodyView::printns(int wrow, int wcol, vattr atr, const char* str, uint len)
|
||||
{
|
||||
vputns(wrow, wcol, atr, str, len);
|
||||
}
|
||||
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
@@ -45,20 +45,20 @@ public:
|
||||
~GMsgHeaderView();
|
||||
|
||||
// Window setup
|
||||
int at_row;
|
||||
int at_column;
|
||||
int width;
|
||||
int height;
|
||||
int border_type;
|
||||
int border_color;
|
||||
int window_color;
|
||||
int title_color;
|
||||
int at_row;
|
||||
int at_column;
|
||||
int width;
|
||||
int height;
|
||||
int border_type;
|
||||
vattr border_color;
|
||||
vattr window_color;
|
||||
vattr title_color;
|
||||
|
||||
int highlight_color;
|
||||
int from_color;
|
||||
int to_color;
|
||||
int subject_color;
|
||||
int location_color;
|
||||
vattr highlight_color;
|
||||
vattr from_color;
|
||||
vattr to_color;
|
||||
vattr subject_color;
|
||||
vattr location_color;
|
||||
|
||||
void Use(Area *areaptr, GMsg *msgptr);
|
||||
|
||||
@@ -87,7 +87,8 @@ protected:
|
||||
|
||||
void PaintLine(int row, Line *line);
|
||||
void UpdateScrollbar();
|
||||
void prints(int wrow, int wcol, int atr, const char* str);
|
||||
void prints(int wrow, int wcol, vattr atr, const char* str);
|
||||
void printns(int wrow, int wcol, vattr atr, const char* str, uint len);
|
||||
|
||||
public:
|
||||
|
||||
@@ -99,16 +100,15 @@ public:
|
||||
~GMsgBodyView();
|
||||
|
||||
// Window setup
|
||||
int at_row;
|
||||
int at_column;
|
||||
int width;
|
||||
int height;
|
||||
int border_type;
|
||||
int border_color;
|
||||
int window_color;
|
||||
int scrollbar_color;
|
||||
|
||||
int highlight_color;
|
||||
int at_row;
|
||||
int at_column;
|
||||
int width;
|
||||
int height;
|
||||
int border_type;
|
||||
vattr border_color;
|
||||
vattr window_color;
|
||||
vattr scrollbar_color;
|
||||
vattr highlight_color;
|
||||
|
||||
void Use(Area *areaptr, GMsg *msgptr, int startline=0);
|
||||
|
||||
|
Reference in New Issue
Block a user