mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-12-14 12:09:36 +00:00
Major draw code refactor
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
#pragma once
|
||||
#ifndef __PL_QUICKDRAW_H__
|
||||
#define __PL_QUICKDRAW_H__
|
||||
|
||||
#include "PLCore.h"
|
||||
#include "QDGraf.h"
|
||||
@@ -70,11 +68,20 @@ struct BitMap
|
||||
void Init(const Rect &rect, GpPixelFormat_t pixelFormat, size_t pitch, void *dataPtr);
|
||||
};
|
||||
|
||||
struct RGBColor
|
||||
class RGBColor
|
||||
{
|
||||
unsigned short red;
|
||||
unsigned short green;
|
||||
unsigned short blue;
|
||||
public:
|
||||
RGBColor(uint8_t r, uint8_t g, uint8_t b);
|
||||
RGBColor(const RGBColor &other);
|
||||
|
||||
uint8_t GetRed() const;
|
||||
uint8_t GetGreen() const;
|
||||
uint8_t GetBlue() const;
|
||||
|
||||
private:
|
||||
uint8_t m_r;
|
||||
uint8_t m_g;
|
||||
uint8_t m_b;
|
||||
};
|
||||
|
||||
typedef CIcon *CIconPtr;
|
||||
@@ -90,7 +97,6 @@ void SetPort(GrafPtr graf);
|
||||
void SetPortWindowPort(WindowPtr window);
|
||||
void SetPortDialogPort(Dialog *dialog);
|
||||
|
||||
void BeginUpdate(WindowPtr graf);
|
||||
void EndUpdate(WindowPtr graf);
|
||||
|
||||
PLError_t GetIconSuite(Handle *suite, short resID, IconSuiteFlags flags);
|
||||
@@ -102,27 +108,16 @@ void DisposeCIcon(CIconHandle icon);
|
||||
|
||||
void SetRect(Rect *rect, short left, short top, short right, short bottom);
|
||||
|
||||
void TextSize(int sz);
|
||||
void TextFace(int face);
|
||||
void TextFont(int fontID);
|
||||
int TextWidth(const PLPasStr &str, int firstChar1Based, int length);
|
||||
void MoveTo(int x, int y);
|
||||
void LineTo(int x, int y);
|
||||
void SetOrigin(int x, int y);
|
||||
void ForeColor(SystemColorID color);
|
||||
void BackColor(SystemColorID color);
|
||||
void GetForeColor(RGBColor *color);
|
||||
void Index2Color(int index, RGBColor *color);
|
||||
void RGBForeColor(const RGBColor *color);
|
||||
void DrawString(const PLPasStr &str);
|
||||
void PaintRect(const Rect *rect);
|
||||
void PaintOval(const Rect *rect);
|
||||
void FillScanlineMask(const PortabilityLayer::ScanlineMask *scanlineMask);
|
||||
|
||||
void ClipRect(const Rect *rect);
|
||||
void GetClip(Rect *rect);
|
||||
|
||||
void FrameRect(const Rect *rect);
|
||||
void FrameOval(const Rect *rect);
|
||||
void FrameRoundRect(const Rect *rect, int w, int h);
|
||||
void PenInvertMode(bool invertMode);
|
||||
@@ -130,10 +125,8 @@ void PenMask(bool maskMode);
|
||||
void PenPat(const Pattern *pattern);
|
||||
void PenSize(int w, int h);
|
||||
void PenNormal();
|
||||
void EraseRect(const Rect *rect);
|
||||
void InvertRect(const Rect *rect);
|
||||
void InsetRect(Rect *rect, int x, int y);
|
||||
void Line(int x, int y);
|
||||
Pattern *GetQDGlobalsGray(Pattern *pattern);
|
||||
Pattern *GetQDGlobalsBlack(Pattern *pattern);
|
||||
|
||||
@@ -150,8 +143,8 @@ void CopyMaskConstrained(const BitMap *srcBitmap, const BitMap *maskBitmap, BitM
|
||||
|
||||
bool PointInScanlineMask(Point point, PortabilityLayer::ScanlineMask *scanlineMask);
|
||||
|
||||
BitMap *GetPortBitMapForCopyBits(CGrafPtr grafPtr);
|
||||
CGrafPtr GetWindowPort(WindowPtr window);
|
||||
BitMap *GetPortBitMapForCopyBits(DrawSurface *grafPtr);
|
||||
DrawSurface *GetWindowPort(WindowPtr window);
|
||||
|
||||
// Computes A - B and returns it packed?
|
||||
Int32 DeltaPoint(Point pointA, Point pointB);
|
||||
@@ -165,4 +158,17 @@ Boolean PtInRect(Point point, const Rect *rect);
|
||||
|
||||
void RestoreDeviceClut(void *unknown);
|
||||
|
||||
#endif
|
||||
|
||||
inline RGBColor::RGBColor(uint8_t r, uint8_t g, uint8_t b)
|
||||
: m_r(r)
|
||||
, m_g(g)
|
||||
, m_b(b)
|
||||
{
|
||||
}
|
||||
|
||||
inline RGBColor::RGBColor(const RGBColor &other)
|
||||
: m_r(other.m_r)
|
||||
, m_g(other.m_g)
|
||||
, m_b(other.m_b)
|
||||
{
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user