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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
|
implementation module clCCall_12
import StdClass, StdInt
from StdIOCommon import :: Modifiers{..}
from ostoolbox import :: OSToolbox
import code from "cCCallSystem_121.o",
"cCCallWindows_121.o",
"cCrossCallWindows_121.o",
"cCrossCall_121.o",
"cdebug_121.o",
"cpicture_121.o",
"util_121.o"
:: CSTR :== Int
:: ACCLPTR :== Int
MaxRand :== 32767
WinHelpKey :== 5
WinEscapeKey :== 27
WinReturnKey :== 13
WinTabKey :== 9
WinDelKey :== 127
WinBackSpKey :== 8
WinEndKey :== 4
WinBeginKey :== 1
WinPgDownKey :== 12
WinPgUpKey :== 11
WinRightKey :== 29
WinLeftKey :== 28
WinDownKey :== 31
WinUpKey :== 30
WinF1Key :== 1001
WinF2Key :== 1002
WinF3Key :== 1003
WinF4Key :== 1004
WinF5Key :== 1005
WinF6Key :== 1006
WinF7Key :== 1007
WinF8Key :== 1008
WinF9Key :== 1009
WinF10Key :== 1010
WinF11Key :== 1011
WinF12Key :== 1012
CTRLBIT :== 4
ALTBIT :== 2
SHIFTBIT :== 1
KEYREPEAT :== 4
KEYUP :== 2
KEYDOWN :== 1
BUTTONUP :== 50
BUTTONSTILLDOWN :== 40
BUTTONTRIPLEDOWN :== 3
BUTTONDOUBLEDOWN :== 2
BUTTONDOWN :== 1
BUTTONSTILLUP :== 0 /* PA: new constant for passing mouse move events. */
// PA: moved from windowevent.icl because also used by menuCrossCall_12
toModifiers :: !Int -> Modifiers
toModifiers i
= { shiftDown = shifton
, optionDown = alton
, commandDown = ctrlon
, controlDown = ctrlon
, altDown = alton
}
where
shifton = i bitand SHIFTBIT <> 0
alton = i bitand ALTBIT <> 0
ctrlon = i bitand CTRLBIT <> 0
winLaunchApp :: !{#Char} !Bool !*OSToolbox -> ( !Bool, !*OSToolbox)
winLaunchApp _ _ _
= code
{
.inline WinLaunchApp
ccall WinLaunchApp "SII-II"
.end
}
winLaunchApp2 :: !{#Char} !{#Char} !Bool !*OSToolbox -> ( !Bool, !*OSToolbox)
winLaunchApp2 _ _ _ _
= code
{
.inline WinLaunchApp2
ccall WinLaunchApp2 "SSII-II"
.end
}
winCallProcess :: !CSTR !CSTR !CSTR !CSTR !CSTR !CSTR !*OSToolbox -> ( !Bool, !Int, !*OSToolbox)
winCallProcess _ _ _ _ _ _ _
= code
{
.inline WinCallProcess
ccall WinCallProcess "IIIIIII-III"
.end
}
winGetModulePath :: {#Char}
winGetModulePath
= code
{
.inline WinGetModulePath
ccall WinGetModulePath "-S"
.end
}
winFileModifiedDate :: !{#Char} -> ( !Bool, !Int, !Int, !Int, !Int, !Int, !Int)
winFileModifiedDate _
= code
{
.inline WinFileModifiedDate
ccall WinFileModifiedDate "S-IIIIIII"
.end
}
winFileExists :: !{#Char} -> Bool
winFileExists _
= code
{
.inline WinFileExists
ccall WinFileExists "S-I"
.end
}
winBeep :: !*OSToolbox -> *OSToolbox
winBeep tb
= code
{
.inline WinBeep
ccall WinBeep "I-I"
.end
}
rand :: Int
rand
= code
{
.inline Rand
ccall Rand "-I"
.end
}
winReleaseCString :: !CSTR !*OSToolbox -> *OSToolbox
winReleaseCString _ _
= code
{
.inline WinReleaseCString
ccall WinReleaseCString "II-I"
.end
}
winGetCStringAndFree :: !CSTR !*OSToolbox -> ( !{#Char}, !*OSToolbox)
winGetCStringAndFree _ _
= code
{
.inline WinGetCStringAndFree
ccall WinGetCStringAndFree "II-SI"
.end
}
winGetCString :: !CSTR !*OSToolbox -> ( !{#Char}, !*OSToolbox)
winGetCString _ _
= code
{
.inline WinGetCString
ccall WinGetCString "II-SI"
.end
}
winMakeCString :: !{#Char} !*OSToolbox -> ( !CSTR, !*OSToolbox)
winMakeCString _ _
= code
{
.inline WinMakeCString
ccall WinMakeCString "SI-pI"
.end
}
winGetAppPath :: CSTR
winGetAppPath
= code
{
.inline WinGetAppPath
ccall WinGetAppPath "-I"
.end
}
winSetDoubleDownDist :: !Int !*OSToolbox -> *OSToolbox
winSetDoubleDownDist _ _
= code
{
.inline WinSetDoubleDownDist
ccall WinSetDoubleDownDist "II-I"
.end
}
winGetHorzResolution :: Int
winGetHorzResolution
= code
{
.inline WinGetHorzResolution
ccall WinGetHorzResolution "-I"
.end
}
winGetVertResolution :: Int
winGetVertResolution
= code
{
.inline WinGetVertResolution
ccall WinGetVertResolution "-I"
.end
}
winMaxFixedWindowSize :: ( !Int, !Int)
winMaxFixedWindowSize
= code
{
.inline WinMaxFixedWindowSize
ccall WinMaxFixedWindowSize "-II"
.end
}
winMaxScrollWindowSize :: ( !Int, !Int)
winMaxScrollWindowSize
= code
{
.inline WinMaxScrollWindowSize
ccall WinMaxScrollWindowSize "-II"
.end
}
// PA: interface added for determining screen width and height.
winScreenYSize :: !*OSToolbox -> (!Int,!*OSToolbox)
winScreenYSize _
= code
{
.inline WinScreenYSize
ccall WinScreenYSize "I-II"
.end
}
winScreenXSize :: !*OSToolbox -> (!Int,!*OSToolbox)
winScreenXSize _
= code
{
.inline WinScreenXSize
ccall WinScreenXSize "I-II"
.end
}
winMinimumWinSize :: ( !Int, !Int)
winMinimumWinSize
= code
{
.inline WinMinimumWinSize
ccall WinMinimumWinSize "-II"
.end
}
// PA: function added to get system metrics for width and height of scrollbars.
winScrollbarSize :: !*OSToolbox -> ( !Int, !Int, !*OSToolbox )
winScrollbarSize _
= code
{
.inline WinScrollbarSize
ccall WinScrollbarSize "I-III"
.end
}
/* PA: two new routines (win(M/S)DIClientToOuterSizeDims added to convert between the
client and outer size of (M/S)DI windows. The Int argument contains the style flags
of the window.
*/
winMDIClientToOuterSizeDims :: !Int !*OSToolbox -> (!Int,!Int,!*OSToolbox)
winMDIClientToOuterSizeDims _ _
= code
{
.inline WinMDIClientToOuterSizeDims
ccall WinMDIClientToOuterSizeDims "II-III"
.end
}
winSDIClientToOuterSizeDims :: !Int !*OSToolbox -> (!Int,!Int,!*OSToolbox)
winSDIClientToOuterSizeDims _ _
= code
{
.inline WinSDIClientToOuterSizeDims
ccall WinSDIClientToOuterSizeDims "II-III"
.end
}
winPlaySound :: !{#Char} !*OSToolbox -> (!Bool,!*OSToolbox)
winPlaySound _ _
= code
{
.inline WinPlaySound
ccall WinPlaySound "SI-II"
.end
}
|