Pararena2/Sources/Abandoned Routines.c
John Calhoun 806b9b47db First check-in.
This project was originally compiled with THINK C for the Macintosh.
The project file is a THINK C project file. Then there is the assembly
static library (SMS) that is linked in to provide fast, 4-channel sound
(written by Patrick Buckland). Resource files, a balloon file for
“balloon help” when it was a thing…. Good luck to anyone trying to
bring this beast back to life.
2016-01-27 20:50:55 -08:00

1 line
3.1 KiB
C
Executable File

/*======================================================== ShowMenuBar */
void ShowMenuBar (WindowPtr theWindow)
{
Rect theRect;
RgnHandle worldRgn, menuBarRgn;
GrafPtr wasPort;
Point originPt;
if (GetMBarHeight() == 0)
{
GetPort((GrafPtr)&wasPort);
SetPort((GrafPtr)theWindow);
GetOrigin(&originPt);
SetOrigin(0, 0);
MBarHeight = wasMenuBarHeight;
theRect = (**GetGrayRgn()).rgnBBox;
UnionRect(&theRect, &screenBits.bounds, &theRect);
worldRgn = NewRgn();
OpenRgn();
FrameRoundRect(&theRect, 16, 16);
CloseRgn(worldRgn);
theRect = screenBits.bounds;
theRect.bottom = theRect.top + wasMenuBarHeight;
menuBarRgn = NewRgn();
RectRgn(menuBarRgn, &theRect);
SectRgn(worldRgn, menuBarRgn, menuBarRgn); /* /------------------\ */
DisposeRgn(worldRgn); /* |__________________| */
UnionRgn(theWindow->visRgn, menuBarRgn, theWindow->visRgn);
DiffRgn(theWindow->visRgn, menuBarRgn, theWindow->visRgn);
DisposeRgn(menuBarRgn);
DrawMenuBar();
SetOrigin(originPt.h, originPt.v);
SetPort((GrafPtr)wasPort);
}
}
/*======================================================== HideMenuBar */
void HideMenuBar (WindowPtr theWindow)
{
Rect theRect;
RgnHandle worldRgn, menuBarRgn;
GrafPtr wasPort;
Point originPt;
short nowMBarHeight;
nowMBarHeight = GetMBarHeight();
if (nowMBarHeight != 0)
{
GetPort((GrafPtr)&wasPort);
SetPort((GrafPtr)theWindow);
GetOrigin(&originPt);
SetOrigin(0, 0);
wasMenuBarHeight = GetMBarHeight();
MBarHeight = 0;
theRect = (**GetGrayRgn()).rgnBBox;
UnionRect(&theRect, &screenBits.bounds, &theRect);
worldRgn = NewRgn(); // /-----------\
OpenRgn(); // | whole |
FrameRoundRect(&theRect, 16, 16); // | desktop |
CloseRgn(worldRgn); // \___________/
theRect = screenBits.bounds;
theRect.bottom = theRect.top + wasMenuBarHeight;
menuBarRgn = NewRgn();
RectRgn(menuBarRgn, &theRect);
SectRgn(worldRgn, menuBarRgn, menuBarRgn); // /------------------\
DisposeRgn(worldRgn); // |__________________|
UnionRgn(theWindow->visRgn, menuBarRgn, theWindow->visRgn);
DisposeRgn(menuBarRgn);
SetOrigin(originPt.h, originPt.v);
SetPort((GrafPtr)wasPort);
}
}
/*======================================================== ShowMenuBar */
void ShowMenuBar (WindowPtr theWindow)
{
Rect theRect;
short nowMBarHeight;
nowMBarHeight = GetMBarHeight();
if (nowMBarHeight == 0)
{
MBarHeight = wasMenuBarHeight;
DiffRgn(GrayRgn, menuBarRgn, GrayRgn);
DisposeRgn(menuBarRgn);
// DrawMenuBar();
}
}
/*======================================================== HideMenuBar */
void HideMenuBar (WindowPtr theWindow)
{
Rect theRect;
short nowMBarHeight;
nowMBarHeight = GetMBarHeight();
if (nowMBarHeight != 0)
{
wasMenuBarHeight = GetMBarHeight();
MBarHeight = 0;
theRect = screenBits.bounds;
theRect.bottom = theRect.top + wasMenuBarHeight;
menuBarRgn = NewRgn();
RectRgn(menuBarRgn, &theRect);
UnionRgn(GrayRgn, menuBarRgn, GrayRgn);
PaintOne(kNilPointer, menuBarRgn);
}
}