-
Notifications
You must be signed in to change notification settings - Fork 0
/
Extension.h
83 lines (58 loc) · 2.78 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
class Extension
{
public:
#define MsgBox(text) MessageBoxA(NULL, text, "MyCharSet Object - Debug information", MB_OK|MB_ICONINFORMATION)
#define FatalBox() MessageBoxA(NULL, "Fatal error has not been repaired; bypassing erroneous code.", "MyCharSet Object - Bypass notification", MB_OK|MB_ICONERROR);
LPRDATA rdPtr;
LPRH rhPtr;
Edif::Runtime Runtime;
static const int MinimumBuild = 252;
static const int Version = 1;
static const int OEFLAGS = 0;
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.
*/
std::wstring WideString; // Unicode string
std::string ThinString; // ASCII string
long long locale; // Current locale?
/* 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 SetBOMMarkASC(const char * FileToAddTo, int TypeOfBOM, int IgnoreCurrentBOM);
/// Conditions
bool IsUnicode();
/// Expressions
char * GetASCIIStringFromUnicodeString(wchar_t * Unicode, int Size, int ASCIIOrUTF8);
wchar_t * GetUnicodeStringFromASCIIString(char * ASCII, int Size, int ASCIIOrUTF8);
char * GetASCIIStringFromUnicodeMemory(int Address, int Size, int ASCIIOrUTF8);
wchar_t * GetUnicodeStringFromASCIIMemory(int Address, int Size, int ASCIIOrUTF8);
size_t GetASCIIMemoryFromUnicodeString(wchar_t * Unicode, int Size, int ASCIIOrUTF8);
size_t GetUnicodeMemoryFromASCIIString(char * ASCII, int Size, int ASCIIOrUTF8);
size_t GetASCIIMemoryFromUnicodeMemory(int Address, int Size, int ASCIIOrUTF8);
size_t GetUnicodeMemoryFromASCIIMemory(int Address, int Size, int ASCIIOrUTF8);
/* 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);
/* 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);
};