1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-02-24 08:02:22 +00:00

Add new include file xscroll.h defining the Scroll functions implemented in xscroll.c

and used in xwinman.c
Update function declarations from K&R style to new style.
Fix incorrect argument counts for some procedure calls.

	new file:   ../inc/xscroll.h
	modified:   xscroll.c
	modified:   xwinman.c
This commit is contained in:
Nick Briggs
2017-06-07 23:53:03 -07:00
parent 9ea244b927
commit 04b0b3ee0b
3 changed files with 32 additions and 21 deletions

View File

@@ -29,10 +29,9 @@ static char *id = "$Id: xscroll.c,v 1.2 1999/01/03 02:07:48 sybalsky Exp $ Copyr
int ScrollPitch = SCROLL_PITCH;
/* Move the DisplayWindow and the ScrollButtons to a new */
/* position. newX, newY refers to the uppre left corner */
/* position. newX, newY refers to the upper left corner */
/* of the LispDisplay */
void Scroll(dsp, newX, newY) DspInterface dsp;
int newX, newY;
void Scroll(DspInterface dsp, int newX, int newY)
{
/* Limit the newX and newY values. */
dsp->Vissible.x = bound(0, newX, dsp->Display.width - dsp->Vissible.width);
@@ -48,20 +47,20 @@ int newX, newY;
dsp->Vissible.height);
} /* end Scroll */
void JumpScrollVer(dsp, y) DspInterface dsp;
void JumpScrollVer(DspInterface dsp, int y)
{ Scroll(dsp, dsp->Vissible.x, (int)((dsp->Display.width * y) / dsp->Vissible.height)); }
void JumpScrollHor(dsp, x) DspInterface dsp;
void JumpScrollHor(DspInterface dsp, int x)
{ Scroll(dsp, (int)((dsp->Display.width * x) / dsp->Vissible.width), dsp->Vissible.y); }
void ScrollLeft(dsp) DspInterface dsp;
void ScrollLeft(DspInterface dsp)
{ Scroll(dsp, dsp->Vissible.x - ScrollPitch, dsp->Vissible.y); }
void ScrollRight(dsp) DspInterface dsp;
void ScrollRight(DspInterface dsp)
{ Scroll(dsp, dsp->Vissible.x + ScrollPitch, dsp->Vissible.y); }
void ScrollUp(dsp) DspInterface dsp;
void ScrollUp(DspInterface dsp)
{ Scroll(dsp, dsp->Vissible.x, dsp->Vissible.y - ScrollPitch); }
void ScrollDown(dsp) DspInterface dsp;
void ScrollDown(DspInterface dsp)
{ Scroll(dsp, dsp->Vissible.x, dsp->Vissible.y + ScrollPitch); }