ossystem.icl 1.36 KB
Newer Older
Peter Achten's avatar
Peter Achten committed
1
2
3
4
5
implementation module ossystem			// for Windows

//	Clean Object I/O library, version 1.2

import	StdInt, StdReal, StdString
6
import	clCCall_12, clCrossCall_12
Peter Achten's avatar
Peter Achten committed
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from	ostypes	import Rect

OSdirseparator	:==	'\\'				// OS separator between folder- and filenames in a pathname

OShomepath :: !String -> String
OShomepath fname = theApplicationPath +++ fname

OSapplicationpath :: !String -> String
OSapplicationpath fname = theApplicationPath +++ fname

theApplicationPath =: path
where
	ptr		= WinGetAppPath 
	(path,_)= WinGetCStringAndFree ptr 99

22
23
OSnewlineChars			:== "\xD\xA" // MW11++

Peter Achten's avatar
Peter Achten committed
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
OStickspersecond :== 1000				// OS max resolution of ticks per second

OSmmToHPixels :: !Real -> Int
OSmmToHPixels mm = toInt ( (mm/25.4) * toReal WinGetHorzResolution )

OSmmToVPixels :: !Real -> Int
OSmmToVPixels mm = toInt ( (mm/25.4) * toReal WinGetVertResolution )

OSmaxScrollWindowSize :: (!Int,!Int)
OSmaxScrollWindowSize = WinMaxScrollWindowSize

OSmaxFixedWindowSize :: (!Int,!Int)
OSmaxFixedWindowSize = WinMaxFixedWindowSize

OSscreenrect :: !*OSToolbox -> (!Rect,!*OSToolbox)
OSscreenrect tb
	# (screenWidth, tb)	= WinScreenXSize tb
	# (screenHeight,tb)	= WinScreenYSize tb
	= ({rleft=0,rtop=0,rright=screenWidth,rbottom=screenHeight},tb)
43
44
45

OSprintSetupTypical		:: Bool // MW11++
OSprintSetupTypical = False
46
47
48
49

OSrefreshDesktop :: !*OSToolbox -> *OSToolbox
OSrefreshDesktop tb
	= WinRefreshDesktop tb