Browse Source

+ added the win16api printing support functions

git-svn-id: trunk@31707 -
nickysn 10 years ago
parent
commit
3ec1c02eee
3 changed files with 46 additions and 0 deletions
  1. 24 0
      rtl/win16/win31.pp
  2. 4 0
      rtl/win16/winprocsh.inc
  3. 18 0
      rtl/win16/wintypes.inc

+ 24 - 0
rtl/win16/win31.pp

@@ -418,6 +418,17 @@ const
   TT_AVAILABLE = $0001;
   TT_ENABLED   = $0002;
 
+type
+{ Printing support }
+  PDOCINFO = ^DOCINFO;
+  LPDOCINFO = ^DOCINFO; far;
+  DOCINFO = record
+    cbSize: SmallInt;
+    lpszDocName: LPCSTR;
+    lpszOutput: LPCSTR;
+  end;
+  TDocInfo = DOCINFO;
+
 function GetFreeSystemResources(SysResource: UINT): UINT; external 'USER';
 
 procedure LogError(err: UINT; lpInfo: FarPointer); external 'KERNEL';
@@ -534,6 +545,19 @@ function GetBitmapDimensionEx(hBitmap: HBITMAP; lpDimension: LPSIZE): BOOL; exte
 { Metafile support }
 function SetMetaFileBitsBetter(hmf: HGLOBAL): HMETAFILE; external 'GDI';
 
+{ Printing support }
+function StartDoc(hdc: HDC; lpdi: LPDOCINFO): SmallInt; external 'GDI';
+{$ifdef VAR_PARAMS_ARE_FAR}
+function StartDoc(hdc: HDC; var di: DOCINFO): SmallInt; external 'GDI';
+{$endif}
+function StartPage(hdc: HDC): SmallInt; external 'GDI';
+function EndPage(hdc: HDC): SmallInt; external 'GDI';
+function EndDoc(hdc: HDC): SmallInt; external 'GDI';
+function AbortDoc(hdc: HDC): SmallInt; external 'GDI';
+
+function SetAbortProc(hdc: HDC; abrtprc: ABORTPROC): SmallInt; external 'GDI';
+function SpoolFile(lpszPrinter, lpszPort, lpszJob, lpszFile: LPSTR): HANDLE; external 'GDI';
+
 implementation
 
 end.

+ 4 - 0
rtl/win16/winprocsh.inc

@@ -692,3 +692,7 @@ procedure PlayMetaFileRecord(hdc: HDC; var ht: HANDLETABLE; var mr: METARECORD;
 
 function EnumMetaFile(hdc: HDC; hmf: HMETAFILE; mfenmprc: MFENUMPROC; lParam: LPARAM): BOOL; external 'GDI';
 function EnumMetaFile(hdc: HDC; hmf: HMETAFILE; mfenmprc: TFarProc; lParam: LPARAM): BOOL; external 'GDI';
+
+{ Printing support }
+
+function QueryAbort(hdc: HDC; reserved: SmallInt): BOOL; external 'GDI';

+ 18 - 0
rtl/win16/wintypes.inc

@@ -44,6 +44,7 @@ type
   FARPROC = FarPointer;
   TFarProc = FARPROC;
 
+  HANDLE = THandle;
   PHANDLE = ^THandle;
   SPHANDLE = ^THandle; near;
   LPHANDLE = ^THandle; far;
@@ -1152,3 +1153,20 @@ const
 
 type
   MFENUMPROC = function(hdc: HDC; lpht: LPHANDLETABLE; lpmr: LPMETARECORD; cObj: SmallInt; lParam: LPARAM): SmallInt; far;
+
+{ Printing support }
+  ABORTPROC = function(hdc: HDC; error: SmallInt): BOOL; far;
+
+const
+{ Spooler Error Codes }
+  SP_NOTREPORTED   = $4000;
+  SP_ERROR         = (-1);
+  SP_APPABORT      = (-2);
+  SP_USERABORT     = (-3);
+  SP_OUTOFDISK     = (-4);
+  SP_OUTOFMEMORY   = (-5);
+
+  PR_JOBSTATUS     = $0000;
+
+{ Spooler status notification message }
+  WM_SPOOLERSTATUS = $002A;