osprint.dcl 1.86 KB
Newer Older
1
definition module osprint
Peter Achten's avatar
Peter Achten committed
2

Peter Achten's avatar
Peter Achten committed
3
//	Clean Standard Object I/O library, version 1.2
Peter Achten's avatar
Peter Achten committed
4

5
import StdFile, StdPicture, iostate
Peter Achten's avatar
Peter Achten committed
6

7
8
9
10
11
12
13
::	PrintSetup
::	JobInfo
	=	{	range	::	!(!Int,!Int)	// First and last page as typed in by the 
										// user. If the user chooses "ALL", then the
										// first page will be one, and the last page 
										// will be a "huge" number. 
		,	copies	::	!Int			// Number of copies. This will not 
Peter Achten's avatar
Peter Achten committed
14
15
16
17
18
19
										// necessarily be equal to the number of 
										// copies, as specified in the print dialog.
										// Some printer drivers take themselves care
										// of producing the appropriate number of 
										// copies => printInfo.copies==1.
		}
20
21
22
23
24
25
26
27
28
::	PrintInfo
	=	{	printSetup	::	PrintSetup	// PC:	the print setup, which was chosen by
										//		the user via the print dialog
										// Mac:	the value will be identical to the
										//		actual PrintSetup argument, that was
										//		passed to one of the printing
										//		functions
		,	jobInfo		::	JobInfo
		}
Peter Achten's avatar
Peter Achten committed
29
30
31
32
::	Alternative x y
	=	Cancelled x
	|	StartedPrinting y

33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
os_getpagedimensions	::	!PrintSetup	!Bool 
						->	!(!(!Int,!Int),
							  !(!(!Int,!Int),!(!Int,!Int)),
							  !(!Int,!Int))
os_defaultprintsetup	::	!*env
						->	(!PrintSetup, !*env)
os_printsetupdialog		::	!Bool !PrintSetup !*env
						->	(!PrintSetup, !*env)
os_printsetupvalid		::	!PrintSetup !*env
						->	(!Bool, !*env)
						
class PrintEnvironments printEnv
  where
	// MW11 changed Point into Point2
	os_printpageperpage
		::	!.Bool !Bool 
			!.x
			.(.x -> .(PrintInfo -> .(*Picture -> ((.Bool,Point2),(.state,*Picture)))))
			((.state,*Picture) -> ((.Bool,Point2),(.state,*Picture)))
			!PrintSetup !*printEnv
		-> 	(Alternative .x .state,!*printEnv)
Peter Achten's avatar
Peter Achten committed
54
55

instance PrintEnvironments Files
56
57
58
59
60
instance PrintEnvironments (PSt .l .p)


os_printsetuptostring	::	!PrintSetup -> String
os_stringtoprintsetup	::	!String -> PrintSetup
Peter Achten's avatar
Peter Achten committed
61