Remove AppleEvents API

This commit is contained in:
elasota
2020-06-02 20:01:16 -04:00
parent eac923c475
commit 2a98bfbc8c
14 changed files with 4 additions and 359 deletions

View File

@@ -1,20 +0,0 @@
#pragma once
#ifndef __PL_AE_HANDLER_DESC_H__
#define __PL_AE_HANDLER_DESC_H__
#include "PLAppleEventsCommonTypes.h"
#include <stdint.h>
namespace PortabilityLayer
{
struct AEHandlerDesc
{
AEEventClass m_eventClass;
AEEventID m_eventID;
AEEventHandler m_handler;
uint32_t m_ref;
};
}
#endif

View File

@@ -1,73 +0,0 @@
#include "AEManager.h"
#include "AEHandlerDesc.h"
#include <vector>
namespace PortabilityLayer
{
class AEManagerImpl final : public AEManager
{
public:
AEManagerImpl();
void Init() override;
void Shutdown() override;
void InstallEventHandler(AEEventClass eventClass, AEEventID eventID, AEEventHandler handler, uint32_t ref, bool isSysHandler) override;
void SetInteractAllowed(AEInteractAllowed interactAllowed) override;
static AEManagerImpl *GetInstance();
private:
std::vector<AEHandlerDesc> m_handlers;
AEInteractAllowed m_interactAllowed;
static AEManagerImpl ms_instance;
};
AEManagerImpl::AEManagerImpl()
: m_interactAllowed(kAEInteractUnknown)
{
}
void AEManagerImpl::Init()
{
m_interactAllowed = kAEInteractUnknown;
}
void AEManagerImpl::Shutdown()
{
m_handlers.clear();
}
void AEManagerImpl::InstallEventHandler(AEEventClass eventClass, AEEventID eventID, AEEventHandler handler, uint32_t ref, bool isSysHandler)
{
AEHandlerDesc desc;
desc.m_eventClass = eventClass;
desc.m_eventID = eventID;
desc.m_handler = handler;
desc.m_ref = ref;
m_handlers.push_back(desc);
}
void AEManagerImpl::SetInteractAllowed(AEInteractAllowed interactAllowed)
{
m_interactAllowed = interactAllowed;
}
AEManagerImpl *AEManagerImpl::GetInstance()
{
return &ms_instance;
}
AEManagerImpl AEManagerImpl::ms_instance;
AEManager *AEManager::GetInstance()
{
return AEManagerImpl::GetInstance();
}
}

View File

@@ -1,24 +0,0 @@
#pragma once
#ifndef __PL_AE_MANAGER_H__
#define __PL_AE_MANAGER_H__
#include "PLAppleEventsCommonTypes.h"
#include <stdint.h>
namespace PortabilityLayer
{
class AEManager
{
public:
virtual void Init() = 0;
virtual void Shutdown() = 0;
virtual void InstallEventHandler(AEEventClass eventClass, AEEventID eventID, AEEventHandler handler, uint32_t ref, bool isSysHandler) = 0;
virtual void SetInteractAllowed(AEInteractAllowed interactAllowed) = 0;
static AEManager *GetInstance();
};
}
#endif

View File

@@ -1,49 +0,0 @@
#include "PLAppleEvents.h"
#include "AEManager.h"
PLError_t AEGetParamDesc(const AppleEvent *evt, AEKeyword keyword, DescType desiredType, AEDescList *descList)
{
PL_NotYetImplemented();
return PLErrors::kNone;
}
PLError_t AEDisposeDesc(AEDescList *descList)
{
PL_NotYetImplemented();
return PLErrors::kNone;
}
PLError_t AECountItems(AEDescList *descList, long *count)
{
PL_NotYetImplemented();
return PLErrors::kNone;
}
PLError_t AEGetNthPtr(AEDescList *descList, long index, DescType desiredType, AEKeyword *keyword, DescType *type, void *data, size_t maxSize, size_t *actualSize)
{
PL_NotYetImplemented();
return PLErrors::kNone;
}
PLError_t AEGetAttributePtr(const AppleEvent *evt, AEKeyword keyword, DescType desiredType, DescType *type, void *data, size_t maxSize, size_t *actualSize)
{
PL_NotYetImplemented();
return PLErrors::kNone;
}
PLError_t AEInstallEventHandler(AEEventClass eventClass, AEEventID eventID, AEEventHandlerUPP handler, UInt32 ref, bool isSysHandler)
{
PortabilityLayer::AEManager::GetInstance()->InstallEventHandler(eventClass, eventID, handler, ref, isSysHandler);
return PLErrors::kNone;
}
PLError_t AESetInteractionAllowed(AEInteractAllowed level)
{
PortabilityLayer::AEManager::GetInstance()->SetInteractAllowed(level);
return PLErrors::kNone;
}
AEEventHandlerUPP NewAEEventHandlerProc(AEEventHandler handler)
{
return handler;
}

View File

@@ -1,32 +0,0 @@
#pragma once
#ifndef __PL_APPLEEVENTS_H__
#define __PL_APPLEEVENTS_H__
#include "PLCore.h"
#include "PLAppleEventsCommonTypes.h"
struct AppleEvent
{
};
struct AEDescList
{
};
struct AEDesc
{
};
typedef AEEventHandler AEEventHandlerUPP;
PLError_t AEGetParamDesc(const AppleEvent *evt, AEKeyword keyword, DescType desiredType, AEDescList *descList);
PLError_t AEDisposeDesc(AEDescList *descList);
PLError_t AECountItems(AEDescList *descList, long *count);
PLError_t AEGetNthPtr(AEDescList *descList, long index, DescType desiredType, AEKeyword *keyword, DescType *type, void *data, size_t maxSize, size_t *actualSize);
PLError_t AEGetAttributePtr(const AppleEvent *evt, AEKeyword keyword, DescType desiredType, DescType *type, void *data, size_t maxSize, size_t *actualSize);
PLError_t AEInstallEventHandler(AEEventClass eventClass, AEEventID eventID, AEEventHandlerUPP handler, UInt32 ref, bool isSysHandler);
PLError_t AESetInteractionAllowed(AEInteractAllowed level);
AEEventHandlerUPP NewAEEventHandlerProc(AEEventHandler handler);
#endif

View File

@@ -1,52 +0,0 @@
#pragma once
#ifndef __PL_APPLE_EVENTS_COMMON_TYPES_H__
#define __PL_APPLE_EVENTS_COMMON_TYPES_H__
#include "PLErrorCodes.h"
#include <stdint.h>
struct AppleEvent;
enum AEError
{
errAEEventNotHandled = 1,
errAEDescNotFound,
errAEParamMissed,
};
enum AEKeyword
{
keyDirectObject,
keyMissedKeywordAttr,
};
enum DescType
{
typeAEList,
typeFSS,
typeWildCard,
};
enum AEEventID
{
kAEOpenApplication,
kAEOpenDocuments,
kAEPrintDocuments,
kAEQuitApplication
};
enum AEEventClass
{
kCoreEventClass
};
enum AEInteractAllowed
{
kAEInteractUnknown,
kAEInteractWithAll
};
typedef PLError_t (*AEEventHandler)(const AppleEvent *theAE, AppleEvent *reply, uint32_t ref);
#endif

View File

@@ -6,7 +6,6 @@
#include "PLKeyEncoding.h"
#include "PLQDraw.h"
#include "AEManager.h"
#include "DisplayDeviceManager.h"
#include "FileManager.h"
#include "FilePermission.h"
@@ -644,7 +643,6 @@ void PL_Init()
PortabilityLayer::MemoryManager::GetInstance()->Init();
PortabilityLayer::ResourceManager::GetInstance()->Init();
PortabilityLayer::DisplayDeviceManager::GetInstance()->Init();
PortabilityLayer::AEManager::GetInstance()->Init();
PortabilityLayer::QDManager::GetInstance()->Init();
PortabilityLayer::MenuManager::GetInstance()->Init();
}

View File

@@ -1,13 +0,0 @@
#include "PLNavigation.h"
PLError_t NavGetDefaultDialogOptions(NavDialogOptions *options)
{
PL_NotYetImplemented();
return PLErrors::kNone;
}
PLError_t NavPutFile(AEDesc *defaultLocation, NavReplyRecord *reply, NavDialogOptions *dlgOptions, void *unknown, UInt32 fileType, UInt32 fileCreator, void *unknown2)
{
PL_NotYetImplemented();
return PLErrors::kNone;
}

View File

@@ -1,26 +0,0 @@
#pragma once
#ifndef __PL_NAVIGATION_H__
#define __PL_NAVIGATION_H__
#include "PLCore.h"
#include "PLAppleEvents.h"
struct AEDesc;
struct NavReplyRecord
{
bool validRecord;
bool replacing;
int vRefNum;
long parID; // Directory?
AEDescList selection;
};
struct NavDialogOptions
{
};
PLError_t NavGetDefaultDialogOptions(NavDialogOptions *options);
PLError_t NavPutFile(AEDesc *defaultLocation, NavReplyRecord *reply, NavDialogOptions *dlgOptions, void *unknown, UInt32 fileType, UInt32 fileCreator, void *unknown2);
#endif

View File

@@ -143,8 +143,6 @@
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\GpCommon\GpBitfield.h" />
<ClInclude Include="AEHandlerDesc.h" />
<ClInclude Include="AEManager.h" />
<ClInclude Include="AntiAliasTable.h" />
<ClInclude Include="AppEventHandler.h" />
<ClInclude Include="ArrayTools.h" />
@@ -204,8 +202,6 @@
<ClInclude Include="PascalStrLiteral.h" />
<ClInclude Include="HostMemoryBuffer.h" />
<ClInclude Include="HostFileSystem.h" />
<ClInclude Include="PLAppleEvents.h" />
<ClInclude Include="PLAppleEventsCommonTypes.h" />
<ClInclude Include="PLApplication.h" />
<ClInclude Include="PLArrayView.h" />
<ClInclude Include="PLArrayViewIterator.h" />
@@ -265,7 +261,6 @@
<ClInclude Include="ResourceCompiledTypeList.h" />
<ClInclude Include="ResourceFile.h" />
<ClInclude Include="PLMenus.h" />
<ClInclude Include="PLNavigation.h" />
<ClInclude Include="PLNumberFormatting.h" />
<ClInclude Include="PLPalettes.h" />
<ClInclude Include="PLPasStr.h" />
@@ -302,7 +297,6 @@
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\stb\stb_image_write.c" />
<ClCompile Include="AEManager.cpp" />
<ClCompile Include="AntiAliasTable.cpp" />
<ClCompile Include="AppEventHandler.cpp" />
<ClCompile Include="BinHex4.cpp" />
@@ -337,7 +331,6 @@
<ClCompile Include="MenuManager.cpp" />
<ClCompile Include="MMBlock.cpp" />
<ClCompile Include="MMHandleBlock.cpp" />
<ClCompile Include="PLAppleEvents.cpp" />
<ClCompile Include="PLApplication.cpp" />
<ClCompile Include="PLButtonWidget.cpp" />
<ClCompile Include="PLControlDefinitions.cpp" />
@@ -354,7 +347,6 @@
<ClCompile Include="PLLabelWidget.cpp" />
<ClCompile Include="PLMenus.cpp" />
<ClCompile Include="PLMovies.cpp" />
<ClCompile Include="PLNavigation.cpp" />
<ClCompile Include="PLNumberFormatting.cpp" />
<ClCompile Include="PLPopupMenuWidget.cpp" />
<ClCompile Include="PLQDOffscreen.cpp" />

View File

@@ -93,9 +93,6 @@
<ClInclude Include="PLResources.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="PLAppleEvents.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="PLToolUtils.h">
<Filter>Header Files</Filter>
</ClInclude>
@@ -105,9 +102,6 @@
<ClInclude Include="PLSound.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="PLNavigation.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="PLNumberFormatting.h">
<Filter>Header Files</Filter>
</ClInclude>
@@ -165,15 +159,6 @@
<ClInclude Include="HostDisplayDriver.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="PLAppleEventsCommonTypes.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="AEManager.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="AEHandlerDesc.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="ByteSwap.h">
<Filter>Header Files</Filter>
</ClInclude>
@@ -521,9 +506,6 @@
<ClCompile Include="PLQDOffscreen.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="PLAppleEvents.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="PLStringCompare.cpp">
<Filter>Source Files</Filter>
</ClCompile>
@@ -533,9 +515,6 @@
<ClCompile Include="PLDialogs.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="PLNavigation.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="PLNumberFormatting.cpp">
<Filter>Source Files</Filter>
</ClCompile>
@@ -569,9 +548,6 @@
<ClCompile Include="HostDisplayDriver.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="AEManager.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ByteSwap.cpp">
<Filter>Source Files</Filter>
</ClCompile>