*** empty log message ***

This commit is contained in:
Paul Tucker
1999-07-30 16:46:47 +00:00
parent 7954b94755
commit 88493adb47
7 changed files with 101 additions and 50 deletions

View File

@@ -1,4 +1,23 @@
19990730-13:00 EDT Paul Tucker <ptucker@sympatico.ca>
19990730-12:30 EDT Paul Tucker <ptucker@sympatico.ca>
* source/rtl/gt/gtwin.c
* simplified gtputs and gtSetAttribute
* corrected gtGetCursorStyle for !cci.bVisible return SC_NONE
other cases should be handled by the switch that follows.
* source/rtl/gt/gtdos.c source/rtl/gt/gtwin.c source/rtl/gt/gtos2.c
! renamed gtSetAttribute gtDrawShadow
(currently active only in gtwin)
+ created new gtSetAttribute that will recolor a region.
(currently not used)
* source/rtl/gtapi.c
* modified most internal calls to hb_gtMaxRow/Col to use Static vars.
* gtScroll - fill scrolled region with spaces, not nulls
* source/rtl/console.c
* HB_SHADOW - call gtDrawShadow
* HB_ISCOLOR now active when using gtdos
* include/gtapi.h
+ added decl for gtDrawShadow
19990730-12:00 EDT Paul Tucker <ptucker@sympatico.ca>
* makefile.vc
+ added inkey to harbour.lib
* as submitted by Matteo Baccan

View File

@@ -107,6 +107,7 @@ int hb_gtWriteCon(char * fpStr, ULONG length);
/* private interface listed below. these are common to all platforms */
void gtInit(void);
int gtIsColor(void);
void gtDone(void);
char gtGetScreenWidth(void);
char gtGetScreenHeight(void);
@@ -119,5 +120,6 @@ void gtPuts(char cRow, char cCol, char attr, char *str, int len);
void gtGetText(char cTop, char cLeft, char cBottom, char cRight, char *dest);
void gtPutText(char cTop, char cLeft, char cBottom, char cRight, char *srce);
void gtSetAttribute( char cTop, char cLeft, char cBottom, char cRight, char attribute );
void gtDrawShadow( char cTop, char cLeft, char cBottom, char cRight, char attribute );
#endif /* HB_GTAPI_H_ */

View File

@@ -991,7 +991,7 @@ HARBOUR HB_SHADOW (void)
uiAttr = hb_parni(5);
if( hb_pcount() > 3 )
gtSetAttribute(hb_parni(1)+1,hb_parni(2)+1,hb_parni(3)+1,hb_parni(4)+1,uiAttr);
gtDrawShadow(hb_parni(1)+1,hb_parni(2)+1,hb_parni(3)+1,hb_parni(4)+1,uiAttr);
#endif
}

View File

@@ -32,7 +32,7 @@
static void gtxGetXY(char cRow, char cCol, char *attr, char *ch);
static void gtxPutch(char cRow, char cCol, char attr, char ch);
static int gtIsColor(void);
int gtIsColor(void);
static char gtGetScreenMode(void);
static void gtSetCursorSize(char start, char end);
static void gtGetCursorSize(char *start, char *end);
@@ -45,7 +45,7 @@ void gtDone(void)
{
}
static int gtIsColor(void)
int gtIsColor(void)
{
return gtGetScreenMode() != 7;
}
@@ -297,6 +297,10 @@ void gtPutText(char cTop, char cLeft, char cBottom, char cRight, char *srce)
void gtSetAttribute( char cTop, char cLeft, char cBottom, char cRight, char attribute )
{
}
void gtDrawShadow( char cTop, char cLeft, char cBottom, char cRight, char attribute )
{
}
/* returns col */

View File

@@ -32,6 +32,11 @@ void gtDone(void)
{
}
int gtIsColor(void)
{
return TRUE;
}
char gtGetScreenWidth(void)
{
VIOMODEINFO vi;
@@ -130,3 +135,7 @@ void gtPutText(char cTop, char cLeft, char cBottom, char cRight, char *srce)
void gtSetAttribute( char cTop, char cLeft, char cBottom, cRight, char attribute )
{
}
void gtDrawShadow( char cTop, char cLeft, char cBottom, cRight, char attribute )
{
}

View File

@@ -68,6 +68,12 @@ void gtDone(void)
LOG("Ending");
}
int gtIsColor(void)
{
/* TODO: need to call something to do this instead of returning TRUE */
return TRUE;
}
char gtGetScreenWidth(void)
{
CONSOLE_SCREEN_BUFFER_INFO csbi;
@@ -179,23 +185,12 @@ void gtPuts(char cRow, char cCol, char attr, char *str, int len)
{
DWORD i, dwlen;
COORD coord;
LPWORD pwattr;
LOG("Puts");
pwattr = (LPWORD) hb_xgrab(len * sizeof(*pwattr));
if (!pwattr)
{
return;
}
coord.X = (DWORD) (cCol);
coord.Y = (DWORD) (cRow);
for (i = 0; i < len; i++)
{
*(pwattr + i) = (WORD)attr;
}
WriteConsoleOutputCharacterA(HOutput, str, (DWORD) len, coord, &dwlen);
WriteConsoleOutputAttribute(HOutput, pwattr, (DWORD) len, coord, &dwlen);
hb_xfree(pwattr);
FillConsoleOutputAttribute(HOutput, (WORD)attr, (DWORD)len, coord, &dwlen);
}
void gtGetText(char cTop, char cLeft, char cBottom, char cRight, char *dest)
@@ -280,29 +275,38 @@ void gtSetAttribute( char cTop, char cLeft, char cBottom, char cRight, char attr
DWORD len, y, width;
COORD coord;
LPWORD pwattr;
width = (cRight - cLeft + 1);
pwattr = (LPWORD) hb_xgrab(width * sizeof(*pwattr));
if (!pwattr)
return;
coord.X = (DWORD) (cLeft);
/* TODO: This needs to be adjusted */
memset( pwattr, attribute, width *sizeof(*pwattr) );
for( y=cTop;y<=cBottom;y++)
{
coord.Y = y;
FillConsoleOutputAttribute(HOutput, (WORD)attribute, width, coord, &len);
}
coord.X = (DWORD) (cLeft); /* note */
}
void gtDrawShadow( char cTop, char cLeft, char cBottom, char cRight, char attribute )
{
/* ptucker */
DWORD len, y, width;
COORD coord;
width = (cRight - cLeft + 1);
coord.X = (DWORD) (cLeft);
coord.Y = (DWORD) (cBottom);
WriteConsoleOutputAttribute(HOutput, pwattr, width, coord, &len);
FillConsoleOutputAttribute(HOutput, (WORD)attribute, width, coord, &len);
coord.X = (DWORD) (cRight);
for( y=cTop;y<=cBottom;y++)
{
coord.Y = (DWORD) (y);
WriteConsoleOutputAttribute(HOutput, pwattr, 1, coord, &len);
coord.Y = y;
FillConsoleOutputAttribute(HOutput, (WORD)attribute, 1, coord, &len);
}
hb_xfree( pwattr );
}
char gtCol(void)

View File

@@ -6,6 +6,12 @@
* GTAPI.C: Generic Terminal for Harbour
*
* Latest mods:
* 1.44 19990730 ptucker simplified gtputs and gtSetAttribute
* corrected gtGetCursorStyle for !cci.bVisible
* return SC_NONE - other cases should be handled
* by the switch that follows.
* changed 'case 8:' in gtWriteCon to check
* against uiCol instead of uiRow
* 1.43 19990729 ptucker Corrected a number of calls so params are
* in top,left,bottom,right or row,col order.
* removed call to gtrectsize in gtputtext.
@@ -60,6 +66,8 @@ static USHORT s_uiCurrentRow = 0;
static USHORT s_uiCurrentCol = 0;
static USHORT s_uiDispCount = 0;
static USHORT s_uiColorIndex = 0;
static USHORT s_uiMaxCol;
static USHORT s_uiMaxRow;
int *_Color; /* masks: 0x0007 Background
0x0070 Foreground
@@ -77,6 +85,8 @@ void hb_gtInit(void)
_Color = (int *)hb_xgrab(5*sizeof(int));
_ColorCount = 5;
gtInit();
s_uiMaxCol = hb_gtMaxCol();
s_uiMaxRow = hb_gtMaxRow();
hb_gtSetPos( gtRow(), gtCol() );
hb_gtSetColorStr( hb_set.HB_SET_COLOR );
}
@@ -99,8 +109,8 @@ int hb_gtBox (USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, char
USHORT uiTopBak = uiTop;
USHORT uiLeftBak = uiLeft;
USHORT uiMRow = hb_gtMaxRow();
USHORT uiMCol = hb_gtMaxCol();
USHORT uiMRow = s_uiMaxRow;
USHORT uiMCol = s_uiMaxCol;
/* TODO: Would be better to support these cases, Clipper implementation */
/* was quite messy for these cases, which can be considered as */
@@ -462,8 +472,7 @@ int hb_gtGetPos(USHORT * uipRow, USHORT * uipCol)
BOOL hb_gtIsColor(void)
{
/* TODO: need to call something to do this instead of returning TRUE */
return(TRUE);
return gtIsColor();
}
USHORT hb_gtMaxCol(void)
@@ -488,8 +497,8 @@ int hb_gtPreExt(void)
int hb_gtRectSize(USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, USHORT * uipBuffSize)
{
USHORT uiMRow = hb_gtMaxRow();
USHORT uiMCol = hb_gtMaxCol();
USHORT uiMRow = s_uiMaxRow;
USHORT uiMCol = s_uiMaxCol;
if( uiTop > uiMRow || uiBottom > uiMRow ||
uiLeft > uiMCol || uiRight > uiMCol ||
@@ -532,8 +541,8 @@ int hb_gtSave(USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, char
int hb_gtScrDim(USHORT * uipHeight, USHORT * uipWidth)
{
*uipHeight = hb_gtMaxRow();
*uipWidth = hb_gtMaxCol();
*uipHeight = s_uiMaxRow;
*uipWidth = s_uiMaxCol;
return(0);
}
@@ -554,6 +563,8 @@ int hb_gtSetMode(USHORT uiRows, USHORT uiCols)
{
HB_SYMBOL_UNUSED( uiRows );
HB_SYMBOL_UNUSED( uiCols );
s_uiMaxCol = hb_gtMaxCol();
s_uiMaxRow = hb_gtMaxRow();
return(0);
}
@@ -561,7 +572,7 @@ int hb_gtSetPos(USHORT uiRow, USHORT uiCol)
{
/* TODO: in this situation Clipper just turns off the cursor */
/* any further writes would be accounted for by clipping */
if(uiRow > hb_gtMaxRow() || uiCol > hb_gtMaxCol())
if(uiRow > s_uiMaxRow || uiCol > s_uiMaxCol)
return(1);
s_uiCurrentRow = uiRow;
@@ -588,8 +599,8 @@ int hb_gtWrite(char * fpStr, ULONG length)
/* Determine where the cursor is going to end up */
iRow = s_uiCurrentRow;
iCol = s_uiCurrentCol;
iMaxCol = hb_gtMaxCol();
iMaxRow = hb_gtMaxRow();
iMaxRow = s_uiMaxRow;
iMaxCol = s_uiMaxCol;
size = length;
if (iCol + size > iMaxCol)
{
@@ -666,24 +677,24 @@ int hb_gtWriteCon(char * fpStr, ULONG length)
case 7:
break;
case 8:
if(uiRow > 0) uiCol--;
if(uiCol > 0) uiCol--;
else if(uiRow > 0)
{
uiRow--;
uiCol=hb_gtMaxCol();
uiCol=s_uiMaxCol;
}
else
{
hb_gtScroll(0, 0, hb_gtMaxRow(), hb_gtMaxCol(), -1, 0);
uiCol=hb_gtMaxCol();
hb_gtScroll(0, 0, s_uiMaxRow, s_uiMaxCol, -1, 0);
uiCol=s_uiMaxCol;
}
hb_gtSetPos (uiRow, uiCol);
break;
case 10:
if(uiRow < hb_gtMaxRow()) uiRow++;
if(uiRow < s_uiMaxRow) uiRow++;
else
{
hb_gtScroll(0, 0, hb_gtMaxRow(), hb_gtMaxCol(), 1, 0);
hb_gtScroll(0, 0, s_uiMaxRow, s_uiMaxCol, 1, 0);
}
hb_gtSetPos (uiRow, uiCol);
break;
@@ -713,28 +724,30 @@ int hb_gtScroll(USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, SH
char * fpBuff = (char *)hb_xgrab (iLength * 2);
if (fpBlank && fpBuff)
{
for (iCount = 0; iCount < iLength; iCount++)
fpBlank [iCount] = 0;
memset( fpBlank, ' ', iLength );
iColOld = iColNew = uiLeft;
if (iCols >= 0)
{
iColOld = iColNew = uiLeft;
iColOld += iCols;
iColSize = uiRight - uiLeft;
iColSize -= iCols;
}
else
{
iColOld = iColNew = uiLeft;
iColNew -= iCols;
iColSize = uiRight - uiLeft;
iColSize += iCols;
}
char attr = _Color[s_uiColorIndex] & 0xff;
for (iCount = (iRows >= 0 ? uiTop : uiBottom);
(iRows >= 0 ? iCount <= uiBottom : iCount >= uiTop);
(iRows >= 0 ? iCount++ : iCount--))
{
int iRowPos = iCount + iRows;
char attr=_Color[s_uiColorIndex] & 0xff;
/* Blank the scroll region in the current row */
gtPuts ( iCount, uiLeft, attr, fpBlank, iLength);