You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
add enumeration for window identifiers to C and E code
add check for duplicate window identifiers when generating code
change "window name" to "window identifier"
add window indentifier validation
update version to 0.10.0-beta
add example E source to the manual
Copy file name to clipboardExpand all lines: cSourceGen.e
+41-18Lines changed: 41 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,8 @@ OPT MODULE,LARGE
8
8
EXPORT OBJECT cSrcGen OF srcGen
9
9
ENDOBJECT
10
10
11
+
ENUM ENUM_IDS, ENUM_IDENTS, ENUM_IDXS
12
+
11
13
PROC create(fser:PTR TO fileStreamer, libsused:PTR TO CHAR,definitionOnly,useIds) OF cSrcGen
12
14
SUPER self.create(fser,libsused,definitionOnly,useIds)
13
15
self.type:=CSOURCE_GEN
@@ -20,17 +22,21 @@ PROC create(fser:PTR TO fileStreamer, libsused:PTR TO CHAR,definitionOnly,useIds
20
22
self.indent:=0
21
23
ENDPROC
22
24
23
-
PROC createEnum(windowName:PTR TO CHAR, listObjects:PTR TO stdlist, ids) OF cSrcGen
25
+
PROC createEnum(enumName:PTR TO CHAR, listObjects:PTR TO stdlist, enumType) OF cSrcGen
24
26
DEF n=0, j
25
27
DEF listObject:PTR TO reactionObject
26
28
DEF tempStr[255]:STRING
27
29
28
30
self.write('enum ')
29
-
IF ids
30
-
StringF(tempStr,'\s_id { ',windowName)
31
-
ELSE
32
-
StringF(tempStr,'\s_idx { ',windowName)
33
-
ENDIF
31
+
SELECT enumType
32
+
CASE ENUM_IDS
33
+
StringF(tempStr,'\s_id { ',enumName)
34
+
CASE ENUM_IDXS
35
+
StringF(tempStr,'\s_idx { ',enumName)
36
+
CASE ENUM_IDENTS
37
+
StringF(tempStr,'\s { ',enumName)
38
+
ENDSELECT
39
+
34
40
LowerStr(tempStr)
35
41
self.write(tempStr)
36
42
n:=0
@@ -47,12 +53,13 @@ PROC createEnum(windowName:PTR TO CHAR, listObjects:PTR TO stdlist, ids) OF cSrc
47
53
ENDIF
48
54
listObject:=listObjects.item(j)
49
55
listObject.gadindex:=j
56
+
50
57
StrCopy(tempStr,listObject.ident)
51
58
LowerStr(tempStr)
52
59
self.write(tempStr)
53
60
n:=n+StrLen(tempStr)
54
61
55
-
IF ids
62
+
IF (enumType=ENUM_IDS) OR (enumType=ENUM_IDENTS)
56
63
StringF(tempStr,'_id = \d',listObject.id)
57
64
self.write(tempStr)
58
65
n:=n+StrLen(tempStr)
@@ -62,13 +69,14 @@ PROC createEnum(windowName:PTR TO CHAR, listObjects:PTR TO stdlist, ids) OF cSrc
62
69
self.writeLine(' };')
63
70
ENDPROC
64
71
65
-
PROC genHeader(screenObject:PTR TO screenObject,rexxObject:PTR TO rexxObject, windowNames:PTR TO stringlist, windowLayouts:PTR TO stdlist, sharedPort) OF cSrcGen
72
+
PROC genHeader(screenObject:PTR TO screenObject,rexxObject:PTR TO rexxObject, windowItems:PTR TO stdlist, windowLayouts:PTR TO stdlist, sharedPort) OF cSrcGen
66
73
DEF tempStr[200]:STRING
67
74
DEF menuItem:PTR TO menuItem
68
75
DEF itemName[200]:STRING
69
76
DEF commKey[10]:STRING
70
77
DEF itemType
71
78
DEF hasarexx,i,j,n
79
+
DEF windowObject:PTR TO reactionObject
72
80
DEF layoutObject:PTR TO reactionObject
73
81
DEF listObjects:PTR TO stdlist
74
82
DEF listObject:PTR TO reactionObject
@@ -181,8 +189,9 @@ PROC genHeader(screenObject:PTR TO screenObject,rexxObject:PTR TO rexxObject, wi
181
189
self.writeLine('')
182
190
ENDIF
183
191
184
-
FOR i:=0 TO windowNames.count()-1
185
-
StrCopy(tempStr,windowNames.item(i))
192
+
FOR i:=0 TO windowItems.count()-1
193
+
windowObject:=windowItems.item(i)
194
+
StrCopy(tempStr,windowObject.ident)
186
195
LowerStr(tempStr)
187
196
self.write('void ')
188
197
self.write(tempStr)
@@ -533,14 +542,24 @@ PROC genHeader(screenObject:PTR TO screenObject,rexxObject:PTR TO rexxObject, wi
0 commit comments