Commit ef3ce12d authored by Martin Wierich's avatar Martin Wierich
Browse files

small changes

parent dc461bf9
......@@ -203,7 +203,7 @@ HANDLE setupDevmode(int size, char *pData)
return hDevmode;
}
void passBackPrintSetup(PRINTDLG *pd, CleanString *o_devmode,
void get_printSetup_with_PRINTDLG(PRINTDLG *pd, CleanString *o_devmode,
CleanString *o_device, CleanString *o_driver, CleanString *o_output)
{
char *newDriver, *newDevice, *newOutput;
......@@ -224,14 +224,11 @@ void passBackPrintSetup(PRINTDLG *pd, CleanString *o_devmode,
LocalUnlock(pd->hDevNames);
}
void get_printSetup_with_PRINTDLG(PRINTDLG *pd, CleanString *o_devmode,
CleanString *o_device, CleanString *o_driver, CleanString *o_output)
{
//rMessageBox(NULL, MB_APPLMODAL, "in get_printSetup_with_PRINTDLG", "pd:%i", pd);
passBackPrintSetup(pd, o_devmode, o_device, o_driver, o_output);
int release_memory_handles(PRINTDLG *pd, int os) {
LocalFree(pd->hDevNames);
LocalFree(pd->hDevMode);
}
return os;
}
UINT APIENTRY DialogToFrontHook(HWND hdl, UINT msg, WPARAM wParam, LPARAM lParam)
// This function hooks the Print dialog. It's purpose is to set the dialog in the
......
......@@ -36,16 +36,11 @@ os_getpagedimensions :: !PrintSetup !Bool
!(!Int,!Int))
os_defaultprintsetup :: !*env
-> (!PrintSetup, !*env)
/* MW was
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
......
......@@ -44,7 +44,7 @@ os_defaultprintsetup env
= ({devmode=devmode, device=device, driver=driver, output=output}, env)
printSetupDialogBoth :: !PrintSetup !(Maybe *Context) -> (!PrintSetup, !Maybe *Context)
printSetupDialogBoth {devmode,device,driver,output} mb_context
printSetupDialogBoth print_setup=:{devmode,device,driver,output} mb_context
# (os, mb_context) = EnvGetOS mb_context
(devmodePtr,os) = WinMakeCString devmode os
(devicePtr,os) = WinMakeCString device os
......@@ -56,31 +56,12 @@ printSetupDialogBoth {devmode,device,driver,output} mb_context
os = WinReleaseCString driverPtr os
os = WinReleaseCString outputPtr os
| ok==0
= ({devmode="\0",device="\0",driver="\0",output="\0"}, EnvSetOS os mb_context)
# (ndevmode,ndevice,ndriver,noutput,os) = get_printSetup_with_PRINTDLG pdPtr os
# os = release_memory_handles pdPtr os
= (print_setup, EnvSetOS os mb_context)
# ((ndevmode,ndevice,ndriver,noutput),os) = get_printSetup_with_PRINTDLG pdPtr os
os = release_memory_handles pdPtr os
= ({devmode=ndevmode,device=ndevice,driver=ndriver,output=noutput}, EnvSetOS os mb_context)
/* MW was
os_printsetupdialog :: !Bool !PrintSetup !*env
-> (!PrintSetup, !*env)
os_printsetupdialog isWorld {devmode,device,driver,output} env
# (os, env) = EnvGetOS env
# (devmodePtr,os) = WinMakeCString devmode os
(devicePtr,os) = WinMakeCString device os
(driverPtr,os) = WinMakeCString driver os
(outputPtr,os) = WinMakeCString output os
(ok, pdPtr, os)
= CCPrintSetupDialog isWorld (size devmode) devmodePtr devicePtr driverPtr outputPtr os
os = WinReleaseCString devmodePtr os
os = WinReleaseCString devicePtr os
os = WinReleaseCString driverPtr os
os = WinReleaseCString outputPtr os
| ok==0
= ({devmode="\0",device="\0",driver="\0",output="\0"}, EnvSetOS os env)
# (ndevmode,ndevice,ndriver,noutput,os) = get_printSetup_with_PRINTDLG pdPtr os
= ({devmode=ndevmode,device=ndevice,driver=ndriver,output=noutput}, EnvSetOS os env)
*/
os_printsetupvalid :: !PrintSetup !*env
-> (!Bool, !*env)
os_printsetupvalid {devmode,device,driver} env
......@@ -95,7 +76,6 @@ os_printsetupvalidC _ _ _ _
class PrintEnvironments printEnv
where
// MW11 changed Point into Point2
os_printpageperpage :: !.Bool !Bool
!.x
.(.x -> .(PrintInfo -> .(*Picture -> ((.Bool,Point2),(.state,*Picture)))))
......@@ -256,10 +236,13 @@ getPrintInfo doDialog emulateScreen {devmode, device, driver, output} mb_context
os = WinReleaseCString driverPtr os
os = WinReleaseCString outputPtr os
| doDialog && (err==(-1))
= continuation err data mb_context (get_printSetup_with_PRINTDLG pdPtr os)
= continuation err data mb_context (devmode,device,driver,output,os)
# (setup_strings, os) = get_printSetup_with_PRINTDLG pdPtr os
os = release_memory_handles pdPtr os
= continuation err data mb_context (setup_strings, os)
# os = release_memory_handles pdPtr os
= continuation err data mb_context ((devmode,device,driver,output),os)
where
continuation err (first,last,copies,hdc) mb_context (devmode,device,driver,output,os)
continuation err (first,last,copies,hdc) mb_context ((devmode,device,driver,output),os)
# first` = max 1 first
last` = max first` last
copies` = max 1 copies
......@@ -398,13 +381,20 @@ printSetup _ _ _ _ _ _ _
ccall printSetup "IIIIII:VII:I"
}
get_printSetup_with_PRINTDLG :: !Int !*OSToolbox -> (!String, !String, !String, !String, !*OSToolbox)
get_printSetup_with_PRINTDLG :: !Int !*OSToolbox -> (!(!String, !String, !String, !String), !*OSToolbox)
get_printSetup_with_PRINTDLG _ _
= code
{
ccall get_printSetup_with_PRINTDLG "I:VSSSS:I"
}
release_memory_handles :: !Int !*OSToolbox -> *OSToolbox
release_memory_handles _ _
= code
{
ccall release_memory_handles "II-I"
}
startPage :: !HDC !*OSToolbox -> (!OkReturn, !*OSToolbox)
startPage _ _
= code
......
......@@ -111,7 +111,6 @@ printUpdateFunction doDialog updateFunc rectangles printSetup printEnv
clipsOfOneRectangle rectangle
= clipRectangles
where
// MW11 was (x1,y1,x2,y2) = RectangleToRect rectangle
{rleft=x1,rtop=y1,rright=x2,rbottom=y2} = RectangleToRect rectangle
wR = x2-x1+1
hR = y2-y1+1
......@@ -134,7 +133,6 @@ printUpdateFunction doDialog updateFunc rectangles printSetup printEnv
((printSetup,rest), appClipPicture (toRegion clipRect) drawFunction picture)
)
// MW11 changed Point into Point2
printPagePerPage :: !Bool !Bool
.x
.(.x -> .(PrintInfo -> .(*Picture -> ((.Bool,Point2),(.state,*Picture)))))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment