COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

	Copyright (c) GeoWorks 1991 -- All Rights Reserved

PROJECT:	PC GEOS
MODULE:		PostScript Import/Export Translation Library
FILE:		transPS.def

AUTHOR:		Jim DeFrisco, 19 Feb 1991

REVISION HISTORY:
	Name	Date		Description
	----	----		-----------
	Jim	2/91		Initial revision


DESCRIPTION:
	This file contains the definitions required by external geodes that
	want to make use of the PostScript Translation Library
		
	$Id: xlatPS.def,v 1.1 97/04/04 14:22:58 newdeal Exp $

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@

SetDef	__TRANSPS

StartLibrary	eps


;----------------------------------------------------------------------------
;               Graphics Translation Library Routines
;----------------------------------------------------------------------------

TR_EXPORT_LOW	enum	TransRoutine
global	EPSExportLow:far
;
; Export the passed transfer format by converting it to the requested
; format.  This is the same format export routine as was used in version 1.2.
; It's existance is desired by the PostScript printer driver.
;
; Pass:		DX	- block containing options, zero to use default
;		SI	- GString handle to source for export
;		DI	- EPSExportLowStreamStruct block handle
;		CX	- GSControl flags to pass to GrDrawGString
;
; Returns: 	AX	= TransError code
;		CX	- return code from GrDrawGString
;
; May Destroy:	Nothing
;

TR_EXPORT_RAW	enum	TransRoutine
global	EPSExportRaw:far
;
;       pass:           dx	- handle of block holding ExportOptionsStruct
;				  (or 0 if no options required)
;			ds:si	- pointer to buffer containing data
;			cx	- #bytes to write
;			di	- EPSExportLowStreamStruct block handle
;
;       return:   	ax	- TransError error code
;				  (either TE_NO_ERROR or, if there was
;				  an error from FileWrite, TE_EXPORT_ERROR)
;			cx	- # of bytes written
;
;       This call performs part of the export function.  This is intended to
;	be used by a piece of code that understands the same format that is
;	being written.  It will probably be used infrequently, and almost 
;	certainly not as part of the common import/export library.  It was
;	created to handle some requirements of the PostScript printer driver.
;

TR_EXPORT_HEADER	enum	TransRoutine
global	EPSExportHeader:far
;
;       pass:           dx	- handle of block holding ExportOptionsStruct
;				  (or 0 if no options required)
;			di	- EPSExportLowStreamStruct block handle
;
;       return: 	ax	- error code, type TransError
;
;       This call performs part of the export function.  It writes out any
;	header information needed in the destination file.
;

TR_EXPORT_TRAILER	enum	TransRoutine
global	EPSExportTrailer:far
;
;       pass:           dx	- handle of block holding ExportOptionsStruct
;				  (or 0 if no options required)
;			di	- EPSExportLowStreamStruct block handle
;
;       return: 	ax	- error code, type TransError
;
;       This call performs part of the export function.  It writes out any
;	trailing information needed in the destination file.
;

TR_EXPORT_BEGIN_PAGE	enum	TransRoutine
global	EPSExportBeginPage:far
;
;       pass:           dx	- handle of block holding ExportOptionsStruct
;				  (or 0 if no options required)
;			di	- EPSExportLowStreamStruct block handle
;
;       return:   	ax	- TransError error code
;				  TE_NO_MULTIPLE_PAGE_DOCS if format
;				  does not support multiple pages
;
;       This call performs part of the export function.  It should be used
;	along with EPSExportEndPage to bracket each page of the document
;	if the document contains multiple pages.  It is not necessary
;	for single page documents.  Some graphics formats will not support
;	mutliple page documents.  In that case, an error will be returned
;	by this routine and the calling program should make arrangements 
;	for the pages to be written to separate files.  
;

TR_EXPORT_END_PAGE	enum	TransRoutine
global	EPSExportEndPage:far
;
;       pass:           dx	- handle of block holding ExportOptionsStruct
;				  (or 0 if no options required)
;			di	- EPSExportLowStreamStruct block handle
;
;       return:  	ax	- error code, type TransError
;
;       This call performs part of the export function.  It should be used
;	along with EPSExportBeginPage to bracket each page of the document
;	if the document contains multiple pages.  It is not necessary
;	for single page documents.  Some graphics formats will not support
;	mutliple page documents.  In that case, an error will be returned
;	by the EPSExportBeginPage routine and the calling program should 
;	make arrangements for the pages to be written to separate files.  
;

TR_NORMALIZE_FILENAME	enum	TransRoutine
global	EPSNormalizeFilename:far
;
;       pass:           dx	- handle of block holding ExportOptionsStruct
;				  (or 0 if no options required)
;       return:   	ax	- error code, type TransError
;
;       The purpose of this call is to ensure that the filename to be used 
;	for output conforms to the standard file naming conventions for this
;	type of graphics file.  This call performs part of the export 
;	function.  It should be called after EPSGetExportOptions is 
;	called, and after all the options are setup in the options block.  
;	When this call return, the filename in the options block will be
;	changed (if necessary) to conform to file naming conventions.
;

TR_EXPORT_BITMAP	enum	TransRoutine
global	EPSExportBitmap:far
;
;	pass:		dx	- handle of block holding ExportOptionsStruct
;				  (or 0 if no options required)
;			si	- gstate for export
;			di	- EPSExportLowStreamStruct block handle
;			bx.ax	- Huge bitmap (VMFile.VMBlock)
;
;	return: 	ax	- error code, type TransError
;
;	This call is similar to TR_EXPORT_LOW except it takes a bitmap
;	instead of a gstring.  The gstate can be used to specify position,
;	scale, etc. for the bitmap
;

;------------------------------------------------------------------------
;	Constants
;------------------------------------------------------------------------

; PostScript formats.  
; This enum is returned by the TransGetFormat routine

EpsFormat	etype	word
EF_STANDARD_EPS	enum	EpsFormat


; PostScript font lists
; There are a number of "standard" font lists for PostScript printers.  Most
; commonly known are the "Standard 13" and the "Standard 35".  This enum
; is stored in the PostScript printer driver for each device supported by
; the driver.  It is set as an option to the PS Translation Library, which
; defaults to using the Standard13
; The initial group of enums was culled from an Adobe document describing 
; different printers that incorporated PostScript.  It is a brochure called
; "PostScript Products" and is dated September 1990.

PSFontList	etype	word, 0, 2
PSFL_STANDARD_13 enum	PSFontList	; the standard 13: Courier, 
					;  Courier-Obl,Bold,Bold-Obl,
					;  Helvetica,Helvetica-Obl,Bold,Bold-Obl
					;  Times Roman,Times-Ital,Bold,Bold-Ital
					;  Symbol
PSFL_STANDARD_35N enum	PSFontList	; standard 13 plus:
					;  Helvetica-Narrow,Nar-Obl,Nar-Bold,
					;  Nar-Bold-Obl, 
					;  ITC Avant Garde Gothic Book,Book-Obl,
					;  Demi,Demi-Obl, 
					;  ITC Bookman Light,Light-Ital,Demi,
					;  Demi-Ital, 
					;  ITC ZapfChancery Medium Italic,
					;  ITC ZapfDingbats, 
					;  New Century Schoolbook Roman,Ital,
					;  Bold,Bold Ital,
					;  Palatino Roman,Ital,Bold,Bold Ital
PSFL_STANDARD_35C enum	PSFontList	; same as 35N except Helvetica-Condensed
					;  instead of Helvetica-Narrow
PSFL_AGFA_74	enum	PSFontList	; standard 35C, plus:
					;  Helvetica Light, Light-Obl; 
					;  Helvetica Black, Black Obl; 
					;  Helvetica Narrow, Nar Obl,Nar Bold, 
					;  Nar Bold Obl; 
					;  ITC American Typewriter Medium, Bold
					;  ITC Bookman Light,Light Ital, Demi, 
					;  Demi Ital; 
					;  ITC Garamond Light, Light Ital, 
					;  Bold, Bold Ital
					;  ITC Korinna Regular, Kursiv Reg, 
					;  Bold, Kursiv Bold; 
					;  ITC Lubalin Graph Book, Book Obl, 
					;  Demi, Demi Obl
					;  ITC Souvenir Light, Light Ital, 
					;  Demi, Demi Ital;
					;  Letter Gothic Reg, Slanted, Bold, 
					;  Bold Slanted
					;  Lucida Roman, Ital,Bold,Bold Ital, 
					;  Optima , Obl, Bold, Bold Obl
					;  Park Avenue
PSFL_DEC_29	enum	PSFontList	; standard 13, plus:
					;  ITC Avant Garde Gothic Book,
					;  Book-Obl,Demi,Demi-Obl 
					;  ITC Lubalin Graph Book, Book
					;  Obl, Demi, Demi Obl; 
					;  ITC Souvenir Light, Light Ital, 
					;  Demi, Demi Ital;
					;  New Century Schoolbook Roman,Ital,
					;  Bold,Bold Ital,
PSFL_IBM_17	enum	PSFontList	; standard 13, plus:
PSFL_TI_17	equ	PSFL_IBM_17	; standard 13, plus:
					;  Helvetica Narrow, Nar Obl,Nar Bold, 
					;  Nar Bold Obl; 
PSFL_IBM_39	enum	PSFontList	; IBM 17, plus:
					;  Helvetica Light, Light-Obl; 
					;  Helvetica Black, Black Obl; 
					;  ITC Avant Garde Gothic Book,
					;  Book-Obl,Demi,Demi-Obl 
					;  ITC Bookman Light,Light Ital, Demi, 
					;  Demi Ital; 
					;  ITC ZapfChancery Medium Italic,
					;  ITC ZapfDingbats, 
					;  New Century Schoolbook Roman,Ital,
					;  Bold,Bold Ital,
					;  Palatino Roman,Ital,Bold,Bold Ital
PSFL_IBM_43	enum	PSFontList	; standard 13, plus:
					;  Helvetica Light, Light-Obl; 
					;  Helvetica Black, Black Obl; 
					;  ITC Avant Garde Gothic Book,
					;  Book-Obl,Demi,Demi-Obl 
					;  ITC Bookman Light,Light Ital, Demi, 
					;  Demi Ital; 
					;  ITC ZapfChancery Medium Italic,
					;  ITC ZapfDingbats, 
					;  New Century Schoolbook Roman,Ital,
					;  Bold,Bold Ital,
					;  Palatino Roman,Ital,Bold,Bold Ital
					;  ITC Garamond Light, Light Ital, 
					;  Bold, Bold Ital
					;  ITC Korinna Regular, Kursiv Reg, 
					;  Bold, Kursiv Bold; 
PSFL_IBM_47	enum	PSFontList	; IBM 43, plus:
					;  Helvetica Narrow, Nar Obl,Nar Bold, 
					;  Nar Bold Obl; 
PSFL_MONOTYPE_8	enum	PSFontList	; Times New Roman, 
					;  Times Italic, Bold, Bold Italic
					;  Arial, Italic, Bold, Bold Italic
PSFL_MONOTYPE_70 enum	PSFontList	; Monotype 8 plus:
					;  Monotype Baskerville, Ital,SemiBold,
					;  Semi Bold Italic, Bold, Bold Italic
					;  Ehrhardt, Ital,SemiBold,SemiBoldItal
					;  Monotype Garamond, Ital 156,Ital 174,
					;  Bold, Bold Italic
					;  Goudy Modern, Ital, text, Extra Bold
					;  Imprint, Italic, Bold, Bold Italic
					;  Ionic, Italic, Bold
					;  Joanna, Italic, Bold, Bold Italic
					;  New Claredon, Bold
					;  Nimrod, Italic, Bold, Bold Italic
					;  Perpetua, Italic, Bold, Bold Italic
					;  Monotype Walbaum, Italic, Medium, 
					;  Medium Italic
					;  Ashley Script, Biffo Script,
					;  Braggadocio, Claredon,
					;  Dorchester Script, Egyptian Extended
					;  Figaro, Forte, Klang, Monoline Script
					;  New Berolina, Palace Script, Pepita,
					;  Script Bold, Swing Bold
PSFL_JAPANESE_2 enum	PSFontList	; Ryumin Light KL,
					;  Gothic Medium BBB
PSFL_JAPANESE_5 enum	PSFontList	; Japanese2, plus:
					;  Futo Min A101, Futo Go B101, Jun 101
PSFL_WANG_14	enum	PSFontList	; standard 13, plus:
					;  Inline
PSFL_WANG_32	enum	PSFontList	; Wang 14, plus:
					;  Helvetica Narrow, Nar Obl,Nar Bold, 
					;  Nar Bold Obl; 
					;  ITC Avant Garde Gothic Book,
					;  Book-Obl,Demi,Demi-Obl 
					;  ITC ZapfChancery Medium Italic,
					;  ITC ZapfDingbats, 
					;  New Century Schoolbook Roman,Ital,
					;  Bold,Bold Ital,
					;  Palatino Roman,Ital,Bold,Bold Ital
PSFL_ADOBE_TC1	enum	PSFontList	; cartridge for LaserJet II
					;  Bodoni Poster, Cooper Black,
					;  Copperplate Gothic 31AB, Cottonwood,
					;  ITC Franklin Gothic No. 2,
					;  Freestyle Script, Hobo, Juniper,
					;  Linotext, Lithos Bold, Peignot Demi,
					;  Present Script, Stencil, Trajan, 
					;  VAG Rounded Bold
PSFL_ADOBE_TC2	enum	PSFontList	; cartridge for LaserJet II
					;  Adobe Garamond Regular, Ital, 
					;  Semibold,Semibold Ital,Bold,BoldItal
					;  Helvetica Light, Light-Obl; 
					;  Helvetica Black, Black Obl; 
					;  Helvetica Compressed
					;  Bodoni, Ital, Bold, Bold Ital
					;  Bodoni Poster
					;  Bodoni Bold Condensed
					;  Tekton, Oblique
PSFL_ADOBE_FULL_SET enum PSFontList	; full set, every Adobe font.
PSFL_QMS_43	enum	PSFontList	; standard 35N, plus:
					;  Helvetica Condensed, Cond Obl,
					;  Cond Bold, Cond Bold Obl; 
					;  Adobe Garamond, Ital, 
					;  Bold, Bold Ital

;------------------------------------------------------------------------
;	Structures
;------------------------------------------------------------------------

;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;
;		IMPORT AND EXPORT OPTIONS BLOCK
;
;	These data structures are one of the central pieces of data that
;	are passed to the translation routines.  Their structure is fairly
;	simple, as described below:
;
;	* The first part of the block contains options that are common
;	  to all translation libraries of a given category.  These elements
;	  are defined in the appropriate xlat<Category>.def (for example,
;	  xlatGrfx.def for the graphics category) file
;
;	* The second part of the block contains options that are particular
;	  to the specific data file type being translated.  This structure
;	  is defined in the appropriate xlat<FileType>.def (for example,
;	  xlatPS.def for the PostScript library) file.
;
;	* The final part of the block contains state variables used internally
;	  by the translation library.  These are typically defined internal
;	  to the library and are not defined for use outside the translation
;	  library.  Changing these values will probably de-rail the 
;	  translation process.
;
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


;	Import Flags
;	This bit field is used to specify a number of options...

GImportFlags	record	
    GIF_UNUSED:16			; options to be specified later
GImportFlags	end

;	Import Options
;	This structure holds the common import options required of all 
;	graphics translation libraries.  For individual translation 
;	libraries that require additional options, those additions are
;	appended to the end of this structure (this is always the first
;	element of any larger structure)

GImportOpts	struct
    GIO_flags	GImportFlags		; bit field of import options
GImportOpts	ends





;	Export Flags
;	This bit field is used to specify a number of options...
;	When defining a new option, make the default state=0 so that it
;	is easy to initialize....

GExportFlags	record	
    GEF_NO_COMMENTS:1,			; don't write out comments
    GEF_NO_HEADER:1,			; don't write out header
    GEF_NO_TRAILER:1,			; don't write out trailer
    GEF_COLLATE:1,			; collate copies if #copies > 1
    GEF_PAGES_DESCENDING:1,		; pages in descending order if #pages >1
    GEF_UNUSED:11			; options to be specified later
GExportFlags	end


;	Export Options
;	This structure holds the common export options required of all 
;	graphics translation libraries.  For individual translation 
;	libraries that require additional options, those additions are
;	appended to the end of this structure (this is always the first
;	element of any larger structure)

GExportOpts	struct
    GEO_flags	GExportFlags		; bit field of export options
    GEO_drawFlags GSControl		; flags to pass to GrDrawGString
    GEO_pages	word			; # pages to output (0 if unknown)
    GEO_copies	word			; #copies
    GEO_appName	char FILE_LONGNAME_LENGTH+1 dup (?) ; name of application
    GEO_docName	char FILE_LONGNAME_LENGTH+1 dup (?) ; name of document

    GEO_fileName char PATH_BUFFER_SIZE dup (?) ; name/path of file
					; this file name can be either absolute
					;  or relative to the DOCUMENT directory
    GEO_docH	dword			; document height 
    GEO_docW	dword			; document width
    GEO_hFile	hptr			; file handle for above fileName
GExportOpts	ends

;	Export Flags
;	This bit field is used to specify a number of options...
;	When defining a new option, make the default state=0 so that it
;	is easy to initialize....

PSExportFlags	record	
    PSEF_EPS_FILE:1,			; it's an EPS file for export.
    PSEF_INCLUDE_PREVIEW:1,		; include bitmap for preview
    PSEF_UNUSED:14			; options to be specified later
PSExportFlags	end

;	PostScript Level
;	This bit field is used to specify the capabilities of the PostScript
;	interpreter that the output is destined for.  Default is level 1, 
;	no extensions.

PSLevel	record	
    PSL_CMYK:1,				; CMYK color extensions to level 1
    PSL_DPS:1,				; Display PostScript ext to level 1
    PSL_COMPOSITE:1,			; Composite Font extensions to level 1
    PSL_FILE:1,				; File System extensions to level 1
    PSL_UNUSED:4,			; options to be specified later
    PSL_LEVEL:8				; low byte is level
PSLevel	end

;	Export Structure
;	This structure holds the options that are passed to the EPSExport
;	routine that control the export operation.

PSExportOpts	struct
    PSEO_common	GExportOpts	<>		; common export options
    PSEO_flags	PSExportFlags 			; flags for PostScript options
    PSEO_fonts	PSFontList			; standard font lists
    PSEO_level	PSLevel				; PostScript Level Info
PSExportOpts	ends


;	Import Structure
;	This structure holds the options that are passed to the EPSImport
;	routine that control the import operation.

PSImportOpts	struct
    PSIO_common	GImportOpts	<>		; common import options
PSImportOpts	ends


;	Structure passed to write data to stream

EPSExportLowStreamStruct        struct
        ESPELSS_token           word		; stream token
        ESPELSS_strategy        fptr.far	; stream driver strategy
EPSExportLowStreamStruct        ends

EndLibrary	eps
