-
Notifications
You must be signed in to change notification settings - Fork 2
/
Extension.cpp
146 lines (99 loc) · 2.53 KB
/
Extension.cpp
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
#include "Common.h"
///
/// EXTENSION CONSTRUCTOR/DESTRUCTOR
///
Extension::Extension(LPRDATA _rdPtr, LPEDATA edPtr, fpcob cobPtr)
: rdPtr(_rdPtr), rhPtr(_rdPtr->rHo.hoAdRunHeader), Runtime(_rdPtr)
{
//Linking
LinkAction(0, CreateAtPos);
LinkAction(1, CreateAtPosXY);
LinkAction(2, CreateBackdropAtPos);
LinkAction(3, CreateBackdropAtPosXY);
LinkExpression(0, NameFromFixed);
oiListItemSize = sizeof(objInfoList);
if ( Runtime.IsHWA() )
{
oiListItemSize += sizeof(LPVOID);
isHWA = true;
}
}
Extension::~Extension()
{
/*
This is where you'd do anything you'd do in DestroyRunObject in the original SDK.
(except calling destructors and other such atrocities, because that's automatic in Edif)
*/
}
short Extension::Handle()
{
/*
If your extension will draw to the MMF window you should first
check if anything about its display has changed :
if (rdPtr->roc.rcChanged)
return REFLAG_DISPLAY;
else
return 0;
You will also need to make sure you change this flag yourself
to 1 whenever you want to redraw your object
If your extension won't draw to the window, but it still needs
to do something every MMF loop use :
return 0;
If you don't need to do something every loop, use :
return REFLAG_ONESHOT;
This doesn't mean this function can never run again. If you want MMF
to handle your object again (causing this code to run) use this function:
Runtime.Rehandle();
At the end of the loop this code will run
*/
// Will not be called next loop
return REFLAG_ONESHOT;
}
short Extension::Display()
{
/*
If you return REFLAG_DISPLAY in Handle() this routine will run.
*/
// Ok
return 0;
}
short Extension::Pause()
{
// Ok
return 0;
}
short Extension::Continue()
{
// Ok
return 0;
}
bool Extension::Save(HANDLE File)
{
bool OK = false;
#ifndef VITALIZE
// Save the object's data here
OK = true;
#endif
return OK;
}
bool Extension::Load(HANDLE File)
{
bool OK = false;
#ifndef VITALIZE
// Load the object's data here
OK = true;
#endif
return OK;
}
// These are called if there's no function linked to an ID
void Extension::Action(int ID, LPRDATA rdPtr, long param1, long param2)
{
}
long Extension::Condition(int ID, LPRDATA rdPtr, long param1, long param2)
{
return false;
}
long Extension::Expression(int ID, LPRDATA rdPtr, long param)
{
return 0;
}