-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.cpp
More file actions
46 lines (35 loc) · 1.24 KB
/
Main.cpp
File metadata and controls
46 lines (35 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "IllustratorSDK.h"
#include "PathExploder.h"
// Tell Xcode to export the following symbols
#if defined(__GNUC__)
#pragma GCC visibility push(default)
#endif
// Plug-in entry point
extern "C" ASAPI ASErr PluginMain(char * caller, char* selector, void* message);
// Tell Xcode to return to default visibility for symbols
#if defined(__GNUC__)
#pragma GCC visibility pop
#endif
PathExploder *pathExploder;
extern "C" ASAPI ASErr PluginMain(char* caller, char* selector, void* message) {
ASErr error = kNoErr;
SPMessageData *msgData = (SPMessageData *)message;
SPBasicSuite *sSPBasic = msgData->basic;
if (sSPBasic->IsEqual(caller, kSPInterfaceCaller)) {
if (sSPBasic->IsEqual(selector, kSPInterfaceStartupSelector)) {
pathExploder = new PathExploder(msgData->self, sSPBasic, (SPInterfaceMessage*)message );
} else if (sSPBasic->IsEqual(selector, kSPInterfaceShutdownSelector)) {
pathExploder->DeactivateTimer();
pathExploder->FreeSelectedArt();
pathExploder->FreeGlobals( (SPInterfaceMessage*)message );
pathExploder->ReleaseSuites(sSPBasic);
delete pathExploder;
}
} else {
if (pathExploder) pathExploder->Message(caller, selector, message);
}
return error;
}