' ########################################################################################
' Microsoft Windows
' File: mxdc.inc
' Contents: Header file for the Microsoft XPS Document Converter (MXDC), which is the
' conversion component of the Microsoft XPS Digital Writer (MXDW).
' Copyright (c) 2011 Jos? Roca
' Portions Copyright (c) Microsoft Corporation.
' All Rights Reserved.
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
' MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
' ########################################################################################
#IF NOT %DEF(PBX_mxdc_PBI)
#DEFINE PBX_mxdc_PBI
%EQUATE `MXDC_INC = 1
#INCLUDE ONCE "Core/Windows.inc"
'#if (NTDDI_VERSION >= NTDDI_VISTASP1)
$$MXDC_IMAGEABLE_AREA_PROP_NAME_WSTR = "MxdcImageableArea"$$
$$MXDC_IMAGE_COMPRESSION_TYPE_PROP_NAME_WSTR = "MxdcImageCompressionType"$$
$$MXDC_DOTS_PER_INCH_PROP_NAME_WSTR = "MxdcDotsPerInch"$$
$$MXDC_LANDSCAPE_ROTATION_PROP_NAME_WSTR = "MxdcLandscapeRotation"$$
' enum MXDC_LANDSCAPE_ROTATION_ENUMS
%EQUATE `MXDC_LANDSCAPE_ROTATE_COUNTERCLOCKWISE_90_DEGREES = 90 ' // 90 Degrees rotation counter-clockwise
%EQUATE `MXDC_LANDSCAPE_ROTATE_NONE = 0 ' // No Rotation
%EQUATE `MXDC_LANDSCAPE_ROTATE_COUNTERCLOCKWISE_270_DEGREES = -90 ' // 270 Degrees rotation counter-clockwise
'/*
' * Microsoft XPS Document Converter Image Types
' */
' enum MXDC_IMAGE_TYPE_ENUMS
%EQUATE `MXDC_IMAGETYPE_JPEGHIGH_COMPRESSION = 1 ' // Lowest Quality, and smallest file size
%EQUATE `MXDC_IMAGETYPE_JPEGMEDIUM_COMPRESSION = 2 ' // Medium Quality, and medium file size
%EQUATE `MXDC_IMAGETYPE_JPEGLOW_COMPRESSION = 3 ' // High Quality, and large file size
%EQUATE `MXDC_IMAGETYPE_PNG = 4 ' // Highest Quality, and largest file size
'//
'// MxdcGetPDEVAdjustment is exported by XPSDrv configuration module and called by the
'// Microsoft XPS Document Converter (MXDC) to supply printer configuration data in the form of a property bag.
'//
'HRESULT WINAPI
'MxdcGetPDEVAdjustment(
' ULONG cbDevMode,
' ULONG cbIn,
' ULONG cbPrintPropertiesCollection,
' );
'#endif // (NTDDI_VERSION >= NTDDI_VISTASP1)
%EQUATE `MXDC_ESCAPE = 4122
'/*
' * Operation Codes used with the MXDC Escape (MXDC_ESCAPE)
' */
' /* MXDC Destination File Name Query Escape */
%EQUATE `MXDCOP_GET_FILENAME = 14
'/* MXDC Document Sequence PrintTicket Escape */
%EQUATE `MXDCOP_PRINTTICKET_FIXED_DOC_SEQ = 22
'/* MXDC Fixed Document PrintTicket Escape */
%EQUATE `MXDCOP_PRINTTICKET_FIXED_DOC = 24
'/* MXDC Fixed Page PrintTicket Escape */
%EQUATE `MXDCOP_PRINTTICKET_FIXED_PAGE = 26
'/* MXDC S0 Page Pass-through Escape */
%EQUATE `MXDCOP_SET_S0PAGE = 28
'/* MXDC S0 Page Resource Pass-through */
%EQUATE `MXDCOP_SET_S0PAGE_RESOURCE = 30
'/* MXDC Full XPS Pass-through Mode */
%EQUATE `MXDCOP_SET_XPSPASSTHRU_MODE = 32
'#pragma pack(1)
'/*
' * All of the MXDC's Escapes must start with this structure.
' */
' // Size = 12 bytes
TYPE tagMxdcEscapeHeader BYTE
 cbInput AS DWORD ' ULONG
 cbOutput AS DWORD ' ULONG
 opCode AS DWORD ' ULONG
END TYPE
MACRO MXDC_ESCAPE_HEADER_T = tagMxdcEscapeHeader
MACRO MxdcEscapeHeader = tagMxdcEscapeHeader
' // Size = 6 bytes
TYPE tagMxdcGetFileNameData BYTE
 cbOutput AS DWORD ' ULONG
 wszData AS WSTRINGZ * 1 ' wchar_t // ' Variable-length array
END TYPE
MACRO MXDC_GET_FILENAME_DATA_T = tagMxdcGetFileNameData
MACRO MxdcGetFileNameData = tagMxdcGetFileNameData
'/*
' * Passthrough and entire S0 Page
' */
' // Size = 5 bytes
TYPE tagMxdcS0PageData BYTE
 dwSize AS DWORD
 bData(0) AS BYTE ' Variable-length array
END TYPE
MACRO MXDC_S0PAGE_DATA_T = tagMxdcS0PageData
MACRO MxdcS0PageData = tagMxdcS0PageData
'/*
' * Microsoft XPS Document Writer Resource Enumerators
' */
' enum MxdcS0PageEnums
%EQUATE `MXDC_RESOURCE_TTF = 0 ' /* TrueType (OpenType) font *' /
%EQUATE `MXDC_RESOURCE_JPEG = 1 ' /* JPEG Image *' /
%EQUATE `MXDC_RESOURCE_PNG = 2 ' /* PNG Image *' /
%EQUATE `MXDC_RESOURCE_TIFF = 3 ' /* TIFF Image *' /
%EQUATE `MXDC_RESOURCE_WDP = 4 ' /* Windows Media Photo Image *' /
%EQUATE `MXDC_RESOURCE_DICTIONARY = 5 ' /* Remote Resource Dictionary Pass-through *' /
%EQUATE `MXDC_RESOURCE_ICC_PROFILE = 6 ' /* ICC Profile Pass-through *' /
%EQUATE `MXDC_RESOURCE_JPEG_THUMBNAIL = 7 ' /* JPEG Thumbnail Pass-through *' /
%EQUATE `MXDC_RESOURCE_PNG_THUMBNAIL = 8 ' /* PNG Thumbnail Pass-through *' /
%EQUATE `MXDC_RESOURCE_MAX = 9 ' /* Maximum Resource Count for validation *' /
' // Size = 273 bytes
TYPE tagMxdcXpsS0PageResource BYTE
 dwSize AS DWORD ' DWORD /* Size of the structue and data */
 dwResourceType AS DWORD ' DWORD /* Resource Type, "MXDC_S0_PAGE_ENUMS" */
 szUri AS STRING * %MAX_PATH ' BYTE /* URI string of the resource */
 dwDataSize AS DWORD ' DWORD /* The resource's data byte size */
 bData(0) AS BYTE ' BYTE /* The resource's data */
END TYPE
MACRO MXDC_XPS_S0PAGE_RESOURCE_T = tagMxdcXpsS0PageResource
MACRO MxdcXpsS0PageResource = tagMxdcXpsS0PageResource
' // Size = 273 bytes
TYPE tagMxdcPrintTicketPassthrough BYTE
 dwDataSize AS DWORD ' DWORD /* The Print Ticket's data byte size */
 bData(0) AS BYTE ' BYTE /* The Print Ticket's data */
END TYPE
MACRO MXDC_PRINTTICKET_DATA_T = tagMxdcPrintTicketPassthrough
MACRO MxdcPrintTicketPassthrough = tagMxdcPrintTicketPassthrough
'/***********************************************************
' * MXDC Escape Data Structures
' *
' */
' // Size = 17 bytes
TYPE tagMxdcPrintTicketEscape BYTE
 mxdcEscape AS MXDC_ESCAPE_HEADER_T
 printTicketData AS MXDC_PRINTTICKET_DATA_T
END TYPE
MACRO MXDC_PRINTTICKET_ESCAPE_T = tagMxdcPrintTicketEscape
MACRO MxdcPrintTicketEscape = tagMxdcPrintTicketEscape
'/*
' * The application will use this to pass the entire
' * XPS Page through the MXDC.
' */
' // Size = 17 bytes
TYPE tagMxdcS0PagePassthroughEscape BYTE
 mxdcEscape AS MXDC_ESCAPE_HEADER_T
 xpsS0PageData AS MXDC_S0PAGE_DATA_T
END TYPE
MACRO MXDC_S0PAGE_PASSTHROUGH_ESCAPE_T = tagMxdcS0PagePassthroughEscape
MACRO MxdcS0PagePassthroughEscape = tagMxdcS0PagePassthroughEscape
'/*
' * This works in concert with MXDC_S0PAGE_PASSTHROUGH_ESCAPE_T.
' * This structure allows the respective resource of the
' * passed through XPS page to be saved. Some of the resource types
' * are as follows: JPEGs, PNGs, TIFFs, WDPs, Thumbnails, TTFs, etc..
' * The full list of resource types are described in the enum,
' * MXDC_S0_PAGE_ENUMS.
' */
' // Size = 285 bytes
TYPE tagMxdcS0PageResourceEscape BYTE
 mxdcEscape AS MXDC_ESCAPE_HEADER_T
 xpsS0PageResourcePassthrough AS MXDC_XPS_S0PAGE_RESOURCE_T
END TYPE
MACRO MXDC_S0PAGE_RESOURCE_ESCAPE_T = tagMxdcS0PageResourceEscape
MACRO MxdcS0PageResourceEscape = tagMxdcS0PageResourceEscape
'#pragma pack()
#ENDIF
