printer4lazarus: carbon - replace OSX 10.5 (driver specific) code with OSX 10.0 compatible code for getting printerinters DPI

git-svn-id: trunk@48507 -
This commit is contained in:
dmitry 2015-03-26 00:48:36 +00:00
parent 2368d8ad9a
commit 575e6ac4fd

View File

@ -338,14 +338,17 @@ end;
function TCarbonPrinter.GetOutputResolution: PMResolution;
var
res: OSStatus;
prn: PMPrinter;
cnt: UInt32;
begin
// PMPrinterGetOutputResolution is supported on OS X 10.5 and later
// TODO: check version instead, because 10.5 may still support PowerPC
{$if defined(PowerPC) or defined(__ppc__) or defined(ppc)}
res := noErr+1;
{$else}
res := PMPrinterGetOutputResolution(GetCurrentPrinter, PrintSettings, Result{%H-});
{$endif}
prn := GetCurrentPrinter;
PMPrinterGetPrinterResolutionCount(prn, cnt);
if cnt>0 then
//todo: get the first one or the highest one?
res:=PMPrinterGetIndexedPrinterResolution(prn, 1, Result)
else
res:=noErr+1;
if res<>noErr then
begin
Result.vRes:=72;