📄 apfpdeng.pas
字号:
(*
if FirstOctet then begin
FirstOctet := False;
for i := pred(slBitWidth mod 8) to 7 do begin
Move(PortraitSet^[i], TmpBuffer^, 216);
NotBuffer(TmpBuffer^, 216);
acCompressRasterLine(apfConverter, TmpBuffer^);
FillChar(TmpBuffer^, MaxData, 0);
cvtLastError := acOutToFileCallBack(apfConverter, DataLine^,
ByteOfs, False, True);
end;
end else begin
*)
for i := 0 to 7 do begin
Move(PortraitSet^[i], TmpBuffer^, 216);
NotBuffer(TmpBuffer^, 216);
acCompressRasterLine(apfConverter, TmpBuffer^);
FillChar(TmpBuffer^, MaxData, 0);
cvtLastError := acOutToFileCallBack(apfConverter, DataLine^,
ByteOfs, False, True);
end;
(*
end;
*)
{ decrement byte offset into landscape scan lines }
dec(LScanLineOfs);
end;
FreeScanNodes(lpdv);
end;
{ free allocated memory }
FreeMem(PortraitSet, sizeof(TRotatedSet));
end;
{---------------------------------------------------------------}
{ the following are simply pass-through functions to UniDrv.DLL }
{---------------------------------------------------------------}
function AdvancedSetupDialog(hwnd : HWND;
hInstMiniDrv : THandle; { handle of driver module }
lpdmIn : PDevMode; { initial device settings }
lpdmOut : PDevMode) : Longint; { final device settings }
begin
AdvancedSetupDialog := UniAdvancedSetupDialog(hwnd, hInstMiniDrv, lpdmIn, lpdmOut);
end;
function BitmapBits(lpdv : PDev; fFlags : DWord; dwCount : DWord;
lpBits : PStr) : WordBool;
begin
{$IFDEF LogControls}
LogControl(lpdv, nclogBitmapBits, nil, nil);
{$ENDIF}
BitmapBits := UniBitmapBits(lpdv, fFlags, dwCount, lpBits);
end;
function ColorInfo(lpdv : PDev; ColorIn : DWord;
lpPhysBits : PDWord) : DWord;
begin
{$IFDEF LogControlsVerbose}
LogControl(lpdv, nclogColorInfo, nil, nil);
{$ENDIF}
ColorInfo := UniColorInfo(lpdv, ColorIn, lpPhysBits);
end;
function CreateDIBitmap : Integer;
begin
{
CreateDIBitmap is never called by GDI.
Keep a stub function here so nobody complains.
}
CreateDIBitmap := 0;
end;
function DevBitBlt(lpdv : PDev; { ptr to dest bitmap descriptor }
DstxOrg : Integer; { destination origin x }
DstyOrg : Integer; { destination origin y }
lpSrcDev : PBitmap; { ptr to source bitmap descriptor }
SrcxOrg : Integer; { source origin x }
SrcyOrg : Integer; { source origin y }
xExt : Word; { x extent of blt }
yExt : Word; { y extent of blt }
lRop : Longint; { raster operation descriptor }
lpPBrush : PPBrush; { ptr to a physical brush (pattern) }
lpDrawMode : PDrawMode) : WordBool;
begin
{$IFDEF LogControlsVerbose}
LogControl(lpdv, nclogDevBitBlt, nil, nil);
{$ENDIF}
DevBitBlt := UniBitBlt(lpdv, DstxOrg, DstyOrg, lpSrcDev, SrcxOrg, SrcyOrg,
xExt, yExt, lRop, lpPBrush, lpDrawMode);
end;
function DevExtTextOut(lpdv : PDev; X, Y : Integer; lpCR : PRect;
lpStr : PStr; Count : Integer; lpFont : PFontInfo;
lpDrawMode : PDrawMode; lpXform : PTextXForm;
lpWidths : PInteger; lpOpaqRect : PRect;
Options : Word) : DWord;
begin
{$IFDEF LogControlsVerbose}
LogControl(lpdv, nclogDevExtTxtOut, nil, nil);
{$ENDIF}
DevExtTextOut := UniExtTextOut(lpdv, X, Y, lpCR, lpStr, Count,
lpFont, lpDrawMode, lpXform, lpWidths,
lpOpaqRect, Options);
end;
function DevGetCharWidth(lpdv : PDev; lpBuf : PInteger; chFirst : Word;
chLast : Word; lpFont : PFontInfo;
lpDrawMode : PDrawMode;
lpXForm : PTextXForm) : Integer;
begin
{$IFDEF LogControlsVerbose}
LogControl(lpdv, nclogDevGetCharW, nil, nil);
{$ENDIF}
DevGetCharWidth := UniGetCharWidth(lpdv, lpBuf, chFirst, chLast,
lpFont, lpDrawMode, lpXForm);
end;
function DeviceBitmap(lpdv : PDev; Command : Word; lpBitmap : PBitmap;
lpBits : PStr) : Integer;
begin
{$IFDEF LogControlsVerbose}
LogControl(lpdv, nclogDeviceBitmap, nil, nil);
{$ENDIF}
DeviceBitmap := 0;
end;
function DeviceCapabilities(lpDevName : PStr; lpPort : PStr; wIndex : Word;
lpOutput : PStr; lpdm : PDevMode) : DWord;
begin
DeviceCapabilities := UniDeviceCapabilities(lpDevName, lpPort, wIndex,
lpOutput, lpdm,
GetModuleHandle(ModuleName));
end;
procedure DeviceMode(hwnd : HWND; hInst : THandle; lpDevName : PStr;
lpPort : PStr);
begin
UniDeviceMode(hwnd, hInst, lpDevName, lpPort);
end;
function DeviceSelectBitmap(lpdv : PDev; lpPrevBmp : PBitmap;
lpBmp : PBitmap; fFlags : DWord) :WordBool; export;
begin
{$IFDEF LogControlsVerbose}
LogControl(lpdv, nclogDevSelectBM, nil, nil);
{$ENDIF}
DeviceSelectBitmap := UniDeviceSelectBitmap(lpdv, lpPrevBmp, lpBmp, fFlags);
end;
function DevInstall(hwnd : HWND; lpDevName : PStr; lpOldPort : PStr;
lpNewPort : PStr) : Integer;
begin
DevInstall := UniDevInstall(hwnd, lpDevName, lpOldPort, lpNewPort);
end;
function DIBBlt(lpBmp : PBitmap; wStyle : Word; iStart : Word; sScans : Word;
lpDIBits : PStr; lpBMI : PBitmapInfo;
lpDrawMode : PDrawMode;
lpConvInfo : PStr) : Integer;
begin
DIBBlt := UniDIBBlt(lpBmp, wStyle, iStart, sScans, lpDIBits, lpBMI,
lpDrawMode, lpConvInfo);
end;
function EnumDFonts(lpdv : PDev; lpFaceName : PStr;
lpCallbackFunc : TFnEnumDFonts;
lpClientData : Pointer) : Integer;
begin
{$IFDEF LogControlsVerbose}
LogControl(lpdv, nclogEnumDFonts, nil, nil);
{$ENDIF}
EnumDFonts := UniEnumDFonts(lpdv, lpFaceName, lpCallbackFunc, lpClientData);
end;
function EnumObj(lpdv : PDev; wStyle : Word; lpCallbackFunc : TFarProc;
lpClientData : Pointer) : Integer;
begin
{$IFDEF LogControlsVerbose}
LogControl(lpdv, nclogEnumObj, @wStyle, nil);
{$ENDIF}
EnumObj := UniEnumObj(lpdv, wStyle, lpCallbackFunc, lpClientData);
end;
function ExtDeviceMode(hwnd : HWND; { parent for DM_PROMPT dialog }
hInst : THandle; { handle from LoadLibrary() }
lpdmOut : PDevMode; { output DEVMODE for DM_COPY }
lpDevName : PStr; { device name }
lpPort : PStr; { port name }
lpdmIn : PDevMode; { input DEVMODE for DM_MODIFY }
lpProfile : PStr; { alternate .ini file }
wMode : Word) : Integer; { option(s) to carry out }
begin
ExtDeviceMode := UniExtDeviceMode(hwnd, hInst, lpdmOut, lpDevName,
lpPort, lpdmIn, lpProfile, wMode);
end;
function ExtDeviceModePropSheet(hwnd : HWND; { parent for dialog }
hInst : THandle; { handle from LoadLibrary() }
lpDevName : PStr; { friendly name }
lpPort : PStr; { port name }
dwReserved : DWord; { for future use }
lpfnAdd : TFnAddPropSheetPage;{ callback to add dialog }
lParam : Longint) : Integer; { pass to callback }
begin
ExtDeviceModePropSheet := UniExtDeviceModePropSheet(hwnd, hInst, lpDevName,
lpPort, dwReserved,
lpfnAdd, lParam);
end;
function FastBorder(lpRect : PRect; Width : Integer; Depth : Integer;
lRop : Longint; lpdv : PDev; lpPBrush : PPBrush;
lpDrawMode : PDrawMode; lpCR : PRect) : Integer;
begin
FastBorder := 0;
end;
function Output(lpdv : PDev; { ptr to the destination }
wStyle : Word; { output operation }
wCount : Word; { number of points }
lpPoints : PPoint; { ptr to a set of points }
lpPPen : PPPen; { ptr to a physical pen }
lpPBrush : PPBrush; { ptr to a physical brush }
lpDrawMode : PDrawMode; { ptr to a drawing mode }
lpCR : PRect) : Integer; { ptr to a clip rect if <> 0 }
begin
{$IFDEF LogControlsVerbose}
LogControl(lpdv, nclogOutput, @wStyle, nil);
{$ENDIF}
Output := UniOutput(lpdv, wStyle, wCount, lpPoints, lpPPen,
lpPBrush, lpDrawMode, lpCR);
end;
function Pixel(lpdv : PDev; X, Y : Integer; Color : DWord;
lpDrawMode : PDrawMode) : DWord;
begin
{$IFDEF LogControlsVerbose}
LogControl(lpdv, nclogPixel, nil, nil);
{$ENDIF}
Pixel := UniPixel(lpdv, X, Y, Color, lpDrawMode);
end;
function RealizeObject(lpdv : PDev; sStyle : Integer; lpInObj : PStr;
lpOutObj : PStr; lpTextXForm : PTextXForm) : DWord;
begin
{$IFDEF LogControlsVerbose}
LogControl(lpdv, nclogRealizeObj, @sStyle, nil);
{$ENDIF}
RealizeObject := UniRealizeObject(lpdv, sStyle, lpInObj, lpOutObj, lpTextXForm);
end;
function ScanLR(lpdv : PDev; X, Y : Integer; Color : DWord;
DirStyle : Word) : Integer;
begin
{
ScanLR is only called for RASDISPLAY devices.
Keep a stub function here so nobody complains.
}
ScanLR := 0;
end;
function SetAttribute(lpdv : PDev; StateNum : Word; Index : Word;
Attribute : Word) : Integer;
begin
{$IFDEF LogControlsVerbose}
LogControl(lpdv, nclogSetAttribute, nil, nil);
{$ENDIF}
SetAttribute := 0;
end;
function SetDIBitsToDevice(lpdv : PDev; DstXOrg, DstYOrg : Word;
StartScan, NumScans : Word; lpCR : PRect;
lpDrawMode : PDrawMode; lpDIBits : PStr;
lpDIBHdr : PBitmapInfoHeader;
lpConvInfo : PStr) : Integer;
begin
{$IFDEF LogControlsVerbose}
LogControl(lpdv, nclogSetDIBits, nil, nil);
{$ENDIF}
SetDIBitsToDevice := UniSetDIBitsToDevice(lpdv, DstXOrg, DstYOrg,
StartScan, NumScans, lpCR,
lpDrawMode, lpDIBits,
lpDIBHdr, lpConvInfo);
end;
function StrBlt(lpdv : PDev; X, Y : Integer; lpCR : PRect; lpStr : PStr;
Count : Integer; lpFontInfo : PFontInfo;
lpDrawMode : PDrawMode; lpXform : PTextXForm) : DWord;
begin
{
StrBlt is never called by GDI.
Keep a stub function here so nobody complains
}
StrBlt := 0;
end;
function StretchBlt(lpdv : PDev; DstX, DstY : Integer;
DstXE, DstYE : Integer; lpBitmaps : PBitmap;
SrcX, SrcY : Integer; SrcXE, SrcYE : Integer;
dwRop : DWord; lpbr : PPBrush; lpdm : PDrawMode;
lpClip : PRect) : Integer;
begin
{$IFDEF LogControlsVerbose}
LogControl(lpdv, nclogStretchBlt, nil, nil);
{$ENDIF}
StretchBlt := -1; {tell GDI to do it}
end;
function StretchDIB(lpdv : PDev; wMode : Word; DstX, DstY : Integer;
DstXE, DstYE : Integer; SrcX, SrcY : Integer;
SrcXE, SrcYE : Integer; lpBits : PStr;
lpDIBHdr : PBitmapInfoHeader; lpConvInfo : PStr;
dwRop : DWord; lpbr : PPBrush; lpdm : PDrawMode;
lpClip : PRect) : Integer;
begin
{$IFDEF LogControlsVerbose}
LogControl(lpdv, nclogStretchDIB, @wMode, nil);
{$ENDIF}
StretchDIB := UniStretchDIB(lpdv, wMode, DstX, DstY, DstXE, DstYE,
SrcX, SrcY, SrcXE, SrcYE, lpBits, lpDIBHdr,
lpConvInfo, dwRop, lpbr, lpdm, lpClip);
end;
begin
StartJobCallback := nil;
EndJobCallback := nil;
ModuleName[0] := #0;
{$IFDEF LogControls}
GetSystemDirectory(WinSysDir, 255);
LFName := StrPas(WinSysDir) + '\PRNDRV.LOG';
assign(LF, LFName);
rewrite(LF);
writeln(LF, 'func name lpdv lpXpdv lpInData lpOutData escape-specific');
writeln(LF);
close(LF);
{$ENDIF}
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -