-
Notifications
You must be signed in to change notification settings - Fork 0
/
Extension.h
130 lines (90 loc) · 2.97 KB
/
Extension.h
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
class Extension
{
public:
// Custom tokeniser
/*inline vector<tstring> ParseStringToVector(tstring source, tstring delimiters)
{
vector <tstring> v;
tstring s = _T("");
for (unsigned int i=0; i<source.length(); i++)
{
tstring charat = _T("");
charat.push_back(source[i]);
if (charat.find_first_of(delimiters) != -1)
{
if (s.length() > 0)
v.push_back(s);
s.clear();
}
else
{
s.push_back(charat[0]);
}
}
if (s.length() > 0)
v.push_back(s);
return v;
}
*/
#define MsgBox(text) MessageBoxA(NULL, text, "RangeHandler Object - Debug information", MB_OK|MB_ICONINFORMATION)
#define FatalBox() MessageBoxA(NULL, "Fatal error has not been repaired; bypassing erroneous code.", "RangeHandler Object - Bypass notification", MB_OK|MB_ICONERROR);
LPRDATA rdPtr;
LPRH rhPtr;
Edif::Runtime Runtime;
static const int MinimumBuild = 251;
static const int Version = 1;
static const int OEFLAGS = OEFLAG_VALUES;
static const int OEPREFS = 0;
static const int WindowProcPriority = 100;
Extension(LPRDATA rdPtr, LPEDATA edPtr, fpcob cobPtr);
~Extension();
/* Add any data you want to store in your extension to this class
(eg. what you'd normally store in rdPtr)
Unlike rdPtr, you can store real C++ objects with constructors
and destructors, without having to call them manually or store
a pointer.
*/
// int MyVariable;
/* Add your actions, conditions and expressions as real class member
functions here. The arguments (and return type for expressions) must
match EXACTLY what you defined in the JSON.
Remember to link the actions, conditions and expressions to their
numeric IDs in the class constructor (Extension.cpp)
*/
/// Actions
void InitialiseRecordingToMemory();
void TestReportAndExplode();
/// Conditions
const bool OnError();
const bool OnReport();
/// Expressions
tchar * GetError(int clear);
tchar * GetReport(int clear);
/// Unreferenced (not called by MMF2)
void Unreferenced_Report(tchar * report, int ThreadID);
void Unreferenced_Error(tchar * error, int ThreadID);
string LastLockFile;
int LastLockLine;
volatile bool threadsafe;
uchar NewThreadID;
bool UsePopups;
/* These are called if there's no function linked to an ID */
void Action(int ID, LPRDATA rdPtr, long param1, long param2);
long Condition(int ID, LPRDATA rdPtr, long param1, long param2);
long Expression(int ID, LPRDATA rdPtr, long param);
int CurrentVal;
bool ReturnBool;
bool RecordingAlreadyStarted;
tstring LastError;
tstring CompleteStatus;
/* These replace the functions like HandleRunObject that used to be
implemented in Runtime.cpp. They work exactly the same, but they're
inside the extension class.
*/
short Handle();
short Display();
short Pause();
short Continue();
bool Save(HANDLE File);
bool Load(HANDLE File);
};