fixed wrong OffsetRgn to updateRgn

This commit is contained in:
chombier 2001-03-20 20:25:57 +00:00
parent 801e48437b
commit 866d3dc91f
7 changed files with 300 additions and 304 deletions

View File

@ -39,6 +39,9 @@ static void calculateWindowPosition(WindRec *theScreen,Rect *whereAt, short cols
/* wdefpatch.c */ /* wdefpatch.c */
extern void drawicon (short id, Rect *dest); extern void drawicon (short id, Rect *dest);
#if GENERATINGPOWERPC
extern Boolean gHasSetWindowContentColor;
#endif
extern WindRec *screens; extern WindRec *screens;
@ -269,32 +272,27 @@ void RSdrawlocker(short w, RgnHandle visRgn)
} }
} }
short
short RSupdate RSupdatecontent(
( GrafPtr wind,
GrafPtr wind RgnHandle updRgn )
)
/* does updating for the specified window, if it's one of mine.
Returns zero iff it is. */
{ {
short w, x1, x2, y1, y2; short x1, x2, y1, y2;
w = RSfindvwind(wind);
if (RSsetwind(w) < 0)
return(-1); /* not one of mine */
BeginUpdate(wind);
RSregnconv /* find bounds of text area needing updating */ RSregnconv /* find bounds of text area needing updating */
( (
wind->visRgn, updRgn,
&x1, &y1, &x2, &y2, &x1, &y1, &x2, &y2,
RScurrent->fheight, RScurrent->fwidth RScurrent->fheight, RScurrent->fwidth
); );
if (x2 > x1) if (x2 > x1)
{ {
VSredraw(w, x1, y1, x2, y2); /* draw that text */ VSredraw(RSfindvwind(wind), x1, y1, x2, y2); /* draw that text */
/* We must reset, less we risk looking UGLY as sin... */ // We must reset, less we risk looking UGLY as sin...
BackPat(PATTERN(qd.white)); BackPat(PATTERN(qd.white));
PenPat(PATTERN(qd.black)); PenPat(PATTERN(qd.black));
if (TelInfo->haveColorQuickDraw) if (TelInfo->haveColorQuickDraw)
{ {
PmForeColor(0); PmForeColor(0);
@ -312,18 +310,36 @@ short RSupdate
ForeColor(RScolors[7]); /* normal foreground */ ForeColor(RScolors[7]); /* normal foreground */
BackColor(RScolors[0]); /* normal Background */ BackColor(RScolors[0]); /* normal Background */
} }
} /* if */
//now get that annoying strip on the right (CCP)
RSa = -1;
PenMode(patOr);
DrawGrowIcon(wind);
PenMode(patCopy);
//DrawControls(wind);
} }
RSa = -1;
}
return(0);
}
short RSupdate
(
GrafPtr wind
)
/* does updating for the specified window, if it's one of mine.
Returns zero iff it is. */
{
short w, x1, x2, y1, y2;
w = RSfindvwind(wind);
if (RSsetwind(w) < 0)
return(-1); /* not one of mine */
BeginUpdate(wind);
if ( !EmptyRgn(wind->visRgn) ) {
RSupdatecontent(wind, wind->visRgn);
DrawGrowIcon(wind);
UpdateControls(wind, wind->visRgn); UpdateControls(wind, wind->visRgn);
RSdrawlocker(w, wind->visRgn); RSdrawlocker(w, wind->visRgn);
}
EndUpdate(wind); EndUpdate(wind);
return(0); return(0);
} /* RSupdate */ } /* RSupdate */
short RSTextSelected(short w) { /* BYU 2.4.11 */ short RSTextSelected(short w) { /* BYU 2.4.11 */
@ -463,7 +479,6 @@ short RSsize (GrafPtr window, long *where, long modifiers)
return(-2); return(-2);
break; break;
default: //Ok, we can resize; tell host default: //Ok, we can resize; tell host
/* NONO */
cwidth = x2 - x1 + 1; cwidth = x2 - x1 + 1;
if ( cwidth > 255 ) { if ( cwidth > 255 ) {
cwidth = 255; cwidth = 255;
@ -478,18 +493,6 @@ short RSsize (GrafPtr window, long *where, long modifiers)
ssh_glue_wresize(&screens[screenIndex]); ssh_glue_wresize(&screens[screenIndex]);
} }
} }
/*
if ((x2 - x1 + 1) <= 132) { // bug fix from RAB 6/5/97
RScalcwsize(w,x2 - x1 +1);
if (screenIndexValid && screens[screenIndex].naws)
SendNAWSinfo(&screens[screenIndex], (x2-x1+1), (y2-y1+1));
} else { // RAB 6/5/97
RScalcwsize(w, 132);
if (screenIndexValid && screens[screenIndex].naws)
SendNAWSinfo(&screens[screenIndex], 132, (y2-y1+1));
} // RAB 6/5/97
*/
/* NONO */
return (0); return (0);
break; break;
} }
@ -523,6 +526,11 @@ Boolean RSsetcolor
if ( !(TelInfo->haveColorQuickDraw) || (RSsetwind(w) < 0) || (n > 15) || (n < 0)) if ( !(TelInfo->haveColorQuickDraw) || (RSsetwind(w) < 0) || (n > 15) || (n < 0))
return(FALSE); return(FALSE);
#if GENERATINGPOWERPC
if ( n == 1 && gHasSetWindowContentColor ) {
SetWindowContentColor(RScurrent->window, &Color);
}
#endif
SetEntryColor(RScurrent->pal, n, &Color); SetEntryColor(RScurrent->pal, n, &Color);
SetPort(RScurrent->window); SetPort(RScurrent->window);
InvalRect(&RScurrent->window->portRect); InvalRect(&RScurrent->window->portRect);
@ -630,9 +638,7 @@ short RSnewwindow
VSdestroy(w); VSdestroy(w);
return(-2); return(-2);
} }
} } else {
else
{
RGBColor scratchRGB; RGBColor scratchRGB;
RScurrent->window = NewCWindow(0L, wDims, name, showit, (short)8,kInFront, goaway, (long)w); RScurrent->window = NewCWindow(0L, wDims, name, showit, (short)8,kInFront, goaway, (long)w);
@ -1743,14 +1749,18 @@ void RSUpdatePalette(void) //called when ANSI colors have changed, and we need
if (RSsetwind(screens[screenIndex].vs) >= 0) if (RSsetwind(screens[screenIndex].vs) >= 0)
{ {
int i; int i;
for (i = 0; i < 16; i++) for (i = 0; i < 16; i++) {
{
RGBColor tempColor; RGBColor tempColor;
GetEntryColor(TelInfo->AnsiColors, i, &tempColor); GetEntryColor(TelInfo->AnsiColors, i, &tempColor);
SetEntryColor(RScurrent->pal,i+4, &tempColor); //set the new color #if GENERATINGPOWERPC
SetPort(screens[screenIndex].wind); if ( i == 1 && gHasSetWindowContentColor ) {
InvalRect(&(RScurrent->window->portRect));//force a redraw SetWindowContentColor(RScurrent->window, &tempColor);
} }
#endif
SetEntryColor(RScurrent->pal,i+4, &tempColor); //set the new color
}
SetPort(screens[screenIndex].wind);
InvalRect(&RScurrent->window->portRect); //force a redraw
} }
} }
} }

View File

@ -4,6 +4,7 @@ void RSunload(void);
void RSselect(short w, Point pt, EventRecord theEvent); void RSselect(short w, Point pt, EventRecord theEvent);
void RSzoom(GrafPtr window, short code, short shifted); void RSzoom(GrafPtr window, short code, short shifted);
void RSdrawlocker(short w, RgnHandle visRgn); void RSdrawlocker(short w, RgnHandle visRgn);
short RSupdatecontent(GrafPtr wind, RgnHandle updRgn);
short RSupdate(GrafPtr wind); short RSupdate(GrafPtr wind);
short RSTextSelected(short w); short RSTextSelected(short w);
void RSskip(short w, Boolean on); void RSskip(short w, Boolean on);

View File

@ -116,13 +116,20 @@ extern WindRec *screens;
#include "rsmac.proto.h" #include "rsmac.proto.h"
#include <CodeFragments.h>
short MaxRS; short MaxRS;
RSdata *RSlocal, *RScurrent; RSdata *RSlocal, *RScurrent;
Rect noConst, Rect noConst;
RScur; /* cursor rectangle */
RgnHandle RSuRgn; /* update region */ static RgnHandle RSuRgn; /* update region */
static RgnHandle hiddenRgn;
static RgnHandle revealedRgn;
#if GENERATINGPOWERPC
Boolean gHasSetWindowContentColor = 0;
#endif
short RSw=-1, /* last window used */ short RSw=-1, /* last window used */
RSa=0; /* last attrib used */ RSa=0; /* last attrib used */
@ -131,6 +138,10 @@ extern long RScolors[];
// initializes handling of terminal windows // initializes handling of terminal windows
void RSinitall(short max) //max windows to allow void RSinitall(short max) //max windows to allow
{ {
#if GENERATINGPOWERPC
OSErr theErr;
CFragConnectionID connID;
#endif
short i; short i;
MaxRS = max; MaxRS = max;
RSlocal = (RSdata *) myNewPtr(MaxRS * sizeof(RSdata)); RSlocal = (RSdata *) myNewPtr(MaxRS * sizeof(RSdata));
@ -144,17 +155,22 @@ void RSinitall(short max) //max windows to allow
RScurrent->cursor.right = 0; RScurrent->cursor.right = 0;
} }
RSuRgn = NewRgn(); RSuRgn = NewRgn();
RScur.left = 0;
RScur.top = 0;
RScur.bottom = 0;
RScur.right = 0;
if (!TelInfo->haveColorQuickDraw) if (!TelInfo->haveColorQuickDraw)
DisposeHandle((Handle)TelInfo->AnsiColors); DisposeHandle((Handle)TelInfo->AnsiColors);
hiddenRgn = NewRgn();
revealedRgn = NewRgn();
#if GENERATINGPOWERPC
// can't use this: updated scrollbars looks ugly.
/*
theErr = GetSharedLibrary("\pWindowsLib", kPowerPCCFragArch, kFindCFrag, &connID, NULL, NULL);
if ( !theErr ) {
gHasSetWindowContentColor = (FindSymbol( connID, "\pSetWindowContentColor", NULL, NULL ) == noErr);
}
*/
gHasSetWindowContentColor = 0;
#endif
} // RSinitall } // RSinitall
void RSsetConst void RSsetConst
( (
short w short w
@ -193,10 +209,6 @@ short RSsetwind
return(0); return(0);
} /* RSsetwind */ } /* RSsetwind */
void RSvalidateRect(short w)
{
ValidRect(&((RSlocal[w].window)->portRect));
}
void RSbell void RSbell
( (
short w short w
@ -499,9 +511,9 @@ void RSinvText
if (lb.v - ub.v > 1) /* highlight extends across more than two lines */ if (lb.v - ub.v > 1) /* highlight extends across more than two lines */
{ {
/* highlight complete in-between lines */ /* highlight complete in-between lines */
SetRect MYSETRECT
( (
&temp, temp,
0, 0,
(ub.v + 1) * RScurrent->fheight, (ub.v + 1) * RScurrent->fheight,
RScurrent->width, RScurrent->width,
@ -515,6 +527,10 @@ void RSinvText
} /* if */ } /* if */
} /* RSinvText */ } /* RSinvText */
/*
* RSdraw
*/
void RSdraw void RSdraw
( (
short w, /* window number */ short w, /* window number */
@ -530,12 +546,10 @@ void RSdraw
{ {
Rect rect; Rect rect;
short ys; short ys;
RgnHandle oldClip;
if (RSlocal[w].skip) if (RSlocal[w].skip)
return; return;
RSsetwind(w); RSsetwind(w);
// RSsetattr(0); JMB 2.6.1d4
ys = y * RScurrent->fheight; ys = y * RScurrent->fheight;
MYSETRECT /* set up rectangle bounding text being drawn */ MYSETRECT /* set up rectangle bounding text being drawn */
@ -549,45 +563,56 @@ void RSdraw
RSsetattr(a); RSsetattr(a);
if (x <= 0) /* BYU 2.4.12 - Without this, 1 pixel column of reverse */ if (x <= 0)
rect.left = -3; /* BYU 2.4.12 - video text does not clear at left margin */ rect.left = 0;
/* NONO */
oldClip = NewRgn();
if (oldClip) {
GetClip(oldClip);
ClipRect(&rect);
}
/* NONO */
/*
if (rect.bottom == RScurrent->rheight)
rect.bottom += 1; //CCP take care of updating problems while scrolling
*/
EraseRect(&rect); EraseRect(&rect);
if (x <= 0) /* BYU 2.4.12 - Okay, just putting it back the way it was */
rect.left = 0; /* BYU 2.4.12 */
MoveTo(x * RScurrent->fwidth, ys + RScurrent->fascent); MoveTo(x * RScurrent->fwidth, ys + RScurrent->fascent);
DrawText(ptr, 0, len); DrawText(ptr, 0, len);
if (RScurrent->selected) if (RScurrent->selected)
RSinvText(w, *(Point *) &RScurrent->anchor, RSinvText(w, *(Point *) &RScurrent->anchor,
*(Point *) &RScurrent->last, &rect); *(Point *) &RScurrent->last, &rect);
ValidRect(&rect); ValidRect(&rect);
/* NONO */
if (oldClip) {
SetClip(oldClip);
DisposeRgn(oldClip);
}
/* NONO */
} /* RSdraw */ } /* RSdraw */
/*
* ScrollRectInRgn
*/
static void ScrollRectInRgn( WindowPtr window, Rect *inRect, short dh, short dv)
{
/* adjust the update region to track the scrolled window contents */
/* this is actually wrong, we must offset only the
* scrolled rect, not the whole window's update region */
/*OffsetRgn(updRgn, dh, dv);*/
Rect rect = *inRect;
RgnHandle updRgn = ((WindowPeek)window)->updateRgn;
LocalToGlobal( &rect.top );
LocalToGlobal( &rect.bottom );
RectRgn( revealedRgn, &rect );
SectRgn( updRgn, revealedRgn, revealedRgn );
OffsetRgn( revealedRgn, dh, dv );
UnionRgn( revealedRgn, updRgn, updRgn );
ScrollRect(inRect, dh, dv, RSuRgn);
InvalRgn(RSuRgn);
/* doesn't work...
if ( !EmptyRgn(RSuRgn) ) {
OffsetRgn( RSuRgn, inRect->left - rect.left, inRect->top - rect.top );
RSupdatecontent(window, RSuRgn);
DiffRgn( updRgn, RSuRgn, updRgn );
}
*/
}
void RSdelcols void RSdelcols
( (
short w, short w,
@ -610,21 +635,16 @@ void RSdelcols
RScurrent->width, RScurrent->width,
RScurrent->height RScurrent->height
); );
ScrollRect(&rect, -n * RScurrent->fwidth, 0, RSuRgn);
InvalRgn(RSuRgn); ScrollRectInRgn(RScurrent->window, &rect, -n * RScurrent->fwidth, 0);
ValidRect(&rect); /* any necessary redrawing in newly-revealed area will be done by caller */
MYSETRECT /* bounds of newly-revealed area */ if (RScurrent->selected) {
( /* bounds of newly-revealed area */
rect, rect.left = RScurrent->width - (n * RScurrent->fwidth);
RScurrent->width - (n * RScurrent->fwidth),
0,
RScurrent->width,
RScurrent->height
);
if (RScurrent->selected)
/* highlight any newly-revealed part of the current selection */ /* highlight any newly-revealed part of the current selection */
RSinvText(w, *(Point *) &RScurrent->anchor, RSinvText(w, *(Point *) &RScurrent->anchor,
*(Point *) &RScurrent->last, &rect); *(Point *) &RScurrent->last, &rect);
}
} /* RSdelcols */ } /* RSdelcols */
void RSdelchars void RSdelchars
@ -658,9 +678,8 @@ void RSdelchars
else else
{ {
/* scroll remainder of line to the left */ /* scroll remainder of line to the left */
ScrollRect(&rect, - RScurrent->fwidth * n, 0, RSuRgn); ScrollRectInRgn(RScurrent->window, &rect, - n * RScurrent->fwidth, 0);
InvalRgn(RSuRgn);
ValidRect(&rect); /* leave newly-revealed area blank */
if (RScurrent->selected) if (RScurrent->selected)
{ {
/* highlight any part of selection which lies in newly-blanked area */ /* highlight any part of selection which lies in newly-blanked area */
@ -669,9 +688,7 @@ void RSdelchars
HUnlock((Handle) RSuRgn); HUnlock((Handle) RSuRgn);
} /* if */ } /* if */
} /* if */ } /* if */
/* NONO */
RSsetattr(VSIw->attrib); /* restore mode for text drawing */ RSsetattr(VSIw->attrib); /* restore mode for text drawing */
/* NONO */
} /* RSdelchars */ } /* RSdelchars */
void RSdellines void RSdellines
@ -692,7 +709,6 @@ void RSdellines
stuff in between. */ stuff in between. */
{ {
Rect rect; Rect rect;
short RSfheightTimesn, RSfheightTimesbplus1;
if (RSlocal[w].skip) if (RSlocal[w].skip)
return; return;
@ -716,33 +732,18 @@ void RSdellines
} /* if */ } /* if */
} /* if */ } /* if */
/* NONO: scroll 2 pixels more on the left*/
/*rect.left = -1;*/ /* BYU 2.4.12 - necessary */
rect.left = -3;
/* NONO */
rect.right = RScurrent->width;
rect.top = t * RScurrent->fheight;
RSfheightTimesbplus1 = (b + 1) * RScurrent->fheight;
rect.bottom = RSfheightTimesbplus1;
/* adjust the update region to track the scrolled window contents */
RSfheightTimesn = RScurrent->fheight * n;
OffsetRgn(((WindowPeek) RScurrent->window)->updateRgn,
0, -RSfheightTimesn);
ScrollRect(&rect, 0, -RSfheightTimesn, RSuRgn);
RSsetattr(VSIw->attrib); /* restore mode for text drawing */
InvalRgn(RSuRgn);
/* validate the area containing the newly-inserted blank lines. */
/* any necessary redrawing in newly-revealed area will be done by caller */
MYSETRECT MYSETRECT
( (
rect, rect,
0, -3, /* scroll 3 pixels more on the left */
(b - n + 1) * RScurrent->fheight - 1, t * RScurrent->fheight,
RScurrent->width, RScurrent->width,
RSfheightTimesbplus1 + 1 (b + 1) * RScurrent->fheight
); );
ValidRect(&rect);
ScrollRectInRgn(RScurrent->window, &rect, 0, -RScurrent->fheight * n);
RSsetattr(VSIw->attrib); /* restore mode for text drawing */
} /* RSdellines */ } /* RSdellines */
void RSerase void RSerase
@ -762,16 +763,16 @@ void RSerase
return; return;
RSsetwind(w); RSsetwind(w);
RSsetattr(0); /* avoid funny pen modes */ RSsetattr(0); /* avoid funny pen modes */
SetRect
MYSETRECT
( (
&rect, rect,
x1 * RScurrent->fwidth , x1 * RScurrent->fwidth ,
y1 * RScurrent->fheight, y1 * RScurrent->fheight,
(x2 + 1) * RScurrent->fwidth - 1, (x2 + 1) * RScurrent->fwidth - 1,
/* NONO removed bottom line from erase */ (y2 + 1) * RScurrent->fheight
(y2 + 1) * RScurrent->fheight /*+ 1*/
/* NONO */
); );
if (rect.left <= 0) /* little buffer strip on left */ if (rect.left <= 0) /* little buffer strip on left */
rect.left = CHO; rect.left = CHO;
if (rect.right >= RScurrent->width - 1) if (rect.right >= RScurrent->width - 1)
@ -782,9 +783,9 @@ void RSerase
if (RScurrent->selected) if (RScurrent->selected)
/* highlight any part of the selection within the cleared area */ /* highlight any part of the selection within the cleared area */
RSinvText(w, *(Point *) &RScurrent->anchor, *(Point *) &RScurrent->last, &rect); RSinvText(w, *(Point *) &RScurrent->anchor, *(Point *) &RScurrent->last, &rect);
/* NONO */
RSsetattr(VSIw->attrib); /* restore mode for text drawing */ RSsetattr(VSIw->attrib); /* restore mode for text drawing */
/* NONO */
} /* RSerase */ } /* RSerase */
void RSinslines void RSinslines
@ -812,25 +813,19 @@ void RSinslines
*(Point *) &RScurrent->last, &noConst); *(Point *) &RScurrent->last, &noConst);
RScurrent->selected = 0; RScurrent->selected = 0;
} /* if */ } /* if */
/* NONO: scroll 2 pixels more on the left */
/*rect.left = -1;*/ /* BYU 2.4.12 - necessary */ MYSETRECT
rect.left = -3; (
/* NONO */ rect,
rect.right = RScurrent->width; -3, /* scroll 3 pixels more on the left */
rect.top = t * RScurrent->fheight; t * RScurrent->fheight,
rect.bottom = (b + 1) * RScurrent->fheight; RScurrent->width,
/* adjust the update region to track the scrolled window contents */ (b + 1) * RScurrent->fheight
OffsetRgn(((WindowPeek) RScurrent->window)->updateRgn, );
0, RScurrent->fheight * n);
ScrollRect(&rect, 0, RScurrent->fheight * n, RSuRgn); ScrollRectInRgn(RScurrent->window, &rect, 0, RScurrent->fheight * n);
InvalRgn(RSuRgn);
/* newly-inserted area is already blank -- validate it to avoid redrawing. */
/* any necessary redrawing will be done by caller */
SetRect(&rect, 0, t * RScurrent->fheight /*- 1*/,
RScurrent->width, (t + n) * RScurrent->fheight + 1);
ValidRect(&rect);
RSsetattr(VSIw->attrib); /* restore mode for text drawing */ RSsetattr(VSIw->attrib); /* restore mode for text drawing */
/* NONO */
} /* RSinslines */ } /* RSinslines */
void RSinscols void RSinscols
@ -848,28 +843,22 @@ void RSinscols
if (RSlocal[w].skip) if (RSlocal[w].skip)
return; return;
RSsetwind(w); RSsetwind(w);
SetRect /* bounds of entire text area */ MYSETRECT /* bounds of entire text area */
( (
&rect, rect,
0, 0,
0, 0,
RScurrent->width, RScurrent->width,
RScurrent->height RScurrent->height
); );
ScrollRect(&rect, n * RScurrent->fwidth, 0, RSuRgn);
InvalRgn(RSuRgn); ScrollRectInRgn(RScurrent->window, &rect, n * RScurrent->fwidth, 0);
ValidRect(&rect); /* any necessary redrawing in newly-revealed area will be done by caller */
SetRect /* bounds of newly-inserted blank area */ if (RScurrent->selected) {
(
&rect,
0,
0,
(n + 1) * RScurrent->fwidth - 1,
RScurrent->height
);
if (RScurrent->selected)
/* highlight any part of the selection in the newly-blanked area */ /* highlight any part of the selection in the newly-blanked area */
rect.right = (n + 1) * RScurrent->fwidth - 1;
RSinvText(w, *(Point *) &RScurrent->anchor, *(Point *) &RScurrent->last, &rect); RSinvText(w, *(Point *) &RScurrent->anchor, *(Point *) &RScurrent->last, &rect);
}
} /* RSinscols */ } /* RSinscols */
void RSinsstring void RSinsstring
@ -890,33 +879,27 @@ void RSinsstring
if (RSlocal[w].skip) if (RSlocal[w].skip)
return; return;
RSsetwind(w); RSsetwind(w);
SetRect /* bounds of part of line from specified position to end of line */ MYSETRECT /* bounds of part of line from specified position to end of line */
( (
&rect, rect,
x * RScurrent->fwidth, x * RScurrent->fwidth,
y * RScurrent->fheight, y * RScurrent->fheight,
RScurrent->width, RScurrent->width,
(y + 1) * RScurrent->fheight (y + 1) * RScurrent->fheight
); );
ScrollRect(&rect, len * RScurrent->fwidth, 0, RSuRgn); /* scroll remainder of line to the right */
if (RSa != a) /* scroll remainder of line to the right */
RSsetattr(a); ScrollRectInRgn(RScurrent->window, &rect, len * RScurrent->fwidth, 0);
InvalRgn(RSuRgn);
ValidRect(&rect); /* any necessary redrawing in newly-revealed area will be done by caller */ /* bounds area to contain inserted string */
SetRect /* bounds area to contain inserted string */ rect.right = (x + len) * RScurrent->fwidth;
(
&rect,
x * RScurrent->fwidth,
y * RScurrent->fheight,
(x + len) * RScurrent->fwidth,
(y + 1) * RScurrent->fheight
);
EraseRect(&rect); /* erase area to appropriate background */ EraseRect(&rect); /* erase area to appropriate background */
MoveTo MoveTo
( (
x * RScurrent->fwidth, rect.left,
y * RScurrent->fheight + RScurrent->fascent rect.top + RScurrent->fascent
); );
RSsetattr(a);
DrawText(ptr, 0, len); DrawText(ptr, 0, len);
if (RScurrent->selected) if (RScurrent->selected)
/* highlight any part of selection covering the newly-inserted text */ /* highlight any part of selection covering the newly-inserted text */
@ -1126,7 +1109,6 @@ void RSsetsize( short w, short v, short h, short screenIndex)
DrawGrowIcon(RSlocal[w].window); /* Draw in the necessary bugger */ DrawGrowIcon(RSlocal[w].window); /* Draw in the necessary bugger */
/* move the scroll bars to their new positions and sizes, and redisplay them */ /* move the scroll bars to their new positions and sizes, and redisplay them */
SetControlValue(RSlocal[w].scroll, RSlocal[w].current); //because we dont always have this SetControlValue(RSlocal[w].scroll, RSlocal[w].current); //because we dont always have this
if (RSlocal[w].scroll != NULL ) { if (RSlocal[w].scroll != NULL ) {
SizeControl(RSlocal[w].scroll, 16, (v - 13)); SizeControl(RSlocal[w].scroll, 16, (v - 13));
@ -1148,7 +1130,6 @@ void RSsetsize( short w, short v, short h, short screenIndex)
} }
/* draw the locker once the scrollbars has moved */ /* draw the locker once the scrollbars has moved */
RSdrawlocker(w, RSlocal[w].window->visRgn); RSdrawlocker(w, RSlocal[w].window->visRgn);
SetRect(&RSlocal[w].textrect, 0, 0, RSlocal[w].rwidth, RSlocal[w].rheight); SetRect(&RSlocal[w].textrect, 0, 0, RSlocal[w].rwidth, RSlocal[w].rheight);
@ -1179,11 +1160,10 @@ void RSbackground(short w, short value)
SetEntryColor(RSlocal[w].pal,0,&temp2); SetEntryColor(RSlocal[w].pal,0,&temp2);
SetEntryColor(RSlocal[w].pal,1,&temp1); SetEntryColor(RSlocal[w].pal,1,&temp1);
} }
SetPort(RSlocal[w].window);
InvalRect(&RSlocal[w].window->portRect); InvalRect(&RSlocal[w].window->portRect);
}
}
}
}
void RScheckmaxwind(Rect *origRect,short origW, void RScheckmaxwind(Rect *origRect,short origW,
short origH, short *endW, short *endH) short origH, short *endW, short *endH)
{ {

View File

@ -32,4 +32,3 @@ void RSbackground(short w, short value);
void RScheckmaxwind(Rect *origRect, short origW, short origH, short *endW, short *endH); void RScheckmaxwind(Rect *origRect, short origW, short origH, short *endW, short *endH);
void RSTextFont(short myfnum, short myfsiz, short myface); void RSTextFont(short myfnum, short myfsiz, short myface);
Boolean SelectURLAroundPoint(Point current); Boolean SelectURLAroundPoint(Point current);
void RSvalidateRect(short w);

View File

@ -369,7 +369,7 @@ low memory situations */
/* NONO */ /* NONO */
/* VSIw->tabs = (char *) myNewPtr(132);*/ /* NCSA: SB - allow 132 column mode */ /* VSIw->tabs = (char *) myNewPtr(132);*/ /* NCSA: SB - allow 132 column mode */
VSIw->tabs = (char *) myNewPtr(255); VSIw->tabs = (char *) myNewPtr(255); /* up to 255 comumns */
/* NONO */ /* NONO */
if (VSIw->tabs == NULL) /* CCP: Hey? Why not check if we got it?! */ if (VSIw->tabs == NULL) /* CCP: Hey? Why not check if we got it?! */
{ {
@ -380,7 +380,7 @@ low memory situations */
} }
/* NONO */ /* NONO */
/* VSIw->allwidth = 131;*/ /* NCSA: SB - always allocate max lines */ /* VSIw->allwidth = 131;*/ /* NCSA: SB - always allocate max lines */
VSIw->allwidth = 255; /* NCSA: SB - always allocate max lines */ VSIw->allwidth = 255; /* always allocate max lines */
/* NONO */ /* NONO */
if (!VSIw->oldScrollback) { if (!VSIw->oldScrollback) {
if (screensave) if (screensave)
@ -711,12 +711,6 @@ short VSredraw
} }
VSIcurson(w, VSIw->x, VSIw->y, 0); /* restore cursor at original position */ VSIcurson(w, VSIw->x, VSIw->y, 0); /* restore cursor at original position */
/* NONO */
/* ??? what is this for ???
tx1 = ty1 = 0;
tn = 132;
*/
/* NONO */
return(0); return(0);
} /* VSredraw */ } /* VSredraw */
@ -828,12 +822,6 @@ short VSOredraw
VSIcurson(w, VSIw->x, VSIw->y, 0); /* restore cursor at original position */ VSIcurson(w, VSIw->x, VSIw->y, 0); /* restore cursor at original position */
/* NONO */
/* ??? what is this for ???
tx1 = ty1 = 0;
tn = 132;
*/
/* NONO */
return(0); return(0);
} /* VSOredraw */ } /* VSOredraw */
@ -2058,6 +2046,7 @@ short VSPulseOne
VSattrlinePtr ypa; VSattrlinePtr ypa;
short y; short y;
short tx1, tx2, ty1, ty2, tn, offset; short tx1, tx2, ty1, ty2, tn, offset;
short cursOff;
if (VSvalids(w) != 0) if (VSvalids(w) != 0)
return(-3); return(-3);
@ -2087,9 +2076,11 @@ short VSPulseOne
if (VSIclip(&tx1, &ty1, &tx2, &ty2, &tn, &offset)!=0) return 0; // test clip region if (VSIclip(&tx1, &ty1, &tx2, &ty2, &tn, &offset)!=0) return 0; // test clip region
VSIcuroff(w); // temporarily hide cursor cursOff = 0;
// VSIcuroff(w); // temporarily hide cursor // Nah [NONO] (flicker)
// RSerase(w, tx1, ty1, tx2, ty2); // Erase the offending area // Nah [DJ] (flicker) // RSerase(w, tx1, ty1, tx2, ty2); // Erase the offending area // Nah [DJ] (flicker)
// draw visible part of scrollback buffer // draw visible part of scrollback buffer
tx1 = x1; // Set up to clip redraw area to visible area of scrollback buffer tx1 = x1; // Set up to clip redraw area to visible area of scrollback buffer
@ -2119,6 +2110,11 @@ short VSPulseOne
lasta = pa[tx1]; lasta = pa[tx1];
for(x=tx1+1; x<=tx2; x++) { for(x=tx1+1; x<=tx2; x++) {
if (pa[x]!=lasta && VSisblnk(lasta)) { // Ahah! [DJ] if (pa[x]!=lasta && VSisblnk(lasta)) { // Ahah! [DJ]
if (!cursOff) {
// temporarily hide cursor
cursOff = 1;
VSIcuroff(w);
}
RSa = 0; // RAB - shouldn't be necessary, but... RSa = 0; // RAB - shouldn't be necessary, but...
RSdraw(w, lastx, y, lasta, x-lastx, pt + lastx); RSdraw(w, lastx, y, lasta, x-lastx, pt + lastx);
lastx = x; lastx = x;
@ -2126,15 +2122,20 @@ short VSPulseOne
} }
} }
if (lastx<=tx2 && VSisblnk(lasta)) { // Ditto [DJ] if (lastx<=tx2 && VSisblnk(lasta)) { // Ditto [DJ]
if (!cursOff) {
// temporarily hide cursor
cursOff = 1;
VSIcuroff(w);
}
RSa = 0; RSa = 0;
RSdraw(w, lastx, y, lasta, tx2-lastx+1, pt + lastx); RSdraw(w, lastx, y, lasta, tx2-lastx+1, pt + lastx);
} }
ypt = ypt->next; ypt = ypt->next;
} }
} }
if ( cursOff ) {
VSIcurson(w, VSIw->x, VSIw->y, 0); /* restore cursor at original position */ VSIcurson(w, VSIw->x, VSIw->y, 0); /* restore cursor at original position */
}
/* NONO */ /* NONO */
/* ??? what is this for ??? /* ??? what is this for ???
tx1 = ty1 = 0; tx1 = ty1 = 0;
@ -2157,6 +2158,7 @@ short VSOPulseOne
VSattrlinePtr ypa; VSattrlinePtr ypa;
short y; short y;
short tx1, tx2, ty1, ty2, tn, offset; short tx1, tx2, ty1, ty2, tn, offset;
short cursOff;
if (VSvalids(w) != 0) if (VSvalids(w) != 0)
return(-3); return(-3);
@ -2183,7 +2185,8 @@ short VSOPulseOne
if (VSIclip(&tx1, &ty1, &tx2, &ty2, &tn, &offset)!=0) return 0; // test clip region if (VSIclip(&tx1, &ty1, &tx2, &ty2, &tn, &offset)!=0) return 0; // test clip region
VSIcuroff(w); // temporarily hide cursor cursOff = 0;
// VSIcuroff(w); // temporarily hide cursor // Nah [NONO] (flicker)
// RSerase(w, tx1, ty1, tx2, ty2); // Erase the offending area // Nah [DJ] (flicker) // RSerase(w, tx1, ty1, tx2, ty2); // Erase the offending area // Nah [DJ] (flicker)
/* /*
// draw visible part of scrollback buffer // draw visible part of scrollback buffer
@ -2236,6 +2239,11 @@ short VSOPulseOne
lasta = pa[tx1]; lasta = pa[tx1];
for(x=tx1+1; x<=tx2; x++) { for(x=tx1+1; x<=tx2; x++) {
if (pa[x]!=lasta && VSisblnk(lasta)) { // Ahah! [DJ] if (pa[x]!=lasta && VSisblnk(lasta)) { // Ahah! [DJ]
if (!cursOff) {
// temporarily hide cursor
cursOff = 1;
VSIcuroff(w);
}
RSa = 0; RSa = 0;
RSdraw(w, lastx, y, lasta, x-lastx, pt + lastx); RSdraw(w, lastx, y, lasta, x-lastx, pt + lastx);
lastx = x; lastx = x;
@ -2243,6 +2251,11 @@ short VSOPulseOne
} }
} }
if (lastx<=tx2 && VSisblnk(lasta)) { // Ditto [DJ] if (lastx<=tx2 && VSisblnk(lasta)) { // Ditto [DJ]
if (!cursOff) {
// temporarily hide cursor
cursOff = 1;
VSIcuroff(w);
}
RSa = 0; RSa = 0;
RSdraw(w, lastx, y, lasta, tx2-lastx+1, pt + lastx); RSdraw(w, lastx, y, lasta, tx2-lastx+1, pt + lastx);
} }
@ -2252,8 +2265,9 @@ short VSOPulseOne
} }
} }
if ( cursOff ) {
VSIcurson(w, VSIw->x, VSIw->y, 0); /* restore cursor at original position */ VSIcurson(w, VSIw->x, VSIw->y, 0); /* restore cursor at original position */
}
/* NONO */ /* NONO */
/* ??? what is this for ??? /* ??? what is this for ???
tx1 = ty1 = 0; tx1 = ty1 = 0;

View File

@ -1186,9 +1186,6 @@ void VSIscroll
} /* if */ } /* if */
// if (RSisInFront(VSIwn))
// RSvalidateRect(VSIwn);
} /* VSIscroll */ } /* VSIscroll */
void VSOscroll void VSOscroll
@ -1322,8 +1319,6 @@ void VSOscroll
} }
} /* if */ } /* if */
// if (RSisInFront(VSIwn))
// RSvalidateRect(VSIwn);
} /* VSOscroll */ } /* VSOscroll */

View File

@ -455,17 +455,14 @@ void VSem
} //we've got a line full of text in the virtual screen } //we've got a line full of text in the virtual screen
//now update the screen to show what we've done //now update the screen to show what we've done
extra += VSIw->x - sx; extra += VSIw->x - sx;
if (insert) if (insert) {
RSinsstring(VSIwn, VSIw->x - extra, VSIw->y,VSIw->attrib, extra, start); RSinsstring(VSIwn, VSIw->x - extra, VSIw->y,VSIw->attrib, extra, start);
else } else {
{
short x2,y2,offset, sxCopy=sx,yCopy = VSIw->y, extraCopy = extra; short x2,y2,offset, sxCopy=sx,yCopy = VSIw->y, extraCopy = extra;
if (!VSIclip(&sxCopy, &yCopy, &x2, &y2, &extraCopy, &offset)) if (!VSIclip(&sxCopy, &yCopy, &x2, &y2, &extraCopy, &offset))
RSdraw(VSIwn, sxCopy,yCopy, VSIw->attrib,extraCopy,(char *) (start + offset)); RSdraw(VSIwn, sxCopy,yCopy, VSIw->attrib,extraCopy,(char *) (start + offset));
} }
//if (RSisInFront(VSIwn)) //CCP if we are front window, validate the screen
// RSvalidateRect(VSIwn);
VScapture((unsigned char *) start, extra); VScapture((unsigned char *) start, extra);
} /* while */ } /* while */