mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-23 01:19:37 +02:00
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:
parent
2368d8ad9a
commit
575e6ac4fd
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user