New placeholders: OffsetRect, PenNormal, PenSize, FrameArc, GetMouse, SndDoCommand

This commit is contained in:
Iliyas Jorio 2020-11-16 07:05:38 +01:00
parent f7b14f7dfe
commit 85d521b196
4 changed files with 74 additions and 7 deletions

View File

@ -191,6 +191,14 @@ void SetRect(Rect* r, short left, short top, short right, short bottom)
r->bottom = bottom;
}
void OffsetRect(Rect* r, short dh, short dv)
{
r->left += dh;
r->right += dh;
r->top += dv;
r->bottom += dv;
}
// ---------------------------------------------------------------------------- -
// GWorld
@ -352,6 +360,16 @@ void RGBForeColor2(const UInt32 color)
penFG = 0xFF000000 | (color & 0x00FFFFFF);
}
void PenNormal(void)
{
TODOMINOR();
}
void PenSize(short width, short height)
{
TODOMINOR();
}
// ---------------------------------------------------------------------------- -
// Paint
@ -448,6 +466,11 @@ void FrameRect(const Rect* r)
curPort->DamageRegion(*r);
}
void FrameArc(const Rect* r, short startAngle, short arcAngle)
{
TODOMINOR();
}
void Pomme::Graphics::DrawARGBPixmap(int left, int top, ARGBPixmap& pixmap)
{
if (!curPort)

View File

@ -179,6 +179,13 @@ void GetKeys(KeyMap km)
#endif
}
void GetMouse(Point* mouseLoc)
{
ONCE(TODOMINOR());
mouseLoc->h = 320;
mouseLoc->v = 240;
}
Boolean Button(void)
{
ONCE(TODOMINOR());

View File

@ -96,12 +96,20 @@ long GetResourceSizeOnDisk(Handle);
long SizeResource(Handle);
//-----------------------------------------------------------------------------
// QuickDraw 2D
// QuickDraw 2D: Shapes
void SetRect(Rect* r, short left, short top, short right, short bottom);
void OffsetRect(Rect* r, short dh, short dv);
// ----------------------------------------------------------------------------
// QuickDraw 2D: PICT
PicHandle GetPicture(short PICTresourceID);
// ----------------------------------------------------------------------------
// QuickDraw 2D: GWorld
void DisposeGWorld(GWorldPtr offscreenGWorld);
// IM:QD:6-16
@ -118,6 +126,15 @@ void GetGWorld(CGrafPtr* port, GDHandle* gdh);
void SetGWorld(CGrafPtr port, GDHandle gdh);
// IM:QD:6-31
PixMapHandle GetGWorldPixMap(GWorldPtr offscreenGWorld);
// IM:QD:6-38
Ptr GetPixBaseAddr(PixMapHandle pm);
// ----------------------------------------------------------------------------
// QuickDraw 2D: Port
void SetPort(GrafPtr port);
void GetPort(GrafPtr* port);
@ -126,6 +143,9 @@ CGrafPtr GetWindowPort(WindowPtr window);
Rect* GetPortBounds(CGrafPtr port, Rect* rect);
// ----------------------------------------------------------------------------
// QuickDraw 2D: Pen state manipulation
void MoveTo(short h, short v);
void GetForeColor(RGBColor* rgb);
@ -144,6 +164,13 @@ void RGBBackColor2(UInt32 color);
// Pomme extension (not part of the original Toolbox API).
void RGBForeColor2(UInt32 color);
void PenNormal(void);
void PenSize(short width, short height);
// ----------------------------------------------------------------------------
// QuickDraw 2D: Paint
void PaintRect(const Rect* r);
void EraseRect(const Rect* r);
@ -152,6 +179,11 @@ void LineTo(short h, short v);
void FrameRect(const Rect*);
void FrameArc(const Rect* r, short startAngle, short arcAngle);
// ----------------------------------------------------------------------------
// QuickDraw 2D: Text rendering
//short TextWidth(const char* textBuf, short firstByte, short byteCount);
short TextWidthC(const char* cstr);
@ -163,12 +195,6 @@ void DrawStringC(const char* cstr);
// IM:QD:7-44
void DrawPicture(PicHandle myPicture, const Rect* dstRect);
// IM:QD:6-31
PixMapHandle GetGWorldPixMap(GWorldPtr offscreenGWorld);
// IM:QD:6-38
Ptr GetPixBaseAddr(PixMapHandle pm);
void CopyBits(
const PixMap* srcBits,
PixMap* dstBits,
@ -218,6 +244,9 @@ void NumToStringC(long theNum, Str255 theString);
void GetKeys(KeyMap);
// Gets current mouse coordinates relative to current port
void GetMouse(Point* mouseLoc);
Boolean Button(void);
//-----------------------------------------------------------------------------
@ -319,6 +348,8 @@ OSErr SndChannelStatus(SndChannelPtr chan, short theLength, SCStatusPtr theStatu
OSErr SndDoImmediate(SndChannelPtr chan, const SndCommand* cmd);
OSErr SndDoCommand(SndChannelPtr chan, const SndCommand* cmd, Boolean noWait);
OSErr GetSoundHeaderOffset(SndListHandle sndHandle, long* offset);
OSErr SndStartFilePlay(SndChannelPtr chan, short fRefNum, short resNum, long bufferSize, Ptr theBuffer, /*AudioSelectionPtr*/ void* theSelection, FilePlayCompletionUPP theCompletion, Boolean async);

View File

@ -521,6 +521,12 @@ OSErr SndDoImmediate(SndChannelPtr chan, const SndCommand* cmd)
return noErr;
}
OSErr SndDoCommand(SndChannelPtr chan, const SndCommand* cmd, Boolean noWait)
{
TODOMINOR();
return noErr;
}
template<typename T>
static void Expect(const T a, const T b, const char* msg)
{