mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-12-14 03:59:36 +00:00
Keyboard input
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
#include "InputManager.h"
|
||||
#include "MacRoman.h"
|
||||
#include "PLKeyEncoding.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
|
||||
namespace PortabilityLayer
|
||||
{
|
||||
@@ -9,19 +12,68 @@ namespace PortabilityLayer
|
||||
public:
|
||||
InputManagerImpl();
|
||||
|
||||
void GetKeys(unsigned char *keys16) const override;
|
||||
void GetKeys(KeyMap &keyMap) const override;
|
||||
void ApplyEvent(const GpKeyboardInputEvent &vosEvent) override;
|
||||
|
||||
static InputManagerImpl *GetInstance();
|
||||
|
||||
private:
|
||||
unsigned char m_keys[16];
|
||||
void ApplyEventAsKey(const GpKeyboardInputEvent &vosEvent, bool bit);
|
||||
KeyMap m_keyMap;
|
||||
|
||||
static InputManagerImpl ms_instance;
|
||||
};
|
||||
|
||||
void InputManagerImpl::GetKeys(unsigned char *keys16) const
|
||||
void InputManagerImpl::GetKeys(KeyMap &keyMap) const
|
||||
{
|
||||
memcpy(keys16, m_keys, 16);
|
||||
keyMap = m_keyMap;
|
||||
}
|
||||
|
||||
void InputManagerImpl::ApplyEvent(const GpKeyboardInputEvent &vosEvent)
|
||||
{
|
||||
if (vosEvent.m_eventType == GpKeyboardInputEventTypes::kDown)
|
||||
ApplyEventAsKey(vosEvent, true);
|
||||
else if (vosEvent.m_eventType == GpKeyboardInputEventTypes::kUp)
|
||||
ApplyEventAsKey(vosEvent, false);
|
||||
}
|
||||
|
||||
void InputManagerImpl::ApplyEventAsKey(const GpKeyboardInputEvent &vosEvent, bool bit)
|
||||
{
|
||||
switch (vosEvent.m_keyIDSubset)
|
||||
{
|
||||
case GpKeyIDSubsets::kASCII:
|
||||
assert(vosEvent.m_key.m_asciiChar >= 0 && vosEvent.m_key.m_asciiChar < 128);
|
||||
m_keyMap.m_ascii.Set(vosEvent.m_key.m_asciiChar, bit);
|
||||
break;
|
||||
case GpKeyIDSubsets::kUnicode:
|
||||
for (int i = 0; i < 256; i++)
|
||||
{
|
||||
if (MacRoman::g_toUnicode[i] == vosEvent.m_key.m_unicodeChar)
|
||||
{
|
||||
if (i < 128)
|
||||
m_keyMap.m_ascii.Set(i, bit);
|
||||
else
|
||||
m_keyMap.m_macRoman.Set(i - 128, bit);
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case GpKeyIDSubsets::kSpecial:
|
||||
m_keyMap.m_special.Set(vosEvent.m_key.m_specialKey, bit);
|
||||
break;
|
||||
case GpKeyIDSubsets::kNumPadNumber:
|
||||
m_keyMap.m_numPadNumber.Set(vosEvent.m_key.m_numPadNumber, bit);
|
||||
break;
|
||||
case GpKeyIDSubsets::kNumPadSpecial:
|
||||
m_keyMap.m_numPadSpecial.Set(vosEvent.m_key.m_numPadSpecialKey, bit);
|
||||
break;
|
||||
case GpKeyIDSubsets::kFKey:
|
||||
m_keyMap.m_fKey.Set(vosEvent.m_key.m_fKey - 1, bit);
|
||||
break;
|
||||
default:
|
||||
assert(false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
InputManagerImpl *InputManagerImpl::GetInstance()
|
||||
@@ -31,8 +83,6 @@ namespace PortabilityLayer
|
||||
|
||||
InputManagerImpl::InputManagerImpl()
|
||||
{
|
||||
for (int i = 0; i < sizeof(m_keys) / sizeof(m_keys[0]); i++)
|
||||
m_keys[i] = 0;
|
||||
}
|
||||
|
||||
InputManagerImpl InputManagerImpl::ms_instance;
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
struct GpKeyboardInputEvent;
|
||||
struct KeyMap;
|
||||
|
||||
namespace PortabilityLayer
|
||||
{
|
||||
class InputManager
|
||||
{
|
||||
public:
|
||||
virtual void GetKeys(unsigned char *keys16) const = 0;
|
||||
virtual void GetKeys(KeyMap &keys16) const = 0;
|
||||
virtual void ApplyEvent(const GpKeyboardInputEvent &vosEvent) = 0;
|
||||
|
||||
static InputManager *GetInstance();
|
||||
};
|
||||
|
||||
@@ -803,7 +803,7 @@ namespace PortabilityLayer
|
||||
for (size_t i = 0; i < numItems; i++)
|
||||
{
|
||||
MenuItem &item = menu->menuItems[i];
|
||||
item.layoutYOffset = cumulativeHeight;
|
||||
item.layoutYOffset = static_cast<uint16_t>(cumulativeHeight);
|
||||
item.layoutHeight = kMenuItemHeight;
|
||||
|
||||
const uint8_t *itemName = strBlob + item.nameOffsetInStringBlob;
|
||||
@@ -849,8 +849,8 @@ namespace PortabilityLayer
|
||||
{
|
||||
Menu *menu = *menuHdl;
|
||||
|
||||
uint32_t menuLeftXCoordinate = kMenuBarInitialPadding + menu->cumulativeOffset + menu->menuIndex * kMenuBarItemPadding * 2 - kMenuBarItemPadding;
|
||||
uint32_t menuRightXCoordinate = menuLeftXCoordinate + menu->unpaddedTitleWidth + kMenuBarItemPadding * 2;
|
||||
const size_t menuLeftXCoordinate = kMenuBarInitialPadding + menu->cumulativeOffset + menu->menuIndex * kMenuBarItemPadding * 2 - kMenuBarItemPadding;
|
||||
const size_t menuRightXCoordinate = menuLeftXCoordinate + menu->unpaddedTitleWidth + kMenuBarItemPadding * 2;
|
||||
|
||||
if (mouseXCoordinate >= menuLeftXCoordinate && mouseXCoordinate < menuRightXCoordinate)
|
||||
{
|
||||
@@ -878,7 +878,7 @@ namespace PortabilityLayer
|
||||
if (selectedMenuHandle)
|
||||
{
|
||||
Menu *menu = *selectedMenuHandle;
|
||||
const int32_t xCoordinate = kMenuBarInitialPadding + menu->menuIndex * kMenuBarItemPadding * 2 + menu->cumulativeOffset - kMenuBarItemPadding;
|
||||
const int32_t xCoordinate = static_cast<int32_t>(kMenuBarInitialPadding + menu->menuIndex * kMenuBarItemPadding * 2 + menu->cumulativeOffset - kMenuBarItemPadding);
|
||||
|
||||
const Vec2i localPoint = point - Vec2i(xCoordinate, kMenuBarHeight);
|
||||
|
||||
@@ -980,7 +980,7 @@ namespace PortabilityLayer
|
||||
return;
|
||||
|
||||
m_haveItem = true;
|
||||
m_itemIndex = item;
|
||||
m_itemIndex = static_cast<unsigned int>(item);
|
||||
|
||||
if (m_currentMenu)
|
||||
RenderMenu(*m_currentMenu);
|
||||
@@ -1001,7 +1001,7 @@ namespace PortabilityLayer
|
||||
{
|
||||
PortabilityLayer::QDManager *qdManager = PortabilityLayer::QDManager::GetInstance();
|
||||
|
||||
const Rect menuRect = Rect::Create(0, 0, menu->layoutHeight, menu->layoutWidth);
|
||||
const Rect menuRect = Rect::Create(0, 0, static_cast<int16_t>(menu->layoutHeight), static_cast<int16_t>(menu->layoutWidth));
|
||||
|
||||
if (m_menuGraf == nullptr)
|
||||
{
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
#include "PLCore.h"
|
||||
#include "PLApplication.h"
|
||||
#include "PLPasStr.h"
|
||||
#include "PLKeyEncoding.h"
|
||||
#include "PLQuickdraw.h"
|
||||
|
||||
#include "AEManager.h"
|
||||
#include "DisplayDeviceManager.h"
|
||||
#include "FileManager.h"
|
||||
#include "FilePermission.h"
|
||||
#include "FontFamily.h"
|
||||
#include "FontManager.h"
|
||||
#include "GpVOSEvent.h"
|
||||
#include "HostDirectoryCursor.h"
|
||||
@@ -19,14 +22,17 @@
|
||||
#include "InputManager.h"
|
||||
#include "ResourceManager.h"
|
||||
#include "MacFileInfo.h"
|
||||
#include "MacRoman.h"
|
||||
#include "MemoryManager.h"
|
||||
#include "MenuManager.h"
|
||||
#include "MemReaderStream.h"
|
||||
#include "MMHandleBlock.h"
|
||||
#include "RenderedFont.h"
|
||||
#include "ResTypeID.h"
|
||||
#include "RandomNumberGenerator.h"
|
||||
#include "PLBigEndian.h"
|
||||
#include "PLEventQueue.h"
|
||||
#include "PLKeyEncoding.h"
|
||||
#include "QDManager.h"
|
||||
#include "Vec2i.h"
|
||||
#include "WindowDef.h"
|
||||
@@ -94,6 +100,65 @@ static void TranslateMouseInputEvent(const GpMouseInputEvent &vosEvent, Portabil
|
||||
|
||||
static void TranslateKeyboardInputEvent(const GpKeyboardInputEvent &vosEvent, PortabilityLayer::EventQueue *queue)
|
||||
{
|
||||
PortabilityLayer::InputManager *inputManager = PortabilityLayer::InputManager::GetInstance();
|
||||
|
||||
if (vosEvent.m_eventType == GpKeyboardInputEventTypes::kUp || vosEvent.m_eventType == GpKeyboardInputEventTypes::kDown)
|
||||
inputManager->ApplyEvent(vosEvent);
|
||||
|
||||
intptr_t msg = 0;
|
||||
|
||||
switch (vosEvent.m_keyIDSubset)
|
||||
{
|
||||
case GpKeyIDSubsets::kASCII:
|
||||
msg = PL_KEY_ASCII(vosEvent.m_key.m_asciiChar);
|
||||
break;
|
||||
case GpKeyIDSubsets::kFKey:
|
||||
msg = PL_KEY_FKEY(vosEvent.m_key.m_fKey);
|
||||
break;
|
||||
case GpKeyIDSubsets::kNumPadNumber:
|
||||
msg = PL_KEY_NUMPAD_NUMBER(vosEvent.m_key.m_numPadNumber);
|
||||
break;
|
||||
case GpKeyIDSubsets::kSpecial:
|
||||
msg = PL_KEY_SPECIAL_ENCODE(vosEvent.m_key.m_specialKey);
|
||||
break;
|
||||
case GpKeyIDSubsets::kNumPadSpecial:
|
||||
msg = PL_KEY_NUMPAD_SPECIAL_ENCODE(vosEvent.m_key.m_numPadSpecialKey);
|
||||
break;
|
||||
case GpKeyIDSubsets::kUnicode:
|
||||
for (int i = 128; i < 256; i++)
|
||||
{
|
||||
if (PortabilityLayer::MacRoman::g_toUnicode[i] == vosEvent.m_key.m_unicodeChar)
|
||||
{
|
||||
msg = PL_KEY_MACROMAN(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
PL_NotYetImplemented();
|
||||
}
|
||||
|
||||
if (msg == 0)
|
||||
return;
|
||||
|
||||
EventRecord *evt = queue->Enqueue();
|
||||
|
||||
switch (vosEvent.m_eventType)
|
||||
{
|
||||
case GpKeyboardInputEventTypes::kUp:
|
||||
evt->what = keyUp;
|
||||
break;
|
||||
case GpKeyboardInputEventTypes::kDown:
|
||||
evt->what = keyUp;
|
||||
break;
|
||||
case GpKeyboardInputEventTypes::kAuto:
|
||||
evt->what = autoKey;
|
||||
break;
|
||||
};
|
||||
|
||||
evt->message = msg;
|
||||
|
||||
PL_NotYetImplemented_TODO("Modifiers");
|
||||
}
|
||||
|
||||
static void TranslateVOSEvent(const GpVOSEvent *vosEvent, PortabilityLayer::EventQueue *queue)
|
||||
@@ -408,7 +473,7 @@ long TickCount()
|
||||
return PortabilityLayer::DisplayDeviceManager::GetInstance()->GetTickCount();
|
||||
}
|
||||
|
||||
void GetKeys(KeyMap keyMap)
|
||||
void GetKeys(KeyMap &keyMap)
|
||||
{
|
||||
PortabilityLayer::InputManager::GetInstance()->GetKeys(keyMap);
|
||||
}
|
||||
@@ -423,10 +488,49 @@ short HiWord(Int32 v)
|
||||
return (((v >> 16) ^ 0x8000) & 0xffff) - 0x8000;
|
||||
}
|
||||
|
||||
bool BitTst(const KeyMap *keyMap, int bit)
|
||||
static bool BitTestEitherSpecial(const KeyMap &keyMap, int eitherSpecial)
|
||||
{
|
||||
const unsigned char *keyMapBytes = *keyMap;
|
||||
return ((keyMapBytes[bit >> 3] >> (7 - (bit & 0x7))) & 1) != 0;
|
||||
switch (eitherSpecial)
|
||||
{
|
||||
case KeyEventEitherSpecialCategories::kAlt:
|
||||
return keyMap.m_special.Get(GpKeySpecials::kLeftAlt) || keyMap.m_special.Get(GpKeySpecials::kRightAlt);
|
||||
case KeyEventEitherSpecialCategories::kShift:
|
||||
return keyMap.m_special.Get(GpKeySpecials::kLeftShift) || keyMap.m_special.Get(GpKeySpecials::kRightShift);
|
||||
case KeyEventEitherSpecialCategories::kControl:
|
||||
return keyMap.m_special.Get(GpKeySpecials::kLeftCtrl) || keyMap.m_special.Get(GpKeySpecials::kRightCtrl);
|
||||
default:
|
||||
assert(false);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool BitTst(const KeyMap &keyMap, int encodedKey)
|
||||
{
|
||||
const KeyEventType evtType = PL_KEY_GET_EVENT_TYPE(encodedKey);
|
||||
const int evtValue = PL_KEY_GET_VALUE(encodedKey);
|
||||
|
||||
switch (evtType)
|
||||
{
|
||||
case KeyEventType_Special:
|
||||
return keyMap.m_special.Get(evtValue);
|
||||
case KeyEventType_ASCII:
|
||||
return keyMap.m_ascii.Get(evtValue);
|
||||
case KeyEventType_MacRoman:
|
||||
assert(evtValue >= 128 && evtValue < 256);
|
||||
return keyMap.m_macRoman.Get(evtValue - 128);
|
||||
case KeyEventType_NumPadNumber:
|
||||
return keyMap.m_numPadNumber.Get(evtValue);
|
||||
case KeyEventType_NumPadSpecial:
|
||||
return keyMap.m_numPadSpecial.Get(evtValue);
|
||||
case KeyEventType_FKey:
|
||||
assert(evtValue >= 1 && evtValue <= GpFKeyMaximumInclusive);
|
||||
return keyMap.m_fKey.Get(evtValue - 1);
|
||||
case KeyEventType_EitherSpecial:
|
||||
return BitTestEitherSpecial(keyMap, evtValue);
|
||||
default:
|
||||
assert(false);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void NumToString(long number, unsigned char *str)
|
||||
@@ -706,8 +810,40 @@ void DisposeDirectoryFiles(DirectoryFileListEntry *firstDFL)
|
||||
|
||||
short StringWidth(const PLPasStr &str)
|
||||
{
|
||||
PL_NotYetImplemented();
|
||||
return 0;
|
||||
const PortabilityLayer::QDState *qdState = PortabilityLayer::QDManager::GetInstance()->GetState();
|
||||
PortabilityLayer::FontManager *fontManager = PortabilityLayer::FontManager::GetInstance();
|
||||
|
||||
const int textSize = qdState->m_textSize;
|
||||
const int textFace = qdState->m_textFace;
|
||||
const int fontID = qdState->m_fontID;
|
||||
|
||||
int variationFlags = 0;
|
||||
if (textFace & bold)
|
||||
variationFlags |= PortabilityLayer::FontFamilyFlag_Bold;
|
||||
|
||||
PortabilityLayer::FontFamily *fontFamily = nullptr;
|
||||
|
||||
switch (fontID)
|
||||
{
|
||||
case applFont:
|
||||
fontFamily = fontManager->GetApplicationFont(textSize, variationFlags);
|
||||
break;
|
||||
case systemFont:
|
||||
fontFamily = fontManager->GetSystemFont(textSize, variationFlags);
|
||||
break;
|
||||
default:
|
||||
PL_NotYetImplemented();
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!fontFamily)
|
||||
return 0;
|
||||
|
||||
PortabilityLayer::RenderedFont *rfont = fontManager->GetRenderedFontFromFamily(fontFamily, textSize, variationFlags);
|
||||
if (!rfont)
|
||||
return 0;
|
||||
|
||||
return rfont->MeasureString(str.UChars(), str.Length());
|
||||
}
|
||||
|
||||
void GetMouse(Point *point)
|
||||
@@ -765,7 +901,10 @@ void GetDateTime(UInt32 *dateTime)
|
||||
|
||||
void GetTime(DateTimeRec *dateTime)
|
||||
{
|
||||
PL_NotYetImplemented();
|
||||
PL_NotYetImplemented_TODO("DateTime");
|
||||
dateTime->month = 1;
|
||||
dateTime->hour = 0;
|
||||
dateTime->minute = 0;
|
||||
}
|
||||
|
||||
UInt32 GetDblTime()
|
||||
|
||||
@@ -181,8 +181,7 @@ typedef VersRecPtr *VersRecHndl;
|
||||
|
||||
typedef WindowPtr WindowRef; // wtf?
|
||||
|
||||
|
||||
typedef unsigned char KeyMap[16];
|
||||
struct KeyMap;
|
||||
|
||||
enum RegionID
|
||||
{
|
||||
@@ -207,6 +206,7 @@ enum EventCode
|
||||
mouseUp,
|
||||
mouseMove,
|
||||
keyDown,
|
||||
keyUp,
|
||||
autoKey,
|
||||
updateEvt,
|
||||
osEvt,
|
||||
@@ -243,9 +243,6 @@ static const int everyEvent = -1;
|
||||
static const int iBeamCursor = 1;
|
||||
static const int watchCursor = 4;
|
||||
|
||||
static const int charCodeMask = 0xff;
|
||||
static const int keyCodeMask = 0xff00;
|
||||
|
||||
static const int shiftKey = 0x1;
|
||||
static const int cmdKey = 0x2; // Ctrl
|
||||
static const int optionKey = 0x4; // Alt
|
||||
@@ -314,11 +311,11 @@ long MenuSelect(Point point); // Breaks into menu select routine (in practice we
|
||||
|
||||
long MenuKey(int charCode);
|
||||
long TickCount();
|
||||
void GetKeys(KeyMap keyMap);
|
||||
void GetKeys(KeyMap &keyMap);
|
||||
|
||||
short LoWord(Int32 v);
|
||||
short HiWord(Int32 v);
|
||||
bool BitTst(const KeyMap *keyMap, int bit);
|
||||
bool BitTst(const KeyMap &keyMap, int bit);
|
||||
|
||||
void NumToString(long number, unsigned char *str);
|
||||
void ParamText(const PLPasStr &title, const PLPasStr &a, const PLPasStr &b, const PLPasStr &c);
|
||||
|
||||
49
PortabilityLayer/PLKeyEncoding.h
Normal file
49
PortabilityLayer/PLKeyEncoding.h
Normal file
@@ -0,0 +1,49 @@
|
||||
#pragma once
|
||||
|
||||
#include "GpVOSEvent.h"
|
||||
#include "GpBitfield.h"
|
||||
|
||||
enum KeyEventType
|
||||
{
|
||||
KeyEventType_Special,
|
||||
KeyEventType_ASCII,
|
||||
KeyEventType_MacRoman,
|
||||
KeyEventType_NumPadNumber,
|
||||
KeyEventType_NumPadSpecial,
|
||||
KeyEventType_FKey,
|
||||
|
||||
KeyEventType_EitherSpecial,
|
||||
};
|
||||
|
||||
namespace KeyEventEitherSpecialCategories
|
||||
{
|
||||
enum KeyEventEitherSpecialCategory
|
||||
{
|
||||
kControl,
|
||||
kAlt,
|
||||
kShift,
|
||||
};
|
||||
}
|
||||
|
||||
#define PL_KEY_SPECIAL(k) ((KeyEventType_Special) | (GpKeySpecials::k) << 3)
|
||||
#define PL_KEY_SPECIAL_ENCODE(k) ((KeyEventType_Special) | (k) << 3)
|
||||
#define PL_KEY_ASCII(k) ((KeyEventType_ASCII) | (k) << 3)
|
||||
#define PL_KEY_MACROMAN(k) ((KeyEventType_MacRoman) | (k) << 3)
|
||||
#define PL_KEY_NUMPAD_NUMBER(k) ((KeyEventType_NumPadNumber) | (k) << 3)
|
||||
#define PL_KEY_NUMPAD_SPECIAL(k) ((KeyEventType_NumPadSpecial) | (GpKeySpecials::k) << 3)
|
||||
#define PL_KEY_NUMPAD_SPECIAL_ENCODE(k) ((KeyEventType_NumPadSpecial) | (k) << 3)
|
||||
#define PL_KEY_FKEY(k) ((KeyEventType_FKey) | (k) << 3)
|
||||
#define PL_KEY_EITHER_SPECIAL(k) ((KeyEventType_EitherSpecial) | (KeyEventEitherSpecialCategories::k) << 3)
|
||||
|
||||
#define PL_KEY_GET_EVENT_TYPE(k) (static_cast<KeyEventType>(k & 7))
|
||||
#define PL_KEY_GET_VALUE(k) ((k) >> 3)
|
||||
|
||||
struct KeyMap
|
||||
{
|
||||
GpBitfield<GpKeySpecials::kCount> m_special;
|
||||
GpBitfield<128> m_ascii;
|
||||
GpBitfield<128> m_macRoman;
|
||||
GpBitfield<10> m_numPadNumber;
|
||||
GpBitfield<GpNumPadSpecials::kCount> m_numPadSpecial;
|
||||
GpBitfield<GpFKeyMaximumInclusive> m_fKey;
|
||||
};
|
||||
@@ -133,7 +133,7 @@ void MoveTo(int x, int y)
|
||||
|
||||
void LineTo(int x, int y)
|
||||
{
|
||||
PL_NotYetImplemented();
|
||||
PL_NotYetImplemented_TODO("Polys");
|
||||
}
|
||||
|
||||
void SetOrigin(int x, int y)
|
||||
@@ -427,12 +427,12 @@ void PaintRect(const Rect *rect)
|
||||
|
||||
void PaintOval(const Rect *rect)
|
||||
{
|
||||
PL_NotYetImplemented();
|
||||
PL_NotYetImplemented_TODO("Ovals");
|
||||
}
|
||||
|
||||
void PaintRgn(RgnHandle region)
|
||||
{
|
||||
PL_NotYetImplemented();
|
||||
PL_NotYetImplemented_TODO("Polys");
|
||||
}
|
||||
|
||||
void ClipRect(const Rect *rect)
|
||||
@@ -449,17 +449,17 @@ void ClipRect(const Rect *rect)
|
||||
|
||||
void FrameRect(const Rect *rect)
|
||||
{
|
||||
PL_NotYetImplemented();
|
||||
PL_NotYetImplemented_TODO("Rects");
|
||||
}
|
||||
|
||||
void FrameOval(const Rect *rect)
|
||||
{
|
||||
PL_NotYetImplemented();
|
||||
PL_NotYetImplemented_TODO("Ovals");
|
||||
}
|
||||
|
||||
void FrameRoundRect(const Rect *rect, int w, int h)
|
||||
{
|
||||
PL_NotYetImplemented();
|
||||
PL_NotYetImplemented_TODO("Ovals");
|
||||
}
|
||||
|
||||
void PenMode(CopyBitsMode copyBitsMode)
|
||||
@@ -469,12 +469,12 @@ void PenMode(CopyBitsMode copyBitsMode)
|
||||
|
||||
void PenMode(PenModeID penMode)
|
||||
{
|
||||
PL_NotYetImplemented();
|
||||
PL_NotYetImplemented_TODO("Polys");
|
||||
}
|
||||
|
||||
void PenPat(const Pattern *pattern)
|
||||
{
|
||||
PL_NotYetImplemented();
|
||||
PL_NotYetImplemented_TODO("Polys");
|
||||
}
|
||||
|
||||
void PenSize(int w, int h)
|
||||
@@ -484,7 +484,7 @@ void PenSize(int w, int h)
|
||||
|
||||
void PenNormal()
|
||||
{
|
||||
PL_NotYetImplemented();
|
||||
PL_NotYetImplemented_TODO("Polys");
|
||||
}
|
||||
|
||||
void EraseRect(const Rect *rect)
|
||||
@@ -499,24 +499,36 @@ void InvertRect(const Rect *rect)
|
||||
|
||||
void InsetRect(Rect *rect, int x, int y)
|
||||
{
|
||||
PL_NotYetImplemented();
|
||||
rect->left += x;
|
||||
rect->right -= x;
|
||||
rect->top += y;
|
||||
rect->bottom -= y;
|
||||
}
|
||||
|
||||
void Line(int x, int y)
|
||||
{
|
||||
PL_NotYetImplemented();
|
||||
PL_NotYetImplemented_TODO("Polys");
|
||||
}
|
||||
|
||||
Pattern *GetQDGlobalsGray(Pattern *pattern)
|
||||
{
|
||||
PL_NotYetImplemented();
|
||||
return nullptr;
|
||||
uint8_t *patternBytes = *pattern;
|
||||
for (int i = 0; i < 8; i += 2)
|
||||
{
|
||||
patternBytes[i] = 0xaa;
|
||||
patternBytes[i + 1] = 0x55;
|
||||
}
|
||||
|
||||
return pattern;
|
||||
}
|
||||
|
||||
Pattern *GetQDGlobalsBlack(Pattern *pattern)
|
||||
{
|
||||
PL_NotYetImplemented();
|
||||
return nullptr;
|
||||
uint8_t *patternBytes = *pattern;
|
||||
for (int i = 0; i < 8; i++)
|
||||
patternBytes[i] = 255;
|
||||
|
||||
return pattern;
|
||||
}
|
||||
|
||||
void GetIndPattern(Pattern *pattern, int patListID, int index)
|
||||
@@ -712,7 +724,7 @@ void RectRgn(RgnHandle region, const Rect *rect)
|
||||
|
||||
void UnionRgn(RgnHandle regionA, RgnHandle regionB, RgnHandle regionC)
|
||||
{
|
||||
PL_NotYetImplemented();
|
||||
PL_NotYetImplemented_TODO("Polys");
|
||||
}
|
||||
|
||||
void DisposeRgn(RgnHandle rgn)
|
||||
@@ -722,12 +734,12 @@ void DisposeRgn(RgnHandle rgn)
|
||||
|
||||
void OpenRgn()
|
||||
{
|
||||
PL_NotYetImplemented();
|
||||
PL_NotYetImplemented_TODO("Polys");
|
||||
}
|
||||
|
||||
void CloseRgn(RgnHandle rgn)
|
||||
{
|
||||
PL_NotYetImplemented();
|
||||
PL_NotYetImplemented_TODO("Polys");
|
||||
}
|
||||
|
||||
Boolean PtInRgn(Point point, RgnHandle rgn)
|
||||
@@ -738,12 +750,12 @@ Boolean PtInRgn(Point point, RgnHandle rgn)
|
||||
|
||||
void GetClip(RgnHandle rgn)
|
||||
{
|
||||
PL_NotYetImplemented();
|
||||
PL_NotYetImplemented_TODO("Polys");
|
||||
}
|
||||
|
||||
void SetClip(RgnHandle rgn)
|
||||
{
|
||||
PL_NotYetImplemented();
|
||||
PL_NotYetImplemented_TODO("Polys");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -127,6 +127,7 @@
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\GpCommon\GpBitfield.h" />
|
||||
<ClInclude Include="AEHandlerDesc.h" />
|
||||
<ClInclude Include="AEManager.h" />
|
||||
<ClInclude Include="BinarySearch.h" />
|
||||
@@ -189,6 +190,7 @@
|
||||
<ClInclude Include="PLErrorCodes.h" />
|
||||
<ClInclude Include="PLEventQueue.h" />
|
||||
<ClInclude Include="PLFolders.h" />
|
||||
<ClInclude Include="PLKeyEncoding.h" />
|
||||
<ClInclude Include="PLLowMem.h" />
|
||||
<ClInclude Include="PLMacTypes.h" />
|
||||
<ClInclude Include="MenuManager.h" />
|
||||
|
||||
@@ -363,6 +363,12 @@
|
||||
<ClInclude Include="SimpleGraphic.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="PLKeyEncoding.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\GpCommon\GpBitfield.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="CFileStream.cpp">
|
||||
|
||||
Reference in New Issue
Block a user