Clean out unused API

This commit is contained in:
elasota
2020-03-14 12:03:50 -04:00
parent cea0bde015
commit e114d5c5dd
11 changed files with 3 additions and 188 deletions

View File

@@ -152,7 +152,6 @@ void OpenCoordWindow (void)
wm->PutWindowBehind(coordWindow, wm->GetPutInFrontSentinel()); wm->PutWindowBehind(coordWindow, wm->GetPutInFrontSentinel());
PortabilityLayer::WindowManager::GetInstance()->ShowWindow(coordWindow); PortabilityLayer::WindowManager::GetInstance()->ShowWindow(coordWindow);
// FlagWindowFloating(coordWindow); TEMP - use flaoting windows // FlagWindowFloating(coordWindow); TEMP - use flaoting windows
HiliteAllWindows();
coordH = -1; coordH = -1;
coordV = -1; coordV = -1;

View File

@@ -92,7 +92,6 @@ void HandleMouseEvent (const GpMouseInputEvent &theEvent, uint32_t tick)
GetWindowLeftTop(whichWindow, &isLinkH, &isLinkV); GetWindowLeftTop(whichWindow, &isLinkH, &isLinkV);
else if (whichWindow == coordWindow) else if (whichWindow == coordWindow)
GetWindowLeftTop(whichWindow, &isCoordH, &isCoordV); GetWindowLeftTop(whichWindow, &isCoordH, &isCoordV);
HiliteAllWindows();
break; break;
case RegionIDs::kClose: case RegionIDs::kClose:
@@ -507,28 +506,6 @@ void HandleEvent (void)
} }
} }
//-------------------------------------------------------------- HiliteAllWindows
// Ugly kludge in order to keep "floating windows" (palettes) on top of<6F>
// the main window.
void HiliteAllWindows (void)
{
PL_NotYetImplemented_TODO("DeleteMe");
#if 0
if (mainWindow != nil)
HiliteWindow(mainWindow, true);
if (mapWindow != nil)
HiliteWindow(mapWindow, true);
if (toolsWindow != nil)
HiliteWindow(toolsWindow, true);
if (coordWindow != nil)
HiliteWindow(coordWindow, true);
if (linkWindow != nil)
HiliteWindow(linkWindow, true);
#endif
}
//-------------------------------------------------------------- IgnoreThisClick //-------------------------------------------------------------- IgnoreThisClick
// Another inelegant kludge designed to temporarily prevent an unwanted<65> // Another inelegant kludge designed to temporarily prevent an unwanted<65>

View File

@@ -162,7 +162,6 @@ void FillScreenRed (void);
void DumpToResEditFile (Ptr, long); void DumpToResEditFile (Ptr, long);
void HandleEvent (void); // --- Event.c void HandleEvent (void); // --- Event.c
void HiliteAllWindows (void);
void IgnoreThisClick (void); void IgnoreThisClick (void);
short WhatsOurDepth (void); // --- Environs.c short WhatsOurDepth (void); // --- Environs.c

View File

@@ -238,7 +238,6 @@ void OpenLinkWindow (void)
GetWindowRect(linkWindow, &dest); GetWindowRect(linkWindow, &dest);
PortabilityLayer::WindowManager::GetInstance()->ShowWindow(linkWindow); PortabilityLayer::WindowManager::GetInstance()->ShowWindow(linkWindow);
// FlagWindowFloating(linkWindow); TEMP - use flaoting windows // FlagWindowFloating(linkWindow); TEMP - use flaoting windows
HiliteAllWindows();
PortabilityLayer::WidgetBasicState basicState; PortabilityLayer::WidgetBasicState basicState;
basicState.m_rect = Rect::Create(5, 70, 25, 124); basicState.m_rect = Rect::Create(5, 70, 25, 124);

View File

@@ -29,9 +29,6 @@ void UpdateMenusEditMode (void);
void UpdateMenusNonEditMode (void); void UpdateMenusNonEditMode (void);
void UpdateMenusHouseOpen (void); void UpdateMenusHouseOpen (void);
void UpdateMenusHouseClosed (void); void UpdateMenusHouseClosed (void);
void UpdateResumeDialog (Dialog *);
Boolean ResumeFilter (Dialog *, EventRecord *, short *);
short QueryResumeGame (void);
void HeyYourPissingAHighScore (void); void HeyYourPissingAHighScore (void);
@@ -666,106 +663,6 @@ void UpdateCoordinateCheckmark (Boolean checkIt)
CheckMenuItem(houseMenu, iCoordinateWindow, checkIt); CheckMenuItem(houseMenu, iCoordinateWindow, checkIt);
} }
//-------------------------------------------------------------- UpdateResumeDialog
// Update function for Resume dialog (below).
void UpdateResumeDialog (Dialog *theDialog)
{
DrawDialog(theDialog);
DrawDefaultButton(theDialog);
}
//-------------------------------------------------------------- ResumeFilter
// Dialog filter for the Resume dialog (below).
Boolean ResumeFilter (Dialog *dial, EventRecord *event, short *item)
{
switch (event->what)
{
case keyDown:
switch (event->message)
{
case PL_KEY_SPECIAL(kEnter):
case PL_KEY_NUMPAD_SPECIAL(kEnter):
FlashDialogButton(dial, kOkayButton);
*item = kOkayButton;
return(true);
break;
default:
return(false);
}
break;
case updateEvt:
if ((WindowPtr)event->message == dial->GetWindow())
{
SetPortDialogPort(dial);
UpdateResumeDialog(dial);
EndUpdate(dial->GetWindow());
event->what = nullEvent;
}
return(false);
break;
default:
return(false);
break;
}
}
//-------------------------------------------------------------- QueryResumeGame
// Dialog that asks user whether they want to resume a saved game or<6F>
// begin a new one. It displays a little info on the state of their<69>
// saved game (number of glider left, points, etc.).
short QueryResumeGame (void)
{
#define kResumeGameDial 1025
Dialog *theDial;
houseType *thisHousePtr;
Str255 scoreStr, glidStr;
long hadPoints;
short hitWhat, hadGliders;
char wasState;
Boolean leaving;
// get score & num. gliders
thisHousePtr = *thisHouse;
hadPoints = thisHousePtr->savedGame.score;
hadGliders = thisHousePtr->savedGame.numGliders;
NumToString(hadPoints, scoreStr); // param text strings
NumToString((long)hadGliders, glidStr);
DialogTextSubstitutions substitutions;
if (hadGliders == 1)
substitutions = DialogTextSubstitutions(glidStr, PSTR(""), scoreStr);
else
substitutions = DialogTextSubstitutions(glidStr, PSTR("s"), scoreStr);
// CenterDialog(kResumeGameDial);
theDial = PortabilityLayer::DialogManager::GetInstance()->LoadDialog(kResumeGameDial, kPutInFront, &substitutions);
if (theDial == nil)
RedAlert(kErrDialogDidntLoad);
SetPort(&theDial->GetWindow()->GetDrawSurface()->m_port);
ShowWindow(theDial->GetWindow());
DrawDefaultButton(theDial);
leaving = false;
while (!leaving)
{
ModalDialog(ResumeFilter, &hitWhat);
if ((hitWhat == kSheWantsNewGame) || (hitWhat == kSheWantsResumeGame))
{
leaving = true;
}
}
theDial->Destroy();
return (hitWhat);
}
//-------------------------------------------------------------- DoNotInDemo //-------------------------------------------------------------- DoNotInDemo
// Only compiled for "demo version" of Glider PRO. It brings up a<> // Only compiled for "demo version" of Glider PRO. It brings up a<>
// dialog that says, essentially, "x" feature is not implemented in<69> // dialog that says, essentially, "x" feature is not implemented in<69>

View File

@@ -76,7 +76,7 @@ void UpdateLoadDialog (Dialog *theDialog)
theWindow = theDialog->GetWindow(); theWindow = theDialog->GetWindow();
DrawSurface *surface = theWindow->GetDrawSurface(); DrawSurface *surface = theWindow->GetDrawSurface();
GetWindowBounds(theWindow, kWindowContentRgn, &dialogRect); dialogRect = theWindow->GetDrawSurface()->m_port.GetRect();
ColorFrameWHRect(theDialog->GetWindow()->GetDrawSurface(), 8, 39, 413, 184, kRedOrangeColor8); // box around files ColorFrameWHRect(theDialog->GetWindow()->GetDrawSurface(), 8, 39, 413, 184, kRedOrangeColor8); // box around files

View File

@@ -319,7 +319,6 @@ void OpenToolsWindow (void)
wm->PutWindowBehind(toolsWindow, wm->GetPutInFrontSentinel()); wm->PutWindowBehind(toolsWindow, wm->GetPutInFrontSentinel());
wm->ShowWindow(toolsWindow); wm->ShowWindow(toolsWindow);
// FlagWindowFloating(toolsWindow); TEMP - use flaoting windows // FlagWindowFloating(toolsWindow); TEMP - use flaoting windows
HiliteAllWindows();
{ {
PortabilityLayer::WidgetBasicState state; PortabilityLayer::WidgetBasicState state;

View File

@@ -63,7 +63,7 @@ void GetLocalWindowRect (WindowPtr theWindow, Rect *bounds)
if (theWindow != nil) if (theWindow != nil)
{ {
SetPortWindowPort(theWindow); SetPortWindowPort(theWindow);
GetWindowBounds(theWindow, kWindowContentRgn, bounds); *bounds = theWindow->GetDrawSurface()->m_port.GetRect();
} }
} }

View File

@@ -108,11 +108,6 @@ short FindWindow(Point point, WindowPtr *window)
return part; return part;
} }
void BringToFront(WindowPtr window)
{
PL_NotYetImplemented();
}
bool TrackGoAway(WindowPtr window, Point point) bool TrackGoAway(WindowPtr window, Point point)
{ {
PL_NotYetImplemented(); PL_NotYetImplemented();
@@ -131,21 +126,6 @@ bool TrackBox(WindowPtr window, Point point, int part)
return false; return false;
} }
void HiliteWindow(WindowPtr window, bool highlighted)
{
PL_NotYetImplemented();
}
void GetWindowBounds(WindowPtr window, WindowRegionType windowRegion, Rect *rect)
{
if (windowRegion == kWindowContentRgn)
*rect = window->m_surface.m_port.GetRect();
else
{
PL_NotYetImplemented();
}
}
WindowPtr GetNewCWindow(int resID, void *storage, WindowPtr behind) WindowPtr GetNewCWindow(int resID, void *storage, WindowPtr behind)
{ {
Handle windowResource = PortabilityLayer::ResourceManager::GetInstance()->GetAppResource('WIND', resID); Handle windowResource = PortabilityLayer::ResourceManager::GetInstance()->GetAppResource('WIND', resID);
@@ -168,18 +148,6 @@ WindowPtr GetNewCWindow(int resID, void *storage, WindowPtr behind)
return window; return window;
} }
WindowPtr NewCWindow(void *storage, const Rect *bounds, const PLPasStr &title, Boolean visible, int wdef, WindowPtr behind, long userdata)
{
PL_NotYetImplemented();
return nullptr;
}
WindowPtr NewWindow(void *storage, const Rect *bounds, const PLPasStr &title, Boolean visible, int wdef, WindowPtr behind, long userdata)
{
PL_NotYetImplemented();
return nullptr;
}
void SizeWindow(WindowPtr window, int width, int height, Boolean addToUpdateRegion) void SizeWindow(WindowPtr window, int width, int height, Boolean addToUpdateRegion)
{ {
PortabilityLayer::WindowManager::GetInstance()->ResizeWindow(window, width, height); PortabilityLayer::WindowManager::GetInstance()->ResizeWindow(window, width, height);

View File

@@ -214,24 +214,6 @@ namespace RegionIDs
typedef RegionIDs::RegionID RegionID_t; typedef RegionIDs::RegionID RegionID_t;
enum WindowRegionType
{
kWindowContentRgn
};
enum EventCode
{
mouseDown,
mouseUp,
mouseMove,
keyDown,
keyUp,
autoKey,
updateEvt,
osEvt,
kHighLevelEvent,
};
static const int everyEvent = -1; static const int everyEvent = -1;
static const int iBeamCursor = 1; static const int iBeamCursor = 1;
@@ -252,16 +234,11 @@ void HideCursor();
void Delay(int ticks, UInt32 *endTickCount); void Delay(int ticks, UInt32 *endTickCount);
short FindWindow(Point point, WindowPtr *window); // Translates global coordinates to window coordinates, returns a region ID short FindWindow(Point point, WindowPtr *window); // Translates global coordinates to window coordinates, returns a region ID
void BringToFront(WindowPtr window);
bool TrackGoAway(WindowPtr window, Point point); // Returns true if the close box was actually clicked (?) bool TrackGoAway(WindowPtr window, Point point); // Returns true if the close box was actually clicked (?)
Int32 GrowWindow(WindowPtr window, Point start, Rect *size); Int32 GrowWindow(WindowPtr window, Point start, Rect *size);
bool TrackBox(WindowPtr window, Point point, int part); // Returns true if grow/shrink box was clicked (part corresponds to type) bool TrackBox(WindowPtr window, Point point, int part); // Returns true if grow/shrink box was clicked (part corresponds to type)
void HiliteWindow(WindowPtr window, bool highlighted);
void GetWindowBounds(WindowPtr window, WindowRegionType windowRegion, Rect *rect);
WindowPtr GetNewCWindow(int resID, void *storage, WindowPtr behind); WindowPtr GetNewCWindow(int resID, void *storage, WindowPtr behind);
WindowPtr NewCWindow(void *storage, const Rect *bounds, const PLPasStr &title, Boolean visible, int wdef, WindowPtr behind, long userdata);
WindowPtr NewWindow(void *storage, const Rect *bounds, const PLPasStr &title, Boolean visible, int wdef, WindowPtr behind, long userdata);
void SizeWindow(WindowPtr window, int width, int height, Boolean addToUpdateRegion); void SizeWindow(WindowPtr window, int width, int height, Boolean addToUpdateRegion);
void MoveWindow(WindowPtr window, int x, int y, Boolean moveToFront); void MoveWindow(WindowPtr window, int x, int y, Boolean moveToFront);
void ShowWindow(WindowPtr window); void ShowWindow(WindowPtr window);

View File

@@ -674,7 +674,7 @@ namespace PortabilityLayer
if (m_windowStackTop == impl) if (m_windowStackTop == impl)
{ {
if (WindowImpl *below = impl->GetWindowBelow()) if (WindowImpl *below = impl->GetWindowBelow())
BringToFront(below); PutWindowBehind(below, GetPutInFrontSentinel());
} }
} }