Replaced a part of color attributes from int type to vattr type
This commit is contained in:
@@ -46,23 +46,23 @@ class GMnu {
|
||||
|
||||
protected:
|
||||
|
||||
int bordertype;
|
||||
int bordercolor;
|
||||
int bordertype;
|
||||
vattr bordercolor;
|
||||
|
||||
int textcolor;
|
||||
int quickcolor;
|
||||
int noselcolor;
|
||||
int barcolor;
|
||||
int shadowcolor;
|
||||
vattr textcolor;
|
||||
vattr quickcolor;
|
||||
vattr noselcolor;
|
||||
vattr barcolor;
|
||||
vattr shadowcolor;
|
||||
|
||||
const char* title;
|
||||
int titlepos;
|
||||
int titlecolor;
|
||||
int titlepos;
|
||||
vattr titlecolor;
|
||||
|
||||
int deschdl;
|
||||
int descrow;
|
||||
int desccolumn;
|
||||
int desccolor;
|
||||
int deschdl;
|
||||
int descrow;
|
||||
int desccolumn;
|
||||
vattr desccolor;
|
||||
|
||||
int helpnumber;
|
||||
|
||||
@@ -95,11 +95,11 @@ public:
|
||||
|
||||
void Init();
|
||||
|
||||
void SetBorder(int type, int color);
|
||||
void SetColor(int text, int quick, int nosel, int bar, int shadow=-1);
|
||||
void SetTitle(const char* title, int color, int pos=TCENTER);
|
||||
void SetBorder(int type, vattr color);
|
||||
void SetColor(vattr text, vattr quick, vattr nosel, vattr bar, vattr shadow = DEFATTR);
|
||||
void SetTitle(const char* title, vattr color, int pos=TCENTER);
|
||||
void SetTitle(const char* title);
|
||||
void SetDesc(int hdl, int row, int col, int color);
|
||||
void SetDesc(int hdl, int row, int col, vattr color);
|
||||
void SetPos(int row, int col, int width=0, int height=0);
|
||||
void SetEsc(int option);
|
||||
void SetHelp(int help);
|
||||
|
@@ -31,6 +31,7 @@
|
||||
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
#include <gdefs.h>
|
||||
#if defined(__USE_NCURSES__)
|
||||
#include <gcurses.h>
|
||||
@@ -38,11 +39,97 @@
|
||||
#if defined(__WIN32__)
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#pragma warning(disable: 4200)
|
||||
#endif
|
||||
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
#ifdef BLINK
|
||||
#undef BLINK
|
||||
#endif
|
||||
#define BLINK 128
|
||||
|
||||
#ifdef INTENSE
|
||||
#undef INTENSE
|
||||
#endif
|
||||
#define INTENSE 8
|
||||
|
||||
#if defined(__UNIX__) && !defined(__USE_NCURSES__)
|
||||
#define ACSET BLINK
|
||||
#else
|
||||
#define ACSET 0
|
||||
#endif
|
||||
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
#if defined(__USE_NCURSES__)
|
||||
typedef chtype vchar; // Type of characters on-screen
|
||||
typedef int vattr; // Type of screen attributes
|
||||
typedef chtype vatch; // Type of character-attribute groups
|
||||
#elif defined(__WIN32__)
|
||||
typedef char vchar; // Type of characters on-screen
|
||||
typedef int vattr; // Type of screen attributes
|
||||
typedef CHAR_INFO vatch; // Type of character-attribute groups
|
||||
#else
|
||||
typedef char vchar; // Type of characters on-screen
|
||||
typedef int vattr; // Type of screen attributes
|
||||
typedef word vatch; // Type of character-attribute groups
|
||||
#endif
|
||||
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// Attribute codes for functions that use them
|
||||
|
||||
const vattr DEFATTR = -1;
|
||||
|
||||
const vattr BLACK = 0;
|
||||
const vattr BLUE = 1;
|
||||
const vattr GREEN = 2;
|
||||
const vattr CYAN = 3;
|
||||
const vattr RED = 4;
|
||||
const vattr MAGENTA = 5;
|
||||
const vattr BROWN = 6;
|
||||
const vattr LGREY = 7;
|
||||
const vattr DGREY = 8;
|
||||
const vattr LBLUE = 9;
|
||||
const vattr LGREEN = 10;
|
||||
const vattr LCYAN = 11;
|
||||
const vattr LRED = 12;
|
||||
const vattr LMAGENTA = 13;
|
||||
const vattr YELLOW = 14;
|
||||
const vattr WHITE = 15;
|
||||
|
||||
const vattr _BLACK = (BLACK << 4);
|
||||
const vattr _BLUE = (BLUE << 4);
|
||||
const vattr _GREEN = (GREEN << 4);
|
||||
const vattr _CYAN = (CYAN << 4);
|
||||
const vattr _RED = (RED << 4);
|
||||
const vattr _MAGENTA = (MAGENTA << 4);
|
||||
const vattr _BROWN = (BROWN << 4);
|
||||
const vattr _LGREY = (LGREY << 4);
|
||||
const vattr _DGREY = (DGREY << 4);
|
||||
const vattr _LBLUE = (LBLUE << 4);
|
||||
const vattr _LGREEN = (LGREEN << 4);
|
||||
const vattr _LCYAN = (LCYAN << 4);
|
||||
const vattr _LRED = (LRED << 4);
|
||||
const vattr _LMAGENTA = (LMAGENTA << 4);
|
||||
const vattr _YELLOW = (YELLOW << 4);
|
||||
const vattr _WHITE = (WHITE << 4);
|
||||
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// Additional monochrome color values
|
||||
|
||||
const vattr UNDERLINE = 1;
|
||||
const vattr NORMAL = 7;
|
||||
const vattr HIGHLIGHT = 15;
|
||||
const vattr REVERSE = 112;
|
||||
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// Display adapter types returned from vidtype()
|
||||
// If bit 0 is set, the adapter was detected in monochrome mode
|
||||
@@ -145,68 +232,6 @@ struct __int10_ah1b_statebuf {
|
||||
#endif
|
||||
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// Attribute codes for functions that use them
|
||||
|
||||
#define BLACK 0
|
||||
#define BLUE 1
|
||||
#define GREEN 2
|
||||
#define CYAN 3
|
||||
#define RED 4
|
||||
#define MAGENTA 5
|
||||
#define BROWN 6
|
||||
#define LGREY 7
|
||||
#define DGREY 8
|
||||
#define LBLUE 9
|
||||
#define LGREEN 10
|
||||
#define LCYAN 11
|
||||
#define LRED 12
|
||||
#define LMAGENTA 13
|
||||
#define YELLOW 14
|
||||
#define WHITE 15
|
||||
|
||||
#define _BLACK (BLACK << 4)
|
||||
#define _BLUE (BLUE << 4)
|
||||
#define _GREEN (GREEN << 4)
|
||||
#define _CYAN (CYAN << 4)
|
||||
#define _RED (RED << 4)
|
||||
#define _MAGENTA (MAGENTA << 4)
|
||||
#define _BROWN (BROWN << 4)
|
||||
#define _LGREY (LGREY << 4)
|
||||
#define _DGREY (DGREY << 4)
|
||||
#define _LBLUE (LBLUE << 4)
|
||||
#define _LGREEN (LGREEN << 4)
|
||||
#define _LCYAN (LCYAN << 4)
|
||||
#define _LRED (LRED << 4)
|
||||
#define _LMAGENTA (LMAGENTA << 4)
|
||||
#define _YELLOW (YELLOW << 4)
|
||||
#define _WHITE (WHITE << 4)
|
||||
|
||||
#ifdef BLINK
|
||||
#undef BLINK
|
||||
#endif
|
||||
#define BLINK 128
|
||||
#ifdef INTENSE
|
||||
#undef INTENSE
|
||||
#endif
|
||||
#define INTENSE 8
|
||||
|
||||
#if defined(__UNIX__) && !defined(__USE_NCURSES__)
|
||||
#define ACSET BLINK
|
||||
#else
|
||||
#define ACSET 0
|
||||
#endif
|
||||
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// Additional monochrome color values
|
||||
|
||||
#define UNDERLINE 1
|
||||
#define NORMAL 7
|
||||
#define HIGHLIGHT 15
|
||||
#define REVERSE 112
|
||||
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// Border types
|
||||
|
||||
@@ -226,29 +251,32 @@ struct __int10_ah1b_statebuf {
|
||||
struct GVidInfo {
|
||||
|
||||
// Screen info
|
||||
struct {
|
||||
int mode; // Video mode
|
||||
int rows; // Number of rows
|
||||
int columns; // Number of columns
|
||||
int cheight; // Character height
|
||||
int cwidth; // Character width
|
||||
struct _screen
|
||||
{
|
||||
int mode; // Video mode
|
||||
int rows; // Number of rows
|
||||
int columns; // Number of columns
|
||||
int cheight; // Character height
|
||||
int cwidth; // Character width
|
||||
} screen;
|
||||
|
||||
// Cursor info
|
||||
struct {
|
||||
int column; // Cursor column
|
||||
int row; // Cursor row
|
||||
int start; // Cursor start line
|
||||
int end; // Cursor end line
|
||||
word attr; // Cursor attribute. Hidden if attr == 0xFFFF
|
||||
struct _cursor
|
||||
{
|
||||
int column; // Cursor column
|
||||
int row; // Cursor row
|
||||
int start; // Cursor start line
|
||||
int end; // Cursor end line
|
||||
word attr; // Cursor attribute. Hidden if attr == 0xFFFF
|
||||
} cursor;
|
||||
|
||||
// Colors
|
||||
struct {
|
||||
int textattr; // Text attribute
|
||||
int overscan; // Overscan color
|
||||
int intensity; // Background color state (intense or blinking)
|
||||
int palette[16]; // Palette state
|
||||
struct _color
|
||||
{
|
||||
vattr textattr; // Text attribute
|
||||
vattr overscan; // Overscan color
|
||||
int intensity; // Background color state (intense or blinking)
|
||||
int palette[16]; // Palette state
|
||||
} color;
|
||||
};
|
||||
|
||||
@@ -261,19 +289,6 @@ typedef uint32_t gdma; // Video DMA linear address
|
||||
typedef word* gdma; // Video DMA pointer
|
||||
#endif
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
#if defined(__USE_NCURSES__)
|
||||
typedef chtype vchar; // Type of characters on-screen
|
||||
typedef chtype vatch; // Type of character-attribute groups
|
||||
#elif defined(__WIN32__)
|
||||
typedef char vchar; // Type of characters on-screen
|
||||
typedef CHAR_INFO vatch; // Type of character-attribute groups
|
||||
#else
|
||||
typedef char vchar; // Type of characters on-screen
|
||||
typedef word vatch; // Type of character-attribute groups
|
||||
#endif
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// Video information record
|
||||
|
||||
@@ -322,7 +337,7 @@ public:
|
||||
void setmode (int _mode);
|
||||
void setrows (int _rows);
|
||||
|
||||
void setoverscan (int _overscan);
|
||||
void setoverscan (vattr _overscan);
|
||||
void setintensity (int _intensity);
|
||||
|
||||
void getpalette (int* _palette);
|
||||
@@ -361,31 +376,31 @@ chtype _box_table(int type, int c);
|
||||
|
||||
int setvparam (int setting);
|
||||
|
||||
int mapattr (int attr);
|
||||
int revsattr (int attr);
|
||||
vattr mapattr (vattr attr);
|
||||
vattr revsattr (vattr attr);
|
||||
|
||||
inline int attrib(int f, int b, int i, int bl) { return (int)((b<<4)|(f)|(i<<3)|(bl<<7)); }
|
||||
inline vattr attrib(int f, int b, int i, int bl) { return (int)((b<<4)|(f)|(i<<3)|(bl<<7)); }
|
||||
|
||||
void vputw (int row, int col, vatch chat);
|
||||
void vputws (int row, int col, vatch* buf, uint len);
|
||||
void vputc (int row, int col, int atr, vchar chr);
|
||||
void vputvs (int row, int col, int atr, const vchar* str);
|
||||
void vputs (int row, int col, int atr, const char* str);
|
||||
void vputs_box (int row, int col, int atr, const char* str);
|
||||
void vputns (int row, int col, int atr, const char* str, uint len);
|
||||
void vputx (int row, int col, int atr, vchar chr, uint len);
|
||||
void vputy (int row, int col, int atr, vchar chr, uint len);
|
||||
void vputc (int row, int col, vattr atr, vchar chr);
|
||||
void vputvs (int row, int col, vattr atr, const vchar* str);
|
||||
void vputs (int row, int col, vattr atr, const char* str);
|
||||
void vputs_box (int row, int col, vattr atr, const char* str);
|
||||
void vputns (int row, int col, vattr atr, const char* str, uint len);
|
||||
void vputx (int row, int col, vattr atr, vchar chr, uint len);
|
||||
void vputy (int row, int col, vattr atr, vchar chr, uint len);
|
||||
|
||||
vatch vgetw (int row, int col);
|
||||
void vgetc (int row, int col, int* atr, vchar* chr);
|
||||
void vgetc (int row, int col, vattr* atr, vchar* chr);
|
||||
|
||||
void vscroll (int srow, int scol, int erow, int ecol, int atr, int lines);
|
||||
void vscroll (int srow, int scol, int erow, int ecol, vattr atr, int lines);
|
||||
|
||||
void vposget (int* row, int* col);
|
||||
void vposset (int row, int col);
|
||||
|
||||
void vclrscr ();
|
||||
void vclrscr (int atr); // Overloaded
|
||||
void vclrscr (vattr atr); // Overloaded
|
||||
|
||||
typedef struct _vsavebuf {
|
||||
int top, left, right, bottom;
|
||||
@@ -404,19 +419,9 @@ bool vcurhidden ();
|
||||
void vcurlarge ();
|
||||
void vcursmall ();
|
||||
|
||||
void vbox (int srow, int scol, int erow, int ecol, int box, int hiattr, int loattr=-1);
|
||||
void vfill (int srow, int scol, int erow, int ecol, vchar chr, int atr);
|
||||
void vbox (int srow, int scol, int erow, int ecol, int box, vattr hiattr, vattr loattr = DEFATTR);
|
||||
void vfill (int srow, int scol, int erow, int ecol, vchar chr, vattr atr);
|
||||
|
||||
vchar vgetc (int row, int col); // Gets the character from position
|
||||
vchar vgchar (vatch chat); // Gets the character part of a character-attribute group
|
||||
int vgattr (vatch chat); // Gets the attribute part of a character-attribute group
|
||||
vatch vschar (vatch chat, vchar chr); // Sets the given character in a character-attribute group
|
||||
vatch vsattr (vatch chat, int atr); // Sets the given attribute in a character-attribute group
|
||||
vatch vcatch (vchar chr, int atr); // Compose character-attribute group from character and attribute
|
||||
|
||||
// inline implementation of functions above
|
||||
|
||||
inline vchar vgetc (int row, int col) { return vgchar(vgetw(row, col)); }
|
||||
|
||||
#if defined(__USE_NCURSES__)
|
||||
|
||||
@@ -424,29 +429,31 @@ int gvid_dosattrcalc (int ourattr);
|
||||
int gvid_attrcalc (int dosattr);
|
||||
|
||||
inline vchar vgchar (vatch chat) { return chat & (A_CHARTEXT | A_ALTCHARSET); }
|
||||
inline int vgattr (vatch chat) { return gvid_dosattrcalc(chat & ~(A_CHARTEXT | A_ALTCHARSET)); }
|
||||
inline vattr vgattr (vatch chat) { return gvid_dosattrcalc(chat & ~(A_CHARTEXT | A_ALTCHARSET)); }
|
||||
inline vatch vschar (vatch chat, vchar chr) { return (chr & (A_CHARTEXT | A_ALTCHARSET)) | (chat & ~(A_CHARTEXT | A_ALTCHARSET)); }
|
||||
inline vatch vsattr (vatch chat, int atr) { return (chat & (A_CHARTEXT | A_ALTCHARSET)) | gvid_attrcalc(atr); }
|
||||
inline vatch vcatch (vchar chr, int atr) { return chr | gvid_attrcalc(atr); }
|
||||
inline vatch vsattr (vatch chat, vattr atr) { return (chat & (A_CHARTEXT | A_ALTCHARSET)) | gvid_attrcalc(atr); }
|
||||
inline vatch vcatch (vchar chr, vattr atr) { return chr | gvid_attrcalc(atr); }
|
||||
|
||||
#elif defined(__WIN32__)
|
||||
|
||||
inline vchar vgchar (vatch chat) { return chat.Char.AsciiChar; }
|
||||
inline int vgattr (vatch chat) { return chat.Attributes; }
|
||||
inline vattr vgattr (vatch chat) { return chat.Attributes; }
|
||||
inline vatch vschar (vatch chat, vchar chr) { chat.Char.UnicodeChar = 0; chat.Char.AsciiChar = chr; return chat; }
|
||||
inline vatch vsattr (vatch chat, int atr) { chat.Attributes = atr; return chat; }
|
||||
inline vatch vcatch (vchar chr, int atr) { vatch chat; chat.Char.UnicodeChar = 0; chat.Char.AsciiChar = chr; chat.Attributes = atr; return chat; }
|
||||
inline vatch vsattr (vatch chat, vattr atr) { chat.Attributes = atr; return chat; }
|
||||
inline vatch vcatch (vchar chr, vattr atr) { vatch chat; chat.Char.UnicodeChar = 0; chat.Char.AsciiChar = chr; chat.Attributes = atr; return chat; }
|
||||
|
||||
#else
|
||||
|
||||
inline vchar vgchar (vatch chat) { return chat & 0xff; }
|
||||
inline int vgattr (vatch chat) { return (chat >> 8) & 0xff; }
|
||||
inline vattr vgattr (vatch chat) { return (chat >> 8) & 0xff; }
|
||||
inline vatch vschar (vatch chat, vchar chr) { return (chat & 0xff00) | chr; }
|
||||
inline vatch vsattr (vatch chat, int atr) { return (chat & 0xff) | (atr << 8); }
|
||||
inline vatch vcatch (vchar chr, int atr) { return (chr & 0xff) | ((atr << 8) & 0xff00); }
|
||||
inline vatch vsattr (vatch chat, vattr atr) { return (chat & 0xff) | (atr << 8); }
|
||||
inline vatch vcatch (vchar chr, vattr atr) { return (chr & 0xff) | ((atr << 8) & 0xff00); }
|
||||
|
||||
#endif
|
||||
|
||||
inline vchar vgetc (int row, int col) { return vgchar(vgetw(row, col)); }
|
||||
|
||||
typedef void (*VidPutStrCP)(int,int,int,const char*);
|
||||
|
||||
void gvid_boxcvt(char* s);
|
||||
|
@@ -365,8 +365,8 @@ void vputansi(int row, int col, word* buf, int len) {
|
||||
// ------------------------------------------------------------------
|
||||
// Converts an attribute to monochrome equivalent
|
||||
|
||||
int mapattr(int attr) {
|
||||
|
||||
vattr mapattr(vattr attr)
|
||||
{
|
||||
switch(attr&112) { // test for a light background
|
||||
|
||||
case _LGREY:
|
||||
@@ -391,9 +391,9 @@ int mapattr(int attr) {
|
||||
// ------------------------------------------------------------------
|
||||
// Reverses the attribute given
|
||||
|
||||
int revsattr(int attr) {
|
||||
|
||||
return (int)(((attr>>4)&0x07)|((attr<<4)&0x70)|(attr&0x80)|(attr&0x08));
|
||||
vattr revsattr(vattr attr)
|
||||
{
|
||||
return (vattr)(((attr>>4)&0x07)|((attr<<4)&0x70)|(attr&0x80)|(attr&0x08));
|
||||
}
|
||||
|
||||
#if !defined(__USE_NCURSES__)
|
||||
@@ -714,7 +714,7 @@ void vputws(int row, int col, vatch* buf, uint len) {
|
||||
// ------------------------------------------------------------------
|
||||
// Print character and attribute at specfied location
|
||||
|
||||
void vputc(int row, int col, int atr, vchar chr) {
|
||||
void vputc(int row, int col, vattr atr, vchar chr) {
|
||||
|
||||
#if defined(__USE_NCURSES__)
|
||||
|
||||
@@ -760,7 +760,7 @@ void vputc(int row, int col, int atr, vchar chr) {
|
||||
// ------------------------------------------------------------------
|
||||
// Print string with attribute at specfied location
|
||||
|
||||
void vputvs(int row, int col, int atr, const vchar* str) {
|
||||
void vputvs(int row, int col, vattr atr, const vchar* str) {
|
||||
|
||||
#if defined(__USE_NCURSES__)
|
||||
|
||||
@@ -782,7 +782,7 @@ void vputvs(int row, int col, int atr, const vchar* str) {
|
||||
// ------------------------------------------------------------------
|
||||
// Print string with attribute at specfied location
|
||||
|
||||
void vputs_box(int row, int col, int atr, const char* str) {
|
||||
void vputs_box(int row, int col, vattr atr, const char* str) {
|
||||
#if defined(__USE_NCURSES__)
|
||||
uint counter;
|
||||
int len = strlen(str);
|
||||
@@ -796,7 +796,7 @@ void vputs_box(int row, int col, int atr, const char* str) {
|
||||
#endif
|
||||
}
|
||||
|
||||
void vputs(int row, int col, int atr, const char* str) {
|
||||
void vputs(int row, int col, vattr atr, const char* str) {
|
||||
|
||||
#if defined(__USE_NCURSES__)
|
||||
|
||||
@@ -889,7 +889,7 @@ static void _vputns(int row, int col, int atr, const char* str, uint width) {
|
||||
// ------------------------------------------------------------------
|
||||
// Print string with attribute at specfied location
|
||||
|
||||
void vputns(int row, int col, int atr, const char* str, uint width) {
|
||||
void vputns(int row, int col, vattr atr, const char* str, uint width) {
|
||||
|
||||
char fillchar = ' ';
|
||||
|
||||
@@ -1004,7 +1004,7 @@ void _vputx(int row, int col, int atr, char chr, uint len) {
|
||||
// ------------------------------------------------------------------
|
||||
// Print horizontal line of character and attribute
|
||||
|
||||
void vputx(int row, int col, int atr, vchar chr, uint len) {
|
||||
void vputx(int row, int col, vattr atr, vchar chr, uint len) {
|
||||
|
||||
#if defined(__USE_NCURSES__)
|
||||
|
||||
@@ -1080,7 +1080,7 @@ inline void _vputy(int row, int col, int atr, char chr, uint len) {
|
||||
// ------------------------------------------------------------------
|
||||
// Print vertical line of character and attribute
|
||||
|
||||
void vputy(int row, int col, int atr, vchar chr, uint len) {
|
||||
void vputy(int row, int col, vattr atr, vchar chr, uint len) {
|
||||
|
||||
#if defined(__USE_NCURSES__)
|
||||
|
||||
@@ -1224,11 +1224,11 @@ vatch vgetw(int row, int col) {
|
||||
// ------------------------------------------------------------------
|
||||
// Get character and attribute at cursor position
|
||||
|
||||
void vgetc(int row, int col, int* atr, vchar* chr) {
|
||||
void vgetc(int row, int col, vattr* atr, vchar* chr) {
|
||||
|
||||
if((row < 0) or (row > gvid->numrows-1) or (col < 0) or (col > gvid->numcols-1)) {
|
||||
*chr = ' ';
|
||||
*atr = 0;
|
||||
*atr = BLACK|_BLACK;
|
||||
}
|
||||
else {
|
||||
vatch tmp = vgetw(row, col);
|
||||
@@ -1285,7 +1285,7 @@ static void _vscroll(int srow, int scol, int erow, int ecol, int atr, int lines)
|
||||
// ------------------------------------------------------------------
|
||||
// Scroll screen area
|
||||
|
||||
void vscroll(int srow, int scol, int erow, int ecol, int atr, int lines) {
|
||||
void vscroll(int srow, int scol, int erow, int ecol, vattr atr, int lines) {
|
||||
|
||||
#if defined(__USE_NCURSES__)
|
||||
|
||||
@@ -1485,7 +1485,7 @@ void vclrscr() {
|
||||
// Clears the screen using given attribute and homes the cursor
|
||||
|
||||
#if (defined(__MSDOS__) || defined(__UNIX__)) && !defined(__USE_NCURSES__)
|
||||
static void _vclrscr(int atr) {
|
||||
static void _vclrscr(vattr atr) {
|
||||
|
||||
int len = gvid->numrows * gvid->numcols;
|
||||
|
||||
@@ -1498,7 +1498,7 @@ static void _vclrscr(int atr) {
|
||||
// ------------------------------------------------------------------
|
||||
// Clears the screen using given attribute and homes the cursor
|
||||
|
||||
void vclrscr(int atr) {
|
||||
void vclrscr(vattr atr) {
|
||||
|
||||
#if defined(__USE_NCURSES__)
|
||||
|
||||
@@ -2147,9 +2147,9 @@ static uint32_t gvid_boxcvtc(char c) {
|
||||
// ------------------------------------------------------------------
|
||||
// Draws a text box on the screen
|
||||
|
||||
void vbox(int srow, int scol, int erow, int ecol, int box, int hiattr, int loattr) {
|
||||
|
||||
if(loattr == -1)
|
||||
void vbox(int srow, int scol, int erow, int ecol, int box, vattr hiattr, vattr loattr)
|
||||
{
|
||||
if (loattr == DEFATTR)
|
||||
loattr = hiattr;
|
||||
else if(loattr == -2)
|
||||
loattr = (int)((hiattr & 0x08) ? (hiattr & 0xF7) : (hiattr | 0x08));
|
||||
@@ -2173,7 +2173,7 @@ void vbox(int srow, int scol, int erow, int ecol, int box, int hiattr, int loatt
|
||||
// ------------------------------------------------------------------
|
||||
// Fills an area of screen with a character & attribute
|
||||
|
||||
void vfill(int srow, int scol, int erow, int ecol, vchar chr, int atr) {
|
||||
void vfill(int srow, int scol, int erow, int ecol, vchar chr, vattr atr) {
|
||||
|
||||
int width = ecol-scol+1;
|
||||
for(int crow=srow; crow<=erow; crow++)
|
||||
|
@@ -439,8 +439,8 @@ int GVid::detectadapter() {
|
||||
// ------------------------------------------------------------------
|
||||
// Video info detect
|
||||
|
||||
void GVid::detectinfo(GVidInfo* _info) {
|
||||
|
||||
void GVid::detectinfo(GVidInfo* _info)
|
||||
{
|
||||
// Reset all original values
|
||||
memset(_info, 0, sizeof(GVidInfo));
|
||||
|
||||
@@ -826,7 +826,7 @@ void GVid::setrows(int _rows) {
|
||||
#endif
|
||||
|
||||
if(origrows < _rows)
|
||||
vfill(origrows, 0, _rows, 80, ' ', 7);
|
||||
vfill(origrows, 0, _rows, 80, ' ', LGREY);
|
||||
|
||||
detectinfo(&curr);
|
||||
resetcurr();
|
||||
@@ -836,8 +836,8 @@ void GVid::setrows(int _rows) {
|
||||
// ------------------------------------------------------------------
|
||||
// Set the screen border (overscan) color
|
||||
|
||||
void GVid::setoverscan(int _overscan) {
|
||||
|
||||
void GVid::setoverscan(vattr _overscan)
|
||||
{
|
||||
#if defined(__USE_NCURSES__)
|
||||
|
||||
NW (_overscan);
|
||||
@@ -871,8 +871,8 @@ void GVid::setoverscan(int _overscan) {
|
||||
// ------------------------------------------------------------------
|
||||
// Set intensity/blinking state
|
||||
|
||||
void GVid::setintensity(int _intensity) {
|
||||
|
||||
void GVid::setintensity(int _intensity)
|
||||
{
|
||||
#if defined(__USE_NCURSES__)
|
||||
|
||||
NW(_intensity);
|
||||
@@ -928,8 +928,8 @@ void GVid::setintensity(int _intensity) {
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
void GVid::getpalette(int* _palette) {
|
||||
|
||||
void GVid::getpalette(int* _palette)
|
||||
{
|
||||
#if defined(__USE_NCURSES__)
|
||||
|
||||
NW(_palette);
|
||||
@@ -977,8 +977,8 @@ void GVid::getpalette(int* _palette) {
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
void GVid::setpalette(int* _palette) {
|
||||
|
||||
void GVid::setpalette(int* _palette)
|
||||
{
|
||||
#if defined(__USE_NCURSES__)
|
||||
|
||||
NW(_palette);
|
||||
|
@@ -119,7 +119,7 @@ struct _item_t {
|
||||
int dwhdl; // description window handle
|
||||
int dwrow; // description window row
|
||||
int dwcol; // description window column
|
||||
int dattr; // description attribute
|
||||
vattr dattr; // description attribute
|
||||
int redisp; // redisplay flag
|
||||
};
|
||||
|
||||
@@ -141,21 +141,21 @@ struct _menu_t {
|
||||
int erow; // ending row of menu window
|
||||
int ecol; // ending column of menu window
|
||||
int btype; // menu window border type
|
||||
int battr; // menu window "hi" border attribute
|
||||
int loattr; // menu window "lo" border attribute
|
||||
int sbattr; // menu window scrollbar attribute
|
||||
int wattr; // menu window attribute
|
||||
vattr battr; // menu window "hi" border attribute
|
||||
vattr loattr; // menu window "lo" border attribute
|
||||
vattr sbattr; // menu window scrollbar attribute
|
||||
vattr wattr; // menu window attribute
|
||||
int menutype; // menu type mask
|
||||
int barwidth; // width of menu bar or zero
|
||||
int textpos; // offset of text from start of bar
|
||||
int textattr; // attribute of menu text
|
||||
int scharattr; // attribute of selection character
|
||||
int noselattr; // non-selectable text attribute
|
||||
int barattr; // attribute of selection bar
|
||||
vattr textattr; // attribute of menu text
|
||||
vattr scharattr; // attribute of selection character
|
||||
vattr noselattr; // non-selectable text attribute
|
||||
vattr barattr; // attribute of selection bar
|
||||
const char* title; // menu title string or NULL if no title
|
||||
int titlepos; // position of menu title (TLEFT,TCENTER,TRIGHT)
|
||||
int titleattr; // attribute of menu title
|
||||
int shadattr; // shadow attribute or -1 if no shadow
|
||||
vattr titleattr; // attribute of menu title
|
||||
vattr shadattr; // shadow attribute or -1 if no shadow
|
||||
int items; // number of items in menu
|
||||
bool hotkey;
|
||||
};
|
||||
@@ -226,17 +226,17 @@ struct _wrec_t {
|
||||
int erow; // end row of window
|
||||
int ecol; // end column of window
|
||||
int btype; // window's box type
|
||||
int wattr; // window's initial text attribute
|
||||
int battr; // attribute of window's border
|
||||
int loattr; // attribute of window's border
|
||||
int sbattr; // attribute of window's scrollbar
|
||||
vattr wattr; // window's initial text attribute
|
||||
vattr battr; // attribute of window's border
|
||||
vattr loattr; // attribute of window's border
|
||||
vattr sbattr; // attribute of window's scrollbar
|
||||
int border; // has border? 0 = no, 1 = yes
|
||||
int row; // window's current cursor row
|
||||
int column; // window's current cursor column
|
||||
int attr; // window's current text attribute
|
||||
vattr attr; // window's current text attribute
|
||||
int tpos; // position of window's title
|
||||
int tattr; // attribute of window's title
|
||||
int wsattr; // attribute of window's shadow
|
||||
vattr tattr; // attribute of window's title
|
||||
vattr wsattr; // attribute of window's shadow
|
||||
};
|
||||
|
||||
|
||||
@@ -345,8 +345,8 @@ int wactiv (int whandle);
|
||||
int wactiv_ (int whandle);
|
||||
int wborder (int btype);
|
||||
int wbox (int wsrow, int wscol, int werow, int wecol, int btype, int attr);
|
||||
int wcclear (int attr);
|
||||
int wcenters (int wrow, int attr, const char* str);
|
||||
int wcclear (vattr attr);
|
||||
int wcenters (int wrow, vattr attr, const char* str);
|
||||
int wchkbox (int wsrow, int wscol, int werow, int wecol);
|
||||
int wchkcol (int wcol);
|
||||
int wchkcoord (int wrow, int wcol);
|
||||
@@ -359,55 +359,55 @@ int wcopy (int nsrow, int nscol);
|
||||
int wdelline (int wrow, int direc);
|
||||
int wdrag (int direction);
|
||||
int wdupc (char ch, int count);
|
||||
int wfill (int wsrow, int wscol, int werow, int wecol, vchar ch, int attr);
|
||||
int wfill (int wsrow, int wscol, int werow, int wecol, vchar ch, vattr attr);
|
||||
_wrec_t* wfindrec (int whandle);
|
||||
int wgotoxy (int wrow, int wcol);
|
||||
int whandle ();
|
||||
int whide ();
|
||||
int whline (int wsrow, int wscol, int count, int btype, int attr);
|
||||
int wmessage (const char* str, int border, int leftofs, int attr);
|
||||
int whline (int wsrow, int wscol, int count, int btype, vattr attr);
|
||||
int wmessage (const char* str, int border, int leftofs, vattr attr);
|
||||
int wmove (int nsrow, int nscol);
|
||||
int wopen (int srow, int scol, int erow, int ecol, int btype, int battr, int wattr, int sbattr=-1, int loattr=-1);
|
||||
inline int wopen_ (int srow, int scol, int vlen, int hlen, int btype, int battr, int wattr, int sbattr=-1, int loattr=-1) { return wopen(srow, scol, srow+vlen-1, scol+hlen-1, btype, battr, wattr, sbattr, loattr); }
|
||||
int wopen (int srow, int scol, int erow, int ecol, int btype, vattr battr, vattr wattr, vattr sbattr = DEFATTR, vattr loattr = DEFATTR);
|
||||
inline int wopen_ (int srow, int scol, int vlen, int hlen, int btype, vattr battr, vattr wattr, vattr sbattr = DEFATTR, vattr loattr = DEFATTR) { return wopen(srow, scol, srow+vlen-1, scol+hlen-1, btype, battr, wattr, sbattr, loattr); }
|
||||
int wperror (const char* message);
|
||||
bool wpickfile (int srow, int scol, int erow, int ecol, int btype, int bordattr, int winattr, int barattr, bool title, std::string &filespec, IfcpCP open, bool casesens=false);
|
||||
int wpickstr (int srow, int scol, int erow, int ecol, int btype, int bordattr, int winattr, int barattr, char* strarr[], int initelem, VfvCP open);
|
||||
int wprintc (int wrow, int wcol, int attr, vchar ch);
|
||||
bool wpickfile (int srow, int scol, int erow, int ecol, int btype, vattr bordattr, vattr winattr, vattr barattr, bool title, std::string &filespec, IfcpCP open, bool casesens=false);
|
||||
int wpickstr (int srow, int scol, int erow, int ecol, int btype, vattr bordattr, vattr winattr, vattr barattr, char* strarr[], int initelem, VfvCP open);
|
||||
int wprintc (int wrow, int wcol, vattr attr, vchar ch);
|
||||
int wprintf (const char* format, ...) __attribute__ ((format (printf, 1, 2)));
|
||||
int wprintaf (int attr, const char* format, ...) __attribute__ ((format (printf, 2, 3)));
|
||||
int wprintfs (int wrow, int wcol, int attr, const char* format, ...) __attribute__ ((format (printf, 4, 5)));
|
||||
int wprints (int wrow, int wcol, int attr, const char* str);
|
||||
int wprints_box (int wrow, int wcol, int attr, const char* str);
|
||||
int wprintvs (int wrow, int wcol, int attr, const vchar* str);
|
||||
int wprintns (int wrow, int wcol, int attr, const char* str, uint len, vchar fill=' ', int fill_attr=-1);
|
||||
int wprintsf (int wrow, int wcol, int attr, const char* format, const char* str);
|
||||
int wprintfs (int wrow, int wcol, vattr attr, const char* format, ...) __attribute__ ((format (printf, 4, 5)));
|
||||
int wprints (int wrow, int wcol, vattr attr, const char* str);
|
||||
int wprints_box (int wrow, int wcol, vattr attr, const char* str);
|
||||
int wprintvs (int wrow, int wcol, vattr attr, const vchar* str);
|
||||
int wprintns (int wrow, int wcol, vattr attr, const char* str, uint len, vchar fill=' ', vattr fill_attr = DEFATTR);
|
||||
int wprintsf (int wrow, int wcol, vattr attr, const char* format, const char* str);
|
||||
int wprintws (int wrow, int wcol, vatch* buf, uint len);
|
||||
void wpropbar (int xx, int yy, long len, int attr, long pos, long size);
|
||||
void wpropbar (int xx, int yy, long len, vattr attr, long pos, long size);
|
||||
int wputc (vchar ch);
|
||||
int wputs (const char* str);
|
||||
int wputx (int wrow, int wcol, int attr, vchar chr, uint len);
|
||||
int wputy (int wrow, int wcol, int attr, vchar chr, uint len);
|
||||
int wputx (int wrow, int wcol, vattr attr, vchar chr, uint len);
|
||||
int wputy (int wrow, int wcol, vattr attr, vchar chr, uint len);
|
||||
int wreadcur (int* wrow, int* wcol);
|
||||
int wscroll (int count, int direc);
|
||||
void wscrollbar (int orientation, uint total, uint maxpos, uint pos, int sadd=0);
|
||||
int wscrollbox (int wsrow, int wscol, int werow, int wecol, int count, int direction);
|
||||
int wshadoff ();
|
||||
int wshadow (int attr);
|
||||
int wshadow (vattr attr);
|
||||
int wsize (int nerow, int necol);
|
||||
int wslide (int nsrow, int nscol);
|
||||
void wtextattr (int attr);
|
||||
int wtitle (const char* str, int tpos, int tattr);
|
||||
void wtextattr (vattr attr);
|
||||
int wtitle (const char* str, int tpos, vattr tattr);
|
||||
int wunhide (int whandle);
|
||||
int wunlink (int w);
|
||||
int wvline (int wsrow, int wscol, int count, int btype, int attr);
|
||||
int wwprintc (int whandle, int wrow, int wcol, int attr, const vchar chr);
|
||||
int wwprints (int whandle, int wrow, int wcol, int attr, const char* str);
|
||||
int wwprintstr (int whandle, int wrow, int wcol, int attr, const char* str);
|
||||
int wvline (int wsrow, int wscol, int count, int btype, vattr attr);
|
||||
int wwprintc (int whandle, int wrow, int wcol, vattr attr, const vchar chr);
|
||||
int wwprints (int whandle, int wrow, int wcol, vattr attr, const char* str);
|
||||
int wwprintstr (int whandle, int wrow, int wcol, vattr attr, const char* str);
|
||||
|
||||
int wmenubeg (int srow, int scol, int erow, int ecol, int btype, int battr, int wattr, VfvCP open, int menutype=M_VERT);
|
||||
inline int wmenubeg_ (int srow, int scol, int vlen, int hlen, int btype, int battr, int wattr, VfvCP open, int menutype=M_VERT) { return wmenubeg(srow, scol, srow+vlen-1, scol+hlen-1, btype, battr, wattr, open, menutype); }
|
||||
int wmenubeg (int srow, int scol, int erow, int ecol, int btype, vattr battr, vattr wattr, VfvCP open, int menutype=M_VERT);
|
||||
inline int wmenubeg_ (int srow, int scol, int vlen, int hlen, int btype, vattr battr, vattr wattr, VfvCP open, int menutype=M_VERT) { return wmenubeg(srow, scol, srow+vlen-1, scol+hlen-1, btype, battr, wattr, open, menutype); }
|
||||
int wmenubegc ();
|
||||
int wmenuend (int taginit, int menutype, int barwidth, int textpos, int textattr, int scharattr, int noselattr, int barattr);
|
||||
int wmenuend (int taginit, int menutype, int barwidth, int textpos, vattr textattr, vattr scharattr, vattr noselattr, vattr barattr);
|
||||
int wmenuget ();
|
||||
int wmenuiba (VfvCP before, VfvCP after);
|
||||
int wmenuidsab (int tagid);
|
||||
@@ -415,13 +415,13 @@ int wmenuienab (int tagid);
|
||||
_item_t* wmenuifind (int tagid);
|
||||
int wmenuinext (int tagid);
|
||||
int wmenuitem (int wrow, int wcol, const char* str, char schar, int tagid, int fmask, VfvCP select, gkey hotkey, int help);
|
||||
int wmenuitxt (int whdl, int wrow, int wcol, int attr, const char* str);
|
||||
int wmenuitxt (int whdl, int wrow, int wcol, vattr attr, const char* str);
|
||||
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// Inline functions
|
||||
|
||||
inline void wtextattr(int attr) { gwin.active->attr = attr; }
|
||||
inline void wtextattr(vattr attr) { gwin.active->attr = attr; }
|
||||
|
||||
inline int wclear () { return wcclear(gwin.active->wattr); }
|
||||
inline void wfillch (vchar a) { gwin.fillch=a; }
|
||||
@@ -437,7 +437,7 @@ inline _field_t* winpfcurr () { return gwin.active->form->cfield; }
|
||||
inline _menu_t* wmenumcurr () { return gwin.cmenu; }
|
||||
inline _item_t* wmenuicurr () { return wmenumcurr()->citem; }
|
||||
|
||||
inline int wmenutitshad(const char* title, int pos, int attr, int shadattr) { gwin.cmenu->title=title; gwin.cmenu->titlepos=pos; gwin.cmenu->titleattr=attr; gwin.cmenu->shadattr=shadattr; return W_NOERROR; }
|
||||
inline int wmenutitshad(const char* title, int pos, vattr attr, vattr shadattr) { gwin.cmenu->title=title; gwin.cmenu->titlepos=pos; gwin.cmenu->titleattr=attr; gwin.cmenu->shadattr=shadattr; return W_NOERROR; }
|
||||
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
@@ -124,7 +124,7 @@ int wgotoxy(int wrow, int wcol) {
|
||||
// ------------------------------------------------------------------
|
||||
// Opens a window and makes it active
|
||||
|
||||
int wopen(int srow, int scol, int erow, int ecol, int btype, int battr, int wattr, int sbattr, int loattr) {
|
||||
int wopen(int srow, int scol, int erow, int ecol, int btype, vattr battr, vattr wattr, vattr sbattr, vattr loattr) {
|
||||
|
||||
// check for valid box type
|
||||
if(btype<0 or btype>7) {
|
||||
@@ -279,7 +279,7 @@ int wcloseall() {
|
||||
// ------------------------------------------------------------------
|
||||
// Gives active window a shadow
|
||||
|
||||
int wshadow(int attr) {
|
||||
int wshadow(vattr attr) {
|
||||
|
||||
// check for active window
|
||||
if(!gwin.total)
|
||||
@@ -408,7 +408,7 @@ int wshadoff() {
|
||||
throw_xrelease(gwin.active->wsbuf);
|
||||
|
||||
// update window's record
|
||||
gwin.active->wsattr = 0xFF;
|
||||
gwin.active->wsattr = WHITE|_WHITE;
|
||||
|
||||
// return with no error
|
||||
return gwin.werrno=W_NOERROR;
|
||||
@@ -427,7 +427,7 @@ int wscroll(int count, int direction) {
|
||||
gwin.active->srow + border,
|
||||
gwin.active->scol + border,
|
||||
gwin.active->erow - border,
|
||||
gwin.active->ecol - ((border or (gwin.active->sbattr != -1)) ? 1 : 0),
|
||||
gwin.active->ecol - ((border or (gwin.active->sbattr != DEFATTR)) ? 1 : 0),
|
||||
gwin.active->wattr,
|
||||
direction == SUP ? count : -count
|
||||
);
|
||||
@@ -570,7 +570,7 @@ int wdupc(char ch, int count) {
|
||||
// ------------------------------------------------------------------
|
||||
// Clears the active window in specified attribute
|
||||
|
||||
int wcclear(int attr) {
|
||||
int wcclear(vattr attr) {
|
||||
|
||||
// check for active window
|
||||
|
||||
@@ -658,14 +658,14 @@ int wclreos() {
|
||||
// ------------------------------------------------------------------
|
||||
// This function will process an Escape sequence when encountered
|
||||
|
||||
static const char* process_esc(const char* str) {
|
||||
|
||||
static const char* process_esc(const char* str)
|
||||
{
|
||||
int wrow,wcol;
|
||||
|
||||
const char *p = str;
|
||||
for(; *p==ESC; p++) {
|
||||
|
||||
int attr = gwin.active->attr;
|
||||
vattr attr = gwin.active->attr;
|
||||
|
||||
switch(*(++p)) {
|
||||
|
||||
@@ -811,7 +811,7 @@ int wputs(const char* str) {
|
||||
// ------------------------------------------------------------------
|
||||
// Displays a character inside active window
|
||||
|
||||
int wprintc(int wrow, int wcol, int atr, vchar chr) {
|
||||
int wprintc(int wrow, int wcol, vattr atr, vchar chr) {
|
||||
|
||||
// check for active window
|
||||
if(!gwin.total)
|
||||
@@ -853,7 +853,7 @@ int wprintf(const char* format, ...) {
|
||||
// ------------------------------------------------------------------
|
||||
// Print a formatted string at a specific position and attribute
|
||||
|
||||
int wprintfs(int wrow, int wcol, int attr, const char* format, ...) {
|
||||
int wprintfs(int wrow, int wcol, vattr attr, const char* format, ...) {
|
||||
|
||||
va_list argptr;
|
||||
char buf[256];
|
||||
@@ -872,7 +872,7 @@ int wprintfs(int wrow, int wcol, int attr, const char* format, ...) {
|
||||
// ------------------------------------------------------------------
|
||||
// Displays a string inside active window
|
||||
|
||||
int wprints(int wrow, int wcol, int attr, const char* str) {
|
||||
int wprints(int wrow, int wcol, vattr attr, const char* str) {
|
||||
|
||||
// check for active window
|
||||
if(!gwin.total)
|
||||
@@ -889,7 +889,7 @@ int wprints(int wrow, int wcol, int attr, const char* str) {
|
||||
return gwin.werrno=W_NOERROR;
|
||||
}
|
||||
|
||||
int wprints_box(int wrow, int wcol, int attr, const char* str) {
|
||||
int wprints_box(int wrow, int wcol, vattr attr, const char* str) {
|
||||
|
||||
// check for active window
|
||||
if(!gwin.total)
|
||||
@@ -910,7 +910,7 @@ int wprints_box(int wrow, int wcol, int attr, const char* str) {
|
||||
// ------------------------------------------------------------------
|
||||
// Displays a string inside active window
|
||||
|
||||
int wprintvs(int wrow, int wcol, int attr, const vchar* str) {
|
||||
int wprintvs(int wrow, int wcol, vattr attr, const vchar* str) {
|
||||
|
||||
// check for active window
|
||||
if(!gwin.total)
|
||||
@@ -930,7 +930,7 @@ int wprintvs(int wrow, int wcol, int attr, const vchar* str) {
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
int wputx(int wrow, int wcol, int attr, vchar chr, uint len) {
|
||||
int wputx(int wrow, int wcol, vattr attr, vchar chr, uint len) {
|
||||
|
||||
const int &border = gwin.active->border;
|
||||
vputx(gwin.active->srow+wrow+border,gwin.active->scol+wcol+border,attr,chr,len);
|
||||
@@ -940,7 +940,7 @@ int wputx(int wrow, int wcol, int attr, vchar chr, uint len) {
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
int wputy(int wrow, int wcol, int attr, vchar chr, uint len) {
|
||||
int wputy(int wrow, int wcol, vattr attr, vchar chr, uint len) {
|
||||
|
||||
const int &border = gwin.active->border;
|
||||
vputy(gwin.active->srow+wrow+border,gwin.active->scol+wcol+border,attr,chr,len);
|
||||
@@ -951,8 +951,8 @@ int wputy(int wrow, int wcol, int attr, vchar chr, uint len) {
|
||||
// ------------------------------------------------------------------
|
||||
// Displays a string inside active window
|
||||
|
||||
int wprintns(int wrow, int wcol, int attr, const char* str, uint len, vchar fill, int fill_attr) {
|
||||
|
||||
int wprintns(int wrow, int wcol, vattr attr, const char* str, uint len, vchar fill, vattr fill_attr)
|
||||
{
|
||||
char* istr = throw_xstrdup(str);
|
||||
char* ostr = istr;
|
||||
char och = *ostr;
|
||||
@@ -966,7 +966,7 @@ int wprintns(int wrow, int wcol, int attr, const char* str, uint len, vchar fill
|
||||
if(len < olen)
|
||||
*ostr = och;
|
||||
else if(len > olen)
|
||||
retval = wputx(wrow, wcol+olen, (fill_attr != -1) ? fill_attr : attr, fill, len-olen);
|
||||
retval = wputx(wrow, wcol+olen, (fill_attr != DEFATTR) ? fill_attr : attr, fill, len-olen);
|
||||
throw_xfree(istr);
|
||||
return retval;
|
||||
}
|
||||
@@ -1039,9 +1039,9 @@ _wrec_t* wfindrec(int whandle) {
|
||||
|
||||
int whide() {
|
||||
|
||||
vsavebuf* p;
|
||||
int shattr;
|
||||
_wrec_t *temp;
|
||||
vsavebuf *p;
|
||||
vattr shattr;
|
||||
_wrec_t *temp;
|
||||
|
||||
// check for active window
|
||||
if(!gwin.total)
|
||||
@@ -1057,7 +1057,7 @@ int whide() {
|
||||
gwin.active->wsattr = shattr;
|
||||
}
|
||||
else {
|
||||
gwin.active->wsattr = -1;
|
||||
gwin.active->wsattr = DEFATTR;
|
||||
}
|
||||
|
||||
// restore contents of active window's buffer
|
||||
@@ -1152,7 +1152,7 @@ int wunhide(int whandle) {
|
||||
gwin.total++;
|
||||
|
||||
// if window had a shadow before hiding, give it one again
|
||||
if(gwin.active->wsattr!=-1)
|
||||
if(gwin.active->wsattr != DEFATTR)
|
||||
wshadow(gwin.active->wsattr);
|
||||
|
||||
// update help category
|
||||
@@ -1223,8 +1223,8 @@ int wunlink(int w) {
|
||||
// Local variables
|
||||
|
||||
static _wrec_t *__curr, *__found;
|
||||
static int __crow, __ccol;
|
||||
static int __gattr;
|
||||
static int __crow, __ccol;
|
||||
static vattr __gattr;
|
||||
static const char* __p;
|
||||
|
||||
|
||||
@@ -1307,6 +1307,7 @@ static void swap_contents(vatch* pfound, vatch* pcurr, int shadow) {
|
||||
// shadow, reflect the character on the screen.
|
||||
|
||||
temp = vgetw(__crow, __ccol);
|
||||
|
||||
if(shadow&2)
|
||||
*pcurr = vschar(*pcurr, vgchar(temp));
|
||||
chat = ((vgattr(temp) & BLINK) and shadow) ? vsattr(*pcurr, vgattr(*pcurr) | BLINK) : *pcurr;
|
||||
@@ -1581,8 +1582,8 @@ int wactiv_(int whandle) {
|
||||
|
||||
static void update_buffers(vatch* pcurr, int shadow) {
|
||||
|
||||
_wrec_t* tcurr;
|
||||
int tgattr;
|
||||
_wrec_t *tcurr;
|
||||
vattr tgattr;
|
||||
|
||||
// put current string character and attribute into found window's buffer
|
||||
|
||||
@@ -1620,7 +1621,7 @@ static void update_buffers(vatch* pcurr, int shadow) {
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
int wwprintc(int whandle, int wrow, int wcol, int attr, const vchar chr) {
|
||||
int wwprintc(int whandle, int wrow, int wcol, vattr attr, const vchar chr) {
|
||||
|
||||
// check for existance of active window or hidden windows
|
||||
if(!gwin.total and gwin.hidden==NULL)
|
||||
@@ -1648,7 +1649,7 @@ int wwprintc(int whandle, int wrow, int wcol, int attr, const vchar chr) {
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
int wwprints(int whandle, int wrow, int wcol, int attr, const char* str) {
|
||||
int wwprints(int whandle, int wrow, int wcol, vattr attr, const char* str) {
|
||||
|
||||
// check for existance of active window or hidden windows
|
||||
if(!gwin.total and gwin.hidden==NULL)
|
||||
@@ -1750,7 +1751,7 @@ int wwprints(int whandle, int wrow, int wcol, int attr, const char* str) {
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
int wwprintstr(int whandle, int wrow, int wcol, int attr, const char* str) {
|
||||
int wwprintstr(int whandle, int wrow, int wcol, vattr attr, const char* str) {
|
||||
|
||||
// check for existance of active window or hidden windows
|
||||
if(!gwin.total and gwin.hidden==NULL)
|
||||
@@ -1830,7 +1831,7 @@ int wborder(int btype) {
|
||||
// ------------------------------------------------------------------
|
||||
// Fills a region of active window w/specified char/attribute
|
||||
|
||||
int wfill(int wsrow, int wscol, int werow, int wecol, vchar chr, int atr) {
|
||||
int wfill(int wsrow, int wscol, int werow, int wecol, vchar chr, vattr atr) {
|
||||
|
||||
// check for active window
|
||||
if(!gwin.total)
|
||||
@@ -1878,7 +1879,7 @@ int whandle() {
|
||||
// ------------------------------------------------------------------
|
||||
// Displays text on window's top or bottom border
|
||||
|
||||
int wmessage(const char* str, int border, int leftofs, int attr) {
|
||||
int wmessage(const char* str, int border, int leftofs, vattr attr) {
|
||||
|
||||
// check for active window
|
||||
if(!gwin.total)
|
||||
@@ -1912,7 +1913,7 @@ int wmessage(const char* str, int border, int leftofs, int attr) {
|
||||
// ------------------------------------------------------------------
|
||||
// Proportion bar
|
||||
|
||||
void wpropbar(int xx, int yy, long len, int attr, long pos, long size) {
|
||||
void wpropbar(int xx, int yy, long len, vattr attr, long pos, long size) {
|
||||
|
||||
// xx, yy = start position in window.
|
||||
// len = length (in chars) of progress field.
|
||||
@@ -1923,10 +1924,10 @@ void wpropbar(int xx, int yy, long len, int attr, long pos, long size) {
|
||||
const vchar barchar = _box_table(gwin.active->btype, 13);
|
||||
#ifdef __UNIX__ // prefferable under xterm
|
||||
const vchar thumbchar = ' ';
|
||||
int thumbattr = revsattr(attr);
|
||||
vattr thumbattr = revsattr(attr);
|
||||
#else
|
||||
const vchar thumbchar = '\xDB';
|
||||
int thumbattr = attr;
|
||||
vattr thumbattr = attr;
|
||||
#endif
|
||||
|
||||
long thumblen = (pos*len)/size;
|
||||
@@ -1944,7 +1945,7 @@ void wpropbar(int xx, int yy, long len, int attr, long pos, long size) {
|
||||
// ------------------------------------------------------------------
|
||||
// Gives active window a title
|
||||
|
||||
int wtitle(const char* str, int tpos, int tattr) {
|
||||
int wtitle(const char* str, int tpos, vattr tattr) {
|
||||
|
||||
// check for active window
|
||||
if(!gwin.total)
|
||||
@@ -2023,8 +2024,8 @@ int wtitle(const char* str, int tpos, int tattr) {
|
||||
|
||||
void wscrollbar(int orientation, uint total, uint maxpos, uint pos, int sadd) {
|
||||
|
||||
int attr = (gwin.active->sbattr == -1) ? gwin.active->battr : gwin.active->sbattr;
|
||||
int invattr = revsattr(attr);
|
||||
vattr attr = (gwin.active->sbattr == DEFATTR) ? gwin.active->battr : gwin.active->sbattr;
|
||||
vattr invattr = revsattr(attr);
|
||||
|
||||
const vchar barchar = _box_table(gwin.active->btype, 13);
|
||||
const vchar arrowupchar = '\x18';
|
||||
@@ -2033,10 +2034,10 @@ void wscrollbar(int orientation, uint total, uint maxpos, uint pos, int sadd) {
|
||||
const vchar arrowrightchar = '\x1A';
|
||||
#ifdef __UNIX__ // prefferable under xterm
|
||||
const vchar thumbchar = ' ';
|
||||
int thumbattr = revsattr(attr);
|
||||
vattr thumbattr = revsattr(attr);
|
||||
#else
|
||||
const vchar thumbchar = '\xDB';
|
||||
int thumbattr = attr;
|
||||
vattr thumbattr = attr;
|
||||
#endif
|
||||
|
||||
if(maxpos == 0)
|
||||
|
@@ -45,7 +45,7 @@ int gwindow::printf(const char* format, ...) {
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
int gwindow::printf(int color, const char* format, ...) {
|
||||
int gwindow::printf(vattr color, const char* format, ...) {
|
||||
|
||||
char buf[255];
|
||||
va_list argptr;
|
||||
@@ -75,7 +75,7 @@ int gwindow::printf(int row, int col, const char* format, ...) {
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
int gwindow::printf(int row, int col, int color, const char* format, ...) {
|
||||
int gwindow::printf(int row, int col, vattr color, const char* format, ...) {
|
||||
|
||||
va_list argptr;
|
||||
char buf[256];
|
||||
|
@@ -40,7 +40,7 @@
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
inline void wgetc(int wrow, int wcol, int* atr, vchar* chr) {
|
||||
inline void wgetc(int wrow, int wcol, vattr* atr, vchar* chr) {
|
||||
|
||||
vgetc(wrow+gwin.active->srow+gwin.active->border, wcol+gwin.active->scol+gwin.active->border, atr, chr);
|
||||
}
|
||||
@@ -68,19 +68,19 @@ protected:
|
||||
|
||||
int window_style;
|
||||
|
||||
int window_color;
|
||||
vattr window_color;
|
||||
|
||||
int border_hi_color;
|
||||
int border_lo_color;
|
||||
vattr border_hi_color;
|
||||
vattr border_lo_color;
|
||||
|
||||
int scrollbar_color;
|
||||
vattr scrollbar_color;
|
||||
|
||||
int title_color;
|
||||
int title_position;
|
||||
vattr title_color;
|
||||
int title_position;
|
||||
|
||||
int message_color;
|
||||
vattr message_color;
|
||||
|
||||
int shadow_color;
|
||||
vattr shadow_color;
|
||||
|
||||
public:
|
||||
|
||||
@@ -146,8 +146,8 @@ public:
|
||||
void set_window_at(int srow, int scol);
|
||||
void set_window_size(int vlen, int hlen);
|
||||
|
||||
void open(int srow, int scol, int erow, int ecol, int style, int bcolor, int wcolor, int sbcolor=-1, int locolor=-1);
|
||||
void openxy(int srow, int scol, int vlen, int hlen, int style, int bcolor, int wcolor, int sbcolor=-1, int locolor=-1);
|
||||
void open(int srow, int scol, int erow, int ecol, int style, vattr bcolor, vattr wcolor, vattr sbcolor = DEFATTR, vattr locolor = DEFATTR);
|
||||
void openxy(int srow, int scol, int vlen, int hlen, int style, vattr bcolor, vattr wcolor, vattr sbcolor = DEFATTR, vattr locolor = DEFATTR);
|
||||
void open();
|
||||
void close();
|
||||
void unlink();
|
||||
@@ -162,16 +162,16 @@ public:
|
||||
int cursor_row();
|
||||
int cursor_column();
|
||||
|
||||
void text_color(int color);
|
||||
void text_color(vattr color);
|
||||
|
||||
void move_cursor(int row, int column);
|
||||
|
||||
void title(const char* title, int color=-1, int position=-1);
|
||||
void title(const char* title, vattr color = DEFATTR, int position=-1);
|
||||
void no_title();
|
||||
|
||||
void message(const char* text, int border, int leftofs, int color=-1);
|
||||
void message(const char* text, int border, int leftofs, vattr color = DEFATTR);
|
||||
|
||||
void shadow(int color=-1);
|
||||
void shadow(vattr color = DEFATTR);
|
||||
void no_shadow();
|
||||
|
||||
void set_vscrollbar_range(int minpos, int maxpos, int visible, int total, int redraw);
|
||||
@@ -180,7 +180,7 @@ public:
|
||||
void set_vscrollbar_pos(int pos, int redraw);
|
||||
void set_hscrollbar_pos(int pos, int redraw);
|
||||
|
||||
void set_scrollbar_color(int color);
|
||||
void set_scrollbar_color(vattr color);
|
||||
|
||||
void vscrollbar(uint total, uint maxpos, uint pos, int sadd=0);
|
||||
void hscrollbar(uint total, uint maxpos, uint pos, int sadd=0);
|
||||
@@ -191,31 +191,31 @@ public:
|
||||
void scroll_box_down(int scol, int srow, int ecol, int erow, int count=1);
|
||||
void scroll_box_up(int scol, int srow, int ecol, int erow, int count=1);
|
||||
|
||||
void getc(int row, int col, int* atr, vchar* chr);
|
||||
void getc(int row, int col, vattr* atr, vchar* chr);
|
||||
|
||||
void putc(vchar ch);
|
||||
void puts(const char* text);
|
||||
void printc(int row, int col, int color, vchar ch);
|
||||
void prints(int row, int col, int color, const char* text);
|
||||
void printvs(int row, int col, int color, const vchar* text);
|
||||
void prints(int row, int col, int color, const std::string& text);
|
||||
void printns(int row, int col, int color, const char* text, int len, vchar fill=' ', int fill_color=-1);
|
||||
void printc(int row, int col, vattr color, vchar ch);
|
||||
void prints(int row, int col, vattr color, const char* text);
|
||||
void printvs(int row, int col, vattr color, const vchar* text);
|
||||
void prints(int row, int col, vattr color, const std::string& text);
|
||||
void printns(int row, int col, vattr color, const char* text, int len, vchar fill=' ', vattr fill_color = DEFATTR);
|
||||
|
||||
int printf(const char* format, ...) __attribute__ ((format (printf, 2, 3)));
|
||||
int printf(int color, const char* format, ...) __attribute__ ((format (printf, 3, 4)));
|
||||
int printf(vattr color, const char* format, ...) __attribute__ ((format (printf, 3, 4)));
|
||||
int printf(int row, int col, const char* format, ...) __attribute__ ((format (printf, 4, 5)));
|
||||
int printf(int row, int col, int color, const char* format, ...) __attribute__ ((format (printf, 5, 6)));
|
||||
int printf(int row, int col, vattr color, const char* format, ...) __attribute__ ((format (printf, 5, 6)));
|
||||
|
||||
void fill_char(vchar ch);
|
||||
void fill(int wsrow, int wscol, int werow, int wecol, vchar ch, int color);
|
||||
void vertical_line(int wsrow, int wscol, int count, int btype, int color);
|
||||
void horizontal_line(int wsrow, int wscol, int count, int btype, int color);
|
||||
void clear(int color=-1);
|
||||
void fill(int wsrow, int wscol, int werow, int wecol, vchar ch, vattr color);
|
||||
void vertical_line(int wsrow, int wscol, int count, int btype, vattr color);
|
||||
void horizontal_line(int wsrow, int wscol, int count, int btype, vattr color);
|
||||
void clear(vattr color = DEFATTR);
|
||||
void clear_eol();
|
||||
void drag(int direction, int howmuch=1);
|
||||
void slide(int row, int col);
|
||||
void putx(int wrow, int wcol, int color, char chr, uint len);
|
||||
void print_center(int row, int color, const char* text);
|
||||
void putx(int wrow, int wcol, vattr color, char chr, uint len);
|
||||
void print_center(int row, vattr color, const char* text);
|
||||
};
|
||||
|
||||
|
||||
@@ -230,8 +230,8 @@ inline void gwindow::init() {
|
||||
window_style = 0;
|
||||
window_color = BLACK|_LGREY;
|
||||
border_hi_color = BLUE|_LGREY;
|
||||
border_lo_color = -1;
|
||||
scrollbar_color = -1;
|
||||
border_lo_color = DEFATTR;
|
||||
scrollbar_color = DEFATTR;
|
||||
title_color = BLUE|_LGREY;
|
||||
title_position = title_center;
|
||||
message_color = BLUE|_LGREY;
|
||||
@@ -259,7 +259,7 @@ inline void gwindow::set_window_size(int vlen, int hlen) {
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
inline void gwindow::open(int srow, int scol, int erow, int ecol, int style, int bcolor, int wcolor, int sbcolor, int locolor) {
|
||||
inline void gwindow::open(int srow, int scol, int erow, int ecol, int style, vattr bcolor, vattr wcolor, vattr sbcolor, vattr locolor) {
|
||||
|
||||
start_row = srow;
|
||||
start_column = scol;
|
||||
@@ -278,7 +278,7 @@ inline void gwindow::open(int srow, int scol, int erow, int ecol, int style, int
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
inline void gwindow::openxy(int srow, int scol, int vlen, int hlen, int style, int bcolor, int wcolor, int sbcolor, int locolor) {
|
||||
inline void gwindow::openxy(int srow, int scol, int vlen, int hlen, int style, vattr bcolor, vattr wcolor, vattr sbcolor, vattr locolor) {
|
||||
|
||||
open(srow, scol, srow+vlen-1, scol+hlen-1, style, bcolor, wcolor, sbcolor, locolor);
|
||||
}
|
||||
@@ -374,7 +374,7 @@ inline int gwindow::cursor_column() {
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
inline void gwindow::text_color(int color) {
|
||||
inline void gwindow::text_color(vattr color) {
|
||||
|
||||
window_color = color;
|
||||
activate_quick();
|
||||
@@ -384,7 +384,7 @@ inline void gwindow::text_color(int color) {
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
inline void gwindow::set_scrollbar_color(int color) {
|
||||
inline void gwindow::set_scrollbar_color(vattr color) {
|
||||
|
||||
wrec->sbattr = color;
|
||||
scrollbar_color = color;
|
||||
@@ -402,9 +402,9 @@ inline void gwindow::move_cursor(int row, int column) {
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
inline void gwindow::title(const char* title, int color, int position) {
|
||||
inline void gwindow::title(const char* title, vattr color, int position) {
|
||||
|
||||
if(color != -1)
|
||||
if(color != DEFATTR)
|
||||
title_color = color;
|
||||
if(position != -1)
|
||||
title_position = position;
|
||||
@@ -423,9 +423,9 @@ inline void gwindow::no_title() {
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
inline void gwindow::message(const char* text, int border, int leftofs, int color) {
|
||||
inline void gwindow::message(const char* text, int border, int leftofs, vattr color) {
|
||||
|
||||
if(color != -1)
|
||||
if(color != DEFATTR)
|
||||
message_color = color;
|
||||
activate_quick();
|
||||
wmessage(text, border, leftofs, message_color);
|
||||
@@ -434,9 +434,9 @@ inline void gwindow::message(const char* text, int border, int leftofs, int colo
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
inline void gwindow::shadow(int color) {
|
||||
inline void gwindow::shadow(vattr color) {
|
||||
|
||||
if(color != -1)
|
||||
if(color != DEFATTR)
|
||||
shadow_color = color;
|
||||
activate_quick();
|
||||
wshadow(shadow_color);
|
||||
@@ -508,7 +508,7 @@ inline void gwindow::scroll_box_up(int scol, int srow, int ecol, int erow, int c
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
inline void gwindow::getc(int row, int col, int* atr, vchar* chr) {
|
||||
inline void gwindow::getc(int row, int col, vattr* atr, vchar* chr) {
|
||||
|
||||
activate_quick();
|
||||
wgetc(row, col, atr, chr);
|
||||
@@ -535,7 +535,7 @@ inline void gwindow::puts(const char* text) {
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
inline void gwindow::printc(int row, int col, int color, vchar ch) {
|
||||
inline void gwindow::printc(int row, int col, vattr color, vchar ch) {
|
||||
|
||||
activate_quick();
|
||||
wprintc(row, col, color, ch);
|
||||
@@ -544,25 +544,25 @@ inline void gwindow::printc(int row, int col, int color, vchar ch) {
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
inline void gwindow::prints(int row, int col, int color, const char* text) {
|
||||
inline void gwindow::prints(int row, int col, vattr color, const char* text) {
|
||||
|
||||
activate_quick();
|
||||
wprints(row, col, color == -1 ? window_color : color, text);
|
||||
wprints(row, col, color == DEFATTR ? window_color : color, text);
|
||||
}
|
||||
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
inline void gwindow::printvs(int row, int col, int color, const vchar* text) {
|
||||
inline void gwindow::printvs(int row, int col, vattr color, const vchar* text) {
|
||||
|
||||
activate_quick();
|
||||
wprintvs(row, col, color == -1 ? window_color : color, text);
|
||||
wprintvs(row, col, color == DEFATTR ? window_color : color, text);
|
||||
}
|
||||
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
inline void gwindow::prints(int row, int col, int color, const std::string& text) {
|
||||
inline void gwindow::prints(int row, int col, vattr color, const std::string& text) {
|
||||
|
||||
prints(row, col, color, text.c_str());
|
||||
}
|
||||
@@ -570,7 +570,7 @@ inline void gwindow::prints(int row, int col, int color, const std::string& text
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
inline void gwindow::printns(int row, int col, int color, const char* text, int len, vchar fill, int fill_color) {
|
||||
inline void gwindow::printns(int row, int col, vattr color, const char* text, int len, vchar fill, vattr fill_color) {
|
||||
|
||||
activate_quick();
|
||||
wprintns(row, col, color, text, len, fill, fill_color);
|
||||
@@ -588,7 +588,7 @@ inline void gwindow::fill_char(vchar ch) {
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
inline void gwindow::fill(int wsrow, int wscol, int werow, int wecol, vchar ch, int color) {
|
||||
inline void gwindow::fill(int wsrow, int wscol, int werow, int wecol, vchar ch, vattr color) {
|
||||
|
||||
activate_quick();
|
||||
wfill(wsrow, wscol, werow, wecol, ch, color);
|
||||
@@ -597,7 +597,7 @@ inline void gwindow::fill(int wsrow, int wscol, int werow, int wecol, vchar ch,
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
inline void gwindow::vertical_line(int wsrow, int wscol, int count, int btype, int color) {
|
||||
inline void gwindow::vertical_line(int wsrow, int wscol, int count, int btype, vattr color) {
|
||||
|
||||
activate_quick();
|
||||
wvline(wsrow, wscol, count, btype, color);
|
||||
@@ -606,7 +606,7 @@ inline void gwindow::vertical_line(int wsrow, int wscol, int count, int btype, i
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
inline void gwindow::horizontal_line(int wsrow, int wscol, int count, int btype, int color) {
|
||||
inline void gwindow::horizontal_line(int wsrow, int wscol, int count, int btype, vattr color) {
|
||||
|
||||
activate_quick();
|
||||
whline(wsrow, wscol, count, btype, color);
|
||||
@@ -615,10 +615,10 @@ inline void gwindow::horizontal_line(int wsrow, int wscol, int count, int btype,
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
inline void gwindow::clear(int color) {
|
||||
inline void gwindow::clear(vattr color) {
|
||||
|
||||
activate_quick();
|
||||
wcclear(color == -1 ? window_color : color);
|
||||
wcclear(color == DEFATTR ? window_color : color);
|
||||
}
|
||||
|
||||
|
||||
@@ -672,7 +672,7 @@ inline void gwindow::slide(int row, int col) {
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
inline void gwindow::print_center(int row, int color, const char* text) {
|
||||
inline void gwindow::print_center(int row, vattr color, const char* text) {
|
||||
|
||||
activate_quick();
|
||||
wcenters(row, color, text);
|
||||
|
@@ -46,10 +46,10 @@ public:
|
||||
const char* file; // help file name
|
||||
int helpptr; // help stack pointer
|
||||
gkey key; // help hot key
|
||||
int winattr; // help window attribute
|
||||
int textattr; // help window text attribute
|
||||
int selattr; // selection text attribute
|
||||
int barattr; // selection bar attribute
|
||||
vattr winattr; // help window attribute
|
||||
vattr textattr; // help window text attribute
|
||||
vattr selattr; // selection text attribute
|
||||
vattr barattr; // selection bar attribute
|
||||
int srow; // help window start row
|
||||
int scol; // help window start column
|
||||
int erow; // help window end row
|
||||
@@ -59,6 +59,27 @@ public:
|
||||
VfvCP open; // pointer to open function
|
||||
gfile* fp; // help file
|
||||
long offset; // help file offset
|
||||
|
||||
_help_t()
|
||||
{
|
||||
memset(help, 0, sizeof(help));
|
||||
file = NULL;
|
||||
helpptr = -1;
|
||||
key = 0;
|
||||
winattr = BLACK|_BLACK;
|
||||
textattr = BLACK|_BLACK;
|
||||
selattr = BLACK|_BLACK;
|
||||
barattr = BLACK|_BLACK;
|
||||
srow = 3;
|
||||
scol = 8;
|
||||
erow = 21;
|
||||
ecol = 71;
|
||||
btype = 0;
|
||||
title = YES;
|
||||
open = NULL;
|
||||
fp = NULL;
|
||||
offset = 0;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -84,7 +105,7 @@ typedef struct _hlpidx_t {
|
||||
|
||||
int whelpcat(int cat);
|
||||
int whelpclr();
|
||||
int whelpdef(const char* file, gkey key, int winattr, int textattr, int selattr, int barattr, VfvCP open);
|
||||
int whelpdef(const char* file, gkey key, vattr winattr, vattr textattr, vattr selattr, vattr barattr, VfvCP open);
|
||||
int whelpop();
|
||||
int whelpopc();
|
||||
int whelppcat(int cat);
|
||||
@@ -92,7 +113,7 @@ int whelpush();
|
||||
int whelpushc(int cat);
|
||||
int whelpwin(int srow, int scol, int erow, int ecol, int btype, int title);
|
||||
void whelpcompile(const char* helpfile, long& offset);
|
||||
inline int whelpundef() { return whelpdef(NULL,0,0,0,0,0,NULL); }
|
||||
inline int whelpundef() { return whelpdef(NULL,0,BLACK|_BLACK,BLACK|_BLACK,BLACK|_BLACK,BLACK|_BLACK,NULL); }
|
||||
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
@@ -71,10 +71,7 @@ static char* catarray[MAXXREF];
|
||||
static int arraycnt = 0;
|
||||
static char buf[BUFSIZE+1];
|
||||
|
||||
_help_t whelp = {
|
||||
{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
|
||||
NULL,-1,0,0,0,0,0,3,8,21,71,0,YES,NULL,NULL,0
|
||||
};
|
||||
_help_t whelp;
|
||||
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
@@ -306,7 +303,7 @@ static void disp_cat() {
|
||||
setonkey(Key_Esc,esc_esc,0);
|
||||
|
||||
// end the menu and process it
|
||||
wmenuend(BASETAGID,M_OMNI|M_NOQS,0,0,whelp.selattr,whelp.selattr,0,whelp.barattr);
|
||||
wmenuend(BASETAGID,M_OMNI|M_NOQS,0,0,whelp.selattr,whelp.selattr,BLACK|_BLACK,whelp.barattr);
|
||||
gmnudropthrough = YES;
|
||||
kbch = i = (gkey)wmenuget();
|
||||
gmnudropthrough = NO;
|
||||
@@ -560,7 +557,7 @@ static void help_handler() {
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
int whelpdef(const char* file, gkey key, int winattr, int textattr, int selattr, int barattr, VfvCP open) {
|
||||
int whelpdef(const char* file, gkey key, vattr winattr, vattr textattr, vattr selattr, vattr barattr, VfvCP open) {
|
||||
|
||||
// is help disengagement requested? If so, un-define the help key.
|
||||
if(file==NULL) {
|
||||
|
@@ -83,7 +83,7 @@ GWin::~GWin() {
|
||||
// ------------------------------------------------------------------
|
||||
// Displays a string in centered in active window
|
||||
|
||||
int wcenters(int wrow, int attr, const char* str) {
|
||||
int wcenters(int wrow, vattr attr, const char* str) {
|
||||
|
||||
register int window_width, string_length;
|
||||
int start_column, border;
|
||||
@@ -133,10 +133,11 @@ int wcenters(int wrow, int attr, const char* str) {
|
||||
|
||||
int wdrag(int direction) {
|
||||
|
||||
int srow, scol, erow, ecol, fill_row, fill_col, i;
|
||||
int nsrow, nscol, nerow, necol, shad_attr=-1;
|
||||
int chars_per_line, lines_per_win;
|
||||
int vert_movement, horz_movement;
|
||||
int srow, scol, erow, ecol, fill_row, fill_col, i;
|
||||
int nsrow, nscol, nerow, necol;
|
||||
vattr shad_attr = DEFATTR;
|
||||
int chars_per_line, lines_per_win;
|
||||
int vert_movement, horz_movement;
|
||||
vsavebuf* win_image;
|
||||
vsavebuf* wp;
|
||||
vatch* p;
|
||||
@@ -243,6 +244,7 @@ int wdrag(int direction) {
|
||||
p += (lines_per_win * chars_per_line);
|
||||
fill_row=erow;
|
||||
}
|
||||
|
||||
vputx(fill_row, scol, vgattr(*p), vgchar(*p), ecol-scol+1);
|
||||
}
|
||||
else {
|
||||
@@ -252,6 +254,7 @@ int wdrag(int direction) {
|
||||
p += chars_per_line;
|
||||
fill_col=ecol;
|
||||
}
|
||||
|
||||
for(i=srow;i<=erow;i++,p+=chars_per_line+1)
|
||||
vputc(i, fill_col, vgattr(*p), vgchar(*p));
|
||||
}
|
||||
@@ -269,8 +272,8 @@ int wdrag(int direction) {
|
||||
gwin.active->ecol = necol;
|
||||
|
||||
// if window has shadow, redraw it
|
||||
if(shad_attr!=-1)
|
||||
wshadow((int)shad_attr);
|
||||
if(shad_attr != DEFATTR)
|
||||
wshadow(shad_attr);
|
||||
|
||||
// reset cursor position
|
||||
vposset(gwin.active->row,gwin.active->column);
|
||||
@@ -285,7 +288,8 @@ int wdrag(int direction) {
|
||||
|
||||
int wslide(int nsrow, int nscol) {
|
||||
|
||||
int shattr=-1, err=0;
|
||||
vattr shattr = DEFATTR;
|
||||
int err = 0;
|
||||
|
||||
// check for active windows
|
||||
if(!gwin.total)
|
||||
@@ -312,8 +316,8 @@ int wslide(int nsrow, int nscol) {
|
||||
return gwin.werrno;
|
||||
|
||||
// if window has shadow, redraw it
|
||||
if(shattr!=-1)
|
||||
wshadow((int)shattr);
|
||||
if(shattr != DEFATTR)
|
||||
wshadow(shattr);
|
||||
|
||||
// return normally
|
||||
return gwin.werrno=W_NOERROR;
|
||||
|
@@ -56,9 +56,9 @@
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
static int disp_char(int wrow,int wcol,int attr,int btype,vchar ch,int direc) {
|
||||
static int disp_char(int wrow,int wcol, vattr attr,int btype,vchar ch,int direc) {
|
||||
|
||||
attr |= ACSET;
|
||||
attr = attr|ACSET;
|
||||
|
||||
// see if next to a border, if so, connect to it
|
||||
if(gwin.active->border) {
|
||||
@@ -156,7 +156,7 @@ static inline int isrighthorz(int btype, vchar ch) {
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
int whline(int wsrow, int wscol, int count, int btype, int attr) {
|
||||
int whline(int wsrow, int wscol, int count, int btype, vattr attr) {
|
||||
|
||||
register int bt;
|
||||
int row,col,up,down;
|
||||
@@ -237,7 +237,7 @@ int whline(int wsrow, int wscol, int count, int btype, int attr) {
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
int wvline(int wsrow, int wscol, int count, int btype, int attr) {
|
||||
int wvline(int wsrow, int wscol, int count, int btype, vattr attr) {
|
||||
|
||||
register int bt;
|
||||
int row,col,left,right;
|
||||
|
@@ -208,7 +208,7 @@ static void disp_item(_item_t *witem,int bar)
|
||||
__extension__ char buf[sizeof(vatch)*gvid->numcols];
|
||||
#endif
|
||||
char ch;
|
||||
int chattr;
|
||||
vattr chattr;
|
||||
_wrec_t* whp;
|
||||
register const char* p;
|
||||
register vatch* ptr=(vatch*)buf;
|
||||
@@ -229,7 +229,7 @@ static void disp_item(_item_t *witem,int bar)
|
||||
{
|
||||
const int &border = gwin.active->border;
|
||||
const int &btype = gwin.active->btype;
|
||||
const int &attr = gwin.active->loattr;
|
||||
const vattr &attr = gwin.active->loattr;
|
||||
vatch line = vcatch(_box_table(btype, 1), attr);
|
||||
|
||||
if (border) *ptr++ = vcatch(_box_table(btype, 9), attr);
|
||||
@@ -719,7 +719,7 @@ static _item_t * up_item(_item_t *curr)
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
int wmenubeg(int srow, int scol, int erow, int ecol, int btype, int battr, int wattr, VfvCP open, int menutype) {
|
||||
int wmenubeg(int srow, int scol, int erow, int ecol, int btype, vattr battr, vattr wattr, VfvCP open, int menutype) {
|
||||
|
||||
_menu_t* wmenu;
|
||||
|
||||
@@ -762,8 +762,8 @@ int wmenubeg(int srow, int scol, int erow, int ecol, int btype, int battr, int w
|
||||
wmenu->item=NULL;
|
||||
wmenu->title = "";
|
||||
wmenu->titlepos = -1;
|
||||
wmenu->titleattr = 0;
|
||||
wmenu->shadattr = -1;
|
||||
wmenu->titleattr = BLACK|_BLACK;
|
||||
wmenu->shadattr = DEFATTR;
|
||||
wmenu->items = 0;
|
||||
|
||||
// increment menu level
|
||||
@@ -809,7 +809,7 @@ int wmenuitem(int wrow, int wcol, const char* str, char schar, int tagid, int fm
|
||||
witem->dwhdl = -1;
|
||||
witem->dwrow = 0;
|
||||
witem->dwcol = 0;
|
||||
witem->dattr = 0;
|
||||
witem->dattr = BLACK|_BLACK;
|
||||
witem->redisp = NO;
|
||||
witem->help = help;
|
||||
witem->child = NULL;
|
||||
@@ -843,7 +843,7 @@ int wmenuitem(int wrow, int wcol, const char* str, char schar, int tagid, int fm
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
int wmenuend(int taginit, int menutype, int barwidth, int textpos, int textattr, int scharattr, int noselattr, int barattr) {
|
||||
int wmenuend(int taginit, int menutype, int barwidth, int textpos, vattr textattr, vattr scharattr, vattr noselattr, vattr barattr) {
|
||||
|
||||
_item_t* item;
|
||||
int w_width, border, found;
|
||||
@@ -926,8 +926,8 @@ int wmenuget() {
|
||||
hide_mouse_cursor_mnu();
|
||||
if(!wopen(gwin.cmenu->srow,gwin.cmenu->scol,gwin.cmenu->erow,gwin.cmenu->ecol,gwin.cmenu->btype,gwin.cmenu->battr,gwin.cmenu->wattr,gwin.cmenu->sbattr,gwin.cmenu->loattr))
|
||||
return -1;
|
||||
if(gwin.cmenu->shadattr != -1)
|
||||
wshadow((int)gwin.cmenu->shadattr);
|
||||
if(gwin.cmenu->shadattr != DEFATTR)
|
||||
wshadow(gwin.cmenu->shadattr);
|
||||
if(gwin.cmenu->title and *gwin.cmenu->title)
|
||||
wtitle(gwin.cmenu->title, gwin.cmenu->titlepos, gwin.cmenu->titleattr);
|
||||
show_mouse_cursor_mnu();
|
||||
@@ -1352,7 +1352,7 @@ _item_t* wmenuifind(int tagid) {
|
||||
// ------------------------------------------------------------------
|
||||
// Adds a text description to menu item
|
||||
|
||||
int wmenuitxt(int whdl, int wrow, int wcol, int attr, const char* str) {
|
||||
int wmenuitxt(int whdl, int wrow, int wcol, vattr attr, const char* str) {
|
||||
|
||||
// make sure at least 1 menu item has been defined
|
||||
if(!gwin.mlevel or gwin.mlevel>gwin.ilevel)
|
||||
@@ -1363,7 +1363,7 @@ int wmenuitxt(int whdl, int wrow, int wcol, int attr, const char* str) {
|
||||
citem->dwhdl = whdl;
|
||||
citem->dwrow = wrow;
|
||||
citem->dwcol = wcol;
|
||||
citem->dattr = (int)attr;
|
||||
citem->dattr = attr;
|
||||
citem->desc = str;
|
||||
|
||||
// return normally
|
||||
|
@@ -34,22 +34,22 @@
|
||||
void GMnu::Init() {
|
||||
|
||||
bordertype = 0;
|
||||
bordercolor = 0;
|
||||
bordercolor = BLACK|_BLACK;
|
||||
|
||||
textcolor = 0;
|
||||
quickcolor = 0;
|
||||
noselcolor = 0;
|
||||
barcolor = 0;
|
||||
shadowcolor = -1;
|
||||
textcolor = BLACK|_BLACK;
|
||||
quickcolor = BLACK|_BLACK;
|
||||
noselcolor = BLACK|_BLACK;
|
||||
barcolor = BLACK|_BLACK;
|
||||
shadowcolor = DEFATTR;
|
||||
|
||||
title = NULL;
|
||||
titlepos = TCENTER;
|
||||
titlecolor = 0;
|
||||
titlecolor = BLACK|_BLACK;
|
||||
|
||||
deschdl = -1;
|
||||
descrow = 0;
|
||||
desccolumn = 0;
|
||||
desccolor = 0;
|
||||
desccolor = BLACK|_BLACK;
|
||||
|
||||
helpnumber = -1;
|
||||
|
||||
@@ -70,7 +70,7 @@ void GMnu::Init() {
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
void GMnu::SetBorder(int type, int color) {
|
||||
void GMnu::SetBorder(int type, vattr color) {
|
||||
|
||||
bordertype = type;
|
||||
bordercolor = color;
|
||||
@@ -79,7 +79,7 @@ void GMnu::SetBorder(int type, int color) {
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
void GMnu::SetColor(int text, int quick, int nosel, int bar, int shadow) {
|
||||
void GMnu::SetColor(vattr text, vattr quick, vattr nosel, vattr bar, vattr shadow) {
|
||||
|
||||
textcolor = text;
|
||||
quickcolor = quick;
|
||||
@@ -91,7 +91,7 @@ void GMnu::SetColor(int text, int quick, int nosel, int bar, int shadow) {
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
void GMnu::SetTitle(const char* text, int color, int pos) {
|
||||
void GMnu::SetTitle(const char* text, vattr color, int pos) {
|
||||
|
||||
title = text;
|
||||
titlepos = pos;
|
||||
@@ -109,7 +109,7 @@ void GMnu::SetTitle(const char* text) {
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
void GMnu::SetDesc(int hdl, int row, int col, int color) {
|
||||
void GMnu::SetDesc(int hdl, int row, int col, vattr color) {
|
||||
|
||||
deschdl = hdl;
|
||||
descrow = row;
|
||||
|
@@ -122,7 +122,7 @@ static void pre_exit(char** p, int numelems) {
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
bool wpickfile(int srow, int scol, int erow, int ecol, int btype, int bordattr, int winattr, int barattr, bool title, std::string &filespec, IfcpCP open, bool casesens) {
|
||||
bool wpickfile(int srow, int scol, int erow, int ecol, int btype, vattr bordattr, vattr winattr, vattr barattr, bool title, std::string &filespec, IfcpCP open, bool casesens) {
|
||||
|
||||
Path cwd, dir, namext, tcwd, path, spec;
|
||||
|
||||
|
@@ -47,22 +47,22 @@ int wpickstr_tag = false;
|
||||
// define record that will hold pick window info
|
||||
|
||||
struct r_t {
|
||||
int numelems;
|
||||
int lastelem;
|
||||
int curr;
|
||||
int first;
|
||||
int last;
|
||||
int strsperline;
|
||||
int strsperwin;
|
||||
int maxstrlen;
|
||||
int wwidth;
|
||||
int wheight;
|
||||
int fillspaces;
|
||||
int gapspaces;
|
||||
int xtraspaces;
|
||||
int winattr;
|
||||
int barattr;
|
||||
int scrollbar;
|
||||
int numelems;
|
||||
int lastelem;
|
||||
int curr;
|
||||
int first;
|
||||
int last;
|
||||
int strsperline;
|
||||
int strsperwin;
|
||||
int maxstrlen;
|
||||
int wwidth;
|
||||
int wheight;
|
||||
int fillspaces;
|
||||
int gapspaces;
|
||||
int xtraspaces;
|
||||
vattr winattr;
|
||||
vattr barattr;
|
||||
int scrollbar;
|
||||
};
|
||||
|
||||
|
||||
@@ -403,7 +403,7 @@ static gkey read_mouse(char* strarr[], r_t* r) {
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
int wpickstr(int srow, int scol, int erow, int ecol, int btype, int bordattr, int winattr, int barattr, char* strarr[], int initelem, VfvCP open) {
|
||||
int wpickstr(int srow, int scol, int erow, int ecol, int btype, vattr bordattr, vattr winattr, vattr barattr, char* strarr[], int initelem, VfvCP open) {
|
||||
|
||||
int i, j, maxlen, outside;
|
||||
gkey xch;
|
||||
|
@@ -43,7 +43,8 @@ gwinpick::gwinpick() {
|
||||
key = 0;
|
||||
keyok = false;
|
||||
ypos = xpos = ylen = xlen = 0;
|
||||
btype = battr = wattr = tattr = sattr = hattr = loattr = sbattr = 0;
|
||||
btype = 0;
|
||||
battr = wattr = tattr = sattr = hattr = loattr = sbattr = BLACK|_BLACK;
|
||||
title = NULL;
|
||||
helpcat = 0;
|
||||
maximum_index = minimum_index = maximum_position = index = position = 0;
|
||||
|
@@ -85,13 +85,13 @@ public:
|
||||
uint ylen; // Window Height
|
||||
uint 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
|
||||
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
|
||||
const char* title; // Window Title
|
||||
int helpcat; // Window Help Category
|
||||
uint maximum_index; // List Entries - 1
|
||||
|
@@ -46,12 +46,12 @@ public:
|
||||
|
||||
gwinput* form;
|
||||
|
||||
int pos;
|
||||
int max_pos;
|
||||
int attr;
|
||||
bool fill_acs;
|
||||
int pos;
|
||||
int max_pos;
|
||||
vattr attr;
|
||||
bool fill_acs;
|
||||
vchar fill;
|
||||
int entry;
|
||||
int entry;
|
||||
|
||||
char* buf;
|
||||
int buf_left_pos;
|
||||
@@ -128,9 +128,9 @@ public:
|
||||
cvt_mixedcase
|
||||
};
|
||||
|
||||
int idle_attr;
|
||||
int active_attr;
|
||||
int edit_attr;
|
||||
vattr idle_attr;
|
||||
vattr active_attr;
|
||||
vattr edit_attr;
|
||||
bool fill_acs;
|
||||
|
||||
vchar idle_fill;
|
||||
@@ -151,7 +151,7 @@ public:
|
||||
gwinput(gwindow &w);
|
||||
virtual ~gwinput();
|
||||
|
||||
void setup(int i_attr, int a_attr, int e_attr, vchar fill, bool fill_acs);
|
||||
void setup(vattr i_attr, vattr a_attr, vattr e_attr, vchar fill, bool fill_acs);
|
||||
|
||||
void add_field(int idnum, int wrow, int wcol, int field_width, std::string& dest, int dest_size, int cvt=gwinput::cvt_none, int mode=gwinput::entry_conditional);
|
||||
|
||||
|
@@ -41,7 +41,7 @@ gwinput::gwinput(gwindow &w) : window(w) {
|
||||
|
||||
first_field = current = NULL;
|
||||
fill_acs = false;
|
||||
idle_attr = active_attr = edit_attr = 7;
|
||||
idle_attr = active_attr = edit_attr = LGREY;
|
||||
idle_fill = active_fill = edit_fill = ' ';
|
||||
insert_mode = true;
|
||||
done = dropped = false;
|
||||
@@ -66,7 +66,7 @@ gwinput::~gwinput() {
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
void gwinput::setup(int i_attr, int a_attr, int e_attr, vchar fill, bool f_acs) {
|
||||
void gwinput::setup(vattr i_attr, vattr a_attr, vattr e_attr, vchar fill, bool f_acs) {
|
||||
|
||||
idle_attr = i_attr;
|
||||
active_attr = a_attr;
|
||||
|
Reference in New Issue
Block a user