diff options
Diffstat (limited to 'print/XPSDrvSmpl/src')
282 files changed, 0 insertions, 79028 deletions
diff --git a/print/XPSDrvSmpl/src/common/bkdata.h b/print/XPSDrvSmpl/src/common/bkdata.h deleted file mode 100644 index dae29cf2..00000000 --- a/print/XPSDrvSmpl/src/common/bkdata.h +++ /dev/null @@ -1,46 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - bkdata.h - -Abstract: - - Booklet data structure definition. This provides a convenient description - of the PrintSchema JobBindAllDocuments and DcoumentBinding features. - ---*/ - -#pragma once - -#include "bkschema.h" - -namespace XDPrintSchema -{ - namespace Binding - { - struct BindingData - { - BindingData() : - bindFeature(JobBindAllDocuments), - bindOption(None), - bindGutter(0) - { - } - - EBinding bindFeature; - EBindingOption bindOption; - INT bindGutter; - }; - } -} - diff --git a/print/XPSDrvSmpl/src/common/bkpchndlr.cpp b/print/XPSDrvSmpl/src/common/bkpchndlr.cpp deleted file mode 100644 index 1ce57acf..00000000 --- a/print/XPSDrvSmpl/src/common/bkpchndlr.cpp +++ /dev/null @@ -1,201 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - bkpchndlr.cpp - -Abstract: - - Booklet PrintCapabilities handling implementation. The booklet PC handler - is used to set booklet settings in a PrintCapabilities document. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "xdexcept.h" -#include "bkpchndlr.h" -#include "globals.h" -#include "privatedefs.h" - -using XDPrintSchema::PRINTCAPABILITIES_NAME; - -using XDPrintSchema::Binding::EBinding; -using XDPrintSchema::Binding::EBindingMin; -using XDPrintSchema::Binding::EBindingMax; -using XDPrintSchema::Binding::EBindingOption; -using XDPrintSchema::Binding::EBindingOptionMin; -using XDPrintSchema::Binding::EBindingOptionMax; -using XDPrintSchema::Binding::BIND_FEATURES; -using XDPrintSchema::Binding::BIND_OPTIONS; - -/*++ - -Routine Name: - - CBookPCHandler::CBookPCHandler - -Routine Description: - - CBookPCHandler class constructor - -Arguments: - - pPrintCapabilities - Pointer to the DOM document representation of the PrintCapabilities - -Return Value: - - None - ---*/ -CBookPCHandler::CBookPCHandler( - _In_ IXMLDOMDocument2* pPrintCapabilities - ) : - CPCHandler(pPrintCapabilities) -{ -} - -/*++ - -Routine Name: - - CBookPCHandler::~CBookPCHandler - -Routine Description: - - CBookPCHandler class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CBookPCHandler::~CBookPCHandler() -{ -} - -/*++ - -Routine Name: - - CBookPCHandler::SetCapabilities - -Routine Description: - - This routine sets booklet capabilities in the PrintCapabilities passed to the - class constructor. - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CBookPCHandler::SetCapabilities( - VOID - ) -{ - HRESULT hr = S_OK; - - try - { - // - // Retrieve the PrintTicket root - // - CComPtr<IXMLDOMNode> pPTRoot(NULL); - - CComBSTR bstrPTQuery(m_bstrFrameworkPrefix); - bstrPTQuery += PRINTCAPABILITIES_NAME; - - if (SUCCEEDED(hr = GetNode(bstrPTQuery, &pPTRoot))) - { - for (EBinding bindFeatures = EBindingMin; - bindFeatures < EBindingMax && SUCCEEDED(hr); - bindFeatures = static_cast<EBinding>(bindFeatures + 1)) - { - CComPtr<IXMLDOMElement> pFeatureElement(NULL); - - if (SUCCEEDED(hr = CreateFeatureSelection(CComBSTR(BIND_FEATURES[bindFeatures]), NULL, &pFeatureElement))) - { - PTDOMElementVector optionList; - - for (EBindingOption bindOption = EBindingOptionMin; - bindOption < EBindingOptionMax && SUCCEEDED(hr); - bindOption = static_cast<EBindingOption>(bindOption + 1)) - { - // - // Create the booklet options - // - CComPtr<IXMLDOMElement> pOptionProperty(NULL); - - if (SUCCEEDED(hr = CreateOption(CComBSTR(BIND_OPTIONS[bindOption]), NULL, &pOptionProperty))) - { - optionList.push_back(pOptionProperty); - } - } - - // - // Add the options into the booklet feature - // - PTDOMElementVector::iterator iterOptionList = optionList.begin(); - - for (;iterOptionList != optionList.end() && SUCCEEDED(hr); iterOptionList++) - { - hr = pFeatureElement->appendChild(*iterOptionList, NULL); - } - } - - if (SUCCEEDED(hr)) - { - hr = pPTRoot->appendChild(pFeatureElement, NULL); - } - } - - for (UINT cIndex = 0; cIndex < numof(bkParamDefIntegers); cIndex++) - { - CComPtr<IXMLDOMElement> pParameterDef(NULL); - - if (SUCCEEDED(hr = CreateIntParameterDef(CComBSTR(bkParamDefIntegers[cIndex].property_name), // Paramater Name - bkParamDefIntegers[cIndex].is_public, // Is Print Schema keyword? - CComBSTR(bkParamDefIntegers[cIndex].display_name), // Display Text - bkParamDefIntegers[cIndex].default_value, // Default - bkParamDefIntegers[cIndex].min_length, // Min Length - bkParamDefIntegers[cIndex].max_length, // Max Length - bkParamDefIntegers[cIndex].multiple, // Multiple - CComBSTR(bkParamDefIntegers[cIndex].unit_type), // Unit Type - &pParameterDef))) // Parameter Def - { - hr = pPTRoot->appendChild(pParameterDef, NULL); - } - } - } - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/common/bkpchndlr.h b/print/XPSDrvSmpl/src/common/bkpchndlr.h deleted file mode 100644 index 46d65138..00000000 --- a/print/XPSDrvSmpl/src/common/bkpchndlr.h +++ /dev/null @@ -1,41 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - bkpchndlr.h - -Abstract: - - Booklet PrintCapabilities handling definition. The booklet PC handler - is used to set booklet settings in a PrintCapabilities. - ---*/ - -#pragma once - -#include "pchndlr.h" -#include "bkdata.h" - -class CBookPCHandler : public CPCHandler -{ -public: - CBookPCHandler( - _In_ IXMLDOMDocument2* pPrintCapabilities - ); - - virtual ~CBookPCHandler(); - - HRESULT - SetCapabilities( - VOID - ); -}; diff --git a/print/XPSDrvSmpl/src/common/bkpthndlr.cpp b/print/XPSDrvSmpl/src/common/bkpthndlr.cpp deleted file mode 100644 index 46fb54b6..00000000 --- a/print/XPSDrvSmpl/src/common/bkpthndlr.cpp +++ /dev/null @@ -1,318 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - bkpthndlr.cpp - -Abstract: - - Booklet PrintTicket handling implementation. The booklet PT handler - is used to extract booklet settings from a PrintTicket and populate - the booklet data structure with the retrieved settings. The class also - defines a method for setting the feature in the PrintTicket given the - data structure. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "bkpthndlr.h" - -using XDPrintSchema::PRINTTICKET_NAME; - -using XDPrintSchema::Binding::BindingData; -using XDPrintSchema::Binding::EBinding; -using XDPrintSchema::Binding::EBindingMin; -using XDPrintSchema::Binding::EBindingMax; -using XDPrintSchema::Binding::EBindingOption; -using XDPrintSchema::Binding::EBindingOptionMin; -using XDPrintSchema::Binding::EBindingOptionMax; -using XDPrintSchema::Binding::BIND_FEATURES; -using XDPrintSchema::Binding::BIND_OPTIONS; -using XDPrintSchema::Binding::BIND_PROP; -using XDPrintSchema::Binding::BIND_PROP_REF_SUFFIX; - -/*++ - -Routine Name: - - CBookPTHandler::CBookPTHandler - -Routine Description: - - CBookPTHandler class constructor - -Arguments: - - pPrintTicket - Pointer to the DOM document representation of the PrintTicket - -Return Value: - - None - ---*/ -CBookPTHandler::CBookPTHandler( - _In_ IXMLDOMDocument2* pPrintTicket - ) : - CPTHandler(pPrintTicket) -{ -} - -/*++ - -Routine Name: - - CBookPTHandler::~CBookPTHandler - -Routine Description: - - CBookPTHandler class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CBookPTHandler::~CBookPTHandler() -{ -} - -/*++ - -Routine Name: - - CBookPTHandler::GetData - -Routine Description: - - The routine fills the data structure passed in with binding data retrieved from - the PrintTicket passed to the class constructor. - -Arguments: - - pBindData - Pointer to the binding data structure to be filled in - -Return Value: - - HRESULT - S_OK - On success - E_ELEMENT_NOT_FOUND - Feature not present in PrintTicket - E_* - On error - ---*/ -HRESULT -CBookPTHandler::GetData( - _Out_ BindingData* pBindData - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pBindData, E_POINTER))) - { - for (EBinding bindFeature = EBindingMin; - bindFeature < EBindingMax; - bindFeature = static_cast<EBinding>(bindFeature + 1)) - { - CComBSTR bstrBindOption; - CComBSTR bstrFeature(BIND_FEATURES[bindFeature]); - - if (SUCCEEDED(hr = GetFeatureOption(bstrFeature, &bstrBindOption))) - { - pBindData->bindFeature = bindFeature; - - // - // Identify the option - // - for (EBindingOption bindOption = EBindingOptionMin; - bindOption < EBindingOptionMax; - bindOption = static_cast<EBindingOption>(bindOption + 1)) - { - if (bstrBindOption == BIND_OPTIONS[bindOption]) - { - pBindData->bindOption = bindOption; - break; - } - } - - // - // Get the gutter value if one exists otherwise use a default - // - if (FAILED(GetScoredPropertyValue(bstrFeature, CComBSTR(BIND_PROP), &pBindData->bindGutter))) - { - pBindData->bindGutter = 0; - } - - break; - } - else if (hr != E_ELEMENT_NOT_FOUND) - { - // - // We have an error other than the element is not present - // so we break and let the result return - // - break; - } - } - } - - // - // Validate the data - // - if (SUCCEEDED(hr)) - { - if (pBindData->bindFeature < EBindingMin || - pBindData->bindFeature >= EBindingMax || - pBindData->bindOption < EBindingOptionMin || - pBindData->bindOption >= EBindingOptionMax) - { - hr = E_FAIL; - } - } - - ERR_ON_HR_EXC(hr, E_ELEMENT_NOT_FOUND); - return hr; -} - -/*++ - -Routine Name: - - CBookPTHandler::SetData - -Routine Description: - - This routine sets the binding data in the PrintTicket passed to the - class constructor. - -Arguments: - - pBindData - Pointer to the binding data to be set in the PrintTicket - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CBookPTHandler::SetData( - _In_ CONST BindingData* pBindData - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pBindData, E_POINTER))) - { - if (pBindData->bindFeature < EBindingMin || - pBindData->bindFeature >= EBindingMax || - pBindData->bindOption < EBindingOptionMin || - pBindData->bindOption >= EBindingOptionMax) - { - hr = E_INVALIDARG; - } - } - - // - // Delete any exsting NUp settings as JobNUpAllDocumentsContiguously and DocumentNUp are mutually exclusive - // - if (SUCCEEDED(hr) && - pBindData->bindOption != XDPrintSchema::Binding::None) - { - // - // Create the following elements - // Feature and Option - // Parameter Ref and Parameter Init - // ScoredProperty - // - // Then append the scored property to the option node and the feature - // and parameter init nodes to the root PrintTicket node. Note: the - // scored poperty is created passing the parameter ref so it is already - // appended - // - CComPtr<IXMLDOMElement> pFeature(NULL); - CComPtr<IXMLDOMElement> pOption(NULL); - CComPtr<IXMLDOMElement> pParamRef(NULL); - CComPtr<IXMLDOMElement> pParamInit(NULL); - CComPtr<IXMLDOMElement> pScoredProp(NULL); - - CComBSTR bstrFeature(BIND_FEATURES[pBindData->bindFeature]); - - if (SUCCEEDED(DeleteFeature(bstrFeature))) - { - CComBSTR bstrPropName(BIND_PROP_REF_SUFFIX); - CComBSTR bstrParamRefName(bstrFeature); - bstrParamRefName += bstrPropName; - - if (SUCCEEDED(hr = CreateFeatureOptionPair(bstrFeature, - CComBSTR(BIND_OPTIONS[pBindData->bindOption]), - &pFeature, - &pOption)) && - SUCCEEDED(hr = CreateParamRefInitPair(bstrParamRefName, pBindData->bindGutter, &pParamRef, &pParamInit)) && - SUCCEEDED(hr = CreateScoredProperty(CComBSTR(BIND_PROP), pParamRef, &pScoredProp)) && - SUCCEEDED(hr = pOption->appendChild(pScoredProp, NULL)) && - SUCCEEDED(hr = AppendToElement(CComBSTR(PRINTTICKET_NAME), pFeature))) - { - hr = AppendToElement(CComBSTR(PRINTTICKET_NAME), pParamInit); - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CBookPTHandler::Delete - -Routine Description: - - This routine deletes the binding feature from the PrintTicket passed to the - class constructor - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CBookPTHandler::Delete( - VOID - ) -{ - HRESULT hr = S_OK; - - for (EBinding bindFeature = EBindingMin; - bindFeature < EBindingMax && SUCCEEDED(hr); - bindFeature = static_cast<EBinding>(bindFeature + 1)) - { - hr = DeleteFeature(CComBSTR(BIND_FEATURES[bindFeature])); - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/common/bkpthndlr.h b/print/XPSDrvSmpl/src/common/bkpthndlr.h deleted file mode 100644 index abd5ef9d..00000000 --- a/print/XPSDrvSmpl/src/common/bkpthndlr.h +++ /dev/null @@ -1,55 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - bkpthndlr.h - -Abstract: - - Booklet PrintTicket handling definition. The booklet PT handler - is used to extract booklet settings from a PrintTicket and populate - the booklet data structure with the retrieved settings. The class also - defines a method for setting the feature in the PrintTicket given the - data structure. - ---*/ - -#pragma once - -#include "pthndlr.h" -#include "bkdata.h" - -class CBookPTHandler : public CPTHandler -{ -public: - CBookPTHandler( - _In_ IXMLDOMDocument2* pPrintTicket - ); - - virtual ~CBookPTHandler(); - - HRESULT - GetData( - _Out_ XDPrintSchema::Binding::BindingData* pBindData - ); - - HRESULT - SetData( - _In_ CONST XDPrintSchema::Binding::BindingData* pBindData - ); - - HRESULT - Delete( - VOID - ); -}; - diff --git a/print/XPSDrvSmpl/src/common/bkschema.cpp b/print/XPSDrvSmpl/src/common/bkschema.cpp deleted file mode 100644 index daa26254..00000000 --- a/print/XPSDrvSmpl/src/common/bkschema.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - bkschema.cpp - -Abstract: - - Binding (booklet) PrintSchema implementation. This implements the features, - options and enumerations that describe the PrintSchema JobBindAllDocuments and - DocumentBinding features. - ---*/ - -#include "precomp.h" -#include "bkschema.h" - -LPCWSTR XDPrintSchema::Binding::BIND_FEATURES[] = { - L"JobBindAllDocuments", - L"DocumentBinding" -}; - -LPCWSTR XDPrintSchema::Binding::BIND_OPTIONS[] = { - L"Bale", - L"BindBottom", - L"BindLeft", - L"BindRight", - L"BindTop", - L"Booklet", - L"EdgeStitchBottom", - L"EdgeStitchLeft", - L"EdgeStitchRight", - L"EdgeStitchTop", - L"Fold", - L"JogOffset", - L"Trim", - L"None" -}; - -LPCWSTR XDPrintSchema::Binding::BIND_PROP = L"BindingGutter"; -LPCWSTR XDPrintSchema::Binding::BIND_PROP_REF_SUFFIX = L"Gutter"; - diff --git a/print/XPSDrvSmpl/src/common/bkschema.h b/print/XPSDrvSmpl/src/common/bkschema.h deleted file mode 100644 index bcf68df2..00000000 --- a/print/XPSDrvSmpl/src/common/bkschema.h +++ /dev/null @@ -1,77 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - bkschema.h - -Abstract: - - Binding (booklet) PrintSchema definition. This defines the features, - options and enumerations that describe the PrintSchema JobBindAllDocuments and - DocumentBinding features within a XDPrintSchema::Binding namespace. - ---*/ - -#pragma once - -#include "schema.h" - -namespace XDPrintSchema -{ - // - // Binding elements described as Printschema keywords - // - namespace Binding - { - // - // Job and Document share identical options so we define two - // features within the Binding namespace. - // - enum EBinding - { - JobBindAllDocuments = 0, EBindingMin = 0, - DocumentBinding, - EBindingMax - }; - - extern LPCWSTR BIND_FEATURES[EBindingMax]; - - // - // Option names - // - enum EBindingOption - { - Bale = 0, EBindingOptionMin = 0, - BindBottom, - BindLeft, - BindRight, - BindTop, - Booklet, - EdgeStitchBottom, - EdgeStitchLeft, - EdgeStitchRight, - EdgeStitchTop, - Fold, - JogOffset, - Trim, - None, - EBindingOptionMax - }; - - extern LPCWSTR BIND_OPTIONS[EBindingOptionMax]; - - extern LPCWSTR BIND_PROP; - - extern LPCWSTR BIND_PROP_REF_SUFFIX; - } -} - diff --git a/print/XPSDrvSmpl/src/common/cmdata.h b/print/XPSDrvSmpl/src/common/cmdata.h deleted file mode 100644 index 7b2dcb7f..00000000 --- a/print/XPSDrvSmpl/src/common/cmdata.h +++ /dev/null @@ -1,42 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - cmdata.h - -Abstract: - - PageColorManagement data structure definition. This provides a convenient - description of the PrintSchema PageColorManagement feature. - ---*/ - -#pragma once - -#include "cmschema.h" - -namespace XDPrintSchema -{ - namespace PageColorManagement - { - struct ColorManagementData - { - ColorManagementData() : - cmOption(None) - { - } - - EPCMOption cmOption; - }; - } -} - diff --git a/print/XPSDrvSmpl/src/common/cmintentsdata.h b/print/XPSDrvSmpl/src/common/cmintentsdata.h deleted file mode 100644 index f9fa2c20..00000000 --- a/print/XPSDrvSmpl/src/common/cmintentsdata.h +++ /dev/null @@ -1,42 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - cmintentsdata.h - -Abstract: - - PageICMRenderingIntent data structure definition. This provides a more - convenient description of the PrintSchema PageICMRenderingIntent feature. - ---*/ - -#pragma once - -#include "cmintentsschema.h" - -namespace XDPrintSchema -{ - namespace PageICMRenderingIntent - { - struct PageICMRenderingIntentData - { - PageICMRenderingIntentData() : - cmOption(AbsoluteColorimetric) - { - } - - EICMIntentOption cmOption; - }; - } -} - diff --git a/print/XPSDrvSmpl/src/common/cmintentsschema.cpp b/print/XPSDrvSmpl/src/common/cmintentsschema.cpp deleted file mode 100644 index 1b68de7b..00000000 --- a/print/XPSDrvSmpl/src/common/cmintentsschema.cpp +++ /dev/null @@ -1,34 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - cmintentsschema.cpp - -Abstract: - - PageICMRenderingIntent PrintSchema implementation. This implements the features, - options and enumerations that describe the PrintSchema PageICMRenderingIntent feature. - ---*/ - -#include "precomp.h" -#include "cmintentsschema.h" - -LPCWSTR XDPrintSchema::PageICMRenderingIntent::ICMINTENT_FEATURE = L"PageICMRenderingIntent"; - -LPCWSTR XDPrintSchema::PageICMRenderingIntent::ICMINTENT_OPTIONS[] = { - L"AbsoluteColorimetric", - L"RelativeColorimetric", - L"Photographs", - L"BusinessGraphics" -}; - diff --git a/print/XPSDrvSmpl/src/common/cmintentsschema.h b/print/XPSDrvSmpl/src/common/cmintentsschema.h deleted file mode 100644 index 73203876..00000000 --- a/print/XPSDrvSmpl/src/common/cmintentsschema.h +++ /dev/null @@ -1,55 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - cmintentsschema.h - -Abstract: - - PageICMRenderingIntent PrintSchema definition. This defines the features, - options and enumerations that describe the PrintSchema PageICMRenderingIntent feature - within a XDPrintSchema::PageICMRenderingIntent namespace. - ---*/ - -#pragma once - -#include "schema.h" - -namespace XDPrintSchema -{ - // - // PageColorManagementIntents elements described as Printschema keywords - // - namespace PageICMRenderingIntent - { - // - // Feature name - // - extern LPCWSTR ICMINTENT_FEATURE; - - // - // Who specified the profile to use - // - enum EICMIntentOption - { - AbsoluteColorimetric = 0, EICMIntentOptionMin = 0, - RelativeColorimetric, - Photographs, - BusinessGraphics, - EICMIntentOptionMax - }; - - extern LPCWSTR ICMINTENT_OPTIONS[EICMIntentOptionMax]; - } -} - diff --git a/print/XPSDrvSmpl/src/common/cmintpthndlr.cpp b/print/XPSDrvSmpl/src/common/cmintpthndlr.cpp deleted file mode 100644 index d23fffb6..00000000 --- a/print/XPSDrvSmpl/src/common/cmintpthndlr.cpp +++ /dev/null @@ -1,156 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - cmintpthndlr.cpp - -Abstract: - - PageICMRenderingIntent PrintTicket handler implementation. Derived from - CPTHandler, this provides PageICMRenderingIntent specific Get and Set methods - acting on the PrintTicket (as a DOM document) passed. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdexcept.h" -#include "cmintpthndlr.h" - -using XDPrintSchema::PageICMRenderingIntent::PageICMRenderingIntentData; -using XDPrintSchema::PageICMRenderingIntent::EICMIntentOption; -using XDPrintSchema::PageICMRenderingIntent::EICMIntentOptionMin; -using XDPrintSchema::PageICMRenderingIntent::BusinessGraphics; -using XDPrintSchema::PageICMRenderingIntent::EICMIntentOptionMax; -using XDPrintSchema::PageICMRenderingIntent::ICMINTENT_FEATURE; -using XDPrintSchema::PageICMRenderingIntent::ICMINTENT_OPTIONS; - -/*++ - -Routine Name: - - CColorManageIntentsPTHandler::CColorManageIntentsPTHandler - -Routine Description: - - CColorManageIntentsPTHandler class constructor - -Arguments: - - pPrintTicket - Pointer to the DOM document representation of the PrintTicket - -Return Value: - - None - ---*/ -CColorManageIntentsPTHandler::CColorManageIntentsPTHandler( - _In_ IXMLDOMDocument2* pPrintTicket - ) : - CPTHandler(pPrintTicket) -{ -} - -/*++ - -Routine Name: - - CColorManageIntentsPTHandler::~CColorManageIntentsPTHandler - -Routine Description: - - CColorManageIntentsPTHandler class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CColorManageIntentsPTHandler::~CColorManageIntentsPTHandler() -{ -} - -/*++ - -Routine Name: - - CColorManageIntentsPTHandler::GetData - -Routine Description: - - The routine fills the data structure passed in with color intent data retrieved - from the PrintTicket passed to the class constructor. - -Arguments: - - pCmData - Pointer to the color intent data structure to be filled in - -Return Value: - - HRESULT - S_OK - On success - E_ELEMENT_NOT_FOUND - Feature not present in PrintTicket - E_* - On error - ---*/ -HRESULT -CColorManageIntentsPTHandler::GetData( - _Inout_ PageICMRenderingIntentData* pCmData - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pCmData, E_POINTER))) - { - CComBSTR bstrCMOption; - - if (SUCCEEDED(hr = GetFeatureOption(CComBSTR(ICMINTENT_FEATURE), &bstrCMOption))) - { - // - // Get the profile type - // - for (EICMIntentOption cmOption = EICMIntentOptionMin; - cmOption < EICMIntentOptionMax; - cmOption = static_cast<EICMIntentOption>(cmOption + 1)) - { - if (bstrCMOption == ICMINTENT_OPTIONS[cmOption]) - { - pCmData->cmOption = cmOption; - break; - } - } - - if (SUCCEEDED(hr)) - { - if (pCmData->cmOption < EICMIntentOptionMin || - pCmData->cmOption >= EICMIntentOptionMax) - { - hr = E_FAIL; - } - } - } - else - { - pCmData->cmOption = BusinessGraphics; - hr = S_OK; - } - } - - ERR_ON_HR_EXC(hr, E_ELEMENT_NOT_FOUND); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/common/cmintpthndlr.h b/print/XPSDrvSmpl/src/common/cmintpthndlr.h deleted file mode 100644 index 19e5b4bc..00000000 --- a/print/XPSDrvSmpl/src/common/cmintpthndlr.h +++ /dev/null @@ -1,43 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - cmintpthndlr.h - -Abstract: - - PageICMRenderingIntent PrintTicket handler definition. Derived from - CPTHandler, this provides PageICMRenderingIntent specific Get and Set methods - acting on the PrintTicket (as a DOM document) passed. - ---*/ - -#pragma once - -#include "pthndlr.h" -#include "cmintentsdata.h" - -class CColorManageIntentsPTHandler : public CPTHandler -{ -public: - CColorManageIntentsPTHandler( - _In_ IXMLDOMDocument2* pPrintTicket - ); - - virtual ~CColorManageIntentsPTHandler(); - - HRESULT - GetData( - _Inout_ XDPrintSchema::PageICMRenderingIntent::PageICMRenderingIntentData* pCmData - ); -}; - diff --git a/print/XPSDrvSmpl/src/common/cmprofiledata.h b/print/XPSDrvSmpl/src/common/cmprofiledata.h deleted file mode 100644 index 29048ea3..00000000 --- a/print/XPSDrvSmpl/src/common/cmprofiledata.h +++ /dev/null @@ -1,44 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - cmprofiledata.h - -Abstract: - - PageSourceColorProfileData data structure definition. This provides - a convenient description of the PrintSchema PageSourceColorProfileData - feature. - ---*/ - -#pragma once - -#include "cmprofileschema.h" - -namespace XDPrintSchema -{ - namespace PageSourceColorProfile - { - struct PageSourceColorProfileData - { - PageSourceColorProfileData() : - cmProfile(RGB) - { - } - - EProfileOption cmProfile; - CComBSTR cmProfileName; - }; - } -} - diff --git a/print/XPSDrvSmpl/src/common/cmprofileschema.cpp b/print/XPSDrvSmpl/src/common/cmprofileschema.cpp deleted file mode 100644 index 5f74fa51..00000000 --- a/print/XPSDrvSmpl/src/common/cmprofileschema.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - cmprofileschema.cpp - -Abstract: - - PageSourceColorProfile PrintSchema implementation. This implements the - features, options and enumerations that describe the PrintSchema - PageSourceColorProfile feature. - ---*/ - -#include "precomp.h" -#include "globals.h" -#include "privatedefs.h" -#include "cmprofileschema.h" - -LPCWSTR XDPrintSchema::PageSourceColorProfile::PROFILE_FEATURE = L"PageSourceColorProfile"; - -LPCWSTR XDPrintSchema::PageSourceColorProfile::PROFILE_OPTIONS[] = { - L"RGB", - L"CMYK" -}; - -LPCWSTR XDPrintSchema::PageSourceColorProfile::PROFILE_URI_PROP = L"SourceColorProfileURI"; -LPCWSTR XDPrintSchema::PageSourceColorProfile::PROFILE_URI_REF = L"PageSourceColorProfileURI"; - -PRIVATE_DEF_STRINGS XDPrintSchema::PageSourceColorProfile::PROFILE_PARAM_DEF = { - "PageSourceColorProfileURI", - NULL, - "xdCMYKPrinter.icc", - 0, - 65536, - "characters" -}; - - - diff --git a/print/XPSDrvSmpl/src/common/cmprofileschema.h b/print/XPSDrvSmpl/src/common/cmprofileschema.h deleted file mode 100644 index 659d42c5..00000000 --- a/print/XPSDrvSmpl/src/common/cmprofileschema.h +++ /dev/null @@ -1,60 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - cmintentsschema.h - -Abstract: - - PageSourceColorProfile PrintSchema definition. This defines the features, - options and enumerations that describe the PrintSchema PageSourceColorProfile - feature within a XDPrintSchema::PageSourceColorProfile namespace. - - ---*/ - -#pragma once - -#include "schema.h" -#include "globals.h" -#include "privatedefs.h" - -namespace XDPrintSchema -{ - // - // PageColorManagement elements described as Printschema keywords - // - namespace PageSourceColorProfile - { - // - // Feature name - // - extern LPCWSTR PROFILE_FEATURE; - - // - // Who specified the profile to use - // - enum EProfileOption - { - RGB = 0, EProfileOptionMin = 0, - CMYK, - EProfileOptionMax - }; - - extern LPCWSTR PROFILE_OPTIONS[EProfileOptionMax]; - - extern LPCWSTR PROFILE_URI_PROP; - extern LPCWSTR PROFILE_URI_REF; - extern PRIVATE_DEF_STRINGS PROFILE_PARAM_DEF; - } -} - diff --git a/print/XPSDrvSmpl/src/common/cmprofpchndlr.cpp b/print/XPSDrvSmpl/src/common/cmprofpchndlr.cpp deleted file mode 100644 index a8f5bb9c..00000000 --- a/print/XPSDrvSmpl/src/common/cmprofpchndlr.cpp +++ /dev/null @@ -1,179 +0,0 @@ -/*++ - -Copyright (c) 2008 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. - -File Name: - - cmprofpchndlr.cpp - -Abstract: - - PageSourceColorProfile PrintCapabilities handling implementation. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdexcept.h" -#include "ptquerybld.h" -#include "cmprofpchndlr.h" - -using XDPrintSchema::PRINTCAPABILITIES_NAME; - -using XDPrintSchema::PageSourceColorProfile::PROFILE_FEATURE; -using XDPrintSchema::PageSourceColorProfile::PROFILE_OPTIONS; -using XDPrintSchema::PageSourceColorProfile::PROFILE_URI_PROP; -using XDPrintSchema::PageSourceColorProfile::PROFILE_URI_REF; -using XDPrintSchema::PageSourceColorProfile::PROFILE_PARAM_DEF; -using XDPrintSchema::PageSourceColorProfile::EProfileOption; -using XDPrintSchema::PageSourceColorProfile::EProfileOptionMax; -using XDPrintSchema::PageSourceColorProfile::EProfileOptionMin; -using XDPrintSchema::PageSourceColorProfile::RGB; -using XDPrintSchema::PageSourceColorProfile::CMYK; - -/*++ - -Routine Name: - - CColorManageProfilePCHandler::CColorManageProfilePCHandler - -Routine Description: - - CColorManageProfilePCHandler class constructor - -Arguments: - - pPrintCapabilities - Pointer to the DOM document representation of the PrintCapabilities - -Return Value: - - None - ---*/ -CColorManageProfilePCHandler::CColorManageProfilePCHandler( - _In_ IXMLDOMDocument2* pPrintCapabilities - ) : - CPCHandler(pPrintCapabilities) -{ -} - -/*++ - -Routine Name: - - CColorManageProfilePCHandler::~CColorManageProfilePCHandler - -Routine Description: - - CColorManageProfilePCHandler class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CColorManageProfilePCHandler::~CColorManageProfilePCHandler() -{ -} - -/*++ - -Routine Name: - - CColorManageProfilePCHandler::SetCapabilities - -Routine Description: - - This routine sets color profile capabilities in the PrintCapabilities passed to the - class constructor. - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorManageProfilePCHandler::SetCapabilities( - VOID - ) -{ - HRESULT hr = S_OK; - - try - { - // - // Retrieve the PrintTicket root - // - CComPtr<IXMLDOMNode> pPCRoot(NULL); - CComPtr<IXMLDOMElement> pFeatureElement(NULL); - - CComBSTR bstrPTQuery(m_bstrFrameworkPrefix); - bstrPTQuery += PRINTCAPABILITIES_NAME; - - if (SUCCEEDED(hr = GetNode(bstrPTQuery, &pPCRoot)) && - SUCCEEDED(hr = CreateFeatureSelection(CComBSTR(PROFILE_FEATURE), NULL, &pFeatureElement))) - { - for ( EProfileOption option = EProfileOptionMin; - option < EProfileOptionMax && SUCCEEDED(hr); - option = static_cast<EProfileOption>(option + 1)) - { - CComPtr<IXMLDOMElement> pOptionElement(NULL); - CComPtr<IXMLDOMElement> pScoredPropElement(NULL); - CComPtr<IXMLDOMElement> pPropRefElement(NULL); - - if (SUCCEEDED(hr = CreateOption(CComBSTR(PROFILE_OPTIONS[option]), NULL, &pOptionElement)) && - SUCCEEDED(hr = CreateScoredProperty(CComBSTR(PROFILE_URI_PROP), &pScoredPropElement)) && - SUCCEEDED(hr = CreateParameterRef(CComBSTR(PROFILE_URI_REF), &pPropRefElement)) && - SUCCEEDED(hr = pScoredPropElement->appendChild(pPropRefElement, NULL)) && - SUCCEEDED(hr = pOptionElement->appendChild(pScoredPropElement, NULL))) - { - hr = pFeatureElement->appendChild(pOptionElement, NULL); - } - } - - CComPtr<IXMLDOMElement> pParameterDef(NULL); - - if (SUCCEEDED(hr = pPCRoot->appendChild(pFeatureElement, NULL)) && - SUCCEEDED(hr = CreateStringParameterDef( CComBSTR(PROFILE_PARAM_DEF.property_name), // Paramater Name - TRUE, // Is Print Schema Keyword? - CComBSTR(PROFILE_PARAM_DEF.display_name), // Display Text - CComBSTR(PROFILE_PARAM_DEF.default_value), // Default - PROFILE_PARAM_DEF.min_length, // Min Length - PROFILE_PARAM_DEF.max_length, // Max Length - CComBSTR(PROFILE_PARAM_DEF.unit_type), // Unit Type - &pParameterDef))) // Parameter Def - { - hr = pPCRoot->appendChild(pParameterDef, NULL); - } - } - - - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - - ERR_ON_HR(hr); - - return S_OK; -} diff --git a/print/XPSDrvSmpl/src/common/cmprofpchndlr.h b/print/XPSDrvSmpl/src/common/cmprofpchndlr.h deleted file mode 100644 index 059ca831..00000000 --- a/print/XPSDrvSmpl/src/common/cmprofpchndlr.h +++ /dev/null @@ -1,42 +0,0 @@ -/*++ - -Copyright (c) 2008 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. - -File Name: - - cmprofpthndlr.h - -Abstract: - - PageSourceColorProfile PrintCapabilities handling definition. - ---*/ - -#pragma once - -#include "pchndlr.h" -#include "cmprofiledata.h" - -class CColorManageProfilePCHandler : public CPCHandler -{ -public: - - CColorManageProfilePCHandler( - _In_ IXMLDOMDocument2* pPrintCapabilities - ); - - virtual ~CColorManageProfilePCHandler(); - - HRESULT - SetCapabilities( - VOID - ); -}; - diff --git a/print/XPSDrvSmpl/src/common/cmprofpthndlr.cpp b/print/XPSDrvSmpl/src/common/cmprofpthndlr.cpp deleted file mode 100644 index ee074fdb..00000000 --- a/print/XPSDrvSmpl/src/common/cmprofpthndlr.cpp +++ /dev/null @@ -1,206 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - cmprofpthndlr.cpp - -Abstract: - - PageSourceColorProfile PrintTicket handling implementation. - The PageSourceColorProfile PT handler is used to extract - PageSourceColorProfile settings from a PrintTicket and populate - the PageSourceColorProfile data structure with the retrieved - settings. The class also defines a method for setting the feature in - the PrintTicket given the data structure. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdexcept.h" -#include "ptquerybld.h" -#include "cmprofpthndlr.h" - -using XDPrintSchema::SCHEMA_STRING; -using XDPrintSchema::PRINTTICKET_NAME; - -using XDPrintSchema::PageSourceColorProfile::PageSourceColorProfileData; -using XDPrintSchema::PageSourceColorProfile::EProfileOption; -using XDPrintSchema::PageSourceColorProfile::EProfileOptionMin; -using XDPrintSchema::PageSourceColorProfile::EProfileOptionMax; -using XDPrintSchema::PageSourceColorProfile::PROFILE_FEATURE; -using XDPrintSchema::PageSourceColorProfile::PROFILE_OPTIONS; -using XDPrintSchema::PageSourceColorProfile::PROFILE_URI_PROP; -using XDPrintSchema::PageSourceColorProfile::PROFILE_URI_REF; -using XDPrintSchema::PageSourceColorProfile::RGB; -using XDPrintSchema::PageSourceColorProfile::CMYK; - -/*++ - -Routine Name: - - CColorManageProfilePTHandler::CColorManageProfilePTHandler - -Routine Description: - - CColorManageProfilePTHandler class constructor - -Arguments: - - pPrintTicket - Pointer to the DOM document representation of the PrintTicket - -Return Value: - - None - ---*/ -CColorManageProfilePTHandler::CColorManageProfilePTHandler( - _In_ IXMLDOMDocument2* pPrintTicket - ) : - CPTHandler(pPrintTicket) -{ -} - -/*++ - -Routine Name: - - CColorManageProfilePTHandler::~CColorManageProfilePTHandler - -Routine Description: - - CColorManageProfilePTHandler class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CColorManageProfilePTHandler::~CColorManageProfilePTHandler() -{ -} - -/*++ - -Routine Name: - - CColorManageProfilePTHandler::GetData - -Routine Description: - - The routine fills the data structure passed in with color profile data - retrieved from the PrintTicket passed to the class constructor. - -Arguments: - - pCmData - Pointer to the color profile data structure to be filled in - -Return Value: - - HRESULT - S_OK - On success - E_ELEMENT_NOT_FOUND - Feature not present in PrintTicket - E_* - On error - ---*/ -HRESULT -CColorManageProfilePTHandler::GetData( - _Inout_ PageSourceColorProfileData* pCmData - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pCmData, E_POINTER))) - { - CComBSTR option; - if (SUCCEEDED(hr = GetFeatureOption(CComBSTR(PROFILE_FEATURE), &option)) && - SUCCEEDED(GetScoredPropertyValue(CComBSTR(PROFILE_FEATURE), CComBSTR(PROFILE_URI_PROP), &pCmData->cmProfileName)) - ) - { - pCmData->cmProfile = CMYK; // default to CMYK - - for (EProfileOption cmOption = EProfileOptionMin; - cmOption < EProfileOptionMax; - cmOption = static_cast<EProfileOption>(cmOption + 1)) - { - if (option == CComBSTR(PROFILE_OPTIONS[cmOption])) - { - pCmData->cmProfile = cmOption; - } - } - } - } - - ERR_ON_HR_EXC(hr, E_ELEMENT_NOT_FOUND); - return hr; -} - -/*++ - -Routine Name: - - CColorManageProfilePTHandler::SetData - -Routine Description: - - This routine sets the color profile data in the PrintTicket - passed to the class constructor. - -Arguments: - - pCmData - Pointer to the color profile data to be set in the PrintTicket - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorManageProfilePTHandler::SetData( - _In_ CONST PageSourceColorProfileData* pCmData - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pCmData, E_POINTER))) - { - CComPtr<IXMLDOMElement> pFeature(NULL); - CComPtr<IXMLDOMElement> pOption(NULL); - CComPtr<IXMLDOMElement> pUriProperty(NULL); - CComPtr<IXMLDOMElement> pRef(NULL); - CComPtr<IXMLDOMElement> pInit(NULL); - - - CComBSTR bstrFeature(PROFILE_FEATURE); - - if (SUCCEEDED(hr = DeleteFeature(bstrFeature)) && - SUCCEEDED(hr = CreateFeatureOptionPair(bstrFeature, CComBSTR(PROFILE_OPTIONS[pCmData->cmProfile]), &pFeature, &pOption)) && - SUCCEEDED(hr = CreateParamRefInitPair(CComBSTR(PROFILE_URI_REF), CComBSTR(SCHEMA_STRING), pCmData->cmProfileName, &pRef, &pInit)) && - SUCCEEDED(hr = CreateScoredProperty(CComBSTR(PROFILE_URI_PROP), pRef, &pUriProperty)) && - SUCCEEDED(hr = pOption->appendChild(pUriProperty, NULL)) && - SUCCEEDED(hr = AppendToElement(CComBSTR(PRINTTICKET_NAME), pInit))) - { - SUCCEEDED(hr = AppendToElement(CComBSTR(PRINTTICKET_NAME), pFeature)); - } - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/common/cmprofpthndlr.h b/print/XPSDrvSmpl/src/common/cmprofpthndlr.h deleted file mode 100644 index fb002a45..00000000 --- a/print/XPSDrvSmpl/src/common/cmprofpthndlr.h +++ /dev/null @@ -1,51 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - cmprofpthndlr.h - -Abstract: - - PageSourceColorProfile PrintTicket handling definition. - The PageSourceColorProfile PT handler is used to extract - PageSourceColorProfile settings from a PrintTicket and populate - the PageSourceColorProfile data structure with the retrieved - settings. The class also defines a method for setting the feature in - the PrintTicket given the data structure. - ---*/ - -#pragma once - -#include "pthndlr.h" -#include "cmprofiledata.h" - -class CColorManageProfilePTHandler : public CPTHandler -{ -public: - CColorManageProfilePTHandler( - _In_ IXMLDOMDocument2* pPrintTicket - ); - - virtual ~CColorManageProfilePTHandler(); - - HRESULT - GetData( - _Inout_ XDPrintSchema::PageSourceColorProfile::PageSourceColorProfileData* pCmData - ); - - HRESULT - SetData( - _In_ CONST XDPrintSchema::PageSourceColorProfile::PageSourceColorProfileData* pCmData - ); -}; - diff --git a/print/XPSDrvSmpl/src/common/cmpthndlr.cpp b/print/XPSDrvSmpl/src/common/cmpthndlr.cpp deleted file mode 100644 index cdd20311..00000000 --- a/print/XPSDrvSmpl/src/common/cmpthndlr.cpp +++ /dev/null @@ -1,154 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - cmpthndlr.cpp - -Abstract: - - PageColorManagement PrintTicket handling implementation. The - PageColorManagement PT handler is used to extract booklet settings - from a PrintTicket and populate the PageColorManagement data - structure with the retrieved settings. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdexcept.h" -#include "cmpthndlr.h" - -using XDPrintSchema::PageColorManagement::ColorManagementData; -using XDPrintSchema::PageColorManagement::EPCMOption; -using XDPrintSchema::PageColorManagement::EPCMOptionMin; -using XDPrintSchema::PageColorManagement::EPCMOptionMax; -using XDPrintSchema::PageColorManagement::PCM_FEATURE; -using XDPrintSchema::PageColorManagement::PCM_OPTIONS; - -/*++ - -Routine Name: - - CColorManagePTHandler::CColorManagePTHandler - -Routine Description: - - CColorManagePTHandler class constructor - -Arguments: - - pPrintTicket - Pointer to the DOM document representation of the PrintTicket - -Return Value: - - None - ---*/ -CColorManagePTHandler::CColorManagePTHandler( - _In_ IXMLDOMDocument2* pPrintTicket - ) : - CPTHandler(pPrintTicket) -{ -} - -/*++ - -Routine Name: - - CColorManagePTHandler::~CColorManagePTHandler - -Routine Description: - - CColorManagePTHandler class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CColorManagePTHandler::~CColorManagePTHandler() -{ -} - -/*++ - -Routine Name: - - CColorManagePTHandler::GetData - -Routine Description: - - The routine fills the data structure passed in with color management data - retrieved from the PrintTicket passed to the class constructor. - -Arguments: - - pCmData - Pointer to the color management data structure to be filled in - -Return Value: - - HRESULT - S_OK - On success - E_ELEMENT_NOT_FOUND - Feature not present in PrintTicket - E_* - On error - ---*/ -HRESULT -CColorManagePTHandler::GetData( - _Inout_ ColorManagementData* pCmData - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pCmData, E_POINTER))) - { - CComBSTR bstrCMOption; - - // - // Check whether to use driver or device color matching - // - if (SUCCEEDED(hr = GetFeatureOption(CComBSTR(PCM_FEATURE), &bstrCMOption))) - { - for (EPCMOption cmOpt = EPCMOptionMin; - cmOpt < EPCMOptionMax; - cmOpt = static_cast<EPCMOption>(cmOpt + 1)) - { - if (bstrCMOption == PCM_OPTIONS[cmOpt]) - { - pCmData->cmOption = cmOpt; - break; - } - } - } - - // - // Validate the data - // - if (SUCCEEDED(hr)) - { - if (pCmData->cmOption < EPCMOptionMin || - pCmData->cmOption >= EPCMOptionMax) - { - hr = E_FAIL; - } - } - } - - ERR_ON_HR_EXC(hr, E_ELEMENT_NOT_FOUND); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/common/cmpthndlr.h b/print/XPSDrvSmpl/src/common/cmpthndlr.h deleted file mode 100644 index 17faf30e..00000000 --- a/print/XPSDrvSmpl/src/common/cmpthndlr.h +++ /dev/null @@ -1,46 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - cmpthndlr.h - -Abstract: - - PageColorManagement PrintTicket handling definition. The - PageColorManagement PT handler is used to extract booklet settings - from a PrintTicket and populate the PageColorManagement data - structure with the retrieved settings. The class also - defines a method for setting the feature in the PrintTicket given the - data structure. - ---*/ - -#pragma once - -#include "pthndlr.h" -#include "cmdata.h" - -class CColorManagePTHandler : public CPTHandler -{ -public: - CColorManagePTHandler( - _In_ IXMLDOMDocument2* pPrintTicket - ); - - virtual ~CColorManagePTHandler(); - - HRESULT - GetData( - _Inout_ XDPrintSchema::PageColorManagement::ColorManagementData* pCmData - ); -}; - diff --git a/print/XPSDrvSmpl/src/common/cmschema.cpp b/print/XPSDrvSmpl/src/common/cmschema.cpp deleted file mode 100644 index f047f8fa..00000000 --- a/print/XPSDrvSmpl/src/common/cmschema.cpp +++ /dev/null @@ -1,34 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - cmschema.cpp - -Abstract: - - PageColorManagement PrintSchema implementation. This implements the features, - options and enumerations that describe the PrintSchema PageColorManagement feature. - ---*/ - -#include "precomp.h" -#include "cmschema.h" - -LPCWSTR XDPrintSchema::PageColorManagement::PCM_FEATURE = L"PageColorManagement"; - -LPCWSTR XDPrintSchema::PageColorManagement::PCM_OPTIONS[] = { - L"None", - L"Device", - L"Driver", - L"System" -}; - diff --git a/print/XPSDrvSmpl/src/common/cmschema.h b/print/XPSDrvSmpl/src/common/cmschema.h deleted file mode 100644 index 6f4a30a6..00000000 --- a/print/XPSDrvSmpl/src/common/cmschema.h +++ /dev/null @@ -1,55 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - cmschema.h - -Abstract: - - PageColorManagement PrintSchema definition. This defines the features, options - and enumerations that describe the PrintSchema PageColorManagement feature - within a XDPrintSchema::PageColorManagement namespace. - ---*/ - -#pragma once - -#include "schema.h" - -namespace XDPrintSchema -{ - // - // PageColorManagement elements described as Printschema keywords - // - namespace PageColorManagement - { - // - // Feature name - // - extern LPCWSTR PCM_FEATURE; - - // - // Option names - // - enum EPCMOption - { - None = 0, EPCMOptionMin = 0, - Device, - Driver, - System, - EPCMOptionMax - }; - - extern LPCWSTR PCM_OPTIONS[EPCMOptionMax]; - } -} - diff --git a/print/XPSDrvSmpl/src/common/globals.cpp b/print/XPSDrvSmpl/src/common/globals.cpp deleted file mode 100644 index 28cf17a5..00000000 --- a/print/XPSDrvSmpl/src/common/globals.cpp +++ /dev/null @@ -1,237 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - globals.cpp - -Abstract: - - Stores function implementations and variable instances global to the filter - module. This is shared between all filters. - ---*/ - -#include "precomp.h" -#include <VersionHelpers.h> - -// -// Module's Instance handle from DLLEntry of process. -// -HINSTANCE g_hInstance = NULL; - -// -// Server lock count -// -LONG g_cServerLocks = 0; - -/*++ - -Routine Name: - - GetLastErrorAsHResult - -Routine Description: - - Converts the Win32 last error to an HRESULT - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -GetLastErrorAsHResult( - void - ) -{ - DWORD error = GetLastError(); - - return HRESULT_FROM_WIN32(error); -} - -/*++ - -Routine Name: - - GetLastErrorAsHResult - -Routine Description: - - Converts a GDI status error to an HRESULT - -Arguments: - - gdiPStatus - The GDI plus status value to be converted to an HRESULT - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -GetGDIStatusErrorAsHResult( - _In_ Status gdiPStatus - ) -{ - HRESULT hr = E_FAIL; - - switch (gdiPStatus) - { - case Ok: - { - hr = S_OK; - } - break; - - case GenericError: - { - hr = E_FAIL; - } - break; - - case InvalidParameter: - { - hr = E_INVALIDARG; - } - break; - - case OutOfMemory: - { - hr = E_OUTOFMEMORY; - } - break; - - case ObjectBusy: - { - hr = E_PENDING; - } - break; - - case InsufficientBuffer: - { - hr = E_OUTOFMEMORY; - } - break; - - case NotImplemented: - { - hr = E_NOTIMPL; - } - break; - - case Win32Error: - { - hr = GetLastErrorAsHResult(); - } - break; - - case FileNotFound: - { - hr = HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND); - } - break; - - case AccessDenied: - { - hr = HRESULT_FROM_WIN32(ERROR_ACCESS_DENIED); - } - break; - - // - // Default to E_FAIL - // - case UnknownImageFormat: - case FontFamilyNotFound: - case FontStyleNotFound: - case NotTrueTypeFont: - case UnsupportedGdiplusVersion: - case GdiplusNotInitialized: - case PropertyNotFound: - case PropertyNotSupported: - case ValueOverflow: - case Aborted: - case WrongState: - default: - break; - }; - - return hr; -} - -/*++ - -Routine Name: - - IsVista - -Routine Description: - - Checks if we are running under Vista - -Arguments: - - None - -Return Value: - - TRUE if we are under Vista - FALSE otherwise - ---*/ - -BOOL -IsVista( - VOID - ) -{ - BOOL bIsVista = FALSE; - bIsVista = IsWindowsVistaOrGreater(); - return bIsVista; -} - -/*++ - -Routine Name: - - GetUniqueNumber - -Routine Description: - - Returns a unique number. - -Arguments: - - None - -Return Value: - - A unique DWORD. - ---*/ - -DWORD -GetUniqueNumber( - VOID - ) -{ - static volatile DWORD number = 0; - - return InterlockedIncrement(&number); -} diff --git a/print/XPSDrvSmpl/src/common/globals.h b/print/XPSDrvSmpl/src/common/globals.h deleted file mode 100644 index e4992c03..00000000 --- a/print/XPSDrvSmpl/src/common/globals.h +++ /dev/null @@ -1,102 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - globals.cpp - -Abstract: - - Stores function definitions, variable declerations and pre-processor macros - global to the filter module. This is shared between all filters. - ---*/ - -#pragma once - -// -// Module's Instance handle from DLLEntry of process. -// -extern HINSTANCE g_hInstance; - -// -// Server lock count -// -extern LONG g_cServerLocks; - -// -// Global defines -// -#define CB_COPY_BUFFER 0x10000 -#define MAX_UISTRING_LEN 256 -#define OEM_SIGNATURE 'XDSM' -#define OEM_VERSION 0x00000001L - -// -// Conversion functions for Microns to 1/100th of Inch (and visa versa) -// -#define HUNDREDTH_OFINCH_TO_MICRON(x) MulDiv(x, 25400, 100) -#define MICRON_TO_HUNDREDTH_OFINCH(x) MulDiv(x, 100, 25400) - -// -// Macros for checking pointers and handles. -// -#define CHECK_POINTER(p, hr) ((p) == NULL ? hr : S_OK) -#define CHECK_HANDLE(h, hr) ((h) == NULL ? hr : S_OK) - -static const FLOAT kMaxByteAsFloat = 255.0f; -static const FLOAT kMaxWordAsFloat = 65535.0f; - -static const WORD kS2Dot13Neg = 0x8000; -static const WORD kS2Dot13One = 0x2000; -static const WORD kS2Dot13Min = 0xFFFF; -static const WORD kS2Dot13Max = 0x7FFF; - -static const FLOAT k96thInchAsMicrons = 264.58f; - -// -// countof macro -// -#ifndef countof -#define countof(ary) (sizeof(ary) / sizeof((ary)[0])) -#endif - -// -// Converts the Win32 last error to an HRESULT -// -HRESULT -GetLastErrorAsHResult( - void - ); - -// -// Converts a GDI status error to an HRESULT -// -HRESULT -GetGDIStatusErrorAsHResult( - _In_ Status gdiPStatus - ); - -// -// Check if we are running under Vista -// -BOOL -IsVista( - VOID - ); - -// -// Returns a unique number -// -DWORD -GetUniqueNumber( - VOID - ); diff --git a/print/XPSDrvSmpl/src/common/nupchndlr.cpp b/print/XPSDrvSmpl/src/common/nupchndlr.cpp deleted file mode 100644 index e2374eb9..00000000 --- a/print/XPSDrvSmpl/src/common/nupchndlr.cpp +++ /dev/null @@ -1,196 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - nuppchndlr.cpp - -Abstract: - - NUp PrintCapabilities handling implementation. The NUp PC handler - is used to set NUp settings in a PrintCapabilities. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "xdexcept.h" -#include "nupchndlr.h" -#include "ptquerybld.h" - -using XDPrintSchema::NUp::NUpData; -using XDPrintSchema::NUp::ENUpFeature; -using XDPrintSchema::NUp::ENUpFeatureMin; -using XDPrintSchema::NUp::DocumentNUp; -using XDPrintSchema::NUp::JobNUpAllDocumentsContiguously; -using XDPrintSchema::NUp::ENUpFeatureMax; -using XDPrintSchema::NUp::NUP_FEATURES; -using XDPrintSchema::NUp::NUP_PROP; - -using XDPrintSchema::NUp::PresentationDirection::ENUpDirectionOption; -using XDPrintSchema::NUp::PresentationDirection::ENUpDirectionOptionMin; -using XDPrintSchema::NUp::PresentationDirection::ENUpDirectionOptionMax; -using XDPrintSchema::NUp::PresentationDirection::NUP_DIRECTION_FEATURE; -using XDPrintSchema::NUp::PresentationDirection::NUP_DIRECTION_OPTIONS; - -/*++ - -Routine Name: - - CNUpPCHandler::CNUpPCHandler - -Routine Description: - - CNUpPCHandler class constructor - -Arguments: - - pPrintCapabilities - Pointer to the DOM document representation of the PrintCapabilities - -Return Value: - - None - ---*/ -CNUpPCHandler::CNUpPCHandler( - _In_ IXMLDOMDocument2* pPrintCapabilities - ) : - CPCHandler(pPrintCapabilities) -{ -} - -/*++ - -Routine Name: - - CNUpPCHandler::~CNUpPCHandler - -Routine Description: - - CNUpPCHandler class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CNUpPCHandler::~CNUpPCHandler() -{ -} - -/*++ - -Routine Name: - - CNUpPCHandler::SetCapabilities - -Routine Description: - - This routine sets NUp capabilities in the PrintCapabilities passed to the - class constructor. - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CNUpPCHandler::SetCapabilities( - VOID - ) -{ - HRESULT hr = S_OK; - - try - { - for (ENUpFeature nupFeatures = ENUpFeatureMin; - nupFeatures < ENUpFeatureMax && SUCCEEDED(hr); - nupFeatures = static_cast<ENUpFeature>(nupFeatures + 1)) - { - // - // Find the existing NUp feature node - // - CPTQueryBuilder propertyQuery(m_bstrFrameworkPrefix); - CComPtr<IXMLDOMNode> pFeatureNode(NULL); - CComBSTR bstrFeatureQuery; - - if (SUCCEEDED(hr = propertyQuery.AddFeature(m_bstrKeywordsPrefix, CComBSTR(NUP_FEATURES[nupFeatures]))) && - SUCCEEDED(hr = propertyQuery.GetQuery(&bstrFeatureQuery)) && - SUCCEEDED(hr = GetNode(bstrFeatureQuery, &pFeatureNode)) && - hr != S_FALSE) - { - CComPtr<IXMLDOMElement> pPresentationFeature(NULL); - - // - // Create the presentation feature options - // - if (SUCCEEDED(hr = CreateFeature(CComBSTR(NUP_DIRECTION_FEATURE), - NULL, - &pPresentationFeature))) - { - PTDOMElementVector optionList; - - for (ENUpDirectionOption presentationOption = ENUpDirectionOptionMin; - presentationOption < ENUpDirectionOptionMax && SUCCEEDED(hr); - presentationOption = static_cast<ENUpDirectionOption>(presentationOption + 1)) - { - // - // Create the presentation options property element - // - CComPtr<IXMLDOMElement> pOptionProperty(NULL); - - if (SUCCEEDED(hr = CreateOption(CComBSTR(NUP_DIRECTION_OPTIONS[presentationOption]), NULL, &pOptionProperty))) - { - optionList.push_back(pOptionProperty); - } - } - - // - // Add the options into the presentation feature - // - PTDOMElementVector::iterator iterOptionList = optionList.begin(); - - for (;iterOptionList != optionList.end() && SUCCEEDED(hr); iterOptionList++) - { - hr = pPresentationFeature->appendChild(*iterOptionList, NULL); - } - - // - // Add the presentation feature into the existing NUp feature - // - if (SUCCEEDED(hr)) - { - hr = pFeatureNode->appendChild(pPresentationFeature, NULL); - } - } - } - } - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/common/nupchndlr.h b/print/XPSDrvSmpl/src/common/nupchndlr.h deleted file mode 100644 index f829d739..00000000 --- a/print/XPSDrvSmpl/src/common/nupchndlr.h +++ /dev/null @@ -1,41 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - nupchndlr.h - -Abstract: - - NUp PrintCapabilities handling definition. The NUp PC handler - is used to set NUp settings in a PrintCapabilities. - ---*/ - -#pragma once - -#include "pchndlr.h" -#include "nupdata.h" - -class CNUpPCHandler : public CPCHandler -{ -public: - CNUpPCHandler( - _In_ IXMLDOMDocument2* pPrintCapabilities - ); - - virtual ~CNUpPCHandler(); - - HRESULT - SetCapabilities( - VOID - ); -}; diff --git a/print/XPSDrvSmpl/src/common/nupdata.h b/print/XPSDrvSmpl/src/common/nupdata.h deleted file mode 100644 index bf76500a..00000000 --- a/print/XPSDrvSmpl/src/common/nupdata.h +++ /dev/null @@ -1,46 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - nupdata.h - -Abstract: - - NUp data structure definition. This provides a convenient description - of the PrintSchema JobNUpAllDocumentsContiguously and DocumentNUp features. - ---*/ - -#pragma once - -#include "nupschema.h" - -namespace XDPrintSchema -{ - namespace NUp - { - struct NUpData - { - NUpData() : - nUpFeature(JobNUpAllDocumentsContiguously), - cNUp(1), - nUpPresentDir(PresentationDirection::RightBottom) - { - } - - ENUpFeature nUpFeature; - INT cNUp; - PresentationDirection::ENUpDirectionOption nUpPresentDir; - }; - } -} - diff --git a/print/XPSDrvSmpl/src/common/nupschema.cpp b/print/XPSDrvSmpl/src/common/nupschema.cpp deleted file mode 100644 index 7ae67391..00000000 --- a/print/XPSDrvSmpl/src/common/nupschema.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - nupschema.cpp - -Abstract: - - NUp PrintSchema implementation. This implements the features, - options and enumerations that describe the PrintSchema JobNUpAllDocumentsContiguously - and DocumentNUp features. - ---*/ - -#include "precomp.h" -#include "nupschema.h" - -LPCWSTR XDPrintSchema::NUp::NUP_FEATURES[] = { - L"JobNUpAllDocumentsContiguously", - L"DocumentNUp" -}; - -LPCWSTR XDPrintSchema::NUp::NUP_PROP = L"PagesPerSheet"; - -LPCWSTR XDPrintSchema::NUp::PresentationDirection::NUP_DIRECTION_FEATURE = L"PresentationDirection"; - -LPCWSTR XDPrintSchema::NUp::PresentationDirection::NUP_DIRECTION_OPTIONS[] = { - L"RightBottom", - L"BottomRight", - L"LeftBottom", - L"BottomLeft", - L"RightTop", - L"TopRight", - L"LeftTop", - L"TopLeft" -}; - diff --git a/print/XPSDrvSmpl/src/common/nupschema.h b/print/XPSDrvSmpl/src/common/nupschema.h deleted file mode 100644 index 4c10451d..00000000 --- a/print/XPSDrvSmpl/src/common/nupschema.h +++ /dev/null @@ -1,77 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - nupschema.h - -Abstract: - - NUp PrintSchema definition. This defines the features, options and - enumerations that describe the PrintSchema JobNUpAllDocumentsContiguously and DocumentNUp - features within a XDPrintSchema::NUp namespace. - ---*/ - -#pragma once - -#include "schema.h" - -namespace XDPrintSchema -{ - // - // NUp elements described as Printschema keywords - // - namespace NUp - { - // - // JobNUpAllDocumentsContiguously and DocumentNUp share identical options so we define two - // features within the NUp namespace. - // - enum ENUpFeature - { - JobNUpAllDocumentsContiguously = 0, ENUpFeatureMin = 0, - DocumentNUp, - ENUpFeatureMax - }; - - extern LPCWSTR NUP_FEATURES[ENUpFeatureMax]; - - extern LPCWSTR NUP_PROP; - - namespace PresentationDirection - { - // - // Feature name - // - extern LPCWSTR NUP_DIRECTION_FEATURE; - - // - // Option names - // - enum ENUpDirectionOption - { - RightBottom = 0, ENUpDirectionOptionMin = 0, - BottomRight, - LeftBottom, - BottomLeft, - RightTop, - TopRight, - LeftTop, - TopLeft, - ENUpDirectionOptionMax - }; - - extern LPCWSTR NUP_DIRECTION_OPTIONS[ENUpDirectionOptionMax]; - } - } -} - diff --git a/print/XPSDrvSmpl/src/common/nupthndlr.cpp b/print/XPSDrvSmpl/src/common/nupthndlr.cpp deleted file mode 100644 index be836bcc..00000000 --- a/print/XPSDrvSmpl/src/common/nupthndlr.cpp +++ /dev/null @@ -1,309 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - nupthndlr.cpp - -Abstract: - - NUp PrintTicket handling implementation. The nup PT handler - is used to extract nup settings from a PrintTicket and populate - the nup properties class with the retrieved settings. The class also - defines a method for setting the feature in the PrintTicket given the - data structure. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdexcept.h" -#include "nupthndlr.h" - -using XDPrintSchema::NUp::NUpData; -using XDPrintSchema::NUp::ENUpFeature; -using XDPrintSchema::NUp::ENUpFeatureMin; -using XDPrintSchema::NUp::ENUpFeatureMax; -using XDPrintSchema::NUp::NUP_FEATURES; -using XDPrintSchema::NUp::NUP_PROP; - -using XDPrintSchema::NUp::PresentationDirection::ENUpDirectionOption; -using XDPrintSchema::NUp::PresentationDirection::ENUpDirectionOptionMin; -using XDPrintSchema::NUp::PresentationDirection::ENUpDirectionOptionMax; -using XDPrintSchema::NUp::PresentationDirection::NUP_DIRECTION_FEATURE; -using XDPrintSchema::NUp::PresentationDirection::NUP_DIRECTION_OPTIONS; - -/*++ - -Routine Name: - - CNUpPTHandler::CNUpPTHandler - -Routine Description: - - CNUpPTHandler class constructor - -Arguments: - - pPrintTicket - Pointer to the DOM document representation of the PrintTicket - -Return Value: - - None - ---*/ -CNUpPTHandler::CNUpPTHandler( - _In_ IXMLDOMDocument2* pPrintTicket - ) : - CPTHandler(pPrintTicket) -{ -} - -/*++ - -Routine Name: - - CNUpPTHandler::~CNUpPTHandler - -Routine Description: - - CNUpPTHandler class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CNUpPTHandler::~CNUpPTHandler() -{ -} - -/*++ - -Routine Name: - - CNUpPTHandler::GetData - -Routine Description: - - The routine fills the data structure passed in with NUp data retrieved from - the PrintTicket passed to the class constructor. - -Arguments: - - pNUpData - Pointer to the NUp data structure to be filled in - -Return Value: - - HRESULT - S_OK - On success - E_ELEMENT_NOT_FOUND - Feature not present in PrintTicket - E_* - On error - ---*/ -HRESULT -CNUpPTHandler::GetData( - _Out_ NUpData* pNUpData - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pNUpData, E_POINTER))) - { - for (ENUpFeature nUpFeature = ENUpFeatureMin; - nUpFeature < ENUpFeatureMax; - nUpFeature = static_cast<ENUpFeature>(nUpFeature + 1)) - { - CComBSTR bstrPresentOption; - CComBSTR bstrFeature(NUP_FEATURES[nUpFeature]); - - if (SUCCEEDED(hr = FeaturePresent(bstrFeature, NULL)) && - SUCCEEDED(hr = GetSubFeatureOption(bstrFeature, - CComBSTR(NUP_DIRECTION_FEATURE), - &bstrPresentOption)) && - SUCCEEDED(hr = GetScoredPropertyValue(bstrFeature, CComBSTR(NUP_PROP), &pNUpData->cNUp))) - { - // - // We may be set to 1-up. If so treat as though the feature is not present - // - if (pNUpData->cNUp > 1) - { - pNUpData->nUpFeature = nUpFeature; - - // - // Convert the presentation direction string to our enumeration - // - for (ENUpDirectionOption presDir = ENUpDirectionOptionMin; - presDir < ENUpDirectionOptionMax; - presDir = static_cast<ENUpDirectionOption>(presDir + 1)) - { - if (bstrPresentOption == NUP_DIRECTION_OPTIONS[presDir]) - { - pNUpData->nUpPresentDir = presDir; - break; - } - } - - // - // We have found and initialised the feature - break out the feature loop - // - break; - } - else - { - hr = E_ELEMENT_NOT_FOUND; - } - } - else if (hr != E_ELEMENT_NOT_FOUND) - { - // - // We have an error other than the element is not present - // so we break and let the result return - // - break; - } - } - } - - // - // Validate the data - // - if (SUCCEEDED(hr)) - { - if (pNUpData->nUpFeature < ENUpFeatureMin || - pNUpData->nUpFeature >= ENUpFeatureMax || - pNUpData->nUpPresentDir < ENUpDirectionOptionMin || - pNUpData->nUpPresentDir >= ENUpDirectionOptionMax) - { - hr = E_FAIL; - } - } - - ERR_ON_HR_EXC(hr, E_ELEMENT_NOT_FOUND); - return hr; -} - -/*++ - -Routine Name: - - CNUpPTHandler::SetData - -Routine Description: - - This routine sets the NUp data in the PrintTicket passed to the - class constructor. Note: The GPD handles the NUp count option and - scored properties so we only have to add the presentation direction - sub-feature. - -Arguments: - - pNUpData - Pointer to the NUp data to be set in the PrintTicket - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CNUpPTHandler::SetData( - _In_ CONST NUpData* pNUpData - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pNUpData, E_POINTER))) - { - if (pNUpData->nUpFeature < ENUpFeatureMin || - pNUpData->nUpFeature >= ENUpFeatureMax || - pNUpData->nUpPresentDir < ENUpDirectionOptionMin || - pNUpData->nUpPresentDir >= ENUpDirectionOptionMax) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - // - // Check the appropriate NUp option is set in the PT - // - CComPtr<IXMLDOMNode> pNUpFeature(NULL); - CComBSTR bstrFeature(NUP_FEATURES[pNUpData->nUpFeature]); - - if (SUCCEEDED(hr = FeaturePresent(bstrFeature, &pNUpFeature))) - { - // - // The NUp feature is present. Create the presentation direction sub-feature - // and ensure it is set in the PrintTicket. - // - CComPtr<IXMLDOMElement> pPresDirFeature(NULL); - CComPtr<IXMLDOMElement> pPresDirOption(NULL); - - if (SUCCEEDED(hr = DeleteFeature(CComBSTR(NUP_DIRECTION_FEATURE))) && - SUCCEEDED(hr = CreateFeatureOptionPair(CComBSTR(NUP_DIRECTION_FEATURE), - CComBSTR(NUP_DIRECTION_OPTIONS[pNUpData->nUpPresentDir]), - &pPresDirFeature, - &pPresDirOption))) - { - hr = pNUpFeature->appendChild(pPresDirFeature, NULL); - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CNUpPTHandler::Delete - -Routine Description: - - This routine deletes the NUp feature from the PrintTicket passed to the - class constructor - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CNUpPTHandler::Delete() -{ - HRESULT hr = S_OK; - - for (ENUpFeature nUpFeature = ENUpFeatureMin; - nUpFeature < ENUpFeatureMax && SUCCEEDED(hr); - nUpFeature = static_cast<ENUpFeature>(nUpFeature + 1)) - { - hr = DeleteFeature(CComBSTR(NUP_FEATURES[nUpFeature])); - } - - ERR_ON_HR(hr); - return hr; -} diff --git a/print/XPSDrvSmpl/src/common/nupthndlr.h b/print/XPSDrvSmpl/src/common/nupthndlr.h deleted file mode 100644 index eaeb22a6..00000000 --- a/print/XPSDrvSmpl/src/common/nupthndlr.h +++ /dev/null @@ -1,53 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - nupthndlr.h - -Abstract: - - NUp properties class implementation. The NUp properties class - is responsible for holding and controling NUp properties. - ---*/ - -#pragma once - - -#include "pthndlr.h" -#include "nupdata.h" - -class CNUpPTHandler : public CPTHandler -{ -public: - CNUpPTHandler( - _In_ IXMLDOMDocument2* pPrintTicket - ); - - virtual ~CNUpPTHandler(); - - HRESULT - GetData( - _Out_ XDPrintSchema::NUp::NUpData* pNUpData - ); - - HRESULT - SetData( - _In_ CONST XDPrintSchema::NUp::NUpData* pNUpData - ); - - HRESULT - Delete( - VOID - ); -}; - diff --git a/print/XPSDrvSmpl/src/common/pchndlr.cpp b/print/XPSDrvSmpl/src/common/pchndlr.cpp deleted file mode 100644 index c480ac52..00000000 --- a/print/XPSDrvSmpl/src/common/pchndlr.cpp +++ /dev/null @@ -1,640 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -File Name: - - pchndlr.cpp - -Abstract: - - Base PrintCapabilities handler class implementation. This class provides common - PrintCapabilities handling functionality for any feature that requires - PrintCapabilities handling. A feature specific handler can derive from - this class to get feature unspecific XML handling functionality. - ---*/ - - -// -// Note on handling missing DOM nodes: -// -// Convert MSXML's S_FALSE to E_ELEMENT_NOT_FOUND. This allows clients to -// use the SUCCEEDED macro more effectively. -// -// E_ELEMENT_NOT_FOUND should not be propogated as an error to the -// filter pipeline or config module - treat as though the requested feature -// has not been enabled. -// - -#include "precomp.h" -#include "debug.h" -#include "xdstring.h" -#include "pchndlr.h" - -using XDPrintSchema::PRINTCAPABILITIES_NAME; -using XDPrintSchema::PARAM_DEF_ELEMENT_NAME; -using XDPrintSchema::NAME_ATTRIBUTE_NAME; -using XDPrintSchema::SCHEMA_CONDITIONAL; -using XDPrintSchema::SCHEMA_INTEGER; -using XDPrintSchema::DATATYPE_VALUE_NAME; -using XDPrintSchema::SCHEMA_QNAME; -using XDPrintSchema::DEFAULTVAL_VALUE_NAME; -using XDPrintSchema::SCHEMA_STRING; -using XDPrintSchema::MAX_VALUE_NAME; -using XDPrintSchema::MIN_VALUE_NAME; -using XDPrintSchema::MAX_LENGTH_NAME; -using XDPrintSchema::MIN_LENGTH_NAME; -using XDPrintSchema::MANDATORY_VALUE_NAME; -using XDPrintSchema::UNITTYPE_VALUE_NAME; -using XDPrintSchema::MULTIPLE_VALUE_NAME; -using XDPrintSchema::DISPLAYNAME_VALUE_NAME; -using XDPrintSchema::SCHEMA_DECIMAL; -using XDPrintSchema::FEATURE_ELEMENT_NAME; -using XDPrintSchema::PICKONE_VALUE_NAME; -using XDPrintSchema::SELECTIONTYPE_VALUE_NAME; -using XDPrintSchema::OPTION_ELEMENT_NAME; -using XDPrintSchema::PARAM_REF_ELEMENT_NAME; -using XDPrintSchema::FRAMEWORK_URI; -using XDPrintSchema::KEYWORDS_URI; - -/*++ - -Routine Name: - - CPCHandler::CPCHandler - -Routine Description: - - CPCHandler class constructor - -Arguments: - - pPrintCapabilities - Pointer to the DOM document representation of the PrintCapabilities - -Return Value: - - None - - Note: Base Class (CPSHandler) - Throws CXDException(HRESULT) on an error - ---*/ -CPCHandler::CPCHandler( - _In_ IXMLDOMDocument2 *pDOMDocument - ) : - CPSHandler(CComBSTR(PRINTCAPABILITIES_NAME), pDOMDocument) -{ -} - -/*++ - -Routine Name: - - CPCHandler::~CPCHandler - -Routine Description: - - CPCHandler class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CPCHandler::~CPCHandler() -{ -} - - -/*++ - -Routine Name: - - CPCHandler::CreateStringParameterDef - -Routine Description: - - Creates a String type ParameterDef Element. - -Arguments: - - bstrParamName - Keyword value name for the parameter - bstrDisplayName - Optional string containing a description of the parameter definition. - defaultValue - Default value of the parameter. - minLength - Minimium valid value. - maxLength - Maximium valid value. - multiple - value can be increased or decreased in multiples of. - bstrUnitType - String containing a description of the unit type of the parameter value. - ppParameterDef - Pointer to an IXMLDOMElement that recieves the new element. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPCHandler::CreateStringParameterDef( - _In_z_ CONST BSTR bstrParamName, - _In_ CONST BOOL bIsPublicKeyword, - _In_opt_z_ CONST BSTR bstrDisplayName, - _In_ CONST BSTR defaultValue, - _In_ CONST INT minLength, - _In_ CONST INT maxLength, - _In_z_ CONST BSTR bstrUnitType, - _Outptr_ IXMLDOMElement** ppParameterDef - ) -{ - HRESULT hr = S_OK; - - // - // Create the parameterDef - // - CComBSTR bstrParameter(m_bstrFrameworkPrefix); - bstrParameter += PARAM_DEF_ELEMENT_NAME; - - // - // PageWatermarkSizeWidth and PageWatermarkSizeHeight are non-standard - // parameter names so need to be accessed using a user defined namespace - // - CComBSTR bstrParameterAttrib; - if (bIsPublicKeyword) - { - hr = bstrParameterAttrib.Append(m_bstrKeywordsPrefix); - } - else - { - hr = bstrParameterAttrib.Append(m_bstrUserKeywordsPrefix); - } - - if (SUCCEEDED(hr)) - { - bstrParameterAttrib += bstrParamName; - } - - if(SUCCEEDED(hr)) - { - hr = CreateXMLElement(bstrParameter, FRAMEWORK_URI, ppParameterDef); - } - - if(SUCCEEDED(hr)) - { - if(SUCCEEDED(hr = CreateXMLAttribute(*ppParameterDef, NAME_ATTRIBUTE_NAME, NULL, bstrParameterAttrib ))) - { - CComPtr<IXMLDOMElement> pDataTypeProp(NULL); - CComPtr<IXMLDOMElement> pDefValProp(NULL); - CComPtr<IXMLDOMElement> pMaxLengthProp(NULL); - CComPtr<IXMLDOMElement> pMinLengthProp(NULL); - CComPtr<IXMLDOMElement> pMandatoryProp(NULL); - CComPtr<IXMLDOMElement> pUnitTypeProp(NULL); - - CComBSTR bstrMandatory(m_bstrKeywordsPrefix); - bstrMandatory += SCHEMA_CONDITIONAL; - - CStringXDW cstrMaxLength; - cstrMaxLength.Format(L"%i", maxLength); - - CStringXDW cstrMinLength; - cstrMinLength.Format(L"%i", minLength); - - CComBSTR bstrStringType(m_bstrSchemaPrefix); - bstrStringType += SCHEMA_STRING; - - if (SUCCEEDED(hr = CreateProperty(CComBSTR(DATATYPE_VALUE_NAME), CComBSTR(SCHEMA_QNAME), bstrStringType, &pDataTypeProp)) && - SUCCEEDED(hr = CreateProperty(CComBSTR(DEFAULTVAL_VALUE_NAME), CComBSTR(SCHEMA_STRING), defaultValue, &pDefValProp)) && - SUCCEEDED(hr = CreateProperty(CComBSTR(MAX_LENGTH_NAME), CComBSTR(SCHEMA_INTEGER), CComBSTR(cstrMaxLength), &pMaxLengthProp)) && - SUCCEEDED(hr = CreateProperty(CComBSTR(MIN_LENGTH_NAME), CComBSTR(SCHEMA_INTEGER), CComBSTR(cstrMinLength), &pMinLengthProp)) && - SUCCEEDED(hr = CreateProperty(CComBSTR(MANDATORY_VALUE_NAME), CComBSTR(SCHEMA_QNAME), bstrMandatory, &pMandatoryProp)) && - SUCCEEDED(hr = CreateProperty(CComBSTR(UNITTYPE_VALUE_NAME), CComBSTR(SCHEMA_STRING), bstrUnitType, &pUnitTypeProp)) && - SUCCEEDED(hr = (*ppParameterDef)->appendChild(pDataTypeProp, NULL)) && - SUCCEEDED(hr = (*ppParameterDef)->appendChild(pDefValProp, NULL)) && - SUCCEEDED(hr = (*ppParameterDef)->appendChild(pMaxLengthProp, NULL)) && - SUCCEEDED(hr = (*ppParameterDef)->appendChild(pMinLengthProp, NULL)) && - SUCCEEDED(hr = (*ppParameterDef)->appendChild(pMandatoryProp, NULL)) && - SUCCEEDED(hr = (*ppParameterDef)->appendChild(pUnitTypeProp, NULL))) - { - if (SUCCEEDED(hr) && - SysStringLen(bstrDisplayName) > 0) - { - CComPtr<IXMLDOMElement> pDisplayProp(NULL); - - if (SUCCEEDED(hr = CreateProperty(CComBSTR(DISPLAYNAME_VALUE_NAME), CComBSTR(SCHEMA_STRING), bstrDisplayName, &pDisplayProp))) - { - hr = (*ppParameterDef)->appendChild(pDisplayProp, NULL); - } - } - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPCHandler::CreateIntParameterDef - -Routine Description: - - Creates a Integer type ParameterDef Element. - -Arguments: - - bstrParamName - Keyword value name for the parameter - bstrDisplayName - Optional string containing a description of the parameter definition. - defaultValue - Default value of the parameter. - minValue - Minimium valid value. - maxLength - Maximium valid value. - multiple - value can be increased or decreased in multiples of. - bstrUnitType - String containing a description of the unit type of the parameter value. - ppParameterDef - Pointer to an IXMLDOMElement that recieves the new element. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPCHandler::CreateIntParameterDef( - _In_z_ CONST BSTR bstrParamName, - _In_ CONST BOOL bIsPublicKeyword, - _In_opt_z_ CONST BSTR bstrDisplayName, - _In_ CONST INT defaultValue, - _In_ CONST INT minValue, - _In_ CONST INT maxValue, - _In_ CONST INT multiple, - _In_z_ CONST BSTR bstrUnitType, - _Outptr_ IXMLDOMElement** ppParameterDef - ) -{ - HRESULT hr = S_OK; - - // - // Create the parameterDef - // - CComBSTR bstrParameter(m_bstrFrameworkPrefix); - bstrParameter += PARAM_DEF_ELEMENT_NAME; - - CComBSTR bstrParameterAttrib; - if (bIsPublicKeyword) - { - hr = bstrParameterAttrib.Append(m_bstrKeywordsPrefix); - } - else - { - hr = bstrParameterAttrib.Append(m_bstrUserKeywordsPrefix); - } - - if (SUCCEEDED(hr)) - { - bstrParameterAttrib += bstrParamName; - } - - if(SUCCEEDED(hr)) - { - hr = CreateXMLElement(bstrParameter, FRAMEWORK_URI, ppParameterDef); - } - - if(SUCCEEDED(hr)) - { - if(SUCCEEDED(hr = CreateXMLAttribute(*ppParameterDef, NAME_ATTRIBUTE_NAME, NULL, bstrParameterAttrib ))) - { - CComPtr<IXMLDOMElement> pDataTypeProp(NULL); - CComPtr<IXMLDOMElement> pDefValProp(NULL); - CComPtr<IXMLDOMElement> pMaxValueProp(NULL); - CComPtr<IXMLDOMElement> pMinValueProp(NULL); - CComPtr<IXMLDOMElement> pMandatoryProp(NULL); - CComPtr<IXMLDOMElement> pUnitTypeProp(NULL); - CComPtr<IXMLDOMElement> pMultipleProp(NULL); - - CStringXDW cstrMultiple; - cstrMultiple.Format(L"%i", multiple); - - CComBSTR bstrMandatory(m_bstrKeywordsPrefix); - bstrMandatory += SCHEMA_CONDITIONAL; - - CStringXDW cstrDefaultValue; - cstrDefaultValue.Format(L"%i", defaultValue); - - CStringXDW cstrMaxValue; - cstrMaxValue.Format(L"%i", maxValue); - - CStringXDW cstrMinValue; - cstrMinValue.Format(L"%i", minValue); - - CComBSTR bstrIntegerType(m_bstrSchemaPrefix); - bstrIntegerType += SCHEMA_INTEGER; - - if (SUCCEEDED(hr = CreateProperty(CComBSTR(DATATYPE_VALUE_NAME), CComBSTR(SCHEMA_QNAME), bstrIntegerType, &pDataTypeProp)) && - SUCCEEDED(hr = CreateProperty(CComBSTR(DEFAULTVAL_VALUE_NAME), CComBSTR(SCHEMA_INTEGER), CComBSTR(cstrDefaultValue), &pDefValProp)) && - SUCCEEDED(hr = CreateProperty(CComBSTR(MAX_VALUE_NAME), CComBSTR(SCHEMA_INTEGER), CComBSTR(cstrMaxValue), &pMaxValueProp)) && - SUCCEEDED(hr = CreateProperty(CComBSTR(MIN_VALUE_NAME), CComBSTR(SCHEMA_INTEGER), CComBSTR(cstrMinValue), &pMinValueProp)) && - SUCCEEDED(hr = CreateProperty(CComBSTR(MANDATORY_VALUE_NAME), CComBSTR(SCHEMA_QNAME), bstrMandatory, &pMandatoryProp)) && - SUCCEEDED(hr = CreateProperty(CComBSTR(UNITTYPE_VALUE_NAME), CComBSTR(SCHEMA_STRING), bstrUnitType, &pUnitTypeProp)) && - SUCCEEDED(hr = CreateProperty(CComBSTR(MULTIPLE_VALUE_NAME), CComBSTR(SCHEMA_INTEGER), CComBSTR(cstrMultiple), &pMultipleProp)) && - SUCCEEDED(hr = (*ppParameterDef)->appendChild(pDataTypeProp, NULL)) && - SUCCEEDED(hr = (*ppParameterDef)->appendChild(pDefValProp, NULL)) && - SUCCEEDED(hr = (*ppParameterDef)->appendChild(pMaxValueProp, NULL)) && - SUCCEEDED(hr = (*ppParameterDef)->appendChild(pMinValueProp, NULL)) && - SUCCEEDED(hr = (*ppParameterDef)->appendChild(pMandatoryProp, NULL)) && - SUCCEEDED(hr = (*ppParameterDef)->appendChild(pUnitTypeProp, NULL)) && - SUCCEEDED(hr = (*ppParameterDef)->appendChild(pMultipleProp, NULL))) - { - if (SysStringLen(bstrDisplayName) > 0) - { - CComPtr<IXMLDOMElement> pDisplayProp(NULL); - - if (SUCCEEDED(hr = CreateProperty(CComBSTR(DISPLAYNAME_VALUE_NAME), CComBSTR(SCHEMA_STRING), bstrDisplayName, &pDisplayProp))) - { - hr = (*ppParameterDef)->appendChild(pDisplayProp, NULL); - } - } - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPCHandler::CreateFeature - -Routine Description: - - Creates a Feature Element. - -Arguments: - - bstrFeatureName - Keyword value name for the feature. - bstrDisplayName - Optional string containing a description of the feature. - ppFeatureElement - Pointer to an IXMLDOMElement that recieves the new element. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPCHandler::CreateFeature( - _In_z_ CONST BSTR bstrFeatureName, - _In_opt_z_ CONST BSTR bstrDisplayName, - _Outptr_ IXMLDOMElement** ppFeatureElement - ) -{ - HRESULT hr = S_OK; - - // - // Create the base feature node - // - CComBSTR bstrFeature(m_bstrFrameworkPrefix); - bstrFeature += FEATURE_ELEMENT_NAME; - - CComBSTR bstrFeatureAttrib(m_bstrKeywordsPrefix); - bstrFeatureAttrib += bstrFeatureName; - - if(SUCCEEDED(hr)) - { - hr = CreateXMLElement(bstrFeature, FRAMEWORK_URI, ppFeatureElement); - } - - if (SUCCEEDED(hr)) - { - hr = CreateXMLAttribute(*ppFeatureElement, NAME_ATTRIBUTE_NAME, NULL, bstrFeatureAttrib ); - } - - // - // Append the Display Name property type - // - if (SUCCEEDED(hr) && - SysStringLen(bstrDisplayName) > 0) - { - CComPtr<IXMLDOMElement> pDisplayProp(NULL); - - if (SUCCEEDED(hr = CreateProperty(CComBSTR(DISPLAYNAME_VALUE_NAME), CComBSTR(SCHEMA_STRING), bstrDisplayName, &pDisplayProp))) - { - hr = (*ppFeatureElement)->appendChild(pDisplayProp, NULL); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPCHandler::CreateFeatureSelection - -Routine Description: - - Creates a Selection Feature Element. - -Arguments: - - bstrFeatureName - Keyword value name for the feature. - bstrDisplayName - Optional string containing a description of the feature. - ppFeatureElement - Pointer to an IXMLDOMElement that recieves the new element. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPCHandler::CreateFeatureSelection( - _In_z_ CONST BSTR bstrFeatureName, - _In_opt_z_ CONST BSTR bstrDisplayName, - _Outptr_ IXMLDOMElement** ppFeatureElement - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CreateFeature(bstrFeatureName, bstrDisplayName, ppFeatureElement))) - { - // - // Append the property type - // - CComPtr<IXMLDOMElement> pPropertyTypeElement(NULL); - - // - // Create the keyname - // - CComBSTR bstrPickOne(m_bstrKeywordsPrefix); - bstrPickOne += PICKONE_VALUE_NAME; - - if (SUCCEEDED(hr = CreateFWProperty(CComBSTR(SELECTIONTYPE_VALUE_NAME), CComBSTR(SCHEMA_QNAME), bstrPickOne, &pPropertyTypeElement))) - { - hr = (*ppFeatureElement)->appendChild(pPropertyTypeElement, NULL); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPCHandler::CreateOption - -Routine Description: - - Creates an Option Type Element. - -Arguments: - - bstrOptionName - Keyword value name for the option. - bstrDisplayName - Optional string containing a description of the feature. - ppOptionElement - Pointer to an IXMLDOMElement that recieves the new element. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPCHandler::CreateOption( - _In_z_ CONST BSTR bstrOptionName, - _In_opt_z_ CONST BSTR bstrDisplayName, - _Outptr_ IXMLDOMElement** ppOptionElement - ) -{ - HRESULT hr = S_OK; - - // - // Create the base feature node - // - CComBSTR bstrOption(m_bstrFrameworkPrefix); - bstrOption += OPTION_ELEMENT_NAME; - - CComBSTR bstrOptionAttrib(m_bstrKeywordsPrefix); - bstrOptionAttrib += bstrOptionName; - - if(SUCCEEDED(hr)) - { - hr = CreateXMLElement(bstrOption, FRAMEWORK_URI, ppOptionElement); - } - - if (SUCCEEDED(hr)) - { - hr = CreateXMLAttribute(*ppOptionElement, NAME_ATTRIBUTE_NAME, NULL, bstrOptionAttrib ); - } - - // - // Append the Display Name property type - // - if (SUCCEEDED(hr) && - SysStringLen(bstrDisplayName) > 0) - { - CComPtr<IXMLDOMElement> pDisplayProp(NULL); - - if (SUCCEEDED(hr = CreateProperty(CComBSTR(DISPLAYNAME_VALUE_NAME), CComBSTR(SCHEMA_STRING), bstrDisplayName, &pDisplayProp))) - { - hr = (*ppOptionElement)->appendChild(pDisplayProp, NULL); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPCHandler::CreateParameterRef - -Routine Description: - - Creates a Reference to a ParameterDef Element. - -Arguments: - - bstrParamRefName - Keyword value name for the parameter reference. - ppParamRefElement - Pointer to an IXMLDOMElement that recieves the new element. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPCHandler::CreateParameterRef( - _In_z_ CONST BSTR bstrParamRefName, - _Outptr_ IXMLDOMElement** ppParamRefElement - ) -{ - HRESULT hr = S_OK; - - // - // Create the base feature node - // - CComBSTR bstrParameterRef(m_bstrFrameworkPrefix); - bstrParameterRef += PARAM_REF_ELEMENT_NAME; - - - // - // PageWatermarkSizeWidth and PageWatermarkSizeHeight are non-standard - // parameter names so need to be accessed using a user defined namespace - // - CComBSTR bstrParamRefAttrib; - if (wcscmp(bstrParamRefName, L"PageWatermarkSizeWidth") == 0 || - wcscmp(bstrParamRefName, L"PageWatermarkSizeHeight") == 0) - { - hr = bstrParamRefAttrib.Append(m_bstrUserKeywordsPrefix); - } - else - { - hr = bstrParamRefAttrib.Append(m_bstrKeywordsPrefix); - } - - if (SUCCEEDED(hr)) - { - bstrParamRefAttrib += bstrParamRefName; - } - - // - //Create the IXMLDOMNode for ParameterRef - // - CComPtr<IXMLDOMNode> pParameterRefNode(NULL); - - if(SUCCEEDED(hr)) - { - hr = CreateXMLElement(bstrParameterRef, FRAMEWORK_URI, ppParamRefElement); - } - - if (SUCCEEDED(hr)) - { - hr = CreateXMLAttribute(*ppParamRefElement, NAME_ATTRIBUTE_NAME, NULL, bstrParamRefAttrib ); - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/common/pchndlr.h b/print/XPSDrvSmpl/src/common/pchndlr.h deleted file mode 100644 index df958354..00000000 --- a/print/XPSDrvSmpl/src/common/pchndlr.h +++ /dev/null @@ -1,91 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -File Name: - - pchndlr.h - -Abstract: - - Base PrintCapabilities handler class definition. This class provides common - PrintCapabilities handling functionality for any feature that requires - PrintCapabilities handling. A feature specific handler can inherit from - this class to get feature unspecific XML handling functionality. - ---*/ - -#pragma once - -#include "schema.h" -#include "pshndlr.h" - -class CPCHandler : public CPSHandler -{ -public: - // - // Constructors and destructors - // - CPCHandler( - _In_ IXMLDOMDocument2 *pPrintCapabilities - ); - - virtual ~CPCHandler(); - -protected: - - HRESULT - CreateStringParameterDef( - _In_z_ CONST BSTR bstrParamName, - _In_ CONST BOOL bIsPublicKeyword, - _In_opt_z_ CONST BSTR bstrDisplayName, - _In_ CONST BSTR bstrDefaultValue, - _In_ CONST INT minLength, - _In_ CONST INT maxLength, - _In_z_ CONST BSTR bstrUnitType, - _Outptr_ IXMLDOMElement** ppParameterDef - ); - - HRESULT - CreateIntParameterDef( - _In_z_ CONST BSTR bstrParamName, - _In_ CONST BOOL bIsPublicKeyword, - _In_opt_z_ CONST BSTR bstrDisplayName, - _In_ CONST INT defaultValue, - _In_ CONST INT minValue, - _In_ CONST INT maxValue, - _In_ CONST INT multiple, - _In_z_ CONST BSTR bstrUnitType, - _Outptr_ IXMLDOMElement** ppParameterDef - ); - - HRESULT - CreateFeature( - _In_z_ CONST BSTR bstrFeatureName, - _In_opt_z_ CONST BSTR bstrDisplayName, - _Outptr_ IXMLDOMElement** ppFeatureElement - ); - - HRESULT - CreateOption( - _In_z_ CONST BSTR bstrOptionName, - _In_opt_z_ CONST BSTR bstrDisplayName, - _Outptr_ IXMLDOMElement** ppOptionElement - ); - - HRESULT - CreateFeatureSelection( - _In_z_ CONST BSTR bstrFeatureName, - _In_opt_z_ CONST BSTR bstrDisplayName, - _Outptr_ IXMLDOMElement** ppFeatureElement - ); - - HRESULT - CreateParameterRef( - _In_z_ CONST BSTR bstrParamRefName, - _Outptr_ IXMLDOMElement** ppParamRefElement - ); -}; - diff --git a/print/XPSDrvSmpl/src/common/pgscdata.h b/print/XPSDrvSmpl/src/common/pgscdata.h deleted file mode 100644 index 7a06ce24..00000000 --- a/print/XPSDrvSmpl/src/common/pgscdata.h +++ /dev/null @@ -1,52 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - pgscdata.h - -Abstract: - - PageScaling data structure definition. This provides a convenient - description of the PrintSchema PageScaling feature. - ---*/ - -#pragma once - -#include "pgscschema.h" - -namespace XDPrintSchema -{ - namespace PageScaling - { - struct PageScalingData - { - PageScalingData() : - pgscOption(None), - offWidth(0), - offHeight(0), - scaleWidth(100), - scaleHeight(100), - offsetOption(OffsetAlignment::Center) - { - } - - EScaleOption pgscOption; - INT offWidth; - INT offHeight; - INT scaleWidth; - INT scaleHeight; - OffsetAlignment::EScaleOffsetOption offsetOption; - }; - } -} - diff --git a/print/XPSDrvSmpl/src/common/pgscpchndlr.cpp b/print/XPSDrvSmpl/src/common/pgscpchndlr.cpp deleted file mode 100644 index 12883a69..00000000 --- a/print/XPSDrvSmpl/src/common/pgscpchndlr.cpp +++ /dev/null @@ -1,349 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - pgscpchndlr.cpp - -Abstract: - - Pagescale PrintCapabilities handling implementation. The pagescale PC handler - is used to set page scaling settings in a PrintCapabilities. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdexcept.h" -#include "pgscpchndlr.h" -#include "privatedefs.h" - -using XDPrintSchema::PRINTCAPABILITIES_NAME; - -using XDPrintSchema::PageScaling::EScaleOption; -using XDPrintSchema::PageScaling::FitBleedToImageable; -using XDPrintSchema::PageScaling::FitMediaToMedia; -using XDPrintSchema::PageScaling::Custom; -using XDPrintSchema::PageScaling::CustomSquare; -using XDPrintSchema::PageScaling::ECustomScaleProps; -using XDPrintSchema::PageScaling::ECustomScalePropsMin; -using XDPrintSchema::PageScaling::ECustomScalePropsMax; -using XDPrintSchema::PageScaling::ECustomSquareScaleProps; -using XDPrintSchema::PageScaling::ECustomSquareScalePropsMin; -using XDPrintSchema::PageScaling::ECustomSquareScalePropsMax; -using XDPrintSchema::PageScaling::SCALE_FEATURE; -using XDPrintSchema::PageScaling::SCALE_OPTIONS; -using XDPrintSchema::PageScaling::CUST_SCALE_PROPS; -using XDPrintSchema::PageScaling::CUST_SQR_SCALE_PROPS; - -using XDPrintSchema::PageScaling::OffsetAlignment::EScaleOffsetOption; -using XDPrintSchema::PageScaling::OffsetAlignment::EScaleOffsetOptionMin; -using XDPrintSchema::PageScaling::OffsetAlignment::EScaleOffsetOptionMax; -using XDPrintSchema::PageScaling::OffsetAlignment::SCALE_OFFSET_FEATURE; -using XDPrintSchema::PageScaling::OffsetAlignment::SCALE_OFFSET_OPTIONS; - -/*++ - -Routine Name: - - CPageScalingPCHandler::CPageScalingPCHandler - -Routine Description: - - CPageScalingPCHandler class constructor - -Arguments: - - pPrintCapabilities - Pointer to the DOM document representation of the PrintCapabilities - -Return Value: - - None - ---*/ -CPageScalingPCHandler::CPageScalingPCHandler( - _In_ IXMLDOMDocument2* pPrintCapabilities - ) : - CPCHandler(pPrintCapabilities) -{ -} - -/*++ - -Routine Name: - - CPageScalingPCHandler::~CPageScalingPCHandler - -Routine Description: - - CPageScalingPCHandler class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CPageScalingPCHandler::~CPageScalingPCHandler() -{ -} - -/*++ - -Routine Name: - - CPageScalingPCHandler::SetCapabilities - -Routine Description: - - This routine sets page scaling capabilities in the PrintCapabilities passed to the - class constructor. - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPageScalingPCHandler::SetCapabilities( - VOID - ) -{ - HRESULT hr = S_OK; - - try - { - // - // Retrieve the PrintTicket root - // - CComPtr<IXMLDOMNode> pPTRoot(NULL); - - CComBSTR bstrPTQuery(m_bstrFrameworkPrefix); - bstrPTQuery += PRINTCAPABILITIES_NAME; - - if (SUCCEEDED(hr = GetNode(bstrPTQuery, &pPTRoot))) - { - CComPtr<IXMLDOMElement> pFeatureElement(NULL); - - if (SUCCEEDED(hr = CreateFeatureSelection(CComBSTR(SCALE_FEATURE), NULL, &pFeatureElement))) - { - CComPtr<IXMLDOMElement> pCustomOption(NULL); - - // - // Create the Custom Options - // - if (SUCCEEDED(hr = CreateOption(CComBSTR(SCALE_OPTIONS[Custom]), NULL, &pCustomOption))) - { - PTDOMElementVector propertList; - - for (ECustomScaleProps customProps = ECustomScalePropsMin; - customProps < ECustomScalePropsMax && SUCCEEDED(hr); - customProps = static_cast<ECustomScaleProps>(customProps + 1)) - { - CComPtr<IXMLDOMElement> pScoredProperty(NULL); - - // - // Create the scored property list - // - if (SUCCEEDED(hr = CreateScoredProperty(CComBSTR(CUST_SCALE_PROPS[customProps]), &pScoredProperty))) - { - CComPtr<IXMLDOMElement> pParamRef(NULL); - - // - // Construct the parameter reference elements - // - CComBSTR bstrPRefName(SCALE_FEATURE); - bstrPRefName += CUST_SCALE_PROPS[customProps]; - - if (SUCCEEDED(hr = CreateParameterRef(bstrPRefName, &pParamRef))) - { - hr = pScoredProperty->appendChild(pParamRef, NULL); - } - - propertList.push_back(pScoredProperty); - } - } - - // - // Add the properties to the custom option - // - PTDOMElementVector::iterator iterPropertList = propertList.begin(); - - for (;iterPropertList != propertList.end() && SUCCEEDED(hr); iterPropertList++) - { - hr = pCustomOption->appendChild(*iterPropertList, NULL); - } - - if (SUCCEEDED(hr)) - { - hr = pFeatureElement->appendChild(pCustomOption, NULL); - } - } - - CComPtr<IXMLDOMElement> pCustomSquareOption(NULL); - - // - // Create the Custom Square - // - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CreateOption(CComBSTR(SCALE_OPTIONS[CustomSquare]), NULL, &pCustomSquareOption))) - { - PTDOMElementVector propertList; - - for (ECustomSquareScaleProps customSquareProps = ECustomSquareScalePropsMin; - customSquareProps < ECustomSquareScalePropsMax && SUCCEEDED(hr); - customSquareProps = static_cast<ECustomSquareScaleProps>(customSquareProps + 1)) - { - CComPtr<IXMLDOMElement> pScoredProperty(NULL); - - // - // Create the scored property list - // - if (SUCCEEDED(hr = CreateScoredProperty(CComBSTR(CUST_SQR_SCALE_PROPS[customSquareProps]), &pScoredProperty))) - { - CComPtr<IXMLDOMElement> pParamRef(NULL); - - // - // Construct the parameter reference elements - // - CComBSTR bstrPRefName(SCALE_FEATURE); - bstrPRefName += CUST_SQR_SCALE_PROPS[customSquareProps]; - - if (SUCCEEDED(hr = CreateParameterRef(bstrPRefName, &pParamRef))) - { - hr = pScoredProperty->appendChild(pParamRef, NULL); - } - - propertList.push_back(pScoredProperty); - } - } - - // - // Add the properties to the custom square option - // - PTDOMElementVector::iterator iterPropertList = propertList.begin(); - - for (;iterPropertList != propertList.end() && SUCCEEDED(hr); iterPropertList++) - { - hr = pCustomSquareOption->appendChild(*iterPropertList, NULL); - } - - if (SUCCEEDED(hr)) - { - hr = pFeatureElement->appendChild(pCustomSquareOption, NULL); - } - } - - // - // Create the remaining scaling options: Fit To ... - // - for (EScaleOption fitToOptions = FitBleedToImageable; - fitToOptions <= FitMediaToMedia && SUCCEEDED(hr); - fitToOptions = static_cast<EScaleOption>(fitToOptions + 1)) - { - CComPtr<IXMLDOMElement> pFitToOption(NULL); - - // - // Create the fit to page option - // - if (SUCCEEDED(hr = CreateOption(CComBSTR(SCALE_OPTIONS[fitToOptions]), NULL, &pFitToOption))) - { - hr = pFeatureElement->appendChild(pFitToOption, NULL); - } - } - - // - // Create the offset options - // - if (SUCCEEDED(hr)) - { - CComPtr<IXMLDOMElement> pOffsetFeature(NULL); - if (SUCCEEDED(hr = CreateFeature(CComBSTR(SCALE_OFFSET_FEATURE), - NULL, - &pOffsetFeature))) - { - PTDOMElementVector optionList; - - for (EScaleOffsetOption offsetOption = EScaleOffsetOptionMin; - offsetOption < EScaleOffsetOptionMax && SUCCEEDED(hr); - offsetOption = static_cast<EScaleOffsetOption>(offsetOption + 1)) - { - CComPtr<IXMLDOMElement> pOptionProperty(NULL); - - if (SUCCEEDED(hr = CreateOption(CComBSTR(SCALE_OFFSET_OPTIONS[offsetOption]), NULL, &pOptionProperty))) - { - optionList.push_back(pOptionProperty); - } - } - - // - // Add the options to the offset feature - // - PTDOMElementVector::iterator iterOptionList = optionList.begin(); - - for (;iterOptionList != optionList.end() && SUCCEEDED(hr); iterOptionList++) - { - hr = pOffsetFeature->appendChild(*iterOptionList, NULL); - } - } - - if (SUCCEEDED(hr)) - { - hr = pFeatureElement->appendChild(pOffsetFeature, NULL); - } - } - - if (SUCCEEDED(hr)) - { - hr = pPTRoot->appendChild(pFeatureElement, NULL); - } - } - - for (UINT cIndex = 0; cIndex < numof(pgscParamDefIntegers); cIndex++) - { - CComPtr<IXMLDOMElement> pParameterDef(NULL); - - if (SUCCEEDED(hr = CreateIntParameterDef(CComBSTR(pgscParamDefIntegers[cIndex].property_name), // Paramater Name - pgscParamDefIntegers[cIndex].is_public, // Is Print Schema Keyword? - CComBSTR(pgscParamDefIntegers[cIndex].display_name), // Display Text - pgscParamDefIntegers[cIndex].default_value, // Default - pgscParamDefIntegers[cIndex].min_length, // Min Length - pgscParamDefIntegers[cIndex].max_length, // Max Length - pgscParamDefIntegers[cIndex].multiple, // Multiple - CComBSTR(pgscParamDefIntegers[cIndex].unit_type), // Unit Type - &pParameterDef))) // Parameter Def - { - hr = pPTRoot->appendChild(pParameterDef, NULL); - } - } - } - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - - ERR_ON_HR(hr); - return hr; -} - - diff --git a/print/XPSDrvSmpl/src/common/pgscpchndlr.h b/print/XPSDrvSmpl/src/common/pgscpchndlr.h deleted file mode 100644 index 3d30583f..00000000 --- a/print/XPSDrvSmpl/src/common/pgscpchndlr.h +++ /dev/null @@ -1,41 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - pgscpchndlr.h - -Abstract: - - Page Scaling PrintCapabilities handling definition. The page scaling PC handler - is used to set page scaling settings in a PrintCapabilities. - ---*/ - -#pragma once - -#include "pchndlr.h" -#include "pgscdata.h" - -class CPageScalingPCHandler : public CPCHandler -{ -public: - CPageScalingPCHandler( - _In_ IXMLDOMDocument2* pPrintCapabilities - ); - - virtual ~CPageScalingPCHandler(); - - HRESULT - SetCapabilities( - VOID - ); -}; diff --git a/print/XPSDrvSmpl/src/common/pgscpthndlr.cpp b/print/XPSDrvSmpl/src/common/pgscpthndlr.cpp deleted file mode 100644 index beffe034..00000000 --- a/print/XPSDrvSmpl/src/common/pgscpthndlr.cpp +++ /dev/null @@ -1,479 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - pgscpthndlr.cpp - -Abstract: - - PageScaling PrintTicket handler implementation. Derived from CPTHandler, - this provides PageScaling specific Get and Set methods acting on the - PrintTicket (as a DOM document) passed. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdexcept.h" -#include "pgscpthndlr.h" - -using XDPrintSchema::PRINTTICKET_NAME; -using XDPrintSchema::NAME_ATTRIBUTE_NAME; - -using XDPrintSchema::PageScaling::PageScalingData; -using XDPrintSchema::PageScaling::EScaleOption; -using XDPrintSchema::PageScaling::EScaleOptionMin; -using XDPrintSchema::PageScaling::Custom; -using XDPrintSchema::PageScaling::CustomSquare; -using XDPrintSchema::PageScaling::FitBleedToImageable; -using XDPrintSchema::PageScaling::FitContentToImageable; -using XDPrintSchema::PageScaling::FitMediaToImageable; -using XDPrintSchema::PageScaling::FitMediaToMedia; -using XDPrintSchema::PageScaling::None; -using XDPrintSchema::PageScaling::EScaleOptionMax; -using XDPrintSchema::PageScaling::ECustomScaleProps; -using XDPrintSchema::PageScaling::ECustomScalePropsMin; -using XDPrintSchema::PageScaling::CstOffsetWidth; -using XDPrintSchema::PageScaling::CstOffsetHeight; -using XDPrintSchema::PageScaling::CstScaleWidth; -using XDPrintSchema::PageScaling::CstScaleHeight; -using XDPrintSchema::PageScaling::ECustomScalePropsMax; -using XDPrintSchema::PageScaling::ECustomSquareScaleProps; -using XDPrintSchema::PageScaling::ECustomSquareScalePropsMin; -using XDPrintSchema::PageScaling::CstSqOffsetWidth; -using XDPrintSchema::PageScaling::CstSqOffsetHeight; -using XDPrintSchema::PageScaling::CstSqScale; -using XDPrintSchema::PageScaling::ECustomSquareScalePropsMax; -using XDPrintSchema::PageScaling::SCALE_FEATURE; -using XDPrintSchema::PageScaling::SCALE_OPTIONS; -using XDPrintSchema::PageScaling::CUST_SCALE_PROPS; -using XDPrintSchema::PageScaling::CUST_SQR_SCALE_PROPS; - -using XDPrintSchema::PageScaling::OffsetAlignment::EScaleOffsetOption; -using XDPrintSchema::PageScaling::OffsetAlignment::EScaleOffsetOptionMin; -using XDPrintSchema::PageScaling::OffsetAlignment::EScaleOffsetOptionMax; -using XDPrintSchema::PageScaling::OffsetAlignment::SCALE_OFFSET_FEATURE; -using XDPrintSchema::PageScaling::OffsetAlignment::SCALE_OFFSET_OPTIONS; - -/*++ - -Routine Name: - - CPageScalingPTHandler::CPageScalingPTHandler - -Routine Description: - - CPageScalingPTHandler class constructor - -Arguments: - - pPrintTicket - Pointer to the DOM document representation of the PrintTicket - -Return Value: - - None - ---*/ -CPageScalingPTHandler::CPageScalingPTHandler( - _In_ IXMLDOMDocument2* pPrintTicket - ) : - CPTHandler(pPrintTicket) -{ -} - -/*++ - -Routine Name: - - CPageScalingPTHandler::~CPageScalingPTHandler - -Routine Description: - - CPageScalingPTHandler class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CPageScalingPTHandler::~CPageScalingPTHandler() -{ -} - -/*++ - -Routine Name: - - CPageScalingPTHandler::GetData - -Routine Description: - - The routine fills the data structure passed in with page scaling data - retrieved from the PrintTicket passed to the class constructor. - -Arguments: - - pPageScaleData - Pointer to the page scaling data structure to be filled in - -Return Value: - - HRESULT - S_OK - On success - E_ELEMENT_NOT_FOUND - Feature not present in PrintTicket - E_* - On error - ---*/ -HRESULT -CPageScalingPTHandler::GetData( - _Out_ PageScalingData* pPageScaleData - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pPageScaleData, E_POINTER))) - { - CComBSTR bstrPgScOption; - - if (SUCCEEDED(hr = GetFeatureOption(CComBSTR(SCALE_FEATURE), &bstrPgScOption))) - { - if (bstrPgScOption == SCALE_OPTIONS[Custom]) - { - pPageScaleData->pgscOption = Custom; - - if (SUCCEEDED(hr = GetScoredPropertyValue(CComBSTR(SCALE_FEATURE), - CComBSTR(CUST_SCALE_PROPS[CstOffsetWidth]), - &pPageScaleData->offWidth)) && - SUCCEEDED(hr = GetScoredPropertyValue(CComBSTR(SCALE_FEATURE), - CComBSTR(CUST_SCALE_PROPS[CstOffsetHeight]), - &pPageScaleData->offHeight)) && - SUCCEEDED(hr = GetScoredPropertyValue(CComBSTR(SCALE_FEATURE), - CComBSTR(CUST_SCALE_PROPS[CstScaleWidth]), - &pPageScaleData->scaleWidth))) - { - hr = GetScoredPropertyValue(CComBSTR(SCALE_FEATURE), - CComBSTR(CUST_SCALE_PROPS[CstScaleHeight]), - &pPageScaleData->scaleHeight); - } - } - else if (bstrPgScOption == SCALE_OPTIONS[CustomSquare]) - { - pPageScaleData->pgscOption = CustomSquare; - - if (SUCCEEDED(hr = GetScoredPropertyValue(CComBSTR(SCALE_FEATURE), - CComBSTR(CUST_SQR_SCALE_PROPS[CstSqOffsetWidth]), - &pPageScaleData->offWidth)) && - SUCCEEDED(hr = GetScoredPropertyValue(CComBSTR(SCALE_FEATURE), - CComBSTR(CUST_SQR_SCALE_PROPS[CstSqOffsetHeight]), - &pPageScaleData->offHeight)) && - SUCCEEDED(hr = GetScoredPropertyValue(CComBSTR(SCALE_FEATURE), - CComBSTR(CUST_SQR_SCALE_PROPS[CstSqScale]), - &pPageScaleData->scaleWidth))) - { - pPageScaleData->scaleHeight = pPageScaleData->scaleWidth; - } - } - else if (bstrPgScOption == SCALE_OPTIONS[None]) - { - // - // No scaling - return as if no element is present - // - hr = E_ELEMENT_NOT_FOUND; - } - else - { - // - // Identify the option - // - for (EScaleOption pgScOption = FitBleedToImageable; - pgScOption < EScaleOptionMax; - pgScOption = static_cast<EScaleOption>(pgScOption + 1)) - { - if (bstrPgScOption == SCALE_OPTIONS[pgScOption]) - { - pPageScaleData->pgscOption = pgScOption; - - // - // Get the offset alignment - // - CComBSTR bstrOffsetAlignment; - - hr = GetSubFeatureOption(CComBSTR(SCALE_FEATURE), - CComBSTR(SCALE_OFFSET_FEATURE), - &bstrOffsetAlignment); - - // - // Identify the Alignment - // - for (EScaleOffsetOption offOption = EScaleOffsetOptionMin; - offOption < EScaleOffsetOptionMax; - offOption = static_cast<EScaleOffsetOption>(offOption + 1)) - { - if (bstrOffsetAlignment == SCALE_OFFSET_OPTIONS[offOption]) - { - pPageScaleData->offsetOption = offOption; - - break; - } - } - - break; - } - } - } - } - } - - // - // Validate the data - // - if (SUCCEEDED(hr)) - { - if (pPageScaleData->pgscOption < EScaleOptionMin || - pPageScaleData->pgscOption >= EScaleOptionMax) - { - hr = E_FAIL; - } - } - - ERR_ON_HR_EXC(hr, E_ELEMENT_NOT_FOUND); - return hr; -} - -/*++ - -Routine Name: - - CPageScalingPTHandler::SetData - -Routine Description: - - This routine sets the page scaling data in the PrintTicket passed to the - class constructor. - -Arguments: - - pPageScaleData - Pointer to the page scale data to be set in the PrintTicket - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPageScalingPTHandler::SetData( - _In_ CONST PageScalingData* pPageScaleData - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pPageScaleData, E_POINTER))) - { - if (pPageScaleData->pgscOption < EScaleOptionMin || - pPageScaleData->pgscOption >= EScaleOptionMax || - pPageScaleData->offsetOption < EScaleOffsetOptionMin || - pPageScaleData->offsetOption >= EScaleOffsetOptionMax) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - // - // Remove any existing page scaling feature node - // - CComPtr<IXMLDOMElement> pFeature(NULL); - CComPtr<IXMLDOMElement> pOption(NULL); - - CComBSTR bstrFeature(SCALE_FEATURE); - CComBSTR bstrAttribName(m_bstrKeywordsPrefix); - - if (SUCCEEDED(hr = DeleteFeature(bstrFeature)) && - pPageScaleData->pgscOption != None && - SUCCEEDED(hr = CreateFeatureOptionPair(bstrFeature, &pFeature, &pOption))) - { - // - // Retrieve the PrintTicket root - // - CComPtr<IXMLDOMNode> pPTRoot(NULL); - - CComBSTR bstrPTQuery(m_bstrFrameworkPrefix); - bstrPTQuery += PRINTTICKET_NAME; - - if (SUCCEEDED(hr = GetNode(bstrPTQuery, &pPTRoot))) - { - // - // Append the feature node to the PrintTicket root element - // - hr = pPTRoot->appendChild(pFeature, NULL); - } - - // - // Set the option value - // - bstrAttribName += SCALE_OPTIONS[pPageScaleData->pgscOption]; - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CreateXMLAttribute(pOption, NAME_ATTRIBUTE_NAME, NULL, bstrAttribName ))) - { - switch (pPageScaleData->pgscOption) - { - case Custom: - { - // - // Create the width offset, height offset, width scale and height scale - // parameter ref/init pairs. Create the relevant scored properties passing the - // paramater refs. Append the scored properties to the option element and the - // paramter init values to the PrintTicket element - // - CONST INT* pValue = &pPageScaleData->offWidth; - for (ECustomScaleProps props = ECustomScalePropsMin; - props < ECustomScalePropsMax && SUCCEEDED(hr); - props = static_cast<ECustomScaleProps>(props + 1), pValue++) - { - CComPtr<IXMLDOMElement> pParamRef(NULL); - CComPtr<IXMLDOMElement> pParamInit(NULL); - CComPtr<IXMLDOMElement> pScoredProp(NULL); - - CComBSTR bstrParamRefName(SCALE_FEATURE); - bstrParamRefName += CUST_SCALE_PROPS[props]; - - if (SUCCEEDED(hr = CreateParamRefInitPair(bstrParamRefName, - *pValue, - &pParamRef,&pParamInit)) && - SUCCEEDED(hr = CreateScoredProperty(CComBSTR(CUST_SCALE_PROPS[props]), - pParamRef, - &pScoredProp)) && - SUCCEEDED(hr = pOption->appendChild(pScoredProp, NULL))) - { - hr = pPTRoot->appendChild(pParamInit, NULL); - } - } - } - break; - - case CustomSquare: - { - // - // Create the width offset, height offset and scale parameter ref/init pairs. - // Create the relevant scored properties passing the paramater refs. Append - // the scored properties to the option element and the paramter init values - // to the PrintTicket element. - // - CONST INT* pValue = &pPageScaleData->offWidth; - for (ECustomSquareScaleProps props = ECustomSquareScalePropsMin; - props < ECustomSquareScalePropsMax && SUCCEEDED(hr); - props = static_cast<ECustomSquareScaleProps>(props + 1), pValue++) - { - CComPtr<IXMLDOMElement> pParamRef(NULL); - CComPtr<IXMLDOMElement> pParamInit(NULL); - CComPtr<IXMLDOMElement> pScoredProp(NULL); - - CComBSTR bstrParamRefName(SCALE_FEATURE); - bstrParamRefName += CUST_SQR_SCALE_PROPS[props]; - - if (SUCCEEDED(hr = CreateParamRefInitPair(bstrParamRefName, - *pValue, - &pParamRef, - &pParamInit)) && - SUCCEEDED(hr = CreateScoredProperty(CComBSTR(CUST_SQR_SCALE_PROPS[props]), - pParamRef, - &pScoredProp)) && - SUCCEEDED(hr = pOption->appendChild(pScoredProp, NULL))) - { - hr = pPTRoot->appendChild(pParamInit, NULL); - } - } - } - break; - - case FitBleedToImageable: - case FitContentToImageable: - case FitMediaToImageable: - case FitMediaToMedia: - { - // - // Create the ScaleOffsetAlignement feature and append to the option node - // - CComPtr<IXMLDOMElement> pSubFeature(NULL); - CComPtr<IXMLDOMElement> pSubOption(NULL); - - CComBSTR bstrOffsetFeature(SCALE_OFFSET_FEATURE); - CComBSTR bstrOffsetOption(SCALE_OFFSET_OPTIONS[pPageScaleData->offsetOption]); - - if (SUCCEEDED(hr = CreateFeatureOptionPair(bstrOffsetFeature, - bstrOffsetOption, - &pSubFeature, - &pSubOption))) - { - hr = pFeature->appendChild(pSubFeature, NULL); - } - } - break; - - case None: - default: - { - } - break; - } - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPageScalingPTHandler::Delete - -Routine Description: - - This routine deletes the page scaling feature from the PrintTicket passed to the - class constructor - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPageScalingPTHandler::Delete( - VOID - ) -{ - // - // Remove any existing page scaling feature node - // - HRESULT hr = DeleteFeature(CComBSTR(SCALE_FEATURE)); - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/common/pgscpthndlr.h b/print/XPSDrvSmpl/src/common/pgscpthndlr.h deleted file mode 100644 index 08c52e7d..00000000 --- a/print/XPSDrvSmpl/src/common/pgscpthndlr.h +++ /dev/null @@ -1,55 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - pgscpthndlr.h - -Abstract: - - PageScaling PrintTicket handling definition. The PageScaling PT handler - is used to extract PageScaling settings from a PrintTicket and populate - the PageScaling data structure with the retrieved settings. The class also - defines a method for setting the feature in the PrintTicket given the - data structure. - ---*/ - -#pragma once - -#include "pthndlr.h" -#include "pgscdata.h" - -class CPageScalingPTHandler : public CPTHandler -{ -public: - CPageScalingPTHandler( - _In_ IXMLDOMDocument2* pPrintTicket - ); - - virtual ~CPageScalingPTHandler(); - - HRESULT - GetData( - _Out_ XDPrintSchema::PageScaling::PageScalingData* pPageScaleData - ); - - HRESULT - SetData( - _In_ CONST XDPrintSchema::PageScaling::PageScalingData* pPageScaleData - ); - - HRESULT - Delete( - void - ); -}; - diff --git a/print/XPSDrvSmpl/src/common/pgscschema.cpp b/print/XPSDrvSmpl/src/common/pgscschema.cpp deleted file mode 100644 index a8ada487..00000000 --- a/print/XPSDrvSmpl/src/common/pgscschema.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - pgscschema.cpp - -Abstract: - - PageScaling PrintSchema implementation. This implements the features, - options and enumerations that describe the PrintSchema PageScaling feature. - ---*/ - -#include "precomp.h" -#include "pgscschema.h" - -LPCWSTR XDPrintSchema::PageScaling::SCALE_FEATURE = L"PageScaling"; - -LPCWSTR XDPrintSchema::PageScaling::SCALE_OPTIONS[EScaleOptionMax] = { - L"Custom", - L"CustomSquare", - L"FitApplicationBleedSizeToPageImageableSize", - L"FitApplicationContentSizeToPageImageableSize", - L"FitApplicationMediaSizeToPageImageableSize", - L"FitApplicationMediaSizeToPageMediaSize", - L"None" -}; - -LPCWSTR XDPrintSchema::PageScaling::CUST_SCALE_PROPS[] = { - L"OffsetWidth", - L"OffsetHeight", - L"ScaleWidth", - L"ScaleHeight" -}; - -LPCWSTR XDPrintSchema::PageScaling::CUST_SQR_SCALE_PROPS[] = { - L"OffsetWidth", - L"OffsetHeight", - L"Scale" -}; - -LPCWSTR XDPrintSchema::PageScaling::OffsetAlignment::SCALE_OFFSET_FEATURE = L"ScaleOffsetAlignment"; - -LPCWSTR XDPrintSchema::PageScaling::OffsetAlignment::SCALE_OFFSET_OPTIONS[] = { - L"BottomCenter", - L"BottomLeft", - L"BottomRight", - L"Center", - L"LeftCenter", - L"RightCenter", - L"TopCenter", - L"TopLeft", - L"TopRight" -}; - diff --git a/print/XPSDrvSmpl/src/common/pgscschema.h b/print/XPSDrvSmpl/src/common/pgscschema.h deleted file mode 100644 index d30c9c92..00000000 --- a/print/XPSDrvSmpl/src/common/pgscschema.h +++ /dev/null @@ -1,112 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - pgscschema.h - -Abstract: - - PageScaling PrintSchema definition. This defines the features, options - and enumerations that describe the PrintSchema PageScaling feature within - a XDPrintSchema::PageScaling namespace. - ---*/ - -#pragma once - -#include "schema.h" - -namespace XDPrintSchema -{ - // - // PageScaling elements described as Printschema keywords - // - namespace PageScaling - { - // - // The feature name - // - extern LPCWSTR SCALE_FEATURE; - - // - // Option names - // - enum EScaleOption - { - Custom = 0, EScaleOptionMin = 0, - CustomSquare, - FitBleedToImageable, - FitContentToImageable, - FitMediaToImageable, - FitMediaToMedia, - None, - EScaleOptionMax - }; - - extern LPCWSTR SCALE_OPTIONS[EScaleOptionMax]; - - // - // Custom scaling properties - // - enum ECustomScaleProps - { - CstOffsetWidth = 0, ECustomScalePropsMin = 0, - CstOffsetHeight, - CstScaleWidth, - CstScaleHeight, - ECustomScalePropsMax - }; - - extern LPCWSTR CUST_SCALE_PROPS[ECustomScalePropsMax]; - - // - // Custom square scaling properties - // - enum ECustomSquareScaleProps - { - CstSqOffsetWidth = 0, ECustomSquareScalePropsMin = 0, - CstSqOffsetHeight, - CstSqScale, - ECustomSquareScalePropsMax - }; - - extern LPCWSTR CUST_SQR_SCALE_PROPS[ECustomSquareScalePropsMax]; - - namespace OffsetAlignment - { - // - // The feature name - // - extern LPCWSTR SCALE_OFFSET_FEATURE; - - // - // Option names - // - enum EScaleOffsetOption - { - BottomCenter = 0, EScaleOffsetOptionMin = 0, - BottomLeft, - BottomRight, - Center, - LeftCenter, - RightCenter, - TopCenter, - TopLeft, - TopRight, - EScaleOffsetOptionMax - }; - - extern LPCWSTR SCALE_OFFSET_OPTIONS[EScaleOffsetOptionMax]; - } - } -} - diff --git a/print/XPSDrvSmpl/src/common/pimagedata.h b/print/XPSDrvSmpl/src/common/pimagedata.h deleted file mode 100644 index fc9a36c7..00000000 --- a/print/XPSDrvSmpl/src/common/pimagedata.h +++ /dev/null @@ -1,52 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - pimagedata.h - -Abstract: - - PageImageableSize data structure definition. This provides a convenient - description of the PrintSchema PageImageableSize feature. - ---*/ - -#pragma once - -#include "pimageschema.h" - -namespace XDPrintSchema -{ - namespace PageImageableSize - { - struct PageImageableData - { - PageImageableData() : - imageableSizeWidth(0), - imageableSizeHeight(0), - originWidth(0), - originHeight(0), - extentWidth(0), - extentHeight(0) - { - } - - INT imageableSizeWidth; - INT imageableSizeHeight; - INT originWidth; - INT originHeight; - INT extentWidth; - INT extentHeight; - }; - } -} - diff --git a/print/XPSDrvSmpl/src/common/pimagepthndlr.cpp b/print/XPSDrvSmpl/src/common/pimagepthndlr.cpp deleted file mode 100644 index 23013810..00000000 --- a/print/XPSDrvSmpl/src/common/pimagepthndlr.cpp +++ /dev/null @@ -1,171 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - pimagepthndlr.cpp - -Abstract: - - This class is responsible for retrieving the PageImageableSize properties from a - PrintCapabilities document. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdexcept.h" -#include "ptquerybld.h" -#include "pimagepthndlr.h" - -using XDPrintSchema::PageImageableSize::PageImageableData; -using XDPrintSchema::PageImageableSize::ImageableSizeWidth; -using XDPrintSchema::PageImageableSize::ImageableSizeHeight; -using XDPrintSchema::PageImageableSize::ImageableArea; -using XDPrintSchema::PageImageableSize::EPageImageablePropsMax; -using XDPrintSchema::PageImageableSize::OriginWidth; -using XDPrintSchema::PageImageableSize::OriginHeight; -using XDPrintSchema::PageImageableSize::ExtentWidth; -using XDPrintSchema::PageImageableSize::ExtentHeight; -using XDPrintSchema::PageImageableSize::PAGE_IMAGEABLE_PROPERTY; -using XDPrintSchema::PageImageableSize::PAGE_IMAGEABLE_PROPS; -using XDPrintSchema::PageImageableSize::PAGE_IMAGEABLE_PROPS_AREA; - -/*++ - -Routine Name: - - CPageImageablePCHandler::CPageImageablePCHandler - -Routine Description: - - CPageImageablePCHandler class constructor - -Arguments: - - pPrintCapabilities - Pointer to the DOM document representation of the PrintCapabilities - -Return Value: - - None - ---*/ -CPageImageablePCHandler::CPageImageablePCHandler( - _In_ IXMLDOMDocument2* pPrintCapabilities - ) : - CPCHandler(pPrintCapabilities) -{ -} - -/*++ - -Routine Name: - - CPageImageablePCHandler::~CPageImageablePCHandler - -Routine Description: - - CPageImageablePCHandler class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CPageImageablePCHandler::~CPageImageablePCHandler() -{ -} - -/*++ - -Routine Name: - - CPageImageablePCHandler::GetData - -Routine Description: - - The routine fills the data structure passed in with page imageable size - data retrieved from the PrintCapabilities passed to the class constructor. - -Arguments: - - pPageImageableData - Pointer to the page imageable size data structure to be filled in - -Return Value: - - HRESULT - S_OK - On success - E_ELEMENT_NOT_FOUND - Feature not present in PrintCapabilities - E_* - On error - ---*/ -HRESULT -CPageImageablePCHandler::GetData( - _Inout_ PageImageableData* pPageImageableData - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pPageImageableData, E_POINTER))) - { - CComBSTR bstrQuery; - CPTQueryBuilder queryImageableArea(m_bstrFrameworkPrefix); - - if (SUCCEEDED(hr = queryImageableArea.AddProperty(m_bstrKeywordsPrefix, CComBSTR(PAGE_IMAGEABLE_PROPERTY))) && - SUCCEEDED(hr = queryImageableArea.GetQuery(&bstrQuery)) && - SUCCEEDED(hr = QueryNode(bstrQuery))) - { - CPTQueryBuilder queryImageableSizeWidth(queryImageableArea); - CPTQueryBuilder queryImageableSizeHeight(queryImageableArea); - - if (SUCCEEDED(hr = queryImageableSizeWidth.AddProperty(m_bstrKeywordsPrefix, CComBSTR(PAGE_IMAGEABLE_PROPS[ImageableSizeWidth]))) && - SUCCEEDED(hr = queryImageableSizeHeight.AddProperty(m_bstrKeywordsPrefix, CComBSTR(PAGE_IMAGEABLE_PROPS[ImageableSizeHeight]))) && - SUCCEEDED(hr = queryImageableSizeWidth.GetQuery(&bstrQuery)) && - SUCCEEDED(hr = QueryNodeValue(bstrQuery, &pPageImageableData->imageableSizeWidth)) && - SUCCEEDED(hr = queryImageableSizeHeight.GetQuery(&bstrQuery)) && - SUCCEEDED(hr = QueryNodeValue(bstrQuery, &pPageImageableData->imageableSizeHeight))) - { - CPTQueryBuilder queryOriginWidth(queryImageableArea); - CPTQueryBuilder queryOriginHeight(queryImageableArea); - CPTQueryBuilder queryExtentWidth(queryImageableArea); - CPTQueryBuilder queryExtentHeight(queryImageableArea); - - if (SUCCEEDED(hr = queryOriginWidth.AddProperty(m_bstrKeywordsPrefix, CComBSTR(PAGE_IMAGEABLE_PROPS[ImageableArea]))) && - SUCCEEDED(hr = queryOriginWidth.AddProperty(m_bstrKeywordsPrefix, CComBSTR(PAGE_IMAGEABLE_PROPS_AREA[OriginWidth]))) && - SUCCEEDED(hr = queryOriginHeight.AddProperty(m_bstrKeywordsPrefix, CComBSTR(PAGE_IMAGEABLE_PROPS[ImageableArea]))) && - SUCCEEDED(hr = queryOriginHeight.AddProperty(m_bstrKeywordsPrefix, CComBSTR(PAGE_IMAGEABLE_PROPS_AREA[OriginHeight]))) && - SUCCEEDED(hr = queryExtentWidth.AddProperty(m_bstrKeywordsPrefix, CComBSTR(PAGE_IMAGEABLE_PROPS[ImageableArea]))) && - SUCCEEDED(hr = queryExtentWidth.AddProperty(m_bstrKeywordsPrefix, CComBSTR(PAGE_IMAGEABLE_PROPS_AREA[ExtentWidth]))) && - SUCCEEDED(hr = queryExtentHeight.AddProperty(m_bstrKeywordsPrefix, CComBSTR(PAGE_IMAGEABLE_PROPS[ImageableArea]))) && - SUCCEEDED(hr = queryExtentHeight.AddProperty(m_bstrKeywordsPrefix, CComBSTR(PAGE_IMAGEABLE_PROPS_AREA[ExtentHeight]))) && - SUCCEEDED(hr = queryOriginWidth.GetQuery(&bstrQuery)) && - SUCCEEDED(hr = QueryNodeValue(bstrQuery, &pPageImageableData->originWidth)) && - SUCCEEDED(hr = queryOriginHeight.GetQuery(&bstrQuery)) && - SUCCEEDED(hr = QueryNodeValue(bstrQuery, &pPageImageableData->originHeight)) && - SUCCEEDED(hr = queryExtentWidth.GetQuery(&bstrQuery)) && - SUCCEEDED(hr = QueryNodeValue(bstrQuery, &pPageImageableData->extentWidth)) && - SUCCEEDED(hr = queryExtentHeight.GetQuery(&bstrQuery))) - { - hr = QueryNodeValue(bstrQuery, &pPageImageableData->extentHeight); - } - } - } - } - - ERR_ON_HR_EXC(hr, E_ELEMENT_NOT_FOUND); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/common/pimagepthndlr.h b/print/XPSDrvSmpl/src/common/pimagepthndlr.h deleted file mode 100644 index 99d5025e..00000000 --- a/print/XPSDrvSmpl/src/common/pimagepthndlr.h +++ /dev/null @@ -1,42 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - pimagepthndlr.h - -Abstract: - - This class is responsible for retrieving the PageImageableSize properties from a - PrintCapabilities document. - ---*/ - -#pragma once - -#include "pchndlr.h" -#include "pimagedata.h" - -class CPageImageablePCHandler : public CPCHandler -{ -public: - CPageImageablePCHandler( - _In_ IXMLDOMDocument2* pPrintCapabilities - ); - - virtual ~CPageImageablePCHandler(); - - HRESULT - GetData( - _Inout_ XDPrintSchema::PageImageableSize::PageImageableData* pPageImageableData - ); -}; - diff --git a/print/XPSDrvSmpl/src/common/pimageschema.cpp b/print/XPSDrvSmpl/src/common/pimageschema.cpp deleted file mode 100644 index bd9dd484..00000000 --- a/print/XPSDrvSmpl/src/common/pimageschema.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - pimageschema.cpp - -Abstract: - - PageImageableSize PrintSchema implementation. This implements the features, - options and enumerations that describe the PrintSchema PageImageableSize feature. - ---*/ - -#include "precomp.h" -#include "pimageschema.h" - -LPCWSTR XDPrintSchema::PageImageableSize::PAGE_IMAGEABLE_PROPERTY = L"PageImageableSize"; - -LPCWSTR XDPrintSchema::PageImageableSize::PAGE_IMAGEABLE_PROPS[] = { - L"ImageableSizeWidth", - L"ImageableSizeHeight", - L"ImageableArea" -}; - -LPCWSTR XDPrintSchema::PageImageableSize::PAGE_IMAGEABLE_PROPS_AREA[] = { - L"OriginWidth", - L"OriginHeight", - L"ExtentWidth", - L"ExtentHeight" -}; - diff --git a/print/XPSDrvSmpl/src/common/pimageschema.h b/print/XPSDrvSmpl/src/common/pimageschema.h deleted file mode 100644 index 760b1d2b..00000000 --- a/print/XPSDrvSmpl/src/common/pimageschema.h +++ /dev/null @@ -1,62 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - pimageschema.h - -Abstract: - - PageImageableSize PrintSchema definition. This defines the features, options - and enumerations that describe the PrintSchema PageImageableSize feature within - a XDPrintSchema::PageImageableSize namespace. - ---*/ - -#pragma once - -#include "schema.h" - -namespace XDPrintSchema -{ - // - // PageImageSize elements described as Printschema keywords - // - namespace PageImageableSize - { - // - // The property name - // - extern LPCWSTR PAGE_IMAGEABLE_PROPERTY; - - enum EPageImageableProps - { - ImageableSizeWidth = 0, EPageImageablePropsMin = 0, - ImageableSizeHeight, - ImageableArea, - EPageImageablePropsMax - }; - - extern LPCWSTR PAGE_IMAGEABLE_PROPS[EPageImageablePropsMax]; - - enum EPageImageablePropsArea - { - OriginWidth = 0, EPageImageablePropsAreaMin = 0, - OriginHeight, - ExtentWidth, - ExtentHeight, - EPageImageablePropsAreaMax - }; - - extern LPCWSTR PAGE_IMAGEABLE_PROPS_AREA[EPageImageablePropsAreaMax]; - } -} - diff --git a/print/XPSDrvSmpl/src/common/porientdata.h b/print/XPSDrvSmpl/src/common/porientdata.h deleted file mode 100644 index 4e3a181d..00000000 --- a/print/XPSDrvSmpl/src/common/porientdata.h +++ /dev/null @@ -1,42 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - porientdata.h - -Abstract: - - PageOrientation data structure definition. This provides a convenient - description of the PrintSchema PageOrientation feature. - ---*/ - -#pragma once - -#include "porientschema.h" - -namespace XDPrintSchema -{ - namespace PageOrientation - { - struct PageOrientationData - { - PageOrientationData() : - orientation(Landscape) - { - } - - EOrientationOption orientation; - }; - } -} - diff --git a/print/XPSDrvSmpl/src/common/porientpthndlr.cpp b/print/XPSDrvSmpl/src/common/porientpthndlr.cpp deleted file mode 100644 index 52e3e7ed..00000000 --- a/print/XPSDrvSmpl/src/common/porientpthndlr.cpp +++ /dev/null @@ -1,150 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - porientpthndlr.cpp - -Abstract: - - PageOrientation PrintTicket handler implementation. Derived from CPTHandler, - this provides a PageOrientation specific Get methods acting on the passed in - PrintTicket (as a DOM document). - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdexcept.h" -#include "porientpthndlr.h" - -using XDPrintSchema::PageOrientation::PageOrientationData; -using XDPrintSchema::PageOrientation::EOrientationOption; -using XDPrintSchema::PageOrientation::EOrientationOptionMin; -using XDPrintSchema::PageOrientation::EOrientationOptionMax; -using XDPrintSchema::PageOrientation::ORIENTATION_FEATURE; -using XDPrintSchema::PageOrientation::ORIENTATION_OPTIONS; - -/*++ - -Routine Name: - - CPageOrientationPTHandler::CPageOrientationPTHandler - -Routine Description: - - CPageOrientationPTHandler class constructor - -Arguments: - - pPrintTicket - Pointer to the DOM document representation of the PrintTicket - -Return Value: - - None - ---*/ -CPageOrientationPTHandler::CPageOrientationPTHandler( - _In_ IXMLDOMDocument2* pPrintTicket - ) : - CPTHandler(pPrintTicket) -{ -} - -/*++ - -Routine Name: - - CPageOrientationPTHandler::~CPageOrientationPTHandler - -Routine Description: - - CPageOrientationPTHandler class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CPageOrientationPTHandler::~CPageOrientationPTHandler() -{ -} - -/*++ - -Routine Name: - - CPageOrientationPTHandler::GetData - -Routine Description: - - The routine fills the data structure passed in with page orientation data retrieved from - the PrintTicket passed to the class constructor. - -Arguments: - - pPageOrientationData - Pointer to the page orientation data structure to be filled in - -Return Value: - - HRESULT - S_OK - On success - E_ELEMENT_NOT_FOUND - Feature not present in PrintTicket - E_* - On error - ---*/ -HRESULT -CPageOrientationPTHandler::GetData( - _Inout_ PageOrientationData* pPageOrientationData - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pPageOrientationData, E_POINTER))) - { - CComBSTR bstrPOOption; - - if (SUCCEEDED(hr = GetFeatureOption(CComBSTR(ORIENTATION_FEATURE), &bstrPOOption))) - { - for (EOrientationOption poOpt = EOrientationOptionMin; - poOpt < EOrientationOptionMax; - poOpt = static_cast<EOrientationOption>(poOpt + 1)) - { - if (bstrPOOption == ORIENTATION_OPTIONS[poOpt]) - { - pPageOrientationData->orientation = poOpt; - break; - } - } - } - } - - // - // Validate the data - // - if (SUCCEEDED(hr)) - { - if (pPageOrientationData->orientation < EOrientationOptionMin || - pPageOrientationData->orientation >= EOrientationOptionMax) - { - hr = E_FAIL; - } - } - - ERR_ON_HR_EXC(hr, E_ELEMENT_NOT_FOUND); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/common/porientpthndlr.h b/print/XPSDrvSmpl/src/common/porientpthndlr.h deleted file mode 100644 index 138bbc0c..00000000 --- a/print/XPSDrvSmpl/src/common/porientpthndlr.h +++ /dev/null @@ -1,45 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - porientpthndlr.h - -Abstract: - - PageOrientation PrintTicket handling definition. The PageOrientation PT handler - is used to extract PageOrientation settings from a PrintTicket and populate - the PageOrientation data structure with the retrieved settings. The class also - defines a method for setting the feature in the PrintTicket given the - data structure. - ---*/ - -#pragma once - -#include "pthndlr.h" -#include "porientdata.h" - -class CPageOrientationPTHandler : public CPTHandler -{ -public: - CPageOrientationPTHandler( - _In_ IXMLDOMDocument2* pPrintTicket - ); - - virtual ~CPageOrientationPTHandler(); - - HRESULT - GetData( - _Inout_ XDPrintSchema::PageOrientation::PageOrientationData* pPageOrientationData - ); -}; - diff --git a/print/XPSDrvSmpl/src/common/porientschema.cpp b/print/XPSDrvSmpl/src/common/porientschema.cpp deleted file mode 100644 index 524001c1..00000000 --- a/print/XPSDrvSmpl/src/common/porientschema.cpp +++ /dev/null @@ -1,34 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - porientschema.cpp - -Abstract: - - PageOrientation PrintSchema implementation. This implements the features, - options and enumerations that describe the PrintSchema PageOrientation feature. - ---*/ - -#include "precomp.h" -#include "porientschema.h" - -LPCWSTR XDPrintSchema::PageOrientation::ORIENTATION_FEATURE = L"PageOrientation"; - -LPCWSTR XDPrintSchema::PageOrientation::ORIENTATION_OPTIONS[EOrientationOptionMax] = { - L"Landscape", - L"Portrait", - L"ReverseLandscape", - L"ReversePortrait" -}; - diff --git a/print/XPSDrvSmpl/src/common/porientschema.h b/print/XPSDrvSmpl/src/common/porientschema.h deleted file mode 100644 index 2fdca11c..00000000 --- a/print/XPSDrvSmpl/src/common/porientschema.h +++ /dev/null @@ -1,55 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - porientschema.h - -Abstract: - - PageOrientation PrintSchema definition. This defines the features, options - and enumerations that describe the PrintSchema PageOrientation feature within - a XDPrintSchema::PageOrientation namespace. - ---*/ - -#pragma once - -#include "schema.h" - -namespace XDPrintSchema -{ - // - // PageOrientation elements described as Printschema keywords - // - namespace PageOrientation - { - // - // The feature name - // - extern LPCWSTR ORIENTATION_FEATURE; - - // - // Paper orientation options - // - enum EOrientationOption - { - Landscape = 0, EOrientationOptionMin = 0, - Portrait, - ReverseLandscape, - ReversePortrait, - EOrientationOptionMax - }; - - extern LPCWSTR ORIENTATION_OPTIONS[EOrientationOptionMax]; - } -} - diff --git a/print/XPSDrvSmpl/src/common/precomp.h b/print/XPSDrvSmpl/src/common/precomp.h deleted file mode 100644 index d871a9fd..00000000 --- a/print/XPSDrvSmpl/src/common/precomp.h +++ /dev/null @@ -1,102 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - precomp.h - -Abstract: - - Precompiled header for all filters - ---*/ - -#pragma once - -// -// Annotate this as a usermode driver for static analysis -// -#include <DriverSpecs.h> -_Analysis_mode_(_Analysis_code_type_user_driver_) - -// -// Standard Annotation Language include -// -#include <sal.h> - -// -// Windows includes -// -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif // WIN32_LEAN_AND_MEAN -#include <windows.h> -#include <limits.h> - -// -// COM includes -// -#include <objbase.h> -#include <oleauto.h> - -// -// ATL Includes -// -#include <atlbase.h> - - -#pragma warning (push) -#pragma warning (disable:4458) -// -// GDIPlus includes -// -#include <GDIPlus.h> -#pragma warning (pop) - -// -// MSXML includes -// -#include <msxml6.h> - -// -// WCS Includes -// -#include <icm.h> - -// -// Filter pipeline includes -// -#include <winspool.h> -#include <filterpipeline.h> -#include <filterpipelineutil.h> -#include <prntvpt.h> - -// -// Standard library includes -// -#include <new> -#include <math.h> -#include <vector> -#include <deque> -#include <map> - -// -// Commonly used namespaces -// -using namespace std; -using namespace Gdiplus; - -// -// String safe includes - included last to prevent build warnings -// -#include <strsafe.h> - -#include "common.ver" diff --git a/print/XPSDrvSmpl/src/common/precompsrc.cpp b/print/XPSDrvSmpl/src/common/precompsrc.cpp deleted file mode 100644 index 5944cf51..00000000 --- a/print/XPSDrvSmpl/src/common/precompsrc.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "precomp.h"
\ No newline at end of file diff --git a/print/XPSDrvSmpl/src/common/privatedefs.h b/print/XPSDrvSmpl/src/common/privatedefs.h deleted file mode 100644 index 0c8cb96d..00000000 --- a/print/XPSDrvSmpl/src/common/privatedefs.h +++ /dev/null @@ -1,300 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - privatedefs.h - -Abstract: - - Definitions for private PrintTicket/PrintCapabilities properties for watermark and page scaling features. - ---*/ - -#pragma once - -// -// Macro to return the number of elements in an array -// -#define numof(n) (sizeof(n) / sizeof(n[0])) - -// -// Structure definition for the Private Parameter Defs (Integer Type) -// -typedef struct _PRIVATE_DEF_INTS -{ - PCSTR property_name; - BOOL is_public; - PCSTR display_name; - INT default_value; - INT min_length; - INT max_length; - INT multiple; - PCSTR unit_type; -}PRIVATE_DEF_INTEGERS; - -// -// Structure definition for the Private Parameter Defs (String Type) -// -typedef struct _PRIVATE_DEF_STRS -{ - PCSTR property_name; - PCSTR display_name; - PCSTR default_value; - INT min_length; - INT max_length; - PCSTR unit_type; -}PRIVATE_DEF_STRINGS; - -// -// Structure definition for the Private Parameter Defs (Decimal Type) -// -typedef struct _PRIVATE_DEF_DECS -{ - PCSTR property_name; - PCSTR display_name; - REAL default_value; - REAL min_length; - REAL max_length; - REAL multiple; - PCSTR unit_type; -}PRIVATE_DEF_DECIMALS; - -// -// Table of values for private integer watermark properties. -// -CONST PRIVATE_DEF_INTEGERS wmParamDefIntegers[] = -{ - { - "PageWatermarkTextAngle", - TRUE, - NULL, - 0, - 0, - 360, - 1, - "Degrees" - }, - { - "PageWatermarkOriginWidth", - TRUE, - NULL, - 0, - -INT_MAX, - INT_MAX, - 1, - "Microns" - }, - { - "PageWatermarkOriginHeight", - TRUE, - NULL, - HUNDREDTH_OFINCH_TO_MICRON(100), - -INT_MAX, - INT_MAX, - 1, - "Microns" - }, - { - "PageWatermarkSizeWidth", - FALSE, - NULL, - HUNDREDTH_OFINCH_TO_MICRON(100), - 0, - INT_MAX, - 1, - "Microns" - }, - { - "PageWatermarkSizeHeight", - FALSE, - NULL, - HUNDREDTH_OFINCH_TO_MICRON(100), - 0, - INT_MAX, - 1, - "Microns" - }, - { - "PageWatermarkTextFontSize", - TRUE, - NULL, - 72, - 1, - INT_MAX, - 1, - "Points Per Inch" - }, - { - "PageWatermarkTextColor", - TRUE, - NULL, - (INT) 0xFFFF0000, - 0, - (INT) 0xFFFFFFFF, - 1, - "sRGB" - }, - { - "PageWatermarkTransparency", - TRUE, - NULL, - 50, - 0, - 100, - 1, - "Transparency" - }, -}; - -// -// enum lookup into above table -// -enum eWMParamDefIntegers -{ - ePageWatermarkAngle = 0, - ePageWatermarkOriginWidth, - ePageWatermarkOriginHeight, - ePageWatermarkSizeWidth, - ePageWatermarkSizeHeight, - ePageWatermarkTextFontSize, - ePageWatermarkTextColor, - ePageWatermarkTransparency, -}; - -// -// Table of values for private string watermark properties. -// -CONST PRIVATE_DEF_STRINGS wmParamDefStrings[] = -{ - { - "PageWatermarkTextText", - NULL, - "CONFIDENTIAL", - 0, - 20, - "characters" - } -}; - -// -// enum lookup into above table -// -enum eWMParamDefStrings -{ - ePageWatermarkTextText = 0 -}; - -// -// Table of values for private integer page scaling properties. -// -CONST PRIVATE_DEF_INTEGERS pgscParamDefIntegers[] = -{ - { - "PageScalingScaleWidth", - TRUE, - NULL, - 100, - 1, - 1000, - 1, - "Percent" - }, - { - "PageScalingScaleHeight", - TRUE, - NULL, - 100, - 1, - 1000, - 1, - "Percent" - }, - { - "PageScalingScale", - TRUE, - NULL, - 100, - 1, - 1000, - 1, - "Percent" - }, - { - "PageScalingOffsetWidth", - TRUE, - NULL, - 0, - -INT_MAX, - INT_MAX, - 1, - "Microns" - }, - { - "PageScalingOffsetHeight", - TRUE, - NULL, - 0, - -INT_MAX, - INT_MAX, - 1, - "Microns" - }, -}; - -// -// enum lookup into above table -// -enum ePGSCParamDefIntegers -{ - ePageScalingScaleWidth = 0, - ePageScalingScaleHeight, - ePageScalingScale, - ePageScalingOffsetWidth, - ePageScalingOffsetHeight, -}; - -// -// Table of values for private integer booklet gutter properties. -// -CONST PRIVATE_DEF_INTEGERS bkParamDefIntegers[] = -{ - { - "JobBindAllDocumentsGutter", - TRUE, - NULL, - 0, - -INT_MAX, - INT_MAX, - 0, - "Microns" - }, - { - "DocumentBindingGutter", - TRUE, - NULL, - 0, - -INT_MAX, - INT_MAX, - 0, - "Microns" - } -}; - -// -// enum lookup into above table -// -enum eBindingParamDefIntegers -{ - eJobBindAllDocumentsGutter = 0, - eDocumentBindingGutter, -}; - diff --git a/print/XPSDrvSmpl/src/common/pshndlr.cpp b/print/XPSDrvSmpl/src/common/pshndlr.cpp deleted file mode 100644 index 90acda70..00000000 --- a/print/XPSDrvSmpl/src/common/pshndlr.cpp +++ /dev/null @@ -1,1836 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -File Name: - - pshndlr.cpp - -Abstract: - - Base PrintSchema Document handler class implementation. - This class provides common PrintTicket / PrintCapabilities handling functionality. - A class can derive from this base class to get PrintTicket/PrintCapabilities - unspecific XML handling functionality. - - Note: The PrintSchema handler code is only intended to work with the sdtandard - public PrintSchema keywords. - ---*/ - - -// -// Note on handling missing DOM nodes: -// -// Convert MSXML's S_FALSE to E_ELEMENT_NOT_FOUND. This allows clients to -// use the SUCCEEDED macro more effectively. -// -// E_ELEMENT_NOT_FOUND should not be propogated as an error to the -// filter pipeline or config module - treat as though the requested feature -// has not been enabled. -// - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "pshndlr.h" - -using XDPrintSchema::FRAMEWORK_URI; -using XDPrintSchema::KEYWORDS_URI; -using XDPrintSchema::SCHEMA_INST_URI; -using XDPrintSchema::SCHEMA_DEF_URI; -using XDPrintSchema::PROPERTY_ELEMENT_NAME; -using XDPrintSchema::NAME_ATTRIBUTE_NAME; -using XDPrintSchema::VALUE_ELEMENT_NAME; -using XDPrintSchema::SCHEMA_TYPE; -using XDPrintSchema::SCORED_PROP_ELEMENT_NAME; -using XDPrintSchema::SCHEMA_STRING; -using XDPrintSchema::SCHEMA_INTEGER; -using XDPrintSchema::SCHEMA_DECIMAL; -using XDPrintSchema::PARAM_REF_ELEMENT_NAME; -using XDPrintSchema::PARAM_INIT_ELEMENT_NAME; -using XDPrintSchema::SCHEMA_INST_URI; - -static LPCWSTR szSelectNS = L"SelectionNamespaces"; -static LPCWSTR szTmpNS = L"psf"; -static LPCWSTR szNSSelection = L"xmlns:%s='%s'"; -static LPCWSTR szSelectLang = L"SelectionLanguage"; -static LPCWSTR szLangSection = L"XPath"; - -static LPCWSTR szPTRootQuery = L"//%s:%s"; - -/*++ - -Routine Name: - - CPSHandler::CPSHandler - -Routine Description: - - CPSHandler class constructor - -Arguments: - - pDOMDocument - Pointer to the DOM document representation of the PrintTicket/PrintCapabilities - -Return Value: - - None - Throws CXDException(HRESULT) on an error - ---*/ -CPSHandler::CPSHandler( - _In_z_ BSTR bstrDocumentType, - _In_ IXMLDOMDocument2 *pPrintDocument - ) : - m_bstrDocumentType(bstrDocumentType), - m_pPrintDocument(pPrintDocument) -{ - ASSERTMSG(m_pPrintDocument != NULL, "NULL PrintDocument passed to PS manager.\n"); - - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(m_pPrintDocument, E_PENDING))) - { - try - { - // - // Make sure XPath selection language is set - // - if (SUCCEEDED(hr = m_pPrintDocument->setProperty(CComBSTR(szSelectLang), CComVariant(szLangSection)))) - { - // - // Construct the alias namespace string - // - CStringXDW cstrNamespaces; - cstrNamespaces.Format(szNSSelection, szTmpNS, FRAMEWORK_URI); - - // - // Specify an alias PrintSchema namespace prefix to allow us to find the real ones - // - if (SUCCEEDED(hr = m_pPrintDocument->setProperty(CComBSTR(szSelectNS), CComVariant(cstrNamespaces)))) - { - if (SUCCEEDED(hr = GetPrefixFromURI(CComBSTR(FRAMEWORK_URI), &m_bstrFrameworkPrefix)) && - SUCCEEDED(hr = GetPrefixFromURI(CComBSTR(KEYWORDS_URI), &m_bstrKeywordsPrefix)) && - SUCCEEDED(hr = GetPrefixFromURI(CComBSTR(SCHEMA_INST_URI), &m_bstrSchemaInstPrefix)) && - SUCCEEDED(hr = GetPrefixFromURI(CComBSTR(SCHEMA_DEF_URI), &m_bstrSchemaPrefix))) - { - CStringXDW cstrNSUserPrefix(L"ns0000:"); - m_bstrUserKeywordsPrefix.Empty(); - m_bstrUserKeywordsPrefix.Attach(cstrNSUserPrefix.AllocSysString()); - - // - // Restore the original namespace prefix for the PrintSchema framework - // - CComBSTR bstrOrgNamespaces; - CStringXDW cstrNSPrefix(m_bstrFrameworkPrefix); - - INT iIndex = cstrNSPrefix.Find(L":"); - if (iIndex != -1 && - cstrNSPrefix.Delete(iIndex, 1) > 0) - { - CStringXDW cstrOrgNamespaces; - cstrOrgNamespaces.Format(szNSSelection, static_cast<LPCWSTR>(cstrNSPrefix), FRAMEWORK_URI); - - hr = m_pPrintDocument->setProperty(CComBSTR(szSelectNS), CComVariant(cstrOrgNamespaces)); - } - else - { - RIP("Could not create namespace prefix correctly\n"); - hr = E_FAIL; - } - } - } - else - { - ERR("Failed to set SelectionNamespaces.\n"); - } - } - else - { - RIP("Failed to set SelectionLanguage.\n"); - } - } - catch (CXDException& e) - { - hr = e; - } - } - - if (FAILED(hr)) - { - throw CXDException(hr); - } -} - -/*++ - -Routine Name: - - CPSHandler::~CPSHandler - -Routine Description: - - CPSHandler class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CPSHandler::~CPSHandler() -{ -} - -/*++ - -Routine Name: - - CPSHandler::DeleteNode - -Routine Description: - - This routine deletes the given node from the PrintDocument - -Arguments: - - pNode - Pointer to the DOM node to be deleted - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPSHandler::DeleteNode( - _In_ IXMLDOMNode* pNode - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pNode, E_POINTER))) - { - CComPtr<IXMLDOMNode> pParentNode(NULL); - CComPtr<IXMLDOMNode> pDeletedNode(NULL); - - if (SUCCEEDED(hr = pNode->get_parentNode(&pParentNode)) && - hr != S_FALSE && - SUCCEEDED(hr = pParentNode->removeChild(pNode, &pDeletedNode)) && - pDeletedNode == NULL) - { - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPSHandler::GetNode - -Routine Description: - - This routine retrieves a node given an XPath query - -Arguments: - - bstrNodeQuery - The XPath query for a node - ppNode - Pointer to an IXMLDOMNode pointer that recieves the node retrieved - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPSHandler::GetNode( - _In_z_ BSTR bstrNodeQuery, - _Outptr_ IXMLDOMNode** ppNode - ) -{ - // - // We should have the PrintDocment in place - // - ASSERTMSG(m_pPrintDocument != NULL, "NULL PS detected whilst retrieving node.\n"); - - // - // Method which takes a query string and returns the first node that matches - // - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppNode, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(m_pPrintDocument, E_PENDING))) - { - *ppNode = NULL; - if (SysStringLen(bstrNodeQuery) == 0) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - // - // Get the node from the PrintDocument - // - hr = m_pPrintDocument->selectSingleNode(bstrNodeQuery, ppNode); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPSHandler::DeletePrivateFeatures - -Routine Description: - - This routine finds and deletes features with values defined in the - private namespace passed in - -Arguments: - - bstrPrivateNS - the private namespace - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPSHandler::DeletePrivateFeatures( - _In_z_ BSTR bstrPrivateNS - ) -{ - HRESULT hr = S_OK; - - if (SysStringLen(bstrPrivateNS) > 0) - { - CComBSTR bstrNSPrefix; - if (SUCCEEDED(hr = GetPrefixFromURI(bstrPrivateNS, &bstrNSPrefix))) - { - // - // Find all root feature elements in the namespace - // - CComPtr<IXMLDOMNodeList> pNodeList(NULL); - - CComBSTR bstrFeatureQuery(L"//"); - bstrFeatureQuery += m_bstrFrameworkPrefix; - bstrFeatureQuery += L"Feature"; - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = m_pPrintDocument->selectNodes(bstrFeatureQuery, &pNodeList)) && - SUCCEEDED(hr = pNodeList->reset())) - { - // - // Delete all the feature with name attributes using the private namespace - // - CComPtr<IXMLDOMNode> pDeleteNode(NULL); - - while (SUCCEEDED(hr) && - SUCCEEDED(hr = pNodeList->nextNode(&pDeleteNode)) && - hr != S_FALSE) - { - CComPtr<IXMLDOMNamedNodeMap> pDeleteNodeAtts(NULL); - CComPtr<IXMLDOMNode> pNameNode(NULL); - CComVariant varNameValue; - - if (SUCCEEDED(hr = pDeleteNode->get_attributes(&pDeleteNodeAtts)) && - hr != S_FALSE && - SUCCEEDED(hr = pDeleteNodeAtts->getNamedItem(CComBSTR(L"name"), &pNameNode)) && - hr != S_FALSE && - SUCCEEDED(hr = pNameNode->get_nodeValue(&varNameValue)) && - hr != S_FALSE) - { - try - { - CStringXDW cstrNameValue(varNameValue.bstrVal); - - if (cstrNameValue.Find(bstrNSPrefix) == 0) - { - hr = DeleteNode(pDeleteNode); - } - } - catch (CXDException& e) - { - hr = e; - } - } - - pDeleteNode = NULL; - } - } - } - } - else - { - hr = E_INVALIDARG; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPSHandler::CreateProperty - -Routine Description: - - This routine creates a property element of the given name. Note: this - method only creates the property element; it is up to the caller to - set the property value - -Arguments: - - bstrPropName - The name of the property - ppPropElement - Pointer to a IXMLDOMElement pointer that recieves the newly created Property element - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPSHandler::CreateProperty( - _In_ CONST BSTR bstrPropName, - _Outptr_ IXMLDOMElement** ppPropElement - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppPropElement, E_POINTER))) - { - *ppPropElement = NULL; - - if (SysStringLen(bstrPropName) <= 0) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - CComBSTR bstrTagName(m_bstrFrameworkPrefix); - bstrTagName += PROPERTY_ELEMENT_NAME; - - CComBSTR bstrAttribName(szTmpNS); - bstrAttribName += L":"; - bstrAttribName += bstrPropName; - - hr = CreateXMLElement(bstrTagName, FRAMEWORK_URI, ppPropElement); - - if (SUCCEEDED(hr)) - { - if (*ppPropElement != NULL) - { - hr = CreateXMLAttribute(*ppPropElement, NAME_ATTRIBUTE_NAME, NULL, bstrAttribName ); - } - else - { - hr = E_FAIL; - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPSHandler::CreateProperty - -Routine Description: - - This routine creates a property element of the given name. - -Arguments: - - bstrPropName - The name of the property to be created - bstrType - The type of the property value (integer, string etc.) - bstrValue - The value of the property - ppPropElement - Pointer to an IXMLDOMElement pointer that recieves the new element - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPSHandler::CreateProperty( - _In_ CONST BSTR bstrPropName, - _In_ CONST BSTR bstrType, - _In_ CONST BSTR bstrValue, - _Outptr_ IXMLDOMElement** ppPropElement - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppPropElement, E_POINTER))) - { - if (SysStringLen(bstrPropName) <= 0 || - SysStringLen(bstrType) <= 0 || - SysStringLen(bstrValue) <= 0) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - // - // Create the scored property and value node - // - if (SUCCEEDED(hr = CreateProperty(bstrPropName, ppPropElement))) - { - CComPtr<IXMLDOMElement> pValue(NULL); - - CComBSTR bstrValueElement(m_bstrFrameworkPrefix); - bstrValueElement += VALUE_ELEMENT_NAME; - - CComBSTR bstrTypeAttribName(m_bstrSchemaInstPrefix); - bstrTypeAttribName += SCHEMA_TYPE; - - CComBSTR bstrTypeAttribValue(m_bstrSchemaPrefix); - bstrTypeAttribValue += bstrType; - - hr = CreateXMLElement(bstrValueElement, FRAMEWORK_URI, &pValue); - - if(SUCCEEDED(hr)) - { - if (SUCCEEDED(hr = CreateXMLAttribute(pValue, bstrTypeAttribName, SCHEMA_INST_URI, bstrTypeAttribValue )) && - SUCCEEDED(hr = pValue->put_text(bstrValue))) - { - hr = (*ppPropElement)->appendChild(pValue, NULL); - } - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPSHandler::CreateFWProperty - -Routine Description: - - This routine creates a property element of the given name. Note: this - method only creates the property element; it is up to the caller to - set the property value - -Arguments: - - bstrPropName - The name of the property - ppPropElement - Pointer to a IXMLDOMElement pointer that recieves the newly created Property element - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPSHandler::CreateFWProperty( - _In_ CONST BSTR bstrPropName, - _Outptr_ IXMLDOMElement** ppPropElement - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppPropElement, E_POINTER))) - { - *ppPropElement = NULL; - - if (SysStringLen(bstrPropName) <= 0) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - CComBSTR bstrTagName(m_bstrFrameworkPrefix); - bstrTagName += PROPERTY_ELEMENT_NAME; - - CComBSTR bstrAttribName(m_bstrFrameworkPrefix); - bstrAttribName += bstrPropName; - - hr = CreateXMLElement(bstrTagName, FRAMEWORK_URI, ppPropElement); - - if (SUCCEEDED(hr)) - { - if (*ppPropElement != NULL) - { - hr = CreateXMLAttribute(*ppPropElement, NAME_ATTRIBUTE_NAME, NULL, bstrAttribName ); - } - else - { - hr = E_FAIL; - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPSHandler::CreateFWProperty - -Routine Description: - - This routine creates a property element of the given name. - -Arguments: - - bstrPropName - The name of the property to be created - bstrType - The type of the property value (integer, string etc.) - bstrValue - The value of the property - ppPropElement - Pointer to an IXMLDOMElement pointer that recieves the new element - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPSHandler::CreateFWProperty( - _In_ CONST BSTR bstrPropName, - _In_ CONST BSTR bstrType, - _In_ CONST BSTR bstrValue, - _Outptr_ IXMLDOMElement** ppPropElement - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppPropElement, E_POINTER))) - { - if (SysStringLen(bstrPropName) <= 0 || - SysStringLen(bstrType) <= 0 || - SysStringLen(bstrValue) <= 0) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - // - // Create the scored property and value node - // - if (SUCCEEDED(hr = CreateFWProperty(bstrPropName, ppPropElement))) - { - CComPtr<IXMLDOMElement> pValue(NULL); - - CComBSTR bstrValueElement(m_bstrFrameworkPrefix); - bstrValueElement += VALUE_ELEMENT_NAME; - - CComBSTR bstrTypeAttribName(m_bstrSchemaInstPrefix); - bstrTypeAttribName += SCHEMA_TYPE; - - CComBSTR bstrTypeAttribValue(m_bstrSchemaPrefix); - bstrTypeAttribValue += bstrType; - - hr = CreateXMLElement(bstrValueElement, FRAMEWORK_URI, &pValue); - - if(SUCCEEDED(hr)) - { - if (SUCCEEDED(hr = CreateXMLAttribute(pValue, bstrTypeAttribName, SCHEMA_INST_URI, bstrTypeAttribValue )) && - SUCCEEDED(hr = pValue->put_text(bstrValue))) - { - hr = (*ppPropElement)->appendChild(pValue, NULL); - } - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPSHandler::CreateScoredProperty - -Routine Description: - - This routine creates a scored property. Note: this does not intialise - the scored property value - this is the responsibility of the caller - -Arguments: - - bstrPropName - The name of the property element to be created - ppScoredPropElement - Pointer to an IXMLDOMElement that recieves the new element - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPSHandler::CreateScoredProperty( - _In_ CONST BSTR bstrPropName, - _Outptr_ IXMLDOMElement** ppScoredPropElement - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppScoredPropElement, E_POINTER))) - { - *ppScoredPropElement = NULL; - - if (SysStringLen(bstrPropName) <= 0) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - CComBSTR bstrTagName(m_bstrFrameworkPrefix); - bstrTagName += SCORED_PROP_ELEMENT_NAME; - - CComBSTR bstrAttribName(m_bstrKeywordsPrefix); - bstrAttribName += bstrPropName; - - hr = CreateXMLElement(bstrTagName, FRAMEWORK_URI, ppScoredPropElement); - - if (SUCCEEDED(hr)) - { - if (*ppScoredPropElement != NULL) - { - hr = CreateXMLAttribute(*ppScoredPropElement, NAME_ATTRIBUTE_NAME, NULL, bstrAttribName ); - } - else - { - hr = E_FAIL; - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPSHandler::CreateScoredProperty - -Routine Description: - - This routine creates a scored property. - -Arguments: - - bstrPropName - The name of the property element to be created - bstrType - The type of the value to be created (integer, string etc.) - bstrValue - The value to be set as a string - ppScoredPropElement - Pointer to an IXMLDOMElement that recieves the new element - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPSHandler::CreateScoredProperty( - _In_ CONST BSTR bstrPropName, - _In_ CONST BSTR bstrType, - _In_ CONST BSTR bstrValue, - _Outptr_ IXMLDOMElement** ppScoredPropElement - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppScoredPropElement, E_POINTER))) - { - if (SysStringLen(bstrPropName) <= 0 || - SysStringLen(bstrType) <= 0 || - SysStringLen(bstrValue) <= 0) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - // - // Create the scored property and value node - // - if (SUCCEEDED(hr = CreateScoredProperty(bstrPropName, ppScoredPropElement))) - { - CComPtr<IXMLDOMElement> pValue(NULL); - - CComBSTR bstrValueElement(m_bstrFrameworkPrefix); - bstrValueElement += VALUE_ELEMENT_NAME; - - CComBSTR bstrTypeAttribName(m_bstrSchemaInstPrefix); - bstrTypeAttribName += SCHEMA_TYPE; - - CComBSTR bstrTypeAttribValue(m_bstrSchemaPrefix); - bstrTypeAttribValue += bstrType; - - hr = CreateXMLElement(bstrValueElement, FRAMEWORK_URI, &pValue); - - if(SUCCEEDED(hr)) - { - if (SUCCEEDED(hr = CreateXMLAttribute(pValue, bstrTypeAttribName, SCHEMA_INST_URI, bstrTypeAttribValue )) && - SUCCEEDED(hr = pValue->put_text(bstrValue))) - { - hr = (*ppScoredPropElement)->appendChild(pValue, NULL); - } - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPSHandler::CreateScoredProperty - -Routine Description: - - This routine creates a scored property of type string. - -Arguments: - - bstrPropName - The name of the property element to be created - bstrValue - The string value to be set - ppScoredPropElement - Pointer to an IXMLDOMElement that recieves the new element - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPSHandler::CreateScoredProperty( - _In_ CONST BSTR bstrPropName, - _In_ CONST BSTR bstrValue, - _Outptr_ IXMLDOMElement** ppScoredPropElement - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppScoredPropElement, E_POINTER))) - { - if (SysStringLen(bstrPropName) > 0 && - SysStringLen(bstrValue) > 0) - { - // - // Create the scored property and value node - // - hr = CreateScoredProperty(bstrPropName, CComBSTR(SCHEMA_STRING), bstrValue, ppScoredPropElement); - } - else - { - hr = E_INVALIDARG; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPSHandler::CreateScoredProperty - -Routine Description: - - This routine creates a scored property of type INT. - -Arguments: - - bstrPropName - The name of the property element to be created - intValue - The INT value to be set - ppScoredPropElement - Pointer to an IXMLDOMElement that recieves the new element - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPSHandler::CreateScoredProperty( - _In_ CONST BSTR bstrPropName, - _In_ CONST INT intValue, - _Outptr_ IXMLDOMElement** ppScoredPropElement - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppScoredPropElement, E_POINTER))) - { - if (SysStringLen(bstrPropName) <= 0) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - try - { - // - // Construct the value string - // - CStringXDW cstrValue; - cstrValue.Format(L"%i", intValue); - - // - // Create the scored property and value node - // - hr = CreateScoredProperty(bstrPropName, - CComBSTR(SCHEMA_INTEGER), - CComBSTR(cstrValue.AllocSysString()), - ppScoredPropElement); - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPSHandler::CreateScoredProperty - -Routine Description: - - This routine creates a scored property of type REAL. - -Arguments: - - bstrPropName - The name of the property element to be created - realValue - The REAL value to be set - ppScoredPropElement - Pointer to an IXMLDOMElement that recieves the new element - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPSHandler::CreateScoredProperty( - _In_ CONST BSTR bstrPropName, - _In_ CONST REAL realValue, - _Outptr_ IXMLDOMElement** ppScoredPropElement - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppScoredPropElement, E_POINTER))) - { - if (SysStringLen(bstrPropName) <= 0) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - try - { - // - // Construct the value string - // - CStringXDW cstrValue; - cstrValue.Format(L"%.2f", realValue); - - // - // Create the scored property and value node - // - hr = CreateScoredProperty(bstrPropName, - CComBSTR(SCHEMA_DECIMAL), - CComBSTR(cstrValue.AllocSysString()), - ppScoredPropElement); - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPSHandler::QueryNode - -Routine Description: - - This routine checks for the existence of a node given the XPath - query passed in - -Arguments: - - bstrQuery - The XPath query defining the node or nodes to be located - -Return Value: - - HRESULT - S_OK - On success - E_ELEMENT_NOT_FOUND - If node does not exist - E_* - On error - ---*/ -HRESULT -CPSHandler::QueryNode( - _In_z_ BSTR bstrQuery - ) -{ - HRESULT hr = S_OK; - - // - // Validate input parameters - // - if (SysStringLen(bstrQuery) > 0) - { - CComPtr<IXMLDOMNode> pNode(NULL); - - hr = GetNode(bstrQuery, &pNode); - } - else - { - hr = E_INVALIDARG; - } - - if (hr == S_FALSE) - { - hr = E_ELEMENT_NOT_FOUND; - } - - ERR_ON_HR_EXC(hr, E_ELEMENT_NOT_FOUND); - return hr; -} - -/*++ - -Routine Name: - - CPSHandler::QueryNodeValue - -Routine Description: - - This routine locates the node specified by the XPath query passed in and - returns the value of the "value" attribute as a string. - -Arguments: - - bstrQuery - The XPath query locating the node to retrieve the value for - pbstrOption - Pointer to a BSTR to recieve the value string - -Return Value: - - HRESULT - S_OK - On success - E_ELEMENT_NOT_FOUND - If node does not exist - E_* - On error - ---*/ -HRESULT -CPSHandler::QueryNodeValue( - _In_z_ BSTR bstrQuery, - _Outptr_ BSTR* pbstrValue - ) -{ - HRESULT hr = S_OK; - - // - // Validate input parameters - // - if (SUCCEEDED(hr = CHECK_POINTER(pbstrValue, E_POINTER))) - { - *pbstrValue = NULL; - - if (SysStringLen(bstrQuery) > 0) - { - hr = GetNodeValue(bstrQuery, pbstrValue); - } - else - { - hr = E_INVALIDARG; - } - } - - if (hr == S_FALSE) - { - hr = E_ELEMENT_NOT_FOUND; - } - - ERR_ON_HR_EXC(hr, E_ELEMENT_NOT_FOUND); - return hr; -} - -/*++ - -Routine Name: - - CPSHandler::QueryNodeValue - -Routine Description: - - This routine locates the node specified by the XPath query passed in and - returns the value of the "value" attribute as an INT. - -Arguments: - - bstrQuery - The XPath query locating the node to retrieve the value for - pValue - Pointer to an INT to recieve the value - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPSHandler::QueryNodeValue( - _In_z_ BSTR bstrQuery, - _Out_ INT* pValue - ) -{ - HRESULT hr = S_OK; - - CComBSTR bstrValue; - if (SUCCEEDED(hr = CHECK_POINTER(pValue, E_POINTER))) - { - if (SysStringLen(bstrQuery) <= 0) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = QueryNodeValue(bstrQuery, &bstrValue))) - { - *pValue = static_cast<INT>(_wtoi(bstrValue)); - } - - ERR_ON_HR_EXC(hr, E_ELEMENT_NOT_FOUND); - return hr; -} - -/*++ - -Routine Name: - - CPSHandler::QueryNodeValue - -Routine Description: - - This routine locates the node specified by the XPath query passed in and - returns the value of the "value" attribute as a REAL. - -Arguments: - - bstrQuery - The XPath query locating the node to retrieve the value for - pValue - Pointer to a REAL to recieve the value - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPSHandler::QueryNodeValue( - _In_z_ BSTR bstrQuery, - _Out_ REAL* pValue - ) -{ - HRESULT hr = S_OK; - - CComBSTR bstrValue; - if (SUCCEEDED(hr = CHECK_POINTER(pValue, E_POINTER))) - { - if (SysStringLen(bstrQuery) <= 0) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = QueryNodeValue(bstrQuery, &bstrValue))) - { - *pValue = static_cast<REAL>(_wtof(bstrValue)); - } - - ERR_ON_HR_EXC(hr, E_ELEMENT_NOT_FOUND); - return hr; -} - -/*++ - -Routine Name: - - CPSHandler::GetNodeValue - -Routine Description: - - This routine retrieves the value of a node given the XPath query to the node - -Arguments: - - bstrNodeQuery - The XPath query for the node from which the value should be retrieved - pbstrValue - Pointer to ta BSTR that recieves the value of the node - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - -Note: - - The annotation for pbstrValue is intended to express that the BSTR may - be NULL when S_FALSE is returned, but not when S_OK is returned. - - In any case, when a failure HRESULT is returned, all out parameter - annotations are ignored. - ---*/ -HRESULT -CPSHandler::GetNodeValue( - _In_z_ BSTR bstrNodeQuery, - _Inout_ _At_(*pbstrValue, _Pre_maybenull_) - _When_(return == S_FALSE, _At_(*pbstrValue, _Post_maybenull_)) - _When_(return != S_FALSE, _At_(*pbstrValue, _Post_valid_)) - BSTR* pbstrValue - ) -{ - HRESULT hr = S_OK; - - CComPtr<IXMLDOMNode> pFeatureNode(NULL); - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrValue, E_POINTER))) - { - SysFreeString(*pbstrValue); - *pbstrValue = NULL; - if (SysStringLen(bstrNodeQuery) <= 0) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = GetNode(bstrNodeQuery, &pFeatureNode)) && - hr != S_FALSE) - { - // - // Scored properties can either be defined as "Value" or "ParameterRef" - // Find out which of these applies to this property and handle accordingly - // - CComBSTR bstrValue(m_bstrFrameworkPrefix); - bstrValue += VALUE_ELEMENT_NAME; - - CComBSTR bstrParamRef(m_bstrFrameworkPrefix); - bstrParamRef += PARAM_REF_ELEMENT_NAME; - - CComVariant varValue; - - CComPtr<IXMLDOMNode> pPropertyNode(NULL); - if (SUCCEEDED(hr = pFeatureNode->selectSingleNode(bstrValue, &pPropertyNode)) && - hr != S_FALSE) - { - // - // Value node. Just retrieve the node value - // - hr = pPropertyNode->get_nodeTypedValue(&varValue); - } - else if (SUCCEEDED(hr = pFeatureNode->selectSingleNode(bstrParamRef, &pPropertyNode)) && - hr != S_FALSE) - { - // - // Property defined by parameter ref. Retrieve the name and look up the value - // from the parameter init elements - // - CComPtr<IXMLDOMNodeList> pParamInitList(NULL); - CComBSTR bstrParamRefValue; - - if (SUCCEEDED(hr = GetAttributeValue(pPropertyNode, CComBSTR(NAME_ATTRIBUTE_NAME), &bstrParamRefValue)) && - hr != S_FALSE && - SUCCEEDED(hr = GetNodes(CComBSTR(PARAM_INIT_ELEMENT_NAME), &pParamInitList)) && - hr != S_FALSE) - { - CComBSTR bstrParamInit; - CComPtr<IXMLDOMNode> pInitNode(NULL); - - hr = pParamInitList->reset(); - - while (SUCCEEDED(hr) && - hr != S_FALSE) - { - if (SUCCEEDED(hr = pParamInitList->nextNode(&pInitNode)) && hr != S_FALSE && pInitNode != NULL) - { - hr = GetAttributeValue(pInitNode, CComBSTR(NAME_ATTRIBUTE_NAME), &bstrParamInit); - if (SUCCEEDED(hr) && bstrParamInit == bstrParamRefValue) - { - hr = pInitNode->get_nodeTypedValue(&varValue); - break; - } - } - - - // - // Release the node and name before getting the next - // - pInitNode = NULL; - bstrParamInit.Empty(); - } - } - } - - if (SUCCEEDED(hr) && - hr != S_FALSE && - SysStringLen(varValue.bstrVal) > 0) - { - *pbstrValue = ::SysAllocString(varValue.bstrVal); - - if (*pbstrValue == NULL) - { - hr = E_OUTOFMEMORY; - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPSHandler::GetAttributeValue - -Routine Description: - - This routine retrieves the value of a named attribute as a string from a DOM node - -Arguments: - - pNode - Pointer to the DOM node to retrieve the attribute value from - bstrAttribName - The name of the attribute - pbstrResult - Pointer to a BSTR that recieves the attribute value - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPSHandler::GetAttributeValue( - _In_ CONST IXMLDOMNode* pNode, - _In_z_ BSTR bstrAttribName, - _Outptr_result_maybenull_ BSTR* pbstrResult - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pNode, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pbstrResult, E_POINTER))) - { - if (SysStringLen(bstrAttribName) <= 0) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - *pbstrResult = NULL; - - // - // Map the associated attributes and get the string result - // - CComPtr<IXMLDOMNamedNodeMap> pIXMLDOMNamedNodeMap(NULL); - CComPtr<IXMLDOMNode> pSubNode(NULL); - - if (SUCCEEDED(hr = const_cast<IXMLDOMNode*>(pNode)->get_attributes(&pIXMLDOMNamedNodeMap)) && - hr != S_FALSE && - SUCCEEDED(hr = pIXMLDOMNamedNodeMap->getNamedItem(bstrAttribName, &pSubNode)) && - hr != S_FALSE) - { - hr = pSubNode->get_text(pbstrResult); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPSHandler::GetNodes - -Routine Description: - - This routine returns a list of all the nodes in the PrintTicket with the - specified element name - -Arguments: - - ppParamInit - Pointer to an IXMLDOMNodeList pointer that recieves the node list - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPSHandler::GetNodes( - _In_ BSTR bstrElementName, - _Outptr_ IXMLDOMNodeList** ppNodeList - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppNodeList, E_POINTER))) - { - if (SysStringLen(bstrElementName) > 0) - { - *ppNodeList = NULL; - - // - // Retrieve all psf:ParameterInit nodes in the PrintTicket - // - CComBSTR bstrParamInitQuery(L"//"); - bstrParamInitQuery += m_bstrFrameworkPrefix; - bstrParamInitQuery += bstrElementName; - - hr = m_pPrintDocument->selectNodes(bstrParamInitQuery, ppNodeList); - } - else - { - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPSHandler::CreateScoredProperty - -Routine Description: - - This routine creates a scored property using the value node passed in. - -Arguments: - - bstrPropName - The name of the property element to be created - pValueNode - Pointer to the IXMLDOMNode that represents the scored property value - ppScoredPropElement - Pointer to an IXMLDOMElement that recieves the new element - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPSHandler::CreateScoredProperty( - _In_ CONST BSTR bstrPropName, - _In_ IXMLDOMNode* pValueNode, - _Outptr_ IXMLDOMElement** ppScoredPropElement - ) -{ - HRESULT hr = S_OK; - - // - // Validate parameters then create the scored property and value node - // - if (SUCCEEDED(hr = CHECK_POINTER(pValueNode, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(ppScoredPropElement, E_POINTER))) - { - if (SysStringLen(bstrPropName) <= 0) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CreateScoredProperty(bstrPropName, ppScoredPropElement))) - { - hr = (*ppScoredPropElement)->appendChild(pValueNode, NULL); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPSHandler::GetPrefixFromURI - -Routine Description: - - Obtains the Prefix associated with a Namespace URI from an XML PrintSchema Document. - -Arguments: - - bstrNamespaceURI - Namespace URI to be used in look-up. - bstrNamespacePrefix - Namespace Prefix to be returned. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPSHandler::GetPrefixFromURI( - _In_z_ BSTR bstrNamespaceURI, - _Outptr_result_maybenull_ BSTR* bstrNamespacePrefix - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(bstrNamespacePrefix, E_POINTER))) - { - if (SysStringLen(bstrNamespaceURI) <= 0) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - *bstrNamespacePrefix = NULL; - - try - { - // - // Construct the Root Query string - // - CStringXDW cstrRootQuery; - cstrRootQuery.Format(szPTRootQuery, szTmpNS, static_cast<LPCWSTR>(m_bstrDocumentType)); - - // - // Find the PrintSchema element so we can retrieve the private namespace prefix - // - CComPtr<IXMLDOMNode> pPTNode(NULL); - CComPtr<IXMLDOMNamedNodeMap> pPTAtts(NULL); - - if (SUCCEEDED(hr = GetNode(CComBSTR(cstrRootQuery), &pPTNode)) && - hr != S_FALSE && - SUCCEEDED(hr = pPTNode->get_attributes(&pPTAtts)) && - SUCCEEDED(hr = pPTAtts->reset())) - { - // - // Iterate over all attributes and match the node value against - // the namespace URI - // - BOOL bMatched = FALSE; - CComPtr<IXMLDOMNode> pAttNode(NULL); - - while (SUCCEEDED(hr) && - !bMatched && - SUCCEEDED(hr = pPTAtts->nextNode(&pAttNode)) && - hr != S_FALSE) - { - CComVariant varValue; - - if (SUCCEEDED(hr = pAttNode->get_nodeValue(&varValue))) - { - if (CComBSTR(varValue.bstrVal) == bstrNamespaceURI) - { - bMatched = TRUE; - } - } - - if (!bMatched) - { - // - // No match - free the attribute node before retrieving the next - // - pAttNode = NULL; - } - } - - if (SUCCEEDED(hr) && - bMatched) - { - // - // If we match then get the node name and strip xmlns: to derive - // the private namespace prefix - // - CStringXDW cstrNSPrefix; - CComBSTR bstrNodeName; - - if (SUCCEEDED(hr = pAttNode->get_nodeName(&bstrNodeName))) - { - cstrNSPrefix = bstrNodeName; - CStringXDW cstrXMLNS(L"xmlns:"); - - if (cstrNSPrefix.Find(cstrXMLNS) != 0 || - cstrNSPrefix.Delete(0, cstrXMLNS.GetLength()) <= 0) - { - ERR("Could not create private namespace prefix correctly\n"); - - hr = E_FAIL; - } - else - { - cstrNSPrefix += L":"; - - SysFreeString(*bstrNamespacePrefix); - *bstrNamespacePrefix = cstrNSPrefix.AllocSysString(); - } - } - } - } - else - { - ERR("Failed to find the PC root element.\n"); - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -HRESULT -CPSHandler::CreateXMLAttribute( - _Inout_ IXMLDOMElement *pTarget, - _In_ PCWSTR pszName, - _In_opt_ PCWSTR pszTargetURI, - _In_ PCWSTR pszValue - ) -/*++ - -Routine Description: - - This routine adds a new attribute to the given XML element. The URI - parameter must be present, but may be an empty string. - - If this routine fails, the document being constructed should be - considered invalid, and be thrown out in its entirity. - - The newly created attribute will be appended to the list of attributes on the element - -Arguments: - - pTarget - the element to which the attribute is to be added - pszName - the name of the attribtue - pszTargetURI - the URI in which the attribute should reside - pszValue - the value to put in the attribute - -Returns: - - S_OK on success, else - E_* on failure - ---*/ -{ - HRESULT hr = S_OK; - CComPtr<IXMLDOMAttribute> pCurrentAttr; - CComPtr<IXMLDOMNode> pCurrentNode; - - if( !( pTarget && pszName && pszValue ) ) - { - hr = E_INVALIDARG; - } - - if(SUCCEEDED(hr)) - { - VARIANT type; - VariantInit( &type ); - V_VT(&type) = VT_I4; - V_I4(&type) = NODE_ATTRIBUTE; - - hr = m_pPrintDocument->createNode(type, const_cast<BSTR>(pszName), const_cast<BSTR>(pszTargetURI), &pCurrentNode); - - VariantClear( &type ); - } - - if( SUCCEEDED(hr) ) - { - hr = pCurrentNode->QueryInterface( IID_IXMLDOMAttribute, (void**)&pCurrentAttr ); - } - - if( SUCCEEDED(hr) ) - { - VARIANT attrVal; - BSTR bstrValue = SysAllocString(pszValue); - - if( bstrValue ) - { - VariantInit(&attrVal); - V_VT(&attrVal) = VT_BSTR; - V_BSTR(&attrVal) = bstrValue; - hr = pCurrentAttr->put_value(attrVal); - - if( SUCCEEDED(hr) ) - { - hr = VariantClear(&attrVal); - } - else - { - VariantClear(&attrVal); - } - } - else - { - hr = E_OUTOFMEMORY; - } - } - - if( SUCCEEDED(hr) ) - { - hr = pTarget->setAttributeNode( pCurrentAttr, NULL ); - } - - return hr; -} - -HRESULT -CPSHandler::CreateXMLElement( - _In_ PCWSTR pszName, - _In_ PCWSTR pszTargetURI, - _Out_opt_ IXMLDOMElement **ppEl - ) -/*++ - -Routine Description: - - Create a new DOM element using the given QName and URI. Implemented using DOMDocument->CreateNode. - -Arguments: - - pszName - The QName of the element to be created - pszTargetUri - The namespace in which the created element lives. The - caller does not have control over the prefix... just the URI - ppEl - If the caller needs a pointer to the newly created node, this should - be a non-null - -Return Value: - - S_OK on success, - E_* on failure. Common values that would be expected - include E_OUTOFMEMORY, and E_INVALIDARG. - ---*/ -{ - HRESULT hr = S_OK; - CComPtr<IXMLDOMNode> pCurrentNode; - - if( !( pszName && pszTargetURI ) ) - { - hr = E_INVALIDARG; - } - - if(SUCCEEDED(hr)) - { - VARIANT type; - VariantInit( &type ); - V_VT(&type) = VT_I4; - V_I4(&type) = NODE_ELEMENT; - hr = m_pPrintDocument->createNode( type, const_cast<BSTR>(pszName), const_cast<BSTR>(pszTargetURI), &pCurrentNode ); - VariantClear( &type ); - } - - // - // Only give the client back the new value element if we succeed. - // - if( SUCCEEDED(hr) && ppEl ) - { - hr = pCurrentNode->QueryInterface( IID_IXMLDOMElement, (void**)ppEl ); - } - - return hr; -} diff --git a/print/XPSDrvSmpl/src/common/pshndlr.h b/print/XPSDrvSmpl/src/common/pshndlr.h deleted file mode 100644 index 22d76863..00000000 --- a/print/XPSDrvSmpl/src/common/pshndlr.h +++ /dev/null @@ -1,218 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -File Name: - - pshndlr.h - -Abstract: - - Base PrintSchema Document handler class definition. - This class provides common PrintTicket / PrintCapabilities handling functionality. - A class can derive from this base class to get PrintTicket/PrintCapabilities - unspecific XML handling functionality. - - Note: The PrintSchema handler code is only intended to work with the sdtandard - public PrintSchema keywords. - ---*/ - -#pragma once - -#include "schema.h" - -typedef vector< CComPtr<IXMLDOMElement> > PTDOMElementVector; - -class CPSHandler -{ -public: - // - // Constructors and destructors - // - CPSHandler( - _In_z_ BSTR bstrDocumentType, - _In_ IXMLDOMDocument2 *pPrintDocument - ); - - virtual ~CPSHandler(); - -public: - HRESULT - DeleteNode( - _In_ IXMLDOMNode* pNode - ); - - HRESULT - DeletePrivateFeatures( - _In_z_ BSTR bstrPrivateNS - ); - -protected: - HRESULT - QueryNode( - _In_z_ BSTR bstrQuery - ); - - HRESULT - QueryNodeValue( - _In_z_ BSTR bstrQuery, - _Outptr_ BSTR* pbstrValue - ); - - HRESULT - QueryNodeValue( - _In_z_ BSTR bstrQuery, - _Out_ REAL* pValue - ); - - HRESULT - QueryNodeValue( - _In_z_ BSTR bstrQuery, - _Out_ INT* pValue - ); - - HRESULT - GetNodeValue( - _In_z_ BSTR bstrNodeQuery, - _Inout_ _At_(*pbstrValue, _Pre_maybenull_) - _When_(return == S_FALSE, _At_(*pbstrValue, _Post_maybenull_)) - _When_(return != S_FALSE, _At_(*pbstrValue, _Post_valid_)) - BSTR* pbstrValue - ); - - HRESULT - GetAttributeValue( - _In_ CONST IXMLDOMNode* pNode, - _In_z_ BSTR bstrAttribName, - _Outptr_result_maybenull_ BSTR* pbstrResult - ); - - HRESULT - GetNodes( - _In_ BSTR bstrElementName, - _Outptr_ IXMLDOMNodeList** ppNodeList - ); - - HRESULT - CreateProperty( - _In_ CONST BSTR bstrPropName, - _Outptr_ IXMLDOMElement** ppPropElement - ); - - HRESULT - CreateProperty( - _In_ CONST BSTR bstrPropName, - _In_ CONST BSTR bstrType, - _In_ CONST BSTR bstrValue, - _Outptr_ IXMLDOMElement** ppPropElement - ); - - HRESULT - CreateFWProperty( - _In_ CONST BSTR bstrPropName, - _Outptr_ IXMLDOMElement** ppPropElement - ); - - HRESULT - CreateFWProperty( - _In_ CONST BSTR bstrPropName, - _In_ CONST BSTR bstrType, - _In_ CONST BSTR bstrValue, - _Outptr_ IXMLDOMElement** ppPropElement - ); - - HRESULT - CreateScoredProperty( - _In_ CONST BSTR bstrPropName, - _Outptr_ IXMLDOMElement** ppScoredPropElement - ); - - HRESULT - CreateScoredProperty( - _In_ CONST BSTR bstrPropName, - _In_ CONST BSTR bstrType, - _In_ CONST BSTR bstrValue, - _Outptr_ IXMLDOMElement** ppScoredPropElement - ); - - HRESULT - CreateScoredProperty( - _In_ CONST BSTR bstrPropName, - _In_ CONST BSTR bstrValue, - _Outptr_ IXMLDOMElement** ppScoredPropElement - ); - - HRESULT - CreateScoredProperty( - _In_ CONST BSTR bstrPropName, - _In_ CONST INT intValue, - _Outptr_ IXMLDOMElement** ppScoredPropElement - ); - - HRESULT - CreateScoredProperty( - _In_ CONST BSTR bstrPropName, - _In_ CONST REAL realValue, - _Outptr_ IXMLDOMElement** ppScoredPropElement - ); - - HRESULT - CreateScoredProperty( - _In_ CONST BSTR bstrPropName, - _In_ IXMLDOMNode* pValueNode, - _Outptr_ IXMLDOMElement** ppScoredPropElement - ); - - HRESULT - GetNode( - _In_z_ BSTR bstrNodeQuery, - _Outptr_ IXMLDOMNode** ppNode - ); - - HRESULT - CreateXMLAttribute( - _Inout_ IXMLDOMElement *pTarget, - _In_ PCWSTR pszName, - _In_opt_ PCWSTR pszTargetURI, - _In_ PCWSTR pszValue - ); - - HRESULT - CreateXMLElement( - _In_ PCWSTR pszName, - _In_ PCWSTR pszTargetURI, - _Out_opt_ IXMLDOMElement **ppEl - ); - -private: - - HRESULT - GetPrefixFromURI( - _In_z_ BSTR bstrNSURI, - _Outptr_result_maybenull_ BSTR* bstrNSPrefix - ); - -protected: - // - // Document and Type - // - CComPtr<IXMLDOMDocument2> m_pPrintDocument; - CComBSTR m_bstrDocumentType; - - // - // W3 namespace prefixes - // - CComBSTR m_bstrSchemaPrefix; - CComBSTR m_bstrSchemaInstPrefix; - - // - // Namespace abbreviations - // - CComBSTR m_bstrFrameworkPrefix; - CComBSTR m_bstrKeywordsPrefix; - CComBSTR m_bstrUserKeywordsPrefix; -}; - diff --git a/print/XPSDrvSmpl/src/common/psizedata.h b/print/XPSDrvSmpl/src/common/psizedata.h deleted file mode 100644 index aad375a4..00000000 --- a/print/XPSDrvSmpl/src/common/psizedata.h +++ /dev/null @@ -1,44 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - psizedata.h - -Abstract: - - PageMediaSize data structure definition. This provides a convenient - description of the PrintSchema PageMediaSize feature. - ---*/ - -#pragma once - -#include "psizeschema.h" - -namespace XDPrintSchema -{ - namespace PageMediaSize - { - struct PageMediaSizeData - { - PageMediaSizeData() : - pageWidth(215900), - pageHeight(279400) - { - } - - INT pageWidth; - INT pageHeight; - }; - } -} - diff --git a/print/XPSDrvSmpl/src/common/psizepthndlr.cpp b/print/XPSDrvSmpl/src/common/psizepthndlr.cpp deleted file mode 100644 index 893c16df..00000000 --- a/print/XPSDrvSmpl/src/common/psizepthndlr.cpp +++ /dev/null @@ -1,136 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - psizepthndlr.cpp - -Abstract: - - PageMediaSize PrintTicket handler implementation. Derived from CPTHandler, - this provides PageMediaSize specific Get method acting on the passed in - PrintTicket (as a DOM document). - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdexcept.h" -#include "psizepthndlr.h" - -using XDPrintSchema::PageMediaSize::PageMediaSizeData; -using XDPrintSchema::PageMediaSize::MediaSizeHeight; -using XDPrintSchema::PageMediaSize::MediaSizeWidth; -using XDPrintSchema::PageMediaSize::PAGESIZE_FEATURE; -using XDPrintSchema::PageMediaSize::PAGESIZE_PROPS; - -/*++ - -Routine Name: - - CPageSizePTHandler::CPageSizePTHandler - -Routine Description: - - CPageSizePTHandler class constructor - -Arguments: - - pPrintTicket - Pointer to the DOM document representation of the PrintTicket - -Return Value: - - None - ---*/ -CPageSizePTHandler::CPageSizePTHandler( - _In_ IXMLDOMDocument2* pPrintTicket - ) : - CPTHandler(pPrintTicket) -{ -} - -/*++ - -Routine Name: - - CPageSizePTHandler::~CPageSizePTHandler - -Routine Description: - - CPageSizePTHandler class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CPageSizePTHandler::~CPageSizePTHandler() -{ -} - -/*++ - -Routine Name: - - CPageSizePTHandler::GetData - -Routine Description: - - The routine fills the data structure passed in with page size data retrieved from - the PrintTicket passed to the class constructor. - -Arguments: - - pPageMediaSizeData - Pointer to the page size data structure to be filled in - -Return Value: - - HRESULT - S_OK - On success - E_ELEMENT_NOT_FOUND - Feature not present in PrintTicket - E_* - On error - ---*/ -HRESULT -CPageSizePTHandler::GetData( - _Out_ PageMediaSizeData* pPageMediaSizeData - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pPageMediaSizeData, E_POINTER))) - { - CComBSTR bstrPageSizeOption; - - // - // We don't actually need the pages size option name, just the dimensions - // - if (SUCCEEDED(hr = GetFeatureOption(CComBSTR(PAGESIZE_FEATURE), &bstrPageSizeOption)) && - SUCCEEDED(hr = GetScoredPropertyValue(CComBSTR(PAGESIZE_FEATURE), - CComBSTR(PAGESIZE_PROPS[MediaSizeWidth]), - &pPageMediaSizeData->pageWidth))) - { - hr = GetScoredPropertyValue(CComBSTR(PAGESIZE_FEATURE), - CComBSTR(PAGESIZE_PROPS[MediaSizeHeight]), - &pPageMediaSizeData->pageHeight); - } - } - - ERR_ON_HR_EXC(hr, E_ELEMENT_NOT_FOUND); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/common/psizepthndlr.h b/print/XPSDrvSmpl/src/common/psizepthndlr.h deleted file mode 100644 index 68e77fdb..00000000 --- a/print/XPSDrvSmpl/src/common/psizepthndlr.h +++ /dev/null @@ -1,45 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - psizepthndlr.h - -Abstract: - - PageMediaSize PrintTicket handling definition. The PageMediaSize PT handler - is used to extract PageMediaSize settings from a PrintTicket and populate - the PageMediaSize data structure with the retrieved settings. The class also - defines a method for setting the feature in the PrintTicket given the - data structure. - ---*/ - -#pragma once - -#include "pthndlr.h" -#include "psizedata.h" - -class CPageSizePTHandler : public CPTHandler -{ -public: - CPageSizePTHandler( - _In_ IXMLDOMDocument2* pPrintTicket - ); - - virtual ~CPageSizePTHandler(); - - HRESULT - GetData( - _Out_ XDPrintSchema::PageMediaSize::PageMediaSizeData* pPageMediaSizeData - ); -}; - diff --git a/print/XPSDrvSmpl/src/common/psizeschema.cpp b/print/XPSDrvSmpl/src/common/psizeschema.cpp deleted file mode 100644 index 448ccb2c..00000000 --- a/print/XPSDrvSmpl/src/common/psizeschema.cpp +++ /dev/null @@ -1,32 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - psizeschema.cpp - -Abstract: - - PageMediaSize PrintSchema implementation. This implements the features, - options and enumerations that describe the PrintSchema PageMediaSize feature. - ---*/ - -#include "precomp.h" -#include "psizeschema.h" - -LPCWSTR XDPrintSchema::PageMediaSize::PAGESIZE_FEATURE = L"PageMediaSize"; - -LPCWSTR XDPrintSchema::PageMediaSize::PAGESIZE_PROPS[] = { - L"MediaSizeWidth", - L"MediaSizeHeight" -}; - diff --git a/print/XPSDrvSmpl/src/common/psizeschema.h b/print/XPSDrvSmpl/src/common/psizeschema.h deleted file mode 100644 index 253846c7..00000000 --- a/print/XPSDrvSmpl/src/common/psizeschema.h +++ /dev/null @@ -1,55 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - psizeschema.h - -Abstract: - - PageMediaSize PrintSchema definition. This defines the features, options - and enumerations that describe the PrintSchema PageMediaSize feature within - a XDPrintSchema::PageMediaSize namespace. - ---*/ - -#pragma once - -#include "schema.h" - -namespace XDPrintSchema -{ - // - // PageMediaSize elements described as Printschema keywords - // - namespace PageMediaSize - { - // - // The feature name - // - extern LPCWSTR PAGESIZE_FEATURE; - - // - // We don't actually ever use the page size option names so they are - // omitted for brevity as there are many of them. - // - - enum EPageSizeProps - { - MediaSizeWidth = 0, EPageSizePropsMin = 0, - MediaSizeHeight, - EPageSizePropsMax - }; - - extern LPCWSTR PAGESIZE_PROPS[EPageSizePropsMax]; - } -} - diff --git a/print/XPSDrvSmpl/src/common/pthndlr.cpp b/print/XPSDrvSmpl/src/common/pthndlr.cpp deleted file mode 100644 index 61158c1f..00000000 --- a/print/XPSDrvSmpl/src/common/pthndlr.cpp +++ /dev/null @@ -1,1385 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -File Name: - - pthndlr.cpp - -Abstract: - - Base PrintTicket handler class implementation. This class provides common - PrintTicket handling functionality for any filter that requires print - ticket handling. A feature specific handler can derive from - this class to get feature unspecific XML handling functionality. - ---*/ - - -// -// Note on handling missing DOM nodes: -// -// Convert MSXML's S_FALSE to E_ELEMENT_NOT_FOUND. This allows clients to -// use the SUCCEEDED macro more effectively. -// -// E_ELEMENT_NOT_FOUND should not be propogated as an error to the -// filter pipeline or config module - treat as though the requested feature -// has not been enabled. -// - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "pthndlr.h" -#include "ptquerybld.h" - -using XDPrintSchema::PRINTTICKET_NAME; -using XDPrintSchema::PARAM_INIT_ELEMENT_NAME; -using XDPrintSchema::PARAM_REF_ELEMENT_NAME; -using XDPrintSchema::NAME_ATTRIBUTE_NAME; -using XDPrintSchema::VALUE_ELEMENT_NAME; -using XDPrintSchema::SCHEMA_TYPE; -using XDPrintSchema::SCHEMA_INTEGER; -using XDPrintSchema::FEATURE_ELEMENT_NAME; -using XDPrintSchema::OPTION_ELEMENT_NAME; -using XDPrintSchema::FRAMEWORK_URI; -using XDPrintSchema::SCHEMA_INST_URI; - -/*++ - -Routine Name: - - CPTHandler::CPTHandler - -Routine Description: - - CPTHandler class constructor - -Arguments: - - pPrintTicket - Pointer to the DOM document representation of the PrintTicket - -Return Value: - - None - - Note: Base Class (CPSHandler) - Throws CXDException(HRESULT) on an error - ---*/ -CPTHandler::CPTHandler( - _In_ IXMLDOMDocument2 *pDOMDocument - ) : - CPSHandler(CComBSTR(PRINTTICKET_NAME), pDOMDocument) -{ -} - -/*++ - -Routine Name: - - CPTHandler::~CPTHandler - -Routine Description: - - CPTHandler class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CPTHandler::~CPTHandler() -{ -} - -/*++ - -Routine Name: - - CPTHandler::DeleteFeature - -Routine Description: - - This routine finds and deletes the named feature - -Arguments: - - bstrFeature - the feature name to be deleted - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTHandler::DeleteFeature( - _In_z_ BSTR bstrFeature - ) -{ - HRESULT hr = S_OK; - - if (SysStringLen(bstrFeature) > 0) - { - // - // Find the feature node - // - CPTQueryBuilder propertyQuery(m_bstrFrameworkPrefix); - CComBSTR bstrQuery; - - CComPtr<IXMLDOMNode> pFeatureNode(NULL); - - if (SUCCEEDED(hr = propertyQuery.AddFeature(m_bstrKeywordsPrefix, bstrFeature)) && - SUCCEEDED(hr = propertyQuery.GetQuery(&bstrQuery))) - { - // - // Keep querying and deleting till all instances of the feature are - // removed - generally this should be a single instance - // - while (SUCCEEDED(hr) && - SUCCEEDED(hr = GetNode(bstrQuery, &pFeatureNode)) && - hr != S_FALSE) - { - // - // Delete the feature node and all children, then locate and delete - // all orphaned parameter init nodes - // - if (SUCCEEDED(hr = DeleteNode(pFeatureNode))) - { - // - // We need to delete all orphaned paramater init elements. Construct a - // list of parameter ref nodes and parameter init nodes and delete parameter - // init nodes that do not have a corresponding reference. - // - CComPtr<IXMLDOMNodeList> pInitList(NULL); - CComPtr<IXMLDOMNodeList> pRefList(NULL); - - if (SUCCEEDED(hr = GetNodes(CComBSTR(PARAM_INIT_ELEMENT_NAME), &pInitList)) && - hr != S_FALSE && - SUCCEEDED(hr = GetNodes(CComBSTR(PARAM_REF_ELEMENT_NAME), &pRefList)) && - hr != S_FALSE) - { - hr = DeleteParamInitOrphans(pRefList, pInitList); - } - } - - // - // Release the feature node for the next pass - // - pFeatureNode = NULL; - } - } - } - else - { - hr = E_INVALIDARG; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPTHandler::DeleteParamInitOrphans - -Routine Description: - - When a feature is deleted it may orphan a set of parameter init nodes. - This routine takes a list of parameter init nodes and a list of parameter - ref nodes and deletes the init nodes with no corresponding ref node. - -Arguments: - - pRefList - pointer to a node list containined the ref nodes - pInitList - pointer to a node list containined the init nodes - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTHandler::DeleteParamInitOrphans( - _In_ IXMLDOMNodeList* pRefList, - _Inout_ IXMLDOMNodeList* pInitList - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pRefList, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pInitList, E_POINTER))) - { - LONG cRefNodes = 0; - - if (SUCCEEDED(hr = pRefList->get_length(&cRefNodes)) && - cRefNodes == 0) - { - // - // There are no ref nodes - delete all init nodes - // - hr = DeleteNodeList(pInitList); - } - else - { - // - // Iterate over init list and search for a corresponding ref node - // - LONG cInitNodes = 0; - hr = pInitList->get_length(&cInitNodes); - - for (LONG cInitNode = 0; cInitNode < cInitNodes && SUCCEEDED(hr); cInitNode++) - { - CComPtr<IXMLDOMNode> pInitNode(NULL); - CComBSTR bstrInitName; - - if (SUCCEEDED(hr = pInitList->get_item(cInitNode, &pInitNode)) && - hr != S_FALSE && - SUCCEEDED(hr = GetAttributeValue(pInitNode, - CComBSTR(NAME_ATTRIBUTE_NAME), - &bstrInitName)) && - hr != S_FALSE && - SUCCEEDED(hr = pRefList->reset())) - { - // - // Iterate over the ref list tring to match - // - BOOL bMatched = FALSE; - - for (LONG cRefNode = 0; cRefNode < cRefNodes && SUCCEEDED(hr) && !bMatched; cRefNode++) - { - CComPtr<IXMLDOMNode> pRefNode(NULL); - CComBSTR bstrRefName; - if (SUCCEEDED(hr = pRefList->get_item(cRefNode, &pRefNode)) && - hr != S_FALSE && - SUCCEEDED(hr = GetAttributeValue(pRefNode, - CComBSTR(NAME_ATTRIBUTE_NAME), - &bstrRefName)) && - hr != S_FALSE) - { - if (bstrRefName == bstrInitName) - { - bMatched = TRUE; - } - } - } - - if (!bMatched) - { - // - // There were no matches - delete the init node - // - hr = DeleteNode(pInitNode); - } - } - } - } - } - - ERR_ON_HR(hr); - return hr; -} - - -/*++ - -Routine Name: - - CPTHandler::DeleteNodeList - -Routine Description: - - This routine deletes all nodes in a node list - -Arguments: - - pNodeList - the node list containing the nodes to be deleted - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTHandler::DeleteNodeList( - _Inout_ IXMLDOMNodeList* pNodeList - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pNodeList, E_POINTER))) - { - LONG cNodes = 0; - - hr = pNodeList->get_length(&cNodes); - - for (LONG cNode = 0; cNode < cNodes && SUCCEEDED(hr); cNode++) - { - CComPtr<IXMLDOMNode> pNode(NULL); - if (SUCCEEDED(hr = pNodeList->get_item(cNode, &pNode)) && - hr != S_FALSE) - { - hr = DeleteNode(pNode); - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPTHandler::DeleteProperty - -Routine Description: - - This routine finds and deletes the named property - -Arguments: - - bstrProperty - the property name to be deleted - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTHandler::DeleteProperty( - _In_z_ BSTR bstrProperty - ) -{ - HRESULT hr = S_OK; - - if (SysStringLen(bstrProperty) > 0) - { - // - // Find the property node - // - CPTQueryBuilder propertyQuery(m_bstrFrameworkPrefix); - CComBSTR bstrQuery; - - CComPtr<IXMLDOMNode> pPropertyNode(NULL); - - if (SUCCEEDED(hr = propertyQuery.AddProperty(m_bstrFrameworkPrefix, bstrProperty)) && - SUCCEEDED(hr = propertyQuery.GetQuery(&bstrQuery)) && - SUCCEEDED(hr = GetNode(bstrQuery, &pPropertyNode)) && - hr != S_FALSE) - { - // - // Delete the property node and all children - // - hr = DeleteNode(pPropertyNode); - } - } - else - { - hr = E_INVALIDARG; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPTHandler::QueryNodeOption - -Routine Description: - - This routine locates the node specified by the XPath query passed in and - returns the value of the "name" attribute as a string. The PrintSchema - keyword prefix is stripped from the result. - -Arguments: - - bstrQuery - The XPath query locating the node to retrieve the value for - pbstrOption - Pointer to a BSTR to recieve the option string - -Return Value: - - HRESULT - S_OK - On success - E_ELEMENT_NOT_FOUND - If node does not exist - E_* - On error - ---*/ -HRESULT -CPTHandler::QueryNodeOption( - _In_z_ BSTR bstrQuery, - _Outptr_result_maybenull_z_ BSTR* pbstrOption - ) -{ - HRESULT hr = S_OK; - - // - // Validate input parameters - // - if (SUCCEEDED(hr = CHECK_POINTER(pbstrOption, E_POINTER))) - { - *pbstrOption = NULL; - - if (SysStringLen(bstrQuery) <= 0) - { - hr = E_INVALIDARG; - } - } - - // - // Given a bare PrintSchema query, retrieve the selected option - // - if (SUCCEEDED(hr)) - { - CComPtr<IXMLDOMNode> pQueryNode(NULL); - - if (SUCCEEDED(hr = GetNode(bstrQuery, &pQueryNode)) && - hr != S_FALSE && - SUCCEEDED(hr = GetAttributeValue(pQueryNode, CComBSTR(NAME_ATTRIBUTE_NAME), pbstrOption)) && - hr != S_FALSE) - { - hr = StripKeywordNamespace(pbstrOption); - } - } - - if (hr == S_FALSE) - { - hr = E_ELEMENT_NOT_FOUND; - } - - ERR_ON_HR_EXC(hr, E_ELEMENT_NOT_FOUND); - return hr; -} - -/*++ - -Routine Name: - - CPTHandler::FeaturePresent - -Routine Description: - - This routine checks if the named feature is present in the PrintTicket - and optionally returns that node - -Arguments: - - bstrFeature - The feature name to be located - ppFeatureNode - optional paramter that recieves the node - -Return Value: - - HRESULT - S_OK - On success - E_ELEMENT_NOT_FOUND - If node does not exist - E_* - On error - ---*/ -HRESULT -CPTHandler::FeaturePresent( - _In_z_ BSTR bstrFeature, - _Outptr_opt_ IXMLDOMNode** ppFeatureNode - ) -{ - HRESULT hr = S_OK; - - // - // Validate input parameters - // - if (SysStringLen(bstrFeature) > 0) - { - // - // Find the feature node - // - CPTQueryBuilder propertyQuery(m_bstrFrameworkPrefix); - CComBSTR bstrQuery; - - CComPtr<IXMLDOMNode> pFeatureNode(NULL); - - if (SUCCEEDED(hr = propertyQuery.AddFeature(m_bstrKeywordsPrefix, bstrFeature)) && - SUCCEEDED(hr = propertyQuery.GetQuery(&bstrQuery))) - { - if (ppFeatureNode == NULL) - { - hr = GetNode(bstrQuery, &pFeatureNode); - } - else - { - hr = GetNode(bstrQuery, ppFeatureNode); - } - } - } - else - { - hr = E_INVALIDARG; - } - - if (hr == S_FALSE) - { - hr = E_ELEMENT_NOT_FOUND; - } - - ERR_ON_HR_EXC(hr, E_ELEMENT_NOT_FOUND); - return hr; -} - -/*++ - -Routine Name: - - CPTHandler::GetFeatureOption - -Routine Description: - - This routine retrieves the option set for the named feature passed in. - -Arguments: - - bstrFeature - The feature name to retrieve the option for - pbstrOption - Pointer to a BSTR to recieve the option - -Return Value: - - HRESULT - S_OK - On success - E_ELEMENT_NOT_FOUND - If node does not exist - E_* - On error - ---*/ -HRESULT -CPTHandler::GetFeatureOption( - _In_z_ BSTR bstrFeature, - _Outptr_result_maybenull_z_ BSTR* pbstrOption - ) -{ - HRESULT hr = S_OK; - - // - // Validate input parameters - // - if (SUCCEEDED(hr = CHECK_POINTER(pbstrOption, E_POINTER))) - { - if (SysStringLen(bstrFeature) <= 0) - { - hr = E_INVALIDARG; - } - } - - // - // Given a bare PrintSchema feature name, retrieve the selected option - // - if (SUCCEEDED(hr)) - { - // - // Find the feature option node - // - CPTQueryBuilder propertyQuery(m_bstrFrameworkPrefix); - CComBSTR bstrQuery; - - CComPtr<IXMLDOMNode> pOptionNode(NULL); - - if (SUCCEEDED(hr = propertyQuery.AddFeature(m_bstrKeywordsPrefix, bstrFeature)) && - SUCCEEDED(hr = propertyQuery.AddOption(m_bstrKeywordsPrefix)) && - SUCCEEDED(hr = propertyQuery.GetQuery(&bstrQuery)) && - SUCCEEDED(hr = GetNode(bstrQuery, &pOptionNode)) && - hr != S_FALSE) - { - // - // If this is a shorthand option then the option is stored in the "name" attribute - // - hr = GetAttributeValue(pOptionNode, CComBSTR(NAME_ATTRIBUTE_NAME), pbstrOption); - - if (hr == S_FALSE) - { - // - // This might be a longhand option in which case the node we have retrieved - // is pointing at a scored property the value of which is the option - // - CComVariant varValue; - if (SUCCEEDED(hr = pOptionNode->get_nodeTypedValue(&varValue)) && - hr != S_FALSE) - { - *pbstrOption = ::SysAllocString(varValue.bstrVal); - - if (*pbstrOption == NULL) - { - hr = E_OUTOFMEMORY; - } - } - } - - if (SUCCEEDED(hr) && - hr != S_FALSE) - { - hr = StripKeywordNamespace(pbstrOption); - } - } - } - - if (hr == S_FALSE) - { - hr = E_ELEMENT_NOT_FOUND; - } - - ERR_ON_HR_EXC(hr, E_ELEMENT_NOT_FOUND); - return hr; -} - -/*++ - -Routine Name: - - CPTHandler::GetSubFeatureOption - -Routine Description: - - This routine retrieves the current option for a sub feature. The routine - finds the named parent feature, then the sub-feature and retrieves the - option that is set. - -Arguments: - - bstrParentFeature - The parent feature name - bstrFeature - The sub-feature name - pbstrOption - Pointer to a BSTR to recieve the option - -Return Value: - - HRESULT - S_OK - On success - E_ELEMENT_NOT_FOUND - If node does not exist - E_* - On error - ---*/ -HRESULT -CPTHandler::GetSubFeatureOption( - _In_z_ BSTR bstrParentFeature, - _In_z_ BSTR bstrFeature, - _Outptr_result_maybenull_z_ BSTR* pbstrOption - ) -{ - HRESULT hr = S_OK; - - // - // Validate input parameters - // - if (SUCCEEDED(hr = CHECK_POINTER(pbstrOption, E_POINTER))) - { - *pbstrOption = NULL; - - if (SysStringLen(bstrFeature) <= 0 || - SysStringLen(bstrParentFeature) <= 0) - { - hr = E_INVALIDARG; - } - } - - // - // Given a bare PrintSchema feature name, retrieve the selected option - // - if (SUCCEEDED(hr)) - { - // - // Find the sub feature option node - // - CPTQueryBuilder propertyQuery(m_bstrFrameworkPrefix); - CComBSTR bstrQuery; - - CComPtr<IXMLDOMNode> pFeatureNode(NULL); - - if (SUCCEEDED(hr = propertyQuery.AddFeature(m_bstrKeywordsPrefix, bstrParentFeature)) && - SUCCEEDED(hr = propertyQuery.AddFeature(m_bstrKeywordsPrefix, bstrFeature)) && - SUCCEEDED(hr = propertyQuery.AddOption(m_bstrKeywordsPrefix)) && - SUCCEEDED(hr = propertyQuery.GetQuery(&bstrQuery)) && - SUCCEEDED(hr = GetNode(bstrQuery, &pFeatureNode)) && - hr != S_FALSE && - SUCCEEDED(hr = GetAttributeValue(pFeatureNode, CComBSTR(NAME_ATTRIBUTE_NAME), pbstrOption)) && - hr != S_FALSE) - { - hr = StripKeywordNamespace(pbstrOption); - } - } - - if (hr == S_FALSE) - { - hr = E_ELEMENT_NOT_FOUND; - } - - ERR_ON_HR_EXC(hr, E_ELEMENT_NOT_FOUND); - return hr; -} - -/*++ - -Routine Name: - - CPTHandler::GetScoredPropertyValue - -Routine Description: - - This routine retrieves the scored property value as a string for a given feature. - -Arguments: - - bstrParentFeature - The parent feature name - bstrProperty - The scored property name - pbstrValue - Pointer to a BSTR to recieve the scored property value - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTHandler::GetScoredPropertyValue( - _In_z_ BSTR bstrParentFeature, - _In_z_ BSTR bstrProperty, - _Outptr_result_maybenull_ BSTR* pbstrValue - ) -{ - HRESULT hr = S_OK; - - // - // Validate input parameters - // - if (SUCCEEDED(hr = CHECK_POINTER(pbstrValue, E_POINTER))) - { - *pbstrValue = NULL; - - if (SysStringLen(bstrProperty) <= 0 || - SysStringLen(bstrParentFeature) <= 0) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - // - // Get the scored property value - // - CPTQueryBuilder propertyQuery(m_bstrFrameworkPrefix); - CComBSTR bstrQuery; - - if (SUCCEEDED(hr = propertyQuery.AddFeature(m_bstrKeywordsPrefix, bstrParentFeature)) && - SUCCEEDED(hr = propertyQuery.AddScoredProperty(m_bstrKeywordsPrefix, bstrProperty)) && - SUCCEEDED(hr = propertyQuery.GetQuery(&bstrQuery))) - { - hr = GetNodeValue(bstrQuery, pbstrValue); - } - } - - if (hr == S_FALSE) - { - hr = E_ELEMENT_NOT_FOUND; - } - - ERR_ON_HR_EXC(hr, E_ELEMENT_NOT_FOUND); - return hr; -} - -/*++ - -Routine Name: - - CPTHandler::GetScoredPropertyValue - -Routine Description: - - This routine retrieves the integer value of a scored property from a named - feature - -Arguments: - - bstrParentFeature - The name of the parent feature - bstrProperty - The name of the scored property to retrieve the value of - pValue - Pointer to an INT that recieves the property value - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTHandler::GetScoredPropertyValue( - _In_z_ BSTR bstrParentFeature, - _In_z_ BSTR bstrProperty, - _Out_ INT* pValue - ) -{ - HRESULT hr = S_OK; - - CComBSTR bstrValue; - if (SUCCEEDED(hr = CHECK_POINTER(pValue, E_POINTER))) - { - if (SysStringLen(bstrParentFeature) <= 0 || - SysStringLen(bstrProperty) <= 0) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = GetScoredPropertyValue(bstrParentFeature, bstrProperty, &bstrValue))) - { - *pValue = static_cast<INT>(_wtoi(bstrValue)); - } - - ERR_ON_HR_EXC(hr, E_ELEMENT_NOT_FOUND); - return hr; -} - -/*++ - -Routine Name: - - CPTHandler::GetScoredPropertyValue - -Routine Description: - - This routine retrieves the REAL value of a scored property from a named - feature - -Arguments: - - bstrParentFeature - The name of the parent feature - bstrProperty - The name of the scored property to retrieve the value of - pValue - Pointer to a REAL that recieves the property value - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTHandler::GetScoredPropertyValue( - _In_z_ BSTR bstrParentFeature, - _In_z_ BSTR bstrProperty, - _Out_ REAL* pValue - ) -{ - HRESULT hr = S_OK; - - CComBSTR bstrValue; - if (SUCCEEDED(hr = CHECK_POINTER(pValue, E_POINTER))) - { - if (SysStringLen(bstrParentFeature) <= 0 || - SysStringLen(bstrProperty) <= 0) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = GetScoredPropertyValue(bstrParentFeature, bstrProperty, &bstrValue))) - { - *pValue = static_cast<REAL>(_wtof(bstrValue)); - } - - ERR_ON_HR_EXC(hr, E_ELEMENT_NOT_FOUND); - return hr; -} - -/*++ - -Routine Name: - - CPTHandler::StripKeywordNamespace - -Routine Description: - - This routine strips the PrintSchema keyword namespace prefix from a value - -Arguments: - - pbstrValue - Pointer to the value string to have the prefix stripped - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTHandler::StripKeywordNamespace( - _Inout_ BSTR* pbstrValue - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrValue, E_POINTER))) - { - if (SysStringLen(*pbstrValue) <= 0) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - try - { - CStringXDW cstrStrippedName(*pbstrValue); - - INT cchStringStart = cstrStrippedName.Find(m_bstrKeywordsPrefix); - size_t cchKWPrefix = 0; - if (cchStringStart != -1 && - SUCCEEDED(hr = StringCchLength(m_bstrKeywordsPrefix, STRSAFE_MAX_CCH, &cchKWPrefix))) - { - cstrStrippedName.Delete(cchStringStart, static_cast<INT>(cchKWPrefix)); - SysFreeString(*pbstrValue); - *pbstrValue = cstrStrippedName.AllocSysString(); - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPTHandler::CreateParamRefInitPair - -Routine Description: - - This routine create a pair of DOM elements corresponding to the ParameterRef and - the ParameterInit that describe a ScoredProperty value. - -Arguments: - - bstrParam - The name of the property - bstrType - The type of the value (string, integer etc.) - bstrValue - The value of the property - ppParamRef - Pointer to a IXMLDOMElement pointer that recives the new ParameterRef - ppParamInit - Pointer to a IXMLDOMElement pointer that recives the new ParameterInit - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTHandler::CreateParamRefInitPair( - _In_ CONST BSTR bstrParam, - _In_ CONST BSTR bstrType, - _In_ CONST BSTR bstrValue, - _Outptr_ IXMLDOMElement** ppParamRef, - _Outptr_ IXMLDOMElement** ppParamInit - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppParamRef, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(ppParamInit, E_POINTER))) - { - *ppParamRef = NULL; - *ppParamInit = NULL; - - if (SysStringLen(bstrParam) <= 0 || - SysStringLen(bstrType) <= 0 || - SysStringLen(bstrValue) <= 0) - { - hr = E_INVALIDARG; - } - } - - CComPtr<IXMLDOMElement> pParamInit(NULL); - CComPtr<IXMLDOMElement> pParamRef(NULL); - - if (SUCCEEDED(hr)) - { - CComBSTR bstrPRefName; - if (wcscmp(bstrParam, L"PageWatermarkSizeWidth") == 0 || - wcscmp(bstrParam, L"PageWatermarkSizeHeight") == 0) - { - bstrPRefName += m_bstrUserKeywordsPrefix; - } - else - { - bstrPRefName += m_bstrKeywordsPrefix; - } - - bstrPRefName += bstrParam; - - // - // Create the parameter ref element - // - CComBSTR bstrTagName(m_bstrFrameworkPrefix); - bstrTagName += PARAM_REF_ELEMENT_NAME; - - if(SUCCEEDED(hr)) - { - hr = CreateXMLElement(bstrTagName, FRAMEWORK_URI, &pParamRef); - } - - if (SUCCEEDED(hr)) - { - hr = CreateXMLAttribute(pParamRef, NAME_ATTRIBUTE_NAME, NULL, bstrPRefName ); - } - - // - // Create the parameter init element - // - bstrTagName.Empty(); - bstrTagName += m_bstrFrameworkPrefix; - bstrTagName += PARAM_INIT_ELEMENT_NAME; - - if(SUCCEEDED(hr)) - { - hr = CreateXMLElement(bstrTagName, FRAMEWORK_URI, &pParamInit); - } - - if (SUCCEEDED(hr)) - { - hr = CreateXMLAttribute(pParamInit, NAME_ATTRIBUTE_NAME, NULL, bstrPRefName ); - } - - // - // Create the parameter init value and add to the parameter init element - // - CComPtr<IXMLDOMElement> pValue(NULL); - - bstrTagName.Empty(); - bstrTagName += m_bstrFrameworkPrefix; - bstrTagName += VALUE_ELEMENT_NAME; - - CComBSTR bstrAttrib(m_bstrSchemaInstPrefix); - bstrAttrib += SCHEMA_TYPE; - - CComBSTR bstrAttribValue(m_bstrSchemaPrefix); - bstrAttribValue += bstrType; - - if(SUCCEEDED(hr)) - { - hr = CreateXMLElement(bstrTagName, FRAMEWORK_URI, &pValue); - } - - if (SUCCEEDED(hr)) - { - if( SUCCEEDED(hr = CreateXMLAttribute(pValue, bstrAttrib, SCHEMA_INST_URI, bstrAttribValue )) && - SUCCEEDED(hr = pValue->put_text(bstrValue))) - { - hr = pParamInit->appendChild(pValue, NULL); - } - } - } - - if (SUCCEEDED(hr)) - { - // - // Assign the outgoing element pointers - detach from CComPtr to release ownership - // - *ppParamRef = pParamRef.Detach(); - *ppParamInit = pParamInit.Detach(); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPTHandler::CreateParamRefInitPair - -Routine Description: - - This routine create a pair of DOM elements corresponding to the ParameterRef and - the ParameterInit that describe a ScoredProperty value. This overload is INT specific - -Arguments: - - bstrParam - The name of the property - intValue - The integer value of the scored property - ppParamRef - Pointer to a IXMLDOMElement pointer that recives the new ParameterRef - ppParamInit - Pointer to a IXMLDOMElement pointer that recives the new ParameterInit - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTHandler::CreateParamRefInitPair( - _In_ CONST BSTR bstrParam, - _In_ CONST INT intValue, - _Outptr_ IXMLDOMElement** ppParamRef, - _Outptr_ IXMLDOMElement** ppParamInit - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppParamRef, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(ppParamInit, E_POINTER))) - { - if (SysStringLen(bstrParam) <= 0) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - try - { - CStringXDW cstrValue; - cstrValue.Format(L"%i", intValue); - - hr = CreateParamRefInitPair(bstrParam, - CComBSTR(SCHEMA_INTEGER), - CComBSTR(cstrValue.AllocSysString()), - ppParamRef, - ppParamInit); - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPTHandler::CreateFeatureOptionPair - -Routine Description: - - This routine create a pair of DOM elements corresponding to Feature and Option. - Note this method does not intialise the option element, it merely creates an Option - node appended to the Feature element. It is up to the caller to set the option value. - -Arguments: - - bstrFeatureName - The name of the feature - ppFeatureElement - Pointer to a IXMLDOMElement pointer that recives the new Feature - ppOptionElement - Pointer to a IXMLDOMElement pointer that recives the new Option - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTHandler::CreateFeatureOptionPair( - _In_ CONST BSTR bstrFeatureName, - _Outptr_ IXMLDOMElement** ppFeatureElement, - _Outptr_ IXMLDOMElement** ppOptionElement - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppFeatureElement, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(ppOptionElement, E_POINTER))) - { - *ppFeatureElement = NULL; - *ppOptionElement = NULL; - - if (SysStringLen(bstrFeatureName) <= 0) - { - hr = E_INVALIDARG; - } - } - else - { - hr = E_POINTER; - } - - if (SUCCEEDED(hr)) - { - CComBSTR bstrFeature(m_bstrFrameworkPrefix); - bstrFeature += FEATURE_ELEMENT_NAME; - - CComBSTR bstrAttribName(m_bstrKeywordsPrefix); - bstrAttribName += bstrFeatureName; - - CComBSTR bstrOption(m_bstrFrameworkPrefix); - bstrOption += OPTION_ELEMENT_NAME; - - if(SUCCEEDED(hr)) - { - hr = CreateXMLElement(bstrFeature, FRAMEWORK_URI, ppFeatureElement); - } - - if(SUCCEEDED(hr)) - { - hr = CreateXMLElement(bstrOption, FRAMEWORK_URI, ppOptionElement); - } - - if(SUCCEEDED(hr)) - { - if (SUCCEEDED(hr = CreateXMLAttribute(*ppFeatureElement, NAME_ATTRIBUTE_NAME, NULL, bstrAttribName ))) - { - hr = (*ppFeatureElement)->appendChild(*ppOptionElement, NULL); - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPTHandler::CreateFeatureOptionPair - -Routine Description: - - This routine create a pair of DOM elements corresponding to Feature and Option. - -Arguments: - - bstrFeatureName - The name of the feature - bstrOptionName - The name of the option - ppFeatureElement - Pointer to a IXMLDOMElement pointer that recives the new Feature - ppOptionElement - Pointer to a IXMLDOMElement pointer that recives the new Option - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTHandler::CreateFeatureOptionPair( - _In_ CONST BSTR bstrFeatureName, - _In_ CONST BSTR bstrOptionName, - _Outptr_ IXMLDOMElement** ppFeatureElement, - _Outptr_ IXMLDOMElement** ppOptionElement - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppFeatureElement, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(ppOptionElement, E_POINTER))) - { - if (SysStringLen(bstrFeatureName) <= 0 || - SysStringLen(bstrOptionName) <= 0) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - if (SUCCEEDED(hr = CreateFeatureOptionPair(bstrFeatureName, ppFeatureElement, ppOptionElement))) - { - // - // Set the option name attribute - // - CComBSTR bstrAttribValue(m_bstrKeywordsPrefix); - bstrAttribValue += bstrOptionName; - - hr = CreateXMLAttribute(*ppOptionElement, NAME_ATTRIBUTE_NAME, NULL, bstrAttribValue ); - - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPTHandler::AppendToElement - -Routine Description: - - This routine uses the passed element name to locate the node to which - it will append the DOM node passed in. - -Arguments: - - bstrElementName - The name of the element to append to - pAppendNode - The node to append - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTHandler::AppendToElement( - _In_ CONST BSTR bstrElementName, - _In_ IXMLDOMNode* pAppendNode - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pAppendNode, E_POINTER))) - { - if (SysStringLen(bstrElementName) <= 0) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - CComPtr<IXMLDOMNode> pNode(NULL); - - CComBSTR bstrQuery(m_bstrFrameworkPrefix); - bstrQuery += bstrElementName; - - if (SUCCEEDED(hr = GetNode(bstrQuery, &pNode))) - { - hr = pNode->appendChild(pAppendNode, NULL); - } - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/common/pthndlr.h b/print/XPSDrvSmpl/src/common/pthndlr.h deleted file mode 100644 index e8bd8a08..00000000 --- a/print/XPSDrvSmpl/src/common/pthndlr.h +++ /dev/null @@ -1,178 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -File Name: - - pthndlr.h - -Abstract: - - Base PrintTicket handler class definition. This class provides common - PrintTicket handling functionality for any filter that requires print - ticket handling. A filter can from this class to get feature unspecific - XML handling functionality. - ---*/ - -#pragma once - -#include "schema.h" -#include "pshndlr.h" - -class CPTHandler : public CPSHandler -{ -public: - // - // Constructors and destructors - // - CPTHandler( - _In_ IXMLDOMDocument2 *pPrintTicket - ); - - virtual ~CPTHandler(); - -public: - HRESULT - DeleteFeature( - _In_z_ BSTR bstrFeature - ); - - HRESULT - DeleteProperty( - _In_z_ BSTR bstrProperty - ); - -protected: - HRESULT - QueryNodeOption( - _In_z_ BSTR bstrQuery, - _Outptr_result_maybenull_z_ BSTR* pbstrOption - ); - - HRESULT - FeaturePresent( - _In_z_ BSTR bstrFeature, - _Outptr_opt_ IXMLDOMNode** ppFeatureNode = NULL - ); - - HRESULT - GetFeatureOption( - _In_z_ BSTR bstrFeature, - _Outptr_result_maybenull_z_ BSTR* pbstrOption - ); - - HRESULT - GetSubFeatureOption( - _In_z_ BSTR bstrParentFeature, - _In_z_ BSTR bstrFeature, - _Outptr_result_maybenull_z_ BSTR* pbstrOption - ); - - HRESULT - GetScoredPropertyValue( - _In_z_ BSTR bstrParentFeature, - _In_z_ BSTR bstrProperty, - _Outptr_result_maybenull_ BSTR* pbstrValue - ); - - HRESULT - GetScoredPropertyValue( - _In_z_ BSTR bstrParentFeature, - _In_z_ BSTR bstrProperty, - _Out_ INT* pValue - ); - - HRESULT - GetScoredPropertyValue( - _In_z_ BSTR bstrParentFeature, - _In_z_ BSTR bstrProperty, - _Out_ REAL* pValue - ); - - HRESULT - SetFeatureOption( - _In_z_ BSTR bstrFeature, - _In_z_ BSTR bstrOption - ); - - HRESULT - SetSubFeatureOption( - _In_z_ BSTR bstrParentFeature, - _In_z_ BSTR bstrFeature, - _In_z_ BSTR bstrOption - ); - - HRESULT - SetPropertyAsValue( - _In_z_ BSTR bstrFeature, - _In_z_ BSTR bstrProperty, - _In_z_ BSTR bstrValue - ); - - HRESULT - SetPropertyAsParameterRef( - _In_z_ BSTR bstrFeature, - _In_z_ BSTR bstrProperty, - _In_z_ BSTR bstrParameterRef, - _In_z_ BSTR bstrValue - ); - - HRESULT - CreateParamRefInitPair( - _In_ CONST BSTR bstrParam, - _In_ CONST BSTR bstrType, - _In_ CONST BSTR bstrValue, - _Outptr_ IXMLDOMElement** ppParamRef, - _Outptr_ IXMLDOMElement** ppParamInit - ); - - HRESULT - CreateParamRefInitPair( - _In_ CONST BSTR bstrParam, - _In_ CONST INT intValue, - _Outptr_ IXMLDOMElement** ppParamRef, - _Outptr_ IXMLDOMElement** ppParamInit - ); - - HRESULT - CreateFeatureOptionPair( - _In_ CONST BSTR bstrFeatureName, - _Outptr_ IXMLDOMElement** ppFeatureElement, - _Outptr_ IXMLDOMElement** ppOptionElement - ); - - HRESULT - CreateFeatureOptionPair( - _In_ CONST BSTR bstrFeatureName, - _In_ CONST BSTR bstrOptionName, - _Outptr_ IXMLDOMElement** ppFeatureElement, - _Outptr_ IXMLDOMElement** ppOptionElement - ); - - HRESULT - AppendToElement( - _In_ CONST BSTR bstrElementName, - _In_ IXMLDOMNode* pAppendNode - ); - -private: - HRESULT - StripKeywordNamespace( - _Inout_ BSTR* pbstrValue - ); - - HRESULT - DeleteNodeList( - _Inout_ IXMLDOMNodeList* pNodeList - ); - - HRESULT - DeleteParamInitOrphans( - _In_ IXMLDOMNodeList* pRefList, - _Inout_ IXMLDOMNodeList* pInitList - ); -}; - diff --git a/print/XPSDrvSmpl/src/common/ptquerybld.cpp b/print/XPSDrvSmpl/src/common/ptquerybld.cpp deleted file mode 100644 index cc7faa8a..00000000 --- a/print/XPSDrvSmpl/src/common/ptquerybld.cpp +++ /dev/null @@ -1,516 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - ptquerybld.cpp - -Abstract: - - PrintTicket XPath query builder implementation. The CPTQueryBuilder class - provides a means of constructing PrintTicket specific XPath queries for - retrieving nodes from within the DOM document describing the PrintTicket. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "ptquerybld.h" - -// -// XML PrintTicket Query Builder Format Strings -// -static PCWSTR szPTQFeature = L"//%sFeature[@name = \"%s\"]"; -static PCWSTR szPTQProperty = L"//%sProperty[@name = \"%s\"]"; -static PCWSTR szPTQScoredProperty = L"//%sScoredProperty[@name = \"%s\"]"; -static PCWSTR szPTQParamRef = L"//%sParameterRef[@name = \"%s\"]"; -static PCWSTR szPTQOptionSH = L"/%sOption"; -static PCWSTR szPTQOptionLH = L"/%sScoredProperty[@name = \"%sOptionName\"]/%sValue"; -static PCWSTR szPTQOrNodes = L" | "; - -/*++ - -Routine Name: - - CPTQueryBuilder::CPTQueryBuilder - -Routine Description: - - CPTQueryBuilder class default constructor - -Arguments: - - bstrFrameworkNS - PrintTicket framework namespace prefix - -Return Value: - - None - ---*/ -CPTQueryBuilder::CPTQueryBuilder( - _In_z_ BSTR bstrFrameworkNS - ) : - m_bstrFrameworkNS(bstrFrameworkNS) -{ -} - -/*++ - -Routine Name: - - CPTQueryBuilder::CPTQueryBuilder - -Routine Description: - - CPTQueryBuilder class constructor - -Arguments: - - bstrFrameworkNS - PrintTicket framework namespace prefix - bstrQuery - String containing base query to use on construction. - -Return Value: - - None - ---*/ -CPTQueryBuilder::CPTQueryBuilder( - _In_z_ BSTR bstrFrameworkNS, - _In_z_ BSTR bstrQuery - ) : - m_bstrFrameworkNS(bstrFrameworkNS), - m_bstrQuery(bstrQuery) -{ -} - -/*++ - -Routine Name: - - CPTQueryBuilder::~CPTQueryBuilder - -Routine Description: - - CPTQueryBuilder class destructor. - -Arguments: - - None - -Return Value: - - None - ---*/ -CPTQueryBuilder::~CPTQueryBuilder( - ) -{ -} - -/*++ - -Routine Name: - - CPTQueryBuilder::Clear - -Routine Description: - - Clears the current query string. - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTQueryBuilder::Clear( - VOID - ) -{ - m_bstrQuery.Empty(); - - return S_OK; -} - -/*++ - -Routine Name: - - CPTQueryBuilder::GetQuery - -Routine Description: - - Makes a copy of the current query string and returns it to the caller. - -Arguments: - - bstrQuery - Address of a pointer that will be modified to point to a string - that is filled out with a copy of the current query. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTQueryBuilder::GetQuery( - _Inout_ _At_(*pbstrQuery, _Pre_maybenull_ _Post_valid_) BSTR* pbstrQuery - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrQuery, E_POINTER))) - { - SysFreeString(*pbstrQuery); - hr = m_bstrQuery.CopyTo(pbstrQuery); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPTQueryBuilder::AddFeature - -Routine Description: - - Appends a feature query to the query builder class. - -Arguments: - - bstrKeywordNS - Optional parameter defining the keyword namespace to prefix. - bstrFeature - Pointer to a string defining the feature name to be appended. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTQueryBuilder::AddFeature( - _In_opt_z_ BSTR bstrKeywordNS, - _In_z_ BSTR bstrFeature - ) -{ - HRESULT hr = S_OK; - - if (m_bstrFrameworkNS.Length() > 0) - { - try - { - CComBSTR bstrKeyword; - - if (SysStringLen(bstrKeywordNS) > 0) - { - hr = bstrKeyword.Append(bstrKeywordNS); - } - - if (SUCCEEDED(hr)) - { - hr = bstrKeyword.Append(bstrFeature); - } - - if (SUCCEEDED(hr)) - { - CStringXDW cstrFeatureQuery; - cstrFeatureQuery.Format(szPTQFeature, static_cast<LPCWSTR>(m_bstrFrameworkNS), static_cast<LPCWSTR>(bstrKeyword)); - - hr = m_bstrQuery.Append(cstrFeatureQuery); - } - } - catch (CXDException& e) - { - hr = e; - } - } - else - { - hr = E_FAIL; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPTQueryBuilder::AddProperty - -Routine Description: - - Appends a property query to the query builder class. - -Arguments: - - bstrKeywordNS - Optional parameter defining the keyword namespace to prefix. - bstrProperty - Pointer to a string defining the property name to be appended. - - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTQueryBuilder::AddProperty( - _In_opt_z_ BSTR bstrKeywordNS, - _In_z_ BSTR bstrProperty - ) -{ - HRESULT hr = S_OK; - - if (m_bstrFrameworkNS.Length() > 0) - { - try - { - CComBSTR bstrKeyword; - - if (SysStringLen(bstrKeywordNS) > 0) - { - hr = bstrKeyword.Append(bstrKeywordNS); - } - - if (SUCCEEDED(hr)) - { - hr = bstrKeyword.Append(bstrProperty); - } - - if (SUCCEEDED(hr)) - { - CStringXDW cstrPropertyQuery; - cstrPropertyQuery.Format(szPTQProperty, static_cast<LPCWSTR>(m_bstrFrameworkNS), static_cast<LPCWSTR>(bstrKeyword)); - - hr = m_bstrQuery.Append(cstrPropertyQuery); - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPTQueryBuilder::AddScoredProperty - -Routine Description: - - Appends a scored property query to the query builder class. - -Arguments: - - bstrKeywordNS - Optional parameter defining the keyword namespace to prefix. - bstrScoredProperty - Pointer to a string defining the scored property name to be appended. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTQueryBuilder::AddScoredProperty( - _In_opt_z_ BSTR bstrKeywordNS, - _In_z_ BSTR bstrScoredProperty - ) -{ - HRESULT hr = S_OK; - - if (m_bstrFrameworkNS.Length() > 0) - { - try - { - CComBSTR bstrKeyword; - - if (SysStringLen(bstrKeywordNS) > 0) - { - hr = bstrKeyword.Append(bstrKeywordNS); - } - - if (SUCCEEDED(hr)) - { - hr = bstrKeyword.Append(bstrScoredProperty); - } - - if (SUCCEEDED(hr)) - { - CStringXDW cstrScoredPropertyQuery; - cstrScoredPropertyQuery.Format(szPTQScoredProperty, static_cast<LPCWSTR>(m_bstrFrameworkNS), static_cast<LPCWSTR>(bstrKeyword)); - - hr = m_bstrQuery.Append(cstrScoredPropertyQuery); - } - } - catch (CXDException& e) - { - hr = e; - } - } - else - { - hr = E_FAIL; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPTQueryBuilder::AddScoredProperty - -Routine Description: - - Appends a Parameter Reference query to the query builder class. - -Arguments: - - bstrKeywordNS - Optional parameter defining the keyword namespace to prefix. - bstrScoredProperty - Pointer to a string defining the scored property name to be appended. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTQueryBuilder::AddParamRef( - _In_opt_z_ BSTR bstrKeywordNS, - _In_z_ BSTR bstrParameterRef - ) -{ - HRESULT hr = S_OK; - - if (m_bstrFrameworkNS.Length() > 0) - { - try - { - CComBSTR bstrKeyword; - - if (SysStringLen(bstrKeywordNS) > 0) - { - hr = bstrKeyword.Append(bstrKeywordNS); - } - - if (SUCCEEDED(hr)) - { - hr = bstrKeyword.Append(bstrParameterRef); - } - - if (SUCCEEDED(hr)) - { - CStringXDW cstrParamRefQuery; - cstrParamRefQuery.Format(szPTQParamRef, static_cast<LPCWSTR>(m_bstrFrameworkNS), static_cast<LPCWSTR>(bstrKeyword)); - - hr = m_bstrQuery.Append(cstrParamRefQuery); - } - } - catch (CXDException& e) - { - hr = e; - } - } - else - { - hr = E_FAIL; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPTQueryBuilder::AddOption - -Routine Description: - - Appends the option query to the query builder class. - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTQueryBuilder::AddOption( - _In_opt_z_ BSTR bstrKeywordNS - ) -{ - HRESULT hr = S_OK; - - if (m_bstrFrameworkNS.Length() > 0) - { - try - { - CStringXDW cstrQueryRoot(m_bstrQuery); - CStringXDW cstrOptionQuery; - cstrOptionQuery.Format(szPTQOptionSH, static_cast<LPCWSTR>(m_bstrFrameworkNS)); - - if (SUCCEEDED(hr = m_bstrQuery.Append(cstrOptionQuery)) && - SUCCEEDED(hr = m_bstrQuery.Append(szPTQOrNodes)) && - SUCCEEDED(hr = m_bstrQuery.Append(cstrQueryRoot))) - { - cstrOptionQuery.Format(szPTQOptionLH, static_cast<LPCWSTR>(m_bstrFrameworkNS), - static_cast<LPCWSTR>(bstrKeywordNS), static_cast<LPCWSTR>(m_bstrFrameworkNS)); - hr = m_bstrQuery.Append(cstrOptionQuery); - } - } - catch (CXDException& e) - { - hr = e; - } - } - else - { - hr = E_FAIL; - } - - ERR_ON_HR(hr); - return hr; -} diff --git a/print/XPSDrvSmpl/src/common/ptquerybld.h b/print/XPSDrvSmpl/src/common/ptquerybld.h deleted file mode 100644 index a82172ea..00000000 --- a/print/XPSDrvSmpl/src/common/ptquerybld.h +++ /dev/null @@ -1,84 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - ptquerybld.h - -Abstract: - - PrintTicket XPath query builder definition. The CPTQueryBuilder class - provides a means of constructing PrintTicket specific XPath queries for - retrieving nodes from within the DOM document describing the PrintTicket. - ---*/ - -#pragma once - -class CPTQueryBuilder -{ -public: - CPTQueryBuilder( - _In_z_ BSTR bstrFrameworkNS - ); - - CPTQueryBuilder( - _In_z_ BSTR bstrFrameworkNS, - _In_z_ BSTR bstrQuery - ); - - virtual ~CPTQueryBuilder(); - - HRESULT - Clear( - VOID - ); - - HRESULT - GetQuery( - _Inout_ _At_(*pbstrQuery, _Pre_maybenull_ _Post_valid_) BSTR* pbstrQuery - ); - - HRESULT - AddFeature( - _In_opt_z_ BSTR bstrKeywordNS, - _In_z_ BSTR bstrPropertyName - ); - - HRESULT - AddProperty( - _In_opt_z_ BSTR bstrKeywordNS, - _In_z_ BSTR bstrPropertyName - ); - - HRESULT - AddScoredProperty( - _In_opt_z_ BSTR bstrKeywordNS, - _In_z_ BSTR bstrPropertyName - ); - - HRESULT - AddParamRef( - _In_opt_z_ BSTR bstrKeywordNS, - _In_z_ BSTR bstrParameterRef - ); - - HRESULT - AddOption( - _In_opt_z_ BSTR bstrKeywordNS - ); - -private: - CComBSTR m_bstrQuery; - - CComBSTR m_bstrFrameworkNS; -}; - diff --git a/print/XPSDrvSmpl/src/common/schema.cpp b/print/XPSDrvSmpl/src/common/schema.cpp deleted file mode 100644 index ce2aa2c2..00000000 --- a/print/XPSDrvSmpl/src/common/schema.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - schema.cpp - -Abstract: - - PrintSchema implementation. This provides the definition of keywords common - to all features within the PrintSchema. - ---*/ - -#include "precomp.h" -#include "schema.h" - -LPCWSTR XDPrintSchema::SCHEMA_INST_URI = - L"http://www.w3.org/2001/XMLSchema-instance"; - -LPCWSTR XDPrintSchema::SCHEMA_DEF_URI = - L"http://www.w3.org/2001/XMLSchema"; - -LPCWSTR XDPrintSchema::SCHEMA_TYPE = L"type"; -LPCWSTR XDPrintSchema::SCHEMA_INTEGER = L"integer"; -LPCWSTR XDPrintSchema::SCHEMA_DECIMAL = L"decimal"; -LPCWSTR XDPrintSchema::SCHEMA_STRING = L"string"; -LPCWSTR XDPrintSchema::SCHEMA_QNAME = L"QName"; -LPCWSTR XDPrintSchema::SCHEMA_CONDITIONAL = L"Conditional"; - -LPCWSTR XDPrintSchema::FRAMEWORK_URI = - L"http://schemas.microsoft.com/windows/2003/08/printing/printschemaframework"; - -LPCWSTR XDPrintSchema::KEYWORDS_URI = - L"http://schemas.microsoft.com/windows/2003/08/printing/printschemakeywords"; - -LPCWSTR XDPrintSchema::FEATURE_ELEMENT_NAME = L"Feature"; -LPCWSTR XDPrintSchema::OPTION_ELEMENT_NAME = L"Option"; -LPCWSTR XDPrintSchema::PARAM_INIT_ELEMENT_NAME = L"ParameterInit"; -LPCWSTR XDPrintSchema::PARAM_REF_ELEMENT_NAME = L"ParameterRef"; -LPCWSTR XDPrintSchema::PARAM_DEF_ELEMENT_NAME = L"ParameterDef"; -LPCWSTR XDPrintSchema::SCORED_PROP_ELEMENT_NAME = L"ScoredProperty"; -LPCWSTR XDPrintSchema::PROPERTY_ELEMENT_NAME = L"Property"; -LPCWSTR XDPrintSchema::VALUE_ELEMENT_NAME = L"Value"; -LPCWSTR XDPrintSchema::NAME_ATTRIBUTE_NAME = L"name"; - - -LPCWSTR XDPrintSchema::PICKONE_VALUE_NAME = L"PickOne"; -LPCWSTR XDPrintSchema::SELECTIONTYPE_VALUE_NAME = L"SelectionType"; -LPCWSTR XDPrintSchema::DATATYPE_VALUE_NAME = L"DataType"; -LPCWSTR XDPrintSchema::DEFAULTVAL_VALUE_NAME = L"DefaultValue"; -LPCWSTR XDPrintSchema::MAX_VALUE_NAME = L"MaxValue"; -LPCWSTR XDPrintSchema::MIN_VALUE_NAME = L"MinValue"; -LPCWSTR XDPrintSchema::MAX_LENGTH_NAME = L"MaxLength"; -LPCWSTR XDPrintSchema::MIN_LENGTH_NAME = L"MinLength"; -LPCWSTR XDPrintSchema::MULTIPLE_VALUE_NAME = L"Multiple"; -LPCWSTR XDPrintSchema::MANDATORY_VALUE_NAME = L"Mandatory"; -LPCWSTR XDPrintSchema::UNITTYPE_VALUE_NAME = L"UnitType"; -LPCWSTR XDPrintSchema::DISPLAYNAME_VALUE_NAME = L"DisplayName"; - -LPCWSTR XDPrintSchema::PRINTTICKET_NAME = L"PrintTicket"; -LPCWSTR XDPrintSchema::PRINTCAPABILITIES_NAME = L"PrintCapabilities"; diff --git a/print/XPSDrvSmpl/src/common/schema.h b/print/XPSDrvSmpl/src/common/schema.h deleted file mode 100644 index 540de949..00000000 --- a/print/XPSDrvSmpl/src/common/schema.h +++ /dev/null @@ -1,94 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - schema.h - -Abstract: - - PrintSchema definition. This provides the definition of keywords common - to all features within the PrintSchema. The description is placed within a - XDPrintSchema namespace. - ---*/ - -#pragma once - -enum EPrintschemaVersion -{ - PRINTSCHEMA_VERSION_NUMBER = 1 -}; - -namespace XDPrintSchema -{ - // - // W3 namespaces - // - extern LPCWSTR SCHEMA_INST_URI; - extern LPCWSTR SCHEMA_DEF_URI; - - // - // W3 type prefixes - // - extern LPCWSTR SCHEMA_TYPE; - extern LPCWSTR SCHEMA_INTEGER; - extern LPCWSTR SCHEMA_DECIMAL; - extern LPCWSTR SCHEMA_STRING; - extern LPCWSTR SCHEMA_QNAME; - extern LPCWSTR SCHEMA_CONDITIONAL; - - // - // Namespaces - // - extern LPCWSTR FRAMEWORK_URI; - extern LPCWSTR KEYWORDS_URI; - - // - // Element and attribute types defined in Printschema framework - // - extern LPCWSTR FEATURE_ELEMENT_NAME; - extern LPCWSTR OPTION_ELEMENT_NAME; - extern LPCWSTR PARAM_INIT_ELEMENT_NAME; - extern LPCWSTR PARAM_REF_ELEMENT_NAME; - extern LPCWSTR PARAM_DEF_ELEMENT_NAME; - extern LPCWSTR SCORED_PROP_ELEMENT_NAME; - extern LPCWSTR VALUE_ELEMENT_NAME; - extern LPCWSTR NAME_ATTRIBUTE_NAME; - extern LPCWSTR PROPERTY_ELEMENT_NAME; - - // - // Value types defined in the PrintSchema Keywords - // - extern LPCWSTR PICKONE_VALUE_NAME; - extern LPCWSTR SELECTIONTYPE_VALUE_NAME; - extern LPCWSTR DATATYPE_VALUE_NAME; - extern LPCWSTR DEFAULTVAL_VALUE_NAME; - extern LPCWSTR MAX_VALUE_NAME; - extern LPCWSTR MIN_VALUE_NAME; - extern LPCWSTR MAX_LENGTH_NAME; - extern LPCWSTR MIN_LENGTH_NAME; - extern LPCWSTR MULTIPLE_VALUE_NAME; - extern LPCWSTR MANDATORY_VALUE_NAME; - extern LPCWSTR UNITTYPE_VALUE_NAME; - extern LPCWSTR DISPLAYNAME_VALUE_NAME; - - // - // Root PrintTicket element - // - extern LPCWSTR PRINTTICKET_NAME; - - // - // Root PrintCapabilities element - // - extern LPCWSTR PRINTCAPABILITIES_NAME; -} - diff --git a/print/XPSDrvSmpl/src/common/wmdata.h b/print/XPSDrvSmpl/src/common/wmdata.h deleted file mode 100644 index effe32a5..00000000 --- a/print/XPSDrvSmpl/src/common/wmdata.h +++ /dev/null @@ -1,71 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - wmdata.h - -Abstract: - - PageWatermark data structure definition. This provides a convenient - description of the PrintSchema PageWatermark feature. - ---*/ - -#pragma once - -#include "wmschema.h" - -namespace XDPrintSchema -{ - namespace PageWatermark - { - struct WMTextData - { - WMTextData() : - bstrFontColor(L"#FFFFFF"), - fontSize(12), - bstrText(L"Undefined") - { - } - - CComBSTR bstrFontColor; - INT fontSize; - CComBSTR bstrText; - }; - - struct WatermarkData - { - WatermarkData() : - type(TextWatermark), - widthOrigin(0), - heightOrigin(0), - widthExtent(215900), - heightExtent(279400), - transparency(0), - angle(0), - layering(Layering::Overlay) - { - } - - EWatermarkOption type; - INT widthOrigin; - INT heightOrigin; - INT widthExtent; - INT heightExtent; - INT transparency; - INT angle; - WMTextData txtData; - Layering::ELayeringOption layering; - }; - } -} - diff --git a/print/XPSDrvSmpl/src/common/wmpchndlr.cpp b/print/XPSDrvSmpl/src/common/wmpchndlr.cpp deleted file mode 100644 index bab943b8..00000000 --- a/print/XPSDrvSmpl/src/common/wmpchndlr.cpp +++ /dev/null @@ -1,555 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - wmpchndlr.cpp - -Abstract: - - Page watermark PrintCapabilities handling implementation. The watermark PC handler - is used to set Page Watermark settings in a PrintCapabilities. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdexcept.h" -#include "xdexcept.h" -#include "wmpchndlr.h" -#include "privatedefs.h" - -using XDPrintSchema::PRINTCAPABILITIES_NAME; - -using XDPrintSchema::PageWatermark::TextWatermark; -using XDPrintSchema::PageWatermark::BitmapWatermark; -using XDPrintSchema::PageWatermark::VectorWatermark; -using XDPrintSchema::PageWatermark::ECommonWatermarkProps; -using XDPrintSchema::PageWatermark::ECommonWatermarkPropsMin; -using XDPrintSchema::PageWatermark::ECommonWatermarkPropsMax; -using XDPrintSchema::PageWatermark::ETextWatermarkProps; -using XDPrintSchema::PageWatermark::ETextWatermarkPropsMin; -using XDPrintSchema::PageWatermark::ETextWatermarkPropsMax; -using XDPrintSchema::PageWatermark::EVectBmpWatermarkProps; -using XDPrintSchema::PageWatermark::EVectBmpWatermarkPropsMin; -using XDPrintSchema::PageWatermark::EVectBmpWatermarkPropsMax; -using XDPrintSchema::PageWatermark::WATERMARK_FEATURE; -using XDPrintSchema::PageWatermark::WATERMARK_OPTIONS; -using XDPrintSchema::PageWatermark::CMN_WATERMARK_PROPS; -using XDPrintSchema::PageWatermark::TXT_WATERMARK_PROPS; -using XDPrintSchema::PageWatermark::VECTBMP_WATERMARK_PROPS; - -using XDPrintSchema::PageWatermark::Layering::ELayeringOption; -using XDPrintSchema::PageWatermark::Layering::ELayeringOptionMin; -using XDPrintSchema::PageWatermark::Layering::ELayeringOptionMax; -using XDPrintSchema::PageWatermark::Layering::LAYERING_FEATURE; -using XDPrintSchema::PageWatermark::Layering::LAYERING_OPTIONS; - -/*++ - -Routine Name: - - CWMPCHandler::CWMPCHandler - -Routine Description: - - CWMPCHandler class constructor - -Arguments: - - pPrintCapabilities - Pointer to the DOM document representation of the PrintCapabilities - -Return Value: - - None - ---*/ -CWMPCHandler::CWMPCHandler( - _In_ IXMLDOMDocument2* pPrintCapabilities - ) : - CPCHandler(pPrintCapabilities) -{ -} - -/*++ - -Routine Name: - - CWMPCHandler::~CWMPCHandler - -Routine Description: - - CWMPCHandler class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CWMPCHandler::~CWMPCHandler() -{ -} - -/*++ - -Routine Name: - - CWMPCHandler::SetCapabilities - -Routine Description: - - This routine sets watermark capabilities in the PrintCapabilities passed to the - class constructor. - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWMPCHandler::SetCapabilities( - VOID - ) -{ - HRESULT hr = S_OK; - - try - { - // - // Retrieve the PrintTicket root - // - CComPtr<IXMLDOMNode> pPTRoot(NULL); - - CComBSTR bstrPTQuery(m_bstrFrameworkPrefix); - bstrPTQuery += PRINTCAPABILITIES_NAME; - - if (SUCCEEDED(hr = GetNode(bstrPTQuery, &pPTRoot))) - { - CComPtr<IXMLDOMElement> pFeatureElement(NULL); - - if (SUCCEEDED(hr = CreateFeatureSelection(CComBSTR(WATERMARK_FEATURE), NULL, &pFeatureElement))) - { - CComPtr<IXMLDOMElement> pTextOption(NULL); - - // - // Create the Text Watermark Options - // - if (SUCCEEDED(hr = CreateOption(CComBSTR(WATERMARK_OPTIONS[TextWatermark]), NULL, &pTextOption))) - { - PTDOMElementVector propertList; - - // - // Create the common scored property list - // - for (ECommonWatermarkProps cmnProps = ECommonWatermarkPropsMin; - cmnProps < ECommonWatermarkPropsMax && SUCCEEDED(hr); - cmnProps = static_cast<ECommonWatermarkProps>(cmnProps + 1)) - { - CComPtr<IXMLDOMElement> pScoredProperty(NULL); - - if (SUCCEEDED(hr = CreateScoredProperty(CComBSTR(CMN_WATERMARK_PROPS[cmnProps]), &pScoredProperty))) - { - CComPtr<IXMLDOMElement> pParamRef(NULL); - - // - // Construct the parameter reference elements - // - CComBSTR bstrPRefName(WATERMARK_FEATURE); - - if (wcscmp(CMN_WATERMARK_PROPS[cmnProps], L"Angle") == 0) - { - hr = bstrPRefName.Append(L"Text"); - } - - bstrPRefName += CMN_WATERMARK_PROPS[cmnProps]; - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CreateParameterRef(bstrPRefName, &pParamRef))) - { - hr = pScoredProperty->appendChild(pParamRef, NULL); - } - - propertList.push_back(pScoredProperty); - } - } - - // - // Create the text specific scored property list - // - for (ETextWatermarkProps txtProps = ETextWatermarkPropsMin; - txtProps < ETextWatermarkPropsMax && SUCCEEDED(hr); - txtProps = static_cast<ETextWatermarkProps>(txtProps + 1)) - { - CComPtr<IXMLDOMElement> pScoredProperty(NULL); - - if (SUCCEEDED(hr = CreateScoredProperty(CComBSTR(TXT_WATERMARK_PROPS[txtProps]), &pScoredProperty))) - { - CComPtr<IXMLDOMElement> pParamRef(NULL); - - // - // Construct the parameter reference elements - // - CComBSTR bstrPRefName(WATERMARK_FEATURE); - bstrPRefName += TXT_WATERMARK_PROPS[txtProps]; - - if (SUCCEEDED(hr = CreateParameterRef(bstrPRefName, &pParamRef))) - { - hr = pScoredProperty->appendChild(pParamRef, NULL); - } - - propertList.push_back(pScoredProperty); - } - } - - // - // Add the properties to the text option - // - PTDOMElementVector::iterator iterPropertList = propertList.begin(); - - for (;iterPropertList != propertList.end() && SUCCEEDED(hr); iterPropertList++) - { - hr = pTextOption->appendChild(*iterPropertList, NULL); - } - - if (SUCCEEDED(hr)) - { - hr = pFeatureElement->appendChild(pTextOption, NULL); - } - } - - CComPtr<IXMLDOMElement> pVectorOption(NULL); - - // - // Create the Vector Watermark Options - // - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CreateOption(CComBSTR(WATERMARK_OPTIONS[VectorWatermark]), NULL, &pVectorOption))) - { - PTDOMElementVector propertList; - - // - // Create the common scored property list - // - for (ECommonWatermarkProps cmnProps = ECommonWatermarkPropsMin; - cmnProps < ECommonWatermarkPropsMax && SUCCEEDED(hr); - cmnProps = static_cast<ECommonWatermarkProps>(cmnProps + 1)) - { - CComPtr<IXMLDOMElement> pScoredProperty(NULL); - - if (SUCCEEDED(hr = CreateScoredProperty(CComBSTR(CMN_WATERMARK_PROPS[cmnProps]), &pScoredProperty))) - { - CComPtr<IXMLDOMElement> pParamRef(NULL); - - // - // Construct the parameter reference elements - // - CComBSTR bstrPRefName(WATERMARK_FEATURE); - - if (wcscmp(CMN_WATERMARK_PROPS[cmnProps], L"Angle") == 0) - { - bstrPRefName += WATERMARK_OPTIONS[TextWatermark]; - } - - bstrPRefName += CMN_WATERMARK_PROPS[cmnProps]; - - if (SUCCEEDED(hr = CreateParameterRef(bstrPRefName, &pParamRef))) - { - hr = pScoredProperty->appendChild(pParamRef, NULL); - } - - propertList.push_back(pScoredProperty); - } - } - - // - // Create the vector specific property list - // - for (EVectBmpWatermarkProps vectProps = EVectBmpWatermarkPropsMin; - vectProps < EVectBmpWatermarkPropsMax && SUCCEEDED(hr); - vectProps = static_cast<EVectBmpWatermarkProps>(vectProps + 1)) - { - // - // Create the scored property element - // - CComPtr<IXMLDOMElement> pScoredProperty(NULL); - - if (SUCCEEDED(hr = CreateScoredProperty(CComBSTR(VECTBMP_WATERMARK_PROPS[vectProps]), &pScoredProperty))) - { - CComPtr<IXMLDOMElement> pParamRef(NULL); - - // - // Construct the parameter reference elements - // - CComBSTR bstrPRefName(WATERMARK_FEATURE); - bstrPRefName += VECTBMP_WATERMARK_PROPS[vectProps]; - - if (SUCCEEDED(hr = CreateParameterRef(bstrPRefName, &pParamRef))) - { - hr = pScoredProperty->appendChild(pParamRef, NULL); - } - - propertList.push_back(pScoredProperty); - } - } - - // - // Add the properties to the vector option - // - PTDOMElementVector::iterator iterPropertList = propertList.begin(); - - for (;iterPropertList != propertList.end() && SUCCEEDED(hr); iterPropertList++) - { - hr = pVectorOption->appendChild(*iterPropertList, NULL); - } - - if (SUCCEEDED(hr)) - { - hr = pFeatureElement->appendChild(pVectorOption, NULL); - } - } - - CComPtr<IXMLDOMElement> pBitmapOption(NULL); - - // - // Create the Bitmap Watermark Options - // - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CreateOption(CComBSTR(WATERMARK_OPTIONS[BitmapWatermark]), NULL, &pBitmapOption))) - { - PTDOMElementVector propertList; - - // - // Create the common scored property list - // - for (ECommonWatermarkProps cmnProps = ECommonWatermarkPropsMin; - cmnProps < ECommonWatermarkPropsMax && SUCCEEDED(hr); - cmnProps = static_cast<ECommonWatermarkProps>(cmnProps + 1)) - { - CComPtr<IXMLDOMElement> pScoredProperty(NULL); - - if (SUCCEEDED(hr = CreateScoredProperty(CComBSTR(CMN_WATERMARK_PROPS[cmnProps]), &pScoredProperty))) - { - CComPtr<IXMLDOMElement> pParamRef(NULL); - - // - // Construct the parameter reference elements - // - CComBSTR bstrPRefName(WATERMARK_FEATURE); - - if (wcscmp(CMN_WATERMARK_PROPS[cmnProps], L"Angle") == 0) - { - hr = bstrPRefName.Append(L"Text"); - } - - bstrPRefName += CMN_WATERMARK_PROPS[cmnProps]; - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CreateParameterRef(bstrPRefName, &pParamRef))) - { - hr = pScoredProperty->appendChild(pParamRef, NULL); - } - - propertList.push_back(pScoredProperty); - } - } - - // - // Create the bitmap specific property list - // - for (EVectBmpWatermarkProps bmpProps = EVectBmpWatermarkPropsMin; - bmpProps < EVectBmpWatermarkPropsMax && SUCCEEDED(hr); - bmpProps = static_cast<EVectBmpWatermarkProps>(bmpProps + 1)) - { - // - // Create the scored property element - // - CComPtr<IXMLDOMElement> pScoredProperty(NULL); - - if (SUCCEEDED(hr = CreateScoredProperty(CComBSTR(VECTBMP_WATERMARK_PROPS[bmpProps]), &pScoredProperty))) - { - CComPtr<IXMLDOMElement> pParamRef(NULL); - - // - // Construct the parameter reference elements - // - CComBSTR bstrPRefName(WATERMARK_FEATURE); - bstrPRefName += VECTBMP_WATERMARK_PROPS[bmpProps]; - - if (SUCCEEDED(hr = CreateParameterRef(bstrPRefName, &pParamRef))) - { - hr = pScoredProperty->appendChild(pParamRef, NULL); - } - - propertList.push_back(pScoredProperty); - } - } - - // - // Add the properties to the bitmap option - // - PTDOMElementVector::iterator iterPropertList = propertList.begin(); - - for (;iterPropertList != propertList.end() && SUCCEEDED(hr); iterPropertList++) - { - hr = pBitmapOption->appendChild(*iterPropertList, NULL); - } - - if (SUCCEEDED(hr)) - { - hr = pFeatureElement->appendChild(pBitmapOption, NULL); - } - } - - CComPtr<IXMLDOMElement> pLayeringFeature(NULL); - - // - // Create the layering feature options - // - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CreateFeature(CComBSTR(LAYERING_FEATURE), NULL, &pLayeringFeature))) - { - PTDOMElementVector optionList; - - // - // Create the layering option list - // - for (ELayeringOption wmLayering = ELayeringOptionMin; - wmLayering < ELayeringOptionMax && SUCCEEDED(hr); - wmLayering = static_cast<ELayeringOption>(wmLayering + 1)) - { - CComPtr<IXMLDOMElement> pOptionProperty(NULL); - - if (SUCCEEDED(hr = CreateOption(CComBSTR(LAYERING_OPTIONS[wmLayering]), NULL, &pOptionProperty))) - { - optionList.push_back(pOptionProperty); - } - } - - // - // Add the options to the layering feature - // - PTDOMElementVector::iterator iterOptionList = optionList.begin(); - - for (;iterOptionList != optionList.end() && SUCCEEDED(hr); iterOptionList++) - { - hr = pLayeringFeature->appendChild(*iterOptionList, NULL); - } - - if (SUCCEEDED(hr)) - { - hr = pFeatureElement->appendChild(pLayeringFeature, NULL); - } - } - - if (SUCCEEDED(hr)) - { - hr = pPTRoot->appendChild(pFeatureElement, NULL); - } - } - - // - // Create the integer parameter defs - // - for (UINT cIndex = 0; SUCCEEDED(hr) && cIndex < numof(wmParamDefIntegers); cIndex++) - { - CComPtr<IXMLDOMElement> pParameterDef(NULL); - - // - // PageWatermarkTextColor has no associated multiple value - // - INT multiple; - if (wcscmp(CComBSTR(wmParamDefIntegers[cIndex].property_name), L"PageWatermarkTextColor") == 0) - { - // - // convert integer representation into a string parameter in the - // PrintCapabilities. This is a special case because it's treated - // as an int in the DEVMODE & a string in the PrintTicket - // - CComBSTR bstrDefault(L"#AARRGGBB"); - hr = StringCchPrintf(bstrDefault, SysStringLen(bstrDefault)+1, TEXT("#%.8X"), wmParamDefIntegers[cIndex].default_value); - - if (SUCCEEDED(hr)) - { - hr = CreateStringParameterDef(CComBSTR(wmParamDefIntegers[cIndex].property_name), // Paramater Name - TRUE, // Is Print Schema keyword? - CComBSTR(wmParamDefIntegers[cIndex].display_name), // Display Text - bstrDefault, // Default - 9, // Min Length: - // table contains min value, which is different - 9, // Max Length: - // table contains min value, which is different - CComBSTR(wmParamDefIntegers[cIndex].unit_type), // Unit Type - &pParameterDef); // Parameter Def - } - } - else - { - multiple = wmParamDefIntegers[cIndex].multiple; - - hr = CreateIntParameterDef(CComBSTR(wmParamDefIntegers[cIndex].property_name), // Paramater Name - wmParamDefIntegers[cIndex].is_public, // Is Print Schema keyword? - CComBSTR(wmParamDefIntegers[cIndex].display_name), // Display Text - wmParamDefIntegers[cIndex].default_value, // Default - wmParamDefIntegers[cIndex].min_length, // Min value - wmParamDefIntegers[cIndex].max_length, // Max value - multiple, // Multiple - CComBSTR(wmParamDefIntegers[cIndex].unit_type), // Unit Type - &pParameterDef); // Parameter Def - } - - if (SUCCEEDED(hr)) - { - hr = pPTRoot->appendChild(pParameterDef, NULL); - } - } - - // - // Create the string parameter defs - // - for (UINT cIndex = 0; SUCCEEDED(hr) && cIndex < numof(wmParamDefStrings); cIndex++) - { - CComPtr<IXMLDOMElement> pParameterDef(NULL); - - if (SUCCEEDED(hr = CreateStringParameterDef(CComBSTR(wmParamDefStrings[cIndex].property_name), // Paramater Name - TRUE, // Is Print Schema keyword? - CComBSTR(wmParamDefStrings[cIndex].display_name), // Display Text - CComBSTR(wmParamDefStrings[cIndex].default_value), // Default - wmParamDefStrings[cIndex].min_length, // Min Length - wmParamDefStrings[cIndex].max_length, // Max Length - CComBSTR(wmParamDefStrings[cIndex].unit_type), // Unit Type - &pParameterDef))) // Parameter Def - { - hr = pPTRoot->appendChild(pParameterDef, NULL); - } - } - } - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/common/wmpchndlr.h b/print/XPSDrvSmpl/src/common/wmpchndlr.h deleted file mode 100644 index 2ffcaada..00000000 --- a/print/XPSDrvSmpl/src/common/wmpchndlr.h +++ /dev/null @@ -1,41 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - wmpchndlr.h - -Abstract: - - Page Watermark PrintCapabilities handling definition. The booklet PC handler - is used to set booklet settings in a PrintCapabilities. - ---*/ - -#pragma once - -#include "pchndlr.h" -#include "wmdata.h" - -class CWMPCHandler : public CPCHandler -{ -public: - CWMPCHandler( - _In_ IXMLDOMDocument2* pPrintCapabilities - ); - - virtual ~CWMPCHandler(); - - HRESULT - SetCapabilities( - VOID - ); -}; diff --git a/print/XPSDrvSmpl/src/common/wmpthndlr.cpp b/print/XPSDrvSmpl/src/common/wmpthndlr.cpp deleted file mode 100644 index 49792d6a..00000000 --- a/print/XPSDrvSmpl/src/common/wmpthndlr.cpp +++ /dev/null @@ -1,1167 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - wmpthndlr.cpp - -Abstract: - - PageWatermark PrintTicket handler implementation. Derived from CPTHandler, - this provides PageWatermark specific Get and Set methods acting on the - PrintTicket passed (as a DOM document). - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "xdexcept.h" -#include "wmpthndlr.h" - -using XDPrintSchema::PRINTTICKET_NAME; -using XDPrintSchema::NAME_ATTRIBUTE_NAME; -using XDPrintSchema::SCHEMA_DECIMAL; -using XDPrintSchema::SCHEMA_INTEGER; -using XDPrintSchema::SCHEMA_STRING; - -using XDPrintSchema::PageWatermark::WatermarkData; - -using XDPrintSchema::PageWatermark::EWatermarkOption; -using XDPrintSchema::PageWatermark::EWatermarkOptionMin; -using XDPrintSchema::PageWatermark::NoWatermark; -using XDPrintSchema::PageWatermark::TextWatermark; -using XDPrintSchema::PageWatermark::BitmapWatermark; -using XDPrintSchema::PageWatermark::VectorWatermark; -using XDPrintSchema::PageWatermark::EWatermarkOptionMax; - -using XDPrintSchema::PageWatermark::ECommonWatermarkProps; -using XDPrintSchema::PageWatermark::ECommonWatermarkPropsMin; -using XDPrintSchema::PageWatermark::WidthOrigin; -using XDPrintSchema::PageWatermark::HeightOrigin; -using XDPrintSchema::PageWatermark::Transparency; -using XDPrintSchema::PageWatermark::Angle; -using XDPrintSchema::PageWatermark::ECommonWatermarkPropsMax; - -using XDPrintSchema::PageWatermark::ETextWatermarkProps; -using XDPrintSchema::PageWatermark::ETextWatermarkPropsMin; -using XDPrintSchema::PageWatermark::FontColor; -using XDPrintSchema::PageWatermark::FontSize; -using XDPrintSchema::PageWatermark::Text; -using XDPrintSchema::PageWatermark::ETextWatermarkPropsMax; - -using XDPrintSchema::PageWatermark::EVectBmpWatermarkProps; -using XDPrintSchema::PageWatermark::EVectBmpWatermarkPropsMin; -using XDPrintSchema::PageWatermark::WidthExtent; -using XDPrintSchema::PageWatermark::HeightExtent; -using XDPrintSchema::PageWatermark::EVectBmpWatermarkPropsMax; - -using XDPrintSchema::PageWatermark::WATERMARK_FEATURE; -using XDPrintSchema::PageWatermark::WATERMARK_OPTIONS; -using XDPrintSchema::PageWatermark::CMN_WATERMARK_PROPS; -using XDPrintSchema::PageWatermark::TXT_WATERMARK_PROPS; -using XDPrintSchema::PageWatermark::VECTBMP_WATERMARK_PROPS; - -using XDPrintSchema::PageWatermark::Layering::ELayeringOption; - -using XDPrintSchema::PageWatermark::Layering::ELayeringOptionMin; -using XDPrintSchema::PageWatermark::Layering::Overlay; -using XDPrintSchema::PageWatermark::Layering::Underlay; -using XDPrintSchema::PageWatermark::Layering::ELayeringOptionMax; - -using XDPrintSchema::PageWatermark::Layering::LAYERING_FEATURE; -using XDPrintSchema::PageWatermark::Layering::LAYERING_OPTIONS; - -/*++ - -Routine Name: - - CWMPTHandler::CWMPTHandler - -Routine Description: - - CWMPTHandler class constructor - -Arguments: - - pPrintTicket - Pointer to the DOM document representation of the PrintTicket - -Return Value: - - None - ---*/ -CWMPTHandler::CWMPTHandler( - _In_ IXMLDOMDocument2* pPrintTicket - ) : - CPTHandler(pPrintTicket) -{ -} - -/*++ - -Routine Name: - - CWMPTHandler::~CWMPTHandler - -Routine Description: - - CWMPTHandler class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CWMPTHandler::~CWMPTHandler() -{ -} - -/*++ - -Routine Name: - - CWMPTHandler::GetData - -Routine Description: - - The routine fills the data structure passed in with watermark data retrieved from - the PrintTicket passed to the class constructor. - -Arguments: - - pWmData - Pointer to the watermark data structure to be filled in - -Return Value: - - HRESULT - S_OK - On success - E_ELEMENT_NOT_FOUND - Feature not present in PrintTicket - E_* - On error - ---*/ -HRESULT -CWMPTHandler::GetData( - _Out_ WatermarkData* pWmData - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pWmData, E_POINTER))) - { - CComBSTR bstrWMOption; - CComBSTR bstrLayerOption; - - if (SUCCEEDED(hr = GetFeatureOption(CComBSTR(WATERMARK_FEATURE), &bstrWMOption)) && - SUCCEEDED(hr = GetSubFeatureOption(CComBSTR(WATERMARK_FEATURE), - CComBSTR(LAYERING_FEATURE), - &bstrLayerOption)) && - SUCCEEDED(hr = GetScoredPropertyValue(CComBSTR(WATERMARK_FEATURE), - CComBSTR(CMN_WATERMARK_PROPS[WidthOrigin]), - &pWmData->widthOrigin)) && - SUCCEEDED(hr = GetScoredPropertyValue(CComBSTR(WATERMARK_FEATURE), - CComBSTR(CMN_WATERMARK_PROPS[HeightOrigin]), - &pWmData->heightOrigin)) && - SUCCEEDED(hr = GetScoredPropertyValue(CComBSTR(WATERMARK_FEATURE), - CComBSTR(CMN_WATERMARK_PROPS[Transparency]), - &pWmData->transparency)) && - SUCCEEDED(hr = GetScoredPropertyValue(CComBSTR(WATERMARK_FEATURE), - CComBSTR(CMN_WATERMARK_PROPS[Angle]), - &pWmData->angle))) - { - if (bstrWMOption == WATERMARK_OPTIONS[BitmapWatermark]) - { - pWmData->type = BitmapWatermark; - - if (SUCCEEDED(hr = GetScoredPropertyValue(CComBSTR(WATERMARK_FEATURE), - CComBSTR(VECTBMP_WATERMARK_PROPS[WidthExtent]), - &pWmData->widthExtent))) - { - hr = GetScoredPropertyValue(CComBSTR(WATERMARK_FEATURE), - CComBSTR(VECTBMP_WATERMARK_PROPS[HeightExtent]), - &pWmData->heightExtent); - } - - } - else if (bstrWMOption == WATERMARK_OPTIONS[TextWatermark]) - { - pWmData->type = TextWatermark; - if (SUCCEEDED(hr = GetScoredPropertyValue(CComBSTR(WATERMARK_FEATURE), - CComBSTR(TXT_WATERMARK_PROPS[FontColor]), - &pWmData->txtData.bstrFontColor)) && - SUCCEEDED(hr = GetScoredPropertyValue(CComBSTR(WATERMARK_FEATURE), - CComBSTR(TXT_WATERMARK_PROPS[FontSize]), - &pWmData->txtData.fontSize))) - { - hr = GetScoredPropertyValue(CComBSTR(WATERMARK_FEATURE), - CComBSTR(TXT_WATERMARK_PROPS[Text]), - &pWmData->txtData.bstrText); - } - } - else if (bstrWMOption == WATERMARK_OPTIONS[VectorWatermark]) - { - pWmData->type = VectorWatermark; - - if (SUCCEEDED(hr = GetScoredPropertyValue(CComBSTR(WATERMARK_FEATURE), - CComBSTR(VECTBMP_WATERMARK_PROPS[WidthExtent]), - &pWmData->widthExtent))) - { - hr = GetScoredPropertyValue(CComBSTR(WATERMARK_FEATURE), - CComBSTR(VECTBMP_WATERMARK_PROPS[HeightExtent]), - &pWmData->heightExtent); - } - } - else - { - hr = E_FAIL; - } - - if (SUCCEEDED(hr)) - { - if (bstrLayerOption == LAYERING_OPTIONS[Underlay]) - { - pWmData->layering = Underlay; - } - else if (bstrLayerOption == LAYERING_OPTIONS[Overlay]) - { - pWmData->layering = Overlay; - } - else - { - hr = E_FAIL; - } - } - } - - if (hr == E_ELEMENT_NOT_FOUND) - { - pWmData->type = NoWatermark; - } - } - - // - // Validate the data - // - if (SUCCEEDED(hr)) - { - if (pWmData->type < EWatermarkOptionMin || - pWmData->type >= EWatermarkOptionMax || - pWmData->layering < ELayeringOptionMin || - pWmData->layering >= ELayeringOptionMax) - { - hr = E_FAIL; - } - } - - ERR_ON_HR_EXC(hr, E_ELEMENT_NOT_FOUND); - return hr; -} - -/*++ - -Routine Name: - - CWMPTHandler::SetData - -Routine Description: - - This routine sets the watermark data in the PrintTicket passed to the - class constructor. - -Arguments: - - pWmData - Pointer to the watermark data to be set in the PrintTicket - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWMPTHandler::SetData( - _In_ CONST WatermarkData* pWmData - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pWmData, E_POINTER))) - { - try - { - // - // Remove any existing watermark feature node - // - if (SUCCEEDED(hr = Delete()) && - pWmData->type != NoWatermark) - { - // - // Construct the appropriate watermark element - // - CComPtr<IXMLDOMElement> pWMDataElem(NULL); - PTDOMElementVector paramInitList; - - switch (pWmData->type) - { - case TextWatermark: - { - hr = CreateTextWMElements(pWmData, &pWMDataElem, ¶mInitList); - } - break; - - case BitmapWatermark: - { - hr = CreateBitmapWMElements(pWmData, &pWMDataElem, ¶mInitList); - } - break; - - case VectorWatermark: - { - hr = CreateVectorWMElements(pWmData, &pWMDataElem, ¶mInitList); - } - break; - - default: - { - hr = E_FAIL; - } - break; - } - - // - // Insert the watermark and paramater init nodes - // - CComPtr<IXMLDOMNode> pPTRoot(NULL); - - CComBSTR bstrPTQuery(m_bstrFrameworkPrefix); - bstrPTQuery += PRINTTICKET_NAME; - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = GetNode(bstrPTQuery, &pPTRoot))) - { - hr = pPTRoot->appendChild(pWMDataElem, NULL); - - PTDOMElementVector::iterator iterParamInit = paramInitList.begin(); - - for (;iterParamInit != paramInitList.end() && SUCCEEDED(hr); iterParamInit++) - { - hr = pPTRoot->appendChild(*iterParamInit, NULL); - } - } - } - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWMPTHandler::Delete - -Routine Description: - - This routine deletes the watermark feature from the PrintTicket passed to the - class constructor - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWMPTHandler::Delete( - VOID - ) -{ - // - // Remove any existing watermark feature node - // - HRESULT hr = DeleteFeature(CComBSTR(WATERMARK_FEATURE)); - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWMPTHandler::CreateCommonWMElements - -Routine Description: - - This routine creates all the DOM elements common to all Watermark types. Note that - this routine also returns the option element seperately (so the caller can specify the - watermark type) and a list of the ParameterInit elements (so the caller can append them - to the root PrintTicket element) - -Arguments: - - pWmData - Pointer to the watermark data structure - ppWMDataElem - Pointer to an IXMLDOMElement pointer that recieves feature element - ppOptionElem - Pointer to an IXMLDOMElement pointer that recieves option element - pParamInitList - Pointer to a vector of DOM element pointers that recieves the parameter init elements - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWMPTHandler::CreateCommonWMElements( - _In_ CONST WatermarkData* pWmData, - _Outptr_ IXMLDOMElement** ppWMDataElem, - _Outptr_ IXMLDOMElement** ppOptionElem, - _Out_ PTDOMElementVector* pParamInitList - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pWmData, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(ppWMDataElem, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(ppOptionElem, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pParamInitList, E_POINTER))) - { - *ppWMDataElem = NULL; - - if (pWmData->layering < ELayeringOptionMin || - pWmData->layering >= ELayeringOptionMax) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - // - // Create the feature option pair - CreateFeatureOptionPair does not - // set the option name, this is done in the calling function - // - if (SUCCEEDED(hr = CreateFeatureOptionPair(CComBSTR(WATERMARK_FEATURE), ppWMDataElem, ppOptionElem))) - { - // - // Over all common properties, create and insert the element - // - for (ECommonWatermarkProps cmnProps = ECommonWatermarkPropsMin; - cmnProps < ECommonWatermarkPropsMax && SUCCEEDED(hr); - cmnProps = static_cast<ECommonWatermarkProps>(cmnProps + 1)) - { - // - // Create the scored property element - // - CComPtr<IXMLDOMElement> pScoredProperty(NULL); - - if (SUCCEEDED(hr = CreateScoredProperty(CComBSTR(CMN_WATERMARK_PROPS[cmnProps]), &pScoredProperty))) - { - // - // Construct the param ref and param init elements - // - CComBSTR bstrPRefName(WATERMARK_FEATURE); - - if (wcscmp(CMN_WATERMARK_PROPS[cmnProps], L"Angle") == 0) - { - bstrPRefName += L"Text"; - } - - bstrPRefName += CMN_WATERMARK_PROPS[cmnProps]; - - CComPtr<IXMLDOMElement> pParamRef(NULL); - CComPtr<IXMLDOMElement> pParamInit(NULL); - - CComBSTR bstrType; - CComBSTR bstrValue; - - if (SUCCEEDED(hr = GetCmnPropTypeAndValue(pWmData, cmnProps, &bstrType, &bstrValue)) && - SUCCEEDED(hr = CreateParamRefInitPair(bstrPRefName, bstrType, bstrValue, &pParamRef, &pParamInit))) - { - // - // Append the parameter ref element to the scored property, append the - // scored property to the option element and add the parameter init - // element to the vector - // - CComPtr<IXMLDOMNode> pPRInserted(NULL); - CComPtr<IXMLDOMNode> pSPInserted(NULL); - - if (SUCCEEDED(hr = pScoredProperty->appendChild(pParamRef, &pPRInserted)) && - SUCCEEDED(hr = (*ppOptionElem)->appendChild(pScoredProperty, &pSPInserted))) - { - try - { - pParamInitList->push_back(pParamInit); - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - } - } - } - } - - // - // Create the layering feature - // - CComPtr<IXMLDOMElement> pLayeringElement(NULL); - CComPtr<IXMLDOMElement> pLayeringOptionElement(NULL); - - CComBSTR bstrAttribName(m_bstrKeywordsPrefix); - bstrAttribName += LAYERING_OPTIONS[pWmData->layering]; - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CreateFeatureOptionPair(CComBSTR(LAYERING_FEATURE), - CComBSTR(LAYERING_OPTIONS[pWmData->layering]), - &pLayeringElement, - &pLayeringOptionElement))) - { - // - // Append the layering feature to the watermark feature node - // - hr = (*ppWMDataElem)->appendChild(pLayeringElement, NULL); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWMPTHandler::CreateCommonVectBmpWMElements - -Routine Description: - - This routine creates all the DOM elements common to all the vector and bitmap Watermark types. - -Arguments: - - pWmData - Pointer to the watermark data structure - pOptionElem - Pointer to an IXMLDOMElement to append the elements to - pParamInitList - Pointer to a vector of DOM element pointers that recieves the parameter init elements - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWMPTHandler::CreateCommonVectBmpWMElements( - _In_ CONST WatermarkData* pWmData, - _In_ IXMLDOMElement* pOptionElem, - _Out_ PTDOMElementVector* pParamInitList - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pWmData, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pOptionElem, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pParamInitList, E_POINTER))) - { - // - // Over all common properties, create and insert the element - // - for (EVectBmpWatermarkProps vectBmpProps = EVectBmpWatermarkPropsMin; - vectBmpProps < EVectBmpWatermarkPropsMax && SUCCEEDED(hr); - vectBmpProps = static_cast<EVectBmpWatermarkProps>(vectBmpProps + 1)) - { - // - // Create the scored property element - // - CComPtr<IXMLDOMElement> pScoredProperty(NULL); - - if (SUCCEEDED(hr = CreateScoredProperty(CComBSTR(VECTBMP_WATERMARK_PROPS[vectBmpProps]), &pScoredProperty))) - { - // - // Construct the param ref and param init elements - // - CComBSTR bstrPRefName(WATERMARK_FEATURE); - bstrPRefName += VECTBMP_WATERMARK_PROPS[vectBmpProps]; - - CComPtr<IXMLDOMElement> pParamRef(NULL); - CComPtr<IXMLDOMElement> pParamInit(NULL); - - CComBSTR bstrType; - CComBSTR bstrValue; - - if (SUCCEEDED(hr = GetCmnVectBmpPropTypeAndValue(pWmData, vectBmpProps, &bstrType, &bstrValue)) && - SUCCEEDED(hr = CreateParamRefInitPair(bstrPRefName, bstrType, bstrValue, &pParamRef, &pParamInit))) - { - // - // Append the parameter ref element to the scored property, append the - // scored property to the option element and add the parameter init - // element to the vector - // - CComPtr<IXMLDOMNode> pPRInserted(NULL); - CComPtr<IXMLDOMNode> pSPInserted(NULL); - - if (SUCCEEDED(hr = pScoredProperty->appendChild(pParamRef, &pPRInserted)) && - SUCCEEDED(hr = pOptionElem->appendChild(pScoredProperty, &pSPInserted))) - { - try - { - pParamInitList->push_back(pParamInit); - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - } - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWMPTHandler::CreateTextWMElements - -Routine Description: - - This routine creates a text watermark feature in the PrintTicket - -Arguments: - - pWmData - Pointer to the watermark data structure - ppWMDataElem - Pointer to an IXMLDOMElement pointer that recieves feature element - pParamInitList - P:ointer to a vector of DOM element pointers that recieves the parameter init elements - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWMPTHandler::CreateTextWMElements( - _In_ CONST WatermarkData* pWmData, - _Outptr_ IXMLDOMElement** ppWMDataElem, - _Out_ PTDOMElementVector* pParamInitList - ) -{ - HRESULT hr = S_OK; - - CComPtr<IXMLDOMElement> pOptionElem(NULL); - - if (SUCCEEDED(hr = CHECK_POINTER(pWmData, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(ppWMDataElem, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pParamInitList, E_POINTER)) && - SUCCEEDED(hr = CreateCommonWMElements(pWmData, ppWMDataElem, &pOptionElem, pParamInitList))) - { - // - // Set the option node name attribute - // - CComBSTR bstrAttribName(m_bstrKeywordsPrefix); - bstrAttribName += WATERMARK_OPTIONS[TextWatermark]; - - hr = CreateXMLAttribute(pOptionElem, NAME_ATTRIBUTE_NAME, NULL, bstrAttribName ); - } - - // - // Write out the text specific options - // - if (SUCCEEDED(hr)) - { - for (ETextWatermarkProps txtProps = ETextWatermarkPropsMin; - txtProps < ETextWatermarkPropsMax && SUCCEEDED(hr); - txtProps = static_cast<ETextWatermarkProps>(txtProps + 1)) - { - // - // Create the scored property element - // - CComPtr<IXMLDOMElement> pScoredProperty(NULL); - - if (SUCCEEDED(hr = CreateScoredProperty(CComBSTR(TXT_WATERMARK_PROPS[txtProps]), &pScoredProperty))) - { - // - // Construct the param ref and param init elements - // - CComBSTR bstrPRefName(WATERMARK_FEATURE); - bstrPRefName += TXT_WATERMARK_PROPS[txtProps]; - - CComPtr<IXMLDOMElement> pParamRef(NULL); - CComPtr<IXMLDOMElement> pParamInit(NULL); - - CComBSTR bstrType; - CComBSTR bstrValue; - - if (SUCCEEDED(hr = GetTxtPropTypeAndValue(pWmData, txtProps, &bstrType, &bstrValue)) && - SUCCEEDED(hr = CreateParamRefInitPair(bstrPRefName, bstrType, bstrValue, &pParamRef, &pParamInit))) - { - // - // Append the parameter ref element to the scored property, append the - // scored property to the option element and add the parameter init - // element to the param init list - // - CComPtr<IXMLDOMNode> pPRInserted(NULL); - CComPtr<IXMLDOMNode> pSPInserted(NULL); - - if (SUCCEEDED(hr = pScoredProperty->appendChild(pParamRef, &pPRInserted)) && - SUCCEEDED(hr = pOptionElem->appendChild(pScoredProperty, &pSPInserted))) - { - try - { - pParamInitList->push_back(pParamInit); - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - } - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWMPTHandler::CreateBitmapWMElements - -Routine Description: - - This routine creates a bitmap watermark feature in the PrintTicket - -Arguments: - - pWmData - Pointer to the watermark data structure - ppWMDataElem - Pointer to an IXMLDOMElement pointer that recieves feature element - pParamInitList - P:ointer to a vector of DOM element pointers that recieves the parameter init elements - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWMPTHandler::CreateBitmapWMElements( - _In_ CONST WatermarkData* pWmData, - _Outptr_ IXMLDOMElement** ppWMDataElem, - _Out_ PTDOMElementVector* pParamInitList - ) -{ - HRESULT hr = S_OK; - - CComPtr<IXMLDOMElement> pOptionElem(NULL); - - if (SUCCEEDED(hr = CHECK_POINTER(pWmData, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(ppWMDataElem, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pParamInitList, E_POINTER)) && - SUCCEEDED(hr = CreateCommonWMElements(pWmData, ppWMDataElem, &pOptionElem, pParamInitList)) && - SUCCEEDED(hr = CreateCommonVectBmpWMElements(pWmData, pOptionElem, pParamInitList))) - { - // - // Set the option node name attribute - // - CComBSTR bstrAttribName(m_bstrKeywordsPrefix); - bstrAttribName += WATERMARK_OPTIONS[BitmapWatermark]; - - hr = CreateXMLAttribute(pOptionElem, NAME_ATTRIBUTE_NAME, NULL, bstrAttribName ); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWMPTHandler::CreateVectorWMElements - -Routine Description: - - This routine creates a vector watermark feature in the PrintTicket - -Arguments: - - pWmData - Pointer to the watermark data structure - ppWMDataElem - Pointer to an IXMLDOMElement pointer that recieves feature element - pParamInitList - P:ointer to a vector of DOM element pointers that recieves the parameter init elements - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWMPTHandler::CreateVectorWMElements( - _In_ CONST WatermarkData* pWmData, - _Outptr_ IXMLDOMElement** ppWMDataElem, - _Out_ PTDOMElementVector* pParamInitList - ) -{ - HRESULT hr = S_OK; - - CComPtr<IXMLDOMElement> pOptionElem(NULL); - - if (SUCCEEDED(hr = CHECK_POINTER(pWmData, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(ppWMDataElem, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pParamInitList, E_POINTER)) && - SUCCEEDED(hr = CreateCommonWMElements(pWmData, ppWMDataElem, &pOptionElem, pParamInitList)) && - SUCCEEDED(hr = CreateCommonVectBmpWMElements(pWmData, pOptionElem, pParamInitList))) - { - // - // Set the option node name attribute - // - CComBSTR bstrAttribName(m_bstrKeywordsPrefix); - bstrAttribName += WATERMARK_OPTIONS[VectorWatermark]; - - hr = CreateXMLAttribute(pOptionElem, NAME_ATTRIBUTE_NAME, NULL, bstrAttribName ); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWMPTHandler::GetCmnPropTypeAndValue - -Routine Description: - - This routine initalises the type and value strings for a given common watermark property - -Arguments: - - pWmData - Pointer to a watermark data structure with the watermark settings - cmnProps - The watermark setting to retrieve the type and value for - pbstrType - Pointer to a BSTR that recieves the type of the value - pbstrValue - Pointer to a BSTR that recieves the value as a string - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWMPTHandler::GetCmnPropTypeAndValue( - _In_ CONST WatermarkData* pWmData, - _In_ CONST ECommonWatermarkProps cmnProps, - _Outptr_ BSTR* pbstrType, - _Outptr_ BSTR* pbstrValue - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pWmData, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pbstrType, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pbstrValue, E_POINTER))) - { - if (cmnProps < ECommonWatermarkPropsMin || - cmnProps >= ECommonWatermarkPropsMax) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - try - { - CStringXDW cstrType; - CStringXDW cstrValue; - - switch (cmnProps) - { - case WidthOrigin: - { - cstrType = SCHEMA_INTEGER; - cstrValue.Format(L"%i", pWmData->widthOrigin); - } - break; - - case HeightOrigin: - { - cstrType = SCHEMA_INTEGER; - cstrValue.Format(L"%i", pWmData->heightOrigin); - } - break; - - case Transparency: - { - cstrType = SCHEMA_INTEGER; - cstrValue.Format(L"%i", pWmData->transparency); - } - break; - - case Angle: - { - cstrType = SCHEMA_INTEGER; - cstrValue.Format(L"%i", pWmData->angle); - } - break; - - default: - { - hr = E_FAIL; - ERR("Unknown common watermark property\n"); - } - break; - } - - if (SUCCEEDED(hr)) - { - *pbstrType = cstrType.AllocSysString(); - *pbstrValue = cstrValue.AllocSysString(); - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWMPTHandler::GetCmnVectBmpPropTypeAndValue - -Routine Description: - - This routine initalises the type and value strings for a common vector and bitmap - watermark properties - -Arguments: - - pWmData - Pointer to a watermark data structure with the watermark settings - cmnProps - The setting to retrieve the type and value for - pbstrType - Pointer to a BSTR that recieves the type of the value - pbstrValue - Pointer to a BSTR that recieves the value as a string - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWMPTHandler::GetCmnVectBmpPropTypeAndValue( - _In_ CONST WatermarkData* pWmData, - _In_ CONST EVectBmpWatermarkProps cmnProps, - _Outptr_ BSTR* pbstrType, - _Outptr_ BSTR* pbstrValue - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pWmData, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pbstrType, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pbstrValue, E_POINTER))) - { - if (cmnProps < EVectBmpWatermarkPropsMin || - cmnProps >= EVectBmpWatermarkPropsMax) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - try - { - CStringXDW cstrType; - CStringXDW cstrValue; - - switch (cmnProps) - { - case WidthExtent: - { - cstrType = SCHEMA_INTEGER; - cstrValue.Format(L"%i", pWmData->widthExtent); - } - break; - - case HeightExtent: - { - cstrType = SCHEMA_INTEGER; - cstrValue.Format(L"%i", pWmData->heightExtent); - } - break; - - default: - { - hr = E_FAIL; - ERR("Unknown common watermark property\n"); - } - break; - } - - if (SUCCEEDED(hr)) - { - *pbstrType = cstrType.AllocSysString(); - *pbstrValue = cstrValue.AllocSysString(); - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWMPTHandler::GetTxtPropTypeAndValue - -Routine Description: - - This routine initalises the type and value strings for a given text watermark property - -Arguments: - - pWmData - Pointer to a watermark data structure with the watermark settings - txtProps - The text watermark setting to retrieve the type and value for - pbstrType - Pointer to a BSTR that recieves the type of the value - pbstrValue - Pointer to a BSTR that recieves the value as a string - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWMPTHandler::GetTxtPropTypeAndValue( - _In_ CONST WatermarkData* pWmData, - _In_ CONST ETextWatermarkProps txtProps, - _Outptr_ BSTR* pbstrType, - _Outptr_ BSTR* pbstrValue - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pWmData, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pbstrType, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pbstrValue, E_POINTER))) - { - if (txtProps < ETextWatermarkPropsMin || - txtProps >= ETextWatermarkPropsMax) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - try - { - CStringXDW cstrType; - CStringXDW cstrValue; - - switch (txtProps) - { - case FontColor: - { - cstrType = SCHEMA_STRING; - cstrValue.Format(L"%s", static_cast<LPCWSTR>(pWmData->txtData.bstrFontColor)); - } - break; - - case FontSize: - { - cstrType = SCHEMA_INTEGER; - cstrValue.Format(L"%i", pWmData->txtData.fontSize); - } - break; - - case Text: - { - cstrType = SCHEMA_STRING; - cstrValue.Format(L"%s", static_cast<LPCWSTR>(pWmData->txtData.bstrText)); - } - break; - - default: - { - hr = E_FAIL; - ERR("Unknown text watermark property\n"); - } - break; - } - - if (SUCCEEDED(hr)) - { - *pbstrType = cstrType.AllocSysString(); - *pbstrValue = cstrValue.AllocSysString(); - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/common/wmpthndlr.h b/print/XPSDrvSmpl/src/common/wmpthndlr.h deleted file mode 100644 index 0cfd24e8..00000000 --- a/print/XPSDrvSmpl/src/common/wmpthndlr.h +++ /dev/null @@ -1,116 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - wmpthnlr.h - -Abstract: - - PageWatermark PrintTicket handling definition. The watermark PT handler - is used to extract watermark settings from a PrintTicket and populate - the watermark properties class with the retrieved settings. The class also - defines a method for setting the feature in the PrintTicket given the - data structure. - ---*/ - -#pragma once - -#include "pthndlr.h" -#include "wmdata.h" - -class CWMPTHandler : public CPTHandler -{ -public: - CWMPTHandler( - _In_ IXMLDOMDocument2* pPrintTicket - ); - - virtual ~CWMPTHandler(); - - HRESULT - GetData( - _Out_ XDPrintSchema::PageWatermark::WatermarkData* pWmData - ); - - HRESULT - SetData( - _In_ CONST XDPrintSchema::PageWatermark::WatermarkData* pWmData - ); - - HRESULT - Delete( - VOID - ); - -private: - HRESULT - CreateCommonWMElements( - _In_ CONST XDPrintSchema::PageWatermark::WatermarkData* pWmData, - _Outptr_ IXMLDOMElement** ppWMDataElem, - _Outptr_ IXMLDOMElement** ppOptionElem, - _Out_ PTDOMElementVector* pParamInitList - ); - - HRESULT - CreateCommonVectBmpWMElements( - _In_ CONST XDPrintSchema::PageWatermark::WatermarkData* pWmData, - _In_ IXMLDOMElement* pOptionElem, - _Out_ PTDOMElementVector* pParamInitList - ); - - HRESULT - CreateTextWMElements( - _In_ CONST XDPrintSchema::PageWatermark::WatermarkData* pWmData, - _Outptr_ IXMLDOMElement** ppWMDataElem, - _Out_ PTDOMElementVector* pParamInitList - ); - - HRESULT - CreateBitmapWMElements( - _In_ CONST XDPrintSchema::PageWatermark::WatermarkData* pWmData, - _Outptr_ IXMLDOMElement** ppWMDataElem, - _Out_ PTDOMElementVector* pParamInitList - ); - - HRESULT - CreateVectorWMElements( - _In_ CONST XDPrintSchema::PageWatermark::WatermarkData* pWmData, - _Outptr_ IXMLDOMElement** ppWMDataElem, - _Out_ PTDOMElementVector* pParamInitList - ); - - HRESULT - GetCmnPropTypeAndValue( - _In_ CONST XDPrintSchema::PageWatermark::WatermarkData* pWmData, - _In_ CONST XDPrintSchema::PageWatermark::ECommonWatermarkProps cmnProps, - _Outptr_ BSTR* pbstrType, - _Outptr_ BSTR* pbstrValue - ); - - HRESULT - GetCmnVectBmpPropTypeAndValue( - _In_ CONST XDPrintSchema::PageWatermark::WatermarkData* pWmData, - _In_ CONST XDPrintSchema::PageWatermark::EVectBmpWatermarkProps cmnProps, - _Outptr_ BSTR* pbstrType, - _Outptr_ BSTR* pbstrValue - ); - - HRESULT - GetTxtPropTypeAndValue( - _In_ CONST XDPrintSchema::PageWatermark::WatermarkData* pWmData, - _In_ CONST XDPrintSchema::PageWatermark::ETextWatermarkProps txtProps, - _Outptr_ BSTR* pbstrType, - _Outptr_ BSTR* pbstrValue - ); -}; - diff --git a/print/XPSDrvSmpl/src/common/wmschema.cpp b/print/XPSDrvSmpl/src/common/wmschema.cpp deleted file mode 100644 index 286e33db..00000000 --- a/print/XPSDrvSmpl/src/common/wmschema.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - wmschema.cpp - -Abstract: - - PageWatermark PrintSchema implementation. This implements the features, - options and enumerations that describe the PrintSchema PageWatermark feature. - ---*/ - -#include "precomp.h" -#include "wmschema.h" - -LPCWSTR XDPrintSchema::PageWatermark::WATERMARK_FEATURE = L"PageWatermark"; - -LPCWSTR XDPrintSchema::PageWatermark::WATERMARK_OPTIONS[] = { - L"None", - L"Text", - L"BitmapGraphic", - L"VectorGraphic" -}; - -LPCWSTR XDPrintSchema::PageWatermark::CMN_WATERMARK_PROPS[] = { - L"OriginWidth", - L"OriginHeight", - L"Transparency", - L"Angle" -}; - -LPCWSTR XDPrintSchema::PageWatermark::TXT_WATERMARK_PROPS[] = { - L"TextColor", - L"TextFontSize", - L"TextText" -}; - -LPCWSTR XDPrintSchema::PageWatermark::VECTBMP_WATERMARK_PROPS[] = { - L"SizeWidth", - L"SizeHeight" -}; - -LPCWSTR XDPrintSchema::PageWatermark::Layering::LAYERING_FEATURE = L"Layering"; - -LPCWSTR XDPrintSchema::PageWatermark::Layering::LAYERING_OPTIONS[] = { - L"Underlay", - L"Overlay" -}; - - diff --git a/print/XPSDrvSmpl/src/common/wmschema.h b/print/XPSDrvSmpl/src/common/wmschema.h deleted file mode 100644 index 734a99df..00000000 --- a/print/XPSDrvSmpl/src/common/wmschema.h +++ /dev/null @@ -1,114 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - wmschema.h - -Abstract: - - PageWatermark PrintSchema definition. This defines the features, options - and enumerations that describe the PrintSchema PageWatermark feature within - a XDPrintSchema::PageWatermark namespace. - ---*/ - -#pragma once - -#include "schema.h" - -namespace XDPrintSchema -{ - // - // PageWatermark elements described as Printschema keywords - // - namespace PageWatermark - { - // - // Feature name - // - extern LPCWSTR WATERMARK_FEATURE; - - // - // Option names - // - enum EWatermarkOption - { - NoWatermark = 0, EWatermarkOptionMin = 0, - TextWatermark, - BitmapWatermark, - VectorWatermark, - EWatermarkOptionMax - }; - - extern LPCWSTR WATERMARK_OPTIONS[EWatermarkOptionMax]; - - // - // Common watermark properties - // - enum ECommonWatermarkProps - { - WidthOrigin = 0, ECommonWatermarkPropsMin = 0, - HeightOrigin, - Transparency, - Angle, - ECommonWatermarkPropsMax - }; - - extern LPCWSTR CMN_WATERMARK_PROPS[ECommonWatermarkPropsMax]; - - // - // Text watermark properties - // - enum ETextWatermarkProps - { - FontColor = 0, ETextWatermarkPropsMin = 0, - FontSize, - Text, - ETextWatermarkPropsMax - }; - - extern LPCWSTR TXT_WATERMARK_PROPS[ETextWatermarkPropsMax]; - - // - // Vector / Bitmap common properties - // - enum EVectBmpWatermarkProps - { - WidthExtent = 0, EVectBmpWatermarkPropsMin = 0, - HeightExtent, - EVectBmpWatermarkPropsMax - }; - - extern LPCWSTR VECTBMP_WATERMARK_PROPS[EVectBmpWatermarkPropsMax]; - - // - // Layering sub feature - // - namespace Layering - { - extern LPCWSTR LAYERING_FEATURE; - - // - // Layering options - // - enum ELayeringOption - { - Underlay = 0, ELayeringOptionMin = 0, - Overlay, - ELayeringOptionMax - }; - - extern LPCWSTR LAYERING_OPTIONS[ELayeringOptionMax]; - } - } -} - diff --git a/print/XPSDrvSmpl/src/common/workbuff.cpp b/print/XPSDrvSmpl/src/common/workbuff.cpp deleted file mode 100644 index efa5fcc8..00000000 --- a/print/XPSDrvSmpl/src/common/workbuff.cpp +++ /dev/null @@ -1,233 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - workbuff.cpp - -Abstract: - - CWorkingBuffer class implementation. This class provides a means of working - with a local buffer by defining a simple interface that allows the retrieval - of a buffer of an appropriate size, handling reallocation as necessary. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "workbuff.h" - -/*++ - -Routine Name: - - CWorkingBuffer::CWorkingBuffer - -Routine Description: - - CWorkingBuffer class constructor - -Arguments: - - None - -Return Value: - - None - Throws CXDException(HRESULT) on an error - ---*/ -CWorkingBuffer::CWorkingBuffer() : - m_pBuffer(NULL), - m_cbSize(CB_COPY_BUFFER) -{ - m_pBuffer = HeapAlloc(GetProcessHeap(), 0, m_cbSize); - - if (m_pBuffer == NULL) - { - m_cbSize = 0; - throw CXDException(E_OUTOFMEMORY); - } -} - -/*++ - -Routine Name: - - CWorkingBuffer::~CWorkingBuffer - -Routine Description: - - CWorkingBuffer class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CWorkingBuffer::~CWorkingBuffer() -{ - if (m_pBuffer != NULL) - { - HeapFree(GetProcessHeap(), 0, m_pBuffer); - m_pBuffer = NULL; - m_cbSize = 0; - } -} - -/*++ - -Routine Name: - - CWorkingBuffer::GetBuffer - -Routine Description: - - This routine returns a pointer to a buffer of at least the requested size. If the internal - buffer is not large enough it will be resized accordingly. - -Arguments: - - cbSize - Requested size of the buffer - ppBuffer - Pointer to a VOID pointer that recieves the buffer - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWorkingBuffer::GetBuffer( - _In_ CONST ULONGLONG cbSize, - _Outptr_result_bytebuffer_(cbSize) PVOID* ppBuffer - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppBuffer, E_POINTER))) - { - *ppBuffer = NULL; - - if (cbSize == 0) - { - hr = E_INVALIDARG; - } - - if (m_cbSize == 0) - { - // - // We have no existing buffer - we should have one - // - hr = E_FAIL; - } - } - - if (SUCCEEDED(hr)) - { - if (m_cbSize >= cbSize) - { - *ppBuffer = m_pBuffer; - } - else - { - // - // Double the buffer size till it is greater than the requested size - // - SIZE_T cbNewSize = m_cbSize; - while (cbNewSize < cbSize) - { - cbNewSize *= 2; - }; - - _Analysis_assume_(cbNewSize >= 1); - - // - // Reallocate the buffer - // - PVOID pNewBuffer = HeapReAlloc(GetProcessHeap(), 0, m_pBuffer, cbNewSize); - - if (pNewBuffer != NULL) - { - m_cbSize = cbNewSize; - m_pBuffer = pNewBuffer; - *ppBuffer = m_pBuffer; - } - else - { - hr = E_OUTOFMEMORY; - } - } - } - - ERR_ON_HR(hr); - return hr; -}; - -/*++ - -Routine Name: - - CWorkingBuffer::GetBufferAt - -Routine Description: - - This routine returns a pointer into the internal buffer at the requested offset. This will - not grow the size of the buffer. - -Arguments: - - cbOffset - Offset into the internal buffer - cbSize - Size of the requested buffer - ppBuffer - Pointer to a VOID pointer that recieves the buffer - -Return Value: - - HRESULT - S_OK - On success - HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER) - If the internal buffer is not large enough - E_* - On error - ---*/ -HRESULT -CWorkingBuffer::GetBufferAt( - _In_ ULONG cbOffset, - _In_ CONST ULONGLONG cbSize, - _Outptr_result_bytebuffer_(cbSize) PVOID* ppBuffer - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppBuffer, E_POINTER))) - { - *ppBuffer = NULL; - - if (cbSize + cbOffset < m_cbSize) - { - *ppBuffer = reinterpret_cast<PBYTE>(m_pBuffer) + cbOffset; - } - else - { - hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); - } - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/common/workbuff.h b/print/XPSDrvSmpl/src/common/workbuff.h deleted file mode 100644 index 263e97d3..00000000 --- a/print/XPSDrvSmpl/src/common/workbuff.h +++ /dev/null @@ -1,51 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - workbuff.h - -Abstract: - - CWorkingBuffer class definition. This class provides a means of working - with a local buffer by defining a simple interface that allows the retrieval - of a buffer of an appropriate size, handling reallocation as necessary. - ---*/ - -#pragma once - -class CWorkingBuffer -{ -public: - CWorkingBuffer(); - - virtual ~CWorkingBuffer(); - - HRESULT - GetBuffer( - _In_ CONST ULONGLONG cbSize, - _Outptr_result_bytebuffer_(cbSize) PVOID* ppBuffer - ); - - HRESULT - GetBufferAt( - _In_ ULONG cbOffset, - _In_ CONST ULONGLONG cbSize, - _Outptr_result_bytebuffer_(cbSize) PVOID* ppBuffer - ); - -private: - _Field_size_bytes_(m_cbSize) PVOID m_pBuffer; - - SIZE_T m_cbSize; -}; - diff --git a/print/XPSDrvSmpl/src/common/xdsmplcmn.vcxproj b/print/XPSDrvSmpl/src/common/xdsmplcmn.vcxproj deleted file mode 100644 index 7cd9846d..00000000 --- a/print/XPSDrvSmpl/src/common/xdsmplcmn.vcxproj +++ /dev/null @@ -1,593 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <ItemGroup Label="ProjectConfigurations"> - <ProjectConfiguration Include="Debug|ARM"> - <Configuration>Debug</Configuration> - <Platform>ARM</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Debug|ARM64"> - <Configuration>Debug</Configuration> - <Platform>ARM64</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Debug|Win32"> - <Configuration>Debug</Configuration> - <Platform>Win32</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release|ARM"> - <Configuration>Release</Configuration> - <Platform>ARM</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release|ARM64"> - <Configuration>Release</Configuration> - <Platform>ARM64</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release|Win32"> - <Configuration>Release</Configuration> - <Platform>Win32</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Debug|x64"> - <Configuration>Debug</Configuration> - <Platform>x64</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release|x64"> - <Configuration>Release</Configuration> - <Platform>x64</Platform> - </ProjectConfiguration> - </ItemGroup> - <PropertyGroup Label="Globals"> - <ProjectGuid>{42677515-C196-4C0F-99A2-F11E2FB55BF6}</ProjectGuid> - <RootNamespace>$(MSBuildProjectName)</RootNamespace> - <SupportsPackaging>false</SupportsPackaging> - <RequiresPackageProject>true</RequiresPackageProject> - <Configuration Condition="'$(Configuration)' == ''">Debug</Configuration> - <Platform Condition="'$(Platform)' == ''">Win32</Platform> - <SampleGuid>{D1077168-B333-455C-93E8-E83066110321}</SampleGuid> - </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> - <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>False</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>StaticLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>False</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>StaticLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>False</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>StaticLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>True</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>StaticLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>True</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>StaticLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>True</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>StaticLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>False</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>StaticLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>True</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>StaticLibrary</ConfigurationType> - </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> - <PropertyGroup> - <OutDir>$(IntDir)</OutDir> - </PropertyGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ItemGroup Label="WrappedTaskItems" /> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);.\;.\..\inc;.\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);.\;.\..\inc;.\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);.\;.\..\inc;.\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);.\;.\..\inc;.\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);.\;.\..\inc;.\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);.\;.\..\inc;.\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);.\;.\..\inc;.\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);.\;.\..\inc;.\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);.\;.\..\inc;.\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);.\;.\..\inc;.\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);.\;.\..\inc;.\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);.\;.\..\inc;.\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);.\;.\..\inc;.\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);.\;.\..\inc;.\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);.\;.\..\inc;.\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);.\;.\..\inc;.\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);.\;.\..\inc;.\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);.\;.\..\inc;.\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);.\;.\..\inc;.\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);.\;.\..\inc;.\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);.\;.\..\inc;.\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);.\;.\..\inc;.\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);.\;.\..\inc;.\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);.\;.\..\inc;.\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <TargetName>xdsmplcmn</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'"> - <TargetName>xdsmplcmn</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> - <TargetName>xdsmplcmn</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <TargetName>xdsmplcmn</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'"> - <TargetName>xdsmplcmn</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> - <TargetName>xdsmplcmn</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <TargetName>xdsmplcmn</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <TargetName>xdsmplcmn</TargetName> - </PropertyGroup> - <ItemGroup> - <ClCompile Include="bkpchndlr.cpp"> - <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="bkpthndlr.cpp"> - <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="bkschema.cpp"> - <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="cmintentsschema.cpp"> - <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="cmintpthndlr.cpp"> - <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="cmprofileschema.cpp"> - <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="cmprofpchndlr.cpp"> - <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="cmprofpthndlr.cpp"> - <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="cmpthndlr.cpp"> - <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="cmschema.cpp"> - <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="globals.cpp"> - <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="nupchndlr.cpp"> - <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="nupschema.cpp"> - <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="nupthndlr.cpp"> - <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="pchndlr.cpp"> - <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="pgscpchndlr.cpp"> - <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="pgscpthndlr.cpp"> - <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="pgscschema.cpp"> - <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="pimagepthndlr.cpp"> - <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="pimageschema.cpp"> - <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="porientpthndlr.cpp"> - <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="porientschema.cpp"> - <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="precompsrc.cpp"> - <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Create</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="pshndlr.cpp"> - <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="psizepthndlr.cpp"> - <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="psizeschema.cpp"> - <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="pthndlr.cpp"> - <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="ptquerybld.cpp"> - <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="schema.cpp"> - <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="wmpchndlr.cpp"> - <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="wmpthndlr.cpp"> - <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="wmschema.cpp"> - <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="workbuff.cpp"> - <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - </ItemGroup> - <ItemGroup> - <Inf Exclude="@(Inf)" Include="*.inf" /> - <FilesToPackage Include="$(TargetPath)" Condition="'$(ConfigurationType)'=='Driver' or '$(ConfigurationType)'=='DynamicLibrary'" /> - </ItemGroup> - <ItemGroup> - <None Exclude="@(None)" Include="*.txt;*.htm;*.html" /> - <None Exclude="@(None)" Include="*.ico;*.cur;*.bmp;*.dlg;*.rct;*.gif;*.jpg;*.jpeg;*.wav;*.jpe;*.tiff;*.tif;*.png;*.rc2" /> - <None Exclude="@(None)" Include="*.def;*.bat;*.hpj;*.asmx" /> - </ItemGroup> - <ItemGroup> - <ClInclude Exclude="@(ClInclude)" Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd" /> - </ItemGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> -</Project>
\ No newline at end of file diff --git a/print/XPSDrvSmpl/src/common/xdsmplcmn.vcxproj.Filters b/print/XPSDrvSmpl/src/common/xdsmplcmn.vcxproj.Filters deleted file mode 100644 index b9b2d859..00000000 --- a/print/XPSDrvSmpl/src/common/xdsmplcmn.vcxproj.Filters +++ /dev/null @@ -1,2230 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <ItemGroup> - <Filter Include="Source Files"> - <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;*</Extensions> - <UniqueIdentifier>{75E1F153-C8D9-48CA-BE6B-826ECD1DB3AD}</UniqueIdentifier> - </Filter> - <Filter Include="Header Files"> - <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions> - <UniqueIdentifier>{C230151A-AC0B-49BB-801B-E64449458C5F}</UniqueIdentifier> - </Filter> - <Filter Include="Resource Files"> - <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms;man;xml</Extensions> - <UniqueIdentifier>{DAF0D217-1F43-40AB-871C-801F743FDFC9}</UniqueIdentifier> - </Filter> - </ItemGroup> - <ItemGroup> - <ClCompile Include="bkpchndlr.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="bkpthndlr.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="bkschema.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="cmintentsschema.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="cmintpthndlr.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="cmprofileschema.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="cmprofpchndlr.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="cmprofpthndlr.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="cmpthndlr.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="cmschema.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="globals.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="nupchndlr.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="nupschema.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="nupthndlr.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="pchndlr.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="pgscpchndlr.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="pgscpthndlr.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="pgscschema.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="pimagepthndlr.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="pimageschema.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="porientpthndlr.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="porientschema.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="precompsrc.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="pshndlr.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="psizepthndlr.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="psizeschema.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="pthndlr.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="ptquerybld.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="schema.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="wmpchndlr.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="wmpthndlr.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="wmschema.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="workbuff.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - </ItemGroup> - <ItemGroup> - <ClInclude Include="bkdata.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="bkpchndlr.h" /> - <ClInclude Include="bkpthndlr.h" /> - <ClInclude Include="bkschema.h" /> - <ClInclude Include="cmdata.h" /> - <ClInclude Include="cmintentsdata.h" /> - <ClInclude Include="cmintentsschema.h" /> - <ClInclude Include="cmintpthndlr.h" /> - <ClInclude Include="cmprofiledata.h" /> - <ClInclude Include="cmprofileschema.h" /> - <ClInclude Include="cmprofpchndlr.h" /> - <ClInclude Include="cmprofpthndlr.h" /> - <ClInclude Include="cmpthndlr.h" /> - <ClInclude Include="cmschema.h" /> - <ClInclude Include="globals.h" /> - <ClInclude Include="nupchndlr.h" /> - <ClInclude Include="nupdata.h" /> - <ClInclude Include="nupschema.h" /> - <ClInclude Include="nupthndlr.h" /> - <ClInclude Include="pchndlr.h" /> - <ClInclude Include="pgscdata.h" /> - <ClInclude Include="pgscpchndlr.h" /> - <ClInclude Include="pgscpthndlr.h" /> - <ClInclude Include="pgscschema.h" /> - <ClInclude Include="pimagedata.h" /> - <ClInclude Include="pimagepthndlr.h" /> - <ClInclude Include="pimageschema.h" /> - <ClInclude Include="porientdata.h" /> - <ClInclude Include="porientpthndlr.h" /> - <ClInclude Include="porientschema.h" /> - <ClInclude Include="precomp.h" /> - <ClInclude Include="privatedefs.h" /> - <ClInclude Include="pshndlr.h" /> - <ClInclude Include="psizedata.h" /> - <ClInclude Include="psizepthndlr.h" /> - <ClInclude Include="psizeschema.h" /> - <ClInclude Include="pthndlr.h" /> - <ClInclude Include="ptquerybld.h" /> - <ClInclude Include="schema.h" /> - <ClInclude Include="wmdata.h" /> - <ClInclude Include="wmpchndlr.h" /> - <ClInclude Include="wmpthndlr.h" /> - <ClInclude Include="wmschema.h" /> - <ClInclude Include="workbuff.h" /> - <ClInclude Include="bkdata.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="bkpchndlr.h" /> - <ClInclude Include="bkpthndlr.h" /> - <ClInclude Include="bkschema.h" /> - <ClInclude Include="cmdata.h" /> - <ClInclude Include="cmintentsdata.h" /> - <ClInclude Include="cmintentsschema.h" /> - <ClInclude Include="cmintpthndlr.h" /> - <ClInclude Include="cmprofiledata.h" /> - <ClInclude Include="cmprofileschema.h" /> - <ClInclude Include="cmprofpchndlr.h" /> - <ClInclude Include="cmprofpthndlr.h" /> - <ClInclude Include="cmpthndlr.h" /> - <ClInclude Include="cmschema.h" /> - <ClInclude Include="globals.h" /> - <ClInclude Include="nupchndlr.h" /> - <ClInclude Include="nupdata.h" /> - <ClInclude Include="nupschema.h" /> - <ClInclude Include="nupthndlr.h" /> - <ClInclude Include="pchndlr.h" /> - <ClInclude Include="pgscdata.h" /> - <ClInclude Include="pgscpchndlr.h" /> - <ClInclude Include="pgscpthndlr.h" /> - <ClInclude Include="pgscschema.h" /> - <ClInclude Include="pimagedata.h" /> - <ClInclude Include="pimagepthndlr.h" /> - <ClInclude Include="pimageschema.h" /> - <ClInclude Include="porientdata.h" /> - <ClInclude Include="porientpthndlr.h" /> - <ClInclude Include="porientschema.h" /> - <ClInclude Include="precomp.h" /> - <ClInclude Include="privatedefs.h" /> - <ClInclude Include="pshndlr.h" /> - <ClInclude Include="psizedata.h" /> - <ClInclude Include="psizepthndlr.h" /> - <ClInclude Include="psizeschema.h" /> - <ClInclude Include="pthndlr.h" /> - <ClInclude Include="ptquerybld.h" /> - <ClInclude Include="schema.h" /> - <ClInclude Include="wmdata.h" /> - <ClInclude Include="wmpchndlr.h" /> - <ClInclude Include="wmpthndlr.h" /> - <ClInclude Include="wmschema.h" /> - <ClInclude Include="workbuff.h" /> - <ClInclude Include="bkdata.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="bkpchndlr.h" /> - <ClInclude Include="bkpthndlr.h" /> - <ClInclude Include="bkschema.h" /> - <ClInclude Include="cmdata.h" /> - <ClInclude Include="cmintentsdata.h" /> - <ClInclude Include="cmintentsschema.h" /> - <ClInclude Include="cmintpthndlr.h" /> - <ClInclude Include="cmprofiledata.h" /> - <ClInclude Include="cmprofileschema.h" /> - <ClInclude Include="cmprofpchndlr.h" /> - <ClInclude Include="cmprofpthndlr.h" /> - <ClInclude Include="cmpthndlr.h" /> - <ClInclude Include="cmschema.h" /> - <ClInclude Include="globals.h" /> - <ClInclude Include="nupchndlr.h" /> - <ClInclude Include="nupdata.h" /> - <ClInclude Include="nupschema.h" /> - <ClInclude Include="nupthndlr.h" /> - <ClInclude Include="pchndlr.h" /> - <ClInclude Include="pgscdata.h" /> - <ClInclude Include="pgscpchndlr.h" /> - <ClInclude Include="pgscpthndlr.h" /> - <ClInclude Include="pgscschema.h" /> - <ClInclude Include="pimagedata.h" /> - <ClInclude Include="pimagepthndlr.h" /> - <ClInclude Include="pimageschema.h" /> - <ClInclude Include="porientdata.h" /> - <ClInclude Include="porientpthndlr.h" /> - <ClInclude Include="porientschema.h" /> - <ClInclude Include="precomp.h" /> - <ClInclude Include="privatedefs.h" /> - <ClInclude Include="pshndlr.h" /> - <ClInclude Include="psizedata.h" /> - <ClInclude Include="psizepthndlr.h" /> - <ClInclude Include="psizeschema.h" /> - <ClInclude Include="pthndlr.h" /> - <ClInclude Include="ptquerybld.h" /> - <ClInclude Include="schema.h" /> - <ClInclude Include="wmdata.h" /> - <ClInclude Include="wmpchndlr.h" /> - <ClInclude Include="wmpthndlr.h" /> - <ClInclude Include="wmschema.h" /> - <ClInclude Include="workbuff.h" /> - <ClInclude Include="bkdata.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="bkpchndlr.h" /> - <ClInclude Include="bkpthndlr.h" /> - <ClInclude Include="bkschema.h" /> - <ClInclude Include="cmdata.h" /> - <ClInclude Include="cmintentsdata.h" /> - <ClInclude Include="cmintentsschema.h" /> - <ClInclude Include="cmintpthndlr.h" /> - <ClInclude Include="cmprofiledata.h" /> - <ClInclude Include="cmprofileschema.h" /> - <ClInclude Include="cmprofpchndlr.h" /> - <ClInclude Include="cmprofpthndlr.h" /> - <ClInclude Include="cmpthndlr.h" /> - <ClInclude Include="cmschema.h" /> - <ClInclude Include="globals.h" /> - <ClInclude Include="nupchndlr.h" /> - <ClInclude Include="nupdata.h" /> - <ClInclude Include="nupschema.h" /> - <ClInclude Include="nupthndlr.h" /> - <ClInclude Include="pchndlr.h" /> - <ClInclude Include="pgscdata.h" /> - <ClInclude Include="pgscpchndlr.h" /> - <ClInclude Include="pgscpthndlr.h" /> - <ClInclude Include="pgscschema.h" /> - <ClInclude Include="pimagedata.h" /> - <ClInclude Include="pimagepthndlr.h" /> - <ClInclude Include="pimageschema.h" /> - <ClInclude Include="porientdata.h" /> - <ClInclude Include="porientpthndlr.h" /> - <ClInclude Include="porientschema.h" /> - <ClInclude Include="precomp.h" /> - <ClInclude Include="privatedefs.h" /> - <ClInclude Include="pshndlr.h" /> - <ClInclude Include="psizedata.h" /> - <ClInclude Include="psizepthndlr.h" /> - <ClInclude Include="psizeschema.h" /> - <ClInclude Include="pthndlr.h" /> - <ClInclude Include="ptquerybld.h" /> - <ClInclude Include="schema.h" /> - <ClInclude Include="wmdata.h" /> - <ClInclude Include="wmpchndlr.h" /> - <ClInclude Include="wmpthndlr.h" /> - <ClInclude Include="wmschema.h" /> - <ClInclude Include="workbuff.h" /> - <ClInclude Include="bkdata.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="bkpchndlr.h" /> - <ClInclude Include="bkpthndlr.h" /> - <ClInclude Include="bkschema.h" /> - <ClInclude Include="cmdata.h" /> - <ClInclude Include="cmintentsdata.h" /> - <ClInclude Include="cmintentsschema.h" /> - <ClInclude Include="cmintpthndlr.h" /> - <ClInclude Include="cmprofiledata.h" /> - <ClInclude Include="cmprofileschema.h" /> - <ClInclude Include="cmprofpchndlr.h" /> - <ClInclude Include="cmprofpthndlr.h" /> - <ClInclude Include="cmpthndlr.h" /> - <ClInclude Include="cmschema.h" /> - <ClInclude Include="globals.h" /> - <ClInclude Include="nupchndlr.h" /> - <ClInclude Include="nupdata.h" /> - <ClInclude Include="nupschema.h" /> - <ClInclude Include="nupthndlr.h" /> - <ClInclude Include="pchndlr.h" /> - <ClInclude Include="pgscdata.h" /> - <ClInclude Include="pgscpchndlr.h" /> - <ClInclude Include="pgscpthndlr.h" /> - <ClInclude Include="pgscschema.h" /> - <ClInclude Include="pimagedata.h" /> - <ClInclude Include="pimagepthndlr.h" /> - <ClInclude Include="pimageschema.h" /> - <ClInclude Include="porientdata.h" /> - <ClInclude Include="porientpthndlr.h" /> - <ClInclude Include="porientschema.h" /> - <ClInclude Include="precomp.h" /> - <ClInclude Include="privatedefs.h" /> - <ClInclude Include="pshndlr.h" /> - <ClInclude Include="psizedata.h" /> - <ClInclude Include="psizepthndlr.h" /> - <ClInclude Include="psizeschema.h" /> - <ClInclude Include="pthndlr.h" /> - <ClInclude Include="ptquerybld.h" /> - <ClInclude Include="schema.h" /> - <ClInclude Include="wmdata.h" /> - <ClInclude Include="wmpchndlr.h" /> - <ClInclude Include="wmpthndlr.h" /> - <ClInclude Include="wmschema.h" /> - <ClInclude Include="workbuff.h" /> - <ClInclude Include="bkdata.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="bkpchndlr.h" /> - <ClInclude Include="bkpthndlr.h" /> - <ClInclude Include="bkschema.h" /> - <ClInclude Include="cmdata.h" /> - <ClInclude Include="cmintentsdata.h" /> - <ClInclude Include="cmintentsschema.h" /> - <ClInclude Include="cmintpthndlr.h" /> - <ClInclude Include="cmprofiledata.h" /> - <ClInclude Include="cmprofileschema.h" /> - <ClInclude Include="cmprofpchndlr.h" /> - <ClInclude Include="cmprofpthndlr.h" /> - <ClInclude Include="cmpthndlr.h" /> - <ClInclude Include="cmschema.h" /> - <ClInclude Include="globals.h" /> - <ClInclude Include="nupchndlr.h" /> - <ClInclude Include="nupdata.h" /> - <ClInclude Include="nupschema.h" /> - <ClInclude Include="nupthndlr.h" /> - <ClInclude Include="pchndlr.h" /> - <ClInclude Include="pgscdata.h" /> - <ClInclude Include="pgscpchndlr.h" /> - <ClInclude Include="pgscpthndlr.h" /> - <ClInclude Include="pgscschema.h" /> - <ClInclude Include="pimagedata.h" /> - <ClInclude Include="pimagepthndlr.h" /> - <ClInclude Include="pimageschema.h" /> - <ClInclude Include="porientdata.h" /> - <ClInclude Include="porientpthndlr.h" /> - <ClInclude Include="porientschema.h" /> - <ClInclude Include="precomp.h" /> - <ClInclude Include="privatedefs.h" /> - <ClInclude Include="pshndlr.h" /> - <ClInclude Include="psizedata.h" /> - <ClInclude Include="psizepthndlr.h" /> - <ClInclude Include="psizeschema.h" /> - <ClInclude Include="pthndlr.h" /> - <ClInclude Include="ptquerybld.h" /> - <ClInclude Include="schema.h" /> - <ClInclude Include="wmdata.h" /> - <ClInclude Include="wmpchndlr.h" /> - <ClInclude Include="wmpthndlr.h" /> - <ClInclude Include="wmschema.h" /> - <ClInclude Include="workbuff.h" /> - <ClInclude Include="bkdata.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="bkpchndlr.h" /> - <ClInclude Include="bkpthndlr.h" /> - <ClInclude Include="bkschema.h" /> - <ClInclude Include="cmdata.h" /> - <ClInclude Include="cmintentsdata.h" /> - <ClInclude Include="cmintentsschema.h" /> - <ClInclude Include="cmintpthndlr.h" /> - <ClInclude Include="cmprofiledata.h" /> - <ClInclude Include="cmprofileschema.h" /> - <ClInclude Include="cmprofpchndlr.h" /> - <ClInclude Include="cmprofpthndlr.h" /> - <ClInclude Include="cmpthndlr.h" /> - <ClInclude Include="cmschema.h" /> - <ClInclude Include="globals.h" /> - <ClInclude Include="nupchndlr.h" /> - <ClInclude Include="nupdata.h" /> - <ClInclude Include="nupschema.h" /> - <ClInclude Include="nupthndlr.h" /> - <ClInclude Include="pchndlr.h" /> - <ClInclude Include="pgscdata.h" /> - <ClInclude Include="pgscpchndlr.h" /> - <ClInclude Include="pgscpthndlr.h" /> - <ClInclude Include="pgscschema.h" /> - <ClInclude Include="pimagedata.h" /> - <ClInclude Include="pimagepthndlr.h" /> - <ClInclude Include="pimageschema.h" /> - <ClInclude Include="porientdata.h" /> - <ClInclude Include="porientpthndlr.h" /> - <ClInclude Include="porientschema.h" /> - <ClInclude Include="precomp.h" /> - <ClInclude Include="privatedefs.h" /> - <ClInclude Include="pshndlr.h" /> - <ClInclude Include="psizedata.h" /> - <ClInclude Include="psizepthndlr.h" /> - <ClInclude Include="psizeschema.h" /> - <ClInclude Include="pthndlr.h" /> - <ClInclude Include="ptquerybld.h" /> - <ClInclude Include="schema.h" /> - <ClInclude Include="wmdata.h" /> - <ClInclude Include="wmpchndlr.h" /> - <ClInclude Include="wmpthndlr.h" /> - <ClInclude Include="wmschema.h" /> - <ClInclude Include="workbuff.h" /> - <ClInclude Include="bkdata.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="bkpchndlr.h" /> - <ClInclude Include="bkpthndlr.h" /> - <ClInclude Include="bkschema.h" /> - <ClInclude Include="cmdata.h" /> - <ClInclude Include="cmintentsdata.h" /> - <ClInclude Include="cmintentsschema.h" /> - <ClInclude Include="cmintpthndlr.h" /> - <ClInclude Include="cmprofiledata.h" /> - <ClInclude Include="cmprofileschema.h" /> - <ClInclude Include="cmprofpchndlr.h" /> - <ClInclude Include="cmprofpthndlr.h" /> - <ClInclude Include="cmpthndlr.h" /> - <ClInclude Include="cmschema.h" /> - <ClInclude Include="globals.h" /> - <ClInclude Include="nupchndlr.h" /> - <ClInclude Include="nupdata.h" /> - <ClInclude Include="nupschema.h" /> - <ClInclude Include="nupthndlr.h" /> - <ClInclude Include="pchndlr.h" /> - <ClInclude Include="pgscdata.h" /> - <ClInclude Include="pgscpchndlr.h" /> - <ClInclude Include="pgscpthndlr.h" /> - <ClInclude Include="pgscschema.h" /> - <ClInclude Include="pimagedata.h" /> - <ClInclude Include="pimagepthndlr.h" /> - <ClInclude Include="pimageschema.h" /> - <ClInclude Include="porientdata.h" /> - <ClInclude Include="porientpthndlr.h" /> - <ClInclude Include="porientschema.h" /> - <ClInclude Include="precomp.h" /> - <ClInclude Include="privatedefs.h" /> - <ClInclude Include="pshndlr.h" /> - <ClInclude Include="psizedata.h" /> - <ClInclude Include="psizepthndlr.h" /> - <ClInclude Include="psizeschema.h" /> - <ClInclude Include="pthndlr.h" /> - <ClInclude Include="ptquerybld.h" /> - <ClInclude Include="schema.h" /> - <ClInclude Include="wmdata.h" /> - <ClInclude Include="wmpchndlr.h" /> - <ClInclude Include="wmpthndlr.h" /> - <ClInclude Include="wmschema.h" /> - <ClInclude Include="workbuff.h" /> - <ClInclude Include="bkdata.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="bkpchndlr.h" /> - <ClInclude Include="bkpthndlr.h" /> - <ClInclude Include="bkschema.h" /> - <ClInclude Include="cmdata.h" /> - <ClInclude Include="cmintentsdata.h" /> - <ClInclude Include="cmintentsschema.h" /> - <ClInclude Include="cmintpthndlr.h" /> - <ClInclude Include="cmprofiledata.h" /> - <ClInclude Include="cmprofileschema.h" /> - <ClInclude Include="cmprofpchndlr.h" /> - <ClInclude Include="cmprofpthndlr.h" /> - <ClInclude Include="cmpthndlr.h" /> - <ClInclude Include="cmschema.h" /> - <ClInclude Include="globals.h" /> - <ClInclude Include="nupchndlr.h" /> - <ClInclude Include="nupdata.h" /> - <ClInclude Include="nupschema.h" /> - <ClInclude Include="nupthndlr.h" /> - <ClInclude Include="pchndlr.h" /> - <ClInclude Include="pgscdata.h" /> - <ClInclude Include="pgscpchndlr.h" /> - <ClInclude Include="pgscpthndlr.h" /> - <ClInclude Include="pgscschema.h" /> - <ClInclude Include="pimagedata.h" /> - <ClInclude Include="pimagepthndlr.h" /> - <ClInclude Include="pimageschema.h" /> - <ClInclude Include="porientdata.h" /> - <ClInclude Include="porientpthndlr.h" /> - <ClInclude Include="porientschema.h" /> - <ClInclude Include="precomp.h" /> - <ClInclude Include="privatedefs.h" /> - <ClInclude Include="pshndlr.h" /> - <ClInclude Include="psizedata.h" /> - <ClInclude Include="psizepthndlr.h" /> - <ClInclude Include="psizeschema.h" /> - <ClInclude Include="pthndlr.h" /> - <ClInclude Include="ptquerybld.h" /> - <ClInclude Include="schema.h" /> - <ClInclude Include="wmdata.h" /> - <ClInclude Include="wmpchndlr.h" /> - <ClInclude Include="wmpthndlr.h" /> - <ClInclude Include="wmschema.h" /> - <ClInclude Include="workbuff.h" /> - <ClInclude Include="bkdata.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="bkpchndlr.h" /> - <ClInclude Include="bkpthndlr.h" /> - <ClInclude Include="bkschema.h" /> - <ClInclude Include="cmdata.h" /> - <ClInclude Include="cmintentsdata.h" /> - <ClInclude Include="cmintentsschema.h" /> - <ClInclude Include="cmintpthndlr.h" /> - <ClInclude Include="cmprofiledata.h" /> - <ClInclude Include="cmprofileschema.h" /> - <ClInclude Include="cmprofpchndlr.h" /> - <ClInclude Include="cmprofpthndlr.h" /> - <ClInclude Include="cmpthndlr.h" /> - <ClInclude Include="cmschema.h" /> - <ClInclude Include="globals.h" /> - <ClInclude Include="nupchndlr.h" /> - <ClInclude Include="nupdata.h" /> - <ClInclude Include="nupschema.h" /> - <ClInclude Include="nupthndlr.h" /> - <ClInclude Include="pchndlr.h" /> - <ClInclude Include="pgscdata.h" /> - <ClInclude Include="pgscpchndlr.h" /> - <ClInclude Include="pgscpthndlr.h" /> - <ClInclude Include="pgscschema.h" /> - <ClInclude Include="pimagedata.h" /> - <ClInclude Include="pimagepthndlr.h" /> - <ClInclude Include="pimageschema.h" /> - <ClInclude Include="porientdata.h" /> - <ClInclude Include="porientpthndlr.h" /> - <ClInclude Include="porientschema.h" /> - <ClInclude Include="precomp.h" /> - <ClInclude Include="privatedefs.h" /> - <ClInclude Include="pshndlr.h" /> - <ClInclude Include="psizedata.h" /> - <ClInclude Include="psizepthndlr.h" /> - <ClInclude Include="psizeschema.h" /> - <ClInclude Include="pthndlr.h" /> - <ClInclude Include="ptquerybld.h" /> - <ClInclude Include="schema.h" /> - <ClInclude Include="wmdata.h" /> - <ClInclude Include="wmpchndlr.h" /> - <ClInclude Include="wmpthndlr.h" /> - <ClInclude Include="wmschema.h" /> - <ClInclude Include="workbuff.h" /> - <ClInclude Include="bkdata.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="bkpchndlr.h" /> - <ClInclude Include="bkpthndlr.h" /> - <ClInclude Include="bkschema.h" /> - <ClInclude Include="cmdata.h" /> - <ClInclude Include="cmintentsdata.h" /> - <ClInclude Include="cmintentsschema.h" /> - <ClInclude Include="cmintpthndlr.h" /> - <ClInclude Include="cmprofiledata.h" /> - <ClInclude Include="cmprofileschema.h" /> - <ClInclude Include="cmprofpchndlr.h" /> - <ClInclude Include="cmprofpthndlr.h" /> - <ClInclude Include="cmpthndlr.h" /> - <ClInclude Include="cmschema.h" /> - <ClInclude Include="globals.h" /> - <ClInclude Include="nupchndlr.h" /> - <ClInclude Include="nupdata.h" /> - <ClInclude Include="nupschema.h" /> - <ClInclude Include="nupthndlr.h" /> - <ClInclude Include="pchndlr.h" /> - <ClInclude Include="pgscdata.h" /> - <ClInclude Include="pgscpchndlr.h" /> - <ClInclude Include="pgscpthndlr.h" /> - <ClInclude Include="pgscschema.h" /> - <ClInclude Include="pimagedata.h" /> - <ClInclude Include="pimagepthndlr.h" /> - <ClInclude Include="pimageschema.h" /> - <ClInclude Include="porientdata.h" /> - <ClInclude Include="porientpthndlr.h" /> - <ClInclude Include="porientschema.h" /> - <ClInclude Include="precomp.h" /> - <ClInclude Include="privatedefs.h" /> - <ClInclude Include="pshndlr.h" /> - <ClInclude Include="psizedata.h" /> - <ClInclude Include="psizepthndlr.h" /> - <ClInclude Include="psizeschema.h" /> - <ClInclude Include="pthndlr.h" /> - <ClInclude Include="ptquerybld.h" /> - <ClInclude Include="schema.h" /> - <ClInclude Include="wmdata.h" /> - <ClInclude Include="wmpchndlr.h" /> - <ClInclude Include="wmpthndlr.h" /> - <ClInclude Include="wmschema.h" /> - <ClInclude Include="workbuff.h" /> - <ClInclude Include="bkdata.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="bkpchndlr.h" /> - <ClInclude Include="bkpthndlr.h" /> - <ClInclude Include="bkschema.h" /> - <ClInclude Include="cmdata.h" /> - <ClInclude Include="cmintentsdata.h" /> - <ClInclude Include="cmintentsschema.h" /> - <ClInclude Include="cmintpthndlr.h" /> - <ClInclude Include="cmprofiledata.h" /> - <ClInclude Include="cmprofileschema.h" /> - <ClInclude Include="cmprofpchndlr.h" /> - <ClInclude Include="cmprofpthndlr.h" /> - <ClInclude Include="cmpthndlr.h" /> - <ClInclude Include="cmschema.h" /> - <ClInclude Include="globals.h" /> - <ClInclude Include="nupchndlr.h" /> - <ClInclude Include="nupdata.h" /> - <ClInclude Include="nupschema.h" /> - <ClInclude Include="nupthndlr.h" /> - <ClInclude Include="pchndlr.h" /> - <ClInclude Include="pgscdata.h" /> - <ClInclude Include="pgscpchndlr.h" /> - <ClInclude Include="pgscpthndlr.h" /> - <ClInclude Include="pgscschema.h" /> - <ClInclude Include="pimagedata.h" /> - <ClInclude Include="pimagepthndlr.h" /> - <ClInclude Include="pimageschema.h" /> - <ClInclude Include="porientdata.h" /> - <ClInclude Include="porientpthndlr.h" /> - <ClInclude Include="porientschema.h" /> - <ClInclude Include="precomp.h" /> - <ClInclude Include="privatedefs.h" /> - <ClInclude Include="pshndlr.h" /> - <ClInclude Include="psizedata.h" /> - <ClInclude Include="psizepthndlr.h" /> - <ClInclude Include="psizeschema.h" /> - <ClInclude Include="pthndlr.h" /> - <ClInclude Include="ptquerybld.h" /> - <ClInclude Include="schema.h" /> - <ClInclude Include="wmdata.h" /> - <ClInclude Include="wmpchndlr.h" /> - <ClInclude Include="wmpthndlr.h" /> - <ClInclude Include="wmschema.h" /> - <ClInclude Include="workbuff.h" /> - <ClInclude Include="bkdata.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="bkpchndlr.h" /> - <ClInclude Include="bkpthndlr.h" /> - <ClInclude Include="bkschema.h" /> - <ClInclude Include="cmdata.h" /> - <ClInclude Include="cmintentsdata.h" /> - <ClInclude Include="cmintentsschema.h" /> - <ClInclude Include="cmintpthndlr.h" /> - <ClInclude Include="cmprofiledata.h" /> - <ClInclude Include="cmprofileschema.h" /> - <ClInclude Include="cmprofpchndlr.h" /> - <ClInclude Include="cmprofpthndlr.h" /> - <ClInclude Include="cmpthndlr.h" /> - <ClInclude Include="cmschema.h" /> - <ClInclude Include="globals.h" /> - <ClInclude Include="nupchndlr.h" /> - <ClInclude Include="nupdata.h" /> - <ClInclude Include="nupschema.h" /> - <ClInclude Include="nupthndlr.h" /> - <ClInclude Include="pchndlr.h" /> - <ClInclude Include="pgscdata.h" /> - <ClInclude Include="pgscpchndlr.h" /> - <ClInclude Include="pgscpthndlr.h" /> - <ClInclude Include="pgscschema.h" /> - <ClInclude Include="pimagedata.h" /> - <ClInclude Include="pimagepthndlr.h" /> - <ClInclude Include="pimageschema.h" /> - <ClInclude Include="porientdata.h" /> - <ClInclude Include="porientpthndlr.h" /> - <ClInclude Include="porientschema.h" /> - <ClInclude Include="precomp.h" /> - <ClInclude Include="privatedefs.h" /> - <ClInclude Include="pshndlr.h" /> - <ClInclude Include="psizedata.h" /> - <ClInclude Include="psizepthndlr.h" /> - <ClInclude Include="psizeschema.h" /> - <ClInclude Include="pthndlr.h" /> - <ClInclude Include="ptquerybld.h" /> - <ClInclude Include="schema.h" /> - <ClInclude Include="wmdata.h" /> - <ClInclude Include="wmpchndlr.h" /> - <ClInclude Include="wmpthndlr.h" /> - <ClInclude Include="wmschema.h" /> - <ClInclude Include="workbuff.h" /> - <ClInclude Include="bkdata.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="bkpchndlr.h" /> - <ClInclude Include="bkpthndlr.h" /> - <ClInclude Include="bkschema.h" /> - <ClInclude Include="cmdata.h" /> - <ClInclude Include="cmintentsdata.h" /> - <ClInclude Include="cmintentsschema.h" /> - <ClInclude Include="cmintpthndlr.h" /> - <ClInclude Include="cmprofiledata.h" /> - <ClInclude Include="cmprofileschema.h" /> - <ClInclude Include="cmprofpchndlr.h" /> - <ClInclude Include="cmprofpthndlr.h" /> - <ClInclude Include="cmpthndlr.h" /> - <ClInclude Include="cmschema.h" /> - <ClInclude Include="globals.h" /> - <ClInclude Include="nupchndlr.h" /> - <ClInclude Include="nupdata.h" /> - <ClInclude Include="nupschema.h" /> - <ClInclude Include="nupthndlr.h" /> - <ClInclude Include="pchndlr.h" /> - <ClInclude Include="pgscdata.h" /> - <ClInclude Include="pgscpchndlr.h" /> - <ClInclude Include="pgscpthndlr.h" /> - <ClInclude Include="pgscschema.h" /> - <ClInclude Include="pimagedata.h" /> - <ClInclude Include="pimagepthndlr.h" /> - <ClInclude Include="pimageschema.h" /> - <ClInclude Include="porientdata.h" /> - <ClInclude Include="porientpthndlr.h" /> - <ClInclude Include="porientschema.h" /> - <ClInclude Include="precomp.h" /> - <ClInclude Include="privatedefs.h" /> - <ClInclude Include="pshndlr.h" /> - <ClInclude Include="psizedata.h" /> - <ClInclude Include="psizepthndlr.h" /> - <ClInclude Include="psizeschema.h" /> - <ClInclude Include="pthndlr.h" /> - <ClInclude Include="ptquerybld.h" /> - <ClInclude Include="schema.h" /> - <ClInclude Include="wmdata.h" /> - <ClInclude Include="wmpchndlr.h" /> - <ClInclude Include="wmpthndlr.h" /> - <ClInclude Include="wmschema.h" /> - <ClInclude Include="workbuff.h" /> - <ClInclude Include="bkdata.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="bkpchndlr.h" /> - <ClInclude Include="bkpthndlr.h" /> - <ClInclude Include="bkschema.h" /> - <ClInclude Include="cmdata.h" /> - <ClInclude Include="cmintentsdata.h" /> - <ClInclude Include="cmintentsschema.h" /> - <ClInclude Include="cmintpthndlr.h" /> - <ClInclude Include="cmprofiledata.h" /> - <ClInclude Include="cmprofileschema.h" /> - <ClInclude Include="cmprofpchndlr.h" /> - <ClInclude Include="cmprofpthndlr.h" /> - <ClInclude Include="cmpthndlr.h" /> - <ClInclude Include="cmschema.h" /> - <ClInclude Include="globals.h" /> - <ClInclude Include="nupchndlr.h" /> - <ClInclude Include="nupdata.h" /> - <ClInclude Include="nupschema.h" /> - <ClInclude Include="nupthndlr.h" /> - <ClInclude Include="pchndlr.h" /> - <ClInclude Include="pgscdata.h" /> - <ClInclude Include="pgscpchndlr.h" /> - <ClInclude Include="pgscpthndlr.h" /> - <ClInclude Include="pgscschema.h" /> - <ClInclude Include="pimagedata.h" /> - <ClInclude Include="pimagepthndlr.h" /> - <ClInclude Include="pimageschema.h" /> - <ClInclude Include="porientdata.h" /> - <ClInclude Include="porientpthndlr.h" /> - <ClInclude Include="porientschema.h" /> - <ClInclude Include="precomp.h" /> - <ClInclude Include="privatedefs.h" /> - <ClInclude Include="pshndlr.h" /> - <ClInclude Include="psizedata.h" /> - <ClInclude Include="psizepthndlr.h" /> - <ClInclude Include="psizeschema.h" /> - <ClInclude Include="pthndlr.h" /> - <ClInclude Include="ptquerybld.h" /> - <ClInclude Include="schema.h" /> - <ClInclude Include="wmdata.h" /> - <ClInclude Include="wmpchndlr.h" /> - <ClInclude Include="wmpthndlr.h" /> - <ClInclude Include="wmschema.h" /> - <ClInclude Include="workbuff.h" /> - <ClInclude Include="bkdata.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="bkpchndlr.h" /> - <ClInclude Include="bkpthndlr.h" /> - <ClInclude Include="bkschema.h" /> - <ClInclude Include="cmdata.h" /> - <ClInclude Include="cmintentsdata.h" /> - <ClInclude Include="cmintentsschema.h" /> - <ClInclude Include="cmintpthndlr.h" /> - <ClInclude Include="cmprofiledata.h" /> - <ClInclude Include="cmprofileschema.h" /> - <ClInclude Include="cmprofpchndlr.h" /> - <ClInclude Include="cmprofpthndlr.h" /> - <ClInclude Include="cmpthndlr.h" /> - <ClInclude Include="cmschema.h" /> - <ClInclude Include="globals.h" /> - <ClInclude Include="nupchndlr.h" /> - <ClInclude Include="nupdata.h" /> - <ClInclude Include="nupschema.h" /> - <ClInclude Include="nupthndlr.h" /> - <ClInclude Include="pchndlr.h" /> - <ClInclude Include="pgscdata.h" /> - <ClInclude Include="pgscpchndlr.h" /> - <ClInclude Include="pgscpthndlr.h" /> - <ClInclude Include="pgscschema.h" /> - <ClInclude Include="pimagedata.h" /> - <ClInclude Include="pimagepthndlr.h" /> - <ClInclude Include="pimageschema.h" /> - <ClInclude Include="porientdata.h" /> - <ClInclude Include="porientpthndlr.h" /> - <ClInclude Include="porientschema.h" /> - <ClInclude Include="precomp.h" /> - <ClInclude Include="privatedefs.h" /> - <ClInclude Include="pshndlr.h" /> - <ClInclude Include="psizedata.h" /> - <ClInclude Include="psizepthndlr.h" /> - <ClInclude Include="psizeschema.h" /> - <ClInclude Include="pthndlr.h" /> - <ClInclude Include="ptquerybld.h" /> - <ClInclude Include="schema.h" /> - <ClInclude Include="wmdata.h" /> - <ClInclude Include="wmpchndlr.h" /> - <ClInclude Include="wmpthndlr.h" /> - <ClInclude Include="wmschema.h" /> - <ClInclude Include="workbuff.h" /> - <ClInclude Include="bkdata.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="bkpchndlr.h" /> - <ClInclude Include="bkpthndlr.h" /> - <ClInclude Include="bkschema.h" /> - <ClInclude Include="cmdata.h" /> - <ClInclude Include="cmintentsdata.h" /> - <ClInclude Include="cmintentsschema.h" /> - <ClInclude Include="cmintpthndlr.h" /> - <ClInclude Include="cmprofiledata.h" /> - <ClInclude Include="cmprofileschema.h" /> - <ClInclude Include="cmprofpchndlr.h" /> - <ClInclude Include="cmprofpthndlr.h" /> - <ClInclude Include="cmpthndlr.h" /> - <ClInclude Include="cmschema.h" /> - <ClInclude Include="globals.h" /> - <ClInclude Include="nupchndlr.h" /> - <ClInclude Include="nupdata.h" /> - <ClInclude Include="nupschema.h" /> - <ClInclude Include="nupthndlr.h" /> - <ClInclude Include="pchndlr.h" /> - <ClInclude Include="pgscdata.h" /> - <ClInclude Include="pgscpchndlr.h" /> - <ClInclude Include="pgscpthndlr.h" /> - <ClInclude Include="pgscschema.h" /> - <ClInclude Include="pimagedata.h" /> - <ClInclude Include="pimagepthndlr.h" /> - <ClInclude Include="pimageschema.h" /> - <ClInclude Include="porientdata.h" /> - <ClInclude Include="porientpthndlr.h" /> - <ClInclude Include="porientschema.h" /> - <ClInclude Include="precomp.h" /> - <ClInclude Include="privatedefs.h" /> - <ClInclude Include="pshndlr.h" /> - <ClInclude Include="psizedata.h" /> - <ClInclude Include="psizepthndlr.h" /> - <ClInclude Include="psizeschema.h" /> - <ClInclude Include="pthndlr.h" /> - <ClInclude Include="ptquerybld.h" /> - <ClInclude Include="schema.h" /> - <ClInclude Include="wmdata.h" /> - <ClInclude Include="wmpchndlr.h" /> - <ClInclude Include="wmpthndlr.h" /> - <ClInclude Include="wmschema.h" /> - <ClInclude Include="workbuff.h" /> - <ClInclude Include="bkdata.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="bkpchndlr.h" /> - <ClInclude Include="bkpthndlr.h" /> - <ClInclude Include="bkschema.h" /> - <ClInclude Include="cmdata.h" /> - <ClInclude Include="cmintentsdata.h" /> - <ClInclude Include="cmintentsschema.h" /> - <ClInclude Include="cmintpthndlr.h" /> - <ClInclude Include="cmprofiledata.h" /> - <ClInclude Include="cmprofileschema.h" /> - <ClInclude Include="cmprofpchndlr.h" /> - <ClInclude Include="cmprofpthndlr.h" /> - <ClInclude Include="cmpthndlr.h" /> - <ClInclude Include="cmschema.h" /> - <ClInclude Include="globals.h" /> - <ClInclude Include="nupchndlr.h" /> - <ClInclude Include="nupdata.h" /> - <ClInclude Include="nupschema.h" /> - <ClInclude Include="nupthndlr.h" /> - <ClInclude Include="pchndlr.h" /> - <ClInclude Include="pgscdata.h" /> - <ClInclude Include="pgscpchndlr.h" /> - <ClInclude Include="pgscpthndlr.h" /> - <ClInclude Include="pgscschema.h" /> - <ClInclude Include="pimagedata.h" /> - <ClInclude Include="pimagepthndlr.h" /> - <ClInclude Include="pimageschema.h" /> - <ClInclude Include="porientdata.h" /> - <ClInclude Include="porientpthndlr.h" /> - <ClInclude Include="porientschema.h" /> - <ClInclude Include="precomp.h" /> - <ClInclude Include="privatedefs.h" /> - <ClInclude Include="pshndlr.h" /> - <ClInclude Include="psizedata.h" /> - <ClInclude Include="psizepthndlr.h" /> - <ClInclude Include="psizeschema.h" /> - <ClInclude Include="pthndlr.h" /> - <ClInclude Include="ptquerybld.h" /> - <ClInclude Include="schema.h" /> - <ClInclude Include="wmdata.h" /> - <ClInclude Include="wmpchndlr.h" /> - <ClInclude Include="wmpthndlr.h" /> - <ClInclude Include="wmschema.h" /> - <ClInclude Include="workbuff.h" /> - <ClInclude Include="bkdata.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="bkpchndlr.h" /> - <ClInclude Include="bkpthndlr.h" /> - <ClInclude Include="bkschema.h" /> - <ClInclude Include="cmdata.h" /> - <ClInclude Include="cmintentsdata.h" /> - <ClInclude Include="cmintentsschema.h" /> - <ClInclude Include="cmintpthndlr.h" /> - <ClInclude Include="cmprofiledata.h" /> - <ClInclude Include="cmprofileschema.h" /> - <ClInclude Include="cmprofpchndlr.h" /> - <ClInclude Include="cmprofpthndlr.h" /> - <ClInclude Include="cmpthndlr.h" /> - <ClInclude Include="cmschema.h" /> - <ClInclude Include="globals.h" /> - <ClInclude Include="nupchndlr.h" /> - <ClInclude Include="nupdata.h" /> - <ClInclude Include="nupschema.h" /> - <ClInclude Include="nupthndlr.h" /> - <ClInclude Include="pchndlr.h" /> - <ClInclude Include="pgscdata.h" /> - <ClInclude Include="pgscpchndlr.h" /> - <ClInclude Include="pgscpthndlr.h" /> - <ClInclude Include="pgscschema.h" /> - <ClInclude Include="pimagedata.h" /> - <ClInclude Include="pimagepthndlr.h" /> - <ClInclude Include="pimageschema.h" /> - <ClInclude Include="porientdata.h" /> - <ClInclude Include="porientpthndlr.h" /> - <ClInclude Include="porientschema.h" /> - <ClInclude Include="precomp.h" /> - <ClInclude Include="privatedefs.h" /> - <ClInclude Include="pshndlr.h" /> - <ClInclude Include="psizedata.h" /> - <ClInclude Include="psizepthndlr.h" /> - <ClInclude Include="psizeschema.h" /> - <ClInclude Include="pthndlr.h" /> - <ClInclude Include="ptquerybld.h" /> - <ClInclude Include="schema.h" /> - <ClInclude Include="wmdata.h" /> - <ClInclude Include="wmpchndlr.h" /> - <ClInclude Include="wmpthndlr.h" /> - <ClInclude Include="wmschema.h" /> - <ClInclude Include="workbuff.h" /> - <ClInclude Include="bkdata.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="bkpchndlr.h" /> - <ClInclude Include="bkpthndlr.h" /> - <ClInclude Include="bkschema.h" /> - <ClInclude Include="cmdata.h" /> - <ClInclude Include="cmintentsdata.h" /> - <ClInclude Include="cmintentsschema.h" /> - <ClInclude Include="cmintpthndlr.h" /> - <ClInclude Include="cmprofiledata.h" /> - <ClInclude Include="cmprofileschema.h" /> - <ClInclude Include="cmprofpchndlr.h" /> - <ClInclude Include="cmprofpthndlr.h" /> - <ClInclude Include="cmpthndlr.h" /> - <ClInclude Include="cmschema.h" /> - <ClInclude Include="globals.h" /> - <ClInclude Include="nupchndlr.h" /> - <ClInclude Include="nupdata.h" /> - <ClInclude Include="nupschema.h" /> - <ClInclude Include="nupthndlr.h" /> - <ClInclude Include="pchndlr.h" /> - <ClInclude Include="pgscdata.h" /> - <ClInclude Include="pgscpchndlr.h" /> - <ClInclude Include="pgscpthndlr.h" /> - <ClInclude Include="pgscschema.h" /> - <ClInclude Include="pimagedata.h" /> - <ClInclude Include="pimagepthndlr.h" /> - <ClInclude Include="pimageschema.h" /> - <ClInclude Include="porientdata.h" /> - <ClInclude Include="porientpthndlr.h" /> - <ClInclude Include="porientschema.h" /> - <ClInclude Include="precomp.h" /> - <ClInclude Include="privatedefs.h" /> - <ClInclude Include="pshndlr.h" /> - <ClInclude Include="psizedata.h" /> - <ClInclude Include="psizepthndlr.h" /> - <ClInclude Include="psizeschema.h" /> - <ClInclude Include="pthndlr.h" /> - <ClInclude Include="ptquerybld.h" /> - <ClInclude Include="schema.h" /> - <ClInclude Include="wmdata.h" /> - <ClInclude Include="wmpchndlr.h" /> - <ClInclude Include="wmpthndlr.h" /> - <ClInclude Include="wmschema.h" /> - <ClInclude Include="workbuff.h" /> - <ClInclude Include="bkdata.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="bkpchndlr.h" /> - <ClInclude Include="bkpthndlr.h" /> - <ClInclude Include="bkschema.h" /> - <ClInclude Include="cmdata.h" /> - <ClInclude Include="cmintentsdata.h" /> - <ClInclude Include="cmintentsschema.h" /> - <ClInclude Include="cmintpthndlr.h" /> - <ClInclude Include="cmprofiledata.h" /> - <ClInclude Include="cmprofileschema.h" /> - <ClInclude Include="cmprofpchndlr.h" /> - <ClInclude Include="cmprofpthndlr.h" /> - <ClInclude Include="cmpthndlr.h" /> - <ClInclude Include="cmschema.h" /> - <ClInclude Include="globals.h" /> - <ClInclude Include="nupchndlr.h" /> - <ClInclude Include="nupdata.h" /> - <ClInclude Include="nupschema.h" /> - <ClInclude Include="nupthndlr.h" /> - <ClInclude Include="pchndlr.h" /> - <ClInclude Include="pgscdata.h" /> - <ClInclude Include="pgscpchndlr.h" /> - <ClInclude Include="pgscpthndlr.h" /> - <ClInclude Include="pgscschema.h" /> - <ClInclude Include="pimagedata.h" /> - <ClInclude Include="pimagepthndlr.h" /> - <ClInclude Include="pimageschema.h" /> - <ClInclude Include="porientdata.h" /> - <ClInclude Include="porientpthndlr.h" /> - <ClInclude Include="porientschema.h" /> - <ClInclude Include="precomp.h" /> - <ClInclude Include="privatedefs.h" /> - <ClInclude Include="pshndlr.h" /> - <ClInclude Include="psizedata.h" /> - <ClInclude Include="psizepthndlr.h" /> - <ClInclude Include="psizeschema.h" /> - <ClInclude Include="pthndlr.h" /> - <ClInclude Include="ptquerybld.h" /> - <ClInclude Include="schema.h" /> - <ClInclude Include="wmdata.h" /> - <ClInclude Include="wmpchndlr.h" /> - <ClInclude Include="wmpthndlr.h" /> - <ClInclude Include="wmschema.h" /> - <ClInclude Include="workbuff.h" /> - <ClInclude Include="bkdata.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="bkpchndlr.h" /> - <ClInclude Include="bkpthndlr.h" /> - <ClInclude Include="bkschema.h" /> - <ClInclude Include="cmdata.h" /> - <ClInclude Include="cmintentsdata.h" /> - <ClInclude Include="cmintentsschema.h" /> - <ClInclude Include="cmintpthndlr.h" /> - <ClInclude Include="cmprofiledata.h" /> - <ClInclude Include="cmprofileschema.h" /> - <ClInclude Include="cmprofpchndlr.h" /> - <ClInclude Include="cmprofpthndlr.h" /> - <ClInclude Include="cmpthndlr.h" /> - <ClInclude Include="cmschema.h" /> - <ClInclude Include="globals.h" /> - <ClInclude Include="nupchndlr.h" /> - <ClInclude Include="nupdata.h" /> - <ClInclude Include="nupschema.h" /> - <ClInclude Include="nupthndlr.h" /> - <ClInclude Include="pchndlr.h" /> - <ClInclude Include="pgscdata.h" /> - <ClInclude Include="pgscpchndlr.h" /> - <ClInclude Include="pgscpthndlr.h" /> - <ClInclude Include="pgscschema.h" /> - <ClInclude Include="pimagedata.h" /> - <ClInclude Include="pimagepthndlr.h" /> - <ClInclude Include="pimageschema.h" /> - <ClInclude Include="porientdata.h" /> - <ClInclude Include="porientpthndlr.h" /> - <ClInclude Include="porientschema.h" /> - <ClInclude Include="precomp.h" /> - <ClInclude Include="privatedefs.h" /> - <ClInclude Include="pshndlr.h" /> - <ClInclude Include="psizedata.h" /> - <ClInclude Include="psizepthndlr.h" /> - <ClInclude Include="psizeschema.h" /> - <ClInclude Include="pthndlr.h" /> - <ClInclude Include="ptquerybld.h" /> - <ClInclude Include="schema.h" /> - <ClInclude Include="wmdata.h" /> - <ClInclude Include="wmpchndlr.h" /> - <ClInclude Include="wmpthndlr.h" /> - <ClInclude Include="wmschema.h" /> - <ClInclude Include="workbuff.h" /> - <ClInclude Include="bkdata.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="bkpchndlr.h" /> - <ClInclude Include="bkpthndlr.h" /> - <ClInclude Include="bkschema.h" /> - <ClInclude Include="cmdata.h" /> - <ClInclude Include="cmintentsdata.h" /> - <ClInclude Include="cmintentsschema.h" /> - <ClInclude Include="cmintpthndlr.h" /> - <ClInclude Include="cmprofiledata.h" /> - <ClInclude Include="cmprofileschema.h" /> - <ClInclude Include="cmprofpchndlr.h" /> - <ClInclude Include="cmprofpthndlr.h" /> - <ClInclude Include="cmpthndlr.h" /> - <ClInclude Include="cmschema.h" /> - <ClInclude Include="globals.h" /> - <ClInclude Include="nupchndlr.h" /> - <ClInclude Include="nupdata.h" /> - <ClInclude Include="nupschema.h" /> - <ClInclude Include="nupthndlr.h" /> - <ClInclude Include="pchndlr.h" /> - <ClInclude Include="pgscdata.h" /> - <ClInclude Include="pgscpchndlr.h" /> - <ClInclude Include="pgscpthndlr.h" /> - <ClInclude Include="pgscschema.h" /> - <ClInclude Include="pimagedata.h" /> - <ClInclude Include="pimagepthndlr.h" /> - <ClInclude Include="pimageschema.h" /> - <ClInclude Include="porientdata.h" /> - <ClInclude Include="porientpthndlr.h" /> - <ClInclude Include="porientschema.h" /> - <ClInclude Include="precomp.h" /> - <ClInclude Include="privatedefs.h" /> - <ClInclude Include="pshndlr.h" /> - <ClInclude Include="psizedata.h" /> - <ClInclude Include="psizepthndlr.h" /> - <ClInclude Include="psizeschema.h" /> - <ClInclude Include="pthndlr.h" /> - <ClInclude Include="ptquerybld.h" /> - <ClInclude Include="schema.h" /> - <ClInclude Include="wmdata.h" /> - <ClInclude Include="wmpchndlr.h" /> - <ClInclude Include="wmpthndlr.h" /> - <ClInclude Include="wmschema.h" /> - <ClInclude Include="workbuff.h" /> - <ClInclude Include="bkdata.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="bkpchndlr.h" /> - <ClInclude Include="bkpthndlr.h" /> - <ClInclude Include="bkschema.h" /> - <ClInclude Include="cmdata.h" /> - <ClInclude Include="cmintentsdata.h" /> - <ClInclude Include="cmintentsschema.h" /> - <ClInclude Include="cmintpthndlr.h" /> - <ClInclude Include="cmprofiledata.h" /> - <ClInclude Include="cmprofileschema.h" /> - <ClInclude Include="cmprofpchndlr.h" /> - <ClInclude Include="cmprofpthndlr.h" /> - <ClInclude Include="cmpthndlr.h" /> - <ClInclude Include="cmschema.h" /> - <ClInclude Include="globals.h" /> - <ClInclude Include="nupchndlr.h" /> - <ClInclude Include="nupdata.h" /> - <ClInclude Include="nupschema.h" /> - <ClInclude Include="nupthndlr.h" /> - <ClInclude Include="pchndlr.h" /> - <ClInclude Include="pgscdata.h" /> - <ClInclude Include="pgscpchndlr.h" /> - <ClInclude Include="pgscpthndlr.h" /> - <ClInclude Include="pgscschema.h" /> - <ClInclude Include="pimagedata.h" /> - <ClInclude Include="pimagepthndlr.h" /> - <ClInclude Include="pimageschema.h" /> - <ClInclude Include="porientdata.h" /> - <ClInclude Include="porientpthndlr.h" /> - <ClInclude Include="porientschema.h" /> - <ClInclude Include="precomp.h" /> - <ClInclude Include="privatedefs.h" /> - <ClInclude Include="pshndlr.h" /> - <ClInclude Include="psizedata.h" /> - <ClInclude Include="psizepthndlr.h" /> - <ClInclude Include="psizeschema.h" /> - <ClInclude Include="pthndlr.h" /> - <ClInclude Include="ptquerybld.h" /> - <ClInclude Include="schema.h" /> - <ClInclude Include="wmdata.h" /> - <ClInclude Include="wmpchndlr.h" /> - <ClInclude Include="wmpthndlr.h" /> - <ClInclude Include="wmschema.h" /> - <ClInclude Include="workbuff.h" /> - <ClInclude Include="bkdata.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="bkpchndlr.h" /> - <ClInclude Include="bkpthndlr.h" /> - <ClInclude Include="bkschema.h" /> - <ClInclude Include="cmdata.h" /> - <ClInclude Include="cmintentsdata.h" /> - <ClInclude Include="cmintentsschema.h" /> - <ClInclude Include="cmintpthndlr.h" /> - <ClInclude Include="cmprofiledata.h" /> - <ClInclude Include="cmprofileschema.h" /> - <ClInclude Include="cmprofpchndlr.h" /> - <ClInclude Include="cmprofpthndlr.h" /> - <ClInclude Include="cmpthndlr.h" /> - <ClInclude Include="cmschema.h" /> - <ClInclude Include="globals.h" /> - <ClInclude Include="nupchndlr.h" /> - <ClInclude Include="nupdata.h" /> - <ClInclude Include="nupschema.h" /> - <ClInclude Include="nupthndlr.h" /> - <ClInclude Include="pchndlr.h" /> - <ClInclude Include="pgscdata.h" /> - <ClInclude Include="pgscpchndlr.h" /> - <ClInclude Include="pgscpthndlr.h" /> - <ClInclude Include="pgscschema.h" /> - <ClInclude Include="pimagedata.h" /> - <ClInclude Include="pimagepthndlr.h" /> - <ClInclude Include="pimageschema.h" /> - <ClInclude Include="porientdata.h" /> - <ClInclude Include="porientpthndlr.h" /> - <ClInclude Include="porientschema.h" /> - <ClInclude Include="precomp.h" /> - <ClInclude Include="privatedefs.h" /> - <ClInclude Include="pshndlr.h" /> - <ClInclude Include="psizedata.h" /> - <ClInclude Include="psizepthndlr.h" /> - <ClInclude Include="psizeschema.h" /> - <ClInclude Include="pthndlr.h" /> - <ClInclude Include="ptquerybld.h" /> - <ClInclude Include="schema.h" /> - <ClInclude Include="wmdata.h" /> - <ClInclude Include="wmpchndlr.h" /> - <ClInclude Include="wmpthndlr.h" /> - <ClInclude Include="wmschema.h" /> - <ClInclude Include="workbuff.h" /> - <ClInclude Include="bkdata.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="bkpchndlr.h" /> - <ClInclude Include="bkpthndlr.h" /> - <ClInclude Include="bkschema.h" /> - <ClInclude Include="cmdata.h" /> - <ClInclude Include="cmintentsdata.h" /> - <ClInclude Include="cmintentsschema.h" /> - <ClInclude Include="cmintpthndlr.h" /> - <ClInclude Include="cmprofiledata.h" /> - <ClInclude Include="cmprofileschema.h" /> - <ClInclude Include="cmprofpchndlr.h" /> - <ClInclude Include="cmprofpthndlr.h" /> - <ClInclude Include="cmpthndlr.h" /> - <ClInclude Include="cmschema.h" /> - <ClInclude Include="globals.h" /> - <ClInclude Include="nupchndlr.h" /> - <ClInclude Include="nupdata.h" /> - <ClInclude Include="nupschema.h" /> - <ClInclude Include="nupthndlr.h" /> - <ClInclude Include="pchndlr.h" /> - <ClInclude Include="pgscdata.h" /> - <ClInclude Include="pgscpchndlr.h" /> - <ClInclude Include="pgscpthndlr.h" /> - <ClInclude Include="pgscschema.h" /> - <ClInclude Include="pimagedata.h" /> - <ClInclude Include="pimagepthndlr.h" /> - <ClInclude Include="pimageschema.h" /> - <ClInclude Include="porientdata.h" /> - <ClInclude Include="porientpthndlr.h" /> - <ClInclude Include="porientschema.h" /> - <ClInclude Include="precomp.h" /> - <ClInclude Include="privatedefs.h" /> - <ClInclude Include="pshndlr.h" /> - <ClInclude Include="psizedata.h" /> - <ClInclude Include="psizepthndlr.h" /> - <ClInclude Include="psizeschema.h" /> - <ClInclude Include="pthndlr.h" /> - <ClInclude Include="ptquerybld.h" /> - <ClInclude Include="schema.h" /> - <ClInclude Include="wmdata.h" /> - <ClInclude Include="wmpchndlr.h" /> - <ClInclude Include="wmpthndlr.h" /> - <ClInclude Include="wmschema.h" /> - <ClInclude Include="workbuff.h" /> - <ClInclude Include="bkdata.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="bkpchndlr.h" /> - <ClInclude Include="bkpthndlr.h" /> - <ClInclude Include="bkschema.h" /> - <ClInclude Include="cmdata.h" /> - <ClInclude Include="cmintentsdata.h" /> - <ClInclude Include="cmintentsschema.h" /> - <ClInclude Include="cmintpthndlr.h" /> - <ClInclude Include="cmprofiledata.h" /> - <ClInclude Include="cmprofileschema.h" /> - <ClInclude Include="cmprofpchndlr.h" /> - <ClInclude Include="cmprofpthndlr.h" /> - <ClInclude Include="cmpthndlr.h" /> - <ClInclude Include="cmschema.h" /> - <ClInclude Include="globals.h" /> - <ClInclude Include="nupchndlr.h" /> - <ClInclude Include="nupdata.h" /> - <ClInclude Include="nupschema.h" /> - <ClInclude Include="nupthndlr.h" /> - <ClInclude Include="pchndlr.h" /> - <ClInclude Include="pgscdata.h" /> - <ClInclude Include="pgscpchndlr.h" /> - <ClInclude Include="pgscpthndlr.h" /> - <ClInclude Include="pgscschema.h" /> - <ClInclude Include="pimagedata.h" /> - <ClInclude Include="pimagepthndlr.h" /> - <ClInclude Include="pimageschema.h" /> - <ClInclude Include="porientdata.h" /> - <ClInclude Include="porientpthndlr.h" /> - <ClInclude Include="porientschema.h" /> - <ClInclude Include="precomp.h" /> - <ClInclude Include="privatedefs.h" /> - <ClInclude Include="pshndlr.h" /> - <ClInclude Include="psizedata.h" /> - <ClInclude Include="psizepthndlr.h" /> - <ClInclude Include="psizeschema.h" /> - <ClInclude Include="pthndlr.h" /> - <ClInclude Include="ptquerybld.h" /> - <ClInclude Include="schema.h" /> - <ClInclude Include="wmdata.h" /> - <ClInclude Include="wmpchndlr.h" /> - <ClInclude Include="wmpthndlr.h" /> - <ClInclude Include="wmschema.h" /> - <ClInclude Include="workbuff.h" /> - <ClInclude Include="bkdata.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="bkpchndlr.h" /> - <ClInclude Include="bkpthndlr.h" /> - <ClInclude Include="bkschema.h" /> - <ClInclude Include="cmdata.h" /> - <ClInclude Include="cmintentsdata.h" /> - <ClInclude Include="cmintentsschema.h" /> - <ClInclude Include="cmintpthndlr.h" /> - <ClInclude Include="cmprofiledata.h" /> - <ClInclude Include="cmprofileschema.h" /> - <ClInclude Include="cmprofpchndlr.h" /> - <ClInclude Include="cmprofpthndlr.h" /> - <ClInclude Include="cmpthndlr.h" /> - <ClInclude Include="cmschema.h" /> - <ClInclude Include="globals.h" /> - <ClInclude Include="nupchndlr.h" /> - <ClInclude Include="nupdata.h" /> - <ClInclude Include="nupschema.h" /> - <ClInclude Include="nupthndlr.h" /> - <ClInclude Include="pchndlr.h" /> - <ClInclude Include="pgscdata.h" /> - <ClInclude Include="pgscpchndlr.h" /> - <ClInclude Include="pgscpthndlr.h" /> - <ClInclude Include="pgscschema.h" /> - <ClInclude Include="pimagedata.h" /> - <ClInclude Include="pimagepthndlr.h" /> - <ClInclude Include="pimageschema.h" /> - <ClInclude Include="porientdata.h" /> - <ClInclude Include="porientpthndlr.h" /> - <ClInclude Include="porientschema.h" /> - <ClInclude Include="precomp.h" /> - <ClInclude Include="privatedefs.h" /> - <ClInclude Include="pshndlr.h" /> - <ClInclude Include="psizedata.h" /> - <ClInclude Include="psizepthndlr.h" /> - <ClInclude Include="psizeschema.h" /> - <ClInclude Include="pthndlr.h" /> - <ClInclude Include="ptquerybld.h" /> - <ClInclude Include="schema.h" /> - <ClInclude Include="wmdata.h" /> - <ClInclude Include="wmpchndlr.h" /> - <ClInclude Include="wmpthndlr.h" /> - <ClInclude Include="wmschema.h" /> - <ClInclude Include="workbuff.h" /> - <ClInclude Include="bkdata.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="bkpchndlr.h" /> - <ClInclude Include="bkpthndlr.h" /> - <ClInclude Include="bkschema.h" /> - <ClInclude Include="cmdata.h" /> - <ClInclude Include="cmintentsdata.h" /> - <ClInclude Include="cmintentsschema.h" /> - <ClInclude Include="cmintpthndlr.h" /> - <ClInclude Include="cmprofiledata.h" /> - <ClInclude Include="cmprofileschema.h" /> - <ClInclude Include="cmprofpchndlr.h" /> - <ClInclude Include="cmprofpthndlr.h" /> - <ClInclude Include="cmpthndlr.h" /> - <ClInclude Include="cmschema.h" /> - <ClInclude Include="globals.h" /> - <ClInclude Include="nupchndlr.h" /> - <ClInclude Include="nupdata.h" /> - <ClInclude Include="nupschema.h" /> - <ClInclude Include="nupthndlr.h" /> - <ClInclude Include="pchndlr.h" /> - <ClInclude Include="pgscdata.h" /> - <ClInclude Include="pgscpchndlr.h" /> - <ClInclude Include="pgscpthndlr.h" /> - <ClInclude Include="pgscschema.h" /> - <ClInclude Include="pimagedata.h" /> - <ClInclude Include="pimagepthndlr.h" /> - <ClInclude Include="pimageschema.h" /> - <ClInclude Include="porientdata.h" /> - <ClInclude Include="porientpthndlr.h" /> - <ClInclude Include="porientschema.h" /> - <ClInclude Include="precomp.h" /> - <ClInclude Include="privatedefs.h" /> - <ClInclude Include="pshndlr.h" /> - <ClInclude Include="psizedata.h" /> - <ClInclude Include="psizepthndlr.h" /> - <ClInclude Include="psizeschema.h" /> - <ClInclude Include="pthndlr.h" /> - <ClInclude Include="ptquerybld.h" /> - <ClInclude Include="schema.h" /> - <ClInclude Include="wmdata.h" /> - <ClInclude Include="wmpchndlr.h" /> - <ClInclude Include="wmpthndlr.h" /> - <ClInclude Include="wmschema.h" /> - <ClInclude Include="workbuff.h" /> - <ClInclude Include="bkdata.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="bkpchndlr.h" /> - <ClInclude Include="bkpthndlr.h" /> - <ClInclude Include="bkschema.h" /> - <ClInclude Include="cmdata.h" /> - <ClInclude Include="cmintentsdata.h" /> - <ClInclude Include="cmintentsschema.h" /> - <ClInclude Include="cmintpthndlr.h" /> - <ClInclude Include="cmprofiledata.h" /> - <ClInclude Include="cmprofileschema.h" /> - <ClInclude Include="cmprofpchndlr.h" /> - <ClInclude Include="cmprofpthndlr.h" /> - <ClInclude Include="cmpthndlr.h" /> - <ClInclude Include="cmschema.h" /> - <ClInclude Include="globals.h" /> - <ClInclude Include="nupchndlr.h" /> - <ClInclude Include="nupdata.h" /> - <ClInclude Include="nupschema.h" /> - <ClInclude Include="nupthndlr.h" /> - <ClInclude Include="pchndlr.h" /> - <ClInclude Include="pgscdata.h" /> - <ClInclude Include="pgscpchndlr.h" /> - <ClInclude Include="pgscpthndlr.h" /> - <ClInclude Include="pgscschema.h" /> - <ClInclude Include="pimagedata.h" /> - <ClInclude Include="pimagepthndlr.h" /> - <ClInclude Include="pimageschema.h" /> - <ClInclude Include="porientdata.h" /> - <ClInclude Include="porientpthndlr.h" /> - <ClInclude Include="porientschema.h" /> - <ClInclude Include="precomp.h" /> - <ClInclude Include="privatedefs.h" /> - <ClInclude Include="pshndlr.h" /> - <ClInclude Include="psizedata.h" /> - <ClInclude Include="psizepthndlr.h" /> - <ClInclude Include="psizeschema.h" /> - <ClInclude Include="pthndlr.h" /> - <ClInclude Include="ptquerybld.h" /> - <ClInclude Include="schema.h" /> - <ClInclude Include="wmdata.h" /> - <ClInclude Include="wmpchndlr.h" /> - <ClInclude Include="wmpthndlr.h" /> - <ClInclude Include="wmschema.h" /> - <ClInclude Include="workbuff.h" /> - <ClInclude Include="bkdata.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="bkpchndlr.h" /> - <ClInclude Include="bkpthndlr.h" /> - <ClInclude Include="bkschema.h" /> - <ClInclude Include="cmdata.h" /> - <ClInclude Include="cmintentsdata.h" /> - <ClInclude Include="cmintentsschema.h" /> - <ClInclude Include="cmintpthndlr.h" /> - <ClInclude Include="cmprofiledata.h" /> - <ClInclude Include="cmprofileschema.h" /> - <ClInclude Include="cmprofpchndlr.h" /> - <ClInclude Include="cmprofpthndlr.h" /> - <ClInclude Include="cmpthndlr.h" /> - <ClInclude Include="cmschema.h" /> - <ClInclude Include="globals.h" /> - <ClInclude Include="nupchndlr.h" /> - <ClInclude Include="nupdata.h" /> - <ClInclude Include="nupschema.h" /> - <ClInclude Include="nupthndlr.h" /> - <ClInclude Include="pchndlr.h" /> - <ClInclude Include="pgscdata.h" /> - <ClInclude Include="pgscpchndlr.h" /> - <ClInclude Include="pgscpthndlr.h" /> - <ClInclude Include="pgscschema.h" /> - <ClInclude Include="pimagedata.h" /> - <ClInclude Include="pimagepthndlr.h" /> - <ClInclude Include="pimageschema.h" /> - <ClInclude Include="porientdata.h" /> - <ClInclude Include="porientpthndlr.h" /> - <ClInclude Include="porientschema.h" /> - <ClInclude Include="precomp.h" /> - <ClInclude Include="privatedefs.h" /> - <ClInclude Include="pshndlr.h" /> - <ClInclude Include="psizedata.h" /> - <ClInclude Include="psizepthndlr.h" /> - <ClInclude Include="psizeschema.h" /> - <ClInclude Include="pthndlr.h" /> - <ClInclude Include="ptquerybld.h" /> - <ClInclude Include="schema.h" /> - <ClInclude Include="wmdata.h" /> - <ClInclude Include="wmpchndlr.h" /> - <ClInclude Include="wmpthndlr.h" /> - <ClInclude Include="wmschema.h" /> - <ClInclude Include="workbuff.h" /> - <ClInclude Include="bkdata.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="bkpchndlr.h" /> - <ClInclude Include="bkpthndlr.h" /> - <ClInclude Include="bkschema.h" /> - <ClInclude Include="cmdata.h" /> - <ClInclude Include="cmintentsdata.h" /> - <ClInclude Include="cmintentsschema.h" /> - <ClInclude Include="cmintpthndlr.h" /> - <ClInclude Include="cmprofiledata.h" /> - <ClInclude Include="cmprofileschema.h" /> - <ClInclude Include="cmprofpchndlr.h" /> - <ClInclude Include="cmprofpthndlr.h" /> - <ClInclude Include="cmpthndlr.h" /> - <ClInclude Include="cmschema.h" /> - <ClInclude Include="globals.h" /> - <ClInclude Include="nupchndlr.h" /> - <ClInclude Include="nupdata.h" /> - <ClInclude Include="nupschema.h" /> - <ClInclude Include="nupthndlr.h" /> - <ClInclude Include="pchndlr.h" /> - <ClInclude Include="pgscdata.h" /> - <ClInclude Include="pgscpchndlr.h" /> - <ClInclude Include="pgscpthndlr.h" /> - <ClInclude Include="pgscschema.h" /> - <ClInclude Include="pimagedata.h" /> - <ClInclude Include="pimagepthndlr.h" /> - <ClInclude Include="pimageschema.h" /> - <ClInclude Include="porientdata.h" /> - <ClInclude Include="porientpthndlr.h" /> - <ClInclude Include="porientschema.h" /> - <ClInclude Include="precomp.h" /> - <ClInclude Include="privatedefs.h" /> - <ClInclude Include="pshndlr.h" /> - <ClInclude Include="psizedata.h" /> - <ClInclude Include="psizepthndlr.h" /> - <ClInclude Include="psizeschema.h" /> - <ClInclude Include="pthndlr.h" /> - <ClInclude Include="ptquerybld.h" /> - <ClInclude Include="schema.h" /> - <ClInclude Include="wmdata.h" /> - <ClInclude Include="wmpchndlr.h" /> - <ClInclude Include="wmpthndlr.h" /> - <ClInclude Include="wmschema.h" /> - <ClInclude Include="workbuff.h" /> - <ClInclude Include="bkdata.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="bkpchndlr.h" /> - <ClInclude Include="bkpthndlr.h" /> - <ClInclude Include="bkschema.h" /> - <ClInclude Include="cmdata.h" /> - <ClInclude Include="cmintentsdata.h" /> - <ClInclude Include="cmintentsschema.h" /> - <ClInclude Include="cmintpthndlr.h" /> - <ClInclude Include="cmprofiledata.h" /> - <ClInclude Include="cmprofileschema.h" /> - <ClInclude Include="cmprofpchndlr.h" /> - <ClInclude Include="cmprofpthndlr.h" /> - <ClInclude Include="cmpthndlr.h" /> - <ClInclude Include="cmschema.h" /> - <ClInclude Include="globals.h" /> - <ClInclude Include="nupchndlr.h" /> - <ClInclude Include="nupdata.h" /> - <ClInclude Include="nupschema.h" /> - <ClInclude Include="nupthndlr.h" /> - <ClInclude Include="pchndlr.h" /> - <ClInclude Include="pgscdata.h" /> - <ClInclude Include="pgscpchndlr.h" /> - <ClInclude Include="pgscpthndlr.h" /> - <ClInclude Include="pgscschema.h" /> - <ClInclude Include="pimagedata.h" /> - <ClInclude Include="pimagepthndlr.h" /> - <ClInclude Include="pimageschema.h" /> - <ClInclude Include="porientdata.h" /> - <ClInclude Include="porientpthndlr.h" /> - <ClInclude Include="porientschema.h" /> - <ClInclude Include="precomp.h" /> - <ClInclude Include="privatedefs.h" /> - <ClInclude Include="pshndlr.h" /> - <ClInclude Include="psizedata.h" /> - <ClInclude Include="psizepthndlr.h" /> - <ClInclude Include="psizeschema.h" /> - <ClInclude Include="pthndlr.h" /> - <ClInclude Include="ptquerybld.h" /> - <ClInclude Include="schema.h" /> - <ClInclude Include="wmdata.h" /> - <ClInclude Include="wmpchndlr.h" /> - <ClInclude Include="wmpthndlr.h" /> - <ClInclude Include="wmschema.h" /> - <ClInclude Include="workbuff.h" /> - <ClInclude Include="bkdata.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="bkpchndlr.h" /> - <ClInclude Include="bkpthndlr.h" /> - <ClInclude Include="bkschema.h" /> - <ClInclude Include="cmdata.h" /> - <ClInclude Include="cmintentsdata.h" /> - <ClInclude Include="cmintentsschema.h" /> - <ClInclude Include="cmintpthndlr.h" /> - <ClInclude Include="cmprofiledata.h" /> - <ClInclude Include="cmprofileschema.h" /> - <ClInclude Include="cmprofpchndlr.h" /> - <ClInclude Include="cmprofpthndlr.h" /> - <ClInclude Include="cmpthndlr.h" /> - <ClInclude Include="cmschema.h" /> - <ClInclude Include="globals.h" /> - <ClInclude Include="nupchndlr.h" /> - <ClInclude Include="nupdata.h" /> - <ClInclude Include="nupschema.h" /> - <ClInclude Include="nupthndlr.h" /> - <ClInclude Include="pchndlr.h" /> - <ClInclude Include="pgscdata.h" /> - <ClInclude Include="pgscpchndlr.h" /> - <ClInclude Include="pgscpthndlr.h" /> - <ClInclude Include="pgscschema.h" /> - <ClInclude Include="pimagedata.h" /> - <ClInclude Include="pimagepthndlr.h" /> - <ClInclude Include="pimageschema.h" /> - <ClInclude Include="porientdata.h" /> - <ClInclude Include="porientpthndlr.h" /> - <ClInclude Include="porientschema.h" /> - <ClInclude Include="precomp.h" /> - <ClInclude Include="privatedefs.h" /> - <ClInclude Include="pshndlr.h" /> - <ClInclude Include="psizedata.h" /> - <ClInclude Include="psizepthndlr.h" /> - <ClInclude Include="psizeschema.h" /> - <ClInclude Include="pthndlr.h" /> - <ClInclude Include="ptquerybld.h" /> - <ClInclude Include="schema.h" /> - <ClInclude Include="wmdata.h" /> - <ClInclude Include="wmpchndlr.h" /> - <ClInclude Include="wmpthndlr.h" /> - <ClInclude Include="wmschema.h" /> - <ClInclude Include="workbuff.h" /> - <ClInclude Include="bkdata.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="bkpchndlr.h" /> - <ClInclude Include="bkpthndlr.h" /> - <ClInclude Include="bkschema.h" /> - <ClInclude Include="cmdata.h" /> - <ClInclude Include="cmintentsdata.h" /> - <ClInclude Include="cmintentsschema.h" /> - <ClInclude Include="cmintpthndlr.h" /> - <ClInclude Include="cmprofiledata.h" /> - <ClInclude Include="cmprofileschema.h" /> - <ClInclude Include="cmprofpchndlr.h" /> - <ClInclude Include="cmprofpthndlr.h" /> - <ClInclude Include="cmpthndlr.h" /> - <ClInclude Include="cmschema.h" /> - <ClInclude Include="globals.h" /> - <ClInclude Include="nupchndlr.h" /> - <ClInclude Include="nupdata.h" /> - <ClInclude Include="nupschema.h" /> - <ClInclude Include="nupthndlr.h" /> - <ClInclude Include="pchndlr.h" /> - <ClInclude Include="pgscdata.h" /> - <ClInclude Include="pgscpchndlr.h" /> - <ClInclude Include="pgscpthndlr.h" /> - <ClInclude Include="pgscschema.h" /> - <ClInclude Include="pimagedata.h" /> - <ClInclude Include="pimagepthndlr.h" /> - <ClInclude Include="pimageschema.h" /> - <ClInclude Include="porientdata.h" /> - <ClInclude Include="porientpthndlr.h" /> - <ClInclude Include="porientschema.h" /> - <ClInclude Include="precomp.h" /> - <ClInclude Include="privatedefs.h" /> - <ClInclude Include="pshndlr.h" /> - <ClInclude Include="psizedata.h" /> - <ClInclude Include="psizepthndlr.h" /> - <ClInclude Include="psizeschema.h" /> - <ClInclude Include="pthndlr.h" /> - <ClInclude Include="ptquerybld.h" /> - <ClInclude Include="schema.h" /> - <ClInclude Include="wmdata.h" /> - <ClInclude Include="wmpchndlr.h" /> - <ClInclude Include="wmpthndlr.h" /> - <ClInclude Include="wmschema.h" /> - <ClInclude Include="workbuff.h" /> - <ClInclude Include="bkdata.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="bkpchndlr.h" /> - <ClInclude Include="bkpthndlr.h" /> - <ClInclude Include="bkschema.h" /> - <ClInclude Include="cmdata.h" /> - <ClInclude Include="cmintentsdata.h" /> - <ClInclude Include="cmintentsschema.h" /> - <ClInclude Include="cmintpthndlr.h" /> - <ClInclude Include="cmprofiledata.h" /> - <ClInclude Include="cmprofileschema.h" /> - <ClInclude Include="cmprofpchndlr.h" /> - <ClInclude Include="cmprofpthndlr.h" /> - <ClInclude Include="cmpthndlr.h" /> - <ClInclude Include="cmschema.h" /> - <ClInclude Include="globals.h" /> - <ClInclude Include="nupchndlr.h" /> - <ClInclude Include="nupdata.h" /> - <ClInclude Include="nupschema.h" /> - <ClInclude Include="nupthndlr.h" /> - <ClInclude Include="pchndlr.h" /> - <ClInclude Include="pgscdata.h" /> - <ClInclude Include="pgscpchndlr.h" /> - <ClInclude Include="pgscpthndlr.h" /> - <ClInclude Include="pgscschema.h" /> - <ClInclude Include="pimagedata.h" /> - <ClInclude Include="pimagepthndlr.h" /> - <ClInclude Include="pimageschema.h" /> - <ClInclude Include="porientdata.h" /> - <ClInclude Include="porientpthndlr.h" /> - <ClInclude Include="porientschema.h" /> - <ClInclude Include="precomp.h" /> - <ClInclude Include="privatedefs.h" /> - <ClInclude Include="pshndlr.h" /> - <ClInclude Include="psizedata.h" /> - <ClInclude Include="psizepthndlr.h" /> - <ClInclude Include="psizeschema.h" /> - <ClInclude Include="pthndlr.h" /> - <ClInclude Include="ptquerybld.h" /> - <ClInclude Include="schema.h" /> - <ClInclude Include="wmdata.h" /> - <ClInclude Include="wmpchndlr.h" /> - <ClInclude Include="wmpthndlr.h" /> - <ClInclude Include="wmschema.h" /> - <ClInclude Include="workbuff.h" /> - <ClInclude Include="bkdata.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="bkpchndlr.h" /> - <ClInclude Include="bkpthndlr.h" /> - <ClInclude Include="bkschema.h" /> - <ClInclude Include="cmdata.h" /> - <ClInclude Include="cmintentsdata.h" /> - <ClInclude Include="cmintentsschema.h" /> - <ClInclude Include="cmintpthndlr.h" /> - <ClInclude Include="cmprofiledata.h" /> - <ClInclude Include="cmprofileschema.h" /> - <ClInclude Include="cmprofpchndlr.h" /> - <ClInclude Include="cmprofpthndlr.h" /> - <ClInclude Include="cmpthndlr.h" /> - <ClInclude Include="cmschema.h" /> - <ClInclude Include="globals.h" /> - <ClInclude Include="nupchndlr.h" /> - <ClInclude Include="nupdata.h" /> - <ClInclude Include="nupschema.h" /> - <ClInclude Include="nupthndlr.h" /> - <ClInclude Include="pchndlr.h" /> - <ClInclude Include="pgscdata.h" /> - <ClInclude Include="pgscpchndlr.h" /> - <ClInclude Include="pgscpthndlr.h" /> - <ClInclude Include="pgscschema.h" /> - <ClInclude Include="pimagedata.h" /> - <ClInclude Include="pimagepthndlr.h" /> - <ClInclude Include="pimageschema.h" /> - <ClInclude Include="porientdata.h" /> - <ClInclude Include="porientpthndlr.h" /> - <ClInclude Include="porientschema.h" /> - <ClInclude Include="precomp.h" /> - <ClInclude Include="privatedefs.h" /> - <ClInclude Include="pshndlr.h" /> - <ClInclude Include="psizedata.h" /> - <ClInclude Include="psizepthndlr.h" /> - <ClInclude Include="psizeschema.h" /> - <ClInclude Include="pthndlr.h" /> - <ClInclude Include="ptquerybld.h" /> - <ClInclude Include="schema.h" /> - <ClInclude Include="wmdata.h" /> - <ClInclude Include="wmpchndlr.h" /> - <ClInclude Include="wmpthndlr.h" /> - <ClInclude Include="wmschema.h" /> - <ClInclude Include="workbuff.h" /> - <ClInclude Include="bkdata.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="bkpchndlr.h" /> - <ClInclude Include="bkpthndlr.h" /> - <ClInclude Include="bkschema.h" /> - <ClInclude Include="cmdata.h" /> - <ClInclude Include="cmintentsdata.h" /> - <ClInclude Include="cmintentsschema.h" /> - <ClInclude Include="cmintpthndlr.h" /> - <ClInclude Include="cmprofiledata.h" /> - <ClInclude Include="cmprofileschema.h" /> - <ClInclude Include="cmprofpchndlr.h" /> - <ClInclude Include="cmprofpthndlr.h" /> - <ClInclude Include="cmpthndlr.h" /> - <ClInclude Include="cmschema.h" /> - <ClInclude Include="globals.h" /> - <ClInclude Include="nupchndlr.h" /> - <ClInclude Include="nupdata.h" /> - <ClInclude Include="nupschema.h" /> - <ClInclude Include="nupthndlr.h" /> - <ClInclude Include="pchndlr.h" /> - <ClInclude Include="pgscdata.h" /> - <ClInclude Include="pgscpchndlr.h" /> - <ClInclude Include="pgscpthndlr.h" /> - <ClInclude Include="pgscschema.h" /> - <ClInclude Include="pimagedata.h" /> - <ClInclude Include="pimagepthndlr.h" /> - <ClInclude Include="pimageschema.h" /> - <ClInclude Include="porientdata.h" /> - <ClInclude Include="porientpthndlr.h" /> - <ClInclude Include="porientschema.h" /> - <ClInclude Include="precomp.h" /> - <ClInclude Include="privatedefs.h" /> - <ClInclude Include="pshndlr.h" /> - <ClInclude Include="psizedata.h" /> - <ClInclude Include="psizepthndlr.h" /> - <ClInclude Include="psizeschema.h" /> - <ClInclude Include="pthndlr.h" /> - <ClInclude Include="ptquerybld.h" /> - <ClInclude Include="schema.h" /> - <ClInclude Include="wmdata.h" /> - <ClInclude Include="wmpchndlr.h" /> - <ClInclude Include="wmpthndlr.h" /> - <ClInclude Include="wmschema.h" /> - <ClInclude Include="workbuff.h" /> - <ClInclude Include="bkdata.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="bkpchndlr.h" /> - <ClInclude Include="bkpthndlr.h" /> - <ClInclude Include="bkschema.h" /> - <ClInclude Include="cmdata.h" /> - <ClInclude Include="cmintentsdata.h" /> - <ClInclude Include="cmintentsschema.h" /> - <ClInclude Include="cmintpthndlr.h" /> - <ClInclude Include="cmprofiledata.h" /> - <ClInclude Include="cmprofileschema.h" /> - <ClInclude Include="cmprofpchndlr.h" /> - <ClInclude Include="cmprofpthndlr.h" /> - <ClInclude Include="cmpthndlr.h" /> - <ClInclude Include="cmschema.h" /> - <ClInclude Include="globals.h" /> - <ClInclude Include="nupchndlr.h" /> - <ClInclude Include="nupdata.h" /> - <ClInclude Include="nupschema.h" /> - <ClInclude Include="nupthndlr.h" /> - <ClInclude Include="pchndlr.h" /> - <ClInclude Include="pgscdata.h" /> - <ClInclude Include="pgscpchndlr.h" /> - <ClInclude Include="pgscpthndlr.h" /> - <ClInclude Include="pgscschema.h" /> - <ClInclude Include="pimagedata.h" /> - <ClInclude Include="pimagepthndlr.h" /> - <ClInclude Include="pimageschema.h" /> - <ClInclude Include="porientdata.h" /> - <ClInclude Include="porientpthndlr.h" /> - <ClInclude Include="porientschema.h" /> - <ClInclude Include="precomp.h" /> - <ClInclude Include="privatedefs.h" /> - <ClInclude Include="pshndlr.h" /> - <ClInclude Include="psizedata.h" /> - <ClInclude Include="psizepthndlr.h" /> - <ClInclude Include="psizeschema.h" /> - <ClInclude Include="pthndlr.h" /> - <ClInclude Include="ptquerybld.h" /> - <ClInclude Include="schema.h" /> - <ClInclude Include="wmdata.h" /> - <ClInclude Include="wmpchndlr.h" /> - <ClInclude Include="wmpthndlr.h" /> - <ClInclude Include="wmschema.h" /> - <ClInclude Include="workbuff.h" /> - <ClInclude Include="bkdata.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="bkpchndlr.h" /> - <ClInclude Include="bkpthndlr.h" /> - <ClInclude Include="bkschema.h" /> - <ClInclude Include="cmdata.h" /> - <ClInclude Include="cmintentsdata.h" /> - <ClInclude Include="cmintentsschema.h" /> - <ClInclude Include="cmintpthndlr.h" /> - <ClInclude Include="cmprofiledata.h" /> - <ClInclude Include="cmprofileschema.h" /> - <ClInclude Include="cmprofpchndlr.h" /> - <ClInclude Include="cmprofpthndlr.h" /> - <ClInclude Include="cmpthndlr.h" /> - <ClInclude Include="cmschema.h" /> - <ClInclude Include="globals.h" /> - <ClInclude Include="nupchndlr.h" /> - <ClInclude Include="nupdata.h" /> - <ClInclude Include="nupschema.h" /> - <ClInclude Include="nupthndlr.h" /> - <ClInclude Include="pchndlr.h" /> - <ClInclude Include="pgscdata.h" /> - <ClInclude Include="pgscpchndlr.h" /> - <ClInclude Include="pgscpthndlr.h" /> - <ClInclude Include="pgscschema.h" /> - <ClInclude Include="pimagedata.h" /> - <ClInclude Include="pimagepthndlr.h" /> - <ClInclude Include="pimageschema.h" /> - <ClInclude Include="porientdata.h" /> - <ClInclude Include="porientpthndlr.h" /> - <ClInclude Include="porientschema.h" /> - <ClInclude Include="precomp.h" /> - <ClInclude Include="privatedefs.h" /> - <ClInclude Include="pshndlr.h" /> - <ClInclude Include="psizedata.h" /> - <ClInclude Include="psizepthndlr.h" /> - <ClInclude Include="psizeschema.h" /> - <ClInclude Include="pthndlr.h" /> - <ClInclude Include="ptquerybld.h" /> - <ClInclude Include="schema.h" /> - <ClInclude Include="wmdata.h" /> - <ClInclude Include="wmpchndlr.h" /> - <ClInclude Include="wmpthndlr.h" /> - <ClInclude Include="wmschema.h" /> - <ClInclude Include="workbuff.h" /> - <ClInclude Include="bkdata.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="bkpchndlr.h" /> - <ClInclude Include="bkpthndlr.h" /> - <ClInclude Include="bkschema.h" /> - <ClInclude Include="cmdata.h" /> - <ClInclude Include="cmintentsdata.h" /> - <ClInclude Include="cmintentsschema.h" /> - <ClInclude Include="cmintpthndlr.h" /> - <ClInclude Include="cmprofiledata.h" /> - <ClInclude Include="cmprofileschema.h" /> - <ClInclude Include="cmprofpchndlr.h" /> - <ClInclude Include="cmprofpthndlr.h" /> - <ClInclude Include="cmpthndlr.h" /> - <ClInclude Include="cmschema.h" /> - <ClInclude Include="globals.h" /> - <ClInclude Include="nupchndlr.h" /> - <ClInclude Include="nupdata.h" /> - <ClInclude Include="nupschema.h" /> - <ClInclude Include="nupthndlr.h" /> - <ClInclude Include="pchndlr.h" /> - <ClInclude Include="pgscdata.h" /> - <ClInclude Include="pgscpchndlr.h" /> - <ClInclude Include="pgscpthndlr.h" /> - <ClInclude Include="pgscschema.h" /> - <ClInclude Include="pimagedata.h" /> - <ClInclude Include="pimagepthndlr.h" /> - <ClInclude Include="pimageschema.h" /> - <ClInclude Include="porientdata.h" /> - <ClInclude Include="porientpthndlr.h" /> - <ClInclude Include="porientschema.h" /> - <ClInclude Include="precomp.h" /> - <ClInclude Include="privatedefs.h" /> - <ClInclude Include="pshndlr.h" /> - <ClInclude Include="psizedata.h" /> - <ClInclude Include="psizepthndlr.h" /> - <ClInclude Include="psizeschema.h" /> - <ClInclude Include="pthndlr.h" /> - <ClInclude Include="ptquerybld.h" /> - <ClInclude Include="schema.h" /> - <ClInclude Include="wmdata.h" /> - <ClInclude Include="wmpchndlr.h" /> - <ClInclude Include="wmpthndlr.h" /> - <ClInclude Include="wmschema.h" /> - <ClInclude Include="workbuff.h" /> - <ClInclude Include="bkdata.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="bkpchndlr.h" /> - <ClInclude Include="bkpthndlr.h" /> - <ClInclude Include="bkschema.h" /> - <ClInclude Include="cmdata.h" /> - <ClInclude Include="cmintentsdata.h" /> - <ClInclude Include="cmintentsschema.h" /> - <ClInclude Include="cmintpthndlr.h" /> - <ClInclude Include="cmprofiledata.h" /> - <ClInclude Include="cmprofileschema.h" /> - <ClInclude Include="cmprofpchndlr.h" /> - <ClInclude Include="cmprofpthndlr.h" /> - <ClInclude Include="cmpthndlr.h" /> - <ClInclude Include="cmschema.h" /> - <ClInclude Include="globals.h" /> - <ClInclude Include="nupchndlr.h" /> - <ClInclude Include="nupdata.h" /> - <ClInclude Include="nupschema.h" /> - <ClInclude Include="nupthndlr.h" /> - <ClInclude Include="pchndlr.h" /> - <ClInclude Include="pgscdata.h" /> - <ClInclude Include="pgscpchndlr.h" /> - <ClInclude Include="pgscpthndlr.h" /> - <ClInclude Include="pgscschema.h" /> - <ClInclude Include="pimagedata.h" /> - <ClInclude Include="pimagepthndlr.h" /> - <ClInclude Include="pimageschema.h" /> - <ClInclude Include="porientdata.h" /> - <ClInclude Include="porientpthndlr.h" /> - <ClInclude Include="porientschema.h" /> - <ClInclude Include="precomp.h" /> - <ClInclude Include="privatedefs.h" /> - <ClInclude Include="pshndlr.h" /> - <ClInclude Include="psizedata.h" /> - <ClInclude Include="psizepthndlr.h" /> - <ClInclude Include="psizeschema.h" /> - <ClInclude Include="pthndlr.h" /> - <ClInclude Include="ptquerybld.h" /> - <ClInclude Include="schema.h" /> - <ClInclude Include="wmdata.h" /> - <ClInclude Include="wmpchndlr.h" /> - <ClInclude Include="wmpthndlr.h" /> - <ClInclude Include="wmschema.h" /> - <ClInclude Include="workbuff.h" /> - <ClInclude Include="bkdata.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="bkpchndlr.h" /> - <ClInclude Include="bkpthndlr.h" /> - <ClInclude Include="bkschema.h" /> - <ClInclude Include="cmdata.h" /> - <ClInclude Include="cmintentsdata.h" /> - <ClInclude Include="cmintentsschema.h" /> - <ClInclude Include="cmintpthndlr.h" /> - <ClInclude Include="cmprofiledata.h" /> - <ClInclude Include="cmprofileschema.h" /> - <ClInclude Include="cmprofpchndlr.h" /> - <ClInclude Include="cmprofpthndlr.h" /> - <ClInclude Include="cmpthndlr.h" /> - <ClInclude Include="cmschema.h" /> - <ClInclude Include="globals.h" /> - <ClInclude Include="nupchndlr.h" /> - <ClInclude Include="nupdata.h" /> - <ClInclude Include="nupschema.h" /> - <ClInclude Include="nupthndlr.h" /> - <ClInclude Include="pchndlr.h" /> - <ClInclude Include="pgscdata.h" /> - <ClInclude Include="pgscpchndlr.h" /> - <ClInclude Include="pgscpthndlr.h" /> - <ClInclude Include="pgscschema.h" /> - <ClInclude Include="pimagedata.h" /> - <ClInclude Include="pimagepthndlr.h" /> - <ClInclude Include="pimageschema.h" /> - <ClInclude Include="porientdata.h" /> - <ClInclude Include="porientpthndlr.h" /> - <ClInclude Include="porientschema.h" /> - <ClInclude Include="precomp.h" /> - <ClInclude Include="privatedefs.h" /> - <ClInclude Include="pshndlr.h" /> - <ClInclude Include="psizedata.h" /> - <ClInclude Include="psizepthndlr.h" /> - <ClInclude Include="psizeschema.h" /> - <ClInclude Include="pthndlr.h" /> - <ClInclude Include="ptquerybld.h" /> - <ClInclude Include="schema.h" /> - <ClInclude Include="wmdata.h" /> - <ClInclude Include="wmpchndlr.h" /> - <ClInclude Include="wmpthndlr.h" /> - <ClInclude Include="wmschema.h" /> - <ClInclude Include="workbuff.h" /> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - </ItemGroup> -</Project>
\ No newline at end of file diff --git a/print/XPSDrvSmpl/src/debug/debug.cpp b/print/XPSDrvSmpl/src/debug/debug.cpp deleted file mode 100644 index 330a4a1d..00000000 --- a/print/XPSDrvSmpl/src/debug/debug.cpp +++ /dev/null @@ -1,189 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - debug.cpp - -Abstract: - - Debug implementations. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "xdstring.h" - -/*++ - -Routine Name: - - RealDebugMessage - -Routine Description: - - This routine takes a debug message and va_list and outputs the message via OutputDebugString - -Arguments: - - dwSize - Maximum size of the debug message in number of characters - pszMessage - The debug message string - arglist - The arg list for the debug message string - -Return Value: - - BOOL - TRUE - On success - FALSE - On error - ---*/ -BOOL -RealDebugMessage( - _In_ DWORD dwSize, - _In_ PCSTR pszMessage, - va_list arglist - ) -{ - HRESULT hr = S_OK; - PSTR pszMsgBuf; - - if (NULL == pszMessage || - 0 == dwSize) - { - hr = E_INVALIDARG; - } - - if (SUCCEEDED(hr)) - { - // - // Allocate memory for message buffer. - // - pszMsgBuf = new(std::nothrow) CHAR[dwSize + 1]; - - if (NULL != pszMsgBuf) - { - // - // Pass the variable parameters to wvsprintf to be formated. - // - hr = StringCbVPrintfA(pszMsgBuf, (dwSize + 1) * sizeof(CHAR), pszMessage, arglist); - - // - // Dump string to debug output. - // - OutputDebugStringA(pszMsgBuf); - - // - // Clean up. - // - delete[] pszMsgBuf; - pszMsgBuf = NULL; - } - else - { - hr = E_OUTOFMEMORY; - } - } - - return SUCCEEDED(hr); -} - -/*++ - -Routine Name: - - DbgPrint - -Routine Description: - - This routine takes a format string and arguments and outputs as a debug string - -Arguments: - - pszFormatString - Format string for the debug message - ... - argument list - -Return Value: - - BOOL - TRUE - On success - FALSE - On error - ---*/ -BOOL -DbgPrint( - _In_ PCSTR pszFormatString, - ... - ) -{ - BOOL bResult; - va_list VAList; - - // - // Pass the variable parameters to RealDebugMessage to be processed. - // - va_start(VAList, pszFormatString); - bResult = RealDebugMessage(0x8000, pszFormatString, VAList); - va_end(VAList); - - return bResult; -} - -/*++ - -Routine Name: - - DbgDOMDoc - -Routine Description: - - This routine outputs an XML DOM document to the debug output stream - -Arguments: - - pszMessage - Debug message - pDomDoc - DOM document to be output - -Return Value: - - None. - ---*/ -VOID -DbgDOMDoc( - _In_ PCSTR pszMessage, - _In_ IXMLDOMDocument2* pDomDoc - ) -{ - try - { - CComBSTR xml; - - if (pDomDoc != NULL && - SUCCEEDED(pDomDoc->get_xml(&xml))) - { - CStringXDA ansi(xml); - - if (pszMessage != NULL) - { - DbgPrint("%s%s\n", pszMessage, ansi.GetBuffer()); - } - else - { - DbgPrint("%s\n", ansi.GetBuffer()); - } - } - } - catch (CXDException&) - { - } -} - diff --git a/print/XPSDrvSmpl/src/debug/debug.h b/print/XPSDrvSmpl/src/debug/debug.h deleted file mode 100644 index ddfdc038..00000000 --- a/print/XPSDrvSmpl/src/debug/debug.h +++ /dev/null @@ -1,186 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - xdsdbg.h - -Abstract: - - Debug definitions. - ---*/ - -#pragma once - -// -// These macros are used for debugging purposes. They expand -// to white spaces on a free build. Here is a brief description -// of what they do and how they are used: -// -// giDebugLevel -// Global variable which set the current debug level to control -// the amount of debug messages emitted. -// -// VERBOSE(msg) -// Display a message if the current debug level is <= DBG_VERBOSE. -// -// TERSE(msg) -// Display a message if the current debug level is <= DBG_TERSE. -// -// WARNING(msg) -// Display a message if the current debug level is <= DBG_WARNING. -// The message format is: WRN filename (linenumber): message -// -// ERR(msg) -// Similiar to WARNING macro above - displays a message -// if the current debug level is <= DBG_ERROR. -// -// ASSERT(cond) -// Verify a condition is true. If not, force a breakpoint. -// -// ASSERTMSG(cond, msg) -// Verify a condition is true. If not, display a message and -// force a breakpoint. -// -// RIP(msg) -// Display a message and force a breakpoint. -// -// Usage: -// These macros require extra parantheses for the msg argument -// example, ASSERTMSG(x > 0, ("x is less than 0\n")); -// WARNING(("App passed NULL pointer, ignoring...\n")); -// - -#pragma once - -#define DBG_VERBOSE 1 -#define DBG_TERSE 2 -#define DBG_WARNING 3 -#define DBG_ERROR 4 -#define DBG_RIP 5 - -BOOL -RealDebugMessage( - _In_ DWORD dwSize, - _In_ PCSTR pszMessage, - va_list arglist - ); - -BOOL -DbgPrint( - _In_ PCSTR pszFormatString, - ... - ); - -VOID -DbgDOMDoc( - _In_ PCSTR pszMessage, - _In_ IXMLDOMDocument2* pDomDoc - ); - -#if DBG - -#ifndef MAX_DEBUG_LEVEL -#define MAX_DEBUG_LEVEL DBG_VERBOSE -#endif - -#define DBGMSG(level, prefix, msg) { \ - INT dbgLevel = level; \ - if (MAX_DEBUG_LEVEL <= (dbgLevel)) { \ - DbgPrint("%s %s (%d): ", prefix, __FILE__, __LINE__); \ - DbgPrint(msg); \ - } \ - } - -#define DBGMSG_ON_HR(level, prefix, hr) { \ - INT dbgLevel = level; \ - HRESULT hres = hr; \ - if (MAX_DEBUG_LEVEL <= (dbgLevel) && FAILED(hres)) { \ - DbgPrint("%s %s (%d): Call failed with HRESULT = 0x%x\n", prefix, __FILE__, __LINE__, hr); \ - } \ - } - -#define DBGMSG_ON_HR_EXC(level, prefix, hr, hr_exc) { \ - INT dbgLevel = level; \ - HRESULT hres = hr; \ - if (MAX_DEBUG_LEVEL <= (dbgLevel) && FAILED(hres) && hres != hr_exc) { \ - DbgPrint("%s %s (%d): Call failed with HRESULT = 0x%x\n", prefix, __FILE__, __LINE__, hr); \ - } \ - } - -#define DBGPRINT(level, msg) { \ - INT dbgLevel = level; \ - if (MAX_DEBUG_LEVEL <= (dbgLevel)) { \ - DbgPrint(msg); \ - } \ - } - -#define DBGXML(msg, pDomDoc) { \ - INT dbgLevel = DBG_VERBOSE; \ - if (MAX_DEBUG_LEVEL <= dbgLevel) { \ - DbgDOMDoc(msg, pDomDoc); \ - } \ - } - -#define VERBOSE(msg) DBGPRINT(DBG_VERBOSE, msg) -#define TERSE(msg) DBGPRINT(DBG_TERSE, msg) -#define WARNING(msg) DBGMSG(DBG_WARNING, "WRN", msg) -#define ERR(msg) DBGMSG(DBG_ERROR, "ERR", msg) -#define ERR_ON_HR(hr) DBGMSG_ON_HR(DBG_ERROR, "ERR", hr) -#define ERR_ON_HR_EXC(hr, hr_exc) DBGMSG_ON_HR_EXC(DBG_ERROR, "ERR", hr, hr_exc) - -#define ASSERT(cond) { \ - if (! (cond)) { \ - RIP(("\n")); \ - } \ - } - -#define ASSERTMSG(cond, msg) { \ - if (!(cond)) { \ - RIP(msg); \ - } \ - } - -#define RIP(msg) { \ - DBGMSG(DBG_RIP, "RIP", msg); \ - DebugBreak(); \ - } - -#define DBG_ONLY(p) p - -#else // !DBG - -#define VERBOSE(msg) -#define TERSE(msg) -#define WARNING(msg) -#define ERR(msg) -#define ERR_ON_HR(hr) -#define ERR_ON_HR_EXC(hr, hr_exc) - -#define ASSERT(cond) - -#define ASSERTMSG(cond, msg) - -#define RIP(msg) - -#define DBG_ONLY(p) - -#define DBGMSG(level, prefix, msg) - -#define DBGMSG_ON_HR(level, prefix, hr) - -#define DBGPRINT(level, msg) - -#define DBGXML(msg, pDomDoc) - -#endif - diff --git a/print/XPSDrvSmpl/src/debug/precomp.h b/print/XPSDrvSmpl/src/debug/precomp.h deleted file mode 100644 index fe380958..00000000 --- a/print/XPSDrvSmpl/src/debug/precomp.h +++ /dev/null @@ -1,67 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - precomp.h - -Abstract: - - Precompiled header. - ---*/ - -#pragma once - -// -// Annotate this as a usermode driver for static analysis -// -#include <DriverSpecs.h> -_Analysis_mode_(_Analysis_code_type_user_driver_) - -// -// Standard Annotation Language include -// -#include <sal.h> - -// -// Windows includes -// -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif // WIN32_LEAN_AND_MEAN -#include <windows.h> - -// -// COM includes -// -#include <objbase.h> -#include <oleauto.h> - -// -// ATL Includes -// -#include <atlbase.h> - -// -// STL Includes -// -#include <new> - -// -// MSXML includes -// -#include <msxml6.h> - -#include <StrSafe.h> - -#include "common.ver" - diff --git a/print/XPSDrvSmpl/src/debug/precompsrc.cpp b/print/XPSDrvSmpl/src/debug/precompsrc.cpp deleted file mode 100644 index 5944cf51..00000000 --- a/print/XPSDrvSmpl/src/debug/precompsrc.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "precomp.h"
\ No newline at end of file diff --git a/print/XPSDrvSmpl/src/debug/xdsdbg.vcxproj b/print/XPSDrvSmpl/src/debug/xdsdbg.vcxproj deleted file mode 100644 index d719c20a..00000000 --- a/print/XPSDrvSmpl/src/debug/xdsdbg.vcxproj +++ /dev/null @@ -1,343 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <ItemGroup Label="ProjectConfigurations"> - <ProjectConfiguration Include="Debug|ARM"> - <Configuration>Debug</Configuration> - <Platform>ARM</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Debug|ARM64"> - <Configuration>Debug</Configuration> - <Platform>ARM64</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Debug|Win32"> - <Configuration>Debug</Configuration> - <Platform>Win32</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release|ARM"> - <Configuration>Release</Configuration> - <Platform>ARM</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release|ARM64"> - <Configuration>Release</Configuration> - <Platform>ARM64</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release|Win32"> - <Configuration>Release</Configuration> - <Platform>Win32</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Debug|x64"> - <Configuration>Debug</Configuration> - <Platform>x64</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release|x64"> - <Configuration>Release</Configuration> - <Platform>x64</Platform> - </ProjectConfiguration> - </ItemGroup> - <PropertyGroup Label="Globals"> - <ProjectGuid>{E5DC3A24-691A-4F3A-B519-E4C49B2DAC98}</ProjectGuid> - <RootNamespace>$(MSBuildProjectName)</RootNamespace> - <SupportsPackaging>false</SupportsPackaging> - <RequiresPackageProject>true</RequiresPackageProject> - <Configuration Condition="'$(Configuration)' == ''">Debug</Configuration> - <Platform Condition="'$(Platform)' == ''">Win32</Platform> - <SampleGuid>{53D0D9CF-F293-45DB-8027-4C68A5747835}</SampleGuid> - </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> - <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>False</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>StaticLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>False</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>StaticLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>False</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>StaticLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>True</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>StaticLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>True</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>StaticLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>True</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>StaticLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>False</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>StaticLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>True</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>StaticLibrary</ConfigurationType> - </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> - <PropertyGroup> - <OutDir>$(IntDir)</OutDir> - </PropertyGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ItemGroup Label="WrappedTaskItems" /> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <TargetName>xdsdbg</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> - <TargetName>xdsdbg</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'"> - <TargetName>xdsdbg</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <TargetName>xdsdbg</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> - <TargetName>xdsdbg</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'"> - <TargetName>xdsdbg</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <TargetName>xdsdbg</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <TargetName>xdsdbg</TargetName> - </PropertyGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <ClCompile> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <ExceptionHandling>Sync</ExceptionHandling> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <PreprocessorDefinitions>%(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE</PreprocessorDefinitions> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);.\;.\..\inc;$(DDK_INC_PATH)</AdditionalIncludeDirectories> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE</PreprocessorDefinitions> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);.\;.\..\inc;$(DDK_INC_PATH)</AdditionalIncludeDirectories> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE</PreprocessorDefinitions> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);.\;.\..\inc;$(DDK_INC_PATH)</AdditionalIncludeDirectories> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> - <ClCompile> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <ExceptionHandling>Sync</ExceptionHandling> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <PreprocessorDefinitions>%(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE</PreprocessorDefinitions> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);.\;.\..\inc;$(DDK_INC_PATH)</AdditionalIncludeDirectories> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE</PreprocessorDefinitions> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);.\;.\..\inc;$(DDK_INC_PATH)</AdditionalIncludeDirectories> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE</PreprocessorDefinitions> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);.\;.\..\inc;$(DDK_INC_PATH)</AdditionalIncludeDirectories> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'"> - <ClCompile> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <ExceptionHandling>Sync</ExceptionHandling> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <PreprocessorDefinitions>%(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE</PreprocessorDefinitions> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);.\;.\..\inc;$(DDK_INC_PATH)</AdditionalIncludeDirectories> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE</PreprocessorDefinitions> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);.\;.\..\inc;$(DDK_INC_PATH)</AdditionalIncludeDirectories> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE</PreprocessorDefinitions> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);.\;.\..\inc;$(DDK_INC_PATH)</AdditionalIncludeDirectories> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <ClCompile> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <ExceptionHandling>Sync</ExceptionHandling> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <PreprocessorDefinitions>%(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE</PreprocessorDefinitions> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);.\;.\..\inc;$(DDK_INC_PATH)</AdditionalIncludeDirectories> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE</PreprocessorDefinitions> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);.\;.\..\inc;$(DDK_INC_PATH)</AdditionalIncludeDirectories> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE</PreprocessorDefinitions> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);.\;.\..\inc;$(DDK_INC_PATH)</AdditionalIncludeDirectories> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> - <ClCompile> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <ExceptionHandling>Sync</ExceptionHandling> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <PreprocessorDefinitions>%(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE</PreprocessorDefinitions> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);.\;.\..\inc;$(DDK_INC_PATH)</AdditionalIncludeDirectories> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE</PreprocessorDefinitions> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);.\;.\..\inc;$(DDK_INC_PATH)</AdditionalIncludeDirectories> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE</PreprocessorDefinitions> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);.\;.\..\inc;$(DDK_INC_PATH)</AdditionalIncludeDirectories> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'"> - <ClCompile> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <ExceptionHandling>Sync</ExceptionHandling> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <PreprocessorDefinitions>%(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE</PreprocessorDefinitions> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);.\;.\..\inc;$(DDK_INC_PATH)</AdditionalIncludeDirectories> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE</PreprocessorDefinitions> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);.\;.\..\inc;$(DDK_INC_PATH)</AdditionalIncludeDirectories> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE</PreprocessorDefinitions> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);.\;.\..\inc;$(DDK_INC_PATH)</AdditionalIncludeDirectories> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <ClCompile> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <ExceptionHandling>Sync</ExceptionHandling> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <PreprocessorDefinitions>%(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE</PreprocessorDefinitions> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);.\;.\..\inc;$(DDK_INC_PATH)</AdditionalIncludeDirectories> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE</PreprocessorDefinitions> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);.\;.\..\inc;$(DDK_INC_PATH)</AdditionalIncludeDirectories> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE</PreprocessorDefinitions> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);.\;.\..\inc;$(DDK_INC_PATH)</AdditionalIncludeDirectories> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <ClCompile> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <ExceptionHandling>Sync</ExceptionHandling> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <PreprocessorDefinitions>%(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE</PreprocessorDefinitions> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);.\;.\..\inc;$(DDK_INC_PATH)</AdditionalIncludeDirectories> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE</PreprocessorDefinitions> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);.\;.\..\inc;$(DDK_INC_PATH)</AdditionalIncludeDirectories> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE</PreprocessorDefinitions> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);.\;.\..\inc;$(DDK_INC_PATH)</AdditionalIncludeDirectories> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemGroup> - <ClCompile Include="debug.cpp"> - <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="precompsrc.cpp"> - <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Create</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - </ItemGroup> - <ItemGroup> - <Inf Exclude="@(Inf)" Include="*.inf" /> - <FilesToPackage Include="$(TargetPath)" Condition="'$(ConfigurationType)'=='Driver' or '$(ConfigurationType)'=='DynamicLibrary'" /> - </ItemGroup> - <ItemGroup> - <None Exclude="@(None)" Include="*.txt;*.htm;*.html" /> - <None Exclude="@(None)" Include="*.ico;*.cur;*.bmp;*.dlg;*.rct;*.gif;*.jpg;*.jpeg;*.wav;*.jpe;*.tiff;*.tif;*.png;*.rc2" /> - <None Exclude="@(None)" Include="*.def;*.bat;*.hpj;*.asmx" /> - </ItemGroup> - <ItemGroup> - <ClInclude Exclude="@(ClInclude)" Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd" /> - </ItemGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> -</Project>
\ No newline at end of file diff --git a/print/XPSDrvSmpl/src/debug/xdsdbg.vcxproj.Filters b/print/XPSDrvSmpl/src/debug/xdsdbg.vcxproj.Filters deleted file mode 100644 index def7a023..00000000 --- a/print/XPSDrvSmpl/src/debug/xdsdbg.vcxproj.Filters +++ /dev/null @@ -1,33 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <ItemGroup> - <Filter Include="Source Files"> - <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;*</Extensions> - <UniqueIdentifier>{D63DDF6B-528A-4350-B9BD-5781172E99A7}</UniqueIdentifier> - </Filter> - <Filter Include="Header Files"> - <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions> - <UniqueIdentifier>{BA0B6D06-BD16-42D4-94AD-1E321724C320}</UniqueIdentifier> - </Filter> - <Filter Include="Resource Files"> - <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms;man;xml</Extensions> - <UniqueIdentifier>{684F91A3-B169-45E2-BD6B-FE8D8524326C}</UniqueIdentifier> - </Filter> - </ItemGroup> - <ItemGroup> - <ClCompile Include="debug.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="precompsrc.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - </ItemGroup> - <ItemGroup> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - </ItemGroup> -</Project>
\ No newline at end of file diff --git a/print/XPSDrvSmpl/src/filters/booklet/bkflt.cpp b/print/XPSDrvSmpl/src/filters/booklet/bkflt.cpp deleted file mode 100644 index 67a4d867..00000000 --- a/print/XPSDrvSmpl/src/filters/booklet/bkflt.cpp +++ /dev/null @@ -1,591 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - bkflt.cpp - -Abstract: - - Booklet filter implementation. This class derives from the Xps filter - class and implements the necessary part handlers to support booklet - printing. The booklet filter is responsible for re-ordering pages and re-uses - the NUp filter to provide 2-up and offset support. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "xdexcept.h" -#include "pthndlr.h" -#include "bkflt.h" -#include "bksax.h" -#include "bkpthndlr.h" - -using XDPrintSchema::Binding::BindingData; - -/*++ - -Routine Name: - - CBookletFilter::CBookletFilter - -Routine Description: - - Default constructor for the booklet filter which initialises the - filter to sensible default values - -Arguments: - - None - -Return Value: - - None - ---*/ -CBookletFilter::CBookletFilter() : - m_bSendAllDocs(TRUE), - m_bookScope(CBkPTProperties::None) -{ -} - -/*++ - -Routine Name: - - CBookletFilter::~CBookletFilter - -Routine Description: - - Default destructor for the booklet filter - -Arguments: - - None - -Return Value: - - None - ---*/ -CBookletFilter::~CBookletFilter() -{ -} - -/*++ - -Routine Name: - - CNUpFilter::ProcessPart - -Routine Description: - - Method for processing each fixed document sequence part in a container - -Arguments: - - pFDS - Pointer to the fixed document sequence to process - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CBookletFilter::ProcessPart( - _Inout_ IFixedDocumentSequence* pFDS - ) -{ - VERBOSE("Processing Fixed Document Sequence part with booklet filter handler\n"); - - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pFDS, E_POINTER))) - { - // - // Get the PT manager to return the FixedDocumentSequence ticket. - // - IXMLDOMDocument2* pPT = NULL; - if (SUCCEEDED(hr = m_ptManager.SetTicket(pFDS)) && - SUCCEEDED(hr = m_ptManager.GetTicket(kPTJobScope, &pPT))) - { - // - // Set the binding scope from the PrintTicket - // - hr = SetBindingScope(pPT); - } - } - - if (SUCCEEDED(hr)) - { - hr = m_pXDWriter->SendFixedDocumentSequence(pFDS); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CBookletFilter::ProcessPart - -Routine Description: - - Method for processing each fixed document part in a container - -Arguments: - - pFD - Pointer to the fixed document to process - -Return Value: - - HRESULT - S_OK - On success - S_FALSE - When not enabled in the PT - E_* - On error - ---*/ -HRESULT -CBookletFilter::ProcessPart( - _Inout_ IFixedDocument* pFD - ) -{ - VERBOSE("Processing Fixed Document part with booklet filter handler\n"); - - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pFD, E_POINTER)) && - SUCCEEDED(hr = m_ptManager.SetTicket(pFD))) - { - // - // If we are in a JobBook session we want to maintain the current - // JobBook settings - // - if (m_bookScope != CBkPTProperties::Job) - { - // - // Flush any outstanding pages in case we have just completed a - // DocNUp sequence - // - hr = FlushCache(); - - // - // Get the PT manager to return the FixedDocument ticket. - // - IXMLDOMDocument2* pPT = NULL; - if (SUCCEEDED(hr) && - SUCCEEDED(hr = m_ptManager.GetTicket(kPTDocumentScope, &pPT))) - { - // - // Set the binding scope from the PrintTicket - // - hr = SetBindingScope(pPT); - } - } - } - - if (SUCCEEDED(hr) && - m_bSendAllDocs) - { - hr = m_pXDWriter->SendFixedDocument(pFD); - - // - // If we are JobBindAllDocuments we only ever send one doc - now we have - // sent the first document we can test to see if we need to send all of them - // - if (m_bookScope == CBkPTProperties::Job) - { - m_bSendAllDocs = FALSE; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CBookletFilter::ProcessPart - -Routine Description: - - Method for processing each fixed page part in a container - -Arguments: - - pFP - Pointer to the fixed page to process - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CBookletFilter::ProcessPart( - _Inout_ IFixedPage* pFP - ) -{ - ASSERTMSG(m_pXDWriter != NULL, "XD writer is not initialised.\n"); - - VERBOSE("Processing Fixed Page with booklet filter handler\n"); - - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pFP, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(m_pXDWriter, E_PENDING))) - { - // - // Check if we are processing a booklet job - // - if (m_bookScope != CBkPTProperties::None) - { - // - // Cache pages for reordering - // - try - { - m_cacheFP.push_back(pFP); - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - else - { - hr = m_pXDWriter->SendFixedPage(pFP); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CBookletFilter::Finalize - -Routine Description: - - Method to flush the cache of pages as the last action of the filter - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CBookletFilter::Finalize( - VOID - ) -{ - // - // Just flush the cache of pages - // - return FlushCache(); -} - -/*++ - -Routine Name: - - CBookletFilter::FlushCache - -Routine Description: - - Method to send the cached collection of pages in the correct order back - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CBookletFilter::FlushCache( - VOID - ) -{ - HRESULT hr = S_OK; - - if (m_pXDWriter == NULL) - { - hr = E_PENDING; - } - - size_t cPages = m_cacheFP.size(); - - if (SUCCEEDED(hr) && - cPages > 0 && - m_bookScope != CBkPTProperties::None) - { - // - // We may need to add a pad page if the page count is odd - // - CComPtr<IFixedPage> pNewFP(NULL); - if (cPages%2 == 1 && - SUCCEEDED(hr = CreatePadPage(&pNewFP))) - { - // - // We successfully created our pad page; add it to the cache - // - try - { - m_cacheFP.push_back(pNewFP); - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - - cPages++; - } - - if (SUCCEEDED(hr)) - { - try - { - // - // Re-order pages in the cache - // - map<size_t, IFixedPage*> reorderedPages; - size_t newIndex = 0; - size_t pageIndex = 0; - for (pageIndex = 0; pageIndex < cPages/2; pageIndex++) - { - reorderedPages[newIndex] = m_cacheFP[pageIndex]; - newIndex += 2; - } - - newIndex = cPages - 1; - for (pageIndex = cPages/2; pageIndex < cPages; pageIndex++) - { - reorderedPages[newIndex] = m_cacheFP[pageIndex]; - newIndex -= 2; - } - - // - // Write out reordered pages - // - for (pageIndex = 0; pageIndex < cPages && SUCCEEDED(hr); pageIndex++) - { - hr = m_pXDWriter->SendFixedPage(reorderedPages[pageIndex]); - } - - // - // Clean out the cache - // - m_cacheFP.clear(); - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CBookletFilter::CreatePadPage - -Routine Description: - - Method to create a pad page which is required for odd page counts to - ensure pages are correctly ordered for presentation as a booklet - -Arguments: - - ppNewPage - Pointer to a pointer to the newly created fixed page - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CBookletFilter::CreatePadPage( - _Outptr_ IFixedPage** ppNewPage - ) -{ - HRESULT hr = S_OK; - - // - // Validate parameters and members before proceeding - // - if (SUCCEEDED(hr = CHECK_POINTER(ppNewPage, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(m_pXDWriter, E_PENDING))) - { - *ppNewPage = NULL; - PCWSTR pszPageName = NULL; - - try - { - // - // Create a unique name for the pad page for this print session - // - CStringXDW szNewPageName; - szNewPageName.Format(L"/Pad_page_%u.xaml", GetUniqueNumber()); - pszPageName = szNewPageName.GetBuffer(); - - // - // Create a new empty page and retrieve a writer. Also get a - // reader from the first page so we can copy the FixedPage root - // element. This ensures the page sizes match. - // - CComPtr<IPrintWriteStream> pWriter(NULL); - CComPtr<ISAXXMLReader> pSaxRdr(NULL); - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = m_pXDWriter->GetNewEmptyPart(pszPageName, - IID_IFixedPage, - reinterpret_cast<PVOID*>(ppNewPage), - &pWriter)) && - SUCCEEDED(hr = pSaxRdr.CoCreateInstance(CLSID_SAXXMLReader60))) - { - // - // We use a simple SAX handler which copies only the root - // element and discards all other content. - // - CBkSaxHandler bkSaxHndlr(pWriter); - CComPtr<IPrintReadStream> pReader(NULL); - - IFixedPage* pFP = NULL; - - pFP = m_cacheFP[0]; - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = pSaxRdr->putContentHandler(&bkSaxHndlr)) && - SUCCEEDED(hr = pFP->GetStream(&pReader))) - { - CComPtr<ISequentialStream> pReadStreamToSeq(NULL); - - pReadStreamToSeq.Attach(new(std::nothrow) pfp::PrintReadStreamToSeqStream(pReader)); - - if (SUCCEEDED(hr = CHECK_POINTER(pReadStreamToSeq, E_OUTOFMEMORY))) - { - hr = pSaxRdr->parse(CComVariant(static_cast<ISequentialStream*>(pReadStreamToSeq))); - } - } - - pWriter->Close(); - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CBookletFilter::SetBindingScope - -Routine Description: - - Method to retrieve the binding scope from a PrintTicket - -Arguments: - - pPT - Pointer to the PrintTicket to retrieve the scope from - -Return Value: - - HRESULT - S_OK - On success - S_FALSE - Booklet settings not present in the PT - E_* - On error - ---*/ -HRESULT -CBookletFilter::SetBindingScope( - _In_ IXMLDOMDocument2* pPT - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pPT, E_POINTER))) - { - try - { - BindingData bindingData; - CBookPTHandler bkPTHandler(pPT); - - // - // Retrieve the booklet properties from the ticket via the handler - // - if (SUCCEEDED(hr) && - SUCCEEDED(hr = bkPTHandler.GetData(&bindingData))) - { - CBkPTProperties bookletPTProps(bindingData); - - // - // Retrieve the booklet scope - // - hr = bookletPTProps.GetScope(&m_bookScope); - } - else if (hr == E_ELEMENT_NOT_FOUND) - { - // - // Booklet PT settings are not present - reset hr to S_FALSE and proceed - // - hr = S_FALSE; - } - } - catch (CXDException& e) - { - hr = e; - } - } - - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/booklet/bkflt.h b/print/XPSDrvSmpl/src/filters/booklet/bkflt.h deleted file mode 100644 index 52f72378..00000000 --- a/print/XPSDrvSmpl/src/filters/booklet/bkflt.h +++ /dev/null @@ -1,80 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - bkflt.h - -Abstract: - - Booklet filter class definition. This class derives from the Xps filter - class and implements the necessary part handlers to support booklet - printing. The booklet filter is responsible for re-ordering pages and re-uses - the NUp filter to provide 2-up and offset support. - ---*/ - -#pragma once - -#include "xdrchflt.h" -#include "bkprps.h" - -class CBookletFilter : public CXDXpsFilter -{ -public: - CBookletFilter(); - - virtual ~CBookletFilter(); - -private: - HRESULT - ProcessPart( - _Inout_ IFixedDocumentSequence* pFDS - ); - - HRESULT - ProcessPart( - _Inout_ IFixedDocument* pFD - ); - - HRESULT - ProcessPart( - _Inout_ IFixedPage* pFP - ); - - HRESULT - Finalize( - VOID - ); - - HRESULT - FlushCache( - VOID - ); - - HRESULT - CreatePadPage( - _Outptr_ IFixedPage** ppNewPage - ); - - HRESULT - SetBindingScope( - _In_ IXMLDOMDocument2* pPT - ); - -private: - vector<CComPtr<IFixedPage> > m_cacheFP; - - BOOL m_bSendAllDocs; - - CBkPTProperties::EBookletScope m_bookScope; -}; - diff --git a/print/XPSDrvSmpl/src/filters/booklet/bkflt.rc b/print/XPSDrvSmpl/src/filters/booklet/bkflt.rc deleted file mode 100644 index 4834b059..00000000 --- a/print/XPSDrvSmpl/src/filters/booklet/bkflt.rc +++ /dev/null @@ -1,43 +0,0 @@ -// -// Copyright (c) 2005 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. -// -// File Name: -// -// bkflt.rc -// -// Abstract: -// -// Booklet filter resource file. -// -// - -#include <winres.h> -#include <ntverp.h> - -#define VER_FILETYPE VFT_DLL -#define VER_FILESUBTYPE VFT2_UNKNOWN -#define VER_FILEDESCRIPTION_STR "XPSDrv Sample Booklet Filter" -#define VER_INTERNALNAME_STR "PrintFeatureFilters" - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -#endif // English (U.S.) resources - -///////////////////////////////////////////////////////////////////////////// - -#include "common.ver" - diff --git a/print/XPSDrvSmpl/src/filters/booklet/bkprps.cpp b/print/XPSDrvSmpl/src/filters/booklet/bkprps.cpp deleted file mode 100644 index dce58de0..00000000 --- a/print/XPSDrvSmpl/src/filters/booklet/bkprps.cpp +++ /dev/null @@ -1,124 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - bkprps.cpp - -Abstract: - - Booklet properties class implementation. The booklet properties class - is responsible for interpreting booklet data appropriate to the booklet - filter. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "bkprps.h" - -using XDPrintSchema::Binding::BindingData; -using XDPrintSchema::Binding::JobBindAllDocuments; -using XDPrintSchema::Binding::None; - -/*++ - -Routine Name: - - CBkPTProperties::CBkPTProperties - -Routine Description: - - Default constructor for the booklet PrintTicket properties class which - sets the internal binding setting to the setting supplied - -Arguments: - - bindingData - Structure containing the booklet binding settings - from the PrintTicket - -Return Value: - - None - ---*/ -CBkPTProperties::CBkPTProperties( - _In_ CONST BindingData& bindingData - ) : - m_bindData(bindingData) -{ -} - -/*++ - -Routine Name: - - CBkPTProperties::~CBkPTProperties - -Routine Description: - - Default destructor for the CBkPTProperties class - -Arguments: - - None - -Return Value: - - None - ---*/ -CBkPTProperties::~CBkPTProperties() -{ -} - -/*++ - -Routine Name: - - CBkPTProperties::GetScope - -Routine Description: - - Method to return the booklet scope which can be either none, job wide or document wide - -Arguments: - - pBkScope - Booklet printing scope which can be None, Job wide or Document - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CBkPTProperties::GetScope( - _Out_ EBookletScope* pBkScope - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pBkScope, E_POINTER))) - { - *pBkScope = CBkPTProperties::None; - - if (m_bindData.bindOption != None) - { - *pBkScope = m_bindData.bindFeature == JobBindAllDocuments ? CBkPTProperties::Job : CBkPTProperties::Document; - } - } - - ERR_ON_HR(hr); - return hr; -} diff --git a/print/XPSDrvSmpl/src/filters/booklet/bkprps.h b/print/XPSDrvSmpl/src/filters/booklet/bkprps.h deleted file mode 100644 index 38d17c26..00000000 --- a/print/XPSDrvSmpl/src/filters/booklet/bkprps.h +++ /dev/null @@ -1,52 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - bkprps.h - -Abstract: - - Booklet properties class definition. The booklet properties class - is responsible for holding and controling booklet properties. - ---*/ - -#pragma once - -#include "bkdata.h" - -class CBkPTProperties -{ -public: - enum EBookletScope - { - None = 0, - Job, - Document - }; - -public: - CBkPTProperties( - _In_ CONST XDPrintSchema::Binding::BindingData& bindingData - ); - - virtual ~CBkPTProperties(); - - HRESULT - GetScope( - _Out_ EBookletScope* pBkScope - ); - -private: - XDPrintSchema::Binding::BindingData m_bindData; -}; - diff --git a/print/XPSDrvSmpl/src/filters/booklet/bksax.cpp b/print/XPSDrvSmpl/src/filters/booklet/bksax.cpp deleted file mode 100644 index 8582e72c..00000000 --- a/print/XPSDrvSmpl/src/filters/booklet/bksax.cpp +++ /dev/null @@ -1,285 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - bksax.cpp - -Abstract: - - Booklet filter SAX handler implementation. The booklet SAX handler derives - from the default SAX handler and implements the necesary SAX interfaces to - process fixed page mark-up for booklet printing. - For documents with odd page counts, we add a blank padding page so that the - 2-Up behaves correctly. All that is required of the handler is to retrieve - the fixed page open tag and write this out. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "bksax.h" - -/*++ - -Routine Name: - - CBkSaxHandler::CBkSaxHandler - -Routine Description: - - Contructor for the booklet filters SAX handler which registers - internally the writer for sending new markup out to - -Arguments: - - pWriter - Pointer to a write stream which receives markup - -Return Value: - - None - Throws CXDException(HRESULT) on an error - ---*/ -CBkSaxHandler::CBkSaxHandler( - _In_ IPrintWriteStream* pWriter - ) : - m_pWriter(pWriter) -{ - ASSERTMSG(m_pWriter != NULL, "NULL writer passed to booklet SAX handler.\n"); - - HRESULT hr = S_OK; - if (FAILED(hr = CHECK_POINTER(m_pWriter, E_POINTER))) - { - throw CXDException(hr); - } -} - -/*++ - -Routine Name: - - CBkSaxHandler::~CBkSaxHandler - -Routine Description: - - Default destructor for the booklet filters SAX handler - -Arguments: - - None - -Return Value: - - None - ---*/ -CBkSaxHandler::~CBkSaxHandler() -{ -} - -/*++ - -Routine Name: - - CBkSaxHandler::startElement - -Routine Description: - - SAX handler method which handles each start element for the XML markup - -Arguments: - - pwchQName - Pointer to a string containing the element name - cchQName - Count of the number of characters in the element name - pAttributes - Pointer to the attribute list for the supplied element - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT STDMETHODCALLTYPE -CBkSaxHandler::startElement( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - _In_reads_(cchQName) CONST wchar_t* pwchQName, - _In_ INT cchQName, - _In_ ISAXAttributes* pAttributes - ) -{ - HRESULT hr = S_OK; - CStringXDW cstrOut; - CComBSTR bstrElement; - - hr = bstrElement.Append(pwchQName, cchQName); - - // - // All we are doing is copying the fixed page root into the new - // document to ensure the same page size - // - INT cAttributes = 0; - if (SUCCEEDED(hr) && - bstrElement == L"FixedPage" && - SUCCEEDED(hr = pAttributes->getLength(&cAttributes))) - { - try - { - cstrOut.Append(L"<"); - cstrOut.Append(bstrElement); - } - catch (CXDException& e) - { - hr = e; - } - - // - // For all attributes - // - for (INT cIndex = 0; cIndex < cAttributes && SUCCEEDED(hr); cIndex++) - { - PCWSTR pszAttUri = NULL; - INT cchAttUri = 0; - PCWSTR pszAttName = NULL; - INT cchAttName = 0; - PCWSTR pszAttQName = NULL; - INT cchAttQName = 0; - PCWSTR pszAttValue = NULL; - INT cchAttValue = 0; - - // - // Get the attribute data ready to write out - // - if (SUCCEEDED(hr = pAttributes->getName(cIndex, - &pszAttUri, - &cchAttUri, - &pszAttName, - &cchAttName, - &pszAttQName, - &cchAttQName)) && - SUCCEEDED(hr = pAttributes->getValue(cIndex, &pszAttValue, &cchAttValue))) - { - try - { - CComBSTR bstrAttName(cchAttQName, pszAttQName); - CComBSTR bstrAttValue(cchAttValue, pszAttValue); - - // - // Delimit attributes with a space - // - cstrOut.Append(L" "); - - // - // Reconstruct the attribute and write back to - // the fixed page - // - cstrOut.Append(bstrAttName); - cstrOut.Append(L"=\""); - - // - // If this is a UnicodeString we may need to escape entities - // - if (bstrAttName == L"UnicodeString") - { - hr = EscapeEntity(&bstrAttValue); - } - - cstrOut.Append(bstrAttValue); - cstrOut.Append(L"\""); - } - catch (CXDException& e) - { - hr = e; - } - } - } - - // - // Close the fixed page tag - // - if (SUCCEEDED(hr)) - { - try - { - cstrOut.Append(L"/>"); - } - catch (CXDException& e) - { - hr = e; - } - } - - // - // Write out the empty page - // - if (SUCCEEDED(hr)) - { - hr = WriteToPrintStream(&cstrOut, m_pWriter); - } - } - - ERR_ON_HR(hr); - return hr; -} - - -/*++ - -Routine Name: - - CBkSaxHandler::startDocument - -Routine Description: - - SAX handler method which handles the start document call to ensure - the xml version is correctly set - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT STDMETHODCALLTYPE -CBkSaxHandler::startDocument( - void - ) -{ - HRESULT hr = S_OK; - - try - { - if (SUCCEEDED(hr = CHECK_POINTER(m_pWriter, E_FAIL))) - { - CStringXDW cstrOut(L"<?xml version=\"1.0\" encoding=\"utf-8\"?>"); - hr = WriteToPrintStream(&cstrOut, m_pWriter); - } - } - catch (CXDException& e) - { - hr = e; - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/booklet/bksax.h b/print/XPSDrvSmpl/src/filters/booklet/bksax.h deleted file mode 100644 index 7a0826b4..00000000 --- a/print/XPSDrvSmpl/src/filters/booklet/bksax.h +++ /dev/null @@ -1,59 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - bksax.cpp - -Abstract: - - Booklet filter SAX handler definition. The booklet SAX handler derives - from the default SAX handler and implements the necesary SAX interfaces to - process fixed page mark-up for booklet printing. - For documents with odd page counts, we add a blank padding page so that the - 2-Up behaves correctly. All that is required of the handler is to retrieve - the fixed page open tag and write this out. - ---*/ - -#pragma once - -#include "saxhndlr.h" - -class CBkSaxHandler : public CSaxHandler -{ -public: - CBkSaxHandler( - _In_ IPrintWriteStream* pWriter - ); - - virtual ~CBkSaxHandler(); - - HRESULT STDMETHODCALLTYPE - startElement( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - _In_reads_(cchQName) CONST wchar_t* pwchQName, - _In_ INT cchQName, - _In_ ISAXAttributes* pAttributes - ); - - HRESULT STDMETHODCALLTYPE - startDocument( - void - ); - -private: - CComPtr<IPrintWriteStream> m_pWriter; -}; - diff --git a/print/XPSDrvSmpl/src/filters/booklet/dllentry.cpp b/print/XPSDrvSmpl/src/filters/booklet/dllentry.cpp deleted file mode 100644 index 6d6c97b9..00000000 --- a/print/XPSDrvSmpl/src/filters/booklet/dllentry.cpp +++ /dev/null @@ -1,143 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - dllentry.cpp - -Abstract: - - Implementation of the booklet filter dllentry points. Dllmain only - stores the instance handle. DllGetClassObject calls on to a generic - get class factory template function. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "clasfact.h" -#include "bkflt.h" -#include "xdexcept.h" - -/*++ - -Routine Name: - - DllMain - -Routine Description: - - Entry point to the booklet filter which is called when a new process is started - -Arguments: - - hInst - Handle to the DLL - wReason - Specifies a flag indicating why the DLL entry-point function is being called - -Return Value: - - TRUE - ---*/ -BOOL WINAPI -DllMain( - _In_ HINSTANCE hInst, - _In_ WORD wReason, - _In_opt_ LPVOID - ) -{ - switch (wReason) - { - case DLL_PROCESS_ATTACH: - { - g_hInstance = hInst; - } - break; - } - - return TRUE; -} - -/*++ - -Routine Name: - - DllCanUnloadNow - -Routine Description: - - Method which reports whether the DLL is in use to allow the caller to unload - the DLL safely - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - Dll can unload - S_FALSE - Dll can't unload - ---*/ -STDAPI -DllCanUnloadNow() -{ - if (g_cServerLocks == 0) - { - return S_OK ; - } - else - { - return S_FALSE; - } -} - -/*++ - -Routine Name: - - DllGetClassObject - -Routine Description: - - Method to return the current class object - -Arguments: - - rclsid - CLSID that will associate the correct data and code - riid - Reference to the identifier of the interface that the caller is to use to communicate with the class object - ppv - Address of pointer variable that receives the interface pointer requested in riid - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - CLASS_E_CLASSNOTAVAILABLE - On unsupported class - ---*/ -STDAPI -DllGetClassObject( - _In_ REFCLSID rclsid, - _In_ REFIID riid, - _Outptr_ LPVOID FAR* ppv - ) -{ - // - // 87AFE626-06CC-4672-A2C1-1B7CF12CBEDD - // - CLSID bookletCLSID = {0x87AFE626, 0x06CC, 0x4672, {0xA2, 0xC1, 0x1B, 0x7C, 0xF1, 0x2C, 0xBE, 0xDD}}; - - return GetFilterClassFactory<CBookletFilter>(rclsid, riid, bookletCLSID, ppv); -} - diff --git a/print/XPSDrvSmpl/src/filters/booklet/precompsrc.cpp b/print/XPSDrvSmpl/src/filters/booklet/precompsrc.cpp deleted file mode 100644 index 5944cf51..00000000 --- a/print/XPSDrvSmpl/src/filters/booklet/precompsrc.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "precomp.h"
\ No newline at end of file diff --git a/print/XPSDrvSmpl/src/filters/booklet/xdbook.def b/print/XPSDrvSmpl/src/filters/booklet/xdbook.def deleted file mode 100644 index ad3c7eda..00000000 --- a/print/XPSDrvSmpl/src/filters/booklet/xdbook.def +++ /dev/null @@ -1,26 +0,0 @@ -; -; Copyright (c) 2005 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. -; -; File Name: -; -; xdbook.def -; -; Abstract: -; -; Booklet filter module definition file -; - -LIBRARY XDBook - -EXPORTS - DllMain - DllCanUnloadNow PRIVATE - DllGetClassObject PRIVATE - diff --git a/print/XPSDrvSmpl/src/filters/booklet/xdbook.vcxproj b/print/XPSDrvSmpl/src/filters/booklet/xdbook.vcxproj deleted file mode 100644 index be4eedd5..00000000 --- a/print/XPSDrvSmpl/src/filters/booklet/xdbook.vcxproj +++ /dev/null @@ -1,540 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <ItemGroup Label="ProjectConfigurations"> - <ProjectConfiguration Include="Debug|ARM"> - <Configuration>Debug</Configuration> - <Platform>ARM</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Debug|ARM64"> - <Configuration>Debug</Configuration> - <Platform>ARM64</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Debug|Win32"> - <Configuration>Debug</Configuration> - <Platform>Win32</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release|ARM"> - <Configuration>Release</Configuration> - <Platform>ARM</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release|ARM64"> - <Configuration>Release</Configuration> - <Platform>ARM64</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release|Win32"> - <Configuration>Release</Configuration> - <Platform>Win32</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Debug|x64"> - <Configuration>Debug</Configuration> - <Platform>x64</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release|x64"> - <Configuration>Release</Configuration> - <Platform>x64</Platform> - </ProjectConfiguration> - </ItemGroup> - <PropertyGroup Label="Globals"> - <ProjectGuid>{8D542B56-EB45-43B1-AAB8-417352F5BDE6}</ProjectGuid> - <RootNamespace>$(MSBuildProjectName)</RootNamespace> - <SupportsPackaging>false</SupportsPackaging> - <RequiresPackageProject>true</RequiresPackageProject> - <Configuration Condition="'$(Configuration)' == ''">Debug</Configuration> - <Platform Condition="'$(Platform)' == ''">Win32</Platform> - <SampleGuid>{A382BFF2-1BDB-408F-9E26-D62594210A87}</SampleGuid> - </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> - <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>False</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>DynamicLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>False</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>DynamicLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>False</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>DynamicLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>True</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>DynamicLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>True</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>DynamicLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>True</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>DynamicLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>False</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>DynamicLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>True</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>DynamicLibrary</ConfigurationType> - </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> - <PropertyGroup> - <OutDir>$(IntDir)</OutDir> - </PropertyGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ItemGroup Label="WrappedTaskItems" /> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <TargetName>xdbook</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'"> - <TargetName>xdbook</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> - <TargetName>xdbook</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <TargetName>xdbook</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'"> - <TargetName>xdbook</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> - <TargetName>xdbook</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <TargetName>xdbook</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <TargetName>xdbook</TargetName> - </PropertyGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <Link> - <EntryPointSymbol Condition="'$(Platform)'=='win32'">_DllMainCRTStartup@12</EntryPointSymbol> - <EntryPointSymbol Condition="'$(Platform)'!='win32'">_DllMainCRTStartup</EntryPointSymbol> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'"> - <Link> - <EntryPointSymbol Condition="'$(Platform)'=='win32'">_DllMainCRTStartup@12</EntryPointSymbol> - <EntryPointSymbol Condition="'$(Platform)'!='win32'">_DllMainCRTStartup</EntryPointSymbol> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> - <Link> - <EntryPointSymbol Condition="'$(Platform)'=='win32'">_DllMainCRTStartup@12</EntryPointSymbol> - <EntryPointSymbol Condition="'$(Platform)'!='win32'">_DllMainCRTStartup</EntryPointSymbol> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <Link> - <EntryPointSymbol Condition="'$(Platform)'=='win32'">_DllMainCRTStartup@12</EntryPointSymbol> - <EntryPointSymbol Condition="'$(Platform)'!='win32'">_DllMainCRTStartup</EntryPointSymbol> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'"> - <Link> - <EntryPointSymbol Condition="'$(Platform)'=='win32'">_DllMainCRTStartup@12</EntryPointSymbol> - <EntryPointSymbol Condition="'$(Platform)'!='win32'">_DllMainCRTStartup</EntryPointSymbol> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> - <Link> - <EntryPointSymbol Condition="'$(Platform)'=='win32'">_DllMainCRTStartup@12</EntryPointSymbol> - <EntryPointSymbol Condition="'$(Platform)'!='win32'">_DllMainCRTStartup</EntryPointSymbol> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <Link> - <EntryPointSymbol Condition="'$(Platform)'=='win32'">_DllMainCRTStartup@12</EntryPointSymbol> - <EntryPointSymbol Condition="'$(Platform)'!='win32'">_DllMainCRTStartup</EntryPointSymbol> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <Link> - <EntryPointSymbol Condition="'$(Platform)'=='win32'">_DllMainCRTStartup@12</EntryPointSymbol> - <EntryPointSymbol Condition="'$(Platform)'!='win32'">_DllMainCRTStartup</EntryPointSymbol> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib</AdditionalDependencies> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib</AdditionalDependencies> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib</AdditionalDependencies> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib</AdditionalDependencies> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib</AdditionalDependencies> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib</AdditionalDependencies> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib</AdditionalDependencies> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib</AdditionalDependencies> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemGroup> - <ClCompile Include="bkflt.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="bkprps.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="bksax.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="dllentry.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ResourceCompile Include="bkflt.rc" /> - </ItemGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <Link> - <ModuleDefinitionFile>xdbook.def</ModuleDefinitionFile> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'"> - <Link> - <ModuleDefinitionFile>xdbook.def</ModuleDefinitionFile> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> - <Link> - <ModuleDefinitionFile>xdbook.def</ModuleDefinitionFile> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <Link> - <ModuleDefinitionFile>xdbook.def</ModuleDefinitionFile> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'"> - <Link> - <ModuleDefinitionFile>xdbook.def</ModuleDefinitionFile> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> - <Link> - <ModuleDefinitionFile>xdbook.def</ModuleDefinitionFile> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <Link> - <ModuleDefinitionFile>xdbook.def</ModuleDefinitionFile> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <Link> - <ModuleDefinitionFile>xdbook.def</ModuleDefinitionFile> - </Link> - </ItemDefinitionGroup> - <ItemGroup> - <ClCompile Include="precompsrc.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Create</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - </ItemGroup> - <ItemGroup> - <Inf Exclude="@(Inf)" Include="*.inf" /> - <FilesToPackage Include="$(TargetPath)" Condition="'$(ConfigurationType)'=='Driver' or '$(ConfigurationType)'=='DynamicLibrary'" /> - </ItemGroup> - <ItemGroup> - <None Exclude="@(None)" Include="*.txt;*.htm;*.html" /> - <None Exclude="@(None)" Include="*.ico;*.cur;*.bmp;*.dlg;*.rct;*.gif;*.jpg;*.jpeg;*.wav;*.jpe;*.tiff;*.tif;*.png;*.rc2" /> - <None Exclude="@(None)" Include="*.def;*.bat;*.hpj;*.asmx" /> - </ItemGroup> - <ItemGroup> - <ClInclude Exclude="@(ClInclude)" Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd" /> - </ItemGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> -</Project>
\ No newline at end of file diff --git a/print/XPSDrvSmpl/src/filters/booklet/xdbook.vcxproj.Filters b/print/XPSDrvSmpl/src/filters/booklet/xdbook.vcxproj.Filters deleted file mode 100644 index 3f281a6c..00000000 --- a/print/XPSDrvSmpl/src/filters/booklet/xdbook.vcxproj.Filters +++ /dev/null @@ -1,65 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <ItemGroup> - <Filter Include="Source Files"> - <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;*</Extensions> - <UniqueIdentifier>{27EE07C8-4A3B-416F-9266-E7701F9FB1DB}</UniqueIdentifier> - </Filter> - <Filter Include="Header Files"> - <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions> - <UniqueIdentifier>{6811EDBB-9803-4589-BAAE-09AD34EC922A}</UniqueIdentifier> - </Filter> - <Filter Include="Resource Files"> - <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms;man;xml</Extensions> - <UniqueIdentifier>{68346DB5-5823-45D6-8621-B9323A164F62}</UniqueIdentifier> - </Filter> - </ItemGroup> - <ItemGroup> - <ClCompile Include="bkflt.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="bkprps.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="bksax.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="dllentry.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="precompsrc.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - </ItemGroup> - <ItemGroup> - <ResourceCompile Include="bkflt.rc"> - <Filter>Resource Files</Filter> - </ResourceCompile> - </ItemGroup> - <ItemGroup> - <ClInclude Include="bkflt.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="bkprps.h" /> - <ClInclude Include="bksax.h" /> - <ClInclude Include="bkflt.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="bkprps.h" /> - <ClInclude Include="bksax.h" /> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - </ItemGroup> - <ItemGroup> - <None Include="*.def;*.bat;*.hpj;*.asmx"> - <Filter>Source Files</Filter> - </None> - </ItemGroup> -</Project>
\ No newline at end of file diff --git a/print/XPSDrvSmpl/src/filters/color/XDColMan.def b/print/XPSDrvSmpl/src/filters/color/XDColMan.def deleted file mode 100644 index 1e85c9f1..00000000 --- a/print/XPSDrvSmpl/src/filters/color/XDColMan.def +++ /dev/null @@ -1,26 +0,0 @@ -; -; Copyright (c) 2005 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. -; -; File Name: -; -; xdwmark.def -; -; Abstract: -; -; Watermark filter module definition file -; - -LIBRARY XDColMan - -EXPORTS - DllMain - DllCanUnloadNow PRIVATE - DllGetClassObject PRIVATE - diff --git a/print/XPSDrvSmpl/src/filters/color/XDColMan.vcxproj b/print/XPSDrvSmpl/src/filters/color/XDColMan.vcxproj deleted file mode 100644 index aa6176fc..00000000 --- a/print/XPSDrvSmpl/src/filters/color/XDColMan.vcxproj +++ /dev/null @@ -1,614 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <ItemGroup Label="ProjectConfigurations"> - <ProjectConfiguration Include="Debug|ARM"> - <Configuration>Debug</Configuration> - <Platform>ARM</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Debug|ARM64"> - <Configuration>Debug</Configuration> - <Platform>ARM64</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Debug|Win32"> - <Configuration>Debug</Configuration> - <Platform>Win32</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release|ARM"> - <Configuration>Release</Configuration> - <Platform>ARM</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release|ARM64"> - <Configuration>Release</Configuration> - <Platform>ARM64</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release|Win32"> - <Configuration>Release</Configuration> - <Platform>Win32</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Debug|x64"> - <Configuration>Debug</Configuration> - <Platform>x64</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release|x64"> - <Configuration>Release</Configuration> - <Platform>x64</Platform> - </ProjectConfiguration> - </ItemGroup> - <PropertyGroup Label="Globals"> - <ProjectGuid>{C9C14C99-103E-45CB-B1B4-2C165429E35C}</ProjectGuid> - <RootNamespace>$(MSBuildProjectName)</RootNamespace> - <SupportsPackaging>false</SupportsPackaging> - <RequiresPackageProject>true</RequiresPackageProject> - <Configuration Condition="'$(Configuration)' == ''">Debug</Configuration> - <Platform Condition="'$(Platform)' == ''">Win32</Platform> - <SampleGuid>{78463D57-E549-447C-A846-B9301DBB2BC9}</SampleGuid> - </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> - <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>False</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>DynamicLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>False</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>DynamicLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>False</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>DynamicLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>True</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>DynamicLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>True</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>DynamicLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>True</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>DynamicLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>False</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>DynamicLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>True</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>DynamicLibrary</ConfigurationType> - </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> - <PropertyGroup> - <OutDir>$(IntDir)</OutDir> - </PropertyGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ItemGroup Label="WrappedTaskItems" /> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <TargetName>XDColMan</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'"> - <TargetName>XDColMan</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> - <TargetName>XDColMan</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <TargetName>XDColMan</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'"> - <TargetName>XDColMan</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> - <TargetName>XDColMan</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <TargetName>XDColMan</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <TargetName>XDColMan</TargetName> - </PropertyGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);mscms.lib;windowscodecs.lib</AdditionalDependencies> - <EntryPointSymbol Condition="'$(Platform)'=='win32'">_DllMainCRTStartup@12</EntryPointSymbol> - <EntryPointSymbol Condition="'$(Platform)'!='win32'">_DllMainCRTStartup</EntryPointSymbol> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'"> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);mscms.lib;windowscodecs.lib</AdditionalDependencies> - <EntryPointSymbol Condition="'$(Platform)'=='win32'">_DllMainCRTStartup@12</EntryPointSymbol> - <EntryPointSymbol Condition="'$(Platform)'!='win32'">_DllMainCRTStartup</EntryPointSymbol> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);mscms.lib;windowscodecs.lib</AdditionalDependencies> - <EntryPointSymbol Condition="'$(Platform)'=='win32'">_DllMainCRTStartup@12</EntryPointSymbol> - <EntryPointSymbol Condition="'$(Platform)'!='win32'">_DllMainCRTStartup</EntryPointSymbol> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);mscms.lib;windowscodecs.lib</AdditionalDependencies> - <EntryPointSymbol Condition="'$(Platform)'=='win32'">_DllMainCRTStartup@12</EntryPointSymbol> - <EntryPointSymbol Condition="'$(Platform)'!='win32'">_DllMainCRTStartup</EntryPointSymbol> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'"> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);mscms.lib;windowscodecs.lib</AdditionalDependencies> - <EntryPointSymbol Condition="'$(Platform)'=='win32'">_DllMainCRTStartup@12</EntryPointSymbol> - <EntryPointSymbol Condition="'$(Platform)'!='win32'">_DllMainCRTStartup</EntryPointSymbol> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);mscms.lib;windowscodecs.lib</AdditionalDependencies> - <EntryPointSymbol Condition="'$(Platform)'=='win32'">_DllMainCRTStartup@12</EntryPointSymbol> - <EntryPointSymbol Condition="'$(Platform)'!='win32'">_DllMainCRTStartup</EntryPointSymbol> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);mscms.lib;windowscodecs.lib</AdditionalDependencies> - <EntryPointSymbol Condition="'$(Platform)'=='win32'">_DllMainCRTStartup@12</EntryPointSymbol> - <EntryPointSymbol Condition="'$(Platform)'!='win32'">_DllMainCRTStartup</EntryPointSymbol> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);mscms.lib;windowscodecs.lib</AdditionalDependencies> - <EntryPointSymbol Condition="'$(Platform)'=='win32'">_DllMainCRTStartup@12</EntryPointSymbol> - <EntryPointSymbol Condition="'$(Platform)'!='win32'">_DllMainCRTStartup</EntryPointSymbol> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib</AdditionalDependencies> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib</AdditionalDependencies> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib</AdditionalDependencies> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib</AdditionalDependencies> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib</AdditionalDependencies> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib</AdditionalDependencies> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib</AdditionalDependencies> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib</AdditionalDependencies> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemGroup> - <ClCompile Include="bmpconv.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="bmpdata.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="cmflt.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="cmimg.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="cmsax.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="colchan.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="colconv.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="dictionary.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="dllentry.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="profile.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="profman.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="scaniter.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="transform.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="wcsapiconv.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="wictobmscn.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ResourceCompile Include="cmflt.rc" /> - </ItemGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <Link> - <ModuleDefinitionFile>XDColMan.def</ModuleDefinitionFile> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'"> - <Link> - <ModuleDefinitionFile>XDColMan.def</ModuleDefinitionFile> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> - <Link> - <ModuleDefinitionFile>XDColMan.def</ModuleDefinitionFile> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <Link> - <ModuleDefinitionFile>XDColMan.def</ModuleDefinitionFile> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'"> - <Link> - <ModuleDefinitionFile>XDColMan.def</ModuleDefinitionFile> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> - <Link> - <ModuleDefinitionFile>XDColMan.def</ModuleDefinitionFile> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <Link> - <ModuleDefinitionFile>XDColMan.def</ModuleDefinitionFile> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <Link> - <ModuleDefinitionFile>XDColMan.def</ModuleDefinitionFile> - </Link> - </ItemDefinitionGroup> - <ItemGroup> - <ClCompile Include="precompsrc.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Create</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - </ItemGroup> - <ItemGroup> - <Inf Exclude="@(Inf)" Include="*.inf" /> - <FilesToPackage Include="$(TargetPath)" Condition="'$(ConfigurationType)'=='Driver' or '$(ConfigurationType)'=='DynamicLibrary'" /> - </ItemGroup> - <ItemGroup> - <None Exclude="@(None)" Include="*.txt;*.htm;*.html" /> - <None Exclude="@(None)" Include="*.ico;*.cur;*.bmp;*.dlg;*.rct;*.gif;*.jpg;*.jpeg;*.wav;*.jpe;*.tiff;*.tif;*.png;*.rc2" /> - <None Exclude="@(None)" Include="*.def;*.bat;*.hpj;*.asmx" /> - </ItemGroup> - <ItemGroup> - <ClInclude Exclude="@(ClInclude)" Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd" /> - </ItemGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> -</Project>
\ No newline at end of file diff --git a/print/XPSDrvSmpl/src/filters/color/XDColMan.vcxproj.Filters b/print/XPSDrvSmpl/src/filters/color/XDColMan.vcxproj.Filters deleted file mode 100644 index 4602c7b8..00000000 --- a/print/XPSDrvSmpl/src/filters/color/XDColMan.vcxproj.Filters +++ /dev/null @@ -1,329 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <ItemGroup> - <Filter Include="Source Files"> - <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;*</Extensions> - <UniqueIdentifier>{D821B726-E809-40D7-B964-B46198856820}</UniqueIdentifier> - </Filter> - <Filter Include="Header Files"> - <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions> - <UniqueIdentifier>{25073272-3E9F-4F45-B3A7-805E2F15B111}</UniqueIdentifier> - </Filter> - <Filter Include="Resource Files"> - <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms;man;xml</Extensions> - <UniqueIdentifier>{2EAE715D-4338-4A62-8F12-EC400CFF4D18}</UniqueIdentifier> - </Filter> - </ItemGroup> - <ItemGroup> - <ClCompile Include="bmpconv.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="bmpdata.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="cmflt.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="cmimg.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="cmsax.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="colchan.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="colconv.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="dictionary.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="dllentry.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="precompsrc.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="profile.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="profman.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="scaniter.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="transform.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="wcsapiconv.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="wictobmscn.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - </ItemGroup> - <ItemGroup> - <ResourceCompile Include="cmflt.rc"> - <Filter>Resource Files</Filter> - </ResourceCompile> - </ItemGroup> - <ItemGroup> - <ClInclude Include="bmpconv.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="bmpdata.h" /> - <ClInclude Include="cmflt.h" /> - <ClInclude Include="cmimg.h" /> - <ClInclude Include="cmsax.h" /> - <ClInclude Include="colchan.h" /> - <ClInclude Include="colconv.h" /> - <ClInclude Include="dictionary.h" /> - <ClInclude Include="profile.h" /> - <ClInclude Include="profman.h" /> - <ClInclude Include="scaniter.h" /> - <ClInclude Include="transform.h" /> - <ClInclude Include="wcsapiconv.h" /> - <ClInclude Include="wictobmscn.h" /> - <ClInclude Include="bmpconv.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="bmpdata.h" /> - <ClInclude Include="cmflt.h" /> - <ClInclude Include="cmimg.h" /> - <ClInclude Include="cmsax.h" /> - <ClInclude Include="colchan.h" /> - <ClInclude Include="colconv.h" /> - <ClInclude Include="dictionary.h" /> - <ClInclude Include="profile.h" /> - <ClInclude Include="profman.h" /> - <ClInclude Include="scaniter.h" /> - <ClInclude Include="transform.h" /> - <ClInclude Include="wcsapiconv.h" /> - <ClInclude Include="wictobmscn.h" /> - <ClInclude Include="bmpconv.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="bmpdata.h" /> - <ClInclude Include="cmflt.h" /> - <ClInclude Include="cmimg.h" /> - <ClInclude Include="cmsax.h" /> - <ClInclude Include="colchan.h" /> - <ClInclude Include="colconv.h" /> - <ClInclude Include="dictionary.h" /> - <ClInclude Include="profile.h" /> - <ClInclude Include="profman.h" /> - <ClInclude Include="scaniter.h" /> - <ClInclude Include="transform.h" /> - <ClInclude Include="wcsapiconv.h" /> - <ClInclude Include="wictobmscn.h" /> - <ClInclude Include="bmpconv.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="bmpdata.h" /> - <ClInclude Include="cmflt.h" /> - <ClInclude Include="cmimg.h" /> - <ClInclude Include="cmsax.h" /> - <ClInclude Include="colchan.h" /> - <ClInclude Include="colconv.h" /> - <ClInclude Include="dictionary.h" /> - <ClInclude Include="profile.h" /> - <ClInclude Include="profman.h" /> - <ClInclude Include="scaniter.h" /> - <ClInclude Include="transform.h" /> - <ClInclude Include="wcsapiconv.h" /> - <ClInclude Include="wictobmscn.h" /> - <ClInclude Include="bmpconv.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="bmpdata.h" /> - <ClInclude Include="cmflt.h" /> - <ClInclude Include="cmimg.h" /> - <ClInclude Include="cmsax.h" /> - <ClInclude Include="colchan.h" /> - <ClInclude Include="colconv.h" /> - <ClInclude Include="dictionary.h" /> - <ClInclude Include="profile.h" /> - <ClInclude Include="profman.h" /> - <ClInclude Include="scaniter.h" /> - <ClInclude Include="transform.h" /> - <ClInclude Include="wcsapiconv.h" /> - <ClInclude Include="wictobmscn.h" /> - <ClInclude Include="bmpconv.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="bmpdata.h" /> - <ClInclude Include="cmflt.h" /> - <ClInclude Include="cmimg.h" /> - <ClInclude Include="cmsax.h" /> - <ClInclude Include="colchan.h" /> - <ClInclude Include="colconv.h" /> - <ClInclude Include="dictionary.h" /> - <ClInclude Include="profile.h" /> - <ClInclude Include="profman.h" /> - <ClInclude Include="scaniter.h" /> - <ClInclude Include="transform.h" /> - <ClInclude Include="wcsapiconv.h" /> - <ClInclude Include="wictobmscn.h" /> - <ClInclude Include="bmpconv.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="bmpdata.h" /> - <ClInclude Include="cmflt.h" /> - <ClInclude Include="cmimg.h" /> - <ClInclude Include="cmsax.h" /> - <ClInclude Include="colchan.h" /> - <ClInclude Include="colconv.h" /> - <ClInclude Include="dictionary.h" /> - <ClInclude Include="profile.h" /> - <ClInclude Include="profman.h" /> - <ClInclude Include="scaniter.h" /> - <ClInclude Include="transform.h" /> - <ClInclude Include="wcsapiconv.h" /> - <ClInclude Include="wictobmscn.h" /> - <ClInclude Include="bmpconv.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="bmpdata.h" /> - <ClInclude Include="cmflt.h" /> - <ClInclude Include="cmimg.h" /> - <ClInclude Include="cmsax.h" /> - <ClInclude Include="colchan.h" /> - <ClInclude Include="colconv.h" /> - <ClInclude Include="dictionary.h" /> - <ClInclude Include="profile.h" /> - <ClInclude Include="profman.h" /> - <ClInclude Include="scaniter.h" /> - <ClInclude Include="transform.h" /> - <ClInclude Include="wcsapiconv.h" /> - <ClInclude Include="wictobmscn.h" /> - <ClInclude Include="bmpconv.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="bmpdata.h" /> - <ClInclude Include="cmflt.h" /> - <ClInclude Include="cmimg.h" /> - <ClInclude Include="cmsax.h" /> - <ClInclude Include="colchan.h" /> - <ClInclude Include="colconv.h" /> - <ClInclude Include="dictionary.h" /> - <ClInclude Include="profile.h" /> - <ClInclude Include="profman.h" /> - <ClInclude Include="scaniter.h" /> - <ClInclude Include="transform.h" /> - <ClInclude Include="wcsapiconv.h" /> - <ClInclude Include="wictobmscn.h" /> - <ClInclude Include="bmpconv.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="bmpdata.h" /> - <ClInclude Include="cmflt.h" /> - <ClInclude Include="cmimg.h" /> - <ClInclude Include="cmsax.h" /> - <ClInclude Include="colchan.h" /> - <ClInclude Include="colconv.h" /> - <ClInclude Include="dictionary.h" /> - <ClInclude Include="profile.h" /> - <ClInclude Include="profman.h" /> - <ClInclude Include="scaniter.h" /> - <ClInclude Include="transform.h" /> - <ClInclude Include="wcsapiconv.h" /> - <ClInclude Include="wictobmscn.h" /> - <ClInclude Include="bmpconv.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="bmpdata.h" /> - <ClInclude Include="cmflt.h" /> - <ClInclude Include="cmimg.h" /> - <ClInclude Include="cmsax.h" /> - <ClInclude Include="colchan.h" /> - <ClInclude Include="colconv.h" /> - <ClInclude Include="dictionary.h" /> - <ClInclude Include="profile.h" /> - <ClInclude Include="profman.h" /> - <ClInclude Include="scaniter.h" /> - <ClInclude Include="transform.h" /> - <ClInclude Include="wcsapiconv.h" /> - <ClInclude Include="wictobmscn.h" /> - <ClInclude Include="bmpconv.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="bmpdata.h" /> - <ClInclude Include="cmflt.h" /> - <ClInclude Include="cmimg.h" /> - <ClInclude Include="cmsax.h" /> - <ClInclude Include="colchan.h" /> - <ClInclude Include="colconv.h" /> - <ClInclude Include="dictionary.h" /> - <ClInclude Include="profile.h" /> - <ClInclude Include="profman.h" /> - <ClInclude Include="scaniter.h" /> - <ClInclude Include="transform.h" /> - <ClInclude Include="wcsapiconv.h" /> - <ClInclude Include="wictobmscn.h" /> - <ClInclude Include="bmpconv.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="bmpdata.h" /> - <ClInclude Include="cmflt.h" /> - <ClInclude Include="cmimg.h" /> - <ClInclude Include="cmsax.h" /> - <ClInclude Include="colchan.h" /> - <ClInclude Include="colconv.h" /> - <ClInclude Include="dictionary.h" /> - <ClInclude Include="profile.h" /> - <ClInclude Include="profman.h" /> - <ClInclude Include="scaniter.h" /> - <ClInclude Include="transform.h" /> - <ClInclude Include="wcsapiconv.h" /> - <ClInclude Include="wictobmscn.h" /> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - </ItemGroup> - <ItemGroup> - <None Include="*.def;*.bat;*.hpj;*.asmx"> - <Filter>Source Files</Filter> - </None> - </ItemGroup> -</Project>
\ No newline at end of file diff --git a/print/XPSDrvSmpl/src/filters/color/bmpconv.cpp b/print/XPSDrvSmpl/src/filters/color/bmpconv.cpp deleted file mode 100644 index 8c6bd347..00000000 --- a/print/XPSDrvSmpl/src/filters/color/bmpconv.cpp +++ /dev/null @@ -1,1187 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - bmpconv.cpp - -Abstract: - - WIC bitmap conversion class implementation. This class provides a wrapper to a bitmap - stream that uses WIC to access bitmap data and provide conversion functionality. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "xdexcept.h" -#include "bmpconv.h" - -/*++ - -Routine Name: - - CBmpConverter::CBmpConverter - -Routine Description: - - CBmpConverter default constructor - -Arguments: - - None - -Return Value: - - None - Throws an exception on error. - ---*/ -CBmpConverter::CBmpConverter() : - m_pImagingFactory(NULL), - m_pBitmap(NULL), - m_pColorContext(NULL), - m_pCurrentLock(NULL), - m_ePixelFormat(kWICPixelFormatDontCare) -{ - // - // Make sure we have an imaging factory to work with - // - HRESULT hr = CreateImagingFactory(); - if (FAILED(hr)) - { - throw CXDException(hr); - } -} - -/*++ - -Routine Name: - - CBmpConverter::CBmpConverter - -Routine Description: - - CBmpConverter constructor - -Arguments: - - ePixFormat - Bitmap pixel format - cWidth - Bitmap width - cHeight - Bitmap height - dpiX - Bitmap horizontal resolution - dpiY - Bitmap vertical resolution - -Return Value: - - None - Throws an exception on error. - ---*/ -CBmpConverter::CBmpConverter( - _In_ CONST EWICPixelFormat& ePixFormat, - _In_ CONST UINT& cWidth, - _In_ CONST UINT& cHeight, - _In_ CONST DOUBLE& dpiX, - _In_ CONST DOUBLE& dpiY - ) : - m_pImagingFactory(NULL), - m_pBitmap(NULL), - m_pColorContext(NULL), - m_pCurrentLock(NULL), - m_ePixelFormat(ePixFormat) -{ - HRESULT hr = S_OK; - - // - // Make sure we have an imaging factory to work with... - // - if (SUCCEEDED(hr = CreateImagingFactory())) - { - // - // ...and that the underlying bitmap is created and intialized. - // - hr = Initialize(m_ePixelFormat, cWidth, cHeight, dpiX, dpiY); - } - - if (FAILED(hr)) - { - throw CXDException(hr); - } -} - -/*++ - -Routine Name: - - CBmpConverter::CBmpConverter - -Routine Description: - - CBmpConverter constructor - -Arguments: - - pStream - Stream containing the bitmap container data - -Return Value: - - None - Throws an exception on error. - ---*/ -CBmpConverter::CBmpConverter( - _In_ IStream* pStream - ) : - m_pImagingFactory(NULL), - m_pBitmap(NULL), - m_pColorContext(NULL), - m_pCurrentLock(NULL), - m_ePixelFormat(kWICPixelFormatDontCare) -{ - HRESULT hr = S_OK; - - // - // Make sure we have an imaging factory to work with... - // - if (SUCCEEDED(hr = CreateImagingFactory())) - { - // - // ...and that the underlying bitmap is created and intialized from the input stream. - // - hr = Initialize(pStream); - } - - if (FAILED(hr)) - { - throw CXDException(hr); - } -} - -/*++ - -Routine Name: - - CBmpConverter::CBmpConverter - -Routine Description: - - CBmpConverter constructor - -Arguments: - - converter - Converter class to construct from - -Return Value: - - None - Throws an exception on error. - ---*/ -CBmpConverter::CBmpConverter( - _In_ CONST CBmpConverter& converter - ) : - m_pImagingFactory(converter.m_pImagingFactory), - m_pBitmap(converter.m_pBitmap), - m_pColorContext(converter.m_pColorContext), - m_pCurrentLock(converter.m_pCurrentLock), - m_ePixelFormat(converter.m_ePixelFormat) -{ - ASSERTMSG(m_pCurrentLock == NULL, "Copying locked bitmap can lead to a deadlock when writing out the bitmap.\n"); -} - -/*++ - -Routine Name: - - CBmpConverter::~CBmpConverter - -Routine Description: - - CBmpConverter destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CBmpConverter::~CBmpConverter() -{ -} - -/*++ - -Routine Name: - - CBmpConverter::Initialize - -Routine Description: - - Initializes the bitmap given format, dimensions and resolution - -Arguments: - - ePixFormat - Bitmap pixel format - cWidth - Bitmap width - cHeight - Bitmap height - dpiX - Bitmap horizontal resolution - dpiY - Bitmap vertical resolution - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CBmpConverter::Initialize( - _In_ CONST EWICPixelFormat& ePixFormat, - _In_ CONST UINT& cWidth, - _In_ CONST UINT& cHeight, - _In_ CONST DOUBLE& dpiX, - _In_ CONST DOUBLE& dpiY - ) -{ - HRESULT hr = S_OK; - - if (ePixFormat <= kWICPixelFormatMin || - ePixFormat >= kWICPixelFormatMax || - cWidth == 0 || - cHeight == 0 || - dpiX <= 0 || - dpiY <= 0) - { - hr = E_INVALIDARG; - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_POINTER(m_pImagingFactory, E_PENDING))) - { - // - // Create the bitmap - // - m_pBitmap = NULL; - m_ePixelFormat = ePixFormat; - if (SUCCEEDED(hr = m_pImagingFactory->CreateBitmap(cWidth, - cHeight, - g_lutPixFrmtGuid[m_ePixelFormat], - WICBitmapCacheOnLoad, - &m_pBitmap)) && - SUCCEEDED(hr = CHECK_POINTER(m_pBitmap, E_FAIL))) - { - // - // Make sure the resolution is preserved - this can lead to strange scaling - // in an XPS document if the resoution changes - // - hr = m_pBitmap->SetResolution(dpiX, dpiY); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CBmpConverter::Initialize - -Routine Description: - - Initializes the bitmap from a stream containing the container information - -Arguments: - - pStream - Streamed container information - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CBmpConverter::Initialize( - _In_ IStream* pStream - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pStream, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(m_pImagingFactory, E_PENDING))) - { - CComPtr<IWICBitmapDecoder> pDecoder(NULL); - CComPtr<IWICBitmapFrameDecode> pBitmapSrcFrame(NULL); - LARGE_INTEGER cbMoveFromStart = {0}; - - // - // Ensure we have released any current color contexts - // - m_pColorContext = NULL; - - // - // Create a decoder from the input stream and retrieve the first frame. Create a color context - // to recieve any potential embedded color profiles. - // - if (SUCCEEDED(hr = pStream->Seek(cbMoveFromStart, STREAM_SEEK_SET, NULL)) && - SUCCEEDED(hr = m_pImagingFactory->CreateDecoderFromStream(pStream, NULL, WICDecodeMetadataCacheOnDemand, &pDecoder)) && - SUCCEEDED(hr = CHECK_POINTER(pDecoder, E_FAIL)) && - SUCCEEDED(hr = pDecoder->GetFrame(0, &pBitmapSrcFrame)) && - SUCCEEDED(hr = CHECK_POINTER(pDecoder, E_FAIL)) && - SUCCEEDED(hr = m_pImagingFactory->CreateColorContext(&m_pColorContext)) && - SUCCEEDED(hr = CHECK_POINTER(m_pColorContext, E_FAIL))) - { - // - // Check for an embedded color context - // - UINT cColContexts = 0; - if (SUCCEEDED(hr = pBitmapSrcFrame->GetColorContexts(1, &(m_pColorContext.p), &cColContexts))) - { - // - // If there are no color contexts, ensure the color context is released - // - if (cColContexts == 0) - { - m_pColorContext = NULL; - } - - hr = Initialize(pBitmapSrcFrame); - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CBmpConverter::Initialize - -Routine Description: - - Intializes the bitmap from a WIC bitmap source - -Arguments: - - pSource - pointer to the WIC bitmap source interface to intialize from - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CBmpConverter::Initialize( - _In_ IWICBitmapSource* pSource - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pSource, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(m_pImagingFactory, E_PENDING))) - { - // - // Make sure we have released any current bitmaps - // - m_pBitmap = NULL; - - // - // Create the bitmap from the source and set the pixel format enumeration from the GUID - // - WICPixelFormatGUID guidPixFormat; - if (SUCCEEDED(hr = m_pImagingFactory->CreateBitmapFromSource(pSource, WICBitmapCacheOnDemand, &m_pBitmap)) && - SUCCEEDED(hr = CHECK_POINTER(m_pBitmap, E_FAIL)) && - SUCCEEDED(hr = m_pBitmap->GetPixelFormat(&guidPixFormat))) - { - hr = PixelFormatFromGUID(guidPixFormat, &m_ePixelFormat); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CBmpConverter::Write - -Routine Description: - - Writes the bitmap to a stream using the requested container format - -Arguments: - - guidContainerFormat - Requested container format to write out - pStream - The destination stream to write to - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CBmpConverter::Write( - _In_ REFGUID guidContainerFormat, - _Inout_ IStream* pStream - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pStream, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(m_pBitmap, E_PENDING)) && - SUCCEEDED(hr = CHECK_POINTER(m_pImagingFactory, E_PENDING))) - { - CComPtr<IWICBitmapEncoder> pEncoder(NULL); - CComPtr<IWICBitmapFrameEncode> pFrame(NULL); - CComPtr<IPropertyBag2> pPropertyBag(NULL); - - UINT srcWidth = 0; - UINT srcHeight = 0; - - DOUBLE xRes = 0.0; - DOUBLE yRes = 0.0; - - WICPixelFormatGUID srcFormat; - - // - // Create the appropriate encoder, set the stream to recieve the data and retrieve a frame. - // Initialize the frame from the current bitmap data. - // - if (SUCCEEDED(hr = m_pImagingFactory->CreateEncoder(guidContainerFormat, NULL, &pEncoder)) && - SUCCEEDED(hr = pEncoder->Initialize(pStream, WICBitmapEncoderNoCache)) && - SUCCEEDED(hr = pEncoder->CreateNewFrame(&pFrame, &pPropertyBag)) && - SUCCEEDED(hr = CHECK_POINTER(pFrame, E_FAIL)) && - SUCCEEDED(hr = CHECK_POINTER(pPropertyBag, E_FAIL)) && - SUCCEEDED(hr = pFrame->Initialize(pPropertyBag)) && - SUCCEEDED(hr = m_pBitmap->GetSize(&srcWidth, &srcHeight)) && - SUCCEEDED(hr = m_pBitmap->GetResolution(&xRes, &yRes)) && - SUCCEEDED(hr = m_pBitmap->GetPixelFormat(&srcFormat))) - { - WICRect sizeSrc = {0}; - sizeSrc.Width = static_cast<INT>(srcWidth); - sizeSrc.Height = static_cast<INT>(srcHeight); - - if (SUCCEEDED(hr = pFrame->SetSize(srcWidth, srcHeight)) && - SUCCEEDED(hr = pFrame->SetResolution(xRes, yRes)) && - SUCCEEDED(hr = pFrame->SetPixelFormat(&srcFormat))) - { - if (HasColorContext()) - { - hr = pFrame->SetColorContexts(1, &m_pColorContext.p); - } - - if (SUCCEEDED(hr)) - { - // - // Write the bitmap data to the frame. - // - hr = pFrame->WriteSource(m_pBitmap, &sizeSrc); - } - } - } - - // - // Commit the frame and the encoder - this sets the bitmap data and encodes the - // bitmap into a container - // - if (SUCCEEDED(hr) && - SUCCEEDED(hr = pFrame->Commit())) - { - hr = pEncoder->Commit(); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CBmpConverter::Convert - -Routine Description: - - Uses WIC to convert from the current pixel format to the requested pixel format - -Arguments: - - ePixFormat - the requested pixel format - pbCanConvert - variable that recieves whether the conversion is possible - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CBmpConverter::Convert( - _In_ EWICPixelFormat ePixFormat, - _Out_ BOOL* pbCanConvert - ) -{ - HRESULT hr = S_OK; - - if (ePixFormat > kWICPixelFormatDontCare && - ePixFormat < kWICPixelFormatMax) - { - if (SUCCEEDED(hr = CHECK_POINTER(pbCanConvert, E_POINTER))) - { - *pbCanConvert = TRUE; - } - } - else - { - hr = E_INVALIDARG; - } - - // - // If the requested format differs from the original we need to do some work. - // - if (SUCCEEDED(hr) && - ePixFormat != m_ePixelFormat) - { - CComPtr<IWICFormatConverter> pConverter(NULL); - - WICPixelFormatGUID dstFormat = g_lutPixFrmtGuid[ePixFormat]; - WICPixelFormatGUID srcFormat; - - // - // Retrieve a format converter, intialize from the current bitmap the use the converter - // to reset the bitmap to the appropriate type. - // - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_POINTER(m_pImagingFactory, E_PENDING)) && - SUCCEEDED(hr = CHECK_POINTER(m_pBitmap, E_PENDING)) && - SUCCEEDED(hr = m_pImagingFactory->CreateFormatConverter(&pConverter)) && - SUCCEEDED(hr = CHECK_POINTER(pConverter, E_FAIL)) && - SUCCEEDED(hr = m_pBitmap->GetPixelFormat(&srcFormat)) && - SUCCEEDED(hr = pConverter->CanConvert(srcFormat, dstFormat, pbCanConvert)) && - *pbCanConvert && - SUCCEEDED(hr = pConverter->Initialize(m_pBitmap, dstFormat, WICBitmapDitherTypeNone, NULL, 0.0f, WICBitmapPaletteTypeCustom))) - { - hr = Initialize(pConverter); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CBmpConverter::LockSurface - -Routine Description: - - Locks the requested rectangle for reading and writing of the pixel data directly - -Arguments: - - prcLock - The rectangle area of the bitmap to lock - bReadOnly - Is this a read only lock - pcbStride - Pointer to variable that recieves the stride between scanlines - pcWidth - Pointer to variable that recieves the bitmap pixel width - pcHeight - Pointer to variable that recieves the bitmap pixel height - pcbData - Pointer to variable that recieves the size of the pixel data buffer - ppbData - Pointer to a BYTE pointer that recieves the data pointer - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CBmpConverter::LockSurface( - _In_ WICRect* prcLock, - _In_ CONST BOOL& bReadOnly, - _Out_ UINT* pcbStride, - _Out_ UINT* pcWidth, - _Out_ UINT* pcHeight, - _Inout_ UINT* pcbData, - _Outptr_result_bytebuffer_maybenull_(*pcbData) - PBYTE* ppbData - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(m_pBitmap, E_PENDING)) && - SUCCEEDED(hr = CHECK_POINTER(m_pImagingFactory, E_PENDING)) && - SUCCEEDED(hr = CHECK_POINTER(prcLock, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pcbStride, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pcWidth, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pcHeight, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pcbData, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(ppbData, E_POINTER))) - { - *pcbStride = 0; - *pcWidth = 0; - *pcHeight = 0; - *pcbData = 0; - *ppbData = NULL; - - // - // Free any current locks and acquire a new one. Get the stride, size and data from the lock. - // - m_pCurrentLock = NULL; - if (SUCCEEDED(hr) && - SUCCEEDED(hr = m_pBitmap->Lock(prcLock, bReadOnly ? WICBitmapLockRead : WICBitmapLockWrite, &m_pCurrentLock)) && - SUCCEEDED(hr = CHECK_POINTER(m_pCurrentLock, E_FAIL)) && - SUCCEEDED(hr = m_pCurrentLock->GetStride(pcbStride)) && - SUCCEEDED(hr = m_pCurrentLock->GetSize(pcWidth, pcHeight))) - { - hr = m_pCurrentLock->GetDataPointer(pcbData, ppbData); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CBmpConverter::UnlockSurface - -Routine Description: - - Unlocks any current lock on the bitmap surface - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CBmpConverter::UnlockSurface( - VOID - ) -{ - m_pCurrentLock = NULL; - - return S_OK; -} - -/*++ - -Routine Name: - - CBmpConverter::GetColorContext - -Routine Description: - - Retrieves any color context associated with the bitmap - -Arguments: - - ppColorContext - Pointer to a color context interface pointer to recieve the context - -Return Value: - - HRESULT - S_OK - On success - E_ELEMENT_NOT_FOUND - On no context present - E_* - On error - ---*/ -HRESULT -CBmpConverter::GetColorContext( - _Outptr_ IWICColorContext** ppColorContext - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppColorContext, E_POINTER))) - { - *ppColorContext = NULL; - - if (HasColorContext()) - { - *ppColorContext = m_pColorContext; - } - else - { - hr = E_ELEMENT_NOT_FOUND; - } - } - - ERR_ON_HR_EXC(hr, E_ELEMENT_NOT_FOUND); - return hr; -} - -/*++ - -Routine Name: - - CBmpConverter::HasAlphaChannel - -Routine Description: - - Indicates if the bitmap has an alpha channel - -Arguments: - - None - -Return Value: - - TRUE - The bitmap has an alpha channel - FALSE - There is no alpha channel - ---*/ -BOOL -CBmpConverter::HasAlphaChannel( - VOID - ) CONST -{ - BOOL bHasAlpha = FALSE; - - switch (m_ePixelFormat) - { - case kWICPixelFormat32bppBGRA: - case kWICPixelFormat32bppPBGRA: - case kWICPixelFormat64bppRGBA: - case kWICPixelFormat64bppPRGBA: - case kWICPixelFormat128bppRGBAFloat: - case kWICPixelFormat128bppPRGBAFloat: - case kWICPixelFormat64bppRGBAFixedPoint: - case kWICPixelFormat128bppRGBAFixedPoint: - case kWICPixelFormat64bppRGBAHalf: - case kWICPixelFormat40bppCMYKAlpha: - case kWICPixelFormat80bppCMYKAlpha: - case kWICPixelFormat32bpp3ChannelsAlpha: - case kWICPixelFormat40bpp4ChannelsAlpha: - case kWICPixelFormat48bpp5ChannelsAlpha: - case kWICPixelFormat56bpp6ChannelsAlpha: - case kWICPixelFormat64bpp7ChannelsAlpha: - case kWICPixelFormat72bpp8ChannelsAlpha: - case kWICPixelFormat64bpp3ChannelsAlpha: - case kWICPixelFormat80bpp4ChannelsAlpha: - case kWICPixelFormat96bpp5ChannelsAlpha: - case kWICPixelFormat112bpp6ChannelsAlpha: - case kWICPixelFormat128bpp7ChannelsAlpha: - case kWICPixelFormat144bpp8ChannelsAlpha: - { - bHasAlpha = TRUE; - } - break; - - default: - { - } - break; - } - - return bHasAlpha; -} - -/*++ - -Routine Name: - - CBmpConverter::HasColorContext - -Routine Description: - - Indicates whether the bitmap has a color context - -Arguments: - - None - -Return Value: - - TRUE - The bitmap has a color context - FALSE - There is no color context associated with the bitmap - ---*/ -BOOL -CBmpConverter::HasColorContext( - VOID - ) CONST -{ - return m_pColorContext != NULL; -} - -/*++ - -Routine Name: - - CBmpConverter::HasColorProfile - -Routine Description: - - Indicates whether the color context (if present) contains a color profile - -Arguments: - - None - -Return Value: - - TRUE - There is a color context and it contains a color profile - FALSE - There is either no color context or the context does not contain a color profile - ---*/ -BOOL -CBmpConverter::HasColorProfile( - VOID - ) CONST -{ - BOOL bHasProfile = FALSE; - - if (HasColorContext()) - { - WICColorContextType wicContextType = WICColorContextUninitialized; - if (m_pColorContext != NULL && - SUCCEEDED(m_pColorContext->GetType(&wicContextType))) - { - bHasProfile = wicContextType == WICColorContextProfile; - } - } - - return bHasProfile; -} - -/*++ - -Routine Name: - - CBmpConverter::GetPixelFormat - -Routine Description: - - Retrieves the underlying pixel format - -Arguments: - - None - -Return Value: - - Enumerated value identifying the current pixel format of the bitmap - ---*/ -EWICPixelFormat -CBmpConverter::GetPixelFormat( - VOID - ) -{ - return m_ePixelFormat; -} - -/*++ - -Routine Name: - - CBmpConverter::GetSize - -Routine Description: - - Retrieves the dimensions of the bitmap - -Arguments: - - pcWidth - Pointer to a variable that recieves the pixel width - pcHeight - Pointer to a variable that recieves the pixel height - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CBmpConverter::GetSize( - _Out_ UINT* pcWidth, - _Out_ UINT* pcHeight - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(m_pBitmap, E_PENDING)) && - SUCCEEDED(hr = CHECK_POINTER(m_pImagingFactory, E_PENDING)) && - SUCCEEDED(hr = CHECK_POINTER(pcWidth, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pcHeight, E_POINTER))) - { - *pcWidth = 0; - *pcHeight = 0; - - hr = m_pBitmap->GetSize(pcWidth, pcHeight); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CBmpConverter::GetResolution - -Routine Description: - - Retrieves the resolution of the underlying bitmap - -Arguments: - - pDpiX - Pointer to a variable that recieves the horizontal resolution - pDpiY - Pointer to a variable that recieves the vertical resolution - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CBmpConverter::GetResolution( - _Out_ DOUBLE* pDpiX, - _Out_ DOUBLE* pDpiY - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(m_pBitmap, E_PENDING)) && - SUCCEEDED(hr = CHECK_POINTER(m_pImagingFactory, E_PENDING)) && - SUCCEEDED(hr = CHECK_POINTER(pDpiX, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pDpiY, E_POINTER))) - { - *pDpiX = 0.0; - *pDpiY = 0.0; - - hr = m_pBitmap->GetResolution(pDpiX, pDpiY); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CBmpConverter::SetProfile - -Routine Description: - - This method sets creates a color context based of the supplied profile filename and - associates that cotext with the bitmap - -Arguments: - - szProfile - The profile filename - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CBmpConverter::SetProfile( - _In_z_ LPWSTR szProfile - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(szProfile, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(m_pImagingFactory, E_PENDING))) - { - m_pColorContext = NULL; - if (SUCCEEDED(hr = m_pImagingFactory->CreateColorContext(&m_pColorContext))) - { - hr = m_pColorContext->InitializeFromFilename(szProfile); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CBmpConverter::operator= - -Routine Description: - - Assignment operator - -Arguments: - - converter - Instance of a CBmpConverter to be assigned to - -Return Value: - - Reference to the newly assigned CBmpConverter instance - ---*/ -CBmpConverter& -CBmpConverter::operator=( - _In_ CONST CBmpConverter& converter - ) -{ - // - // Assign all the member pointers. The COM pointer takes care of reference counting. - // - m_pImagingFactory = converter.m_pImagingFactory; - m_pBitmap = converter.m_pBitmap; - m_pColorContext = converter.m_pColorContext; - m_pCurrentLock = converter.m_pCurrentLock; - m_ePixelFormat = converter.m_ePixelFormat; - - ASSERTMSG(m_pCurrentLock == NULL, "Copying locked bitmap can lead to a deadlock.\n"); - - return *this; -} - -/*++ - -Routine Name: - - CBmpConverter::CreateImagingFactory - -Routine Description: - - Creates the WIC imaging factory - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CBmpConverter::CreateImagingFactory( - VOID - ) -{ - m_pImagingFactory = NULL; - HRESULT hr = m_pImagingFactory.CoCreateInstance(CLSID_WICImagingFactory); - if (SUCCEEDED(hr)) - { - hr = CHECK_POINTER(m_pImagingFactory, E_FAIL); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CBmpConverter::PixelFormatFromGUID - -Routine Description: - - Converts the WIC pixel format GUID to the matching pixel format enumeration - -Arguments: - - pixelFormat - GUID defining the pixel format - pPixFormat - Pointer to the pixel format to be set - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CBmpConverter::PixelFormatFromGUID( - _In_ REFGUID pixelFormat, - _Out_ EWICPixelFormat* pPixFormat - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pPixFormat, E_POINTER))) - { - *pPixFormat = kWICPixelFormatDontCare; - BOOL bFound = 0; - - // - // Loop all the potential formats - // - for (UINT cFormat = 0; - cFormat < kWICPixelFormatMax; - cFormat++) - { - // - // Try to match the guid - // - if (pixelFormat == g_lutPixFrmtGuid[cFormat]) - { - // - // The index provides the corresponding pixel format enumerated value - // - bFound = TRUE; - *pPixFormat = static_cast<EWICPixelFormat>(cFormat); - break; - } - } - - if (!bFound) - { - RIP("Could not match format GUID\n"); - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/color/bmpconv.h b/print/XPSDrvSmpl/src/filters/color/bmpconv.h deleted file mode 100644 index 5bed56b4..00000000 --- a/print/XPSDrvSmpl/src/filters/color/bmpconv.h +++ /dev/null @@ -1,168 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - bmpconv.h - -Abstract: - - WIC bitmap conversion class definition. This class provides a wrapper to a bitmap - stream that uses WIC to access bitmap data and provide conversion functionality. - ---*/ - -#pragma once - -#include "bmpdata.h" - -class CBmpConverter -{ -public: - CBmpConverter(); - - CBmpConverter( - _In_ CONST EWICPixelFormat& ePixFormat, - _In_ CONST UINT& cWidth, - _In_ CONST UINT& cHeight, - _In_ CONST DOUBLE& dpiX, - _In_ CONST DOUBLE& dpiY - ); - - CBmpConverter( - _In_ IStream* pStream - ); - - CBmpConverter( - _In_ CONST CBmpConverter& converter - ); - - virtual ~CBmpConverter(); - - HRESULT - Initialize( - _In_ CONST EWICPixelFormat& ePixFormat, - _In_ CONST UINT& cWidth, - _In_ CONST UINT& cHeight, - _In_ CONST DOUBLE& dpiX, - _In_ CONST DOUBLE& dpiY - ); - - HRESULT - Initialize( - _In_ IStream* pStream - ); - - HRESULT - Initialize( - _In_ IWICBitmapSource* pSource - ); - - HRESULT - Write( - _In_ REFGUID guidContainerFormat, - _Inout_ IStream* pStream - ); - - HRESULT - Convert( - _In_ EWICPixelFormat ePixFormat, - _Out_ BOOL* pbCanConvert - ); - - HRESULT - LockSurface( - _In_ WICRect* prcLock, - _In_ CONST BOOL& bReadOnly, - _Out_ UINT* pcbStride, - _Out_ UINT* pcWidth, - _Out_ UINT* pcHeight, - _Inout_ UINT* pcbData, - _Outptr_result_bytebuffer_maybenull_(*pcbData) - PBYTE* ppbData - ); - - HRESULT - UnlockSurface( - VOID - ); - - HRESULT - GetColorContext( - _Outptr_ IWICColorContext** ppColorContext - ); - - BOOL - HasAlphaChannel( - VOID - ) CONST; - - BOOL - HasColorContext( - VOID - ) CONST; - - BOOL - HasColorProfile( - VOID - ) CONST; - - EWICPixelFormat - GetPixelFormat( - VOID - ); - - HRESULT - GetSize( - _Out_ UINT* pcWidth, - _Out_ UINT* pcHeight - ); - - HRESULT - GetResolution( - _Out_ DOUBLE* pDpiX, - _Out_ DOUBLE* pDpiY - ); - - HRESULT - SetProfile( - _In_z_ LPWSTR szProfile - ); - - CBmpConverter& - operator=( - _In_ CONST CBmpConverter& converter - ); - -private: - HRESULT - CreateImagingFactory( - VOID - ); - - HRESULT - PixelFormatFromGUID( - _In_ REFGUID pixelFormat, - _Out_ EWICPixelFormat* pPixFormat - ); - -protected: - CComPtr<IWICImagingFactory> m_pImagingFactory; - - CComPtr<IWICBitmap> m_pBitmap; - - CComPtr<IWICColorContext> m_pColorContext; - - CComPtr<IWICBitmapLock> m_pCurrentLock; - - EWICPixelFormat m_ePixelFormat; -}; - diff --git a/print/XPSDrvSmpl/src/filters/color/bmpdata.cpp b/print/XPSDrvSmpl/src/filters/color/bmpdata.cpp deleted file mode 100644 index b4df4d02..00000000 --- a/print/XPSDrvSmpl/src/filters/color/bmpdata.cpp +++ /dev/null @@ -1,253 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - bmpdata.cpp - -Abstract: - - This file supplies various look-up tables for use in converting and color matching - input bitmaps via WCS/ICM and WIC - ---*/ - -#include "precomp.h" -#include "globals.h" -#include "bmpdata.h" - -/* -Look up table between WIC pixel format enumeration and WIC pixel format GUID -*/ -CONST WICPixelFormatGUID g_lutPixFrmtGuid[kWICPixelFormatMax] = { - GUID_WICPixelFormatDontCare, - GUID_WICPixelFormat1bppIndexed, - GUID_WICPixelFormat2bppIndexed, - GUID_WICPixelFormat4bppIndexed, - GUID_WICPixelFormat8bppIndexed, - GUID_WICPixelFormatBlackWhite, - GUID_WICPixelFormat2bppGray, - GUID_WICPixelFormat4bppGray, - GUID_WICPixelFormat8bppGray, - GUID_WICPixelFormat16bppBGR555, - GUID_WICPixelFormat16bppBGR565, - GUID_WICPixelFormat16bppGray, - GUID_WICPixelFormat24bppBGR, - GUID_WICPixelFormat24bppRGB, - GUID_WICPixelFormat32bppBGR, - GUID_WICPixelFormat32bppBGRA, - GUID_WICPixelFormat32bppPBGRA, - GUID_WICPixelFormat32bppGrayFloat, - GUID_WICPixelFormat48bppRGBFixedPoint, - GUID_WICPixelFormat16bppGrayFixedPoint, - GUID_WICPixelFormat32bppBGR101010, - GUID_WICPixelFormat48bppRGB, - GUID_WICPixelFormat64bppRGBA, - GUID_WICPixelFormat64bppPRGBA, - GUID_WICPixelFormat96bppRGBFixedPoint, - GUID_WICPixelFormat128bppRGBAFloat, - GUID_WICPixelFormat128bppPRGBAFloat, - GUID_WICPixelFormat128bppRGBFloat, - GUID_WICPixelFormat32bppCMYK, - GUID_WICPixelFormat64bppRGBAFixedPoint, - GUID_WICPixelFormat64bppRGBFixedPoint, - GUID_WICPixelFormat128bppRGBAFixedPoint, - GUID_WICPixelFormat128bppRGBFixedPoint, - GUID_WICPixelFormat64bppRGBAHalf, - GUID_WICPixelFormat64bppRGBHalf, - GUID_WICPixelFormat48bppRGBHalf, - GUID_WICPixelFormat32bppRGBE, - GUID_WICPixelFormat16bppGrayHalf, - GUID_WICPixelFormat32bppGrayFixedPoint, - GUID_WICPixelFormat64bppCMYK, - GUID_WICPixelFormat24bpp3Channels, - GUID_WICPixelFormat32bpp4Channels, - GUID_WICPixelFormat40bpp5Channels, - GUID_WICPixelFormat48bpp6Channels, - GUID_WICPixelFormat56bpp7Channels, - GUID_WICPixelFormat64bpp8Channels, - GUID_WICPixelFormat48bpp3Channels, - GUID_WICPixelFormat64bpp4Channels, - GUID_WICPixelFormat80bpp5Channels, - GUID_WICPixelFormat96bpp6Channels, - GUID_WICPixelFormat112bpp7Channels, - GUID_WICPixelFormat128bpp8Channels, - GUID_WICPixelFormat40bppCMYKAlpha, - GUID_WICPixelFormat80bppCMYKAlpha, - GUID_WICPixelFormat32bpp3ChannelsAlpha, - GUID_WICPixelFormat40bpp4ChannelsAlpha, - GUID_WICPixelFormat48bpp5ChannelsAlpha, - GUID_WICPixelFormat56bpp6ChannelsAlpha, - GUID_WICPixelFormat64bpp7ChannelsAlpha, - GUID_WICPixelFormat72bpp8ChannelsAlpha, - GUID_WICPixelFormat64bpp3ChannelsAlpha, - GUID_WICPixelFormat80bpp4ChannelsAlpha, - GUID_WICPixelFormat96bpp5ChannelsAlpha, - GUID_WICPixelFormat112bpp6ChannelsAlpha, - GUID_WICPixelFormat128bpp7ChannelsAlpha, - GUID_WICPixelFormat144bpp8ChannelsAlpha -}; - -/* -Look-up table between WICPixelFormat enumeration and conversion information - -The aim of this table is to assist us in transforming the input WCS data into a format acceptable -to WCS/ICM TranslateBitmapBits call. The sort of problems this aims to resolve are: - - 1. The lack of S7DOT24FIXED format support in WCS/ICM. - 2. The lack of half format support in WCS/ICM. - 3. The lack of support for > 8bpc in WCS/ICM for channel counts > 4 - -The table is used in the following way: - - 1. Look-up the most appropriate WIC pixel format for color conversion by indexing into - the table using the matching WIC pixel format enumeration then using WIC to convert - to this format. - 2. Identify the matching BMFORMAT enumeration to process with WCS/ICM - 3. Identify where we need to process alpha data seperately and using an intermediate - transform buffer to pass to ICM/WCS where necessary - -Additionally the table also provides useful look-up information for use when processing -intermediate transform buffers: channel count, alpha channel placement and color data type. - -*/ -CONST WICToBMFORMAT g_lutWICToBMFormat[kWICPixelFormatMax] = { - {kWICPixelFormat24bppRGB, kBM_RGBTRIPLETS, FALSE, 3, 0, COLOR_BYTE}, // kWICPixelFormatDontCare - {kWICPixelFormat24bppRGB, kBM_RGBTRIPLETS, FALSE, 3, 0, COLOR_BYTE}, // kWICPixelFormat1bppIndexed - {kWICPixelFormat24bppRGB, kBM_RGBTRIPLETS, FALSE, 3, 0, COLOR_BYTE}, // kWICPixelFormat2bppIndexed - {kWICPixelFormat24bppRGB, kBM_RGBTRIPLETS, FALSE, 3, 0, COLOR_BYTE}, // kWICPixelFormat4bppIndexed - {kWICPixelFormat24bppRGB, kBM_RGBTRIPLETS, FALSE, 3, 0, COLOR_BYTE}, // kWICPixelFormat8bppIndexed - {kWICPixelFormat8bppGray, kBM_GRAY, FALSE, 1, 0, COLOR_BYTE}, // kWICPixelFormatBlackWhite - {kWICPixelFormat8bppGray, kBM_GRAY, FALSE, 1, 0, COLOR_BYTE}, // kWICPixelFormat2bppGray - {kWICPixelFormat8bppGray, kBM_GRAY, FALSE, 1, 0, COLOR_BYTE}, // kWICPixelFormat4bppGray - {kWICPixelFormat8bppGray, kBM_GRAY, FALSE, 1, 0, COLOR_BYTE}, // kWICPixelFormat8bppGray - {kWICPixelFormat24bppRGB, kBM_RGBTRIPLETS, FALSE, 3, 0, COLOR_BYTE}, // kWICPixelFormat16bppBGR555 - {kWICPixelFormat24bppRGB, kBM_RGBTRIPLETS, FALSE, 3, 0, COLOR_BYTE}, // kWICPixelFormat16bppBGR565 - {kWICPixelFormat16bppGray, kBM_16b_GRAY, FALSE, 1, 0, COLOR_WORD}, // kWICPixelFormat16bppGray - {kWICPixelFormat24bppBGR, kBM_BGRTRIPLETS, FALSE, 3, 0, COLOR_BYTE}, // kWICPixelFormat24bppBGR - {kWICPixelFormat24bppRGB, kBM_RGBTRIPLETS, FALSE, 3, 0, COLOR_BYTE}, // kWICPixelFormat24bppRGB - {kWICPixelFormat24bppBGR, kBM_BGRTRIPLETS, FALSE, 3, 0, COLOR_BYTE}, // kWICPixelFormat32bppBGR - {kWICPixelFormat32bppBGRA, kBM_xRGBQUADS, FALSE, 4, 3, COLOR_BYTE}, // kWICPixelFormat32bppBGRA - {kWICPixelFormat32bppPBGRA, kBM_xRGBQUADS, FALSE, 4, 3, COLOR_BYTE}, // kWICPixelFormat32bppPBGRA - {kWICPixelFormat16bppGray, kBM_16b_GRAY, FALSE, 1, 0, COLOR_WORD}, // kWICPixelFormat32bppGrayFloat - {kWICPixelFormat48bppRGBFixedPoint, kBM_S2DOT13FIXED_scRGB, FALSE, 3, 0, COLOR_S2DOT13FIXED}, // kWICPixelFormat48bppRGBFixedPoint - {kWICPixelFormat16bppGray, kBM_16b_GRAY, FALSE, 1, 0, COLOR_WORD}, // kWICPixelFormat16bppGrayFixedPoint - {kWICPixelFormat48bppRGB, kBM_16b_RGB, FALSE, 3, 0, COLOR_WORD}, // kWICPixelFormat32bppBGR101010 - {kWICPixelFormat48bppRGB, kBM_16b_RGB, FALSE, 3, 0, COLOR_WORD}, // kWICPixelFormat48bppRGB - {kWICPixelFormat64bppRGBA, kBM_16b_RGB, TRUE, 4, 3, COLOR_WORD}, // kWICPixelFormat64bppRGBA - {kWICPixelFormat64bppPRGBA, kBM_16b_RGB, TRUE, 4, 3, COLOR_WORD}, // kWICPixelFormat64bppPRGBA - {kWICPixelFormat128bppRGBFloat, kBM_32b_scRGB, TRUE, 4, 0, COLOR_FLOAT}, // kWICPixelFormat96bppRGBFixedPoint - {kWICPixelFormat128bppRGBAFloat, kBM_32b_scARGB, FALSE, 4, 3, COLOR_FLOAT}, // kWICPixelFormat128bppRGBAFloat - {kWICPixelFormat128bppPRGBAFloat, kBM_32b_scARGB, FALSE, 4, 3, COLOR_FLOAT}, // kWICPixelFormat128bppPRGBAFloat - {kWICPixelFormat128bppRGBFloat, kBM_32b_scARGB, FALSE, 4, 0, COLOR_FLOAT}, // kWICPixelFormat128bppRGBFloat - {kWICPixelFormat32bppCMYK, kBM_CMYKQUADS, FALSE, 4, 0, COLOR_BYTE}, // kWICPixelFormat32bppCMYK - {kWICPixelFormat64bppRGBAFixedPoint, kBM_S2DOT13FIXED_scARGB, FALSE, 4, 3, COLOR_S2DOT13FIXED}, // kWICPixelFormat64bppRGBAFixedPoint - {kWICPixelFormat64bppRGBFixedPoint, kBM_S2DOT13FIXED_scARGB, FALSE, 4, 0, COLOR_S2DOT13FIXED}, // kWICPixelFormat64bppRGBFixedPoint - {kWICPixelFormat128bppRGBAFloat, kBM_32b_scARGB, FALSE, 4, 3, COLOR_FLOAT}, // kWICPixelFormat128bppRGBAFixedPoint - {kWICPixelFormat128bppRGBAFloat, kBM_32b_scARGB, FALSE, 4, 0, COLOR_FLOAT}, // kWICPixelFormat128bppRGBFixedPoint - {kWICPixelFormat128bppRGBAFloat, kBM_32b_scARGB, FALSE, 4, 3, COLOR_FLOAT}, // kWICPixelFormat64bppRGBAHalf - {kWICPixelFormat128bppRGBAFloat, kBM_32b_scARGB, FALSE, 4, 0, COLOR_FLOAT}, // kWICPixelFormat64bppRGBHalf - {kWICPixelFormat128bppRGBAFloat, kBM_32b_scARGB, FALSE, 4, 0, COLOR_FLOAT}, // kWICPixelFormat48bppRGBHalf - {kWICPixelFormat128bppRGBAFloat, kBM_32b_scARGB, FALSE, 4, 3, COLOR_FLOAT}, // kWICPixelFormat32bppRGBE - {kWICPixelFormat16bppGray, kBM_16b_GRAY, FALSE, 1, 0, COLOR_WORD}, // kWICPixelFormat16bppGrayHalf - {kWICPixelFormat16bppGray, kBM_16b_GRAY, FALSE, 1, 0, COLOR_WORD}, // kWICPixelFormat32bppGrayFixedPoint - {kWICPixelFormat32bpp4Channels, kBM_CMYKQUADS, FALSE, 4, 0, COLOR_BYTE}, // kWICPixelFormat64bppCMYK - {kWICPixelFormat24bpp3Channels, kBM_RGBTRIPLETS, FALSE, 3, 0, COLOR_BYTE}, // kWICPixelFormat24bpp3Channels - {kWICPixelFormat32bpp4Channels, kBM_CMYKQUADS, FALSE, 4, 0, COLOR_BYTE}, // kWICPixelFormat32bpp4Channels - {kWICPixelFormat40bpp5Channels, kBM_5CHANNEL, FALSE, 5, 0, COLOR_BYTE}, // kWICPixelFormat40bpp5Channels - {kWICPixelFormat48bpp6Channels, kBM_6CHANNEL, FALSE, 6, 0, COLOR_BYTE}, // kWICPixelFormat48bpp6Channels - {kWICPixelFormat56bpp7Channels, kBM_7CHANNEL, FALSE, 7, 0, COLOR_BYTE}, // kWICPixelFormat56bpp7Channels - {kWICPixelFormat64bpp8Channels, kBM_8CHANNEL, FALSE, 8, 0, COLOR_BYTE}, // kWICPixelFormat64bpp8Channels - {kWICPixelFormat24bpp3Channels, kBM_RGBTRIPLETS, FALSE, 3, 0, COLOR_BYTE}, // kWICPixelFormat48bpp3Channels - {kWICPixelFormat32bpp4Channels, kBM_CMYKQUADS, FALSE, 4, 0, COLOR_BYTE}, // kWICPixelFormat64bpp4Channels - {kWICPixelFormat40bpp5Channels, kBM_5CHANNEL, FALSE, 5, 0, COLOR_BYTE}, // kWICPixelFormat80bpp5Channels - {kWICPixelFormat48bpp6Channels, kBM_6CHANNEL, FALSE, 6, 0, COLOR_BYTE}, // kWICPixelFormat96bpp6Channels - {kWICPixelFormat56bpp7Channels, kBM_7CHANNEL, FALSE, 7, 0, COLOR_BYTE}, // kWICPixelFormat112bpp7Channels - {kWICPixelFormat64bpp8Channels, kBM_8CHANNEL, FALSE, 8, 0, COLOR_BYTE}, // kWICPixelFormat128bpp8Channels - {kWICPixelFormat40bppCMYKAlpha, kBM_CMYKQUADS, TRUE, 5, 4, COLOR_BYTE}, // kWICPixelFormat40bppCMYKAlpha - {kWICPixelFormat40bppCMYKAlpha, kBM_CMYKQUADS, TRUE, 5, 4, COLOR_BYTE}, // kWICPixelFormat80bppCMYKAlpha - {kWICPixelFormat32bpp3ChannelsAlpha, kBM_RGBTRIPLETS, TRUE, 4, 3, COLOR_BYTE}, // kWICPixelFormat32bpp3ChannelsAlpha - {kWICPixelFormat40bpp4ChannelsAlpha, kBM_CMYKQUADS, TRUE, 5, 4, COLOR_BYTE}, // kWICPixelFormat40bpp4ChannelsAlpha - {kWICPixelFormat48bpp5ChannelsAlpha, kBM_5CHANNEL, TRUE, 6, 5, COLOR_BYTE}, // kWICPixelFormat48bpp5ChannelsAlpha - {kWICPixelFormat56bpp6ChannelsAlpha, kBM_6CHANNEL, TRUE, 7, 6, COLOR_BYTE}, // kWICPixelFormat56bpp6ChannelsAlpha - {kWICPixelFormat64bpp7ChannelsAlpha, kBM_7CHANNEL, TRUE, 8, 7, COLOR_BYTE}, // kWICPixelFormat64bpp7ChannelsAlpha - {kWICPixelFormat72bpp8ChannelsAlpha, kBM_8CHANNEL, TRUE, 9, 8, COLOR_BYTE}, // kWICPixelFormat72bpp8ChannelsAlpha - {kWICPixelFormat32bpp3ChannelsAlpha, kBM_RGBTRIPLETS, TRUE, 4, 3, COLOR_BYTE}, // kWICPixelFormat64bpp3ChannelsAlpha - {kWICPixelFormat40bpp4ChannelsAlpha, kBM_CMYKQUADS, TRUE, 5, 4, COLOR_BYTE}, // kWICPixelFormat80bpp4ChannelsAlpha - {kWICPixelFormat48bpp5ChannelsAlpha, kBM_5CHANNEL, TRUE, 6, 5, COLOR_BYTE}, // kWICPixelFormat96bpp5ChannelsAlpha - {kWICPixelFormat56bpp6ChannelsAlpha, kBM_6CHANNEL, TRUE, 7, 6, COLOR_BYTE}, // kWICPixelFormat112bpp6ChannelsAlpha - {kWICPixelFormat64bpp7ChannelsAlpha, kBM_7CHANNEL, TRUE, 8, 7, COLOR_BYTE}, // kWICPixelFormat128bpp7ChannelsAlpha - {kWICPixelFormat72bpp8ChannelsAlpha, kBM_8CHANNEL, TRUE, 9, 8, COLOR_BYTE}, // kWICPixelFormat144bpp8ChannelsAlpha -}; - -/* -Look up table between color data type and data type size -*/ -CONST size_t g_lutColorDataSize[] = -{ - 0, // Packing as enumeration starts from 1 - sizeof(BYTE), // COLOR_BYTE =1 - sizeof(WORD), // COLOR_WORD - sizeof(FLOAT), // COLOR_FLOAT - sizeof(WORD), // COLOR_S2DOT13FIXED -}; - -/* -Define a color type that is not valid for WCS - we use this to distinguish -BMFORMATs that do not have a corresponding WCS color type -*/ -#define COLOR_INVALID 0 - -/* -Look up between local BMFORMAT enumeration providing the underlying enumeration -value and the corresponding pixel data size -*/ -CONST BMFormatData g_lutBMFormatData[kICMPixelFormatMax] = { - {BM_x555RGB, 3, static_cast<COLORDATATYPE>(COLOR_INVALID)}, - {BM_x555XYZ, 3, static_cast<COLORDATATYPE>(COLOR_INVALID)}, - {BM_x555Yxy, 3, static_cast<COLORDATATYPE>(COLOR_INVALID)}, - {BM_x555Lab, 3, static_cast<COLORDATATYPE>(COLOR_INVALID)}, - {BM_x555G3CH, 3, static_cast<COLORDATATYPE>(COLOR_INVALID)}, - {BM_RGBTRIPLETS, 3, COLOR_BYTE}, - {BM_BGRTRIPLETS, 3, COLOR_BYTE}, - {BM_XYZTRIPLETS, 3, COLOR_BYTE}, - {BM_YxyTRIPLETS, 3, COLOR_BYTE}, - {BM_LabTRIPLETS, 3, COLOR_BYTE}, - {BM_G3CHTRIPLETS, 3, COLOR_BYTE}, - {BM_5CHANNEL, 5, COLOR_BYTE}, - {BM_6CHANNEL, 6, COLOR_BYTE}, - {BM_7CHANNEL, 7, COLOR_BYTE}, - {BM_8CHANNEL, 8, COLOR_BYTE}, - {BM_GRAY, 1, COLOR_BYTE}, - {BM_xRGBQUADS, 4, COLOR_BYTE}, - {BM_xBGRQUADS, 4, COLOR_BYTE}, - {BM_xG3CHQUADS, 4, COLOR_BYTE}, - {BM_KYMCQUADS, 4, COLOR_BYTE}, - {BM_CMYKQUADS, 4, COLOR_BYTE}, - {BM_10b_RGB, 4, COLOR_BYTE}, - {BM_10b_XYZ, 4, COLOR_BYTE}, - {BM_10b_Yxy, 4, COLOR_BYTE}, - {BM_10b_Lab, 4, COLOR_BYTE}, - {BM_10b_G3CH, 4, COLOR_BYTE}, - {BM_NAMED_INDEX, 4, COLOR_BYTE}, - {BM_16b_RGB, 3, COLOR_WORD}, - {BM_16b_XYZ, 3, COLOR_WORD}, - {BM_16b_Yxy, 3, COLOR_WORD}, - {BM_16b_Lab, 3, COLOR_WORD}, - {BM_16b_G3CH, 3, COLOR_WORD}, - {BM_16b_GRAY, 3, COLOR_WORD}, - {BM_565RGB, 3, COLOR_WORD}, - {BM_32b_scRGB, 3, COLOR_FLOAT}, - {BM_32b_scARGB, 4, COLOR_FLOAT}, - {BM_S2DOT13FIXED_scRGB, 3, COLOR_S2DOT13FIXED}, - {BM_S2DOT13FIXED_scARGB, 4, COLOR_S2DOT13FIXED}, -}; - diff --git a/print/XPSDrvSmpl/src/filters/color/bmpdata.h b/print/XPSDrvSmpl/src/filters/color/bmpdata.h deleted file mode 100644 index 225b7745..00000000 --- a/print/XPSDrvSmpl/src/filters/color/bmpdata.h +++ /dev/null @@ -1,768 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - bmpdata.h - -Abstract: - - This file supplies definitions for various look-up tables for use in converting and - color matching input bitmaps via WCS/ICM and WIC - ---*/ - -#pragma once - -// -// Macros to limit maximum buffer size allocations -// -#define MAX_COLDATATYPE_SIZE sizeof(FLOAT) -#define MAX_COLCHANNEL_COUNT 9 // 8 channel plus alpha -#define MAX_PIXELWIDTH_COUNT SIZE_MAX/MAX_COLDATATYPE_SIZE/MAX_COLCHANNEL_COUNT - - -/* -Enumeration for all WIC pixel formats -*/ -enum EWICPixelFormat -{ - kWICPixelFormatDontCare = 0, kWICPixelFormatMin = 0, - kWICPixelFormat1bppIndexed, - kWICPixelFormat2bppIndexed, - kWICPixelFormat4bppIndexed, - kWICPixelFormat8bppIndexed, - kWICPixelFormatBlackWhite, - kWICPixelFormat2bppGray, - kWICPixelFormat4bppGray, - kWICPixelFormat8bppGray, - kWICPixelFormat16bppBGR555, - kWICPixelFormat16bppBGR565, - kWICPixelFormat16bppGray, - kWICPixelFormat24bppBGR, - kWICPixelFormat24bppRGB, - kWICPixelFormat32bppBGR, - kWICPixelFormat32bppBGRA, - kWICPixelFormat32bppPBGRA, - kWICPixelFormat32bppGrayFloat, - kWICPixelFormat48bppRGBFixedPoint, - kWICPixelFormat16bppGrayFixedPoint, - kWICPixelFormat32bppBGR101010, - kWICPixelFormat48bppRGB, - kWICPixelFormat64bppRGBA, - kWICPixelFormat64bppPRGBA, - kWICPixelFormat96bppRGBFixedPoint, - kWICPixelFormat128bppRGBAFloat, - kWICPixelFormat128bppPRGBAFloat, - kWICPixelFormat128bppRGBFloat, - kWICPixelFormat32bppCMYK, - kWICPixelFormat64bppRGBAFixedPoint, - kWICPixelFormat64bppRGBFixedPoint, - kWICPixelFormat128bppRGBAFixedPoint, - kWICPixelFormat128bppRGBFixedPoint, - kWICPixelFormat64bppRGBAHalf, - kWICPixelFormat64bppRGBHalf, - kWICPixelFormat48bppRGBHalf, - kWICPixelFormat32bppRGBE, - kWICPixelFormat16bppGrayHalf, - kWICPixelFormat32bppGrayFixedPoint, - kWICPixelFormat64bppCMYK, - kWICPixelFormat24bpp3Channels, - kWICPixelFormat32bpp4Channels, - kWICPixelFormat40bpp5Channels, - kWICPixelFormat48bpp6Channels, - kWICPixelFormat56bpp7Channels, - kWICPixelFormat64bpp8Channels, - kWICPixelFormat48bpp3Channels, - kWICPixelFormat64bpp4Channels, - kWICPixelFormat80bpp5Channels, - kWICPixelFormat96bpp6Channels, - kWICPixelFormat112bpp7Channels, - kWICPixelFormat128bpp8Channels, - kWICPixelFormat40bppCMYKAlpha, - kWICPixelFormat80bppCMYKAlpha, - kWICPixelFormat32bpp3ChannelsAlpha, - kWICPixelFormat40bpp4ChannelsAlpha, - kWICPixelFormat48bpp5ChannelsAlpha, - kWICPixelFormat56bpp6ChannelsAlpha, - kWICPixelFormat64bpp7ChannelsAlpha, - kWICPixelFormat72bpp8ChannelsAlpha, - kWICPixelFormat64bpp3ChannelsAlpha, - kWICPixelFormat80bpp4ChannelsAlpha, - kWICPixelFormat96bpp5ChannelsAlpha, - kWICPixelFormat112bpp6ChannelsAlpha, - kWICPixelFormat128bpp7ChannelsAlpha, - kWICPixelFormat144bpp8ChannelsAlpha, - kWICPixelFormatMax -}; - -/* -ICM/WCS BMFORMAT enumeration indexed from 0 for use as a look-up into -a BMFORMAT data structure array -*/ -enum EICMPixelFormat -{ - kBM_x555RGB = 0, kICMPixelFormatMin = 0, - kBM_x555XYZ, - kBM_x555Yxy, - kBM_x555Lab, - kBM_x555G3CH, - kBM_RGBTRIPLETS, - kBM_BGRTRIPLETS, - kBM_XYZTRIPLETS, - kBM_YxyTRIPLETS, - kBM_LabTRIPLETS, - kBM_G3CHTRIPLETS, - kBM_5CHANNEL, - kBM_6CHANNEL, - kBM_7CHANNEL, - kBM_8CHANNEL, - kBM_GRAY, - kBM_xRGBQUADS, - kBM_xBGRQUADS, - kBM_xG3CHQUADS, - kBM_KYMCQUADS, - kBM_CMYKQUADS, - kBM_10b_RGB, - kBM_10b_XYZ, - kBM_10b_Yxy, - kBM_10b_Lab, - kBM_10b_G3CH, - kBM_NAMED_INDEX, - kBM_16b_RGB, - kBM_16b_XYZ, - kBM_16b_Yxy, - kBM_16b_Lab, - kBM_16b_G3CH, - kBM_16b_GRAY, - kBM_565RGB, - kBM_32b_scRGB, - kBM_32b_scARGB, - kBM_S2DOT13FIXED_scRGB, - kBM_S2DOT13FIXED_scARGB, - kICMPixelFormatMax -}; - -/* -This structure is used to store information for converting and processing a particular -WIC format. The structure forms the basis of a look-up table between a source WIC pixel -format and the following items: - The format to convert to before processing - - This converts to a form consumable by ICM/WCS. - The corresponding BMFORMAT enumeration - - This lets us lookup the data type to pass to TranslateBitmapBits. - Whether we need an intermediate buffer to process alpha data - The alpha channel in WIC pixel formats do not match ICM/WCS compatible - formats. Under these circumstances we need to copy the bitmap data, translate - and apply back to the WIC bitmap. - The count of channels and the channel width - This allows us to lookup the offset required when copying intermediate data to - the WIC bitmap. - The offset to the alpha channel (we actually store the COLORDATATYPE and lookup the size) - When copying alpha data we need to know where to retrieve the alpha channel from and - where to copy it to in a given scanline. - -With this data, handling intermediate buffer data follows the following algorithm: - - If no intermediate buffer is required - The locked WIC pixel data can be converted in situ - Otherwise - Color data handling - From the begining of the WIC buffer and the intermediate buffer - Copy the intermediate buffer pixel width into the locked WIC scanline - Move the WIC pixel pointer on by the WIC pixel width - Move the intermediate buffer pointer on by the BMFORMAT pixel width - Repeat till no scanline data left to process - Alpha data handling - From the begining of the source and destination WIC buffers - Offset the source to the alpha channel - Offset the destination to the alpha channel - Convert the source to format to the destination - Copy the alpha data to the destination - Move the source WIC pixel pointer on by the WIC pixel width - Move the destination WIC pixel pointer on by the WIC pixel width - Repeat till no alpha data left to process - -*/ -struct WICToBMFORMAT -{ - EWICPixelFormat m_pixFormTarget; - EICMPixelFormat m_bmFormTarget; - BOOL m_bNeedsScanBuffer; - UINT m_cChannels; - UINT m_cAlphaOffset; - COLORDATATYPE m_colDataType; -}; - -/* -Structure providing information about BMFORMAT data for use as a lookup against -the local BMFORMAT enumeration -*/ -struct BMFormatData -{ - BMFORMAT m_bmFormat; - UINT m_cChannels; - COLORDATATYPE m_colDataType; -}; - -extern CONST WICPixelFormatGUID g_lutPixFrmtGuid[kWICPixelFormatMax]; -extern CONST WICToBMFORMAT g_lutWICToBMFormat[kWICPixelFormatMax]; -extern CONST size_t g_lutColorDataSize[]; -extern CONST BMFormatData g_lutBMFormatData[kICMPixelFormatMax]; - -struct S2DOT13FIXED -{ - WORD val; -}; -typedef S2DOT13FIXED* PS2DOT13FIXED; - -/*++ - -Routine Name: - - ConvertCopy - -Routine Description: - - Inline function that converts a src channel data type to a destination - of another type. This overload converts BYTE to BYTE - -Arguments: - - dst - Destination value to be set - src - Source value - -Return Value: - - None - ---*/ -inline VOID -ConvertCopy( - _Out_ BYTE& dst, - _In_ BYTE src - ) -{ - dst = src; -} - -/*++ - -Routine Name: - - ConvertCopy - -Routine Description: - - Inline function that converts a src channel data type to a destination - of another type. This overload converts WORD to BYTE - -Arguments: - - dst - Destination value to be set - src - Source value - -Return Value: - - None - ---*/ -inline VOID -ConvertCopy( - _Out_ BYTE& dst, - _In_ WORD src - ) -{ - dst = static_cast<BYTE>((static_cast<DWORD>(src) + 0x7F) >> 8); -} - -/*++ - -Routine Name: - - ConvertCopy - -Routine Description: - - Inline function that converts a src channel data type to a destination - of another type. This overload converts FLOAT to BYTE - -Arguments: - - dst - Destination value to be set - src - Source value - -Return Value: - - None - ---*/ -inline VOID -ConvertCopy( - _Out_ BYTE& dst, - _In_ FLOAT src - ) -{ - if (src < 0.0f) - { - dst = 0x00; - } - else if (src > 1.0f) - { - dst = 0xFF; - } - else - { - dst = static_cast<BYTE>(src * kMaxByteAsFloat); - } -} - -/*++ - -Routine Name: - - ConvertCopy - -Routine Description: - - Inline function that converts a src channel data type to a destination - of another type. This overload converts S2DOT13FIXED to BYTE - -Arguments: - - dst - Destination value to be set - src - Source value - -Return Value: - - None - ---*/ -inline VOID -ConvertCopy( - _Out_ BYTE& dst, - _In_ S2DOT13FIXED src - ) -{ - if (src.val & kS2Dot13Neg) - { - dst = 0x00; - } - else if (src.val > kS2Dot13One) - { - dst = 0xFF; - } - else - { - dst = static_cast<BYTE>(MulDiv(src.val, 0xFF, kS2Dot13One)); - } -} - -/*++ - -Routine Name: - - ConvertCopy - -Routine Description: - - Inline function that converts a src channel data type to a destination - of another type. This overload converts BYTE to WORD - -Arguments: - - dst - Destination value to be set - src - Source value - -Return Value: - - None - ---*/ -inline VOID -ConvertCopy( - _Out_ WORD& dst, - _In_ BYTE src - ) -{ - dst = (src << 8) | src; -} - -/*++ - -Routine Name: - - ConvertCopy - -Routine Description: - - Inline function that converts a src channel data type to a destination - of another type. This overload converts WORD to WORD - -Arguments: - - dst - Destination value to be set - src - Source value - -Return Value: - - None - ---*/ -inline VOID -ConvertCopy( - _Out_ WORD& dst, - _In_ WORD src - ) -{ - dst = src; -} - -/*++ - -Routine Name: - - ConvertCopy - -Routine Description: - - Inline function that converts a src channel data type to a destination - of another type. This overload converts FLOAT to WORD - -Arguments: - - dst - Destination value to be set - src - Source value - -Return Value: - - None - ---*/ -inline VOID -ConvertCopy( - _Out_ WORD& dst, - _In_ FLOAT src - ) -{ - if (src < 0.0f) - { - dst = 0x0000; - } - else if (src > 1.0f) - { - dst = 0xFFFF; - } - else - { - dst = static_cast<WORD>(src * kMaxWordAsFloat); - } -} - -/*++ - -Routine Name: - - ConvertCopy - -Routine Description: - - Inline function that converts a src channel data type to a destination - of another type. This overload converts S2DOT13FIXED to WORD - -Arguments: - - dst - Destination value to be set - src - Source value - -Return Value: - - None - ---*/ -inline VOID -ConvertCopy( - _Out_ WORD& dst, - _In_ S2DOT13FIXED src - ) -{ - if (src.val & kS2Dot13Neg) - { - dst = 0x0000; - } - else if (src.val > kS2Dot13One) - { - dst = 0xFFFF; - } - else - { - dst = static_cast<BYTE>(MulDiv(src.val, 0xFFFF, kS2Dot13One)); - } -} - -/*++ - -Routine Name: - - ConvertCopy - -Routine Description: - - Inline function that converts a src channel data type to a destination - of another type. This overload converts BYTE to FLOAT - -Arguments: - - dst - Destination value to be set - src - Source value - -Return Value: - - None - ---*/ -inline VOID -ConvertCopy( - _Out_ FLOAT& dst, - _In_ BYTE src - ) -{ - dst = src/kMaxByteAsFloat; -} - -/*++ - -Routine Name: - - ConvertCopy - -Routine Description: - - Inline function that converts a src channel data type to a destination - of another type. This overload converts WORD to FLOAT - -Arguments: - - dst - Destination value to be set - src - Source value - -Return Value: - - None - ---*/ -inline VOID -ConvertCopy( - _Out_ FLOAT& dst, - _In_ WORD src - ) -{ - dst = src/kMaxWordAsFloat; -} - -/*++ - -Routine Name: - - ConvertCopy - -Routine Description: - - Inline function that converts a src channel data type to a destination - of another type. This overload converts FLOAT to FLOAT - -Arguments: - - dst - Destination value to be set - src - Source value - -Return Value: - - None - ---*/ -inline VOID -ConvertCopy( - _Out_ FLOAT& dst, - _In_ FLOAT src - ) -{ - dst = src; -} - -/*++ - -Routine Name: - - ConvertCopy - -Routine Description: - - Inline function that converts a src channel data type to a destination - of another type. This overload converts S2DOT13FIXED to FLOAT - -Arguments: - - dst - Destination value to be set - src - Source value - -Return Value: - - None - ---*/ -inline VOID -ConvertCopy( - _Out_ FLOAT& dst, - _In_ S2DOT13FIXED src - ) -{ - if (src.val & kS2Dot13Neg) - { - dst = -static_cast<FLOAT>(src.val^kS2Dot13Neg)/kS2Dot13One; - } - else - { - dst = static_cast<FLOAT>(src.val)/kS2Dot13One; - } -} - -/*++ - -Routine Name: - - ConvertCopy - -Routine Description: - - Inline function that converts a src channel data type to a destination - of another type. This overload converts BYTE to S2DOT13FIXED - -Arguments: - - dst - Destination value to be set - src - Source value - -Return Value: - - None - ---*/ -inline VOID -ConvertCopy( - _Out_ S2DOT13FIXED& dst, - _In_ BYTE src - ) -{ - dst.val = static_cast<WORD>(MulDiv(kS2Dot13One, src, 0xFF)); -} - -/*++ - -Routine Name: - - ConvertCopy - -Routine Description: - - Inline function that converts a src channel data type to a destination - of another type. This overload converts WORD to S2DOT13FIXED - -Arguments: - - dst - Destination value to be set - src - Source value - -Return Value: - - None - ---*/ -inline VOID -ConvertCopy( - _Out_ S2DOT13FIXED& dst, - _In_ WORD src - ) -{ - dst.val = static_cast<WORD>(MulDiv(kS2Dot13One, src, 0xFFFF)); -} - -/*++ - -Routine Name: - - ConvertCopy - -Routine Description: - - Inline function that converts a src channel data type to a destination - of another type. This overload converts FLOAT to S2DOT13FIXED - -Arguments: - - dst - Destination value to be set - src - Source value - -Return Value: - - None - ---*/ -inline VOID -ConvertCopy( - _Out_ S2DOT13FIXED& dst, - _In_ FLOAT src - ) -{ - if (src < -4.0f) - { - dst.val = kS2Dot13Min; - } - else if (src > 4.0f) - { - dst.val = kS2Dot13Max; - } - else - { - dst.val = static_cast<WORD>(src * kS2Dot13One); - } -} - -/*++ - -Routine Name: - - ConvertCopy - -Routine Description: - - Inline function that converts a src channel data type to a destination - of another type. This overload converts S2DOT13FIXED to S2DOT13FIXED - -Arguments: - - dst - Destination value to be set - src - Source value - -Return Value: - - None - ---*/ -inline VOID -ConvertCopy( - _Out_ S2DOT13FIXED& dst, - _In_ S2DOT13FIXED src - ) -{ - dst = src; -} - diff --git a/print/XPSDrvSmpl/src/filters/color/cmflt.cpp b/print/XPSDrvSmpl/src/filters/color/cmflt.cpp deleted file mode 100644 index 303cef2a..00000000 --- a/print/XPSDrvSmpl/src/filters/color/cmflt.cpp +++ /dev/null @@ -1,264 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - cmflt.cpp - -Abstract: - - Color management filter implementation. This class derives from the Xps filter - class and implements the necessary part handlers to support color management. - The color management filter is responsible for adding and removing resources to - and from the XPS document and putting the appropriate mark-up onto pages when applying - a color transform. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "pthndlr.h" -#include "cmflt.h" -#include "cmsax.h" -#include "colconv.h" -#include "cmpthndlr.h" -#include "cmintpthndlr.h" -#include "cmprofpthndlr.h" - -using XDPrintSchema::PageColorManagement::ColorManagementData; -using XDPrintSchema::PageColorManagement::Driver; - -using XDPrintSchema::PageSourceColorProfile::PageSourceColorProfileData; - -using XDPrintSchema::PageICMRenderingIntent::PageICMRenderingIntentData; - -/*++ - -Routine Name: - - CColorManageFilter::CColorManageFilter - -Routine Description: - - Default constructor for the color management filter which ensures GDI plus is correctly running - -Arguments: - - None - -Return Value: - - None - ---*/ -CColorManageFilter::CColorManageFilter() -{ -} - -/*++ - -Routine Name: - - CColorManageFilter::~CColorManageFilter - -Routine Description: - - Default destructor for the color management filter - -Arguments: - - None - -Return Value: - - None - ---*/ -CColorManageFilter::~CColorManageFilter() -{ -} - -/*++ - -Routine Name: - - CColorManageFilter::ProcessPart - -Routine Description: - - Method for processing each fixed page part in a container - -Arguments: - - pFP - Pointer to the fixed page to process - -Return Value: - - HRESULT - S_OK - On success - S_FALSE - When not enabled in the PT - E_* - On error - ---*/ -HRESULT -CColorManageFilter::ProcessPart( - _Inout_ IFixedPage* pFP - ) -{ - VERBOSE("Processing Fixed Page part with color management handler\n"); - - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pFP, E_POINTER))) - { - // - // Get the PT manager to return the correct ticket. Use a regular pointer - // to retrieve the ticket and assign to the smart pointer to increment - // ref count (we don't want our smart pointer to release the PT before - // the PT manager is finished with it) - // - IXMLDOMDocument2* pPT = NULL; - if (SUCCEEDED(hr = m_ptManager.SetTicket(pFP)) && - SUCCEEDED(hr = m_ptManager.GetTicket(kPTPageScope, &pPT))) - { - try - { - // - // Get data from PT handler and test if we are color matching - // - ColorManagementData cmData; - CColorManagePTHandler cmPTHandler(pPT); - - PageSourceColorProfileData cmProfData; - CColorManageProfilePTHandler profPTHandler(pPT); - - PageICMRenderingIntentData cmIntData; - CColorManageIntentsPTHandler ptIntentsHandler(pPT); - - CComVariant varName; - - if (SUCCEEDED(hr = m_pPrintPropertyBag->GetProperty(XPS_FP_PRINTER_NAME, &varName)) && - SUCCEEDED(hr = cmPTHandler.GetData(&cmData)) && - SUCCEEDED(hr = profPTHandler.GetData(&cmProfData))) - { - hr = ptIntentsHandler.GetData(&cmIntData); - } - - if (SUCCEEDED(hr) && - cmData.cmOption == Driver && - cmProfData.cmProfileName.Length() > 0) - { - // - // Retrieve the writer from the fixed page - // - CComPtr<IPrintWriteStream> pWriter(NULL); - - // - // Create a map of the resources that need to be cleaned up after the page - // has been processed. These are bitmaps that have been replaced with color - // matched equivalents and any icc profiles that have been consumed while - // color matching. - // - ResDeleteMap resDel; - - if (SUCCEEDED(hr = pFP->GetWriteStream(&pWriter))) - { - // - // Set-up the SAX reader and begin parsing the mark-up - // - CComPtr<ISAXXMLReader> pSaxRdr(NULL); - CComPtr<IPrintReadStream> pReader(NULL); - - // - // Create a profile manager which handles working with the selected profile - // - CProfileManager profManager(varName.bstrVal, cmProfData, cmIntData, pFP); - - // - // Create two color converter objects which coordinate color transforms for - // bitmaps and color mark-up strings - // - CBitmapColorConverter cmBmpConverter(m_pXDWriter, pFP, &m_resCache, &profManager, &resDel); - CColorRefConverter cmRefConverter(m_pXDWriter, pFP, &m_resCache, &profManager, &resDel); - CResourceDictionaryConverter cmDictConverter(m_pXDWriter, - pFP, - &m_resCache, - &profManager, - &resDel, - &cmBmpConverter, - &cmRefConverter); - - // - // Create a SAX handler to parse the markup in the fixed page - // - CCMSaxHandler cmSaxHndlr(pWriter, &cmBmpConverter, &cmRefConverter, &cmDictConverter); - - if (SUCCEEDED(hr = pSaxRdr.CoCreateInstance(CLSID_SAXXMLReader60)) && - SUCCEEDED(hr = pSaxRdr->putContentHandler(&cmSaxHndlr)) && - SUCCEEDED(hr = pFP->GetStream(&pReader))) - { - CComPtr<ISequentialStream> pReadStreamToSeq(NULL); - - pReadStreamToSeq.Attach(new(std::nothrow) pfp::PrintReadStreamToSeqStream(pReader)); - - if (SUCCEEDED(hr = CHECK_POINTER(pReadStreamToSeq, E_OUTOFMEMORY))) - { - hr = pSaxRdr->parse(CComVariant(static_cast<ISequentialStream*>(pReadStreamToSeq))); - } - } - - pWriter->Close(); - } - - if (SUCCEEDED(hr)) - { - // - // We have parsed the entire page - it should be safe to delete - // all unrequired resources - // - ResDeleteMap::const_iterator iterRes = resDel.begin(); - - for (;iterRes != resDel.end(); iterRes++) - { - hr = pFP->DeleteResource(iterRes->first); - } - } - } - else if (hr == E_ELEMENT_NOT_FOUND) - { - hr = S_FALSE; - } - } - catch (CXDException& e) - { - hr = e; - } - catch (...) - { - hr = E_FAIL; - } - } - } - - if (SUCCEEDED(hr)) - { - // - // We can send the fixed page - // - hr = m_pXDWriter->SendFixedPage(pFP); - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/color/cmflt.h b/print/XPSDrvSmpl/src/filters/color/cmflt.h deleted file mode 100644 index 02c44853..00000000 --- a/print/XPSDrvSmpl/src/filters/color/cmflt.h +++ /dev/null @@ -1,51 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - cmflt.h - -Abstract: - - Implementation of the color management filter which handles page parts from the - XPS document container. - ---*/ - -#pragma once - -#include "xdrchflt.h" -#include "ptmanage.h" - -typedef map<CStringXDW, BOOL> ResDeleteMap; - -class CColorManageFilter : public CXDXpsFilter -{ -public: - CColorManageFilter(); - - virtual ~CColorManageFilter(); - -private: - virtual HRESULT - ProcessPart( - _Inout_ IFixedPage* pFP - ); - -private: - - // - // Create a resource cache object to manage the storage of bitmaps and - // color profiles in the container - // - CFileResourceCache m_resCache; -}; - diff --git a/print/XPSDrvSmpl/src/filters/color/cmflt.rc b/print/XPSDrvSmpl/src/filters/color/cmflt.rc deleted file mode 100644 index 19ae3e89..00000000 --- a/print/XPSDrvSmpl/src/filters/color/cmflt.rc +++ /dev/null @@ -1,43 +0,0 @@ -// -// Copyright (c) 2005 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. -// -// File Name: -// -// cmflt.rc -// -// Abstract: -// -// Color filter resource file. -// -// - -#include <winres.h> -#include <ntverp.h> - -#define VER_FILETYPE VFT_DLL -#define VER_FILESUBTYPE VFT2_UNKNOWN -#define VER_FILEDESCRIPTION_STR "XPSDrv Sample Color Filter" -#define VER_INTERNALNAME_STR "PrintFeatureFilters" - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -#endif // English (U.S.) resources - -///////////////////////////////////////////////////////////////////////////// - -#include "common.ver" - diff --git a/print/XPSDrvSmpl/src/filters/color/cmimg.cpp b/print/XPSDrvSmpl/src/filters/color/cmimg.cpp deleted file mode 100644 index 6c312629..00000000 --- a/print/XPSDrvSmpl/src/filters/color/cmimg.cpp +++ /dev/null @@ -1,856 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - cmimg.cpp - -Abstract: - - Color managed image implementation. The CColorManagedImage class is responsible - for managing the image resource for a stored bitmap. This implements - the IResWriter interface so that the font can be added to the resource - cache. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "xdexcept.h" -#include "cmimg.h" -#include "streamcnv.h" - -using XDPrintSchema::PageSourceColorProfile::EProfileOption; -using XDPrintSchema::PageSourceColorProfile::RGB; -using XDPrintSchema::PageSourceColorProfile::CMYK; - -/*++ - -Routine Name: - - CColorManagedImage::CColorManagedImage - -Routine Description: - - Constructor for the CColorManagedImage class which registers internally the - supplied resource URI and a pointer to the profile manager which will supply - suitable color transforms to apply to that resource - -Arguments: - - bstrResURI - String containing the URI to the resource to be handled - pProfManager - Pointer to a profile manager which will supply suitable - transforms to apply to the supplied resource - -Return Value: - - None - Throws CXDException(HRESULT) on an error - ---*/ -CColorManagedImage::CColorManagedImage( - _In_ BSTR bstrResURI, - _In_ CProfileManager* pProfManager, - _In_ IFixedPage* pFixedPage, - _In_ ResDeleteMap* pResDel - ) : - m_pProfManager(pProfManager), - m_pFixedPage(pFixedPage), - m_bstrSrcProfileURI(NULL), - m_pResDel(pResDel) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pProfManager, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(m_pFixedPage, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(m_pResDel, E_POINTER))) - { - if (SysStringLen(bstrResURI) <= 0) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - CComBSTR bstrAttribute(bstrResURI); - - if (bstrAttribute.Length() == 0) - { - hr = E_INVALIDARG; - } - else - { - try - { - // - // Process the mark-up looking for the bitmap URI and any associated profiles - // - CStringXDW cstrAttribute(bstrResURI); - CStringXDW cstrColConvBMP(L"{ColorConvertedBitmap "); - - cstrAttribute.Trim(); - INT cchFind = cstrAttribute.Find(cstrColConvBMP); - - if (cchFind == -1) - { - // - // The mark-up is the bitmap URI - // - cstrAttribute.Trim(); - m_bstrBitmapURI.Empty(); - m_bstrBitmapURI.Attach(cstrAttribute.AllocSysString()); - } - else - { - // - // The mark-up is specifying a profile associated with the image. - // Extract the path and set this in the profile manager. The markup takes - // the form "{ColorConvertedBitmap image.ext profile.icc}". - // - - // - // Delete leading string "{ColorConvertedBitmap " and the trailing "}" - // - cstrAttribute.Delete(0, cstrColConvBMP.GetLength()); - cstrAttribute.Delete(cstrAttribute.GetLength() - 1, 1); - cstrAttribute.Trim(); - - // - // Find the seperating space - // - cchFind = cstrAttribute.Find(L" "); - - // - // Construct the bitmap URI - // - m_bstrBitmapURI.Empty(); - m_bstrBitmapURI.Attach(cstrAttribute.Left(cchFind).AllocSysString()); - - // - // Delete the bitmap URI and space leaving the profile URI - // - cstrAttribute.Delete(0, cchFind+1); - - m_bstrSrcProfileURI.Empty(); - m_bstrSrcProfileURI.Attach(cstrAttribute.AllocSysString()); - } - } - catch (CXDException& e) - { - hr = e; - } - } - } - - if (FAILED(hr)) - { - throw CXDException(hr); - } -} - -/*++ - -Routine Name: - - CColorManagedImage::~CColorManagedImage - -Routine Description: - - Default destructor for the CColorManagedImage class - -Arguments: - - None - -Return Value: - - None - ---*/ -CColorManagedImage::~CColorManagedImage() -{ -} - -/*++ - -Routine Name: - - CColorManagedImage::WriteData - -Routine Description: - - This method handles the decoding of a bitmap, the colour - translation applied to the bitmap and the re-encoding of the bitmap - -Arguments: - - pStream - Pointer to a stream to write the resource out to - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorManagedImage::WriteData( - _In_ IPartBase* pResource, - _In_ IPrintWriteStream* pStream - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pResource, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pStream, E_POINTER))) - { - try - { - CComPtr<IUnknown> pRead(NULL); - CComPtr<IPartImage> pImagePart(NULL); - CComPtr<IPrintReadStream> pImageStream(NULL); - - // - // Load the bitmap into memory and create a stream to read the bitmap from - // - if (SUCCEEDED(hr = m_pFixedPage->GetPagePart(m_bstrBitmapURI, &pRead)) && - SUCCEEDED(hr = pRead.QueryInterface(&pImagePart)) && - SUCCEEDED(hr = pImagePart->GetStream(&pImageStream))) - { - BOOL bApplyTransform = FALSE; - CComPtr<IStream> pInputImageStream(NULL); - - EWICPixelFormat eDstPixFormat = kWICPixelFormatDontCare; - UINT cDstWidth = 0; - UINT cDstHeight = 0; - DOUBLE dpiDstX = 0.0; - DOUBLE dpiDstY = 0.0; - - EProfileOption eProfileOption = RGB; - - // - // Set up the source and destination bitmaps so they are ready for use by TranslateBitmapBits - // - pInputImageStream.Attach(new(std::nothrow) CPrintReadStreamToIStream(pImageStream)); - if (SUCCEEDED(hr = CHECK_POINTER(pInputImageStream, E_OUTOFMEMORY)) && - SUCCEEDED(hr = m_srcBmp.Initialize(pInputImageStream)) && - SUCCEEDED(hr = m_srcBmp.GetSize(&cDstWidth, &cDstHeight)) && - SUCCEEDED(hr = m_srcBmp.GetResolution(&dpiDstX, &dpiDstY)) && - SUCCEEDED(hr = m_pProfManager->GetProfileOption(&eProfileOption))) - { - // - // The destination bitmap format can be one of: - // - // kWICPixelFormat128bppRGBFloat - scRGB output - // kWICPixelFormat128bppRGBAFloat - scRGB output with a source alpha channel - // kWICPixelFormat64bppCMYK - CMYK output - // kWICPixelFormat80bppCMYKAlpha - CMYK output with a source alpha channel - // - BOOL bScRGBOut = FALSE; - switch (eProfileOption) - { - case RGB: - { - eDstPixFormat = m_srcBmp.HasAlphaChannel() ? kWICPixelFormat128bppRGBAFloat : kWICPixelFormat128bppRGBFloat; - bScRGBOut = TRUE; - } - break; - - case CMYK: - { - eDstPixFormat = m_srcBmp.HasAlphaChannel() ? kWICPixelFormat40bppCMYKAlpha : kWICPixelFormat32bppCMYK; - } - break; - - default: - { - RIP("Unrecognised destination profile option.\n"); - - hr = E_FAIL; - } - break; - } - - if (SUCCEEDED(hr)) - { - // - // If the input is scRGB and the output is scRGB just pass through the bitmap - // Note: This should be optimised we do not write out a new bitmap but use the original - // - if (eDstPixFormat == m_srcBmp.GetPixelFormat() && - bScRGBOut) - { - m_dstBmp = m_srcBmp; - } - else if (SUCCEEDED(hr = m_dstBmp.Initialize(eDstPixFormat, cDstWidth, cDstHeight, dpiDstX, dpiDstY))) - { - bApplyTransform = TRUE; - } - } - } - - // - // Process the source and destination bitmaps a scanline at a time if the output image - // is still not set - // - if (SUCCEEDED(hr) && - bApplyTransform) - { - // - // Create scanline iterator objects from the source and destination bitmaps - // - CScanIterator srcIter(m_srcBmp, NULL); - CScanIterator dstIter(m_dstBmp, NULL); - - // - // Initialize the iterators, set the source profile and transform the scanlines - // - if (SUCCEEDED(hr = srcIter.Initialize(TRUE)) && - SUCCEEDED(hr = dstIter.Initialize(FALSE)) && - SUCCEEDED(hr = SetSrcProfile(&srcIter)) && - SUCCEEDED(hr = TransformScanLines(&srcIter, &dstIter))) - { - // - // CMYK output requires an embedded profile - // - CComBSTR bstrProfile; - if (eProfileOption == CMYK && - SUCCEEDED(hr = m_pProfManager->GetDstProfileName(&bstrProfile))) - { - hr = dstIter.SetProfile(bstrProfile); - } - } - - if (SUCCEEDED(hr)) - { - m_dstBmp = dstIter; - } - - // - // If there's a problem loading a suitable source profile, just pass - // the bitmap through unmodified - // - if (hr == HRESULT_FROM_WIN32(ERROR_PROFILE_NOT_FOUND)) - { - bApplyTransform = FALSE; - m_dstBmp = m_srcBmp; - hr = S_OK; - } - } - - if (SUCCEEDED(hr)) - { - // - // Create a write stream to accept the converted bitmap, fill from the output bitmap - // and write to the output stream (after ensuring the stream is pointing to the start). - // - CComPtr<IStream> pOutputImageStream(NULL); - - LARGE_INTEGER cbMoveFromStart = {0}; - - PBYTE pBuff = new(std::nothrow) BYTE[CB_COPY_BUFFER]; - - if (SUCCEEDED(hr = CHECK_POINTER(pBuff, E_OUTOFMEMORY)) && - SUCCEEDED(hr = CreateStreamOnHGlobal(NULL, TRUE, &pOutputImageStream)) && - SUCCEEDED(hr = m_dstBmp.Write(GUID_ContainerFormatWmp, pOutputImageStream)) && - SUCCEEDED(hr = pOutputImageStream->Seek(cbMoveFromStart, STREAM_SEEK_SET, NULL))) - { - ULONG cbRead = 0; - ULONG cbWritten = 0; - - while (SUCCEEDED(hr) && - SUCCEEDED(hr = pOutputImageStream->Read(pBuff, CB_COPY_BUFFER, &cbRead)) && - cbRead > 0) - { - hr = pStream->WriteBytes(pBuff, cbRead, &cbWritten); - ASSERTMSG(cbRead == cbWritten, "Failed to write all data.\n"); - } - } - - if (pBuff != NULL) - { - delete[] pBuff; - pBuff = NULL; - } - } - - // - // Set the content type of the image part - // - CComQIPtr<IPartImage> pImage = pResource; - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_POINTER(pImage, E_NOINTERFACE))) - { - hr = pImage->SetImageContent(CComBSTR(L"image/vnd.ms-photo")); - } - - // - // If all is well mark the replaced bitmap and profile for deletion - // - if (SUCCEEDED(hr)) - { - (*m_pResDel)[m_bstrBitmapURI.m_str] = TRUE; - - if (m_bstrSrcProfileURI.Length() > 0) - { - (*m_pResDel)[m_bstrSrcProfileURI.m_str] = TRUE; - } - } - } - } - catch (CXDException& e) - { - hr = e; - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorManagedImage::GetKeyName - -Routine Description: - - Method to obtain a unique key for the resource being handled - -Arguments: - - pbstrKeyName - Pointer to a string to hold the generated key - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorManagedImage::GetKeyName( - _Outptr_ BSTR* pbstrKeyName - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrKeyName, E_POINTER))) - { - if (m_bstrBitmapURI.Length() > 0) - { - *pbstrKeyName = NULL; - - // - // The full URI to the bitmap resource concatenated with any associated - // profile is a suitable key - // - try - { - CStringXDW cstrKey(m_bstrBitmapURI); - cstrKey += m_bstrSrcProfileURI; - - *pbstrKeyName = cstrKey.AllocSysString(); - } - catch (CXDException& e) - { - hr = e; - } - } - else - { - hr = E_PENDING; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorManagedImage::GetResURI - -Routine Description: - - Method to obtain the URI of the resource being handled - -Arguments: - - pbstrResURI - Pointer to a string to hold the resource URI - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorManagedImage::GetResURI( - _Outptr_ BSTR* pbstrResURI - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrResURI, E_POINTER))) - { - *pbstrResURI = NULL; - - if (m_bstrBitmapURI.Length() > 0) - { - try - { - // - // Create a URI from the original bitmap URI and the current tick count - // - CStringXDW cstrFileName(m_bstrBitmapURI); - CStringXDW cstrFileExt(PathFindExtension(cstrFileName)); - - INT indFileExt = cstrFileName.Find(cstrFileExt); - - if (indFileExt > -1) - { - cstrFileName.Delete(indFileExt, cstrFileExt.GetLength()); - } - - // - // Create a unique name for the bitmap for this print session - // - CStringXDW cstrURI; - cstrURI.Format(L"%s_%u.wdp", static_cast<LPCWSTR>(cstrFileName), GetUniqueNumber()); - - SysFreeString(*pbstrResURI); - *pbstrResURI = cstrURI.AllocSysString(); - } - catch (CXDException& e) - { - hr = e; - } - } - else - { - hr = E_PENDING; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorManagedImage::SetSrcProfile - -Routine Description: - - Method to set the source color profile given a particular source bitmap - -Arguments: - - pSrcBmp - Pointer to the source bitmap - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorManagedImage::SetSrcProfile( - _In_ CBmpConverter* pSrcBmp - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pSrcBmp, E_POINTER))) - { - // - // Update the source profile based on the source bitmap. The source profile - // is set according to the following rules: - // - // If the profile is specified in the ImageSource mark-up - // Use the profile in the container - // Else If the profile is embeded - // Use the embedded profile - // Else - // If the profile is RGB <= 16 bpc - // Use sRGB profile as source - // Else if the profile is RGB > 16 bpc - // Use scRGB profile as source - // Else if the profile is CMYK - // Use SWOP profile as source - // - if (m_bstrSrcProfileURI.Length() > 0) - { - // - // The mark-up references a profile in the XPS document - get the profile manager - // to extract it and set as the source profile - // - hr = m_pProfManager->SetSrcProfileFromContainer(m_bstrSrcProfileURI); - } - else if (pSrcBmp->HasColorProfile()) - { - IWICColorContext* pSrcContext = NULL; - - UINT cbBuffer = 0; - PBYTE pBuffer = NULL; - UINT cbActual = 0; - - // - // We have a profile embedded in the bitmap - extract and set as the source profile - // - if (SUCCEEDED(hr = pSrcBmp->GetColorContext(&pSrcContext)) && - SUCCEEDED(hr = pSrcContext->GetProfileBytes(cbBuffer, pBuffer, &cbActual))) - { - if (cbActual > 0) - { - pBuffer = new(std::nothrow) BYTE[cbActual]; - cbBuffer = cbActual; - - // - // The annotation on IWICColorContext::GetProfileBytes requires that the buffer - // be initialized. - // - - if (SUCCEEDED(hr = CHECK_POINTER(pBuffer, E_OUTOFMEMORY))) - { - ::memset(pBuffer, 0, cbBuffer); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = pSrcContext->GetProfileBytes(cbBuffer, pBuffer, &cbActual))) - { - // - // Set the source profile in the profile manager. Note: in this instance the profile name is - // no used to load the profile, merely to cache the profile. The bitmap URI uniquely idenitifies - // the bitmap and hence the embedded profile and is appropriate as a cache name - // - hr = m_pProfManager->SetSrcProfileFromBuffer(m_bstrBitmapURI, pBuffer, cbBuffer); - } - - if (pBuffer != NULL) - { - delete[] pBuffer; - pBuffer = NULL; - } - } - else - { - RIP("Zero length profile.\n"); - hr = E_FAIL; - } - } - } - else - { - // - // Deduce the source profile from the source bitmap format - // - switch (pSrcBmp->GetPixelFormat()) - { - case kWICPixelFormatDontCare: - case kWICPixelFormat1bppIndexed: - case kWICPixelFormat2bppIndexed: - case kWICPixelFormat4bppIndexed: - case kWICPixelFormat8bppIndexed: - case kWICPixelFormatBlackWhite: - case kWICPixelFormat2bppGray: - case kWICPixelFormat4bppGray: - case kWICPixelFormat8bppGray: - case kWICPixelFormat16bppBGR555: - case kWICPixelFormat16bppBGR565: - case kWICPixelFormat16bppGray: - case kWICPixelFormat24bppBGR: - case kWICPixelFormat24bppRGB: - case kWICPixelFormat32bppBGR: - case kWICPixelFormat32bppBGRA: - case kWICPixelFormat32bppPBGRA: - case kWICPixelFormat32bppBGR101010: - case kWICPixelFormat48bppRGB: - case kWICPixelFormat64bppRGBA: - case kWICPixelFormat64bppPRGBA: - { - hr = m_pProfManager->SetSrcProfileFromColDir(L"sRGB Color Space Profile.icm"); - } - break; - - case kWICPixelFormat48bppRGBFixedPoint: - case kWICPixelFormat96bppRGBFixedPoint: - case kWICPixelFormat128bppRGBAFloat: - case kWICPixelFormat128bppPRGBAFloat: - case kWICPixelFormat128bppRGBFloat: - case kWICPixelFormat64bppRGBAFixedPoint: - case kWICPixelFormat64bppRGBFixedPoint: - case kWICPixelFormat128bppRGBAFixedPoint: - case kWICPixelFormat128bppRGBFixedPoint: - case kWICPixelFormat64bppRGBAHalf: - case kWICPixelFormat64bppRGBHalf: - case kWICPixelFormat48bppRGBHalf: - case kWICPixelFormat32bppRGBE: - case kWICPixelFormat16bppGrayHalf: - case kWICPixelFormat32bppGrayFloat: - case kWICPixelFormat32bppGrayFixedPoint: - case kWICPixelFormat16bppGrayFixedPoint: - { - hr = m_pProfManager->SetSrcProfileFromColDir(L"xdwscRGB.icc"); - } - break; - - case kWICPixelFormat32bppCMYK: - case kWICPixelFormat64bppCMYK: - case kWICPixelFormat40bppCMYKAlpha: - case kWICPixelFormat80bppCMYKAlpha: - { - hr = m_pProfManager->SetSrcProfileFromColDir(L"xdCMYKPrinter.icc"); - } - break; - - default: - { - RIP("No acceptable default profile.\n"); - - hr = HRESULT_FROM_WIN32(ERROR_PROFILE_NOT_FOUND); - } - break; - } - } - } - - ERR_ON_HR(hr); - return hr; -} - - -/*++ - -Routine Name: - - CColorManagedImage::TransformScanLines - -Routine Description: - - Given source and destination scanline iterators, this method applies the - requiresite color transform - -Arguments: - - pSrcScans - Pointer to the source scanline iterator - pDstScans - Pointer to the destination scanline iterator - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorManagedImage::TransformScanLines( - _In_ CScanIterator* pSrcScans, - _In_ CScanIterator* pDstScans - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pSrcScans, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pDstScans, E_POINTER))) - { - try - { - // - // Apply the transform - // - HTRANSFORM hTransform = NULL; - BOOL bCanUseWCS = FALSE; - - if (SUCCEEDED(hr = m_pProfManager->GetColorTransform(&hTransform, &bCanUseWCS))) - { - PBYTE pDstData = NULL; - BMFORMAT bmSrcFormat; - UINT cSrcWidth = 0; - UINT cSrcHeight = 0; - UINT cbSrcStride = 0; - - PBYTE pSrcData = NULL; - BMFORMAT bmDstFormat; - UINT cDstWidth = 0; - UINT cDstHeight = 0; - UINT cbDstStride = 0; - - // - // While the source andd destination have scanlines remaining to process... - // - while (!pDstScans->Finished() && - !pSrcScans->Finished() && - SUCCEEDED(hr)) - { - // - // ...retrieve the scan buffers (these may have been processed to remove alpha data)... - // - if (SUCCEEDED(hr = pSrcScans->GetScanBuffer(&pSrcData, &bmSrcFormat, &cSrcWidth, &cSrcHeight, &cbSrcStride)) && - SUCCEEDED(hr = pDstScans->GetScanBuffer(&pDstData, &bmDstFormat, &cDstWidth, &cDstHeight, &cbDstStride))) - { - // - // ...translate the scanline data... - // - if (TranslateBitmapBits(hTransform, - pSrcData, - bmSrcFormat, - cSrcWidth, - cSrcHeight, - cbSrcStride, - pDstData, - bmDstFormat, - cbDstStride, - NULL, - 0)) - { - // - // ...and commit the data to the destination bitmap before incrementing to the next scanline. - // - hr = pDstScans->Commit(*pSrcScans); - (*pSrcScans)++; - (*pDstScans)++; - } - else - { - RIP("Translate bitmap bits failed.\n"); - hr = GetLastErrorAsHResult(); - } - } - } - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/color/cmimg.h b/print/XPSDrvSmpl/src/filters/color/cmimg.h deleted file mode 100644 index 397c3678..00000000 --- a/print/XPSDrvSmpl/src/filters/color/cmimg.h +++ /dev/null @@ -1,87 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - cmimg.h - -Abstract: - - Color management image definition. The CColorManagedImage class is responsible - for managing the image resources used in a container. This implements - the IResWriter interface so that the font can be added to the resource - cache. - ---*/ - -#pragma once - -#include "rescache.h" -#include "profman.h" -#include "scaniter.h" -#include "cmflt.h" - -class CColorManagedImage : public IResWriter -{ -public: - CColorManagedImage( - _In_ BSTR bstrResURI, - _In_ CProfileManager* pProfManager, - _In_ IFixedPage* pFixedPage, - _In_ ResDeleteMap* pResDel - ); - - ~CColorManagedImage(); - - HRESULT - WriteData( - _In_ IPartBase* pResource, - _In_ IPrintWriteStream* pStream - ); - - HRESULT - GetKeyName( - _Outptr_ BSTR* pbstrKeyName - ); - - HRESULT - GetResURI( - _Outptr_ BSTR* pbstrResURI - ); - -private: - HRESULT - SetSrcProfile( - _In_ CBmpConverter* pScanIter - ); - - HRESULT - TransformScanLines( - _In_ CScanIterator* pSrcScans, - _In_ CScanIterator* pDstScans - ); - -private: - CComBSTR m_bstrBitmapURI; - - CComBSTR m_bstrSrcProfileURI; - - CProfileManager* m_pProfManager; - - CBmpConverter m_srcBmp; - - CBmpConverter m_dstBmp; - - CComPtr<IFixedPage> m_pFixedPage; - - ResDeleteMap* m_pResDel; -}; - diff --git a/print/XPSDrvSmpl/src/filters/color/cmsax.cpp b/print/XPSDrvSmpl/src/filters/color/cmsax.cpp deleted file mode 100644 index f5db86dd..00000000 --- a/print/XPSDrvSmpl/src/filters/color/cmsax.cpp +++ /dev/null @@ -1,440 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - cmsax.cpp - -Abstract: - - Color managed image SAX handler implementation. The CCMSaxHandler class is responsible - for handling the XML markup in the container. - - Note regarding opacity masks: Ideally we would like to avoid color matching whilst - within an opacity mask element as only the alpha channel is of interest. This is - complicated however by the fact that the opacity mask resources my be re-used as - rendering resources. Ideally we would color match opacity mask elements only when - the resources are shared with other rendering operations. This is difficult to - achieve with SAX however as we do not know a priori if the resource is shared or - the resource is going to be shared. - Currently we are performing unnecessary color matching when an opacity mask is - encountered. We could alternatively ensure opacity mask resources are preserved and - other render sources are modified and written as new resources. The trade off is - reduced speed performance against added resource handling complexity and XPS - content bloat. This implementation takes the first option which trades processing time - against the amount of data written to the container and resource handling complexity. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "cmsax.h" - -/*++ - -Routine Name: - - CCMSaxHandler::CCMSaxHandler - -Routine Description: - - Contructor for the color management filters SAX handler. - The constructor registers a writer for sending new markup out to and a color - converter object which handles any color conversion work for those markup - elements containing color data. - -Arguments: - - pWriter - Pointer to a write stream which receives markup - pConverter - Pointer to a color converter object which handles any - color conversion work for elements containing color data - -Return Value: - - None - Throws CXDException(HRESULT) on an error - ---*/ -CCMSaxHandler::CCMSaxHandler( - _In_ IPrintWriteStream* pWriter, - _In_ CBitmapColorConverter* pBmpConverter, - _In_ CColorRefConverter* pRefConverter, - _In_opt_ CResourceDictionaryConverter* pDictConverter - ) : - m_pWriter(pWriter), - m_bOpenTag(FALSE), - m_pBmpConv(pBmpConverter), - m_pRefConv(pRefConverter), - m_pDictConv(pDictConverter) -{ - ASSERTMSG(m_pWriter != NULL, "NULL writer passed to color SAX handler.\n"); - ASSERTMSG(m_pBmpConv != NULL, "NULL bitmap color converter passed to color SAX handler.\n"); - ASSERTMSG(m_pRefConv != NULL, "NULL color ref converter passed to color SAX handler.\n"); - - HRESULT hr = S_OK; - if (FAILED(hr = CHECK_POINTER(m_pWriter, E_POINTER)) || - FAILED(hr = CHECK_POINTER(m_pBmpConv, E_POINTER)) || - FAILED(hr = CHECK_POINTER(m_pRefConv, E_POINTER))) - { - throw CXDException(hr); - } -} - -/*++ - -Routine Name: - - CCMSaxHandler::~CCMSaxHandler - -Routine Description: - - Default destructor for the color management filters SAX handler - -Arguments: - - None - -Return Value: - - None - ---*/ -CCMSaxHandler::~CCMSaxHandler() -{ - m_bstrOpenElement.Empty(); -} - -/*++ - -Routine Name: - - CCMSaxHandler::startElement - -Routine Description: - - SAX handler method which handles each start element for the XML markup. - -Arguments: - - pwchQName - Pointer to a string containing the element name - cchQName - Count of the number of characters in the element name - pAttributes - Pointer to the attribute list for the supplied element - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT STDMETHODCALLTYPE -CCMSaxHandler::startElement( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - _In_reads_(cchQName) CONST wchar_t* pwchQName, - _In_ INT cchQName, - _In_ ISAXAttributes* pAttributes - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pwchQName, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pAttributes, E_POINTER))) - { - if (cchQName < 1) - { - hr = E_INVALIDARG; - } - } - - CStringXDW cstrOut; - if (SUCCEEDED(hr)) - { - try - { - CComBSTR bstrElement(cchQName, pwchQName); - - // - // Check if we need to close an opened tag - // - if (m_bOpenTag) - { - cstrOut.Append(L">"); - } - - // - // Store the opened element name so we can handle nested elements - // - m_bstrOpenElement = bstrElement; - - // - // Create output element - // - cstrOut.Append(L"<"); - cstrOut.Append(bstrElement); - - // - // We opened a tag - // - m_bOpenTag = TRUE; - - // - // Find the number of attributes and enumerate over all of them - // - INT cAttributes = 0; - if (SUCCEEDED(hr = pAttributes->getLength(&cAttributes))) - { - for (INT cIndex = 0; cIndex < cAttributes; cIndex++) - { - PCWSTR pszAttUri = NULL; - INT cchAttUri = 0; - PCWSTR pszAttName = NULL; - INT cchAttName = 0; - PCWSTR pszAttQName = NULL; - INT cchAttQName = 0; - PCWSTR pszAttValue = NULL; - INT cchAttValue = 0; - - // - // Get the attribute data ready to write out - // - if (SUCCEEDED(hr = pAttributes->getName(cIndex, - &pszAttUri, - &cchAttUri, - &pszAttName, - &cchAttName, - &pszAttQName, - &cchAttQName))) - { - if (SUCCEEDED(pAttributes->getValue(cIndex, &pszAttValue, &cchAttValue))) - { - CComBSTR bstrAttName(cchAttQName, pszAttQName); - CComBSTR bstrAttValue(cchAttValue, pszAttValue); - - if (bstrElement == L"ResourceDictionary" && - bstrAttName == L"Source") - { - // - // Convert remote resource dictionary - // - if (SUCCEEDED(hr = CHECK_POINTER(m_pDictConv, E_FAIL))) - { - hr = m_pDictConv->Convert(&bstrAttValue); - } - } - else - { - // - // Find all color refs and image sources. - // - if (bstrAttName == L"Color" || - bstrAttName == L"Fill" || - bstrAttName == L"Stroke" ) - { - // - // Process the value passing the colorref - // - hr = m_pRefConv->Convert(&bstrAttValue); - } - else if (bstrAttName == L"ImageSource") - { - // - // Process the value passing the URI - // - hr = m_pBmpConv->Convert(&bstrAttValue); - } - } - - // - // Delimit attributes with a space - // - cstrOut.Append(L" "); - - // - // Reconstruct the attribute and write back to - // the fixed page - // - cstrOut.Append(bstrAttName); - cstrOut.Append(L"=\""); - - // - // If this is a UnicodeString we may need to escape entities - // - if (bstrAttName == L"UnicodeString") - { - hr = EscapeEntity(&bstrAttValue); - } - - cstrOut.Append(bstrAttValue); - cstrOut.Append(L"\""); - } - } - } - } - } - catch (CXDException& e) - { - hr = e; - } - } - - if (SUCCEEDED(hr)) - { - hr = WriteToPrintStream(&cstrOut, m_pWriter); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CCMSaxHandler::endElement - -Routine Description: - - SAX handler method which handles each end element for the XML markup - -Arguments: - - pwchQName - Pointer to a string containing the element name - cchQName - Count of the number of characters in the element name - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT STDMETHODCALLTYPE -CCMSaxHandler::endElement( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - _In_reads_(cchQName) CONST wchar_t* pwchQName, - _In_ INT cchQName - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pwchQName, E_POINTER))) - { - if (cchQName < 1) - { - hr = E_INVALIDARG; - } - } - - CStringXDW cstrClose; - if (SUCCEEDED(hr)) - { - try - { - CComBSTR bstrElement(cchQName, pwchQName); - - // - // If this is a root element with child nodes, the open - // element will not match the last startElement. In this case - // we need to add an appropriate closing tag - // - if (bstrElement == m_bstrOpenElement) - { - // - // Names match so just add a closing bracket - // - // We might have closed the tag when writing a new element - // - if (m_bOpenTag) - { - cstrClose.Append(L"/>"); - } - } - else - { - // - // Add a clossing tag - // - cstrClose.Append(L"</"); - cstrClose.Append(bstrElement); - cstrClose.Append(L">"); - } - } - catch (CXDException& e) - { - hr = e; - } - } - - if (SUCCEEDED(hr)) - { - hr = WriteToPrintStream(&cstrClose, m_pWriter); - } - - m_bOpenTag = FALSE; - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CCMSaxHandler::startDocument - -Routine Description: - - SAX handler method which handles the start document call to ensure - the xml version is correctly set - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT STDMETHODCALLTYPE -CCMSaxHandler::startDocument( - void - ) -{ - HRESULT hr = S_OK; - - try - { - if (SUCCEEDED(hr = CHECK_POINTER(m_pWriter, E_FAIL))) - { - CStringXDW cstrOut(L"<?xml version=\"1.0\" encoding=\"utf-8\"?>"); - hr = WriteToPrintStream(&cstrOut, m_pWriter); - } - } - catch (CXDException& e) - { - hr = e; - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/color/cmsax.h b/print/XPSDrvSmpl/src/filters/color/cmsax.h deleted file mode 100644 index dc09f9d0..00000000 --- a/print/XPSDrvSmpl/src/filters/color/cmsax.h +++ /dev/null @@ -1,80 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - cmsax.h - -Abstract: - - Color management sax handler definition. The color management SAX handler - is responsible for parsing the FixedPage mark-up for and vector objects - or bitmaps which contain color data and altering the mark-up where appropriate. - ---*/ - -#pragma once - -#include "saxhndlr.h" -#include "colconv.h" - -class CCMSaxHandler : public CSaxHandler -{ -public: - CCMSaxHandler( - _In_ IPrintWriteStream* pWriter, - _In_ CBitmapColorConverter* pBmpConverter, - _In_ CColorRefConverter* pRefConverter, - _In_opt_ CResourceDictionaryConverter* pDictConverter - ); - - virtual ~CCMSaxHandler(); - - virtual HRESULT STDMETHODCALLTYPE - startElement( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - _In_reads_(cchQName) CONST wchar_t* pwchQName, - _In_ INT cchQName, - _In_ ISAXAttributes* pAttributes - ); - - virtual HRESULT STDMETHODCALLTYPE - endElement( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - _In_reads_(cchQName) CONST wchar_t* pwchQName, - _In_ INT cchQName - ); - - HRESULT STDMETHODCALLTYPE - startDocument( - void - ); - -private: - CComPtr<IPrintWriteStream> m_pWriter; - - CComBSTR m_bstrOpenElement; - - BOOL m_bOpenTag; - - CColorConverter* m_pBmpConv; - - CColorConverter* m_pRefConv; - - CColorConverter* m_pDictConv; -}; - diff --git a/print/XPSDrvSmpl/src/filters/color/colchan.cpp b/print/XPSDrvSmpl/src/filters/color/colchan.cpp deleted file mode 100644 index 2d98334f..00000000 --- a/print/XPSDrvSmpl/src/filters/color/colchan.cpp +++ /dev/null @@ -1,1883 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - colchan.cpp - -Abstract: - - Color channel class implementation. The color channel class is responsible for maintaining - simple single color multiple channel data intialised from color references in the XPS markup. - It provides methods for intialization, access and conversion of the data. - - Note regarding color formats: The CColorChannelData class is only used in the filter for - processing color references in mark-up. As such we only ever see 8 bit per channel sRGB and - floating point scRGB and n-channel colors and we only ever need convert to 16 bpc for - down-level scRGB conversion. If the CColorChannelData is ever used when fixed point input - or other output types are required then these formats need support added (see E_NOTIMPL - return values). - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdexcept.h" -#include "colchan.h" - -#define MAX_CHANNEL_COUNT 9 // 1 alpha channel and 8 color channels -#define MAX_CHANNEL_SIZE sizeof(FLOAT) - -DWORD g_cbChannelType[] = { - sizeof(BYTE), // COLOR_BYTE - sizeof(WORD), // COLOR_WORD - sizeof(FLOAT), // COLOR_FLOAT - sizeof(WORD) // COLOR_S2DOT13FIXED -}; - - -/*++ - -Routine Name: - - CColorChannelData::CColorChannelData - -Routine Description: - - CColorChannelData default constructor - -Arguments: - - None - -Return Value: - - None - Throws an exception on failure. - ---*/ -CColorChannelData::CColorChannelData() : - m_cChannels(0), - m_channelType(COLOR_BYTE), - m_pChannelData(NULL), - m_cbChannelData(0), - m_dataType(sRGB) -{ - if (FAILED(AllocateChannelBuffers(&m_cbChannelData, &m_pChannelData))) - { - throw CXDException(E_OUTOFMEMORY); - } -} - -/*++ - -Routine Name: - - CColorChannelData::~CColorChannelData - -Routine Description: - - CColorChannelData destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CColorChannelData::~CColorChannelData() -{ - FreeChannelBuffers(); -} - -/*++ - -Routine Name: - - CColorChannelData::AddChannelData - -Routine Description: - - Template method for adding channel data. This allows any of the available color - channel data types to be added to the channel data buffer - -Arguments: - - channelValue - Value for the channel to be added - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -template <class _T> -HRESULT -CColorChannelData::AddChannelData( - _In_ CONST _T& channelValue - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = ValidateDataSize<_T>())) - { - if (m_cChannels < MAX_CHANNEL_COUNT) - { - _T* pChannelData = reinterpret_cast<_T*>(m_pChannelData); - pChannelData[m_cChannels] = channelValue; - m_cChannels++; - } - else - { - hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorChannelData::GetChannelCount - -Routine Description: - - Retrieves the current number of channels defining the color. - -Arguments: - - pcChannels - Pointer to a variable that recieves the count of channels - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorChannelData::GetChannelCount( - _Out_ DWORD* pcChannels - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pcChannels, E_POINTER))) - { - *pcChannels = m_cChannels; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorChannelData::GetChannelCountNoAlpha - -Routine Description: - - Retrieves the number of channels less the alpha channel if present - -Arguments: - - pcChannels - Pointer to a variable that recieves the count of non-alpha channels - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorChannelData::GetChannelCountNoAlpha( - _Out_ DWORD* pcChannels - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = GetChannelCount(pcChannels))) - { - if (HasAlpha()) - { - (*pcChannels)--; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorChannelData::GetChannelType - -Routine Description: - - Retrieves the COLORDATATYPE for the channel data - -Arguments: - - pChannelType - Pointer to a COLORDATATYPE variable that recieves the type - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorChannelData::GetChannelType( - _Out_ COLORDATATYPE* pChannelType - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pChannelType, E_POINTER))) - { - *pChannelType = m_channelType; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorChannelData::ResetChannelType - -Routine Description: - - Resets the underlying channel data type to the requested type - -Arguments: - - channelType - The channel data type to reset to - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorChannelData::ResetChannelType( - _In_ CONST COLORDATATYPE& channelType - ) -{ - m_channelType = channelType; - m_cChannels = 0; - - return S_OK; -} - -/*++ - -Routine Name: - - CColorChannelData::GetChannelData - -Routine Description: - - Retrieves the buffer and count of bytes of the channel data - -Arguments: - - pcbDataSize - Pointer to variable that recieves the count of bytes in the buffer - ppData - Pointer to a BYTE pointer that recieves the buffer - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorChannelData::GetChannelData( - _Out_ DWORD* pcbDataSize, - _Out_ - _When_(*pcbDataSize > 0, _At_(*ppData, _Post_ _Readable_bytes_(*pcbDataSize))) - _When_(*pcbDataSize == 0, _At_(*ppData, _Post_ _Maybenull_)) - PVOID* ppData - ) -{ - HRESULT hr = S_OK; - - DWORD cbDataTypeSize = 0; - if (SUCCEEDED(hr = CHECK_POINTER(pcbDataSize, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(ppData, E_POINTER)) && - SUCCEEDED(hr = GetChannelSizeFromType(m_channelType, &cbDataTypeSize))) - { - *ppData = NULL; - *pcbDataSize = 0; - - if (m_cbChannelData >= m_cChannels * cbDataTypeSize) - { - if (m_cChannels > 0) - { - *pcbDataSize = m_cChannels * cbDataTypeSize; - *ppData = m_pChannelData; - } - } - else - { - hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorChannelData::GetChannelDataNoAlpha - -Routine Description: - - Retrieves the buffer and count of bytes of the channel data excluding the - alpha channel if present - -Arguments: - - pcbDataSize - Pointer to variable that recieves the count of bytes in the buffer - ppData - Pointer to a BYTE pointer that recieves the buffer - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorChannelData::GetChannelDataNoAlpha( - _Out_ DWORD* pcbDataSize, - _Out_ - _When_(*pcbDataSize > 0, _At_(*ppData, _Post_ _Readable_bytes_(*pcbDataSize))) - _When_(*pcbDataSize == 0, _At_(*ppData, _Post_ _Maybenull_)) - PVOID* ppData - ) -{ - HRESULT hr = S_OK; - - DWORD cbData = 0; - PBYTE pData = NULL; - - if (SUCCEEDED(hr = CHECK_POINTER(pcbDataSize, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(ppData, E_POINTER)) && - SUCCEEDED(hr = GetChannelData(&cbData, reinterpret_cast<PVOID*>(&pData)))) - { - *pcbDataSize = cbData; - *ppData = pData; - - if (HasAlpha()) - { - DWORD cbChannelSize = 0; - if (SUCCEEDED(hr = GetChannelSizeFromType(m_channelType, &cbChannelSize))) - { - if (cbData >= cbChannelSize) - { - *pcbDataSize = cbData - cbChannelSize; - *ppData = pData + cbChannelSize; - } - else - { - hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); - } - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorChannelData::ClampChannelValues - -Routine Description: - - Template method that recieves the minimum and maximum value for a channel - and applies this to all channels defining the color - -Arguments: - - min - Minimum channel value - max - Maximum channel value - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -template <class _T> -HRESULT -CColorChannelData::ClampChannelValues( - _In_ CONST _T& min, - _In_ CONST _T& max - ) -{ - HRESULT hr = S_OK; - - // - // Validate the data size against the current type - // - if (SUCCEEDED(hr = ValidateDataSize<_T>())) - { - _T* pData = reinterpret_cast<_T*>(m_pChannelData); - for (DWORD cChannel = 0; cChannel < m_cChannels; cChannel++, pData++) - { - if (*pData < min) - { - *pData = min; - } - else if (*pData > max) - { - *pData = max; - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorChannelData::InitializeChannelData - -Routine Description: - - Initializes the channel data according to the type, count of channels and a default value - -Arguments: - - channelType - The required channel data format - dataType - The required data type - cChannels - The count of channels defining the color - channelValue - The intial value for all channels - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -template <class _T> -HRESULT -CColorChannelData::InitializeChannelData( - _In_ CONST COLORDATATYPE& channelType, - _In_ CONST EColorDataType& dataType, - _In_ CONST DWORD& cChannels, - _In_ CONST _T& channelValue - ) -{ - HRESULT hr = S_OK; - - // - // Validate the data size against the current type - // - if (SUCCEEDED(hr = ResetChannelType(channelType)) && - SUCCEEDED(hr = ValidateDataSize<_T>())) - { - if (cChannels <= MAX_CHANNEL_COUNT) - { - m_dataType = dataType; - m_cChannels = cChannels; - _T* pChannelData = reinterpret_cast<_T*>(m_pChannelData); - - for (DWORD cChannel = 0; cChannel < m_cChannels; cChannel++, pChannelData++) - { - *pChannelData = channelValue; - } - } - else - { - hr = E_INVALIDARG; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorChannelData::SetColorDataType - -Routine Description: - - Sets the color data type - -Arguments: - - dataType - The color data type - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorChannelData::SetColorDataType( - _In_ CONST EColorDataType& dataType - ) -{ - m_dataType = dataType; - - return S_OK; -} - -/*++ - -Routine Name: - - CColorChannelData::GetColorDataType - -Routine Description: - - Retrieves the current color data type - -Arguments: - - pDataType - Pointer to a variable to recieve the color data type - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorChannelData::GetColorDataType( - _Out_ EColorDataType* pDataType - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pDataType, E_POINTER))) - { - *pDataType = m_dataType; - } - - return S_OK; -} - -/*++ - -Routine Name: - - CColorChannelData::HasAlpha - -Routine Description: - - Indicates if the color channel data includes an alpha channel - -Arguments: - - None - -Return Value: - - TRUE - An alpha channel is present - FALSE - There is no alpha channel - ---*/ -BOOL -CColorChannelData::HasAlpha( - VOID - ) -{ - // - // If the source or destination is n-channel, or if either sRGB or scRGB have 4 channels, - // we have an alpha channel - // - return m_dataType == nChannel || m_cChannels == 4; -} - -/*++ - -Routine Name: - - CColorChannelData::GetAlphaChannelSize - -Routine Description: - - Retrieves the count of bytes of the alpha channel - -Arguments: - - pcbAlphaChannel - pointer to a variable that recieves the count of bytes of the alpha channel - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorChannelData::GetAlphaChannelSize( - _Out_ DWORD* pcbAlphaChan - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pcbAlphaChan, E_POINTER))) - { - *pcbAlphaChan = 0; - if (HasAlpha()) - { - hr = GetChannelSizeFromType(m_channelType, pcbAlphaChan); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorChannelData::InitializeAlphaChannel - -Routine Description: - - Initialize the alpha channel based off a source color channel data object - -Arguments: - - pSrcChannelData - Pointer to a source color data channel object - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorChannelData::InitializeAlphaChannel( - _In_ CColorChannelData* pSrcChannelData - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pSrcChannelData, E_POINTER))) - { - if (HasAlpha()) - { - FLOAT alpha = 1.0f; - if (SUCCEEDED(hr) && - pSrcChannelData->HasAlpha() && - SUCCEEDED(hr = pSrcChannelData->GetAlphaAsFloat(&alpha))) - { - // - // Ensure alpha lies between 0.0 and 1.0 - // - if (alpha < 0.0) - { - alpha = 0.0; - } - else if (alpha > 1.0) - { - alpha = 1.0; - } - } - - switch (m_channelType) - { - case COLOR_BYTE: - { - *m_pChannelData = static_cast<BYTE>(alpha * kMaxByteAsFloat); - } - break; - - case COLOR_WORD: - { - *reinterpret_cast<WORD*>(m_pChannelData) = static_cast<WORD>(alpha * kMaxWordAsFloat); - } - break; - - case COLOR_FLOAT: - { - *reinterpret_cast<FLOAT*>(m_pChannelData) = alpha; - } - break; - - case COLOR_S2DOT13FIXED: - { - hr = E_NOTIMPL; - } - break; - - default: - { - RIP("Unrecognised channel data format.\n"); - hr = E_FAIL; - } - break; - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorChannelData::GetColor - -Routine Description: - - Retrieves a COLOR object based of the channel data - -Arguments: - - pColor - Pointer to a color structure to be filled in - pType - Pointer to storage to accept the color type - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorChannelData::GetColor( - _Out_ PCOLOR pColor, - _Out_ COLORTYPE* pType - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pColor, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pType, E_POINTER))) - { - if (m_cChannels == 0) - { - hr = E_PENDING; - } - } - - DWORD cChannels = 0; - if (SUCCEEDED(hr) && - SUCCEEDED(hr = GetChannelCountNoAlpha(&cChannels))) - { - if (cChannels <= 4) - { - hr = ColorToWord(reinterpret_cast<PWORD>(pColor), static_cast<UINT>(sizeof(COLOR))); - } - else if (cChannels <= 8) - { - hr = ColorToByte(reinterpret_cast<PBYTE>(pColor), static_cast<UINT>(sizeof(COLOR))); - } - else - { - hr = E_FAIL; - } - - if (SUCCEEDED(hr)) - { - if (m_dataType == sRGB || - m_dataType == scRGB) - { - *pType = COLOR_RGB; - } - else if (m_dataType == nChannel) - { - *pType = static_cast<COLORTYPE>(cChannels + 3); - } - else - { - RIP("Unrecognised data type.\n"); - - hr = E_FAIL; - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorChannelData::SetColor - -Routine Description: - - Sets the channel data based on a COLOR structure - -Arguments: - - pColor - Pointer to a color structure to set the channel data from - type - The color type described by the color structure - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorChannelData::SetColor( - _In_ COLOR* pColor, - _In_ CONST COLORTYPE& type - ) -{ - HRESULT hr = S_OK; - - DWORD cChannels = 0; - DWORD cbData = 0; - PBYTE pData = NULL; - - if (SUCCEEDED(hr = CHECK_POINTER(pColor, E_POINTER)) && - SUCCEEDED(hr = GetChannelCountNoAlpha(&cChannels)) && - SUCCEEDED(hr = GetChannelDataNoAlpha(&cbData, reinterpret_cast<PVOID*>(&pData)))) - { - DWORD cSrcChannels = 0; - - switch (type) - { - case COLOR_RGB: - { - if (m_dataType == sRGB || - m_dataType == scRGB) - { - cSrcChannels = 3; - } - else - { - hr = HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED); - } - } - break; - - case COLOR_3_CHANNEL: - case COLOR_CMYK: - case COLOR_5_CHANNEL: - case COLOR_6_CHANNEL: - case COLOR_7_CHANNEL: - case COLOR_8_CHANNEL: - { - if (m_dataType == nChannel) - { - cSrcChannels = static_cast<DWORD>(type - 3); - } - else - { - hr = HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED); - } - } - break; - - case COLOR_GRAY: - case COLOR_XYZ: - case COLOR_Yxy: - case COLOR_Lab: - case COLOR_NAMED: - { - hr = E_NOTIMPL; - } - break; - - default: - { - RIP("Unrecognised color type\n"); - hr = E_FAIL; - } - break; - } - - if (SUCCEEDED(hr)) - { - if (cChannels == cSrcChannels) - { - if (cSrcChannels <= 4) - { - hr = ColorFromWord(reinterpret_cast<PWORD>(pColor), sizeof(COLOR)); - } - else if (cSrcChannels <= 8) - { - hr = ColorFromByte(reinterpret_cast<PBYTE>(pColor), sizeof(COLOR)); - } - else - { - RIP("Invalid channel count\n"); - hr = E_FAIL; - } - } - else - { - RIP("Miss-match between source channel count and current channel count\n"); - hr = E_FAIL; - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorChannelData::ColorToByte - -Routine Description: - - Converts the channel data to a 8 bpc COLOR type - -Arguments: - - pDstData - Pointer to the data to be set - cbDstData - Size of the destination buffer - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorChannelData::ColorToByte( - _Out_writes_bytes_(cbDstData) PBYTE pDstData, - _In_ CONST UINT cbDstData - ) -{ - HRESULT hr = S_OK; - - DWORD cChannels = 0; - DWORD cbData = 0; - PBYTE pData = NULL; - - if (SUCCEEDED(hr = CHECK_POINTER(pDstData, E_POINTER)) && - SUCCEEDED(hr = GetChannelCountNoAlpha(&cChannels)) && - SUCCEEDED(hr = GetChannelDataNoAlpha(&cbData, reinterpret_cast<PVOID*>(&pData)))) - { - ZeroMemory(pDstData, cbDstData); - - if (cbDstData < cChannels) - { - hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); - } - } - - if (SUCCEEDED(hr) && - cbData == 0 && - cChannels != 0) - { - hr = E_UNEXPECTED; - } - - if (SUCCEEDED(hr)) - { - if (cbDstData > 0) - { - switch (m_channelType) - { - case COLOR_BYTE: - { - if (cbDstData >= cbData) - { - // - // Just copy all channels after alpha into the buffer - // - CopyMemory(pDstData, pData, cbData); - } - else - { - hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); - } - } - break; - - case COLOR_WORD: - { - if (cbDstData >= cChannels * sizeof(BYTE) && - cbData >= cChannels * sizeof(WORD)) - { - PWORD pSrcData = reinterpret_cast<PWORD>(pData); - - for (UINT cCurrChan = 0; - cCurrChan < cChannels; - cCurrChan++) - { - _Analysis_assume_(cCurrChan < cbDstData); - - pDstData[cCurrChan] = static_cast<BYTE>(MulDiv(pSrcData[cCurrChan], 0xFF, 0xFFFF)); - } - } - else - { - hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); - } - } - break; - - case COLOR_FLOAT: - { - // - // Make sure the float data runs between 0.0 and 1.0 for nChannel and sRGB and is - // truncated and scaled as follows for scRGB: - // - // 1. Truncate the input color to between -2.0 and +2.0 - // 2. Offset the value by +2.0 to put it into the 0.0 to 4.0 range - // 3. Scale the value down by 4.0 to put it into the range 0.0 to 1.0 - // 4. Set the 16 bit value according to the channel value from 0x00 - // for 0.0 to 0xFF for 1.0 - // - if (cbDstData >= cChannels * sizeof(BYTE) && - cbData >= cChannels * sizeof(FLOAT)) - { - PFLOAT pSrcData = reinterpret_cast<PFLOAT>(pData); - - if (m_dataType == scRGB) - { - for (UINT cCurrChan = 0; - cCurrChan < cChannels; - cCurrChan++) - { - _Analysis_assume_(cCurrChan < cbDstData); - - FLOAT channelValue = pSrcData[cCurrChan]; - channelValue = channelValue < -2.0f ? -2.0f : channelValue; - channelValue = channelValue > 2.0f ? 2.0f : channelValue; - channelValue += 2.0f; - channelValue /= 4.0f; - pDstData[cCurrChan] = static_cast<BYTE>(channelValue * kMaxByteAsFloat); - } - } - else - { - if (SUCCEEDED(hr = ClampChannelValues(0.0f, 1.0f))) - { - for (UINT cCurrChan = 0; - cCurrChan < cChannels; - cCurrChan++) - { - _Analysis_assume_(cCurrChan < cbDstData); - - pDstData[cCurrChan] = static_cast<BYTE>(pSrcData[cCurrChan] * kMaxByteAsFloat); - } - } - } - } - else - { - hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); - } - } - break; - - case COLOR_S2DOT13FIXED: - { - hr = E_NOTIMPL; - } - break; - - default: - { - RIP("Unrecognised color type\n"); - hr = E_FAIL; - } - break; - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorChannelData::ColorToWord - -Routine Description: - - Converts the channel data to a 16 bpc COLOR type - -Arguments: - - pDstData - Pointer to the data to be set - cbDstData - Size of the destination buffer - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorChannelData::ColorToWord( - _Out_writes_bytes_(cbDstData) PWORD pDstData, - _In_ CONST UINT cbDstData - ) -{ - HRESULT hr = S_OK; - - DWORD cChannels = 0; - DWORD cbData = 0; - PBYTE pData = NULL; - - if (SUCCEEDED(hr = CHECK_POINTER(pDstData, E_POINTER)) && - SUCCEEDED(hr = GetChannelCountNoAlpha(&cChannels)) && - SUCCEEDED(hr = GetChannelDataNoAlpha(&cbData, reinterpret_cast<PVOID*>(&pData)))) - { - ZeroMemory(pDstData, cbDstData); - - if (cbDstData / sizeof(WORD) < cChannels) - { - hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); - } - } - - if (SUCCEEDED(hr) && - cbData == 0 && - cChannels != 0) - { - hr = E_UNEXPECTED; - } - - if (SUCCEEDED(hr)) - { - if (cbDstData > 0) - { - switch (m_channelType) - { - case COLOR_BYTE: - { - if (cbDstData >= cChannels * sizeof(WORD) && - cbData >= cChannels * sizeof(BYTE)) - { - for (UINT cCurrChan = 0; - cCurrChan < cChannels; - cCurrChan++) - { - _Analysis_assume_((cCurrChan + 1) * sizeof(WORD) <= cbDstData); - - pDstData[cCurrChan] = static_cast<WORD>(MulDiv(pData[cCurrChan], 0xFFFF, 0xFF)); - } - } - else - { - hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); - } - } - break; - - case COLOR_WORD: - { - if (cbDstData - cbData > 0) - { - // - // Just copy all channels after alpha into the COLOR structure - // - CopyMemory(pDstData, pData, cbData); - } - else - { - hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); - } - } - break; - - case COLOR_FLOAT: - { - // - // Make sure the float data runs between 0.0 and 1.0 for nChannel and sRGB and is - // truncated and scaled as follows for scRGB: - // - // 1. Truncate the input color to between -2.0 and +2.0 - // 2. Offset the value by +2.0 to put it into the 0.0 to 4.0 range - // 3. Scale the value by 4.0 to put it into the range 0.0 to 1.0 - // 4. Set the 16 bit value according to the channel value from 0x0000 - // for 0.0 to 0xFFFF for 1.0 - // - if (cbDstData >= cChannels * sizeof(WORD) && - cbData >= cChannels * sizeof(FLOAT)) - { - PFLOAT pSrcData = reinterpret_cast<PFLOAT>(pData); - - if (m_dataType == scRGB) - { - for (UINT cCurrChan = 0; - cCurrChan < cChannels; - cCurrChan++) - { - _Analysis_assume_((cCurrChan + 1) * sizeof(WORD) <= cbDstData); - - FLOAT channelValue = pSrcData[cCurrChan]; - channelValue = channelValue < -2.0f ? -2.0f : channelValue; - channelValue = channelValue > 2.0f ? 2.0f : channelValue; - channelValue += 2.0f; - channelValue /= 4.0f; - pDstData[cCurrChan] = static_cast<WORD>(channelValue * kMaxWordAsFloat); - } - } - else - { - if (SUCCEEDED(hr = ClampChannelValues(0.0f, 1.0f))) - { - for (UINT cCurrChan = 0; - cCurrChan < cChannels; - cCurrChan++) - { - _Analysis_assume_((cCurrChan + 1) * sizeof(WORD) <= cbDstData); - - pDstData[cCurrChan] = static_cast<WORD>(pSrcData[cCurrChan] * kMaxWordAsFloat); - } - } - } - } - else - { - hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); - } - } - break; - - case COLOR_S2DOT13FIXED: - { - hr = E_NOTIMPL; - } - break; - - default: - { - RIP("Unrecognised color type\n"); - hr = E_FAIL; - } - break; - } - } - } - - ERR_ON_HR(hr); - return hr; -} - - -/*++ - -Routine Name: - - CColorChannelData::ColorFromByte - -Routine Description: - - Uses an 8 bpc COLOR structure to set the channel data - -Arguments: - - pSrcData - Pointer to the source COLOR data - cbSrcData - Size of the source buffer in bytes - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorChannelData::ColorFromByte( - _In_reads_bytes_(cbSrcData) PBYTE pSrcData, - _In_ CONST UINT& cbSrcData - ) -{ - HRESULT hr = S_OK; - - DWORD cChannels = 0; - DWORD cbData = 0; - PBYTE pData = NULL; - - if (SUCCEEDED(hr = CHECK_POINTER(pSrcData, E_POINTER)) && - SUCCEEDED(hr = GetChannelCountNoAlpha(&cChannels)) && - SUCCEEDED(hr = GetChannelDataNoAlpha(&cbData, reinterpret_cast<PVOID*>(&pData)))) - { - if (cbData == 0 && - cChannels != 0) - { - hr = E_UNEXPECTED; - } - } - - if (SUCCEEDED(hr)) - { - ZeroMemory(pData, cbData); - - if (cbSrcData > 0) - { - switch (m_channelType) - { - case COLOR_BYTE: - { - if (cbData >= cChannels * sizeof(BYTE) && - cbSrcData >= cChannels * sizeof(BYTE)) - { - // - // Just copy src to dst - // - CopyMemory(pData, pSrcData, cChannels * sizeof(BYTE)); - } - else - { - hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); - } - } - break; - - case COLOR_WORD: - { - if (cbData >= cChannels * sizeof(WORD) && - cbSrcData >= cChannels * sizeof(BYTE)) - { - PWORD pDstData = reinterpret_cast<PWORD>(pData); - - for (UINT cCurrChan = 0; - cCurrChan < cChannels; - cCurrChan++) - { - _Analysis_assume_(cCurrChan < cbSrcData); - - pDstData[cCurrChan] = static_cast<WORD>(MulDiv(pSrcData[cCurrChan], 0xFFFF, 0xFF)); - } - } - else - { - hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); - } - } - break; - - case COLOR_FLOAT: - { - // - // Make sure the float data is scaled to 0.0 and 1.0 for nChannel and sRGB and is - // scaled as follows for scRGB: - // - // 1. Convert the WORD value from 0x00 - 0xFF to 0.0f - 1.0f - // 1. Scale the value up by 4.0 to put it into the range 0.0 to 2.0 - // 2. Offset the value by -2.0 to put it into the -2.0 to 2.0 range - // - if (cbData >= cChannels * sizeof(FLOAT) && - cbSrcData >= cChannels * sizeof(BYTE)) - { - PFLOAT pDstData = reinterpret_cast<PFLOAT>(pData); - - if (m_dataType == scRGB) - { - for (UINT cCurrChan = 0; - cCurrChan < cChannels; - cCurrChan++) - { - _Analysis_assume_(cCurrChan < cbSrcData); - - pDstData[cCurrChan] = ((static_cast<FLOAT>(pSrcData[cCurrChan])*4.0f)/kMaxByteAsFloat) - 2.0f; - } - } - else - { - for (UINT cCurrChan = 0; - cCurrChan < cChannels; - cCurrChan++) - { - _Analysis_assume_(cCurrChan < cbSrcData); - - pDstData[cCurrChan] = static_cast<FLOAT>(pSrcData[cCurrChan])/kMaxByteAsFloat; - } - } - } - else - { - hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); - } - } - break; - - case COLOR_S2DOT13FIXED: - { - hr = E_NOTIMPL; - } - break; - - default: - { - RIP("Unrecognised color type\n"); - hr = E_FAIL; - } - break; - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorChannelData::ColorFromWord - -Routine Description: - - Uses an 16 bpc COLOR structure to set the channel data - -Arguments: - - pSrcData - Pointer to the source COLOR data - cbSrcData - Size of the source buffer in bytes - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorChannelData::ColorFromWord( - _In_reads_bytes_(cbSrcData) PWORD pSrcData, - _In_ CONST UINT& cbSrcData - ) -{ - HRESULT hr = S_OK; - - DWORD cChannels = 0; - DWORD cbData = 0; - PBYTE pData = NULL; - - if (SUCCEEDED(hr = CHECK_POINTER(pSrcData, E_POINTER)) && - SUCCEEDED(hr = GetChannelCountNoAlpha(&cChannels)) && - SUCCEEDED(hr = GetChannelDataNoAlpha(&cbData, reinterpret_cast<PVOID*>(&pData)))) - { - if (cbData == 0 && - cChannels != 0) - { - hr = E_UNEXPECTED; - } - } - - if (SUCCEEDED(hr)) - { - ZeroMemory(pData, cbData); - - if (cbSrcData > 0) - { - switch (m_channelType) - { - case COLOR_BYTE: - { - if (cbData >= cChannels * sizeof(BYTE) && - cbSrcData >= cChannels * sizeof(WORD)) - { - for (UINT cCurrChan = 0; - cCurrChan < cChannels; - cCurrChan++) - { - _Analysis_assume_((cCurrChan + 1) * sizeof(WORD) < cbSrcData); - - pData[cCurrChan] = static_cast<BYTE>(MulDiv(pSrcData[cCurrChan], 0xFF, 0xFFFF)); - } - } - else - { - hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); - } - } - break; - - case COLOR_WORD: - { - if (cbData >= cChannels * sizeof(WORD) && - cbSrcData >= cChannels * sizeof(WORD)) - { - // - // Just copy src to dst - // - CopyMemory(pData, pSrcData, cChannels * sizeof(WORD)); - } - else - { - hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); - } - } - break; - - case COLOR_FLOAT: - { - // - // Make sure the float data is scaled to 0.0 and 1.0 for nChannel and sRGB and is - // scaled as follows for scRGB: - // - // 1. Convert the WORD value from 0x0000 - 0xFFFF to 0.0f - 1.0f - // 1. Scale the value up by 4.0 to put it into the range 0.0 to 2.0 - // 2. Offset the value by -2.0 to put it into the -2.0 to 2.0 range - // - if (cbData >= cChannels * sizeof(FLOAT) && - cbSrcData >= cChannels * sizeof(WORD)) - { - PFLOAT pDstData = reinterpret_cast<PFLOAT>(pData); - - if (m_dataType == scRGB) - { - for (UINT cCurrChan = 0; - cCurrChan < cChannels; - cCurrChan++) - { - _Analysis_assume_((cCurrChan + 1) * sizeof(WORD) < cbSrcData); - - pDstData[cCurrChan] = ((static_cast<FLOAT>(pSrcData[cCurrChan])*4.0f)/kMaxWordAsFloat) - 2.0f; - } - } - else - { - for (UINT cCurrChan = 0; - cCurrChan < cChannels; - cCurrChan++) - { - _Analysis_assume_((cCurrChan + 1) * sizeof(WORD) < cbSrcData); - - pDstData[cCurrChan] = static_cast<FLOAT>(pSrcData[cCurrChan])/kMaxWordAsFloat; - } - } - } - else - { - hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); - } - } - break; - - case COLOR_S2DOT13FIXED: - { - hr = E_NOTIMPL; - } - break; - - default: - { - RIP("Unrecognised color type\n"); - hr = E_FAIL; - } - break; - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorChannelData::GetChannelSizeFromType - -Routine Description: - - Retrieves the channel data size from the channel data type - -Arguments: - - channelType - The color channel data type - pcbChannelSize - Pointer to storage to recieve the channel data size - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorChannelData::GetChannelSizeFromType( - _In_ CONST COLORDATATYPE& channelType, - _Out_ DWORD* pcbChannelSize - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pcbChannelSize, E_POINTER))) - { - if (channelType < COLOR_BYTE || - channelType > COLOR_S2DOT13FIXED) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - *pcbChannelSize = g_cbChannelType[channelType - 1]; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorChannelData::ValidateDataSize - -Routine Description: - - Template method that validates the data size given the current channel data type - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -template <class _T> -HRESULT -CColorChannelData::ValidateDataSize( - VOID - ) -{ - HRESULT hr = S_OK; - - DWORD cbDataSize = 0; - if (SUCCEEDED(hr = GetChannelSizeFromType(m_channelType, &cbDataSize))) - { - // - // Make sure the data being added matches the data type in size - // - if (sizeof(_T) != cbDataSize) - { - hr = E_INVALIDARG; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorChannelData::AllocateChannelBuffers - -Routine Description: - - Allocates the channel data buffer - -Arguments: - - pcbBuffer - Pointer to variable that recieves the allocated buffer size - ppBuffer - Pointer to a pointer that recieves the buffer address - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorChannelData::AllocateChannelBuffers( - _Out_ UINT* pcbBuffer, - _Outptr_result_bytebuffer_(*pcbBuffer) _At_buffer_(*ppBuffer, _Iter_, *pcbBuffer, _Post_invalid_) - PBYTE* ppBuffer - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pcbBuffer, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(ppBuffer, E_POINTER))) - { - // - // Allocate a buffer for the channel data MAX_CHANNEL_COUNT x MAX_CHANNEL_SIZE - // This guarantees we have enough storage for the maximum n-channel support - // in WCS - // - *pcbBuffer = MAX_CHANNEL_COUNT*MAX_CHANNEL_SIZE; - *ppBuffer = new(std::nothrow) BYTE[*pcbBuffer]; - - if (*ppBuffer == NULL) - { - *pcbBuffer = 0; - hr = E_OUTOFMEMORY; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorChannelData::FreeChannelBuffers - -Routine Description: - - Releases channel buffer - -Arguments: - - None - -Return Value: - - None - ---*/ -VOID -CColorChannelData::FreeChannelBuffers( - VOID - ) -{ - if (m_pChannelData != NULL) - { - delete[] m_pChannelData; - m_pChannelData = NULL; - } - m_cbChannelData = 0; -} - -/*++ - -Routine Name: - - CColorChannelData::GetAlphaAsFloat - -Routine Description: - - Retrieves the alpha value of the channel data as a float - -Arguments: - - pAlpha - Pointer to a float that recieves the alpha value - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorChannelData::GetAlphaAsFloat( - _Out_ PFLOAT pAlpha - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pAlpha, E_POINTER))) - { - *pAlpha = 0.0f; - - if (HasAlpha()) - { - switch (m_channelType) - { - case COLOR_BYTE: - { - *pAlpha = static_cast<FLOAT>(*m_pChannelData)/kMaxByteAsFloat; - } - break; - - case COLOR_WORD: - { - *pAlpha = static_cast<FLOAT>(*reinterpret_cast<WORD*>(m_pChannelData))/kMaxWordAsFloat; - } - break; - - case COLOR_FLOAT: - { - *pAlpha = *reinterpret_cast<PFLOAT>(m_pChannelData); - } - break; - - case COLOR_S2DOT13FIXED: - { - hr = E_NOTIMPL; - } - break; - - default: - { - RIP("Unrecognised channel data format.\n"); - hr = E_FAIL; - } - break; - } - } - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/color/colchan.h b/print/XPSDrvSmpl/src/filters/color/colchan.h deleted file mode 100644 index 393261a8..00000000 --- a/print/XPSDrvSmpl/src/filters/color/colchan.h +++ /dev/null @@ -1,289 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - colchan.h - -Abstract: - - Color channel class definition. The color channel class is responsible for maintaining - simple single color multiple channel data intialised from color references in the XPS markup. - It provides methods for intialization, access and conversion of the data. - ---*/ - -#pragma once - -enum EColorDataType -{ - sRGB = 0, - scRGB, - nChannel -}; - -class CColorChannelData -{ -public: - CColorChannelData(); - - ~CColorChannelData(); - - template <class _T> - HRESULT - AddChannelData( - _In_ CONST _T& channelValue - ); - - HRESULT - GetChannelCount( - _Out_ DWORD* pcChannels - ); - - HRESULT - GetChannelCountNoAlpha( - _Out_ DWORD* pcChannels - ); - - HRESULT - GetChannelType( - _Out_ COLORDATATYPE* pChannelType - ); - - HRESULT - ResetChannelType( - _In_ CONST COLORDATATYPE& channelType - ); - - HRESULT - GetChannelData( - _Out_ DWORD* pcbDataSize, - _Out_ - _When_(*pcbDataSize > 0, _At_(*ppData, _Post_ _Readable_bytes_(*pcbDataSize))) - _When_(*pcbDataSize == 0, _At_(*ppData, _Post_ _Maybenull_)) - PVOID* ppData - ); - - HRESULT - GetChannelDataNoAlpha( - _Out_ DWORD* pcbDataSize, - _Out_ - _When_(*pcbDataSize > 0, _At_(*ppData, _Post_ _Readable_bytes_(*pcbDataSize))) - _When_(*pcbDataSize == 0, _At_(*ppData, _Post_ _Maybenull_)) - PVOID* ppData - ); - - template <class _T> - HRESULT - ClampChannelValues( - _In_ CONST _T& min, - _In_ CONST _T& max - ); - - template <class _T> - HRESULT - InitializeChannelData( - _In_ CONST COLORDATATYPE& channelType, - _In_ CONST EColorDataType& dataType, - _In_ CONST DWORD& cChannels, - _In_ CONST _T& channelValue - ); - - HRESULT - SetColorDataType( - _In_ CONST EColorDataType& dataType - ); - - HRESULT - GetColorDataType( - _Out_ EColorDataType* pDataType - ); - - BOOL - HasAlpha( - VOID - ); - - HRESULT - InitializeAlphaChannel( - _In_ CColorChannelData* pSrcChannelData - ); - - HRESULT - GetColor( - _Out_ PCOLOR pColor, - _Out_ COLORTYPE* pType - ); - - HRESULT - SetColor( - _In_ COLOR* pColor, - _In_ CONST COLORTYPE& type - ); - -private: - HRESULT - GetChannelSizeFromType( - _In_ CONST COLORDATATYPE& channelType, - _Out_ DWORD* pcbChannelSize - ); - - template <class _T> - HRESULT - ValidateDataSize( - VOID - ); - - HRESULT - AllocateChannelBuffers( - _Out_ UINT* pcbBuffer, - _Outptr_result_bytebuffer_(*pcbBuffer) _At_buffer_(*ppBuffer, _Iter_, *pcbBuffer, _Post_invalid_) - PBYTE* ppBuffer - ); - - VOID - FreeChannelBuffers( - VOID - ); - - HRESULT - GetAlphaAsFloat( - _Out_ PFLOAT pAlpha - ); - - HRESULT - ColorToByte( - _Out_writes_bytes_(cbDstData) PBYTE pDstData, - _In_ CONST UINT cbDstData - ); - - HRESULT - ColorToWord( - _Out_writes_bytes_(cbDstData) PWORD pDstData, - _In_ CONST UINT cbDstData - ); - - HRESULT - ColorFromByte( - _In_reads_bytes_(cbSrcData) PBYTE pSrcData, - _In_ CONST UINT& cbSrcData - ); - - HRESULT - ColorFromWord( - _In_reads_bytes_(cbSrcData) PWORD pSrcData, - _In_ CONST UINT& cbSrcData - ); - - HRESULT - GetAlphaChannelSize( - _Out_ DWORD* pcbAlphaChan - ); - -private: - DWORD m_cChannels; - - COLORDATATYPE m_channelType; - - PBYTE m_pChannelData; - - UINT m_cbChannelData; - - EColorDataType m_dataType; -}; - -// -// Explicitly instantiate the template functions for BYTE, WORD and FLOAT -// -template -HRESULT -CColorChannelData::AddChannelData<BYTE>( - _In_ CONST BYTE& channelValue - ); - -template -HRESULT -CColorChannelData::ClampChannelValues<BYTE>( - _In_ CONST BYTE& min, - _In_ CONST BYTE& max - ); - -template -HRESULT -CColorChannelData::InitializeChannelData<BYTE>( - _In_ CONST COLORDATATYPE& channelType, - _In_ CONST EColorDataType& dataType, - _In_ CONST DWORD& cChannels, - _In_ CONST BYTE& channelValue - ); - -template -HRESULT -CColorChannelData::ValidateDataSize<BYTE>( - VOID - ); - -template -HRESULT -CColorChannelData::AddChannelData<WORD>( - _In_ CONST WORD& channelValue - ); - -template -HRESULT -CColorChannelData::ClampChannelValues<WORD>( - _In_ CONST WORD& min, - _In_ CONST WORD& max - ); - -template -HRESULT -CColorChannelData::InitializeChannelData<WORD>( - _In_ CONST COLORDATATYPE& channelType, - _In_ CONST EColorDataType& dataType, - _In_ CONST DWORD& cChannels, - _In_ CONST WORD& channelValue - ); - -template -HRESULT -CColorChannelData::ValidateDataSize<WORD>( - VOID - ); - -template -HRESULT -CColorChannelData::AddChannelData<FLOAT>( - _In_ CONST FLOAT& channelValue - ); - -template -HRESULT -CColorChannelData::ClampChannelValues<FLOAT>( - _In_ CONST FLOAT& min, - _In_ CONST FLOAT& max - ); - -template -HRESULT -CColorChannelData::InitializeChannelData<FLOAT>( - _In_ CONST COLORDATATYPE& channelType, - _In_ CONST EColorDataType& dataType, - _In_ CONST DWORD& cChannels, - _In_ CONST FLOAT& channelValue - ); - -template -HRESULT -CColorChannelData::ValidateDataSize<FLOAT>( - VOID - ); - diff --git a/print/XPSDrvSmpl/src/filters/color/colconv.cpp b/print/XPSDrvSmpl/src/filters/color/colconv.cpp deleted file mode 100644 index 13804f5e..00000000 --- a/print/XPSDrvSmpl/src/filters/color/colconv.cpp +++ /dev/null @@ -1,1138 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - colconv.cpp - -Abstract: - - Color conversion manager implementation. The CColorConverter class is responsible - for coordinating the handling of the color conversion process. - - Note regarding transform caching: The color filter provides caching for the last - transform. This aids performance as quite some time can be consumed creating a - transform. The filter may however suffer if source content color profiles are rapidly - switched (e.g. alternating sRGB and scRGB mark-up). This could be mitigated by increasing - the number cached transforms beyond one. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "xdexcept.h" -#include "colconv.h" -#include "cmimg.h" -#include "dictionary.h" - -using XDPrintSchema::PageSourceColorProfile::EProfileOption; -using XDPrintSchema::PageSourceColorProfile::RGB; -using XDPrintSchema::PageSourceColorProfile::CMYK; - -using XDPrintSchema::PageICMRenderingIntent::AbsoluteColorimetric; -using XDPrintSchema::PageICMRenderingIntent::RelativeColorimetric; -using XDPrintSchema::PageICMRenderingIntent::Photographs; -using XDPrintSchema::PageICMRenderingIntent::BusinessGraphics; - -COLORTYPE g_nChannelMap[] = { - COLOR_3_CHANNEL, - COLOR_CMYK, - COLOR_5_CHANNEL, - COLOR_6_CHANNEL, - COLOR_7_CHANNEL, - COLOR_8_CHANNEL -}; - -/*++ - -Routine Name: - - CColorConverter::CColorConverter - -Routine Description: - - Constructor for the base CColorConverter class. Provides common functionality - between the bitmap and color ref converter classes - -Arguments: - - pXpsConsumer - Pointer to the XPS consumer interface. Used to write out resources - pFixedPage - Pointer to the FixedPage interface. Resource cache uses this when writing - pResCache - Pointer to the resource cache. - pProfManager - Pointer to a profile manager for supplying a suitable color profile - -Return Value: - - None - Throws CXDException(HRESULT) on an error - ---*/ -CColorConverter::CColorConverter( - _In_ IXpsDocumentConsumer* pXpsConsumer, - _In_ IFixedPage* pFixedPage, - _In_ CFileResourceCache* pResCache, - _In_ CProfileManager* pProfManager, - _In_ ResDeleteMap* pResDel - ) : - m_pXpsConsumer(pXpsConsumer), - m_pFixedPage(pFixedPage), - m_pProfManager(pProfManager), - m_pResCache(pResCache), - m_pResDel(pResDel) -{ - HRESULT hr = S_OK; - - if (FAILED(hr = CHECK_POINTER(m_pXpsConsumer, E_POINTER)) || - FAILED(hr = CHECK_POINTER(m_pFixedPage, E_POINTER)) || - FAILED(hr = CHECK_POINTER(m_pProfManager, E_POINTER)) || - FAILED(hr = CHECK_POINTER(m_pResCache, E_POINTER)) || - FAILED(hr = CHECK_POINTER(m_pResDel, E_POINTER))) - { - throw CXDException(hr); - } -} - -/*++ - -Routine Name: - - CColorConverter::~CColorConverter - -Routine Description: - - Default destructor for the CColorConverter class - -Arguments: - - None - -Return Value: - - None - ---*/ -CColorConverter::~CColorConverter() -{ -} - -/*++ - -Routine Name: - - CBitmapColorConverter::CBitmapColorConverter - -Routine Description: - - Constructor for the CBitmapColorConverter class - -Arguments: - - pXpsConsumer - Pointer to the XPS consumer interface. Used to write out resources - pFixedPage - Pointer to the FixedPage interface. Resource cache uses this when writing - pResCache - Pointer to the resource cache. - pProfManager - Pointer to a profile manager for supplying a suitable color profile - -Return Value: - - None - Throws CXDException(HRESULT) on an error - ---*/ -CBitmapColorConverter::CBitmapColorConverter( - _In_ IXpsDocumentConsumer* pXpsConsumer, - _In_ IFixedPage* pFixedPage, - _In_ CFileResourceCache* pResCache, - _In_ CProfileManager* pProfManager, - _In_ ResDeleteMap* pResDel - ) : - CColorConverter(pXpsConsumer, pFixedPage, pResCache, pProfManager, pResDel) -{ -} - -/*++ - -Routine Name: - - CBitmapColorConverter::~CBitmapColorConverter - -Routine Description: - - Destructor for the CBitmapColorConverter class - -Arguments: - - None - -Return Value: - - None - ---*/ -CBitmapColorConverter::~CBitmapColorConverter() -{ -} - -/*++ - -Routine Name: - - CColorConverter::ConvertBitmap - -Routine Description: - - Method which performs the color conversion process to a bitmap resource and sets - the resource URI to contain the URI of the converted bitmap resource - -Arguments: - - pbstrBmpURI - Pointer to a string containing the bitmap resource path and name - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CBitmapColorConverter::Convert( - _Inout_ BSTR* pbstrBmpURI - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrBmpURI, E_POINTER))) - { - try - { - // - // Create a color managed image object - // - CColorManagedImage bmpColManaged(*pbstrBmpURI, m_pProfManager, m_pFixedPage, m_pResDel); - - // - // Write out the cached bitmap and get a keyname for the written bitmap - // - CComBSTR bstrKey; - if (SUCCEEDED(hr = m_pResCache->WriteResource<IPartImage>(m_pXpsConsumer, m_pFixedPage, &bmpColManaged)) && - SUCCEEDED(hr = bmpColManaged.GetKeyName(&bstrKey))) - { - hr = m_pResCache->GetURI(bstrKey, pbstrBmpURI); - - ASSERTMSG(SUCCEEDED(hr), "Failed to process image"); - } - } - catch (CXDException& e) - { - hr = e; - } - } - else - { - hr = E_POINTER; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorRefConverter::CColorRefConverter - -Routine Description: - - Constructor for the base CColorRefConverter class which handles parsing and - conversion of a color string within XPS mark-up - -Arguments: - - pXpsConsumer - Pointer to the XPS consumer interface. Used to write out resources - pFixedPage - Pointer to the FixedPage interface. Resource cache uses this when writing - pResCache - Pointer to the resource cache. - pProfManager - Pointer to a profile manager for supplying a suitable color profile - -Return Value: - - None - Throws CXDException(HRESULT) on an error - ---*/ -CColorRefConverter::CColorRefConverter( - _In_ IXpsDocumentConsumer* pXpsConsumer, - _In_ IFixedPage* pFixedPage, - _In_ CFileResourceCache* pResCache, - _In_ CProfileManager* pProfManager, - _In_ ResDeleteMap* pResDel - ) : - CColorConverter(pXpsConsumer, pFixedPage, pResCache, pProfManager, pResDel) -{ -} - -/*++ - -Routine Name: - - CColorRefConverter::~CColorRefConverter - -Routine Description: - - Destructor for the CColorRefConverter class - -Arguments: - - None - -Return Value: - - None - ---*/ -CColorRefConverter::~CColorRefConverter() -{ -} - -/*++ - -Routine Name: - - CColorRefConverter::ConvertColor - -Routine Description: - - Method which performs the color conversion process to an XPS color ref element - -Arguments: - - pbstrColorRef - Pointer to a string containing the color data to be converted - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorRefConverter::Convert( - _Inout_ BSTR* pbstrColorRef - ) -{ - HRESULT hr = S_OK; - - BOOL bIsResourceReference = FALSE; - if (SUCCEEDED(hr = CHECK_POINTER(pbstrColorRef, E_POINTER)) && - SUCCEEDED(hr = ParseColorString(*pbstrColorRef, &m_srcData, &bIsResourceReference)) && - !bIsResourceReference) - { - // - // If the source and destination types are the same (e.g. scRGB in and scRGB out) - // we need go no further - simply return the existing string. This does not apply - // to nChannel as ContextColors specify their own profile and we cannot prove that - // this matches our output. The color space for sRGB and scRGB are implicit however. - // - EColorDataType srcType = sRGB; - EColorDataType dstType = sRGB; - if (SUCCEEDED(hr = InitDstChannels(&m_srcData, &m_dstData)) && - SUCCEEDED(hr = m_srcData.GetColorDataType(&srcType)) && - SUCCEEDED(hr = m_dstData.GetColorDataType(&dstType))) - { - if (dstType == nChannel || - dstType != srcType) - { - if (SUCCEEDED(hr = TransformColor(&m_srcData, &m_dstData))) - { - hr = CreateColorString(&m_dstData, pbstrColorRef); - } - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorRefConverter::InitDstChannels - -Routine Description: - - Initialise the destination color channel data based on the destination color - profile - -Arguments: - - pChannelDataDst - Pointer to a color channel data object to be intialised - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorRefConverter::InitDstChannels( - _In_ CColorChannelData* pChannelDataSrc, - _Inout_ CColorChannelData* pChannelDataDst - ) -{ - HRESULT hr = S_OK; - - EProfileOption profileType = RGB; - if (SUCCEEDED(hr = CHECK_POINTER(pChannelDataSrc, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pChannelDataDst, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(m_pProfManager, E_FAIL)) && - SUCCEEDED(hr = m_pProfManager->GetDstProfileType(&profileType))) - { - // - // Initialize the channel data based on the destination color profile - // settings: - // RGB = 3 channel with no src alpha - // 4 channel with src alpha - // CMYK = 5 channel (nChannel always has an alpha channel) - // - // The color type is based off the OS. XP does not have access to WCS - // and therefore floating point formats are converted to 16 bits per channel - // - // The conversion process for downlevel handling depends on the source format. - // If we are color matching for scRGB we convert the floating point value as - // follows: - // - // 1. Truncate the input color to between -2.0 and +2.0 - // 2. Offset the value by +2.0 to put it into the 0.0 to 4.0 range - // 3. Scale the value by 4.0 to put it into the range 0.0 to 1.0 - // 4. Set the 16 bit value according to the channel value from 0x0000 - // for 0.0 to 0xFFFF for 1.0 - // 5. Call TranslateColors passing the 16 bit value - // 6. Reverse steps 1 - 4 to retrieve the floating point value - // - // If we are color matching for context colors we apply the following conversion - // - // 1. Truncate the input color to between 0.0 and +1.0 - // 2. Set the 16 bit value according to the channel value from 0x0000 - // for 0.0 to 0xFFFF for 1.0 - // 3. Call TranslateColors passing the 16 bit value - // 4. Reverse steps 1 - 2 to retrieve the floating point value - // - // Note: We do not modify the gamma during the scRGB conversion process as this will - // be applied by WCS/ICM as the gamma is encapsulated by the relevant ICC - // profile. i.e. The gamma is maintained linear as that is what the transform - // is expecting. - // - COLORDATATYPE colorDataType = COLOR_FLOAT; - EColorDataType dataType = sRGB; - - DWORD cChannels = 0; - if (profileType == RGB) - { - dataType = scRGB; - cChannels = 3; - if (pChannelDataSrc->HasAlpha()) - { - cChannels++; - } - } - else if (profileType == CMYK) - { - dataType = nChannel; - cChannels = 5; - } - else - { - RIP("Unsupported color channel format\n"); - hr = E_FAIL; - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = pChannelDataDst->InitializeChannelData<FLOAT>(colorDataType, dataType, cChannels, 0.0f))) - { - hr = pChannelDataDst->InitializeAlphaChannel(pChannelDataSrc); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorRefConverter::GetFloatChannelData - -Routine Description: - - Method which converts a comma delimited set of floating point values - defining color channels into floating point values in a list - -Arguments: - - szColorRef - The srting containing the comma seperated color values - pChannelData - Pointer to the color channels object - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorRefConverter::GetFloatChannelData( - _In_ LPCWSTR szColorRef, - _Inout_ CColorChannelData* pChannelData - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pChannelData, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(szColorRef, E_POINTER)) && - SUCCEEDED(hr = pChannelData->ResetChannelType(COLOR_FLOAT))) - { - try - { - CStringXDW cstrColorRef(szColorRef); - cstrColorRef.Trim(); - cstrColorRef.MakeLower(); - - INT cTokenIndex = 0; - INT cChars = cstrColorRef.GetLength(); - while (SUCCEEDED(hr) && - cTokenIndex < cChars && - cTokenIndex != -1) - { - CStringXDW cstrChannel(cstrColorRef.Tokenize(L",", cTokenIndex)); - hr = pChannelData->AddChannelData(static_cast<FLOAT>(_wtof(cstrChannel))); - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorRefConverter::SetFloatChannelData - -Routine Description: - - Method which converts channel data object into a comma delimited set of - floating point values - -Arguments: - - pChannelData - Pointer to the color channel data - pcstrChannelData - Pointer to the color string to be populated - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorRefConverter::SetFloatChannelData( - _In_ CColorChannelData* pChannelData, - _Inout_ CStringXDW* pcstrChannelData - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pChannelData, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pcstrChannelData, E_POINTER))) - { - try - { - // - // Over all channels, write out comma seperated float values - // - DWORD cbData = 0; - PFLOAT pData = NULL; - DWORD cChanCount = 0; - if (SUCCEEDED(hr = pChannelData->GetChannelData(&cbData, reinterpret_cast<PVOID*>(&pData))) && - SUCCEEDED(hr = pChannelData->GetChannelCount(&cChanCount))) - { - if (cChanCount == 0) - { - hr = E_FAIL; - } - - if (SUCCEEDED(hr) && - cbData >= cChanCount * sizeof(FLOAT)) - { - CStringXDW cstrChannel; - cstrChannel.Format(L"%f", pData[0]); - pcstrChannelData->Append(cstrChannel); - for (DWORD cChan = 1; cChan < cChanCount; cChan++) - { - cstrChannel.Format(L",%f", pData[cChan]); - pcstrChannelData->Append(cstrChannel); - } - } - else - { - hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); - } - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorRefConverter::ParseColorString - -Routine Description: - - Method which converts a XML formatted color string into useable color data - -Arguments: - - bstrColorRef - The color ref string to be parsed - pChannelData - Pointer to the color channel data object to be populated - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorRefConverter::ParseColorString( - _In_ BSTR bstrColorRef, - _Inout_ CColorChannelData* pChannelData, - _Out_ BOOL* pbIsResourceReference - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pChannelData, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pbIsResourceReference, E_POINTER))) - { - *pbIsResourceReference = FALSE; - - if (SysStringLen(bstrColorRef) <= 0) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - try - { - CStringXDW cstrColRef(bstrColorRef); - cstrColRef.Trim(); - - if (0 == cstrColRef.Find(L"sc#")) - { - // - // Strip the "sc#" prefix ready to parse the floating point channels - // - cstrColRef.Delete(0, 3); - - // - // Set the src profile to xdwscRGB.icc - this is an ICC profile with - // the system wcsRGB profile embedded so should work down-level - // Set the color data type and retrieve the channel data - // - if (SUCCEEDED(hr = m_pProfManager->SetSrcProfileFromColDir(L"xdwscRGB.icc")) && - SUCCEEDED(hr = pChannelData->ResetChannelType(COLOR_FLOAT)) && - SUCCEEDED(hr = pChannelData->SetColorDataType(scRGB))) - { - hr = GetFloatChannelData(cstrColRef, pChannelData); - } - } - else if (0 == cstrColRef.Find(L"ContextColor")) - { - // - // Context colors always have an associated profile - retrieve - // this and set it in the profile manager - // - cstrColRef.Delete(0, countof(L"ContextColor ")); - cstrColRef.Trim(); - CStringXDW cstrProfile(cstrColRef.Left(cstrColRef.Find(L" "))); - cstrColRef.Delete(0, cstrProfile.GetLength()); - - // - // Set the source profile ready to create the transform, retrieve the channel data - // and clamp between 0.0 and 1.0. - // - if (SUCCEEDED(hr = m_pProfManager->SetSrcProfileFromContainer(cstrProfile.GetBuffer())) && - SUCCEEDED(hr = pChannelData->ResetChannelType(COLOR_FLOAT)) && - SUCCEEDED(hr = pChannelData->SetColorDataType(nChannel)) && - SUCCEEDED(hr = GetFloatChannelData(cstrColRef, pChannelData)) && - SUCCEEDED(hr = pChannelData->ClampChannelValues(0.0f, 1.0f))) - { - // - // Mark the color profile for deletion - // - (*m_pResDel)[cstrProfile] = TRUE; - } - } - else if (0 == cstrColRef.Find(L"#")) - { - // - // Delete the # symbol so we are just left with the RGB values - // - cstrColRef.Delete(0, 1); - - // - // Set the source profile to sRGB rather than assume the default is set to - // sRGB. - // - if (SUCCEEDED(hr = m_pProfManager->SetSrcProfileFromColDir(L"sRGB Color Space Profile.icm")) && - SUCCEEDED(hr = pChannelData->ResetChannelType(COLOR_BYTE)) && - SUCCEEDED(hr = pChannelData->SetColorDataType(sRGB))) - { - while (SUCCEEDED(hr) && - cstrColRef.GetLength() > 0) - { - // - // Add the channel data - // - hr = pChannelData->AddChannelData(static_cast<BYTE>(wcstol(cstrColRef.Left(2), NULL, 16))); - - // - // Delete the channel from the color ref string - // - cstrColRef.Delete(0, 2); - } - } - } - else if (0 == cstrColRef.Find(L"{StaticResource")) - { - *pbIsResourceReference = TRUE; - } - else - { - // - // Unrecognised type - // - RIP("Unrecognised color syntax."); - hr = E_FAIL; - } - } - catch (CXDException& e) - { - hr = e; - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorRefConverter::TransformColor - -Routine Description: - - Method which applies a color transform to a set of color data - -Arguments: - - pSrcData - Pointer to the source color channel data - pDstData - Pointer to the destination color channel data - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorRefConverter::TransformColor( - _In_ CColorChannelData* pSrcData, - _Inout_ CColorChannelData* pDstData - ) -{ - HRESULT hr = S_OK; - - HTRANSFORM hColorTrans = NULL; - - BOOL bUseWCS = FALSE; - - if (SUCCEEDED(hr = CHECK_POINTER(pSrcData, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pDstData, E_POINTER)) && - SUCCEEDED(hr = m_pProfManager->GetColorTransform(&hColorTrans, &bUseWCS))) - { - if (bUseWCS) - { - DWORD cSrcChan = 0; - DWORD cDstChan = 0; - - COLORDATATYPE srcDataType = COLOR_FLOAT; - COLORDATATYPE dstDataType = COLOR_FLOAT; - - DWORD cbSrcChan = 0; - DWORD cbDstChan = 0; - - PBYTE pSrcBuff = NULL; - PBYTE pDstBuff = NULL; - - if (SUCCEEDED(hr = CHECK_POINTER(hColorTrans, E_HANDLE)) && - SUCCEEDED(hr = pSrcData->GetChannelCountNoAlpha(&cSrcChan)) && - SUCCEEDED(hr = pSrcData->GetChannelType(&srcDataType)) && - SUCCEEDED(hr = pSrcData->GetChannelDataNoAlpha(&cbSrcChan, reinterpret_cast<PVOID*>(&pSrcBuff))) && - SUCCEEDED(hr = pDstData->GetChannelCountNoAlpha(&cDstChan)) && - SUCCEEDED(hr = pDstData->GetChannelType(&dstDataType)) && - SUCCEEDED(hr = pDstData->GetChannelDataNoAlpha(&cbDstChan, reinterpret_cast<PVOID*>(&pDstBuff)))) - { - if (cbDstChan > 0) - { - if (!WcsTranslateColorsXD(hColorTrans, - 1, - cSrcChan, - srcDataType, - cbSrcChan, - pSrcBuff, - cDstChan, - dstDataType, - cbDstChan, - pDstBuff)) - { - hr = GetLastErrorAsHResult(); - } - } - else - { - hr = E_FAIL; - } - } - } - else - { - COLOR srcColor; - COLOR dstColor; - - COLORTYPE srcType; - COLORTYPE dstType; - - if (SUCCEEDED(hr = pSrcData->GetColor(&srcColor, &srcType)) && - SUCCEEDED(hr = pDstData->GetColor(&dstColor, &dstType))) - { - if (TranslateColors(hColorTrans, - &srcColor, - 1, - srcType, - &dstColor, - dstType)) - { - hr = pDstData->SetColor(&dstColor, dstType); - } - else - { - hr = GetLastErrorAsHResult(); - } - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorRefConverter::CreateColorString - -Routine Description: - - Method which creates a XML formatted string descripting a transformed set of colors - -Arguments: - - pDstData - Pointer to destination color channel data - pbstrColorRef - Pointer to a string to contain the XML formatted color data - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorRefConverter::CreateColorString( - _In_ CColorChannelData* pDstData, - _Inout_ BSTR* pbstrColorRef - ) -{ - CComBSTR bstrTmpHolder; - - HRESULT hr = S_OK; - - EColorDataType colDataType = sRGB; - if (SUCCEEDED(hr = CHECK_POINTER(pDstData, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pbstrColorRef, E_POINTER)) && - SUCCEEDED(hr = pDstData->GetColorDataType(&colDataType))) - { - try - { - CStringXDW cstrChannelData; - - if (colDataType == scRGB) - { - // - // scRGB - // - cstrChannelData += L"sc#"; - hr = SetFloatChannelData(pDstData, &cstrChannelData); - } - else if (colDataType == nChannel) - { - // - // CMYK - // - cstrChannelData += L"ContextColor "; - - // - // Add the ICC profile and retrieve the URI - // - CComBSTR bstrKey; - CComBSTR bstrICCURI; - if (SUCCEEDED(hr = m_pResCache->WriteResource<IPartColorProfile>(m_pXpsConsumer, m_pFixedPage, m_pProfManager)) && - SUCCEEDED(hr = m_pProfManager->GetKeyName(&bstrKey)) && - SUCCEEDED(hr = m_pResCache->GetURI(bstrKey, &bstrICCURI))) - { - // - // Append the URI and a space - // - cstrChannelData += bstrICCURI; - cstrChannelData += L" "; - - hr = SetFloatChannelData(pDstData, &cstrChannelData); - } - } - else if (colDataType == sRGB) - { - // - // sRGB - // - cstrChannelData += L"#"; - - // - // Over all channels, write out hex byte values - // - DWORD cbData = 0; - PBYTE pData = NULL; - DWORD cChanCount = 0; - if (SUCCEEDED(hr = pDstData->GetChannelData(&cbData, reinterpret_cast<PVOID*>(&pData))) && - SUCCEEDED(hr = pDstData->GetChannelCount(&cChanCount))) - { - if (cbData >= cChanCount * sizeof(BYTE)) - { - for (DWORD cChan = 0; cChan < cChanCount; cChan++) - { - _Analysis_assume_(cChan < cbData); - - CStringXDW cstrChannel; - cstrChannel.Format(L"%02x", pData[cChan]); - cstrChannelData.Append(cstrChannel); - } - } - else - { - hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); - } - } - } - else - { - RIP("Invalid color type\n"); - hr = E_FAIL; - } - - if (SUCCEEDED(hr)) - { - SysFreeString(*pbstrColorRef); - *pbstrColorRef = cstrChannelData.AllocSysString(); - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CResourceDictionaryConverter::CResourceDictionaryConverter - -Routine Description: - - CResourceDictionaryConverter constructir - -Arguments: - - pXpsConsumer - Pointer to the XPS consumer interface - pFixedPage - Pointer to the fixed page interface - pResCache - Pointer to the resource cache - pProfManager - Pointer to the color profile manager - pResDel - Pointer to the list of resources to delete from the page - pBmpConv - Pointer to the bitmap conversion class - pRefConv - Pointer to the color reference conversion class - -Return Value: - - None - Throws an exception on error. - ---*/ -CResourceDictionaryConverter::CResourceDictionaryConverter( - _In_ IXpsDocumentConsumer* pXpsConsumer, - _In_ IFixedPage* pFixedPage, - _In_ CFileResourceCache* pResCache, - _In_ CProfileManager* pProfManager, - _In_ ResDeleteMap* pResDel, - _In_ CBitmapColorConverter* pBmpConv, - _In_ CColorRefConverter* pRefConv - ) : - CColorConverter(pXpsConsumer, pFixedPage, pResCache, pProfManager, pResDel), - m_pBmpConv(pBmpConv), - m_pRefConv(pRefConv) -{ - if (m_pBmpConv == NULL || - m_pRefConv == NULL) - { - throw CXDException(E_POINTER); - } -} - -/*++ - -Routine Name: - - CResourceDictionaryConverter::~CResourceDictionaryConverter - -Routine Description: - - CResourceDictionaryConverter destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CResourceDictionaryConverter::~CResourceDictionaryConverter() -{ -} - -/*++ - -Routine Name: - - CResourceDictionaryConverter::Convert - -Routine Description: - - Applies color conversion on a remote resource dictionary. This is achieved - by creating a color SAX parser passing a stream based off the resource - -Arguments: - - pbstrDictionaryURI - The remote dictionary URI - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CResourceDictionaryConverter::Convert( - _Inout_ BSTR* pbstrDictionaryURI - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrDictionaryURI, E_POINTER))) - { - try - { - CStringXDW cstrOriginalURI(*pbstrDictionaryURI); - - // - // Create a color managed dictionary object and pass to the cache manager - // - CRemoteDictionary newDictionary(m_pFixedPage, m_pBmpConv, m_pRefConv, *pbstrDictionaryURI); - - CComBSTR bstrKey; - if (SUCCEEDED(hr = m_pResCache->WriteResource<IPartResourceDictionary>(m_pXpsConsumer, m_pFixedPage, &newDictionary)) && - SUCCEEDED(hr = newDictionary.GetKeyName(&bstrKey)) && - SUCCEEDED(hr = m_pResCache->GetURI(bstrKey, pbstrDictionaryURI))) - { - (*m_pResDel)[cstrOriginalURI] = TRUE; - } - } - catch (CXDException& e) - { - hr = e; - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/color/colconv.h b/print/XPSDrvSmpl/src/filters/color/colconv.h deleted file mode 100644 index a658df7f..00000000 --- a/print/XPSDrvSmpl/src/filters/color/colconv.h +++ /dev/null @@ -1,167 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - colconv.h - -Abstract: - - Color conversion class definition. The CColorConverter class is responsible - for managing the color conversion process for vector objects and bitmaps. - ---*/ - -#pragma once - -#include "colchan.h" -#include "rescache.h" -#include "profman.h" -#include "wcsapiconv.h" -#include "cmflt.h" - -class CColorConverter -{ -public: - CColorConverter( - _In_ IXpsDocumentConsumer* pXpsConsumer, - _In_ IFixedPage* pFixedPage, - _In_ CFileResourceCache* pResCache, - _In_ CProfileManager* pProfManager, - _In_ ResDeleteMap* pResDel - ); - - virtual ~CColorConverter(); - - virtual HRESULT - Convert( - _Inout_ BSTR* pbstr - ) = 0; - -protected: - CComPtr<IXpsDocumentConsumer> m_pXpsConsumer; - - CComPtr<IFixedPage> m_pFixedPage; - - CProfileManager* m_pProfManager; - - CFileResourceCache* m_pResCache; - - ResDeleteMap* m_pResDel; -}; - -class CBitmapColorConverter : public CColorConverter -{ -public: - CBitmapColorConverter( - _In_ IXpsDocumentConsumer* pXpsConsumer, - _In_ IFixedPage* pFixedPage, - _In_ CFileResourceCache* pResCache, - _In_ CProfileManager* pProfManager, - _In_ ResDeleteMap* pResDel - ); - - virtual ~CBitmapColorConverter(); - - HRESULT - Convert( - _Inout_ BSTR* pbstrBmpURI - ); -}; - -class CColorRefConverter : public CColorConverter -{ -public: - CColorRefConverter( - _In_ IXpsDocumentConsumer* pXpsConsumer, - _In_ IFixedPage* pFixedPage, - _In_ CFileResourceCache* pResCache, - _In_ CProfileManager* pProfManager, - _In_ ResDeleteMap* pResDel - ); - - virtual ~CColorRefConverter(); - - HRESULT - Convert( - _Inout_ BSTR* pbstrColorRef - ); - -private: - HRESULT - InitDstChannels( - _In_ CColorChannelData* pChannelDataSrc, - _Inout_ CColorChannelData* pChannelDataDst - ); - - HRESULT - GetFloatChannelData( - _In_ LPCWSTR szColorRef, - _Inout_ CColorChannelData* pChannelData - ); - - HRESULT - SetFloatChannelData( - _In_ CColorChannelData* pChannelData, - _Inout_ CStringXDW* pcstrChannelData - ); - - HRESULT - ParseColorString( - _In_ BSTR bstrColorRef, - _Inout_ CColorChannelData* pChannelData, - _Out_ BOOL* pbIsResourceReference - ); - - HRESULT - TransformColor( - _In_ CColorChannelData* pSrcData, - _Inout_ CColorChannelData* pDstData - ); - - HRESULT - CreateColorString( - _In_ CColorChannelData* pDstData, - _Inout_ BSTR* pbstrColorRef - ); - -private: - CColorChannelData m_srcData; - - CColorChannelData m_dstData; -}; - -class CResourceDictionaryConverter : public CColorConverter -{ -public: - CResourceDictionaryConverter( - _In_ IXpsDocumentConsumer* pXpsConsumer, - _In_ IFixedPage* pFixedPage, - _In_ CFileResourceCache* pResCache, - _In_ CProfileManager* pProfManager, - _In_ ResDeleteMap* pResDel, - _In_ CBitmapColorConverter* pBmpConv, - _In_ CColorRefConverter* pRefConv - ); - - virtual ~CResourceDictionaryConverter(); - - HRESULT - Convert( - _Inout_ BSTR* pbstrDictionaryURI - ); - -private: - CBitmapColorConverter* m_pBmpConv; - - CColorRefConverter* m_pRefConv; -}; - diff --git a/print/XPSDrvSmpl/src/filters/color/dictionary.cpp b/print/XPSDrvSmpl/src/filters/color/dictionary.cpp deleted file mode 100644 index efd15760..00000000 --- a/print/XPSDrvSmpl/src/filters/color/dictionary.cpp +++ /dev/null @@ -1,289 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - dict.cpp - -Abstract: - - Dictionary class implementation. The CRemoteDictionary class is responsible - for representing a single dictionay including managing any color - transforms in that dictionary and writing the dictionary out. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "dictionary.h" -#include "cmsax.h" - -/*++ - -Routine Name: - - CRemoteDictionary::CRemoteDictionary - -Routine Description: - - Constructor for the CRemoteDictionary class which registers the URI to the resource - being represented and pointers to suitable color transformation objects - for use with color elements within that resource - -Arguments: - - bstrResURI - String containing the URI to the resource to be handled - pBmpConverter - Pointer to a bitmap color conversion object - pRefConverter - Pointer to a vector color conversion object - -Return Value: - - None - Throws CXDException(HRESULT) on an error - ---*/ -CRemoteDictionary::CRemoteDictionary( - _In_ IFixedPage* pFixedPage, - _In_ CBitmapColorConverter* pBmpConverter, - _In_ CColorRefConverter* pRefConverter, - _In_ BSTR bstrResURI - ) : - m_pFixedPage(pFixedPage), - m_pBmpConverter(pBmpConverter), - m_pRefConverter(pRefConverter), - m_bstrDictionaryURI(bstrResURI) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(m_pFixedPage, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(m_pRefConverter, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(m_pBmpConverter, E_POINTER))) - { - if (m_bstrDictionaryURI.Length() == 0) - { - hr = E_INVALIDARG; - } - } - - if (FAILED(hr)) - { - throw CXDException(hr); - } -} - -/*++ - -Routine Name: - - CRemoteDictionary::~CRemoteDictionary - -Routine Description: - - Destructor for the CRemoteDictionary class - -Arguments: - - None - -Return Value: - - None - ---*/ -CRemoteDictionary::~CRemoteDictionary() -{ -} - -/*++ - -Routine Name: - - CRemoteDictionary::WriteData - -Routine Description: - - This method handles the parsing of a new dictionary and - the writing out the new dictionary - -Arguments: - - pWriter - Pointer to a stream to write the resource out to - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CRemoteDictionary::WriteData( - _In_ IPartBase* pResource, - _In_ IPrintWriteStream* pWriter - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pResource, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pWriter, E_POINTER))) - { - try - { - CComPtr<IUnknown> pRead(NULL); - CComPtr<IPartResourceDictionary> pResDictPart(NULL); - CComPtr<IPrintReadStream> pReader(NULL); - - if (SUCCEEDED(hr = m_pFixedPage->GetPagePart(m_bstrDictionaryURI, &pRead)) && - SUCCEEDED(hr = pRead->QueryInterface(&pResDictPart)) && - SUCCEEDED(hr = pResDictPart->GetStream(&pReader))) - { - // - // Create a SAX handler to parse the markup in the fixed page - // - CCMSaxHandler cmSaxHndlr(pWriter, m_pBmpConverter, m_pRefConverter, NULL); - - // - // Set-up the SAX reader and begin parsing the mark-up - // - CComPtr<ISAXXMLReader> pSaxRdr(NULL); - - if (SUCCEEDED(hr = pSaxRdr.CoCreateInstance(CLSID_SAXXMLReader60)) && - SUCCEEDED(hr = pSaxRdr->putContentHandler(&cmSaxHndlr))) - { - CComPtr<ISequentialStream> pReadStreamToSeq(NULL); - - pReadStreamToSeq.Attach(new(std::nothrow) pfp::PrintReadStreamToSeqStream(pReader)); - - if (SUCCEEDED(hr = CHECK_POINTER(pReadStreamToSeq, E_OUTOFMEMORY))) - { - hr = pSaxRdr->parse(CComVariant(static_cast<ISequentialStream*>(pReadStreamToSeq))); - } - } - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - - -/*++ - -Routine Name: - - CRemoteDictionary::GetKeyName - -Routine Description: - - Method to obtain a unique key for the resource being handled - -Arguments: - - pbstrKeyName - Pointer to a string to hold the generated key - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CRemoteDictionary::GetKeyName( - _Outptr_ BSTR* pbstrKeyName - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrKeyName, E_POINTER))) - { - if (m_bstrDictionaryURI.Length() > 0) - { - *pbstrKeyName = NULL; - - // - // The full URI to the resource is a suitable key - // - if (SUCCEEDED(hr = m_bstrDictionaryURI.CopyTo(pbstrKeyName)) && - !*pbstrKeyName) - { - hr = E_OUTOFMEMORY; - } - } - else - { - hr = E_PENDING; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CRemoteDictionary::GetResURI - -Routine Description: - - Method to obtain the URI of the resource being handled - -Arguments: - - pbstrResURI - Pointer to a string to hold the resource URI - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CRemoteDictionary::GetResURI( - _Outptr_ BSTR* pbstrResURI - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrResURI, E_POINTER))) - { - *pbstrResURI = NULL; - - try - { - // - // Create a unique name for the dictionary for this print session - // - CStringXDW cstrURI; - cstrURI.Format(L"%s_%u.dict", static_cast<LPCWSTR>(m_bstrDictionaryURI), GetUniqueNumber()); - - *pbstrResURI = cstrURI.AllocSysString(); - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/color/dictionary.h b/print/XPSDrvSmpl/src/filters/color/dictionary.h deleted file mode 100644 index 42e4e974..00000000 --- a/print/XPSDrvSmpl/src/filters/color/dictionary.h +++ /dev/null @@ -1,65 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - dict.h - -Abstract: - - Dictionary class definition. The CRemoteDictionary class is responsible - for representing a single dictionay including managing any color - transforms in that dictionary and writing the dictionary out. - ---*/ - -#pragma once - -#include "colconv.h" - -class CRemoteDictionary : public IResWriter -{ -public: - CRemoteDictionary( - _In_ IFixedPage* pFixedPage, - _In_ CBitmapColorConverter* pBmpConverter, - _In_ CColorRefConverter* pRefConverter, - _In_ BSTR bstrResURI - ); - - ~CRemoteDictionary(); - - HRESULT - WriteData( - _In_ IPartBase* pResource, - _In_ IPrintWriteStream* pStream - ); - - HRESULT - GetKeyName( - _Outptr_ BSTR* pbstrKeyName - ); - - HRESULT - GetResURI( - _Outptr_ BSTR* pbstrResURI - ); - -private: - CComBSTR m_bstrDictionaryURI; - - CBitmapColorConverter* m_pBmpConverter; - - CColorRefConverter* m_pRefConverter; - - CComPtr<IFixedPage> m_pFixedPage; -}; - diff --git a/print/XPSDrvSmpl/src/filters/color/dllentry.cpp b/print/XPSDrvSmpl/src/filters/color/dllentry.cpp deleted file mode 100644 index fff45c12..00000000 --- a/print/XPSDrvSmpl/src/filters/color/dllentry.cpp +++ /dev/null @@ -1,145 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - dllentry.cpp - -Abstract: - - Implementation of the color management filter dllentry points. Dllmain only - stores the instance handle. DllGetClassObject calls on to a generic - get class factory template function. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "clasfact.h" -#include "cmflt.h" -#include "xdexcept.h" -#include "xdstring.h" - -/*++ - -Routine Name: - - DllMain - -Routine Description: - - Entry point to the color management filter which is called when a new process is started - -Arguments: - - hInst - Handle to the DLL - wReason - Specifies a flag indicating why the DLL entry-point function is being called - -Return Value: - - TRUE - ---*/ -BOOL WINAPI -DllMain( - _In_ HINSTANCE hInst, - _In_ WORD wReason, - _In_opt_ LPVOID - ) -{ - switch (wReason) - { - case DLL_PROCESS_ATTACH: - { - g_hInstance = hInst; - } - break; - } - - return TRUE; -} - -/*++ - -Routine Name: - - DllCanUnloadNow - -Routine Description: - - Method which reports whether the DLL is in use to allow the caller to unload - the DLL safely - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - Dll can unload - S_FALSE - Dll can't unload - ---*/ -STDAPI -DllCanUnloadNow() -{ - if (g_cServerLocks == 0) - { - return S_OK ; - } - else - { - return S_FALSE; - } -} - -/*++ - -Routine Name: - - DllGetClassObject - -Routine Description: - - Method to return the current class object - -Arguments: - - rclsid - CLSID that will associate the correct data and code - riid - Reference to the identifier of the interface that the caller is to use to communicate with the class object - ppv - Address of pointer variable that receives the interface pointer requested in riid - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - CLASS_E_CLASSNOTAVAILABLE - On unsupported class - ---*/ -STDAPI -DllGetClassObject( - _In_ REFCLSID rclsid, - _In_ REFIID riid, - _Outptr_ LPVOID FAR* ppv - ) -{ - // - // 21934A6D-EA30-480a-8DAD-C8045807F737 - // - CLSID colorCLSID = {0x21934A6D, 0xEA30, 0x480a, {0x8D, 0xAD, 0xC8, 0x04, 0x58, 0x07, 0xF7, 0x37}}; - - return GetFilterClassFactory<CColorManageFilter>(rclsid, riid, colorCLSID, ppv); -} - diff --git a/print/XPSDrvSmpl/src/filters/color/precompsrc.cpp b/print/XPSDrvSmpl/src/filters/color/precompsrc.cpp deleted file mode 100644 index 5944cf51..00000000 --- a/print/XPSDrvSmpl/src/filters/color/precompsrc.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "precomp.h"
\ No newline at end of file diff --git a/print/XPSDrvSmpl/src/filters/color/profile.cpp b/print/XPSDrvSmpl/src/filters/color/profile.cpp deleted file mode 100644 index e3a8368c..00000000 --- a/print/XPSDrvSmpl/src/filters/color/profile.cpp +++ /dev/null @@ -1,709 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - profile.cpp - -Abstract: - - Profile class implementation. The profile class is responsible for loading and maintaining - colo profile resources. The class provides methods for loading profiles from filename or - URI and is responsible for limited caching based off the file name and the (WCS)OpenProfile - options. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "profile.h" -#include "wcsapiconv.h" - -DWORD g_tagWCSProfile = 'MS00'; - -/*++ - -Routine Name: - - CProfile::CProfile - -Routine Description: - - CProfile constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CProfile::CProfile() : - m_hProfile(NULL), - m_dwDesiredAccess(PROFILE_READ), - m_dwShareMode(FILE_SHARE_READ), - m_dwCreationMode(OPEN_EXISTING), - m_dwWCSFlags(0) -{ -} - -/*++ - -Routine Name: - - CProfile::~CProfile - -Routine Description: - - CProfile destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CProfile::~CProfile() -{ - FreeProfile(); -} - -/*++ - -Routine Name: - - CProfile::SetProfile - -Routine Description: - - Sets the current profile from the fixed page using the specified resoure URI - -Arguments: - - pFP - Pointer to the fixed page interface - szURI - URI to the ICC profile to load - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CProfile::SetProfile( - _In_ IFixedPage* pFP, - _In_ LPCWSTR szURI - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pFP, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(szURI, E_POINTER))) - { - try - { - CStringXDW cstrKey; - - if (SUCCEEDED(hr = CreateProfileKey(szURI, NULL, NULL, &cstrKey)) && - (m_hProfile == NULL || - m_cstrProfileKey != cstrKey)) - { - FreeProfile(); - - // - // Get the read stream for the URI - // - CComPtr<IUnknown> pPart(NULL); - CComPtr<IPartColorProfile> pProfilePart(NULL); - CComPtr<IPrintReadStream> pRead(NULL); - CComBSTR bstrProfileURI(szURI); - - ULONGLONG cbEnd = 0; - - // - // Get the profile part and a read stream. Seek to the end to find the - // size of the profile data - // - if (SUCCEEDED(hr = pFP->GetPagePart(bstrProfileURI, &pPart)) && - SUCCEEDED(hr = pPart.QueryInterface(&pProfilePart)) && - SUCCEEDED(hr = pProfilePart->GetStream(&pRead)) && - SUCCEEDED(hr = pRead->Seek(0, STREAM_SEEK_END, &cbEnd))) - { - // - // Allocate the buffer and copy - // - UINT cbProfileData = static_cast<UINT>(cbEnd); - PBYTE pProfileData = new(std::nothrow) BYTE[cbProfileData]; - - ULONG cbRead; - BOOL bEOF = FALSE; - if (SUCCEEDED(hr = CHECK_POINTER(pProfileData, E_OUTOFMEMORY)) && - SUCCEEDED(hr = pRead->Seek(0, STREAM_SEEK_SET, &cbEnd)) && - SUCCEEDED(hr = pRead->ReadBytes(pProfileData, cbProfileData, &cbRead, &bEOF))) - { - if (cbProfileData != cbRead) - { - RIP("Failed to read all profile data\n"); - - hr = E_FAIL; - } - } - - // - // Create the transform from the buffer - // - if (SUCCEEDED(hr)) - { - PROFILE profile = { - PROFILE_MEMBUFFER, - pProfileData, - cbProfileData - }; - - if (SUCCEEDED(hr = OpenProfile(&profile, &m_hProfile))) - { - m_cstrProfileKey = cstrKey; - } - } - - if (pProfileData != NULL) - { - delete[] pProfileData; - pProfileData = NULL; - } - } - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CProfile::SetProfile - -Routine Description: - - Sets a profile from the specified file name - -Arguments: - - szFileName - File name of the profile to open - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CProfile::SetProfile( - _In_ LPCWSTR szFileName - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(szFileName, E_POINTER))) - { - try - { - CStringXDW cstrKey; - - if (SUCCEEDED(hr = CreateProfileKey(szFileName, NULL, NULL, &cstrKey)) && - (m_hProfile == NULL || - m_cstrProfileKey != cstrKey)) - { - FreeProfile(); - - CStringXDW profileFileName(szFileName); - PROFILE profile = { - PROFILE_FILENAME, - profileFileName.GetBuffer(), - profileFileName.GetLength() * sizeof(WCHAR) - }; - - if (SUCCEEDED(hr = OpenProfile(&profile, &m_hProfile))) - { - m_cstrProfileKey = cstrKey; - } - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CProfile::SetProfile - -Routine Description: - - Sets a color profile from memory - -Arguments: - - szProfile - Name of the profile. This is used for caching puproses - pBuffer - Buffer containing the profile data - cbBuffer - Size of the buffer - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CProfile::SetProfile( - _In_ LPWSTR szProfile, - _In_reads_bytes_(cbBuffer) PBYTE pBuffer, - _In_ UINT cbBuffer - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(szProfile, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pBuffer, E_POINTER))) - { - try - { - CStringXDW cstrKey; - - if (SUCCEEDED(hr = CreateProfileKey(szProfile, NULL, NULL, &cstrKey)) && - (m_hProfile == NULL || - m_cstrProfileKey != cstrKey)) - { - FreeProfile(); - - PROFILE profile = { - PROFILE_MEMBUFFER, - pBuffer, - cbBuffer - }; - - if (SUCCEEDED(hr = OpenProfile(&profile, &m_hProfile))) - { - m_cstrProfileKey = cstrKey; - } - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CProfile::GetProfileHandle - -Routine Description: - - Retrieves the current profile handle - -Arguments: - - phProfile - Pointer to a HPROFILE that accepts the current profile handle - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CProfile::GetProfileHandle( - _Out_ HPROFILE* phProfile - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(phProfile, E_POINTER))) - { - *phProfile = NULL; - if (SUCCEEDED(hr = CHECK_HANDLE(m_hProfile, E_PENDING))) - { - *phProfile = m_hProfile; - } - } - - ERR_ON_HR_EXC(hr, E_PENDING); - return hr; -} - -/*++ - -Routine Name: - - CProfile::IsWCSCompatible - -Routine Description: - - Checks if the current profile is suitable for use with WCS - -Arguments: - - pbWCSCompat - Pointer to BOOL the accepts the result - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CProfile::IsWCSCompatible( - _Out_ BOOL* pbWCSCompat - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbWCSCompat, E_POINTER)) && - SUCCEEDED(hr = CHECK_HANDLE(m_hProfile, E_PENDING))) - { - // - // Assume true as the GetColorProfileHeader documentation states: "This function - // does not support Windows Color System (WCS) profiles CAMP, DMP, and GMMP.", therefore - // if the profile is loaded and it is not ICC (i.e. no header) it should be WCS compatible - // - *pbWCSCompat = TRUE; - - PROFILEHEADER profileHeader = {0}; - if (GetColorProfileHeader(m_hProfile, &profileHeader)) - { - if (profileHeader.phClass == CLASS_LINK || - profileHeader.phClass == CLASS_NAMED) - { - *pbWCSCompat = FALSE; - } - } - } - - ERR_ON_HR(hr); - return hr; -} - - -/*++ - -Routine Name: - - CProfile::GetProfileKey - -Routine Description: - - Retrieves a key identifying the current profile. This is composed of the profile name - and the options used to create the profile - -Arguments: - - pcstrProfileKey - Pointer to a CStringXDW object that recieves the key - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CProfile::GetProfileKey( - _Out_ CStringXDW* pcstrProfileKey - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pcstrProfileKey, E_POINTER))) - { - try - { - *pcstrProfileKey = m_cstrProfileKey; - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CProfile::operator== - -Routine Description: - - CProfile equality operator - -Arguments: - - cstrProfileKey - the key to compare against - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -BOOL -CProfile::operator==( - _In_ CONST CStringXDW& cstrProfileKey - ) CONST -{ - BOOL bEqual = TRUE; - - try - { - if (m_cstrProfileKey != cstrProfileKey) - { - bEqual = FALSE; - } - } - catch (CXDException&) - { - bEqual = FALSE; - } - - return bEqual; -} - -/*++ - -Routine Name: - - CProfile::operator!= - -Routine Description: - - CProfile inequality operator - -Arguments: - - cstrProfileKey - profile key to compare against - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -BOOL -CProfile::operator!=( - _In_ CONST CStringXDW& cstrProfileKey - ) CONST -{ - return !operator==(cstrProfileKey); -} - -/*++ - -Routine Name: - - CProfile::FreeProfile - -Routine Description: - - Frees the current profile - -Arguments: - - None - -Return Value: - - None - ---*/ -VOID -CProfile::FreeProfile( - VOID - ) -{ - try - { - m_cstrProfileKey.Empty(); - } - catch (CXDException&) - { - } - - if (m_hProfile != NULL) - { - CloseColorProfile(m_hProfile); - m_hProfile = NULL; - } -} - -/*++ - -Routine Name: - - CProfile::OpenProfile - -Routine Description: - - Opens the current profile based off the current OS. Vista uses WCSOpenProfile while - earlier Windows use OpenProfile - -Arguments: - - pProfile - Pointer to the profile structure used to open the profile - phProfile - Pointer to a HPROFILE to recieve the opened profile handle - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CProfile::OpenProfile( - _In_ PROFILE* pProfile, - _Out_ HPROFILE* phProfile - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pProfile, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(phProfile, E_POINTER))) - { - // - // Get a handle to the color profile using WCS in Vista or the XP API in earlier operating systems - // - if (IsVista()) - { - *phProfile = WcsOpenColorProfileXD(pProfile, NULL, NULL, m_dwDesiredAccess, m_dwShareMode, m_dwCreationMode, m_dwWCSFlags); - } - else - { - *phProfile = OpenColorProfile(pProfile, m_dwDesiredAccess, m_dwShareMode, m_dwCreationMode); - } - - if (FAILED(CHECK_POINTER(*phProfile, E_POINTER))) - { - hr = GetLastErrorAsHResult(); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CProfile::CreateProfileKey - -Routine Description: - - Creates a profile key based on the possible profile names used to construct the - profile and the settings used to open the profile - -Arguments: - - - pszCDMP - Device model profile name - pszCAMP - Color adjustment model profile name - pszGMMP - Gamut model profile name - pcstrKey - Pointer to a CStringXDW that recieves the key - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CProfile::CreateProfileKey( - _In_ LPCWSTR pszCDMP, - _In_opt_ LPCWSTR pszCAMP, - _In_opt_ LPCWSTR pszGMMP, - _Out_ CStringXDW* pcstrKey - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pszCDMP, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pcstrKey, E_POINTER))) - { - try - { - pcstrKey->Empty(); - pcstrKey->Append(pszCDMP); - - if (pszCAMP != NULL) - { - pcstrKey->Append(pszCAMP); - } - - if (pszGMMP != NULL) - { - pcstrKey->Append(pszGMMP); - } - - CStringXDW cstrOpenOptions; - cstrOpenOptions.Format(L"%x%x%x%x", m_dwDesiredAccess, m_dwShareMode, m_dwCreationMode, m_dwWCSFlags); - - pcstrKey->Append(cstrOpenOptions); - pcstrKey->MakeLower(); - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/color/profile.h b/print/XPSDrvSmpl/src/filters/color/profile.h deleted file mode 100644 index 46fa46fa..00000000 --- a/print/XPSDrvSmpl/src/filters/color/profile.h +++ /dev/null @@ -1,124 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - profile.h - -Abstract: - - Profile class definition. The profile class is responsible for loading and maintaining - colo profile resources. The class provides methods for loading profiles from filename or - URI and is responsible for limited caching based off the file name and the (WCS)OpenProfile - options. - ---*/ - -#pragma once - -class CProfile -{ -public: - CProfile(); - - ~CProfile(); - - HRESULT - SetProfile( - _In_ IFixedPage* pFP, - _In_ LPCWSTR szURI - ); - - HRESULT - SetProfile( - _In_ LPCWSTR szURI - ); - - HRESULT - SetProfile( - _In_ LPWSTR szProfile, - _In_reads_bytes_(cbBuffer) PBYTE pBuffer, - _In_ UINT cbBuffer - ); - - HRESULT - GetProfileHandle( - _Out_ HPROFILE* phProfile - ); - - HRESULT - IsWCSCompatible( - _Out_ BOOL* pbWCSCompat - ); - - HRESULT - GetProfileKey( - _Out_ CStringXDW* pcstrProfileURI - ); - - BOOL - operator==( - _In_ CONST CStringXDW& cstrProfileKey - ) CONST; - - BOOL - operator!=( - _In_ CONST CStringXDW& cstrProfileKey - ) CONST; - -private: - HRESULT - CreateProfileBuffer( - VOID - ); - - VOID - FreeProfile( - VOID - ); - - HRESULT - OpenProfile( - _In_ PROFILE* pProfile, - _Out_ HPROFILE* phProfile - ); - - HRESULT - CreateProfileKey( - _In_ LPCWSTR pszCDMP, - _In_opt_ LPCWSTR pszCAMP, - _In_opt_ LPCWSTR pszGMMP, - _Out_ CStringXDW* pcstrKey - ); - -private: - HPROFILE m_hProfile; - - DWORD m_dwDesiredAccess; - - DWORD m_dwShareMode; - - DWORD m_dwCreationMode; - - DWORD m_dwWCSFlags; - - // - // We define a key for a profile as the URI(s) plus any options used when - // creating the profile. This allows anything that uses this profile in - // combination with other profiles to identify the constituents of the - // transform and hence cache that transform without needing to store the - // profile handles. - // - // Note: Do not cache against the handle as handles can be re-used - // - CStringXDW m_cstrProfileKey; -}; - diff --git a/print/XPSDrvSmpl/src/filters/color/profman.cpp b/print/XPSDrvSmpl/src/filters/color/profman.cpp deleted file mode 100644 index 16ee9dc2..00000000 --- a/print/XPSDrvSmpl/src/filters/color/profman.cpp +++ /dev/null @@ -1,818 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - profman.cpp - -Abstract: - - Color profile class implementation. The CProfileManager class represents - a color profile and provides a transform from the system default profile - to the supplied profile. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "xdexcept.h" -#include "profman.h" - -using XDPrintSchema::PageSourceColorProfile::PageSourceColorProfileData; -using XDPrintSchema::PageSourceColorProfile::EProfileOption; -using XDPrintSchema::PageSourceColorProfile::RGB; -using XDPrintSchema::PageSourceColorProfile::CMYK; - -using XDPrintSchema::PageICMRenderingIntent::PageICMRenderingIntentData; -using XDPrintSchema::PageICMRenderingIntent::AbsoluteColorimetric; -using XDPrintSchema::PageICMRenderingIntent::RelativeColorimetric; -using XDPrintSchema::PageICMRenderingIntent::Photographs; -using XDPrintSchema::PageICMRenderingIntent::BusinessGraphics; - - -/*++ - -Routine Name: - - CProfileManager::CProfileManager - -Routine Description: - - Constructor for the CProfileManager class which records internally the device name, - color profile structure, color intents data and initialises the CProfileManager - ready to supply suitable color transforms - -Arguments: - - pszDeviceName - Pointer to a string containing the device name - cmProfData - Structure containing color profile settings from the PrintTicket - cmIntData - Structure containing color intents settings from the PrintTicket - -Return Value: - - None - Throws CXDException(HRESULT) on an error - ---*/ -CProfileManager::CProfileManager( - _In_ LPCWSTR pszDeviceName, - _In_ PageSourceColorProfileData cmProfData, - _In_ PageICMRenderingIntentData cmIntData, - _In_ IFixedPage* pFP - ) : - m_strDeviceName(pszDeviceName), - m_cmProfData(cmProfData), - m_cmIntData(cmIntData), - m_pFixedPage(pFP) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pszDeviceName, E_POINTER)) || - SUCCEEDED(hr = CHECK_POINTER(m_pFixedPage, E_POINTER))) - { - if(m_strDeviceName.GetLength() <= 0) - { - hr = E_INVALIDARG; - } - } - - if (FAILED(hr)) - { - throw CXDException(E_INVALIDARG); - } -} - -/*++ - -Routine Name: - - CProfileManager::~CProfileManager - -Routine Description: - - Default destructor for the CProfileManager class which performs and clean up - -Arguments: - - None - -Return Value: - - None - ---*/ -CProfileManager::~CProfileManager() -{ -} - -/*++ - -Routine Name: - - CProfileManager::GetColorTransform - -Routine Description: - - Method which supplies a color transform based on the settings in the PrintTicket - -Arguments: - - phColorTrans - Pointer to a color transform handle which will contain - a transform based off the settings in the PrintTicket - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CProfileManager::GetColorTransform( - _Out_ HTRANSFORM* phColorTrans, - _Out_ BOOL* pbUseWCS - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbUseWCS, E_POINTER)) && - SUCCEEDED(hr = CHECK_HANDLE(phColorTrans, E_POINTER)) && - SUCCEEDED(hr = m_dstProfile.SetProfile(m_cmProfData.cmProfileName))) - { - *pbUseWCS = IsVista(); - - try - { - // - // Construct and populate a profile list for the transform object - // - ProfileList profileList; - - // - // Check the source profile has been set. GetProfileHandle will return an error - // if it has not been. - // - HPROFILE hProfile = NULL; - if (SUCCEEDED(hr = m_srcProfile.GetProfileHandle(&hProfile))) - { - profileList.push_back(&m_srcProfile); - profileList.push_back(&m_dstProfile); - - // - // Map the PrintTicket intents option to the ICM option - // - DWORD intents = INTENT_ABSOLUTE_COLORIMETRIC; - switch (m_cmIntData.cmOption) - { - case AbsoluteColorimetric: - { - intents = INTENT_ABSOLUTE_COLORIMETRIC; - } - break; - - case RelativeColorimetric: - { - intents = INTENT_RELATIVE_COLORIMETRIC; - } - break; - - case Photographs: - { - intents = INTENT_PERCEPTUAL; - } - break; - - case BusinessGraphics: - default: - { - intents = INTENT_SATURATION; - } - break; - } - - DWORD flRender = BEST_MODE; - - // - // Check if the source and destination profiles are compatible with WCS - // - if (*pbUseWCS && - SUCCEEDED(hr = m_srcProfile.IsWCSCompatible(pbUseWCS))) - { - if (*pbUseWCS) - { - hr = m_dstProfile.IsWCSCompatible(pbUseWCS); - } - } - - if (SUCCEEDED(hr) && - *pbUseWCS) - { - // - // Everything is in place for using WCS - // - flRender |= WCS_ALWAYS; - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = m_colorTrans.CreateTransform(&profileList, intents, flRender))) - { - hr = m_colorTrans.GetTransformHandle(phColorTrans); - } - } - } - catch (CXDException& e) - { - hr = e; - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CProfileManager::GetDstProfileType - -Routine Description: - - Method to return the color profile type as read from the PrintTicket - -Arguments: - - pType - Pointer to the profile type to be filled in - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CProfileManager::GetDstProfileType( - _Out_ EProfileOption* pType - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pType, E_POINTER))) - { - *pType = m_cmProfData.cmProfile; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CProfileManager::GetDstProfileName - -Routine Description: - - Method which returns the systems default colour profile name - -Arguments: - - pbstrProfileName - Pointer to string to hold the profile name - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CProfileManager::GetDstProfileName( - _Inout_ BSTR* pbstrProfileName - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrProfileName, E_POINTER))) - { - try - { - CStringXDW cstrURI; - - if (m_cmProfData.cmProfile == RGB || - m_cmProfData.cmProfile == CMYK) - { - if (SUCCEEDED(hr = GetColDir(&cstrURI))) - { - cstrURI += L"\\"; - cstrURI += m_cmProfData.cmProfileName; - } - } - else - { - hr = E_NOTIMPL; - } - SysFreeString(*pbstrProfileName); - *pbstrProfileName = cstrURI.AllocSysString(); - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CProfileManager::SetSrcProfileFromContainer - -Routine Description: - - Method which sets the source colour profile from a profile within the - XPS container - -Arguments: - - pszProfileURI - Pointer to string holding the profile URI - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CProfileManager::SetSrcProfileFromContainer( - _In_ LPWSTR szProfileURI - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(szProfileURI, E_POINTER))) - { - hr = m_srcProfile.SetProfile(m_pFixedPage, szProfileURI); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CProfileManager::SetSrcProfileFromColDir - -Routine Description: - - Method which sets the source colour profile from the color directory - -Arguments: - - pszProfile - Pointer to string holding the profile name - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CProfileManager::SetSrcProfileFromColDir( - _In_ LPWSTR szProfile - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(szProfile, E_POINTER))) - { - hr = SetProfileFromColDir(&m_srcProfile, szProfile); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CProfileManager::SetSrcProfileFromBuffer - -Routine Description: - - Method which sets the source colour profile from a buffer - -Arguments: - - pszProfile - Pointer to string holding the profile name - pBuffer - Pointer to buffer holding the profile data - cbBuffer - Count of bytes in the profile buffer - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CProfileManager::SetSrcProfileFromBuffer( - _In_ LPWSTR szProfile, - _In_reads_bytes_(cbBuffer) PBYTE pBuffer, - _In_ UINT cbBuffer - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(szProfile, E_POINTER)) || - SUCCEEDED(hr = CHECK_POINTER(pBuffer, E_POINTER))) - { - hr = m_srcProfile.SetProfile(szProfile, pBuffer, cbBuffer); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CProfileManager::GetProfileOption - -Routine Description: - - This method retrieves the profile option set in the PrintTicket - -Arguments: - - pProfileOption - Pointer to a profile option enumeration type to recieve the option - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CProfileManager::GetProfileOption( - _Out_ EProfileOption* pProfileOption - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pProfileOption, E_POINTER))) - { - *pProfileOption = m_cmProfData.cmProfile; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CProfileManager::WriteData - -Routine Description: - - This method handles writing the destination profile to the container - -Arguments: - - pStream - Pointer to a stream to write the resource out to - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CProfileManager::WriteData( - _In_ IPartBase* pResource, - _In_ IPrintWriteStream* pStream - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pResource, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pStream, E_POINTER))) - { - HANDLE hFile = INVALID_HANDLE_VALUE; - - // - // Open the destination profile file from disk. We could use the - // handle however we do not know whether we will get the ICC or DMP. - // - CComBSTR bstrProfile; - if (SUCCEEDED(hr = GetDstProfileName(&bstrProfile))) - { - hFile = CreateFile(bstrProfile, - GENERIC_READ, - FILE_SHARE_READ, - NULL, - OPEN_EXISTING, - FILE_ATTRIBUTE_NORMAL, - NULL); - - if (hFile == INVALID_HANDLE_VALUE) - { - hr = GetLastErrorAsHResult(); - } - } - - if (SUCCEEDED(hr)) - { - // - // Write profile data to stream - // - PBYTE pBuff = new(std::nothrow) BYTE[CB_COPY_BUFFER]; - hr = CHECK_POINTER(pBuff, E_OUTOFMEMORY); - - DWORD cbRead = 0; - - while (SUCCEEDED(hr)) - { - if (ReadFile(hFile, pBuff, CB_COPY_BUFFER, &cbRead, NULL)) - { - if (cbRead > 0) - { - ULONG cbWritten = 0; - hr = pStream->WriteBytes(reinterpret_cast<LPVOID>(pBuff), cbRead, &cbWritten); - - if (cbRead != cbWritten) - { - RIP("Failed to write all profile data.\n"); - - hr = E_FAIL; - } - } - else - { - break; - } - } - else - { - hr = GetLastErrorAsHResult(); - } - } - - delete[] pBuff; - pBuff = NULL; - } - - if (hFile != INVALID_HANDLE_VALUE) - { - CloseHandle(hFile); - hFile = INVALID_HANDLE_VALUE; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CProfileManager::GetKeyName - -Routine Description: - - Method to obtain a unique key for the resource being handled - -Arguments: - - pbstrKeyName - Pointer to a string to hold the generated key - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CProfileManager::GetKeyName( - _Inout_ _At_(*pbstrKeyName, _Pre_maybenull_ _Post_valid_) BSTR* pbstrKeyName - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrKeyName, E_POINTER))) - { - SysFreeString(*pbstrKeyName); - - if (SUCCEEDED(hr = m_cmProfData.cmProfileName.CopyTo(pbstrKeyName)) && - !*pbstrKeyName) - { - hr = E_OUTOFMEMORY; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CProfileManager::GetResURI - -Routine Description: - - Method to obtain the URI of the resource being handled - -Arguments: - - pbstrResURI - Pointer to a string to hold the resource URI - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CProfileManager::GetResURI( - _Outptr_ BSTR* pbstrResURI - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrResURI, E_POINTER))) - { - try - { - CStringXDW cstrFileName(m_cmProfData.cmProfileName); - CStringXDW cstrFileExt(PathFindExtension(cstrFileName)); - - INT indFileExt = cstrFileName.Find(cstrFileExt); - - if (indFileExt > -1) - { - cstrFileName.Delete(indFileExt, cstrFileExt.GetLength()); - } - - // - // Create a unique name for the profile for this print session - // - CStringXDW cstrURI; - cstrURI.Format(L"/%s_%u%s", static_cast<LPCWSTR>(cstrFileName), GetUniqueNumber(), static_cast<LPCWSTR>(cstrFileExt)); - - *pbstrResURI = cstrURI.AllocSysString(); - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CProfileManager::SetProfileFromColDir - -Routine Description: - - Set the named profile from the color directory. The method appends the specified - file name to the color directory path and instructs the profile class to open the - profile - -Arguments: - - pProfile - Pointer to the profile class that actually opens the profile - szProfile - The profile file name - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CProfileManager::SetProfileFromColDir( - _In_ CProfile* pProfile, - _In_ LPWSTR szProfile - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pProfile, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(szProfile, E_POINTER))) - { - try - { - CStringXDW cstrProfile; - - if (SUCCEEDED(hr = GetColDir(&cstrProfile))) - { - cstrProfile += L"\\"; - cstrProfile += szProfile; - - hr = pProfile->SetProfile(cstrProfile.GetBuffer()); - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CProfileManager::GetColDir - -Routine Description: - - Retrieves the color directory path - -Arguments: - - pcstrColDir - Pointer to a string class that accepts the color directory path - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CProfileManager::GetColDir( - _Out_ CStringXDW* pcstrColDir - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pcstrColDir, E_POINTER))) - { - try - { - pcstrColDir->Empty(); - DWORD cbColDir = 0; - if (!GetColorDirectory(NULL, NULL, &cbColDir)) - { - pcstrColDir->Preallocate(cbColDir/sizeof(WCHAR)); - if (!GetColorDirectory(NULL, pcstrColDir->GetBuffer(), &cbColDir)) - { - hr = GetLastErrorAsHResult(); - } - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/color/profman.h b/print/XPSDrvSmpl/src/filters/color/profman.h deleted file mode 100644 index 4246a0c2..00000000 --- a/print/XPSDrvSmpl/src/filters/color/profman.h +++ /dev/null @@ -1,126 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - profman.h - -Abstract: - - Color profile manager definition. The CProfileManager class is responsible - for managing the color profile set in the driver. - ---*/ - -#pragma once - -#include "cmprofiledata.h" -#include "cmintentsdata.h" -#include "rescache.h" -#include "transform.h" - -class CProfileManager : public IResWriter -{ -public: - CProfileManager( - _In_ LPCWSTR pszDeviceName, - _In_ XDPrintSchema::PageSourceColorProfile::PageSourceColorProfileData cmProfData, - _In_ XDPrintSchema::PageICMRenderingIntent::PageICMRenderingIntentData cmIntData, - _In_ IFixedPage* pFP - ); - - virtual ~CProfileManager(); - - HRESULT - GetColorTransform( - _Out_ HTRANSFORM* phColorTrans, - _Out_ BOOL* pbUseWCS - ); - - HRESULT - GetDstProfileType( - _Out_ XDPrintSchema::PageSourceColorProfile::EProfileOption* pType - ); - - HRESULT - GetDstProfileName( - _Inout_ BSTR* pbstrProfileName - ); - - HRESULT - SetSrcProfileFromContainer( - _In_ LPWSTR szProfileURI - ); - - HRESULT - SetSrcProfileFromColDir( - _In_ LPWSTR szProfile - ); - - HRESULT - SetSrcProfileFromBuffer( - _In_ LPWSTR szProfile, - _In_reads_bytes_(cbBuffer) PBYTE pBuffer, - _In_ UINT cbBuffer - ); - - HRESULT - GetProfileOption( - _Out_ XDPrintSchema::PageSourceColorProfile::EProfileOption* pProfileOption - ); - - // - // IResWriter interface - // - HRESULT - WriteData( - _In_ IPartBase* pResource, - _In_ IPrintWriteStream* pStream - ); - - HRESULT - GetKeyName( - _Inout_ _At_(*pbstrKeyName, _Pre_maybenull_ _Post_valid_) BSTR* pbstrKeyName - ); - - HRESULT - GetResURI( - _Outptr_ BSTR* pbstrResURI - ); - -private: - HRESULT - SetProfileFromColDir( - _In_ CProfile* pProfile, - _In_ LPWSTR szProfile - ); - - HRESULT - GetColDir( - _Out_ CStringXDW* pcstrColDir - ); - -private: - CStringXDW m_strDeviceName; - - XDPrintSchema::PageSourceColorProfile::PageSourceColorProfileData m_cmProfData; - - XDPrintSchema::PageICMRenderingIntent::PageICMRenderingIntentData m_cmIntData; - - CProfile m_srcProfile; - - CProfile m_dstProfile; - - CTransform m_colorTrans; - - CComPtr<IFixedPage> m_pFixedPage; -}; - diff --git a/print/XPSDrvSmpl/src/filters/color/scaniter.cpp b/print/XPSDrvSmpl/src/filters/color/scaniter.cpp deleted file mode 100644 index 541554ab..00000000 --- a/print/XPSDrvSmpl/src/filters/color/scaniter.cpp +++ /dev/null @@ -1,604 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - scaniter.cpp - -Abstract: - - CScanIterator class implementation. The scan iterator class provides a convenient - interface for iterating over WIC data and retrieving scanline data approriate for - consumption in WCS/ICM. For example, the WIC pixel formats do not have alpha channel - positions that correspond with the WCS/ICM BMFORMAT types so this class is responsible - for presenting bitmap data without the alpha channel and for copying alpha data from - source to destination when scnaline changes are commited to the underlying WIC bitmap. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "xdexcept.h" -#include "globals.h" -#include "scaniter.h" - -/*++ - -Routine Name: - - CScanIterator::CScanIterator - -Routine Description: - - CScanIterator constructor - -Arguments: - - - bmpConv - Bitmap converter class encapsulating the underlying WIC bitmap - pRect - The rectangular area of the bitmap over which we want to iterate scanlines - -Return Value: - - None - Throws an exception on error. - ---*/ -CScanIterator::CScanIterator( - _In_ CONST CBmpConverter& bmpConv, - _In_opt_ WICRect* pRect - ) : - CBmpConverter(bmpConv), - m_bSrcLine(TRUE), - m_cbWICStride(0), - m_cWICWidth(0), - m_cWICHeight(0), - m_cbWICData(0), - m_pbWICData(NULL) -{ - HRESULT hr = S_OK; - - UINT cWidth = 0; - UINT cHeight = 0; - - if (SUCCEEDED(hr = CHECK_POINTER(m_pBitmap, E_POINTER)) && - SUCCEEDED(hr = m_pBitmap->GetSize(&cWidth, &cHeight))) - { - if (pRect == NULL) - { - // - // We want to iterate over the entire surface - // - m_rectTotal.X = 0; - m_rectTotal.Y = 0; - m_rectTotal.Width = static_cast<INT>(cWidth); - m_rectTotal.Height = static_cast<INT>(cHeight); - } - else - { - if (pRect->X >= 0 && - pRect->Y >= 0 && - pRect->Width <= static_cast<INT>(cWidth) && - pRect->Height <= static_cast<INT>(cHeight)) - { - m_rectTotal = *pRect; - } - else - { - hr = E_INVALIDARG; - } - } - } - - if (FAILED(hr)) - { - throw CXDException(hr); - } -} - -/*++ - -Routine Name: - - CScanIterator::~CScanIterator - -Routine Description: - - CScanIterator destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CScanIterator::~CScanIterator() -{ - UnlockSurface(); -} - -/*++ - -Routine Name: - - CScanIterator::Initialize - -Routine Description: - - Initialize the iterator. Here we are going to: - - 1. Convert to a suitable WIC format for processing - 2. Allocate an intermediate color buffer (if required) for processing - 3. Allocate an intermediate alpha buffer (if required) for processing - 4. Reset and lock the iterator rect ready for processing - -Arguments: - - bSrcLine - true if this is a source scanline (i.e. read only) - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CScanIterator::Initialize( - _In_ CONST BOOL& bSrcLine - ) -{ - HRESULT hr = S_OK; - m_bSrcLine = bSrcLine; - - // - // Look up the pixel format to convert to so that the bitmap is appropriate - // for consumption by WCS/ICM. - // - // Note: we are not dealing with the limitations of ICM downlevel. Downlevel - // we need to convert floating and fixed point values to values appropriate - // to ICM then back again before writing out so the underlying bitmap type is - // unmodified. - // - EWICPixelFormat eConversionFormat = kWICPixelFormatDontCare; - if (m_ePixelFormat > 0 && - m_ePixelFormat < kWICPixelFormatMax) - { - eConversionFormat = g_lutWICToBMFormat[m_ePixelFormat].m_pixFormTarget; - } - else - { - RIP("Unrecognised pixel format.\n"); - hr = E_FAIL; - } - - // - // Apply the conversion if required - // - BOOL bCanConvert = FALSE; - if (eConversionFormat != m_ePixelFormat && - SUCCEEDED(hr) && - SUCCEEDED(hr = Convert(eConversionFormat, &bCanConvert))) - { - if (!bCanConvert) - { - RIP("Cannot convert to target type.\n"); - hr = E_FAIL; - } - } - - // - // Set the current iteration data ready for processing - // - if (SUCCEEDED(hr)) - { - // - // Ensure the iterator is reset to the start of the area to be processed. This - // ensures that the current rect lock is valid so that we can initialise the - // first scanline to process - // - Reset(); - - // - // Initialise the WIC <-> BM scan line converter - // - if (SUCCEEDED(hr = m_currScan.Initialize(g_lutWICToBMFormat[m_ePixelFormat]))) - { - hr = SetCurrentIterationData(); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CScanIterator::Reset - -Routine Description: - - Resets the current rect to the first scanline in the buffer. - -Arguments: - - None - -Return Value: - - None - ---*/ -VOID -CScanIterator::Reset( - VOID - ) -{ - m_rectCurrLock.X = m_rectTotal.X; - m_rectCurrLock.Y = m_rectTotal.Y; - m_rectCurrLock.Width = m_rectTotal.Width; - m_rectCurrLock.Height = 1; -} - -/*++ - -Routine Name: - - CScanIterator::operator++ - -Routine Description: - - Iterate to the next scan line. - -Arguments: - - None - -Return Value: - - Reference to this iterator - ---*/ -CScanIterator& -CScanIterator::operator++(INT) -{ - HRESULT hr = S_OK; - - m_rectCurrLock.Y++; - if (!Finished()) - { - if (FAILED(hr = SetCurrentIterationData())) - { - throw CXDException(hr); - } - } - - return *this; -} - -/*++ - -Routine Name: - - CScanIterator::GetScanBuffer - -Routine Description: - - Retrieves the scanline buffer appropriate for WCS/ICM consumption - -Arguments: - - ppData - Pointer to pointer that recieves the address of the data buffer - Note: the buffer is only valid for the lifetime of the CScanIterator object. - pBmFormat - Pointer to a BMFORMAT enumeration that recieves the format - pcWidth - Pointer to storage that recieves the pixel width - pcHeight - Pointer to storage that recieves the pixel height - pcbStride - Pointer to storage that recieves the stride - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CScanIterator::GetScanBuffer( - _Outptr_result_buffer_(*pcbStride) PBYTE* ppData, - _Out_ BMFORMAT* pBmFormat, - _Out_ UINT* pcWidth, - _Out_ UINT* pcHeight, - _Out_ UINT* pcbStride - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppData, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pBmFormat, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pcWidth, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pcHeight, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pcbStride, E_POINTER))) - { - *ppData = NULL; - *pcWidth = 0; - *pcHeight = 1; - *pcbStride = 0; - *pBmFormat = BM_RGBTRIPLETS; - - // - // Get the data from the WIC <-> BMFORMAT scanline converter - // - hr = m_currScan.GetData(ppData, pBmFormat, pcWidth, pcbStride); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CScanIterator::Commit - -Routine Description: - - Commits the current color buffer to the surface if required and applies an optional alpha - channel passed in from a source iterator - -Arguments: - - alphaSource - Scan iterator instance with any potential alpha data to copy - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CScanIterator::Commit( - _In_ CONST CScanIterator& alphaSource - ) -{ - HRESULT hr = S_OK; - - COLORDATATYPE srcDataType = COLOR_BYTE; - COLORDATATYPE dstDataType = COLOR_BYTE; - - if (m_bSrcLine) - { - RIP("Cannot commit to readonly surface.\n"); - - hr = E_FAIL; - } - else if (alphaSource.m_ePixelFormat >= kWICPixelFormatMax || - alphaSource.m_ePixelFormat < kWICPixelFormatMin || - m_ePixelFormat >= kWICPixelFormatMax || - m_ePixelFormat < kWICPixelFormatMin) - { - RIP("Invalid pixel format.\n"); - - hr = E_FAIL; - } - else - { - srcDataType = g_lutWICToBMFormat[alphaSource.m_ePixelFormat].m_colDataType; - dstDataType = g_lutWICToBMFormat[m_ePixelFormat].m_colDataType; - - if (srcDataType > COLOR_S2DOT13FIXED || - srcDataType < COLOR_BYTE || - dstDataType > COLOR_S2DOT13FIXED || - dstDataType < COLOR_BYTE) - { - RIP("Invalid data type.\n"); - - hr = E_FAIL; - } - } - - if (SUCCEEDED(hr) && - alphaSource.HasAlphaChannel() && - HasAlphaChannel()) - { - // - // Convert and copy alpha data into destination - // - PBYTE pDst = m_pbWICData; - size_t cbDstChannel = g_lutColorDataSize[dstDataType]; - size_t cbDstAlphaOffset = g_lutWICToBMFormat[m_ePixelFormat].m_cAlphaOffset * cbDstChannel; - UINT cDstChannels = g_lutWICToBMFormat[m_ePixelFormat].m_cChannels; - - PBYTE pSrc = alphaSource.m_pbWICData; - size_t cbSrcChannel = g_lutColorDataSize[srcDataType]; - size_t cbSrcAlphaOffset = g_lutWICToBMFormat[alphaSource.m_ePixelFormat].m_cAlphaOffset * cbSrcChannel; - UINT cSrcChannels = g_lutWICToBMFormat[alphaSource.m_ePixelFormat].m_cChannels; - - if (m_cWICWidth * cDstChannels * cbDstChannel <= m_cbWICStride && - alphaSource.m_cWICWidth * cSrcChannels * cbSrcChannel <= alphaSource.m_cbWICStride) - { - // - // Move the source and destination to the first alpha channel - // - pDst += cbDstAlphaOffset; - pSrc += cbSrcAlphaOffset; - - // - // Call the appropriate convert copy function by casting the src pointer - // to the underlying data type - // - switch (srcDataType) - { - case COLOR_BYTE: - hr = ConvertCopyAlphaChannels(reinterpret_cast<PBYTE>(pSrc), - m_cWICWidth, - cSrcChannels, - dstDataType, - pDst, - m_cWICWidth, - cDstChannels); - break; - - case COLOR_WORD: - hr = ConvertCopyAlphaChannels(reinterpret_cast<PWORD>(pSrc), - m_cWICWidth, - cSrcChannels, - dstDataType, - pDst, - m_cWICWidth, - cDstChannels); - break; - - case COLOR_FLOAT: - hr = ConvertCopyAlphaChannels(reinterpret_cast<PFLOAT>(pSrc), - m_cWICWidth, - cSrcChannels, - dstDataType, - pDst, - m_cWICWidth, - cDstChannels); - break; - - case COLOR_S2DOT13FIXED: - hr = ConvertCopyAlphaChannels(reinterpret_cast<PS2DOT13FIXED>(pSrc), - m_cWICWidth, - cSrcChannels, - dstDataType, - pDst, - m_cWICWidth, - cDstChannels); - break; - - default: - { - RIP("Unrecognized source format.\n"); - - hr = E_FAIL; - } - break; - } - } - else - { - RIP("Insufficient buffer sizes.\n"); - - hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); - } - } - - // - // Commit the scanline - // - if (SUCCEEDED(hr)) - { - hr = m_currScan.Commit(m_pbWICData, m_cbWICStride); - } - - // - // Release the lock - // - UnlockSurface(); - - m_cbWICStride = 0; - m_cWICWidth = 0; - m_cWICHeight = 0; - m_cbWICData = 0; - m_pbWICData = NULL; - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CScanIterator::Finished - -Routine Description: - - We are done once all scanlines have been processed. - -Arguments: - - None - -Return Value: - - TRUE - We have iterated over all requested scanlines - FALSE - There are scanlines remaining - ---*/ -BOOL -CScanIterator::Finished( - VOID - ) -{ - return m_rectCurrLock.Y >= (m_rectTotal.Y + m_rectTotal.Height); -} - -/*++ - -Routine Name: - - CScanIterator::SetCurrentIterationData - -Routine Description: - - Sets up the current iteration data by locking the relevant area of the WIC bitmap - source and getting the WIC to BMFORMAT converter class to apply any conversion required - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CScanIterator::SetCurrentIterationData( - VOID - ) -{ - HRESULT hr = S_OK; - - m_cbWICStride = 0; - m_cWICWidth = 0; - m_cWICHeight = 0; - m_cbWICData = 0; - m_pbWICData = NULL; - - if (SUCCEEDED(hr = LockSurface(&m_rectCurrLock, - m_bSrcLine, - &m_cbWICStride, - &m_cWICWidth, - &m_cWICHeight, - &m_cbWICData, - &m_pbWICData)) && - SUCCEEDED(hr = CHECK_POINTER(m_pbWICData, E_FAIL))) - { - hr = m_currScan.SetData(m_bSrcLine, m_pbWICData, m_cbWICStride, m_cWICWidth); - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/color/scaniter.h b/print/XPSDrvSmpl/src/filters/color/scaniter.h deleted file mode 100644 index de4b725e..00000000 --- a/print/XPSDrvSmpl/src/filters/color/scaniter.h +++ /dev/null @@ -1,218 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - scaniter.h - -Abstract: - - CScanIterator class definition. The scan iterator class provides a convenient - interface for iterating over WIC data and retrieving scanline data approriate for - consumption in WCS/ICM. For example, the WIC pixel formats do not have alpha channel - positions that correspond with the WCS/ICM BMFORMAT types so this class is responsible - for presenting bitmap data without the alpha channel and for copying alpha data from - source to destination when scnaline changes are commited to the underlying WIC bitmap. - ---*/ - -#pragma once - -#include "bmpconv.h" -#include "wictobmscn.h" - -/* -Iterates through all scanlines in a bitmap creating a buffer appropriate -to color modification. These are: - - RGB channels (in that order) as byte, word, float or fixed - no alpha - CMYK channels (order as the source bitmap) as byte, word, float or fixed - no alpha - nChannel (order as the source bitmap) as byte - no alpha - -*/ -class CScanIterator : public CBmpConverter -{ -public: - CScanIterator( - _In_ CONST CBmpConverter& bmpConv, - _In_opt_ WICRect* pRect - ); - - virtual ~CScanIterator(); - - HRESULT - Initialize( - _In_ CONST BOOL& bReadOnly - ); - - VOID - Reset( - VOID - ); - - CScanIterator& - operator++( - INT - ); - - virtual HRESULT - GetScanBuffer( - _Outptr_result_buffer_(*pcbStride) PBYTE* ppData, - _Out_ BMFORMAT* pBmFormat, - _Out_ UINT* pcWidth, - _Out_ UINT* pcHeight, - _Out_ UINT* pcbStride - ); - - HRESULT - Commit( - _In_ CONST CScanIterator& cbAlphaBuffer - ); - - BOOL - Finished( - VOID - ); - -private: - HRESULT - SetCurrentIterationData( - VOID - ); - - template <class _T, class _U> - HRESULT - ConvertCopyAlphaChannels( - _In_reads_(cSrcPix) _T* pSrc, - _In_ CONST UINT& cSrcPix, - _In_ CONST UINT& cSrcChan, - _Out_writes_(cDstPix) _U* pDst, - _In_ CONST UINT& cDstPix, - _In_ CONST UINT& cDstChan - ) - { - HRESULT hr = S_OK; - - if (cDstPix == cSrcPix) - { - for (UINT cCurPix = 0; - cCurPix < cDstPix; - cCurPix++, pSrc += cSrcChan, pDst += cDstChan) - { - ConvertCopy(*pDst, *pSrc); - } - } - else - { - hr = E_INVALIDARG; - } - - ERR_ON_HR(hr); - return hr; - } - - template <class _T> - HRESULT - ConvertCopyAlphaChannels( - _In_reads_(cSrcPix) _T* pSrc, - _In_ CONST UINT& cSrcPix, - _In_ CONST UINT& cSrcChan, - _In_ CONST COLORDATATYPE& dstColType, - _When_(dstColType == COLOR_BYTE, _Out_writes_bytes_(cDstPix)) - _When_(dstColType == COLOR_WORD, _At_((PWORD)pDst, _Out_writes_(cDstPix))) - _When_(dstColType == COLOR_FLOAT, _At_((PFLOAT)pDst, _Out_writes_bytes_(cDstPix * sizeof(FLOAT)))) // Esp:1154 - _When_(dstColType == COLOR_S2DOT13FIXED, _At_((PS2DOT13FIXED)pDst, _Out_writes_(cDstPix))) - PBYTE pDst, - _In_ CONST UINT& cDstPix, - _In_ CONST UINT& cDstChan - ) - { - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pSrc, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pDst, E_POINTER))) - { - // - // Call the appropriate convert copy function by casting the dst pointer - // to the underlying data type - // - switch (dstColType) - { - case COLOR_BYTE: - hr = ConvertCopyAlphaChannels(reinterpret_cast<_T*>(pSrc), - cSrcPix, - cSrcChan, - reinterpret_cast<PBYTE>(pDst), - cDstPix, - cDstChan); - break; - - case COLOR_WORD: - hr = ConvertCopyAlphaChannels(reinterpret_cast<_T*>(pSrc), - cSrcPix, - cSrcChan, - reinterpret_cast<PWORD>(pDst), - cDstPix, - cDstChan); - break; - - case COLOR_FLOAT: - hr = ConvertCopyAlphaChannels(reinterpret_cast<_T*>(pSrc), - cSrcPix, - cSrcChan, - reinterpret_cast<PFLOAT>(pDst), - cDstPix, - cDstChan); - break; - - case COLOR_S2DOT13FIXED: - hr = ConvertCopyAlphaChannels(reinterpret_cast<_T*>(pSrc), - cSrcPix, - cSrcChan, - reinterpret_cast<PS2DOT13FIXED>(pDst), - cDstPix, - cDstChan); - break; - - default: - { - RIP("Unrecognized destination format.\n"); - - hr = E_INVALIDARG; - } - break; - } - } - - ERR_ON_HR(hr); - return hr; - } - -private: - WICRect m_rectTotal; - - WICRect m_rectCurrLock; - - BOOL m_bSrcLine; - - CWICToBMFormatScan m_currScan; - - UINT m_cbWICStride; - - UINT m_cWICWidth; - - UINT m_cWICHeight; - - UINT m_cbWICData; - - PBYTE m_pbWICData; -}; - diff --git a/print/XPSDrvSmpl/src/filters/color/transform.cpp b/print/XPSDrvSmpl/src/filters/color/transform.cpp deleted file mode 100644 index adbf5b45..00000000 --- a/print/XPSDrvSmpl/src/filters/color/transform.cpp +++ /dev/null @@ -1,666 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - transform.cpp - -Abstract: - - CTransform class implementation. This class creates and manages color transforms providing - limited caching functionality based off the source profile keys. - - This file also contains a utility class for handling profile lists. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "xdexcept.h" -#include "transform.h" - -class CProfileList -{ -public: - /*++ - - Routine Name: - - CProfileList - - Routine Description: - - CProfileList constructor - - Arguments: - - pProfiles - pointer to a vector of profiles - - Return Value: - - None - Throws an exception on error. - - --*/ - CProfileList( - _In_ ProfileList* pProfiles - ) : - m_cProfiles(0), - m_phProfiles(NULL) - { - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pProfiles, E_POINTER))) - { - hr = CreateHandleBuffer(pProfiles); - } - - if (FAILED(hr)) - { - throw CXDException(hr); - } - } - - /*++ - - Routine Name: - - ~CProfileList - - Routine Description: - - CProfileList destructor - - Arguments: - - None - - Return Value: - - None - - --*/ - ~CProfileList() - { - FreeHandleBuffer(); - } - - /*++ - - Routine Name: - - GetProfileData - - Routine Description: - - Retrieves - - Arguments: - - pphProfiles - Pointer to pointer that recieves the address of an array of profile handles - Note: the buffer is only valid for the lifetime of the CProfileList object. - pcProfiles - Pointer to storage that recieves the count of profiles in the array - - Return Value: - - HRESULT - S_OK - On success - E_* - On error - - --*/ - HRESULT - GetProfileData( - _When_(*pcProfiles > 0, _Outptr_result_buffer_(*pcProfiles)) - _When_(*pcProfiles == 0, _Outptr_result_maybenull_) - HPROFILE** pphProfiles, - _Out_ DWORD* pcProfiles - ) - { - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pphProfiles, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pcProfiles, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(m_phProfiles, E_PENDING))) - { - *pphProfiles = 0; - *pcProfiles = 0; - - if (m_cProfiles > 0) - { - *pphProfiles = m_phProfiles; - *pcProfiles = m_cProfiles; - } - } - - ERR_ON_HR(hr); - return hr; - } - -private: - /*++ - - Routine Name: - - CreateHandleBuffer - - Routine Description: - - Creates the buffer that holds the profile handles - - Arguments: - - pProfiles - Pointer to the vector of CProfile objects that have the individual profile data - - Return Value: - - HRESULT - S_OK - On success - E_* - On error - - --*/ - HRESULT - CreateHandleBuffer( - _In_ ProfileList* pProfiles - ) - { - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pProfiles, E_POINTER))) - { - try - { - FreeHandleBuffer(); - - m_cProfiles = static_cast<DWORD>(pProfiles->size()); - if (m_cProfiles > 0) - { - m_phProfiles = new(std::nothrow) HPROFILE[m_cProfiles]; - - if (SUCCEEDED(hr = CHECK_POINTER(m_phProfiles, E_OUTOFMEMORY))) - { - ProfileList::iterator iterProfiles = pProfiles->begin(); - - for (UINT cProfile = 0; - SUCCEEDED(hr) && iterProfiles != pProfiles->end() && cProfile < m_cProfiles; - iterProfiles++, cProfile++) - { - hr = (*iterProfiles)->GetProfileHandle(&m_phProfiles[cProfile]); - } - } - } - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; - } - - /*++ - - Routine Name: - - FreeHandleBuffer - - Routine Description: - - Frees up the profile handle buffer - - Arguments: - - None - - Return Value: - - None - - --*/ - VOID - FreeHandleBuffer( - VOID - ) - { - if (m_phProfiles != NULL) - { - delete[] m_phProfiles; - m_phProfiles = NULL; - } - - m_cProfiles = 0; - } - -private: - HPROFILE* m_phProfiles; - - DWORD m_cProfiles; -}; - -/*++ - -Routine Name: - - CTransform::CTransform - -Routine Description: - - CTransform constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CTransform::CTransform() : - m_hColorTrans(NULL), - m_intents(INTENT_ABSOLUTE_COLORIMETRIC), - m_renderFlags(0), - m_pcstrProfileKeys(NULL), - m_cProfiles(0) -{ -} - -/*++ - -Routine Name: - - CTransform::~CTransform - -Routine Description: - - CTransform destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CTransform::~CTransform() -{ - FreeTransform(); -} - -/*++ - -Routine Name: - - CTransform::CreateTransform - -Routine Description: - - Creates the transform from a vector of CProfile objects - -Arguments: - - pProfiles - Pointer to the vector of CProfile objects that have the individual profile data - intent - Intent flags to be applied when creating transform - renderFlags - Render flags to be applied when creating transform - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CTransform::CreateTransform( - _In_ ProfileList* pProfiles, - _In_ CONST DWORD intent, - _In_ CONST DWORD renderFlags - ) -{ - HRESULT hr = S_OK; - - if (intent <= INTENT_ABSOLUTE_COLORIMETRIC) - { - BOOL bFreeTransform = FALSE; - - if (m_intents != intent) - { - m_intents = intent; - bFreeTransform = TRUE; - } - - if (m_renderFlags != renderFlags) - { - m_renderFlags = renderFlags; - bFreeTransform = TRUE; - } - - if (bFreeTransform) - { - FreeTransform(); - } - } - else - { - hr = E_INVALIDARG; - } - - BOOL bUpdate = FALSE; - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_POINTER(pProfiles, E_POINTER)) && - SUCCEEDED(hr = UpdateProfiles(pProfiles, &bUpdate))) - { - try - { - if (bUpdate) - { - HPROFILE* phProfiles = NULL; - DWORD cProfiles = 0; - CProfileList profileList(pProfiles); - - if (SUCCEEDED(hr = profileList.GetProfileData(&phProfiles, &cProfiles))) - { - m_hColorTrans = CreateMultiProfileTransform(phProfiles, - cProfiles, - &m_intents, - 1, - m_renderFlags, - INDEX_DONT_CARE); - - if (m_hColorTrans == NULL) - { - hr = GetLastErrorAsHResult(); - } - } - else - { - hr = E_INVALIDARG; - } - } - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CTransform::GetTransformHandle - -Routine Description: - - Retrieves the current transform handle - -Arguments: - - phTrans - Pointer to a HTRANSFORM that recieves the transform handle - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CTransform::GetTransformHandle( - _Out_ HTRANSFORM* phTrans - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(phTrans, E_POINTER))) - { - *phTrans = NULL; - - if (SUCCEEDED(hr = CHECK_HANDLE(m_hColorTrans, E_PENDING))) - { - *phTrans = m_hColorTrans; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CTransform::FreeTransform - -Routine Description: - - Free the current transform - -Arguments: - - None - -Return Value: - - None - ---*/ -VOID -CTransform::FreeTransform( - VOID - ) -{ - FreeProfileKeysBuffer(); - if (m_hColorTrans != NULL) - { - DeleteColorTransform(m_hColorTrans); - m_hColorTrans = NULL; - } -} - -/*++ - -Routine Name: - - CTransform::CreateProfileKeysBuffer - -Routine Description: - - Creates a buffer to recieve the keys to the profiles that compse the current - trnasform - -Arguments: - - cProfiles - the count of profiles that compose the transform - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CTransform::CreateProfileKeysBuffer( - _In_ CONST UINT& cProfiles - ) -{ - HRESULT hr = S_OK; - - FreeProfileKeysBuffer(); - - if (cProfiles > 0) - { - m_pcstrProfileKeys = new(std::nothrow) CStringXDW[cProfiles]; - if (SUCCEEDED(hr = CHECK_POINTER(m_pcstrProfileKeys, E_OUTOFMEMORY))) - { - m_cProfiles = cProfiles; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CTransform::FreeProfileKeysBuffer - -Routine Description: - - Frees the profile key buffer - -Arguments: - - None - -Return Value: - - None - ---*/ -VOID -CTransform::FreeProfileKeysBuffer( - VOID - ) -{ - if (m_pcstrProfileKeys != NULL) - { - delete[] m_pcstrProfileKeys; - m_pcstrProfileKeys = NULL; - } - - m_cProfiles = 0; -} - -/*++ - -Routine Name: - - CTransform::UpdateProfiles - -Routine Description: - - Updates the profile list and checks whether the transform needs to be generated - (i.e. is the current transform the same as the requested transform) - -Arguments: - - pProfiles - Pointer to the vector of CProfile objects that have the individual profile data - pbUpdate - Pointer to BOOL that recieves whether the transform requires updating - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CTransform::UpdateProfiles( - _In_ ProfileList* pProfiles, - _Out_ BOOL* pbUpdate - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pProfiles, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pbUpdate, E_POINTER))) - { - *pbUpdate = FALSE; - - try - { - // - // If we already have a transform, a list of profile keys and matching - // number of profiles, check our keys against the incoming list of profiles - // and note if we need to create a new transform - // - CStringXDW* pcstrProfileKeys = NULL; - if (m_hColorTrans != NULL && - m_pcstrProfileKeys != NULL && - m_cProfiles > 0 && - m_cProfiles == static_cast<UINT>(pProfiles->size())) - { - pcstrProfileKeys = m_pcstrProfileKeys; - ProfileList::iterator iterProfiles = pProfiles->begin(); - - for (; - iterProfiles != pProfiles->end() && !*pbUpdate; - iterProfiles++) - { - if (*(*iterProfiles) != *pcstrProfileKeys++) - { - *pbUpdate = TRUE; - } - } - } - else - { - *pbUpdate = TRUE; - } - - if (*pbUpdate) - { - // - // We need to create a new transform. Free any current transform and cache the keys - // to the profiles that constitute the transform - // - FreeTransform(); - if (SUCCEEDED(hr = CreateProfileKeysBuffer(static_cast<UINT>(pProfiles->size())))) - { - pcstrProfileKeys = m_pcstrProfileKeys; - ProfileList::iterator iterProfiles = pProfiles->begin(); - - for (; - SUCCEEDED(hr) && iterProfiles != pProfiles->end(); - iterProfiles++, pcstrProfileKeys++) - { - // - // If CreateProfileKeysBuffer succeeds, it fills - // in m_pcstrProfileKeys with pProfiles->size() - // elements. Hence the _Analysis_assume_. - // - _Analysis_assume_(pcstrProfileKeys != NULL); - hr = (*iterProfiles)->GetProfileKey(pcstrProfileKeys); - } - } - } - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/color/transform.h b/print/XPSDrvSmpl/src/filters/color/transform.h deleted file mode 100644 index 4d3034fd..00000000 --- a/print/XPSDrvSmpl/src/filters/color/transform.h +++ /dev/null @@ -1,83 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - transform.h - -Abstract: - - CTransform class definition. This class creates and manages color transforms providing - limited caching functionality based off the source profile keys. - - ---*/ - -#pragma once - -#include "profile.h" - -typedef vector<CProfile*> ProfileList; - -class CTransform -{ -public: - CTransform(); - - ~CTransform(); - - HRESULT - CreateTransform( - _In_ ProfileList* pProfiles, - _In_ CONST DWORD intent, - _In_ CONST DWORD renderFlags - ); - - HRESULT - GetTransformHandle( - _Out_ HTRANSFORM* phTrans - ); - - -private: - VOID - FreeTransform( - VOID - ); - - HRESULT - CreateProfileKeysBuffer( - _In_ CONST UINT& cProfiles - ); - - VOID - FreeProfileKeysBuffer( - VOID - ); - - HRESULT - UpdateProfiles( - _In_ ProfileList* pProfiles, - _Out_ BOOL* pbUpdate - ); - -private: - HTRANSFORM m_hColorTrans; - - DWORD m_intents; - - DWORD m_renderFlags; - - CStringXDW* m_pcstrProfileKeys; - - DWORD m_cProfiles; -}; - diff --git a/print/XPSDrvSmpl/src/filters/color/wcsapiconv.cpp b/print/XPSDrvSmpl/src/filters/color/wcsapiconv.cpp deleted file mode 100644 index b53efb15..00000000 --- a/print/XPSDrvSmpl/src/filters/color/wcsapiconv.cpp +++ /dev/null @@ -1,813 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - wcsapiconv.cpp - -Abstract: - - Implementation of the wrapper to the WCS API's - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "wcsapiconv.h" - -CWCSApiConv g_WCSApiConv; - -/*++ - -Routine Name: - - CWCSApiConv::CWCSApiConv - -Routine Description: - - CWCSApiConv class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CWCSApiConv::CWCSApiConv() -{ - m_dllHandle = LoadLibrary(L"mscms.dll"); - - // - // If running on Vista, record the proc address for each WCS API - // - if (m_dllHandle != NULL && - IsVista()) - { - m_WcsAssociateColorProfileWithDevice = GetProcAddress(m_dllHandle,"WcsAssociateColorProfileWithDevice"); - m_WcsDisassociateColorProfileFromDevice = GetProcAddress(m_dllHandle, "WcsDisassociateColorProfileFromDevice"); - m_WcsEnumColorProfilesSize = GetProcAddress(m_dllHandle, "WcsEnumColorProfilesSize"); - m_WcsGetDefaultColorProfileSize = GetProcAddress(m_dllHandle, "WcsGetDefaultColorProfileSize"); - m_WcsGetDefaultColorProfile = GetProcAddress(m_dllHandle, "WcsGetDefaultColorProfile"); - m_WcsSetDefaultColorProfile = GetProcAddress(m_dllHandle, "WcsSetDefaultColorProfile"); - m_WcsSetDefaultRenderingIntent = GetProcAddress(m_dllHandle, "WcsSetDefaultRenderingIntent"); - m_WcsGetUsePerUserProfiles = GetProcAddress(m_dllHandle, "WcsGetUsePerUserProfiles"); - m_WcsSetUsePerUserProfiles = GetProcAddress(m_dllHandle, "WcsSetUsePerUserProfiles"); - m_WcsTranslateColors = GetProcAddress(m_dllHandle, "WcsTranslateColors"); - m_WcsCheckColors = GetProcAddress(m_dllHandle, "WcsCheckColors"); - m_WcsOpenColorProfileA = GetProcAddress(m_dllHandle, "WcsOpenColorProfileA"); - m_WcsOpenColorProfileW = GetProcAddress(m_dllHandle, "WcsOpenColorProfileW"); - m_WcsCreateIccProfile = GetProcAddress(m_dllHandle, "WcsCreateIccProfile"); - - ASSERTMSG(m_WcsAssociateColorProfileWithDevice != NULL && - m_WcsDisassociateColorProfileFromDevice != NULL && - m_WcsEnumColorProfilesSize != NULL && - m_WcsGetDefaultColorProfileSize != NULL && - m_WcsGetDefaultColorProfile != NULL && - m_WcsSetDefaultColorProfile != NULL && - m_WcsSetDefaultRenderingIntent != NULL && - m_WcsGetUsePerUserProfiles != NULL && - m_WcsSetUsePerUserProfiles != NULL && - m_WcsTranslateColors != NULL && - m_WcsCheckColors != NULL && - m_WcsOpenColorProfileA != NULL && - m_WcsOpenColorProfileW != NULL && - m_WcsCreateIccProfile != NULL, - "Failed to load WCS APIs correctly.\n"); - } -} - -/*++ - -Routine Name: - - CWCSApiConv::~CWCSApiConv - -Routine Description: - - CWCSApiConv class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CWCSApiConv::~CWCSApiConv() -{ - FreeLibrary(m_dllHandle); -} - -/*++ - -Routine Name: - - CWCSApiConv::WcsAssociateColorProfileWithDevice - -Routine Description: - - -Arguments: - - scope - Profile management scope for this operation, which could be system wide or for current user. - - pProfileName - Points to the file name of the profile to associate. - - pDeviceName - Points to the name of the device to associate. - -Return Value: - - BOOL - If this function succeeds, the return value is TRUE. - ---*/ -BOOL -CWCSApiConv::WcsAssociateColorProfileWithDevice( - _In_ WCS_PROFILE_MANAGEMENT_SCOPE scope, - _In_ PCWSTR pProfileName, - _In_ PCWSTR pDeviceName - ) -{ - BOOL bResult = FALSE; - - if (m_WcsAssociateColorProfileWithDevice != NULL) - { - bResult = m_WcsAssociateColorProfileWithDevice.GetFunc()(scope, pProfileName, pDeviceName); - } - - return bResult; -} - -/*++ - -Routine Name: - - CWCSApiConv::WcsDisassociateColorProfileFromDevice - -Routine Description: - - -Arguments: - - scope - Profile management scope for this operation, which could be system wide or for current user. - - pProfileName - Pointer to the file name of the profile to disassociate. - - pDeviceName - Pointer to the name of the device to disassociate. - -Return Value: - - BOOL - If this function succeeds, the return value is TRUE. - ---*/ -BOOL -CWCSApiConv::WcsDisassociateColorProfileFromDevice( - _In_ WCS_PROFILE_MANAGEMENT_SCOPE scope, - _In_ PCWSTR pProfileName, - _In_ PCWSTR pDeviceName - ) -{ - BOOL bResult = FALSE; - - if (m_WcsDisassociateColorProfileFromDevice != NULL) - { - bResult = m_WcsDisassociateColorProfileFromDevice.GetFunc()(scope, pProfileName, pDeviceName); - } - - return bResult; -} - -/*++ - -Routine Name: - - CWCSApiConv::WcsEnumColorProfilesSize - -Routine Description: - - -Arguments: - - scope - management scope for this operation, which could be system wide or for current user. - - pEnumRecord - Pointer to the structure specifying the enumeration criteria. - - pdwSize - Returns the size in bytes required for the buffer to receive the set of profile names in WcsEnumColorProfiles. - -Return Value: - - BOOL - If this function succeeds, the return value is TRUE. - ---*/ -_Success_(return) -BOOL -#pragma warning(suppress: 6001 6101) // PREFast can't see through templated forwarder function call -CWCSApiConv::WcsEnumColorProfilesSize( - _In_ WCS_PROFILE_MANAGEMENT_SCOPE scope, - _In_ PENUMTYPEW pEnumRecord, - _Out_ PDWORD pdwSize - ) -{ - BOOL bResult = FALSE; - - if (m_WcsEnumColorProfilesSize != NULL) - { - bResult = m_WcsEnumColorProfilesSize.GetFunc()(scope, pEnumRecord, pdwSize); - } - - return bResult; -} - -/*++ - -Routine Name: - - CWCSApiConv::WcsGetDefaultColorProfileSize - -Routine Description: - - -Arguments: - - scope - Profile management scope for this operation, which could be system wide or for current user. - - pDeviceName - Pointer to the name of the device to get the default profile for. NULL implies device-independent default. - - cptColorProfileType - Specifies the color profile type value. - - cpstColorProfileSubType - Specifies the color profile subtype value. - - dwProfileID - Specifies the ID of the color space that the profile represents. - - pcbProfileName - the size in bytes for receiving the default profile in WcsGetDefaultColorProfile. - -Return Value: - - BOOL - If this function succeeds, the return value is TRUE. - ---*/ -_Success_(return) -BOOL -#pragma warning(suppress: 6001 6101) // PREFast can't see through templated forwarder function call -CWCSApiConv::WcsGetDefaultColorProfileSize( - _In_ WCS_PROFILE_MANAGEMENT_SCOPE scope, - _In_opt_ PCWSTR pDeviceName, - _In_ COLORPROFILETYPE cptColorProfileType, - _In_ COLORPROFILESUBTYPE cpstColorProfileSubType, - _In_ DWORD dwProfileID, - _Out_ PDWORD pcbProfileName - ) -{ - BOOL bResult = FALSE; - - if (m_WcsGetDefaultColorProfileSize != NULL) - { - bResult = m_WcsGetDefaultColorProfileSize.GetFunc()(scope, - pDeviceName, - cptColorProfileType, - cpstColorProfileSubType, - dwProfileID, - pcbProfileName); - } - - return bResult; -} - -/*++ - -Routine Name: - - CWCSApiConv::WcsGetDefaultColorProfile - -Routine Description: - - -Arguments: - - scope - Profile management scope for this operation, which could be system wide or for current user. - - pDeviceName - Pointer to the name of the device to get the default profile for. NULL implies device-independent default. - - cptColorProfileType - Specifies the color profile type value. - - cpstColorProfileSubType - Specifies the color profile subtype value. - - dwProfileID - Specifies the ID of the color space that the profile represents. - - cbProfileName - The size in bytes of the buffer pointed to by pProfileName. - - pProfileName - Pointer to the buffer in which the name of the profile is to be placed. - -Return Value: - - BOOL - If this function succeeds, the return value is TRUE. - ---*/ -#pragma warning(suppress: 6001 6054 6101) // PREFast can't see through templated forwarder function call -_Success_(return) -BOOL -CWCSApiConv::WcsGetDefaultColorProfile( - _In_ WCS_PROFILE_MANAGEMENT_SCOPE scope, - _In_opt_ PCWSTR pDeviceName, - _In_ COLORPROFILETYPE cptColorProfileType, - _In_ COLORPROFILESUBTYPE cpstColorProfileSubType, - _In_ DWORD dwProfileID, - _In_ DWORD cbProfileName, - _Out_writes_bytes_(cbProfileName) LPWSTR pProfileName - ) -{ - BOOL bResult = FALSE; - - if (m_WcsGetDefaultColorProfile != NULL) - { - bResult = m_WcsGetDefaultColorProfile.GetFunc()(scope, - pDeviceName, - cptColorProfileType, - cpstColorProfileSubType, - dwProfileID, - cbProfileName, - pProfileName); - } - - return bResult; -} - -/*++ - -Routine Name: - - CWCSApiConv::WcsSetDefaultColorProfile - -Routine Description: - - -Arguments: - - scope - Profile management scope for this operation, which could be system wide or for current user. - - pDeviceName - Pointer to the name of the device to set the default profile for. NULL implies device-independent default. - - cptColorProfileType - Specifies the color profile type value. - - cpstColorProfileSubType - Specifies the color profile subtype value. - - dwProfileID - Specifies the ID of the color space that the profile represents. - - pProfileName - Pointer to the buffer in which contains the name of the profile. - -Return Value: - - BOOL - If this function succeeds, the return value is TRUE. - ---*/ -BOOL -CWCSApiConv::WcsSetDefaultColorProfile( - _In_ WCS_PROFILE_MANAGEMENT_SCOPE scope, - _In_opt_ PCWSTR pDeviceName, - _In_ COLORPROFILETYPE cptColorProfileType, - _In_ COLORPROFILESUBTYPE cpstColorProfileSubType, - _In_ DWORD dwProfileID, - _In_opt_ LPCWSTR pProfileName - ) -{ - BOOL bResult = FALSE; - - if (m_WcsSetDefaultColorProfile != NULL) - { - bResult = m_WcsSetDefaultColorProfile.GetFunc()(scope, - pDeviceName, - cptColorProfileType, - cpstColorProfileSubType, - dwProfileID, - pProfileName); - } - - return bResult; -} - -/*++ - -Routine Name: - - CWCSApiConv::WcsSetDefaultRenderingIntent - -Routine Description: - - -Arguments: - - scope - management scope for this operation, which could be system wide or for current user. - - dwRenderingIntent - The rendering intent to set. - -Return Value: - - BOOL - If this function succeeds, the return value is TRUE. - ---*/ -BOOL -CWCSApiConv::WcsSetDefaultRenderingIntent( - _In_ WCS_PROFILE_MANAGEMENT_SCOPE scope, - _In_ DWORD dwRenderingIntent - ) -{ - BOOL bResult = FALSE; - - if (m_WcsSetDefaultRenderingIntent != NULL) - { - bResult = m_WcsSetDefaultRenderingIntent.GetFunc()(scope, dwRenderingIntent); - } - - return bResult; -} - -/*++ - -Routine Name: - - CWCSApiConv::WcsGetUsePerUserProfiles - -Routine Description: - - -Arguments: - - pDeviceName - The friendly name of the device. - - dwDeviceClass - The class of the device: CLASS_SCANNER for a capture device, - CLASS_MONITOR for a display device, or CLASS_PRINTER for a printer. - - pUsePerUserProfiles - Pointer to a location to receive the result. - This location receives TRUE if the user has chosen to use a - per-user profile association list for the specified device; otherwise FALSE. - -Return Value: - - BOOL - If this function succeeds, the return value is TRUE. - ---*/ -_Success_(return) -BOOL -#pragma warning(suppress: 6001 6101) // PREFast can't see through templated forwarder function call -CWCSApiConv::WcsGetUsePerUserProfiles( - _In_ LPCWSTR pDeviceName, - _In_ DWORD dwDeviceClass, - _Out_ PBOOL pUsePerUserProfiles - ) -{ - BOOL bResult = FALSE; - - if (m_WcsGetUsePerUserProfiles != NULL) - { - bResult = m_WcsGetUsePerUserProfiles.GetFunc()(pDeviceName, dwDeviceClass, pUsePerUserProfiles); - } - - return bResult; -} - -/*++ - -Routine Name: - - CWCSApiConv::WcsSetUsePerUserProfiles - -Routine Description: - - -Arguments: - - pDeviceName - The friendly name of the device. - - dwDeviceClass - The class of the device: CLASS_SCANNER for a capture device, - CLASS_MONITOR for a display device, or CLASS_PRINTER for a printer. - - usePerUserProfiles - TRUE is the user wishes to use a per-user profile association - list for the specified device; otherwise FALSE. - -Return Value: - - BOOL - If this function succeeds, the return value is TRUE. - ---*/ -BOOL -CWCSApiConv::WcsSetUsePerUserProfiles( - _In_ LPCWSTR pDeviceName, - _In_ DWORD dwDeviceClass, - _In_ BOOL usePerUserProfiles - ) -{ - BOOL bResult = FALSE; - - if (m_WcsSetUsePerUserProfiles != NULL) - { - bResult = m_WcsSetUsePerUserProfiles.GetFunc()(pDeviceName, dwDeviceClass, usePerUserProfiles); - } - - return bResult; -} - -/*++ - -Routine Name: - - CWCSApiConv::WcsTranslateColors - -Routine Description: - - -Arguments: - - hColorTransform - Identifies the WCS color transform to use. - - nColors - Contains the number of elements in the arrays pointed to by pInputData and pOutputData. - - nInputChannels - Contains the number of channels per element in the array pointed to by pInputData - - cdtInput - Specifies the input COLORDATATYPTE. - - cbInput - Contains buffer size of pInputData. - - pInputData - Pointer to array of input colors. - - nOutputChannels - Contains the number of channels per element in the array pointed to by pOutputData. - - cdtOutput - Specifies the output COLORDATATYPTE. - - cbOutput - Contains buffer size of pOutputData. - - pOutputData - Pointer to array of output colors. - -Return Value: - - BOOL - If this function succeeds, the return value is TRUE. - ---*/ -BOOL -CWCSApiConv::WcsTranslateColors( - _In_ HTRANSFORM hColorTransform, - _In_ DWORD nColors, - _In_ DWORD nInputChannels, - _In_ COLORDATATYPE cdtInput, - _In_ DWORD cbInput, - _In_reads_bytes_(cbInput) PVOID pInputData, - _In_ DWORD nOutputChannels, - _In_ COLORDATATYPE cdtOutput, - _In_ DWORD cbOutput, - _Out_writes_bytes_(cbOutput) PVOID pOutputData - ) -{ - BOOL bResult = FALSE; - - if (m_WcsTranslateColors != NULL) - { - bResult = m_WcsTranslateColors.GetFunc()(hColorTransform, - nColors, - nInputChannels, - cdtInput, - cbInput, - pInputData, - nOutputChannels, - cdtOutput, - cbOutput, - pOutputData); - } - - return bResult; -} - -/*++ - -Routine Name: - - CWCSApiConv::WCSCheckColors - -Routine Description: - - -Arguments: - - hColorTransform - Identifies the WCS color transform to use. - - nColors - Contains the number of elements in the arrays pointed to by pInputData and pResult. - - nInputChannels - Contains the number of channels per element in the array pointed to by pInputData - - cdtInput - Specifies the input COLORDATATYPTE. - - cbInput - Contains buffer size of pInputData. - - pInputData - Pointer to array of input colors. - - pResult - Pointer to array of nColor results of the test. - -Return Value: - - BOOL - If this function succeeds, the return value is TRUE. - ---*/ -BOOL -CWCSApiConv::WCSCheckColors( - _In_ HTRANSFORM hColorTransform, - _In_ DWORD nColors, - _In_ DWORD nInputChannels, - _In_ COLORDATATYPE cdtInput, - _In_ DWORD cbInput, - _In_reads_bytes_(cbInput) PVOID pInputData, - _Out_writes_bytes_(nColors)PBYTE pResult -) -{ - BOOL bResult = FALSE; - - if (m_WcsCheckColors != NULL) - { - bResult = m_WcsCheckColors.GetFunc()(hColorTransform, - nColors, - nInputChannels, - cdtInput, - cbInput, - pInputData, - pResult); - } - - return bResult; -} - -/*++ - -Routine Name: - - CWCSApiConv::WcsOpenColorProfileA - -Routine Description: - - -Arguments: - - pCDMPProfile - Pointer to a WCS DMP or an ICC color profile structure specifying the profile. - - pCAMPProfile - Pointer to a WCS CAMP color profile structure specifying the profile. - If this parameter is NULL, then the standard default CAMP is used. - - pGMMPProfile - Pointer to a WCS GMMP color profile structure specifying the profile. - If this parameter is NULL, then the standard default GMMP is used. - - dwDesireAccess - Specifies how to access the given profile. This parameter must take one the following constant values. - - dwShareMode - Specifies how the profile should be shared, if the profile is contained in a file. - A value of zero prevents the profile from being shared at all. - - dwCreationMode - Specifies which actions to take on the profile while opening it, if it is contained in a file. - - -Return Value: - - HPROFILE - Handle to the opened color profile - ---*/ -HPROFILE -CWCSApiConv::WcsOpenColorProfileA( - _In_ PPROFILE pCDMPProfile, - _In_opt_ PPROFILE pCAMPProfile, - _In_opt_ PPROFILE pGMMPProfile, - _In_ DWORD dwDesireAccess, - _In_ DWORD dwShareMode, - _In_ DWORD dwCreationMode, - _In_ DWORD dwFlags - ) -{ - HPROFILE hProfile = NULL; - - if (m_WcsOpenColorProfileA != NULL) - { - hProfile = m_WcsOpenColorProfileA.GetFunc()(pCDMPProfile, - pCAMPProfile, - pGMMPProfile, - dwDesireAccess, - dwShareMode, - dwCreationMode, - dwFlags); - } - - return hProfile; -} - -/*++ - -Routine Name: - - CWCSApiConv::WcsOpenColorProfileW - -Routine Description: - - -Arguments: - - pCDMPProfile - Pointer to a WCS DMP or an ICC color profile structure specifying the profile. - - pCAMPProfile - Pointer to a WCS CAMP color profile structure specifying the profile. - If this parameter is NULL, then the standard default CAMP is used. - - pGMMPProfile - Pointer to a WCS GMMP color profile structure specifying the profile. - If this parameter is NULL, then the standard default GMMP is used. - - dwDesireAccess - Specifies how to access the given profile. This parameter must take one the following constant values. - - dwShareMode - Specifies how the profile should be shared, if the profile is contained in a file. - A value of zero prevents the profile from being shared at all. - - dwCreationMode - Specifies which actions to take on the profile while opening it, if it is contained in a file. - - -Return Value: - - HPROFILE - Handle to the opened color profile - ---*/ -HPROFILE -CWCSApiConv::WcsOpenColorProfileW( - _In_ PPROFILE pCDMPProfile, - _In_opt_ PPROFILE pCAMPProfile, - _In_opt_ PPROFILE pGMMPProfile, - _In_ DWORD dwDesireAccess, - _In_ DWORD dwShareMode, - _In_ DWORD dwCreationMode, - _In_ DWORD dwFlags - ) -{ - HPROFILE hProfile = NULL; - - if (m_WcsOpenColorProfileW != NULL) - { - hProfile = m_WcsOpenColorProfileW.GetFunc()(pCDMPProfile, - pCAMPProfile, - pGMMPProfile, - dwDesireAccess, - dwShareMode, - dwCreationMode, - dwFlags); - } - - return hProfile; -} - -/*++ - -Routine Name: - - CWCSApiConv::WcsCreateIccProfile - -Routine Description: - - -Arguments: - - hWcsProfile - handle to a WCS profile which contains a combination - of a WCS DMP, and optionally a CAMP and/or GMMP. - - dwOptions - Options flag values from WCS_DEFAULT and WCS_ICCONLY - -Return Value: - - HPROFILE - Handle to the newly created color profile - ---*/ -HPROFILE -CWCSApiConv::WcsCreateIccProfile( - _In_ HPROFILE hWcsProfile, - _In_ DWORD dwOptions - ) -{ - HPROFILE hProfile = NULL; - - if (m_WcsCreateIccProfile != NULL) - { - hProfile = m_WcsCreateIccProfile.GetFunc()(hWcsProfile, dwOptions); - } - - return hProfile; -} - diff --git a/print/XPSDrvSmpl/src/filters/color/wcsapiconv.h b/print/XPSDrvSmpl/src/filters/color/wcsapiconv.h deleted file mode 100644 index 1e63cd6a..00000000 --- a/print/XPSDrvSmpl/src/filters/color/wcsapiconv.h +++ /dev/null @@ -1,280 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - wcsapiconv.h - -Abstract: - - Provides a wrapper to the WCS API's - ---*/ - -#pragma once - -class CWCSApiConv; -extern CWCSApiConv g_WCSApiConv; - -typedef BOOL (CALLBACK* WCSASSOCIATECOLORPROFILEWITHDEVICE)(WCS_PROFILE_MANAGEMENT_SCOPE, PCWSTR, PCWSTR); -typedef BOOL (CALLBACK* WCSDISASSOCIATECOLORPROFILEFROMDEVICE)(WCS_PROFILE_MANAGEMENT_SCOPE, PCWSTR, PCWSTR); -typedef BOOL (CALLBACK* WCSENUMCOLORPROFILESSIZE)(WCS_PROFILE_MANAGEMENT_SCOPE, PENUMTYPEW, PDWORD); -typedef BOOL (CALLBACK* WCSGETDEFAULTCOLORPROFILESIZE)(WCS_PROFILE_MANAGEMENT_SCOPE, PCWSTR, COLORPROFILETYPE, COLORPROFILESUBTYPE, DWORD, PDWORD); -typedef BOOL (CALLBACK* WCSGETDEFAULTCOLORPROFILE)(WCS_PROFILE_MANAGEMENT_SCOPE, PCWSTR, COLORPROFILETYPE, COLORPROFILESUBTYPE, DWORD, DWORD, LPWSTR); -typedef BOOL (CALLBACK* WCSSETDEFAULTCOLORPROFILE)(WCS_PROFILE_MANAGEMENT_SCOPE, PCWSTR, COLORPROFILETYPE, COLORPROFILESUBTYPE, DWORD, LPCWSTR); -typedef BOOL (CALLBACK* WCSSETDEFAULTRENDERINGINTENT)(WCS_PROFILE_MANAGEMENT_SCOPE, DWORD); -typedef BOOL (CALLBACK* WCSGETUSEPERUSERPROFILES)(LPCWSTR, DWORD, PBOOL); -typedef BOOL (CALLBACK* WCSSETUSEPERUSERPROFILES)(LPCWSTR, DWORD, BOOL); -typedef BOOL (CALLBACK* WCSTRANSLATECOLORS)(HTRANSFORM, DWORD, DWORD, COLORDATATYPE, DWORD, PVOID, DWORD, COLORDATATYPE, DWORD, PVOID); -typedef BOOL (CALLBACK* WCSCHECKCOLORS)(HTRANSFORM, DWORD, DWORD, COLORDATATYPE, DWORD, PVOID, PBYTE); -typedef HPROFILE (CALLBACK* WCSOPENCOLORPROFILE)(PPROFILE, PPROFILE, PPROFILE, DWORD, DWORD, DWORD, DWORD); -typedef HPROFILE (CALLBACK* WCSCREATEICCPROFILE)(HPROFILE, DWORD); - -#define WcsAssociateColorProfileWithDeviceXD g_WCSApiConv.WcsAssociateColorProfileWithDevice -#define WcsDisassociateColorProfileFromDeviceXD g_WCSApiConv.WcsDisassociateColorProfileFromDevice -#define WcsEnumColorProfilesSizeXD g_WCSApiConv.WcsEnumColorProfilesSize -#define WcsGetDefaultColorProfileSizeXD g_WCSApiConv.WcsGetDefaultColorProfileSize -#define WcsGetDefaultColorProfileXD g_WCSApiConv.WcsGetDefaultColorProfile -#define WcsSetDefaultColorProfileXD g_WCSApiConv.WcsSetDefaultColorProfile -#define WcsSetDefaultRenderingIntentXD g_WCSApiConv.WcsSetDefaultRenderingIntent -#define WcsGetUsePerUserProfilesXD g_WCSApiConv.WcsGetUsePerUserProfiles -#define WcsSetUsePerUserProfilesXD g_WCSApiConv.WcsSetUsePerUserProfiles -#define WcsTranslateColorsXD g_WCSApiConv.WcsTranslateColors -#define WCSCheckColorsXD g_WCSApiConv.WCSCheckColors -#define WcsOpenColorProfileWXD g_WCSApiConv.WcsOpenColorProfileW -#define WcsOpenColorProfileAXD g_WCSApiConv.WcsOpenColorProfileA -#define WcsCreateIccProfileXD g_WCSApiConv.WcsCreateIccProfile - -#ifdef _UNICODE -#define WcsOpenColorProfileXD WcsOpenColorProfileWXD -#else -#define WcsOpenColorProfileXD WcsOpenColorProfileAXD -#endif - -template <typename _T> -class CEncodedFuncPtr -{ -public: - CEncodedFuncPtr() : - m_pFunc(NULL) - { - } - - ~CEncodedFuncPtr(){} - - CEncodedFuncPtr<_T>& - operator=( - _In_ FARPROC pFunc - ) - { - m_pFunc = EncodePointer(pFunc); - return *this; - } - - BOOL - operator==( - _In_opt_ PVOID pv - ) const - { - return m_pFunc == pv; - } - - BOOL - operator!=( - _In_opt_ PVOID pv - ) const - { - return !operator==(pv); - } - - _T - GetFunc( - VOID - ) - { - return reinterpret_cast<_T>(DecodePointer(m_pFunc)); - } - -private: - __field_encoded_pointer PVOID m_pFunc; -}; - -class CWCSApiConv -{ -public: - CWCSApiConv(); - - ~CWCSApiConv(); - - BOOL - WcsAssociateColorProfileWithDevice( - _In_ WCS_PROFILE_MANAGEMENT_SCOPE scope, - _In_ PCWSTR pProfileName, - _In_ PCWSTR pDeviceName - ); - - BOOL - WcsDisassociateColorProfileFromDevice( - _In_ WCS_PROFILE_MANAGEMENT_SCOPE scope, - _In_ PCWSTR pProfileName, - _In_ PCWSTR pDeviceName - ); - - _Success_(return) - BOOL - WcsEnumColorProfilesSize( - _In_ WCS_PROFILE_MANAGEMENT_SCOPE scope, - _In_ PENUMTYPEW pEnumRecord, - _Out_ PDWORD pdwSize - ); - - _Success_(return) - BOOL - WcsGetDefaultColorProfileSize( - _In_ WCS_PROFILE_MANAGEMENT_SCOPE scope, - _In_opt_ PCWSTR pDeviceName, - _In_ COLORPROFILETYPE cptColorProfileType, - _In_ COLORPROFILESUBTYPE cpstColorProfileSubType, - _In_ DWORD dwProfileID, - _Out_ PDWORD pcbProfileName - ); - - _Success_(return) - BOOL - WcsGetDefaultColorProfile( - _In_ WCS_PROFILE_MANAGEMENT_SCOPE scope, - _In_opt_ PCWSTR pDeviceName, - _In_ COLORPROFILETYPE cptColorProfileType, - _In_ COLORPROFILESUBTYPE cpstColorProfileSubType, - _In_ DWORD dwProfileID, - _In_ DWORD cbProfileName, - _Out_writes_bytes_(cbProfileName) LPWSTR pProfileName - ); - - BOOL - WcsSetDefaultColorProfile( - _In_ WCS_PROFILE_MANAGEMENT_SCOPE scope, - _In_opt_ PCWSTR pDeviceName, - _In_ COLORPROFILETYPE cptColorProfileType, - _In_ COLORPROFILESUBTYPE cpstColorProfileSubType, - _In_ DWORD dwProfileID, - _In_opt_ LPCWSTR pProfileName - ); - - BOOL - WcsSetDefaultRenderingIntent( - _In_ WCS_PROFILE_MANAGEMENT_SCOPE scope, - _In_ DWORD dwRenderingIntent - ); - - _Success_(return) - BOOL - WcsGetUsePerUserProfiles( - _In_ LPCWSTR pDeviceName, - _In_ DWORD dwDeviceClass, - _Out_ PBOOL pUsePerUserProfiles - ); - - BOOL - WcsSetUsePerUserProfiles( - _In_ LPCWSTR pDeviceName, - _In_ DWORD dwDeviceClass, - _In_ BOOL usePerUserProfiles - ); - - BOOL - WcsTranslateColors( - _In_ HTRANSFORM hColorTransform, - _In_ DWORD nColors, - _In_ DWORD nInputChannels, - _In_ COLORDATATYPE cdtInput, - _In_ DWORD cbInput, - _In_reads_bytes_(cbInput) PVOID pInputData, - _In_ DWORD nOutputChannels, - _In_ COLORDATATYPE cdtOutput, - _In_ DWORD cbOutput, - _Out_writes_bytes_(cbOutput)PVOID pOutputData - ); - - BOOL - WCSCheckColors( - _In_ HTRANSFORM hColorTransform, - _In_ DWORD nColors, - _In_ DWORD nInputChannels, - _In_ COLORDATATYPE cdtInput, - _In_ DWORD cbInput, - _In_reads_bytes_(cbInput) PVOID pInputData, - _Out_writes_bytes_(nColors)PBYTE pResult - ); - - HPROFILE WINAPI - WcsOpenColorProfileA( - _In_ PPROFILE pCDMPProfile, - _In_opt_ PPROFILE pCAMPProfile, - _In_opt_ PPROFILE pGMMPProfile, - _In_ DWORD dwDesireAccess, - _In_ DWORD dwShareMode, - _In_ DWORD dwCreationMode, - _In_ DWORD dwFlags - ); - - HPROFILE WINAPI - WcsOpenColorProfileW( - _In_ PPROFILE pCDMPProfile, - _In_opt_ PPROFILE pCAMPProfile, - _In_opt_ PPROFILE pGMMPProfile, - _In_ DWORD dwDesireAccess, - _In_ DWORD dwShareMode, - _In_ DWORD dwCreationMode, - _In_ DWORD dwFlags - ); - - HPROFILE - WcsCreateIccProfile( - _In_ HPROFILE hWcsProfile, - _In_ DWORD dwOptions - ); - -private: - HINSTANCE m_dllHandle; - - // - // WCS API - // - CEncodedFuncPtr<WCSASSOCIATECOLORPROFILEWITHDEVICE> m_WcsAssociateColorProfileWithDevice; - - CEncodedFuncPtr<WCSDISASSOCIATECOLORPROFILEFROMDEVICE> m_WcsDisassociateColorProfileFromDevice; - - CEncodedFuncPtr<WCSENUMCOLORPROFILESSIZE> m_WcsEnumColorProfilesSize; - - CEncodedFuncPtr<WCSGETDEFAULTCOLORPROFILESIZE> m_WcsGetDefaultColorProfileSize; - - CEncodedFuncPtr<WCSGETDEFAULTCOLORPROFILE> m_WcsGetDefaultColorProfile; - - CEncodedFuncPtr<WCSSETDEFAULTCOLORPROFILE> m_WcsSetDefaultColorProfile; - - CEncodedFuncPtr<WCSSETDEFAULTRENDERINGINTENT> m_WcsSetDefaultRenderingIntent; - - CEncodedFuncPtr<WCSGETUSEPERUSERPROFILES> m_WcsGetUsePerUserProfiles; - - CEncodedFuncPtr<WCSSETUSEPERUSERPROFILES> m_WcsSetUsePerUserProfiles; - - CEncodedFuncPtr<WCSTRANSLATECOLORS> m_WcsTranslateColors; - - CEncodedFuncPtr<WCSCHECKCOLORS> m_WcsCheckColors; - - CEncodedFuncPtr<WCSOPENCOLORPROFILE> m_WcsOpenColorProfileA; - - CEncodedFuncPtr<WCSOPENCOLORPROFILE> m_WcsOpenColorProfileW; - - CEncodedFuncPtr<WCSCREATEICCPROFILE> m_WcsCreateIccProfile; -}; - diff --git a/print/XPSDrvSmpl/src/filters/color/wictobmscn.cpp b/print/XPSDrvSmpl/src/filters/color/wictobmscn.cpp deleted file mode 100644 index ca6058aa..00000000 --- a/print/XPSDrvSmpl/src/filters/color/wictobmscn.cpp +++ /dev/null @@ -1,751 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - wictobmscn.cpp - -Abstract: - - WIC pixel format to BMFORMAT conversion class implementation. This class provides methods - for converting between a source WIC scanline to a target destination BMFORMAT scanline. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "wictobmscn.h" - -/*++ - -Routine Name: - - CWICToBMFormatScan::CWICToBMFormatScan - -Routine Description: - - CWICToBMFormatScan constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CWICToBMFormatScan::CWICToBMFormatScan() : - m_pScanBuffer(NULL), - m_cbScanBuffer(0), - m_cWidth(0), - m_pData(NULL), - m_cbData(0), - m_bInitialized(FALSE) -{ -} - -/*++ - -Routine Name: - - CWICToBMFormatScan::~CWICToBMFormatScan - -Routine Description: - - CWICToBMFormatScan destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CWICToBMFormatScan::~CWICToBMFormatScan() -{ - FreeScanBuffer(); -} - -/*++ - -Routine Name: - - CWICToBMFormatScan::Initialize - -Routine Description: - - Initializes the WIC to BMFORMAT transform data from the WICToBMFORMAT structure - -Arguments: - - WICToBM - Structure containing WIC pixel format to BMFORMAT conversion information - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWICToBMFormatScan::Initialize( - _In_ CONST WICToBMFORMAT& WICToBM - ) -{ - HRESULT hr = S_OK; - - m_convData = WICToBM; - - if (m_convData.m_pixFormTarget <= kWICPixelFormatMin || - m_convData.m_pixFormTarget >= kWICPixelFormatMax || - m_convData.m_bmFormTarget < kICMPixelFormatMin || - m_convData.m_bmFormTarget >= kICMPixelFormatMax) - { - hr = E_INVALIDARG; - } - - if (SUCCEEDED(hr) && - !IsVista()) - { - // - // When processing color data down-level from Vista, we cannot use fixed or float - // BMFORMAT types. In these circumstances we need to convert to a 16 bpc equivalent, - // then back again. - // - if (m_convData.m_bmFormTarget == kBM_32b_scRGB || - m_convData.m_bmFormTarget == kBM_32b_scARGB || - m_convData.m_bmFormTarget == kBM_S2DOT13FIXED_scRGB || - m_convData.m_bmFormTarget == kBM_S2DOT13FIXED_scARGB) - { - m_convData.m_bNeedsScanBuffer = TRUE; - m_convData.m_bmFormTarget = kBM_16b_RGB; - } - } - - if (SUCCEEDED(hr)) - { - m_bInitialized = TRUE; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWICToBMFormatScan::SetData - -Routine Description: - - Set the current WIC data. This method takes the WIC scanline data and - applies any necessary conversion to achieve the required BMFORMAT - -Arguments: - - bIsSrc - Indicates if this is a source scanline (i.e. is the conversion required as the scanline is input) - pWicPxData - Pointer to the WIC data - cbWicPxData - Count of bytes in the WIC data buffer - cWidth - Count of pixels inthe scanline - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWICToBMFormatScan::SetData( - _In_ CONST BOOL bIsSrc, - _In_reads_bytes_(cbWicPxData) PBYTE pWicPxData, - _In_ CONST UINT cbWicPxData, - _In_ CONST UINT cWidth - ) -{ - HRESULT hr = m_bInitialized ? S_OK : E_PENDING; - - COLORDATATYPE srcColType = COLOR_BYTE; - EICMPixelFormat eICMFormSrc = kBM_RGBTRIPLETS; - - COLORDATATYPE dstColType = COLOR_BYTE; - EICMPixelFormat eICMFormDst = kBM_RGBTRIPLETS; - - // - // Validate input - // - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_POINTER(pWicPxData, E_POINTER))) - { - if (m_convData.m_pixFormTarget >= kWICPixelFormatMin && - m_convData.m_pixFormTarget < kWICPixelFormatMax) - { - // - // Set up the destination and source formats - // - eICMFormSrc = g_lutWICToBMFormat[m_convData.m_pixFormTarget].m_bmFormTarget; - srcColType = g_lutWICToBMFormat[m_convData.m_pixFormTarget].m_colDataType; - - if (m_convData.m_bmFormTarget < kICMPixelFormatMax && - m_convData.m_bmFormTarget >= kICMPixelFormatMin) - { - dstColType = g_lutBMFormatData[m_convData.m_bmFormTarget].m_colDataType; - eICMFormDst = m_convData.m_bmFormTarget; - } - else - { - hr = E_FAIL; - } - } - else - { - hr = E_FAIL; - } - } - - // - // Validate source and destination formats - // - if (SUCCEEDED(hr)) - { - if (eICMFormSrc < kICMPixelFormatMin || - eICMFormSrc >= kICMPixelFormatMax || - eICMFormDst < kICMPixelFormatMin || - eICMFormDst >= kICMPixelFormatMax) - { - RIP("Invalid pixel format.\n"); - - hr = E_FAIL; - } - else if (srcColType < COLOR_BYTE || - srcColType > COLOR_S2DOT13FIXED || - dstColType < COLOR_BYTE || - dstColType > COLOR_S2DOT13FIXED) - { - RIP("Invalid color data type.\n"); - - hr = E_FAIL; - } - } - - if (SUCCEEDED(hr)) - { - m_cWidth = cWidth; - if (m_convData.m_bNeedsScanBuffer) - { - // - // We need to convert in one way or another - create a buffer to - // hold the intermediate scanline data - // - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CreateScanBuffer(m_cWidth, - g_lutColorDataSize[dstColType], - g_lutBMFormatData[eICMFormDst].m_cChannels))) - { - if (bIsSrc) - { - // - // We need to initialise the buffer from the WIC buffer passed in. Here we - // are doing one of two things: - // - // 1. Copying data directly as we have parity between the WIC and - // ICM pixel formats - // 2. Convert from the WIC format to the ICM format and copy. - // - - // - // Set up the source and destination pointers - // - PBYTE pSrc = pWicPxData; - UINT cSrcChannels = g_lutWICToBMFormat[m_convData.m_pixFormTarget].m_cChannels; - size_t cbSrcBytesPerPixel = g_lutColorDataSize[srcColType] * cSrcChannels; - - PBYTE pDst = m_pScanBuffer; - UINT cDstChannels = g_lutBMFormatData[eICMFormDst].m_cChannels; - size_t cbDstBytesPerPixel = g_lutColorDataSize[dstColType] * cDstChannels; - - PBYTE pSrcEnd = pSrc + cbWicPxData; - PBYTE pDstEnd = pDst + m_cbScanBuffer; - - if (dstColType == m_convData.m_colDataType) - { - while (pSrc < pSrcEnd && - pDst < pDstEnd) - { - if (pSrc + cbDstBytesPerPixel < pSrcEnd) - { - CopyMemory(pDst, pSrc, cbDstBytesPerPixel); - } - pSrc += cbSrcBytesPerPixel; - pDst += cbDstBytesPerPixel; - } - } - else - { - // - // We should only ever be required to convert from floating point and fixed point - // scRGB formats to 16 bpc RGB - // - if (eICMFormDst == kBM_16b_RGB && - (eICMFormSrc == kBM_32b_scRGB || - eICMFormSrc == kBM_32b_scARGB)) - { - FLOAT* pSrcData = reinterpret_cast<FLOAT*>(pSrc); - WORD* pDstData = reinterpret_cast<WORD*>(pDst); - - while (pSrcData <= reinterpret_cast<FLOAT*>(pSrcEnd) - cSrcChannels && - pDstData <= reinterpret_cast<WORD*>(pDstEnd) - cDstChannels) - { - for (UINT cChan = 0; - cChan < cDstChannels && cChan < cSrcChannels; - cChan++) - { - // - // Note: We are only converting from FLOAT and not applying gamma modification - // as the transform should account for this given the input scRGB ICC source profile. - // - if (pSrcData[cChan] <= -2.0f) - { - pDstData[cChan] = 0; - } - else if (pSrcData[cChan] >= 2.0f) - { - pDstData[cChan] = 0xFFFF; - } - else - { - pDstData[cChan] = static_cast<WORD>(kMaxWordAsFloat * (pSrcData[cChan] + 2.0) / 4.0f); - } - } - - pSrcData += cSrcChannels; - pDstData += cDstChannels; - } - } - else if (eICMFormDst == kBM_16b_RGB && - (eICMFormSrc == kBM_S2DOT13FIXED_scRGB || - eICMFormSrc == kBM_S2DOT13FIXED_scARGB)) - { - WORD* pSrcData = reinterpret_cast<WORD*>(pSrc); - WORD* pDstData = reinterpret_cast<WORD*>(pDst); - - while (pSrcData <= reinterpret_cast<WORD*>(pSrcEnd) - cSrcChannels && - pDstData <= reinterpret_cast<WORD*>(pDstEnd) - cDstChannels) - { - for (UINT cChan = 0; - cChan < cDstChannels && cChan < cSrcChannels; - cChan++) - { - // - // Note: We are only converting from S2DOT13FIXED and not applying gamma modification - // as the transform should account for this given the input scRGB ICC source profile. - // - pDstData[cChan] = pSrcData[cChan] & kS2Dot13Neg ? pSrcData[cChan] ^ 0xFFFF : pSrcData[cChan] | kS2Dot13Neg; - } - - pSrcData += cSrcChannels; - pDstData += cDstChannels; - } - } - else - { - hr = E_NOTIMPL; - } - } - } - - // - // Set the out buffer pointer and size to the copy buffer - // - if (SUCCEEDED(hr)) - { - m_pData = m_pScanBuffer; - m_cbData = m_cbScanBuffer; - } - } - } - else - { - // - // Set the out buffer pointer and size to the WIC pixel data - // - m_pData = pWicPxData; - m_cbData = cbWicPxData; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWICToBMFormatScan::Commit - -Routine Description: - - Commits the internal scanline data to the WIC data buffer - -Arguments: - - pWicPxData - Pointer to the WIC data - cbWicPxData - Count of bytes in the WIC data buffer - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWICToBMFormatScan::Commit( - _In_reads_bytes_(cbWicPxData) PBYTE pWicPxData, - _In_ CONST UINT cbWicPxData - ) -{ - HRESULT hr = m_bInitialized ? S_OK : E_PENDING; - - COLORDATATYPE srcColType = COLOR_BYTE; - EICMPixelFormat eICMFormSrc = kBM_RGBTRIPLETS; - - COLORDATATYPE dstColType = COLOR_BYTE; - EICMPixelFormat eICMFormDst = kBM_RGBTRIPLETS; - - // - // Validate input - // - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_POINTER(pWicPxData, E_POINTER))) - { - if (m_convData.m_pixFormTarget >= kWICPixelFormatMin && - m_convData.m_pixFormTarget < kWICPixelFormatMax) - { - // - // Set up the destination and source formats - // - eICMFormDst = g_lutWICToBMFormat[m_convData.m_pixFormTarget].m_bmFormTarget; - dstColType = g_lutWICToBMFormat[m_convData.m_pixFormTarget].m_colDataType; - - if (m_convData.m_bmFormTarget < kICMPixelFormatMax && - m_convData.m_bmFormTarget >= kICMPixelFormatMin) - { - eICMFormSrc = m_convData.m_bmFormTarget; - srcColType = g_lutBMFormatData[eICMFormSrc].m_colDataType; - } - else - { - hr = E_FAIL; - } - } - else - { - hr = E_FAIL; - } - } - - // - // Validate source and destination formats - // - if (SUCCEEDED(hr)) - { - if (eICMFormSrc < kICMPixelFormatMin || - eICMFormSrc >= kICMPixelFormatMax || - eICMFormDst < kICMPixelFormatMin || - eICMFormDst >= kICMPixelFormatMax) - { - RIP("Invalid pixel format.\n"); - - hr = E_FAIL; - } - else if (srcColType < COLOR_BYTE || - srcColType > COLOR_S2DOT13FIXED || - dstColType < COLOR_BYTE || - dstColType > COLOR_S2DOT13FIXED) - { - RIP("Invalid color data type.\n"); - - hr = E_FAIL; - } - } - - if (SUCCEEDED(hr)) - { - if (pWicPxData != m_pData) - { - // - // We need to convert the scan buffer and write back into the WIC buffer - // - PBYTE pDst = pWicPxData; - UINT cDstChannels = g_lutWICToBMFormat[m_convData.m_pixFormTarget].m_cChannels; - size_t cbDstBytesPerPixel = g_lutColorDataSize[dstColType] * cDstChannels; - - PBYTE pSrc = m_pScanBuffer; - UINT cSrcChannels = g_lutBMFormatData[eICMFormSrc].m_cChannels; - size_t cbSrcBytesPerPixel = g_lutColorDataSize[srcColType] * cSrcChannels; - - PBYTE pSrcEnd = pSrc + m_cbScanBuffer; - PBYTE pDstEnd = pDst + cbWicPxData; - - if (srcColType == m_convData.m_colDataType) - { - while (pSrc < pSrcEnd && - pDst < pDstEnd) - { - if (pDst + cbSrcBytesPerPixel < pDstEnd) - { - CopyMemory(pDst, pSrc, cbSrcBytesPerPixel); - } - - pSrc += cbSrcBytesPerPixel; - pDst += cbDstBytesPerPixel; - } - } - else - { - // - // We should only ever be required to convert from 16 bpc RGB to floating point - // and fixed point scRGB formats - // - if (eICMFormSrc == kBM_16b_RGB && - (eICMFormDst == kBM_32b_scRGB || - eICMFormDst == kBM_32b_scARGB)) - { - WORD* pSrcData = reinterpret_cast<WORD*>(pSrc); - FLOAT* pDstData = reinterpret_cast<FLOAT*>(pDst); - UINT cAlpha = eICMFormDst == kBM_32b_scARGB ? 1 : 0; - - while (pSrcData <= reinterpret_cast<WORD*>(pSrcEnd) - cSrcChannels && - pDstData <= reinterpret_cast<FLOAT*>(pDstEnd) - cDstChannels) - { - pDstData += cAlpha; - - for (UINT cChan = 0; - cChan < (cDstChannels - cAlpha) && cChan < cSrcChannels; - cChan++) - { - // - // Note: We are only converting to FLOAT and not applying gamma modification - // as the transform should account for this given the input scRGB ICC source profile. - // - pDstData[cChan] = (4.0f * static_cast<FLOAT>(pSrcData[cChan]) / kMaxWordAsFloat) - 2.0f; - } - - pSrcData += cSrcChannels; - pDstData += cDstChannels - cAlpha; - } - } - else if (eICMFormSrc == kBM_16b_RGB && - (eICMFormDst == kBM_S2DOT13FIXED_scRGB || - eICMFormDst == kBM_S2DOT13FIXED_scARGB)) - { - WORD* pSrcData = reinterpret_cast<WORD*>(pSrc); - WORD* pDstData = reinterpret_cast<WORD*>(pDst); - UINT cAlpha = eICMFormDst == kBM_S2DOT13FIXED_scARGB ? 1 : 0; - - while (pSrcData <= reinterpret_cast<WORD*>(pSrcEnd) - cSrcChannels && - pDstData <= reinterpret_cast<WORD*>(pDstEnd) - cDstChannels) - { - pDstData += cAlpha; - - for (UINT cChan = 0; - cChan < (cDstChannels - cAlpha) && cChan < cSrcChannels; - cChan++) - { - // - // Note: We are only converting to S2DOT13FIXED and not applying gamma modification - // as the transform should account for this given the input scRGB ICC source profile. - // - pDstData[cChan] = pSrcData[cChan] & kS2Dot13Neg ? - pSrcData[cChan] ^ kS2Dot13Neg : pSrcData[cChan] ^ 0xFFFF; - } - - pSrcData += cSrcChannels; - pDstData += cDstChannels - cAlpha; - } - } - else - { - hr = E_NOTIMPL; - } - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWICToBMFormatScan::GetData - -Routine Description: - - Retrieves the BMFORMAT buffer ready for processing - -Arguments: - - ppData - Pointer to a pointer that recieves the address of the data buffer. - Note: the buffer is only valid for the lifetime of the CWICToBMFormatScan object. - pBmFormat - Pointer to a BMFORMAT enum that recieves the type - pcWidth - Pointer to storage that recieves the pixel width - pcbStride - Pointer to storage that recieves the scanline stride - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWICToBMFormatScan::GetData( - _Outptr_result_bytebuffer_(*pcbStride) PBYTE* ppData, - _Out_ BMFORMAT* pBmFormat, - _Out_ UINT* pcWidth, - _Out_ UINT* pcbStride - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppData, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pBmFormat, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pcWidth, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pcbStride, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(m_pData, E_PENDING))) - { - if (m_convData.m_bmFormTarget >= kICMPixelFormatMin && - m_convData.m_bmFormTarget < kICMPixelFormatMax) - { - *pBmFormat = g_lutBMFormatData[m_convData.m_bmFormTarget].m_bmFormat; - *pcWidth = m_cWidth; - *ppData = m_pData; - *pcbStride = static_cast<UINT>(m_cbData); - } - else - { - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWICToBMFormatScan::CreateScanBuffer - -Routine Description: - - Creates the intermediate scanline buffer - -Arguments: - - cWidth - Pixel width of the scanline - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWICToBMFormatScan::CreateScanBuffer( - _In_ CONST UINT cWidth, - _In_ CONST SIZE_T cbDataType, - _In_ CONST UINT cChannels - ) -{ - HRESULT hr = S_OK; - - if (cWidth > MAX_PIXELWIDTH_COUNT || - cbDataType > MAX_COLDATATYPE_SIZE || - cChannels > MAX_COLCHANNEL_COUNT) - { - hr = E_INVALIDARG; - } - - size_t cbScanBuffer = 0; - - if (SUCCEEDED(hr)) - { - if (FAILED(SizeTMult(cWidth, cbDataType, &cbScanBuffer)) || - FAILED(SizeTMult(cbScanBuffer, cChannels, &cbScanBuffer))) - { - hr = HRESULT_FROM_WIN32(ERROR_ARITHMETIC_OVERFLOW); - } - - } - - if (SUCCEEDED(hr)) - { - if (cbScanBuffer != m_cbScanBuffer) - { - FreeScanBuffer(); - m_pScanBuffer = new(std::nothrow) BYTE[cbScanBuffer]; - if (SUCCEEDED(hr = CHECK_POINTER(m_pScanBuffer, E_OUTOFMEMORY))) - { - m_cbScanBuffer = cbScanBuffer; - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWICToBMFormatScan::FreeScanBuffer - -Routine Description: - - Free the intermediate scanline buffer - -Arguments: - - None - -Return Value: - - None - ---*/ -VOID -CWICToBMFormatScan::FreeScanBuffer( - VOID - ) -{ - if (m_pScanBuffer != NULL) - { - delete[] m_pScanBuffer; - m_pScanBuffer = NULL; - } - - m_cbScanBuffer = 0; -} - diff --git a/print/XPSDrvSmpl/src/filters/color/wictobmscn.h b/print/XPSDrvSmpl/src/filters/color/wictobmscn.h deleted file mode 100644 index 6ac780be..00000000 --- a/print/XPSDrvSmpl/src/filters/color/wictobmscn.h +++ /dev/null @@ -1,88 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - wictobmscn.h - -Abstract: - - WIC pixel format to BMFORMAT conversion class implementation. This class provides methods - for converting between a source WIC scanline to a target destination BMFORMAT scanline. - ---*/ - -#pragma once - -#include "bmpdata.h" - -class CWICToBMFormatScan -{ -public: - CWICToBMFormatScan(); - - virtual ~CWICToBMFormatScan(); - - HRESULT - Initialize( - _In_ CONST WICToBMFORMAT& WICToBM - ); - - HRESULT - SetData( - _In_ CONST BOOL bIsSrc, - _In_reads_bytes_(cbWicPxData) PBYTE pWicPxData, - _In_ CONST UINT cbWicPxData, - _In_ CONST UINT cWidth - ); - - HRESULT - Commit( - _In_reads_bytes_(cbWicPxData) PBYTE pWicPxData, - _In_ CONST UINT cbWicPxData - ); - - HRESULT - GetData( - _Outptr_result_bytebuffer_(*pcbStride) PBYTE* ppData, - _Out_ BMFORMAT* pBmFormat, - _Out_ UINT* pcWidth, - _Out_ UINT* pcbStride - ); - -private: - HRESULT - CreateScanBuffer( - _In_ CONST UINT cWidth, - _In_ CONST SIZE_T cbDataType, - _In_ CONST UINT cChannels - ); - - VOID - FreeScanBuffer( - VOID - ); - -private: - WICToBMFORMAT m_convData; - - PBYTE m_pScanBuffer; - - size_t m_cbScanBuffer; - - UINT m_cWidth; - - PBYTE m_pData; - - size_t m_cbData; - - BOOL m_bInitialized; -}; diff --git a/print/XPSDrvSmpl/src/filters/common/clasfact.h b/print/XPSDrvSmpl/src/filters/common/clasfact.h deleted file mode 100644 index 409fc9bc..00000000 --- a/print/XPSDrvSmpl/src/filters/common/clasfact.h +++ /dev/null @@ -1,202 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - clasfact.h - -Abstract: - - This file defines a template IClassFactory implementation - to be returned by each filter's DllGetClassObject() function. - - Also, a routine to return one of these class factories so that - this code does not need to be duplicated in every filter's - DllGetClassObject(). - ---*/ - -#pragma once - -#include "cunknown.h" -#include "globals.h" - -template <class _T> -class CClassFactory : public CUnknown<IClassFactory> -{ -public: - // - // Constructor and Destruction - // - CClassFactory() : - CUnknown<IClassFactory>(IID_IClassFactory) - { } - - virtual ~CClassFactory() - { } - - // - // IClassFactory methods - // - virtual HRESULT STDMETHODCALLTYPE - CreateInstance( - _In_opt_ LPUNKNOWN pUnkOuter, - _In_ REFIID riid, - _Outptr_ PVOID* ppvObject - ) - { - HRESULT hr = S_OK; - - if (ppvObject == NULL) - { - hr = E_POINTER; - goto Exit; - } - *ppvObject = NULL; - - if (pUnkOuter == NULL) - { - // - // Create Filter - // - _T* pFilter = NULL; - - try - { - pFilter = new(std::nothrow) _T; - hr = CHECK_POINTER(pFilter, E_OUTOFMEMORY); - } - catch (CXDException& e) - { - if (pFilter != NULL) - { - delete pFilter; - pFilter = NULL; - } - - hr = e; - } - catch(...) - { - hr = E_FAIL; - } - - if (SUCCEEDED(hr)) - { - // - // Get the requested interface - // - hr = pFilter->QueryInterface(riid, ppvObject) ; - - // - // Release the IUnknown pointer. If QueryInterface failed - // the Release() call will clean up - // - pFilter->Release(); - } - } - else - { - // - // Cannot aggregate - // - hr = CLASS_E_NOAGGREGATION; - } - - Exit: - ERR_ON_HR(hr); - return hr; - } - - virtual HRESULT STDMETHODCALLTYPE - LockServer( - _In_ BOOL bLock - ) - { - if (bLock) - { - InterlockedIncrement(&g_cServerLocks); - } - else - { - InterlockedDecrement(&g_cServerLocks); - } - - return S_OK; - } -}; - -template <class _T> -HRESULT -GetFilterClassFactory( - _In_ REFCLSID rclsid, - _In_ REFIID riid, - _In_ REFCLSID expectedclsid, - _Out_ VOID** ppv - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppv, E_POINTER))) - { - *ppv = NULL; - - // - // Make sure the appropriate class factory is being requested - // - if (rclsid == expectedclsid) - { - CClassFactory<_T>* pFactory = NULL; - - try - { - pFactory = new(std::nothrow) CClassFactory<_T>(); - hr = CHECK_POINTER(pFactory, E_OUTOFMEMORY); - } - catch (CXDException& e) - { - if (pFactory != NULL) - { - delete pFactory; - pFactory = NULL; - } - - hr = e; - } - catch (...) - { - hr = E_FAIL; - } - - if (SUCCEEDED(hr)) - { - // - // Get the requested interface. - // - hr = pFactory->QueryInterface(riid, ppv); - - // - // Release the IUnknown pointer. - // (If QueryInterface failed, component will delete itself.) - // - pFactory->Release(); - } - } - else - { - hr = CLASS_E_CLASSNOTAVAILABLE; - } - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/common/precompsrc.cpp b/print/XPSDrvSmpl/src/filters/common/precompsrc.cpp deleted file mode 100644 index 5944cf51..00000000 --- a/print/XPSDrvSmpl/src/filters/common/precompsrc.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "precomp.h"
\ No newline at end of file diff --git a/print/XPSDrvSmpl/src/filters/common/ptmanage.cpp b/print/XPSDrvSmpl/src/filters/common/ptmanage.cpp deleted file mode 100644 index fa50170f..00000000 --- a/print/XPSDrvSmpl/src/filters/common/ptmanage.cpp +++ /dev/null @@ -1,1216 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - ptmanage.cpp - -Abstract: - - PrintTicket management class implementation. This class encapsulate - PrintTicket handling algorithm defined in the XPS Document specification. - It provides a simple set and get interace for to filters and handles - merging of tickets and the use of the Win32 PrintTicket provider API. - The algorithm for determining the PrintTicket applies as follows: - - 1. Validate and merge the PrintTicket from the FDS with the default - printicket converted from the property bag. - The resultant ticket will be the Job level ticket. - - 2. Validate and merge the PrintTicket from the current FD with the Job - level ticket from step 1. The resultant ticket will be the document - level ticket. - - 3. Validate and merge the PrintTicket from the current FP with the Doc - level ticket from step 2. The resultant ticket will be the page - level ticket. - - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "ptmanage.h" -#include "streamcnv.h" - -/*++ - -Routine Name: - - CPTManager::CPTManager - -Routine Description: - - CPTManager class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CPTManager::CPTManager() : - m_pDefaultPT(NULL), - m_pJobPT(NULL), - m_pDocPT(NULL), - m_pPagePT(NULL), - m_hProvider(NULL), - m_hToken(INVALID_HANDLE_VALUE) -{ -} - -/*++ - -Routine Name: - - CPTManager::~CPTManager - -Routine Description: - - CPTManager class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CPTManager::~CPTManager() -{ - // - // Close the PT provider - // - CloseProvider(); -} - -/*++ - -Routine Name: - - CPTManager::Initialise - -Routine Description: - - This routine Initialises the PrintTicket manager with the default PrintTicket - and the device name. - -Arguments: - - pDefaultTicketStream - Pointer to the default user PrintTicket as an IStream - bstrPrinterName - The name of the printer - userToken - The user's security token - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTManager::Initialise( - _In_ IPrintReadStream* pDefaultTicketStream, - _In_z_ BSTR bstrPrinterName, - _In_ HANDLE userToken - ) -{ - HRESULT hr = S_OK; - - m_hToken = userToken; - - // - // If the provider is already open close it - // - CloseProvider(); - - if (SUCCEEDED(hr = CHECK_POINTER(pDefaultTicketStream, E_POINTER))) - { - if (SysStringLen(bstrPrinterName) <= 0) - { - hr = E_INVALIDARG; - } - } - - // - // We need to impersonate the user who submitted the job - // in order to always have sufficient rights to call - // PTOpenProvider. - // - if (SUCCEEDED(hr)) - { - if (SetThreadToken(NULL, m_hToken)) - { - // - // Open the PT interface and initialise PrintTickets - // - if (SUCCEEDED(hr = PTOpenProvider(bstrPrinterName, 1, &m_hProvider))) - { - CComPtr<IStream> pPTStream(NULL); - pPTStream.Attach(new(std::nothrow) CPrintReadStreamToIStream(pDefaultTicketStream)); - - if (SUCCEEDED(hr = CHECK_POINTER(pPTStream, E_OUTOFMEMORY))) - { - hr = InitialisePrintTickets(pPTStream); - } - } - - // - // Always revert back to the default security context - // - if (!SetThreadToken(NULL, NULL)) - { - // - // We couldn't revert the security context. The filter pipeline - // manager will clean up the thread when operation is complete, - // when it is determined that the security context was not - // reverted. Since there are no security implications with - // running this filter in an elevated context, we can - // continue to run. - // - } - } - else - { - hr = HRESULT_FROM_WIN32(GetLastError()); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPTManager::SetTicket - -Routine Description: - - This routine sets the Job level PrintTicket from the PrintTicket held in the - FixedDocumentSequence. If there is no PrintTicket associated with the FDS, the - default PrintTicket is used to set the Job level PrintTicket. - -Arguments: - - pFDS - Pointer to the FixedDocumentSequence interface - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTManager::SetTicket( - _In_ CONST IFixedDocumentSequence* pFDS - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pFDS, E_POINTER))) - { - CComPtr<IPartPrintTicket> pPTRef(NULL); - - // - // If a PrintTicket is available merge it at the job level - // - if (SUCCEEDED(hr = const_cast<IFixedDocumentSequence*>(pFDS)->GetPrintTicket(&pPTRef))) - { - hr = MergeTicket(kPTJobScope, pPTRef); - } - else if (hr == HRESULT_FROM_WIN32(ERROR_NOT_FOUND)) - { - // - // This indicates there is no print-ticket associated with - // the job. Free the tickets from this scope upward and - // reintialise the defaults - // - FreePrintTickets(kPTJobScope); - hr = UpdateDefaultPTs(kPTJobScope); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPTManager::SetTicket - -Routine Description: - - This routine sets the Socument level PrintTicket from the PrintTicket held in the - FixedDocument. If there is no PrintTicket associated with the FD, the - FixedDocumentSequence PrintTicket is used to set the Docuemnt level PrintTicket. - -Arguments: - - pFD - Pointer to the FixedDocument interface - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTManager::SetTicket( - _In_ CONST IFixedDocument* pFD - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pFD, E_POINTER))) - { - CComPtr<IPartPrintTicket> pPTRef(NULL); - - // - // If a PrintTicket is available merge it at the doc level - // - if (SUCCEEDED(hr) && - SUCCEEDED(hr = const_cast<IFixedDocument*>(pFD)->GetPrintTicket(&pPTRef))) - { - hr = MergeTicket(kPTDocumentScope, pPTRef); - } - else if (hr == HRESULT_FROM_WIN32(ERROR_NOT_FOUND)) - { - // - // This indicates there is no print-ticket associated with - // the job. Free the tickets from this scope upward and - // reintialise the defaults - // - FreePrintTickets(kPTDocumentScope); - hr = UpdateDefaultPTs(kPTDocumentScope); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPTManager::SetTicket - -Routine Description: - - This routine sets the Page level PrintTicket from the PrintTicket held in the - FixedPage. If there is no PrintTicket associated with the FP, the - FixedDocument PrintTicket is used to set the Page level PrintTicket. - -Arguments: - - pFP - Pointer to the FixedPage interface - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTManager::SetTicket( - _In_ CONST IFixedPage* pFP - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pFP, E_POINTER))) - { - CComPtr<IPartPrintTicket> pPTRef(NULL); - - // - // If a PrintTicket is available merge it at the page level - // - if (SUCCEEDED(hr) && - SUCCEEDED(hr = const_cast<IFixedPage*>(pFP)->GetPrintTicket(&pPTRef))) - { - hr = MergeTicket(kPTPageScope, pPTRef); - } - else if (hr == HRESULT_FROM_WIN32(ERROR_NOT_FOUND)) - { - // - // This indicates there is no print-ticket associated with - // the job. Free the tickets from this scope upward and - // reintialise the defaults - // - FreePrintTickets(kPTPageScope); - hr = UpdateDefaultPTs(kPTPageScope); - } - } - - ERR_ON_HR(hr); - return hr; -} - - -/*++ - -Routine Name: - - CPTManager::SetTicket - -Routine Description: - - Sets the PrintTicket at the specified scope given a PrintTicket defined - as a DOM document - -Arguments: - - ptScope - The scope of the PrintTicket to be set - pPT - Pointer to an IXMLDOMDocument2 interface that contains the PrintTicket to be set - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTManager::SetTicket( - _In_ CONST EPrintTicketScope ptScope, - _In_opt_ CONST IXMLDOMDocument2* pPT - ) -{ - HRESULT hr = S_OK; - - // - // Free the tickets from this scope upward and reintialise - // from the appropriate default. This ensures we are not - // using an old PrintTicket from the same scope - // - FreePrintTickets(ptScope); - - if (SUCCEEDED(hr = UpdateDefaultPTs(ptScope))) - { - if (pPT) - { - hr = MergeTicket(ptScope, pPT); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPTManager::GetTicket - -Routine Description: - - This routine retrieves the PrintTicket at the requested scope - -Arguments: - - ptScope - The scope of the PrintTicket to be retrieved - ppTicket - Pointer to an IXMLDOMDocument2 interface pointer that recieves the PrintTicket - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTManager::GetTicket( - _In_ CONST EPrintTicketScope ptScope, - _Outptr_ IXMLDOMDocument2** ppTicket - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppTicket, E_POINTER)) && - SUCCEEDED(hr = UpdateDefaultPTs(ptScope))) - { - *ppTicket = NULL; - - switch (ptScope) - { - case kPTPageScope: - { - // - // Pointer should either be default or FP ticket but never NULL - // - ASSERTMSG(m_pPagePT != NULL, "NULL Page PrintTicket.\n"); - - if (SUCCEEDED(hr = CHECK_POINTER(m_pPagePT, E_PENDING))) - { - *ppTicket = m_pPagePT; - } - } - break; - - case kPTDocumentScope: - { - // - // Pointer should either be default or FD ticket but never NULL - // - ASSERTMSG(m_pDocPT != NULL, "NULL Document PrintTicket.\n"); - - if (SUCCEEDED(hr = CHECK_POINTER(m_pDocPT, E_PENDING))) - { - *ppTicket = m_pDocPT; - } - } - break; - - case kPTJobScope: - { - // - // Pointer should either be default or FDS ticket but never NULL - // - ASSERTMSG(m_pJobPT != NULL, "NULL Job PrintTicket.\n"); - - if (SUCCEEDED(hr = CHECK_POINTER(m_pJobPT, E_PENDING))) - { - *ppTicket = m_pJobPT; - } - } - break; - - default: - { - RIP("Unrecognised PT scope\n"); - - hr = E_INVALIDARG; - } - break; - } - - if (*ppTicket == NULL) - { - RIP("Failed to retrieve a valid PrintTicket\n"); - - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - - -/*++ - -Routine Name: - - CPTManager::GetCapabilities - -Routine Description: - - This routine retrieves a PrintCapabilities document given a PrintTicket - -Arguments: - - pTicket - Pointer to the PrintTicket as a DOM document - pTicket - Pointer to a DOM document pointer that recieves the PrintCapabilities - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTManager::GetCapabilities( - _In_ IXMLDOMDocument2* pTicket, - _Outptr_ IXMLDOMDocument2** ppCapabilities - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pTicket, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(ppCapabilities, E_POINTER))) - { - *ppCapabilities = NULL; - - CComBSTR bstrError; - CComPtr<IStream> pPTIn(NULL); - CComPtr<IStream> pPCOut(NULL); - CComPtr<IXMLDOMDocument2> pCapabilitiesDoc(NULL); - - // - // Create the PrintCapabilities DOM document, retrieve the IStreams from the - // DOM documents and call the PT api to retrieve the capabilities document - // - if (SUCCEEDED(hr = pCapabilitiesDoc.CoCreateInstance(CLSID_DOMDocument60)) && - SUCCEEDED(hr = pTicket->QueryInterface(IID_IStream, reinterpret_cast<VOID**>(&pPTIn))) && - SUCCEEDED(hr = pCapabilitiesDoc->QueryInterface(IID_IStream, reinterpret_cast<VOID**>(&pPCOut)))) - { - if (SetThreadToken(NULL, m_hToken)) - { - if (SUCCEEDED(hr = PTGetPrintCapabilities(m_hProvider, pPTIn, pPCOut, &bstrError))) - { - LARGE_INTEGER cbMove = {0}; - if (SUCCEEDED(hr = pPCOut->Seek(cbMove, STREAM_SEEK_SET, NULL))) - { - *ppCapabilities = pCapabilitiesDoc.Detach(); - } - } - else - { - try - { - CStringXDA cstrError(bstrError); - ERR(cstrError.GetBuffer()); - } - catch (CXDException&) - { - } - } - - // - // Always revert back to the default security context - // - if (!SetThreadToken(NULL, NULL)) - { - // - // We couldn't revert the security context. The filter pipeline - // manager will clean up the thread when operation is complete, - // when it is determined that the security context was not - // reverted. Since there are no security implications with - // running this filter in an elevated context, we can - // continue to run. - // - } - } - else - { - hr = HRESULT_FROM_WIN32(GetLastError()); - - // - // If SetThreadToken fails, GetLastError will return an error - // - _Analysis_assume_(FAILED(hr)); - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPTManager::InitialisePrintTickets - -Routine Description: - - This routine intialises the PrintTickets at the default, job, document and page scope - using an IStream containing the default PrintTicket mark-up - -Arguments: - - pDefaultPTStream - Pointer to an IStream interface that contains the default PrintTicket data - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTManager::InitialisePrintTickets( - _In_ IStream* pDefaultPTStream - ) -{ - ASSERTMSG(m_hProvider != NULL, "NULL PrintTicket provider interface detected.\n"); - - HRESULT hr = S_OK; - - // - // Make sure all print tickets are released - // - m_pDefaultPT = NULL; - m_pJobPT = NULL; - m_pDocPT = NULL; - m_pPagePT = NULL; - - if (SUCCEEDED(hr = CHECK_POINTER(pDefaultPTStream, E_POINTER))) - { - // - // Create the DOM documents for default PT - // - hr = SetPTFromStream(pDefaultPTStream, &m_pDefaultPT); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPTManager::SetPTFromDOMDoc - -Routine Description: - - This routine copies one DOM document representation of the PrintTicket to another - -Arguments: - - pPTDOMDoc - Pointer to the source PrintTicket as a DOM document - ppDomDoc - Pointer to an IXMLDOMDOcument pointer that recieves the copied PrintTicket - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTManager::SetPTFromDOMDoc( - _In_ IXMLDOMDocument2* pPTDOMDoc, - _Outptr_ IXMLDOMDocument2** ppDomDoc - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pPTDOMDoc, E_POINTER))) - { - // - // Get the IStream from the DOM doc and pass to SetPTFromStream - // - CComPtr<IStream> pStream(NULL); - if (SUCCEEDED(hr = pPTDOMDoc->QueryInterface(IID_IStream, reinterpret_cast<VOID**>(&pStream)))) - { - hr = SetPTFromStream(pStream, ppDomDoc); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPTManager::SetPTFromStream - -Routine Description: - - This routine copies an IStream representation of the PrintTicket to a DOM document - -Arguments: - - pPTStream - Pointer to the source PrintTicket as an IStream - ppDomDoc - Pointer to an IXMLDOMDOcument pointer that recieves the copied PrintTicket - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTManager::SetPTFromStream( - _In_ IStream* pPTStream, - _Outptr_ IXMLDOMDocument2** ppDomDoc - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pPTStream, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(ppDomDoc, E_POINTER))) - { - *ppDomDoc = NULL; - - LARGE_INTEGER cbMoveFromStart = {0}; - CComPtr<IXMLDOMDocument2> pDOMDoc(NULL); - VARIANT_BOOL fLoaded = VARIANT_FALSE; - - // - // Create the DOM document instance, seek to the start of the - // PT stream and load into the dom document - // - if (SUCCEEDED(hr = pDOMDoc.CoCreateInstance(CLSID_DOMDocument60)) && - SUCCEEDED(hr = pPTStream->Seek(cbMoveFromStart, STREAM_SEEK_SET, NULL)) && - SUCCEEDED(hr = pDOMDoc->load(CComVariant(pPTStream), &fLoaded))) - { - if (fLoaded == VARIANT_TRUE) - { - // - // Assign the outgoing element pointer - detach from CComPtr to release ownership - // - *ppDomDoc = pDOMDoc.Detach(); - } - else - { - hr = E_FAIL; - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPTManager::MergeTicket - -Routine Description: - - This routine merges a PrintTicket (supplied as a IPartPrintTicket pointer) into - the DOM representation of the PrintTicket at the requested scope - -Arguments: - - ptScope - The scope at which the PrintTicket is to be merged - pPTRef - Pointer to an IPartPrintTicket interface containing the PrintTicket to be merged - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTManager::MergeTicket( - _In_ CONST EPrintTicketScope ptScope, - _In_ CONST IPartPrintTicket* pPTRef - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pPTRef, E_POINTER))) - { - // - // Create a DOM document from the PT ref stream - // - CComPtr<IXMLDOMDocument2> pNewPT(NULL); - CComPtr<IPrintReadStream> pRead(NULL); - - if (SUCCEEDED(hr = pNewPT.CoCreateInstance(CLSID_DOMDocument60)) && - SUCCEEDED(hr = const_cast<IPartPrintTicket*>(pPTRef)->GetStream(&pRead))) - { - CComPtr<ISequentialStream> pReadStreamToSeq(NULL); - VARIANT_BOOL fLoaded = VARIANT_FALSE; - - pReadStreamToSeq.Attach(new(std::nothrow) pfp::PrintReadStreamToSeqStream(pRead)); - - if (SUCCEEDED(hr = CHECK_POINTER(pReadStreamToSeq, E_OUTOFMEMORY)) && - SUCCEEDED(hr = pNewPT->load(CComVariant(pReadStreamToSeq), &fLoaded))) - { - if (fLoaded == VARIANT_TRUE) - { - hr = MergeTicket(ptScope, pNewPT); - } - else - { - hr = E_FAIL; - } - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPTManager::MergeTicket - -Routine Description: - - This routine merges a PrintTicket (supplied as a IXMLDOMDocument2 pointer) into - the DOM representation of the PrintTicket at the requested scope - -Arguments: - - ptScope - The scope at which the PrintTicket is to be merged - pPT - Pointer to an IXMLDOMDocument2 interface containing the PrintTicket to be merged - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTManager::MergeTicket( - _In_ CONST EPrintTicketScope ptScope, - _In_ CONST IXMLDOMDocument2* pPT - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pPT, E_POINTER))) - { - CComPtr<IXMLDOMDocument2> pPTLevelUp(NULL); - CComPtr<IXMLDOMDocument2> pResult(NULL); - - switch (ptScope) - { - case kPTJobScope: - { - pPTLevelUp = m_pDefaultPT; - } - break; - - case kPTDocumentScope: - { - pPTLevelUp = m_pJobPT; - } - break; - - case kPTPageScope: - { - pPTLevelUp = m_pDocPT; - } - break; - - default: - { - RIP("Unrecognised PT scope\n"); - - hr = E_INVALIDARG; - } - break; - } - - ASSERTMSG(pPTLevelUp != NULL, "PrintTicket at the level up has not been set (check part handler is attempting to)\n"); - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_POINTER(pPTLevelUp, E_PENDING)) && - SUCCEEDED(hr = GetMergedTicket(ptScope, pPT, pPTLevelUp, &pResult))) - { - switch (ptScope) - { - case kPTJobScope: - { - m_pJobPT = pResult; - } - break; - - case kPTDocumentScope: - { - m_pDocPT = pResult; - } - break; - - case kPTPageScope: - { - m_pPagePT = pResult; - } - break; - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPTManager::GetMergedTicket - -Routine Description: - - This routine retrieves a merged PrintTicket at the requested scope given the base - and delta PrintTickets as IXMLDOMDocument2 interface pointers - -Arguments: - - ptScope - The scope at which the merge should take place - pDelta - The delta PrintTicket as an IXMLDOMDocument2 pointer - pBase - The base PrintTicket as an IXMLDOMDocument2 pointer - ppResult - The resulting PrintTicket after the merge has completed - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTManager::GetMergedTicket( - _In_ CONST EPrintTicketScope ptScope, - _In_ CONST IXMLDOMDocument2* pDelta, - _In_ IXMLDOMDocument2* pBase, - _Outptr_ IXMLDOMDocument2** ppResult - ) -{ - ASSERTMSG(pDelta != NULL, "NULL PT reference part passed.\n"); - ASSERTMSG(pBase != NULL, "NULL base PT passed.\n"); - ASSERTMSG(ppResult != NULL, "NULL out PT passed.\n"); - - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_HANDLE(m_hProvider, E_PENDING)) && - SUCCEEDED(hr = CHECK_POINTER(ppResult, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pDelta, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pBase, E_POINTER))) - { - *ppResult = NULL; - } - - CComPtr<IStream> pResultStream(NULL); - CComPtr<IStream> pBaseStream(NULL); - CComPtr<IStream> pDeltaStream(NULL); - - CComPtr<IXMLDOMDocument2> pNewPT(NULL); - - // - // Create a new DOM doc based off the result ticket and - // assign to the resultant DOM doc - // - try - { - CComBSTR bstrErrorMessage; - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CreateStreamOnHGlobal(NULL, TRUE, &pResultStream)) && - SUCCEEDED(hr = pBase->QueryInterface(IID_IStream, reinterpret_cast<VOID**>(&pBaseStream))) && - SUCCEEDED(hr = const_cast<IXMLDOMDocument2*>(pDelta)->QueryInterface(IID_IStream, reinterpret_cast<VOID**>(&pDeltaStream)))) - { - if (SetThreadToken(NULL, m_hToken)) - { - if (SUCCEEDED(hr = PTMergeAndValidatePrintTicket(m_hProvider, - pBaseStream, - pDeltaStream, - ptScope, - pResultStream, - &bstrErrorMessage))) - { - if (SUCCEEDED(hr = SetPTFromStream(pResultStream, &pNewPT))) - { - // - // Assign the outgoing element pointer - detach from CComPtr to release ownership - // - *ppResult = pNewPT.Detach(); - } - } - else - { - CStringXDA cstrMessage; - CStringXDA cstrError(bstrErrorMessage); - cstrMessage.Format("PTMergeAndValidatePrintTicket failed with message: %s\n", static_cast<LPCSTR>(cstrError)); - - ERR(cstrMessage.GetBuffer()); - } - - // - // Always revert back to the default security context - // - if (!SetThreadToken(NULL, NULL)) - { - // - // We couldn't revert the security context. The filter pipeline - // manager will clean up the thread when operation is complete, - // when it is determined that the security context was not - // reverted. Since there are no security implications with - // running this filter in an elevated context, we can - // continue to run. - // - } - } - else - { - hr = HRESULT_FROM_WIN32(GetLastError()); - - // - // If SetThreadToken fails, GetLastError will return an error - // - _Analysis_assume_(FAILED(hr)); - } - } - } - catch (CXDException& e) - { - hr = e; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPTManager::CloseProvider - -Routine Description: - - This routine closes the PrintTicket provider - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTManager::CloseProvider( - VOID - ) -{ - HRESULT hr = S_OK; - - if (m_hProvider != NULL) - { - hr = PTCloseProvider(m_hProvider); - m_hProvider = NULL; - } - - return hr; -} - -/*++ - -Routine Name: - - CPTManager::UpdateDefaultPTs - -Routine Description: - - This routine updates the default PrintTicket at a given scope. This routine updates - the Job PrintTicket with the default, the Document with the Job and the Page with the - Document if they are not set and are within the requested scope. - -Arguments: - - ptScope - The scope of the PrintTicket to update - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTManager::UpdateDefaultPTs( - _In_ CONST EPrintTicketScope ptScope - ) -{ - HRESULT hr = S_OK; - - // - // We need at least the default ticket in place - // - ASSERTMSG(m_pDefaultPT != NULL, "The default PrintTicket is not correctly set\n"); - - if (SUCCEEDED(hr = CHECK_POINTER(m_pDefaultPT, E_PENDING))) - { - if (ptScope <= kPTJobScope && - m_pJobPT == NULL) - { - hr = SetPTFromDOMDoc(m_pDefaultPT, &m_pJobPT); - } - - if (SUCCEEDED(hr) && - ptScope <= kPTDocumentScope && - m_pDocPT == NULL) - { - hr = SetPTFromDOMDoc(m_pJobPT, &m_pDocPT); - } - - if (SUCCEEDED(hr) && - ptScope == kPTPageScope && - m_pPagePT == NULL) - { - hr = SetPTFromDOMDoc(m_pDocPT, &m_pPagePT); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPTManager::FreePrintTickets - -Routine Description: - - This routine releases the PrintTicket at a given scope and all PrintTickets - that depend on it. - -Arguments: - - ptScope - The scope from which the PrintTickets should be released - -Return Value: - - None - ---*/ -VOID -CPTManager::FreePrintTickets( - _In_ CONST EPrintTicketScope ptScope - ) -{ - if (ptScope >= kPTPageScope) - { - m_pPagePT = NULL; - } - - if (ptScope >= kPTDocumentScope) - { - m_pDocPT = NULL; - } - - if (ptScope >= kPTJobScope) - { - m_pJobPT = NULL; - } -} - diff --git a/print/XPSDrvSmpl/src/filters/common/ptmanage.h b/print/XPSDrvSmpl/src/filters/common/ptmanage.h deleted file mode 100644 index 1c1e3f67..00000000 --- a/print/XPSDrvSmpl/src/filters/common/ptmanage.h +++ /dev/null @@ -1,153 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - ptmanage.cpp - -Abstract: - - PrintTicket management class definition. This class encapsulate - PrintTicket handling algorithm defined in the XPS Document specification. - It provides a simple set and get interace for to filters and handles - merging of tickets and the use of the Win32 PrintTicket provider API. - The algorithm for determining the PrintTicket applies as follows: - - 1. Validate and merge the PrintTicket from the FDS with the default - printicket converted from the default devmode in the property bag. - The resultant ticket will be the Job level ticket. - - 2. Validate and merge the PrintTicket from the current FD with the Job - level ticket from step 1. The resultant ticket will be the document - level ticket. - - 3. Validate and merge the PrintTicket from the current FP with the Doc - level ticket from step 2. The resultant ticket will be the page - level ticket. - ---*/ - -#pragma once - -class CPTManager -{ -public: - CPTManager(); - - virtual ~CPTManager(); - - HRESULT - Initialise( - _In_ IPrintReadStream* pDefaultTicketStream, - _In_z_ BSTR bstrPrinterName, - _In_ HANDLE userToken - ); - - HRESULT - SetTicket( - _In_ CONST IFixedDocumentSequence* pFDS - ); - - HRESULT - SetTicket( - _In_ CONST IFixedDocument* pFD - ); - - HRESULT - SetTicket( - _In_ CONST IFixedPage* pFP - ); - - HRESULT - SetTicket( - _In_ CONST EPrintTicketScope ptScope, - _In_opt_ CONST IXMLDOMDocument2* pPT - ); - - HRESULT - GetTicket( - _In_ CONST EPrintTicketScope ptScope, - _Outptr_ IXMLDOMDocument2** ppTicket - ); - - HRESULT - GetCapabilities( - _In_ IXMLDOMDocument2* pTicket, - _Outptr_ IXMLDOMDocument2** ppCapabilities - ); - -private: - HRESULT - InitialisePrintTickets( - _In_ IStream* pDefaultPTStream - ); - - HRESULT - SetPTFromDOMDoc( - _In_ IXMLDOMDocument2* pPTDOMDoc, - _Outptr_ IXMLDOMDocument2** ppDomDoc - ); - - HRESULT - SetPTFromStream( - _In_ IStream* pPTStream, - _Outptr_ IXMLDOMDocument2** ppDomDoc - ); - - HRESULT - MergeTicket( - _In_ CONST EPrintTicketScope ptScope, - _In_ CONST IPartPrintTicket* pPTRef - ); - - HRESULT - MergeTicket( - _In_ CONST EPrintTicketScope ptScope, - _In_ CONST IXMLDOMDocument2* pPT - ); - - HRESULT - GetMergedTicket( - _In_ CONST EPrintTicketScope ptScope, - _In_ CONST IXMLDOMDocument2* pDelta, - _In_ IXMLDOMDocument2* pBase, - _Outptr_ IXMLDOMDocument2** ppResult - ); - - HRESULT - CloseProvider( - VOID - ); - - HRESULT - UpdateDefaultPTs( - _In_ CONST EPrintTicketScope ptScope - ); - - VOID - FreePrintTickets( - _In_ CONST EPrintTicketScope ptScope - ); - -private: - CComPtr<IXMLDOMDocument2> m_pDefaultPT; - - CComPtr<IXMLDOMDocument2> m_pJobPT; - - CComPtr<IXMLDOMDocument2> m_pDocPT; - - CComPtr<IXMLDOMDocument2> m_pPagePT; - - HPTPROVIDER m_hProvider; - - HANDLE m_hToken; -}; - diff --git a/print/XPSDrvSmpl/src/filters/common/rescache.cpp b/print/XPSDrvSmpl/src/filters/common/rescache.cpp deleted file mode 100644 index 32b206e2..00000000 --- a/print/XPSDrvSmpl/src/filters/common/rescache.cpp +++ /dev/null @@ -1,309 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - rescache.cpp - -Abstract: - - File resource cache implementation. Filters that need to add resources - may be required to add the same resource to numerous pages in a job. To - prevent the same resource being sent repeatedly, the file resource cache - class implements an interface that filters can use to add resources - without needing to keep track of whether they have been sent. For specific - filter functionality, a class should be created that implements a resource - writer interface. This should be able to write the resource to a stream. The - filter can then add this class to the the resource cache and it will take - care of writing the resource via the IResWriter::WriteData method if it has - not already been written. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdexcept.h" -#include "rescache.h" - -/*++ - -Routine Name: - - CFileResourceCache::CFileResourceCache - -Routine Description: - - CFileResourceCache class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CFileResourceCache::CFileResourceCache() -{ -} - -/*++ - -Routine Name: - - CFileResourceCache::~CFileResourceCache - -Routine Description: - - CFileResourceCache class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CFileResourceCache::~CFileResourceCache() -{ -} - -/*++ - -Routine Name: - - CFileResourceCache::WriteResource - -Routine Description: - - This template function writes a resource to a fixed page. The type - of resource is supplied as an argument to the template. The resource - data is written via the IResWriter interface passed to the method. - -Arguments: - - pXpsConsumer - The XPS consumer to create the new resource part - pFixedPage - The FixedPage to send the resource to - pResWriter - The resource writer (hides the resource type behind a generic write interface) - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -template <class _T> -HRESULT -CFileResourceCache::WriteResource( - _In_ IXpsDocumentConsumer* pXpsConsumer, - _In_ IFixedPage* pFixedPage, - _In_ IResWriter* pResWriter - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pXpsConsumer, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pFixedPage, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pResWriter, E_POINTER))) - { - CComBSTR bstrKeyName; - CComBSTR bstrURI; - - // - // Check if the resource has already been written - // - if (SUCCEEDED(hr = pResWriter->GetKeyName(&bstrKeyName)) && - SUCCEEDED(hr = pResWriter->GetResURI(&bstrURI))) - { - if (!Cached(bstrKeyName)) - { - // - // The resource is not cached: - // 1. Create the resource part - // 2. Write data to part - // 3. Cache URI and new part against the resource name - // - CComPtr<_T> pRes(NULL); - CComPtr<IPrintWriteStream> pWrite(NULL); - - if (SUCCEEDED(hr = pXpsConsumer->GetNewEmptyPart(bstrURI, - __uuidof(_T), - reinterpret_cast<VOID**>(&pRes), - &pWrite))) - { - hr = pResWriter->WriteData(pRes, pWrite); - - pWrite->Close(); - - try - { - CComPtr<IPartBase> pPartBase(NULL); - if (SUCCEEDED(hr) && - SUCCEEDED(hr = pRes.QueryInterface(&pPartBase))) - { - m_resMap[CComBSTR(bstrKeyName)].first = bstrURI; - m_resMap[CComBSTR(bstrKeyName)].second = pPartBase; - } - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - } - - // - // Set the resource so relationships are updated - // - try - { - if (SUCCEEDED(hr)) - { - hr = pFixedPage->SetPagePart(m_resMap[CComBSTR(bstrKeyName)].second); - } - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CFileResourceCache::GetURI - -Routine Description: - - This routine retrieves the URI to a given resource - -Arguments: - - bstrResNameIn - The name of the resource for which the URI is required - pbstrURI - Pointer to a BSTR that recieves the resource URI - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CFileResourceCache::GetURI( - _In_z_ BSTR bstrResNameIn, - _Outptr_ BSTR* pbstrURI - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrURI, E_POINTER))) - { - if (SysStringLen(bstrResNameIn) == 0) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - try - { - CComBSTR bstrResName(bstrResNameIn); - CComBSTR uri(m_resMap[bstrResName].first); - - if (uri.Length() > 0) - { - if (SUCCEEDED(hr = uri.CopyTo(pbstrURI)) && - !*pbstrURI) - { - hr = E_OUTOFMEMORY; - } - } - else - { - *pbstrURI = NULL; - hr = E_FAIL; - } - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CFileResourceCache::Cached - -Routine Description: - - This routine checks if a resource has been cached - -Arguments: - - bstrResNameIn - The name (key) of the resource - -Return Value: - - BOOL - TRUE - The resource is in the cache - FALSE - The resource is not in the cache - ---*/ -BOOL -CFileResourceCache::Cached( - _In_z_ BSTR bstrResNameIn - ) -{ - BOOL bCached = FALSE; - - try - { - CComBSTR bstrResName(bstrResNameIn); - ResCache::const_iterator resMapIter = m_resMap.begin(); - - for (;resMapIter != m_resMap.end() && !bCached; resMapIter++) - { - if (resMapIter->first == bstrResName) - { - bCached = TRUE; - } - } - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - } - - return bCached; -} - diff --git a/print/XPSDrvSmpl/src/filters/common/rescache.h b/print/XPSDrvSmpl/src/filters/common/rescache.h deleted file mode 100644 index 554e6352..00000000 --- a/print/XPSDrvSmpl/src/filters/common/rescache.h +++ /dev/null @@ -1,132 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - rescache.h - -Abstract: - - File resource cache defintion and resource writer interface defintion. - Filters that need to add resources may be required to add the same resource - to numerous pages in a job. To prevent the same resource being sent - repeatedly, the file resource cache class implements an interface that - filters can use to add resources without needing to keep track of whether - they have been sent. For specific filter functionality, a class should be - created that implements a resource writer interface. This should be able to - write the resource to a stream. The filter can then add this class to the - the resource cache and it will take care of writing the resource via the - IResWriter::WriteData method if it has not already been written. - ---*/ - -#pragma once - -// -// The resource cache needs to map a unique name against the URI used -// and the part that was added. This allows us to retrieve the URI to -// write to the mark-up and also the part to set to the page/doc/docseq -// part. -// -typedef pair<CComBSTR, CComPtr<IPartBase> > URIPartPair; -typedef map<CComBSTR ,URIPartPair> ResCache; - -class IResWriter -{ -public: - IResWriter(){} - - virtual ~IResWriter(){} - - virtual HRESULT - WriteData( - _In_ IPartBase* pResource, - _In_ IPrintWriteStream* pWriter - ) = 0; - - virtual HRESULT - GetKeyName( - _Outptr_ BSTR* pbstrKeyName - ) = 0; - - virtual HRESULT - GetResURI( - _Outptr_ BSTR* pbstrResURI - ) = 0; - -}; - -class CFileResourceCache -{ -public: - CFileResourceCache(); - - virtual ~CFileResourceCache(); - - HRESULT - GetURI( - _In_z_ BSTR bstrResName, - _Outptr_ BSTR* pbstrURI - ); - - template <class _T> - HRESULT - WriteResource( - _In_ IXpsDocumentConsumer* pXpsConsumer, - _In_ IFixedPage* pFixedPage, - _In_ IResWriter* pResWriter - ); - -protected: - BOOL - Cached( - _In_z_ BSTR bstrResName - ); - -private: - ResCache m_resMap; -}; - -// -// Explicitly instantiate the IPartFont, IPartImage and IPartColorProfile WriteResource template functions -// -template -HRESULT -CFileResourceCache::WriteResource<IPartFont>( - _In_ IXpsDocumentConsumer* pXpsConsumer, - _In_ IFixedPage* pFixedPage, - _In_ IResWriter* pResWriter - ); - -template -HRESULT -CFileResourceCache::WriteResource<IPartImage>( - _In_ IXpsDocumentConsumer* pXpsConsumer, - _In_ IFixedPage* pFixedPage, - _In_ IResWriter* pResWriter - ); - -template -HRESULT -CFileResourceCache::WriteResource<IPartColorProfile>( - _In_ IXpsDocumentConsumer* pXpsConsumer, - _In_ IFixedPage* pFixedPage, - _In_ IResWriter* pResWriter - ); - -template -HRESULT -CFileResourceCache::WriteResource<IPartResourceDictionary>( - _In_ IXpsDocumentConsumer* pXpsConsumer, - _In_ IFixedPage* pFixedPage, - _In_ IResWriter* pResWriter - ); - diff --git a/print/XPSDrvSmpl/src/filters/common/rescpy.cpp b/print/XPSDrvSmpl/src/filters/common/rescpy.cpp deleted file mode 100644 index 2f56349c..00000000 --- a/print/XPSDrvSmpl/src/filters/common/rescpy.cpp +++ /dev/null @@ -1,132 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - rescpy.cpp - -Abstract: - - Page resource copy class implementation. This class stores resources - from one page and copies them to a destination. This is required when - copying page markup into a new page - without doing so any resources - referenced in the source page are lost. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "rescpy.h" - -/*++ - -Routine Name: - - CResourceCopier::CResourceCopier - -Routine Description: - - CResourceCopier class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CResourceCopier::CResourceCopier() -{ -} - -/*++ - -Routine Name: - - CResourceCopier::~CResourceCopier - -Routine Description: - - CResourceCopier class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CResourceCopier::~CResourceCopier() -{ -} - -/*++ - -Routine Name: - - CResourceCopier::CopyPageResources - -Routine Description: - - This routine takes a source page and copies all resources to a destination page. - This is required when a filter copies mark-up to a new FixedPage part else the - resources for the mark-up will be lost. - -Arguments: - - pFPSrc - Pointer to the source IFixedPage interface - pFPDst - Pointer to the destination IFixedPage interface - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CResourceCopier::CopyPageResources( - _In_ CONST IFixedPage* pFPSrc, - _Inout_ IFixedPage* pFPDst - ) -{ - HRESULT hr = S_OK; - CComPtr<IXpsPartIterator> pXpsPartIt(NULL); - - if (SUCCEEDED(hr = CHECK_POINTER(pFPSrc, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pFPDst, E_POINTER)) && - SUCCEEDED(hr = const_cast<IFixedPage*>(pFPSrc)->GetXpsPartIterator(&pXpsPartIt))) - { - pXpsPartIt->Reset(); - while (!pXpsPartIt->IsDone() && - SUCCEEDED(hr)) - { - CComBSTR bstrPartURI; - CComPtr<IUnknown> pXPSPart(NULL); - - if (SUCCEEDED(hr = pXpsPartIt->Current(&bstrPartURI, &pXPSPart))) - { - hr = pFPDst->SetPagePart(pXPSPart); - - pXpsPartIt->Next(); - } - } - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/common/rescpy.h b/print/XPSDrvSmpl/src/filters/common/rescpy.h deleted file mode 100644 index 27dde831..00000000 --- a/print/XPSDrvSmpl/src/filters/common/rescpy.h +++ /dev/null @@ -1,40 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - rescpy.h - -Abstract: - - Page resource copy class definition. This class stores resources - from one page and copies them to a destination. This is required when - copying page markup into a new page - without doing so any resources - referenced in the source page are lost. - ---*/ - -#pragma once - -class CResourceCopier -{ -public: - CResourceCopier(); - - virtual ~CResourceCopier(); - - HRESULT - CopyPageResources( - _In_ CONST IFixedPage* pFPSrc, - _Inout_ IFixedPage* pFPDst - ); -}; - diff --git a/print/XPSDrvSmpl/src/filters/common/saxhndlr.cpp b/print/XPSDrvSmpl/src/filters/common/saxhndlr.cpp deleted file mode 100644 index bca931a5..00000000 --- a/print/XPSDrvSmpl/src/filters/common/saxhndlr.cpp +++ /dev/null @@ -1,586 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - saxhndlr.cpp - -Abstract: - - Default sax handler implementation. Provides default implementations - for the ISAXContentHandler. This allows derived classes to only need - to implement the methods that are required. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "xdexcept.h" -#include "saxhndlr.h" -#include "widetoutf8.h" - -/*++ - -Routine Name: - - CSaxHandler::CSaxHandler - -Routine Description: - - CSaxHandler class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CSaxHandler::CSaxHandler() : - CUnknown<ISAXContentHandler>(IID_ISAXContentHandler) -{ -} - -/*++ - -Routine Name: - - CSaxHandler::~CSaxHandler - -Routine Description: - - CSaxHandler class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CSaxHandler::~CSaxHandler() -{ -} - -/*++ - -Routine Name: - - CSaxHandler::putDocumentLocator - -Routine Description: - - This routine is the default implementation for ISAXContentHandler::putDocumentLocator - -Arguments: - - Unused - -Return Value: - - HRESULT - S_OK - Always succeeds - ---*/ -HRESULT STDMETHODCALLTYPE -CSaxHandler::putDocumentLocator( - ISAXLocator * - ) -{ - return S_OK; -} - -/*++ - -Routine Name: - - CSaxHandler::startDocument - -Routine Description: - - This routine is the default implementation for ISAXContentHandler::startDocument - -Arguments: - - Unused - -Return Value: - - HRESULT - S_OK - Always succeeds - ---*/ -HRESULT STDMETHODCALLTYPE -CSaxHandler::startDocument( - void - ) -{ - return S_OK; -} - -/*++ - -Routine Name: - - CSaxHandler::endDocument - -Routine Description: - - This routine is the default implementation for ISAXContentHandler::endDocument - -Arguments: - - Unused - -Return Value: - - HRESULT - S_OK - Always succeeds - ---*/ -HRESULT STDMETHODCALLTYPE -CSaxHandler::endDocument( - void - ) -{ - return S_OK; -} - -/*++ - -Routine Name: - - CSaxHandler::startPrefixMapping - -Routine Description: - - This routine is the default implementation for ISAXContentHandler::startPrefixMapping - -Arguments: - - Unused - -Return Value: - - HRESULT - S_OK - Always succeeds - ---*/ -HRESULT STDMETHODCALLTYPE -CSaxHandler::startPrefixMapping( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT - ) -{ - return S_OK; -} - -/*++ - -Routine Name: - - CSaxHandler::endPrefixMapping - -Routine Description: - - This routine is the default implementation for ISAXContentHandler::endPrefixMapping - -Arguments: - - Unused - -Return Value: - - HRESULT - S_OK - Always succeeds - ---*/ -HRESULT STDMETHODCALLTYPE -CSaxHandler::endPrefixMapping( - CONST wchar_t*, - INT - ) -{ - return S_OK; -} - -/*++ - -Routine Name: - - CSaxHandler::startElement - -Routine Description: - - This routine is the default implementation for ISAXContentHandler::startElement - -Arguments: - - Unused - -Return Value: - - HRESULT - S_OK - Always succeeds - ---*/ -HRESULT STDMETHODCALLTYPE -CSaxHandler::startElement( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - _In_ ISAXAttributes* - ) -{ - return S_OK; -} - -/*++ - -Routine Name: - - CSaxHandler::endElement - -Routine Description: - - This routine is the default implementation for ISAXContentHandler::endElement - -Arguments: - - Unused - -Return Value: - - HRESULT - S_OK - Always succeeds - ---*/ -HRESULT STDMETHODCALLTYPE -CSaxHandler::endElement( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - CONST wchar_t*, - INT - ) -{ - return S_OK; -} - -/*++ - -Routine Name: - - CSaxHandler::characters - -Routine Description: - - This routine is the default implementation for ISAXContentHandler::characters - -Arguments: - - Unused - -Return Value: - - HRESULT - S_OK - Always succeeds - ---*/ -HRESULT STDMETHODCALLTYPE -CSaxHandler::characters( - CONST wchar_t*, - INT - ) -{ - return S_OK; -} - -/*++ - -Routine Name: - - CSaxHandler::ignorableWhitespace - -Routine Description: - - This routine is the default implementation for ISAXContentHandler::ignorableWhitespace - -Arguments: - - Unused - -Return Value: - - HRESULT - S_OK - Always succeeds - ---*/ -HRESULT STDMETHODCALLTYPE -CSaxHandler::ignorableWhitespace( - CONST wchar_t*, - INT - ) -{ - return S_OK; -} - -/*++ - -Routine Name: - - CSaxHandler::processingInstruction - -Routine Description: - - This routine is the default implementation for ISAXContentHandler::processingInstruction - -Arguments: - - Unused - -Return Value: - - HRESULT - S_OK - Always succeeds - ---*/ -HRESULT STDMETHODCALLTYPE -CSaxHandler::processingInstruction( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT - ) -{ - return S_OK; -} - -/*++ - -Routine Name: - - CSaxHandler::skippedEntity - -Routine Description: - - This routine is the default implementation for ISAXContentHandler::skippedEntity - -Arguments: - - Unused - -Return Value: - - HRESULT - S_OK - Always succeeds - ---*/ -HRESULT STDMETHODCALLTYPE -CSaxHandler::skippedEntity( - CONST wchar_t*, - INT - ) -{ - return S_OK; -} - -/*++ - -Routine Name: - - CSaxHandler::WriteToPrintStream - -Routine Description: - - This routine converts a CStringXDW buffer to UTF-8 string to be - written to the write stream provided. This overload handles accepts - an IPrintWriteStream to write the data out. - -Arguments: - - pcstrOut - Pointer to the Atl CStringXDW containing the mark-up to be written - pWriter - Pointer to the print write stream to write to - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CSaxHandler::WriteToPrintStream( - _In_ CStringXDW* pcstrOut, - _In_ IPrintWriteStream* pWriter - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pcstrOut, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pWriter, E_POINTER))) - { - ULONG cbWritten = 0; - PVOID pData = NULL; - ULONG cbData = 0; - - try - { - CWideToUTF8 wideToUTF8(pcstrOut); - - if (SUCCEEDED(hr = wideToUTF8.GetBuffer(&pData, &cbData))) - { - hr = pWriter->WriteBytes(pData, cbData, &cbWritten); - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CSaxHandler::WriteToPrintStream - -Routine Description: - - This routine converts a CStringXDW buffer to UTF-8 string to be - written to the write stream provided. This overload handles accepts - an ISequentialStream to write the data out. - -Arguments: - - pcstrOut - Pointer to the Atl CStringXDW containing the mark-up to be written - pWriter - Pointer to the print write stream to write to - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CSaxHandler::WriteToPrintStream( - _In_ CStringXDW* pcstrOut, - _In_ ISequentialStream* pWriter - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pcstrOut, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pWriter, E_POINTER))) - { - ULONG cbWritten = 0; - PVOID pData = NULL; - ULONG cbData = 0; - - try - { - CWideToUTF8 wideToUTF8(pcstrOut); - - if (SUCCEEDED(hr = wideToUTF8.GetBuffer(&pData, &cbData))) - { - hr = pWriter->Write(pData, cbData, &cbWritten); - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - - - -/*++ - -Routine Name: - - CSaxHandler::EscapeEntity - -Routine Description: - - The UnicodeString mark-up could contain characters that need to be escaped (the - SAX handler is passed the characters and not the original escapes). - The list of characters which need to be escaped are defined in the XML standard - and may change in future revisions. - This routine takes a BSTR and replaces all instances of these characters with - their escaped versions. - -Arguments: - - pStr - Pointer to the BSTR to be converted - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CSaxHandler::EscapeEntity( - _Inout_ BSTR* pStr - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pStr, E_POINTER))) - { - try - { - if (SysStringLen(*pStr) > 0) - { - CStringXDW cstrStr(*pStr); - - cstrStr.Replace(L"&", L"&"); - cstrStr.Replace(L"<", L"<"); - cstrStr.Replace(L">", L">"); - cstrStr.Replace(L"\"", L"""); - cstrStr.Replace(L"'", L"'"); - - SysFreeString(*pStr); - *pStr = cstrStr.AllocSysString(); - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/common/saxhndlr.h b/print/XPSDrvSmpl/src/filters/common/saxhndlr.h deleted file mode 100644 index 33b142e1..00000000 --- a/print/XPSDrvSmpl/src/filters/common/saxhndlr.h +++ /dev/null @@ -1,129 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - saxhndlr.h - -Abstract: - - Default sax handler definition. Provides default implementations - for the ISAXContentHandler. This allows derived classes to only need - to implement the methods that are required. - ---*/ - -#pragma once - -#include "CUnknown.h" - -class CSaxHandler : public CUnknown<ISAXContentHandler> -{ -public: - CSaxHandler(); - - virtual ~CSaxHandler(); - - virtual HRESULT STDMETHODCALLTYPE - putDocumentLocator( - ISAXLocator * - ); - - virtual HRESULT STDMETHODCALLTYPE - startDocument( - void - ); - - virtual HRESULT STDMETHODCALLTYPE - endDocument( - void - ); - - virtual HRESULT STDMETHODCALLTYPE - startPrefixMapping( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT - ); - - virtual HRESULT STDMETHODCALLTYPE - endPrefixMapping( - CONST wchar_t*, - INT - ); - - virtual HRESULT STDMETHODCALLTYPE - startElement( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - _In_ ISAXAttributes* - ); - - virtual HRESULT STDMETHODCALLTYPE - endElement( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - CONST wchar_t*, - INT - ); - - virtual HRESULT STDMETHODCALLTYPE - characters( - CONST wchar_t*, - INT - ); - - virtual HRESULT STDMETHODCALLTYPE - ignorableWhitespace( - CONST wchar_t*, - INT - ); - - virtual HRESULT STDMETHODCALLTYPE - processingInstruction( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT - ); - - virtual HRESULT STDMETHODCALLTYPE - skippedEntity( - CONST wchar_t*, - INT - ); - -protected: - HRESULT - WriteToPrintStream( - _In_ CStringXDW* pcstrOut, - _In_ IPrintWriteStream* pWriter - ); - - HRESULT - WriteToPrintStream( - _In_ CStringXDW* pcstrOut, - _In_ ISequentialStream* pWriter - ); - - HRESULT - EscapeEntity( - _Inout_ BSTR* pStr - ); -}; - diff --git a/print/XPSDrvSmpl/src/filters/common/widetoutf8.cpp b/print/XPSDrvSmpl/src/filters/common/widetoutf8.cpp deleted file mode 100644 index 39a207a5..00000000 --- a/print/XPSDrvSmpl/src/filters/common/widetoutf8.cpp +++ /dev/null @@ -1,199 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - widetoutf8.cpp - -Abstract: - - The CWideToUTF8 class converts a Unicode character string into the UTF-8 code page format. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "widetoutf8.h" - -/*++ - -Routine Name: - - CWideToUTF8::CWideToUTF8 - -Routine Description: - - CWideToUTF8 class constructor - -Arguments: - - pcstrWide - Unicode string to be converted to UTF8. - -Return Value: - - None - Throws CXDException(HRESULT) on an error - ---*/ -CWideToUTF8::CWideToUTF8( - CStringXDW* pcstrWide - ) : - m_pcstrWide(pcstrWide), - m_pMultiByte(NULL) -{ - HRESULT hr = CHECK_POINTER(m_pcstrWide, E_POINTER); - - if (FAILED(hr)) - { - throw CXDException(hr); - } -} - -/*++ - -Routine Name: - - CWideToUTF8::~CWideToUTF8 - -Routine Description: - - CWideToUTF8 class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CWideToUTF8::~CWideToUTF8() -{ - FreeBuffer(); -} - -/*++ - -Routine Name: - - CWideToUTF8::GetBuffer - -Routine Description: - - This method retrieves a pointer to the UTF8 converted character buffer for the CWideToUTF8 object. - -Arguments: - - ppBuffer - pointer to a pointer to the buffer. - pcbBuffer - size of the buffer that was returned. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWideToUTF8::GetBuffer( - _Outptr_ PVOID* ppBuffer, - _Out_ ULONG* pcbBuffer - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppBuffer, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pcbBuffer, E_POINTER))) - { - FreeBuffer(); - - try - { - INT cbMultiByte = WideCharToMultiByte(CP_UTF8, - 0, - m_pcstrWide->GetBuffer(), - m_pcstrWide->GetLength(), - NULL, - 0, - NULL, - NULL); - - if (cbMultiByte > 0) - { - m_pMultiByte = new(std::nothrow) CHAR[cbMultiByte]; - - if (SUCCEEDED(hr = CHECK_POINTER(m_pMultiByte, E_OUTOFMEMORY))) - { - if (WideCharToMultiByte(CP_UTF8, - 0, - m_pcstrWide->GetBuffer(), - m_pcstrWide->GetLength(), - m_pMultiByte, - cbMultiByte, - NULL, - NULL) > 0) - { - *ppBuffer = m_pMultiByte; - *pcbBuffer = cbMultiByte; - } - else - { - hr = E_FAIL; - } - } - } - else - { - hr = E_FAIL; - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWideToUTF8::FreeBuffer - -Routine Description: - - Releases the memory that was allocated for the string buffer during a call to CWideToUTF8::GetBuffer. - -Arguments: - - None - -Return Value: - - None - ---*/ -VOID -CWideToUTF8::FreeBuffer() -{ - if (m_pMultiByte != NULL) - { - delete[] m_pMultiByte; - m_pMultiByte = NULL; - } -} - diff --git a/print/XPSDrvSmpl/src/filters/common/widetoutf8.h b/print/XPSDrvSmpl/src/filters/common/widetoutf8.h deleted file mode 100644 index 9bae001a..00000000 --- a/print/XPSDrvSmpl/src/filters/common/widetoutf8.h +++ /dev/null @@ -1,48 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - widetoutf8.h - -Abstract: - - The CWideToUTF8 class converts a Unicode character string into the UTF-8 code page format. - ---*/ - -#pragma once - -class CWideToUTF8 -{ -public: - CWideToUTF8( - CStringXDW* pcstrWide - ); - - virtual ~CWideToUTF8(); - - HRESULT - GetBuffer( - _Outptr_ PVOID* ppBuffer, - _Out_ ULONG* pcbBuffer - ); - -private: - VOID - FreeBuffer(); - -private: - CStringXDW* m_pcstrWide; - - PSTR m_pMultiByte; -}; - diff --git a/print/XPSDrvSmpl/src/filters/common/xdfltcmn.vcxproj b/print/XPSDrvSmpl/src/filters/common/xdfltcmn.vcxproj deleted file mode 100644 index 192dab63..00000000 --- a/print/XPSDrvSmpl/src/filters/common/xdfltcmn.vcxproj +++ /dev/null @@ -1,561 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <ItemGroup Label="ProjectConfigurations"> - <ProjectConfiguration Include="Debug|ARM"> - <Configuration>Debug</Configuration> - <Platform>ARM</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Debug|ARM64"> - <Configuration>Debug</Configuration> - <Platform>ARM64</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Debug|Win32"> - <Configuration>Debug</Configuration> - <Platform>Win32</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release|ARM"> - <Configuration>Release</Configuration> - <Platform>ARM</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release|ARM64"> - <Configuration>Release</Configuration> - <Platform>ARM64</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release|Win32"> - <Configuration>Release</Configuration> - <Platform>Win32</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Debug|x64"> - <Configuration>Debug</Configuration> - <Platform>x64</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release|x64"> - <Configuration>Release</Configuration> - <Platform>x64</Platform> - </ProjectConfiguration> - </ItemGroup> - <PropertyGroup Label="Globals"> - <ProjectGuid>{0F8262C1-75D8-4A92-BCB6-37A290891708}</ProjectGuid> - <RootNamespace>$(MSBuildProjectName)</RootNamespace> - <SupportsPackaging>false</SupportsPackaging> - <RequiresPackageProject>true</RequiresPackageProject> - <Configuration Condition="'$(Configuration)' == ''">Debug</Configuration> - <Platform Condition="'$(Platform)' == ''">Win32</Platform> - <SampleGuid>{308C4F37-78C7-4A5B-82A5-303C05764FB6}</SampleGuid> - </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> - <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>False</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>StaticLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>False</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>StaticLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>False</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>StaticLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>True</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>StaticLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>True</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>StaticLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>True</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>StaticLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>False</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>StaticLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>True</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>StaticLibrary</ConfigurationType> - </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> - <PropertyGroup> - <OutDir>$(IntDir)</OutDir> - </PropertyGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ItemGroup Label="WrappedTaskItems" /> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\xdcont</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\xdcont</AdditionalIncludeDirectories> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\xdcont</AdditionalIncludeDirectories> - </Midl> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\xdcont</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\xdcont</AdditionalIncludeDirectories> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\xdcont</AdditionalIncludeDirectories> - </Midl> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\xdcont</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\xdcont</AdditionalIncludeDirectories> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\xdcont</AdditionalIncludeDirectories> - </Midl> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\xdcont</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\xdcont</AdditionalIncludeDirectories> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\xdcont</AdditionalIncludeDirectories> - </Midl> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\xdcont</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\xdcont</AdditionalIncludeDirectories> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\xdcont</AdditionalIncludeDirectories> - </Midl> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\xdcont</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\xdcont</AdditionalIncludeDirectories> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\xdcont</AdditionalIncludeDirectories> - </Midl> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\xdcont</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\xdcont</AdditionalIncludeDirectories> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\xdcont</AdditionalIncludeDirectories> - </Midl> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\xdcont</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\xdcont</AdditionalIncludeDirectories> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\xdcont</AdditionalIncludeDirectories> - </Midl> - </ItemDefinitionGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <TargetName>xdfltcmn</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'"> - <TargetName>xdfltcmn</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> - <TargetName>xdfltcmn</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <TargetName>xdfltcmn</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'"> - <TargetName>xdfltcmn</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> - <TargetName>xdfltcmn</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <TargetName>xdfltcmn</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <TargetName>xdfltcmn</TargetName> - </PropertyGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib</AdditionalDependencies> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib</AdditionalDependencies> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib</AdditionalDependencies> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib</AdditionalDependencies> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib</AdditionalDependencies> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib</AdditionalDependencies> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib</AdditionalDependencies> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib</AdditionalDependencies> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemGroup> - <ClCompile Include="precompsrc.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Create</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="ptmanage.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="rescache.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="rescpy.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="saxhndlr.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="widetoutf8.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="xdrchflt.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="xdsmplflt.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="xdstrmflt.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - </ItemGroup> - <ItemGroup> - <Inf Exclude="@(Inf)" Include="*.inf" /> - <FilesToPackage Include="$(TargetPath)" Condition="'$(ConfigurationType)'=='Driver' or '$(ConfigurationType)'=='DynamicLibrary'" /> - </ItemGroup> - <ItemGroup> - <None Exclude="@(None)" Include="*.txt;*.htm;*.html" /> - <None Exclude="@(None)" Include="*.ico;*.cur;*.bmp;*.dlg;*.rct;*.gif;*.jpg;*.jpeg;*.wav;*.jpe;*.tiff;*.tif;*.png;*.rc2" /> - <None Exclude="@(None)" Include="*.def;*.bat;*.hpj;*.asmx" /> - </ItemGroup> - <ItemGroup> - <ClInclude Exclude="@(ClInclude)" Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd" /> - </ItemGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> -</Project>
\ No newline at end of file diff --git a/print/XPSDrvSmpl/src/filters/common/xdfltcmn.vcxproj.Filters b/print/XPSDrvSmpl/src/filters/common/xdfltcmn.vcxproj.Filters deleted file mode 100644 index 505d9ff4..00000000 --- a/print/XPSDrvSmpl/src/filters/common/xdfltcmn.vcxproj.Filters +++ /dev/null @@ -1,163 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <ItemGroup> - <Filter Include="Source Files"> - <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;*</Extensions> - <UniqueIdentifier>{3569C0F7-AC20-44FD-9CA8-9C48594440AD}</UniqueIdentifier> - </Filter> - <Filter Include="Header Files"> - <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions> - <UniqueIdentifier>{1187C371-A1BD-44D6-8827-8FCC4E2D6F4B}</UniqueIdentifier> - </Filter> - <Filter Include="Resource Files"> - <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms;man;xml</Extensions> - <UniqueIdentifier>{CC77C845-B29A-4778-BAE1-962D34312C2A}</UniqueIdentifier> - </Filter> - </ItemGroup> - <ItemGroup> - <ClCompile Include="precompsrc.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="ptmanage.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="rescache.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="rescpy.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="saxhndlr.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="widetoutf8.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="xdrchflt.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="xdsmplflt.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="xdstrmflt.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - </ItemGroup> - <ItemGroup> - <ClInclude Include="clasfact.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="ptmanage.h" /> - <ClInclude Include="rescache.h" /> - <ClInclude Include="rescpy.h" /> - <ClInclude Include="saxhndlr.h" /> - <ClInclude Include="widetoutf8.h" /> - <ClInclude Include="xdrchflt.h" /> - <ClInclude Include="xdsmplflt.h" /> - <ClInclude Include="xdstrmflt.h" /> - <ClInclude Include="clasfact.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="ptmanage.h" /> - <ClInclude Include="rescache.h" /> - <ClInclude Include="rescpy.h" /> - <ClInclude Include="saxhndlr.h" /> - <ClInclude Include="widetoutf8.h" /> - <ClInclude Include="xdrchflt.h" /> - <ClInclude Include="xdsmplflt.h" /> - <ClInclude Include="xdstrmflt.h" /> - <ClInclude Include="clasfact.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="ptmanage.h" /> - <ClInclude Include="rescache.h" /> - <ClInclude Include="rescpy.h" /> - <ClInclude Include="saxhndlr.h" /> - <ClInclude Include="widetoutf8.h" /> - <ClInclude Include="xdrchflt.h" /> - <ClInclude Include="xdsmplflt.h" /> - <ClInclude Include="xdstrmflt.h" /> - <ClInclude Include="clasfact.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="ptmanage.h" /> - <ClInclude Include="rescache.h" /> - <ClInclude Include="rescpy.h" /> - <ClInclude Include="saxhndlr.h" /> - <ClInclude Include="widetoutf8.h" /> - <ClInclude Include="xdrchflt.h" /> - <ClInclude Include="xdsmplflt.h" /> - <ClInclude Include="xdstrmflt.h" /> - <ClInclude Include="clasfact.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="ptmanage.h" /> - <ClInclude Include="rescache.h" /> - <ClInclude Include="rescpy.h" /> - <ClInclude Include="saxhndlr.h" /> - <ClInclude Include="widetoutf8.h" /> - <ClInclude Include="xdrchflt.h" /> - <ClInclude Include="xdsmplflt.h" /> - <ClInclude Include="xdstrmflt.h" /> - <ClInclude Include="clasfact.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="ptmanage.h" /> - <ClInclude Include="rescache.h" /> - <ClInclude Include="rescpy.h" /> - <ClInclude Include="saxhndlr.h" /> - <ClInclude Include="widetoutf8.h" /> - <ClInclude Include="xdrchflt.h" /> - <ClInclude Include="xdsmplflt.h" /> - <ClInclude Include="xdstrmflt.h" /> - <ClInclude Include="clasfact.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="ptmanage.h" /> - <ClInclude Include="rescache.h" /> - <ClInclude Include="rescpy.h" /> - <ClInclude Include="saxhndlr.h" /> - <ClInclude Include="widetoutf8.h" /> - <ClInclude Include="xdrchflt.h" /> - <ClInclude Include="xdsmplflt.h" /> - <ClInclude Include="xdstrmflt.h" /> - <ClInclude Include="clasfact.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="ptmanage.h" /> - <ClInclude Include="rescache.h" /> - <ClInclude Include="rescpy.h" /> - <ClInclude Include="saxhndlr.h" /> - <ClInclude Include="widetoutf8.h" /> - <ClInclude Include="xdrchflt.h" /> - <ClInclude Include="xdsmplflt.h" /> - <ClInclude Include="xdstrmflt.h" /> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - </ItemGroup> -</Project>
\ No newline at end of file diff --git a/print/XPSDrvSmpl/src/filters/common/xdrchflt.cpp b/print/XPSDrvSmpl/src/filters/common/xdrchflt.cpp deleted file mode 100644 index 6fa2b0ed..00000000 --- a/print/XPSDrvSmpl/src/filters/common/xdrchflt.cpp +++ /dev/null @@ -1,508 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - xdrchflt.cpp - -Abstract: - - Base Xps filter implementation. The CXDXpsFilter provides common filter - functionality for Xps filters. It provides default handlers for part - handlers that set print tickets appropriately through the PrintTicket - manager class. This allows derived classes to implement only the part - handlers that they require (for example, the watermark filter is only - interested in the fixed page, and leaves all other parts to be handled - by this class). The class implements IPrintPipelineFilter::StartOperation - which is responsible for retrieving parts from the Xps provider and - dispatching them to the relevant part handler. It is also responsible for - intialising the Xps provider and consumer. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdrchflt.h" - -/*++ - -Routine Name: - - CXDXpsFilter::CXDXpsFilter - -Routine Description: - - CXDXpsFilter class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CXDXpsFilter::CXDXpsFilter() : - m_pXDReader(NULL), - m_pXDWriter(NULL) -{ - VERBOSE("Constructing Xps filter\n"); -} - -/*++ - -Routine Name: - - CXDXpsFilter::~CXDXpsFilter - -Routine Description: - - CXDXpsFilter class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CXDXpsFilter::~CXDXpsFilter() -{ - VERBOSE("Destroying Xps filter\n"); -} - -/*++ - -Routine Name: - - CXDXpsFilter::StartOperation - -Routine Description: - - This is the XPS Doxument interface implementation of IPrintPipelineFilter::StartOperation - shared by all XPS Document filters - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXDXpsFilter::StartOperation( - VOID - ) -{ - VERBOSE("Starting filter operation.\n"); - - HRESULT hr = S_OK; - BOOL bDoCoUninitialize = FALSE; - - if (SUCCEEDED(hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED))) - { - bDoCoUninitialize = TRUE; - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = InitialiseXDIO()) && - SUCCEEDED(hr = InitializePrintTicketManager())) - { - CComPtr<IUnknown> pUnk(NULL); - - while (SUCCEEDED(hr) && - SUCCEEDED(hr = m_pXDReader->GetXpsPart(&pUnk)) && - pUnk != NULL && - !m_bFilterFinished) - { - CComPtr<IXpsDocument> pXD(NULL); - CComPtr<IFixedDocumentSequence> pFDS(NULL); - CComPtr<IFixedDocument> pFD(NULL); - CComPtr<IFixedPage> pFP(NULL); - - // - // Query interface to find the part type and pass to the - // appropriate part handler - // - if (SUCCEEDED(pUnk.QueryInterface(&pXD))) - { - hr = ProcessPart(pXD); - } - else if (SUCCEEDED(pUnk.QueryInterface(&pFDS))) - { - hr = ProcessPart(pFDS); - } - else if (SUCCEEDED(pUnk.QueryInterface(&pFD))) - { - hr = ProcessPart(pFD); - } - else if (SUCCEEDED(pUnk.QueryInterface(&pFP))) - { - hr = ProcessPart(pFP); - } - else - { - // - // Unrecognised part - send as unknown. - // - hr = m_pXDWriter->SendXpsUnknown(pUnk); - } - - // - // Must call release since pUnk is declared outside of the while loop - // - pUnk.Release(); - } - - if (SUCCEEDED(hr)) - { - // - // Call finalize letting derived classes know we have - // processed all parts - // - hr = Finalize(); - } - - // - // Close the xps package consumer - // - m_pXDWriter->CloseSender(); - } - - // - // If the filter failed make sure we shutdown the pipeline - // - if (FAILED(hr)) - { - if (m_bFilterFinished) - { - // - // Filter is already closing down so report S_OK - // - hr = S_OK; - } - else - { - // - // Request the pipeline manager shutdown the filter - // - ERR("Requesting filter shutdown\n"); - RequestShutdown(hr); - } - } - - // - // Let the filter pipe manager know the filter is finished - // - if (bDoCoUninitialize) - { - CoUninitialize(); - } - - FilterFinished(); - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXDXpsFilter::ProcessPart - -Routine Description: - - This routine is the default XPS document part handler - -Arguments: - - pXD - Pointer to the IXPSDocument interface - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXDXpsFilter::ProcessPart( - _Inout_ IXpsDocument* pXD - ) -{ - VERBOSE("Processing XPS Document part with default handler\n"); - - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pXD, E_POINTER))) - { - hr = m_pXDWriter->SendXpsDocument(pXD); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXDXpsFilter::ProcessPart - -Routine Description: - - This routine is the default fixed document sequence part handler - -Arguments: - - pFDS - Pointer to the IFixedDocumentSequence interface - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXDXpsFilter::ProcessPart( - _Inout_ IFixedDocumentSequence* pFDS - ) -{ - VERBOSE("Processing Fixed Document Sequence part with default handler\n"); - - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pFDS, E_POINTER))) - { - // - // Default handler: Set the PT and send the doc sequence - // - if (SUCCEEDED(hr = m_ptManager.SetTicket(pFDS))) - { - hr = m_pXDWriter->SendFixedDocumentSequence(pFDS); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXDXpsFilter::ProcessPart - -Routine Description: - - This routine is the default fixed document part handler - -Arguments: - - pFD - Pointer to the IFixedDocument interface - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXDXpsFilter::ProcessPart( - _Inout_ IFixedDocument* pFD - ) -{ - VERBOSE("Processing Fixed Document part with default handler\n"); - - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pFD, E_POINTER))) - { - // - // Default handler: Set the PT and send the doc - // - if (SUCCEEDED(hr = m_ptManager.SetTicket(pFD))) - { - hr = m_pXDWriter->SendFixedDocument(pFD); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXDXpsFilter::ProcessPart - -Routine Description: - - This routine is the default fixed page handler - -Arguments: - - pFP - Pointer to the IFixedPage interface - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXDXpsFilter::ProcessPart( - _Inout_ IFixedPage* pFP - ) -{ - VERBOSE("Processing Fixed Page part with default handler\n"); - - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pFP, E_POINTER))) - { - // - // Default handler: No ticket required, just send the page - // - hr = m_pXDWriter->SendFixedPage(pFP); - } - - ERR_ON_HR(hr); - return hr; -} - - -/*++ - -Routine Name: - - CXDXpsFilter::Finalize - -Routine Description: - - This method is the default finalize method called when all parts in the XPS document - have been processed - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXDXpsFilter::Finalize( - VOID - ) -{ - return S_OK; -} - -/*++ - -Routine Name: - - CXDXpsFilter::InitialiseXDIO - -Routine Description: - - This routine initialises the XPS producer and consumer interfaces used by - all XPS document filters - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXDXpsFilter::InitialiseXDIO( - VOID - ) -{ - VERBOSE("Retrieving Xps producer and consumer.\n"); - - HRESULT hr = S_OK; - - // - // Ensure the produver and consumer are released - // - m_pXDReader = NULL; - m_pXDWriter = NULL; - - if (SUCCEEDED(hr = CHECK_POINTER(m_pInterFltrComm, E_PENDING))) - { - // - // Get the producer and consumer from the filter communicator - // - if (SUCCEEDED(hr = m_pInterFltrComm->RequestReader(reinterpret_cast<VOID**>(&m_pXDReader)))) - { - hr = m_pInterFltrComm->RequestWriter(reinterpret_cast<VOID**>(&m_pXDWriter)); - } - - // - // If anything went wrong, ensure the produver and consumer are released - // - if (FAILED(hr)) - { - m_pXDReader = NULL; - m_pXDWriter = NULL; - } - } - - // - // Check interface is as expected. If not then it is likely that - // the wrong GUID has been defined in the filter configuration file - // - if (SUCCEEDED(hr)) - { - CComPtr<IXpsDocumentProvider> pReaderCheck(NULL); - CComPtr<IXpsDocumentConsumer> pWriterCheck(NULL); - - if (FAILED(m_pXDReader.QueryInterface(&pReaderCheck)) || - FAILED(m_pXDWriter.QueryInterface(&pWriterCheck))) - { - RIP("Invalid reader and writer defined - check GUIDs in the filter configuration file\n"); - - // - // Request the pipeline manager shutsdown the filter - // - hr = E_FAIL; - RequestShutdown(hr); - } - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/common/xdrchflt.h b/print/XPSDrvSmpl/src/filters/common/xdrchflt.h deleted file mode 100644 index eeb6e4c9..00000000 --- a/print/XPSDrvSmpl/src/filters/common/xdrchflt.h +++ /dev/null @@ -1,86 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - xdrchflt.h - -Abstract: - - Base Xps filter definition. The CXDXpsFilter provides common filter - functionality for Xps filters. It provides default handlers for part - handlers that set print tickets appropriately through the PrintTicket - manager class. This allows derived classes to implement only the part - handlers that they require (for example, the watermark filter is only - interested in the fixed page, and leaves all other parts to be handled - by this class). The class implements IPrintPipelineFilter::StartOperation - which is responsible for retrieving parts from the Xps provider and - dispatching them to the relevant part handler. It is also responsible for - intialising the Xps provider and consumer. - ---*/ - -#pragma once - -#include "xdsmplflt.h" -#include "rescache.h" - -class CXDXpsFilter : public CXDSmplFilter -{ -public: - CXDXpsFilter(); - - virtual ~CXDXpsFilter(); - -protected: - virtual HRESULT STDMETHODCALLTYPE - StartOperation( - VOID - ); - - virtual HRESULT - ProcessPart( - _Inout_ IXpsDocument* pXD - ); - - virtual HRESULT - ProcessPart( - _Inout_ IFixedDocumentSequence* pFDS - ); - - virtual HRESULT - ProcessPart( - _Inout_ IFixedDocument* pFD - ); - - virtual HRESULT - ProcessPart( - _Inout_ IFixedPage* pFP - ); - - virtual HRESULT - Finalize( - VOID - ); - - virtual HRESULT - InitialiseXDIO( - VOID - ); - -protected: - CComPtr<IXpsDocumentProvider> m_pXDReader; - - CComPtr<IXpsDocumentConsumer> m_pXDWriter; - - CFileResourceCache m_resCache; -}; - diff --git a/print/XPSDrvSmpl/src/filters/common/xdsmplflt.cpp b/print/XPSDrvSmpl/src/filters/common/xdsmplflt.cpp deleted file mode 100644 index cce45ac6..00000000 --- a/print/XPSDrvSmpl/src/filters/common/xdsmplflt.cpp +++ /dev/null @@ -1,319 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - xdsmplflt.cpp - -Abstract: - - Base filter class for stream and Xps filters. This class implements - the IPrintPipelineFilter methods common to both Xps and stream filters. - -Known Issues: - - Request shutdown does not pass an IImgErrorInfo pointer - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdsmplflt.h" - -/*++ - -Routine Name: - - CXDSmplFilter::CXDSmplFilter - -Routine Description: - - CXDSmplFilter class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CXDSmplFilter::CXDSmplFilter() : - CUnknown<IPrintPipelineFilter>(IID_IPrintPipelineFilter), - m_bFilterFinished(FALSE) -{ - VERBOSE("Constructing filter\n"); -} - - -/*++ - -Routine Name: - - CXDSmplFilter::~CXDSmplFilter - -Routine Description: - - CXDSmplFilter class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CXDSmplFilter::~CXDSmplFilter() -{ - VERBOSE("Destroying filter\n"); - - // - // Make sure FilterFinished() is called - // - FilterFinished(); -} - -/*++ - -Routine Name: - - CXDSmplFilter::InitializeFilter - -Routine Description: - - This is the IPrintPipelineFilter::InitializeFilter implementation used - by all XPS document interface filters. This is called by the print filter - pipeline manager before IPrintPipelineFilter::StartOperation. - -Arguments: - - pIInterFilterCommunicator - Pointer to the inter filter communicator - pIPropertyBag - Pointer to the property bag - pIPipelineControl - Pointer to the pipeline control interface - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXDSmplFilter::InitializeFilter( - _In_ IInterFilterCommunicator* pIInterFilterCommunicator, - _In_ IPrintPipelinePropertyBag* pIPropertyBag, - _In_ IPrintPipelineManagerControl* pIPipelineControl - ) -{ - VERBOSE("Initializing filter\n"); - - HRESULT hr = S_OK; - - if (FAILED(hr = CHECK_POINTER(pIInterFilterCommunicator, E_POINTER)) || - FAILED(hr = CHECK_POINTER(pIPropertyBag, E_POINTER)) || - FAILED(hr = CHECK_POINTER(pIPipelineControl, E_POINTER))) - { - RequestShutdown(hr); - } - else - { - m_pPrintPipeManager = pIPipelineControl; - m_pInterFltrComm = pIInterFilterCommunicator; - m_pPrintPropertyBag = pIPropertyBag; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXDSmplFilter::ShutdownOperation - -Routine Description: - - This is the IPrintPipelineFilter::ShutdownOperation implementation used - by all XPS document interface filters. This is called by the print filter - pipeline manager when the filter is complete or an error forces the - pipeline to be shutdown - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXDSmplFilter::ShutdownOperation( - VOID - ) -{ - VERBOSE("Shutting down filter\n"); - - FilterFinished(); - return S_OK; -} - -/*++ - -Routine Name: - - CXDSmplFilter::FilterFinished - -Routine Description: - - This routine is called when the filter is finished. Filter finished should - only be called once so this routine protects against multiple calls from the - same filter. - -Arguments: - - None - -Return Value: - - None - ---*/ -VOID -CXDSmplFilter::FilterFinished( - VOID - ) -{ - if (!m_bFilterFinished) - { - VERBOSE("Finishing filter\n"); - - if (m_pPrintPipeManager != NULL) - { - m_pPrintPipeManager->FilterFinished(); - m_bFilterFinished = TRUE; - } - } -} - -/*++ - -Routine Name: - - CXDSmplFilter::RequestShutdown - -Routine Description: - - This routine lets derived classes request the filter to shutdown - without having to know about the pipeline manager explicitly - -Arguments: - - hr - The HRESULT value to be passed to the pipeline managers RequestShutdown method. - -Return Value: - - None - ---*/ -VOID -CXDSmplFilter::RequestShutdown( - _In_ HRESULT hr - ) -{ - VERBOSE("Requesting shutdown\n"); - - if (m_pPrintPipeManager != NULL) - { -#pragma prefast(suppress:__WARNING_INVALID_PARAM_VALUE_1, "MSDN requires that pReason be NULL.") - m_pPrintPipeManager->RequestShutdown(hr, NULL); - } -} - -/*++ - -Routine Name: - - CXDSmplFilter::InitializePrintTicketManager - -Routine Description: - - This routine initializes the PrintTicket manager with the default devmode - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXDSmplFilter::InitializePrintTicketManager( - VOID - ) -{ - ASSERTMSG(m_pPrintPropertyBag != NULL, "NULL property bag pointer\n"); - - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(m_pPrintPropertyBag, E_PENDING))) - { - // - // Get the printer name and user PrintTicket from the property bag - // - CComVariant varName; - CComVariant varPTReadStreamFactory; - - // - // Avoid CComVariant if getting the XPS_FP_USER_TOKEN property. - // Please refer to http://go.microsoft.com/fwlink/?LinkID=255534 for detailed information. - // - VARIANT varUserToken; - VariantInit(&varUserToken); - - if (SUCCEEDED(hr = m_pPrintPropertyBag->GetProperty(XPS_FP_USER_PRINT_TICKET, &varPTReadStreamFactory)) && - SUCCEEDED(hr = m_pPrintPropertyBag->GetProperty(XPS_FP_PRINTER_NAME, &varName)) && - SUCCEEDED(hr = m_pPrintPropertyBag->GetProperty(XPS_FP_USER_TOKEN, &varUserToken))) - { - // - // Retrieve the PrintReadStream for the user PrintTicket - // - CComPtr<IUnknown> pUnk(varPTReadStreamFactory.punkVal); - CComPtr<IPrintReadStreamFactory> pPrintReadStreamFactory(NULL); - CComPtr<IPrintReadStream> pPrintReadStream(NULL); - if (SUCCEEDED(hr = pUnk.QueryInterface(&pPrintReadStreamFactory)) && - SUCCEEDED(hr = pPrintReadStreamFactory->GetStream(&pPrintReadStream))) - { - // - // Initialise the PT manager with the user PrintTicket and device name - // - hr = m_ptManager.Initialise(pPrintReadStream, varName.bstrVal, varUserToken.byref); - } - } - - VariantClear(&varUserToken); - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/common/xdsmplflt.h b/print/XPSDrvSmpl/src/filters/common/xdsmplflt.h deleted file mode 100644 index b4903b4e..00000000 --- a/print/XPSDrvSmpl/src/filters/common/xdsmplflt.h +++ /dev/null @@ -1,77 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - xdsmplflt.h - -Abstract: - - Base filter class for stream and Xps filters. This class implements - the IPrintPipelineFilter methods common to both Xps and stream filters. - ---*/ - -#pragma once - -#include "cunknown.h" -#include "ptmanage.h" - -class CXDSmplFilter : public CUnknown<IPrintPipelineFilter> -{ -public: - CXDSmplFilter(); - - virtual ~CXDSmplFilter(); - - // - // IImgPipelineFilter methods - // - virtual HRESULT STDMETHODCALLTYPE - InitializeFilter( - _In_ IInterFilterCommunicator* pINegotiation, - _In_ IPrintPipelinePropertyBag* pIPropertyBag, - _In_ IPrintPipelineManagerControl* pIPipelineControl - ); - - virtual HRESULT STDMETHODCALLTYPE - ShutdownOperation( - VOID - ); - -protected: - VOID - FilterFinished( - VOID - ); - - VOID - RequestShutdown( - _In_ HRESULT hr - ); - - HRESULT - InitializePrintTicketManager( - VOID - ); - -protected: - CComPtr<IInterFilterCommunicator> m_pInterFltrComm; - - CComPtr<IPrintPipelineManagerControl> m_pPrintPipeManager; - - CComPtr<IPrintPipelinePropertyBag> m_pPrintPropertyBag; - - CPTManager m_ptManager; - - BOOL m_bFilterFinished; -}; - diff --git a/print/XPSDrvSmpl/src/filters/common/xdstrmflt.cpp b/print/XPSDrvSmpl/src/filters/common/xdstrmflt.cpp deleted file mode 100644 index da8d6a5e..00000000 --- a/print/XPSDrvSmpl/src/filters/common/xdstrmflt.cpp +++ /dev/null @@ -1,351 +0,0 @@ -/*++ - -Copyright (C) 2005 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. - -File Name: - - xdstrmflt.cpp - -Abstract: - - Base stream filter implementation. This provides stream interface specific - functionality general to all filters that use the stream interface to process - fixed pages. The class is responsible copying data from reader to writer in the - absence of the PK archive handling module, for a default fixed page processing - function (filters should implement their own to manipulate fixed page markup) - and for initialising the stream reader and writer. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstrmflt.h" - -/*++ - -Routine Name: - - CXDStreamFilter::CXDStreamFilter - -Routine Description: - - CXDStreamFilter class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CXDStreamFilter::CXDStreamFilter() : - m_pStreamReader(NULL), - m_pStreamWriter(NULL) -{ - VERBOSE("Constructing stream filter\n"); -} - -/*++ - -Routine Name: - - CXDStreamFilter::~CXDStreamFilter - -Routine Description: - - CXDStreamFilter clsas destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CXDStreamFilter::~CXDStreamFilter() -{ - VERBOSE("Destroying stream filter\n"); -} - -/*++ - -Routine Name: - - CXDStreamFilter::StartOperation - -Routine Description: - - This is the stream interface implementation of IPrintPipelineFilter::StartOperation - shared by all stream interface filters - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT STDMETHODCALLTYPE -CXDStreamFilter::StartOperation( - VOID - ) -{ - VERBOSE("Starting stream filter operation.\n"); - - HRESULT hr = S_OK; - BOOL bDoCoUninitialize = FALSE; - - if (SUCCEEDED(hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED))) - { - bDoCoUninitialize = TRUE; - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = InitialiseStreamIO()) && - SUCCEEDED(hr = InitializePrintTicketManager())) - { - try - { - CXPSProcessor* pXpsProcessor = new(std::nothrow) CXPSProcessor(m_pStreamReader, m_pStreamWriter, this, m_pPrintPropertyBag, &m_ptManager); - - if (SUCCEEDED(hr = CHECK_POINTER(pXpsProcessor, E_OUTOFMEMORY))) - { - hr = pXpsProcessor->Start(); - } - - if (pXpsProcessor != NULL) - { - delete pXpsProcessor; - pXpsProcessor = NULL; - } - } - catch (CXDException& e) - { - hr = e; - } - catch (...) - { - hr = E_FAIL; - } - - if (hr == E_NOINTERFACE) - { - // - // The PK archive handler is missing - just pass the data on - // - - if (SUCCEEDED(hr = CHECK_POINTER(m_pStreamReader, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(m_pStreamWriter, E_POINTER))) - { - ULONG cbRead = 0; - BOOL bEOF = FALSE; - - PBYTE pBuff = new(std::nothrow) BYTE[CB_COPY_BUFFER]; - - if (SUCCEEDED(hr = CHECK_POINTER(pBuff, E_OUTOFMEMORY))) - { - do - { - if (SUCCEEDED(hr = m_pStreamReader->ReadBytes(pBuff, CB_COPY_BUFFER, &cbRead, &bEOF))) - { - ULONG cbWritten = 0; - hr = m_pStreamWriter->WriteBytes(pBuff, cbRead, &cbWritten); - } - } - while (SUCCEEDED(hr) && - !bEOF && - cbRead > 0); - - delete[] pBuff; - pBuff = NULL; - } - } - } - } - - if (m_pStreamWriter) - { - m_pStreamWriter->Close(); - } - - // - // If the filter failed make sure we shutdown the pipeline - // - if (FAILED(hr)) - { - if (m_bFilterFinished) - { - // - // Filter is already closing down so report S_OK - // - hr = S_OK; - } - else - { - // - // Request the pipeline manager shutdown the filter - // - ERR("Requesting filter shutdown\n"); - RequestShutdown(hr); - } - } - - // - // Let the filter pipe manager know the filter is finished - // - if (bDoCoUninitialize) - { - CoUninitialize(); - } - - FilterFinished(); - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXDStreamFilter::ProcessFixedPage - -Routine Description: - - This routine is the default implemenation of the fixed page processor called by - the XPS processor object. - -Arguments: - - pFPPT - Pointer to the fixed page PrintTicket - pPageReadStream - Pointer to the page read stream - pPageWriteStream - Pointer to the page write stream - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXDStreamFilter::ProcessFixedPage( - _In_ IXMLDOMDocument2* pFPPT, - _In_ ISequentialStream* pPageReadStream, - _In_ ISequentialStream* pPageWriteStream - ) -{ - VERBOSE("Processing stream fixed page with default handler\n"); - - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pFPPT, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pPageReadStream, E_POINTER))) - { - hr = CHECK_POINTER(pPageWriteStream, E_POINTER); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXDStreamFilter::InitialiseStreamIO - -Routine Description: - - This routine initialises the print stream read and write interfaces used by - all stream filters - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXDStreamFilter::InitialiseStreamIO( - VOID - ) -{ - VERBOSE("Retrieving stream reader and writer.\n"); - - HRESULT hr = S_OK; - - // - // Make sure the reader and writer are released - // - m_pStreamReader = NULL; - m_pStreamWriter = NULL; - - if (SUCCEEDED(hr = CHECK_POINTER(m_pInterFltrComm, E_PENDING))) - { - // - // Get the reader and writer from the filter communicator - // - if (SUCCEEDED(hr = m_pInterFltrComm->RequestReader(reinterpret_cast<VOID**>(&m_pStreamReader)))) - { - hr = m_pInterFltrComm->RequestWriter(reinterpret_cast<VOID**>(&m_pStreamWriter)); - } - - // - // If anything went wrong, make sure the reader and writer - // have been released - // - if (FAILED(hr)) - { - m_pStreamReader = NULL; - m_pStreamWriter = NULL; - } - } - - // - // Check interface is as expected. If not then it is likely that - // the wrong GUID has been defined in the filter configuration file - // - if (SUCCEEDED(hr)) - { - CComPtr<IPrintReadStream> pReaderCheck(NULL); - CComPtr<IPrintWriteStream> pWriterCheck(NULL); - - if (FAILED(m_pStreamReader.QueryInterface(&pReaderCheck)) || - FAILED(m_pStreamWriter.QueryInterface(&pWriterCheck))) - { - RIP("Invalid reader and writer defined - check GUIDs in the filter configuration file\n"); - - // - // Request the pipeline manager shutsdown the filter - // - hr = E_FAIL; - RequestShutdown(hr); - } - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/common/xdstrmflt.h b/print/XPSDrvSmpl/src/filters/common/xdstrmflt.h deleted file mode 100644 index 64489672..00000000 --- a/print/XPSDrvSmpl/src/filters/common/xdstrmflt.h +++ /dev/null @@ -1,63 +0,0 @@ -/*++ - -Copyright (C) 2005 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. - -File Name: - - xdstrmflt.h - -Abstract: - - Base stream filter definition. This provides stream interface specific - functionality general to all filters that use the stream interface to process - fixed pages. The class is responsible copying data from reader to writer in the - absence of the PK archive handling module, for a default fixed page processing - function (filters should implement their own to manipulate fixed page markup) - and for initialising the stream reader and writer. - ---*/ - -#pragma once - -#include "xdsmplflt.h" -#include "ptmanage.h" -#include "xpsproc.h" - -class CXDStreamFilter : public CXDSmplFilter, public IFixedPageProcessor -{ -public: - CXDStreamFilter(); - - virtual ~CXDStreamFilter(); - -protected: - virtual HRESULT STDMETHODCALLTYPE - StartOperation( - VOID - ); - - virtual HRESULT - ProcessFixedPage( - _In_ IXMLDOMDocument2* pFPPT, - _In_ ISequentialStream* pPageReadStream, - _In_ ISequentialStream* pPageWriteStream - ); - - HRESULT - InitialiseStreamIO( - VOID - ); - -protected: - CComPtr<IPrintReadStream> m_pStreamReader; - - CComPtr<IPrintWriteStream> m_pStreamWriter; -}; - diff --git a/print/XPSDrvSmpl/src/filters/nup/dllentry.cpp b/print/XPSDrvSmpl/src/filters/nup/dllentry.cpp deleted file mode 100644 index 271afaaa..00000000 --- a/print/XPSDrvSmpl/src/filters/nup/dllentry.cpp +++ /dev/null @@ -1,144 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - dllentry.cpp - -Abstract: - - Implementation of the NUp filter dllentry points. Dllmain only - stores the instance handle. DllGetClassObject calls on to a generic - get class factory template function. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "clasfact.h" -#include "nupflt.h" -#include "xdexcept.h" - -/*++ - -Routine Name: - - DllMain - -Routine Description: - - Entry point to the NUp filter which is called when a new process is started - -Arguments: - - hInst - Handle to the DLL - wReason - Specifies a flag indicating why the DLL entry-point function is being called - -Return Value: - - TRUE - ---*/ -BOOL WINAPI -DllMain( - _In_ HINSTANCE hInst, - _In_ WORD wReason, - _In_opt_ LPVOID - ) -{ - switch (wReason) - { - case DLL_PROCESS_ATTACH: - { - g_hInstance = hInst; - } - break; - } - - return TRUE; -} - - -/*++ - -Routine Name: - - DllCanUnloadNow - -Routine Description: - - Method which reports whether the DLL is in use to allow the caller to unload - the DLL safely - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - Dll can unload - S_FALSE - Dll can't unload - ---*/ -STDAPI -DllCanUnloadNow() -{ - if (g_cServerLocks == 0) - { - return S_OK ; - } - else - { - return S_FALSE; - } -} - -/*++ - -Routine Name: - - DllGetClassObject - -Routine Description: - - Method to return the current class object - -Arguments: - - rclsid - CLSID that will associate the correct data and code - riid - Reference to the identifier of the interface that the caller is to use to communicate with the class object - ppv - Address of pointer variable that receives the interface pointer requested in riid - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - CLASS_E_CLASSNOTAVAILABLE - On unsupported class - ---*/ -STDAPI -DllGetClassObject( - _In_ REFCLSID rclsid, - _In_ REFIID riid, - _Outptr_ LPVOID FAR* ppv - ) -{ - // - // 6B105794-3140-40ca-A94F-624AE00AC9E8 - // - CLSID nupCLSID = {0x6B105794, 0x3140, 0x40ca, {0xA9, 0x4F, 0x62, 0x4A, 0xE0, 0x0A, 0xC9, 0xE8}}; - - return GetFilterClassFactory<CNUpFilter>(rclsid, riid, nupCLSID, ppv); -} - diff --git a/print/XPSDrvSmpl/src/filters/nup/nupflt.cpp b/print/XPSDrvSmpl/src/filters/nup/nupflt.cpp deleted file mode 100644 index b226ecc7..00000000 --- a/print/XPSDrvSmpl/src/filters/nup/nupflt.cpp +++ /dev/null @@ -1,476 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - nupflt.cpp - -Abstract: - - NUp filter implementation. This class derives from the Xps filter class - and implements the necessary part handlers to support NUp printing. The - NUp filter is responsible for applying page transformations appropriate - to the NUp option selected. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "nupflt.h" -#include "nupsax.h" -#include "nupthndlr.h" -#include "bkpthndlr.h" -#include "psizepthndlr.h" -#include "porientpthndlr.h" - - -using XDPrintSchema::NUp::NUpData; - -using XDPrintSchema::Binding::BindingData; - -using XDPrintSchema::PageMediaSize::PageMediaSizeData; - -using XDPrintSchema::PageOrientation::PageOrientationData; - -/*++ - -Routine Name: - - CNUpFilter::CNUpFilter - -Routine Description: - - Default constructor for the nup filter which ensures GDI plus is correctly running - and initialises the CNUpFilter variables to sensible defaults - -Arguments: - - None - -Return Value: - - None - ---*/ -CNUpFilter::CNUpFilter() : - m_bSendAllDocs(TRUE), - m_pNUpPage(NULL), - m_nupScope(CNUpPTProperties::None) -{ - ASSERTMSG(m_gdiPlus.GetGDIPlusStartStatus() == Ok, "GDI plus is not correctly initialized.\n"); -} - -/*++ - -Routine Name: - - CNUpFilter::~CNUpFilter - -Routine Description: - - Default destructor for the color management filter - -Arguments: - - None - -Return Value: - - None - ---*/ -CNUpFilter::~CNUpFilter() -{ - DeleteNUpPage(); -} - -/*++ - -Routine Name: - - CNUpFilter::ProcessPart - -Routine Description: - - Method for processing each fixed document sequence part in a container - -Arguments: - - pFDS - Pointer to the fixed document sequence to process - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CNUpFilter::ProcessPart( - _Inout_ IFixedDocumentSequence* pFDS - ) -{ - VERBOSE("Processing Fixed Document Sequence part with NUpFilter handler\n"); - - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pFDS, E_POINTER))) - { - // - // Get the PT manager to return the correct ticket. - // - IXMLDOMDocument2* pPT = NULL; - if (SUCCEEDED(hr = m_ptManager.SetTicket(pFDS)) && - SUCCEEDED(hr = m_ptManager.GetTicket(kPTJobScope, &pPT))) - { - hr = CreateNUpPage(pPT); - } - } - - if (SUCCEEDED(hr)) - { - hr = m_pXDWriter->SendFixedDocumentSequence(pFDS); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CNUpFilter::ProcessPart - -Routine Description: - - Method for processing each fixed document part in a container - -Arguments: - - pFD - Pointer to the fixed document to process - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CNUpFilter::ProcessPart( - _Inout_ IFixedDocument* pFD - ) -{ - VERBOSE("Processing Fixed Document part with NUpFilter handler\n"); - - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pFD, E_POINTER)) && - SUCCEEDED(hr = m_ptManager.SetTicket(pFD))) - { - // - // If we are in a JobNUpAllDocumentsContiguously session we want to maintain the current - // JobNUpAllDocumentsContiguously settings so keep the current NUp page object - // - if (m_nupScope != CNUpPTProperties::Job) - { - // - // Get the PT manager to return the correct ticket. - // - IXMLDOMDocument2* pPT = NULL; - if (SUCCEEDED(hr = m_ptManager.GetTicket(kPTDocumentScope, &pPT))) - { - hr = CreateNUpPage(pPT); - } - } - } - - if (SUCCEEDED(hr) && - m_bSendAllDocs) - { - hr = m_pXDWriter->SendFixedDocument(pFD); - - // - // If we are JobNUpAllDocumentsContiguously we only ever send one doc - now we have - // sent the first document we can test to see if we need to - // send all of them - // - if (m_nupScope == CNUpPTProperties::Job) - { - m_bSendAllDocs = FALSE; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CNUpFilter::ProcessPart - -Routine Description: - - Method for processing each fixed page part in a container - -Arguments: - - pFP - Pointer to the fixed page to process - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CNUpFilter::ProcessPart( - _Inout_ IFixedPage* pFP - ) -{ - VERBOSE("Processing Fixed Page part with NUpFilter handler\n"); - - ASSERTMSG(m_pXDWriter != NULL, "NULL consumer pointer\n"); - - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pFP, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(m_pXDWriter, E_PENDING))) - { - if (m_pNUpPage != NULL) - { - // - // Add this pages contents to our NUp page - // - hr = m_pNUpPage->AddPageContent(m_pXDWriter, pFP); - } - else - { - // - // Just write out the fixed page - // - hr = m_pXDWriter->SendFixedPage(pFP); - } - } - - ERR_ON_HR(hr); - return hr; -} - - -/*++ - -Routine Name: - - CNUpFilter::Finalize - -Routine Description: - - Method to close any pages which are still open as the last action of the filter - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CNUpFilter::Finalize( - VOID - ) -{ - ASSERTMSG(m_pXDWriter != NULL, "NULL consumer pointer\n"); - - HRESULT hr = S_OK; - - if (m_pNUpPage != NULL) - { - // - // Close any open pages - we are done - // - hr = m_pNUpPage->ClosePage(m_pXDWriter); - DeleteNUpPage(); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CNUpFilter::DeleteNUpPage - -Routine Description: - - Method to delete the current CNUpPage object - -Arguments: - - None - -Return Value: - - None - ---*/ -VOID -CNUpFilter::DeleteNUpPage( - VOID - ) -{ - if (m_pNUpPage != NULL) - { - delete m_pNUpPage; - m_pNUpPage = NULL; - } -} - -/*++ - -Routine Name: - - CNUpFilter::CreateNUpPage - -Routine Description: - - Method to create a new nup page based on the settings specified in the PrintTicket - -Arguments: - - pPT - Pointer to the PrintTicket containing the nup driver settings - -Return Value: - - HRESULT - S_OK - On success - S_FALSE - When not enabled in the PT - E_* - On error - ---*/ -HRESULT -CNUpFilter::CreateNUpPage( - _In_ IXMLDOMDocument2* pPT - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pPT, E_POINTER))) - { - - try - { - // - // Retrieve the NUp, Booklet, PageMediaSize and PageOrientation data from the PT - // - NUpData nUpData; - BindingData bindingData; - PageMediaSizeData pageMediaSizeData; - PageOrientationData pageOrientData; - - CNUpPTHandler nUpPTHandler(pPT); - CBookPTHandler bkPTHandler(pPT); - CPageSizePTHandler pageSizePTHandler(pPT); - CPageOrientationPTHandler pageOrientPTHandler(pPT); - - // - // Try the booklet data first - // - if (FAILED(hr = bkPTHandler.GetData(&bindingData))) - { - // - // If booklet is not present try NUp settings - // - if (hr == E_ELEMENT_NOT_FOUND) - { - hr = nUpPTHandler.GetData(&nUpData); - } - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = pageSizePTHandler.GetData(&pageMediaSizeData)) && - SUCCEEDED(hr = pageOrientPTHandler.GetData(&pageOrientData))) - { - CNUpPTProperties nUpProps(nUpData, bindingData, pageMediaSizeData, pageOrientData); - - UINT cNUp = 1; - if (SUCCEEDED(hr = nUpProps.GetScope(&m_nupScope)) && - SUCCEEDED(hr = nUpProps.GetCount(&cNUp)) && - m_nupScope != CNUpPTProperties::None && - cNUp > 1) - { - if (m_pNUpPage == NULL) - { - // - // Create a new NUp page - // - m_pNUpPage = new(std::nothrow) CNUpPage(&nUpProps, &m_resCopier); - - hr = CHECK_POINTER(m_pNUpPage, E_OUTOFMEMORY); - } - else if (m_nupScope == CNUpPTProperties::Document) - { - // - // Second or subsequent Document NUp session - close the page and set - // the new properties - // - if (SUCCEEDED(hr = m_pNUpPage->ClosePage(m_pXDWriter))) - { - hr = m_pNUpPage->SetProperties(&nUpProps); - } - } - } - else - { - // - // NUp is not set - Fail the request so the page is closed and deleted - // - hr = E_ELEMENT_NOT_FOUND; - } - } - } - catch (CXDException& e) - { - hr = e; - } - } - - if (hr == E_ELEMENT_NOT_FOUND) - { - // - // The relevant features are not present in the print ticket or contain unsupported values. - // Close and delete the NUp page if it is currently open and do not propogate the fail status. - // - hr = S_FALSE; - - if (m_pNUpPage != NULL) - { - hr = m_pNUpPage->ClosePage(m_pXDWriter); - } - - DeleteNUpPage(); - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/nup/nupflt.h b/print/XPSDrvSmpl/src/filters/nup/nupflt.h deleted file mode 100644 index 814d8021..00000000 --- a/print/XPSDrvSmpl/src/filters/nup/nupflt.h +++ /dev/null @@ -1,88 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - nupflt.h - -Abstract: - - NUp filter definition. This class derives from the Xps filter - class and implements the necessary part handlers to support booklet - printing. The nup filter is responsible for applyinh page transofmations - appropriate to the NUp option selected. - -Known Issues: - - The filter uses PageMediaSize and not PageImageableSize to calculate the - canvas bounds - - The filter does not yet handle booklet offsets (gutter etc.) - ---*/ - -#pragma once - -#include "xdrchflt.h" -#include "nuppage.h" -#include "gdip.h" - -class CNUpFilter : public CXDXpsFilter -{ -public: - CNUpFilter(); - - virtual ~CNUpFilter(); - -private: - - virtual HRESULT - ProcessPart( - _Inout_ IFixedDocumentSequence* pFDS - ); - - virtual HRESULT - ProcessPart( - _Inout_ IFixedDocument* pFD - ); - - virtual HRESULT - ProcessPart( - _Inout_ IFixedPage* pFP - ); - - HRESULT - Finalize( - VOID - ); - - VOID - DeleteNUpPage( - VOID - ); - - HRESULT - CreateNUpPage( - _In_ IXMLDOMDocument2* pPT - ); - -protected: - GDIPlus m_gdiPlus; - - CNUpPage* m_pNUpPage; - - BOOL m_bSendAllDocs; - - CNUpPTProperties::ENUpScope m_nupScope; - - CResourceCopier m_resCopier; -}; - diff --git a/print/XPSDrvSmpl/src/filters/nup/nupflt.rc b/print/XPSDrvSmpl/src/filters/nup/nupflt.rc deleted file mode 100644 index f88d267c..00000000 --- a/print/XPSDrvSmpl/src/filters/nup/nupflt.rc +++ /dev/null @@ -1,43 +0,0 @@ -// -// Copyright (c) 2005 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. -// -// File Name: -// -// nupflt.rc -// -// Abstract: -// -// NUp filter resource file. -// -// - -#include <winres.h> -#include <ntverp.h> - -#define VER_FILETYPE VFT_DLL -#define VER_FILESUBTYPE VFT2_UNKNOWN -#define VER_FILEDESCRIPTION_STR "XPSDrv Sample NUp Filter" -#define VER_INTERNALNAME_STR "PrintFeatureFilters" - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -#endif // English (U.S.) resources - -///////////////////////////////////////////////////////////////////////////// - -#include "common.ver" - diff --git a/print/XPSDrvSmpl/src/filters/nup/nuppage.cpp b/print/XPSDrvSmpl/src/filters/nup/nuppage.cpp deleted file mode 100644 index f814d21a..00000000 --- a/print/XPSDrvSmpl/src/filters/nup/nuppage.cpp +++ /dev/null @@ -1,581 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - nuppage.cpp - -Abstract: - - NUp page implementation. This class is responsible for maintaining - the current NUp page. The public interface defines methods for adding - fixed page content and closing the current page. When a page is added, - the class uses a SAX handler to strip the FixedPage tags from the - source page, apply a canvas with a transformation and add it to the - current NUp page. When the page is full it is closed and sent and a new - NUp page is created. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "nuppage.h" -#include "nupsax.h" -#include "widetoutf8.h" - -static CONST PCWSTR pszOpenFPTag = L"<?xml version=\"1.0\" encoding=\"utf-8\"?><FixedPage Width=\"%.2f\" Height=\"%.2f\" xml:lang=\"en-US\" xmlns=\"http://schemas.microsoft.com/xps/2005/06\">"; - -/*++ - -Routine Name: - - CNUpPage::CNUpPage - -Routine Description: - - Constructor for the CNUpPage class which initialises itself to sensible values - and creates a new page transformation - -Arguments: - - pNUpProps - Pointer to class containing nup settings from the PrintTicket - pResCopier - Pointer to page resource copy class used for copying markup between pages - -Return Value: - - None - Throws CXDException(HRESULT) on an error - ---*/ -CNUpPage::CNUpPage( - _In_ CNUpPTProperties* pNUpProps, - _In_ CResourceCopier* pResCopier - ) : - m_pNUpProps(NULL), - m_pNUpTransform(NULL), - m_pWriter(NULL), - m_pFixedPage(NULL), - m_cCurrPageIndex(0), - m_cNUp(1), - m_pResCopier(pResCopier) -{ - HRESULT hr = S_OK; - ASSERTMSG(m_pResCopier != NULL, "Invalid resource copier\n"); - - if (SUCCEEDED(hr = CHECK_POINTER(pNUpProps, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pResCopier, E_POINTER))) - { - try - { - m_pNUpProps = new(std::nothrow) CNUpPTProperties(*pNUpProps); - - if (SUCCEEDED(hr = CHECK_POINTER(m_pNUpProps, E_OUTOFMEMORY))) - { - m_pNUpTransform = new(std::nothrow) CNUpTransform(m_pNUpProps); - - hr = CHECK_POINTER(m_pNUpTransform, E_OUTOFMEMORY); - } - - if (SUCCEEDED(hr)) - { - hr = m_pNUpProps->GetCount(&m_cNUp); - } - } - catch (CXDException& e) - { - hr = e; - } - } - - if (FAILED(hr)) - { - if (m_pNUpProps != NULL) - { - delete m_pNUpProps; - m_pNUpProps = NULL; - } - - if (m_pNUpTransform != NULL) - { - delete m_pNUpTransform; - m_pNUpTransform = NULL; - } - - throw CXDException(hr); - } -} - -/*++ - -Routine Name: - - CNUpPage::~CNUpPage - -Routine Description: - - Default destructor for the CNUpPage class - -Arguments: - - None - -Return Value: - - None - ---*/ -CNUpPage::~CNUpPage() -{ - DeleteProperties(); - DeleteTransform(); - - ASSERTMSG(m_pWriter == NULL, "Destroying NUp page with open page writer\n"); - ASSERTMSG(m_pFixedPage == NULL, "Destroying NUp page with open fixed page\n"); -} - -/*++ - -Routine Name: - - CNUpPage::AddPageContent - -Routine Description: - - Method to write out fixed page with a transformation matrix - -Arguments: - - pWriter - Pointer to a writer which the transformed fixed page will be sent to - pFP - Pointer to the fixed page to be transformed and written out - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CNUpPage::AddPageContent( - _In_ IXpsDocumentConsumer* pWriter, - _In_ IFixedPage* pFP - ) -{ - ASSERTMSG(m_pNUpTransform != NULL, "NULL transform object\n"); - ASSERTMSG(m_pNUpProps != NULL, "NULL NUp properties object\n"); - - HRESULT hr = S_OK; - - SizeF sizePage; - if (SUCCEEDED(hr = CHECK_POINTER(pWriter, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pFP, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(m_pNUpProps, E_PENDING)) && - SUCCEEDED(hr = CHECK_POINTER(m_pNUpTransform, E_PENDING)) && - SUCCEEDED(hr = m_pNUpProps->GetPageSize(&sizePage)) && - m_pFixedPage == NULL) - { - hr = CreateNewPage(pWriter, sizePage); - } - - if (SUCCEEDED(hr)) - { - // - // Create a SAX reader to parse the mark-up write out the page - // content - // - CComPtr<ISAXXMLReader> pSaxRdr(NULL); - if (SUCCEEDED(hr) && - SUCCEEDED(hr = pSaxRdr.CoCreateInstance(CLSID_SAXXMLReader60))) - { - try - { - m_pNUpTransform->SetCurrentPage(m_cCurrPageIndex); - - // - // Create our NUp sax handler - // - CNUpSaxHandler nupSaxHndlr(m_pWriter, m_pResCopier, m_pNUpTransform); - - // - // Set-up the SAX reader and begin parsing the mark-up - // - CComPtr<IPrintReadStream> pReader(NULL); - if (SUCCEEDED(hr = pSaxRdr->putContentHandler(&nupSaxHndlr)) && - SUCCEEDED(hr = pFP->GetStream(&pReader))) - { - CComPtr<ISequentialStream> pReadStreamToSeq(NULL); - - pReadStreamToSeq.Attach(new(std::nothrow) pfp::PrintReadStreamToSeqStream(pReader)); - - if (SUCCEEDED(hr = CHECK_POINTER(pReadStreamToSeq, E_OUTOFMEMORY))) - { - hr = pSaxRdr->parse(CComVariant(static_cast<ISequentialStream*>(pReadStreamToSeq))); - } - } - } - catch (CXDException& e) - { - hr = e; - } - } - - // - // Copy resources - // - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_POINTER(m_pResCopier, E_PENDING))) - { - hr = m_pResCopier->CopyPageResources(pFP, m_pFixedPage); - } - - m_cCurrPageIndex++; - } - - if (SUCCEEDED(hr)) - { - // - // Check if we need to close the page - // - if (m_cCurrPageIndex == m_cNUp) - { - hr = ClosePage(pWriter); - m_cCurrPageIndex = 0; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CNUpPage::ClosePage - -Routine Description: - - Method to close an open fixed page including the addition of any required markup - -Arguments: - - pWriter - Pointer to a writer which receives the closing markup - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CNUpPage::ClosePage( - _In_ IXpsDocumentConsumer* pWriter - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pWriter, E_POINTER))) - { - // - // Add closing page mark-up, close the current page writer - // - if (m_pWriter != NULL) - { - try - { - CStringXDW cstrCloseFP(L"</FixedPage>"); - hr = WriteToPrintStream(&cstrCloseFP, m_pWriter); - } - catch (CXDException& e) - { - hr = e; - } - - ASSERTMSG(SUCCEEDED(hr), "Failed to write fixed page closing tag\n"); - - m_pWriter->Close(); - } - - // - // Send the current page - // - if (m_pFixedPage != NULL) - { - hr = pWriter->SendFixedPage(m_pFixedPage); - } - - ASSERTMSG(SUCCEEDED(hr), "Failed to send page\n"); - } - - // - // Release the writer and the fixed page - // - m_pWriter = NULL; - m_pFixedPage = NULL; - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CNUpPage::SetProperties - -Routine Description: - - Method to set the nup properties at a start of a new run of pages - -Arguments: - - pNUpProps - Pointer to an object containing nup settings from the PrintTicket - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CNUpPage::SetProperties( - _In_ CNUpPTProperties* pNUpProps - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pNUpProps, E_POINTER))) - { - DeleteProperties(); - DeleteTransform(); - - m_pNUpProps = new(std::nothrow) CNUpPTProperties(*pNUpProps); - - if (SUCCEEDED(hr = CHECK_POINTER(m_pNUpProps, E_OUTOFMEMORY))) - { - m_pNUpTransform = new(std::nothrow) CNUpTransform(m_pNUpProps); - - if (SUCCEEDED(hr = CHECK_POINTER(m_pNUpTransform, E_OUTOFMEMORY))) - { - hr = m_pNUpProps->GetCount(&m_cNUp); - m_cCurrPageIndex = 0; - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CNUpPage::CreateNewPage - -Routine Description: - - Method to create a new fixed page to contain the original pages as canvas' - -Arguments: - - pWriter - Pointer to a writer which the new fixed page will be sent to - sizePage - Size of the new page - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CNUpPage::CreateNewPage( - _In_ IXpsDocumentConsumer* pWriter, - _In_ SizeF sizePage - ) -{ - HRESULT hr = S_OK; - - CComBSTR bstrPageURI; - - if (SUCCEEDED(hr = CHECK_POINTER(pWriter, E_POINTER))) - { - // - // Create a unique page URI - // - try - { - // - // Create a unique name for the NUp page for this print session - // - CStringXDW cstrPageURI; - cstrPageURI.Format(L"/NUpPage_%u.xml", GetUniqueNumber()); - bstrPageURI.Empty(); - bstrPageURI.Attach(cstrPageURI.AllocSysString()); - } - catch (CXDException& e) - { - hr = e; - } - } - - // - // Close any open pages, create the new page and retrieve the page writer - // - if (SUCCEEDED(hr) && - SUCCEEDED(hr = ClosePage(pWriter)) && - SUCCEEDED(hr = pWriter->GetNewEmptyPart(bstrPageURI, - __uuidof(IFixedPage), - reinterpret_cast<VOID**>(&m_pFixedPage), - &m_pWriter))) - { - // - // Construct the opening FixedPage tag - // - try - { - CStringXDW cstrOpenFP; - cstrOpenFP.Format(pszOpenFPTag, sizePage.Width, sizePage.Height); - hr = WriteToPrintStream(&cstrOpenFP, m_pWriter); - } - catch (CXDException& e) - { - hr = e; - } - - ASSERTMSG(SUCCEEDED(hr), "Failed to write fixed page opening tag\n"); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CNUpPage::DeleteProperties - -Routine Description: - - Method to delete the current nup properties object - -Arguments: - - None - -Return Value: - - None - ---*/ -VOID -CNUpPage::DeleteProperties( - VOID - ) -{ - if (m_pNUpProps != NULL) - { - delete m_pNUpProps; - m_pNUpProps = NULL; - } -} - -/*++ - -Routine Name: - - CNUpPage::DeleteTransform - -Routine Description: - - Method to delete the current nup transform object - -Arguments: - - None - -Return Value: - - None - ---*/ -VOID -CNUpPage::DeleteTransform( - VOID - ) -{ - delete m_pNUpTransform; - m_pNUpTransform = NULL; -} - - -/*++ - -Routine Name: - - CNUpPage::WriteToPrintStream - -Routine Description: - - This routine converts a CStringXDW buffer to UTF-8 string to be - written to the write stream provided - -Arguments: - - pcstrOut - Pointer to the Atl CStringXDW containing the mark-up to be written - pWriter - Pointer to the print write stream to write to - -Return Value: - - HRESULT - S_OK - Always succeeds - ---*/ -HRESULT -CNUpPage::WriteToPrintStream( - _In_ CStringXDW* pcstrOut, - _In_ IPrintWriteStream* pWriter - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pcstrOut, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pWriter, E_POINTER))) - { - ULONG cbWritten = 0; - PVOID pData = NULL; - ULONG cbData = 0; - - try - { - CWideToUTF8 wideToUTF8(pcstrOut); - - if (SUCCEEDED(hr = wideToUTF8.GetBuffer(&pData, &cbData))) - { - hr = pWriter->WriteBytes(pData, cbData, &cbWritten); - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/nup/nuppage.h b/print/XPSDrvSmpl/src/filters/nup/nuppage.h deleted file mode 100644 index 545c5114..00000000 --- a/print/XPSDrvSmpl/src/filters/nup/nuppage.h +++ /dev/null @@ -1,107 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - nuppage.h - -Abstract: - - NUp page definition. This class is responsible for maintaining - the current NUp page. The public interface defines methods for adding - fixed page content and closing the current page. When a page is added, - the class uses a SAX handler to strip the FixedPage tags from the - source page, apply a canvas with a transformation and add it to the - current NUp page. When the page is full it is closed and sent and a new - NUp page is created. - ---*/ - -#pragma once - -#include "rescpy.h" -#include "xdstring.h" -#include "nupxform.h" - -class CNUpPage -{ -public: - CNUpPage( - _In_ CNUpPTProperties* pNUpProps, - _In_ CResourceCopier* pResCopier - ); - - virtual ~CNUpPage(); - - HRESULT - AddPageContent( - _In_ IXpsDocumentConsumer* pWriter, - _In_ IFixedPage* pFP - ); - - HRESULT - ClosePage( - _In_ IXpsDocumentConsumer* pWriter - ); - - HRESULT - SetProperties( - _In_ CNUpPTProperties* pNUpProps - ); - -private: - HRESULT - CreateNewPage( - _In_ IXpsDocumentConsumer* pWriter, - _In_ SizeF sizePage - ); - - HRESULT - CopyResources( - _In_ IFixedPage* pFPSrc, - _Inout_ IFixedPage* pFPDst - ); - - VOID - DeleteProperties( - VOID - ); - - VOID - DeleteTransform( - VOID - ); - - HRESULT - WriteToPrintStream( - _In_ CStringXDW* pcstrOut, - _In_ IPrintWriteStream* pWriter - ); - -private: - CComPtr<IPrintWriteStream> m_pWriter; - - CComPtr<IFixedPage> m_pFixedPage; - - // - // Current page index (i.e. 0 - 5 for 6 Up) - // - UINT m_cCurrPageIndex; - - UINT m_cNUp; - - CNUpTransform* m_pNUpTransform; - - CNUpPTProperties* m_pNUpProps; - - CResourceCopier* m_pResCopier; -}; - diff --git a/print/XPSDrvSmpl/src/filters/nup/nupsax.cpp b/print/XPSDrvSmpl/src/filters/nup/nupsax.cpp deleted file mode 100644 index 6c92730c..00000000 --- a/print/XPSDrvSmpl/src/filters/nup/nupsax.cpp +++ /dev/null @@ -1,522 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - nupsax.xpp - -Abstract: - - NUp SAX handler implementation. The class derives from the default SAX handler - and implements only the necessary SAX APIs to process the mark-up. The - handler is responsible for copying page mark-up to a writer, removing - the fixed page opening and closing tags. It is also responsible for - identifying resources that need to be copied from the source page to - the NUp page. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "nupsax.h" - -// -// We will need to preserve namespaces defined by the source fixed page into each canvas, -// e.g. xmlns:x="http://schemas.microsoft.com/xps/2005/06/resourcedictionary-key". To do -// this we will create and populate a vector of namespaces to add to the canvas wrappning -// the source fixed page. -// -typedef pair<CStringXDW, CStringXDW> AttribValuePair; -typedef vector<AttribValuePair> NamespaceVector; - -/*++ - -Routine Name: - - CNUpSaxHandler::CNUpSaxHandler - -Routine Description: - - Contructor for the nup filters SAX handler which registers - internally the writer for sending new markup out to and a - resource copier which copies markup between pages - -Arguments: - - pWriter - Pointer to a write stream which receives markup - pResCopier - Pointer to a resource markup copier object which - copies markup between pages - -Return Value: - - None - Throws CXDException(HRESULT) on an error - ---*/ -CNUpSaxHandler::CNUpSaxHandler( - _In_ IPrintWriteStream* pWriter, - _In_ CResourceCopier* pResCopier, - _In_ CNUpTransform* pNUpTransform - ) : - m_pWriter(pWriter), - m_bOpenTag(FALSE), - m_pResCopier(pResCopier), - m_pNUpTransform(pNUpTransform) -{ - ASSERTMSG(m_pWriter != NULL, "NULL writer passed to NUp SAX handler.\n"); - ASSERTMSG(m_pResCopier != NULL, "NULL resource copier passed to NUp SAX handler.\n"); - ASSERTMSG(m_pNUpTransform != NULL, "NULL NUp Transform object passed to NUp SAX handler.\n"); - - HRESULT hr = S_OK; - if (FAILED(hr = CHECK_POINTER(m_pWriter, E_PENDING)) || - FAILED(hr = CHECK_POINTER(m_pResCopier, E_PENDING)) || - FAILED(hr = CHECK_POINTER(m_pNUpTransform, E_PENDING))) - { - throw CXDException(hr); - } -} - -/*++ - -Routine Name: - - CNUpSaxHandler::~CNUpSaxHandler - -Routine Description: - - Default destructor for the nup filters SAX handler - -Arguments: - - None - -Return Value: - - None - ---*/ -CNUpSaxHandler::~CNUpSaxHandler() -{ - m_bstrOpenElement.Empty(); -} - -/*++ - -Routine Name: - - CNUpSaxHandler::startElement - -Routine Description: - - SAX handler method which handles each start element for the XML markup - -Arguments: - - pwchQName - Pointer to a string containing the element name - cchQName - Count of the number of characters in the element name - pAttributes - Pointer to the attribute list for the supplied element - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT STDMETHODCALLTYPE -CNUpSaxHandler::startElement( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - _In_reads_(cchQName) CONST wchar_t* pwchQName, - _In_ INT cchQName, - _In_ ISAXAttributes* pAttributes - ) -{ - HRESULT hr = S_OK; - CStringXDW cstrOut; - - // - // If this is the fixed page we need the width and height retrieved - // - BOOL bIsFixedPage = FALSE; - - try - { - CComBSTR bstrElement(cchQName, pwchQName); - - bIsFixedPage = (bstrElement == L"FixedPage"); - - // - // The resource dictionary is now canvas wide - // - if (bstrElement == L"FixedPage.Resources") - { - bstrElement = L"Canvas.Resources"; - } - - // - // Check if we need to close an opened tag - // - if (m_bOpenTag) - { - cstrOut.Append(L">"); - } - - // - // Store the opened element name so we can handle nested elements - // - m_bstrOpenElement = bstrElement; - } - catch (CXDException& e) - { - hr = e; - } - - if (SUCCEEDED(hr)) - { - // - // If this is the fixed page we do not write the tag - // - if (!bIsFixedPage) - { - // - // Write out element - // - try - { - cstrOut.Append(L"<"); - cstrOut.Append(m_bstrOpenElement); - } - catch (CXDException& e) - { - hr = e; - } - - // - // We opened a tag - // - m_bOpenTag = TRUE; - } - - SizeF sizePage(0.0f, 0.0f); - - // - // Record additional namespaces defined by the fixed page - // - NamespaceVector fpNamespaces; - - // - // Find the number of attributes and enumerate over all of them - // - INT cAttributes = 0; - if (SUCCEEDED(hr) && - SUCCEEDED(hr = pAttributes->getLength(&cAttributes))) - { - for (INT cIndex = 0; cIndex < cAttributes && SUCCEEDED(hr); cIndex++) - { - PCWSTR pszAttUri = NULL; - INT cchAttUri = 0; - PCWSTR pszAttName = NULL; - INT cchAttName = 0; - PCWSTR pszAttQName = NULL; - INT cchAttQName = 0; - PCWSTR pszAttValue = NULL; - INT cchAttValue = 0; - - // - // Get the attribute data ready to write out - // - if (SUCCEEDED(hr = pAttributes->getName(cIndex, - &pszAttUri, - &cchAttUri, - &pszAttName, - &cchAttName, - &pszAttQName, - &cchAttQName))) - { - if (SUCCEEDED(pAttributes->getValue(cIndex, &pszAttValue, &cchAttValue))) - { - try - { - CComBSTR bstrAttName(cchAttQName, pszAttQName); - CComBSTR bstrAttValue(cchAttValue, pszAttValue); - - if (bIsFixedPage) - { - // - // Extract the page Width and Height values - // - CStringXDW cstrAttName(bstrAttName); - if (cstrAttName == L"Width") - { - sizePage.Width = static_cast<REAL>(_wtof(bstrAttValue)); - - if (sizePage.Width < 1.f) - { - // - // According to the Xps Specification, - // FixedPage Width must be >= 1.0 - // - hr = E_FAIL; - } - } - else if (cstrAttName == L"Height") - { - sizePage.Height = static_cast<REAL>(_wtof(bstrAttValue)); - - if (sizePage.Height < 1.f) - { - // - // According to the Xps Specification, - // FixedPage Height must be >= 1.0 - // - hr = E_FAIL; - } - } - else if (cstrAttName.Find(L"xmlns:") == 0) - { - // - // We have an additional namespace - add to the vector to be applied to the canvas element - // - fpNamespaces.push_back(AttribValuePair(cstrAttName, CStringXDW(bstrAttValue))); - } - } - else - { - // - // Delimit attributes with a space - // - cstrOut.Append(L" "); - - // - // Reconstruct the attribute and write back to - // the fixed page - // - cstrOut.Append(bstrAttName); - cstrOut.Append(L"=\""); - - // - // If this is a UnicodeString we may need to escape entities - // - if (bstrAttName == L"UnicodeString") - { - hr = EscapeEntity(&bstrAttValue); - } - - cstrOut.Append(bstrAttValue); - cstrOut.Append(L"\""); - } - } - catch (CXDException& e) - { - hr = e; - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - } - } - } - - if (SUCCEEDED(hr) && - bIsFixedPage) - { - // - // Write the canvas out - // - try - { - // - // Get the page transform for the current page - // - CComBSTR bstrMatrix; - Matrix matrixTransform; - - if (SUCCEEDED(hr = m_pNUpTransform->GetPageTransform(sizePage, &matrixTransform)) && - SUCCEEDED(hr = m_pNUpTransform->MatrixToXML(&matrixTransform, &bstrMatrix))) - { - - // - // Create a clipping region which is the size of the logical page - // - CStringXDW strClip; - - strClip.Format(L"M 0,0 L %.2f,0 L %.2f,%.2f L 0, %.2f Z", - sizePage.Width, - sizePage.Width, - sizePage.Height, - sizePage.Height); - - cstrOut.Format(L"<Canvas RenderTransform=\"%s\" Clip=\"%s\"", - static_cast<LPCWSTR>(bstrMatrix), - static_cast<LPCWSTR>(strClip)); - - // - // Add additional namespaces from the FixedPage - // - for (NamespaceVector::const_iterator iterNamespaces = fpNamespaces.begin(); - iterNamespaces != fpNamespaces.end(); - iterNamespaces++) - { - cstrOut += L" "; - cstrOut += (*iterNamespaces).first; - cstrOut += L"=\""; - cstrOut += (*iterNamespaces).second; - cstrOut += L"\""; - } - - cstrOut += L">"; - } - } - catch (CXDException& e) - { - hr = e; - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - - ASSERTMSG(SUCCEEDED(hr), "Failed to write canvas\n"); - } - - if (SUCCEEDED(hr)) - { - hr = WriteToPrintStream(&cstrOut, m_pWriter); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CNUpSaxHandler::endElement - -Routine Description: - - SAX handler method which handles each end element for the XML markup - -Arguments: - - pwchQName - Pointer to a string containing the element name - cchQName - Count of the number of characters in the element name - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT STDMETHODCALLTYPE -CNUpSaxHandler::endElement( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - _In_reads_(cchQName) CONST wchar_t* pwchQName, - _In_ INT cchQName - ) -{ - HRESULT hr = S_OK; - CStringXDW cstrClose; - BOOL bCloseTag = FALSE; - - try - { - CComBSTR bstrElement(cchQName, pwchQName); - - // - // The resource dictionary is now canvas wide - // - if (bstrElement == L"FixedPage.Resources") - { - bstrElement = L"Canvas.Resources"; - } - - // - // Ignore close fixed page tag - // - if (bstrElement != L"FixedPage") - { - bCloseTag = TRUE; - - // - // If this is a root element with child nodes, the open - // element will not match the last startElement. In this case - // we need to add an appropriate closing tag - // - if (bstrElement == m_bstrOpenElement && !!m_bOpenTag) - { - // - // Names match so just add a closing bracket - // - // We might have closed the tag when writing the watermark XML - // - cstrClose.Append(L"/>"); - } - else - { - // - // Add a closing tag - // - cstrClose.Append(L"</"); - cstrClose.Append(bstrElement); - cstrClose.Append(L">"); - } - - m_bOpenTag = FALSE; - } - else - { - // - // Close the canvas - // - try - { - bCloseTag = TRUE; - cstrClose.Append(L"</Canvas>"); - } - catch (CXDException& e) - { - hr = e; - } - - ASSERTMSG(SUCCEEDED(hr), "Failed to write canvas\n"); - } - } - catch (CXDException& e) - { - hr = e; - } - - if (SUCCEEDED(hr) && - bCloseTag) - { - hr = WriteToPrintStream(&cstrClose, m_pWriter); - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/nup/nupsax.h b/print/XPSDrvSmpl/src/filters/nup/nupsax.h deleted file mode 100644 index 8b78cfd8..00000000 --- a/print/XPSDrvSmpl/src/filters/nup/nupsax.h +++ /dev/null @@ -1,76 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - nupsax.h - -Abstract: - - NUp SAX handler definition. The class derives from the default SAX handler - and implements only the necessary SAX APIs to process the mark-up. The - handler is responsible for copying page mark-up to a writer, removing - the fixed page opening and closing tags. It is also responsible for - identifying resources that need to be copied from the source page to - the NUp page. - ---*/ - -#pragma once - -#include "saxhndlr.h" -#include "rescpy.h" -#include "nupxform.h" - -class CNUpSaxHandler : public CSaxHandler -{ -public: - CNUpSaxHandler( - _In_ IPrintWriteStream* pWriter, - _In_ CResourceCopier* pResCopier, - _In_ CNUpTransform* pNUpTransform - ); - - virtual ~CNUpSaxHandler(); - - virtual HRESULT STDMETHODCALLTYPE - startElement( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - _In_reads_(cchQName) CONST wchar_t* pwchQName, - _In_ INT cchQName, - _In_ ISAXAttributes* pAttributes - ); - - virtual HRESULT STDMETHODCALLTYPE - endElement( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - _In_reads_(cchQName) CONST wchar_t* pwchQName, - _In_ INT cchQName - ); - -private: - CComPtr<IPrintWriteStream> m_pWriter; - - CComBSTR m_bstrOpenElement; - - BOOL m_bOpenTag; - - CResourceCopier* m_pResCopier; - - CNUpTransform* m_pNUpTransform; -}; - diff --git a/print/XPSDrvSmpl/src/filters/nup/nuptprps.cpp b/print/XPSDrvSmpl/src/filters/nup/nuptprps.cpp deleted file mode 100644 index 0783f0ce..00000000 --- a/print/XPSDrvSmpl/src/filters/nup/nuptprps.cpp +++ /dev/null @@ -1,449 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - nuptprps.cpp - -Abstract: - - NUp properties class implementation. The NUp properties class is - responsible for interpreting NUp, Binding, PageMediaSize and - PageOrientation data for the NUp filter. Binding data is required - as the NUp filter is responsible for applying two up for booklet - processing. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "nuptprps.h" - -using XDPrintSchema::NUp::NUpData; -using XDPrintSchema::NUp::JobNUpAllDocumentsContiguously; - -using XDPrintSchema::NUp::PresentationDirection::ENUpDirectionOption; -using XDPrintSchema::NUp::PresentationDirection::LeftBottom; -using XDPrintSchema::NUp::PresentationDirection::TopLeft; -using XDPrintSchema::NUp::PresentationDirection::BottomLeft; -using XDPrintSchema::NUp::PresentationDirection::RightBottom; - -using XDPrintSchema::Binding::BindingData; -using XDPrintSchema::Binding::EBindingOption; -using XDPrintSchema::Binding::None; -using XDPrintSchema::Binding::BindLeft; -using XDPrintSchema::Binding::BindRight; -using XDPrintSchema::Binding::BindTop; -using XDPrintSchema::Binding::BindBottom; -using XDPrintSchema::Binding::JobBindAllDocuments; -using XDPrintSchema::Binding::EdgeStitchLeft; -using XDPrintSchema::Binding::EdgeStitchRight; -using XDPrintSchema::Binding::EdgeStitchTop; -using XDPrintSchema::Binding::EdgeStitchBottom; - -using XDPrintSchema::PageMediaSize::PageMediaSizeData; - -using XDPrintSchema::PageOrientation::PageOrientationData; -using XDPrintSchema::PageOrientation::EOrientationOption; - -/*++ - -Routine Name: - - CNUpPTProperties::CNUpPTProperties - -Routine Description: - - Constructor for the CNUpPTProperties class which - initialises members to sensible default values - -Arguments: - - nupData - Structure containing nup settings from the PrintTicket - bindingData - Structure containing nup binding settings from the PrintTicket - pageMediaSizeData - Structure containing nup page media size settings from the PrintTicket - pageOrientData - Structure containing nup page orientation settings from the PrintTicket - -Return Value: - - None - ---*/ -CNUpPTProperties::CNUpPTProperties( - _In_ CONST NUpData& nupData, - _In_ CONST BindingData& bindingData, - _In_ CONST PageMediaSizeData& pageMediaSizeData, - _In_ CONST PageOrientationData& pageOrientData - ) : - m_nupData(nupData), - m_bindingData(bindingData), - m_pageMediaSizeData(pageMediaSizeData), - m_pageOrientData(pageOrientData) -{ -} - -/*++ - -Routine Name: - - CNUpPTProperties::~CNUpPTProperties - -Routine Description: - - Default destructor for the CNUpPTProperties class - -Arguments: - - None - -Return Value: - - None - ---*/ -CNUpPTProperties::~CNUpPTProperties() -{ -} - -/*++ - -Routine Name: - - CNUpPTProperties::GetCount - -Routine Description: - - Method to get the nup count. For booklet printing this will always be set to two - -Arguments: - - pcNUpPages - Integer value which will contain the nup count - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CNUpPTProperties::GetCount( - _Out_ UINT* pcNUpPages - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pcNUpPages, E_POINTER))) - { - *pcNUpPages = m_nupData.cNUp; - - if (m_bindingData.bindOption != XDPrintSchema::Binding::None) - { - *pcNUpPages = 2; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CNUpPTProperties::GetPresentationDirection - -Routine Description: - - Method to get the nup presentation direction - -Arguments: - - pPresentationDirection - Enumeration value which is set to the current - presentation direction - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CNUpPTProperties::GetPresentationDirection( - _Out_ ENUpDirectionOption* pPresentationDirection - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pPresentationDirection, E_POINTER))) - { - *pPresentationDirection = m_nupData.nUpPresentDir; - - if (m_bindingData.bindOption != XDPrintSchema::Binding::None) - { - hr = PresentDirFromBindOption(pPresentationDirection); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CNUpPTProperties::GetScope - -Routine Description: - - Method to get the nup scope which can be either - document wide or job wide. - -Arguments: - - pNUpScope - Enumeration value which will be set to the - current scope of nup. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CNUpPTProperties::GetScope( - _In_ ENUpScope* pNUpScope - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pNUpScope, E_POINTER))) - { - *pNUpScope = CNUpPTProperties::None; - - if (m_bindingData.bindOption != XDPrintSchema::Binding::None) - { - *pNUpScope = m_bindingData.bindFeature == JobBindAllDocuments ? Job : Document; - } - else if (m_nupData.cNUp > 1) - { - *pNUpScope = m_nupData.nUpFeature == JobNUpAllDocumentsContiguously ? Job : Document; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CNUpPTProperties::GetPageSize - -Routine Description: - - Method to get the nup page media size - -Arguments: - - pSizePage - Value which will be set to the nup page media size - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CNUpPTProperties::GetPageSize( - _Out_ SizeF* pSizePage - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pSizePage, E_POINTER))) - { - // - // Convert microns to 96th of an inch. - // - pSizePage->Width = static_cast<REAL>(m_pageMediaSizeData.pageWidth)/k96thInchAsMicrons; - pSizePage->Height = static_cast<REAL>(m_pageMediaSizeData.pageHeight)/k96thInchAsMicrons; - - if (pSizePage->Width <= 0.0f || - pSizePage->Height <= 0.0f) - { - // - // The page media size is incorrect - // - ERR("Could not acquire a valid media page size\n"); - - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CNUpPTProperties::GetPageOrientation - -Routine Description: - - Method to get the nup page orientation which can be either landscape or portrait - -Arguments: - - pPageOrientation - Enumeration value which will be set to either landscape or portrait - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CNUpPTProperties::GetPageOrientation( - _In_ EOrientationOption* pPageOrientation - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pPageOrientation, E_POINTER))) - { - *pPageOrientation = m_pageOrientData.orientation; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CNUpPTProperties::PresentDirFromBindOption - -Routine Description: - - Method to obtain a presentation direction from the current binding setting - -Arguments: - - pPresentationDirection - Enumeration value which will be set to a presentation direction - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CNUpPTProperties::PresentDirFromBindOption( - _Out_ ENUpDirectionOption* pPresentationDirection - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pPresentationDirection, E_POINTER))) - { - switch (m_bindingData.bindOption) - { - case BindRight: - case EdgeStitchRight: - { - *pPresentationDirection = LeftBottom; - } - break; - - case BindBottom: - case EdgeStitchBottom: - { - // - // Vertical direction takes precidence over horizontal direction - // - *pPresentationDirection = TopLeft; - } - break; - - case BindTop: - case EdgeStitchTop: - { - // - // Vertical direction takes precidence over horizontal direction - // - *pPresentationDirection = BottomLeft; - } - break; - - // - // Everything else is RightBottom - // - default: - { - *pPresentationDirection = RightBottom; - } - break; - } - } - - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CNUpPTProperties::GetBindingOption - -Routine Description: - - Method to obtain the binding direction - -Arguments: - - pBindingOption - Enumeration value which will be set to a binding direction - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CNUpPTProperties::GetBindingOption( - _Out_ EBindingOption* pBindingOption - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pBindingOption, E_POINTER))) - { - *pBindingOption = m_bindingData.bindOption; - } - - ERR_ON_HR(hr); - return hr; -} diff --git a/print/XPSDrvSmpl/src/filters/nup/nuptprps.h b/print/XPSDrvSmpl/src/filters/nup/nuptprps.h deleted file mode 100644 index 2d53082a..00000000 --- a/print/XPSDrvSmpl/src/filters/nup/nuptprps.h +++ /dev/null @@ -1,97 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - nuptprps.cpp - -Abstract: - - NUp properties class definition. The NUp properties class is - responsible for holding and controling NUp properties. - ---*/ - -#pragma once - -#include "nupdata.h" -#include "bkdata.h" -#include "psizedata.h" -#include "porientdata.h" - -class CNUpPTProperties -{ -public: - enum ENUpScope - { - None = 0, - Job, - Document - }; - -public: - CNUpPTProperties( - _In_ CONST XDPrintSchema::NUp::NUpData& nupData, - _In_ CONST XDPrintSchema::Binding::BindingData& bindingData, - _In_ CONST XDPrintSchema::PageMediaSize::PageMediaSizeData& pageMediaSizeData, - _In_ CONST XDPrintSchema::PageOrientation::PageOrientationData& pageOrientData - ); - - virtual ~CNUpPTProperties(); - - HRESULT - GetCount( - _Out_ UINT* pcNUpPages - ); - - HRESULT - GetPresentationDirection( - _Out_ XDPrintSchema::NUp::PresentationDirection::ENUpDirectionOption* pPresentationDirection - ); - - HRESULT - GetScope( - _In_ ENUpScope* pNUpScope - ); - - HRESULT - GetPageSize( - _Out_ SizeF* pSizePage - ); - - HRESULT - GetPageOrientation( - _In_ XDPrintSchema::PageOrientation::EOrientationOption* pPageOrientation - ); - - HRESULT - GetBindingOption( - _Out_ XDPrintSchema::Binding::EBindingOption* pBindingOption - ); - -private: - CNUpPTProperties& operator = (CONST CNUpPTProperties&); - - HRESULT - PresentDirFromBindOption( - _Out_ XDPrintSchema::NUp::PresentationDirection::ENUpDirectionOption* pPresentationDirection - ); - -private: - CONST XDPrintSchema::NUp::NUpData m_nupData; - - CONST XDPrintSchema::Binding::BindingData m_bindingData; - - CONST XDPrintSchema::PageMediaSize::PageMediaSizeData m_pageMediaSizeData; - - CONST XDPrintSchema::PageOrientation::PageOrientationData m_pageOrientData; -}; - diff --git a/print/XPSDrvSmpl/src/filters/nup/nupxform.cpp b/print/XPSDrvSmpl/src/filters/nup/nupxform.cpp deleted file mode 100644 index a79ff819..00000000 --- a/print/XPSDrvSmpl/src/filters/nup/nupxform.cpp +++ /dev/null @@ -1,623 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - nupxform.cpp - -Abstract: - - NUp transform implementation. The NUp transform class is responsible - for calculating the appropriate matrix transform for a given page in - an NUp sequence. - -Known Issues: - - The NUp implementation does not yet account for reverse orientations - (ReverseLandscape and ReversePortrait). - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "xdexcept.h" -#include "nupxform.h" - -using XDPrintSchema::NUp::NUpData; -using XDPrintSchema::NUp::JobNUpAllDocumentsContiguously; - -using XDPrintSchema::NUp::PresentationDirection::ENUpDirectionOption; -using XDPrintSchema::NUp::PresentationDirection::ENUpDirectionOptionMin; -using XDPrintSchema::NUp::PresentationDirection::RightBottom; -using XDPrintSchema::NUp::PresentationDirection::BottomRight; -using XDPrintSchema::NUp::PresentationDirection::LeftBottom; -using XDPrintSchema::NUp::PresentationDirection::BottomLeft; -using XDPrintSchema::NUp::PresentationDirection::RightTop; -using XDPrintSchema::NUp::PresentationDirection::TopRight; -using XDPrintSchema::NUp::PresentationDirection::LeftTop; -using XDPrintSchema::NUp::PresentationDirection::TopLeft; -using XDPrintSchema::NUp::PresentationDirection::ENUpDirectionOptionMax; - -using XDPrintSchema::Binding::EBindingOption; -using XDPrintSchema::Binding::None; -using XDPrintSchema::Binding::BindTop; -using XDPrintSchema::Binding::BindBottom; - -using XDPrintSchema::PageOrientation::EOrientationOption; -using XDPrintSchema::PageOrientation::Landscape; -using XDPrintSchema::PageOrientation::ReverseLandscape; -using XDPrintSchema::PageOrientation::Portrait; - -static CONST REAL kLetterWidth96thsInch = 816.0f; -static CONST REAL kLetterHeight96thsInch = 1056.0f; - -/*++ - -Routine Name: - - CNUpTransform::CNUpTransform - -Routine Description: - - Constructor for the CNUpTransform class which initialises members - to sensible values based on the supplied PrintTicket object - -Arguments: - - pNUpPTProps - PrintTicket properties object used for initialising the - CNUpTransform object - -Return Value: - - None - Throws CXDException(HRESULT) on an error - ---*/ -CNUpTransform::CNUpTransform( - _In_ CNUpPTProperties* pNUpPTProps - ) : - m_bRotatePage(FALSE), - m_cCurrPageIndex(0) -{ - ASSERTMSG(pNUpPTProps != NULL, "NULL PrintTicket passed to page transform handler\n"); - - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pNUpPTProps, E_POINTER))) - { - if (SUCCEEDED(hr) && - FAILED(hr = pNUpPTProps->GetCount(&m_CanvasCount))) - { - m_CanvasCount = 1; - ERR("Failed to retrieve NUp count\n"); - } - - if (SUCCEEDED(hr) && - FAILED(hr = pNUpPTProps->GetPresentationDirection(&m_NUpPresentDirection))) - { - m_NUpPresentDirection = RightBottom; - ERR("Failed to retrieve NUp order\n"); - } - - if (SUCCEEDED(hr) && - FAILED(hr = pNUpPTProps->GetPageSize(&m_sizeTargetPage))) - { - m_sizeTargetPage.Width = kLetterWidth96thsInch; - m_sizeTargetPage.Height = kLetterHeight96thsInch; - ERR("Failed to retrieve target page size\n"); - } - - EOrientationOption pgOrient = Portrait; - if (SUCCEEDED(hr) && - FAILED(hr = pNUpPTProps->GetPageOrientation(&pgOrient))) - { - ERR("Failed to retrieve target page orientation\n"); - } - - // - // Initialise canvas count - // - switch (m_CanvasCount) - { - case 1: - { - m_CanvasXCount = 1; - m_CanvasYCount = 1; - } - break; - - case 2: - { - m_CanvasXCount = 1; - m_CanvasYCount = 2; - m_bRotatePage = TRUE; - - // - // Booklet printing is treated as a special case of 2Up. - // Unlike regular 2Up which always rotates pages, booklet - // only requires pages to be rotated when binding left to right - // or right to left. - // - EBindingOption bindingOption; - if(SUCCEEDED(hr = pNUpPTProps->GetBindingOption(&bindingOption))) - { - if(bindingOption == BindBottom || - bindingOption == BindTop) - { - m_bRotatePage = FALSE; - } - - if (pgOrient == Landscape) - { - m_CanvasXCount = 2; - m_CanvasYCount = 1; - } - } - } - break; - - case 4: - { - m_CanvasXCount = 2; - m_CanvasYCount = 2; - } - break; - - case 6: - { - m_CanvasXCount = 2; - m_CanvasYCount = 3; - m_bRotatePage = TRUE; - } - break; - - case 8: - { - m_CanvasXCount = 2; - m_CanvasYCount = 4; - m_bRotatePage = TRUE; - } - break; - - case 9: - { - m_CanvasXCount = 3; - m_CanvasYCount = 3; - } - break; - - case 16: - { - m_CanvasXCount = 4; - m_CanvasYCount = 4; - } - break; - - default: - { - m_CanvasXCount = 1; - m_CanvasYCount = 1; - } - break; - } - - if (pgOrient == Landscape || - pgOrient == ReverseLandscape) - { - INT countSwap = m_CanvasXCount; - m_CanvasXCount = m_CanvasYCount; - m_CanvasYCount = countSwap; - } - } - - if (SUCCEEDED(hr)) - { - hr = InitTransformMap(); - } - - if (FAILED(hr)) - { - throw CXDException(hr); - } -} - - -/*++ - -Routine Name: - - CNUpTransform::~CNUpTransform - -Routine Description: - - Default destructor for the CNUpTransform class - -Arguments: - - None - -Return Value: - - None - ---*/ -CNUpTransform::~CNUpTransform() -{ -} - -/*++ - -Routine Name: - - CNUpTransform::SetCurrentPage - -Routine Description: - - Sets the page member of the object - -Arguments: - - cPage - Current page count around the nup page count. - -Return Value: - - None - ---*/ -VOID -CNUpTransform::SetCurrentPage( - _In_ UINT cPage - ) -{ - m_cCurrPageIndex = cPage; -} - -/*++ - -Routine Name: - - CNUpTransform::GetPageTransform - -Routine Description: - - Method for obtaining a page transformation matrix based on the count of the - current canvas and the dimensions of the source and target pages - -Arguments: - - sizePage - Size of the source page being transformed - pTransform - Pointer to the resulting transformation matrix - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CNUpTransform::GetPageTransform( - _In_ SizeF sizePage, - _Out_ Matrix* pTransform - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pTransform, E_POINTER))) - { - SizeF sizeCanvas(m_sizeTargetPage.Width / m_CanvasXCount, m_sizeTargetPage.Height / m_CanvasYCount); - PointF canvasCentre(sizeCanvas.Width/2.0f, sizeCanvas.Height/2.0f); - PointF pageCentre(sizePage.Width/2.0f, sizePage.Height/2.0f); - - REAL scaleX = 1.0f; - REAL scaleY = 1.0f; - if (m_bRotatePage) - { - // - // Calculate the dimension scale accounting for page rotation - // - scaleX = sizeCanvas.Width / sizePage.Height; - scaleY = sizeCanvas.Height / sizePage.Width; - - // - // Apply the rotation - // - pTransform->Rotate(90.0f, MatrixOrderAppend); - } - else - { - // - // Calculate the dimension scale - // - scaleX = sizeCanvas.Width / sizePage.Width; - scaleY = sizeCanvas.Height / sizePage.Height; - } - - // - // The minimum scale of x and y gurantees both - // dimensions fit the target - // - REAL scale = min(scaleX, scaleY); - - // - // Apply the scaling factor - // - pTransform->Scale(scale, scale, MatrixOrderAppend); - - // - // Find the new page centre - // - pTransform->TransformPoints(&pageCentre, 1); - - // - // Apply a translate to the canvas - // - UINT cPage = 0; - BOOL bDone = FALSE; - - for (UINT cIndexY = 0; cIndexY < m_CanvasYCount && !bDone; cIndexY++) - { - for (UINT cIndexX = 0; cIndexX < m_CanvasXCount && !bDone; cIndexX++) - { - if (m_pageNumVect[cPage] == m_cCurrPageIndex) - { - // - // Offset multipliers from loop indices - // - REAL yMult = static_cast<REAL>(cIndexY); - REAL xMult = static_cast<REAL>(cIndexX); - - // - // Use a matrix to find the centre of the translated canvas - // - Matrix canvasXForm; - - // - // Translate canvas to destination - // - canvasXForm.Translate(sizeCanvas.Width * xMult, sizeCanvas.Height * yMult, MatrixOrderAppend); - - // - // Apply the canvas transform to the canvas centre - // - canvasXForm.TransformPoints(&canvasCentre, 1); - - bDone = TRUE; - } - cPage++; - } - } - - // - // Calculate the offset of the centre of page to the centre - // of the canvas and apply the translation - // - PointF offset(canvasCentre - pageCentre); - pTransform->Translate(offset.X, offset.Y, MatrixOrderAppend); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CNUpTransform::MatrixToXML - -Routine Description: - - Method to create xml markup representing a transformation matrix - -Arguments: - - pMatrix - Pointer to a transformation matrix to convert to markup - pbstrMatrixXForm - Pointer to a string to contain the matrix markup - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CNUpTransform::MatrixToXML( - _In_ CONST Matrix* pMatrix, - _Outptr_ BSTR* pbstrMatrixXForm - ) -{ - // - // Construct the matric mark-up from a GDI+ matrix - // - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrMatrixXForm, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pMatrix, E_POINTER))) - { - *pbstrMatrixXForm = NULL; - REAL matElems[6]; - - if (Ok == pMatrix->GetElements(matElems)) - { - CStringXDW cstrMatrix; - - try - { - cstrMatrix.Format(L"%.2f,%.2f,%.2f,%.2f,%.2f,%.2f", - matElems[0], - matElems[1], - matElems[2], - matElems[3], - matElems[4], - matElems[5]); - - *pbstrMatrixXForm = cstrMatrix.AllocSysString(); - } - catch (CXDException& e) - { - hr = e; - } - } - else - { - *pbstrMatrixXForm = NULL; - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CNUpTransform::InitTransformMap - -Routine Description: - - Method to initialise the map of transforms which depends - on the nup page count and presentation direction - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CNUpTransform::InitTransformMap( - VOID - ) -{ - HRESULT hr = S_OK; - - // - // Populate the map of page numbers. - // The transforms are calculated left to right, top to bottom on - // the physical page so rather than special case each presentation - // order, we simply apply the same transform in the same order but - // to a different ordering of pages - // - try - { - // - // Certain NUp page counts cause a rotation to be applied to the page. - // When this occurs, the presentation order should also be rotated. - // - ENUpDirectionOption rotatedOrder[ENUpDirectionOptionMax] = { - BottomLeft, - LeftBottom, - TopLeft, - LeftTop, - BottomRight, - RightBottom, - TopRight, - RightTop - }; - - if (m_bRotatePage) - { - if (m_NUpPresentDirection >= ENUpDirectionOptionMin && - m_NUpPresentDirection < ENUpDirectionOptionMax) - { - m_NUpPresentDirection = rotatedOrder[m_NUpPresentDirection]; - } - else - { - ERR("Invalid presentation direction.\n"); - - hr = E_FAIL; - } - } - - if (SUCCEEDED(hr)) - { - m_pageNumVect.clear(); - for (UINT cIndexY = 0; cIndexY < m_CanvasYCount; cIndexY++) - { - for (UINT cIndexX = 0; cIndexX < m_CanvasXCount; cIndexX++) - { - switch (m_NUpPresentDirection) - { - case RightTop: - { - m_pageNumVect.push_back((m_CanvasXCount * (m_CanvasYCount-1)) - (m_CanvasXCount * cIndexY) + cIndexX); - } - break; - - case LeftBottom: - { - m_pageNumVect.push_back(cIndexY * m_CanvasXCount + (m_CanvasXCount - cIndexX) - 1); - } - break; - - case LeftTop: - { - m_pageNumVect.push_back((m_CanvasXCount * m_CanvasYCount) - cIndexX - (cIndexY*m_CanvasXCount) - 1); - } - break; - - case BottomRight: - { - m_pageNumVect.push_back(m_CanvasYCount * cIndexX + cIndexY); - } - break; - - case TopRight: - { - m_pageNumVect.push_back((m_CanvasYCount - 1 - cIndexY) + (cIndexX * m_CanvasYCount)); - } - break; - - case BottomLeft: - { - m_pageNumVect.push_back(m_CanvasYCount * (m_CanvasXCount - 1 - cIndexX) + cIndexY); - } - break; - - case TopLeft: - { - m_pageNumVect.push_back(((m_CanvasXCount-cIndexX) * m_CanvasYCount) - 1 - cIndexY); - } - break; - - case RightBottom: - default: - { - m_pageNumVect.push_back(cIndexY * m_CanvasXCount + cIndexX); - } - break; - } - } - } - } - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/nup/nupxform.h b/print/XPSDrvSmpl/src/filters/nup/nupxform.h deleted file mode 100644 index a752730f..00000000 --- a/print/XPSDrvSmpl/src/filters/nup/nupxform.h +++ /dev/null @@ -1,101 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - nupxform.h - -Abstract: - - NUp transform definition. The NUp transform class is responsible - for calculating the appropriate matrix transform for a given page in - an NUp sequence. - ---*/ - -#pragma once - -#include "nuptprps.h" - -class CNUpTransform -{ -public: - CNUpTransform( - _In_ CNUpPTProperties* pNUpPTProps - ); - - virtual ~CNUpTransform(); - - VOID - SetCurrentPage( - _In_ UINT cPage - ); - - HRESULT - GetPageTransform( - _In_ SizeF sizePage, - _Out_ Matrix* pTransform - ); - - HRESULT - MatrixToXML( - _In_ CONST Matrix* pMatrix, - _Outptr_ BSTR* pbstrMatrixXForm - ); - -private: - HRESULT - InitTransformMap( - VOID - ); - -private: - // - // Nup count - // - UINT m_CanvasCount; - - // - // Current Nup index - // - UINT m_cCurrPageIndex; - - // - // Presentation order - // - XDPrintSchema::NUp::PresentationDirection::ENUpDirectionOption m_NUpPresentDirection; - - // - // Target page size - // - SizeF m_sizeTargetPage; - - // - // Nup count across - // - UINT m_CanvasXCount; - - // - // Nup count down - // - UINT m_CanvasYCount; - - // - // Vector of page maps - // - vector<UINT> m_pageNumVect; - - // - // We need to handle page rotation for 2, 6 and 8 up - // - BOOL m_bRotatePage; -}; - diff --git a/print/XPSDrvSmpl/src/filters/nup/precompsrc.cpp b/print/XPSDrvSmpl/src/filters/nup/precompsrc.cpp deleted file mode 100644 index 5944cf51..00000000 --- a/print/XPSDrvSmpl/src/filters/nup/precompsrc.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "precomp.h"
\ No newline at end of file diff --git a/print/XPSDrvSmpl/src/filters/nup/xdnup.def b/print/XPSDrvSmpl/src/filters/nup/xdnup.def deleted file mode 100644 index 349aaaa6..00000000 --- a/print/XPSDrvSmpl/src/filters/nup/xdnup.def +++ /dev/null @@ -1,26 +0,0 @@ -; -; Copyright (c) 2005 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. -; -; File Name: -; -; xdnup.def -; -; Abstract: -; -; NUp filter module definition file -; - -LIBRARY XDNup - -EXPORTS - DllMain - DllCanUnloadNow PRIVATE - DllGetClassObject PRIVATE - diff --git a/print/XPSDrvSmpl/src/filters/nup/xdnup.vcxproj b/print/XPSDrvSmpl/src/filters/nup/xdnup.vcxproj deleted file mode 100644 index 9c42026c..00000000 --- a/print/XPSDrvSmpl/src/filters/nup/xdnup.vcxproj +++ /dev/null @@ -1,552 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <ItemGroup Label="ProjectConfigurations"> - <ProjectConfiguration Include="Debug|ARM"> - <Configuration>Debug</Configuration> - <Platform>ARM</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Debug|ARM64"> - <Configuration>Debug</Configuration> - <Platform>ARM64</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Debug|Win32"> - <Configuration>Debug</Configuration> - <Platform>Win32</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release|ARM"> - <Configuration>Release</Configuration> - <Platform>ARM</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release|ARM64"> - <Configuration>Release</Configuration> - <Platform>ARM64</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release|Win32"> - <Configuration>Release</Configuration> - <Platform>Win32</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Debug|x64"> - <Configuration>Debug</Configuration> - <Platform>x64</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release|x64"> - <Configuration>Release</Configuration> - <Platform>x64</Platform> - </ProjectConfiguration> - </ItemGroup> - <PropertyGroup Label="Globals"> - <ProjectGuid>{23BA577F-B171-4CEC-92E0-49EE44564366}</ProjectGuid> - <RootNamespace>$(MSBuildProjectName)</RootNamespace> - <SupportsPackaging>false</SupportsPackaging> - <RequiresPackageProject>true</RequiresPackageProject> - <Configuration Condition="'$(Configuration)' == ''">Debug</Configuration> - <Platform Condition="'$(Platform)' == ''">Win32</Platform> - <SampleGuid>{5C442B00-0FF4-48AA-9CD8-A0C589B6E6B9}</SampleGuid> - </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> - <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>False</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>DynamicLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>False</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>DynamicLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>False</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>DynamicLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>True</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>DynamicLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>True</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>DynamicLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>True</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>DynamicLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>False</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>DynamicLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>True</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>DynamicLibrary</ConfigurationType> - </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> - <PropertyGroup> - <OutDir>$(IntDir)</OutDir> - </PropertyGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ItemGroup Label="WrappedTaskItems" /> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <TargetName>xdnup</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'"> - <TargetName>xdnup</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> - <TargetName>xdnup</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <TargetName>xdnup</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'"> - <TargetName>xdnup</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> - <TargetName>xdnup</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <TargetName>xdnup</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <TargetName>xdnup</TargetName> - </PropertyGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <Link> - <EntryPointSymbol Condition="'$(Platform)'=='win32'">_DllMainCRTStartup@12</EntryPointSymbol> - <EntryPointSymbol Condition="'$(Platform)'!='win32'">_DllMainCRTStartup</EntryPointSymbol> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'"> - <Link> - <EntryPointSymbol Condition="'$(Platform)'=='win32'">_DllMainCRTStartup@12</EntryPointSymbol> - <EntryPointSymbol Condition="'$(Platform)'!='win32'">_DllMainCRTStartup</EntryPointSymbol> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> - <Link> - <EntryPointSymbol Condition="'$(Platform)'=='win32'">_DllMainCRTStartup@12</EntryPointSymbol> - <EntryPointSymbol Condition="'$(Platform)'!='win32'">_DllMainCRTStartup</EntryPointSymbol> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <Link> - <EntryPointSymbol Condition="'$(Platform)'=='win32'">_DllMainCRTStartup@12</EntryPointSymbol> - <EntryPointSymbol Condition="'$(Platform)'!='win32'">_DllMainCRTStartup</EntryPointSymbol> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'"> - <Link> - <EntryPointSymbol Condition="'$(Platform)'=='win32'">_DllMainCRTStartup@12</EntryPointSymbol> - <EntryPointSymbol Condition="'$(Platform)'!='win32'">_DllMainCRTStartup</EntryPointSymbol> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> - <Link> - <EntryPointSymbol Condition="'$(Platform)'=='win32'">_DllMainCRTStartup@12</EntryPointSymbol> - <EntryPointSymbol Condition="'$(Platform)'!='win32'">_DllMainCRTStartup</EntryPointSymbol> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <Link> - <EntryPointSymbol Condition="'$(Platform)'=='win32'">_DllMainCRTStartup@12</EntryPointSymbol> - <EntryPointSymbol Condition="'$(Platform)'!='win32'">_DllMainCRTStartup</EntryPointSymbol> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <Link> - <EntryPointSymbol Condition="'$(Platform)'=='win32'">_DllMainCRTStartup@12</EntryPointSymbol> - <EntryPointSymbol Condition="'$(Platform)'!='win32'">_DllMainCRTStartup</EntryPointSymbol> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib</AdditionalDependencies> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib</AdditionalDependencies> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib</AdditionalDependencies> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib</AdditionalDependencies> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib</AdditionalDependencies> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib</AdditionalDependencies> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib</AdditionalDependencies> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib</AdditionalDependencies> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemGroup> - <ClCompile Include="dllentry.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="nupflt.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="nuppage.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="nupsax.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="nuptprps.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="nupxform.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ResourceCompile Include="nupflt.rc" /> - </ItemGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <Link> - <ModuleDefinitionFile>xdnup.def</ModuleDefinitionFile> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'"> - <Link> - <ModuleDefinitionFile>xdnup.def</ModuleDefinitionFile> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> - <Link> - <ModuleDefinitionFile>xdnup.def</ModuleDefinitionFile> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <Link> - <ModuleDefinitionFile>xdnup.def</ModuleDefinitionFile> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'"> - <Link> - <ModuleDefinitionFile>xdnup.def</ModuleDefinitionFile> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> - <Link> - <ModuleDefinitionFile>xdnup.def</ModuleDefinitionFile> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <Link> - <ModuleDefinitionFile>xdnup.def</ModuleDefinitionFile> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <Link> - <ModuleDefinitionFile>xdnup.def</ModuleDefinitionFile> - </Link> - </ItemDefinitionGroup> - <ItemGroup> - <ClCompile Include="precompsrc.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Create</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - </ItemGroup> - <ItemGroup> - <Inf Exclude="@(Inf)" Include="*.inf" /> - <FilesToPackage Include="$(TargetPath)" Condition="'$(ConfigurationType)'=='Driver' or '$(ConfigurationType)'=='DynamicLibrary'" /> - </ItemGroup> - <ItemGroup> - <None Exclude="@(None)" Include="*.txt;*.htm;*.html" /> - <None Exclude="@(None)" Include="*.ico;*.cur;*.bmp;*.dlg;*.rct;*.gif;*.jpg;*.jpeg;*.wav;*.jpe;*.tiff;*.tif;*.png;*.rc2" /> - <None Exclude="@(None)" Include="*.def;*.bat;*.hpj;*.asmx" /> - </ItemGroup> - <ItemGroup> - <ClInclude Exclude="@(ClInclude)" Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd" /> - </ItemGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> -</Project>
\ No newline at end of file diff --git a/print/XPSDrvSmpl/src/filters/nup/xdnup.vcxproj.Filters b/print/XPSDrvSmpl/src/filters/nup/xdnup.vcxproj.Filters deleted file mode 100644 index 5cf3c9d5..00000000 --- a/print/XPSDrvSmpl/src/filters/nup/xdnup.vcxproj.Filters +++ /dev/null @@ -1,95 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <ItemGroup> - <Filter Include="Source Files"> - <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;*</Extensions> - <UniqueIdentifier>{56E5007B-AD73-4A1E-B8F2-57AC3F2BCBB4}</UniqueIdentifier> - </Filter> - <Filter Include="Header Files"> - <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions> - <UniqueIdentifier>{C21FF91C-053E-46A7-AFD9-4F9E238380BE}</UniqueIdentifier> - </Filter> - <Filter Include="Resource Files"> - <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms;man;xml</Extensions> - <UniqueIdentifier>{B20F8D0B-1C7C-4058-9CC7-30742279D85E}</UniqueIdentifier> - </Filter> - </ItemGroup> - <ItemGroup> - <ClCompile Include="dllentry.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="nupflt.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="nuppage.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="nupsax.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="nuptprps.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="nupxform.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="precompsrc.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - </ItemGroup> - <ItemGroup> - <ResourceCompile Include="nupflt.rc"> - <Filter>Resource Files</Filter> - </ResourceCompile> - </ItemGroup> - <ItemGroup> - <ClInclude Include="nupflt.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="nuppage.h" /> - <ClInclude Include="nupsax.h" /> - <ClInclude Include="nuptprps.h" /> - <ClInclude Include="nupxform.h" /> - <ClInclude Include="nupflt.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="nuppage.h" /> - <ClInclude Include="nupsax.h" /> - <ClInclude Include="nuptprps.h" /> - <ClInclude Include="nupxform.h" /> - <ClInclude Include="nupflt.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="nuppage.h" /> - <ClInclude Include="nupsax.h" /> - <ClInclude Include="nuptprps.h" /> - <ClInclude Include="nupxform.h" /> - <ClInclude Include="nupflt.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="nuppage.h" /> - <ClInclude Include="nupsax.h" /> - <ClInclude Include="nuptprps.h" /> - <ClInclude Include="nupxform.h" /> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - </ItemGroup> - <ItemGroup> - <None Include="*.def;*.bat;*.hpj;*.asmx"> - <Filter>Source Files</Filter> - </None> - </ItemGroup> -</Project>
\ No newline at end of file diff --git a/print/XPSDrvSmpl/src/filters/precomp.h b/print/XPSDrvSmpl/src/filters/precomp.h deleted file mode 100644 index 68292995..00000000 --- a/print/XPSDrvSmpl/src/filters/precomp.h +++ /dev/null @@ -1,110 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - precomp.h - -Abstract: - - Precompiled header for all filters - ---*/ - -#pragma once - -// -// Annotate this as a usermode driver for static analysis -// -#include <DriverSpecs.h> -_Analysis_mode_(_Analysis_code_type_user_driver_) - -// -// Standard Annotation Language include -// -#include <sal.h> - -// -// Windows includes -// -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif // WIN32_LEAN_AND_MEAN -#include <windows.h> -#include <windowsx.h> - -// -// COM includes -// -#include <objbase.h> -#include <oleauto.h> - -// -// Standard library includes -// -#include <new> -#include <math.h> -#pragma warning(push) -#pragma warning(disable : 4018) -#include <vector> -#pragma warning(pop) -#include <deque> -#include <map> - -// -// ATL Includes -// -#include <atlbase.h> - -#pragma warning (push) -#pragma warning (disable:4458) -// -// GDIPlus includes -// -#include <GDIPlus.h> -#pragma warning (pop) - -// -// MSXML includes -// -#include <msxml6.h> - -// -// Filter pipeline includes -// -#include <winspool.h> -#include <filterpipeline.h> -#include <filterpipelineutil.h> -#include <prntvpt.h> - -// -// WCS Includes -// -#include <icm.h> - -// -// Windows Imaging Component -// -#include <wincodec.h> - -// -// Commonly used namespaces -// -using namespace std; -using namespace Gdiplus; - -// -// String safe includes - included last to prevent build warnings -// -#include <strsafe.h> - -#include "common.ver" - diff --git a/print/XPSDrvSmpl/src/filters/scaling/dllentry.cpp b/print/XPSDrvSmpl/src/filters/scaling/dllentry.cpp deleted file mode 100644 index 7ae94af8..00000000 --- a/print/XPSDrvSmpl/src/filters/scaling/dllentry.cpp +++ /dev/null @@ -1,144 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - dllentry.cpp - -Abstract: - - Implementation of the page scaling filter dllentry points. Dllmain only - stores the instance handle. DllGetClassObject calls on to a generic - get class factory template function. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "clasfact.h" -#include "scaleflt.h" -#include "xdexcept.h" - -/*++ - -Routine Name: - - DllMain - -Routine Description: - - Entry point to the page scaling filter which is called when a new process is started - -Arguments: - - hInst - Handle to the DLL module. - wReason - Indicates why the DLL entry-point function is being called. - -Return Value: - - TRUE - ---*/ -BOOL WINAPI -DllMain( - _In_ HINSTANCE hInst, - _In_ WORD wReason, - _In_opt_ LPVOID - ) -{ - switch (wReason) - { - case DLL_PROCESS_ATTACH: - { - g_hInstance = hInst; - } - break; - } - - return TRUE; -} - -/*++ - -Routine Name: - - DllCanUnloadNow - -Routine Description: - - Determines whether the DLL is in use. - If not, the caller can unload the DLL from memory. - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - Dll can unload - S_FALSE - Dll can't unload - ---*/ -STDAPI -DllCanUnloadNow() -{ - if (g_cServerLocks == 0) - { - return S_OK ; - } - else - { - return S_FALSE; - } -} - -/*++ - -Routine Name: - - DllGetClassObject - -Routine Description: - - Retrieves the class object for the DLL. - Called from within the CoGetClassObject function. - -Arguments: - - rclsid - CLSID that will associate the correct data and code. - riid - Reference to the identifier of the interface that the caller is to use to communicate with the class object. - ppv - Address of pointer variable that receives the interface pointer requested in riid. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - CLASS_E_CLASSNOTAVAILABLE - On unsupported class - ---*/ -STDAPI -DllGetClassObject( - _In_ REFCLSID rclsid, - _In_ REFIID riid, - _Outptr_ LPVOID FAR* ppv - ) -{ - // - // 976EDCE4-274E-482a-9773-12453BE3E7F1 - // - CLSID scalingCLSID = {0x976EDCE4, 0x274E, 0x482a, {0x97, 0x73, 0x12, 0x45, 0x3B, 0xE3, 0xE7, 0xF1}}; - - return GetFilterClassFactory<CPageScalingFilter>(rclsid, riid, scalingCLSID, ppv); -} - diff --git a/print/XPSDrvSmpl/src/filters/scaling/pagescale.cpp b/print/XPSDrvSmpl/src/filters/scaling/pagescale.cpp deleted file mode 100644 index 7a7bc160..00000000 --- a/print/XPSDrvSmpl/src/filters/scaling/pagescale.cpp +++ /dev/null @@ -1,761 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - pagescale.cpp - -Abstract: - - Page Scaling class implementation. The Page Scaling class provides - functionality required to perform page Scaling. This includes methods for converting a GDI matrix object - into the appropriate XPS matrix mark-up and intialising the matrix according to - the Page Scaling options. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "pagescale.h" - -using XDPrintSchema::PageScaling::EScaleOption; -using XDPrintSchema::PageScaling::Custom; -using XDPrintSchema::PageScaling::CustomSquare; -using XDPrintSchema::PageScaling::FitBleedToImageable; -using XDPrintSchema::PageScaling::FitContentToImageable; -using XDPrintSchema::PageScaling::FitMediaToImageable; -using XDPrintSchema::PageScaling::FitMediaToMedia; - -using XDPrintSchema::PageScaling::OffsetAlignment::EScaleOffsetOption; -using XDPrintSchema::PageScaling::OffsetAlignment::BottomCenter; -using XDPrintSchema::PageScaling::OffsetAlignment::BottomLeft; -using XDPrintSchema::PageScaling::OffsetAlignment::BottomRight; -using XDPrintSchema::PageScaling::OffsetAlignment::Center; -using XDPrintSchema::PageScaling::OffsetAlignment::LeftCenter; -using XDPrintSchema::PageScaling::OffsetAlignment::RightCenter; -using XDPrintSchema::PageScaling::OffsetAlignment::TopCenter; -using XDPrintSchema::PageScaling::OffsetAlignment::TopLeft; -using XDPrintSchema::PageScaling::OffsetAlignment::TopRight; - -/*++ - -Routine Name: - - CPageScaling::CPageScaling - -Routine Description: - - CPageScaling class constructor - -Arguments: - - pgscProps - Reference to the page scaling PrintTicket properties. - -Return Value: - - None - ---*/ -CPageScaling::CPageScaling( - _In_ CONST CPGSCPTProperties& pgscProps - ) : - m_pageDimensions(0.0f, 0.0f), - m_PGSCProps(pgscProps), - m_bAddCanvas(FALSE), - m_contentBox(0.0f, 0.0f, 0.0f, 0.0f), - m_bleedBox(0.0f, 0.0f, 0.0f, 0.0f) -{ -} - -/*++ - -Routine Name: - - CPageScaling::~CPageScaling - -Routine Description: - - CPageScaling class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CPageScaling::~CPageScaling() -{ -} - -/*++ - -Routine Name: - - CPageScaling::GetFixedPageWidth - -Routine Description: - - Creates a string containing the page width in 1/96 Inch - (Not applicable to Custom Scaling options). - -Arguments: - - pbstrWidth - Address of a pointer that will be modified to point to a string - that is filled out with the fixed page width. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPageScaling::GetFixedPageWidth( - _Outptr_ BSTR* pbstrWidth - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrWidth, E_POINTER))) - { - try - { - SizeF targetPage; - if (SUCCEEDED(hr = m_PGSCProps.GetPageSize(&targetPage))) - { - CStringXDW cstrValue; - cstrValue.Format(L"%.2f", targetPage.Width); - *pbstrWidth = cstrValue.AllocSysString(); - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPageScaling::GetFixedPageHeight - -Routine Description: - - Creates a string containing the page height in 1/96 Inch - (Not applicable to Custom Scaling options). - -Arguments: - - pbstrHeight - Address of a pointer that will be modified to point to a string - that is filled out with the fixed page height. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPageScaling::GetFixedPageHeight( - _Outptr_ BSTR* pbstrHeight - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrHeight, E_POINTER))) - { - try - { - SizeF targetPage; - if (SUCCEEDED(hr = m_PGSCProps.GetPageSize(&targetPage))) - { - CStringXDW cstrValue; - cstrValue.Format(L"%.2f", targetPage.Height); - *pbstrHeight = cstrValue.AllocSysString(); - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPageScaling::MatrixToXML - -Routine Description: - - Creates a string representation of a Matrix class object. - The string is suitable for use in XPS markup with the 'RenderTransform' keyword. - -Arguments: - - pMatrix - Pointer to a Matrix class object. - pbstrMatrixXForm - Address of a pointer that will be modified to point to a string - that is filled out with the matrix. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPageScaling::MatrixToXML( - _In_ CONST Matrix* pMatrix, - _Outptr_ BSTR* pbstrMatrixXForm - ) -{ - // - // Construct the matric mark-up from a GDI+ matrix - // - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrMatrixXForm, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pMatrix, E_POINTER))) - { - REAL matElems[6]; - if (Ok == pMatrix->GetElements(matElems)) - { - try - { - CStringXDW cstrMatrix; - cstrMatrix.Format(L"%.2f,%.2f,%.2f,%.2f,%.2f,%.2f", - matElems[0], - matElems[1], - matElems[2], - matElems[3], - matElems[4], - matElems[5]); - - *pbstrMatrixXForm = cstrMatrix.AllocSysString(); - } - catch (CXDException& e) - { - hr = e; - } - } - else - { - *pbstrMatrixXForm = NULL; - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPageScaling::SetPageDimensions - -Routine Description: - - Used to set the XPS page width and height in the page scaling interface. - -Arguments: - - width - Width of the XPS fixed page in 1/96 Inch. - height - Height of the XPS fixed page in 1/96 Inch. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPageScaling::SetPageDimensions( - _In_ CONST REAL width, - _In_ CONST REAL height - ) -{ - m_pageDimensions.Width = width; - m_pageDimensions.Height = height; - - return S_OK; -} - -/*++ - -Routine Name: - - CPageScaling::SetBleedBox - -Routine Description: - - Used to set the XPS BleedBox in the page scaling interface. - -Arguments: - - pBleedBox - pointer to a rectangle defining the BleedBox of the XPS page in 1/96 Inch. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPageScaling::SetBleedBox( - _In_ RectF* pBleedBox - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pBleedBox, E_POINTER))) - { - m_bleedBox = *pBleedBox; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPageScaling::SetContentBox - -Routine Description: - - Used to set the XPS ContentBox in the page scaling interface. - -Arguments: - - pContentBox - pointer to a rectangle defining the ContentBox of the XPS page in 1/96 Inch. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPageScaling::SetContentBox( - _In_ RectF* pContentBox - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pContentBox, E_POINTER))) - { - m_contentBox = *pContentBox; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPageScaling::CalculateMatrix - -Routine Description: - - Calculates a matrix transform from the current page scaling properties. - -Arguments: - - pMatrix - Pointer to a Matrix class object that is modified to reflect the current transform. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPageScaling::CalculateMatrix( - _Inout_ Matrix* pMatrix - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pMatrix, E_POINTER))) - { - REAL xScale = 1.0f; - REAL yScale = 1.0f; - REAL widthOffset = 0.0f; - REAL heightOffset = 0.0f; - - EScaleOption pgscOption; - - if (SUCCEEDED(hr = m_PGSCProps.GetOption(&pgscOption))) - { - switch (pgscOption) - { - case Custom: - case CustomSquare: - { - // - // The PrintTicket property handler for Custom and CustomSquare - // already handle mapping of x and y. - // - if (SUCCEEDED(hr = m_PGSCProps.GetWidthScale(&xScale)) && - SUCCEEDED(hr = m_PGSCProps.GetHeightScale(&yScale)) && - SUCCEEDED(hr = m_PGSCProps.GetWidthOffset(&widthOffset))) - { - hr = m_PGSCProps.GetHeightOffset(&heightOffset); - } - } - break; - - case FitBleedToImageable: // ImageableSize <- BleedBox - case FitContentToImageable: // ImageableSize <- ContentBox - case FitMediaToImageable: // ImageableSize <- FixedPage - case FitMediaToMedia: // Mediasize <- FixedPage - { - EScaleOffsetOption offsetOption; - - if (SUCCEEDED(hr = m_PGSCProps.GetOffsetOption(&offsetOption))) - { - RectF targetPage; - RectF sourcePage; - - switch (pgscOption) - { - case FitBleedToImageable: - { - m_PGSCProps.GetImageableRect(&targetPage); - - sourcePage = m_bleedBox; - } - break; - case FitContentToImageable: - { - m_PGSCProps.GetImageableRect(&targetPage); - - sourcePage = m_contentBox; - } - break; - case FitMediaToImageable: - { - m_PGSCProps.GetImageableRect(&targetPage); - - sourcePage = RectF(0, 0, m_pageDimensions.Width, m_pageDimensions.Height); - } - break; - case FitMediaToMedia: - { - SizeF pageSize; - m_PGSCProps.GetPageSize(&pageSize); - targetPage = RectF(0, 0, pageSize.Width, pageSize.Height); - - sourcePage = RectF(0, 0, m_pageDimensions.Width, m_pageDimensions.Height); - } - break; - } - - // - // Calculate scaling factors - // - xScale = static_cast<REAL>(targetPage.Width / sourcePage.Width); - yScale = static_cast<REAL>(targetPage.Height / sourcePage.Height); - - // - // Best Fit, always maintain aspect ratio - // Select the smallest of the two scale factors, - // This will ensure that the image always fits on the page. - // - if (xScale < yScale) - { - yScale = xScale; - } - else - { - xScale = yScale; - } - - // - // Calculate the offset to meet the offset alignment setting - // - RectF scaledPage(xScale*sourcePage.X, yScale*sourcePage.Y, xScale*sourcePage.Width, yScale*sourcePage.Height); - switch (offsetOption) - { - case BottomCenter: - { - widthOffset = (targetPage.X + (targetPage.Width/2.0f)) - (scaledPage.X + (scaledPage.Width/2.0f)); - heightOffset = (targetPage.Y + targetPage.Height) - (scaledPage.Y + scaledPage.Height); - } - break; - case BottomLeft: - { - widthOffset = targetPage.X - scaledPage.X; - heightOffset = targetPage.Y + targetPage.Height - (scaledPage.Y + scaledPage.Height); - } - break; - case BottomRight: - { - widthOffset = (targetPage.X + targetPage.Width) - (scaledPage.X + scaledPage.Width); - heightOffset = (targetPage.Y + targetPage.Height) - (scaledPage.Y + scaledPage.Height); - } - break; - case Center: - { - widthOffset = (targetPage.X + (targetPage.Width/2.0f)) - (scaledPage.X + (scaledPage.Width/2.0f)); - heightOffset = (targetPage.Y + (targetPage.Height/2.0f)) - (scaledPage.Y + (scaledPage.Height/2.0f)); - } - break; - case LeftCenter: - { - widthOffset = targetPage.X - scaledPage.X; - heightOffset = (targetPage.Y + (targetPage.Height/2.0f)) - (scaledPage.Y + (scaledPage.Height/2.0f)); - } - break; - case RightCenter: - { - widthOffset = (targetPage.X + targetPage.Width) - (scaledPage.X + scaledPage.Width); - heightOffset = (targetPage.Y + (targetPage.Height/2.0f)) - (scaledPage.Y + (scaledPage.Height/2.0f)); - } - break; - case TopCenter: - { - widthOffset = (targetPage.X + (targetPage.Width/2.0f)) - (scaledPage.X + (scaledPage.Width/2.0f)); - heightOffset = targetPage.Y - scaledPage.Y; - } - break; - default: - case TopLeft: - { - // - // Default Top Left - // - widthOffset = targetPage.X - scaledPage.X; - heightOffset = targetPage.Y - scaledPage.Y; - } - break; - case TopRight: - { - widthOffset = (targetPage.X + targetPage.Width) - (scaledPage.X + scaledPage.Width); - heightOffset = targetPage.Y - scaledPage.Y; - } - break; - } - } - } - break; - - default: - { - // - // No Scaling required. - // - } - break; - } - } - - // - // Apply the transforms to the matrix - // - Status gdiPlusStatus = pMatrix->Scale(xScale, yScale, MatrixOrderAppend); - - if (gdiPlusStatus == Ok) - { - gdiPlusStatus = pMatrix->Translate(widthOffset, heightOffset, MatrixOrderAppend); - } - - if (gdiPlusStatus != Ok) - { - hr = GetGDIStatusErrorAsHResult(gdiPlusStatus); - } - } - - ERR_ON_HR(hr); - return hr; -} - - -/*++ - -Routine Name: - - CPageScaling::CreateTransform - -Routine Description: - - Creates a string representation of the current page scaling matrix. - The string is suitable for use in XPS markup with the 'RenderTransform' keyword. - -Arguments: - - pbstrMatrixXForm - Address of a pointer that will be modified to point to a string - that is filled out with the matrix. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPageScaling::CreateTransform( - _Outptr_ BSTR* pbstrMatrixXForm - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrMatrixXForm, E_POINTER))) - { - *pbstrMatrixXForm = NULL; - - // - // Start with the identity matrix - // - - Matrix xForm; - - if (SUCCEEDED(hr = CalculateMatrix(&xForm))) - { - // - // Retrieve the matrix string - // - hr = MatrixToXML(&xForm, pbstrMatrixXForm); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPageScaling::GetOpenTagXML - -Routine Description: - - Creates a string that contains the open tag XPS markup required to - scale the page content. Page Scaling is achieved by wrapping the page content - in a canvas and applying a RenderTransform which reflects the current page scaling properties. - -Arguments: - - pbstrXML - Address of a pointer that will be modified to point to a string - that is filled out with the page scaling close tag XPS markup. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPageScaling::GetOpenTagXML( - _Outptr_ BSTR* pbstrXML - ) -{ - HRESULT hr = S_OK; - - // - // Create the Canvas with Render Transform - // - try - { - CComBSTR bstrMatrixXForm; - - if (SUCCEEDED(hr = CreateTransform(&bstrMatrixXForm))) - { - CStringXDW cstrCanvas; - cstrCanvas.Format(L"<Canvas RenderTransform=\"%s\"", static_cast<LPCWSTR>(bstrMatrixXForm)); - *pbstrXML = cstrCanvas.AllocSysString(); - } - } - catch (CXDException& e) - { - hr = e; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPageScaling::GetCloseTagXML - -Routine Description: - - Creates a string that contains the close tag XPS markup. - This is achived by closing the canvas tag. - -Arguments: - - pbstrXML - Address of a pointer that will be modified to point to a string - that is filled out with the page scaling close tag XPS markup. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPageScaling::GetCloseTagXML( - _Outptr_ BSTR* pbstrXML - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrXML, E_POINTER))) - { - try - { - CStringXDW cstrCanvas(L"</Canvas>\n"); - *pbstrXML = cstrCanvas.AllocSysString(); - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/scaling/pagescale.h b/print/XPSDrvSmpl/src/filters/scaling/pagescale.h deleted file mode 100644 index 51f9be89..00000000 --- a/print/XPSDrvSmpl/src/filters/scaling/pagescale.h +++ /dev/null @@ -1,107 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - scalepage.h - -Abstract: - - Page Scaling class implementation. The Page Scaling class provides - functionality required to generate the XPS markup to perform page scaling. - This includes methods for converting a GDI matrix object - into the appropriate XPS matrix mark-up and intialising the matrix according to - the Page Scaling options. - ---*/ - -#pragma once - -#include "pgscptprop.h" - -class CPageScaling -{ -public: - CPageScaling( - _In_ CONST CPGSCPTProperties& psProps - ); - - virtual ~CPageScaling(); - - HRESULT - GetFixedPageWidth( - _Outptr_ BSTR* pbstrWidth - ); - - HRESULT - GetFixedPageHeight( - _Outptr_ BSTR* pbstrHeight - ); - - HRESULT - GetOpenTagXML( - _Outptr_ BSTR* pbstrXML - ); - - HRESULT - GetCloseTagXML( - _Outptr_ BSTR* pbstrXML - ); - - HRESULT - SetPageDimensions( - _In_ CONST REAL width, - _In_ CONST REAL height - ); - - HRESULT - SetBleedBox( - _In_ RectF* pBleedBox - ); - - HRESULT - SetContentBox( - _In_ RectF* pContentBox - ); - -private: - HRESULT - CreateTransform( - _Outptr_ BSTR* pbstrMatrixXForm - ); - - HRESULT - CalculateMatrix( - _Inout_ Matrix* pMatrix - ); - - HRESULT - MatrixToXML( - _In_ CONST Matrix* pMatrix, - _Outptr_ BSTR* pbstrMatrixXForm - ); - -private: - CComPtr<IXMLDOMDocument2> m_pDOMDoc; - - CComPtr<IXMLDOMElement> m_pCanvasElem; - - CPGSCPTProperties m_PGSCProps; - - RectF m_bleedBox; - - RectF m_contentBox; - - SizeF m_pageDimensions; - - BOOL m_bAddCanvas; -}; - diff --git a/print/XPSDrvSmpl/src/filters/scaling/pgscptprop.cpp b/print/XPSDrvSmpl/src/filters/scaling/pgscptprop.cpp deleted file mode 100644 index 9f771658..00000000 --- a/print/XPSDrvSmpl/src/filters/scaling/pgscptprop.cpp +++ /dev/null @@ -1,478 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - pgscptprop.cpp - -Abstract: - - Page Scaling properties class implementation. The Page Scaling properties class - is responsible for holding and controling Page Scaling properties. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "pgscptprop.h" - -using XDPrintSchema::PageScaling::PageScalingData; -using XDPrintSchema::PageScaling::EScaleOption; -using XDPrintSchema::PageScaling::OffsetAlignment::EScaleOffsetOption; - -using XDPrintSchema::PageOrientation::PageOrientationData; -using XDPrintSchema::PageOrientation::Landscape; -using XDPrintSchema::PageOrientation::ReverseLandscape; - -using XDPrintSchema::PageMediaSize::PageMediaSizeData; - -using XDPrintSchema::PageImageableSize::PageImageableData; - -/*++ - -Routine Name: - - CPGSCPTProperties::CPGSCPTProperties - -Routine Description: - - CPGSCPTProperties class constructor - -Arguments: - - pgscData - reference to the Page Scaling data. - pSizeData - reference to the Page Size data. - pImageableData - reference to the Page Imageable Size data. - -Return Value: - - None - ---*/ -CPGSCPTProperties::CPGSCPTProperties( - _In_ CONST PageScalingData& pgscData, - _In_ CONST PageMediaSizeData& pSizeData, - _In_ CONST PageImageableData& pImageableData, - _In_ CONST PageOrientationData& pageOrientData - ) : - m_pgscData(pgscData), - m_pageMediaSizeData(pSizeData), - m_pageImageableData(pImageableData), - m_pageOrientData(pageOrientData) -{ -} - -/*++ - -Routine Name: - - CPGSCPTProperties::~CPGSCPTProperties - -Routine Description: - - CPGSCPTProperties class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CPGSCPTProperties::~CPGSCPTProperties() -{ -} - -/*++ - -Routine Name: - - CPGSCPTProperties::GetOption - -Routine Description: - - Used to obtain the current page scaling option. - -Arguments: - - pOption - Pointer to the page scaling option to filled out. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPGSCPTProperties::GetOption( - _Out_ EScaleOption* pOption - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pOption, E_POINTER))) - { - *pOption = m_pgscData.pgscOption; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPGSCPTProperties::GetOffsetOption - -Routine Description: - - Used to obtain the current page scaling offset option. - -Arguments: - - pOffsetOption - Pointer to the page scaling offset option to filled out. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPGSCPTProperties::GetOffsetOption( - _Out_ EScaleOffsetOption* pOffsetOption - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pOffsetOption, E_POINTER))) - { - *pOffsetOption = m_pgscData.offsetOption; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPGSCPTProperties::GetWidthOffset - -Routine Description: - - Used to obtain the current width offset (Only applies to the custom scaling options). - Units are in 1/96 Inch. - -Arguments: - - pWidthOffset - Pointer to the width offset data to be filled out. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPGSCPTProperties::GetWidthOffset( - _Out_ REAL* pWidthOffset - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pWidthOffset, E_POINTER))) - { - *pWidthOffset = static_cast<REAL>(m_pgscData.offWidth)/k96thInchAsMicrons; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPGSCPTProperties::GetHeightOffset - -Routine Description: - - Used to obtain the current height offset (Only applies to the custom scaling options). - Units are in 1/96 Inch. - -Arguments: - - pHeightOffset - Pointer to the height offset data to be filled out. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPGSCPTProperties::GetHeightOffset( - _Out_ REAL* pHeightOffset - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pHeightOffset, E_POINTER))) - { - *pHeightOffset = static_cast<REAL>(m_pgscData.offHeight)/k96thInchAsMicrons; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPGSCPTProperties::GetWidthScale - -Routine Description: - - Used to obtain the current width scale percentage - (Only applies to the custom scaling options). - -Arguments: - - pWidthScale - Pointer to the width scale data to be filled out. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPGSCPTProperties::GetWidthScale( - _Out_ REAL* pWidthScale - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pWidthScale, E_POINTER))) - { - *pWidthScale = static_cast<REAL>(m_pgscData.scaleWidth)/100.00f; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPGSCPTProperties::GetHeightScale - -Routine Description: - - Used to obtain the current height scale percentage - (Only applies to the custom scaling options). - -Arguments: - - pHeightScale - Pointer to the height scale data to be filled out. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPGSCPTProperties::GetHeightScale( - _Out_ REAL* pHeightScale - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pHeightScale, E_POINTER))) - { - *pHeightScale = static_cast<REAL>(m_pgscData.scaleHeight)/100.00f; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPGSCPTProperties::GetPageSize - -Routine Description: - - Used to obtain the current page size. Units are in 1/96 Inch. - - Note: This returns the page dimensions accounting for the orientation and media size - expressed by the PrintTicket as PageOrientation and PageMediaSize. The PageMediaSize - expresses the dimensions using the convention that the page is oriented as portrait. - To get the dimensions for scaling we need to swap width for height when in landscape - so that we can scale the FixedPage content appropriately. - -Arguments: - - pSizePage - Pointer to the page size data to be filled out. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPGSCPTProperties::GetPageSize( - _Out_ SizeF* pSizePage - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pSizePage, E_POINTER))) - { - // - // Convert microns to 96th of an inch - // - pSizePage->Width = static_cast<REAL>(m_pageMediaSizeData.pageWidth)/k96thInchAsMicrons; - pSizePage->Height = static_cast<REAL>(m_pageMediaSizeData.pageHeight)/k96thInchAsMicrons; - - // - // Swap dimensions if the orientation is a landscape orientation - // - if (m_pageOrientData.orientation == Landscape || - m_pageOrientData.orientation == ReverseLandscape) - { - REAL sizeSwap = pSizePage->Width; - pSizePage->Width = pSizePage->Height; - pSizePage->Height = sizeSwap; - } - - if (pSizePage->Width <= 0.0f || - pSizePage->Height <= 0.0f) - { - // - // The page media size is incorrect - // - ERR("Could not acquire a valid media page size\n"); - - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPGSCPTProperties::GetImageableRect - -Routine Description: - - Used to obtain the current page imageable area and offset. - Units are in 1/96 Inch. - -Arguments: - - pImageableRect - Pointer to the page imageable data to be filled out. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPGSCPTProperties::GetImageableRect( - _Out_ RectF* pImageableRect - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pImageableRect, E_POINTER))) - { - pImageableRect->X = 0; - pImageableRect->Y = 0; - pImageableRect->Width = 0; - pImageableRect->Height = 0; - - // - // Get the size of the area - convert microns to 96th of an inch - // - SizeF sizeImage; - if (m_pageImageableData.imageableSizeWidth > 0 && - m_pageImageableData.imageableSizeHeight > 0) - { - sizeImage.Width = static_cast<REAL>(m_pageImageableData.imageableSizeWidth)/k96thInchAsMicrons; - sizeImage.Height = static_cast<REAL>(m_pageImageableData.imageableSizeHeight)/k96thInchAsMicrons; - } - else - { - // - // Page imageable size was not set - use the page media size - // - sizeImage.Width = static_cast<REAL>(m_pageMediaSizeData.pageWidth)/k96thInchAsMicrons; - sizeImage.Height = static_cast<REAL>(m_pageMediaSizeData.pageHeight)/k96thInchAsMicrons; - } - - // - // Get the offset of the area - convert microns to 96th of an inch - // - PointF offsetImage(static_cast<REAL>(m_pageImageableData.originWidth)/k96thInchAsMicrons, - static_cast<REAL>(m_pageImageableData.originHeight)/k96thInchAsMicrons); - - // - // Swap dimensions if the orientation is a landscape orientation - // - if (m_pageOrientData.orientation == Landscape || - m_pageOrientData.orientation == ReverseLandscape) - { - pImageableRect->Width = sizeImage.Height; - pImageableRect->Height = sizeImage.Width; - - pImageableRect->X = offsetImage.Y; - pImageableRect->Y = offsetImage.X; - } - else - { - pImageableRect->Width = sizeImage.Width; - pImageableRect->Height = sizeImage.Height; - - pImageableRect->X = offsetImage.X; - pImageableRect->Y = offsetImage.Y; - } - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/scaling/pgscptprop.h b/print/XPSDrvSmpl/src/filters/scaling/pgscptprop.h deleted file mode 100644 index 99cb5328..00000000 --- a/print/XPSDrvSmpl/src/filters/scaling/pgscptprop.h +++ /dev/null @@ -1,91 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - pgscptprop.h - -Abstract: - - Page Scaling properties class definition. The Page Scaling properties class - is responsible for holding and controling Page Scaling properties. - ---*/ - -#pragma once - -#include "pgscdata.h" -#include "psizedata.h" -#include "pimagedata.h" -#include "porientdata.h" - -class CPGSCPTProperties -{ -public: - CPGSCPTProperties( - _In_ CONST XDPrintSchema::PageScaling::PageScalingData& pgscData, - _In_ CONST XDPrintSchema::PageMediaSize::PageMediaSizeData& psizeData, - _In_ CONST XDPrintSchema::PageImageableSize::PageImageableData& pimageableData, - _In_ CONST XDPrintSchema::PageOrientation::PageOrientationData& pageOrientData - ); - - virtual ~CPGSCPTProperties(); - - HRESULT - GetOption( - _Out_ XDPrintSchema::PageScaling::EScaleOption* pScaleOption - ); - - HRESULT - GetWidthOffset( - _Out_ REAL* pWidthOffset - ); - - HRESULT - GetHeightOffset( - _Out_ REAL* pHeightOffset - ); - - HRESULT - GetWidthScale( - _Out_ REAL* pWidthScale - ); - - HRESULT - GetHeightScale( - _Out_ REAL* pHeightScale - ); - - HRESULT - GetOffsetOption( - _Out_ XDPrintSchema::PageScaling::OffsetAlignment::EScaleOffsetOption* pOffsetOption - ); - - HRESULT - GetPageSize( - _Out_ SizeF* pSizePage - ); - - HRESULT - GetImageableRect( - _Out_ RectF* pImageableRect - ); - -protected: - XDPrintSchema::PageScaling::PageScalingData m_pgscData; - - XDPrintSchema::PageMediaSize::PageMediaSizeData m_pageMediaSizeData; - - XDPrintSchema::PageImageableSize::PageImageableData m_pageImageableData; - - XDPrintSchema::PageOrientation::PageOrientationData m_pageOrientData; -}; - diff --git a/print/XPSDrvSmpl/src/filters/scaling/precompsrc.cpp b/print/XPSDrvSmpl/src/filters/scaling/precompsrc.cpp deleted file mode 100644 index 5944cf51..00000000 --- a/print/XPSDrvSmpl/src/filters/scaling/precompsrc.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "precomp.h"
\ No newline at end of file diff --git a/print/XPSDrvSmpl/src/filters/scaling/scaleflt.cpp b/print/XPSDrvSmpl/src/filters/scaling/scaleflt.cpp deleted file mode 100644 index 1827a9a2..00000000 --- a/print/XPSDrvSmpl/src/filters/scaling/scaleflt.cpp +++ /dev/null @@ -1,253 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - scaleflt.cpp - -Abstract: - - Page Scaling filter implementation. This class derives from the Xps filter - class and implements the necessary part handlers to support Page Scaling - printing. The Page Scaling filter is responsible for modifying the XPS document - to add the appropriate mark-up onto pages to achieve scaling. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "scaleflt.h" -#include "pagescale.h" -#include "scalesax.h" -#include "psizepthndlr.h" -#include "pimagepthndlr.h" -#include "pgscpthndlr.h" -#include "porientpthndlr.h" - -using XDPrintSchema::PageScaling::PageScalingData; -using XDPrintSchema::PageMediaSize::PageMediaSizeData; -using XDPrintSchema::PageImageableSize::PageImageableData; -using XDPrintSchema::PageOrientation::PageOrientationData; - -/*++ - -Routine Name: - - CPageScalingFilter::CPageScalingFilter - -Routine Description: - - CPageScalingFilter class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CPageScalingFilter::CPageScalingFilter() -{ - ASSERTMSG(m_gdiPlus.GetGDIPlusStartStatus() == Ok, "GDI plus is not correctly initialized.\n"); -} - -/*++ - -Routine Name: - - CPageScalingFilter::~CPageScalingFilter - -Routine Description: - - CPageScalingFilter class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CPageScalingFilter::~CPageScalingFilter() -{ -} - -/*++ - -Routine Name: - - CPageScalingFilter::ProcessFixedPage - -Routine Description: - - This method processes the XPS content of a page applying - any scaling required according to information in the PrintTicket. - The result is written out to a new XPS document. - -Arguments: - - pPrintTicket - Pointer to the XML PrintTicket Document that is associated with the page. - pPageReadStream - Pointer to the input stream interface for the XPS Page. - pPageWriteStream - Pointer to the output stream interface for the XPS Page. - -Return Value: - - HRESULT - S_OK - On success - HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED) - When the fixed page is not to be modified - E_* - On error - ---*/ -HRESULT -CPageScalingFilter::ProcessFixedPage( - _In_ IXMLDOMDocument2* pFPPT, - _In_ ISequentialStream* pPageReadStream, - _In_ ISequentialStream* pPageWriteStream - ) -{ - VERBOSE("Processing stream fixed page with page scaling handler\n"); - - HRESULT hr = S_OK; - - CPageScaling* pPageScaling = NULL; - CComPtr<ISAXXMLReader> pSaxRdr(NULL); - CComPtr<IXMLDOMDocument2> pPrintCapabilities(NULL); - - if (SUCCEEDED(hr = m_ptManager.GetCapabilities(pFPPT, &pPrintCapabilities)) && - SUCCEEDED(hr = CHECK_POINTER(pFPPT, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pPageReadStream, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pPageWriteStream, E_POINTER)) && - SUCCEEDED(hr = GetPageScaling(pFPPT, pPrintCapabilities, &pPageScaling)) && - SUCCEEDED(hr = pSaxRdr.CoCreateInstance(CLSID_SAXXMLReader60))) - { - // - // Set-up the SAX reader and begin parsing the mark-up - // - CScaleSaxHandler scaleSaxHndlr(pPageWriteStream, pPageScaling); - - if (SUCCEEDED(hr = pSaxRdr->putContentHandler(&scaleSaxHndlr))) - { - hr = pSaxRdr->parse(CComVariant(pPageReadStream)); - } - } - else if (hr == E_ELEMENT_NOT_FOUND) - { - // - // No Page Scaling was found in the PrintTicket - return error not supported so - // the xps container sends the unmodified data - // - hr = HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED); - } - - // - // Clean up the Page Scaling if it was successfully created - // - if (pPageScaling != NULL) - { - delete pPageScaling; - pPageScaling = NULL; - } - - ERR_ON_HR_EXC(hr, HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED)); - return hr; -} - -/*++ - -Routine Name: - - CPageScalingFilter::GetPageScaling - -Routine Description: - - Creates and initialises an instance of the Page Scaling Interface - using the information in the PrintTicket provided. - -Arguments: - - pPrintTicket - Pointer to an XML PrintTicket Document. - pPrintCapabilities - Pointer to an XML PrintCapabilities Document. - ppPageScaling - Address of pointer that receives the Page Scaling Interface. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPageScalingFilter::GetPageScaling( - _In_ IXMLDOMDocument2* pPrintTicket, - _In_ IXMLDOMDocument2* pPrintCapabilities, - _Outptr_ CPageScaling** ppPageScaling - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppPageScaling, E_POINTER))) - { - *ppPageScaling = NULL; - - try - { - CPageScalingPTHandler pgscPTHandler(pPrintTicket); - CPageImageablePCHandler imagePCHandler(pPrintCapabilities); - CPageSizePTHandler sizePTHandler(pPrintTicket); - CPageOrientationPTHandler orientPTHandler(pPrintTicket); - - PageScalingData pgscData; - PageMediaSizeData sizeData; - PageImageableData imageData; - PageOrientationData orientData; - - if (SUCCEEDED(hr = pgscPTHandler.GetData(&pgscData)) && - SUCCEEDED(hr = sizePTHandler.GetData(&sizeData)) && - SUCCEEDED(hr = orientPTHandler.GetData(&orientData))) - { - hr = imagePCHandler.GetData(&imageData); - - // - // The imageable area property in a PrintTicket is an optional requirement. - // - if (hr == E_ELEMENT_NOT_FOUND) - { - hr = S_OK; - } - - if (SUCCEEDED(hr)) - { - CPGSCPTProperties pgscProperties(pgscData, sizeData, imageData, orientData); - - *ppPageScaling = new(std::nothrow) CPageScaling(pgscProperties); - - if (*ppPageScaling == NULL) - { - hr = E_OUTOFMEMORY; - } - } - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR_EXC(hr, E_ELEMENT_NOT_FOUND); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/scaling/scaleflt.h b/print/XPSDrvSmpl/src/filters/scaling/scaleflt.h deleted file mode 100644 index 2e8307c0..00000000 --- a/print/XPSDrvSmpl/src/filters/scaling/scaleflt.h +++ /dev/null @@ -1,56 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - scaleflt.h - -Abstract: - - Page Scaling filter defnition. This class derives from the Xps filter - class and implements the necessary part handlers to support Page Scaling. - The Page Scaling filter is responsible for adding mark-up to - the XPS document to allow scaling of pages. - ---*/ - -#pragma once - -#include "xdstrmflt.h" -#include "pagescale.h" -#include "gdip.h" - -class CPageScalingFilter : public CXDStreamFilter -{ -public: - CPageScalingFilter(); - - virtual ~CPageScalingFilter(); - - virtual HRESULT - ProcessFixedPage( - _In_ IXMLDOMDocument2* pFPPT, - _In_ ISequentialStream* pPageReadStream, - _In_ ISequentialStream* pPageWriteStream - ); - -private: - HRESULT - GetPageScaling( - _In_ IXMLDOMDocument2* pPrintTicket, - _In_ IXMLDOMDocument2* pPrintCapabilities, - _Outptr_ CPageScaling** ppPageScaling - ); - -private: - GDIPlus m_gdiPlus; -}; - diff --git a/print/XPSDrvSmpl/src/filters/scaling/scaleflt.rc b/print/XPSDrvSmpl/src/filters/scaling/scaleflt.rc deleted file mode 100644 index 677e6c0a..00000000 --- a/print/XPSDrvSmpl/src/filters/scaling/scaleflt.rc +++ /dev/null @@ -1,43 +0,0 @@ -// -// Copyright (c) 2005 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. -// -// File Name: -// -// scaleflt.rc -// -// Abstract: -// -// Page Scaling filter resource file. -// -// - -#include <winres.h> -#include <ntverp.h> - -#define VER_FILETYPE VFT_DLL -#define VER_FILESUBTYPE VFT2_UNKNOWN -#define VER_FILEDESCRIPTION_STR "XPSDrv Sample Scaling Filter" -#define VER_INTERNALNAME_STR "PrintFeatureFilters" - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -#endif // English (U.S.) resources - -///////////////////////////////////////////////////////////////////////////// - -#include "common.ver" - diff --git a/print/XPSDrvSmpl/src/filters/scaling/scalesax.cpp b/print/XPSDrvSmpl/src/filters/scaling/scalesax.cpp deleted file mode 100644 index 43219976..00000000 --- a/print/XPSDrvSmpl/src/filters/scaling/scalesax.cpp +++ /dev/null @@ -1,591 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - scalesax.xpp - -Abstract: - - Page Scaling SAX handler implementation. The class derives from the default SAX handler - and implements only the necessary SAX APIs to process the mark-up. The - handler is responsible for copying page mark-up to a writer, removing - the fixed page opening and closing tags. - -Known Issues: - - Need to check if all resources are required resources are being added to the - resource copying class. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "scalesax.h" - -/*++ - -Routine Name: - - CScaleSaxHandler::CScaleSaxHandler - -Routine Description: - - CScaleSaxHandler class constructor - -Arguments: - - pWriter - Pointer to the output stream interface for the XPS page markup. - pPageScaling - Pointer to the Page Scaling Interface. - -Return Value: - - None - Throws CXDException(HRESULT) on an error - ---*/ -CScaleSaxHandler::CScaleSaxHandler( - _In_ ISequentialStream* pWriter, - _In_ CPageScaling* pPageScaling - ) : - m_pWriter(pWriter), - m_pPageScaling(pPageScaling), - m_bOpenTag(FALSE) -{ - ASSERTMSG(m_pWriter != NULL, "NULL writer passed to page scaling SAX handler.\n"); - ASSERTMSG(m_pPageScaling != NULL, "NULL page scaling class passed to page scaling SAX handler.\n"); - - HRESULT hr = S_OK; - if (FAILED(hr = CHECK_POINTER(m_pWriter, E_POINTER)) || - FAILED(hr = CHECK_POINTER(m_pPageScaling, E_POINTER))) - { - throw CXDException(hr); - } -} - -/*++ - -Routine Name: - - CScaleSaxHandler::~CScaleSaxHandler - -Routine Description: - - CScaleSaxHandler class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CScaleSaxHandler::~CScaleSaxHandler() -{ - m_bstrOpenElement.Empty(); -} - -/*++ - -Routine Name: - - CScaleSaxHandler::startElement - -Routine Description: - - Receives notification of the beginning of an XML element in the XPS page. - The page scaling filter parses each element, applies any changes - and writes out the resultant XPS markup. - -Arguments: - - pwchQName - The XML 1.0 qualified name (QName), with prefix, or an empty string - (if QNames are not available). - cchQName - The length of the QName. - pAttributes - The attributes attached to the element. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT STDMETHODCALLTYPE -CScaleSaxHandler::startElement( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - _In_reads_(cchQName) CONST wchar_t* pwchQName, - _In_ INT cchQName, - _In_ ISAXAttributes* pAttributes - ) -{ - HRESULT hr = S_OK; - CStringXDW cstrOut; - - // - // If this is the fixed page we need the width and height retrieved - // - BOOL bIsFixedPage = FALSE; - - try - { - CComBSTR bstrElement(cchQName, pwchQName); - - bIsFixedPage = (bstrElement == L"FixedPage"); - - // - // Check if we need to close an opened tag - // - if (m_bOpenTag) - { - cstrOut.Append(L">\n"); - } - - // - // Store the opened element name so we can handle nested elements - // - m_bstrOpenElement = bstrElement; - } - catch (CXDException& e) - { - hr = e; - } - - if (SUCCEEDED(hr)) - { - // - // Write out element - // - try - { - cstrOut.Append(L"<"); - cstrOut.Append(m_bstrOpenElement); - } - catch (CXDException& e) - { - hr = e; - } - - // - // We opened a tag - // - m_bOpenTag = TRUE; - - REAL widthPage(0.0f); - REAL heightPage(0.0f); - RectF bleedBox(0.0f, 0.0f, 0.0f, 0.0f); - RectF contentBox(0.0f, 0.0f, 0.0f, 0.0f); - - BOOL bBleedBoxSet = FALSE; - BOOL bContentBoxSet = FALSE; - - // - // Find the number of attributes and enumerate over all of them - // - INT cAttributes = 0; - if (SUCCEEDED(hr) && - SUCCEEDED(hr = pAttributes->getLength(&cAttributes))) - { - for (INT cIndex = 0; cIndex < cAttributes && SUCCEEDED(hr); cIndex++) - { - PCWSTR pszAttUri = NULL; - INT cchAttUri = 0; - PCWSTR pszAttName = NULL; - INT cchAttName = 0; - PCWSTR pszAttQName = NULL; - INT cchAttQName = 0; - PCWSTR pszAttValue = NULL; - INT cchAttValue = 0; - - // - // Get the attribute data ready to write out - // - if (SUCCEEDED(hr = pAttributes->getName(cIndex, - &pszAttUri, - &cchAttUri, - &pszAttName, - &cchAttName, - &pszAttQName, - &cchAttQName))) - { - if (SUCCEEDED(pAttributes->getValue(cIndex, &pszAttValue, &cchAttValue))) - { - try - { - CComBSTR bstrAttName(cchAttQName, pszAttQName); - CComBSTR bstrAttValue(cchAttValue, pszAttValue); - - // - // If this is the fixed page we want to retrieve the - // dimensions of the fixed page - take the opportunity - // to do so now while we parse the attributes - // - if (bIsFixedPage) - { - if (bstrAttName == L"Width") - { - widthPage = static_cast<REAL>(_wtof(bstrAttValue)); - } - else if (bstrAttName == L"Height") - { - heightPage = static_cast<REAL>(_wtof(bstrAttValue)); - } - else if (bstrAttName == L"ContentBox") - { - CStringXDW str( bstrAttValue ); - CStringXDW resToken; - INT curPos= 0; - bContentBoxSet = TRUE; - - resToken = str.Tokenize(L",",curPos); - - if (resToken != L"") - { - contentBox.X = static_cast<REAL>(_wtof(resToken)); - } - - resToken = str.Tokenize(L",",curPos); - - if (resToken != L"") - { - contentBox.Y = static_cast<REAL>(_wtof(resToken)); - } - - resToken = str.Tokenize(L",",curPos); - - if (resToken != L"") - { - contentBox.Width = static_cast<REAL>(_wtof(resToken)); - } - - resToken = str.Tokenize(L",",curPos); - - if (resToken != L"") - { - contentBox.Height = static_cast<REAL>(_wtof(resToken)); - } - } - else if (bstrAttName == L"BleedBox") - { - CStringXDW str( bstrAttValue ); - CStringXDW resToken; - INT curPos= 0; - bBleedBoxSet = TRUE; - - resToken = str.Tokenize(L",",curPos); - - if (resToken != "") - { - bleedBox.X = static_cast<REAL>(_wtof(resToken)); - } - - resToken = str.Tokenize(L",",curPos); - - if (resToken != "") - { - bleedBox.Y = static_cast<REAL>(_wtof(resToken)); - } - - resToken = str.Tokenize(L",",curPos); - - if (resToken != "") - { - bleedBox.Width = static_cast<REAL>(_wtof(resToken)); - } - - resToken = str.Tokenize(L",",curPos); - - if (resToken != "") - { - bleedBox.Height = static_cast<REAL>(_wtof(resToken)); - } - } - } - - // - // As we are applying scaling we need to remove the bleedBox and contentBox - // - if (bstrAttName != L"BleedBox" && - bstrAttName != L"ContentBox") - { - // - // Replace the Width and Height aValues with the target papersize - // - if (bstrAttName == L"Width") - { - CComBSTR bstrWidthValue; - if (SUCCEEDED(hr = m_pPageScaling->GetFixedPageWidth(&bstrWidthValue))) - { - if (bstrWidthValue.Length() > 0) - { - bstrAttValue = bstrWidthValue; - } - } - } - else if (bstrAttName == L"Height") - { - CComBSTR bstrHeightValue; - if (SUCCEEDED(hr = m_pPageScaling->GetFixedPageHeight(&bstrHeightValue))) - { - if (bstrHeightValue.Length() > 0) - { - bstrAttValue = bstrHeightValue; - } - } - } - - if (SUCCEEDED(hr)) - { - // - // Delimit attributes with a space - // - cstrOut.Append(L" "); - - // - // Reconstruct the attribute and write back to - // the fixed page - // - cstrOut.Append(bstrAttName); - cstrOut.Append(L"=\""); - - // - // If this is a UnicodeString we may need to escape entities - // - if (bstrAttName == L"UnicodeString") - { - hr = EscapeEntity(&bstrAttValue); - } - - cstrOut.Append(bstrAttValue); - cstrOut.Append(L"\""); - } - } - } - catch (CXDException& e) - { - hr = e; - } - } - } - } - } - - // - // If bleedbox hasn't been set, set it to the page dimensions - // - if (bBleedBoxSet == FALSE) - { - bleedBox.Width = widthPage; - bleedBox.Height = heightPage; - } - - // - // If contentbox hasn't been set, set it to the page dimensions - // - if (bContentBoxSet == FALSE) - { - contentBox.Width = widthPage; - contentBox.Height = heightPage; - } - - if (SUCCEEDED(hr = m_pPageScaling->SetPageDimensions(widthPage, heightPage)) && - SUCCEEDED(hr = m_pPageScaling->SetBleedBox(&bleedBox)) && - SUCCEEDED(hr = m_pPageScaling->SetContentBox(&contentBox))) - { - if (bIsFixedPage) - { - try - { - // - // Close the fixed page tag - // - cstrOut.Append(L">"); - - // - // Create and retrieve the markup for the Canvas - // - CComBSTR bstrCanvasText; - if (SUCCEEDED(hr = m_pPageScaling->GetOpenTagXML(&bstrCanvasText))) - { - // - // Insert the mark-up by writing after the opening fixed page - // remembering to close the tag first - // - cstrOut.Append(bstrCanvasText); - } - } - catch (CXDException& e) - { - hr = e; - } - } - } - - if (SUCCEEDED(hr)) - { - hr = WriteToPrintStream(&cstrOut, m_pWriter); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CScaleSaxHandler::endElement - -Routine Description: - - Receives notification of the end of an XML element in the XPS page. - The page scaling filter parses each element, applies any changes - and writes out the resultant XPS markup. - - A corresponding startElement method is invoked for every endElement method, even when the element is empty. - -Arguments: - - pwchQName - The XML 1.0 qualified name (QName), with prefix, or an empty string - (if QNames are not available). - cchQName - The length of the QName. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT STDMETHODCALLTYPE -CScaleSaxHandler::endElement( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - _In_reads_(cchQName) CONST wchar_t* pwchQName, - _In_ INT cchQName - ) -{ - HRESULT hr = S_OK; - CStringXDW cstrClose; - BOOL bIsFixedPage = FALSE; - - try - { - CComBSTR bstrElement(cchQName, pwchQName); - - bIsFixedPage = (bstrElement == L"FixedPage"); - - // - // If this is a root element with child nodes, the open - // element will not match the last startElement. In this case - // we need to add an appropriate closing tag - // - if (bstrElement == m_bstrOpenElement) - { - // - // Names match so just add a closing bracket - // - if (m_bOpenTag) - { - cstrClose.Append(L"/>\n"); - } - } - else - { - // - // Close Canvas if previously opened. - // - if (bIsFixedPage) - { - // - // Insert the closing canvas mark-up before closing the fixed page - // - CComBSTR bstrCloseCanvasText; - if (SUCCEEDED(hr = m_pPageScaling->GetCloseTagXML(&bstrCloseCanvasText))) - { - cstrClose.Append(bstrCloseCanvasText); - } - } - - // - // Add a full closing tag - // - cstrClose.Append(L"</"); - cstrClose.Append(bstrElement); - cstrClose.Append(L">\n"); - } - - m_bOpenTag = FALSE; - } - catch (CXDException& e) - { - hr = e; - } - - if (SUCCEEDED(hr)) - { - hr = WriteToPrintStream(&cstrClose, m_pWriter); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CScaleSaxHandler::startDocument - -Routine Description: - - This method writes out the header markup for the XPS page. - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT STDMETHODCALLTYPE -CScaleSaxHandler::startDocument() -{ - HRESULT hr = S_OK; - - try - { - CStringXDW cstrXMLVersion(L"<?xml version=\"1.0\" encoding=\"utf-8\"?>"); - hr = WriteToPrintStream(&cstrXMLVersion, m_pWriter); - } - catch (CXDException& e) - { - hr = e; - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/scaling/scalesax.h b/print/XPSDrvSmpl/src/filters/scaling/scalesax.h deleted file mode 100644 index 2e10e971..00000000 --- a/print/XPSDrvSmpl/src/filters/scaling/scalesax.h +++ /dev/null @@ -1,75 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - scalesax.h - -Abstract: - - Page Scaling SAX handler definition. The class derives from the default SAX handler - and implements only the necessary SAX APIs to process the mark-up. The - handler is responsible for copying page mark-up to a writer, removing - the fixed page opening and closing tags. - ---*/ - -#pragma once - -#include "saxhndlr.h" -#include "pagescale.h" - -class CScaleSaxHandler : public CSaxHandler -{ -public: - CScaleSaxHandler( - _In_ ISequentialStream* pWriter, - _In_ CPageScaling* pPageScaling - ); - - virtual ~CScaleSaxHandler(); - - virtual HRESULT STDMETHODCALLTYPE - startDocument( - void - ); - - virtual HRESULT STDMETHODCALLTYPE - startElement( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - _In_reads_(cchQName) CONST wchar_t* pwchQName, - _In_ INT cchQName, - _In_ ISAXAttributes* pAttributes - ); - - virtual HRESULT STDMETHODCALLTYPE - endElement( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - _In_reads_(cchQName) CONST wchar_t* pwchQName, - _In_ INT cchQName - ); - -private: - CComPtr<ISequentialStream> m_pWriter; - - CComBSTR m_bstrOpenElement; - - BOOL m_bOpenTag; - - CPageScaling* m_pPageScaling; -}; - diff --git a/print/XPSDrvSmpl/src/filters/scaling/xdscale.def b/print/XPSDrvSmpl/src/filters/scaling/xdscale.def deleted file mode 100644 index 82d0a024..00000000 --- a/print/XPSDrvSmpl/src/filters/scaling/xdscale.def +++ /dev/null @@ -1,26 +0,0 @@ -; -; Copyright (c) 2005 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. -; -; File Name: -; -; xdscale.def -; -; Abstract: -; -; Page Scaling filter module definition file -; - -LIBRARY XDScale - -EXPORTS - DllMain - DllCanUnloadNow PRIVATE - DllGetClassObject PRIVATE - diff --git a/print/XPSDrvSmpl/src/filters/scaling/xdscale.vcxproj b/print/XPSDrvSmpl/src/filters/scaling/xdscale.vcxproj deleted file mode 100644 index a2a09897..00000000 --- a/print/XPSDrvSmpl/src/filters/scaling/xdscale.vcxproj +++ /dev/null @@ -1,578 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <ItemGroup Label="ProjectConfigurations"> - <ProjectConfiguration Include="Debug|ARM"> - <Configuration>Debug</Configuration> - <Platform>ARM</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Debug|ARM64"> - <Configuration>Debug</Configuration> - <Platform>ARM64</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Debug|Win32"> - <Configuration>Debug</Configuration> - <Platform>Win32</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release|ARM"> - <Configuration>Release</Configuration> - <Platform>ARM</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release|ARM64"> - <Configuration>Release</Configuration> - <Platform>ARM64</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release|Win32"> - <Configuration>Release</Configuration> - <Platform>Win32</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Debug|x64"> - <Configuration>Debug</Configuration> - <Platform>x64</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release|x64"> - <Configuration>Release</Configuration> - <Platform>x64</Platform> - </ProjectConfiguration> - </ItemGroup> - <PropertyGroup Label="Globals"> - <ProjectGuid>{1893FA97-40A9-480F-BB77-279F959EAE6E}</ProjectGuid> - <RootNamespace>$(MSBuildProjectName)</RootNamespace> - <SupportsPackaging>false</SupportsPackaging> - <RequiresPackageProject>true</RequiresPackageProject> - <Configuration Condition="'$(Configuration)' == ''">Debug</Configuration> - <Platform Condition="'$(Platform)' == ''">Win32</Platform> - <SampleGuid>{79E3B808-CF1F-48F7-B76D-97BFFFEFF2D5}</SampleGuid> - </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> - <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>False</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>DynamicLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>False</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>DynamicLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>False</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>DynamicLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>True</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>DynamicLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>True</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>DynamicLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>True</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>DynamicLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>False</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>DynamicLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>True</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>DynamicLibrary</ConfigurationType> - </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> - <PropertyGroup> - <OutDir>$(IntDir)</OutDir> - </PropertyGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ItemGroup Label="WrappedTaskItems" /> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <TargetName>xdscale</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'"> - <TargetName>xdscale</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> - <TargetName>xdscale</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <TargetName>xdscale</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'"> - <TargetName>xdscale</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> - <TargetName>xdscale</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <TargetName>xdscale</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <TargetName>xdscale</TargetName> - </PropertyGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <Link> - <EntryPointSymbol Condition="'$(Platform)'=='win32'">_DllMainCRTStartup@12</EntryPointSymbol> - <EntryPointSymbol Condition="'$(Platform)'!='win32'">_DllMainCRTStartup</EntryPointSymbol> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'"> - <Link> - <EntryPointSymbol Condition="'$(Platform)'=='win32'">_DllMainCRTStartup@12</EntryPointSymbol> - <EntryPointSymbol Condition="'$(Platform)'!='win32'">_DllMainCRTStartup</EntryPointSymbol> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> - <Link> - <EntryPointSymbol Condition="'$(Platform)'=='win32'">_DllMainCRTStartup@12</EntryPointSymbol> - <EntryPointSymbol Condition="'$(Platform)'!='win32'">_DllMainCRTStartup</EntryPointSymbol> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <Link> - <EntryPointSymbol Condition="'$(Platform)'=='win32'">_DllMainCRTStartup@12</EntryPointSymbol> - <EntryPointSymbol Condition="'$(Platform)'!='win32'">_DllMainCRTStartup</EntryPointSymbol> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'"> - <Link> - <EntryPointSymbol Condition="'$(Platform)'=='win32'">_DllMainCRTStartup@12</EntryPointSymbol> - <EntryPointSymbol Condition="'$(Platform)'!='win32'">_DllMainCRTStartup</EntryPointSymbol> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> - <Link> - <EntryPointSymbol Condition="'$(Platform)'=='win32'">_DllMainCRTStartup@12</EntryPointSymbol> - <EntryPointSymbol Condition="'$(Platform)'!='win32'">_DllMainCRTStartup</EntryPointSymbol> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <Link> - <EntryPointSymbol Condition="'$(Platform)'=='win32'">_DllMainCRTStartup@12</EntryPointSymbol> - <EntryPointSymbol Condition="'$(Platform)'!='win32'">_DllMainCRTStartup</EntryPointSymbol> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <Link> - <EntryPointSymbol Condition="'$(Platform)'=='win32'">_DllMainCRTStartup@12</EntryPointSymbol> - <EntryPointSymbol Condition="'$(Platform)'!='win32'">_DllMainCRTStartup</EntryPointSymbol> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\xdcont</AdditionalIncludeDirectories> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\xdcont</AdditionalIncludeDirectories> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\xdcont</AdditionalIncludeDirectories> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);.\..\xdcont\$(IntDir)\xdcont.lib</AdditionalDependencies> - <AdditionalDependencies>%(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib</AdditionalDependencies> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\xdcont</AdditionalIncludeDirectories> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\xdcont</AdditionalIncludeDirectories> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\xdcont</AdditionalIncludeDirectories> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);.\..\xdcont\$(IntDir)\xdcont.lib</AdditionalDependencies> - <AdditionalDependencies>%(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib</AdditionalDependencies> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\xdcont</AdditionalIncludeDirectories> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\xdcont</AdditionalIncludeDirectories> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\xdcont</AdditionalIncludeDirectories> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);.\..\xdcont\$(IntDir)\xdcont.lib</AdditionalDependencies> - <AdditionalDependencies>%(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib</AdditionalDependencies> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\xdcont</AdditionalIncludeDirectories> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\xdcont</AdditionalIncludeDirectories> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\xdcont</AdditionalIncludeDirectories> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);.\..\xdcont\$(IntDir)\xdcont.lib</AdditionalDependencies> - <AdditionalDependencies>%(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib</AdditionalDependencies> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\xdcont</AdditionalIncludeDirectories> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\xdcont</AdditionalIncludeDirectories> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\xdcont</AdditionalIncludeDirectories> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);.\..\xdcont\$(IntDir)\xdcont.lib</AdditionalDependencies> - <AdditionalDependencies>%(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib</AdditionalDependencies> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\xdcont</AdditionalIncludeDirectories> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\xdcont</AdditionalIncludeDirectories> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\xdcont</AdditionalIncludeDirectories> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);.\..\xdcont\$(IntDir)\xdcont.lib</AdditionalDependencies> - <AdditionalDependencies>%(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib</AdditionalDependencies> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\xdcont</AdditionalIncludeDirectories> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\xdcont</AdditionalIncludeDirectories> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\xdcont</AdditionalIncludeDirectories> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);.\..\xdcont\$(IntDir)\xdcont.lib</AdditionalDependencies> - <AdditionalDependencies>%(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib</AdditionalDependencies> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\xdcont</AdditionalIncludeDirectories> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\xdcont</AdditionalIncludeDirectories> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\xdcont</AdditionalIncludeDirectories> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);.\..\xdcont\$(IntDir)\xdcont.lib</AdditionalDependencies> - <AdditionalDependencies>%(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib</AdditionalDependencies> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemGroup> - <ClCompile Include="dllentry.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="pagescale.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="pgscptprop.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="scaleflt.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="scalesax.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ResourceCompile Include="scaleflt.rc" /> - </ItemGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <Link> - <ModuleDefinitionFile>xdscale.def</ModuleDefinitionFile> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'"> - <Link> - <ModuleDefinitionFile>xdscale.def</ModuleDefinitionFile> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> - <Link> - <ModuleDefinitionFile>xdscale.def</ModuleDefinitionFile> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <Link> - <ModuleDefinitionFile>xdscale.def</ModuleDefinitionFile> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'"> - <Link> - <ModuleDefinitionFile>xdscale.def</ModuleDefinitionFile> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> - <Link> - <ModuleDefinitionFile>xdscale.def</ModuleDefinitionFile> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <Link> - <ModuleDefinitionFile>xdscale.def</ModuleDefinitionFile> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <Link> - <ModuleDefinitionFile>xdscale.def</ModuleDefinitionFile> - </Link> - </ItemDefinitionGroup> - <ItemGroup> - <ClCompile Include="precompsrc.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Create</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - </ItemGroup> - <ItemGroup> - <Inf Exclude="@(Inf)" Include="*.inf" /> - <FilesToPackage Include="$(TargetPath)" Condition="'$(ConfigurationType)'=='Driver' or '$(ConfigurationType)'=='DynamicLibrary'" /> - </ItemGroup> - <ItemGroup> - <None Exclude="@(None)" Include="*.txt;*.htm;*.html" /> - <None Exclude="@(None)" Include="*.ico;*.cur;*.bmp;*.dlg;*.rct;*.gif;*.jpg;*.jpeg;*.wav;*.jpe;*.tiff;*.tif;*.png;*.rc2" /> - <None Exclude="@(None)" Include="*.def;*.bat;*.hpj;*.asmx" /> - </ItemGroup> - <ItemGroup> - <ClInclude Exclude="@(ClInclude)" Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd" /> - </ItemGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> -</Project>
\ No newline at end of file diff --git a/print/XPSDrvSmpl/src/filters/scaling/xdscale.vcxproj.Filters b/print/XPSDrvSmpl/src/filters/scaling/xdscale.vcxproj.Filters deleted file mode 100644 index a280f042..00000000 --- a/print/XPSDrvSmpl/src/filters/scaling/xdscale.vcxproj.Filters +++ /dev/null @@ -1,79 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <ItemGroup> - <Filter Include="Source Files"> - <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;*</Extensions> - <UniqueIdentifier>{B7C68E16-EA47-4D1B-8022-13F7CB1ED129}</UniqueIdentifier> - </Filter> - <Filter Include="Header Files"> - <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions> - <UniqueIdentifier>{406C7911-614E-48F2-A001-163ED9285D10}</UniqueIdentifier> - </Filter> - <Filter Include="Resource Files"> - <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms;man;xml</Extensions> - <UniqueIdentifier>{C852B60D-E874-41E7-B59F-2FBA134E0B5B}</UniqueIdentifier> - </Filter> - </ItemGroup> - <ItemGroup> - <ClCompile Include="dllentry.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="pagescale.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="pgscptprop.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="precompsrc.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="scaleflt.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="scalesax.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - </ItemGroup> - <ItemGroup> - <ResourceCompile Include="scaleflt.rc"> - <Filter>Resource Files</Filter> - </ResourceCompile> - </ItemGroup> - <ItemGroup> - <ClInclude Include="pagescale.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="pgscptprop.h" /> - <ClInclude Include="scaleflt.h" /> - <ClInclude Include="scalesax.h" /> - <ClInclude Include="pagescale.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="pgscptprop.h" /> - <ClInclude Include="scaleflt.h" /> - <ClInclude Include="scalesax.h" /> - <ClInclude Include="pagescale.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="pgscptprop.h" /> - <ClInclude Include="scaleflt.h" /> - <ClInclude Include="scalesax.h" /> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - </ItemGroup> - <ItemGroup> - <None Include="*.def;*.bat;*.hpj;*.asmx"> - <Filter>Source Files</Filter> - </None> - </ItemGroup> -</Project>
\ No newline at end of file diff --git a/print/XPSDrvSmpl/src/filters/watermark/Raster1.png b/print/XPSDrvSmpl/src/filters/watermark/Raster1.png Binary files differdeleted file mode 100644 index 4c11e3c0..00000000 --- a/print/XPSDrvSmpl/src/filters/watermark/Raster1.png +++ /dev/null diff --git a/print/XPSDrvSmpl/src/filters/watermark/Vector1.xps b/print/XPSDrvSmpl/src/filters/watermark/Vector1.xps Binary files differdeleted file mode 100644 index 8227a215..00000000 --- a/print/XPSDrvSmpl/src/filters/watermark/Vector1.xps +++ /dev/null diff --git a/print/XPSDrvSmpl/src/filters/watermark/dllentry.cpp b/print/XPSDrvSmpl/src/filters/watermark/dllentry.cpp deleted file mode 100644 index dc4f7974..00000000 --- a/print/XPSDrvSmpl/src/filters/watermark/dllentry.cpp +++ /dev/null @@ -1,143 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - dllentry.cpp - -Abstract: - - Implementation of the watermark filter dllentry points. Dllmain only - stores the instance handle. DllGetClassObject calls on to a generic - get class factory template function. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "clasfact.h" -#include "wmflt.h" -#include "xdexcept.h" - -/*++ - -Routine Name: - - DllMain - -Routine Description: - - Entry point to the watermark filter which is called when a new process is started - -Arguments: - - hInst - Handle to the DLL - wReason - Specifies a flag indicating why the DLL entry-point function is being called - -Return Value: - - TRUE - ---*/ -BOOL WINAPI -DllMain( - _In_ HINSTANCE hInst, - _In_ WORD wReason, - _In_opt_ LPVOID - ) -{ - switch (wReason) - { - case DLL_PROCESS_ATTACH: - { - g_hInstance = hInst; - } - break; - } - - return TRUE; -} - -/*++ - -Routine Name: - - DllCanUnloadNow - -Routine Description: - - Method which reports whether the DLL is in use to allow the caller to unload - the DLL safely - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - Dll can unload - S_FALSE - Dll can't unload - ---*/ -STDAPI -DllCanUnloadNow() -{ - if (g_cServerLocks == 0) - { - return S_OK ; - } - else - { - return S_FALSE; - } -} - -/*++ - -Routine Name: - - DllGetClassObject - -Routine Description: - - Method to return the current class object - -Arguments: - - rclsid - CLSID that will associate the correct data and code - riid - Reference to the identifier of the interface that the caller is to use to communicate with the class object - ppv - Address of pointer variable that receives the interface pointer requested in riid - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - CLASS_E_CLASSNOTAVAILABLE - On unsupported class - ---*/ -STDAPI -DllGetClassObject( - _In_ REFCLSID rclsid, - _In_ REFIID riid, - _Outptr_ LPVOID FAR* ppv - ) -{ - // - // B8B525BF-F147-460a-B2D5-9DFB1F30D0FD - // - CLSID watermarkCLSID = {0xB8B525BF, 0xF147, 0x460a, {0xB2, 0xD5, 0x9D, 0xFB, 0x1F, 0x30, 0xD0, 0xFD}}; - - return GetFilterClassFactory<CWatermarkFilter>(rclsid, riid, watermarkCLSID, ppv); -} - diff --git a/print/XPSDrvSmpl/src/filters/watermark/precompsrc.cpp b/print/XPSDrvSmpl/src/filters/watermark/precompsrc.cpp deleted file mode 100644 index 5944cf51..00000000 --- a/print/XPSDrvSmpl/src/filters/watermark/precompsrc.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "precomp.h"
\ No newline at end of file diff --git a/print/XPSDrvSmpl/src/filters/watermark/wmbase.cpp b/print/XPSDrvSmpl/src/filters/watermark/wmbase.cpp deleted file mode 100644 index 97d15b3e..00000000 --- a/print/XPSDrvSmpl/src/filters/watermark/wmbase.cpp +++ /dev/null @@ -1,416 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - wmbase.cpp - -Abstract: - - Base watermark class implementation. The base watermark class provides - common functionality required between different watermarks (Text, RasterGraphic - and VectorGraphic. This includes methods for converting a GDI matrix object - into the appropriate XPS matrix mark-up and intialising the matrix according to - the watermark options. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "wmbase.h" - -using XDPrintSchema::PageWatermark::Layering::ELayeringOption; -using XDPrintSchema::PageWatermark::Layering::Overlay; -using XDPrintSchema::PageWatermark::Layering::Underlay; - -/*++ - -Routine Name: - - CWatermark::CWatermark - -Routine Description: - - Constructor for the base watermark class - -Arguments: - - wmProps - Watermark PrintTicket properties class - -Return Value: - - None - Throws CXDException(HRESULT) on an error - ---*/ -CWatermark::CWatermark( - _In_ CONST CWMPTProperties& wmProps - ) : - m_pDOMDoc(NULL), - m_WMProps(wmProps) -{ - // - // Create the DOM document so that sub-classes have access ASAP - // - HRESULT hr = m_pDOMDoc.CoCreateInstance(CLSID_DOMDocument60); - - if (FAILED(hr)) - { - ERR("Failed to create watermark DOM document.\n"); - throw CXDException(hr); - } -} - -/*++ - -Routine Name: - - CWatermark::~CWatermark - -Routine Description: - - Default destructor for the watermarks base class - -Arguments: - - None - -Return Value: - - None - ---*/ -CWatermark::~CWatermark() -{ -} - -/*++ - -Routine Name: - - CWatermark::MatrixToXML - -Routine Description: - - Method to create XML markup representing the - supplied transformation matrix - -Arguments: - - pMatrix - Pointer to the transformation matrix to convert to XML - pbstrMatrixXForm - Pointer to the string which will containg the matrix markup - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWatermark::MatrixToXML( - _In_ CONST Matrix* pMatrix, - _Outptr_ BSTR* pbstrMatrixXForm - ) -{ - // - // Construct the matric mark-up from a GDI+ matrix - // - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrMatrixXForm, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pMatrix, E_POINTER))) - { - REAL matElems[6]; - if (Ok == pMatrix->GetElements(matElems)) - { - try - { - CStringXDW cstrMatrix; - cstrMatrix.Format(L"%.2f,%.2f,%.2f,%.2f,%.2f,%.2f", - matElems[0], - matElems[1], - matElems[2], - matElems[3], - matElems[4], - matElems[5]); - - *pbstrMatrixXForm = cstrMatrix.AllocSysString(); - } - catch (CXDException& e) - { - hr = e; - } - } - else - { - *pbstrMatrixXForm = NULL; - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWatermark::GetXML - -Routine Description: - - Method to get the XML containing the watermark text - -Arguments: - - pbstrXML - Pointer to the string to hold the watermark XML text - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWatermark::GetXML( - _Outptr_ BSTR* pbstrXML - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrXML, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(m_pWMElem, E_PENDING))) - { - hr = m_pWMElem->get_xml(pbstrXML); - - if (SUCCEEDED(hr)) - { - _Analysis_assume_nullterminated_(*pbstrXML); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWatermark::CreateWMTransform - -Routine Description: - - Method to create a transformation matrix which will scale, translate and rotate - the watermark to correctly fit onto the page. This overload perform scaling to fit - the watermark content to the requested bounds and is used when creating the bitmap - or vector watermark. - -Arguments: - - wmBounds - Rectangular area to contain the watermark - pbstrMatrixXForm - Pointer to the string to contain the watermark transformation matrix - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWatermark::CreateWMTransform( - _In_ RectF wmBounds, - _Outptr_ BSTR* pbstrMatrixXForm - ) -{ - ASSERTMSG(wmBounds.Width > 0, "Zero width watermark found whilst creating transform\n"); - ASSERTMSG(wmBounds.Height > 0, "Zero height watermark found whilst creating transform\n"); - - HRESULT hr = S_OK; - - if (wmBounds.Width <= 0 || wmBounds.Height <= 0) - { - hr = E_INVALIDARG; - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_POINTER(pbstrMatrixXForm, E_POINTER))) - { - *pbstrMatrixXForm = NULL; - - RectF targetBounds; - REAL angle = 0; - - if (SUCCEEDED(hr = m_WMProps.GetBounds(&targetBounds)) && - SUCCEEDED(hr = m_WMProps.GetAngle(&angle))) - { - ASSERTMSG(targetBounds.Width > 0, "Zero width target found whilst creating transform\n"); - ASSERTMSG(targetBounds.Height > 0, "Zero height target found whilst creating transform\n"); - - // - // Start with the identity matrix - // - Matrix xForm; - - // - // Offset to the target bounds - // - PointF offset(targetBounds.X - wmBounds.X, targetBounds.Y - wmBounds.Y); - - // - // Apply the transforms to the matrix - // - xForm.Scale(targetBounds.Width/wmBounds.Width, targetBounds.Height/wmBounds.Height, MatrixOrderAppend); - xForm.Rotate(angle, MatrixOrderAppend); - xForm.Translate(offset.X, offset.Y, MatrixOrderAppend); - - // - // Retrieve the matrix string - // - hr = MatrixToXML(&xForm, pbstrMatrixXForm); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWatermark::CreateWMTransform - -Routine Description: - - Method to create a transformation matrix which will translate and rotate. This overload - does not perform any scaling to fit the watermark content and is used when creating the - text watermark. - -Arguments: - - wmOrigin - Point defining the watermark origin - pbstrMatrixXForm - Pointer to the string to contain the watermark transformation matrix - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWatermark::CreateWMTransform( - _In_ PointF wmOrigin, - _Outptr_ BSTR* pbstrMatrixXForm - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrMatrixXForm, E_POINTER))) - { - *pbstrMatrixXForm = NULL; - REAL angle = 0; - - if (SUCCEEDED(hr = m_WMProps.GetAngle(&angle))) - { - // - // Start with the identity matrix - // - Matrix xForm; - - // - // Apply the transforms to the matrix - // - xForm.Rotate(angle, MatrixOrderAppend); - xForm.Translate(wmOrigin.X, wmOrigin.Y, MatrixOrderAppend); - - // - // Retrieve the matrix string - // - hr = MatrixToXML(&xForm, pbstrMatrixXForm); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWatermark::InsertStart - -Routine Description: - - Method to check whether the watermark should be inserted at the start of the - page to create an underlay effect - -Arguments: - - None - -Return Value: - - BOOL - TRUE - The watermark mark-up needs to be inserted at the start of the fixed page - FALSE - The watermark mark-up needs to be inserted at the end of the fixed page - ---*/ -BOOL -CWatermark::InsertStart( - VOID - ) -{ - ELayeringOption wmLayering = Overlay; - - m_WMProps.GetLayering(&wmLayering); - - return wmLayering == Underlay; -} - -/*++ - -Routine Name: - - CWatermark::InsertEnd - -Routine Description: - - Method to check whether the watermark should be inserted at the - end of the page to create an overlay effect - -Arguments: - - None - -Return Value: - - BOOL - TRUE - The watermark mark-up needs to be inserted at the end of the fixed page - FALSE - The watermark mark-up needs to be inserted at the start of the fixed page - ---*/ -BOOL -CWatermark::InsertEnd( - VOID - ) -{ - return !InsertStart(); -} - diff --git a/print/XPSDrvSmpl/src/filters/watermark/wmbase.h b/print/XPSDrvSmpl/src/filters/watermark/wmbase.h deleted file mode 100644 index 9638425e..00000000 --- a/print/XPSDrvSmpl/src/filters/watermark/wmbase.h +++ /dev/null @@ -1,95 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - wmbase.h - -Abstract: - - Base watermark class implementation. The base watermark class provides - common functionality required between different watermarks (Text, RasterGraphic - and VectorGraphic. This includes methods for converting a GDI matrix object - into the appropriate XPS matrix mark-up and intialising the matrix according to - the watermark options. - ---*/ - -#pragma once - -#include "rescache.h" -#include "wmptprop.h" - -class CWatermark -{ -public: - CWatermark( - _In_ CONST CWMPTProperties& wmProps - ); - - virtual ~CWatermark(); - - virtual HRESULT - CreateXMLElement( - VOID - ) = 0; - - virtual HRESULT - AddParts( - _In_ IXpsDocumentConsumer* pXpsConsumer, - _In_ IFixedPage* pFixedPage, - _In_ CFileResourceCache* pResCache - - ) = 0; - - virtual HRESULT - GetXML( - _Outptr_ BSTR* pbstrXML - ); - - virtual BOOL - InsertStart( - VOID - ); - - virtual BOOL - InsertEnd( - VOID - ); - -protected: - HRESULT - CreateWMTransform( - _In_ RectF wmBounds, - _Outptr_ BSTR* pbstrMatrixXForm - ); - - HRESULT - CreateWMTransform( - _In_ PointF wmOrigin, - _Outptr_ BSTR* pbstrMatrixXForm - ); - -private: - HRESULT - MatrixToXML( - _In_ CONST Matrix* pMatrix, - _Outptr_ BSTR* pbstrMatrixXForm - ); - -protected: - CComPtr<IXMLDOMDocument2> m_pDOMDoc; - - CComPtr<IXMLDOMElement> m_pWMElem; - - CWMPTProperties m_WMProps; -}; - diff --git a/print/XPSDrvSmpl/src/filters/watermark/wmflt.cpp b/print/XPSDrvSmpl/src/filters/watermark/wmflt.cpp deleted file mode 100644 index 13e171d4..00000000 --- a/print/XPSDrvSmpl/src/filters/watermark/wmflt.cpp +++ /dev/null @@ -1,340 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - wmflt.cpp - -Abstract: - - Watermark filter implementation. This class derives from the Xps filter - class and implements the necessary part handlers to support Watermark - printing. The Watermark filter is responsible for adding resources to - the XPS document and putting the appropriate mark-up onto pages with a - watermark. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "xdexcept.h" -#include "wmflt.h" -#include "wmtext.h" -#include "wmrast.h" -#include "wmvect.h" -#include "wmsax.h" -#include "wmpthndlr.h" -#include "wmres.h" - -using XDPrintSchema::PageWatermark::WatermarkData; -using XDPrintSchema::PageWatermark::EWatermarkOption; -using XDPrintSchema::PageWatermark::TextWatermark; -using XDPrintSchema::PageWatermark::BitmapWatermark; -using XDPrintSchema::PageWatermark::VectorWatermark; - -/*++ - -Routine Name: - - CWatermarkFilter::CWatermarkFilter - -Routine Description: - - Default constructor for the watermark filter which ensures GDI plus is correctly running - -Arguments: - - None - -Return Value: - - None - ---*/ -CWatermarkFilter::CWatermarkFilter() -{ - ASSERTMSG(m_gdiPlus.GetGDIPlusStartStatus() == Ok, "GDI plus is not correctly initialized.\n"); -} - -/*++ - -Routine Name: - - CWatermarkFilter::~CWatermarkFilter - -Routine Description: - - Default destructor for the watermark filter - -Arguments: - - None - -Return Value: - - None - ---*/ -CWatermarkFilter::~CWatermarkFilter() -{ -} - -/*++ - -Routine Name: - - CWatermarkFilter::ProcessPart - -Routine Description: - - Method for processing each fixed page part in a container - -Arguments: - - pFP - Pointer to the fixed page to process - -Return Value: - - HRESULT - S_OK - On success - S_FALSE - When not enabled in the PT - E_* - On error - ---*/ -HRESULT -CWatermarkFilter::ProcessPart( - _Inout_ IFixedPage* pFP - ) -{ - VERBOSE("Processing Fixed Page part with watermark handler\n"); - - HRESULT hr = S_OK; - CWatermark* pWatermark = NULL; - - if (SUCCEEDED(hr = CHECK_POINTER(pFP, E_POINTER))) - { - // - // Retrieve the watermark settings from the PrintTicket - // - IXMLDOMDocument2* pPT = NULL; - if (SUCCEEDED(hr = m_ptManager.SetTicket(pFP)) && - SUCCEEDED(hr = m_ptManager.GetTicket(kPTPageScope, &pPT)) && - SUCCEEDED(hr = GetWatermark(pPT, &pWatermark)) && - SUCCEEDED(hr = CHECK_POINTER(pWatermark, E_FAIL))) - { - // - // Add the resource part - // - if (SUCCEEDED(hr = pWatermark->AddParts(m_pXDWriter, pFP, &m_resCache))) - { - // - // Retrieve the writer from the fixed page - // - CComPtr<IPrintWriteStream> pWriter(NULL); - - if (SUCCEEDED(hr = pFP->GetWriteStream(&pWriter))) - { - // - // Set-up the SAX reader and begin parsing the mark-up - // - CComPtr<ISAXXMLReader> pSaxRdr(NULL); - CComPtr<IPrintReadStream> pReader(NULL); - - try - { - CWMSaxHandler wmSaxHndlr(pWriter, pWatermark); - - if (SUCCEEDED(hr = pSaxRdr.CoCreateInstance(CLSID_SAXXMLReader60)) && - SUCCEEDED(hr = pSaxRdr->putContentHandler(&wmSaxHndlr)) && - SUCCEEDED(hr = pFP->GetStream(&pReader))) - { - CComPtr<ISequentialStream> pReadStreamToSeq(NULL); - - pReadStreamToSeq.Attach(new(std::nothrow) pfp::PrintReadStreamToSeqStream(pReader)); - - if (SUCCEEDED(hr = CHECK_POINTER(pReadStreamToSeq, E_OUTOFMEMORY))) - { - hr = pSaxRdr->parse(CComVariant(static_cast<ISequentialStream*>(pReadStreamToSeq))); - } - } - } - catch (CXDException& e) - { - hr = e; - } - - pWriter->Close(); - } - } - else if (hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)) - { - // - // Could not find resource file - fail gracefully so we continue - // to process the document - // - ERR("Specified resource file does not exist\n"); - hr = S_FALSE; - } - else if (hr == HRESULT_FROM_WIN32(ERROR_ACCESS_DENIED)) - { - // - // Insufficient rights to open file - fail gracefully so we continue - // to process the document - // - ERR("Insufficient rights to open resource file\n"); - hr = S_FALSE; - } - else if (hr == HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED)) - { - // - // We do not support this URI as a resource - fail gracefully so we continue - // to process the document - // - ERR("Unsupported URI to resource resource\n"); - hr = S_FALSE; - } - } - else if (hr == E_ELEMENT_NOT_FOUND) - { - // - // No watermark was found in the PrintTicket - do not propogate this error - // - hr = S_FALSE; - } - } - - // - // Clean up the watermark if it was successfully created - // - if (pWatermark != NULL) - { - delete pWatermark; - pWatermark = NULL; - } - - if (SUCCEEDED(hr)) - { - // - // We can send the fixed page - // - hr = m_pXDWriter->SendFixedPage(pFP); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWatermarkFilter::GetWatermark - -Routine Description: - - Method for obtaining the watermark PrintTicket preferences - -Arguments: - - pPrintTicket - DOM document containing the PrintTicket - ppWatermark - Pointer to object which will contain the values - read from the PrintTicket - -Return Value: - - HRESULT - S_OK - On success - E_ELEMENT_NOT_FOUND - When feature not present in the PT - E_* - On error - ---*/ -HRESULT -CWatermarkFilter::GetWatermark( - _In_ IXMLDOMDocument2* pPrintTicket, - _Outptr_result_maybenull_ CWatermark** ppWatermark - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppWatermark, E_POINTER))) - { - *ppWatermark = NULL; - - try - { - - CWMPTHandler wmPTHandler(pPrintTicket); - WatermarkData wmData; - - if (SUCCEEDED(hr = wmPTHandler.GetData(&wmData))) - { - CWMPTProperties wmProperties(wmData); - - EWatermarkOption wmOption; - - if (SUCCEEDED(hr = wmProperties.GetType(&wmOption))) - { - switch (wmOption) - { - case TextWatermark: - { - *ppWatermark = new(std::nothrow) CTextWatermark(wmProperties); - - if (*ppWatermark == NULL) - { - hr = E_OUTOFMEMORY; - } - } - break; - - case BitmapWatermark: - { - *ppWatermark = new(std::nothrow) CRasterWatermark(wmProperties, IDR_WM_PNG1); - - if (*ppWatermark == NULL) - { - hr = E_OUTOFMEMORY; - } - } - break; - - case VectorWatermark: - { - *ppWatermark = new(std::nothrow) CVectorWatermark(wmProperties, IDR_WM_XPS1); - - if (*ppWatermark == NULL) - { - hr = E_OUTOFMEMORY; - } - } - break; - - default: - { - hr = E_ELEMENT_NOT_FOUND; - } - break; - } - } - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR_EXC(hr, E_ELEMENT_NOT_FOUND); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/watermark/wmflt.h b/print/XPSDrvSmpl/src/filters/watermark/wmflt.h deleted file mode 100644 index 8fa42ca1..00000000 --- a/print/XPSDrvSmpl/src/filters/watermark/wmflt.h +++ /dev/null @@ -1,54 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - wmflt.h - -Abstract: - - Watermark filter defnition. This class derives from the Xps filter - class and implements the necessary part handlers to support Watermark - printing. The Watermark filter is responsible for adding resources to - the XPS document and putting the appropriate mark-up onto pages with a - watermark - ---*/ - -#pragma once - -#include "xdrchflt.h" -#include "wmbase.h" -#include "gdip.h" - -class CWatermarkFilter : public CXDXpsFilter -{ -public: - CWatermarkFilter(); - - virtual ~CWatermarkFilter(); - -private: - virtual HRESULT - ProcessPart( - _Inout_ IFixedPage* pFP - ); - - HRESULT - GetWatermark( - _In_ IXMLDOMDocument2* pPrintTicket, - _Outptr_result_maybenull_ CWatermark** ppWatermark - ); - -private: - GDIPlus m_gdiPlus; -}; - diff --git a/print/XPSDrvSmpl/src/filters/watermark/wmflt.rc b/print/XPSDrvSmpl/src/filters/watermark/wmflt.rc deleted file mode 100644 index 06f5485c..00000000 --- a/print/XPSDrvSmpl/src/filters/watermark/wmflt.rc +++ /dev/null @@ -1,54 +0,0 @@ -// -// Copyright (c) 2005 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. -// -// File Name: -// -// wmflt.rc -// -// Abstract: -// -// Watermark filter resource file. -// -// - -#include <winres.h> -#include <ntverp.h> - -#include "wmres.h" - -#define VER_FILETYPE VFT_DLL -#define VER_FILESUBTYPE VFT2_UNKNOWN -#define VER_FILEDESCRIPTION_STR "XPSDrv Sample Watermark Filter" -#define VER_INTERNALNAME_STR "PrintFeatureFilters" - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// -// Watermark Resources -// - -IDR_WM_PNG1 RCDATA "Raster1.png" - -IDR_WM_XPS1 RCDATA "Vector1.xps" - -#endif // English (U.S.) resources - -///////////////////////////////////////////////////////////////////////////// - -#include "common.ver" - diff --git a/print/XPSDrvSmpl/src/filters/watermark/wmfont.cpp b/print/XPSDrvSmpl/src/filters/watermark/wmfont.cpp deleted file mode 100644 index 5bb49548..00000000 --- a/print/XPSDrvSmpl/src/filters/watermark/wmfont.cpp +++ /dev/null @@ -1,413 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - wmfont.cpp - -Abstract: - - Watermark font implementation. The CWatermarkFont class is responsible - for managing the font resource for a text watermark. This implements - the IResWriter interface so that the font can be added to the resource - cache. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "wmfont.h" - -using XDPrintSchema::PageWatermark::EWatermarkOption; -using XDPrintSchema::PageWatermark::TextWatermark; - -/*++ - -Routine Name: - - CWatermarkFont::CWatermarkFont - -Routine Description: - - Constructor for the CWatermarkFont font management class which - sets the member variables to sensible defaults and ensures the - current watermark which uses this font is a text based watermark - -Arguments: - - wmProps - Object containing the PrintTicket settings - -Return Value: - - None - Throws CXDException(HRESULT) on an error - ---*/ -CWatermarkFont::CWatermarkFont( - _In_ CONST CWMPTProperties& wmProps - ) : - m_hDC(CreateDC(TEXT("DISPLAY"), NULL, NULL, NULL)), - m_WMProps(wmProps), - m_hFont(NULL), - m_hOldFont(NULL), - m_bstrFaceName(L"Arial") -{ - HRESULT hr = S_OK; - - ASSERTMSG(m_hDC != NULL, "NULL DC passed.\n"); - - EWatermarkOption wmType; - - if (SUCCEEDED(hr = m_WMProps.GetType(&wmType))) - { - if (wmType == TextWatermark) - { - hr = SetFont(); - } - else - { - hr = E_INVALIDARG; - } - } - - if (FAILED(hr)) - { - throw CXDException(hr); - } -} - -/*++ - -Routine Name: - - CWatermarkFont::~CWatermarkFont - -Routine Description: - - Default destructor for the font management class - -Arguments: - - None - -Return Value: - - None - ---*/ -CWatermarkFont::~CWatermarkFont() -{ - UnsetFont(); - - if (SUCCEEDED(CHECK_HANDLE(m_hDC, E_PENDING))) - { - DeleteDC(m_hDC); - } -} - -/*++ - -Routine Name: - - CWatermarkFont::WriteData - -Routine Description: - - Method for writing out the font to the container - -Arguments: - - pStream - Pointer to the stream to write the font out to - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWatermarkFont::WriteData( - _In_ IPartBase* pResource, - _In_ IPrintWriteStream* pStream - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pResource, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pStream, E_POINTER))) - { - // - // Find the size of the font data - // - DWORD cbFontData = GetFontData(m_hDC, 0, 0, 0, 0); - - if (cbFontData != GDI_ERROR) - { - PBYTE pFontData = new(std::nothrow) BYTE[cbFontData]; - - if (SUCCEEDED(hr = CHECK_POINTER(pFontData, E_OUTOFMEMORY))) - { - // - // Retrieve the font data - // - if (GDI_ERROR != GetFontData(m_hDC, - 0, - 0, - reinterpret_cast<LPVOID>(pFontData), - cbFontData)) - { - // - // SetFontOptions(Font_Obfusticate) sets the appropriate content type - // The pipeline takes care of XORing the font data with the URI GUID - // - CComQIPtr<IPartFont> pFont = pResource; - if (SUCCEEDED(hr = CHECK_POINTER(pFont, E_NOINTERFACE)) && - SUCCEEDED(hr = pFont->SetFontOptions(Font_Obfusticate))) - { - // - // Write font data to stream - // - ULONG cbWritten = 0; - hr = pStream->WriteBytes(reinterpret_cast<LPVOID>(pFontData), - cbFontData, - &cbWritten); - - ASSERTMSG(cbFontData == cbWritten, "Failed to write all font data.\n"); - } - } - else - { - hr = GetLastErrorAsHResult(); - } - - delete[] pFontData; - pFontData = NULL; - } - } - else - { - hr = GetLastErrorAsHResult(); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWatermarkFont::SetFont - -Routine Description: - - Method to select a font into the device context - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWatermarkFont::SetFont( - VOID - ) -{ - ASSERTMSG(m_hFont == NULL, "Non NULL font handle when setting new font. Possible resource leak.\n"); - ASSERTMSG(m_hOldFont == NULL, "Non NULL old font handle when setting new font. Possible resource leak.\n"); - - HRESULT hr = S_OK; - - INT fontSize; - - if (SUCCEEDED(hr = m_WMProps.GetFontSize(&fontSize))) - { - LOGFONTW logfont; - - logfont.lfHeight = -MulDiv(fontSize, GetDeviceCaps(m_hDC, LOGPIXELSY), 72); - logfont.lfWidth = 0; - logfont.lfEscapement = 0; - logfont.lfOrientation = 0; - logfont.lfWeight = FW_NORMAL; - logfont.lfItalic = FALSE; - logfont.lfUnderline = FALSE; - logfont.lfStrikeOut = FALSE; - logfont.lfCharSet = ANSI_CHARSET; - logfont.lfOutPrecision = OUT_TT_ONLY_PRECIS; - logfont.lfClipPrecision = CLIP_DEFAULT_PRECIS; - logfont.lfQuality = CLEARTYPE_QUALITY; - logfont.lfPitchAndFamily = FF_DONTCARE; - - size_t cchSrc = 0; - if (SUCCEEDED(hr = StringCchLength(m_bstrFaceName, LF_FACESIZE, &cchSrc)) && - SUCCEEDED(hr = StringCchCopyN(logfont.lfFaceName, LF_FACESIZE, m_bstrFaceName, cchSrc))) - { - if (m_hFont != NULL) - { - UnsetFont(); - } - - m_hFont = CreateFontIndirect(&logfont); - - if (m_hFont != NULL) - { - m_hOldFont = SelectFont(m_hDC, m_hFont); - } - else - { - hr = GetLastErrorAsHResult(); - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWatermarkFont::UnsetFont - -Routine Description: - - Method de-select a font from the current device context - -Arguments: - - None - -Return Value: - - None - ---*/ -VOID -CWatermarkFont::UnsetFont( - VOID - ) -{ - ASSERTMSG(m_hFont != NULL, "Attempting to deselect invalid font.\n"); - ASSERTMSG(m_hOldFont != NULL, "Attempting to select invalid font.\n"); - - SelectFont(m_hDC, m_hOldFont); - if (m_hFont != NULL) - { - DeleteObject(m_hFont); - m_hFont = NULL; - } -} - -/*++ - -Routine Name: - - CWatermarkFont::GetKeyName - -Routine Description: - - Method to obtain a unique key for the stored font based on the resource name - -Arguments: - - pbstrKeyName - Pointer to the string to contain the generated key name - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWatermarkFont::GetKeyName( - _Outptr_ BSTR* pbstrKeyName - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrKeyName, E_POINTER))) - { - // - // The name of the resource is a suitable key - // - if (SUCCEEDED(hr = m_bstrFaceName.CopyTo(pbstrKeyName)) && - !*pbstrKeyName) - { - hr = E_OUTOFMEMORY; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWatermarkFont::GetResURI - -Routine Description: - - Method to obtain the URI to the stored font - -Arguments: - - pbstrResURI - Pointer to the string to contain the font resource URI - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWatermarkFont::GetResURI( - _Outptr_ BSTR* pbstrResURI - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrResURI, E_POINTER))) - { - *pbstrResURI = NULL; - - try - { - // - // Create an obfuscated font name using our font GUID - // - CStringXDW cstrURI(L"Resources/Fonts/78F47176-ADD7-0E49-AB3A-C59F137240AC.odttf"); - *pbstrResURI = cstrURI.AllocSysString(); - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/watermark/wmfont.h b/print/XPSDrvSmpl/src/filters/watermark/wmfont.h deleted file mode 100644 index a7990011..00000000 --- a/print/XPSDrvSmpl/src/filters/watermark/wmfont.h +++ /dev/null @@ -1,82 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - wmfont.h - -Abstract: - - Watermark font definition. The CWatermarkFont class is responsible - for managing the font resource for a text watermark. This implements - the IResWriter interface so that the font can be added to the resource - cache. - -Known Issues: - - The watermark font does not yet use the Uniscript interface to retrieve glyph - indices. - ---*/ - -#pragma once - -#include "rescache.h" -#include "wmptprop.h" - -class CWatermarkFont : public IResWriter -{ -public: - CWatermarkFont( - _In_ CONST CWMPTProperties& wmProps - ); - - ~CWatermarkFont(); - - HRESULT - WriteData( - _In_ IPartBase* pResource, - _In_ IPrintWriteStream* pStream - ); - - HRESULT - GetKeyName( - _Outptr_ BSTR* pbstrKeyName - ); - - HRESULT - GetResURI( - _Outptr_ BSTR* pbstrResURI - ); - -private: - HRESULT - SetFont( - VOID - ); - - VOID - UnsetFont( - VOID - ); - -private: - HDC m_hDC; - - HFONT m_hFont; - - HFONT m_hOldFont; - - CComBSTR m_bstrFaceName; - - CWMPTProperties m_WMProps; -}; - diff --git a/print/XPSDrvSmpl/src/filters/watermark/wmimg.cpp b/print/XPSDrvSmpl/src/filters/watermark/wmimg.cpp deleted file mode 100644 index 38f78f4d..00000000 --- a/print/XPSDrvSmpl/src/filters/watermark/wmimg.cpp +++ /dev/null @@ -1,503 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - wmimg.cpp - -Abstract: - - Watermark image implementation. The CWatermarkImage class is responsible - for managing the image resource for a raster watermark. This implements - the IResWriter interface so that the font can be added to the resource - cache. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "wmimg.h" - -using XDPrintSchema::PageWatermark::EWatermarkOption; -using XDPrintSchema::PageWatermark::BitmapWatermark; - -/*++ - -Routine Name: - - CWatermarkImage::CWatermarkImage - -Routine Description: - - Constructor for the CWatermarkFont bitmap management class which - sets the member variables to sensible defaults and ensures the - current watermark which uses this bitmap is a bitmap based watermark - -Arguments: - - wmProps - Object containing the PrintTicket settings - resourceID - Resource ID for the watermark -Return Value: - - None - Throws CXDException(HRESULT) on an error - ---*/ -CWatermarkImage::CWatermarkImage( - _In_ CONST CWMPTProperties& wmProps, - _In_ CONST INT resourceID - ) : - m_WMProps(wmProps), - m_resourceID(resourceID), - m_pPNGData(NULL), - m_pPNGStream(NULL), - m_hPNGRes(NULL), - m_cbPNGData(0) -{ - HRESULT hr = S_OK; - - EWatermarkOption wmType; - - if (SUCCEEDED(hr = m_WMProps.GetType(&wmType))) - { - if (wmType != BitmapWatermark) - { - hr = E_INVALIDARG; - } - } - - if (FAILED(hr)) - { - throw CXDException(hr); - } -} - -/*++ - -Routine Name: - - CWatermarkImage::~CWatermarkImage - -Routine Description: - - Default destructor for the font management class - -Arguments: - - None - -Return Value: - - None - ---*/ -CWatermarkImage::~CWatermarkImage() -{ - if (m_hPNGRes != NULL) - { - FreeResource(m_hPNGRes); - m_hPNGRes = NULL; - } -} - -/*++ - -Routine Name: - - CWatermarkImage::GetImageDimensions - -Routine Description: - - Method to obtain the width and height for the watermark bitmap - -Arguments: - - pDimensions - Pointer to a structure which will hold the bitmap dimensions - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWatermarkImage::GetImageDimensions( - _Out_ SizeF* pDimensions - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pDimensions, E_POINTER)) && - SUCCEEDED(hr = CreatePNGStream())) - { - pDimensions->Width = 0; - pDimensions->Height = 0; - - Bitmap image(m_pPNGStream); - Status gdiPStat = image.GetLastStatus(); - - if (gdiPStat == Ok) - { - pDimensions->Width = (REAL)image.GetWidth(); - pDimensions->Height = (REAL)image.GetHeight(); - - REAL horzRes = image.GetHorizontalResolution(); - REAL vertRes = image.GetVerticalResolution(); - - if (horzRes > 0 && - vertRes > 0) - { - pDimensions->Width *= 96.0f / horzRes; - pDimensions->Height *= 96.0f / vertRes; - } - } - else - { - hr = GetGDIStatusErrorAsHResult(gdiPStat); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWatermarkImage::WriteData - -Routine Description: - - Method for writing out the bitmap to the container - -Arguments: - - pStream - Pointer to the stream to write the bitmap out to - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWatermarkImage::WriteData( - _In_ IPartBase* pResource, - _In_ IPrintWriteStream* pStream - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pResource, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pStream, E_POINTER))) - { - if (SUCCEEDED(hr = LoadPNGResource())) - { - ULONG cbWritten = 0; - - hr = pStream->WriteBytes(m_pPNGData, m_cbPNGData, &cbWritten); - - ASSERTMSG(m_cbPNGData == cbWritten, "Failed to write all data.\n"); - - // - // Set the content type of the image part - // - CComQIPtr<IPartImage> pImage = pResource; - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_POINTER(pImage, E_NOINTERFACE))) - { - hr = pImage->SetImageContent(CComBSTR(L"image/png")); - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWatermarkImage::GetKeyName - -Routine Description: - - Method to obtain a unique key for the stored bitmap based on the resource name - -Arguments: - - pbstrKeyName - Pointer to the string to contain the generated key name - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWatermarkImage::GetKeyName( - _Outptr_ BSTR* pbstrKeyName - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrKeyName, E_POINTER))) - { - try - { - // - // The id of the resource is a suitable key - // - - CStringXDW cstrKeyName; - cstrKeyName.Format(L"%d", m_resourceID); - - *pbstrKeyName = cstrKeyName.AllocSysString(); - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWatermarkImage::GetResURI - -Routine Description: - - Method to obtain the URI to the stored bitmap - -Arguments: - - pbstrResURI - Pointer to the string to contain the bitmap resource URI - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWatermarkImage::GetResURI( - _Outptr_ BSTR* pbstrResURI - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrResURI, E_POINTER))) - { - *pbstrResURI = NULL; - - try - { - // - // Create a unique name for the watermark bitmap for this print session - // - CStringXDW cstrURI; - cstrURI.Format(L"/WM_%d_%u.png", m_resourceID, GetUniqueNumber()); - - *pbstrResURI = cstrURI.AllocSysString(); - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWatermarkImage::CheckResID - -Routine Description: - - Method to check that the bitmap resource exists - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWatermarkImage::CheckResID( - VOID - ) -{ - HRESULT hr = S_OK; - - HRSRC hrSrc = FindResourceEx(g_hInstance, - RT_RCDATA, - MAKEINTRESOURCE(m_resourceID), - MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US)); - - if (hrSrc == NULL) - { - hr = GetLastErrorAsHResult(); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWatermarkImage::CreatePNGStream - -Routine Description: - - Method to write out the PNG bitmap to the container - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWatermarkImage::CreatePNGStream( - VOID - ) -{ - HRESULT hr = S_OK; - - // - // If a stream hasn't already been created, load the PNG image resource - // and create a new stream - // - if (m_pPNGStream == NULL && - SUCCEEDED(hr = LoadPNGResource()) && - SUCCEEDED(hr = CreateStreamOnHGlobal(NULL, TRUE, &m_pPNGStream))) - { - ULONG cbWritten = 0; - - // - // Write the data to the stream - // - hr = m_pPNGStream->Write(m_pPNGData, m_cbPNGData, &cbWritten); - } - - // - // Make sure the stream is pointing back at the start of the data - // - if (SUCCEEDED(hr)) - { - LARGE_INTEGER cbMoveFromStart = {0}; - - hr = m_pPNGStream->Seek(cbMoveFromStart, STREAM_SEEK_SET, NULL); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWatermarkImage::LoadPNGResource - -Routine Description: - - Method to load the PNG bitmap resource - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWatermarkImage::LoadPNGResource( - VOID - ) -{ - HRESULT hr = S_OK; - - if (m_pPNGData == NULL) - { - HRSRC hrSrc = FindResourceEx(g_hInstance, - RT_RCDATA, - MAKEINTRESOURCE(m_resourceID), - MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US)); - if (hrSrc != NULL) - { - // - // Load the resource - // - m_hPNGRes = LoadResource(g_hInstance, hrSrc); - - if (m_hPNGRes != NULL) - { - // - // Retrieve the PNG data and the size of the data - // - m_pPNGData = LockResource(m_hPNGRes); - m_cbPNGData = SizeofResource(g_hInstance, hrSrc); - - if (m_pPNGData == NULL || - m_cbPNGData <= 0) - { - hr = E_FAIL; - } - } - else - { - hr = GetLastErrorAsHResult(); - } - } - else - { - hr = GetLastErrorAsHResult(); - } - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/watermark/wmimg.h b/print/XPSDrvSmpl/src/filters/watermark/wmimg.h deleted file mode 100644 index f7ab0e8c..00000000 --- a/print/XPSDrvSmpl/src/filters/watermark/wmimg.h +++ /dev/null @@ -1,90 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - wmimg.h - -Abstract: - - Watermark image definition. The CWatermarkImage class is responsible - for managing the image resource for a raster watermark. This implements - the IResWriter interface so that the font can be added to the resource - cache. - ---*/ - -#pragma once - -#include "rescache.h" -#include "wmptprop.h" - -class CWatermarkImage : public IResWriter -{ -public: - CWatermarkImage( - _In_ CONST CWMPTProperties& wmProps, - _In_ CONST INT resourceID - ); - - ~CWatermarkImage(); - - HRESULT - GetImageDimensions( - _Out_ SizeF* pDimensions - ); - - HRESULT - WriteData( - _In_ IPartBase* pResource, - _In_ IPrintWriteStream* pStream - ); - - HRESULT - GetKeyName( - _Outptr_ BSTR* pbstrKeyName - ); - - HRESULT - GetResURI( - _Outptr_ BSTR* pbstrResURI - ); - - HRESULT - CheckResID( - VOID - ); - -private: - HRESULT - CreatePNGStream( - VOID - ); - - HRESULT - LoadPNGResource( - VOID - ); - -private: - CWMPTProperties m_WMProps; - - INT m_resourceID; - - CComPtr<IStream> m_pPNGStream; - - PVOID m_pPNGData; - - DWORD m_cbPNGData; - - HGLOBAL m_hPNGRes; -}; - diff --git a/print/XPSDrvSmpl/src/filters/watermark/wmptprop.cpp b/print/XPSDrvSmpl/src/filters/watermark/wmptprop.cpp deleted file mode 100644 index c8b102a1..00000000 --- a/print/XPSDrvSmpl/src/filters/watermark/wmptprop.cpp +++ /dev/null @@ -1,683 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - wmptprop.cpp - -Abstract: - - Watermark properties class implementation. The Watermark properties class - is responsible for holding and controling Watermark properties. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "wmptprop.h" - -using XDPrintSchema::PageWatermark::WatermarkData; -using XDPrintSchema::PageWatermark::EWatermarkOption; -using XDPrintSchema::PageWatermark::NoWatermark; -using XDPrintSchema::PageWatermark::TextWatermark; -using XDPrintSchema::PageWatermark::BitmapWatermark; -using XDPrintSchema::PageWatermark::VectorWatermark; -using XDPrintSchema::PageWatermark::Layering::ELayeringOption; - -/*++ - -Routine Name: - - CWMPTProperties::CWMPTProperties - -Routine Description: - - Constructor for the CWMPTProperties PrintTicket properties class - -Arguments: - - wmData - Structure containing watermark properties read from the PrintTicket - -Return Value: - - None - ---*/ -CWMPTProperties::CWMPTProperties( - _In_ CONST WatermarkData& wmData - ) : - m_wmData(wmData) -{ -} - -/*++ - -Routine Name: - - CWMPTProperties::~CWMPTProperties - -Routine Description: - - Default destructor for the CWMPTProperties class - -Arguments: - - None - -Return Value: - - None - ---*/ -CWMPTProperties::~CWMPTProperties() -{ -} - -/*++ - -Routine Name: - - CWMPTProperties::GetType - -Routine Description: - - Method to obtain the watermark type to identify as vector, text or bitmap - -Arguments: - - pType - Enumerated type to indicate the watermark type - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWMPTProperties::GetType( - _Out_ EWatermarkOption* pType - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pType, E_POINTER))) - { - *pType = m_wmData.type; - - // - // If we are a bitmap or vector watermark and the extents are zero, report no watermark - // - if (m_wmData.type == BitmapWatermark || - m_wmData.type == VectorWatermark) - { - if (m_wmData.widthExtent == 0 || - m_wmData.heightExtent == 0) - { - *pType = NoWatermark; - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWMPTProperties::GetLayering - -Routine Description: - - Method to obtain the watermark layering type - -Arguments: - - pLayering - Enumerated type to indicate the watermark layering type - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWMPTProperties::GetLayering( - _Out_ ELayeringOption* pLayering - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pLayering, E_POINTER))) - { - *pLayering = m_wmData.layering; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWMPTProperties::GetBounds - -Routine Description: - - Method to obtain the watermark bounding area - -Arguments: - - pBounds - Variable which is set to the watermark bounding area - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWMPTProperties::GetBounds( - _Out_ RectF* pBounds - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pBounds, E_POINTER))) - { - // - // Convert from microns to 96ths of an inch - // - pBounds->X = static_cast<REAL>(m_wmData.widthOrigin)/k96thInchAsMicrons; - pBounds->Y = static_cast<REAL>(m_wmData.heightOrigin)/k96thInchAsMicrons; - pBounds->Width = static_cast<REAL>(m_wmData.widthExtent)/k96thInchAsMicrons; - pBounds->Height = static_cast<REAL>(m_wmData.heightExtent)/k96thInchAsMicrons; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWMPTProperties::GetOrigin - -Routine Description: - - Method to obtain the watermark origin - -Arguments: - - pOrigin - Variable which is set to the watermark origin - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWMPTProperties::GetOrigin( - _Out_ PointF* pOrigin - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pOrigin, E_POINTER))) - { - // - // Convert from microns to 96ths of an inch - // - pOrigin->X = static_cast<REAL>(m_wmData.widthOrigin)/k96thInchAsMicrons; - pOrigin->Y = static_cast<REAL>(m_wmData.heightOrigin)/k96thInchAsMicrons; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWMPTProperties::GetAngle - -Routine Description: - - Method to obtain the watermark angle - -Arguments: - - pAngle - Variable which is set to the watermark angle - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWMPTProperties::GetAngle( - _Out_ REAL* pAngle - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pAngle, E_POINTER))) - { - *pAngle = static_cast<REAL>(m_wmData.angle); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWMPTProperties::GetTransparency - -Routine Description: - - Method to obtain the watermark transparency value - -Arguments: - - pTransparency - Variable which is set to the watermark transparency value - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWMPTProperties::GetTransparency( - _Out_ INT* pTransparency - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pTransparency, E_POINTER))) - { - *pTransparency = m_wmData.transparency; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWMPTProperties::GetOpacity - -Routine Description: - - Method to obtain the watermark opacity value - -Arguments: - - pOpacity - Variable which is set to the watermark opacity value - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWMPTProperties::GetOpacity( - _Out_ REAL* pOpacity - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pOpacity, E_POINTER))) - { - *pOpacity = 1.0f - (m_wmData.transparency / 100.0f); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWMPTProperties::GetTransparency - -Routine Description: - - Method to obtain the watermark transparency value as a string - -Arguments: - - pbstrTransparency - String which is set to contain the watermark transparency value - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWMPTProperties::GetTransparency( - _Outptr_ BSTR* pbstrTransparency - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrTransparency, E_POINTER))) - { - *pbstrTransparency = NULL; - INT transparency = 0; - if (SUCCEEDED(hr = GetTransparency(&transparency))) - { - try - { - CStringXDW szTransparency; - szTransparency.Format(L"%i", transparency); - - *pbstrTransparency = szTransparency.AllocSysString(); - } - catch (CXDException& e) - { - hr = e; - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWMPTProperties::GetOpacity - -Routine Description: - - Method to obtain the watermark opacity value as a string - -Arguments: - - pbstrOpacity - String which is set to contain the watermark opacity value - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWMPTProperties::GetOpacity( - _Outptr_ BSTR* pbstrOpacity - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrOpacity, E_POINTER))) - { - *pbstrOpacity = NULL; - REAL opacity = 0; - if (SUCCEEDED(hr = GetOpacity(&opacity))) - { - try - { - CStringXDW szOpacity; - szOpacity.Format(L"%.2f", opacity); - - *pbstrOpacity = szOpacity.AllocSysString(); - } - catch (CXDException& e) - { - hr = e; - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWMPTProperties::GetFontColor - -Routine Description: - - Method to obtain the watermark font color as a string - -Arguments: - - pbstrColor - String which is set to contain the watermark font color. Any BSTR - this points to will be freed. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWMPTProperties::GetFontColor( - _Inout_ _At_(*pbstrColor, _Pre_maybenull_ _Post_valid_) BSTR* pbstrColor - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrColor, E_POINTER))) - { - SysFreeString(*pbstrColor); - *pbstrColor = NULL; - if (m_wmData.type == TextWatermark) - { - if (SUCCEEDED(hr = m_wmData.txtData.bstrFontColor.CopyTo(pbstrColor)) && - !*pbstrColor) - { - hr = E_OUTOFMEMORY; - } - } - else - { - hr = HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWMPTProperties::GetText - -Routine Description: - - Method to obtain the watermark text as a string - -Arguments: - - pbstrText - String which is set to contain the watermark text - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWMPTProperties::GetText( - _Inout_ _At_(*pbstrText, _Pre_maybenull_ _Post_valid_) BSTR* pbstrText - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrText, E_POINTER))) - { - SysFreeString(*pbstrText); - *pbstrText = NULL; - if (m_wmData.type == TextWatermark) - { - if (SUCCEEDED(hr = m_wmData.txtData.bstrText.CopyTo(pbstrText)) && - !*pbstrText) - { - hr = E_OUTOFMEMORY; - } - } - else - { - hr = HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWMPTProperties::GetFontSize - -Routine Description: - - Method to obtain the watermark font size - -Arguments: - - pSize - Variable which is set to contain the watermark font size - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWMPTProperties::GetFontSize( - _Out_ INT* pSize - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pSize, E_POINTER))) - { - if (m_wmData.type == TextWatermark) - { - *pSize = m_wmData.txtData.fontSize; - } - else - { - hr = HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWMPTProperties::GetFontEmSize - -Routine Description: - - Method to obtain the watermark font EM size as a string - -Arguments: - - pbstrSize - String which is set to contain the watermark EM font size - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWMPTProperties::GetFontEmSize( - _Outptr_ BSTR* pbstrSize - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrSize, E_POINTER))) - { - *pbstrSize = NULL; - - if (m_wmData.type != TextWatermark) - { - hr = HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED); - } - } - - if (SUCCEEDED(hr)) - { - INT size = 0; - - if (SUCCEEDED(hr = GetFontSize(&size))) - { - // - // Convert from 72nds to 96ths of an inch - // - size = MulDiv(size, 96, 72); - - try - { - CStringXDW szFontSize; - szFontSize.Format(L"%d", size); - - *pbstrSize = szFontSize.AllocSysString(); - } - catch (CXDException& e) - { - hr = e; - } - } - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/watermark/wmptprop.h b/print/XPSDrvSmpl/src/filters/watermark/wmptprop.h deleted file mode 100644 index eec7fed4..00000000 --- a/print/XPSDrvSmpl/src/filters/watermark/wmptprop.h +++ /dev/null @@ -1,103 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - wmptprop.h - -Abstract: - - Watermark properties class definition. The Watermark properties class - is responsible for holding and controling Watermark properties. - ---*/ - -#pragma once - -#include "wmdata.h" - -class CWMPTProperties -{ -public: - CWMPTProperties( - _In_ CONST XDPrintSchema::PageWatermark::WatermarkData& wmData - ); - - virtual ~CWMPTProperties(); - - HRESULT - GetType( - _Out_ XDPrintSchema::PageWatermark::EWatermarkOption* pType - ); - - HRESULT - GetLayering( - _Out_ XDPrintSchema::PageWatermark::Layering::ELayeringOption* pLayering - ); - - HRESULT - GetBounds( - _Out_ RectF* pBounds - ); - - HRESULT GetOrigin( - _Out_ PointF* pOrigin - ); - - HRESULT - GetAngle( - _Out_ REAL* pAngle - ); - - HRESULT - GetTransparency( - _Out_ INT* pTransparency - ); - - HRESULT - GetOpacity( - _Out_ REAL* pOpacity - ); - - HRESULT - GetTransparency( - _Outptr_ BSTR* pbstrTransparency - ); - - HRESULT - GetOpacity( - _Outptr_ BSTR* pbstrOpacity - ); - - HRESULT - GetFontColor( - _Inout_ _At_(*pbstrColor, _Pre_maybenull_ _Post_valid_) BSTR* pbstrColor - ); - - HRESULT - GetText( - _Inout_ _At_(*pbstrText, _Pre_maybenull_ _Post_valid_) BSTR* pbstrText - ); - - HRESULT - GetFontSize( - _Out_ INT* pSize - ); - - HRESULT - GetFontEmSize( - _Outptr_ BSTR* pbstrSize - ); - -protected: - XDPrintSchema::PageWatermark::WatermarkData m_wmData; -}; - diff --git a/print/XPSDrvSmpl/src/filters/watermark/wmrast.cpp b/print/XPSDrvSmpl/src/filters/watermark/wmrast.cpp deleted file mode 100644 index d83a0783..00000000 --- a/print/XPSDrvSmpl/src/filters/watermark/wmrast.cpp +++ /dev/null @@ -1,271 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - wmrast.cpp - -Abstract: - - RasterGraphic watermark class implamentation. CRasterWatermark is the - raster implementation of the CWatermark class. This implements methods - for creating the page mark-up and adding the watermark resource to the - resource cache. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "wmrast.h" -#include "wmptprop.h" - -using XDPrintSchema::PageWatermark::EWatermarkOption; -using XDPrintSchema::PageWatermark::BitmapWatermark; - -/*++ - -Routine Name: - - CRasterWatermark::CRasterWatermark - -Routine Description: - - Constructor for the raster watermark class - -Arguments: - - wmProps - Watermark PrintTicket properties class - resourceID - Resource ID for the watermark - -Return Value: - - None - Throws CXDException(HRESULT) on an error - ---*/ -CRasterWatermark::CRasterWatermark( - _In_ CONST CWMPTProperties& wmProps, - _In_ CONST INT resourceID - ) : - CWatermark(wmProps), - m_wmBMP(wmProps, resourceID) -{ - HRESULT hr = S_OK; - - EWatermarkOption wmType; - - if (SUCCEEDED(hr = m_WMProps.GetType(&wmType))) - { - if (wmType != BitmapWatermark) - { - hr = E_INVALIDARG; - } - } - - if (FAILED(hr)) - { - throw CXDException(hr); - } -} - -/*++ - -Routine Name: - - CRasterWatermark::~CRasterWatermark - -Routine Description: - - Default destructor for the watermarks base class - -Arguments: - - None - -Return Value: - - None - ---*/ -CRasterWatermark::~CRasterWatermark() -{ -} - -/*++ - -Routine Name: - - CRasterWatermark::CreateXMLElement - -Routine Description: - - Method to create the XML markup which describes the transform and properties used - to present the watermark correctly on the page - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CRasterWatermark::CreateXMLElement( - VOID - ) -{ - ASSERTMSG(m_pDOMDoc != NULL, "NULL DOM document detected whilst creating text watermark\n"); - ASSERTMSG(m_bstrImageURI.Length() > 0, "Invalid image URI detected whilst creating text watermark\n"); - - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(m_pDOMDoc, E_PENDING))) - { - if (m_bstrImageURI.Length() == 0) - { - hr = E_PENDING; - } - } - - // - // We need to retrieve the bitmap bounds to calculate - // the correct render transform for the watermark - // - SizeF bmpDims; - CComBSTR bstrWMOpacity; - if (SUCCEEDED(hr) && - SUCCEEDED(hr = m_wmBMP.GetImageDimensions(&bmpDims)) && - SUCCEEDED(hr = m_WMProps.GetOpacity(&bstrWMOpacity))) - { - // - // The markup will look like this (square bracketed values "[]" - // describes content): - // - // <Path - // RenderTransform="[appropriate to scale, translate and rotate to the PT settings]" - // Data="M [corner coords of image] z"> - // <Path.Fill> - // <ImageBrush - // ImageSource="[image URI from cache]" - // Opacity="[opacity value from PT]" - // ViewboxUnits="Absolute" - // Viewbox="[image bounds]" - // ViewportUnits="Absolute" - // Viewport="[image bounds]" /> - // </Path.Fill> - // </Path> - // - CComPtr<IXMLDOMElement> pPathFill(NULL); - CComPtr<IXMLDOMElement> pImageBrush(NULL); - CComPtr<IXMLDOMNode> pInsertNode(NULL); - - CStringXDW strPathData; - CStringXDW strViewbox; - CStringXDW strViewport; - - CComBSTR bstrMatrixXForm; - - // - // Create the transform and elements and add attributes - // - try - { - strPathData.Format(L"M 0,0 L 0,%.2f %.2f,%.2f %.2f,0 z", bmpDims.Height, bmpDims.Width, bmpDims.Height, bmpDims.Width); - strViewbox.Format(L"0,0,%.2f,%.2f", bmpDims.Width, bmpDims.Height); - strViewport.Format(L"0,0,%.2f,%.2f", bmpDims.Width, bmpDims.Height); - - if (SUCCEEDED(hr = CreateWMTransform(RectF(0, 0, bmpDims.Width, bmpDims.Height), &bstrMatrixXForm)) && - SUCCEEDED(hr = m_pDOMDoc->createElement(CComBSTR(L"Path"), &m_pWMElem)) && - SUCCEEDED(hr = m_pDOMDoc->createElement(CComBSTR(L"Path.Fill"), &pPathFill)) && - SUCCEEDED(hr = m_pDOMDoc->createElement(CComBSTR(L"ImageBrush"), &pImageBrush)) && - SUCCEEDED(hr = m_pWMElem->setAttribute(CComBSTR(L"RenderTransform"), CComVariant(bstrMatrixXForm))) && - SUCCEEDED(hr = m_pWMElem->setAttribute(CComBSTR(L"Data"), CComVariant(strPathData.GetBuffer()))) && - SUCCEEDED(hr = pImageBrush->setAttribute(CComBSTR(L"ImageSource"), CComVariant(m_bstrImageURI))) && - SUCCEEDED(hr = pImageBrush->setAttribute(CComBSTR(L"Opacity"), CComVariant(bstrWMOpacity))) && - SUCCEEDED(hr = pImageBrush->setAttribute(CComBSTR(L"ViewboxUnits"), CComVariant(L"Absolute"))) && - SUCCEEDED(hr = pImageBrush->setAttribute(CComBSTR(L"Viewbox"), CComVariant(strViewbox.GetBuffer()))) && - SUCCEEDED(hr = pImageBrush->setAttribute(CComBSTR(L"ViewportUnits"), CComVariant(L"Absolute"))) && - SUCCEEDED(hr = pImageBrush->setAttribute(CComBSTR(L"Viewport"), CComVariant(strViewport.GetBuffer()))) && - SUCCEEDED(hr = pPathFill->appendChild(pImageBrush, &pInsertNode)) && - SUCCEEDED(hr = m_pWMElem->appendChild(pPathFill, &pInsertNode))) - { - hr = m_pWMElem->appendChild(pPathFill, &pInsertNode); - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CRasterWatermark::AddParts - -Routine Description: - - Method to add the watermark bitmap resource to the cache - -Arguments: - - pXpsConsumer - Pointer to the writer used when writing the resource back out to the pipeline - pFixedPage - Pointer to the fixed page associated with the bitmap - pResCache - Pointer to a resource cache object which manages the writing of the bitmap - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CRasterWatermark::AddParts( - _In_ IXpsDocumentConsumer* pXpsConsumer, - _In_ IFixedPage* pFixedPage, - _In_ CFileResourceCache* pResCache - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pXpsConsumer, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pFixedPage, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pResCache, E_POINTER))) - { - // - // Write the font resource to the cache - // - m_bstrImageURI.Empty(); - CComBSTR bstrKey; - if (SUCCEEDED(hr = m_wmBMP.CheckResID()) && - SUCCEEDED(hr = pResCache->WriteResource<IPartImage>(pXpsConsumer, pFixedPage, &m_wmBMP)) && - SUCCEEDED(hr = m_wmBMP.GetKeyName(&bstrKey))) - { - hr = pResCache->GetURI(bstrKey, &m_bstrImageURI); - } - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/watermark/wmrast.h b/print/XPSDrvSmpl/src/filters/watermark/wmrast.h deleted file mode 100644 index 22e17b85..00000000 --- a/print/XPSDrvSmpl/src/filters/watermark/wmrast.h +++ /dev/null @@ -1,58 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - wmrast.h - -Abstract: - - RasterGraphic watermark class definition. CRasterWatermark is the - raster implementation of the CWatermark class. This implements methods - for creating the page mark-up and adding the watermark resource to the - resource cache. - ---*/ - -#pragma once - -#include "wmbase.h" -#include "wmimg.h" -#include "wmptprop.h" - -class CRasterWatermark : public CWatermark -{ -public: - CRasterWatermark( - _In_ CONST CWMPTProperties& wmProps, - _In_ CONST INT resourceID - ); - - virtual ~CRasterWatermark(); - - virtual HRESULT - CreateXMLElement( - VOID - ); - - virtual HRESULT - AddParts( - _In_ IXpsDocumentConsumer* pXpsConsumer, - _In_ IFixedPage* pFixedPage, - _In_ CFileResourceCache* pResCache - ); - -private: - CComBSTR m_bstrImageURI; - - CWatermarkImage m_wmBMP; -}; - diff --git a/print/XPSDrvSmpl/src/filters/watermark/wmres.h b/print/XPSDrvSmpl/src/filters/watermark/wmres.h deleted file mode 100644 index 0df8f4d4..00000000 --- a/print/XPSDrvSmpl/src/filters/watermark/wmres.h +++ /dev/null @@ -1,27 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - wmres.h - -Abstract: - - Warmark specific resource defines. - ---*/ - -#pragma once - -#define IDR_WM_PNG1 101 - -#define IDR_WM_XPS1 201 - diff --git a/print/XPSDrvSmpl/src/filters/watermark/wmsax.cpp b/print/XPSDrvSmpl/src/filters/watermark/wmsax.cpp deleted file mode 100644 index be165d53..00000000 --- a/print/XPSDrvSmpl/src/filters/watermark/wmsax.cpp +++ /dev/null @@ -1,427 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - wmsax.cpp - -Abstract: - - Watermark sax handler implementation. The watermark SAX handler is - responsible for parsing the FixedPage mark-up for the page size and - adding the inserting the watermark mark-up in appropriate place. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "wmsax.h" - -/*++ - -Routine Name: - - CWMSaxHandler::CWMSaxHandler - -Routine Description: - - Contructor for the watermark filters SAX handler. - The constructor registers a writer for streaming out any markup and a watermark - handler object for generating any new watermark markup and handling related resources - -Arguments: - - pWriter - Pointer to a write stream which receives markup - pWatermark - Pointer to a watermark handler object - -Return Value: - - None - Throws CXDException(HRESULT) on an error - ---*/ -CWMSaxHandler::CWMSaxHandler( - _In_ IPrintWriteStream* pWriter, - _In_ CWatermark* pWatermark - ) : - m_pWriter(pWriter), - m_watermark(pWatermark), - m_bOpenTag(FALSE) -{ - ASSERTMSG(m_pWriter != NULL, "NULL writer passed to watermark SAX handler.\n"); - ASSERTMSG(m_watermark != NULL, "NULL watermark passed to watermark SAX handler.\n"); - - HRESULT hr = S_OK; - if (FAILED(hr = CHECK_POINTER(m_pWriter, E_POINTER)) || - FAILED(hr = CHECK_POINTER(m_watermark, E_POINTER))) - { - throw CXDException(hr); - } -} - -/*++ - -Routine Name: - - CWMSaxHandler::~CWMSaxHandler - -Routine Description: - - Default destructor for the watermark filter SAX handler - -Arguments: - - None - -Return Value: - - None - ---*/ -CWMSaxHandler::~CWMSaxHandler() -{ -} - -/*++ - -Routine Name: - - CWMSaxHandler::startElement - -Routine Description: - - SAX handler method which handles each start element for the XML markup - -Arguments: - - pwchQName - Pointer to a string containing the element name - cchQName - Count of the number of characters in the element name - pAttributes - Pointer to the attribute list for the supplied element - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT STDMETHODCALLTYPE -CWMSaxHandler::startElement( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - _In_reads_(cchQName) CONST wchar_t* pwchQName, - _In_ INT cchQName, - _In_ ISAXAttributes* pAttributes - ) -{ - HRESULT hr = S_OK; - CStringXDW cstrOut; - - try - { - // - // Check if we need to close an opened tag - // - if (m_bOpenTag) - { - cstrOut.Append(L">"); - } - - // - // Store the opened element name so we can handle nested elements - // - m_bstrOpenElement = CComBSTR(cchQName, pwchQName); - - // - // Write out element - // - cstrOut.Append(L"<"); - cstrOut.Append(m_bstrOpenElement); - } - catch (CXDException& e) - { - hr = e; - } - - // - // We opened a tag - // - m_bOpenTag = TRUE; - - // - // If this is the fixed page we need the width and height retreived - // - BOOL bIsFixedPage = (m_bstrOpenElement == L"FixedPage"); - - // - // Find the number of attributes and enumerate over all of them - // - INT cAttributes = 0; - if (SUCCEEDED(hr) && - SUCCEEDED(hr = pAttributes->getLength(&cAttributes))) - { - for (INT cIndex = 0; cIndex < cAttributes; cIndex++) - { - PCWSTR pszAttUri = NULL; - INT cchAttUri = 0; - PCWSTR pszAttName = NULL; - INT cchAttName = 0; - PCWSTR pszAttQName = NULL; - INT cchAttQName = 0; - PCWSTR pszAttValue = NULL; - INT cchAttValue = 0; - - // - // Get the attribute data ready to write out - // - if (SUCCEEDED(hr = pAttributes->getName(cIndex, - &pszAttUri, - &cchAttUri, - &pszAttName, - &cchAttName, - &pszAttQName, - &cchAttQName))) - { - if (SUCCEEDED(pAttributes->getValue(cIndex, &pszAttValue, &cchAttValue))) - { - try - { - CComBSTR bstrAttName(cchAttQName, pszAttQName); - CComBSTR bstrAttValue(cchAttValue, pszAttValue); - - // - // Delimit attributes with a space - // - cstrOut.Append(L" "); - - // - // Reconstruct the attribute and write back to - // the fixed page - // - cstrOut.Append(bstrAttName); - cstrOut.Append(L"=\""); - - // - // If this is a UnicodeString we may need to escape entities - // - if (bstrAttName == L"UnicodeString") - { - hr = EscapeEntity(&bstrAttValue); - } - - cstrOut.Append(bstrAttValue); - cstrOut.Append(L"\""); - } - catch (CXDException& e) - { - hr = e; - } - } - } - } - } - - // - // We output the mark-up here for underlaid watermarks - // - if (SUCCEEDED(hr) && - bIsFixedPage) - { - // - // If this is the fixed page element make sure we close it in case the - // page has no content. - // - try - { - cstrOut.Append(L">"); - m_bOpenTag = FALSE; - } - catch (CXDException& e) - { - hr = e; - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_POINTER(m_watermark, E_PENDING))) - { - - // - // Create the watermark markup - // - if (SUCCEEDED(hr) && - SUCCEEDED(hr = m_watermark->CreateXMLElement())) - { - // - // Check if the mark-up needs to inserted at the start of the - // fixed page (underlay) - // - if (m_watermark->InsertStart()) - { - CComBSTR bstrWMText; - if (SUCCEEDED(hr = m_watermark->GetXML(&bstrWMText))) - { - // - // Insert the watermark mark-up - // - cstrOut.Append(bstrWMText); - } - } - } - } - } - - if (SUCCEEDED(hr)) - { - hr = WriteToPrintStream(&cstrOut, m_pWriter); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWMSaxHandler::endElement - -Routine Description: - - SAX handler method which handles each end element for the XML markup - -Arguments: - - pwchQName - Pointer to a string containing the element name - cchQName - Count of the number of characters in the element name - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT STDMETHODCALLTYPE -CWMSaxHandler::endElement( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - _In_reads_(cchQName) CONST wchar_t* pwchQName, - _In_ INT cchQName - ) -{ - HRESULT hr = S_OK; - CStringXDW cstrClose; - - try - { - CComBSTR bstrElement(cchQName, pwchQName); - - if (bstrElement == L"FixedPage") - { - if (SUCCEEDED(hr = CHECK_POINTER(m_watermark, E_PENDING)) && - m_watermark->InsertEnd()) - { - CComBSTR bstrWMText; - if (SUCCEEDED(hr = m_watermark->GetXML(&bstrWMText))) - { - cstrClose.Append(bstrWMText); - } - } - } - - // - // If this element matches the current open element, use shorthand to close - // the tag - // - if (bstrElement == m_bstrOpenElement && - m_bOpenTag) - { - cstrClose.Append(L"/>"); - } - else - { - // - // Close the element - // - cstrClose.Append(L"</"); - cstrClose.Append(bstrElement); - cstrClose.Append(L">"); - } - } - catch (CXDException& e) - { - hr = e; - } - - if (SUCCEEDED(hr)) - { - hr = WriteToPrintStream(&cstrClose, m_pWriter); - } - - m_bOpenTag = FALSE; - - ERR_ON_HR(hr); - return hr; -} - - -/*++ - -Routine Name: - - CWMSaxHandler::startDocument - -Routine Description: - - SAX handler method which handles the start document call to ensure - the xml version is correctly set - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT STDMETHODCALLTYPE -CWMSaxHandler::startDocument( - void - ) -{ - HRESULT hr = S_OK; - - try - { - if (SUCCEEDED(hr = CHECK_POINTER(m_pWriter, E_FAIL))) - { - CStringXDW cstrOut(L"<?xml version=\"1.0\" encoding=\"utf-8\"?>"); - hr = WriteToPrintStream(&cstrOut, m_pWriter); - } - } - catch (CXDException& e) - { - hr = e; - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/watermark/wmsax.h b/print/XPSDrvSmpl/src/filters/watermark/wmsax.h deleted file mode 100644 index cd76ca9e..00000000 --- a/print/XPSDrvSmpl/src/filters/watermark/wmsax.h +++ /dev/null @@ -1,74 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - wmsax.h - -Abstract: - - Watermark sax handler definition. The watermark SAX handler is responsible for - parsing the FixedPage mark-up for the page size and inserting the watermark mark-up - in appropriate place. - ---*/ - -#pragma once - -#include "saxhndlr.h" -#include "wmtext.h" - -class CWMSaxHandler : public CSaxHandler -{ -public: - CWMSaxHandler( - _In_ IPrintWriteStream* pWriter, - _In_ CWatermark* pWatermark - ); - - virtual ~CWMSaxHandler(); - - virtual HRESULT STDMETHODCALLTYPE - startElement( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - _In_reads_(cchQName) CONST wchar_t* pwchQName, - _In_ INT cchQName, - _In_ ISAXAttributes* pAttributes - ); - - virtual HRESULT STDMETHODCALLTYPE - endElement( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - _In_reads_(cchQName) CONST wchar_t* pwchQName, - _In_ INT cchQName - ); - - HRESULT STDMETHODCALLTYPE - startDocument( - void - ); - -private: - CComPtr<IPrintWriteStream> m_pWriter; - - CComBSTR m_bstrOpenElement; - - BOOL m_bOpenTag; - - CWatermark* m_watermark; -}; - diff --git a/print/XPSDrvSmpl/src/filters/watermark/wmtext.cpp b/print/XPSDrvSmpl/src/filters/watermark/wmtext.cpp deleted file mode 100644 index a249648d..00000000 --- a/print/XPSDrvSmpl/src/filters/watermark/wmtext.cpp +++ /dev/null @@ -1,250 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - wmtext.cpp - -Abstract: - - Text watermark class implamentation. CTextWatermark is the - text implementation of the CWatermark class. This implements methods - for creating the page mark-up and adding the watermark resource to the - resource cache. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdexcept.h" -#include "wmtext.h" -#include "wmptprop.h" -#include "rescache.h" - -using XDPrintSchema::PageWatermark::EWatermarkOption; -using XDPrintSchema::PageWatermark::TextWatermark; - -/*++ - -Routine Name: - - CTextWatermark::CTextWatermark - -Routine Description: - - Constructor for the text watermark class - -Arguments: - - wmProps - Watermark PrintTicket properties class - -Return Value: - - None - Throws CXDException(HRESULT) on an error - ---*/ -CTextWatermark::CTextWatermark( - _In_ CONST CWMPTProperties& wmProps - ) : - CWatermark(wmProps), - m_wmFont(wmProps) -{ - HRESULT hr = S_OK; - - EWatermarkOption wmType; - - if (SUCCEEDED(hr = m_WMProps.GetType(&wmType))) - { - if (wmType != TextWatermark) - { - hr = E_INVALIDARG; - } - } - - if (FAILED(hr)) - { - throw CXDException(hr); - } -} - -/*++ - -Routine Name: - - CTextWatermark::~CTextWatermark - -Routine Description: - - Default destructor for the watermarks base class - -Arguments: - - None - -Return Value: - - None - ---*/ -CTextWatermark::~CTextWatermark() -{ -} - -/*++ - -Routine Name: - - CTextWatermark::CreateXMLElement - -Routine Description: - - Method to create the XML markup which describes the transform and properties used - to present the watermark correctly on the page - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CTextWatermark::CreateXMLElement( - VOID - ) -{ - ASSERTMSG(m_pDOMDoc != NULL, "NULL DOM document detected whilst creating text watermark\n"); - ASSERTMSG(m_bstrFontURI.Length() > 0, "Invalid font URI detected whilst creating text watermark\n"); - - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(m_pDOMDoc, E_PENDING))) - { - if (m_bstrFontURI.Length() == 0) - { - hr = E_PENDING; - } - } - - PointF stringOrigin; - - CComBSTR bstrWMText; - CComBSTR bstrWMOpacity; - CComBSTR bstrWMFontSize; - CComBSTR bstrWMFontColor; - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = m_WMProps.GetText(&bstrWMText)) && - SUCCEEDED(hr = m_WMProps.GetFontColor(&bstrWMFontColor)) && - SUCCEEDED(hr = m_WMProps.GetFontEmSize(&bstrWMFontSize)) && - SUCCEEDED(hr = m_WMProps.GetOpacity(&bstrWMOpacity)) && - SUCCEEDED(hr = m_WMProps.GetOrigin(&stringOrigin))) - { - // - // The markup will look like this (square bracketed values "[]" - // describes content): - // - // <Glyphs - // Fill="[color ref]" - // Opacity="[float value between 0 and 1]" - // RenderTransform="[matrix transform from PT angle and offset]" - // FontURI="[font URI]" - // FontRenderingEmSize="[em size]" - // OriginX="0" - // OriginY="0" - // UnicodeString="[the watermark text]" - // /> - // - CComBSTR bstrMatrixXForm; - - CComBSTR bstrFontName(L"/"); - hr = bstrFontName.Append(m_bstrFontURI); - - // - // Create the transform and element and add attributes - // - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CreateWMTransform(stringOrigin, &bstrMatrixXForm)) && - SUCCEEDED(hr = m_pDOMDoc->createElement(CComBSTR(L"Glyphs"), &m_pWMElem)) && - SUCCEEDED(hr = m_pWMElem->setAttribute(CComBSTR(L"Fill"), CComVariant(bstrWMFontColor))) && - SUCCEEDED(hr = m_pWMElem->setAttribute(CComBSTR(L"Opacity"), CComVariant(bstrWMOpacity))) && - SUCCEEDED(hr = m_pWMElem->setAttribute(CComBSTR(L"RenderTransform"), CComVariant(bstrMatrixXForm))) && - SUCCEEDED(hr = m_pWMElem->setAttribute(CComBSTR(L"FontUri"), CComVariant(bstrFontName))) && - SUCCEEDED(hr = m_pWMElem->setAttribute(CComBSTR(L"FontRenderingEmSize"), CComVariant(bstrWMFontSize))) && - SUCCEEDED(hr = m_pWMElem->setAttribute(CComBSTR(L"OriginX"), CComVariant(L"0"))) && - SUCCEEDED(hr = m_pWMElem->setAttribute(CComBSTR(L"OriginY"), CComVariant(L"0")))) - { - hr = m_pWMElem->setAttribute(CComBSTR(L"UnicodeString"), CComVariant(bstrWMText)); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CTextWatermark::AddParts - -Routine Description: - - Method to add the watermark font resource to the cache - -Arguments: - - pXpsConsumer - Pointer to the writer used when writing the resource back out to the pipeline - pFixedPage - Pointer to the fixed page associated with the font - pResCache - Pointer to a resource cache object which manages the writing of the font - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CTextWatermark::AddParts( - _In_ IXpsDocumentConsumer* pXpsConsumer, - _In_ IFixedPage* pFixedPage, - _In_ CFileResourceCache* pResCache - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pXpsConsumer, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pFixedPage, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pResCache, E_POINTER))) - { - // - // Write the font resource to the cache - // - m_bstrFontURI.Empty(); - CComBSTR bstrKey; - if (SUCCEEDED(hr = pResCache->WriteResource<IPartFont>(pXpsConsumer, pFixedPage, &m_wmFont)) && - SUCCEEDED(hr = m_wmFont.GetKeyName(&bstrKey))) - { - hr = pResCache->GetURI(bstrKey, &m_bstrFontURI); - } - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/watermark/wmtext.h b/print/XPSDrvSmpl/src/filters/watermark/wmtext.h deleted file mode 100644 index ff439fdc..00000000 --- a/print/XPSDrvSmpl/src/filters/watermark/wmtext.h +++ /dev/null @@ -1,57 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - wmtext.h - -Abstract: - - Text watermark class definition. CTextWatermark is the - text implementation of the CWatermark class. This implements methods - for creating the page mark-up and adding the watermark resource to the - resource cache. - ---*/ - -#pragma once - -#include "wmbase.h" -#include "wmfont.h" -#include "rescache.h" - -class CTextWatermark : public CWatermark -{ -public: - CTextWatermark( - _In_ CONST CWMPTProperties& wmProps - ); - - virtual ~CTextWatermark(); - - virtual HRESULT - CreateXMLElement( - VOID - ); - - virtual HRESULT - AddParts( - _In_ IXpsDocumentConsumer* pXpsConsumer, - _In_ IFixedPage* pFixedPage, - _In_ CFileResourceCache* pResCache - ); - -private: - CComBSTR m_bstrFontURI; - - CWatermarkFont m_wmFont; -}; - diff --git a/print/XPSDrvSmpl/src/filters/watermark/wmvect.cpp b/print/XPSDrvSmpl/src/filters/watermark/wmvect.cpp deleted file mode 100644 index 3c73b2ba..00000000 --- a/print/XPSDrvSmpl/src/filters/watermark/wmvect.cpp +++ /dev/null @@ -1,279 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - wmvect.cpp - -Abstract: - - VectorGraphic watermark class implamentation. CVectorWatermark is the - vecotr implementation of the CWatermark class. This implements methods - for creating the page mark-up and adding the watermark resource to the - markup. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "wmvect.h" -#include "wmptprop.h" - -using XDPrintSchema::PageWatermark::EWatermarkOption; -using XDPrintSchema::PageWatermark::VectorWatermark; - -/*++ - -Routine Name: - - CVectorWatermark::CVectorWatermark - -Routine Description: - - Constructor for the vector watermark class - -Arguments: - - wmProps - Watermark PrintTicket properties class - resourceID - Resource ID for the watermark - -Return Value: - - None - Throws CXDException(HRESULT) on an error - ---*/ -CVectorWatermark::CVectorWatermark( - _In_ CONST CWMPTProperties& wmProps, - _In_ CONST INT resourceID - ) : - CWatermark(wmProps), - m_wmMarkup(wmProps, resourceID) -{ - HRESULT hr = S_OK; - - EWatermarkOption wmType; - - if (SUCCEEDED(hr = m_WMProps.GetType(&wmType))) - { - if (wmType != VectorWatermark) - { - hr = E_INVALIDARG; - } - } - - if (FAILED(hr)) - { - throw CXDException(hr); - } -} - -/*++ - -Routine Name: - - CVectorWatermark::~CVectorWatermark - -Routine Description: - - Default destructor for the watermarks base class - -Arguments: - - None - -Return Value: - - None - ---*/ -CVectorWatermark::~CVectorWatermark() -{ -} - -/*++ - -Routine Name: - - CVectorWatermark::CreateXMLElement - -Routine Description: - - Method to create the XML markup which describes the transform and properties used - to present the watermark correctly on the page - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CVectorWatermark::CreateXMLElement( - VOID - ) -{ - ASSERTMSG(m_pDOMDoc != NULL, "NULL DOM document detected whilst creating text watermark\n"); - - HRESULT hr = S_OK; - - // - // We need to retrieve the RAW Markup bounds to calculate - // the correct render transform for the watermark - // - SizeF markupDims; - CComBSTR bstrWMOpacity; - if (SUCCEEDED(hr = CHECK_POINTER(m_pDOMDoc, E_PENDING)) && - SUCCEEDED(hr = m_wmMarkup.GetImageDimensions(&markupDims)) && - SUCCEEDED(hr = m_WMProps.GetOpacity(&bstrWMOpacity))) - { - // - // The markup will look like this (square bracketed values "[]" - // describes content): - // - // <Canvas - // Opacity="[appropriate transparency value]" - // RenderTransform="[appropriate to scale, translate and rotate to the PT settings]" - // [Raw Markup] - // </Canvas> - // - CComBSTR bstrMatrixXForm; - - if (SUCCEEDED(hr = CreateWMTransform(RectF(0, 0, markupDims.Width, markupDims.Height), &bstrMatrixXForm))) - { - try - { - CStringXDW strOpenCanvas; - strOpenCanvas.Format(L"<Canvas Opacity=\"%s\" RenderTransform=\"%s\">", - static_cast<LPCWSTR>(bstrWMOpacity), static_cast<LPCWSTR>(bstrMatrixXForm)); - - IStream* pStream; - CComBSTR bstrContent; - - if (SUCCEEDED(hr = m_wmMarkup.GetStream(&pStream)) && - SUCCEEDED(hr = bstrContent.ReadFromStream(pStream))) - { - m_bstrMarkup.Empty(); - - if (SUCCEEDED(hr = m_bstrMarkup.Append(strOpenCanvas)) && - SUCCEEDED(hr = m_bstrMarkup.Append(bstrContent))) - { - hr = m_bstrMarkup.Append(L"</Canvas>\n"); - } - } - } - catch (CXDException& e) - { - hr = e; - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CVectorWatermark::GetXML - -Routine Description: - - Method for copying the XML markup which describes the watermark text - -Arguments: - - pbstrXML - Pointer to the string to contain the XML vector markup. Any BSTR - this points to will be freed. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CVectorWatermark::GetXML( - _Inout_ _At_(*pbstrXML, _Pre_maybenull_ _Post_valid_) BSTR* pbstrXML - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrXML, E_POINTER))) - { - SysFreeString(*pbstrXML); - - if (m_bstrMarkup.Length() > 0) - { - if (SUCCEEDED(hr = m_bstrMarkup.CopyTo(pbstrXML)) && - !*pbstrXML) - { - hr = E_OUTOFMEMORY; - } - } - else - { - hr = E_PENDING; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CVectorWatermark::AddParts - -Routine Description: - - Method to add any required resource to the cache. - This isn't required for vector based watermarks. - -Arguments: - - pXpsConsumer - Pointer to the writer used when writing the resource back out to the pipeline - pFixedPage - Pointer to the fixed page associated with the resource - pResCache - Pointer to a resource cache object which manages the writing of the resource - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CVectorWatermark::AddParts( - _In_ IXpsDocumentConsumer*, - _In_ IFixedPage*, - _In_ CFileResourceCache* - ) -{ - // - // No Implementation required. - // - - return S_OK; -} - diff --git a/print/XPSDrvSmpl/src/filters/watermark/wmvect.h b/print/XPSDrvSmpl/src/filters/watermark/wmvect.h deleted file mode 100644 index 54b9e01c..00000000 --- a/print/XPSDrvSmpl/src/filters/watermark/wmvect.h +++ /dev/null @@ -1,62 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - wmvect.h - -Abstract: - - VectorGraphic watermark class definition. CVectorWatermark is the - Vector implementation of the CWatermark class. This implements methods - for creating the page mark-up and adding the watermark resource to fixed page. - ---*/ - -#pragma once - -#include "wmbase.h" -#include "wmxps.h" -#include "wmptprop.h" - -class CVectorWatermark : public CWatermark -{ -public: - CVectorWatermark( - _In_ CONST CWMPTProperties& wmProps, - _In_ CONST INT resourceID - ); - - virtual ~CVectorWatermark(); - - virtual HRESULT - CreateXMLElement( - VOID - ); - - virtual HRESULT - GetXML( - _Inout_ _At_(*pbstrXML, _Pre_maybenull_ _Post_valid_) BSTR* pbstrXML - ); - - virtual HRESULT - AddParts( - _In_ IXpsDocumentConsumer* pXpsConsumer, - _In_ IFixedPage* pFixedPage, - _In_ CFileResourceCache* pResCache - ); - -private: - CWatermarkMarkup m_wmMarkup; - - CComBSTR m_bstrMarkup; -}; - diff --git a/print/XPSDrvSmpl/src/filters/watermark/wmxps.cpp b/print/XPSDrvSmpl/src/filters/watermark/wmxps.cpp deleted file mode 100644 index 82d819e8..00000000 --- a/print/XPSDrvSmpl/src/filters/watermark/wmxps.cpp +++ /dev/null @@ -1,291 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - wmxps.cpp - -Abstract: - - Watermark XPS markup class implementation. The CWatermarkMarkup class is responsible - for creating a stream that contains markup loaded from a resource. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdexcept.h" -#include "wmxps.h" - -using XDPrintSchema::PageWatermark::EWatermarkOption; -using XDPrintSchema::PageWatermark::VectorWatermark; - -/*++ - -Routine Name: - - CWatermarkMarkup::CWatermarkMarkup - -Routine Description: - - Constructor for the CWatermarkMarkup vector management class - which sets the member variables to sensible defaults and - ensures the current watermark is a vector based watermark - -Arguments: - - wmProps - Object containing the PrintTicket settings - resourceID - Resource ID for the watermark - -Return Value: - - None - Throws CXDException(HRESULT) on an error - ---*/ -CWatermarkMarkup::CWatermarkMarkup( - _In_ CONST CWMPTProperties& wmProps, - _In_ CONST INT resourceID - ) : - m_WMProps(wmProps), - m_resourceID(resourceID) -{ - HRESULT hr = S_OK; - - EWatermarkOption wmType; - - if (SUCCEEDED(hr = m_WMProps.GetType(&wmType))) - { - if (wmType != VectorWatermark) - { - hr = E_INVALIDARG; - } - } - - if (FAILED(hr)) - { - throw CXDException(hr); - } -} - -/*++ - -Routine Name: - - CWatermarkMarkup::~CWatermarkMarkup - -Routine Description: - - Default destructor for the font management class - -Arguments: - - None - -Return Value: - - None - ---*/ -CWatermarkMarkup::~CWatermarkMarkup() -{ -} - -/*++ - -Routine Name: - - CWatermarkMarkup::GetImageDimensions - -Routine Description: - - Method to obtain the width and height for the watermark vector image - -Arguments: - - pDimensions - Pointer to a structure which will hold the vector image dimensions - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWatermarkMarkup::GetImageDimensions( - _Out_ SizeF* pDimensions - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pDimensions, E_POINTER))) - { - // - // Currently fixed to A4 dimensions - // - pDimensions->Width = 793.76f; - pDimensions->Height = 1122.56f; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWatermarkMarkup::CreateXPSStream - -Routine Description: - - Method for writing out the vector image to the container - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWatermarkMarkup::CreateXPSStream( - VOID - ) -{ - HRESULT hr = S_OK; - - if (m_pXPSStream == NULL) - { - HRSRC hrSrc = FindResourceEx(g_hInstance, - RT_RCDATA, - MAKEINTRESOURCE(m_resourceID), - MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US)); - if (hrSrc != NULL) - { - // - // Load the resource - // - HGLOBAL hXPSRes = LoadResource(g_hInstance, hrSrc); - - if (hXPSRes != NULL) - { - if (SUCCEEDED(hr = CreateStreamOnHGlobal(NULL, TRUE, &m_pXPSStream))) - { - // - // Retrieve the XPS data and the size of the data - // - PVOID pXPSData = LockResource(hXPSRes); - DWORD cbXPSData = SizeofResource(g_hInstance, hrSrc); - - if (SUCCEEDED(hr = CHECK_POINTER(pXPSData, E_FAIL)) && - cbXPSData > 0) - { - ULONG cbTotalWritten = 0; - - // - // Write the size of the data to the stream. - // This is required as the stream will be read back using the CComBSTR ReadFromStream() method - // - DWORD cbXPSDataWithTerm = cbXPSData + sizeof(OLECHAR); - - if (SUCCEEDED(hr = m_pXPSStream->Write(&cbXPSDataWithTerm, sizeof(cbXPSDataWithTerm), &cbTotalWritten))) - { - // - // Write the data to the stream - // Note the XPS data content must be in Unicode format to be compatible with - // the CComBSTR ReadFromStream() method. - // - ULONG cbWritten = 0; - - if (SUCCEEDED(hr = m_pXPSStream->Write(pXPSData, cbXPSData, &cbWritten))) - { - cbTotalWritten += cbWritten; - - hr = m_pXPSStream->Write(OLESTR("\0"), sizeof(OLECHAR), &cbWritten); - cbTotalWritten += cbWritten; - } - } - } - } - - FreeResource(hXPSRes); - } - else - { - hr = GetLastErrorAsHResult(); - } - } - else - { - hr = GetLastErrorAsHResult(); - } - } - - // - // Make sure the stream is pointing back at the start of the data - // - if (SUCCEEDED(hr)) - { - LARGE_INTEGER cbMoveFromStart = {0}; - - hr = m_pXPSStream->Seek(cbMoveFromStart, - STREAM_SEEK_SET, - NULL); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWatermarkMarkup::GetStream - -Routine Description: - - Method for obtaining a stream to write the vector image out to - -Arguments: - - ppStream - Pointer to a pointer to the stream - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWatermarkMarkup::GetStream( - _Out_ IStream** ppStream - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppStream, E_POINTER)) && - SUCCEEDED(hr = CreateXPSStream())) - { - *ppStream = m_pXPSStream; - } - - ERR_ON_HR(hr); - return hr; -} diff --git a/print/XPSDrvSmpl/src/filters/watermark/wmxps.h b/print/XPSDrvSmpl/src/filters/watermark/wmxps.h deleted file mode 100644 index 125edaac..00000000 --- a/print/XPSDrvSmpl/src/filters/watermark/wmxps.h +++ /dev/null @@ -1,60 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - wmxps.h - -Abstract: - - Watermark XPS markup class definition. The CWatermarkMarkup class is responsible - for creating a stream that contains markup loaded from a resource. - ---*/ - -#pragma once - -#include "wmptprop.h" - -class CWatermarkMarkup -{ -public: - CWatermarkMarkup( - _In_ CONST CWMPTProperties& wmProps, - _In_ CONST INT resourceID - ); - - ~CWatermarkMarkup(); - - HRESULT - GetImageDimensions( - _Out_ SizeF* pDimensions - ); - - HRESULT - GetStream( - _Out_ IStream** ppStream - ); - -private: - HRESULT - CreateXPSStream( - VOID - ); - -private: - CWMPTProperties m_WMProps; - - INT m_resourceID; - - CComPtr<IStream> m_pXPSStream; -}; - diff --git a/print/XPSDrvSmpl/src/filters/watermark/xdwmark.def b/print/XPSDrvSmpl/src/filters/watermark/xdwmark.def deleted file mode 100644 index dee0a0d7..00000000 --- a/print/XPSDrvSmpl/src/filters/watermark/xdwmark.def +++ /dev/null @@ -1,26 +0,0 @@ -; -; Copyright (c) 2005 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. -; -; File Name: -; -; xdwmark.def -; -; Abstract: -; -; Watermark filter module definition file -; - -LIBRARY XDWMark - -EXPORTS - DllMain - DllCanUnloadNow PRIVATE - DllGetClassObject PRIVATE - diff --git a/print/XPSDrvSmpl/src/filters/watermark/xdwmark.vcxproj b/print/XPSDrvSmpl/src/filters/watermark/xdwmark.vcxproj deleted file mode 100644 index 65ba86ed..00000000 --- a/print/XPSDrvSmpl/src/filters/watermark/xdwmark.vcxproj +++ /dev/null @@ -1,582 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <ItemGroup Label="ProjectConfigurations"> - <ProjectConfiguration Include="Debug|ARM"> - <Configuration>Debug</Configuration> - <Platform>ARM</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Debug|ARM64"> - <Configuration>Debug</Configuration> - <Platform>ARM64</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Debug|Win32"> - <Configuration>Debug</Configuration> - <Platform>Win32</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release|ARM"> - <Configuration>Release</Configuration> - <Platform>ARM</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release|ARM64"> - <Configuration>Release</Configuration> - <Platform>ARM64</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release|Win32"> - <Configuration>Release</Configuration> - <Platform>Win32</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Debug|x64"> - <Configuration>Debug</Configuration> - <Platform>x64</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release|x64"> - <Configuration>Release</Configuration> - <Platform>x64</Platform> - </ProjectConfiguration> - </ItemGroup> - <PropertyGroup Label="Globals"> - <ProjectGuid>{E31D1C4F-8E0D-428A-8583-5159CE690B33}</ProjectGuid> - <RootNamespace>$(MSBuildProjectName)</RootNamespace> - <SupportsPackaging>false</SupportsPackaging> - <RequiresPackageProject>true</RequiresPackageProject> - <Configuration Condition="'$(Configuration)' == ''">Debug</Configuration> - <Platform Condition="'$(Platform)' == ''">Win32</Platform> - <SampleGuid>{026C20B0-65B4-4ECC-BD89-61D7F5EC7DE8}</SampleGuid> - </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> - <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>False</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>DynamicLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>False</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>DynamicLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>False</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>DynamicLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>True</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>DynamicLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>True</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>DynamicLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>True</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>DynamicLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>False</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>DynamicLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>True</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>DynamicLibrary</ConfigurationType> - </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> - <PropertyGroup> - <OutDir>$(IntDir)</OutDir> - </PropertyGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ItemGroup Label="WrappedTaskItems" /> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <TargetName>xdwmark</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'"> - <TargetName>xdwmark</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> - <TargetName>xdwmark</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <TargetName>xdwmark</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'"> - <TargetName>xdwmark</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> - <TargetName>xdwmark</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <TargetName>xdwmark</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <TargetName>xdwmark</TargetName> - </PropertyGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <Link> - <EntryPointSymbol Condition="'$(Platform)'=='win32'">_DllMainCRTStartup@12</EntryPointSymbol> - <EntryPointSymbol Condition="'$(Platform)'!='win32'">_DllMainCRTStartup</EntryPointSymbol> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'"> - <Link> - <EntryPointSymbol Condition="'$(Platform)'=='win32'">_DllMainCRTStartup@12</EntryPointSymbol> - <EntryPointSymbol Condition="'$(Platform)'!='win32'">_DllMainCRTStartup</EntryPointSymbol> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> - <Link> - <EntryPointSymbol Condition="'$(Platform)'=='win32'">_DllMainCRTStartup@12</EntryPointSymbol> - <EntryPointSymbol Condition="'$(Platform)'!='win32'">_DllMainCRTStartup</EntryPointSymbol> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <Link> - <EntryPointSymbol Condition="'$(Platform)'=='win32'">_DllMainCRTStartup@12</EntryPointSymbol> - <EntryPointSymbol Condition="'$(Platform)'!='win32'">_DllMainCRTStartup</EntryPointSymbol> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'"> - <Link> - <EntryPointSymbol Condition="'$(Platform)'=='win32'">_DllMainCRTStartup@12</EntryPointSymbol> - <EntryPointSymbol Condition="'$(Platform)'!='win32'">_DllMainCRTStartup</EntryPointSymbol> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> - <Link> - <EntryPointSymbol Condition="'$(Platform)'=='win32'">_DllMainCRTStartup@12</EntryPointSymbol> - <EntryPointSymbol Condition="'$(Platform)'!='win32'">_DllMainCRTStartup</EntryPointSymbol> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <Link> - <EntryPointSymbol Condition="'$(Platform)'=='win32'">_DllMainCRTStartup@12</EntryPointSymbol> - <EntryPointSymbol Condition="'$(Platform)'!='win32'">_DllMainCRTStartup</EntryPointSymbol> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <Link> - <EntryPointSymbol Condition="'$(Platform)'=='win32'">_DllMainCRTStartup@12</EntryPointSymbol> - <EntryPointSymbol Condition="'$(Platform)'!='win32'">_DllMainCRTStartup</EntryPointSymbol> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib</AdditionalDependencies> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib</AdditionalDependencies> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib</AdditionalDependencies> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib</AdditionalDependencies> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib</AdditionalDependencies> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib</AdditionalDependencies> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib</AdditionalDependencies> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib</AdditionalDependencies> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemGroup> - <ClCompile Include="dllentry.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="wmbase.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="wmflt.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="wmfont.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="wmimg.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="wmptprop.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="wmrast.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="wmsax.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="wmtext.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="wmvect.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="wmxps.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ResourceCompile Include="wmflt.rc" /> - </ItemGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <Link> - <ModuleDefinitionFile>xdwmark.def</ModuleDefinitionFile> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'"> - <Link> - <ModuleDefinitionFile>xdwmark.def</ModuleDefinitionFile> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> - <Link> - <ModuleDefinitionFile>xdwmark.def</ModuleDefinitionFile> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <Link> - <ModuleDefinitionFile>xdwmark.def</ModuleDefinitionFile> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'"> - <Link> - <ModuleDefinitionFile>xdwmark.def</ModuleDefinitionFile> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> - <Link> - <ModuleDefinitionFile>xdwmark.def</ModuleDefinitionFile> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <Link> - <ModuleDefinitionFile>xdwmark.def</ModuleDefinitionFile> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <Link> - <ModuleDefinitionFile>xdwmark.def</ModuleDefinitionFile> - </Link> - </ItemDefinitionGroup> - <ItemGroup> - <ClCompile Include="precompsrc.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Create</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - </ItemGroup> - <ItemGroup> - <Inf Exclude="@(Inf)" Include="*.inf" /> - <FilesToPackage Include="$(TargetPath)" Condition="'$(ConfigurationType)'=='Driver' or '$(ConfigurationType)'=='DynamicLibrary'" /> - </ItemGroup> - <ItemGroup> - <None Exclude="@(None)" Include="*.txt;*.htm;*.html" /> - <None Exclude="@(None)" Include="*.ico;*.cur;*.bmp;*.dlg;*.rct;*.gif;*.jpg;*.jpeg;*.wav;*.jpe;*.tiff;*.tif;*.png;*.rc2" /> - <None Exclude="@(None)" Include="*.def;*.bat;*.hpj;*.asmx" /> - </ItemGroup> - <ItemGroup> - <ClInclude Exclude="@(ClInclude)" Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd" /> - </ItemGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> -</Project>
\ No newline at end of file diff --git a/print/XPSDrvSmpl/src/filters/watermark/xdwmark.vcxproj.Filters b/print/XPSDrvSmpl/src/filters/watermark/xdwmark.vcxproj.Filters deleted file mode 100644 index 26028881..00000000 --- a/print/XPSDrvSmpl/src/filters/watermark/xdwmark.vcxproj.Filters +++ /dev/null @@ -1,233 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <ItemGroup> - <Filter Include="Source Files"> - <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;*</Extensions> - <UniqueIdentifier>{D41A7413-BCDC-4F43-A05E-64E4DECEEB59}</UniqueIdentifier> - </Filter> - <Filter Include="Header Files"> - <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions> - <UniqueIdentifier>{D59E1E53-E90B-4BC1-87E3-0D94C8AB6D45}</UniqueIdentifier> - </Filter> - <Filter Include="Resource Files"> - <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms;man;xml</Extensions> - <UniqueIdentifier>{70B7C8CE-B4D3-4816-980B-2376D8B2B6F1}</UniqueIdentifier> - </Filter> - </ItemGroup> - <ItemGroup> - <ClCompile Include="dllentry.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="precompsrc.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="wmbase.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="wmflt.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="wmfont.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="wmimg.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="wmptprop.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="wmrast.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="wmsax.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="wmtext.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="wmvect.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="wmxps.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - </ItemGroup> - <ItemGroup> - <ResourceCompile Include="wmflt.rc"> - <Filter>Resource Files</Filter> - </ResourceCompile> - </ItemGroup> - <ItemGroup> - <ClInclude Include="wmbase.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="wmflt.h" /> - <ClInclude Include="wmfont.h" /> - <ClInclude Include="wmimg.h" /> - <ClInclude Include="wmptprop.h" /> - <ClInclude Include="wmrast.h" /> - <ClInclude Include="wmres.h" /> - <ClInclude Include="wmsax.h" /> - <ClInclude Include="wmtext.h" /> - <ClInclude Include="wmvect.h" /> - <ClInclude Include="wmxps.h" /> - <ClInclude Include="wmbase.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="wmflt.h" /> - <ClInclude Include="wmfont.h" /> - <ClInclude Include="wmimg.h" /> - <ClInclude Include="wmptprop.h" /> - <ClInclude Include="wmrast.h" /> - <ClInclude Include="wmres.h" /> - <ClInclude Include="wmsax.h" /> - <ClInclude Include="wmtext.h" /> - <ClInclude Include="wmvect.h" /> - <ClInclude Include="wmxps.h" /> - <ClInclude Include="wmbase.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="wmflt.h" /> - <ClInclude Include="wmfont.h" /> - <ClInclude Include="wmimg.h" /> - <ClInclude Include="wmptprop.h" /> - <ClInclude Include="wmrast.h" /> - <ClInclude Include="wmres.h" /> - <ClInclude Include="wmsax.h" /> - <ClInclude Include="wmtext.h" /> - <ClInclude Include="wmvect.h" /> - <ClInclude Include="wmxps.h" /> - <ClInclude Include="wmbase.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="wmflt.h" /> - <ClInclude Include="wmfont.h" /> - <ClInclude Include="wmimg.h" /> - <ClInclude Include="wmptprop.h" /> - <ClInclude Include="wmrast.h" /> - <ClInclude Include="wmres.h" /> - <ClInclude Include="wmsax.h" /> - <ClInclude Include="wmtext.h" /> - <ClInclude Include="wmvect.h" /> - <ClInclude Include="wmxps.h" /> - <ClInclude Include="wmbase.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="wmflt.h" /> - <ClInclude Include="wmfont.h" /> - <ClInclude Include="wmimg.h" /> - <ClInclude Include="wmptprop.h" /> - <ClInclude Include="wmrast.h" /> - <ClInclude Include="wmres.h" /> - <ClInclude Include="wmsax.h" /> - <ClInclude Include="wmtext.h" /> - <ClInclude Include="wmvect.h" /> - <ClInclude Include="wmxps.h" /> - <ClInclude Include="wmbase.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="wmflt.h" /> - <ClInclude Include="wmfont.h" /> - <ClInclude Include="wmimg.h" /> - <ClInclude Include="wmptprop.h" /> - <ClInclude Include="wmrast.h" /> - <ClInclude Include="wmres.h" /> - <ClInclude Include="wmsax.h" /> - <ClInclude Include="wmtext.h" /> - <ClInclude Include="wmvect.h" /> - <ClInclude Include="wmxps.h" /> - <ClInclude Include="wmbase.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="wmflt.h" /> - <ClInclude Include="wmfont.h" /> - <ClInclude Include="wmimg.h" /> - <ClInclude Include="wmptprop.h" /> - <ClInclude Include="wmrast.h" /> - <ClInclude Include="wmres.h" /> - <ClInclude Include="wmsax.h" /> - <ClInclude Include="wmtext.h" /> - <ClInclude Include="wmvect.h" /> - <ClInclude Include="wmxps.h" /> - <ClInclude Include="wmbase.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="wmflt.h" /> - <ClInclude Include="wmfont.h" /> - <ClInclude Include="wmimg.h" /> - <ClInclude Include="wmptprop.h" /> - <ClInclude Include="wmrast.h" /> - <ClInclude Include="wmres.h" /> - <ClInclude Include="wmsax.h" /> - <ClInclude Include="wmtext.h" /> - <ClInclude Include="wmvect.h" /> - <ClInclude Include="wmxps.h" /> - <ClInclude Include="wmbase.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="wmflt.h" /> - <ClInclude Include="wmfont.h" /> - <ClInclude Include="wmimg.h" /> - <ClInclude Include="wmptprop.h" /> - <ClInclude Include="wmrast.h" /> - <ClInclude Include="wmres.h" /> - <ClInclude Include="wmsax.h" /> - <ClInclude Include="wmtext.h" /> - <ClInclude Include="wmvect.h" /> - <ClInclude Include="wmxps.h" /> - <ClInclude Include="wmbase.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="wmflt.h" /> - <ClInclude Include="wmfont.h" /> - <ClInclude Include="wmimg.h" /> - <ClInclude Include="wmptprop.h" /> - <ClInclude Include="wmrast.h" /> - <ClInclude Include="wmres.h" /> - <ClInclude Include="wmsax.h" /> - <ClInclude Include="wmtext.h" /> - <ClInclude Include="wmvect.h" /> - <ClInclude Include="wmxps.h" /> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - </ItemGroup> - <ItemGroup> - <None Include="*.ico;*.cur;*.bmp;*.dlg;*.rct;*.gif;*.jpg;*.jpeg;*.wav;*.jpe;*.tiff;*.tif;*.png;*.rc2"> - <Filter>Resource Files</Filter> - </None> - <None Include="*.def;*.bat;*.hpj;*.asmx"> - <Filter>Source Files</Filter> - </None> - </ItemGroup> -</Project>
\ No newline at end of file diff --git a/print/XPSDrvSmpl/src/filters/xdcont/precompsrc.cpp b/print/XPSDrvSmpl/src/filters/xdcont/precompsrc.cpp deleted file mode 100644 index 5944cf51..00000000 --- a/print/XPSDrvSmpl/src/filters/xdcont/precompsrc.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "precomp.h"
\ No newline at end of file diff --git a/print/XPSDrvSmpl/src/filters/xdcont/xdcont.vcxproj b/print/XPSDrvSmpl/src/filters/xdcont/xdcont.vcxproj deleted file mode 100644 index e7337bf9..00000000 --- a/print/XPSDrvSmpl/src/filters/xdcont/xdcont.vcxproj +++ /dev/null @@ -1,473 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <ItemGroup Label="ProjectConfigurations"> - <ProjectConfiguration Include="Debug|ARM"> - <Configuration>Debug</Configuration> - <Platform>ARM</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Debug|ARM64"> - <Configuration>Debug</Configuration> - <Platform>ARM64</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Debug|Win32"> - <Configuration>Debug</Configuration> - <Platform>Win32</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release|ARM"> - <Configuration>Release</Configuration> - <Platform>ARM</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release|ARM64"> - <Configuration>Release</Configuration> - <Platform>ARM64</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release|Win32"> - <Configuration>Release</Configuration> - <Platform>Win32</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Debug|x64"> - <Configuration>Debug</Configuration> - <Platform>x64</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release|x64"> - <Configuration>Release</Configuration> - <Platform>x64</Platform> - </ProjectConfiguration> - </ItemGroup> - <PropertyGroup Label="Globals"> - <ProjectGuid>{D38B87BF-5778-4DA8-8DCE-B0F37F087D5A}</ProjectGuid> - <RootNamespace>$(MSBuildProjectName)</RootNamespace> - <SupportsPackaging>false</SupportsPackaging> - <RequiresPackageProject>true</RequiresPackageProject> - <Configuration Condition="'$(Configuration)' == ''">Debug</Configuration> - <Platform Condition="'$(Platform)' == ''">Win32</Platform> - <SampleGuid>{08C4151B-A3CA-440F-9542-0B219834C1B3}</SampleGuid> - </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> - <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>False</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>StaticLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>False</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>StaticLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>False</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>StaticLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>True</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>StaticLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>True</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>StaticLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>True</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>StaticLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>False</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>StaticLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>True</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>StaticLibrary</ConfigurationType> - </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> - <PropertyGroup> - <OutDir>$(IntDir)</OutDir> - </PropertyGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ItemGroup Label="WrappedTaskItems" /> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <TargetName>xdcont</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'"> - <TargetName>xdcont</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> - <TargetName>xdcont</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <TargetName>xdcont</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'"> - <TargetName>xdcont</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> - <TargetName>xdcont</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <TargetName>xdcont</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <TargetName>xdcont</TargetName> - </PropertyGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib</AdditionalDependencies> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib</AdditionalDependencies> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib</AdditionalDependencies> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib</AdditionalDependencies> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib</AdditionalDependencies> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib</AdditionalDependencies> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib</AdditionalDependencies> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <ResourceCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <ClCompile> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - <Midl> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib</AdditionalDependencies> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);_UNICODE;UNICODE</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemGroup> - <ClCompile Include="precompsrc.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Create</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="xpsarch.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="xpsfd.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="xpsfds.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="xpsfiler.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="xpsfilew.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="xpsproc.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="xpsrels.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="xpstype.cpp"> - <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - </ItemGroup> - <ItemGroup> - <Inf Exclude="@(Inf)" Include="*.inf" /> - <FilesToPackage Include="$(TargetPath)" Condition="'$(ConfigurationType)'=='Driver' or '$(ConfigurationType)'=='DynamicLibrary'" /> - </ItemGroup> - <ItemGroup> - <None Exclude="@(None)" Include="*.txt;*.htm;*.html" /> - <None Exclude="@(None)" Include="*.ico;*.cur;*.bmp;*.dlg;*.rct;*.gif;*.jpg;*.jpeg;*.wav;*.jpe;*.tiff;*.tif;*.png;*.rc2" /> - <None Exclude="@(None)" Include="*.def;*.bat;*.hpj;*.asmx" /> - </ItemGroup> - <ItemGroup> - <ClInclude Exclude="@(ClInclude)" Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd" /> - </ItemGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> -</Project>
\ No newline at end of file diff --git a/print/XPSDrvSmpl/src/filters/xdcont/xdcont.vcxproj.Filters b/print/XPSDrvSmpl/src/filters/xdcont/xdcont.vcxproj.Filters deleted file mode 100644 index b1aba0bd..00000000 --- a/print/XPSDrvSmpl/src/filters/xdcont/xdcont.vcxproj.Filters +++ /dev/null @@ -1,163 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <ItemGroup> - <Filter Include="Source Files"> - <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;*</Extensions> - <UniqueIdentifier>{B192E969-B943-4CD9-AFDD-E14B61AEFA09}</UniqueIdentifier> - </Filter> - <Filter Include="Header Files"> - <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions> - <UniqueIdentifier>{3E626190-7767-495A-A5B3-629C0AA184CA}</UniqueIdentifier> - </Filter> - <Filter Include="Resource Files"> - <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms;man;xml</Extensions> - <UniqueIdentifier>{E0D34E98-7FA3-45FC-AD1E-5A41EF88FAB1}</UniqueIdentifier> - </Filter> - </ItemGroup> - <ItemGroup> - <ClCompile Include="precompsrc.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="xpsarch.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="xpsfd.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="xpsfds.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="xpsfiler.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="xpsfilew.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="xpsproc.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="xpsrels.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="xpstype.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - </ItemGroup> - <ItemGroup> - <ClInclude Include="xps.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="xpsarch.h" /> - <ClInclude Include="xpsfd.h" /> - <ClInclude Include="xpsfds.h" /> - <ClInclude Include="xpsfiler.h" /> - <ClInclude Include="xpsfilew.h" /> - <ClInclude Include="xpsproc.h" /> - <ClInclude Include="xpsrels.h" /> - <ClInclude Include="xpstype.h" /> - <ClInclude Include="xps.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="xpsarch.h" /> - <ClInclude Include="xpsfd.h" /> - <ClInclude Include="xpsfds.h" /> - <ClInclude Include="xpsfiler.h" /> - <ClInclude Include="xpsfilew.h" /> - <ClInclude Include="xpsproc.h" /> - <ClInclude Include="xpsrels.h" /> - <ClInclude Include="xpstype.h" /> - <ClInclude Include="xps.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="xpsarch.h" /> - <ClInclude Include="xpsfd.h" /> - <ClInclude Include="xpsfds.h" /> - <ClInclude Include="xpsfiler.h" /> - <ClInclude Include="xpsfilew.h" /> - <ClInclude Include="xpsproc.h" /> - <ClInclude Include="xpsrels.h" /> - <ClInclude Include="xpstype.h" /> - <ClInclude Include="xps.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="xpsarch.h" /> - <ClInclude Include="xpsfd.h" /> - <ClInclude Include="xpsfds.h" /> - <ClInclude Include="xpsfiler.h" /> - <ClInclude Include="xpsfilew.h" /> - <ClInclude Include="xpsproc.h" /> - <ClInclude Include="xpsrels.h" /> - <ClInclude Include="xpstype.h" /> - <ClInclude Include="xps.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="xpsarch.h" /> - <ClInclude Include="xpsfd.h" /> - <ClInclude Include="xpsfds.h" /> - <ClInclude Include="xpsfiler.h" /> - <ClInclude Include="xpsfilew.h" /> - <ClInclude Include="xpsproc.h" /> - <ClInclude Include="xpsrels.h" /> - <ClInclude Include="xpstype.h" /> - <ClInclude Include="xps.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="xpsarch.h" /> - <ClInclude Include="xpsfd.h" /> - <ClInclude Include="xpsfds.h" /> - <ClInclude Include="xpsfiler.h" /> - <ClInclude Include="xpsfilew.h" /> - <ClInclude Include="xpsproc.h" /> - <ClInclude Include="xpsrels.h" /> - <ClInclude Include="xpstype.h" /> - <ClInclude Include="xps.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="xpsarch.h" /> - <ClInclude Include="xpsfd.h" /> - <ClInclude Include="xpsfds.h" /> - <ClInclude Include="xpsfiler.h" /> - <ClInclude Include="xpsfilew.h" /> - <ClInclude Include="xpsproc.h" /> - <ClInclude Include="xpsrels.h" /> - <ClInclude Include="xpstype.h" /> - <ClInclude Include="xps.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="xpsarch.h" /> - <ClInclude Include="xpsfd.h" /> - <ClInclude Include="xpsfds.h" /> - <ClInclude Include="xpsfiler.h" /> - <ClInclude Include="xpsfilew.h" /> - <ClInclude Include="xpsproc.h" /> - <ClInclude Include="xpsrels.h" /> - <ClInclude Include="xpstype.h" /> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - </ItemGroup> -</Project>
\ No newline at end of file diff --git a/print/XPSDrvSmpl/src/filters/xdcont/xps.h b/print/XPSDrvSmpl/src/filters/xdcont/xps.h deleted file mode 100644 index 0b2ae4b8..00000000 --- a/print/XPSDrvSmpl/src/filters/xdcont/xps.h +++ /dev/null @@ -1,83 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - xps.h - -Abstract: - - Enumerations and definitions used by the stream filter. - ---*/ - -#pragma once - -#include "xdstring.h" -#include "ipkfile.h" - -enum ERelsType -{ - RelsAnnotations = 0, ERelsTypeMin = 0, - RelsDigitalSignatureDefinitions, - RelsDiscardControl, - RelsDocumentStructure, - RelsPrintTicket, - RelsRequiredResource, - RelsRestrictedFont, - RelsStartPart, - RelsStoryFragments, - RelsCoreProperties, - RelsDigitalSignature, - RelsDigitalSignatureCertificate, - RelsDigitalSignatureOrigin, - RelsThumbnail, - RelsUnknown, ERelsTypeMax = RelsUnknown -}; - -typedef std::pair<CStringXDA, ERelsType> RelsNameType; -typedef std::vector<RelsNameType> RelsTypeList; -typedef std::map<CStringXDA, RelsTypeList> RelsMap; - -enum EContentType -{ - ContentFixedDocumentSequence = 0, EContentTypeMin = 0, - ContentFixedDocument, - ContentFixedPage, - ContentDiscardControl, - ContentDocumentStructure, - ContentFont, - ContentICCProfile, - ContentObfuscatedFont, - ContentPrintTicket, - ContentRemoteResourceDictionary, - ContentStoryFragments, - ContentJPEGImage, - ContentPNGImage, - ContentTIFFImage, - ContentWindowsMediaPhotoImage, - ContentCoreProperties, - ContentDigitalSignatureCertificate, - ContentDigitalSignatureOrigin, - ContentDigitalSignatureXMLSignature, - ContentRelationships, - ContentUnknown, EContentTypeMax = ContentUnknown -}; - -typedef std::map<CStringXDA, EContentType> ContentMap; - -typedef std::vector<CStringXDA> FileList; - -typedef std::map<CStringXDA, BOOL> SentList; - -typedef std::pair <CONST IPKFile*, BOOL> RecordTracker; -typedef std::vector<RecordTracker> XPSPartStack; - diff --git a/print/XPSDrvSmpl/src/filters/xdcont/xpsarch.cpp b/print/XPSDrvSmpl/src/filters/xdcont/xpsarch.cpp deleted file mode 100644 index 68800b31..00000000 --- a/print/XPSDrvSmpl/src/filters/xdcont/xpsarch.cpp +++ /dev/null @@ -1,639 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - xpsarch.cpp - -Abstract: - - Implementation of the XPS archive class. This class is responsible for providing - an interface to clients that removes the potentially interleaved nature of an - XPS document. This allows clients to manipulate files using the parts full name - instead of having to worry about the semantics of interleaved parts. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "xdexcept.h" -#include "xpsarch.h" - -typedef HRESULT (*GetClassObject)(REFCLSID, REFIID, LPVOID FAR*); - -static PCSTR szPartNameFormatString = "%s/[%i].piece"; -static PCSTR szLastPartNameFormatString = "%s/[%i].last.piece"; - -// -// GUIDs for the archive handler -// -CONST GUID CLSID_PKArchiveHandler = {0x5a0f4115, 0xd4d3, 0x401e, {0x80, 0x71, 0xa4, 0x40, 0xd6, 0xd0, 0x70, 0x92}}; -CONST GUID IID_IPKArchive = {0xbdbbdf56, 0xc742, 0x4efd, {0x80, 0x75, 0xaf, 0x2c, 0x7b, 0x24, 0x7f, 0x38}}; - -/*++ - -Routine Name: - - CXPSArchive::CXPSArchive - -Routine Description: - - CXPSArchive class constructor - -Arguments: - - pReadStream - Pointer to the print read stream - pWriteStream - Pointer to the print write stream - -Return Value: - - None - Throws CXDException(HRESULT) on an error - ---*/ -CXPSArchive::CXPSArchive( - _In_ IPrintReadStream* pReadStream, - _In_ IPrintWriteStream* pWriteStream - ) : - m_pWriteStream(pWriteStream), - m_pPkArchive(NULL), - m_hPkArch(NULL) -{ - HRESULT hr = S_OK; - - // - // Get the current directory to load the pk archive library - // - DWORD cchName = 0; - TCHAR* szFileName = new(std::nothrow) TCHAR[MAX_PATH]; - - if (SUCCEEDED(hr = CHECK_POINTER(szFileName, E_OUTOFMEMORY))) - { - cchName = GetModuleFileName(g_hInstance, szFileName, MAX_PATH); - - if (cchName == 0) - { - hr = GetLastErrorAsHResult(); - } - } - - if (SUCCEEDED(hr) && - cchName > 0) - { - // - // Remove the filespec - // - PathRemoveFileSpec(szFileName); - - try - { - // - // Append the PK archive DLL name - // - CStringXD cstrPath(szFileName); - cstrPath += TEXT("\\pkarch.dll"); - - // - // Try to load the PK archive DLL - // - m_hPkArch = LoadLibrary(cstrPath); - } - catch (CXDException& e) - { - hr = e; - } - } - - if (szFileName != NULL) - { - delete[] szFileName; - szFileName = NULL; - } - - if (SUCCEEDED(hr)) - { - // - // Get DllGetClassObject from the PK archive and instantiate the PK archive handler - // - if (m_hPkArch != NULL) - { - GetClassObject pfnGetClassObject = reinterpret_cast<GetClassObject>(GetProcAddress(m_hPkArch, "DllGetClassObject")); - - if (SUCCEEDED(hr = CHECK_POINTER(pfnGetClassObject, E_NOINTERFACE)) && - SUCCEEDED(hr = pfnGetClassObject(CLSID_PKArchiveHandler, IID_IPKArchive, reinterpret_cast<LPVOID*>(&m_pPkArchive)))) - { - hr = CHECK_POINTER(m_pPkArchive, E_NOINTERFACE); - } - } - else - { - hr = E_NOINTERFACE; - } - } - - // - // Initialise the IO streams - // - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_POINTER(pReadStream, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(m_pWriteStream, E_POINTER)) && - SUCCEEDED(hr = m_pPkArchive->SetReadStream(pReadStream)) && - SUCCEEDED(hr = m_pPkArchive->SetWriteStream(m_pWriteStream))) - { - // - // We can now process the read stream to create the file index - // - hr = m_pPkArchive->ProcessReadStream(); - } - - if (FAILED(hr)) - { - throw CXDException(hr); - } -} - -/*++ - -Routine Name: - - CXPSArchive::~CXPSArchive - -Routine Description: - - CXPSArchive class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CXPSArchive::~CXPSArchive() -{ - if (m_pPkArchive != NULL) - { - m_pPkArchive->Close(); - m_pPkArchive = NULL; - } - - if (m_pWriteStream != NULL) - { - m_pWriteStream->Close(); - } - - if (m_hPkArch != NULL) - { - FreeLibrary(m_hPkArch); - } -} - -/*++ - -Routine Name: - - CXPSArchive::InitialiseFile - -Routine Description: - - This routine intialises the named file ready for processing - or sending on. This entails locating all the PK archive files - that constitute the XPS part. - -Arguments: - - szFileName - The name of the part to intialise - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXPSArchive::InitialiseFile( - _In_z_ PCSTR szFileName - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(szFileName, E_POINTER))) - { - try - { - CStringXDA cstrFileName(szFileName); - - // - // Open the file handler - if it is still in use this will fail - // - if (SUCCEEDED(hr = m_XpsFile.Open(szFileName))) - { - // - // Find the record or the parts comprising the record - // - hr = AddFile(szFileName); - } - else - { - RIP("File handler has not been closed correctly\n"); - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR_EXC(hr, E_ELEMENT_NOT_FOUND); - return hr; -} - -/*++ - -Routine Name: - - CXPSArchive::GetFileStream - -Routine Description: - - This routine retrieves the read stream for an XPS part. - -Arguments: - - szFileName - The name of the XPS part the stream is required for - ppFileStream - Pointer to an ISequentialStream pointer that recieves the stream - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXPSArchive::GetFileStream( - _In_z_ PCSTR szFileName, - _Outptr_ ISequentialStream** ppFileStream - ) -{ - HRESULT hr = S_OK; - - // - // Initialise the current XPS file - // - if (SUCCEEDED(hr = CHECK_POINTER(ppFileStream, E_POINTER)) && - SUCCEEDED(hr = InitialiseFile(szFileName))) - { - // - // Query the XPS file for the file stream - // - *ppFileStream = NULL; - hr = m_XpsFile.QueryInterface(IID_ISequentialStream, reinterpret_cast<PVOID*>(ppFileStream)); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXPSArchive::CloseCurrent - -Routine Description: - - This routine closes the currently opened XPS file - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXPSArchive::CloseCurrent( - VOID - ) -{ - return m_XpsFile.Close(); -} - -/*++ - -Routine Name: - - CXPSArchive::SendCurrentFile - -Routine Description: - - This routine sends the current initialised file and requests the - PK archive handler compresses it according to the requested method - -Arguments: - - eCompType - The requested compression type - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXPSArchive::SendCurrentFile( - _In_ ECompressionType eCompType - ) -{ - HRESULT hr = S_OK; - - ULONG cb = 0; - PVOID pv = NULL; - PSTR pName = NULL; - - // - // Get the data buffer and file name - // - if (SUCCEEDED(hr = m_XpsFile.GetBuffer(&pv, &cb)) && - SUCCEEDED(hr = m_XpsFile.GetFileName(&pName))) - { - hr = SendFile(pName, pv, cb, eCompType); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXPSArchive::SendCurrentFile - -Routine Description: - - This routine sends the current initialised file by requesting the - PK archive handler send the original constituent PK records - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXPSArchive::SendCurrentFile( - VOID - ) -{ - HRESULT hr = S_OK; - - XPSPartStack* pPartStack = NULL; - PSTR pName = NULL; - - if (SUCCEEDED(hr = CHECK_POINTER(m_pPkArchive, E_NOINTERFACE)) && - SUCCEEDED(hr = m_XpsFile.GetFileParts(&pPartStack)) && - SUCCEEDED(hr = m_XpsFile.GetFileName(&pName))) - { - try - { - // - // Send all file parts on to the PK archive - // - if (!m_sentList[pName]) - { - XPSPartStack::const_iterator iterParts = pPartStack->begin(); - - for (; - iterParts != pPartStack->end() && SUCCEEDED(hr); - iterParts++) - { - hr = m_pPkArchive->SendFile(iterParts->first); - } - - if (SUCCEEDED(hr)) - { - m_sentList[pName] = TRUE; - } - } - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXPSArchive::SendFile - -Routine Description: - - This routine sends a file defined by it's name and constituent data. The - routine passes the name and buffer to the PK archive handler to compress - and add to the archive. - -Arguments: - - szFileName - The name of the part - pBuffer - The buffer containing the part data - cbBuffer - The size of the data buffer - eCompType - The requested compression type - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXPSArchive::SendFile( - _In_z_ PCSTR szFileName, - _In_reads_bytes_(cbBuffer) PVOID pBuffer, - _In_ ULONG cbBuffer, - _In_ ECompressionType eCompType - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(m_pPkArchive, E_NOINTERFACE)) && - SUCCEEDED(hr = CHECK_POINTER(szFileName, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pBuffer, E_POINTER))) - { - if (eCompType == CompDeflated || - eCompType == CompNone) - { - try - { - // - // Get the PK archive to compress and send the file on - // - if (!m_sentList[szFileName]) - { - if (SUCCEEDED(hr = m_pPkArchive->SendFile(szFileName, pBuffer, cbBuffer, eCompType))) - { - m_sentList[szFileName] = TRUE; - } - } - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - else - { - hr = HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXPSArchive::AddFile - -Routine Description: - - This routine adds the PK file or constiuent PK files to the XPS file - ready for retrieval of the read stream. This hides the XPS piece handling - from the client which just adds the part by it's full un-interleaved name - -Arguments: - - szFileName - The name of the part - -Return Value: - - HRESULT - S_OK - On success - E_ELEMENT_NOT_FOUND - When part not present or badly formed in the container - E_* - On error - ---*/ -HRESULT -CXPSArchive::AddFile( - _In_z_ PCSTR szFileName - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(m_pPkArchive, E_NOINTERFACE)) && - SUCCEEDED(hr = CHECK_POINTER(szFileName, E_POINTER))) - { - // - // Find the part or parts comprising the file - // - NameIndex* pNameIndex = NULL; - - if (SUCCEEDED(hr = m_pPkArchive->GetNameIndex(&pNameIndex))) - { - try - { - NameIndex::const_iterator iterNameIndex = pNameIndex->find(szFileName); - if (iterNameIndex != pNameIndex->end()) - { - // - // There is a single part - // - hr = m_XpsFile.AddFilePart(CStringXDA(szFileName), iterNameIndex->second); - } - else - { - // - // This could be a multipart interleaved file - // - UINT cPart = 0; - do - { - CStringXDA cstrPart; - cstrPart.Format(szPartNameFormatString, szFileName, cPart); - - iterNameIndex = pNameIndex->find(cstrPart); - if (iterNameIndex != pNameIndex->end()) - { - // - // We found the next part - // - hr = m_XpsFile.AddFilePart(CStringXDA(szFileName), iterNameIndex->second); - cPart++; - } - else - { - cstrPart.Format(szLastPartNameFormatString, szFileName, cPart); - iterNameIndex = pNameIndex->find(cstrPart); - - if (iterNameIndex != pNameIndex->end()) - { - // - // We found the last part - // - hr = m_XpsFile.AddFilePart(CStringXDA(szFileName), iterNameIndex->second); - cPart++; - break; - } - else - { - // - // The element is either not well constructed (i.e. missing a piece or the last - // part) or it does not exist - // - hr = E_ELEMENT_NOT_FOUND; - } - } - } - while (SUCCEEDED(hr)); - } - } - catch (CXDException& e) - { - hr = e; - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - } - - ERR_ON_HR_EXC(hr, E_ELEMENT_NOT_FOUND); - return hr; -} diff --git a/print/XPSDrvSmpl/src/filters/xdcont/xpsarch.h b/print/XPSDrvSmpl/src/filters/xdcont/xpsarch.h deleted file mode 100644 index c891faa2..00000000 --- a/print/XPSDrvSmpl/src/filters/xdcont/xpsarch.h +++ /dev/null @@ -1,91 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - xpsarch.h - -Abstract: - - Definition of the XPS archive class. This class is responsible for providing - an interface to clients that removes the potentially interleaved nature of an - XPS document. This allows clients to manipulate files using the parts full name - instead of having to worry about the semantics of interleaved parts. - ---*/ - -#pragma once - -#include "ipkarch.h" -#include "xpsfiler.h" - -class CXPSArchive -{ -public: - CXPSArchive( - _In_ IPrintReadStream* pReadStream, - _In_ IPrintWriteStream* pWriteStream - ); - - virtual ~CXPSArchive(); - - HRESULT - InitialiseFile( - _In_z_ PCSTR szFileName - ); - - HRESULT - GetFileStream( - _In_z_ PCSTR szFileName, - _Outptr_ ISequentialStream** ppFileStream - ); - - HRESULT - CloseCurrent( - VOID - ); - - HRESULT - SendCurrentFile( - _In_ ECompressionType eCompType - ); - - HRESULT - SendCurrentFile( - VOID - ); - - HRESULT - SendFile( - _In_z_ PCSTR szFileName, - _In_reads_bytes_(cbBuffer) PVOID pBuffer, - _In_ ULONG cbBuffer, - _In_ ECompressionType eCompType - ); - -private: - HRESULT - AddFile( - _In_z_ PCSTR szFileName - ); - -private: - HMODULE m_hPkArch; - - CComPtr<IPKArchive> m_pPkArchive; - - CXPSReadFile m_XpsFile; - - SentList m_sentList; - - CComPtr<IPrintWriteStream> m_pWriteStream; -}; - diff --git a/print/XPSDrvSmpl/src/filters/xdcont/xpsfd.cpp b/print/XPSDrvSmpl/src/filters/xdcont/xpsfd.cpp deleted file mode 100644 index ebe78ee5..00000000 --- a/print/XPSDrvSmpl/src/filters/xdcont/xpsfd.cpp +++ /dev/null @@ -1,285 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - xpsfd.cpp - -Abstract: - - Implementation of the XPS Fixed Document (FD) SAX handler. This class is - responsible for retrieving and storing in the correct order the Fixed Pages - that comprise the Fixed Document. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "xdexcept.h" -#include "xpsfd.h" - -static PCSTR szPageContent = "PageContent"; -static PCSTR szSource = "Source"; - -/*++ - -Routine Name: - - CFixedDocument::CFixedDocument - -Routine Description: - - CFixedDocument class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CFixedDocument::CFixedDocument() -{ -} - -/*++ - -Routine Name: - - CFixedDocument::~CFixedDocument - -Routine Description: - - CFixedDocument class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CFixedDocument::~CFixedDocument() -{ -} - -/*++ - -Routine Name: - - CFixedDocument::startElement - -Routine Description: - - This routine is the startElement method of the SAX handler. This is used - to parse the fixed document mark-up retrieving and storing the list of - fixed pages in the document - -Arguments: - - pwchNamespaceUri - Unused: Local namespace URI - cchNamespaceUri - Unused: Length of the namespace URI - pwchLocalName - Unused: Local name string - cchLocalName - Unused: Length of the local name string - pwchQName - The qualified name with prefix - cchQName - The length of the qualified name with prefix - pAttributes - Pointer to the ISAXAttributes interface containing attributes attached to the element - - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT STDMETHODCALLTYPE -CFixedDocument::startElement( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - _In_reads_(cchQName) CONST wchar_t* pwchQName, - _In_ INT cchQName, - _In_ ISAXAttributes* pAttributes - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pwchQName, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pAttributes, E_POINTER))) - { - if (cchQName <= 0) - { - hr = E_INVALIDARG; - } - } - - try - { - CStringXDA cstrElementName(pwchQName, cchQName); - - if (cstrElementName == szPageContent) - { - INT cAttributes = 0; - - if (SUCCEEDED(hr)) - { - hr = pAttributes->getLength(&cAttributes); - } - - // - // Run over all attributes identifying the document in the sequence - // - for (INT cIndex = 0; cIndex < cAttributes && SUCCEEDED(hr); cIndex++) - { - PCWSTR pszAttUri = NULL; - INT cchAttUri = 0; - PCWSTR pszAttName = NULL; - INT cchAttName = 0; - PCWSTR pszAttQName = NULL; - INT cchAttQName = 0; - PCWSTR pszAttValue = NULL; - INT cchAttValue = 0; - - // - // Get the attribute data ready to write out - // - if (SUCCEEDED(hr = pAttributes->getName(cIndex, &pszAttUri, &cchAttUri, &pszAttName, &cchAttName, &pszAttQName, &cchAttQName)) && - SUCCEEDED(hr = pAttributes->getValue(cIndex, &pszAttValue, &cchAttValue))) - { - CStringXDA cstrAttName(pszAttQName, cchAttQName); - CStringXDA cstrAttValue(pszAttValue, cchAttValue); - - if (cstrAttName == szSource) - { - // - // Strip any leading "/" - // - if (cstrAttValue.GetAt(0) == '/') - { - cstrAttValue.Delete(0); - } - - try - { - // - // Add the fixed page to the list - // - m_FixedPageList.push_back(cstrAttValue); - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - } - } - } - } - catch (CXDException& e) - { - hr = e; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CFixedDocument::GetFixedPageList - -Routine Description: - - This routine retrieves the fixed page list constructed as the fixed document - mark-up was parsed - -Arguments: - - pFixedPageList - Pointer to the vector that recieves the fixed page list - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CFixedDocument::GetFixedPageList( - _Out_ FileList* pFixedPageList - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pFixedPageList, E_POINTER))) - { - try - { - pFixedPageList->assign(m_FixedPageList.begin(), m_FixedPageList.end()); - } - catch (CXDException& e) - { - hr = e; - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - - return hr; -} - -/*++ - -Routine Name: - - CFixedDocument::Clear - -Routine Description: - - This routine clears the fixed page list - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CFixedDocument::Clear( - VOID - ) -{ - HRESULT hr = S_OK; - - m_FixedPageList.clear(); - - ERR_ON_HR(hr); - return hr; -} diff --git a/print/XPSDrvSmpl/src/filters/xdcont/xpsfd.h b/print/XPSDrvSmpl/src/filters/xdcont/xpsfd.h deleted file mode 100644 index 65888511..00000000 --- a/print/XPSDrvSmpl/src/filters/xdcont/xpsfd.h +++ /dev/null @@ -1,60 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - xpsfd.h - -Abstract: - - Definition of the XPS Fixed Document (FD) SAX handler. This class is - responsible for retrieving and storing in the correct order the Fixed Pages - that comprise the Fixed Document. - ---*/ - -#pragma once - -#include "saxhndlr.h" -#include "xps.h" - -class CFixedDocument : public CSaxHandler -{ -public: - CFixedDocument(); - - virtual ~CFixedDocument(); - - virtual HRESULT STDMETHODCALLTYPE - startElement( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - _In_reads_(cchQName) CONST wchar_t* pwchQName, - _In_ INT cchQName, - _In_ ISAXAttributes* pAttributes - ); - - HRESULT - GetFixedPageList( - _Out_ FileList* pFixedPageList - ); - - HRESULT - Clear( - VOID - ); - -private: - FileList m_FixedPageList; -}; - diff --git a/print/XPSDrvSmpl/src/filters/xdcont/xpsfds.cpp b/print/XPSDrvSmpl/src/filters/xdcont/xpsfds.cpp deleted file mode 100644 index e4eb8bc8..00000000 --- a/print/XPSDrvSmpl/src/filters/xdcont/xpsfds.cpp +++ /dev/null @@ -1,285 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - xpsfds.cpp - -Abstract: - - Implementation of the XPS Fixed Document Sequence (FDS) SAX handler. - This class is responsible for retrieving and storing in the correct - order the Fixed Documentss that comprise the Fixed Document - Sequence. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "xdexcept.h" -#include "xpsfds.h" - -static PCSTR szDocumentReference = "DocumentReference"; -static PCSTR szSource = "Source"; - -/*++ - -Routine Name: - - CFixedDocumentSequence::CFixedDocumentSequence - -Routine Description: - - CFixedDocumentSequence class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CFixedDocumentSequence::CFixedDocumentSequence() -{ -} - -/*++ - -Routine Name: - - CFixedDocumentSequence::~CFixedDocumentSequence - -Routine Description: - - CFixedDocumentSequence class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CFixedDocumentSequence::~CFixedDocumentSequence() -{ -} - -/*++ - -Routine Name: - - CFixedDocumentSequence::startElement - -Routine Description: - - This routine is the startElement method of the SAX handler. This is used - to parse the fixed document sequence mark-up retrieving and storing the list of - fixed documents in the sequence - -Arguments: - - pwchNamespaceUri - Unused: Local namespace URI - cchNamespaceUri - Unused: Length of the namespace URI - pwchLocalName - Unused: Local name string - cchLocalName - Unused: Length of the local name string - pwchQName - The qualified name with prefix - cchQName - The length of the qualified name with prefix - pAttributes - Pointer to the ISAXAttributes interface containing attributes attached to the element - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT STDMETHODCALLTYPE -CFixedDocumentSequence::startElement( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - _In_reads_(cchQName) CONST wchar_t* pwchQName, - _In_ INT cchQName, - _In_ ISAXAttributes* pAttributes - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pwchQName, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pAttributes, E_POINTER))) - { - if (cchQName <= 0) - { - hr = E_INVALIDARG; - } - } - - try - { - CStringXDA cstrElementName(pwchQName, cchQName); - - if (cstrElementName == szDocumentReference) - { - INT cAttributes = 0; - - if (SUCCEEDED(hr)) - { - hr = pAttributes->getLength(&cAttributes); - } - - // - // Run over all attributes identifying the document in the sequence - // - for (INT cIndex = 0; cIndex < cAttributes && SUCCEEDED(hr); cIndex++) - { - PCWSTR pszAttUri = NULL; - INT cchAttUri = 0; - PCWSTR pszAttName = NULL; - INT cchAttName = 0; - PCWSTR pszAttQName = NULL; - INT cchAttQName = 0; - PCWSTR pszAttValue = NULL; - INT cchAttValue = 0; - - // - // Get the attribute data ready to write out - // - if (SUCCEEDED(hr = pAttributes->getName(cIndex, &pszAttUri, &cchAttUri, &pszAttName, &cchAttName, &pszAttQName, &cchAttQName)) && - SUCCEEDED(hr = pAttributes->getValue(cIndex, &pszAttValue, &cchAttValue))) - { - CStringXDA cstrAttName(pszAttQName, cchAttQName); - CStringXDA cstrAttValue(pszAttValue, cchAttValue); - - if (cstrAttName == szSource) - { - // - // Strip any leading "/" - // - if (cstrAttValue.GetAt(0) == '/') - { - cstrAttValue.Delete(0); - } - - try - { - // - // Add the fixed document to the list - // - m_FixedDocumentList.push_back(cstrAttValue); - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - } - } - } - } - catch (CXDException& e) - { - hr = e; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CFixedDocumentSequence::GetFixedDocumentList - -Routine Description: - - This routine retrieves the fixed document list constructed as the fixed document - sequence mark-up was parsed - -Arguments: - - pFixedDocumentList - Pointer to the vector that recieves the fixed document list - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CFixedDocumentSequence::GetFixedDocumentList( - _Out_ FileList* pFixedDocumentList - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pFixedDocumentList, E_POINTER))) - { - try - { - pFixedDocumentList->assign(m_FixedDocumentList.begin(), m_FixedDocumentList.end()); - } - catch (CXDException& e) - { - hr = e; - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - - return hr; -} - -/*++ - -Routine Name: - - CFixedDocumentSequence::Clear - -Routine Description: - - This routine clears the fixed page list - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CFixedDocumentSequence::Clear( - VOID - ) -{ - HRESULT hr = S_OK; - - m_FixedDocumentList.clear(); - - ERR_ON_HR(hr); - return hr; -} diff --git a/print/XPSDrvSmpl/src/filters/xdcont/xpsfds.h b/print/XPSDrvSmpl/src/filters/xdcont/xpsfds.h deleted file mode 100644 index 78860b70..00000000 --- a/print/XPSDrvSmpl/src/filters/xdcont/xpsfds.h +++ /dev/null @@ -1,61 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - xpsfds.h - -Abstract: - - Definition of the XPS Fixed Document Sequence (FDS) SAX handler. - This class is responsible for retrieving and storing in the correct - order the Fixed Documentss that comprise the Fixed Document - Sequence. - ---*/ - -#pragma once - -#include "saxhndlr.h" -#include "xps.h" - -class CFixedDocumentSequence : public CSaxHandler -{ -public: - CFixedDocumentSequence(); - - virtual ~CFixedDocumentSequence(); - - virtual HRESULT STDMETHODCALLTYPE - startElement( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - _In_reads_(cchQName) CONST wchar_t* pwchQName, - _In_ INT cchQName, - _In_ ISAXAttributes* pAttributes - ); - - HRESULT - GetFixedDocumentList( - _Out_ FileList* pFixedDocumentList - ); - - HRESULT - Clear( - VOID - ); - -private: - FileList m_FixedDocumentList; -}; - diff --git a/print/XPSDrvSmpl/src/filters/xdcont/xpsfiler.cpp b/print/XPSDrvSmpl/src/filters/xdcont/xpsfiler.cpp deleted file mode 100644 index c8ee85cb..00000000 --- a/print/XPSDrvSmpl/src/filters/xdcont/xpsfiler.cpp +++ /dev/null @@ -1,679 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - xpsfiler.cpp - -Abstract: - - Implementation of the XPS file reader class. This class implements - ISequentialStream::Read by using the IPKFile interface to supply the - client with decompressed data as requested. This allows the file to - be passed directly to a SAX or DOM handler for parsing. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdexcept.h" -#include "xpsfiler.h" - -/*++ - -Routine Name: - - CXPSReadFile::CXPSReadFile - -Routine Description: - - CXPSReadFile class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CXPSReadFile::CXPSReadFile() : - CUnknown<ISequentialStream>(IID_ISequentialStream), - m_cbSent(0), - m_cbExtracted(0), - m_bExtractedAll(FALSE) -{ -} - -/*++ - -Routine Name: - - CXPSReadFile::~CXPSReadFile - -Routine Description: - - CXPSReadFile class denstructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CXPSReadFile::~CXPSReadFile() -{ - Close(); -} - -/*++ - -Routine Name: - - CXPSReadFile::Read - -Routine Description: - - This routine implements the ISequentialStream read interface allowing - clients to access file data without having to worry about part - interleaving or decompression. - -Arguments: - - pv - Pointer to the buffer to recieve the file data - cb - The size of the data buffer - pcbRead - Pointer to a ULONG that recieves the number of bytes read - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT STDMETHODCALLTYPE -CXPSReadFile::Read( - _Out_writes_bytes_(cb) void* pv, - _In_ ULONG cb, - _Out_ ULONG* pcbRead - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pv, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pcbRead, E_POINTER))) - { - *pcbRead = 0; - - if (cb > 0) - { - // - // Add data to our working buffer till we have enough to copy or - // we ran out of data - // - while (m_cbExtracted - m_cbSent < cb && - !m_bExtractedAll && - SUCCEEDED(hr)) - { - hr = DecompressNextFile(); - } - - // - // Copy the data into the copy buffer - // - if (SUCCEEDED(hr)) - { - hr = CopyBuffer(pv, cb, pcbRead); - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXPSReadFile::Write - -Routine Description: - - This routine is the ISequentialStream write implementation. It is not - implemented - -Arguments: - - Unused - -Return Value: - - HRESULT - E_NOTIMPL - This method is not implemented - ---*/ -HRESULT STDMETHODCALLTYPE -CXPSReadFile::Write( - _In_reads_bytes_(cb) CONST void*, - _In_ ULONG cb, - _Out_opt_ ULONG* - ) -{ - UNREFERENCED_PARAMETER(cb); - return E_NOTIMPL; -} - -/*++ - -Routine Name: - - CXPSReadFile::Open - -Routine Description: - - This routine intialises a file ready to be read - -Arguments: - - szFileName - The name of the part to be intialised - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXPSReadFile::Open( - _In_ PCSTR szFileName - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(szFileName, E_POINTER))) - { - try - { - if (m_partStack.empty()) - { - m_cstrFileName = szFileName; - } - else - { - RIP("The file must be closed before another is opened\n"); - - hr = E_FAIL; - } - - } - catch (CXDException& e) - { - hr = e; - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXPSReadFile::Close - -Routine Description: - - This routine closes the currently open file - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXPSReadFile::Close( - VOID - ) -{ - HRESULT hr = S_OK; - - m_partStack.clear(); - m_cstrFileName.Empty(); - m_cbSent = 0; - m_cbExtracted = 0; - m_bExtractedAll = 0; - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXPSReadFile::GetBuffer - -Routine Description: - - This routine retrieves the current populated buffer and the count - of bytes available - -Arguments: - - ppv - Pointer to a VOID pointer that recieves the buffer - pcb - Pointer to a ULONG that recieves the size of the buffer - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXPSReadFile::GetBuffer( - _Outptr_result_bytebuffer_(*pcb) PVOID* ppv, - _Out_ ULONG* pcb - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppv, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pcb, E_POINTER))) - { - *ppv = NULL; - *pcb = 0; - - if (!m_bExtractedAll) - { - hr = E_PENDING; - } - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = m_workFile.GetBuffer(m_cbExtracted, ppv))) - { - *pcb = static_cast<ULONG>(m_cbExtracted); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXPSReadFile::GetFileName - -Routine Description: - - This routine retrieves the file name of the currently opened file - -Arguments: - - pszFileName - Pointer to a string that recieves the filename - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXPSReadFile::GetFileName( - _Outptr_ PSTR* pszFileName - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pszFileName, E_POINTER))) - { - try - { - if (m_cstrFileName.GetLength() > 0) - { - *pszFileName = m_cstrFileName.GetBuffer(); - } - else - { - hr = E_PENDING; - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXPSReadFile::AddFilePart - -Routine Description: - - This routine adds a PK file name to the stack of files that - constitute the XPS part - -Arguments: - - szFileName - The file name to add - pPkFile - The PK file to add to the stack - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXPSReadFile::AddFilePart( - _In_ PCSTR szFileName, - _In_ CONST IPKFile* pPkFile - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(szFileName, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pPkFile, E_POINTER))) - { - try - { - if (m_cstrFileName == szFileName) - { - m_partStack.push_back(RecordTracker(pPkFile, FALSE)); - } - else - { - RIP("Filename differs from currently open file\n"); - - hr = E_FAIL; - } - } - catch (CXDException& e) - { - hr = e; - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXPSReadFile::GetFileParts - -Routine Description: - - This routine retrieves the PK files that constitute the XPS part - -Arguments: - - ppPartStack - Pointer to an XPSPartStack pointer that recieves the part stack - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXPSReadFile::GetFileParts( - _Outptr_ XPSPartStack** ppPartStack - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppPartStack, E_POINTER))) - { - *ppPartStack = &m_partStack; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXPSReadFile::DecompressNextFile - -Routine Description: - - This routine decompresses the next compressed part in the part stack - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXPSReadFile::DecompressNextFile( - VOID - ) -{ - HRESULT hr = S_OK; - - // - // If there are more files to decompress - // - if (!m_bExtractedAll) - { - try - { - // - // Decompress the next unprocessed file into the working buffer - // - XPSPartStack::iterator iterXpsStack = m_partStack.begin(); - - for (;iterXpsStack != m_partStack.end(); iterXpsStack++) - { - if (!iterXpsStack->second) - { - if (SUCCEEDED(hr = Decompress(iterXpsStack->first))) - { - iterXpsStack->second = TRUE; - } - - break; - } - } - - if (iterXpsStack == m_partStack.end()) - { - // - // That was the last record - // - m_bExtractedAll = TRUE; - } - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - else - { - RIP("File has already been fully extracted\n"); - - hr = E_FAIL; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXPSReadFile::Decompress - -Routine Description: - - This routine uses the PK archive handler to decompress the PK file specified - -Arguments: - - pRecord - The PK file to be decompressed - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXPSReadFile::Decompress( - _In_ CONST IPKFile* pRecord - ) -{ - HRESULT hr = S_OK; - - ECompressionType eCompType; - ULONG cbDecompressed = 0; - - if (SUCCEEDED(hr = CHECK_POINTER(pRecord, E_POINTER)) && - SUCCEEDED(hr = pRecord->GetDecompressedSize(&cbDecompressed)) && - SUCCEEDED(hr = pRecord->GetCompressionMethod(&eCompType))) - { - if (eCompType == CompDeflated || - eCompType == CompNone) - { - PVOID pUnCompressedData = NULL; - - if (SUCCEEDED(hr = m_workFile.GetBuffer(m_cbExtracted + cbDecompressed, &pUnCompressedData))) - { - pUnCompressedData = reinterpret_cast<PBYTE>(pUnCompressedData) + m_cbExtracted; - - if (SUCCEEDED(hr = pRecord->DecompressTo(pUnCompressedData, cbDecompressed))) - { - m_cbExtracted += cbDecompressed; - } - } - } - else - { - ERR("Unsupported compression method\n"); - - hr = HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXPSReadFile::CopyBuffer - -Routine Description: - - This routine copies the decompressed data from the working buffer to - the specified buffer - -Arguments: - - pv - Pointer to the buffer to recieve the file data - cb - The size of the data buffer - pcbRead - Pointer to a ULONG that recieves the number of bytes written to the buffer - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXPSReadFile::CopyBuffer( - _Out_writes_bytes_(cb) void* pv, - _In_ ULONG cb, - _Out_ ULONG* pcbRead - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pv, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pcbRead, E_POINTER))) - { - *pcbRead = 0; - - if (cb > 0) - { - // - // We return the smaller of the amount requested and the - // amount available - // - *pcbRead = static_cast<ULONG>(min(m_cbExtracted - m_cbSent, cb)); - - PVOID pData = NULL; - - if (SUCCEEDED(hr = m_workFile.GetBufferAt(static_cast<ULONG>(m_cbSent), static_cast<ULONGLONG>(*pcbRead), &pData))) - { - CopyMemory(pv, pData, *pcbRead); - - m_cbSent += *pcbRead; - } - } - } - - ERR_ON_HR(hr); - return hr; -} diff --git a/print/XPSDrvSmpl/src/filters/xdcont/xpsfiler.h b/print/XPSDrvSmpl/src/filters/xdcont/xpsfiler.h deleted file mode 100644 index 03603098..00000000 --- a/print/XPSDrvSmpl/src/filters/xdcont/xpsfiler.h +++ /dev/null @@ -1,119 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - xpsfiler.h - -Abstract: - - Definition of the XPS file reader class. This class implements - ISequentialStream::Read by using the IPKFile interface to supply the - client with decompressed data as requested. This allows the file to - be passed directly to a SAX or DOM handler for parsing. - ---*/ - -#pragma once - -#include "xps.h" -#include "ipkarch.h" -#include "workbuff.h" -#include "cunknown.h" - -class CXPSReadFile : public CUnknown<ISequentialStream> -{ -public: - CXPSReadFile(); - - virtual ~CXPSReadFile(); - - // - // ISequentialStream members - // - HRESULT STDMETHODCALLTYPE - Read( - _Out_writes_bytes_(cb) void* pv, - _In_ ULONG cb, - _Out_ ULONG* pcbRead - ); - - HRESULT STDMETHODCALLTYPE - Write( - _In_reads_bytes_(cb) CONST void*, - _In_ ULONG cb, - _Out_opt_ ULONG* - ); - - HRESULT - Open( - _In_ PCSTR szFileName - ); - - HRESULT - Close( - VOID - ); - - HRESULT - AddFilePart( - _In_ PCSTR szFileName, - _In_ CONST IPKFile* pPkFile - ); - - HRESULT - GetFileParts( - _Outptr_ XPSPartStack** ppPartStack - ); - - HRESULT - GetBuffer( - _Outptr_result_bytebuffer_(*pcb) PVOID* ppv, - _Out_ ULONG* pcb - ); - - HRESULT - GetFileName( - _Outptr_ PSTR* pszFileName - ); - -private: - HRESULT - DecompressNextFile( - VOID - ); - - HRESULT - Decompress( - _In_ CONST IPKFile* pRecord - ); - - HRESULT - CopyBuffer( - _Out_writes_bytes_(cb) void* pv, - _In_ ULONG cb, - _Out_ ULONG* pcbRead - ); - -private: - CWorkingBuffer m_workFile; - - CStringXDA m_cstrFileName; - - XPSPartStack m_partStack; - - SIZE_T m_cbSent; - - SIZE_T m_cbExtracted; - - BOOL m_bExtractedAll; -}; - diff --git a/print/XPSDrvSmpl/src/filters/xdcont/xpsfilew.cpp b/print/XPSDrvSmpl/src/filters/xdcont/xpsfilew.cpp deleted file mode 100644 index 64decfac..00000000 --- a/print/XPSDrvSmpl/src/filters/xdcont/xpsfilew.cpp +++ /dev/null @@ -1,291 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - xpsfilew.cpp - -Abstract: - - Implementation of an XPS file writer. This implements ISequentialStream::Write - and essentially wraps a buffer that recieves and stores the part information - so that in can be later compressed and written out. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xpsfilew.h" - -/*++ - -Routine Name: - - CXPSWriteFile::CXPSWriteFile - -Routine Description: - - CXPSWriteFile class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CXPSWriteFile::CXPSWriteFile() : - CUnknown<ISequentialStream>(IID_ISequentialStream), - m_cbWritten(0) -{ -} - -/*++ - -Routine Name: - - CXPSWriteFile::CXPSWriteFile - -Routine Description: - - CXPSWriteFile class constructor - -Arguments: - - szFileName - The name of the file to write to - -Return Value: - - None - ---*/ -CXPSWriteFile::CXPSWriteFile( - PCSTR szFileName - ) : - CUnknown<ISequentialStream>(IID_ISequentialStream), - m_cbWritten(0), - m_cstrFileName(szFileName) -{ -} - -/*++ - -Routine Name: - - CXPSWriteFile::~CXPSWriteFile - -Routine Description: - - CXPSWriteFile class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CXPSWriteFile::~CXPSWriteFile() -{ -} - -// -// ISequentialStream members -// -/*++ - -Routine Name: - - CXPSWriteFile::Read - -Routine Description: - - This is the ISequentialStream read method - this is not implemented in - the file writter - -Arguments: - - Unused - -Return Value: - - HRESULT - E_NOTIMPL - This method is not implemented - ---*/ -HRESULT STDMETHODCALLTYPE -CXPSWriteFile::Read( - _Out_writes_bytes_to_(cb, *pcbRead) void*, - _In_ ULONG cb, - _Out_opt_ ULONG* pcbRead - ) -{ - UNREFERENCED_PARAMETER(cb); - UNREFERENCED_PARAMETER(pcbRead); - return E_NOTIMPL; -} - -/*++ - -Routine Name: - - CXPSWriteFile::Write - -Routine Description: - - This routine implements the ISequentialStream wrte interface allowing - clients to write file data. - -Arguments: - - pData - Pointer to the source data - cbData - The size of the data buffer - pcbWritten - Pointer to a ULONG that recieves the number of bytes written - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT STDMETHODCALLTYPE -CXPSWriteFile::Write( - _In_reads_bytes_(cbData) CONST void* pData, - _In_ ULONG cbData, - _Out_ ULONG* pcbWritten - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pData, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pcbWritten, E_POINTER))) - { - *pcbWritten = 0; - - PBYTE pDest = NULL; - if (SUCCEEDED(hr = m_workFile.GetBuffer(m_cbWritten + cbData, reinterpret_cast<PVOID*>(&pDest)))) - { - pDest += m_cbWritten; - - CopyMemory(pDest, pData, cbData); - - m_cbWritten += cbData; - *pcbWritten = cbData; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXPSWriteFile::GetBuffer - -Routine Description: - - This routine retrieves the buffer containing the file data written by - a client - -Arguments: - - ppv - Pointer to a VOID pointer that recieves the buffer - pcb - Pointer to a ULONG that recieves the size of the buffer - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXPSWriteFile::GetBuffer( - _Outptr_result_bytebuffer_(*pcb) PVOID* ppv, - _Out_ ULONG* pcb - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppv, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pcb, E_POINTER))) - { - *ppv = NULL; - *pcb = 0; - - if (SUCCEEDED(hr = m_workFile.GetBuffer(m_cbWritten, ppv))) - { - *pcb = static_cast<ULONG>(m_cbWritten); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXPSWriteFile::GetFileName - -Routine Description: - - This routine retrieves the file name of the currently opened file - -Arguments: - - pszFileName - Pointer to a string that recieves the filename - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXPSWriteFile::GetFileName( - _Outptr_ PSTR* pszFileName - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pszFileName, E_POINTER))) - { - try - { - if (m_cstrFileName.GetLength() > 0) - { - *pszFileName = m_cstrFileName.GetBuffer(); - } - else - { - hr = E_PENDING; - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} diff --git a/print/XPSDrvSmpl/src/filters/xdcont/xpsfilew.h b/print/XPSDrvSmpl/src/filters/xdcont/xpsfilew.h deleted file mode 100644 index 652027b1..00000000 --- a/print/XPSDrvSmpl/src/filters/xdcont/xpsfilew.h +++ /dev/null @@ -1,76 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - xpsfilew.h - -Abstract: - - Definition of an XPS file writer. This implements ISequentialStream::Write - and essentially wraps a buffer that recieves and stores the part information - so that in can be later compressed and written out. - ---*/ - -#pragma once - -#include "workbuff.h" -#include "cunknown.h" -#include "xdstring.h" - -class CXPSWriteFile : public CUnknown<ISequentialStream> -{ -public: - CXPSWriteFile(); - - CXPSWriteFile( - PCSTR szFileName - ); - - virtual ~CXPSWriteFile(); - - // - // ISequentialStream members - // - HRESULT STDMETHODCALLTYPE - Read( - _Out_writes_bytes_to_(cb, *pcbRead) void*, - _In_ ULONG cb, - _Out_opt_ ULONG* pcbRead - ); - - HRESULT STDMETHODCALLTYPE - Write( - _In_reads_bytes_(cbData) CONST void* pData, - _In_ ULONG cbData, - _Out_ ULONG* pcbWritten - ); - - HRESULT - GetBuffer( - _Outptr_result_bytebuffer_(*pcb) PVOID* ppv, - _Out_ ULONG* pcb - ); - - HRESULT - GetFileName( - _Outptr_ PSTR* pszFileName - ); - -private: - CWorkingBuffer m_workFile; - - ULONG m_cbWritten; - - CStringXDA m_cstrFileName; -}; - diff --git a/print/XPSDrvSmpl/src/filters/xdcont/xpsproc.cpp b/print/XPSDrvSmpl/src/filters/xdcont/xpsproc.cpp deleted file mode 100644 index 14da1437..00000000 --- a/print/XPSDrvSmpl/src/filters/xdcont/xpsproc.cpp +++ /dev/null @@ -1,916 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - xpsproc.cpp - -Abstract: - - Implementation of the XPS processor. This class is responsible for handling - the logical document and page structure of the XPS container. The class starts - with the content types part and .rels part to find the Fixed Document Sequence. - It then parses the FDS to find the Fixed Documents and finally the FDs to find - each Fixed Page. Each fixed page is then reported to a client FixedPageProcessor - to interpret the mark-up and write out modifications as required. The class is - additionally responsible for ensuring all XPS parts and accompanying resources are - sent on to the PK archive handler to be written out. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "xdexcept.h" -#include "xpsproc.h" -#include "xpsfilew.h" - -static PCSTR szContentTypes = "[Content_Types].xml"; -static PCSTR szRelsPre = "_rels/"; -static PCSTR szRelsPost = ".rels"; - -/*++ - -Routine Name: - - CXPSProcessor::CXPSProcessor - -Routine Description: - - CXPSProcessor class constructor - -Arguments: - - pReadStream - Pointer to the print read stream - pWriteStream - Pointer to the print write stream - pPageProcessor - Pointer to the page processor interface - pPropertyBag - Pointer to the filter pipeline property bag - -Return Value: - - None - Throws CXDException(HRESULT) on an error - ---*/ -CXPSProcessor::CXPSProcessor( - _In_ IPrintReadStream* pReadStream, - _In_ IPrintWriteStream* pWriteStream, - _In_ IFixedPageProcessor* pPageProcessor, - _In_ IPrintPipelinePropertyBag* pPropertyBag, - _In_ CPTManager* pPtManager - ) : - m_xpsArchive(pReadStream, pWriteStream), - m_pSaxRdr(NULL), - m_pPageProcessor(pPageProcessor), - m_pPrintPropertyBag(pPropertyBag), - m_pPtManager(pPtManager) -{ - HRESULT hr = S_OK; - - CComPtr<ISequentialStream> pFileReader(NULL); - - // - // Setup the SAX reader and extract the content types - // - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_POINTER(pReadStream, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pWriteStream, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(m_pPageProcessor, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(m_pPtManager, E_POINTER)) && - SUCCEEDED(hr = m_pSaxRdr.CoCreateInstance(CLSID_SAXXMLReader60)) && - SUCCEEDED(hr = m_xpsArchive.GetFileStream(szContentTypes, &pFileReader)) && - SUCCEEDED(hr = m_pSaxRdr->putContentHandler(&m_contentTypes)) && - SUCCEEDED(hr = m_pSaxRdr->parse(CComVariant(pFileReader)))) - { - // - // We've got all the data we need - send it on - // - hr = m_xpsArchive.SendCurrentFile(); - } - - // - // Close the curent file ready for the next - // - m_xpsArchive.CloseCurrent(); - - if (FAILED(hr)) - { - throw CXDException(hr); - } -} - -/*++ - -Routine Name: - - CXPSProcessor::~CXPSProcessor - -Routine Description: - - CXPSProcessor class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CXPSProcessor::~CXPSProcessor() -{ -} - -/*++ - -Routine Name: - - CXPSProcessor::Start - -Routine Description: - - This routine kicks off the processing of the XPS archive struture. The - routine parses the Fixed Document Sequence mark-up to find the Fixed - Document parts, then parses the Fixed Document mark-up to find the Fixed - Page parts before passing these on to the Fixed Page processor. Additionally - the routine handles indentifying, processing and sending resources and part - relationships. Note: This limits the XPS document processing to only modifying - the fixed page data; the client is not presented the opportunity to modify any - other parts. - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXPSProcessor::Start( - VOID - ) -{ - HRESULT hr = S_OK; - - try - { - // - // Get the start part list and iterate over all parts - // - FileList fixedDocumentSequenceParts; - if (SUCCEEDED(hr = GetFixedDocumentSequenceParts(&fixedDocumentSequenceParts))) - { - FileList::const_iterator iterFDS = fixedDocumentSequenceParts.begin(); - - for (; - iterFDS != fixedDocumentSequenceParts.end() && - SUCCEEDED(hr) && - SUCCEEDED(hr = ProcessRelsParts(*iterFDS, ContentFixedDocumentSequence)); - iterFDS++) - { - // - // Parse the start part retrieving the FD list - iterate over all FDs - // - FileList fixedDocumentParts; - if (SUCCEEDED(hr = GetFixedDocumentParts(*iterFDS, &fixedDocumentParts))) - { - FileList::const_iterator iterFD = fixedDocumentParts.begin(); - - for (; - iterFD != fixedDocumentParts.end() && - SUCCEEDED(hr) && - SUCCEEDED(hr = ProcessRelsParts(*iterFD, ContentFixedDocument)); - iterFD++) - { - // - // Parse the FD retrieving the FP list - iterate over all FPs - // - FileList fixedPageParts; - if (SUCCEEDED(hr = GetFixedPageParts(*iterFD, &fixedPageParts))) - { - FileList::const_iterator iterFP = fixedPageParts.begin(); - - for (; - iterFP != fixedPageParts.end() && - SUCCEEDED(hr) && - SUCCEEDED(hr = ProcessRelsParts(*iterFP, ContentFixedPage)); - iterFP++) - { - // - // Process the fixed page - this calls on to the IFixedPageProcessor - // interface for the client to do the work - // - hr = ProcessFixedPage(*iterFP); - } - } - } - } - } - } - } - catch (CXDException& e) - { - hr = e; - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXPSProcessor::GetFixedDocumentSequenceParts - -Routine Description: - - This routine retrieves the Fixed Document Sequence from the root - relationships part. - -Arguments: - - pFixedDocumentSequencePartsList - List of fixed document sequences found to be populated - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXPSProcessor::GetFixedDocumentSequenceParts( - _Inout_ FileList* pFixedDocumentSequencePartsList - ) -{ - HRESULT hr = S_OK; - - // - // Extract the .rels part to find the start part - // - if (SUCCEEDED(hr = CHECK_POINTER(pFixedDocumentSequencePartsList, E_POINTER)) && - SUCCEEDED(hr = GetRelsForPart(""))) - { - CONST RelsTypeList* pRelsTypeList = NULL; - - hr = m_rels.GetRelsTypeList("", &pRelsTypeList); - - RelsTypeList::const_iterator iterRels = pRelsTypeList->begin(); - - for (;iterRels != pRelsTypeList->end() && SUCCEEDED(hr); iterRels++) - { - if (iterRels->second == RelsStartPart) - { - // - // We have a start part add it to the part list - // - pFixedDocumentSequencePartsList->push_back(iterRels->first); - } - else - { - // - // Send any other part on - // - if (SUCCEEDED(hr = m_xpsArchive.InitialiseFile(iterRels->first)) && - SUCCEEDED(hr = m_xpsArchive.SendCurrentFile())) - { - m_xpsArchive.CloseCurrent(); - } - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXPSProcessor::GetFixedDocumentParts - -Routine Description: - - This routine retrieves the list of fixed documents from the fixed document - sequence - -Arguments: - - szFixedDocSeq - The name of the FDS part to parse - pFixedDocumentParts - Pointer to the document list to be populated - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXPSProcessor::GetFixedDocumentParts( - _In_ PCSTR szFixedDocSeq, - _Out_ FileList* pFixedDocumentParts - ) -{ - HRESULT hr = S_OK; - CComPtr<ISequentialStream> pFileReader(NULL); - - // - // Set up the fixed document sequence as the current file in the - // XPS archive and parse the file stream using the FDS SAX content - // handler to retrieve all fixed documents in the sequence - // - if (SUCCEEDED(hr = CHECK_POINTER(szFixedDocSeq, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pFixedDocumentParts, E_POINTER)) && - SUCCEEDED(hr = m_contentTypes.ValidateContentType(szFixedDocSeq, ContentFixedDocumentSequence)) && - SUCCEEDED(hr = m_xpsArchive.GetFileStream(szFixedDocSeq, &pFileReader)) && - SUCCEEDED(hr = m_fixedDocSeq.Clear()) && - SUCCEEDED(hr = m_pSaxRdr->putContentHandler(&m_fixedDocSeq)) && - SUCCEEDED(hr = m_pSaxRdr->parse(CComVariant(pFileReader))) && - SUCCEEDED(hr = m_fixedDocSeq.GetFixedDocumentList(pFixedDocumentParts))) - { - // - // We are done with the FDS - send it on - // - hr = m_xpsArchive.SendCurrentFile(); - } - - // - // Close the curent file ready for the next - // - m_xpsArchive.CloseCurrent(); - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXPSProcessor::GetFixedPageParts - -Routine Description: - - This routine retrieves the list of fixed pages from the Fixed Document - -Arguments: - - szFixedDoc - The name of the FD part to parse - pFixedPageParts - Pointer to the page list to be populated - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXPSProcessor::GetFixedPageParts( - _In_ PCSTR szFixedDoc, - _Out_ FileList* pFixedPageParts - ) -{ - HRESULT hr = S_OK; - CComPtr<ISequentialStream> pFileReader(NULL); - - // - // Set up the fixed document as the current file in the XPS - // archive and parse the file stream using the FD SAX content - // handler to retrieve all fixed pages in the document - // - if (SUCCEEDED(hr = CHECK_POINTER(szFixedDoc, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pFixedPageParts, E_POINTER)) && - SUCCEEDED(hr = m_contentTypes.ValidateContentType(szFixedDoc, ContentFixedDocument)) && - SUCCEEDED(hr = m_xpsArchive.GetFileStream(szFixedDoc, &pFileReader)) && - SUCCEEDED(hr = m_fixedDoc.Clear()) && - SUCCEEDED(hr = m_pSaxRdr->putContentHandler(&m_fixedDoc)) && - SUCCEEDED(hr = m_pSaxRdr->parse(CComVariant(pFileReader))) && - SUCCEEDED(hr = m_fixedDoc.GetFixedPageList(pFixedPageParts))) - { - // - // We are done with the FD - send it on - // - hr = m_xpsArchive.SendCurrentFile(); - } - - // - // Close the curent file ready for the next - // - m_xpsArchive.CloseCurrent(); - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXPSProcessor::GetRelsForPart - -Routine Description: - - This routine retrieves and populates the rels object with the relationships - for the specified part - -Arguments: - - szPartName - The name of the part to retrieve the relationships for - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXPSProcessor::GetRelsForPart( - _In_ PCSTR szPartName - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(szPartName, E_POINTER))) - { - try - { - CStringXDA cstrRelsPartName; - CComPtr<ISequentialStream> pFileReader(NULL); - - // - // Construct the rels part from the parent part name and parse for - // relationships - // - if (SUCCEEDED(hr = MakeRelsPartName(szPartName, &cstrRelsPartName)) && - SUCCEEDED(hr = m_contentTypes.ValidateContentType(cstrRelsPartName, ContentRelationships)) && - SUCCEEDED(hr = m_xpsArchive.GetFileStream(cstrRelsPartName, &pFileReader)) && - SUCCEEDED(hr = m_pSaxRdr->putContentHandler(&m_rels)) && - SUCCEEDED(hr = m_rels.SetCurrentFileName(szPartName)) && - SUCCEEDED(hr = m_pSaxRdr->parse(CComVariant(pFileReader)))) - { - // - // We are done with the .rels part - send it on - // - hr = m_xpsArchive.SendCurrentFile(); - } - - // - // Close the curent file ready for the next - // - m_xpsArchive.CloseCurrent(); - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR_EXC(hr, E_ELEMENT_NOT_FOUND); - return hr; -} - -/*++ - -Routine Name: - - CXPSProcessor::MakeRelsPartName - -Routine Description: - - This routine converts a part name into the appropriate .rels name. - The rules for naming are: - rels parts are stored in a directory named _rels relative to the current part - rels parts always end in .rels - e.g. \Documents\FixedDoc.fdseq has rels part \Documents\_rels\FixedDoc.fdseq.rels - -Arguments: - - szPartName - The name of the part to be converted - pcstrRelsPartName - Pointer to a CStringXDA that recieves the new name - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXPSProcessor::MakeRelsPartName( - _In_ PCSTR szPartName, - _Out_ CStringXDA* pcstrRelsPartName - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(szPartName, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pcstrRelsPartName, E_POINTER))) - { - try - { - *pcstrRelsPartName = szPartName; - - // - // Find the slash that splits the directory and part name - // - INT cLastSlash = -1; - for (;;) - { - INT cSlash = pcstrRelsPartName->Find("/", cLastSlash + 1); - - if (cSlash != -1) - { - cLastSlash = cSlash; - } - else - { - break; - } - } - cLastSlash++; - - // - // Insert "_rels/" after the slash and append ".rels" - // - pcstrRelsPartName->Insert(cLastSlash, szRelsPre); - pcstrRelsPartName->Append(szRelsPost); - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXPSProcessor::ProcessRelsParts - -Routine Description: - - This routine processes the related parts for a given part - -Arguments: - - szPartName - The name of the part - eContentType - The type of the part to be processed. This must be either an FDS, FD or FP. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXPSProcessor::ProcessRelsParts( - _In_ PCSTR szPartName, - _In_ CONST EContentType eContentType - ) -{ - HRESULT hr = S_OK; - - BOOL bPrintTicketSent = FALSE; - - if (SUCCEEDED(hr = CHECK_POINTER(szPartName, E_POINTER))) - { - if (eContentType != ContentFixedDocumentSequence && - eContentType != ContentFixedDocument && - eContentType != ContentFixedPage) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - try - { - // - // Validate the part content type - // Get the rels and handle any print tickets - // - CONST RelsTypeList* pRelsTypeList; - if (SUCCEEDED(hr = m_contentTypes.ValidateContentType(szPartName, eContentType)) && - SUCCEEDED(hr = GetRelsForPart(szPartName)) && - SUCCEEDED(hr = m_rels.GetRelsTypeList(szPartName, &pRelsTypeList))) - { - - RelsTypeList::const_iterator iterRels = pRelsTypeList->begin(); - - for (;iterRels != pRelsTypeList->end() && SUCCEEDED(hr); iterRels++) - { - // - // Strip any leading "/" - // - CStringXDA cstrName(iterRels->first); - if (cstrName.GetAt(0) == '/') - { - cstrName.Delete(0); - } - - // - // The second of the pair in the RelsTypeList iterator is the rels type - // - switch (iterRels->second) - { - case RelsPrintTicket: - { - hr = AddPrintTicket(cstrName, eContentType); - bPrintTicketSent = TRUE; - } - break; - - case RelsAnnotations: - case RelsDigitalSignatureDefinitions: - case RelsDiscardControl: - case RelsDocumentStructure: - case RelsRequiredResource: - case RelsRestrictedFont: - case RelsStoryFragments: - case RelsCoreProperties: - case RelsDigitalSignature: - case RelsDigitalSignatureCertificate: - case RelsDigitalSignatureOrigin: - case RelsThumbnail: - { - // - // We are not interested in the content so intialise the current - // file in the XPS archive and send it on - // - if (SUCCEEDED(hr = m_xpsArchive.InitialiseFile(cstrName))) - { - hr = m_xpsArchive.SendCurrentFile(); - } - } - break; - - default: - { - ERR("Unrecognised rels part\n"); - - hr = E_FAIL; - } - break; - } - - // - // Close the current file ready for the next - // - m_xpsArchive.CloseCurrent(); - } - } - else if (hr == E_ELEMENT_NOT_FOUND) - { - // - // There is no PrintTicket - // - hr = S_OK; - } - - // - // No print ticket has been sent so just inform the print ticket - // manager that a suitable ticket needs to be set for this level - // - if (bPrintTicketSent == FALSE) - { - switch (eContentType) - { - case ContentFixedPage: - { - hr = m_pPtManager->SetTicket(kPTPageScope, NULL); - } - break; - case ContentFixedDocument: - { - hr = m_pPtManager->SetTicket(kPTDocumentScope, NULL); - } - break; - case ContentFixedDocumentSequence: - { - hr = m_pPtManager->SetTicket(kPTJobScope, NULL); - } - break; - default: - { - hr = ERROR_NOT_SUPPORTED; - } - break; - } - } - } - catch (CXDException& e) - { - hr = e; - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXPSProcessor::AddPrintTicket - -Routine Description: - - This routine retrieves the PrintTicket information and updates the PrintTicket - manager at the appropriate scope - -Arguments: - - szPTPartName - The part name for the PrintTicket - eContentType - The type of the containing part. This must be either an FDS, FD or FP. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXPSProcessor::AddPrintTicket( - _In_ PCSTR szPTPartName, - _In_ CONST EContentType eContentType - ) -{ - HRESULT hr = S_OK; - - // - // Validate the parameters - // - if (SUCCEEDED(hr = CHECK_POINTER(szPTPartName, E_POINTER))) - { - if (eContentType != ContentFixedDocumentSequence && - eContentType != ContentFixedDocument && - eContentType != ContentFixedPage) - { - hr = E_INVALIDARG; - } - } - - // - // Extract the PrintTicket from the current file in the XPS archive - // and pass to the PrinTicket manager at the appropriate scope - // - CComPtr<ISequentialStream> pFileReader(NULL); - CComPtr<IXMLDOMDocument2> pPT(NULL); - - VARIANT_BOOL fLoaded = VARIANT_FALSE; - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = m_xpsArchive.GetFileStream(szPTPartName, &pFileReader)) && - SUCCEEDED(hr = pPT.CoCreateInstance(CLSID_DOMDocument60)) && - SUCCEEDED(hr = pPT->load(CComVariant(pFileReader), &fLoaded))) - { - if (fLoaded == VARIANT_TRUE) - { - // - // Determine the scope from the parent parts content type - // - EPrintTicketScope ePTScope = kPTPageScope; - - if (eContentType == ContentFixedDocumentSequence) - { - ePTScope = kPTJobScope; - } - else if (eContentType == ContentFixedDocument) - { - ePTScope = kPTDocumentScope; - } - - if (SUCCEEDED(hr = m_pPtManager->SetTicket(ePTScope, pPT))) - { - // - // Make sure the PrintTicket is passed on - // - hr = m_xpsArchive.SendCurrentFile(); - } - } - else - { - ERR("Failed to load PT\n"); - - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXPSProcessor::AddPrintTicket - -Routine Description: - - This routine intialises the appropriate read and write streams for a fixed - page processor and calls the processor to do the work - -Arguments: - - szFPPartName - The name of the FixedPage part - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXPSProcessor::ProcessFixedPage( - _In_ PCSTR szFPPartName - ) -{ - HRESULT hr = S_OK; - // - // Retrieve the file stream and pass to the page scaling handler - // - CComPtr<ISequentialStream> pFileReader(NULL); - CXPSWriteFile* pXpsWriteFile = new(std::nothrow) CXPSWriteFile(szFPPartName); - - IXMLDOMDocument2* pPT = NULL; - - if (SUCCEEDED(hr = CHECK_POINTER(pXpsWriteFile, E_OUTOFMEMORY)) && - SUCCEEDED(hr = CHECK_POINTER(m_pPageProcessor, E_PENDING)) && - SUCCEEDED(hr = CHECK_POINTER(szFPPartName, E_PENDING)) && - SUCCEEDED(hr = m_xpsArchive.GetFileStream(szFPPartName, &pFileReader)) && - SUCCEEDED(hr = m_pPtManager->GetTicket(kPTPageScope, &pPT)) && - SUCCEEDED(hr = CHECK_POINTER(pPT, E_FAIL)) && - SUCCEEDED(hr = m_pPageProcessor->ProcessFixedPage(pPT, pFileReader, pXpsWriteFile))) - { - // - // Send the new fixed page - // - ULONG cb = 0; - PVOID pv = NULL; - - if (SUCCEEDED(hr = pXpsWriteFile->GetBuffer(&pv, &cb))) - { - hr = m_xpsArchive.SendFile(szFPPartName, pv, cb, CompDeflated); - } - } - else if (hr == HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED)) - { - // - // The page processor does not want to do any work - just send the page - // - hr = m_xpsArchive.SendCurrentFile(); - } - - if (pXpsWriteFile != NULL) - { - delete pXpsWriteFile; - pXpsWriteFile = NULL; - } - - // - // Close the current file ready for the next - // - m_xpsArchive.CloseCurrent(); - - ERR_ON_HR(hr); - return hr; -} diff --git a/print/XPSDrvSmpl/src/filters/xdcont/xpsproc.h b/print/XPSDrvSmpl/src/filters/xdcont/xpsproc.h deleted file mode 100644 index 70b08ec6..00000000 --- a/print/XPSDrvSmpl/src/filters/xdcont/xpsproc.h +++ /dev/null @@ -1,137 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - xpsproc.h - -Abstract: - - Definition of the XPS processor. This class is responsible for handling - the logical document and page structure of the XPS container. The class starts - with the content types part and .rels part to find the Fixed Document Sequence. - It then parses the FDS to find the Fixed Documents and finally the FDs to find - each Fixed Page. Each fixed page is then reported to a client FixedPageProcessor - to interpret the mark-up and write out modifications as required. The class is - additionally responsible for ensuring all XPS parts and accompanying resources are - sent on to the PK archive handler to be written out. - ---*/ - -#pragma once - -#include "xps.h" -#include "xpsarch.h" -#include "xpstype.h" -#include "xpsrels.h" -#include "xpsfds.h" -#include "xpsfd.h" -#include "ptmanage.h" - -class IFixedPageProcessor -{ -public: - IFixedPageProcessor(){} - - virtual ~IFixedPageProcessor(){} - - virtual HRESULT - ProcessFixedPage( - _In_ IXMLDOMDocument2* pFPPT, - _In_ ISequentialStream* pPageReadStream, - _Out_ ISequentialStream* pPageWriteStream - ) = 0; -}; - -class CXPSProcessor -{ -public: - CXPSProcessor( - _In_ IPrintReadStream* pReadStream, - _In_ IPrintWriteStream* pWriteStream, - _In_ IFixedPageProcessor* pPageProcessor, - _In_ IPrintPipelinePropertyBag* pPropertyBag, - _In_ CPTManager* pPtManager - ); - - virtual ~CXPSProcessor(); - - HRESULT - Start( - VOID - ); - -private: - HRESULT - GetFixedDocumentSequenceParts( - _Inout_ FileList* pFixedDocumentSequenceParts - ); - - HRESULT - GetFixedDocumentParts( - _In_ PCSTR szFixedDocSeq, - _Out_ FileList* pFixedDocumentParts - ); - - HRESULT - GetFixedPageParts( - _In_ PCSTR szFixedDoc, - _Out_ FileList* pFixedPageParts - ); - - HRESULT - GetRelsForPart( - _In_ PCSTR szPartName - ); - - HRESULT - MakeRelsPartName( - _In_ PCSTR szPartName, - _Out_ CStringXDA* pcstrRelsPartName - ); - - HRESULT - ProcessRelsParts( - _In_ PCSTR szPartName, - _In_ CONST EContentType contentType - ); - - HRESULT - AddPrintTicket( - _In_ PCSTR szPartName, - _In_ CONST EContentType eContentType - ); - - HRESULT - ProcessFixedPage( - _In_ PCSTR szPartName - ); - -private: - CXPSArchive m_xpsArchive; - - CContentTypes m_contentTypes; - - CRels m_rels; - - CFixedDocumentSequence m_fixedDocSeq; - - CFixedDocument m_fixedDoc; - - CComPtr<ISAXXMLReader> m_pSaxRdr; - - IFixedPageProcessor* m_pPageProcessor; - - CPTManager* m_pPtManager; - - CComPtr<IPrintPipelinePropertyBag> m_pPrintPropertyBag; -}; - diff --git a/print/XPSDrvSmpl/src/filters/xdcont/xpsrels.cpp b/print/XPSDrvSmpl/src/filters/xdcont/xpsrels.cpp deleted file mode 100644 index 8bb8fed8..00000000 --- a/print/XPSDrvSmpl/src/filters/xdcont/xpsrels.cpp +++ /dev/null @@ -1,419 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - xpsrels.cpp - -Abstract: - - Implementation of the XPS rels part SAX handler. This class is responsible - for retrieving all the rels parts for a particular rels file and storing - them for access by the XPS processor. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "xdexcept.h" -#include "xpsrels.h" - -static PCSTR szRelationship = "Relationship"; -static PCSTR szTarget = "Target"; -static PCSTR szType = "Type"; - -static PCSTR szRels[ERelsTypeMax] = { - "http://schemas.microsoft.com/xps/2005/06/annotations", - "http://schemas.microsoft.com/xps/2005/06/signature-definitions", - "http://schemas.microsoft.com/xps/2005/06/discard-control", - "http://schemas.microsoft.com/xps/2005/06/documentstructure", - "http://schemas.microsoft.com/xps/2005/06/printticket", - "http://schemas.microsoft.com/xps/2005/06/required-resource", - "http://schemas.microsoft.com/xps/2005/06/restricted-font", - "http://schemas.microsoft.com/xps/2005/06/fixedrepresentation", - "http://schemas.microsoft.com/xps/2005/06/storyfragments", - "http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties", - "http://schemas.openxmlformats.org/package/2006/relationships/digital-signature/signature", - "http://schemas.openxmlformats.org/package/2006/relationships/digital-signature/certificate", - "http://schemas.openxmlformats.org/package/2006/relationships/digital-signature/origin", - "http://schemas.openxmlformats.org/package/2006/relationships/metadata/thumbnail", -}; - -/*++ - -Routine Name: - - CRels::CRels - -Routine Description: - - CRels class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CRels::CRels() -{ -} - -/*++ - -Routine Name: - - CRels::~CRels - -Routine Description: - - CRels class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CRels::~CRels() -{ -} - -/*++ - -Routine Name: - - CRels::startElement - -Routine Description: - - This routine is the startElement method of the SAX handler. This is used - to parse a relationships part mark-up retrieving and storing the list of - relationships - -Arguments: - - pwchNamespaceUri - Unused: Local namespace URI - cchNamespaceUri - Unused: Length of the namespace URI - pwchLocalName - Unused: Local name string - cchLocalName - Unused: Length of the local name string - pwchQName - The qualified name with prefix - cchQName - The length of the qualified name with prefix - pAttributes - Pointer to the ISAXAttributes interface containing attributes attached to the element - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT STDMETHODCALLTYPE -CRels::startElement( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - _In_reads_(cchQName) CONST wchar_t* pwchQName, - _In_ INT cchQName, - _In_ ISAXAttributes* pAttributes - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pwchQName, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pAttributes, E_POINTER))) - { - if (cchQName <= 0) - { - hr = E_INVALIDARG; - } - } - - try - { - CStringXDA cstrElementName(pwchQName, cchQName); - - if (SUCCEEDED(hr) && - cstrElementName == szRelationship) - { - CStringXDA cstrTargetName; - CStringXDA cstrRelsType; - - INT cAttributes = 0; - - if (SUCCEEDED(hr)) - { - hr = pAttributes->getLength(&cAttributes); - } - - // - // Run over all attributes identifying part names and part types - // - for (INT cIndex = 0; cIndex < cAttributes && SUCCEEDED(hr); cIndex++) - { - PCWSTR pszAttUri = NULL; - INT cchAttUri = 0; - PCWSTR pszAttName = NULL; - INT cchAttName = 0; - PCWSTR pszAttQName = NULL; - INT cchAttQName = 0; - PCWSTR pszAttValue = NULL; - INT cchAttValue = 0; - - // - // Get the attribute data ready to write out - // - if (SUCCEEDED(hr = pAttributes->getName(cIndex, &pszAttUri, &cchAttUri, &pszAttName, &cchAttName, &pszAttQName, &cchAttQName)) && - SUCCEEDED(hr = pAttributes->getValue(cIndex, &pszAttValue, &cchAttValue))) - { - CStringXDA cstrAttName(pszAttQName, cchAttQName); - CStringXDA cstrAttValue(pszAttValue, cchAttValue); - - if (cstrAttName == szTarget) - { - cstrTargetName = cstrAttValue; - } - else if (cstrAttName == szType) - { - cstrRelsType = cstrAttValue; - } - } - } - - if (cstrTargetName.GetLength() > 0) - { - if (cstrRelsType.GetLength() > 0) - { - ERelsType relsType; - if (SUCCEEDED(hr = GetRelsTypeFromString(cstrRelsType, &relsType))) - { - // - // Strip any leading "/" - // - if (cstrTargetName.GetAt(0) == '/') - { - cstrTargetName.Delete(0); - } - - try - { - m_relsMap[m_cstrCurrentFileName].push_back(RelsNameType(cstrTargetName, relsType)); - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - } - else - { - RIP("Target name identified with no corresponding type\n"); - - hr = E_FAIL; - } - } - } - } - catch (CXDException& e) - { - hr = e; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CRels::SetCurrentFileName - -Routine Description: - - This routine sets the filename of the part for which the relationships - are being identified - -Arguments: - - szFileName - The name of the XPS part - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CRels::SetCurrentFileName( - _In_ PCSTR szFileName - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(szFileName, E_POINTER))) - { - try - { - m_cstrCurrentFileName = szFileName; - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CRels::GetRelsTypeList - -Routine Description: - - This routine retrieves the list of the relationships for the specified - part name - -Arguments: - - szFileName - The name of the XPS part to retrieve the relationships list for - ppFileList - Pointer to a RelsTypeList pointer that recieves the relationships list - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CRels::GetRelsTypeList( - _In_ PCSTR szFileName, - _Outptr_ CONST RelsTypeList** ppFileList - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppFileList, E_POINTER))) - { - try - { - RelsMap::const_iterator iterRels = m_relsMap.find(szFileName); - if (iterRels != m_relsMap.end()) - { - *ppFileList = &(iterRels->second); - } - else - { - hr = HRESULT_FROM_WIN32(ERROR_NOT_FOUND); - } - } - catch (CXDException& e) - { - hr = e; - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CRels::GetRelsTypeFromString - -Routine Description: - - This routine retrieves the relationship enumeration defining the type from the - relationships string defining the type - -Arguments: - - cstrRelsType - The string defining the rels type - pRelsType - Pointer to the rels type that recieves the type - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CRels::GetRelsTypeFromString( - _In_ CONST CStringXDA& cstrRelsType, - _Out_ ERelsType* pRelsType - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pRelsType, E_POINTER))) - { - *pRelsType = RelsUnknown; - - try - { - if (cstrRelsType.GetLength() > 0) - { - for (ERelsType relsType = ERelsTypeMin; - relsType < ERelsTypeMax; - relsType = static_cast<ERelsType>(relsType + 1)) - { - if (cstrRelsType.CompareNoCase(szRels[relsType]) == 0) - { - *pRelsType = relsType; - break; - } - } - - if (*pRelsType == RelsUnknown) - { - ERR("Unrecognized relationships type string.\n"); - - hr = E_FAIL; - } - } - else - { - hr = E_INVALIDARG; - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} diff --git a/print/XPSDrvSmpl/src/filters/xdcont/xpsrels.h b/print/XPSDrvSmpl/src/filters/xdcont/xpsrels.h deleted file mode 100644 index 29ee4a9c..00000000 --- a/print/XPSDrvSmpl/src/filters/xdcont/xpsrels.h +++ /dev/null @@ -1,70 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - xpsrels.h - -Abstract: - - Definition of the XPS rels part SAX handler. This class is responsible - for retrieving all the rels parts for a particular rels file and storing - them for access by the XPS processor. - ---*/ - -#pragma once - -#include "saxhndlr.h" -#include "xps.h" - -class CRels : public CSaxHandler -{ -public: - CRels(); - - virtual ~CRels(); - - virtual HRESULT STDMETHODCALLTYPE - startElement( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - _In_reads_(cchQName) CONST wchar_t* pwchQName, - _In_ INT cchQName, - _In_ ISAXAttributes* pAttributes - ); - - HRESULT - GetRelsTypeList( - _In_ PCSTR szFileName, - _Outptr_ CONST RelsTypeList** ppFileList - ); - - HRESULT - SetCurrentFileName( - _In_ PCSTR szFileName - ); - -private: - HRESULT - GetRelsTypeFromString( - _In_ CONST CStringXDA& cstrRelsType, - _Out_ ERelsType* pRelsType - ); - -private: - RelsMap m_relsMap; - - CStringXDA m_cstrCurrentFileName; -}; - diff --git a/print/XPSDrvSmpl/src/filters/xdcont/xpstype.cpp b/print/XPSDrvSmpl/src/filters/xdcont/xpstype.cpp deleted file mode 100644 index 35dca7cf..00000000 --- a/print/XPSDrvSmpl/src/filters/xdcont/xpstype.cpp +++ /dev/null @@ -1,417 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - xpstype.cpp - -Abstract: - - Implementation of the XPS content type part SAX handler. This class is responsible - for retrieving all the content types information and storing them for access by the - XPS processor. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "xdexcept.h" -#include "xpstype.h" - -static PCSTR szCTOverride = "Override"; -static PCSTR szCTPartName = "PartName"; -static PCSTR szCTContentType = "ContentType"; -static PCSTR szCTDefault = "Default"; -static PCSTR szCTExtension = "Extension"; - -static PCSTR szContentType[EContentTypeMax] = { - "application/vnd.ms-package.xps-fixeddocumentsequence+xml", - "application/vnd.ms-package.xps-fixeddocument+xml", - "application/vnd.ms-package.xps-fixedpage+xml", - "application/vnd.ms-package.xps-discard-control+xml", - "application/vnd.ms-package.xps-documentstructure+xml", - "application/vnd.ms-opentype", - "application/vnd.ms-color.iccprofile", - "application/vnd.ms-package.obfuscated-opentype", - "application/vnd.ms-printing.printticket+xml", - "application/vnd.ms-package.xps-resourcedictionary+xml", - "application/vnd.ms-package.xps-storyfragments+xml", - "image/jpeg", - "image/png", - "image/tiff", - "image/vnd.ms-photo", - "application/vnd.openxmlformats-package.core-properties+xml", - "application/vnd.openxmlformats-package.digital-signature-certificate", - "application/vnd.openxmlformats-package.digital-signature-origin", - "application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml", - "application/vnd.openxmlformats-package.relationships+xml", -}; - -/*++ - -Routine Name: - - CContentTypes::CContentTypes - -Routine Description: - - CContentTypes class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CContentTypes::CContentTypes() -{ -} - -/*++ - -Routine Name: - - CContentTypes::~CContentTypes - -Routine Description: - - CContentTypes class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CContentTypes::~CContentTypes() -{ -} - -/*++ - -Routine Name: - - CContentTypes::startElement - -Routine Description: - - This routine is the startElement method of the SAX handler. This is used - to parse the content types part mark-up retrieving and storing the list of - content types - -Arguments: - - pwchNamespaceUri - Unused: Local namespace URI - cchNamespaceUri - Unused: Length of the namespace URI - pwchLocalName - Unused: Local name string - cchLocalName - Unused: Length of the local name string - pwchQName - The qualified name with prefix - cchQName - The length of the qualified name with prefix - pAttributes - Pointer to the ISAXAttributes interface containing attributes attached to the element - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT STDMETHODCALLTYPE -CContentTypes::startElement( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - _In_reads_(cchQName) CONST wchar_t* pwchQName, - _In_ INT cchQName, - _In_ ISAXAttributes* pAttributes - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pwchQName, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pAttributes, E_POINTER))) - { - if (cchQName <= 0) - { - hr = E_INVALIDARG; - } - } - - try - { - CStringXDA cstrElementName(pwchQName, cchQName); - - if (cstrElementName == szCTOverride || - cstrElementName == szCTDefault) - { - CStringXDA cstrPartName; - CStringXDA cstrPartType; - - INT cAttributes = 0; - - if (SUCCEEDED(hr)) - { - hr = pAttributes->getLength(&cAttributes); - } - - // - // Run over all attributes identifying part names and part types - // - for (INT cIndex = 0; cIndex < cAttributes && SUCCEEDED(hr); cIndex++) - { - PCWSTR pszAttUri = NULL; - INT cchAttUri = 0; - PCWSTR pszAttName = NULL; - INT cchAttName = 0; - PCWSTR pszAttQName = NULL; - INT cchAttQName = 0; - PCWSTR pszAttValue = NULL; - INT cchAttValue = 0; - - // - // Get the attribute data ready to write out - // - if (SUCCEEDED(hr = pAttributes->getName(cIndex, &pszAttUri, &cchAttUri, &pszAttName, &cchAttName, &pszAttQName, &cchAttQName)) && - SUCCEEDED(hr = pAttributes->getValue(cIndex, &pszAttValue, &cchAttValue))) - { - CStringXDA cstrAttName(pszAttQName, cchAttQName); - CStringXDA cstrAttValue(pszAttValue, cchAttValue); - - if (cstrAttName == szCTPartName || - cstrAttName == szCTExtension) - { - cstrPartName = cstrAttValue; - } - else if (cstrAttName == szCTContentType) - { - cstrPartType = cstrAttValue; - } - } - } - - if (cstrPartName.GetLength() > 0) - { - if (cstrPartType.GetLength() > 0) - { - EContentType contentType; - if (SUCCEEDED(hr = GetContentTypeFromString(cstrPartType, &contentType))) - { - // - // Strip any leading "/" - // - if (cstrPartName.GetAt(0) == '/') - { - cstrPartName.Delete(0); - } - - try - { - m_contentMap[cstrPartName] = contentType; - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - } - else - { - RIP("Part name identified with no corresponding type\n"); - - hr = E_FAIL; - } - } - } - } - catch (CXDException& e) - { - hr = e; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CContentTypes::ValidateContentType - -Routine Description: - - This routine validates a part against a content type - -Arguments: - - szPartName - The name of the XPS part - contentType - The content type to validate against - -Return Value: - - HRESULT - S_OK - On success - E_ELEMENT_NOT_FOUND - When the part is not present - E_* - On error - ---*/ -HRESULT -CContentTypes::ValidateContentType( - _In_ PCSTR szPartName, - _In_ CONST EContentType contentType - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(szPartName, E_POINTER))) - { - try - { - CStringXDA cstrPartName(szPartName); - - if (cstrPartName.GetLength() > 0) - { - // - // Check if the content type is defined for the full part name - // - ContentMap::const_iterator iterContents = m_contentMap.find(cstrPartName); - if (iterContents == m_contentMap.end()) - { - // - // Check if the type is defined by the extension - // - CStringXDA partExt(PathFindExtensionA(cstrPartName)); - - // - // Strip any leading "/" - // - if (partExt.GetAt(0) == '/') - { - partExt.Delete(0); - } - - iterContents = m_contentMap.find(partExt); - } - - if (iterContents != m_contentMap.end()) - { - if (contentType != iterContents->second) - { - hr = E_FAIL; - } - } - else - { - hr = E_ELEMENT_NOT_FOUND; - } - } - else - { - hr = E_INVALIDARG; - } - } - catch (CXDException& e) - { - hr = e; - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - - ERR_ON_HR_EXC(hr, E_ELEMENT_NOT_FOUND); - return hr; -} - -/*++ - -Routine Name: - - CContentTypes::GetContentTypeFromString - -Routine Description: - - This routine retrieves the content type enumeration defining the type from the - content type string defining the type - -Arguments: - - cstrPartType - The string defining the content type - pContentType - Pointer to the content type that recieves the type - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CContentTypes::GetContentTypeFromString( - _In_ CONST CStringXDA& cstrPartType, - _Out_ EContentType* pContentType - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pContentType, E_POINTER))) - { - *pContentType = ContentUnknown; - - try - { - if (cstrPartType.GetLength() > 0) - { - for (EContentType contentType = EContentTypeMin; - contentType < EContentTypeMax; - contentType = static_cast<EContentType>(contentType + 1)) - { - if (cstrPartType.CompareNoCase(szContentType[contentType]) == 0) - { - *pContentType = contentType; - break; - } - } - - if (*pContentType == ContentUnknown) - { - ERR("Unrecognized content type string.\n"); - - hr = E_FAIL; - } - } - else - { - hr = E_INVALIDARG; - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/xdcont/xpstype.h b/print/XPSDrvSmpl/src/filters/xdcont/xpstype.h deleted file mode 100644 index 0a5b5b06..00000000 --- a/print/XPSDrvSmpl/src/filters/xdcont/xpstype.h +++ /dev/null @@ -1,63 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - xpstype.h - -Abstract: - - Definition of the XPS content type part SAX handler. This class is responsible - for retrieving all the content types information and storing them for access by the - XPS processor. - ---*/ - -#pragma once - -#include "saxhndlr.h" -#include "xps.h" - -class CContentTypes : public CSaxHandler -{ -public: - CContentTypes(); - - virtual ~CContentTypes(); - - virtual HRESULT STDMETHODCALLTYPE - startElement( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - _In_reads_(cchQName) CONST wchar_t* pwchQName, - _In_ INT cchQName, - _In_ ISAXAttributes* pAttributes - ); - - HRESULT - ValidateContentType( - _In_ PCSTR szPartName, - _In_ CONST EContentType contentType - ); - -private: - HRESULT - GetContentTypeFromString( - _In_ CONST CStringXDA& cstrPartType, - _Out_ EContentType* pContentType - ); - -private: - ContentMap m_contentMap; -}; - diff --git a/print/XPSDrvSmpl/src/inc/cunknown.h b/print/XPSDrvSmpl/src/inc/cunknown.h deleted file mode 100644 index c7cceff0..00000000 --- a/print/XPSDrvSmpl/src/inc/cunknown.h +++ /dev/null @@ -1,212 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - cunknown.h - -Abstract: - - Provides a simple template implementation for classes that need to - implement IUnknown. - ---*/ - -#pragma once - -template <class _T> -class CUnknown : public _T -{ -public: - /*++ - - Routine Name: - - CUnknown - - Routine Description: - - CUnknown class constructor - - Arguments: - - IIDTarget - The target interface guid - - Return Value: - - None - - --*/ - CUnknown( - REFIID IIDTarget - ) : - m_IIDTarget(IIDTarget), - m_cRef(1) - { - } - - /*++ - - Routine Name: - - ~CUnknown - - Routine Description: - - CUnknown class destructor - - Arguments: - - None - - Return Value: - - None - - --*/ - virtual ~CUnknown() - { - } - - // - // IUnknown methods - // - /*++ - - Routine Name: - - QueryInterface - - Routine Description: - - This routine implements the IUnknown::QueryInterface method. Returns the raw interface - pointer for the requested IID if it matches the target IID - - Arguments: - - riid - The IID of the requested interface - ppv - The raw interface pointer - - Return Value: - - HRESULT - S_OK - On success - E_* - On error - - --*/ - virtual HRESULT STDMETHODCALLTYPE - QueryInterface( - REFIID riid, - _Out_ PVOID* ppv - ) - { - HRESULT hr = S_OK; - - if (ppv != NULL) - { - if (riid == IID_IUnknown || - riid == m_IIDTarget) - { - *ppv = static_cast<_T*>(this); - } - else - { - *ppv = NULL; - - hr = E_NOINTERFACE; - } - } - else - { - hr = E_POINTER; - } - - if (SUCCEEDED(hr)) - { - AddRef(); - } - - return hr; - } - - /*++ - - Routine Name: - - AddRef - - Routine Description: - - This routine increments the reference count on the current interface - - Arguments: - - None - - Return Value: - - HRESULT - S_OK - On success - E_* - On error - - --*/ - virtual ULONG STDMETHODCALLTYPE - AddRef() - { - return InterlockedIncrement(&m_cRef); - } - - /*++ - - Routine Name: - - Release - - Routine Description: - - This routine decrements the reference count on the current interface - - Arguments: - - None - - Return Value: - - HRESULT - S_OK - On success - E_* - On error - - Notes: - - The drv_at annotation tells Prefast to consider this object's memory - freed after Release has been called. - - --*/ - virtual - ULONG STDMETHODCALLTYPE - Release() - { - ULONG cRef = InterlockedDecrement(&m_cRef); - - if (0 == cRef) - { - delete this; - } - - return cRef; - } - -private: - LONG m_cRef; - - IID m_IIDTarget; -}; - diff --git a/print/XPSDrvSmpl/src/inc/gdip.h b/print/XPSDrvSmpl/src/inc/gdip.h deleted file mode 100644 index 923c3430..00000000 --- a/print/XPSDrvSmpl/src/inc/gdip.h +++ /dev/null @@ -1,121 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - gdip.h - -Abstract: - - Provides a wrapper class around GDIPlus that takes care of intialisation - and shutdown. A class only need define this as a member variable to use - GDIPlus - intialisation and shutdown are handled during construction and - destruction. - -Known issues: - - The class does not yet implement debug event handling. - ---*/ - -#pragma once - -class GDIPlus -{ -public: - /*++ - - Routine Name: - - GDIPlus - - Routine Description: - - GDIPlus class constructor - - Arguments: - - None - - Return Value: - - None - - --*/ - GDIPlus() : - m_pGDIPlusToken(NULL), - m_GDIPlusStartStatus(GdiplusNotInitialized) - { - GdiplusStartupInput gdiPlusStartInput; - - m_GDIPlusStartStatus = GdiplusStartup(&m_pGDIPlusToken, &gdiPlusStartInput, NULL); - } - - /*++ - - Routine Name: - - ~GDIPlus - - Routine Description: - - GDIPlus class destructor - - Arguments: - - None - - Return Value: - - None - - --*/ - virtual ~GDIPlus() - { - GdiplusShutdown(m_pGDIPlusToken); - m_pGDIPlusToken = NULL; - m_GDIPlusStartStatus = GdiplusNotInitialized; - } - - /*++ - - Routine Name: - - GetGDIPlusStartStatus - - Routine Description: - - This routine returns the start status of GDI Plus - - Arguments: - - None - - Return Value: - - Gdiplus::Status - Ok - On success - Gdiplus error - On Error - - --*/ - Status GetGDIPlusStartStatus( - VOID - ) - { - return m_GDIPlusStartStatus; - } - -private: - ULONG_PTR m_pGDIPlusToken; - - Status m_GDIPlusStartStatus; -}; - diff --git a/print/XPSDrvSmpl/src/inc/ipkarch.h b/print/XPSDrvSmpl/src/inc/ipkarch.h deleted file mode 100644 index 7721a2db..00000000 --- a/print/XPSDrvSmpl/src/inc/ipkarch.h +++ /dev/null @@ -1,230 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - ipkarch.h - -Abstract: - - Definition of the interface supported by the PK archive handling module. - ---*/ - -#pragma once - -#include "ipkfile.h" - -// -// {5A0F4115-D4D3-401e-8071-A440D6D07092} -// -DEFINE_GUID(CLSID_PKArchiveHandler, 0x5a0f4115, 0xd4d3, 0x401e, 0x80, 0x71, 0xa4, 0x40, 0xd6, 0xd0, 0x70, 0x92); - -// -// {BDBBDF56-C742-4efd-8075-AF2C7B247F38} -// -DEFINE_GUID(IID_IPKArchive, 0xbdbbdf56, 0xc742, 0x4efd, 0x80, 0x75, 0xaf, 0x2c, 0x7b, 0x24, 0x7f, 0x38); - - -typedef map<CStringXDA, CONST IPKFile*> NameIndex; - -class IPKArchive : public IUnknown -{ -public: - /*++ - - Routine Name: - - SetReadStream - - Routine Description: - - This routine sets the read stream for the PK archive handler - - Arguments: - - pReadStream - Pointer to the print read stream interface - - Return Value: - - HRESULT - S_OK - On success - E_* - On error - - --*/ - HRESULT - virtual SetReadStream( - _In_ IPrintReadStream* pReadStream - ) = 0; - - /*++ - - Routine Name: - - SetWriteStream - - Routine Description: - - This routine sets the write stream for the PK archive handler - - Arguments: - - pWriteStream - Pointer to the print write stream interface - - Return Value: - - HRESULT - S_OK - On success - E_* - On error - - --*/ - HRESULT - virtual SetWriteStream( - _In_ IPrintWriteStream* pWriteStream - ) = 0; - - /*++ - - Routine Name: - - ProcessReadStream - - Routine Description: - - This method instructs the PK archive handler to process the PK archive for all records - - Arguments: - - None - - Return Value: - - HRESULT - S_OK - On success - E_* - On error - - --*/ - HRESULT - virtual ProcessReadStream( - VOID - ) = 0; - - /*++ - - Routine Name: - - GetNameIndex - - Routine Description: - - This routine retrieves the archives indexed by name - - Arguments: - - ppNameIdx - Pointer to a NameIndex pointer that recieves the archive index - - Return Value: - - HRESULT - S_OK - On success - E_* - On error - - --*/ - HRESULT - virtual GetNameIndex( - _Outptr_ NameIndex** ppNameIdx - ) = 0; - - /*++ - - Routine Name: - - SendFile - - Routine Description: - - This routine sends the PK file to the write stream - - Arguments: - - pFile - Pointer to the IPKFile to be sent to the write stream - - Return Value: - - HRESULT - S_OK - On success - E_* - On error - - --*/ - HRESULT - virtual SendFile( - _In_ CONST IPKFile* pFile - ) = 0; - - /*++ - - Routine Name: - - SendFile - - Routine Description: - - This routine compresses and sends a buffer as a PK archive to the write stream - - Arguments: - - szFileName - The name of the archive to be created - pBuffer - The buffer containing the uncompressed archive data - cbBuffer - The size of the uncompressed archive data - compressionType - The type of compression to be used (only CompNone and CompDeflated are supported) - - Return Value: - - HRESULT - S_OK - On success - E_* - On error - - --*/ - HRESULT - virtual SendFile( - _In_z_ PCSTR szFileName, - _In_reads_bytes_(cbBuffer) PVOID pBuffer, - ULONG cbBuffer, - ECompressionType eCompType - ) = 0; - - /*++ - - Routine Name: - - Close - - Routine Description: - - This routine closes and finalises the PK archive - - Arguments: - - None - - Return Value: - - HRESULT - S_OK - On success - E_* - On error - - --*/ - HRESULT - virtual Close( - VOID - ) = 0; -}; - diff --git a/print/XPSDrvSmpl/src/inc/ipkfile.h b/print/XPSDrvSmpl/src/inc/ipkfile.h deleted file mode 100644 index 184b194c..00000000 --- a/print/XPSDrvSmpl/src/inc/ipkfile.h +++ /dev/null @@ -1,128 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - ipkfile.h - -Abstract: - - Definition of the PK file interface supported by the PK archive handling module. - ---*/ - -#pragma once - -// -// All compression types added for completeness. Only CompNone and -// CompDeflated are correctly supported. -// -enum ECompressionType -{ - CompNone = 0, - CompShrunk, - CompFactor1, - CompFactor2, - CompFactor3, - CompFactor4, - CompImploded, - CompTokenized, - CompDeflated, - CompDefalted64, - CompPKImploded, - CompPKReserved, - CompBZIP2 -}; - -class IPKFile -{ -public: - /*++ - - Routine Name: - - GetCompressionMethod - - Routine Description: - - This method returns the current compression methof for the archive file - - Arguments: - - pCompType - Pointer to the ECompressionType enumeration that recieves the compression type - - Return Value: - - HRESULT - S_OK - On success - E_* - On error - - --*/ - virtual HRESULT - GetCompressionMethod( - _Out_ ECompressionType* peCompType - ) CONST = 0; - - /*++ - - Routine Name: - - GetDecompressedSize - - Routine Description: - - This routine retrieves the size of the uncompressed archive file - - Arguments: - - pcbUnCompressed - Pointer to a ULONG that recieves the decompressed data size - - Return Value: - - HRESULT - S_OK - On success - E_* - On error - - --*/ - virtual HRESULT - GetDecompressedSize( - _Out_ ULONG* pcbUnCompressed - ) CONST = 0; - - /*++ - - Routine Name: - - DecompressTo - - Routine Description: - - This routine decompresses the archive file data to the buffer passed - - Arguments: - - pDecompBuffer - Pointer to the buffer to be filled with decompressed data - cbDecompBuffer - Size of the decompresssion buffer passed - - Return Value: - - HRESULT - S_OK - On success - E_* - On error - - --*/ - virtual HRESULT - DecompressTo( - _Out_writes_bytes_(cbDecompBuffer) PVOID pDecompBuffer, - ULONG cbDecompBuffer - ) CONST = 0; -}; - diff --git a/print/XPSDrvSmpl/src/inc/streamcnv.h b/print/XPSDrvSmpl/src/inc/streamcnv.h deleted file mode 100644 index 2877073f..00000000 --- a/print/XPSDrvSmpl/src/inc/streamcnv.h +++ /dev/null @@ -1,593 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - streamcnv.h - -Abstract: - - This wrapper class presents an IStream interface to an IPrintReadStream object. - This is useful for where an IStream interface is required for an API but is not - available without creating a seperate buffer and copying data in, e.g. decoding - bitmap data in WIC. This is not appropriate for use with interfaces that write - back into the stream. - ---*/ - -#pragma once - -#include "cunknown.h" - -class CPrintReadStreamToIStream : public CUnknown<IStream> -{ -public: - /*++ - - Routine Name: - - CPrintReadStreamToIStream - - Routine Description: - - CPrintReadStreamToIStream constructor - - Arguments: - - pReadStream - the print read stream to wrap with an IStream interface - - Return Value: - - None - - --*/ - CPrintReadStreamToIStream( - _In_ IPrintReadStream* pReadStream - ) : - CUnknown<IStream>(IID_IStream), - m_pReadStream(pReadStream) - { - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CoFileTimeNow(&m_mTime)) && - SUCCEEDED(hr = CoFileTimeNow(&m_cTime)) && - SUCCEEDED(hr = CoFileTimeNow(&m_aTime))) - { - m_cbStream.QuadPart = 0; - if (m_pReadStream == NULL) - { - hr = E_POINTER; - } - } - - if (FAILED(hr)) - { - throw CXDException(hr); - } - } - - /*++ - - Routine Name: - - ~CPrintReadStreamToIStream - - Routine Description: - - CPrintReadStreamToIStream destructor - - Arguments: - - None - - Return Value: - - None - - --*/ - virtual ~CPrintReadStreamToIStream() - { - } - - // - // ISequentialStream methods - // - /*++ - - Routine Name: - - Read - - Routine Description: - - Implements IStream::Read by calling on to IPrintReadStream::ReadBytes - - Arguments: - - pv - Pointer to the buffer to read into - cb - Count of bytes avaiable in the buffer pointed to by pv - pcbRead - pointer to a ULONG that recieves the count of bytes actually read - - Return Value: - - HRESULT - S_OK - On success and *pcbRead == cb - S_FALSE - On success and *pcbRead < cb - E_* - On error - - --*/ - HRESULT STDMETHODCALLTYPE - Read( - _Out_writes_bytes_to_(cb, *pcbRead) PVOID pv, - _In_ ULONG cb, - _Out_opt_ PULONG pcbRead - ) - { - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pv, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pcbRead, E_POINTER)) && - SUCCEEDED(hr = CoFileTimeNow(&m_aTime))) - { - BOOL bEOF = FALSE; - - *pcbRead = 0; - - while (SUCCEEDED(hr) && - !bEOF && - *pcbRead < cb) - { - DWORD cbRead = 0; - - hr = m_pReadStream->ReadBytes(reinterpret_cast<PVOID>(reinterpret_cast<PBYTE>(pv) + *pcbRead), cb - *pcbRead, &cbRead, &bEOF); - - if (SUCCEEDED(hr)) - { - *pcbRead += cbRead; - } - } - } - - if (SUCCEEDED(hr) && - *pcbRead < cb) - { - hr = S_FALSE; - } - - ERR_ON_HR(hr); - return hr; - } - - /*++ - - Routine Name: - - Write - - Routine Description: - - Not implemented - - Arguments: - - None - - Return Value: - - E_NOTIMPL - - --*/ - HRESULT STDMETHODCALLTYPE - Write( - _In_reads_bytes_(cb) CONST VOID*, - _In_ ULONG cb, - _Out_opt_ PULONG - ) - { - UNREFERENCED_PARAMETER(cb); - ERR("Unsupported method called.\n"); - return E_NOTIMPL; - } - - // - // IStream methods - // - /*++ - - Routine Name: - - Seek - - Routine Description: - - Implements IStream::Seek by calling on to IPrintReadStream::Seek - - Arguments: - - dlibMove - Count of bytes to displace the current position relative to the dwOrigin parameter - dwOrigin - The origin to apply the displacement from - plibNewPosition - Pointer to a variable to recieve the new position of the seek pointer - - Return Value: - - HRESULT - S_OK - On success - E_* - On error - - --*/ - HRESULT STDMETHODCALLTYPE - Seek( - LARGE_INTEGER dlibMove, - DWORD dwOrigin, - _Out_opt_ ULARGE_INTEGER* plibNewPosition - ) - { - HRESULT hr = S_OK; - - ULONGLONG libNewPos = 0; - if (SUCCEEDED(hr = m_pReadStream->Seek(dlibMove.QuadPart, dwOrigin, &libNewPos)) && - plibNewPosition != NULL) - { - plibNewPosition->QuadPart = libNewPos; - } - - ERR_ON_HR(hr); - return hr; - } - - /*++ - - Routine Name: - - SetSize - - Routine Description: - - Not implemented - - Arguments: - - None - - Return Value: - - E_NOTIMPL - - --*/ - HRESULT STDMETHODCALLTYPE - SetSize( - ULARGE_INTEGER - ) - { - ERR("Unsupported method called.\n"); - return E_NOTIMPL; - } - - /*++ - - Routine Name: - - CopyTo - - Routine Description: - - Not implemented - - Arguments: - - None - - Return Value: - - E_NOTIMPL - - --*/ - HRESULT STDMETHODCALLTYPE - CopyTo( - _In_ IStream*, - ULARGE_INTEGER, - _Out_opt_ ULARGE_INTEGER*, - _Out_opt_ ULARGE_INTEGER* - ) - { - ERR("Unsupported method called.\n"); - return E_NOTIMPL; - } - - /*++ - - Routine Name: - - Commit - - Routine Description: - - Not implemented - - Arguments: - - None - - Return Value: - - E_NOTIMPL - - --*/ - HRESULT STDMETHODCALLTYPE - Commit( - DWORD - ) - { - ERR("Unsupported method called.\n"); - return E_NOTIMPL; - } - - /*++ - - Routine Name: - - Revert - - Routine Description: - - Not implemented - - Arguments: - - None - - Return Value: - - E_NOTIMPL - - --*/ - HRESULT STDMETHODCALLTYPE - Revert( - VOID - ) - { - ERR("Unsupported method called.\n"); - return E_NOTIMPL; - } - - /*++ - - Routine Name: - - LockRegion - - Routine Description: - - Not implemented - - Arguments: - - None - - Return Value: - - E_NOTIMPL - - --*/ - HRESULT STDMETHODCALLTYPE - LockRegion( - ULARGE_INTEGER, - ULARGE_INTEGER, - DWORD - ) - { - ERR("Unsupported method called.\n"); - return E_NOTIMPL; - } - - /*++ - - Routine Name: - - UnlockRegion - - Routine Description: - - Not implemented - - Arguments: - - None - - Return Value: - - E_NOTIMPL - - --*/ - HRESULT STDMETHODCALLTYPE - UnlockRegion( - ULARGE_INTEGER, - ULARGE_INTEGER, - DWORD - ) - { - ERR("Unsupported method called.\n"); - return E_NOTIMPL; - } - - /*++ - - Routine Name: - - Stat - - Routine Description: - - Retrieves the STATSG structure for this stream - - Arguments: - - pstatstg - Pointer to the STATSG structure to be completed - grfStatFlag - Flag determining what should be completed - - Return Value: - - HRESULT - S_OK - On success - E_* - On error - - --*/ - HRESULT STDMETHODCALLTYPE Stat( - STATSTG* pstatstg, - DWORD grfStatFlag - ) - { - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pstatstg, E_POINTER)) && - SUCCEEDED(hr = GetStreamSize(&pstatstg->cbSize))) - { - if (grfStatFlag == STATFLAG_DEFAULT) - { - CComBSTR bstrStoreName(L"PrintReadStream"); - UINT cchStoreName = bstrStoreName.Length(); - - pstatstg->pwcsName = reinterpret_cast<LPOLESTR>(CoTaskMemAlloc((cchStoreName + 1) * sizeof(BSTR))); - - if (pstatstg->pwcsName != NULL) - { - CopyMemory(pstatstg->pwcsName, bstrStoreName.m_str, cchStoreName * sizeof(BSTR)); - pstatstg->pwcsName[cchStoreName] = 0; - } - else - { - hr = E_OUTOFMEMORY; - } - } - else - { - pstatstg->pwcsName = NULL; - } - - pstatstg->type = STGTY_STREAM; - pstatstg->mtime = m_mTime; - pstatstg->ctime = m_cTime; - pstatstg->atime = m_aTime; - pstatstg->grfMode = STGM_READ | STGM_SHARE_DENY_WRITE; - pstatstg->grfLocksSupported = LOCK_WRITE; - pstatstg->clsid = CLSID_NULL; - pstatstg->grfStateBits = 0; - } - - ERR_ON_HR(hr); - return hr; - } - - /*++ - - Routine Name: - - Clone - - Routine Description: - - Not implemented - - Arguments: - - None - - Return Value: - - E_NOTIMPL - - --*/ - HRESULT STDMETHODCALLTYPE - Clone( - IStream** - ) - { - ERR("Unsupported method called.\n"); - return E_NOTIMPL; - } - -private: - /*++ - - Routine Name: - - GetStreamSize - - Routine Description: - - Retrieves the stream size. If this is the first time the stream size is accessed - the method retrieves teh size by seeking to the end of the stream and reporting - the offset from the start. This value is then stored and used in subsequent - calls to this method - - Arguments: - - pcbSize - Pointer to the size to be filled out - - Return Value: - - HRESULT - S_OK - On success - E_* - On error - - --*/ - HRESULT - GetStreamSize( - ULARGE_INTEGER* pcbSize - ) - { - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pcbSize, E_POINTER))) - { - // - // This stream implementation can never shrink, so if the size is greater - // than 0 we do not need to re-acquire. - // - if (m_cbStream.QuadPart > 0) - { - *pcbSize = m_cbStream; - } - else - { - // - // Seek to the end of the stream to find the size then reset to the current position - // - ULONGLONG libOldPosition = 0; - if (SUCCEEDED(hr = m_pReadStream->Seek(0, STREAM_SEEK_CUR, &libOldPosition)) && - SUCCEEDED(hr = m_pReadStream->Seek(0, STREAM_SEEK_END, &pcbSize->QuadPart)) && - SUCCEEDED(hr = m_pReadStream->Seek(libOldPosition, STREAM_SEEK_SET, NULL))) - { - // - // Store the result - // - m_cbStream.QuadPart = pcbSize->QuadPart; - } - } - } - - ERR_ON_HR(hr); - return hr; - } - - -private: - CComPtr<IPrintReadStream> m_pReadStream; - - ULARGE_INTEGER m_cbStream; - - FILETIME m_mTime; - - FILETIME m_cTime; - - FILETIME m_aTime; -}; - diff --git a/print/XPSDrvSmpl/src/inc/xdexcept.h b/print/XPSDrvSmpl/src/inc/xdexcept.h deleted file mode 100644 index 6dfc653f..00000000 --- a/print/XPSDrvSmpl/src/inc/xdexcept.h +++ /dev/null @@ -1,104 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - xdexcept.h - -Abstract: - - XPSDrv sample driver exception class - ---*/ - -#pragma once - -class CXDException -{ -public: - /*++ - - Routine Name: - - CXDException - - Routine Description: - - Class constructor - - Arguments: - - None - - Return Value: - - None - - --*/ - CXDException() throw() : - m_hr(E_FAIL) - { - } - - /*++ - - Routine Name: - - CXDException - - Routine Description: - - Class constructor - - Arguments: - - hr - HRESULT value for the error for which the exception is thrown - - Return Value: - - None - - --*/ - CXDException( - HRESULT hr - ) throw() : - m_hr(hr) - { - } - - /*++ - - Routine Name: - - operator HRESULT() - - Routine Description: - - HRESULT cast operator - - Arguments: - - None - - Return Value: - - The HRESULT value associated with the exception - - --*/ - operator HRESULT() CONST throw() - { - return m_hr; - } - -public: - HRESULT m_hr; -}; - diff --git a/print/XPSDrvSmpl/src/inc/xdstring.h b/print/XPSDrvSmpl/src/inc/xdstring.h deleted file mode 100644 index 0a1f7177..00000000 --- a/print/XPSDrvSmpl/src/inc/xdstring.h +++ /dev/null @@ -1,2889 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - xdstring.h - -Abstract: - - A string class that emulates the CStringT class interface. The class uses an - internal string of default length 128 characters. The string size is doubled - on each resize. - ---*/ - -#pragma once - -#include <strsafe.h> -#include "xdexcept.h" - -#define CCH_INITIAL_BUFFER 128 - -template< typename _T = CHAR > -class ChTraitsBaseXD -{ -public: - typedef CHAR XCHARXD; - typedef WCHAR YCHARXD; -}; - -template<> -class ChTraitsBaseXD< WCHAR > -{ -public: - typedef WCHAR XCHARXD; - typedef CHAR YCHARXD; -}; - -template <typename _T> -class CStringXDT -{ -public: - typedef typename ChTraitsBaseXD<_T>::XCHARXD XCHARXD; - typedef typename ChTraitsBaseXD<_T>::YCHARXD YCHARXD; - -public: - /*++ - - Routine Name: - - CStringXDT - - Routine Description: - - Class constructor - - Arguments: - - None - - Return Value: - - None - - --*/ - CStringXDT() : - m_pszData(NULL) - { - } - - /*++ - - Routine Name: - - CStringXDT - - Routine Description: - - Class constructor - - Arguments: - - cstrSrc - source CStringXDT class to construct from - - Return Value: - - None - - --*/ - CStringXDT( - _In_ CONST CStringXDT<_T>& cstrSrc - ) : - m_pszData(NULL) - { - CreateString(cstrSrc.GetString()); - } - - /*++ - - Routine Name: - - CStringXDT - - Routine Description: - - Class constructor - - Arguments: - - pszSrc - source string that matches the template argument to construct from - - Return Value: - - None - - --*/ - CStringXDT( - _In_z_ CONST XCHARXD* pszSrc - ) : - m_pszData(NULL) - { - CreateString(pszSrc); - } - - - /*++ - - Routine Name: - - CStringXDT - - Routine Description: - - Class constructor - - Arguments: - - pszSrc - source string to construct from. This is the "cross" - string, i.e. CHAR for WCHAR template and vice versa - - Return Value: - - None - - --*/ - CStringXDT( - _In_z_ CONST YCHARXD* pszSrc - ) : - m_pszData(NULL) - { - CreateStringFromY(pszSrc); - } - - /*++ - - Routine Name: - - CStringXDT - - Routine Description: - - Class constructor - - Arguments: - - pszSrc - source string that matches the template argument to construct from - cchSrc - the length of the source string to construct from - - Return Value: - - None - - --*/ - CStringXDT( - _In_reads_(cchSrc) CONST XCHARXD* pszSrc, - _In_ INT cchSrc - ) : - m_pszData(NULL) - { - if (cchSrc < 0) - { - RIP("Negative string size requested.\n"); - throw CXDException(E_INVALIDARG); - } - - CreateString(pszSrc, static_cast<size_t>(cchSrc)); - } - - /*++ - - Routine Name: - - CStringXDT - - Routine Description: - - Class constructor - - Arguments: - - pszSrc - source string to construct from. This is the "cross" - string, i.e. CHAR for WCHAR template and vice versa - cchSrc - the length of the source string to construct from - - Return Value: - - None - - --*/ - CStringXDT( - _In_reads_(cchSrc) CONST YCHARXD* pszSrc, - _In_ INT cchSrc - ) : - m_pszData(NULL) - { - if (cchSrc < 0) - { - RIP("Negative string size requested.\n"); - throw CXDException(E_INVALIDARG); - } - - CreateStringFromY(pszSrc, static_cast<size_t>(cchSrc)); - } - - /*++ - - Routine Name: - - ~CStringXDT - - Routine Description: - - Class destructor - - Arguments: - - None - - Return Value: - - None - - --*/ - ~CStringXDT() - { - if (m_pszData != NULL) - { - HeapFree(GetProcessHeap(), 0, GetDataBuffer()); - m_pszData = NULL; - } - } - - // - // Operators - // - /*++ - - Routine Name: - - operator= - - Routine Description: - - Assignment operator - - Arguments: - - cstrSrc - const reference to the source CStringXDT - - Return Value: - - Reference to the newly assigned CStringXDT instance - - --*/ - CStringXDT<_T>& - operator=( - _In_ CONST CStringXDT<_T>& cstrSrc - ) - { - *this = cstrSrc.m_pszData; - - return *this; - } - - /*++ - - Routine Name: - - operator= - - Routine Description: - - Assignment operator - - Arguments: - - pszSrc - const pointer to the source string of the same type as the template - - Return Value: - - Reference to the newly assigned CStringXDT instance - - --*/ - CStringXDT<_T>& - operator=( - _In_z_ CONST XCHARXD* pszSrc - ) - { - if (this->operator!=(pszSrc)) - { - Empty(); - CreateString(pszSrc); - } - - return *this; - } - - /*++ - - Routine Name: - - operator= - - Routine Description: - - Assignment operator - - Arguments: - - pszSrc - const pointer to the source string of the opposite type to the template - - Return Value: - - Reference to the newly assigned CStringXDT instance - - --*/ - CStringXDT<_T>& - operator=( - _In_z_ CONST YCHARXD* pszSrc - ) - { - if (this->operator!=(pszSrc)) - { - Empty(); - CreateStringFromY(pszSrc); - } - - return *this; - } - - /*++ - - Routine Name: - - operator+= - - Routine Description: - - Addition assignment operator - appends a source string to the current underlying string - - Arguments: - - pszSrc - pointer to the native string to append - - Return Value: - - Reference to this instance - - --*/ - CStringXDT<_T>& - operator+=( - _In_z_ CONST XCHARXD* pszSrc - ) - { - size_t cchSrc = StringLength(pszSrc); - size_t cchCur = StringLength(GetString()); - - SetBufferSize(cchSrc + cchCur); - CopyString(GetString() + cchCur, GetBufferCharCount() - cchCur, pszSrc, cchSrc); - - return *this; - } - - /*++ - - Routine Name: - - operator+= - - Routine Description: - - Addition assignment operator - appends a source string to the current underlying string - - Arguments: - - pszSrc - pointer to the opposite string type to append - - Return Value: - - Reference to this instance - - --*/ - CStringXDT<_T>& - operator+=( - _In_z_ CONST YCHARXD* pszSrc - ) - { - size_t cchSrc = StringLength(pszSrc); - size_t cchCur = StringLength(GetString()); - - SetBufferSize(cchSrc + cchCur); - CopyYString(GetString() + cchCur, GetBufferCharCount() - cchCur, pszSrc, cchSrc); - - return *this; - } - - /*++ - - Routine Name: - - operator CONST _T*() - - Routine Description: - - const cast operator - - Arguments: - - None - - Return Value: - - Pointer to the underlying string - - --*/ - operator CONST _T*() CONST throw() - { - return GetString(); - } - - /*++ - - Routine Name: - - operator!= - - Routine Description: - - Inequality operator - compares against the native string type - - Arguments: - - pszCompare - the string to compare to - - Return Value: - - true - the strings do not match - false - the strings match - - --*/ - bool - operator!=( - _In_z_ CONST XCHARXD* pszCompare - ) CONST - { - return !operator==(pszCompare); - } - - /*++ - - Routine Name: - - operator== - - Routine Description: - - Equality operator - compares against the native string type - - Arguments: - - pszCompare - the string to compare to - - Return Value: - - true - the strings match - false - the strings do not match - - --*/ - bool - operator==( - _In_z_ CONST XCHARXD* pszCompare - ) CONST - { - return CompareXDString(GetString(), pszCompare) == 0; - } - - /*++ - - Routine Name: - - operator!= - - Routine Description: - - Inequality operator - compares against the oposite string type - - Arguments: - - pszCompare - the string to compare to - - Return Value: - - true - the strings do not match - false - the strings match - - --*/ - bool - operator!=( - _In_z_ CONST YCHARXD* pszCompare - ) CONST - { - return !operator==(pszCompare); - } - - /*++ - - Routine Name: - - operator== - - Routine Description: - - Equality operator - compares against the opposite string type - - Arguments: - - pszCompare - the string to compare to - - Return Value: - - true - the strings match - false - the strings do not match - - --*/ - bool - operator==( - _In_z_ CONST YCHARXD* pszCompare - ) CONST - { - CStringXDT<XCHARXD> cstrCompare(pszCompare); - return CompareXDString(GetString(), cstrCompare) == 0; - } - - /*++ - - Routine Name: - - operator< - - Routine Description: - - Less than operator - - Arguments: - - cstrCompare - The CStringXDT instance to compare to - - Return Value: - - true - this string instance is less than the compare string - false - this string instance is not less than the compare string - - --*/ - bool - operator<( - _In_ CONST CStringXDT<_T>& cstrCompare - ) CONST - { - return CompareXDString(GetString(), cstrCompare.GetString()) < 0; - } - - /*++ - - Routine Name: - - operator< - - Routine Description: - - Less than operator - - Arguments: - - cstrCompare - pointer to a native string to compate with - - Return Value: - - true - this string instance is less than the compare string - false - this string instance is not less than the compare string - - --*/ - bool - operator<( - _In_z_ CONST XCHARXD* pszCompare - ) CONST - { - return CompareXDString(GetString(), pszCompare) < 0; - } - - /*++ - - Routine Name: - - operator< - - Routine Description: - - Less than operator - - Arguments: - - cstrCompare - pointer to a opposite string type to compate with - - Return Value: - - true - this string instance is less than the compare string - false - this string instance is not less than the compare string - - --*/ - bool - operator<( - _In_z_ CONST YCHARXD* pszCompare - ) CONST - { - CStringXDT<XCHARXD> cstrCompare(pszCompare); - return CompareXDString(GetString(), cstrCompare) < 0; - } - - /*++ - - Routine Name: - - operator[] - - Routine Description: - - Array index operator - - Arguments: - - cchIndex - the character index into the string - - Return Value: - - The value of the character at the specified index - - --*/ - _T operator[]( - _In_ INT cchIndex - ) CONST - { - if (cchIndex < 0 || - cchIndex > GetLength()) - { - throw CXDException(E_INVALIDARG); - } - - return GetString()[cchIndex]; - } - - // - // Methods - // - /*++ - - Routine Name: - - AllocSysString - - Routine Description: - - Allocates a BSTR from the underlying string - - Arguments: - - None - - Return Value: - - The newly allocated BSTR - - --*/ - BSTR - AllocSysString() - { - return AllocSysString(GetString()); - } - - /*++ - - Routine Name: - - Find - - Routine Description: - - Finds the location of a sub string in the underlying string - - Arguments: - - pszSub - the sub string to search for - cchStart - the point to start searching the underlying string from - - Return Value: - - -1 if the sub string is not found - the index of the sub-string in the underlying strings - - --*/ - INT - Find( - _In_z_ CONST _T* pszSub, - _In_ INT cchStart = 0 - ) CONST throw() - { - return Find(GetString(), pszSub, cchStart); - } - - /*++ - - Routine Name: - - Delete - - Routine Description: - - Deletes one or more characters from a given offset - - Arguments: - - cchStart - the starting character to delete from - cchDelete - the number of characters to delete - - Return Value: - - The length of the remaining string - - --*/ - INT - Delete( - INT cchStart, - INT cchDelete = 1 - ) - { - if (cchStart < 0) - { - cchStart = 0; - } - - if (cchDelete < 0) - { - cchDelete = 0; - } - - size_t cchStr = StringLength(GetString()); - if (cchStr < static_cast<size_t>(cchStart + cchDelete)) - { - throw CXDException(E_INVALIDARG); - } - - size_t cchToMove = cchStr + 1 - static_cast<size_t>(cchDelete + cchStart); - MoveMemory(GetString() + cchStart, m_pszData + cchStart + cchDelete, cchToMove * sizeof(_T)); - - return GetLength(); - } - - /*++ - - Routine Name: - - GetLength - - Routine Description: - - Retrieves the length of the string - - Arguments: - - None - - Return Value: - - The count of characters in the string - - --*/ - INT - GetLength() CONST throw() - { - INT cch = 0; - - try - { - cch = static_cast<INT>(StringLength(GetString())); - } - catch (CXDException&) - { - } - - return cch; - } - - /*++ - - Routine Name: - - Format - - Routine Description: - - Writes formatted data to the string. - - Arguments: - - pszFormat - the format string - ... - Variable argument list - - Return Value: - - None - - --*/ - VOID - Format( - _In_z_ CONST _T* pszFormat, - ... - ) - { - if (pszFormat == NULL) - { - throw CXDException(E_INVALIDARG); - } - - va_list argList; - va_start(argList, pszFormat); - Format(pszFormat, argList); - va_end(argList); - } - - /*++ - - Routine Name: - - Empty - - Routine Description: - - Sets the string to zero length - - Arguments: - - None - - Return Value: - - None - - --*/ - VOID - Empty() - { - try - { - *GetString() = 0; - } - catch (CXDException&) - { - } - } - - /*++ - - Routine Name: - - Compare - - Routine Description: - - Compares the string data with a compare string passed in - case sensitive. - This is the same functionality as strcmp. - - Arguments: - - pszCompare - the string to compare against - - Return Value: - - < 0 if the string data is less than the compare string - 0 if the strings are identical - > 0 if the string data is more than the compare string - - --*/ - INT - Compare( - _In_z_ CONST _T* pszCompare - ) CONST - { - return CompareXDString(GetString(), pszCompare); - } - - /*++ - - Routine Name: - - CompareNoCase - - Routine Description: - - Compares the string data with a compare string passed in - case insensitive. - This is the same functionality as stricmp. - - Arguments: - - pszCompare - the string to compare against - - Return Value: - - < 0 if the string data is less than the compare string - 0 if the strings are identical - > 0 if the string data is more than the compare string - - --*/ - INT - CompareNoCase( - _In_z_ CONST _T* pszCompare - ) CONST throw() - { - return CompareXDStringNoCase(GetString(), pszCompare); - } - - /*++ - - Routine Name: - - Replace - - Routine Description: - - Replaces all instances of a target string with a new string - - Arguments: - - pszOld - the string to replace - pszNew - the replacement string - - Return Value: - - The number of replaced instances - - --*/ - INT - Replace( - _In_z_ CONST _T* pszOld, - _In_z_ CONST _T* pszNew - ) - { - // - // Find the length of the old and new strings - // - size_t cchOld = StringLength(pszOld); - size_t cchNew = StringLength(pszNew); - - // - // Count the instances of the string to replace - // - _T* pszCurr = GetString(); - INT cReplace = 0; - INT cchStart = Find(pszCurr, pszOld, 0); - while (cchStart >= 0) - { - cReplace++; - pszCurr += cchStart + cchOld; - cchStart = Find(pszCurr, pszOld, 0); - } - - if (cReplace > 0) - { - // - // Resize the buffer to accomodate the replacements - // - INT cchDelta = static_cast<INT>(cchNew - cchOld); - INT cchDeltaBuffer = cReplace * cchDelta; - SetBufferSize(StringLength(GetString()) + cchDeltaBuffer); - - // - // Replace all instances of the old string and replace with - // the new string - // - pszCurr = GetString(); - cchStart = Find(pszCurr, pszOld, 0); - while (cchStart >= 0) - { - // - // Move the remainder of the string up by the length of the replacement - // this makes room to insert the replacement string - // - pszCurr += cchStart; - _T* pszOldEnd = pszCurr + cchOld; - size_t cchToMove = StringLength(pszOldEnd) + 1; - MoveMemory(pszCurr + cchNew, pszOldEnd, cchToMove * sizeof(_T)); - - // - // Fill the "gap" with the new string - // - CopyMemory(pszCurr, pszNew, cchNew * sizeof(_T)); - - // - // Look for the next string from the end of the current instance - // - pszCurr += cchNew; - cchStart = Find(pszCurr, pszOld, 0); - } - } - - return cReplace; - } - - /*++ - - Routine Name: - - Append - - Routine Description: - - Appends a string to the current string data - - Arguments: - - pszSrc - the string to append - - Return Value: - - None - - --*/ - VOID - Append( - _In_z_ CONST _T* pszSrc - ) - { - *this += pszSrc; - } - - /*++ - - Routine Name: - - Insert - - Routine Description: - - Inserts a string to the current string data - - Arguments: - - cch - the index at which to insert the string - pszSrc - the string to insert - - Return Value: - - None - - --*/ - INT - Insert( - _In_ CONST INT& cch, - _In_z_ CONST _T* pszSrc - ) - { - if (cch >= 0 && - pszSrc != NULL) - { - _T* pszCurr = GetString(); - size_t cchCurr = StringLength(pszCurr); - - if (cchCurr >= static_cast<size_t>(cch)) - { - size_t cchSrc = StringLength(pszSrc); - SetBufferSize(cchCurr + cchSrc); - - // - // Move the remainder of the string up by the length of the replacement - // this makes room to insert the replacement string - // - pszCurr += cch; - size_t cchToMove = StringLength(pszCurr) + 1; - MoveMemory(pszCurr + cchSrc, pszCurr, cchToMove * sizeof(_T)); - - // - // Fill the "gap" with the new string - // - CopyMemory(pszCurr, pszSrc, cchSrc * sizeof(_T)); - } - } - else - { - throw CXDException(E_INVALIDARG); - } - - return static_cast<INT>(StringLength(GetString())); - } - - /*++ - - Routine Name: - - IsEmpty - - Routine Description: - - Indicates whether the string is zero length - - Arguments: - - None - - Return Value: - - true - the string is empty - false - otherwise - - --*/ - bool - IsEmpty() CONST throw() - { - return GetLength() == 0; - } - - /*++ - - Routine Name: - - GetBuffer - - Routine Description: - - Returns the underlying string buffer - - Arguments: - - None - - Return Value: - - The underlying string buffer - - --*/ - _T* - GetBuffer() - { - return GetString(); - } - - /*++ - - Routine Name: - - Tokenize - - Routine Description: - - Retrieves the position of the next token in a string - - Arguments: - - pszTokens - string defining the token - cchStart - the point at which the token search should start. This value is updated - by the call to the posiion following the end character of the token. - - Return Value: - - Returns a CStringXDT object containing the token value. - - --*/ - CStringXDT<_T> - Tokenize( - _In_z_ CONST _T* pszTokens, - _Inout_ INT& cchStart - ) CONST - { - CStringXDT<_T> cstrResult; - - if (cchStart < 0) - { - throw CXDException(E_INVALIDARG); - } - - INT cchTokens = static_cast<INT>(StringLength(pszTokens)); - if (cchTokens == 0) - { - if (cchStart < GetLength()) - { - cstrResult = GetString() + cchStart; - } - else - { - // - // There are no tokens or data - // - cchStart = -1; - } - } - else - { - // - // Skip leading tokens - // - while (Find(pszTokens, cchStart) == cchStart) - { - cchStart += cchTokens; - } - - INT cchFirstToken = Find(pszTokens, cchStart); - - if (cchFirstToken > 0) - { - // - // The result string runs from the start to the first token - // - cstrResult = Mid(cchStart, cchFirstToken - cchStart); - cchStart = cchFirstToken + cchTokens; - } - else - { - if (cchStart < GetLength()) - { - // - // There are no more tokens but there is data left - // - cstrResult = GetString() + cchStart; - cchStart = GetLength() + cchTokens; - } - else - { - // - // There are no more tokens or data - // - cchStart = -1; - } - } - } - - return cstrResult; - } - - /*++ - - Routine Name: - - GetAt - - Routine Description: - - Retrieves character at the given index - - Arguments: - - cchAt - character count index of the character to return - - Return Value: - - The character value at the specified index - - --*/ - _T GetAt( - _In_ INT cchAt - ) CONST - { - if (cchAt < 0 || - cchAt > GetLength()) - { - throw CXDException(E_INVALIDARG); - } - - return GetString()[cchAt]; - } - - /*++ - - Routine Name: - - Trim - - Routine Description: - - Trims the string of leading and trailing white space - - Arguments: - - None - - Return Value: - - Reference to the trimmed CStringXDT object - - --*/ - CStringXDT<_T>& - Trim() - { - return TrimRight().TrimLeft(); - } - - /*++ - - Routine Name: - - TrimRight - - Routine Description: - - Trims the string of trailing white space - - Arguments: - - None - - Return Value: - - Reference to the trimmed CStringXDT object - - --*/ - CStringXDT<_T>& - TrimRight() - { - _T* pszFirstTrailing = NULL; - _T* pszData = GetString(); - while (*pszData != 0) - { - if (IsSpace(*pszData)) - { - if (pszFirstTrailing == NULL) - { - pszFirstTrailing = pszData; - } - } - else - { - pszFirstTrailing = NULL; - } - pszData++; - } - - if (pszFirstTrailing != NULL) - { - Truncate(static_cast<INT>(pszFirstTrailing - GetString())); - } - - return *this; - } - - /*++ - - Routine Name: - - Trim - - Routine Description: - - Trims the string of leading white space - - Arguments: - - None - - Return Value: - - Reference to the trimmed CStringXDT object - - --*/ - CStringXDT<_T>& - TrimLeft() - { - _T* pszData = GetString(); - - while (IsSpace(*pszData)) - { - pszData++; - } - - INT cchWhite = static_cast<INT>(pszData - GetString()); - if (cchWhite > 0) - { - Delete(0, cchWhite); - } - - return *this; - } - - /*++ - - Routine Name: - - Left - - Routine Description: - - Returns a CStringXDT object containing the string of the specified length - from the left of the string data - - Arguments: - - cchLeft - count of characters to return from the string data - - Return Value: - - The CStringXDT object containing the requested string - - --*/ - CStringXDT<_T> - Left( - _In_ INT cchLeft - ) CONST - { - if (cchLeft < 0) - { - cchLeft = 0; - } - - if (cchLeft > GetLength()) - { - return *this; - } - - return CStringXDT<_T>(GetString(), cchLeft); - } - - /*++ - - Routine Name: - - Mid - - Routine Description: - - Returns a CStringXDT object containing the string from the specified offset - to the end of the string data - - Arguments: - - cchFirst - the index of the character to start the string - - Return Value: - - The CStringXDT object containing the requested string - - --*/ - CStringXDT<_T> - Mid( - _In_ INT cchFirst - ) CONST - { - return Mid(cchFirst, GetLength() - cchFirst); - } - - /*++ - - Routine Name: - - Mid - - Routine Description: - - Returns a CStringXDT object containing the string from the specified offset - of the requested length - - Arguments: - - cchFirst - the index of the character to start the string - cchSize - the count of characters to compose the return string from - - Return Value: - - The CStringXDT object containing the requested string - - --*/ - CStringXDT<_T> - Mid( - _In_ INT cchFirst, - _In_ INT cchSize - ) CONST - { - INT cchCurr = GetLength(); - - if (cchFirst < 0 || - cchSize < 0 || - cchSize + cchFirst > cchCurr || - cchFirst > cchCurr) - { - throw CXDException(E_INVALIDARG); - } - - if (cchFirst == 0 && - cchSize == cchCurr) - { - return *this; - } - - return CStringXDT<_T>(GetString() + cchFirst, cchSize); - } - - /*++ - - Routine Name: - - MakeLower - - Routine Description: - - Makes all characters in the string lower case - - Arguments: - - None - - Return Value: - - Reference to the modified string object - - --*/ - CStringXDT<_T>& - MakeLower() - { - MakeLower(GetString(), GetBufferCharCount()); - return *this; - } - - /*++ - - Routine Name: - - Truncate - - Routine Description: - - Truncates the string data to the specified size - - Arguments: - - cchNew - the length to which the string data is to be truncated - - Return Value: - - None - - --*/ - VOID - Truncate( - INT cchNew - ) - { - if (cchNew < 0) - { - cchNew = 0; - } - - if (cchNew < GetLength()) - { - GetString()[cchNew] = 0; - } - } - - /*++ - - Routine Name: - - Preallocate - - Routine Description: - - Preallocate the string buffer to accomodate a string of length cChars - Note: this function adds one for the NULL terminator - - Arguments: - - cChars - the count of chars to allocate for - - Return Value: - - None - - --*/ - VOID - Preallocate( - INT cChars - ) - { - if (cChars < 0) - { - cChars = 0; - } - - SetBufferSize(static_cast<size_t>(cChars) + 1); - } - - -private: - /*++ - - Routine Name: - - CreateString - - Routine Description: - - Creates a native string specifically from a WCHAR source string - - Arguments: - - pszSrc - the WCHAR source string - - Return Value: - - None - - --*/ - VOID - CreateString( - _In_z_ CONST WCHAR* pszSrc - ) - { - if (pszSrc != NULL) - { - CreateString(pszSrc, StringLength(pszSrc)); - } - } - - /*++ - - Routine Name: - - CreateString - - Routine Description: - - Creates a native string specifically from a CHAR source string - - Arguments: - - pszSrc - the CHAR source string - - Return Value: - - None - - --*/ - VOID - CreateString( - _In_z_ CONST CHAR* pszSrc - ) - { - if (pszSrc != NULL) - { - CreateString(pszSrc, StringLength(pszSrc)); - } - } - - /*++ - - Routine Name: - - CreateString - - Routine Description: - - Creates a snative tring from a native source string and character count - - Arguments: - - pszSrc - the source string - cchSrc - count of characters to copy from the source string - - Return Value: - - None - - --*/ - VOID - CreateString( - _In_reads_(cchSrc) CONST _T* pszSrc, - _In_ size_t cchSrc - ) - { - if (pszSrc != NULL) - { - SetBufferSize(cchSrc); - CopyString(GetString(), GetBufferCharCount(), pszSrc, cchSrc); - } - } - - /*++ - - Routine Name: - - CreateStringFromY - - Routine Description: - - Creates a string from a source string of the opposite type. - WCHAR specific implementation. - - Arguments: - - pszSrc - the source string - cchSrc - count of characters to copy from the source string - - Return Value: - - None - - --*/ - VOID - CreateStringFromY( - _In_z_ CONST WCHAR* pszSrc - ) - { - if (pszSrc != NULL) - { - CreateStringFromY(pszSrc, StringLength(pszSrc)); - } - } - - /*++ - - Routine Name: - - CreateStringFromY - - Routine Description: - - Creates a string from a source string of the opposite type and character count. - WCHAR specific implementation. - - Arguments: - - pszSrc - the source string - cchSrc - count of characters to copy from the source string - - Return Value: - - None - - --*/ - VOID - CreateStringFromY( - _In_reads_(cchSrc) CONST WCHAR* pszSrc, - _In_ size_t cchSrc - ) - { - if (pszSrc != NULL && - cchSrc > 0) - { - SetBufferSize(cchSrc); - CopyYString(GetString(), GetBufferCharCount(), pszSrc, cchSrc); - } - } - - /*++ - - Routine Name: - - CreateStringFromY - - Routine Description: - - Creates a string from a source string of the opposite type and a chacter count. - CHAR specific implementation. - - Arguments: - - pszSrc - the source string - - Return Value: - - None - - --*/ - VOID - CreateStringFromY( - _In_z_ CONST CHAR* pszSrc - ) - { - if (pszSrc != NULL) - { - CreateStringFromY(pszSrc, StringLength(pszSrc)); - } - } - - /*++ - - Routine Name: - - CreateStringFromY - - Routine Description: - - Creates a string from a source string of the opposite type. - CHAR specific implementation. - - Arguments: - - pszSrc - the source string - cchSrc - count of characters to copy from the source string - - Return Value: - - None - - --*/ - VOID - CreateStringFromY( - _In_reads_(cchSrc) CONST CHAR* pszSrc, - _In_ size_t cchSrc - ) - { - if (pszSrc != NULL && - cchSrc > 0) - { - SetBufferSize(cchSrc); - CopyYString(GetString(), GetBufferCharCount(), pszSrc, cchSrc); - } - } - - /*++ - - Routine Name: - - StringLength - - Routine Description: - - Returns the character count of the string. WCHAR specific. - - Arguments: - - pszSrc - source to string to retrieve the length of - - Return Value: - - The count of characters in the string - - --*/ - static size_t - StringLength( - _In_opt_z_ CONST WCHAR* pszSrc - ) - { - size_t cch = 0; - if( pszSrc != NULL ) - { - while( *pszSrc != 0 ) - { - cch++; - pszSrc++; - } - } - - return cch; - } - - /*++ - - Routine Name: - - StringLength - - Routine Description: - - Returns the character count of the string. CHAR specific. - - Arguments: - - pszSrc - source to string to retrieve the length of - - Return Value: - - The count of characters in the string - - --*/ - static size_t - StringLength( - _In_opt_z_ CONST CHAR* pszSrc - ) - { - size_t cch = 0; - - if( pszSrc != NULL ) - { - while( *pszSrc != 0 ) - { - cch++; - pszSrc++; - } - } - - return cch; - } - - /*++ - - Routine Name: - - GetBufferCharCount - - Routine Description: - - Gets the total count of available characters in the buffer. This is the length - of the buffer as opposed to the count of characters in the string (the buffer) - can be larger. - - Arguments: - - None - - Return Value: - - The count of available characters in the data buffer - - --*/ - size_t - GetBufferCharCount( - VOID - ) CONST - { - size_t cch = 0; - - if (m_pszData != NULL) - { - cch = *reinterpret_cast<size_t*>(reinterpret_cast<PBYTE>(m_pszData) - sizeof(size_t)); - } - else - { - throw CXDException(E_PENDING); - } - - return cch; - } - - /*++ - - Routine Name: - - GetDataBuffer - - Routine Description: - - Retrieves the pointer to the start of the data buffer. The size of the - buffer is stored before the actual string data. - - Arguments: - - None - - Return Value: - - Pointer to the start of the data buffer - - --*/ - PVOID - GetDataBuffer( - VOID - ) CONST - { - PVOID pData = NULL; - - if (m_pszData != NULL) - { - pData = reinterpret_cast<PVOID>(reinterpret_cast<PBYTE>(m_pszData) - sizeof(size_t)); - } - else - { - throw CXDException(E_PENDING); - } - - return pData; - } - - /*++ - - Routine Name: - - SetBufferSize - - Routine Description: - - Sets the size of the buffer according to the character count passed in. If - the character count is less than that available no action is required. If it - is larger the data buffer is doubled in size till it is sufficient. - - Arguments: - - cch - count of characters the buffer must accomodate - - Return Value: - - None - - --*/ - VOID - SetBufferSize( - size_t cch - ) CONST - { - if (m_pszData == NULL) - { - // - // Allocate a new buffer - // - size_t cchAllocate = CCH_INITIAL_BUFFER; - - // - // Double the buffer size till we have enough room - // - while (cch >= cchAllocate) - { - cchAllocate *= 2; - } - - LPVOID pData = HeapAlloc(GetProcessHeap(), 0, cchAllocate * sizeof(_T) + sizeof(size_t)); - - if (pData != NULL) - { - *static_cast<size_t*>(pData) = cchAllocate; - m_pszData = reinterpret_cast<_T*>(reinterpret_cast<PBYTE>(pData) + sizeof(size_t)); - *m_pszData = 0; - } - else - { - throw CXDException(E_OUTOFMEMORY); - } - } - else - { - size_t cchAllocated = GetBufferCharCount(); - - if (cch >= cchAllocated) - { - // - // Double the buffer size till we have enough room - // - while (cch >= cchAllocated) - { - cchAllocated *= 2; - } - - // - // Re-allocate the existing buffer - // - LPVOID pData = HeapReAlloc(GetProcessHeap(), 0, GetDataBuffer(), cchAllocated * sizeof(_T) + sizeof(size_t)); - - if (pData != NULL) - { - *static_cast<size_t*>(pData) = cchAllocated; - m_pszData = reinterpret_cast<_T*>(reinterpret_cast<PBYTE>(pData) + sizeof(size_t)); - } - else - { - throw CXDException(E_OUTOFMEMORY); - } - } - } - } - - /*++ - - Routine Name: - - CopyString - - Routine Description: - - Copys a native string from one buffer to another. WCHAR specific implementation. - - Arguments: - - pszDst - pointer to the destination buffer to copy to - cchDst - count of characters available in the destination buffer - pszSrc - pointer to the source buffer - cchSrc - count of characters to copy - - Return Value: - - None - - --*/ - static VOID - CopyString( - _Inout_updates_(cchDst) WCHAR* pszDst, - _In_ size_t cchDst, - _In_reads_(cchSrc) CONST WCHAR* pszSrc, - _In_ size_t cchSrc - ) - { - HRESULT hr = S_OK; - - if (cchDst < cchSrc) - { - hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); - } - else if (pszDst == NULL) - { - hr = E_INVALIDARG; - } - - if (SUCCEEDED(hr) && - pszSrc != NULL && - cchSrc > 0) - { - hr = StringCchCopyNW(pszDst, cchDst, pszSrc, cchSrc); - } - - if (FAILED(hr)) - { - throw CXDException(hr); - } - } - - /*++ - - Routine Name: - - CopyString - - Routine Description: - - Copys a native string from one buffer to another. CHAR specific implementation. - - Arguments: - - pszDst - pointer to the destination buffer to copy to - cchDst - count of characters available in the destination buffer - pszSrc - pointer to the source buffer - cchSrc - count of characters to copy - - Return Value: - - None - - --*/ - static VOID - CopyString( - _Inout_updates_(cchDst) CHAR* pszDst, - _In_ size_t cchDst, - _In_reads_(cchSrc) CONST CHAR* pszSrc, - _In_ size_t cchSrc - ) - { - HRESULT hr = S_OK; - - if (cchDst < cchSrc) - { - hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); - } - else if (pszDst == NULL) - { - hr = E_INVALIDARG; - } - - if (SUCCEEDED(hr) && - pszSrc != NULL && - cchSrc > 0) - { - hr = StringCchCopyNA(pszDst, cchDst, pszSrc, cchSrc); - } - - if (FAILED(hr)) - { - throw CXDException(hr); - } - } - - /*++ - - Routine Name: - - CopyYString - - Routine Description: - - Copys a string of the opposite type from one buffer to another. CHAR specific implementation. - - Arguments: - - pszDst - pointer to the destination buffer to copy to - cchDst - count of characters available in the destination buffer - pszSrc - pointer to the source buffer - cchSrc - count of characters to copy - - Return Value: - - None - - --*/ - static VOID - CopyYString( - _Inout_updates_(cchDst) CHAR* pszDst, - _In_ size_t cchDst, - _In_reads_(cchSrc) CONST WCHAR* pszSrc, - _In_ size_t cchSrc - ) - { - HRESULT hr = S_OK; - - if (cchDst < cchSrc) - { - hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); - } - else if (pszDst == NULL) - { - hr = E_INVALIDARG; - } - - if (SUCCEEDED(hr) && - pszSrc != NULL && - cchSrc > 0) - { - size_t cbWritten = WideCharToMultiByte(CP_ACP, - 0, - pszSrc, - static_cast<INT>(cchSrc), - pszDst, - static_cast<INT>(cchDst * sizeof(_T)), - NULL, - NULL); - - if (cbWritten == cchSrc && - cchSrc < cchDst) - { - pszDst[cchSrc] = 0; - } - else - { - ERR("Failed to convert wide char to multibyte string\n"); - throw CXDException(E_FAIL); - } - } - - if (FAILED(hr)) - { - throw CXDException(hr); - } - } - - /*++ - - Routine Name: - - CopyYString - - Routine Description: - - Copys a string of the opposite type from one buffer to another. WCHAR specific implementation. - - Arguments: - - pszDst - pointer to the destination buffer to copy to - cchDst - count of characters available in the destination buffer - pszSrc - pointer to the source buffer - cchSrc - count of characters to copy - - Return Value: - - None - - --*/ - static VOID - CopyYString( - _Inout_updates_(cchDst) WCHAR* pszDst, - _In_ size_t cchDst, - _In_reads_(cchSrc) CONST CHAR* pszSrc, - _In_ size_t cchSrc - ) - { - HRESULT hr = S_OK; - - if (cchDst < cchSrc) - { - hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); - } - else if (pszDst == NULL) - { - hr = E_INVALIDARG; - } - - if (SUCCEEDED(hr) && - pszSrc != NULL && - cchSrc > 0) - { - size_t cchWritten = MultiByteToWideChar(CP_ACP, - 0, - pszSrc, - static_cast<INT>(cchSrc), - pszDst, - static_cast<INT>(cchDst)); - - if (cchWritten == cchSrc && - cchSrc < cchDst) - { - pszDst[cchSrc] = 0; - } - else - { - ERR("Failed to convert multibyte to wide char string\n"); - throw CXDException(E_FAIL); - } - } - - if (FAILED(hr)) - { - throw CXDException(hr); - } - } - - /*++ - - Routine Name: - - CompareXDString - - Routine Description: - - Case sensitive comparison of a native string with another - WCHAR specific implementation. - - Arguments: - - psz - first string in comparison - pszCmp - second string in comparison - - Return Value: - - < 0 if the string data is less than the compare string - 0 if the strings are identical - > 0 if the string data is more than the compare string - - --*/ - static INT - CompareXDString( - _In_z_ CONST WCHAR* psz, - _In_z_ CONST WCHAR* pszCmp - ) - { - if (pszCmp == NULL) - { - throw CXDException(E_FAIL); - } - - return wcscmp(psz, pszCmp); - } - - /*++ - - Routine Name: - - CompareXDString - - Routine Description: - - Case sensitive comparison of a native string with another - CHAR specific implementation. - - Arguments: - - psz - first string in comparison - pszCmp - second string in comparison - - Return Value: - - < 0 if the string data is less than the compare string - 0 if the strings are identical - > 0 if the string data is more than the compare string - - --*/ - static INT - CompareXDString( - _In_z_ CONST CHAR* psz, - _In_z_ CONST CHAR* pszCmp - ) - { - if (pszCmp == NULL) - { - throw CXDException(E_FAIL); - } - - return strcmp(psz, pszCmp); - } - - /*++ - - Routine Name: - - CompareXDString - - Routine Description: - - Case insensitive comparison of a native string with another - WCHAR specific implementation. - - Arguments: - - psz - first string in comparison - pszCmp - second string in comparison - - Return Value: - - < 0 if the string data is less than the compare string - 0 if the strings are identical - > 0 if the string data is more than the compare string - - --*/ - static INT - CompareXDStringNoCase( - _In_z_ CONST WCHAR* psz, - _In_z_ CONST WCHAR* pszCmp - ) - { - if (pszCmp == NULL) - { - throw CXDException(E_FAIL); - } - - return _wcsicmp(psz, pszCmp); - } - - /*++ - - Routine Name: - - CompareXDString - - Routine Description: - - Case insensitive comparison of a native string with another - CHAR specific implementation. - - Arguments: - - psz - first string in comparison - pszCmp - second string in comparison - - Return Value: - - < 0 if the string data is less than the compare string - 0 if the strings are identical - > 0 if the string data is more than the compare string - - --*/ - static INT - CompareXDStringNoCase( - _In_z_ CONST CHAR* psz, - _In_z_ CONST CHAR* pszCmp - ) - { - if (pszCmp == NULL) - { - throw CXDException(E_FAIL); - } - - return _stricmp(psz, pszCmp); - } - - /*++ - - Routine Name: - - AllocSysString - - Routine Description: - - Allocates a system string from the string data. WCHAR specific implementation. - - Arguments: - - psz - The string to allocate from - - Return Value: - - The newly allocated BSTR - - --*/ - static BSTR - AllocSysString( - _In_z_ CONST WCHAR* psz - ) - { - BSTR bstr = ::SysAllocString(psz); - - if (bstr == NULL) - { - throw CXDException(E_OUTOFMEMORY); - } - - return bstr; - } - - /*++ - - Routine Name: - - AllocSysString - - Routine Description: - - Allocates a system string from the string data. CHAR specific implementation. - - Arguments: - - psz - The string to allocate from - - Return Value: - - The newly allocated BSTR - - --*/ - static BSTR - AllocSysString( - _In_z_ CONST CHAR* psz - ) - { - CStringXDW cstrWide(psz); - BSTR bstr = ::SysAllocString(cstrWide); - - if (bstr == NULL) - { - throw CXDException(E_OUTOFMEMORY); - } - - return bstr; - } - - /*++ - - Routine Name: - - Find - - Routine Description: - - Retrieves the location of a sub string in another string. This is the - CHAR spzecific implementation for native string type - - Arguments: - - pszSrc - string to search in - pszSub - sub string to search for - cchStart - starting point for the search - - Return Value: - - < 0 if the substring was not found - Otherwise, the location of the substring - - --*/ - static INT - Find( - _In_z_ CONST CHAR* pszSrc, - _In_z_ CONST CHAR* pszSub, - _In_ INT cchStart = 0 - ) throw() - { - INT cchIndex = -1; - size_t cchLen = StringLength(pszSrc); - - if (pszSrc != NULL && - pszSub != NULL && - cchStart >= 0 && - cchStart <= static_cast<INT>(cchLen)) - { - CHAR* psz = strstr(const_cast<CHAR*>(pszSrc + cchStart), pszSub); - - if (psz != NULL) - { - cchIndex = static_cast<INT>(psz - pszSrc); - } - } - - return cchIndex; - } - - /*++ - - Routine Name: - - Find - - Routine Description: - - Retrieves the location of a sub string in another string. This is the - WCHAR spzecific implementation for native string type - - Arguments: - - pszSrc - string to search in - pszSub - sub string to search for - cchStart - starting point for the search - - Return Value: - - < 0 if the substring was not found - Otherwise, the location of the substring - - --*/ - static INT - Find( - _In_z_ CONST WCHAR* pszSrc, - _In_z_ CONST WCHAR* pszSub, - _In_ INT cchStart = 0 - ) throw() - { - INT cchIndex = -1; - size_t cchLen = StringLength(pszSrc); - - if (pszSrc != NULL && - pszSub != NULL && - cchStart >= 0 && - cchStart <= static_cast<INT>(cchLen)) - { - WCHAR* psz = wcsstr(const_cast<WCHAR*>(pszSrc + cchStart), pszSub); - - if (psz != NULL) - { - cchIndex = static_cast<INT>(psz - pszSrc); - } - } - - return cchIndex; - } - - /*++ - - Routine Name: - - Format - - Routine Description: - - Writes formatted data to the string. WCHAR specific implementation. - - Arguments: - - pszFormat - the format string - argList - Variable argument list - - Return Value: - - None - - --*/ - VOID - Format( - _In_z_ CONST WCHAR* pszFormat, - va_list argList - ) - { - INT cchFormatedLen = _vscwprintf(pszFormat, argList); - - if (cchFormatedLen >= 0) - { - SetBufferSize(cchFormatedLen); - vswprintf_s(GetString(), GetBufferCharCount(), pszFormat, argList); - } - else - { - throw CXDException(E_INVALIDARG); - } - } - - /*++ - - Routine Name: - - Format - - Routine Description: - - Writes formatted data to the string. CHAR specific implementation. - - Arguments: - - pszFormat - the format string - argList - Variable argument list - - Return Value: - - None - - --*/ - VOID - Format( - _In_z_ CONST CHAR* pszFormat, - va_list argList - ) - { - INT cchFormatedLen = _vscprintf(pszFormat, argList); - - if (cchFormatedLen >= 0) - { - SetBufferSize(cchFormatedLen); - vsprintf_s(GetString(), GetBufferCharCount(), pszFormat, argList); - } - else - { - throw CXDException(E_INVALIDARG); - } - } - - /*++ - - Routine Name: - - IsSpace - - Routine Description: - - Determinese if a character is white space character. WCHAR specific implementation. - - Arguments: - - szCandidate - candidate character value - - Return Value: - - true - if the character is a white space character - false - otherwise - - --*/ - static bool - IsSpace( - _In_ CONST WCHAR& szCandidate - ) - { - return iswspace(szCandidate) != 0; - } - - /*++ - - Routine Name: - - IsSpace - - Routine Description: - - Determinese if a character is white space character. CHAR specific implementation. - - Arguments: - - szCandidate - candidate character value - - Return Value: - - true - if the character is a white space character - false - otherwise - - --*/ - static bool - IsSpace( - _In_z_ CONST CHAR& szCandidate - ) - { - return isspace(szCandidate) != 0; - } - - /*++ - - Routine Name: - - MakeLower - - Routine Description: - - Converts all characters in the source string to lower case characters. - WCHAR specific implementation. - - Arguments: - - pszSrc - string to be converted - cchSrc - character count of the string - - Return Value: - - NULL if the conversion fails - Pointer to the converted string on success - - --*/ - static PWSTR - MakeLower( - PWSTR pszSrc, - size_t cchSrc - ) - { - PWSTR pszRet = NULL; - if (_wcslwr_s(pszSrc, cchSrc) == 0) - { - pszRet = pszSrc; - } - - return pszRet; - } - - /*++ - - Routine Name: - - MakeLower - - Routine Description: - - Converts all characters in the source string to lower case characters. - CHAR specific implementation. - - Arguments: - - pszSrc - string to be converted - cchSrc - character count of the string - - Return Value: - - NULL if the conversion fails - Pointer to the converted string on success - - --*/ - static PSTR - MakeLower( - PSTR pszSrc, - size_t cchSrc - ) - { - PSTR pszRet = NULL; - if (_strlwr_s(pszSrc, cchSrc) == 0) - { - pszRet = pszSrc; - } - - return pszRet; - } - - /*++ - - Routine Name: - - GetString - - Routine Description: - - Retrieves the underlying string. - - Arguments: - - None - - Return Value: - - The underlying string - - --*/ - _T*& - GetString( - VOID - ) CONST - { - if (m_pszData == NULL) - { - SetBufferSize(1); - } - - return m_pszData; - } - -private: - mutable _T* m_pszData; -}; - -typedef CStringXDT<TCHAR> CStringXD; -typedef CStringXDT<WCHAR> CStringXDW; -typedef CStringXDT<CHAR> CStringXDA; - diff --git a/print/XPSDrvSmpl/src/ui/bkdmptcnv.cpp b/print/XPSDrvSmpl/src/ui/bkdmptcnv.cpp deleted file mode 100644 index 00c4e905..00000000 --- a/print/XPSDrvSmpl/src/ui/bkdmptcnv.cpp +++ /dev/null @@ -1,433 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - bkdmptcnv.cpp - -Abstract: - - Booklet/Binding devmode <-> PrintTicket conversion class implementation. The class - defines a common data representation between the DevMode (GPD) and PrintTicket - representations and implements the conversion and validation methods required - by CFeatureDMPTConvert. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdexcept.h" -#include "xdstring.h" -#include "bkdmptcnv.h" -#include "bkpchndlr.h" - -using XDPrintSchema::Binding::BindingData; -using XDPrintSchema::Binding::EBinding; -using XDPrintSchema::Binding::EBindingMin; -using XDPrintSchema::Binding::JobBindAllDocuments; -using XDPrintSchema::Binding::DocumentBinding; -using XDPrintSchema::Binding::EBindingMax; - -using XDPrintSchema::Binding::EBindingOption; -using XDPrintSchema::Binding::None; -using XDPrintSchema::Binding::BindLeft; -using XDPrintSchema::Binding::BindRight; -using XDPrintSchema::Binding::BindTop; -using XDPrintSchema::Binding::BindBottom; - -PCSTR g_pszBindFeature[EBindingMax] = { - "JobBindAllDocuments", - "DocumentBinding", -}; -static GPDStringToOption<EBindingOption> g_bindingTypeOption[] = { - {"None", None}, - {"BindLeft", BindLeft}, - {"BindRight", BindRight}, - {"BindTop", BindTop}, - {"BindBottom", BindBottom}, -}; -UINT g_cBindOption = sizeof(g_bindingTypeOption)/sizeof(GPDStringToOption<EBindingOption>); - -/*++ - -Routine Name: - - CBookletDMPTConv::CBookletDMPTConv - -Routine Description: - - CBookletDMPTConv class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CBookletDMPTConv::CBookletDMPTConv() -{ -} - -/*++ - -Routine Name: - - CBookletDMPTConv::~CBookletDMPTConv - -Routine Description: - - CBookletDMPTConv class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CBookletDMPTConv::~CBookletDMPTConv() -{ -} - -/*++ - -Routine Name: - - CBookletDMPTConv::GetPTDataSettingsFromDM - -Routine Description: - - Populates the booklet data structure from the Devmode passed in. - -Arguments: - - pDevmode - pointer to input devmode buffer. - cbDevmode - size in bytes of full input devmode. - pPrivateDevmode - pointer to input private devmode buffer. - cbDrvPrivateSize - size in bytes of private devmode. - pDataSettings - Pointer to booklet data structure to be updated. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CBookletDMPTConv::GetPTDataSettingsFromDM( - _In_ PDEVMODE pDevmode, - _In_ ULONG cbDevmode, - _In_ PVOID pPrivateDevmode, - _In_ ULONG cbDrvPrivateSize, - _Out_ BookletSettings* pDataSettings - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pDevmode, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pPrivateDevmode, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pDataSettings, E_POINTER))) - { - if (cbDevmode < sizeof(DEVMODE) || - cbDrvPrivateSize == 0) - { - hr = E_INVALIDARG; - } - } - - // - // Retrieve the GPD and devmode controlled settings for both Job and Document binding - // - for (EBinding bindFeature = EBindingMin; - bindFeature < EBindingMax && SUCCEEDED(hr); - bindFeature = static_cast<EBinding>(bindFeature + 1)) - { - pDataSettings->settings[bindFeature].bindFeature = bindFeature; - hr = GetOptionFromGPDString<EBindingOption>(pDevmode, - cbDevmode, - g_pszBindFeature[bindFeature], - g_bindingTypeOption, - g_cBindOption, - pDataSettings->settings[bindFeature].bindOption); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CBookletDMPTConv::MergePTDataSettingsWithPT - -Routine Description: - - This method updates the booklet data structure from a PrintTicket description. - -Arguments: - - pPrintTicket - Pointer to the input PrintTicket. - pDataSettings - Pointer to the booklet data structure - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CBookletDMPTConv::MergePTDataSettingsWithPT( - _In_ IXMLDOMDocument2* pPrintTicket, - _Inout_ BookletSettings* pDataSettings - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pPrintTicket, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pDataSettings, E_POINTER))) - { - try - { - // - // Get the binding settings from the PrintTicket and set the options in - // the appropriate Job or Document equivalent in the BookletSettings structure - // - BindingData bindData; - CBookPTHandler bkPTHndlr(pPrintTicket); - - if (SUCCEEDED(hr = bkPTHndlr.GetData(&bindData))) - { - // - // Only update settings relevant to the feature - // - if (bindData.bindFeature < EBindingMax && - bindData.bindFeature >= EBindingMin) - { - pDataSettings->settings[bindData.bindFeature] = bindData; - } - } - else if (hr == E_ELEMENT_NOT_FOUND) - { - // - // Binding setting not in the PT - make sure neither Job or - // Document binding are set in the outgoing data structure - // - pDataSettings->settings[JobBindAllDocuments].bindOption = None; - pDataSettings->settings[DocumentBinding].bindOption = None; - - hr = S_OK; - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CBookletDMPTConv::SetPTDataInDM - -Routine Description: - - This method updates the booklet options in the devmode from the UI Settings. - -Arguments: - - dataSettings - Reference to booklet data settings to be updated. - pDevmode - pointer to devmode to be updated. - cbDevmode - size in bytes of full devmode. - pPrivateDevmode - pointer to input private devmode buffer. - cbDrvPrivateSize - size in bytes of private devmode. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CBookletDMPTConv::SetPTDataInDM( - _In_ CONST BookletSettings& dataSettings, - _Inout_ PDEVMODE pDevmode, - _In_ ULONG cbDevmode, - _Inout_ PVOID pPrivateDevmode, - _In_ ULONG cbDrvPrivateSize - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pDevmode, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pPrivateDevmode, E_POINTER))) - { - if (cbDevmode < sizeof(DEVMODE) || - cbDrvPrivateSize == 0) - { - hr = E_INVALIDARG; - } - } - - for (EBinding bindFeature = EBindingMin; - bindFeature < EBindingMax && SUCCEEDED(hr); - bindFeature = static_cast<EBinding>(bindFeature + 1)) - { - hr = SetGPDStringFromOption<EBindingOption>(pDevmode, - cbDevmode, - g_pszBindFeature[bindFeature], - g_bindingTypeOption, - g_cBindOption, - dataSettings.settings[bindFeature].bindOption); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CBookletDMPTConv::SetPTDataInPT - -Routine Description: - - This method updates the watemark PrintTicket description from booklet data structure. - -Arguments: - - dataSettings - Reference to booklet data structure to update from. - pPrintTicket - Pointer to the PrintTicket to be updated. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CBookletDMPTConv::SetPTDataInPT( - _In_ CONST BookletSettings& dataSettings, - _Inout_ IXMLDOMDocument2* pPrintTicket - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pPrintTicket, E_POINTER))) - { - try - { - CBookPTHandler bkPTHndlr(pPrintTicket); - BindingData bkData; - - // - // Preferentially set Job over Document - // - if (dataSettings.settings[JobBindAllDocuments].bindOption != None) - { - bkData.bindFeature = JobBindAllDocuments; - bkData.bindOption = dataSettings.settings[JobBindAllDocuments].bindOption; - } - else - { - bkData.bindFeature = DocumentBinding; - bkData.bindOption = dataSettings.settings[DocumentBinding].bindOption; - } - - // - // If the option is enabled set, otherwise delete it from the PT - // - if (bkData.bindOption != None) - { - hr = bkPTHndlr.SetData(&bkData); - } - else - { - hr = bkPTHndlr.Delete(); - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CBookletDMPTConv::CompletePrintCapabilities - -Routine Description: - - Unidrv calls this routine with an input Device Capabilities Document - that is partially populated with Device capabilities information - filled in by Unidrv for features that it understands. The plug-in - needs to read any private features in the input PrintTicket, delete - them and add them back under Printschema namespace so that higher - level applications can understand them and make use of them. - -Arguments: - - pPrintTicket - pointer to input PrintTicket - pCapabilities - pointer to Device Capabilities Document. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT STDMETHODCALLTYPE -CBookletDMPTConv::CompletePrintCapabilities( - _In_opt_ IXMLDOMDocument2*, - _Inout_ IXMLDOMDocument2* pPrintCapabilities - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pPrintCapabilities, E_POINTER))) - { - try - { - CBookPCHandler bookpcHandler(pPrintCapabilities); - bookpcHandler.SetCapabilities(); - } - catch(CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} diff --git a/print/XPSDrvSmpl/src/ui/bkdmptcnv.h b/print/XPSDrvSmpl/src/ui/bkdmptcnv.h deleted file mode 100644 index bd6640c9..00000000 --- a/print/XPSDrvSmpl/src/ui/bkdmptcnv.h +++ /dev/null @@ -1,84 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - bkdmptcnv.h - -Abstract: - - Booklet/Binding devmode <-> PrintTicket conversion class definition. The class - defines a common data representation between the DevMode (GPD) and PrintTicket - representations and implements the conversion and validation methods required - by CFeatureDMPTConvert. - ---*/ - -#pragma once - -#include "ftrdmptcnv.h" -#include "bkpthndlr.h" - -// -// The PT handling code defines a single BindingData structure that covers both -// JobBindAllDocuments and DocumentBinding to avoid conflicts. The GPD however -// controls both so we re-use the BindingData structure to handle both in -// the DevMode -// -struct BookletSettings -{ - XDPrintSchema::Binding::BindingData settings[XDPrintSchema::Binding::EBindingMax]; -}; - -class CBookletDMPTConv : public CFeatureDMPTConvert<BookletSettings> -{ -public: - CBookletDMPTConv(); - - ~CBookletDMPTConv(); - -private: - HRESULT - GetPTDataSettingsFromDM( - _In_ PDEVMODE pDevmode, - _In_ ULONG cbDevmode, - _In_ PVOID pPrivateDevmode, - _In_ ULONG cbDrvPrivateSize, - _Out_ BookletSettings* pDataSettings - ); - - HRESULT - MergePTDataSettingsWithPT( - _In_ IXMLDOMDocument2* pPrintTicket, - _Inout_ BookletSettings* pDrvSettings - ); - - HRESULT - SetPTDataInDM( - _In_ CONST BookletSettings& drvSettings, - _Inout_ PDEVMODE pDevmode, - _In_ ULONG cbDevmode, - _Inout_ PVOID pPrivateDevmode, - _In_ ULONG cbDrvPrivateSize - ); - - HRESULT - SetPTDataInPT( - _In_ CONST BookletSettings& drvSettings, - _Inout_ IXMLDOMDocument2* pPrintTicket - ); - - HRESULT STDMETHODCALLTYPE - CompletePrintCapabilities( - _In_opt_ IXMLDOMDocument2* pPrintTicket, - _Inout_ IXMLDOMDocument2* pPrintCapabilities - ); -}; diff --git a/print/XPSDrvSmpl/src/ui/colctrls.cpp b/print/XPSDrvSmpl/src/ui/colctrls.cpp deleted file mode 100644 index acffdada..00000000 --- a/print/XPSDrvSmpl/src/ui/colctrls.cpp +++ /dev/null @@ -1,371 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - colctrls.cpp - -Abstract: - - Implementation of the color management specific UI controls. These are the - combo box used to select the PageColorManagement option, a list box - for selecting the PageSourceColorProfile option and a combo box for - selecting the PageSourceColorProfile option. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "resource.h" -#include "colctrls.h" - -PCSTR CUICtrlPageColManCombo::m_pszPageColManName = "PageColorManagement"; -PCSTR CUICtrlColProfList::m_pszDestColProf = "PageSourceColorProfile"; -PCSTR CUICtrlPageColIntentCombo::m_pszPageIntentName = "PageICMRenderingIntent"; - -#define DRIVER_COL_MAN_SEL 2 - -/*++ - -Routine Name: - - CUICtrlPageColManCombo::CUICtrlPageColManCombo - -Routine Description: - - CUICtrlPageColManCombo class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlPageColManCombo::CUICtrlPageColManCombo() : - CUICtrlDefaultCombo(m_pszPageColManName, IDC_COMBO_COL_MANAGE) -{ -} - -/*++ - -Routine Name: - - CUICtrlPageColManCombo::~CUICtrlPageColManCombo - -Routine Description: - - CUICtrlPageColManCombo class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlPageColManCombo::~CUICtrlPageColManCombo() -{ -} - -/*++ - -Routine Name: - - CUICtrlPageColManCombo::OnInit - -Routine Description: - - This is responsible for initialising the control and is called when - the WM_INITDIALOG message is recieved. This method populates the combo - box with the appropriate option strings. - -Arguments: - - hDlg - handle to the parent window - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlPageColManCombo::OnInit( - _In_ CONST HWND hDlg - ) -{ - HRESULT hr = S_OK; - // - // Populate the combo box - // - if (SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_NONE)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_DEVICE)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_DRIVER))) - { - hr = AddString(hDlg, g_hInstance, IDS_GPD_SYSTEM); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUICtrlPageColManCombo::EnableDependentCtrls - -Routine Description: - - This method is used to enable or disable other controls in the UI based on the - current combo box selection. - -Arguments: - - hDlg - handle to the parent window - lSel - current combo box selection - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlPageColManCombo::EnableDependentCtrls( - _In_ CONST HWND hDlg, - _In_ CONST LONG lSel - ) -{ - HRESULT hr = S_OK; - HWND hWnd = NULL; - - if (SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_TEXT_COLPROF), E_HANDLE))) - { - EnableWindow(hWnd, lSel == DRIVER_COL_MAN_SEL); - } - - if (SUCCEEDED(hr) && - (SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_LIST_COLPROF), E_HANDLE)))) - { - EnableWindow(hWnd, lSel == DRIVER_COL_MAN_SEL); - } - - if (SUCCEEDED(hr) && - (SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_TXT_COL_INTENT), E_HANDLE)))) - { - EnableWindow(hWnd, lSel == DRIVER_COL_MAN_SEL); - } - - if (SUCCEEDED(hr) && - (SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_COMBO_COL_INTENT), E_HANDLE)))) - { - EnableWindow(hWnd, lSel == DRIVER_COL_MAN_SEL); - } - - if (FAILED(hr)) - { - hr = HRESULT_FROM_WIN32(GetLastError()); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUICtrlColProfList::CUICtrlColProfList - -Routine Description: - - CUICtrlColProfList class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlColProfList::CUICtrlColProfList() : - CUICtrlDefaultList(m_pszDestColProf, IDC_LIST_COLPROF) -{ -} - -/*++ - -Routine Name: - - CUICtrlColProfList::~CUICtrlColProfList - -Routine Description: - - CUICtrlColProfList class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlColProfList::~CUICtrlColProfList() -{ -} - -/*++ - -Routine Name: - - CUICtrlColProfList::OnInit - -Routine Description: - - This is responsible for initialising the control and is called when - the WM_INITDIALOG message is recieved. This method populates the list - box with the appropriate option strings. - -Arguments: - - hDlg - handle to the parent window - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlColProfList::OnInit( - _In_ CONST HWND hDlg - ) -{ - HRESULT hr = S_OK; - // - // Populate the combo box - // - if (SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_CMYK))) - { - hr = AddString(hDlg, g_hInstance, IDS_GPD_SCRGB); - } - - ERR_ON_HR(hr); - return hr; -} - - -/*++ - -Routine Name: - - CUICtrlPageColIntentCombo::CUICtrlPageColIntentCombo - -Routine Description: - - CUICtrlPageColIntentCombo class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlPageColIntentCombo::CUICtrlPageColIntentCombo() : - CUICtrlDefaultCombo(m_pszPageIntentName, IDC_COMBO_COL_INTENT) -{ -} - -/*++ - -Routine Name: - - CUICtrlPageColIntentCombo::~CUICtrlPageColIntentCombo - -Routine Description: - - CUICtrlPageColIntentCombo class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlPageColIntentCombo::~CUICtrlPageColIntentCombo() -{ -} - -/*++ - -Routine Name: - - CUICtrlPageColIntentCombo::OnInit - -Routine Description: - - This is responsible for initialising the control and is called when - the WM_INITDIALOG message is recieved. This method populates the combo - box with the appropriate option strings. - -Arguments: - - hDlg - handle to the parent window - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlPageColIntentCombo::OnInit( - _In_ CONST HWND hDlg - ) -{ - HRESULT hr = S_OK; - - // - // Populate the combo box - // - if (SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_ABSCOLINTENT)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_RELCOLINTENT)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_PHOTOINTENT))) - { - hr = AddString(hDlg, g_hInstance, IDS_GPD_BIZINTENT); - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/ui/colctrls.h b/print/XPSDrvSmpl/src/ui/colctrls.h deleted file mode 100644 index 90ebd21c..00000000 --- a/print/XPSDrvSmpl/src/ui/colctrls.h +++ /dev/null @@ -1,83 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - colctrls.h - -Abstract: - - Definition of the color management specific UI controls. These are the - combo box used to select the PageColorManagement option, a list box - for selecting the PageSourceColorProfile option and a combo box for - selecting the PageSourceColorProfile option. - ---*/ - -#pragma once - -#include "uictrl.h" - -class CUICtrlPageColManCombo : public CUICtrlDefaultCombo -{ -public: - CUICtrlPageColManCombo(); - - virtual ~CUICtrlPageColManCombo(); - - HRESULT - OnInit( - _In_ CONST HWND hDlg - ); - -private: - HRESULT - EnableDependentCtrls( - _In_ CONST HWND hDlg, - _In_ CONST LONG lSel - ); - -private: - static PCSTR m_pszPageColManName; -}; - -class CUICtrlColProfList : public CUICtrlDefaultList -{ -public: - CUICtrlColProfList(); - - virtual ~CUICtrlColProfList(); - - HRESULT - OnInit( - _In_ CONST HWND hDlg - ); - -private: - static PCSTR m_pszDestColProf; -}; - -class CUICtrlPageColIntentCombo : public CUICtrlDefaultCombo -{ -public: - CUICtrlPageColIntentCombo(); - - virtual ~CUICtrlPageColIntentCombo(); - - HRESULT - OnInit( - _In_ CONST HWND hDlg - ); - -private: - static PCSTR m_pszPageIntentName; -}; - diff --git a/print/XPSDrvSmpl/src/ui/coldmptcnv.cpp b/print/XPSDrvSmpl/src/ui/coldmptcnv.cpp deleted file mode 100644 index 3d20af57..00000000 --- a/print/XPSDrvSmpl/src/ui/coldmptcnv.cpp +++ /dev/null @@ -1,395 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - coldmptcnv.cpp - -Abstract: - - PageSourceColorProfile devmode <-> PrintTicket conversion class implementation. - The class defines a common data representation between the DevMode (GPD) and PrintTicket - representations and implements the conversion and validation methods required - by CFeatureDMPTConvert. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdexcept.h" -#include "xdstring.h" -#include "cmprofpchndlr.h" -#include "coldmptcnv.h" - -using XDPrintSchema::PageSourceColorProfile::PageSourceColorProfileData; -using XDPrintSchema::PageSourceColorProfile::EProfileOption; -using XDPrintSchema::PageSourceColorProfile::RGB; -using XDPrintSchema::PageSourceColorProfile::CMYK; - -PCWSTR g_pszCMYKProfileName = L"xdCMYKPrinter.icc"; -PCWSTR g_pszRGBProfileName = L"xdwscRGB.icc"; -PCSTR g_pszColProfFeature = "PageSourceColorProfile"; -static GPDStringToOption<EProfileOption> g_colProfTypeOption[] = { - {"CMYK", CMYK}, - {"scRGB", RGB}, -}; -UINT g_cColProfOption = sizeof(g_colProfTypeOption)/sizeof(GPDStringToOption<EProfileOption>); - -/*++ - -Routine Name: - - CColorProfileDMPTConv::CColorProfileDMPTConv - -Routine Description: - - CColorProfileDMPTConv class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CColorProfileDMPTConv::CColorProfileDMPTConv() -{ -} - -/*++ - -Routine Name: - - CColorProfileDMPTConv::~CColorProfileDMPTConv - -Routine Description: - - CColorProfileDMPTConv class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CColorProfileDMPTConv::~CColorProfileDMPTConv() -{ -} - -/*++ - -Routine Name: - - CColorProfileDMPTConv::GetPTDataSettingsFromDM - -Routine Description: - - Populates the color profile data structure from the Devmode passed in. - -Arguments: - - pDevmode - pointer to input devmode buffer. - cbDevmode - size in bytes of full input devmode. - pPrivateDevmode - pointer to input private devmode buffer. - cbDrvPrivateSize - size in bytes of private devmode. - pDataSettings - Pointer to color profile data structure to be updated. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorProfileDMPTConv::GetPTDataSettingsFromDM( - _In_ PDEVMODE pDevmode, - _In_ ULONG cbDevmode, - _In_ PVOID pPrivateDevmode, - _In_ ULONG cbDrvPrivateSize, - _Out_ PageSourceColorProfileData* pDataSettings - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pDevmode, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pPrivateDevmode, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pDataSettings, E_POINTER))) - { - if (cbDevmode < sizeof(DEVMODE) || - cbDrvPrivateSize == 0) - { - hr = E_INVALIDARG; - } - } - - // - // Defer setting up the profile file names until we write to the PT - // as they only have meaning at that point - // - if (SUCCEEDED(hr)) - { - GetOptionFromGPDString<EProfileOption>(pDevmode, - cbDevmode, - g_pszColProfFeature, - g_colProfTypeOption, - g_cColProfOption, - pDataSettings->cmProfile); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorProfileDMPTConv::MergePTDataSettingsWithPT - -Routine Description: - - This method updates the color profile data structure from a PrintTicket description. - -Arguments: - - pPrintTicket - Pointer to the input PrintTicket. - pDataSettings - Pointer to the color profile data structure - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorProfileDMPTConv::MergePTDataSettingsWithPT( - _In_ IXMLDOMDocument2* pPrintTicket, - _Inout_ PageSourceColorProfileData* pDataSettings - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_POINTER(pPrintTicket, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pDataSettings, E_POINTER))) - { - try - { - PageSourceColorProfileData profData; - CColorManageProfilePTHandler profPTHndlr(pPrintTicket); - - if (SUCCEEDED(hr = profPTHndlr.GetData(&profData))) - { - pDataSettings->cmProfile = profData.cmProfile; - } - else if (hr == E_ELEMENT_NOT_FOUND) - { - // - // The property is not in the PT. This is not an error - reset hresult - // and continue - // - hr = S_OK; - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorProfileDMPTConv::SetPTDataInDM - -Routine Description: - - This method updates the color profile options in the devmode from the UI Settings. - -Arguments: - - dataSettings - Reference to color profile data settings to be updated. - pDevmode - pointer to devmode to be updated. - cbDevmode - size in bytes of full devmode. - pPrivateDevmode - pointer to input private devmode buffer. - cbDrvPrivateSize - size in bytes of private devmode. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorProfileDMPTConv::SetPTDataInDM( - _In_ CONST PageSourceColorProfileData& dataSettings, - _Inout_ PDEVMODE pDevmode, - _In_ ULONG cbDevmode, - _Inout_ PVOID pPrivateDevmode, - _In_ ULONG cbDrvPrivateSize - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pDevmode, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pPrivateDevmode, E_POINTER))) - { - if (cbDevmode < sizeof(DEVMODE) || - cbDrvPrivateSize == 0) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - hr = SetGPDStringFromOption<EProfileOption>(pDevmode, - cbDevmode, - g_pszColProfFeature, - g_colProfTypeOption, - g_cColProfOption, - dataSettings.cmProfile); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorProfileDMPTConv::SetPTDataInPT - -Routine Description: - - This method updates the watemark PrintTicket description from color profile data structure. - -Arguments: - - dataSettings - Reference to color profile data structure to update from. - pPrintTicket - Pointer to the PrintTicket to be updated. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorProfileDMPTConv::SetPTDataInPT( - _In_ CONST PageSourceColorProfileData& dataSettings, - _Inout_ IXMLDOMDocument2* pPrintTicket - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pPrintTicket, E_POINTER))) - { - try - { - CColorManageProfilePTHandler cmProfPTHndlr(pPrintTicket); - PageSourceColorProfileData profData; - profData.cmProfile = dataSettings.cmProfile; - - // - // Ensure profile file names are set from the enumerated type - // - if (profData.cmProfile == CMYK) - { - profData.cmProfileName = g_pszCMYKProfileName; - } - else - { - profData.cmProfileName = g_pszRGBProfileName; - } - - hr = cmProfPTHndlr.SetData(&profData); - } - catch (CXDException& e) - { - hr = e; - } - } - else - { - hr = E_POINTER; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorProfileDMPTConv::CompletePrintCapabilities - -Routine Description: - - Unidrv calls this routine with an input Device Capabilities Document - that is partially populated with Device capabilities information - filled in by Unidrv for features that it understands. The plug-in - needs to read any private features in the input PrintTicket, delete - them and add them back under Printschema namespace so that higher - level applications can understand them and make use of them. - -Arguments: - - pPrintTicket - pointer to input PrintTicket - pCapabilities - pointer to Device Capabilities Document. - -Return Value: - - HRESULT - S_OK - Always - ---*/ -HRESULT STDMETHODCALLTYPE -CColorProfileDMPTConv::CompletePrintCapabilities( - _In_opt_ IXMLDOMDocument2*, - _Inout_ IXMLDOMDocument2* pPrintCapabilities - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pPrintCapabilities, E_POINTER))) - { - try - { - CColorManageProfilePCHandler cmProfPCHandler(pPrintCapabilities); - cmProfPCHandler.SetCapabilities(); - } - catch(CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} diff --git a/print/XPSDrvSmpl/src/ui/coldmptcnv.h b/print/XPSDrvSmpl/src/ui/coldmptcnv.h deleted file mode 100644 index 0c890758..00000000 --- a/print/XPSDrvSmpl/src/ui/coldmptcnv.h +++ /dev/null @@ -1,76 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - coldmptcnv.h - -Abstract: - - PageSourceColorProfile devmode <-> PrintTicket conversion class definition. - The class defines a common data representation between the DevMode (GPD) and PrintTicket - representations and implements the conversion and validation methods required - by CFeatureDMPTConvert. - ---*/ - -#pragma once - -#include "ftrdmptcnv.h" -#include "cmprofpthndlr.h" -#include "cmprofiledata.h" - -class CColorProfileDMPTConv : - public CFeatureDMPTConvert<XDPrintSchema::PageSourceColorProfile::PageSourceColorProfileData> -{ -public: - CColorProfileDMPTConv(); - - virtual ~CColorProfileDMPTConv(); - -private: - HRESULT - GetPTDataSettingsFromDM( - _In_ PDEVMODE pDevmode, - _In_ ULONG cbDevmode, - _In_ PVOID pPrivateDevmode, - _In_ ULONG cbDrvPrivateSize, - _Out_ XDPrintSchema::PageSourceColorProfile::PageSourceColorProfileData* pDataSettings - ); - - HRESULT - MergePTDataSettingsWithPT( - _In_ IXMLDOMDocument2* pPrintTicket, - _Inout_ XDPrintSchema::PageSourceColorProfile::PageSourceColorProfileData* pDrvSettings - ); - - HRESULT - SetPTDataInDM( - _In_ CONST XDPrintSchema::PageSourceColorProfile::PageSourceColorProfileData& drvSettings, - _Inout_ PDEVMODE pDevmode, - _In_ ULONG cbDevmode, - _Inout_ PVOID pPrivateDevmode, - _In_ ULONG cbDrvPrivateSize - ); - - HRESULT - SetPTDataInPT( - _In_ CONST XDPrintSchema::PageSourceColorProfile::PageSourceColorProfileData& drvSettings, - _Inout_ IXMLDOMDocument2* pPrintTicket - ); - - HRESULT STDMETHODCALLTYPE - CompletePrintCapabilities( - _In_opt_ IXMLDOMDocument2*, - _Inout_ IXMLDOMDocument2* pPrintCapabilities - ); -}; - diff --git a/print/XPSDrvSmpl/src/ui/colppg.cpp b/print/XPSDrvSmpl/src/ui/colppg.cpp deleted file mode 100644 index 24e9eb35..00000000 --- a/print/XPSDrvSmpl/src/ui/colppg.cpp +++ /dev/null @@ -1,160 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - colppg.cpp - -Abstract: - - Implementation of the color management property page. This class is - responsible for initialising and registering the color management - property page and its controls. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdexcept.h" -#include "xdstring.h" -#include "resource.h" -#include "colppg.h" -#include "colctrls.h" - -/*++ - -Routine Name: - - CColorPropPage::CColorPropPage - -Routine Description: - - CColorPropPage class constructor. - Creates a handler class object for every control on the color profile property page. - Each of these handlers is stored in a collection. - -Arguments: - - None - -Return Value: - - None - Throws CXDException(HRESULT) on an error - ---*/ -CColorPropPage::CColorPropPage() -{ - HRESULT hr = S_OK; - - try - { - CUIControl* pControl = new(std::nothrow) CUICtrlPageColManCombo(); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY))) - { - hr = AddUIControl(IDC_COMBO_COL_MANAGE, pControl); - } - - if (SUCCEEDED(hr)) - { - pControl = new(std::nothrow) CUICtrlColProfList(); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY))) - { - hr = AddUIControl(IDC_LIST_COLPROF, pControl); - } - } - - if (SUCCEEDED(hr)) - { - pControl = new(std::nothrow) CUICtrlPageColIntentCombo(); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY))) - { - hr = AddUIControl(IDC_COMBO_COL_INTENT, pControl); - } - } - } - catch (CXDException& e) - { - hr = e; - } - - if (FAILED(hr)) - { - DestroyUIComponents(); - throw CXDException(hr); - } -} - -/*++ - -Routine Name: - - CColorPropPage::~CColorPropPage - -Routine Description: - - CColorPropPage class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CColorPropPage::~CColorPropPage() -{ -} - -/*++ - -Routine Name: - - CColorPropPage::InitDlgBox - -Routine Description: - - Provides the base class with the data required to intialise the dialog box. - -Arguments: - - ppszTemplate - Pointer to dialog box template to be intialised. - ppszTitle - Pointer to dialog box title to be intialised. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorPropPage::InitDlgBox( - _Out_ LPCTSTR* ppszTemplate, - _Out_ LPCTSTR* ppszTitle - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppszTemplate, E_POINTER)) || - SUCCEEDED(hr = CHECK_POINTER(ppszTitle, E_POINTER))) - { - *ppszTemplate = MAKEINTRESOURCE(IDD_COL_MANAGE); - *ppszTitle = MAKEINTRESOURCE(IDS_COLMAN); - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/ui/colppg.h b/print/XPSDrvSmpl/src/ui/colppg.h deleted file mode 100644 index 76fff12d..00000000 --- a/print/XPSDrvSmpl/src/ui/colppg.h +++ /dev/null @@ -1,42 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - colppg.h - -Abstract: - - Definition of the color management property page. This class is - responsible for initialising and registering the color management - property page and its controls. - ---*/ - -#pragma once - -#include "precomp.h" -#include "docppg.h" - -class CColorPropPage : public CDocPropPage -{ -public: - CColorPropPage(); - - virtual ~CColorPropPage(); - - HRESULT - InitDlgBox( - _Out_ LPCTSTR* ppszTemplate, - _Out_ LPCTSTR* ppszTitle - ); -}; - diff --git a/print/XPSDrvSmpl/src/ui/devmode.h b/print/XPSDrvSmpl/src/ui/devmode.h deleted file mode 100644 index c5e74fbc..00000000 --- a/print/XPSDrvSmpl/src/ui/devmode.h +++ /dev/null @@ -1,82 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - devmode.h - -Abstract: - - Definition of the OEM devmode structure. - ---*/ - -#pragma once - - -//////////////////////////////////////////////////////// -// OEM Devmode Defines -//////////////////////////////////////////////////////// - -#define MAX_WATERMARK_TEXT 24 - -//////////////////////////////////////////////////////// -// OEM Devmode Type Definitions -//////////////////////////////////////////////////////// - -// -//Can add info to the private devmode bellow here. -//Note : -// This structure must be prefixed by OEM_DMEXTRAHEADER -// Your plug-in must implement the IPrintOemUI::DevMode method -// -typedef struct tagOEMDEV -{ - OEM_DMEXTRAHEADER dmOEMExtra; - - // - //Private DevMode Members - // - - // - // Page Scaling Members - // - - DWORD dwPgScaleX; - DWORD dwPgScaleY; - INT iPgOffsetX; - INT iPgOffsetY; - - // - // Watermark Members - // - INT iWMTransparency; - INT iWMAngle; - INT iWMOffsetX; - INT iWMOffsetY; - - // - // Text Watermark Members - // - INT iWMFontSize; - DWORD dwColText; - TCHAR strWMText[MAX_WATERMARK_TEXT]; - - // - // Bitmap / Vector Members - // - INT iWMWidth; - INT iWMHeight; - -} OEMDEV, *POEMDEV; - -typedef CONST OEMDEV *PCOEMDEV; - diff --git a/print/XPSDrvSmpl/src/ui/dllentry.cpp b/print/XPSDrvSmpl/src/ui/dllentry.cpp deleted file mode 100644 index 47c8a728..00000000 --- a/print/XPSDrvSmpl/src/ui/dllentry.cpp +++ /dev/null @@ -1,175 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - dllentry.cpp - -Abstract: - - Implementation of the UI plugin dllentry points. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdexcept.h" -#include "xdsmplcf.h" - -/*++ - -Routine Name: - - DllMain - -Routine Description: - - Entry point into the dynamic-link library (DLL). - Called by the system when processes and threads are initialized and terminated, - or upon calls to the LoadLibrary and FreeLibrary functions. - -Arguments: - - hInst - Handle to the DLL module. - wReason - Indicates why the DLL entry-point function is being called. - -Return Value: - - TRUE - ---*/ -BOOL WINAPI -DllMain( - _In_ HINSTANCE hInst, - _In_ WORD wReason, - _In_opt_ LPVOID - ) -{ - switch (wReason) - { - case DLL_PROCESS_ATTACH: - { - g_hInstance = hInst; - } - break; - } - - return TRUE; -} - -/*++ - -Routine Name: - - DllCanUnloadNow - -Routine Description: - - Determines whether the DLL is in use. - If not, the caller can unload the DLL from memory. - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - Dll can unload - S_FALSE - Dll can't unload - ---*/ -STDAPI -DllCanUnloadNow() -{ - if (g_cServerLocks == 0) - { - return S_OK ; - } - else - { - return S_FALSE; - } -} - -/*++ - -Routine Name: - - DllGetClassObject - -Routine Description: - - Retrieves the class objects for the DLL. - Supported class ids are CLSID_OEMUI and CLSID_OEMPTPROVIDER. - Called from within the CoGetClassObject function. - -Arguments: - - rclsid - CLSID that will associate the correct data and code. - riid - Reference to the identifier of the interface that the caller is to use to communicate with the class object. - ppv - Address of pointer variable that receives the interface pointer requested in riid. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - CLASS_E_CLASSNOTAVAILABLE - On unsupported class - ---*/ -STDAPI -DllGetClassObject( - _In_ REFCLSID rclsid, - _In_ REFIID riid, - _Outptr_ LPVOID FAR* ppv - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppv, E_POINTER))) - { - *ppv = NULL; - - // - // Make sure the appropriate CLSID is being requested - // - if (rclsid == CLSID_OEMUI || - rclsid == CLSID_OEMPTPROVIDER) - { - CXDSmplUICF* pXDSmplUICF = new(std::nothrow) CXDSmplUICF(); - hr = CHECK_POINTER(pXDSmplUICF, E_OUTOFMEMORY); - - if (SUCCEEDED(hr)) - { - // - // Get the requested interface. - // - hr = pXDSmplUICF->QueryInterface(riid, ppv); - - // - // Release the IUnknown pointer. - // (If QueryInterface failed, component will delete itself.) - // - pXDSmplUICF->Release(); - } - } - else - { - hr = CLASS_E_CLASSNOTAVAILABLE; - } - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/ui/docppg.cpp b/print/XPSDrvSmpl/src/ui/docppg.cpp deleted file mode 100644 index c297741a..00000000 --- a/print/XPSDrvSmpl/src/ui/docppg.cpp +++ /dev/null @@ -1,1314 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - docppg.cpp - -Abstract: - - Implementation of the document property page class. This is an abstract - class that provides common functionality for all property pages including - accessors and the dialog proc. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdexcept.h" -#include "xdstring.h" -#include "docppg.h" - -/*++ - -Routine Name: - - CDocPropPage::CDocPropPage - -Routine Description: - - CDocPropPage class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CDocPropPage::CDocPropPage() : - m_hPage(NULL), - m_hComPropSheet(NULL), - m_pOemCUIPParam(NULL), - m_pfnComPropSheet(NULL), - m_pDriverUIHelp(NULL), - m_pUIProperties(NULL) -{ -} - -/*++ - -Routine Name: - - CDocPropPage::~CDocPropPage - -Routine Description: - - CDocPropPage class destructor. - -Arguments: - - None - -Return Value: - - None - ---*/ -CDocPropPage::~CDocPropPage() -{ - HRESULT hr = S_OK; - hr = DestroyUIComponents(); - - ASSERTMSG(SUCCEEDED(hr), "Error Deleting Property Pages/n"); -} - -/*++ - -Routine Name: - - CDocPropPage::PropPageInit - -Routine Description: - - Adds an additional Feature property page to the existing Unidrv supplied property pages. - Called from the Unidrv UI Plug-in entry point for DocumentPropertySheets(), - on the PROPSHEETUI_REASON_INIT message. - - This base class implementation provides common property page intialisation functionality for - all property pages. Derived property page classes are required to provide the dialog box template - and the dialog box title. - -Arguments: - - pPSUIInfo - Pointer to a PPROPSHEETUI_INFO structure. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CDocPropPage::PropPageInit( - _In_ CONST PPROPSHEETUI_INFO pPSUIInfo - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pPSUIInfo, E_POINTER))) - { - // - // Only proceed if we have effectively published the helper interfaces to the UI - // control objects. - // - // We also need to retrieve the dialog template resource and dialog title from the - // derived property page class. - // - PROPSHEETPAGE page = {0}; - if (SUCCEEDED(hr = PublishHelpToControls()) && - SUCCEEDED(hr = InitDlgBox(&page.pszTemplate, &page.pszTitle))) - { - page.dwSize = sizeof(PROPSHEETPAGE); - page.dwFlags = PSP_DEFAULT | PSP_USETITLE; - page.hInstance = g_hInstance; - - page.pfnDlgProc = CDocPropPage::DlgProc; - page.lParam = reinterpret_cast<LPARAM>(this); - - pPSUIInfo->Result = pPSUIInfo->pfnComPropSheet(pPSUIInfo->hComPropSheet, - CPSFUNC_ADD_PROPSHEETPAGE, - reinterpret_cast<LPARAM>(&page), - 0); - - if (SUCCEEDED(hr = SetComPropSheetFunc(pPSUIInfo->pfnComPropSheet)) && - SUCCEEDED(hr = SetPageHandle(reinterpret_cast<HANDLE>(pPSUIInfo->Result)))) - { - hr = SetComPropSheetHandle(pPSUIInfo->hComPropSheet); - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CDocPropPage::StoreThis - -Routine Description: - - Stores a pointer to this instance of the CDocPropPage class - that will be associated with the windows handle provided. - -Arguments: - - hDlg - Handle of the property page window associated with this class. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CDocPropPage::StoreThis( - _In_ CONST HWND hDlg - ) -{ - HRESULT hr = S_OK; - - if (!SetProp(hDlg, MAKEINTATOM(ID_XDSMPL_DLG_ATOM), reinterpret_cast<HANDLE>(this))) - { - hr = E_FAIL; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CDocPropPage::RetrieveThis - -Routine Description: - - Obtains the instance of the CDocPropPage class that is associated with a windows handle. - -Arguments: - - hDlg - Handle of the property page Window associated with this class. - pDocPropPage - Address of a pointer to be filled out with the instance of this class. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ - -HRESULT -CDocPropPage::RetrieveThis( - _In_ CONST HWND hDlg, - _Outptr_ CDocPropPage** pDocPropPage - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_HANDLE(hDlg, E_HANDLE)) && - SUCCEEDED(hr = CHECK_POINTER(pDocPropPage, E_POINTER))) - { - *pDocPropPage = reinterpret_cast<CDocPropPage*>(GetProp(hDlg, MAKEINTATOM(ID_XDSMPL_DLG_ATOM))); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CDocPropPage::RemoveThis - -Routine Description: - - Removes the class pointer from the associated windows handle. - -Arguments: - - hDlg - Handle of the property page Window associated with this class. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CDocPropPage::RemoveThis( - _In_ CONST HWND hDlg - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_HANDLE(hDlg, E_HANDLE))) - { - RemoveProp(hDlg, MAKEINTATOM(ID_XDSMPL_DLG_ATOM)); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CDocPropPage::SetComPropSheetFunc - -Routine Description: - - Store the pointer to the PFNCOMPROPSHEET function. - -Arguments: - - pfnComPropSheet - pointer to the PFNCOMPROPSHEET function. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CDocPropPage::SetComPropSheetFunc( - _In_ CONST PFNCOMPROPSHEET pfnComPropSheet - ) -{ - HRESULT hr = S_OK; - - ASSERTMSG(pfnComPropSheet != NULL, "NULL pointer to common propert sheet functions.\n"); - - if (SUCCEEDED(hr = CHECK_POINTER(pfnComPropSheet, E_POINTER))) - { - m_pfnComPropSheet = pfnComPropSheet; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CDocPropPage::SetPageHandle - -Routine Description: - - Store the handle of a property page window. - -Arguments: - - hPage - Handle of a property page window. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CDocPropPage::SetPageHandle( - _In_ CONST HANDLE hPage - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_HANDLE(hPage, E_HANDLE))) - { - m_hPage = hPage; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CDocPropPage::SetComPropSheetHandle - -Routine Description: - - Store the handle of the Common Property Sheet window. - -Arguments: - - hComPropSheet - Handle of the common property sheet window. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CDocPropPage::SetComPropSheetHandle( - _In_ CONST HANDLE hComPropSheet - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_HANDLE(hComPropSheet, E_HANDLE))) - { - m_hComPropSheet = hComPropSheet; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CDocPropPage::GetComPropSheetFunc - -Routine Description: - - Retrieve the pointer of the PFNCOMPROPSHEET function. - -Arguments: - - ppfnComPropSheet - Address of a pointer that will be filled out with the PFNCOMPROPSHEET function. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CDocPropPage::GetComPropSheetFunc( - _Outptr_ PFNCOMPROPSHEET* ppfnComPropSheet - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppfnComPropSheet, E_POINTER))) - { - *ppfnComPropSheet = m_pfnComPropSheet; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CDocPropPage::GetPageHandle - -Routine Description: - - Retrieves the property page handle. - -Arguments: - - None - -Return Value: - - Handle to the property page - ---*/ -HANDLE -CDocPropPage::GetPageHandle( - VOID - ) -{ - return m_hPage; -} - -/*++ - -Routine Name: - - CDocPropPage::GetComPropSheetHandle - -Routine Description: - - Retrieves the common property sheet handle - -Arguments: - - None - -Return Value: - - Handle to the common property sheet - ---*/ -HANDLE -CDocPropPage::GetComPropSheetHandle( - VOID - ) -{ - return m_hComPropSheet; -} - -/*++ - -Routine Name: - - CDocPropPage::DestroyUIComponents - -Routine Description: - - Destroy all control handler classes that have been added into the collection. - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CDocPropPage::DestroyUIComponents( - VOID - ) -{ - HRESULT hr = S_OK; - - try - { - UIControlMap::iterator iterUIComponents = m_UIControls.begin(); - - while (iterUIComponents != m_UIControls.end()) - { - if (iterUIComponents->second != NULL) - { - delete iterUIComponents->second; - iterUIComponents->second = NULL; - } - iterUIComponents++; - } - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CDocPropPage::AddUIControl - -Routine Description: - - Adds a control handler class into the collection. - -Arguments: - - iCtrlID - Resource Identifier of control. - pUIControl - Pointer to a control handler class. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CDocPropPage::AddUIControl( - _In_ CONST INT iCtrlID, - _In_ CUIControl* pUIControl - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pUIControl, E_POINTER))) - { - try - { - m_UIControls[iCtrlID] = pUIControl; - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CDocPropPage::GetUIComponents - -Routine Description: - - Obtains the collection of control handlers. - -Arguments: - - ppUIComponents - Address of the pointer that will be filled out with the contain handler collection. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CDocPropPage::GetUIComponents( - _Outptr_ UIControlMap** ppUIComponents - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppUIComponents, E_POINTER))) - { - *ppUIComponents = &m_UIControls; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CDocPropPage::SetOemCUIPParam - -Routine Description: - - Store the pointer to the POEMCUIPPARAM function. - -Arguments: - - pOemCUIPParam - pointer to the POEMCUIPPARAM function. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CDocPropPage::SetOemCUIPParam( - _In_ CONST POEMCUIPPARAM pOemCUIPParam - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pOemCUIPParam, E_POINTER))) - { - m_pOemCUIPParam = pOemCUIPParam; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CDocPropPage::SetUIProperties - -Routine Description: - - Store the pointer to an CUIProperties interface. - -Arguments: - - pUIProperties - pointer to an CUIProperties interface. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CDocPropPage::SetUIProperties( - _In_ CUIProperties* pUIProperties - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pUIProperties, E_POINTER))) - { - m_pUIProperties = pUIProperties; - } - - ERR_ON_HR(hr); - return hr; -} - - -/*++ - -Routine Name: - - CDocPropPage::GetOemCUIPParam - -Routine Description: - - Retrieve the pointer to the OEMCUIPPARAM function. - -Arguments: - - ppOemCUIPParam - Address of a pointer that will be filled out with the POEMCUIPPARAM function. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CDocPropPage::GetOemCUIPParam( - _Outptr_ POEMCUIPPARAM* ppOemCUIPParam - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppOemCUIPParam, E_POINTER))) - { - *ppOemCUIPParam = m_pOemCUIPParam; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CDocPropPage::SetPrintOemDriverUI - -Routine Description: - - Store a pointer to the IPrintOemDriverUI interface. - -Arguments: - - pOEMDriverUI - pointer to the IPrintOemDriverUI interface. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CDocPropPage::SetPrintOemDriverUI( - _In_ CONST IPrintOemDriverUI* pOEMDriverUI - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pOEMDriverUI, E_POINTER))) - { - m_pDriverUIHelp = const_cast<IPrintOemDriverUI*>(pOEMDriverUI); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CDocPropPage::PublishHelpToControls - -Routine Description: - - Propagate any useful interfaces used in this class down to the collection of control handlers. - This allows access to these helper interfaces in the control handlers classes. - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CDocPropPage::PublishHelpToControls( - VOID - ) -{ - ASSERTMSG(m_pDriverUIHelp != NULL, "NULL pointer to driver UI help interface.\n"); - ASSERTMSG(m_pOemCUIPParam != NULL, "NULL pointer to OEMCUIPPARAM structure.\n"); - ASSERTMSG(m_pUIProperties != NULL, "NULL pointer to CUIProperties.\n"); - - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(m_pDriverUIHelp, E_PENDING)) && - SUCCEEDED(hr = CHECK_POINTER(m_pOemCUIPParam, E_PENDING)) && - SUCCEEDED(hr = CHECK_POINTER(m_pUIProperties, E_PENDING))) - { - try - { - // - // Iterate over all controls and report the helper interfaces - // - if (!m_UIControls.empty()) - { - UIControlMap::iterator iterUIComponents = m_UIControls.begin(); - - while (iterUIComponents != m_UIControls.end()) - { - CUIControl* pControl = iterUIComponents->second; - - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_POINTER)) && - SUCCEEDED(hr = pControl->SetPrintOemDriverUI(m_pDriverUIHelp)) && - SUCCEEDED(hr = pControl->SetUIProperties(m_pUIProperties)) && - SUCCEEDED(hr = pControl->SetOemCUIPParam(m_pOemCUIPParam))) - { - iterUIComponents++; - } - } - - } - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CDocPropPage::SendCommand - -Routine Description: - - Call the OnCommand() method in the relevant control handler in the collection. - -Arguments: - - hDlg - Handle of property page. - wParam - Windows WPARAM value passed with the windows message WM_COMMAND. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CDocPropPage::SendCommand( - _In_ CONST HWND hDlg, - _In_ CONST WPARAM wParam - ) -{ - // - // Use the wParam as the index into the control map and - // inform the control that generated the command - // - HRESULT hr = S_OK; - - UIControlMap* pComponents = NULL; - - if (SUCCEEDED(hr = GetUIComponents(&pComponents)) && - SUCCEEDED(hr = CHECK_POINTER(pComponents, E_POINTER))) - { - try - { - CUIControl* pControl = (*pComponents)[LOWORD(wParam)]; - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_POINTER))) - { - hr = pControl->OnCommand(hDlg, HIWORD(wParam)); - } - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CDocPropPage::SendNotify - -Routine Description: - - Call the OnNotify() method in the relevant control handler in the collection. - -Arguments: - - hDlg - Handle of property page. - pNMhdr - Windows Notify structure that was passed with the windows message WM_NOTIFY. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CDocPropPage::SendNotify( - _In_ CONST HWND hDlg, - _In_ CONST NMHDR* pNMhdr - ) -{ - // - // Use the wParam as the index into the control map and - // inform the control of an activation - // - HRESULT hr = S_OK; - - UIControlMap* pComponents = NULL; - - if (SUCCEEDED(hr = GetUIComponents(&pComponents)) && - SUCCEEDED(hr = CHECK_POINTER(pComponents, E_POINTER))) - { - try - { - CUIControl* pControl = (*pComponents)[pNMhdr->idFrom]; - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_POINTER))) - { - hr = pControl->OnNotify(hDlg, pNMhdr); - } - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CDocPropPage::SendSetActive - -Routine Description: - - Call the OnActivate() method in all control handlers in the collection. - -Arguments: - - hDlg - Handle of property page. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CDocPropPage::SendSetActive( - _In_ CONST HWND hDlg - ) -{ - // - // Use the wParam as the index into the control map and - // inform the control of an activation - // - HRESULT hr = S_OK; - - UIControlMap* pComponents = NULL; - - if (SUCCEEDED(hr = GetUIComponents(&pComponents)) && - SUCCEEDED(hr = CHECK_POINTER(pComponents, E_POINTER))) - { - try - { - UIControlMap::iterator iterUIComponents = pComponents->begin(); - - while (iterUIComponents != pComponents->end()) - { - CUIControl* pControl = iterUIComponents->second; - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_POINTER))) - { - if (FAILED(hr = pControl->OnActivate(hDlg))) - { - break; - } - } - - iterUIComponents++; - } - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CDocPropPage::SendInit - -Routine Description: - - Call the OnInit() method in all control handlers in the collection. - -Arguments: - - hDlg - Handle of property page. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CDocPropPage::SendInit( - _In_ CONST HWND hDlg - ) -{ - // - // Use the wParam as the index into the control map and - // inform the control of an activation - // - HRESULT hr = S_OK; - - UIControlMap* pComponents = NULL; - - if (SUCCEEDED(hr = GetUIComponents(&pComponents)) && - SUCCEEDED(hr = CHECK_POINTER(pComponents, E_POINTER))) - { - try - { - UIControlMap::iterator iterUIComponents = pComponents->begin(); - - while (iterUIComponents != pComponents->end()) - { - CUIControl* pControl = iterUIComponents->second; - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_POINTER))) - { - if (FAILED(hr = pControl->OnInit(hDlg))) - { - break; - } - } - - iterUIComponents++; - } - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CDocPropPage::DlgProc - -Routine Description: - - Dialog proccedure for the property page. - This handles all windows messages that are sent to the property page. - -Arguments: - - hDlg - Handle of the property page. - uiMessage - Specifies the message. - wParam - Specifies additional message-specific information. - lParam - Specifies additional message-specific information. - -Return Value: - - The return value is the result of the message processing and depends on the message sent. - ---*/ -INT_PTR CALLBACK -CDocPropPage::DlgProc( - _In_ CONST HWND hDlg, - _In_ CONST UINT uiMessage, - _In_ CONST WPARAM wParam, - _In_ CONST LPARAM lParam - ) -{ - HRESULT hr = S_OK; - BOOL retVal = FALSE; - - switch (uiMessage) - { - case WM_INITDIALOG: - { - // - // Store the class instance - // - PROPSHEETPAGE* pPage = reinterpret_cast<PROPSHEETPAGE*>(lParam); - - if (SUCCEEDED(hr = CHECK_POINTER(pPage, E_POINTER))) - { - if (pPage->lParam != NULL) - { - CDocPropPage* thisInst = reinterpret_cast<CDocPropPage*>(pPage->lParam); - - if (SUCCEEDED(hr = CHECK_POINTER(thisInst, E_FAIL))) - { - if (SUCCEEDED(hr = thisInst->StoreThis(hDlg))) - { - hr = thisInst->SendInit(hDlg); - } - } - } - else - { - hr = E_FAIL; - } - } - - // - // Set the keyboard focus to the control specified by wParam - // - retVal = TRUE; - } - break; - - case WM_COMMAND: - { - switch (HIWORD(wParam)) - { - case EN_CHANGE: - case BN_CLICKED: - case CBN_SELCHANGE: - // case LBN_SELCHANGE: CBN_SELCHANGE=LBN_SELCHANGE - { - CDocPropPage* thisInst; - - if (SUCCEEDED(hr = RetrieveThis(hDlg, &thisInst))) - { - if (SUCCEEDED(hr = CHECK_POINTER(thisInst, E_FAIL))) - { - hr = thisInst->SendCommand(hDlg, wParam); - } - } - - // - // Set to FALSE to indiate that the message has been handled. - // - retVal = FALSE; - } - break; - - default: - { - // - // Unhandled command so return TRUE - // - retVal = TRUE; - } - break; - } - } - break; - - case WM_NOTIFY: - { - NMHDR* pHdr = reinterpret_cast<NMHDR*>(lParam); - if (SUCCEEDED(hr = CHECK_POINTER(pHdr, E_POINTER))) - { - switch (pHdr->code) - { - case PSN_SETACTIVE: - { - CDocPropPage* thisInst; - - if (SUCCEEDED(hr = RetrieveThis(hDlg, &thisInst)) && - SUCCEEDED(hr = CHECK_POINTER(thisInst, E_FAIL))) - { - hr = thisInst->SendSetActive(hDlg); - } - - // - // Return FALSE to accept the page activation - // - retVal = FALSE; - } - break; - - case PSN_KILLACTIVE: - { - // - // Return FALSE to allow the page to lose activation - // - retVal = FALSE; - } - break; - - case PSN_APPLY: - { - PFNCOMPROPSHEET pfnComPropSheet = NULL; - - CDocPropPage* thisInst; - - if (SUCCEEDED(hr = RetrieveThis(hDlg, &thisInst)) && - SUCCEEDED(hr = CHECK_POINTER(thisInst, E_FAIL)) && - SUCCEEDED(hr = thisInst->GetComPropSheetFunc(&pfnComPropSheet)) && - SUCCEEDED(hr = CHECK_POINTER(pfnComPropSheet, E_FAIL))) - { - // - // Ensure that the last error is in a known state. - // - SetLastError(0); - - // - // We do not need to validate any settings so set PSNRET_NOERROR - // - if (SetWindowLongPtr(hDlg, DWLP_MSGRESULT, PSNRET_NOERROR) == 0) - { - // - // A return value of 0 does not necessarily indicate a failure. - // - hr = HRESULT_FROM_WIN32(GetLastError()); - } - - if (SUCCEEDED(hr)) - { - // - // We have applied the change... - // - PropSheet_UnChanged(GetParent(hDlg), hDlg); - - // - // Inform the propsheet - // - pfnComPropSheet(thisInst->GetComPropSheetHandle(), - CPSFUNC_SET_RESULT, - reinterpret_cast<LPARAM>(thisInst->GetPageHandle()), - (LPARAM)CPSUI_OK); - } - } - - retVal = TRUE; - } - break; - - case UDN_DELTAPOS: - { - CDocPropPage* thisInst; - - if (SUCCEEDED(hr = RetrieveThis(hDlg, &thisInst)) && - SUCCEEDED(hr = CHECK_POINTER(thisInst, E_FAIL))) - { - hr = thisInst->SendNotify(hDlg, pHdr); - } - - // - // Set return to FALSE to allow the control value - // - retVal = FALSE; - } - break; - } - } - } - break; - - case WM_NCDESTROY: - { - CDocPropPage* thisInst; - - if (SUCCEEDED(hr = CDocPropPage::RetrieveThis(hDlg, &thisInst)) && - SUCCEEDED(hr = CHECK_POINTER(thisInst, E_FAIL))) - { - hr = thisInst->RemoveThis(hDlg); - } - - // - // Set return to FALSE to indicate that the message was processed - // - retVal = FALSE; - } - break; - } - - ERR_ON_HR(hr); - return retVal; -} - diff --git a/print/XPSDrvSmpl/src/ui/docppg.h b/print/XPSDrvSmpl/src/ui/docppg.h deleted file mode 100644 index 1a6d1dc5..00000000 --- a/print/XPSDrvSmpl/src/ui/docppg.h +++ /dev/null @@ -1,186 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - docppg.h - -Abstract: - - Definition of the document property page class. This is an abstract - class that provides common functionality for all property pages including - accessors and the dialog proc. - ---*/ - -#pragma once - -#include "uictrl.h" - -#define ID_XDSMPL_DLG_ATOM 1000 - -typedef std::map<INT_PTR, CUIControl*> UIControlMap; - -class CDocPropPage -{ -public: - CDocPropPage(); - - virtual ~CDocPropPage(); - - virtual HRESULT - InitDlgBox( - _Out_ LPCTSTR* ppszTemplate, - _Out_ LPCTSTR* ppszTitle - ) = 0; - - // - // Implementation - // - virtual HRESULT - PropPageInit( - _In_ CONST PPROPSHEETUI_INFO pPSUIInfo - ); - - virtual HRESULT - SetPrintOemDriverUI( - _In_ CONST IPrintOemDriverUI* pOEMDriverUI - ); - - virtual HRESULT - SetOemCUIPParam( - _In_ CONST POEMCUIPPARAM pOemCUIParam - ); - - virtual HRESULT - SetUIProperties( - _In_ CUIProperties* pUIProperties - ); - - static INT_PTR CALLBACK - DlgProc( - _In_ HWND hDlg, - _In_ UINT uiMessage, - _In_ WPARAM wParam, - _In_ LPARAM lParam - ); - -protected: - HRESULT - StoreThis( - _In_ CONST HWND hDlg - ); - - static HRESULT - RetrieveThis( - _In_ CONST HWND hDlg, - _Outptr_ CDocPropPage** pDocPropPage - ); - - HRESULT - RemoveThis( - _In_ CONST HWND hDlg - ); - - HRESULT - SetComPropSheetFunc( - _In_ CONST PFNCOMPROPSHEET pfnComPropSheet - ); - - HRESULT - SetPageHandle( - _In_ CONST HANDLE hPage - ); - - HRESULT - SetComPropSheetHandle( - _In_ CONST HANDLE hComPropSheet - ); - - HRESULT - GetComPropSheetFunc( - _Outptr_ PFNCOMPROPSHEET* ppfnComPropSheet - ); - - HANDLE - GetPageHandle( - VOID - ); - - HANDLE - GetComPropSheetHandle( - VOID - ); - - HRESULT - AddUIControl( - _In_ CONST INT iCtrlID, - _In_ CUIControl* pUIControl - ); - - HRESULT - GetUIComponents( - _Outptr_ UIControlMap** ppUIComponents - ); - - HRESULT - GetOemCUIPParam( - _Outptr_ POEMCUIPPARAM* ppOemCUIPParam - ); - - HRESULT - PublishHelpToControls( - VOID - ); - - HRESULT - SendCommand( - _In_ CONST HWND hDlg, - _In_ CONST WPARAM wParam - ); - - HRESULT - SendSetActive( - _In_ CONST HWND hDlg - ); - - HRESULT - SendInit( - _In_ CONST HWND hDlg - ); - - HRESULT - SendNotify( - _In_ CONST HWND hDlg, - _In_ CONST NMHDR* pNMhdr - ); - - HRESULT - DestroyUIComponents( - VOID - ); - -private: - UIControlMap m_UIControls; - - CComPtr<IPrintOemDriverUI> m_pDriverUIHelp; - - HANDLE m_hPage; - - HANDLE m_hComPropSheet; - - PFNCOMPROPSHEET m_pfnComPropSheet; - - POEMCUIPPARAM m_pOemCUIPParam; - - CUIProperties* m_pUIProperties; -}; - diff --git a/print/XPSDrvSmpl/src/ui/ftrctrls.cpp b/print/XPSDrvSmpl/src/ui/ftrctrls.cpp deleted file mode 100644 index 94923e9a..00000000 --- a/print/XPSDrvSmpl/src/ui/ftrctrls.cpp +++ /dev/null @@ -1,1667 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - ftrctrls.cpp - -Abstract: - - Implementation of the features property page UI controls. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "resource.h" -#include "ftrctrls.h" -#include "privatedefs.h" - -PCSTR CUICtrlFeatPgScaleCombo::m_pszFeatPgScale = "PageScaling"; - -PCSTR CUICtrlFeatScaleOffsetCombo::m_pszFeatScaleOffset = "ScaleOffsetAlignment"; - -PCSTR CUICtrlFeatPgScaleXEdit::m_pszFeatPgScaleX = "PageScalingScaleWidth"; -PCSTR CUICtrlFeatPgScaleXSpin::m_pszFeatPgScaleX = "PageScalingScaleWidth"; -PCSTR CUICtrlFeatPgScaleYEdit::m_pszFeatPgScaleY = "PageScalingScaleHeight"; -PCSTR CUICtrlFeatPgScaleYSpin::m_pszFeatPgScaleY = "PageScalingScaleHeight"; -PCSTR CUICtrlFeatPgOffsetXEdit::m_pszFeatPgOffsetX = "PageScalingOffsetWidth"; -PCSTR CUICtrlFeatPgOffsetXSpin::m_pszFeatPgOffsetX = "PageScalingOffsetWidth"; -PCSTR CUICtrlFeatPgOffsetYEdit::m_pszFeatPgOffsetY = "PageScalingOffsetHeight"; -PCSTR CUICtrlFeatPgOffsetYSpin::m_pszFeatPgOffsetY = "PageScalingOffsetHeight"; - -PCSTR CUICtrlFeatNUpCombo::m_pszFeatNUp = "DocumentNUp"; -PCSTR CUICtrlFeatNUpOrderCombo::m_pszFeatNUpOrder = "DocumentNUpPresentationOrder"; - -PCSTR CUICtrlFeatDocDuplexCombo::m_pszFeatDocDuplex = "DocumentDuplex"; -PCSTR CUICtrlFeatPhotIntCombo::m_pszFeatPhotInt = "PagePhotoPrintingIntent"; -PCSTR CUICtrlFeatBordersCheck::m_pszFeatBorders = "PageBorderless"; - -PCSTR CUICtrlFeatJobBindCombo::m_pszFeatJobBind = "JobBindAllDocuments"; -PCSTR CUICtrlFeatDocBindCombo::m_pszFeatDocBind = "DocumentBinding"; - -#define PGSCALE_NONE_SEL 0 -#define PGSCALE_CUSTOM_SEL 1 -#define PGSCALE_CUSTSQUARE_SEL 2 -#define PGSCALE_FITBLEED_SEL 3 -#define PGSCALE_FITCONTENT_SEL 4 -#define PGSCALE_FITPAGE_SEL 5 -#define PGSCALE_SCALEPAGETOPAGE_SEL 6 - -#define JOBBIND_NONE_SEL 0 - -// -// Page scale selection combo box control -// -/*++ - -Routine Name: - - CUICtrlFeatPgScaleCombo::CUICtrlFeatPgScaleCombo - -Routine Description: - - CUICtrlFeatPgScaleCombo class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlFeatPgScaleCombo::CUICtrlFeatPgScaleCombo() : - CUICtrlDefaultCombo(m_pszFeatPgScale, IDC_COMBO_PGSCALE) -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatPgScaleCombo::~CUICtrlFeatPgScaleCombo - -Routine Description: - - CUICtrlFeatPgScaleCombo class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlFeatPgScaleCombo::~CUICtrlFeatPgScaleCombo() -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatPgScaleCombo::OnInit - -Routine Description: - - This is responsible for initialising the control and is called when - the WM_INITDIALOG message is recieved. This method populates the combo - box with the appropriate option strings. - -Arguments: - - hDlg - handle to the parent window - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlFeatPgScaleCombo::OnInit( - _In_ CONST HWND hDlg - ) -{ - HRESULT hr = S_OK; - - // - // Populate the combo box - // - if (SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_NONE)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_CUSTOM)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_CUSTSQUARE)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_FITBLEED)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_FITCONTENT)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_FITPAGE))) - { - hr = AddString(hDlg, g_hInstance, IDS_GPD_SCALEPAGETOPAGE); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUICtrlFeatPgScaleCombo::EnableDependentCtrls - -Routine Description: - - This method is used to enable or disable other controls in the UI based on the - current combo box selection. - -Arguments: - - hDlg - handle to the parent window - lSel - current combo box selection - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlFeatPgScaleCombo::EnableDependentCtrls( - _In_ CONST HWND hDlg, - _In_ CONST LONG lSel - ) -{ - HRESULT hr = S_OK; - HWND hWnd = NULL; - - BOOL bNone = (lSel == PGSCALE_NONE_SEL); - BOOL bCustom = (lSel == PGSCALE_CUSTOM_SEL); - BOOL bCustomSquare = (lSel == PGSCALE_CUSTSQUARE_SEL); - BOOL bFit = !(bCustom | bCustomSquare) && !bNone; - - // - // Here we are enabling/disabling and showing/hiding the page scale controls - // based on the currently selected options. - // - // If custom scaling is selected we need to enable and show the X/Y offset and X/Y - // scaling controls and hide the "fit to" options. If we custom square scaling is - // selected we show the same controls as custom scaling but disable the Y scaling - // control so the user can only apply the scale in one dimension. - // - // If one of the "fit to" options (FitApplicationBleedSizeToPageImageableSize etc.) - // is selected we disable and hide the custom controls (X/Y offset and scale) and enable - // the offset alignment option control. - // - if (SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_EDIT_PGSCALEX), E_HANDLE))) - { - EnableWindow(hWnd, bCustom | bCustomSquare); - ShowWindow(hWnd, (bCustom | bCustomSquare | bNone) ? SW_SHOW : SW_HIDE); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_SPIN_PGSCALEX), E_HANDLE))) - { - EnableWindow(hWnd, bCustom | bCustomSquare); - ShowWindow(hWnd, (bCustom | bCustomSquare | bNone) ? SW_SHOW : SW_HIDE); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_TXT_PGSCALEX), E_HANDLE))) - { - EnableWindow(hWnd, bCustom | bCustomSquare); - ShowWindow(hWnd, (bCustom | bCustomSquare | bNone) ? SW_SHOW : SW_HIDE); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_EDIT_PGSCALEY), E_HANDLE))) - { - EnableWindow(hWnd, bCustom); - ShowWindow(hWnd, (bCustom | bCustomSquare | bNone) ? SW_SHOW : SW_HIDE); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_SPIN_PGSCALEY), E_HANDLE))) - { - EnableWindow(hWnd, bCustom); - ShowWindow(hWnd, (bCustom | bCustomSquare | bNone) ? SW_SHOW : SW_HIDE); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_TXT_PGSCALEY), E_HANDLE))) - { - EnableWindow(hWnd, bCustom); - ShowWindow(hWnd, (bCustom | bCustomSquare | bNone) ? SW_SHOW : SW_HIDE); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_EDIT_PGOFFX), E_HANDLE))) - { - EnableWindow(hWnd, bCustom | bCustomSquare); - ShowWindow(hWnd, (bCustom | bCustomSquare | bNone) ? SW_SHOW : SW_HIDE); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_SPIN_PGOFFX), E_HANDLE))) - { - EnableWindow(hWnd, bCustom | bCustomSquare); - ShowWindow(hWnd, (bCustom | bCustomSquare | bNone) ? SW_SHOW : SW_HIDE); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_TXT_PGOFFX), E_HANDLE))) - { - EnableWindow(hWnd, bCustom | bCustomSquare); - ShowWindow(hWnd, (bCustom | bCustomSquare | bNone) ? SW_SHOW : SW_HIDE); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_EDIT_PGOFFY), E_HANDLE))) - { - EnableWindow(hWnd, bCustom | bCustomSquare); - ShowWindow(hWnd, (bCustom | bCustomSquare | bNone) ? SW_SHOW : SW_HIDE); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_SPIN_PGOFFY), E_HANDLE))) - { - EnableWindow(hWnd, bCustom | bCustomSquare); - ShowWindow(hWnd, (bCustom | bCustomSquare | bNone) ? SW_SHOW : SW_HIDE); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_TXT_PGOFFY), E_HANDLE))) - { - EnableWindow(hWnd, bCustom | bCustomSquare); - ShowWindow(hWnd, (bCustom | bCustomSquare | bNone) ? SW_SHOW : SW_HIDE); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_COMBO_SCALEOFF), E_HANDLE))) - { - EnableWindow(hWnd, bFit); - ShowWindow(hWnd, bFit ? SW_SHOW : SW_HIDE); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_TXT_SCALEOFF), E_HANDLE))) - { - EnableWindow(hWnd, bFit); - ShowWindow(hWnd, bFit ? SW_SHOW : SW_HIDE); - } - - if (FAILED(hr)) - { - hr = HRESULT_FROM_WIN32(GetLastError()); - } - - ERR_ON_HR(hr); - return hr; -} - -// -// Page scale selection combo box control -// -/*++ - -Routine Name: - - CUICtrlFeatScaleOffsetCombo::CUICtrlFeatScaleOffsetCombo - -Routine Description: - - CUICtrlFeatScaleOffsetCombo class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlFeatScaleOffsetCombo::CUICtrlFeatScaleOffsetCombo() : - CUICtrlDefaultCombo(m_pszFeatScaleOffset, IDC_COMBO_SCALEOFF) -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatScaleOffsetCombo::~CUICtrlFeatScaleOffsetCombo - -Routine Description: - - CUICtrlFeatScaleOffsetCombo class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlFeatScaleOffsetCombo::~CUICtrlFeatScaleOffsetCombo() -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatScaleOffsetCombo::OnInit - -Routine Description: - - This is responsible for initialising the control and is called when - the WM_INITDIALOG message is recieved. This method populates the combo - box with the appropriate option strings. - -Arguments: - - hDlg - handle to the parent window - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlFeatScaleOffsetCombo::OnInit( - _In_ CONST HWND hDlg - ) -{ - HRESULT hr = S_OK; - - // - // Populate the combo box - // - if (SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_SCALE_ALIGN_BC)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_SCALE_ALIGN_BL)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_SCALE_ALIGN_BR)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_SCALE_ALIGN_CC)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_SCALE_ALIGN_LC)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_SCALE_ALIGN_CR)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_SCALE_ALIGN_CT)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_SCALE_ALIGN_TL))) - { - hr = AddString(hDlg, g_hInstance, IDS_GPD_SCALE_ALIGN_TR); - } - - ERR_ON_HR(hr); - return hr; -} - -#define NUP_1PPS_SEL 0 - -// -// NUp page per sheet combo box control -// -/*++ - -Routine Name: - - CUICtrlFeatNUpCombo::CUICtrlFeatNUpCombo - -Routine Description: - - CUICtrlFeatNUpCombo class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlFeatNUpCombo::CUICtrlFeatNUpCombo() : - CUICtrlDefaultCombo(m_pszFeatNUp, IDC_COMBO_NUP) -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatNUpCombo::~CUICtrlFeatNUpCombo - -Routine Description: - - CUICtrlFeatNUpCombo class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlFeatNUpCombo::~CUICtrlFeatNUpCombo() -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatNUpCombo::OnInit - -Routine Description: - - This is responsible for initialising the control and is called when - the WM_INITDIALOG message is recieved. This method populates the combo - box with the appropriate option strings. - -Arguments: - - hDlg - handle to the parent window - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlFeatNUpCombo::OnInit( - _In_ CONST HWND hDlg - ) -{ - HRESULT hr = S_OK; - - // - // Populate the combo box - // - if (SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_1PPS)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_2PPS)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_4PPS)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_6PPS)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_8PPS)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_9PPS))) - { - hr = AddString(hDlg, g_hInstance, IDS_GPD_16PPS); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUICtrlFeatNUpCombo::EnableDependentCtrls - -Routine Description: - - This method is used to enable or disable other controls in the UI based on the - current combo box selection. - -Arguments: - - hDlg - handle to the parent window - lSel - current combo box selection - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlFeatNUpCombo::EnableDependentCtrls( - _In_ CONST HWND hDlg, - _In_ CONST LONG lSel - ) -{ - HRESULT hr = S_OK; - HWND hWnd = NULL; - - // - // Here we are enabling/disabling the NUp and Binding controls depending on the current - // NUp selection. - // - // When NUp is more than 1 page per sheet we enable the NUp order controls and disable - // binding option controls. - // - if (SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_COMBO_NUP_ORDER), E_HANDLE))) - { - EnableWindow(hWnd, lSel > NUP_1PPS_SEL); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_TXT_NUP_ORDER), E_HANDLE))) - { - EnableWindow(hWnd, lSel > NUP_1PPS_SEL); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_COMBO_JOBBIND), E_HANDLE))) - { - EnableWindow(hWnd, lSel == NUP_1PPS_SEL); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_TXT_JOBBIND), E_HANDLE))) - { - EnableWindow(hWnd, lSel == NUP_1PPS_SEL); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_COMBO_DOCBIND), E_HANDLE))) - { - EnableWindow(hWnd, lSel == NUP_1PPS_SEL); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_TXT_DOCBIND), E_HANDLE))) - { - EnableWindow(hWnd, lSel == NUP_1PPS_SEL); - } - - if (FAILED(hr)) - { - hr = HRESULT_FROM_WIN32(GetLastError()); - } - - ERR_ON_HR(hr); - return hr; -} - -// -// NUp presentation order combo box control -// -/*++ - -Routine Name: - - CUICtrlFeatNUpOrderCombo::CUICtrlFeatNUpOrderCombo - -Routine Description: - - CUICtrlFeatNUpOrderCombo class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlFeatNUpOrderCombo::CUICtrlFeatNUpOrderCombo() : - CUICtrlDefaultCombo(m_pszFeatNUpOrder, IDC_COMBO_NUP_ORDER) -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatNUpOrderCombo::~CUICtrlFeatNUpOrderCombo - -Routine Description: - - CUICtrlFeatNUpOrderCombo class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlFeatNUpOrderCombo::~CUICtrlFeatNUpOrderCombo() -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatNUpOrderCombo::OnInit - -Routine Description: - - This is responsible for initialising the control and is called when - the WM_INITDIALOG message is recieved. This method populates the combo - box with the appropriate option strings. - -Arguments: - - hDlg - handle to the parent window - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlFeatNUpOrderCombo::OnInit( - _In_ CONST HWND hDlg - ) -{ - HRESULT hr = S_OK; - - // - // Populate the combo box - // - if (SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_LTORTTOB)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_TTOBLTOR)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_RTOLTTOB)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_TTOBRTOL)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_LTORBTOT)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_BTOTLTOR)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_RTOLBTOT))) - { - hr = AddString(hDlg, g_hInstance, IDS_GPD_BTOTRTOL); - } - - ERR_ON_HR(hr); - return hr; -} - -// -// Binding combo box control -// -/*++ - -Routine Name: - - CUICtrlFeatJobBindCombo::CUICtrlFeatJobBindCombo - -Routine Description: - - CUICtrlFeatJobBindCombo class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlFeatJobBindCombo::CUICtrlFeatJobBindCombo() : - CUICtrlDefaultCombo(m_pszFeatJobBind, IDC_COMBO_JOBBIND) -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatJobBindCombo::~CUICtrlFeatJobBindCombo - -Routine Description: - - CUICtrlFeatJobBindCombo class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlFeatJobBindCombo::~CUICtrlFeatJobBindCombo() -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatJobBindCombo::OnInit - -Routine Description: - - This is responsible for initialising the control and is called when - the WM_INITDIALOG message is recieved. This method populates the combo - box with the appropriate option strings. - -Arguments: - - hDlg - handle to the parent window - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlFeatJobBindCombo::OnInit( - _In_ CONST HWND hDlg - ) -{ - HRESULT hr = S_OK; - // - // Populate the combo box - // - if (SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_NONE)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_LTOR)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_RTOL)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_TTOB))) - { - hr = AddString(hDlg, g_hInstance, IDS_GPD_BTOT); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUICtrlFeatJobBindCombo::EnableDependentCtrls - -Routine Description: - - This method is used to enable or disable other controls in the UI based on the - current combo box selection. - -Arguments: - - hDlg - handle to the parent window - lSel - current combo box selection - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlFeatJobBindCombo::EnableDependentCtrls( - _In_ CONST HWND hDlg, - _In_ CONST LONG lSel - ) -{ - HRESULT hr = S_OK; - HWND hWnd = NULL; - - // - // Here we are enabling/disabling binding and NUp controls based off the current - // binding option. - // - // If JobBindAllDocuments option is selected we disable DocumentBinding and NUp controls. - // - if (SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_COMBO_DOCBIND), E_HANDLE))) - { - EnableWindow(hWnd, (lSel == JOBBIND_NONE_SEL)); - } - - if (SUCCEEDED(hr) && - (SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_TXT_DOCBIND), E_HANDLE)))) - { - EnableWindow(hWnd, (lSel == JOBBIND_NONE_SEL)); - } - - if (SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_COMBO_NUP), E_HANDLE))) - { - EnableWindow(hWnd, (lSel == JOBBIND_NONE_SEL)); - } - - if (SUCCEEDED(hr) && - (SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_TXT_NUP), E_HANDLE)))) - { - EnableWindow(hWnd, (lSel == JOBBIND_NONE_SEL)); - } - - if (SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_TXT_NUP_ORDER), E_HANDLE))) - { - EnableWindow(hWnd, (lSel == JOBBIND_NONE_SEL)); - } - - if (SUCCEEDED(hr) && - (SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_COMBO_NUP_ORDER), E_HANDLE)))) - { - EnableWindow(hWnd, (lSel == JOBBIND_NONE_SEL)); - } - - if (FAILED(hr)) - { - hr = HRESULT_FROM_WIN32(GetLastError()); - } - - ERR_ON_HR(hr); - return hr; -} - -// -// Binding Direction combo box control -// -/*++ - -Routine Name: - - CUICtrlFeatDocBindCombo::CUICtrlFeatDocBindCombo - -Routine Description: - - CUICtrlFeatDocBindCombo class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlFeatDocBindCombo::CUICtrlFeatDocBindCombo() : - CUICtrlDefaultCombo(m_pszFeatDocBind, IDC_COMBO_DOCBIND) -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatDocBindCombo::~CUICtrlFeatDocBindCombo - -Routine Description: - - CUICtrlFeatDocBindCombo class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlFeatDocBindCombo::~CUICtrlFeatDocBindCombo() -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatDocBindCombo::OnInit - -Routine Description: - - This is responsible for initialising the control and is called when - the WM_INITDIALOG message is recieved. This method populates the combo - box with the appropriate option strings. - -Arguments: - - hDlg - handle to the parent window - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlFeatDocBindCombo::OnInit( - _In_ CONST HWND hDlg - ) -{ - HRESULT hr = S_OK; - // - // Populate the combo box - // - if (SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_NONE)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_LTOR)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_RTOL)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_TTOB))) - { - hr = AddString(hDlg, g_hInstance, IDS_GPD_BTOT); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUICtrlFeatDocBindCombo::EnableDependentCtrls - -Routine Description: - - This method is used to enable or disable other controls in the UI based on the - current combo box selection. - -Arguments: - - hDlg - handle to the parent window - lSel - current combo box selection - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlFeatDocBindCombo::EnableDependentCtrls( - _In_ CONST HWND hDlg, - _In_ CONST LONG lSel - ) -{ - HRESULT hr = S_OK; - HWND hWnd = NULL; - - // - // Here we are enabling/disabling binding and NUp controls based off the current - // DocumentBinding option. - // - // If DocumentBinding option is selected we disable JobBindAllDocuments and NUp controls. - // - if (SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_COMBO_NUP), E_HANDLE))) - { - EnableWindow(hWnd, (lSel == JOBBIND_NONE_SEL)); - } - - if (SUCCEEDED(hr) && - (SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_TXT_NUP), E_HANDLE)))) - { - EnableWindow(hWnd, (lSel == JOBBIND_NONE_SEL)); - } - - if (SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_TXT_NUP_ORDER), E_HANDLE))) - { - EnableWindow(hWnd, (lSel == JOBBIND_NONE_SEL)); - } - - if (SUCCEEDED(hr) && - (SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_COMBO_NUP_ORDER), E_HANDLE)))) - { - EnableWindow(hWnd, (lSel == JOBBIND_NONE_SEL)); - } - - if (FAILED(hr)) - { - hr = HRESULT_FROM_WIN32(GetLastError()); - } - - ERR_ON_HR(hr); - return hr; -} - -// -// Document photo printing intent combo box control -// -/*++ - -Routine Name: - - CUICtrlFeatPhotIntCombo::CUICtrlFeatPhotIntCombo - -Routine Description: - - CUICtrlFeatPhotIntCombo class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlFeatPhotIntCombo::CUICtrlFeatPhotIntCombo() : - CUICtrlDefaultCombo(m_pszFeatPhotInt, IDC_COMBO_PHOTO_INTENT) -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatPhotIntCombo::~CUICtrlFeatPhotIntCombo - -Routine Description: - - CUICtrlFeatPhotIntCombo class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlFeatPhotIntCombo::~CUICtrlFeatPhotIntCombo() -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatPhotIntCombo::OnInit - -Routine Description: - - This is responsible for initialising the control and is called when - the WM_INITDIALOG message is recieved. This method populates the combo - box with the appropriate option strings. - -Arguments: - - hDlg - handle to the parent window - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlFeatPhotIntCombo::OnInit( - _In_ CONST HWND hDlg - ) -{ - HRESULT hr = S_OK; - - // - // Populate the combo box - // - if (SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_NONE)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_BEST)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_DRAFT))) - { - hr = AddString(hDlg, g_hInstance, IDS_GPD_STANDARD); - } - - ERR_ON_HR(hr); - return hr; -} - -// -// Document duplex combo box control -// -/*++ - -Routine Name: - - CUICtrlFeatDocDuplexCombo::CUICtrlFeatDocDuplexCombo - -Routine Description: - - CUICtrlFeatDocDuplexCombo class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlFeatDocDuplexCombo::CUICtrlFeatDocDuplexCombo() : - CUICtrlDefaultCombo(m_pszFeatDocDuplex, IDC_COMBO_DOCDUPLEX) -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatDocDuplexCombo::~CUICtrlFeatDocDuplexCombo - -Routine Description: - - CUICtrlFeatDocDuplexCombo class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlFeatDocDuplexCombo::~CUICtrlFeatDocDuplexCombo() -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatDocDuplexCombo::OnInit - -Routine Description: - - This is responsible for initialising the control and is called when - the WM_INITDIALOG message is recieved. This method populates the combo - box with the appropriate option strings. - -Arguments: - - hDlg - handle to the parent window - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlFeatDocDuplexCombo::OnInit( - _In_ CONST HWND hDlg - ) -{ - HRESULT hr = S_OK; - // - // Populate the combo box - // - if (SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_NONE))&& - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_HORIZONTAL))) - { - hr = AddString(hDlg, g_hInstance, IDS_GPD_VERTICAL); - } - - ERR_ON_HR(hr); - return hr; -} - -// -// Document duplex combo box control -// -/*++ - -Routine Name: - - CUICtrlFeatPgScaleXEdit::CUICtrlFeatPgScaleXEdit - -Routine Description: - - CUICtrlFeatPgScaleXEdit class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlFeatPgScaleXEdit::CUICtrlFeatPgScaleXEdit() : - CUICtrlDefaultEditNum(m_pszFeatPgScaleX, - IDC_EDIT_PGSCALEX, - pgscParamDefIntegers[ePageScalingScaleWidth].min_length, - pgscParamDefIntegers[ePageScalingScaleWidth].max_length, - IDC_SPIN_PGSCALEX) -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatPgScaleXEdit::~CUICtrlFeatPgScaleXEdit - -Routine Description: - - CUICtrlFeatPgScaleXEdit class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlFeatPgScaleXEdit::~CUICtrlFeatPgScaleXEdit() -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatPgScaleXSpin::CUICtrlFeatPgScaleXSpin - -Routine Description: - - CUICtrlFeatPgScaleXSpin class constructor - -Arguments: - - pEdit - Pointer to the edit num buddy control - -Return Value: - - None - ---*/ -CUICtrlFeatPgScaleXSpin::CUICtrlFeatPgScaleXSpin( - _In_ CUICtrlDefaultEditNum* pEdit - ) : - CUICtrlDefaultSpin(pEdit) -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatPgScaleXSpin::~CUICtrlFeatPgScaleXSpin - -Routine Description: - - CUICtrlFeatPgScaleXSpin class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlFeatPgScaleXSpin::~CUICtrlFeatPgScaleXSpin() -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatPgScaleYEdit::CUICtrlFeatPgScaleYEdit - -Routine Description: - - CUICtrlFeatPgScaleYEdit class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlFeatPgScaleYEdit::CUICtrlFeatPgScaleYEdit() : - CUICtrlDefaultEditNum(m_pszFeatPgScaleY, - IDC_EDIT_PGSCALEY, - pgscParamDefIntegers[ePageScalingScaleHeight].min_length, - pgscParamDefIntegers[ePageScalingScaleHeight].max_length, - IDC_SPIN_PGSCALEY) -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatPgScaleYEdit::~CUICtrlFeatPgScaleYEdit - -Routine Description: - - CUICtrlFeatPgScaleYEdit class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlFeatPgScaleYEdit::~CUICtrlFeatPgScaleYEdit() -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatPgScaleYSpin::CUICtrlFeatPgScaleYSpin - -Routine Description: - - CUICtrlFeatPgScaleYSpin class constructor - -Arguments: - - pEdit - Pointer to the edit num buddy control - -Return Value: - - None - ---*/ -CUICtrlFeatPgScaleYSpin::CUICtrlFeatPgScaleYSpin( - _In_ CUICtrlDefaultEditNum* pEdit - ) : - CUICtrlDefaultSpin(pEdit) -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatPgScaleYSpin::~CUICtrlFeatPgScaleYSpin - -Routine Description: - - CUICtrlFeatPgScaleYSpin class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlFeatPgScaleYSpin::~CUICtrlFeatPgScaleYSpin() -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatPgOffsetXEdit::CUICtrlFeatPgOffsetXEdit - -Routine Description: - - CUICtrlFeatPgOffsetXEdit class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlFeatPgOffsetXEdit::CUICtrlFeatPgOffsetXEdit() : - CUICtrlDefaultEditNum(m_pszFeatPgOffsetX, - IDC_EDIT_PGOFFX, - MICRON_TO_HUNDREDTH_OFINCH(pgscParamDefIntegers[ePageScalingOffsetWidth].min_length), - MICRON_TO_HUNDREDTH_OFINCH(pgscParamDefIntegers[ePageScalingOffsetWidth].max_length), - IDC_SPIN_PGOFFX) -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatPgOffsetXEdit::~CUICtrlFeatPgOffsetXEdit - -Routine Description: - - CUICtrlFeatPgOffsetXEdit class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlFeatPgOffsetXEdit::~CUICtrlFeatPgOffsetXEdit() -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatPgOffsetXSpin::CUICtrlFeatPgOffsetXSpin - -Routine Description: - - CUICtrlFeatPgOffsetXSpin class constructor - -Arguments: - - pEdit - Pointer to the edit num buddy control - -Return Value: - - None - ---*/ -CUICtrlFeatPgOffsetXSpin::CUICtrlFeatPgOffsetXSpin( - _In_ CUICtrlDefaultEditNum* pEdit - ) : - CUICtrlDefaultSpin(pEdit) -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatPgOffsetXSpin::~CUICtrlFeatPgOffsetXSpin - -Routine Description: - - CUICtrlFeatPgOffsetXSpin class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlFeatPgOffsetXSpin::~CUICtrlFeatPgOffsetXSpin() -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatPgOffsetYEdit::CUICtrlFeatPgOffsetYEdit - -Routine Description: - - CUICtrlFeatPgOffsetYEdit class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlFeatPgOffsetYEdit::CUICtrlFeatPgOffsetYEdit() : - CUICtrlDefaultEditNum(m_pszFeatPgOffsetY, - IDC_EDIT_PGOFFY, - MICRON_TO_HUNDREDTH_OFINCH(pgscParamDefIntegers[ePageScalingOffsetHeight].min_length), - MICRON_TO_HUNDREDTH_OFINCH(pgscParamDefIntegers[ePageScalingOffsetHeight].max_length), - IDC_SPIN_PGOFFY) -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatPgOffsetYEdit::~CUICtrlFeatPgOffsetYEdit - -Routine Description: - - CUICtrlFeatPgOffsetYEdit class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlFeatPgOffsetYEdit::~CUICtrlFeatPgOffsetYEdit() -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatPgOffsetYSpin::CUICtrlFeatPgOffsetYSpin - -Routine Description: - - CUICtrlFeatPgOffsetYSpin class constructor - -Arguments: - - pEdit - Pointer to the edit num buddy control - -Return Value: - - None - ---*/ -CUICtrlFeatPgOffsetYSpin::CUICtrlFeatPgOffsetYSpin( - _In_ CUICtrlDefaultEditNum* pEdit - ) : - CUICtrlDefaultSpin(pEdit) -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatPgOffsetYSpin::~CUICtrlFeatPgOffsetYSpin - -Routine Description: - - CUICtrlFeatPgOffsetYSpin class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlFeatPgOffsetYSpin::~CUICtrlFeatPgOffsetYSpin() -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatBordersCheck::CUICtrlFeatBordersCheck - -Routine Description: - - CUICtrlFeatBordersCheck class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlFeatBordersCheck::CUICtrlFeatBordersCheck() : - CUICtrlDefaultCheck(m_pszFeatBorders, IDC_CHECK_BORDERLESS) -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatBordersCheck::~CUICtrlFeatBordersCheck - -Routine Description: - - CUICtrlFeatBordersCheck class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlFeatBordersCheck::~CUICtrlFeatBordersCheck() -{ -} - diff --git a/print/XPSDrvSmpl/src/ui/ftrctrls.h b/print/XPSDrvSmpl/src/ui/ftrctrls.h deleted file mode 100644 index 6351bb49..00000000 --- a/print/XPSDrvSmpl/src/ui/ftrctrls.h +++ /dev/null @@ -1,288 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - ftrctrls.h - -Abstract: - - Definition of the features property page UI controls. - ---*/ - -#pragma once - -#include "uictrl.h" - -class CUICtrlFeatPgScaleCombo : public CUICtrlDefaultCombo -{ -public: - CUICtrlFeatPgScaleCombo(); - - virtual ~CUICtrlFeatPgScaleCombo(); - - HRESULT - OnInit( - _In_ CONST HWND hDlg - ); - -private: - HRESULT - EnableDependentCtrls( - _In_ CONST HWND hDlg, - _In_ CONST LONG lSel - ); - -private: - static PCSTR m_pszFeatPgScale; -}; - -class CUICtrlFeatScaleOffsetCombo : public CUICtrlDefaultCombo -{ -public: - CUICtrlFeatScaleOffsetCombo(); - - virtual ~CUICtrlFeatScaleOffsetCombo(); - - HRESULT - OnInit( - _In_ CONST HWND hDlg - ); - -private: - static PCSTR m_pszFeatScaleOffset; -}; - -class CUICtrlFeatPgScaleXEdit : public CUICtrlDefaultEditNum -{ -public: - CUICtrlFeatPgScaleXEdit(); - - virtual ~CUICtrlFeatPgScaleXEdit(); - -private: - static PCSTR m_pszFeatPgScaleX; -}; - -class CUICtrlFeatPgScaleXSpin : public CUICtrlDefaultSpin -{ -public: - CUICtrlFeatPgScaleXSpin( - _In_ CUICtrlDefaultEditNum* pEdit - ); - - virtual ~CUICtrlFeatPgScaleXSpin(); - -private: - static PCSTR m_pszFeatPgScaleX; -}; - -class CUICtrlFeatPgOffsetXEdit : public CUICtrlDefaultEditNum -{ -public: - CUICtrlFeatPgOffsetXEdit(); - - virtual ~CUICtrlFeatPgOffsetXEdit(); - -private: - static PCSTR m_pszFeatPgOffsetX; -}; - -class CUICtrlFeatPgOffsetXSpin : public CUICtrlDefaultSpin -{ -public: - CUICtrlFeatPgOffsetXSpin( - _In_ CUICtrlDefaultEditNum* pEdit - ); - - virtual ~CUICtrlFeatPgOffsetXSpin(); - -private: - static PCSTR m_pszFeatPgOffsetX; -}; - -class CUICtrlFeatPgScaleYEdit : public CUICtrlDefaultEditNum -{ -public: - CUICtrlFeatPgScaleYEdit(); - - virtual ~CUICtrlFeatPgScaleYEdit(); - -private: - static PCSTR m_pszFeatPgScaleY; -}; - -class CUICtrlFeatPgScaleYSpin : public CUICtrlDefaultSpin -{ -public: - CUICtrlFeatPgScaleYSpin( - _In_ CUICtrlDefaultEditNum* pEdit - ); - - virtual ~CUICtrlFeatPgScaleYSpin(); - -private: - static PCSTR m_pszFeatPgScaleY; -}; - -class CUICtrlFeatPgOffsetYEdit : public CUICtrlDefaultEditNum -{ -public: - CUICtrlFeatPgOffsetYEdit(); - - virtual ~CUICtrlFeatPgOffsetYEdit(); - -private: - static PCSTR m_pszFeatPgOffsetY; -}; - -class CUICtrlFeatPgOffsetYSpin : public CUICtrlDefaultSpin -{ -public: - CUICtrlFeatPgOffsetYSpin( - _In_ CUICtrlDefaultEditNum* pEdit - ); - - virtual ~CUICtrlFeatPgOffsetYSpin(); - -private: - static PCSTR m_pszFeatPgOffsetY; -}; - -class CUICtrlFeatNUpCombo : public CUICtrlDefaultCombo -{ -public: - CUICtrlFeatNUpCombo(); - - virtual ~CUICtrlFeatNUpCombo(); - - HRESULT - OnInit( - _In_ CONST HWND hDlg - ); - -private: - HRESULT - EnableDependentCtrls( - _In_ CONST HWND hDlg, - _In_ CONST LONG lSel - ); - -private: - static PCSTR m_pszFeatNUp; -}; - -class CUICtrlFeatNUpOrderCombo : public CUICtrlDefaultCombo -{ -public: - CUICtrlFeatNUpOrderCombo(); - - virtual ~CUICtrlFeatNUpOrderCombo(); - - HRESULT - OnInit( - _In_ CONST HWND hDlg - ); - -private: - static PCSTR m_pszFeatNUpOrder; -}; - -class CUICtrlFeatJobBindCombo : public CUICtrlDefaultCombo -{ -public: - CUICtrlFeatJobBindCombo(); - - virtual ~CUICtrlFeatJobBindCombo(); - - HRESULT - OnInit( - _In_ CONST HWND hDlg - ); - -private: - HRESULT - EnableDependentCtrls( - _In_ CONST HWND hDlg, - _In_ CONST LONG lSel - ); - -private: - static PCSTR m_pszFeatJobBind; -}; - -class CUICtrlFeatDocBindCombo : public CUICtrlDefaultCombo -{ -public: - CUICtrlFeatDocBindCombo(); - - virtual ~CUICtrlFeatDocBindCombo(); - - HRESULT - OnInit( - _In_ CONST HWND hDlg - ); - -private: - HRESULT - EnableDependentCtrls( - _In_ CONST HWND hDlg, - _In_ CONST LONG lSel - ); - -private: - static PCSTR m_pszFeatDocBind; -}; - -class CUICtrlFeatPhotIntCombo : public CUICtrlDefaultCombo -{ -public: - CUICtrlFeatPhotIntCombo(); - - virtual ~CUICtrlFeatPhotIntCombo(); - - HRESULT - OnInit( - _In_ CONST HWND hDlg - ); - -private: - static PCSTR m_pszFeatPhotInt; -}; - -class CUICtrlFeatDocDuplexCombo : public CUICtrlDefaultCombo -{ -public: - CUICtrlFeatDocDuplexCombo(); - - virtual ~CUICtrlFeatDocDuplexCombo(); - - HRESULT - OnInit( - _In_ CONST HWND hDlg - ); - -private: - static PCSTR m_pszFeatDocDuplex; -}; - -class CUICtrlFeatBordersCheck : public CUICtrlDefaultCheck -{ -public: - CUICtrlFeatBordersCheck(); - - virtual ~CUICtrlFeatBordersCheck(); - -private: - static PCSTR m_pszFeatBorders; -}; - diff --git a/print/XPSDrvSmpl/src/ui/ftrdmptcnv.h b/print/XPSDrvSmpl/src/ui/ftrdmptcnv.h deleted file mode 100644 index 4ae471ea..00000000 --- a/print/XPSDrvSmpl/src/ui/ftrdmptcnv.h +++ /dev/null @@ -1,631 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - ftrdmptcnv.h - -Abstract: - - Defines the interface for a DevMode <-> PrintTicket feature conversion class - and an abstract class that handles the print core helper interface pointer. - ---*/ - -#pragma once - -template <typename _T = INT> -struct GPDStringToOption -{ - PCSTR pszOption; - _T option; -}; - -class IFeatureDMPTConvert -{ -public: - IFeatureDMPTConvert(){} - - virtual ~IFeatureDMPTConvert(){} - - virtual HRESULT STDMETHODCALLTYPE - ConvertPrintTicketToDevMode( - _In_ IXMLDOMDocument2* pPrintTicket, - _In_ ULONG cbDevmode, - _Inout_ PDEVMODE pDevmode, - _In_ ULONG cbDrvPrivateSize, - _In_ PVOID pPrivateDevmode - ) = 0; - - virtual HRESULT STDMETHODCALLTYPE - ConvertDevModeToPrintTicket( - _In_ ULONG cbDevmode, - _In_ PDEVMODE pDevmode, - _In_ ULONG cbDrvPrivateSize, - _In_ PVOID pPrivateDevmode, - _Inout_ IXMLDOMDocument2* pPrintTicket - ) = 0; - - virtual HRESULT STDMETHODCALLTYPE - CompletePrintCapabilities( - _In_opt_ IXMLDOMDocument2* pPrintTicket, - _Inout_ IXMLDOMDocument2* pPrintCapabilities - ) = 0; - - virtual HRESULT STDMETHODCALLTYPE - PublishPrintTicketHelperInterface( - _In_ IPrintCoreHelperUni* pHelper - ) = 0; - - - virtual HRESULT STDMETHODCALLTYPE - ValidatePrintTicket( - _Inout_ IXMLDOMDocument2* pPrintTicket - ) = 0; -}; - -template <typename _T> -class CFeatureDMPTConvert : public IFeatureDMPTConvert -{ -public: - CFeatureDMPTConvert(){} - - virtual ~CFeatureDMPTConvert(){} - - /*++ - - Routine Name: - - ConvertPrintTicketToDevMode - - Routine Description: - - - The plug-in is passed an input Print Ticket that is fully populated, - and a devmode. This method controls the calls to update the DevMode - to reflect the settings defined in the PrintTicket. - - The template this class is instantiated using defines the data - type passed between routines. Derived classes define this data - and then act on it as appropriate to the feature. - - Arguments: - - pPrintTicket - pointer to input Print Ticket - cbDevmode - size in bytes of input full devmode - pDevmode - pointer to input full devmode buffer - cbDrvPrivateSize - buffer size in bytes of plug-in private devmode - pPrivateDevmode - pointer to plug-in private devmode buffer - - Return Value: - - HRESULT - S_OK - On success - E_* - On error - - --*/ - HRESULT STDMETHODCALLTYPE - ConvertPrintTicketToDevMode( - _In_ IXMLDOMDocument2* pPrintTicket, - _In_ ULONG cbDevmode, - _Inout_ PDEVMODE pDevmode, - _In_ ULONG cbDrvPrivateSize, - _In_ PVOID pPrivateDevmode - ) - { - HRESULT hr = S_OK; - - // - // Validate parameters - // - if (SUCCEEDED(hr = CHECK_POINTER(pDevmode, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pPrivateDevmode, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pPrintTicket, E_POINTER))) - { - if (cbDevmode < sizeof(DEVMODE) || - cbDrvPrivateSize == 0) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - // - // Initialise the GPD settings from the devmode and merge with - // the PrintTicket settings - // - _T ptData; - - if (SUCCEEDED(hr = GetPTDataSettingsFromDM(pDevmode, cbDevmode, pPrivateDevmode, cbDrvPrivateSize, &ptData)) && - SUCCEEDED(hr = MergePTDataSettingsWithPT(pPrintTicket, &ptData))) - { - // - // Set the combined options in the devmode - // - hr = SetPTDataInDM(ptData, pDevmode, cbDevmode, pPrivateDevmode, cbDrvPrivateSize); - } - } - - ERR_ON_HR(hr); - return hr; - } - - /*++ - - Routine Name: - - ConvertDevModeToPrintTicket - - Routine Description: - - Unidrv will call the routine with an Input PrintTicket that is - populated with public and Unidrv private features. This method - controls the calls to update the PrintTicket to reflect the - settings defined in the devmode. - - The template this class is instantiated using defines the data - type passed between routines. Derived classes define this data - and then act on it as appropriate to the feature. - - Arguments: - - cbDevmode - size in bytes of input full devmode - pDevmode - pointer to input full devmode buffer - cbDrvPrivateSize - buffer size in bytes of plug-in private devmode - pPrivateDevmode - pointer to plug-in private devmode buffer - pPrintTicket - pointer to input Print Ticket - - - Return Value: - - HRESULT - S_OK - On success - E_* - On error - - --*/ - HRESULT STDMETHODCALLTYPE - ConvertDevModeToPrintTicket( - _In_ ULONG cbDevmode, - _In_ PDEVMODE pDevmode, - _In_ ULONG cbDrvPrivateSize, - _In_ PVOID pPrivateDevmode, - _Inout_ IXMLDOMDocument2* pPrintTicket - ) - { - HRESULT hr = S_OK; - - // - // Validate parameters - // - if (SUCCEEDED(hr = CHECK_POINTER(pDevmode, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pPrivateDevmode, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pPrintTicket, E_POINTER))) - { - if (cbDevmode < sizeof(DEVMODE) || - cbDrvPrivateSize == 0) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - // - // Initialise the GPD settings from the devmode - // - _T ptData; - - if (SUCCEEDED(hr = GetPTDataSettingsFromDM(pDevmode, cbDevmode, pPrivateDevmode, cbDrvPrivateSize, &ptData))) - { - // - // Set the options in the PrintTicket - // - hr = SetPTDataInPT(ptData, pPrintTicket); - } - } - - ERR_ON_HR(hr); - return hr; - } - - /*++ - - Routine Name: - - PublishPrintTicketHelperInterface - - Routine Description: - - This routine is stores the print core helper interface for use by - derived feature specific DM<->PT conversion classes. - - Arguments: - - pHelper - Pointer to core helper interface - - Return Value: - - HRESULT - S_OK - On success - E_* - On error - - --*/ - HRESULT STDMETHODCALLTYPE - PublishPrintTicketHelperInterface( - _In_ IPrintCoreHelperUni* pHelper - ) - { - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pHelper, E_POINTER)) && - m_pCoreHelper == NULL) - { - m_pCoreHelper = pHelper; - } - - ERR_ON_HR(hr); - return hr; - } - - /*++ - - Routine Name: - - ValidatePrintTicket - - Routine Description: - - Default validate implementation - just returns S_NO_CONFLICT. If the - derived feature specific class needs to validate the PrintTicket it - should provide its own implementation and handle the PrintTicket - appropriately. - - Arguments: - - pPrintTicket - Pointer to input Print Ticket. - - Return Value: - - HRESULT - S_NO_CONFLICT - On success - E_* - On error - - --*/ - virtual HRESULT STDMETHODCALLTYPE - ValidatePrintTicket( - _Inout_ IXMLDOMDocument2* pPrintTicket - ) - { - HRESULT hr = S_NO_CONFLICT; - - if (SUCCEEDED(hr = CHECK_POINTER(pPrintTicket, E_POINTER))) - { - hr = S_NO_CONFLICT; - } - - ERR_ON_HR(hr); - return hr; - } - -protected: - /*++ - - Routine Name: - - GetPTDataSettingsFromDM - - Routine Description: - - This pure virtual function ensures the concrete feature converter class - implements a means of retrieving the data type defined by that class from - the DevMode. - - Arguments: - - pDevmode - pointer to input devmode buffer. - cbDevmode - size in bytes of full input devmode. - pPrivateDevmode - pointer to input private devmode buffer. - cbDrvPrivateSize - size in bytes of private devmode. - pDataSettings - Pointer to data structure defined by a template argument to be updated. - - Return Value: - - HRESULT - S_OK - On success - E_* - On error - - --*/ - virtual HRESULT - GetPTDataSettingsFromDM( - _In_ PDEVMODE pDevmode, - _In_ ULONG cbDevmode, - _In_ PVOID pPrivateDevmode, - _In_ ULONG cbDrvPrivateSize, - _Out_ _T* pDataSettings - ) = 0; - - /*++ - - Routine Name: - - MergePTDataSettingsWithPT - - Routine Description: - - This pure virtual function ensures the concrete feature converter class - implements a means of merging the data type defined by that class from - the PrintTicket settings. - - Arguments: - - pPrintTicket - Pointer to the PrintTicket to merge the data structure with. - pDataSettings - Pointer to data structure defined by a template argument to be updated. - - Return Value: - - HRESULT - S_OK - On success - E_* - On error - - --*/ - virtual HRESULT - MergePTDataSettingsWithPT( - _In_ IXMLDOMDocument2* pPrintTicket, - _Inout_ _T* pDrvSettings - ) = 0; - - /*++ - - Routine Name: - - SetPTDataInDM - - Routine Description: - - This pure virtual function ensures the concrete feature converter class - implements a means of setting the data type defined by that class in the - DevMode. - - Arguments: - - dataSettings - const reference to the data structure defined by a template argument to be update from. - pDevmode - pointer to input devmode buffer. - cbDevmode - size in bytes of full input devmode. - pPrivateDevmode - pointer to input private devmode buffer. - cbDrvPrivateSize - size in bytes of private devmode. - - Return Value: - - HRESULT - S_OK - On success - E_* - On error - - --*/ - virtual HRESULT - SetPTDataInDM( - _In_ CONST _T& dataSettings, - _Inout_ PDEVMODE pDevmode, - _In_ ULONG cbDevmode, - _Inout_ PVOID pPrivateDevmode, - _In_ ULONG cbDrvPrivateSize - ) = 0; - - /*++ - - Routine Name: - - SetPTDataInPT - - Routine Description: - - This pure virtual function ensures the concrete feature converter class - implements a means of setting the data type defined by that class in the - PrintTicket. - - Arguments: - - dataSettings - const reference to the data structure defined by a template argument to be update from. - pPrintTicket - Pointer to the PrintTicket to update the data structure with. - - Return Value: - - HRESULT - S_OK - On success - E_* - On error - - --*/ - virtual HRESULT - SetPTDataInPT( - _In_ CONST _T& dataSettings, - _Inout_ IXMLDOMDocument2* pPrintTicket - ) = 0; - - /*++ - - Routine Name: - - GetOptionFromGPDString - - Routine Description: - - This template function takes as a template parameter the type of the - data to be retrieved from the DevMode. A table is passed through that - provides the look-up between the GPD string and the data type to be - returned. The routine then iterates through the options for the feature - specified matching against look-up and returning the corresponding value. - - Arguments: - - pDevmode - pointer to input DevMode. - cbDevmode - count of bytes in the input devmode. - pszFeature - string defining the feature name to match against. - pOptTable - pointer to the look-up table matching the GPD option strings to the option value. - cOptEntries - the number of entries in the look-up table - result - reference to the result value to be updated (type defined by the template argument) - - - Return Value: - - HRESULT - S_OK - On success - E_* - On error - - --*/ - template<typename _U> - HRESULT - GetOptionFromGPDString( - _In_ PDEVMODE pDevmode, - _In_ ULONG cbDevmode, - _In_z_ PCSTR pszFeature, - _In_ CONST GPDStringToOption<_U>* pOptTable, - _In_ CONST UINT cOptEntries, - _Out_ _U& result - ) - { - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pDevmode, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pszFeature, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pOptTable, E_POINTER))) - { - if (cbDevmode < sizeof(DEVMODE)) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - BOOL bFound = FALSE; - - if (cOptEntries > 0) - { - PCSTR pszOption = NULL; - - if (SUCCEEDED(hr = m_pCoreHelper->GetOption(pDevmode, cbDevmode, pszFeature, &pszOption))) - { - CStringXDA cstrOption(pszOption); - for (UINT index = 0; index < cOptEntries && !bFound; index++) - { - if (cstrOption == pOptTable->pszOption) - { - result = pOptTable->option; - bFound = TRUE; - } - else - { - pOptTable++; - } - } - } - } - - if (!bFound) - { - hr = E_ELEMENT_NOT_FOUND; - } - } - - ERR_ON_HR(hr); - return hr; - } - - /*++ - - Routine Name: - - SetGPDStringFromOption - - Routine Description: - - This template function takes as a template parameter the type of the - data to be set in the DevMode. A table is passed through that provides - the look-up between the GPD string and the data type to be set. The routine - then iterates through the options for the feature specified matching against - the look-up and setting the corresponding value in the DevMode. - - Arguments: - - pDevmode - pointer to input DevMode. - cbDevmode - count of bytes in the input devmode. - pszFeature - string defining the feature name to match against. - pOptTable - pointer to the look-up table matching the GPD option strings to the option value. - cOptEntries - the number of entries in the look-up table - result - const reference to the result value to update from (type defined by the template argument) - - Return Value: - - HRESULT - S_OK - On success - E_* - On error - - --*/ - template<typename _U> - HRESULT - SetGPDStringFromOption( - _Inout_ PDEVMODE pDevmode, - _In_ ULONG cbDevmode, - _In_z_ PCSTR pszFeature, - _In_ CONST GPDStringToOption<_U>* pOptTable, - _In_ CONST UINT cOptEntries, - _In_ CONST _U& option - ) - { - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pDevmode, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pszFeature, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pOptTable, E_POINTER))) - { - if (cbDevmode < sizeof(DEVMODE)) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - if (cOptEntries > 0) - { - for (UINT index = 0; index < cOptEntries; index++) - { - if (option == pOptTable->option) - { - PRINT_FEATURE_OPTION featureOption[1] = { - pszFeature, - pOptTable->pszOption - }; - - DWORD dwResult = 0; - DWORD cPairsWritten = 0; - - hr = m_pCoreHelper->SetOptions(pDevmode, cbDevmode, TRUE, featureOption, 1, &cPairsWritten, &dwResult); - - break; - } - else - { - pOptTable++; - } - } - } - } - - ERR_ON_HR(hr); - return hr; - } - - -protected: - CComPtr<IPrintCoreHelperUni> m_pCoreHelper; -}; - diff --git a/print/XPSDrvSmpl/src/ui/ftrppg.cpp b/print/XPSDrvSmpl/src/ui/ftrppg.cpp deleted file mode 100644 index 5cb4ea8f..00000000 --- a/print/XPSDrvSmpl/src/ui/ftrppg.cpp +++ /dev/null @@ -1,270 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - ftrppg.cpp - -Abstract: - - Implementation of the feature property page. This class is - responsible for initialising and registering the features - property page and its controls. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdexcept.h" -#include "xdstring.h" -#include "resource.h" -#include "ftrppg.h" -#include "ftrctrls.h" - -/*++ - -Routine Name: - - CFeaturePropPage::CFeaturePropPage - -Routine Description: - - CFeaturePropPage class constructor. - Creates a handler class object for every control on the feature property page. - Each of these handlers is stored in a collection. - -Arguments: - - None - -Return Value: - - None - Throws CXDException(HRESULT) on an error - ---*/ -CFeaturePropPage::CFeaturePropPage() -{ - HRESULT hr = S_OK; - - try - { - CUIControl* pControl = new(std::nothrow) CUICtrlFeatPgScaleCombo(); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY))) - { - hr = AddUIControl(IDC_COMBO_PGSCALE, pControl); - } - - if (SUCCEEDED(hr)) - { - pControl = new(std::nothrow) CUICtrlFeatScaleOffsetCombo(); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY))) - { - hr = AddUIControl(IDC_COMBO_SCALEOFF, pControl); - } - } - - if (SUCCEEDED(hr)) - { - pControl = new(std::nothrow) CUICtrlFeatPgScaleXEdit(); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY)) && - SUCCEEDED(hr = AddUIControl(IDC_EDIT_PGSCALEX, pControl))) - { - pControl = new(std::nothrow) CUICtrlFeatPgScaleXSpin(reinterpret_cast<CUICtrlDefaultEditNum *>(pControl)); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY))) - { - hr = AddUIControl(IDC_SPIN_PGSCALEX, pControl); - } - } - } - - if (SUCCEEDED(hr)) - { - pControl = new(std::nothrow) CUICtrlFeatPgOffsetXEdit(); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY)) && - SUCCEEDED(hr = AddUIControl(IDC_EDIT_PGOFFX, pControl))) - { - pControl = new(std::nothrow) CUICtrlFeatPgOffsetXSpin(reinterpret_cast<CUICtrlDefaultEditNum *>(pControl)); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY))) - { - hr = AddUIControl(IDC_SPIN_PGOFFX, pControl); - } - } - } - - if (SUCCEEDED(hr)) - { - pControl = new(std::nothrow) CUICtrlFeatPgScaleYEdit(); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY)) && - SUCCEEDED(hr = AddUIControl(IDC_EDIT_PGSCALEY, pControl))) - { - pControl = new(std::nothrow) CUICtrlFeatPgScaleYSpin(reinterpret_cast<CUICtrlDefaultEditNum *>(pControl)); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY))) - { - hr = AddUIControl(IDC_SPIN_PGSCALEY, pControl); - } - } - } - - if (SUCCEEDED(hr)) - { - pControl = new(std::nothrow) CUICtrlFeatPgOffsetYEdit(); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY)) && - SUCCEEDED(hr = AddUIControl(IDC_EDIT_PGOFFY, pControl))) - { - pControl = new(std::nothrow) CUICtrlFeatPgOffsetYSpin(reinterpret_cast<CUICtrlDefaultEditNum *>(pControl)); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY))) - { - hr = AddUIControl(IDC_SPIN_PGOFFY, pControl); - } - } - } - - if (SUCCEEDED(hr)) - { - pControl = new(std::nothrow) CUICtrlFeatNUpCombo(); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY))) - { - hr = AddUIControl(IDC_COMBO_NUP, pControl); - } - } - - if (SUCCEEDED(hr)) - { - pControl = new(std::nothrow) CUICtrlFeatNUpOrderCombo(); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY))) - { - hr = AddUIControl(IDC_COMBO_NUP_ORDER, pControl); - } - } - - if (SUCCEEDED(hr)) - { - pControl = new(std::nothrow) CUICtrlFeatPhotIntCombo(); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY))) - { - hr = AddUIControl(IDC_COMBO_PHOTO_INTENT, pControl); - } - } - - if (SUCCEEDED(hr)) - { - pControl = new(std::nothrow) CUICtrlFeatDocDuplexCombo(); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY))) - { - hr = AddUIControl(IDC_COMBO_DOCDUPLEX, pControl); - } - } - - if (SUCCEEDED(hr)) - { - pControl = new(std::nothrow) CUICtrlFeatBordersCheck(); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY))) - { - hr = AddUIControl(IDC_CHECK_BORDERLESS, pControl); - } - } - - if (SUCCEEDED(hr)) - { - pControl = new(std::nothrow) CUICtrlFeatJobBindCombo(); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY))) - { - hr = AddUIControl(IDC_COMBO_JOBBIND, pControl); - } - } - - if (SUCCEEDED(hr)) - { - pControl = new(std::nothrow) CUICtrlFeatDocBindCombo(); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY))) - { - hr = AddUIControl(IDC_COMBO_DOCBIND, pControl); - } - } - } - catch (CXDException& e) - { - hr = e; - } - - if (FAILED(hr)) - { - DestroyUIComponents(); - throw CXDException(hr); - } -} - -/*++ - -Routine Name: - - CFeaturePropPage::~CFeaturePropPage - -Routine Description: - - CFeaturePropPage class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CFeaturePropPage::~CFeaturePropPage() -{ -} - -/*++ - -Routine Name: - - CFeaturePropPage::InitDlgBox - -Routine Description: - - Provides the base class with the data required to intialise the dialog box. - -Arguments: - - ppszTemplate - Pointer to dialog box template to be intialised. - ppszTitle - Pointer to dialog box title to be intialised. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CFeaturePropPage::InitDlgBox( - _Out_ LPCTSTR* ppszTemplate, - _Out_ LPCTSTR* ppszTitle - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppszTemplate, E_POINTER)) || - SUCCEEDED(hr = CHECK_POINTER(ppszTitle, E_POINTER))) - { - *ppszTemplate = MAKEINTRESOURCE(IDD_FEATURES); - *ppszTitle = MAKEINTRESOURCE(IDS_FEATURE); - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/ui/ftrppg.h b/print/XPSDrvSmpl/src/ui/ftrppg.h deleted file mode 100644 index 73384fa5..00000000 --- a/print/XPSDrvSmpl/src/ui/ftrppg.h +++ /dev/null @@ -1,42 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - ftrppg.h - -Abstract: - - Definition of the feature property page. This class is - responsible for initialising and registering the features - property page and its controls. - ---*/ - -#pragma once - -#include "precomp.h" -#include "docppg.h" - -class CFeaturePropPage : public CDocPropPage -{ -public: - CFeaturePropPage(); - - virtual ~CFeaturePropPage(); - - HRESULT - InitDlgBox( - _Out_ LPCTSTR* ppszTemplate, - _Out_ LPCTSTR* ppszTitle - ); -}; - diff --git a/print/XPSDrvSmpl/src/ui/nupptcnv.cpp b/print/XPSDrvSmpl/src/ui/nupptcnv.cpp deleted file mode 100644 index 017d87ca..00000000 --- a/print/XPSDrvSmpl/src/ui/nupptcnv.cpp +++ /dev/null @@ -1,477 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - nupptcnv.cpp - -Abstract: - - JobNUpAllDocumentsContiguously and DocumentNUp devmode <-> PrintTicket conversion class implementation. - The class defines a common data representation between the DevMode (GPD) and PrintTicket - representations and implements the conversion and validation methods required - by CFeatureDMPTConvert. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdexcept.h" -#include "xdstring.h" -#include "nupptcnv.h" -#include "nupchndlr.h" - -using XDPrintSchema::NUp::NUpData; -using XDPrintSchema::NUp::ENUpFeature; -using XDPrintSchema::NUp::ENUpFeatureMin; -using XDPrintSchema::NUp::JobNUpAllDocumentsContiguously; -using XDPrintSchema::NUp::DocumentNUp; -using XDPrintSchema::NUp::ENUpFeatureMax; - -using XDPrintSchema::NUp::PresentationDirection::ENUpDirectionOption; -using XDPrintSchema::NUp::PresentationDirection::LeftTop; -using XDPrintSchema::NUp::PresentationDirection::LeftBottom; -using XDPrintSchema::NUp::PresentationDirection::RightTop; -using XDPrintSchema::NUp::PresentationDirection::RightBottom; -using XDPrintSchema::NUp::PresentationDirection::BottomRight; -using XDPrintSchema::NUp::PresentationDirection::BottomLeft; -using XDPrintSchema::NUp::PresentationDirection::TopRight; -using XDPrintSchema::NUp::PresentationDirection::TopLeft; - -PCSTR g_pszNUpFeature[ENUpFeatureMax] = { - "JobNUpAllDocumentsContiguously", - "DocumentNUp" -}; -static GPDStringToOption<INT> g_pagesPerSheetOption[] = { - {"1", 1}, - {"2", 2}, - {"4", 4}, - {"6", 6}, - {"8", 8}, - {"9", 9}, - {"16", 16}, -}; -UINT g_cPagesPerSheetOption = sizeof(g_pagesPerSheetOption)/sizeof(GPDStringToOption<INT>); - -PCSTR g_pszPresDirFeature[ENUpFeatureMax] = { - "JobNUpContiguouslyPresentationOrder", - "DocumentNUpPresentationOrder", -}; -static GPDStringToOption<ENUpDirectionOption> g_presDirTypeOption[] = { - {"RightBottom", RightBottom}, - {"BottomRight", BottomRight}, - {"LeftBottom", LeftBottom}, - {"BottomLeft", BottomLeft}, - {"RightTop", RightTop}, - {"TopRight", TopRight}, - {"LeftTop", LeftTop}, - {"TopLeft", TopLeft}, -}; -UINT g_cPresDirOption = sizeof(g_presDirTypeOption)/sizeof(GPDStringToOption<ENUpDirectionOption>); - - -/*++ - -Routine Name: - - CNUpDMPTConv::CNUpDMPTConv - -Routine Description: - - CNUpDMPTConv class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CNUpDMPTConv::CNUpDMPTConv() -{ -} - -/*++ - -Routine Name: - - CNUpDMPTConv::~CNUpDMPTConv - -Routine Description: - - CNUpDMPTConv class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CNUpDMPTConv::~CNUpDMPTConv() -{ -} - -/*++ - -Routine Name: - - CNUpDMPTConv::GetPTDataSettingsFromDM - -Routine Description: - - Populates the NUp data structure from the Devmode passed in. - -Arguments: - - pDevmode - pointer to input devmode buffer. - cbDevmode - size in bytes of full input devmode. - pPrivateDevmode - pointer to input private devmode buffer. - cbDrvPrivateSize - size in bytes of private devmode. - pDataSettings - Pointer to NUp data structure to be updated. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CNUpDMPTConv::GetPTDataSettingsFromDM( - _In_ PDEVMODE pDevmode, - _In_ ULONG cbDevmode, - _In_ PVOID pPrivateDevmode, - _In_ ULONG cbDrvPrivateSize, - _Out_ NUpSettings* pDataSettings - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pDevmode, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pPrivateDevmode, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pDataSettings, E_POINTER))) - { - if (cbDevmode < sizeof(DEVMODE) || - cbDrvPrivateSize == 0) - { - hr = E_INVALIDARG; - } - } - - // - // Retrieve the GPD and devmode controlled settings for both Job and Document NUp - // - for (ENUpFeature nUpFeature = ENUpFeatureMin; - nUpFeature < ENUpFeatureMax && SUCCEEDED(hr); - nUpFeature = static_cast<ENUpFeature>(nUpFeature + 1)) - { - pDataSettings->settings[nUpFeature].nUpFeature = nUpFeature; - if (SUCCEEDED(hr = GetOptionFromGPDString<INT>(pDevmode, - cbDevmode, - g_pszNUpFeature[nUpFeature], - g_pagesPerSheetOption, - g_cPagesPerSheetOption, - pDataSettings->settings[nUpFeature].cNUp))) - { - hr = GetOptionFromGPDString<ENUpDirectionOption>(pDevmode, - cbDevmode, - g_pszPresDirFeature[nUpFeature], - g_presDirTypeOption, - g_cPresDirOption, - pDataSettings->settings[nUpFeature].nUpPresentDir); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CNUpDMPTConv::MergePTDataSettingsWithPT - -Routine Description: - - This method updates the NUp data structure from a PrintTicket description. - -Arguments: - - pPrintTicket - Pointer to the input PrintTicket. - pDataSettings - Pointer to the NUp data structure - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CNUpDMPTConv::MergePTDataSettingsWithPT( - _In_ IXMLDOMDocument2* pPrintTicket, - _Inout_ NUpSettings* pDataSettings - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pPrintTicket, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pDataSettings, E_POINTER))) - { - try - { - // - // Get the NUp settings from the PrintTicket and set the options in - // the appropriate Job or Document equivalent in the NUpSettings structure - // - NUpData nUpData; - CNUpPTHandler nUpPTHndlr(pPrintTicket); - - if (SUCCEEDED(hr = nUpPTHndlr.GetData(&nUpData))) - { - // - // Only update settings relevant to the feature - // - if (nUpData.nUpFeature < ENUpFeatureMax && - nUpData.nUpFeature >= ENUpFeatureMin) - { - pDataSettings->settings[nUpData.nUpFeature] = nUpData; - } - } - else if (hr == E_ELEMENT_NOT_FOUND) - { - // - // NUp setting not in the PT - make sure neither Job or - // Document NUp are set in the outgoing data structure - // - pDataSettings->settings[JobNUpAllDocumentsContiguously].cNUp = 1; - pDataSettings->settings[DocumentNUp].cNUp = 1; - - hr = S_OK; - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CNUpDMPTConv::SetPTDataInDM - -Routine Description: - - This method updates the NUp options in the devmode from the UI Settings. - -Arguments: - - dataSettings - Reference to NUp data settings to be updated. - pDevmode - pointer to devmode to be updated. - cbDevmode - size in bytes of full devmode. - pPrivateDevmode - pointer to input private devmode buffer. - cbDrvPrivateSize - size in bytes of private devmode. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CNUpDMPTConv::SetPTDataInDM( - _In_ CONST NUpSettings& dataSettings, - _Inout_ PDEVMODE pDevmode, - _In_ ULONG cbDevmode, - _Inout_ PVOID pPrivateDevmode, - _In_ ULONG cbDrvPrivateSize - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pDevmode, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pPrivateDevmode, E_POINTER))) - { - if (cbDevmode < sizeof(DEVMODE) || - cbDrvPrivateSize == 0) - { - hr = E_INVALIDARG; - } - } - - for (ENUpFeature nUpFeature = ENUpFeatureMin; - nUpFeature < ENUpFeatureMax && SUCCEEDED(hr); - nUpFeature = static_cast<ENUpFeature>(nUpFeature + 1)) - { - if (SUCCEEDED(hr = SetGPDStringFromOption<INT>(pDevmode, - cbDevmode, - g_pszNUpFeature[nUpFeature], - g_pagesPerSheetOption, - g_cPagesPerSheetOption, - dataSettings.settings[nUpFeature].cNUp))) - { - hr = SetGPDStringFromOption<ENUpDirectionOption>(pDevmode, - cbDevmode, - g_pszPresDirFeature[nUpFeature], - g_presDirTypeOption, - g_cPresDirOption, - dataSettings.settings[nUpFeature].nUpPresentDir); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CNUpDMPTConv::SetPTDataInPT - -Routine Description: - - This method updates the watemark PrintTicket description from NUp data structure. - -Arguments: - - dataSettings - Reference to NUp data structure to update from. - pPrintTicket - Pointer to the PrintTicket to be updated. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CNUpDMPTConv::SetPTDataInPT( - _In_ CONST NUpSettings& dataSettings, - _Inout_ IXMLDOMDocument2* pPrintTicket - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pPrintTicket, E_POINTER))) - { - try - { - CNUpPTHandler nUpPTHndlr(pPrintTicket); - NUpData nUpData; - - // - // Preferentially set Job over Document - // - if (dataSettings.settings[JobNUpAllDocumentsContiguously].cNUp > 1) - { - nUpData.nUpFeature = JobNUpAllDocumentsContiguously; - nUpData.cNUp = dataSettings.settings[JobNUpAllDocumentsContiguously].cNUp; - nUpData.nUpPresentDir = dataSettings.settings[JobNUpAllDocumentsContiguously].nUpPresentDir; - } - else - { - nUpData.nUpFeature = DocumentNUp; - nUpData.cNUp = dataSettings.settings[DocumentNUp].cNUp; - nUpData.nUpPresentDir = dataSettings.settings[DocumentNUp].nUpPresentDir; - } - - // - // If the option is enabled set, otherwise delete it from the PT - // - if (nUpData.cNUp > 1) - { - hr = nUpPTHndlr.SetData(&nUpData); - } - else - { - hr = nUpPTHndlr.Delete(); - } - } - catch (CXDException& e) - { - hr = e; - } - } - else - { - hr = E_POINTER; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CNUpDMPTConv::CompletePrintCapabilities - -Routine Description: - - Unidrv calls this routine with an input Device Capabilities Document - that is partially populated with Device capabilities information - filled in by Unidrv for features that it understands. The plug-in - needs to read any private features in the input PrintTicket, delete - them and add them back under Printschema namespace so that higher - level applications can understand them and make use of them. - -Arguments: - - pPrintTicket - pointer to input PrintTicket - pCapabilities - pointer to Device Capabilities Document. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT STDMETHODCALLTYPE -CNUpDMPTConv::CompletePrintCapabilities( - _In_opt_ IXMLDOMDocument2*, - _Inout_ IXMLDOMDocument2* pPrintCapabilities - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pPrintCapabilities, E_POINTER))) - { - try - { - CNUpPCHandler nuppcHandler(pPrintCapabilities); - nuppcHandler.SetCapabilities(); - } - catch(CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} diff --git a/print/XPSDrvSmpl/src/ui/nupptcnv.h b/print/XPSDrvSmpl/src/ui/nupptcnv.h deleted file mode 100644 index e77798c8..00000000 --- a/print/XPSDrvSmpl/src/ui/nupptcnv.h +++ /dev/null @@ -1,86 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - nupptcnv.h - -Abstract: - - JobNUpAllDocumentsContiguously and DocumentNUp devmode <-> PrintTicket conversion class definition. - The class defines a common data representation between the DevMode (GPD) and PrintTicket - representations and implements the conversion and validation methods required - by CFeatureDMPTConvert. - ---*/ - -#pragma once - -#include "ftrdmptcnv.h" -#include "nupthndlr.h" -#include "nupdata.h" - -// -// The PT handling code defines a single NUpData structure that covers -// both JobNUpAllDocumentsContiguously and DocumentNUp to avoid conflicts. The GPD however -// controls both so we re-use the NUpData structure to handle both in -// the DevMode by using a NUpData for each Job and Document feature -// -struct NUpSettings -{ - XDPrintSchema::NUp::NUpData settings[XDPrintSchema::NUp::ENUpFeatureMax]; -}; - -class CNUpDMPTConv : public CFeatureDMPTConvert<NUpSettings> -{ -public: - CNUpDMPTConv(); - - virtual ~CNUpDMPTConv(); - -private: - HRESULT - GetPTDataSettingsFromDM( - _In_ PDEVMODE pDevmode, - _In_ ULONG cbDevmode, - _In_ PVOID pPrivateDevmode, - _In_ ULONG cbDrvPrivateSize, - _Out_ NUpSettings* pDataSettings - ); - - HRESULT - MergePTDataSettingsWithPT( - _In_ IXMLDOMDocument2* pPrintTicket, - _Inout_ NUpSettings* pDrvSettings - ); - - HRESULT - SetPTDataInDM( - _In_ CONST NUpSettings& drvSettings, - _Inout_ PDEVMODE pDevmode, - _In_ ULONG cbDevmode, - _Inout_ PVOID pPrivateDevmode, - _In_ ULONG cbDrvPrivateSize - ); - - HRESULT - SetPTDataInPT( - _In_ CONST NUpSettings& drvSettings, - _Inout_ IXMLDOMDocument2* pPrintTicket - ); - - HRESULT STDMETHODCALLTYPE - CompletePrintCapabilities( - _In_opt_ IXMLDOMDocument2*, - _Inout_ IXMLDOMDocument2* pPrintCapabilities - ); -}; - diff --git a/print/XPSDrvSmpl/src/ui/pgscdmptcnv.cpp b/print/XPSDrvSmpl/src/ui/pgscdmptcnv.cpp deleted file mode 100644 index 73b717d0..00000000 --- a/print/XPSDrvSmpl/src/ui/pgscdmptcnv.cpp +++ /dev/null @@ -1,468 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - pgscdmptcnv.cpp - -Abstract: - - PageScaling devmode <-> PrintTicket conversion class implementation. - The class defines a common data representation between the DevMode (GPD) and PrintTicket - representations and implements the conversion and validation methods required - by CFeatureDMPTConvert. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdexcept.h" -#include "xdstring.h" -#include "pgscdmptcnv.h" - -using XDPrintSchema::PageScaling::PageScalingData; -using XDPrintSchema::PageScaling::EScaleOption; -using XDPrintSchema::PageScaling::None; -using XDPrintSchema::PageScaling::Custom; -using XDPrintSchema::PageScaling::CustomSquare; -using XDPrintSchema::PageScaling::FitBleedToImageable; -using XDPrintSchema::PageScaling::FitContentToImageable; -using XDPrintSchema::PageScaling::FitMediaToImageable; -using XDPrintSchema::PageScaling::FitMediaToMedia; - -using XDPrintSchema::PageScaling::OffsetAlignment::EScaleOffsetOption; -using XDPrintSchema::PageScaling::OffsetAlignment::BottomCenter; -using XDPrintSchema::PageScaling::OffsetAlignment::BottomLeft; -using XDPrintSchema::PageScaling::OffsetAlignment::BottomRight; -using XDPrintSchema::PageScaling::OffsetAlignment::Center; -using XDPrintSchema::PageScaling::OffsetAlignment::LeftCenter; -using XDPrintSchema::PageScaling::OffsetAlignment::RightCenter; -using XDPrintSchema::PageScaling::OffsetAlignment::TopCenter; -using XDPrintSchema::PageScaling::OffsetAlignment::TopLeft; -using XDPrintSchema::PageScaling::OffsetAlignment::TopRight; - -// -// Lookup table between GPD page scaling option string and schema enumerated type -// -PCSTR g_pszPageScalingTypeFeature = "PageScaling"; -static GPDStringToOption<EScaleOption> g_pageScalingTypeOption[] = { - {"None", None}, - {"Custom", Custom}, - {"CustomSquare", CustomSquare}, - {"FitApplicationBleedSizeToPageImageableSize", FitBleedToImageable}, - {"FitApplicationContentSizeToPageImageableSize", FitContentToImageable}, - {"FitApplicationMediaSizeToPageImageableSize", FitMediaToImageable}, - {"FitApplicationMediaSizeToPageMediaSize", FitMediaToMedia}, -}; -UINT g_cPageScalingTypeOption = sizeof(g_pageScalingTypeOption)/sizeof(GPDStringToOption<EScaleOption>); - -// -// Lookup table between GPD scaling offset alignment option string and schema enumerated type -// -PCSTR g_pszScaleOffsetTypeFeature = "ScaleOffsetAlignment"; -static GPDStringToOption<EScaleOffsetOption> g_scaleOffsetTypeOption[] = { - {"BottomCenter", BottomCenter}, - {"BottomLeft", BottomLeft}, - {"BottomRight", BottomRight}, - {"Center", Center}, - {"LeftCenter", LeftCenter}, - {"RightCenter", RightCenter}, - {"TopCenter", TopCenter}, - {"TopLeft", TopLeft}, - {"TopRight", TopRight}, -}; -UINT g_cScaleOffsetTypeOption = sizeof(g_scaleOffsetTypeOption)/sizeof(GPDStringToOption<EScaleOffsetOption>); - - - -/*++ - -Routine Name: - - CPageScalingDMPTConv::CPageScalingDMPTConv - -Routine Description: - - CPageScalingDMPTConv class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CPageScalingDMPTConv::CPageScalingDMPTConv() -{ -} - -/*++ - -Routine Name: - - CPageScalingDMPTConv::~CPageScalingDMPTConv - -Routine Description: - - CPageScalingDMPTConv class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CPageScalingDMPTConv::~CPageScalingDMPTConv() -{ -} - -/*++ - -Routine Name: - - CPageScalingDMPTConv::GetPTDataSettingsFromDM - -Routine Description: - - Populates the page scaling data structure from the Devmode passed in. - -Arguments: - - pDevmode - pointer to input devmode buffer. - cbDevmode - size in bytes of full input devmode. - pPrivateDevmode - pointer to input private devmode buffer. - cbDrvPrivateSize - size in bytes of private devmode. - pDataSettings - Pointer to page scaling data structure to be updated. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPageScalingDMPTConv::GetPTDataSettingsFromDM( - _In_ PDEVMODE pDevmode, - _In_ ULONG cbDevmode, - _In_ PVOID pPrivateDevmode, - _In_ ULONG cbDrvPrivateSize, - _Out_ PageScalingData* pDataSettings - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pDevmode, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pPrivateDevmode, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pDataSettings, E_POINTER))) - { - if (cbDevmode < sizeof(DEVMODE) || - cbDrvPrivateSize == 0) - { - hr = E_INVALIDARG; - } - } - - // - // Retrieve the GPD and devmode controlled settings - // - CUIProperties uiProperties(static_cast<POEMDEV>(pPrivateDevmode)); - if (SUCCEEDED(hr) && - SUCCEEDED(hr = GetOptionFromGPDString<EScaleOption>(pDevmode, - cbDevmode, - g_pszPageScalingTypeFeature, - g_pageScalingTypeOption, - g_cPageScalingTypeOption, - pDataSettings->pgscOption)) && - SUCCEEDED(hr = GetOptionFromGPDString<EScaleOffsetOption>(pDevmode, - cbDevmode, - g_pszScaleOffsetTypeFeature, - g_scaleOffsetTypeOption, - g_cScaleOffsetTypeOption, - pDataSettings->offsetOption)) && - SUCCEEDED(hr = uiProperties.GetItem(g_pszPSScaleWidth, &pDataSettings->scaleWidth, sizeof(pDataSettings->scaleWidth))) && - SUCCEEDED(hr = uiProperties.GetItem(g_pszPSScaleHeight, &pDataSettings->scaleHeight, sizeof(pDataSettings->scaleHeight))) && - SUCCEEDED(hr = uiProperties.GetItem(g_pszOffsetWidth, &pDataSettings->offWidth, sizeof(pDataSettings->offWidth))) && - SUCCEEDED(hr = uiProperties.GetItem(g_pszOffsetHeight, &pDataSettings->offHeight, sizeof(pDataSettings->offHeight)))) - { - // - // Convert length measurements from 100ths of an inch to microns - // - pDataSettings->scaleWidth = pDataSettings->scaleWidth; - pDataSettings->scaleHeight = pDataSettings->scaleHeight; - pDataSettings->offWidth = HUNDREDTH_OFINCH_TO_MICRON(pDataSettings->offWidth); - pDataSettings->offHeight = HUNDREDTH_OFINCH_TO_MICRON(pDataSettings->offHeight); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPageScalingDMPTConv::MergePTDataSettingsWithPT - -Routine Description: - - This method updates the page scaling data structure from a PrintTicket description. - -Arguments: - - pPrintTicket - Pointer to the input PrintTicket. - pDataSettings - Pointer to the page scaling data structure - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPageScalingDMPTConv::MergePTDataSettingsWithPT( - _In_ IXMLDOMDocument2* pPrintTicket, - _Inout_ PageScalingData* pDataSettings - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_POINTER(pPrintTicket, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pDataSettings, E_POINTER))) - { - try - { - // - // Get the page scaling settings from the PrintTicket and set the options in - // the input Watermark data structure - // - PageScalingData pgScData; - CPageScalingPTHandler pgScPTHndlr(pPrintTicket); - - if (SUCCEEDED(hr = pgScPTHndlr.GetData(&pgScData))) - { - *pDataSettings = pgScData; - } - else if (hr == E_ELEMENT_NOT_FOUND) - { - // - // PageScaling setting not in the PT - this is not an error. Just - // leave set the type as None and reset the HRESULT to S_OK - // - pDataSettings->pgscOption = None; - hr = S_OK; - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPageScalingDMPTConv::SetPTDataInDM - -Routine Description: - - This method updates the page scaling options in the devmode from the UI Settings. - -Arguments: - - dataSettings - Reference to page scaling data settings to be updated. - pDevmode - pointer to devmode to be updated. - cbDevmode - size in bytes of full devmode. - pPrivateDevmode - pointer to input private devmode buffer. - cbDrvPrivateSize - size in bytes of private devmode. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPageScalingDMPTConv::SetPTDataInDM( - _In_ CONST PageScalingData& dataSettings, - _Inout_ PDEVMODE pDevmode, - _In_ ULONG cbDevmode, - _Inout_ PVOID pPrivateDevmode, - _In_ ULONG cbDrvPrivateSize - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pDevmode, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pPrivateDevmode, E_POINTER))) - { - if (cbDevmode < sizeof(DEVMODE) || - cbDrvPrivateSize == 0) - { - hr = E_INVALIDARG; - } - } - - // - // Convert lengths from microns to 100ths of an inch before writing to the DevMode - // - if (SUCCEEDED(hr)) - { - INT scaleWidth = dataSettings.scaleWidth; - INT scaleHeight = dataSettings.scaleHeight; - INT offWidth = MICRON_TO_HUNDREDTH_OFINCH(dataSettings.offWidth); - INT offHeight = MICRON_TO_HUNDREDTH_OFINCH(dataSettings.offHeight); - - // - // Set the GPD and devmode controlled settings - // - CUIProperties uiProperties(static_cast<POEMDEV>(pPrivateDevmode)); - - if (SUCCEEDED(hr = SetGPDStringFromOption<EScaleOption>(pDevmode, - cbDevmode, - g_pszPageScalingTypeFeature, - g_pageScalingTypeOption, - g_cPageScalingTypeOption, - dataSettings.pgscOption)) && - SUCCEEDED(hr = SetGPDStringFromOption<EScaleOffsetOption>(pDevmode, - cbDevmode, - g_pszScaleOffsetTypeFeature, - g_scaleOffsetTypeOption, - g_cScaleOffsetTypeOption, - dataSettings.offsetOption)) && - SUCCEEDED(hr = uiProperties.SetItem(g_pszPSScaleWidth, &scaleWidth, sizeof(scaleWidth))) && - SUCCEEDED(hr = uiProperties.SetItem(g_pszPSScaleHeight, &scaleHeight, sizeof(scaleHeight))) && - SUCCEEDED(hr = uiProperties.SetItem(g_pszOffsetWidth, &offWidth, sizeof(offWidth)))) - { - hr = uiProperties.SetItem(g_pszOffsetHeight, &offHeight, sizeof(offHeight)); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPageScalingDMPTConv::SetPTDataInPT - -Routine Description: - - This method updates the watemark PrintTicket description from page scaling data structure. - -Arguments: - - drvSettings - Reference to page scaling data structure to update from. - pPrintTicket - Pointer to the PrintTicket to be updated. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPageScalingDMPTConv::SetPTDataInPT( - _In_ CONST PageScalingData& dataSettings, - _Inout_ IXMLDOMDocument2* pPrintTicket - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pPrintTicket, E_POINTER))) - { - try - { - CPageScalingPTHandler pgScPTHndlr(pPrintTicket); - hr = pgScPTHndlr.SetData(&dataSettings); - } - catch (CXDException& e) - { - hr = e; - } - } - else - { - hr = E_POINTER; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPageScalingDMPTConv::CompletePrintCapabilities - -Routine Description: - - Unidrv calls this routine with an input Device Capabilities Document - that is partially populated with Device capabilities information - filled in by Unidrv for features that it understands. The plug-in - needs to read any private features in the input PrintTicket, delete - them and add them back under Printschema namespace so that higher - level applications can understand them and make use of them. - -Arguments: - - pPrintTicket - pointer to input PrintTicket - pCapabilities - pointer to Device Capabilities Document. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT STDMETHODCALLTYPE -CPageScalingDMPTConv::CompletePrintCapabilities( - _In_opt_ IXMLDOMDocument2*, - _Inout_ IXMLDOMDocument2* pPrintCapabilities - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pPrintCapabilities, E_POINTER))) - { - try - { - CPageScalingPCHandler pagescalingpcHandler(pPrintCapabilities); - pagescalingpcHandler.SetCapabilities(); - } - catch(CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} diff --git a/print/XPSDrvSmpl/src/ui/pgscdmptcnv.h b/print/XPSDrvSmpl/src/ui/pgscdmptcnv.h deleted file mode 100644 index 3f8b188a..00000000 --- a/print/XPSDrvSmpl/src/ui/pgscdmptcnv.h +++ /dev/null @@ -1,76 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - pgscdmptcnv.h - -Abstract: - - PageScaling devmode <-> PrintTicket conversion class definition. - The class defines a common data representation between the DevMode (GPD) and PrintTicket - representations and implements the conversion and validation methods required - by CFeatureDMPTConvert. - ---*/ - -#pragma once - -#include "ftrdmptcnv.h" -#include "pgscpthndlr.h" -#include "pgscpchndlr.h" -#include "uiproperties.h" - -class CPageScalingDMPTConv : public CFeatureDMPTConvert<XDPrintSchema::PageScaling::PageScalingData> -{ -public: - CPageScalingDMPTConv(); - - ~CPageScalingDMPTConv(); - -private: - HRESULT - GetPTDataSettingsFromDM( - _In_ PDEVMODE pDevmode, - _In_ ULONG cbDevmode, - _In_ PVOID pPrivateDevmode, - _In_ ULONG cbDrvPrivateSize, - _Out_ XDPrintSchema::PageScaling::PageScalingData* pDataSettings - ); - - HRESULT - MergePTDataSettingsWithPT( - _In_ IXMLDOMDocument2* pPrintTicket, - _Inout_ XDPrintSchema::PageScaling::PageScalingData* pDrvSettings - ); - - HRESULT - SetPTDataInDM( - _In_ CONST XDPrintSchema::PageScaling::PageScalingData& drvSettings, - _Inout_ PDEVMODE pDevmode, - _In_ ULONG cbDevmode, - _Inout_ PVOID pPrivateDevmode, - _In_ ULONG cbDrvPrivateSize - ); - - HRESULT - SetPTDataInPT( - _In_ CONST XDPrintSchema::PageScaling::PageScalingData& drvSettings, - _Inout_ IXMLDOMDocument2* pPrintTicket - ); - - HRESULT STDMETHODCALLTYPE - CompletePrintCapabilities( - _In_opt_ IXMLDOMDocument2*, - _Inout_ IXMLDOMDocument2* pPrintCapabilities - ); -}; - diff --git a/print/XPSDrvSmpl/src/ui/precomp.h b/print/XPSDrvSmpl/src/ui/precomp.h deleted file mode 100644 index b9847ea0..00000000 --- a/print/XPSDrvSmpl/src/ui/precomp.h +++ /dev/null @@ -1,103 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - precomp.h - -Abstract: - - Precompiled header for UI plugin module. - ---*/ - -#pragma once - -// -// Annotate this as a usermode driver for static analysis -// -#include <DriverSpecs.h> -_Analysis_mode_(_Analysis_code_type_user_driver_) - -// -// Standard Annotation Language include -// -#include <sal.h> - -// -// Prefast warning suppression macros -// -#include <suppress.h> - -// -// Windows includes -// -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif // WIN32_LEAN_AND_MEAN -#include <windows.h> -#include <commctrl.h> -#include <commdlg.h> -#include <limits.h> - -// -// COM includes -// -#include <objbase.h> -#include <oleauto.h> - -// -// ATL Includes -// -#include <atlbase.h> - -#pragma warning (push) -#pragma warning (disable:4458) -// -// GDIPlus includes -// -#include <gdiplus.h> -#pragma warning (pop) - -// -// MSXML includes -// -#include <msxml6.h> - -// -// Standard library includes -// -#include <new> -#include <vector> -#include <map> - -#include <prsht.h> -#include <initguid.h> -#include <winddiui.h> - -#include <printoem.h> -#include <prdrvcom.h> -#include <prcomoem.h> - -// -// Commonly used namespaces -// -using namespace std; -using namespace Gdiplus; - -// -// StrSafe.h needs to be included last to disallow bad string functions. -// -#include <strsafe.h> - -#define E_ELEMENT_NOT_FOUND HRESULT_FROM_WIN32(ERROR_NOT_FOUND) - - diff --git a/print/XPSDrvSmpl/src/ui/precompsrc.cpp b/print/XPSDrvSmpl/src/ui/precompsrc.cpp deleted file mode 100644 index 5944cf51..00000000 --- a/print/XPSDrvSmpl/src/ui/precompsrc.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "precomp.h"
\ No newline at end of file diff --git a/print/XPSDrvSmpl/src/ui/resource.h b/print/XPSDrvSmpl/src/ui/resource.h deleted file mode 100644 index 448397a5..00000000 --- a/print/XPSDrvSmpl/src/ui/resource.h +++ /dev/null @@ -1,232 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - resource.h - -Abstract: - - Resource specific defines. - ---*/ - -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by xdsmpldlg.rc -// -#define IDD_COL_MANAGE 100 -#define IDD_WATERMARK 101 -#define IDD_FEATURES 102 -#define IDS_LAYOUT 126 -#define IDS_PAPQUAL 127 -#define IDS_COLMAN 128 -#define IDS_WMARK 129 -#define IDS_FEATURE 130 -#define IDC_COMBO_COL_MANAGE 1001 -#define IDC_LIST_COLPROF 1002 -#define IDC_TEXT_COLPROF 1003 -#define IDC_COMBO_WMTYPE 1004 -#define IDC_TXT_WMTYPE 1005 -#define IDC_GRP_WM 1006 -#define IDC_COMBO_WMLAYERING 1007 -#define IDC_GRP_COLPROF 1008 -#define IDC_TXT_WMLAYERING 1009 -#define IDC_GRP_PGSCALE 1010 -#define IDC_GRP_DOCNUP 1011 -#define IDC_EDIT_WMTEXT 1012 -#define IDC_TXT_WMTEXT 1013 -#define IDC_COMBO_PGSCALE 1014 -#define IDC_TXT_PGSCALE 1015 -#define IDC_EDIT_PGSCALEX 1018 -#define IDC_EDIT_PGOFFX 1019 -#define IDC_EDIT_PGSCALEY 1022 -#define IDC_GRP_WM_MIMIC 1023 -#define IDC_EDIT_PGOFFY 1024 -#define IDC_SPIN_PGSCALEX 1025 -#define IDC_SPIN_PGOFFX 1026 -#define IDC_SPIN_PGSCALEY 1027 -#define IDC_SPIN_PGOFFY 1028 -#define IDC_COMBO_NUP 1029 -#define IDC_TXT_NUP 1030 -#define IDC_COMBO_NUP_ORDER 1031 -#define IDC_TXT_NUP_ORDER 1032 -#define IDC_COMBO_JOBBIND 1033 -#define IDC_TXT_JOBBIND 1034 -#define IDC_COMBO_DOCBIND 1035 -#define IDC_TXT_DOCBIND 1036 -#define IDC_COMBO_PHOTO_INTENT 1037 -#define IDC_TXT_PHOTO_INTENT 1038 -#define IDC_CHECK_BORDERLESS 1039 -#define IDC_TXT_PGOFFY 1040 -#define IDC_TXT_PGOFFX 1041 -#define IDC_TXT_PGSCALEY 1042 -#define IDC_TXT_PGSCALEX 1043 -#define IDC_CHECK_DEVFONTSUB 1044 -#define IDC_GRP_DOCDUP 1045 -#define IDC_CHECK_DOCDUPLEX 1046 -#define IDC_COMBO_DOCDUPLEX 1047 -#define IDC_TXT_DOCDUPLEX 1048 -#define IDC_TXT_COL_MANAGE 1049 -#define IDC_EDIT_WMTRANSPARENCY 1050 -#define IDC_SPIN_WMTRANSPARENCY 1051 -#define IDC_EDIT_WMANGLE 1052 -#define IDC_SPIN_WMANGLE 1053 -#define IDC_EDIT_WMOFFX 1054 -#define IDC_SPIN_WMOFFX 1055 -#define IDC_EDIT_WMOFFY 1056 -#define IDC_SPIN_WMOFFY 1057 -#define IDC_TXT_WMTRANSPARENCY 1058 -#define IDC_TXT_WMANGLE 1059 -#define IDC_TXT_WMOFFX 1060 -#define IDC_TXT_WMOFFY 1061 -#define IDC_EDIT_WMWIDTH 1062 -#define IDC_SPIN_WMWIDTH 1063 -#define IDC_EDIT_WMHEIGHT 1064 -#define IDC_SPIN_WMHEIGHT 1065 -#define IDC_TXT_WMWIDTH 1066 -#define IDC_TXT_WMHEIGHT 1067 -#define IDC_EDIT_WMSIZE 1068 -#define IDC_SPIN_WMSIZE 1069 -#define IDC_TXT_WMSIZE 1070 -#define IDC_BUTTON_WMCOLOR 1071 -#define IDC_COMBO_COL_INTENT 1073 -#define IDC_TXT_COL_INTENT 1074 -#define IDC_COMBO_SCALEOFF 1075 -#define IDC_TXT_SCALEOFF 1076 - -// -// String resource IDs used in GPD -// -#define IDS_GPD_1PPS 2000 -#define IDS_GPD_2PPS 2001 -#define IDS_GPD_4PPS 2002 -#define IDS_GPD_6PPS 2003 -#define IDS_GPD_8PPS 2004 -#define IDS_GPD_9PPS 2005 -#define IDS_GPD_16PPS 2006 -#define IDS_GPD_RES1200 2007 -#define IDS_GPD_RES600 2008 -#define IDS_GPD_AUTOMATIC 2009 -#define IDS_GPD_BORDERED 2010 -#define IDS_GPD_BORDERLESS 2011 -#define IDS_GPD_BTOT 2012 -#define IDS_GPD_BTOTLTOR 2013 -#define IDS_GPD_BTOTRTOL 2014 -#define IDS_GPD_CMYK 2015 -#define IDS_GPD_COLOR 2016 -#define IDS_GPD_CONFIDENTIAL 2017 -#define IDS_GPD_CUSTSQUARE 2018 -#define IDS_GPD_CUSTOM 2019 -#define IDS_GPD_SRCCOLPROF 2020 -#define IDS_GPD_DEVICE 2021 -#define IDS_GPD_DOCBIND 2022 -#define IDS_GPD_PAGECOLMAN 2023 -#define IDS_GPD_PAGEPHOTINTENT 2024 -#define IDS_GPD_DOCDUPLEX 2025 -#define IDS_GPD_DOCNUP 2026 -#define IDS_GPD_DOCNUPPRESENTORDER 2027 -#define IDS_GPD_DRAFT 2028 -#define IDS_GPD_DRIVER 2029 -#define IDS_GPD_DUPLEX 2030 -#define IDS_GPD_FAX 2031 -#define IDS_GPD_FITBLEED 2032 -#define IDS_GPD_FITCONTENT 2033 -#define IDS_GPD_FITPAGE 2034 -#define IDS_GPD_GLOSSY 2035 -#define IDS_GPD_GRAYSCALE 2036 -#define IDS_GPD_HIGH 2037 -#define IDS_GPD_HORIZONTAL 2038 -#define IDS_GPD_JOBBINDING 2039 -#define IDS_GPD_JOBNUPPRESENTORDER 2040 -#define IDS_GPD_JOBNUP 2041 -#define IDS_GPD_JOBPAGEORDER 2042 -#define IDS_GPD_LANDSCAPE 2043 -#define IDS_GPD_LTOR 2044 -#define IDS_GPD_LTORBTOT 2045 -#define IDS_GPD_LTORTTOB 2046 -#define IDS_GPD_MEDIATYPE 2047 -#define IDS_GPD_MONO 2048 -#define IDS_GPD_NONE 2049 -#define IDS_GPD_NORMAL 2050 -#define IDS_GPD_OFF 2051 -#define IDS_GPD_ON 2052 -#define IDS_GPD_ORIENATION 2053 -#define IDS_GPD_OVERLAYED 2054 -#define IDS_GPD_PAGEBORDER 2055 -#define IDS_GPD_PAGEQUALITY 2056 -#define IDS_GPD_PAGESCALING 2057 -#define IDS_GPD_PAPERSOURCE 2058 -#define IDS_GPD_PHOTOGRAPHIC 2059 -#define IDS_GPD_PORTRAIT 2060 -#define IDS_GPD_RASTERIMAGE 2061 -#define IDS_GPD_RESOLUTION 2062 -#define IDS_GPD_REVERSELANDSCAPE 2063 -#define IDS_GPD_REVERSE 2064 -#define IDS_GPD_RTOL 2065 -#define IDS_GPD_RTOLBTOT 2066 -#define IDS_GPD_RTOLTTOB 2067 -#define IDS_GPD_SCALEPAGETOPAGE 2068 -#define IDS_GPD_SCRGB 2069 -#define IDS_GPD_STANDARD 2070 -#define IDS_GPD_TEXT 2071 -#define IDS_GPD_TTOB 2072 -#define IDS_GPD_TTOBLTOR 2073 -#define IDS_GPD_TTOBRTOL 2074 -#define IDS_GPD_TRANSPARENCY 2075 -#define IDS_GPD_TRANSPARENT 2076 -#define IDS_GPD_UNDERLAYED 2077 -#define IDS_GPD_UPPER 2078 -#define IDS_GPD_VECTORIMAGE 2079 -#define IDS_GPD_VERTICAL 2080 -#define IDS_GPD_WATERMARKLAYERING 2081 -#define IDS_GPD_WATERMARKTEXT 2082 -#define IDS_GPD_WATERMARKTYPE 2083 -#define IDS_GPD_WATERMARKBITMAP 2084 -#define IDS_GPD_WATERMARKGRAPHIC 2087 -#define IDS_GPD_BEST 2090 -#define IDS_GPD_PAGEICMINTENT 2091 -#define IDS_GPD_ABSCOLINTENT 2092 -#define IDS_GPD_RELCOLINTENT 2093 -#define IDS_GPD_PHOTOINTENT 2094 -#define IDS_GPD_BIZINTENT 2095 -#define IDS_GPD_SYSTEM 2096 -#define IDS_GPD_WATERMARKTEXTCOLOR 2097 -#define IDS_GPD_RED 2098 -#define IDS_GPD_GREEN 2099 -#define IDS_GPD_BLUE 2100 -#define IDS_GPD_MAGENTA 2101 -#define IDS_GPD_CYAN 2102 -#define IDS_GPD_YELLOW 2103 -#define IDS_GPD_BLACK 2104 -#define IDS_GPD_SCALE_ALIGN 2105 -#define IDS_GPD_SCALE_ALIGN_BC 2106 -#define IDS_GPD_SCALE_ALIGN_BL 2107 -#define IDS_GPD_SCALE_ALIGN_BR 2108 -#define IDS_GPD_SCALE_ALIGN_CC 2109 -#define IDS_GPD_SCALE_ALIGN_LC 2110 -#define IDS_GPD_SCALE_ALIGN_CR 2111 -#define IDS_GPD_SCALE_ALIGN_CT 2112 -#define IDS_GPD_SCALE_ALIGN_TL 2113 -#define IDS_GPD_SCALE_ALIGN_TR 2114 - -// -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 131 -#define _APS_NEXT_COMMAND_VALUE 32771 -#define _APS_NEXT_CONTROL_VALUE 1077 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif - diff --git a/print/XPSDrvSmpl/src/ui/uictrl.cpp b/print/XPSDrvSmpl/src/ui/uictrl.cpp deleted file mode 100644 index a424a3a4..00000000 --- a/print/XPSDrvSmpl/src/ui/uictrl.cpp +++ /dev/null @@ -1,2117 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - uictrl.cpp - -Abstract: - - Implementation of the abstract UI control class and the base default - UI controls for check boxe, list, combo, edit and spin controls. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "uictrl.h" - -/*++ - -Routine Name: - - CUIControl::CUIControl - -Routine Description: - - CUIControl class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUIControl::CUIControl() : - m_pDriverUIHelp(NULL), - m_pOemCUIPParam(NULL), - m_pUIProperties(NULL) -{ -} - -/*++ - -Routine Name: - - CUIControl::~CUIControl - -Routine Description: - - CUIControl class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUIControl::~CUIControl() -{ -} - -/*++ - -Routine Name: - - CUIControl::SetOemCUIPParam - -Routine Description: - - Store a pointer to a OEMCUIPPARAM structure as a member in the class. - -Arguments: - - pOemCUIPParam - Pointer to a OEMCUIPPARAM structure - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUIControl::SetOemCUIPParam( - _In_ CONST POEMCUIPPARAM pOemCUIPParam - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pOemCUIPParam, E_POINTER))) - { - m_pOemCUIPParam = pOemCUIPParam; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUIControl::SetUIProperties - -Routine Description: - - Store a pointer to an CUIProperties interface as a member in the class. - -Arguments: - - pUIProperties - Pointer to an instance of the CUIProperties interface. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUIControl::SetUIProperties( - _In_ CUIProperties* pUIProperties - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pUIProperties, E_POINTER))) - { - m_pUIProperties = pUIProperties; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUIControl::SetPrintOemDriverUI - -Routine Description: - - Store a pointer to an IPrintOemDriverUI interface as a member in the class. - -Arguments: - - pOEMDriverUI - Pointer to an instance of the IPrintOemDriverUI interface. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUIControl::SetPrintOemDriverUI( - _In_ CONST IPrintOemDriverUI* pOEMDriverUI - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pOEMDriverUI, E_POINTER))) - { - m_pDriverUIHelp = const_cast<IPrintOemDriverUI*>(pOEMDriverUI); - } - - ERR_ON_HR(hr); - return hr; -} - -// -// Message handling stubs -// -/*++ - -Routine Name: - - CUIControl::OnInit - -Routine Description: - - This is a default implementation that returns S_OK. - Called from the property page handler on a WM_INITDIALOG message. - -Arguments: - - None referenced. - -Return Value: - - HRESULT - S_OK - ---*/ -HRESULT -CUIControl::OnInit( - _In_ CONST HWND - ) -{ - // - // A sub class is required to implement this method if it requires intialisation. The - // implementation is optional however so we return S_OK by default. - // - return S_OK; -} - -/*++ - -Routine Name: - - CUIControl::OnCommand - -Routine Description: - - This is a place holder method with no implementation. - Called from the property page handler on a WM_COMMAND message. - -Arguments: - - None referenced. - -Return Value: - - HRESULT - E_NOTIMPL - Method not implemented - ---*/ -HRESULT -CUIControl::OnCommand( - _In_ CONST HWND , - _In_ INT - ) -{ - // - // A sub class is required to implement this method if it can recieve command messages. The - // implementation is optional however so we return S_OK by default. - // - return S_OK; -} - -/*++ - -Routine Name: - - CUIControl::OnNotify - -Routine Description: - - This is a place holder method with no implementation. - Called from the property page handler on a WM_NOTIFY message. - -Arguments: - - None referenced. - -Return Value: - - HRESULT - E_NOTIMPL - Method not implemented - ---*/ -HRESULT -CUIControl::OnNotify( - _In_ CONST HWND, - _In_ CONST NMHDR* - ) -{ - // - // A sub class is required to implement this method if it can recieve notify messages. The - // implementation is optional however so we return S_OK by default. - // - return S_OK; -} - -// -// Check box control -// -/*++ - -Routine Name: - - CUICtrlDefaultCheck::CUICtrlDefaultCheck - -Routine Description: - - CUICtrlDefaultCheck class constructor - -Arguments: - - gpdString - Property name of the data associated with this control. - iCheckResID - Resource id for the checkbox control. - -Return Value: - - None - ---*/ -CUICtrlDefaultCheck::CUICtrlDefaultCheck( - _In_ PCSTR gpdString, - _In_ CONST INT iCheckResID - ) : - m_szGPDString(gpdString), - m_iCheckResID(iCheckResID) -{ -} - -/*++ - -Routine Name: - - CUICtrlDefaultCheck::~CUICtrlDefaultCheck - -Routine Description: - - CUICtrlDefaultCheck class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlDefaultCheck::~CUICtrlDefaultCheck() -{ -} - -/*++ - -Routine Name: - - CUICtrlDefaultCheck::OnActivate - -Routine Description: - - Called when the parent property page becomes active. - This method initialises the state of the control to reflect the Unidrv GPD settings. - -Arguments: - - hDlg - handle to the parent window - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlDefaultCheck::OnActivate( - _In_ CONST HWND hDlg - ) -{ - HRESULT hr = S_OK; - POPTITEM pOptItem = NULL; - - ASSERTMSG(m_pOemCUIPParam != NULL, "NULL pointer to OEMCUIPPARAM structure.\n"); - ASSERTMSG(m_pUIProperties != NULL, "NULL pointer to UI properties interface.\n"); - - if (SUCCEEDED(hr = CHECK_POINTER(m_pOemCUIPParam, E_PENDING)) && - SUCCEEDED(hr = CHECK_POINTER(m_pUIProperties, E_PENDING)) && - SUCCEEDED(hr = m_pUIProperties->GetOptItem(m_pOemCUIPParam, m_szGPDString, &pOptItem)) && - SUCCEEDED(hr = CHECK_POINTER(pOptItem, E_FAIL))) - { - - // - // Convert from a selection to a checkbox state - // and initialise the controls state. - // - - LONG lSel = pOptItem->Sel; - - UINT uChecked = (lSel == 0) ? BST_UNCHECKED : BST_CHECKED; - - if (CheckDlgButton(hDlg, m_iCheckResID, uChecked) > 0) - { - hr = EnableDependentCtrls(hDlg, lSel); - } - else - { - hr = HRESULT_FROM_WIN32(GetLastError()); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUICtrlDefaultCheck::OnCommand - -Routine Description: - - Called from the property page handler when a WM_COMMAND message is recieved. - Filters out any button click (BN_CLICKED) messages intended for this control. - -Arguments: - - hDlg - handle to the parent window - iCommand - specifies the notification code - -Return Value: - - HRESULT - S_OK - On success - E_NOTIMPL - Command not implemented - E_* - On error - ---*/ -HRESULT -CUICtrlDefaultCheck::OnCommand( - _In_ CONST HWND hDlg, - _In_ INT iCommand - ) -{ - HRESULT hr = S_OK; - - switch (iCommand) - { - case BN_CLICKED: - { - hr = OnBnClicked(hDlg); - } - break; - - default: - hr = E_NOTIMPL; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUICtrlDefaultCheck::OnBnClicked - -Routine Description: - - This rountine handles the event of a button press. The state of the check box control is read which - can be either checked and unchecked, the result is communicated through the Unidrv helper functions - informing the Unidrv core that a change has occured. - -Arguments: - - hDlg - handle to the parent window - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlDefaultCheck::OnBnClicked( - _In_ CONST HWND hDlg - ) -{ - HRESULT hr = S_OK; - - ASSERTMSG(m_pUIProperties != NULL, "NULL pointer to UI properties interface.\n"); - ASSERTMSG(m_pOemCUIPParam != NULL, "NULL pointer to OEMCUIPPARAM structure.\n"); - ASSERTMSG(m_pOemCUIPParam->poemuiobj != NULL, "NULL pointer to OEMCUIPPARAM->poemuiobj structure.\n"); - ASSERTMSG(m_pDriverUIHelp != NULL, "NULL pointer to driver UI help interface.\n"); - - if (SUCCEEDED(hr = CHECK_POINTER(m_pUIProperties, E_PENDING)) && - SUCCEEDED(hr = CHECK_POINTER(m_pOemCUIPParam, E_PENDING)) && - SUCCEEDED(hr = CHECK_POINTER(m_pOemCUIPParam->poemuiobj, E_PENDING)) && - SUCCEEDED(hr = CHECK_POINTER(m_pDriverUIHelp, E_PENDING))) - { - // - // Retrieve the controls current selection - // and convert from checkbox state to a selection - // - UINT uChecked = IsDlgButtonChecked(hDlg, m_iCheckResID); - - LONG lSel = (uChecked == BST_UNCHECKED) ? 0 : 1; - - // - // Check against the optitem - // - POPTITEM pOptItem = NULL; - - if (SUCCEEDED(hr = m_pUIProperties->GetOptItem(m_pOemCUIPParam, m_szGPDString, &pOptItem)) && - SUCCEEDED(hr = CHECK_POINTER(pOptItem, E_FAIL))) - { - if (pOptItem->Sel != lSel) - { - PropSheet_Changed(GetParent(hDlg), hDlg); - - pOptItem->Sel = lSel; - pOptItem->Flags |= OPTIF_CHANGED; - - if (SUCCEEDED(hr = m_pDriverUIHelp->DrvUpdateUISetting(m_pOemCUIPParam->poemuiobj, pOptItem, 0, OEMCUIP_DOCPROP))) - { - hr = EnableDependentCtrls(hDlg, lSel); - } - } - else - { - PropSheet_UnChanged(GetParent(hDlg), hDlg); - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUICtrlDefaultCheck::EnableDependentCtrls - -Routine Description: - - This is a default implementation simply returns S_OK - -Arguments: - - None referenced. - -Return Value: - - HRESULT - S_OK - Success - ---*/ -HRESULT -CUICtrlDefaultCheck::EnableDependentCtrls( - _In_ CONST HWND, - _In_ CONST LONG - ) -{ - return S_OK; -} - - -// -// List box control -// -/*++ - -Routine Name: - - CUICtrlDefaultList::CUICtrlDefaultList - -Routine Description: - - CUICtrlDefaultList class construtor - -Arguments: - - gpdString - Property name of the data associated with this control. - iListResID - Resource id for the List Box control. - -Return Value: - - None - ---*/ -CUICtrlDefaultList::CUICtrlDefaultList( - _In_ PCSTR gpdString, - _In_ CONST INT iListResID - ) : - m_szGPDString(gpdString), - m_iListResID(iListResID) -{ -} - -/*++ - -Routine Name: - - CUICtrlDefaultList::~CUICtrlDefaultList - -Routine Description: - - CUICtrlDefaultList class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlDefaultList::~CUICtrlDefaultList() -{ -} - -/*++ - -Routine Name: - - CUICtrlDefaultList::AddString - -Routine Description: - - Loads a string from the specified resource and adds it to the end of the list box. - -Arguments: - - hDlg - handle to the parent window - hStringResDLL - handle of the resource DLL that contains the string table. - idString - identifer of the string resource to be added - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlDefaultList::AddString( - _In_ CONST HWND hDlg, - _In_ CONST HINSTANCE hStringResDLL, - _In_ CONST INT idString - ) -{ - HRESULT hr = S_OK; - - TCHAR szItem[MAX_UISTRING_LEN]; - if (LoadString(hStringResDLL, idString, szItem, countof(szItem)) > 0) - { - LRESULT lResult = SendDlgItemMessage(hDlg, m_iListResID, LB_ADDSTRING, 0, reinterpret_cast<LPARAM>(szItem)); - - if (lResult == LB_ERRSPACE || - lResult == LB_ERR) - { - hr = E_FAIL; - } - } - else - { - hr = HRESULT_FROM_WIN32(GetLastError()); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUICtrlDefaultList::OnActivate - -Routine Description: - - Called when the parent property page becomes active. - This method initialises the state of the control to reflect the Unidrv GPD settings. - -Arguments: - - hDlg - handle to the parent window - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlDefaultList::OnActivate( - _In_ CONST HWND hDlg - ) -{ - HRESULT hr = S_OK; - POPTITEM pOptItem = NULL; - - ASSERTMSG(m_pOemCUIPParam != NULL, "NULL pointer to OEMCUIPPARAM structure.\n"); - ASSERTMSG(m_pUIProperties != NULL, "NULL pointer to UI properties interface.\n"); - - if (SUCCEEDED(hr = CHECK_POINTER(m_pOemCUIPParam, E_PENDING)) && - SUCCEEDED(hr = CHECK_POINTER(m_pUIProperties, E_PENDING)) && - SUCCEEDED(hr = m_pUIProperties->GetOptItem(m_pOemCUIPParam, m_szGPDString, &pOptItem)) && - SUCCEEDED(hr = CHECK_POINTER(pOptItem, E_FAIL))) - { - LONG lSel = pOptItem->Sel; - if (SendDlgItemMessage(hDlg, m_iListResID, LB_SETCURSEL, lSel, 0) != LB_ERR) - { - hr = EnableDependentCtrls(hDlg, lSel); - } - else - { - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUICtrlDefaultList::OnCommand - -Routine Description: - - Called from the property page handler when a WM_COMMAND message is recieved. - Filters out any list box selection change (LBN_SELCHANGE) messages intended for this control. - -Arguments: - - hDlg - handle to the parent window - iCommand - specifies the notification code - -Return Value: - - HRESULT - S_OK - On success - E_NOTIMPL - Command not implemented - E_* - On error - ---*/ -HRESULT -CUICtrlDefaultList::OnCommand( - _In_ CONST HWND hDlg, - _In_ INT iCommand - ) -{ - HRESULT hr = S_OK; - - switch (iCommand) - { - case LBN_SELCHANGE: - { - hr = OnSelChange(hDlg); - } - break; - - default: - hr = E_NOTIMPL; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUICtrlDefaultList::OnSelChange - -Routine Description: - - This rountine handles the event of a change of selection in the list box. The selection of the - list box control is read and the result is communicated through the Unidrv helper functions - informing the Unidrv core that a change has occured. - -Arguments: - - hDlg - handle to the parent window - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlDefaultList::OnSelChange( - _In_ CONST HWND hDlg - ) -{ - HRESULT hr = S_OK; - - ASSERTMSG(m_pUIProperties != NULL, "NULL pointer to UI properties interface.\n"); - ASSERTMSG(m_pOemCUIPParam != NULL, "NULL pointer to OEMCUIPPARAM structure.\n"); - ASSERTMSG(m_pOemCUIPParam->poemuiobj != NULL, "NULL pointer to OEMCUIPPARAM->poemuiobj structure.\n"); - ASSERTMSG(m_pDriverUIHelp != NULL, "NULL pointer to driver UI help interface.\n"); - - - if (SUCCEEDED(hr = CHECK_POINTER(m_pUIProperties, E_PENDING)) && - SUCCEEDED(hr = CHECK_POINTER(m_pOemCUIPParam, E_PENDING)) && - SUCCEEDED(hr = CHECK_POINTER(m_pOemCUIPParam->poemuiobj, E_PENDING)) && - SUCCEEDED(hr = CHECK_POINTER(m_pDriverUIHelp, E_PENDING))) - { - // - // Retrieve the controls current selection - // - LONG lSel = static_cast<LONG>(SendDlgItemMessage(hDlg, m_iListResID, LB_GETCURSEL, 0, 0)); - - if (lSel != LB_ERR) - { - // - // Check against the optitem - // - POPTITEM pOptItem = NULL; - - if (SUCCEEDED(hr = m_pUIProperties->GetOptItem(m_pOemCUIPParam, m_szGPDString, &pOptItem)) && - SUCCEEDED(hr = CHECK_POINTER(pOptItem, E_FAIL))) - { - if (pOptItem->Sel != lSel) - { - PropSheet_Changed(GetParent(hDlg), hDlg); - - pOptItem->Sel = lSel; - pOptItem->Flags |= OPTIF_CHANGED; - - if (SUCCEEDED(hr = m_pDriverUIHelp->DrvUpdateUISetting(m_pOemCUIPParam->poemuiobj, pOptItem, 0, OEMCUIP_DOCPROP))) - { - hr = EnableDependentCtrls(hDlg, lSel); - } - } - else - { - PropSheet_UnChanged(GetParent(hDlg), hDlg); - } - } - } - else - { - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUICtrlDefaultList::EnableDependentCtrls - -Routine Description: - - This is a default implementation that returns S_OK. - Called when a selection is changed in the list box to show/enable any dependent controls. - -Arguments: - - None referenced. - -Return Value: - - HRESULT - S_OK - Success - ---*/ -HRESULT -CUICtrlDefaultList::EnableDependentCtrls( - _In_ CONST HWND, - _In_ CONST LONG - ) -{ - return S_OK; -} - -// -// Combo box control -// -/*++ - -Routine Name: - - CUICtrlDefaultCombo::CUICtrlDefaultCombo - -Routine Description: - - CUICtrlDefaultCombo class constructor. - -Arguments: - - gpdString - Property name of the data associated with this control. - iComboResID - Resource id for the Combo Box control. - -Return Value: - - None - ---*/ -CUICtrlDefaultCombo::CUICtrlDefaultCombo( - _In_ PCSTR gpdString, - _In_ CONST INT iComboResID - ) : - m_szGPDString(gpdString), - m_iComboResID(iComboResID) -{ -} - -/*++ - -Routine Name: - - CUICtrlDefaultCombo::~CUICtrlDefaultCombo - -Routine Description: - - CUICtrlDefaultCombo class destructor. - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlDefaultCombo::~CUICtrlDefaultCombo() -{ -} - -/*++ - -Routine Name: - - CUICtrlDefaultCombo::OnActivate - -Routine Description: - - Called when the parent property page becomes active. - This method initialises the state of the control to reflect the Unidrv GPD settings. - -Arguments: - - hDlg - handle to the parent window - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlDefaultCombo::OnActivate( - _In_ CONST HWND hDlg - ) -{ - HRESULT hr = S_OK; - POPTITEM pOptItem = NULL; - - ASSERTMSG(m_pOemCUIPParam != NULL, "NULL pointer to OEMCUIPPARAM structure.\n"); - ASSERTMSG(m_pUIProperties != NULL, "NULL pointer to UI properties interface.\n"); - - if (SUCCEEDED(hr = CHECK_POINTER(m_pOemCUIPParam, E_PENDING)) && - SUCCEEDED(hr = CHECK_POINTER(m_pUIProperties, E_PENDING)) && - SUCCEEDED(hr = m_pUIProperties->GetOptItem(m_pOemCUIPParam, m_szGPDString, &pOptItem)) && - SUCCEEDED(hr = CHECK_POINTER(pOptItem, E_FAIL))) - { - LONG lSel = pOptItem->Sel; - - LRESULT lResult = SendDlgItemMessage(hDlg, m_iComboResID, CB_SETCURSEL, lSel, 0); - - if (lResult != CB_ERR && - lResult != CB_ERRSPACE) - { - hr = EnableDependentCtrls(hDlg, lSel); - } - else - { - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUICtrlDefaultCombo::OnCommand - -Routine Description: - - Called from the property page handler when a WM_COMMAND message is recieved. - Filters out any Combo Box selection change (CBN_SELCHANGE) messages intended for this control. - -Arguments: - - hDlg - handle to the parent window - iCommand - specifies the notification code - -Return Value: - - HRESULT - S_OK - On success - E_NOTIMPL - Command not implemented - E_* - On error - ---*/ -HRESULT -CUICtrlDefaultCombo::OnCommand( - _In_ CONST HWND hDlg, - _In_ INT iCommand - ) -{ - HRESULT hr = S_OK; - - switch (iCommand) - { - case CBN_SELCHANGE: - { - hr = OnSelChange(hDlg); - } - break; - - default: - { - hr = E_NOTIMPL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUICtrlDefaultCombo::OnSelChange - -Routine Description: - - This rountine handles the event of a change of selection in the combo box. The selection of the - combo box control is read and the result is communicated through the Unidrv helper functions - informing the Unidrv core that a change has occured. - -Arguments: - - hDlg - handle to the parent window - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlDefaultCombo::OnSelChange( - _In_ CONST HWND hDlg - ) -{ - HRESULT hr = S_OK; - - ASSERTMSG(m_pUIProperties != NULL, "NULL pointer to UI properties interface.\n"); - ASSERTMSG(m_pOemCUIPParam != NULL, "NULL pointer to OEMCUIPPARAM structure.\n"); - ASSERTMSG(m_pOemCUIPParam->poemuiobj != NULL, "NULL pointer to OEMCUIPPARAM->poemuiobj structure.\n"); - ASSERTMSG(m_pDriverUIHelp != NULL, "NULL pointer to driver UI help interface.\n"); - - if (SUCCEEDED(hr = CHECK_POINTER(m_pUIProperties, E_PENDING)) && - SUCCEEDED(hr = CHECK_POINTER(m_pOemCUIPParam, E_PENDING)) && - SUCCEEDED(hr = CHECK_POINTER(m_pOemCUIPParam->poemuiobj, E_PENDING)) && - SUCCEEDED(hr = CHECK_POINTER(m_pDriverUIHelp, E_PENDING))) - { - // - // Retrieve the controls current selection - // - - LONG lSel = static_cast<LONG>(SendDlgItemMessage(hDlg, m_iComboResID, CB_GETCURSEL, 0, 0)); - - if (lSel == CB_ERR) - { - hr = E_FAIL; - } - - POPTITEM pOptItem = NULL; - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = m_pUIProperties->GetOptItem(m_pOemCUIPParam, m_szGPDString, &pOptItem)) && - SUCCEEDED(hr = CHECK_POINTER(pOptItem, E_FAIL))) - { - if (pOptItem->Sel != lSel) - { - PropSheet_Changed(GetParent(hDlg), hDlg); - - pOptItem->Sel = lSel; - pOptItem->Flags |= OPTIF_CHANGED; - - if (SUCCEEDED(hr = m_pDriverUIHelp->DrvUpdateUISetting(m_pOemCUIPParam->poemuiobj, pOptItem, 0, OEMCUIP_DOCPROP))) - { - hr = EnableDependentCtrls(hDlg, lSel); - } - } - else - { - PropSheet_UnChanged(GetParent(hDlg), hDlg); - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUICtrlDefaultCombo::EnableDependentCtrls - -Routine Description: - - This is a default implementation that returns S_OK. - Called when a selection is changed in the combo box to show/enable any dependent controls. - -Arguments: - - None referenced - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlDefaultCombo::EnableDependentCtrls( - _In_ CONST HWND, - _In_ CONST LONG - ) -{ - return S_OK; -} - -/*++ - -Routine Name: - - CUICtrlDefaultCombo::AddString - -Routine Description: - - Loads a string from the specified resource and adds it to the end of the Combo Box. - -Arguments: - - hDlg - handle to the parent window - hStringResDLL - handle of the resource DLL that contains the string table. - idString - identifer of the string resource to be added - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlDefaultCombo::AddString( - _In_ CONST HWND hDlg, - _In_ CONST HINSTANCE hStringResDLL, - _In_ CONST INT idString - ) -{ - HRESULT hr = S_OK; - - TCHAR szItem[MAX_UISTRING_LEN]; - if (LoadString(hStringResDLL, idString, szItem, countof(szItem)) > 0) - { - LRESULT lResult = SendDlgItemMessage(hDlg, m_iComboResID, CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(szItem)); - - if (lResult == CB_ERRSPACE || - lResult == CB_ERR) - { - hr = E_FAIL; - } - } - else - { - hr = HRESULT_FROM_WIN32(GetLastError()); - } - - ERR_ON_HR(hr); - return hr; -} - -// -// EditNum control -// -/*++ - -Routine Name: - - CUICtrlDefaultEditNum::CUICtrlDefaultEditNum - -Routine Description: - - CUICtrlDefaultEditNum class constructor - -Arguments: - - gpdString - Property name of the data associated with this control. - iEditResID - Resource id for the Combo Box control. - iPropMin - Minimum integer value that is valid. - iPropMax - Maximum integer value that is valid. - iSpinResID - Resource id for the associated Up/Down spinner control. - -Return Value: - - None - ---*/ -CUICtrlDefaultEditNum::CUICtrlDefaultEditNum( - _In_ PCSTR propString, - _In_ CONST INT iEditResID, - _In_ CONST INT iPropMin, - _In_ CONST INT iPropMax, - _In_ CONST INT iSpinResID - ) : - m_szPropString(propString), - m_iEditResID(iEditResID), - m_iPropMin(iPropMin), - m_iPropMax(iPropMax), - m_iSpinResID(iSpinResID) - -{ -} - -/*++ - -Routine Name: - - CUICtrlDefaultEditNum::~CUICtrlDefaultEditNum - -Routine Description: - - CUICtrlDefaultEditNum class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlDefaultEditNum::~CUICtrlDefaultEditNum() -{ -} - -/*++ - -Routine Name: - - CUICtrlDefaultEditNum::OnActivate - -Routine Description: - - Called when the parent property page becomes active. - This method initialises the state of the control to reflect the OEM private devmode. - -Arguments: - - hDlg - handle to the parent window - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlDefaultEditNum::OnActivate( - _In_ CONST HWND hDlg - ) -{ - HRESULT hr = S_OK; - - ASSERTMSG(m_pUIProperties != NULL, "NULL pointer to UI properties interface.\n"); - - if (SUCCEEDED(hr = CHECK_POINTER(m_pUIProperties, E_PENDING))) - { - INT iPos = 0; - TCHAR szItem[MAX_UISTRING_LEN]; - - if (SUCCEEDED(hr = m_pUIProperties->GetItem(m_szPropString, reinterpret_cast<UIProperty*>(&iPos), sizeof(iPos))) && - SUCCEEDED(hr = StringCchPrintf(szItem, MAX_UISTRING_LEN, TEXT("%d"), iPos))) - { - if (SetDlgItemText(hDlg, m_iEditResID, reinterpret_cast<LPCTSTR>(szItem)) == 0) - { - hr = HRESULT_FROM_WIN32(GetLastError()); - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUICtrlDefaultEditNum::OnCommand - -Routine Description: - - Called from the property page handler when a WM_COMMAND message is recieved. - Filters out any Edit Text change (EN_CHANGE) messages intended for this control. - -Arguments: - - hDlg - handle to the parent window - iCommand - specifies the notification code - -Return Value: - - HRESULT - S_OK - On success - E_NOTIMPL - Command not implemented - E_* - On error - ---*/ -HRESULT -CUICtrlDefaultEditNum::OnCommand( - _In_ CONST HWND hDlg, - _In_ INT iCommand - ) -{ - HRESULT hr = S_OK; - - switch (iCommand) - { - case EN_CHANGE: - { - hr = OnEnChange(hDlg); - } - break; - - default: - hr = E_NOTIMPL; - - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUICtrlDefaultEditNum::CheckInRange - -Routine Description: - - Ensures that a value is within range of the controls min/max extents. - -Arguments: - - pValue - pointer to the integer value to check. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlDefaultEditNum::CheckInRange( - _In_ PINT pValue - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pValue, E_POINTER))) - { - if (*pValue > m_iPropMax) - { - *pValue = m_iPropMax; - } - - if (*pValue < m_iPropMin) - { - *pValue = m_iPropMin; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUICtrlDefaultEditNum::OnEnChange - -Routine Description: - - This rountine handles the event of a change in the text box. The text in the control is read then - validated and the result is stored in the OEM private devmode. In addition the buddy spinner - control is updated to reflect the change in value. - -Arguments: - - hDlg - handle to the parent window - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlDefaultEditNum::OnEnChange( - _In_ CONST HWND hDlg - ) -{ - HRESULT hr = S_OK; - - ASSERTMSG(m_pUIProperties != NULL, "NULL pointer to UI properties interface.\n"); - - BOOL bTranslated; - - INT iPos = static_cast<INT>(GetDlgItemInt(hDlg, m_iEditResID, &bTranslated, TRUE)); - - if (bTranslated) - { - INT iOrgPos = 0; - - if (SUCCEEDED(hr = CHECK_POINTER(m_pUIProperties, E_PENDING)) && - SUCCEEDED(hr = m_pUIProperties->GetItem(m_szPropString, reinterpret_cast<UIProperty*>(&iOrgPos), sizeof(iOrgPos))) && - SUCCEEDED(hr = CheckInRange(&iPos)) && - iOrgPos != iPos) - { - SendDlgItemMessage(hDlg, m_iSpinResID, UDM_SETPOS32, 0, static_cast<LPARAM>(iPos)); - - if (SUCCEEDED(hr = m_pUIProperties->SetItem(m_szPropString, reinterpret_cast<UIProperty*>(&iPos), sizeof(iPos)))) - { - PropSheet_Changed(GetParent(hDlg), hDlg); - } - } - } - else - { - hr = E_FAIL; - } - - ERR_ON_HR(hr); - return hr; -} - -// -// Edit control -// -/*++ - -Routine Name: - - CUICtrlDefaultSpin::CUICtrlDefaultSpin - -Routine Description: - - CUICtrlDefaultSpin class constructor. - - Requires a Text Box buddy control class. - Settings for this Spin control are taken from the buddy class. - -Arguments: - - pEdit - Pointer to the buddy Text Box control. - -Return Value: - - None - ---*/ -CUICtrlDefaultSpin::CUICtrlDefaultSpin( - _In_ CUICtrlDefaultEditNum * pEdit - ): - m_szPropString(0), - m_iSpinResID(0), - m_iPropMin(0), - m_iPropMax(0), - m_iEditResID(0) -{ - if (pEdit !=NULL) - { - m_szPropString = pEdit->m_szPropString; - m_iSpinResID = pEdit->m_iSpinResID; - m_iPropMin = pEdit->m_iPropMin; - m_iPropMax = pEdit->m_iPropMax; - m_iEditResID = pEdit->m_iEditResID; - } -} - -/*++ - -Routine Name: - - CUICtrlDefaultSpin::~CUICtrlDefaultSpin - -Routine Description: - - CUICtrlDefaultSpin class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlDefaultSpin::~CUICtrlDefaultSpin() -{ -} - -/*++ - -Routine Name: - - CUICtrlDefaultSpin::OnActivate - -Routine Description: - - Called when the parent property page becomes active. - This method initialises the state of the control to reflect the OEM private devmode. - -Arguments: - - hDlg - handle to the parent window - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlDefaultSpin::OnActivate( - _In_ CONST HWND hDlg - ) -{ - HRESULT hr = S_OK; - INT iPos = 0; - - ASSERTMSG(m_pUIProperties != NULL, "NULL pointer to UI properties interface.\n"); - - if (SUCCEEDED(hr = CHECK_POINTER(m_pUIProperties, E_PENDING)) && - SUCCEEDED(hr = m_pUIProperties->GetItem(m_szPropString, reinterpret_cast<UIProperty*>(&iPos), sizeof(iPos)))) - { - SendDlgItemMessage(hDlg, m_iSpinResID, UDM_SETRANGE32, m_iPropMin, m_iPropMax); - SendDlgItemMessage(hDlg, m_iSpinResID, UDM_SETPOS32, 0, iPos); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUICtrlDefaultSpin::OnNotify - -Routine Description: - - Called from the property page handler when a WM_NOTIFY message is recieved. - Filters out any Up/Down position (UDN_DELTAPOS) messages intended for this control. - -Arguments: - - hDlg - handle to the parent window - pNmhdr - pointer to the notification message - -Return Value: - - HRESULT - S_OK - On success - E_NOTIMPL - Command not implemented - E_* - On error - ---*/ -HRESULT -CUICtrlDefaultSpin::OnNotify( - _In_ CONST HWND hDlg, - _In_ CONST NMHDR* pNmhdr - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pNmhdr, E_POINTER))) - { - switch (pNmhdr->code) - { - case UDN_DELTAPOS: - { - hr = OnDeltaPos(hDlg, reinterpret_cast<CONST NMUPDOWN*>(pNmhdr)); - } - break; - - default: - hr = E_NOTIMPL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUICtrlDefaultSpin::CheckInRange - -Routine Description: - - Ensures that a value is within range of the controls min/max extents. - -Arguments: - - pValue - Pointer to the integer value to check. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlDefaultSpin::CheckInRange( - _In_ PINT pValue - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pValue, E_POINTER))) - { - if (*pValue > m_iPropMax) - { - *pValue = m_iPropMax; - } - - if (*pValue < m_iPropMin) - { - *pValue = m_iPropMin; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUICtrlDefaultSpin::OnDeltaPos - -Routine Description: - - This rountine handles the event of a change in value of the Up/Down control. The new value - of the control is validated and stored in the OEM private devmode. In addition the buddy text - box control is updated to reflect the change. - -Arguments: - - hDlg - handle to the parent window - pNmud - this structure contains information specific to up-down control messages - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlDefaultSpin::OnDeltaPos( - _In_ CONST HWND hDlg, - _In_ CONST NMUPDOWN* pNmud - ) -{ - HRESULT hr = S_OK; - INT iOrgPos = 0; - INT iPos = 0; - - ASSERTMSG(m_pUIProperties != NULL, "NULL pointer to UI properties interface.\n"); - - if (SUCCEEDED(hr = CHECK_POINTER(pNmud, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(m_pUIProperties, E_PENDING)) && - SUCCEEDED(hr = m_pUIProperties->GetItem(m_szPropString, reinterpret_cast<UIProperty*>(&iOrgPos), sizeof(iOrgPos)))) - { - iPos = iOrgPos + pNmud->iDelta; - TCHAR szItem[MAX_UISTRING_LEN]; - - if (SUCCEEDED(hr = CheckInRange(&iPos)) && - iOrgPos != iPos && - SUCCEEDED(hr = StringCchPrintf(szItem, MAX_UISTRING_LEN, TEXT("%d"), iPos))) - { - if (SetDlgItemText(hDlg, m_iEditResID, reinterpret_cast<LPCTSTR>(szItem)) > 0) - { - if (SUCCEEDED(hr = m_pUIProperties->SetItem(m_szPropString, reinterpret_cast<UIProperty*>(&iPos), sizeof(iPos)))) - { - PropSheet_Changed(GetParent(hDlg), hDlg); - } - } - else - { - hr = HRESULT_FROM_WIN32(GetLastError()); - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -// -// EditText control -// -/*++ - -Routine Name: - - CUICtrlDefaultEditText::CUICtrlDefaultEditText - -Routine Description: - - CUICtrlDefaultEditText class constructor - -Arguments: - - gpdString - Property name of the data associated with this control. - iEditResID - Resource id for the Combo Box control. - cbMaxLength - Maximum number of characters allowed. - -Return Value: - - None - ---*/ -CUICtrlDefaultEditText::CUICtrlDefaultEditText( - _In_ PCSTR propString, - _In_ CONST INT iEditResID, - _In_ CONST INT cbMaxLength - ) : - m_szPropString(propString), - m_iEditResID(iEditResID), - m_cbMaxLength(cbMaxLength) - -{ -} - -/*++ - -Routine Name: - - CUICtrlDefaultEditText::~CUICtrlDefaultEditText - -Routine Description: - - CUICtrlDefaultEditText class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlDefaultEditText::~CUICtrlDefaultEditText() -{ -} - -/*++ - -Routine Name: - - CUICtrlDefaultEditText::OnActivate - -Routine Description: - - Called when the parent property page becomes active. - This method initialises the state of the control to reflect the OEM private devmode. - -Arguments: - - hDlg - handle to the parent window - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlDefaultEditText::OnActivate( - _In_ CONST HWND hDlg - ) -{ - HRESULT hr = S_OK; - - ASSERTMSG(m_pUIProperties != NULL, "NULL pointer to UI properties interface.\n"); - - if (SUCCEEDED(hr = CHECK_POINTER(m_pUIProperties, E_PENDING))) - { - SIZE_T cbBuffer = sizeof(TCHAR) * m_cbMaxLength; - LPTSTR lpBuffer = new(std::nothrow) TCHAR[m_cbMaxLength]; - - if (SUCCEEDED(hr = CHECK_POINTER(lpBuffer, E_OUTOFMEMORY))) - { - if (SUCCEEDED(hr = m_pUIProperties->GetItem(m_szPropString, reinterpret_cast<UIProperty*>(lpBuffer), cbBuffer)) && - SUCCEEDED(hr = CHECK_POINTER(lpBuffer, E_FAIL))) - { - if (SetDlgItemText(hDlg, m_iEditResID, reinterpret_cast<LPCTSTR>(lpBuffer)) == 0) - { - hr = HRESULT_FROM_WIN32(GetLastError()); - } - } - - delete[] lpBuffer; - lpBuffer = NULL; - } - } - - if (SUCCEEDED(hr)) - { - SendDlgItemMessage(hDlg, m_iEditResID, EM_LIMITTEXT, m_cbMaxLength - 1, 0L); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUICtrlDefaultEditText::OnCommand - -Routine Description: - - Called from the property page handler when a WM_COMMAND message is recieved. - Filters out any Edit Text change (EN_CHANGE) messages intended for this control. - -Arguments: - - hDlg - handle to the parent window - iCommand - specifies the notification code - -Return Value: - - HRESULT - S_OK - On success - E_NOTIMPL - Command not implemented - E_* - On error - ---*/ -HRESULT -CUICtrlDefaultEditText::OnCommand( - _In_ CONST HWND hDlg, - _In_ INT iCommand - ) -{ - HRESULT hr = S_OK; - - switch (iCommand) - { - case EN_CHANGE: - { - hr = OnEnChange(hDlg); - } - break; - - default: - hr = E_NOTIMPL; - - } - - ERR_ON_HR(hr); - return hr; -} - - -/*++ - -Routine Name: - - CUICtrlDefaultEditNum::OnEnChange - -Routine Description: - - This rountine handles the event of a change in the text box. - The text in the control is read and the result is stored in the OEM private devmode. - -Arguments: - - hDlg - handle to the parent window - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlDefaultEditText::OnEnChange( - _In_ CONST HWND hDlg - ) -{ - HRESULT hr = S_OK; - - ASSERTMSG(m_pUIProperties != NULL, "NULL pointer to UI properties interface.\n"); - - SIZE_T cbBuffer = sizeof(TCHAR) * m_cbMaxLength; - LPTSTR lpBuffer = new(std::nothrow) TCHAR[m_cbMaxLength]; - - if (SUCCEEDED(hr = CHECK_POINTER(lpBuffer, E_OUTOFMEMORY))) - { - if (GetDlgItemText(hDlg, m_iEditResID, lpBuffer, m_cbMaxLength) == 0) - { - hr = HRESULT_FROM_WIN32(GetLastError()); - } - else - { - LPTSTR lpOrgBuffer = new(std::nothrow) TCHAR[m_cbMaxLength]; - - if (SUCCEEDED(hr = CHECK_POINTER(lpOrgBuffer, E_OUTOFMEMORY))) - { - if (SUCCEEDED(hr = CHECK_POINTER(m_pUIProperties, E_PENDING)) && - SUCCEEDED(hr = m_pUIProperties->GetItem(m_szPropString, reinterpret_cast<UIProperty*>(lpOrgBuffer), cbBuffer)) && - SUCCEEDED(hr = CHECK_POINTER(lpOrgBuffer, E_FAIL)) && - wcsncmp(lpBuffer, lpOrgBuffer, m_cbMaxLength) != 0 && - SUCCEEDED(hr = m_pUIProperties->SetItem(m_szPropString, reinterpret_cast<UIProperty*>(lpBuffer), cbBuffer))) - { - PropSheet_Changed(GetParent(hDlg), hDlg); - } - - delete[] lpOrgBuffer; - lpOrgBuffer = NULL; - } - } - - delete[] lpBuffer; - lpBuffer = NULL; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUICtrlDefaultBtn::CUICtrlDefaultBtn - -Routine Description: - - CUICtrlDefaultBtn class constructor. - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlDefaultBtn::CUICtrlDefaultBtn( - _In_ PCSTR propertyString, - _In_ INT iBtnResID - ) : - m_szPropertyString(propertyString), - m_iBtnResID(iBtnResID) -{ -} - -/*++ - -Routine Name: - - CUICtrlDefaultBtn::CUICtrlDefaultBtn - -Routine Description: - - CUICtrlDefaultBtn class constructor. - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlDefaultBtn::~CUICtrlDefaultBtn() -{ -} - -/*++ - -Routine Name: - - CUICtrlDefaultBtn::CUICtrlDefaultBtn - -Routine Description: - - Default button OnActivate handler. - -Arguments: - - None - -Return Value: - - S_OK - ---*/ -HRESULT -CUICtrlDefaultBtn::OnActivate( - _In_ CONST HWND - ) -{ - return S_OK; -} - -/*++ - -Routine Name: - - CUICtrlDefaultBtn::OnCommand - -Routine Description: - - Default button OnCommand handler. - -Arguments: - - hDlg - handle to the parent window - iCommand - specifies the notification code - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlDefaultBtn::OnCommand( - _In_ CONST HWND hDlg, - _In_ INT iCommand - ) -{ - HRESULT hr = S_OK; - - switch (iCommand) - { - case BN_CLICKED: - { - hr = OnBnClicked(hDlg); - } - break; - - default: - hr = E_NOTIMPL; - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/ui/uictrl.h b/print/XPSDrvSmpl/src/ui/uictrl.h deleted file mode 100644 index 5292e78b..00000000 --- a/print/XPSDrvSmpl/src/ui/uictrl.h +++ /dev/null @@ -1,405 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - uictrl.h - -Abstract: - - Definition of the UI control interface called by the containing property page, - the abstract UI control class and the base default UI controls for check boxe, - list, combo, edit and spin controls. - ---*/ - -#pragma once - -#include "UIProperties.h" - -class CUIControl -{ -public: - CUIControl(); - - virtual ~CUIControl(); - - virtual HRESULT - SetPrintOemDriverUI( - _In_ CONST IPrintOemDriverUI* pOEMDriverUI - ); - - virtual HRESULT - SetOemCUIPParam( - _In_ CONST POEMCUIPPARAM pOemCUIPParam - ); - - virtual HRESULT - SetUIProperties( - _In_ CUIProperties* pUIProperties - ); - - // - // Message handling stubs - // - virtual HRESULT - OnActivate( - _In_ CONST HWND hDlg - ) = 0; - - virtual HRESULT - OnInit( - _In_ CONST HWND hDlg - ); - - virtual HRESULT - OnCommand( - _In_ CONST HWND hDlg, - _In_ INT iCommand - ); - - virtual HRESULT - OnNotify( - _In_ CONST HWND hDlg, - _In_ CONST NMHDR* pNmhdr - ); - -protected: - CComPtr<IPrintOemDriverUI> m_pDriverUIHelp; - - POEMCUIPPARAM m_pOemCUIPParam; - - CUIProperties * m_pUIProperties; -}; - -class CUICtrlDefaultCheck : public CUIControl -{ -public: - CUICtrlDefaultCheck( - _In_ PCSTR gpdString, - _In_ INT iCheckResID - ); - - virtual ~CUICtrlDefaultCheck(); - - HRESULT - OnActivate( - _In_ CONST HWND hDlg - ); - - HRESULT - OnCommand( - _In_ CONST HWND hDlg, - _In_ INT iCommand - ); - -private: - virtual HRESULT - OnBnClicked( - _In_ CONST HWND hDlg - ); - - virtual HRESULT - EnableDependentCtrls( - _In_ CONST HWND hDlg, - _In_ CONST LONG lSel - ); - - CUICtrlDefaultCheck& operator = (CONST CUICtrlDefaultCheck&); - -private: - PCSTR m_szGPDString; - - CONST INT m_iCheckResID; -}; - -class CUICtrlDefaultList : public CUIControl -{ -public: - CUICtrlDefaultList( - _In_ PCSTR gpdString, - _In_ INT iListResID - ); - - virtual ~CUICtrlDefaultList(); - - HRESULT - OnActivate( - _In_ CONST HWND hDlg - ); - - HRESULT - OnCommand( - _In_ CONST HWND hDlg, - _In_ INT iCommand - ); - -protected: - HRESULT - AddString( - _In_ CONST HWND hDlg, - _In_ CONST HINSTANCE hStringResDLL, - _In_ CONST INT idString - ); - -private: - virtual HRESULT - EnableDependentCtrls( - _In_ CONST HWND hDlg, - _In_ CONST LONG lSel - ); - - virtual HRESULT - OnSelChange( - _In_ CONST HWND hDlg - ); - - CUICtrlDefaultList& operator = (CONST CUICtrlDefaultList&); - -private: - PCSTR m_szGPDString; - - CONST INT m_iListResID; -}; - -class CUICtrlDefaultCombo : public CUIControl -{ -public: - CUICtrlDefaultCombo( - _In_ PCSTR gpdString, - _In_ INT iComboResID - ); - - virtual ~CUICtrlDefaultCombo(); - - HRESULT - OnActivate( - _In_ CONST HWND hDlg - ); - - HRESULT - OnCommand( - _In_ CONST HWND hDlg, - _In_ INT iCommand - ); - - virtual HRESULT - OnSelChange( - _In_ CONST HWND hDlg - ); - -protected: - HRESULT - AddString( - _In_ CONST HWND hDlg, - _In_ CONST HINSTANCE hStringResDLL, - _In_ CONST INT idString - ); - -private: - virtual HRESULT - EnableDependentCtrls( - _In_ CONST HWND hDlg, - _In_ CONST LONG lSel - ); - - CUICtrlDefaultCombo& operator = (CONST CUICtrlDefaultCombo&); - -private: - PCSTR m_szGPDString; - - CONST INT m_iComboResID; -}; - -class CUICtrlDefaultSpin; - -class CUICtrlDefaultEditNum : public CUIControl -{ -public: - CUICtrlDefaultEditNum( - _In_ PCSTR propString, - _In_ CONST INT iEditResID, - _In_ CONST INT iPropMin, - _In_ CONST INT iPropMax, - _In_ CONST INT iSpinResID - ); - - virtual ~CUICtrlDefaultEditNum(); - - friend class CUICtrlDefaultSpin; - - HRESULT - virtual OnActivate( - _In_ CONST HWND hDlg - ); - - virtual HRESULT - OnCommand( - _In_ CONST HWND hDlg, - _In_ INT iCommand - ); - -private: - CUICtrlDefaultEditNum() : - m_iEditResID(0), - m_iPropMin(0), - m_iPropMax(0), - m_iSpinResID(0) - {} - - virtual HRESULT - CheckInRange( - _In_ PINT pValue - ); - - virtual HRESULT - OnEnChange( - _In_ CONST HWND hDlg - ); - - CUICtrlDefaultEditNum& operator = (CONST CUICtrlDefaultEditNum&); - - -private: - PCSTR m_szPropString; - - CONST INT m_iPropMin; - - CONST INT m_iPropMax; - - CONST INT m_iEditResID; - - CONST INT m_iSpinResID; -}; - -class CUICtrlDefaultSpin : public CUIControl -{ - -public: - CUICtrlDefaultSpin( - _In_ CUICtrlDefaultEditNum* pEdit - ); - - virtual ~CUICtrlDefaultSpin(); - - virtual HRESULT - OnActivate( - _In_ CONST HWND hDlg - ); - - virtual HRESULT - OnNotify( - _In_ CONST HWND hDlg, - _In_ CONST NMHDR* pNmhdr - ); - - -private: - virtual HRESULT - CheckInRange( - _In_ PINT pValue - ); - - virtual HRESULT - OnDeltaPos( - _In_ CONST HWND hDlg, - _In_ CONST NMUPDOWN* pNmud - ); - - CUICtrlDefaultSpin& operator = (CONST CUICtrlDefaultSpin&); - -private: - PCSTR m_szPropString; - - INT m_iPropMin; - - INT m_iPropMax; - - INT m_iSpinResID; - - INT m_iEditResID; -}; - -class CUICtrlDefaultEditText : public CUIControl -{ -public: - CUICtrlDefaultEditText( - _In_ PCSTR propString, - _In_ CONST INT iEditResID, - _In_ CONST INT cbMaxLength - ); - - virtual ~CUICtrlDefaultEditText(); - - HRESULT - virtual OnActivate( - _In_ CONST HWND hDlg - ); - - virtual HRESULT - OnCommand( - _In_ CONST HWND hDlg, - _In_ INT iCommand - ); - -private: - virtual HRESULT - OnEnChange( - _In_ CONST HWND hDlg - ); - - CUICtrlDefaultEditText& operator = (CONST CUICtrlDefaultEditText&); - - -private: - PCSTR m_szPropString; - - CONST INT m_cbMaxLength; - - CONST INT m_iEditResID; -}; - -class CUICtrlDefaultBtn : public CUIControl -{ -public: - CUICtrlDefaultBtn( - _In_ PCSTR propertyString, - _In_ INT iCheckResID - ); - - virtual ~CUICtrlDefaultBtn(); - - HRESULT - OnActivate( - _In_ CONST HWND hDlg - ); - - HRESULT - OnCommand( - _In_ CONST HWND hDlg, - _In_ INT iCommand - ); - -private: - virtual HRESULT - OnBnClicked( - _In_ CONST HWND hDlg - ) = 0; - - CUICtrlDefaultBtn& operator = (CONST CUICtrlDefaultCheck&); - -protected: - PCSTR m_szPropertyString; - -private: - CONST INT m_iBtnResID; -}; - diff --git a/print/XPSDrvSmpl/src/ui/uiproperties.cpp b/print/XPSDrvSmpl/src/ui/uiproperties.cpp deleted file mode 100644 index c6ceb4e7..00000000 --- a/print/XPSDrvSmpl/src/ui/uiproperties.cpp +++ /dev/null @@ -1,783 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - uiproperties.cpp - -Abstract: - - This class encapsulates all handling of GPD and OEM private devmode settings - used in the XPSDrv feature sample UI. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "xdexcept.h" -#include "uiproperties.h" -#include "privatedefs.h" - -PCSTR g_pszPSScaleWidth = "PageScalingScaleWidth"; -PCSTR g_pszPSScaleHeight = "PageScalingScaleHeight"; -PCSTR g_pszOffsetWidth = "PageScalingOffsetWidth"; -PCSTR g_pszOffsetHeight = "PageScalingOffsetHeight"; -PCSTR g_pszWMTransparency = "PageWatermarkTransparency"; -PCSTR g_pszWMAngle = "PageWatermarkTextAngle"; -PCSTR g_pszWMOffsetWidth = "PageWatermarkOriginWidth"; -PCSTR g_pszWMOffsetHeight = "PageWatermarkOriginHeight"; -PCSTR g_pszWMSizeWidth = "PageWatermarkSizeWidth"; -PCSTR g_pszWMSizeHeight = "PageWatermarkSizeHeight"; -PCSTR g_pszWMFontSize = "PageWatermarkTextFontSize"; -PCSTR g_pszWMFontColor = "PageWatermarkTextColor"; -PCSTR g_pszWMText = "PageWatermarkTextText"; - -/*++ - -Routine Name: - - CUIProperties::CUIProperties - -Routine Description: - - CUIProperties default class constructor. - -Arguments: - - None. - -Return Value: - - None - Throws CXDException(HRESULT) on an error - ---*/ -CUIProperties::CUIProperties(): - m_pOEMDev(NULL) -{ - HRESULT hr = InitialiseMap(); - - if (FAILED(hr)) - { - throw CXDException(hr); - } -} - -/*++ - -Routine Name: - - CUIProperties::CUIProperties - -Routine Description: - - CUIProperties class constructor. - -Arguments: - - pOEMDM - Pointer to an OEMDEV structure. - -Return Value: - - None - Throws CXDException(HRESULT) on an error - ---*/ -CUIProperties::CUIProperties( - POEMDEV pOEMDM): - m_pOEMDev(pOEMDM) -{ - HRESULT hr = InitialiseMap(); - - if (FAILED(hr)) - { - throw CXDException(hr); - } -} - -/*++ - -Routine Name: - - CUIProperties::~CUIProperties - -Routine Description: - - CUIProperties class destructor. - -Arguments: - - None - -Return Value: - - None - ---*/ -CUIProperties::~CUIProperties() -{ -} - -/*++ - -Routine Name: - - CUIProperties::InitialiseMap - -Routine Description: - - Creates a map of GPD names and private OEM devmode properties that will be used by the driver. - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUIProperties::InitialiseMap( - VOID - ) -{ - HRESULT hr = S_OK; - - try - { - // - // Initialise the OEM devmode entries - // - m_PropertyMap[g_pszPSScaleWidth] = UIPropertyPair(sizeof(DWORD), offsetof(OEMDEV, dwPgScaleX)); - m_PropertyMap[g_pszPSScaleHeight] = UIPropertyPair(sizeof(DWORD), offsetof(OEMDEV, dwPgScaleY)); - m_PropertyMap[g_pszOffsetWidth] = UIPropertyPair(sizeof(INT), offsetof(OEMDEV, iPgOffsetX)); - m_PropertyMap[g_pszOffsetHeight] = UIPropertyPair(sizeof(INT), offsetof(OEMDEV, iPgOffsetY)); - m_PropertyMap[g_pszWMTransparency] = UIPropertyPair(sizeof(INT), offsetof(OEMDEV, iWMTransparency)); - m_PropertyMap[g_pszWMAngle] = UIPropertyPair(sizeof(INT), offsetof(OEMDEV, iWMAngle)); - m_PropertyMap[g_pszWMFontSize] = UIPropertyPair(sizeof(INT), offsetof(OEMDEV, iWMFontSize)); - m_PropertyMap[g_pszWMFontColor] = UIPropertyPair(sizeof(DWORD), offsetof(OEMDEV, dwColText)); - m_PropertyMap[g_pszWMOffsetWidth] = UIPropertyPair(sizeof(INT), offsetof(OEMDEV, iWMOffsetX)); - m_PropertyMap[g_pszWMOffsetHeight] = UIPropertyPair(sizeof(INT), offsetof(OEMDEV, iWMOffsetY)); - m_PropertyMap[g_pszWMSizeWidth] = UIPropertyPair(sizeof(INT), offsetof(OEMDEV, iWMWidth)); - m_PropertyMap[g_pszWMSizeHeight] = UIPropertyPair(sizeof(INT), offsetof(OEMDEV, iWMHeight)); - m_PropertyMap[g_pszWMText] = UIPropertyPair(sizeof(TCHAR) * MAX_WATERMARK_TEXT, offsetof(OEMDEV, strWMText)); - - // - // Initialise the GPD OptItem entries. - // NOTE: These options will be removed from the standard Unidrv UI Treeview. - // - m_OptItemList.push_back("JobBindAllDocuments"); - m_OptItemList.push_back("DocumentBinding"); - m_OptItemList.push_back("PageColorManagement"); - m_OptItemList.push_back("PageSourceColorProfile"); - m_OptItemList.push_back("PageICMRenderingIntent"); - m_OptItemList.push_back("PageScaling"); - m_OptItemList.push_back("ScaleOffsetAlignment"); - m_OptItemList.push_back("PageWatermarkType"); - m_OptItemList.push_back("PageWatermarkLayering"); - m_OptItemList.push_back("JobNUpAllDocumentsContiguously"); - m_OptItemList.push_back("JobNUpContiguouslyPresentationOrder"); - m_OptItemList.push_back("DocumentNUp"); - m_OptItemList.push_back("DocumentNUpPresentationOrder"); - m_OptItemList.push_back("PageBorderless"); - m_OptItemList.push_back("PagePhotoPrintingIntent"); - m_OptItemList.push_back("DocumentDuplex"); - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUIProperties::SetItem - -Routine Description: - - This method is used to set properties in the private OEM devmode. - -Arguments: - - pFeatureName - Pointer to the property name. - pUIProperty - Pointer to the property value. - cbSize - Size of the buffer pointed to by pUIProperty. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUIProperties::SetItem( - _In_ PCSTR pFeatureName, - _In_reads_bytes_(cbSize) CONST UIProperty* pUIProperty, - _In_ SIZE_T cbSize - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(m_pOEMDev, E_PENDING))) - { - try - { - UIPropertyMap::const_iterator iterItem = m_PropertyMap.find(pFeatureName); - - if (iterItem != m_PropertyMap.end()) - { - if (iterItem->second.first >= cbSize) - { - memcpy(reinterpret_cast<LPBYTE>(m_pOEMDev) + iterItem->second.second, pUIProperty, cbSize); - } - else - { - hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); - } - } - else - { - hr = E_INVALIDARG; - } - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUIProperties::GetItem - - -Routine Description: - - This method is used to get properties in the private OEM devmode. - -Arguments: - - pFeatureName - Pointer to the property name. - pUIProperty - Pointer to the property value. - cbSize - Size of the buffer pointed to by pUIProperty. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUIProperties::GetItem( - _In_ PCSTR pFeatureName, - _Out_writes_bytes_(cbSize) UIProperty* pUIProperty, - _In_ SIZE_T cbSize - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(m_pOEMDev, E_PENDING))) - { - try - { - UIPropertyMap::const_iterator iterItem = m_PropertyMap.find(pFeatureName); - - if (iterItem != m_PropertyMap.end()) - { - if (iterItem->second.first == cbSize) - { - memcpy(pUIProperty, reinterpret_cast<LPBYTE>(m_pOEMDev) + iterItem->second.second, cbSize); - } - else - { - hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); - } - } - else - { - hr = E_INVALIDARG; - } - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUIProperties::SetHeader - -Routine Description: - - Initialises the Unidrv private header portion of the OEM devmode. - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUIProperties::SetHeader() -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(m_pOEMDev, E_PENDING))) - { - // - //OEM_DMEXTRAHEADER Members - // - m_pOEMDev->dmOEMExtra.dwSize = sizeof(OEMDEV); - m_pOEMDev->dmOEMExtra.dwSignature = OEM_SIGNATURE; - m_pOEMDev->dmOEMExtra.dwVersion = OEM_VERSION; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUIProperties::SetDefaults - -Routine Description: - - Initialises the OEM devmode with default values. - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUIProperties::SetDefaults() -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(m_pOEMDev, E_PENDING))) - { - if (SUCCEEDED(hr = SetHeader())) - { - // - //Private members - // - - // - // Page Scaling - // - m_pOEMDev->dwPgScaleX = pgscParamDefIntegers[ePageScalingScaleWidth].default_value; - m_pOEMDev->dwPgScaleY = pgscParamDefIntegers[ePageScalingScaleHeight].default_value; - m_pOEMDev->iPgOffsetX = MICRON_TO_HUNDREDTH_OFINCH(pgscParamDefIntegers[ePageScalingOffsetWidth].default_value); - m_pOEMDev->iPgOffsetY = MICRON_TO_HUNDREDTH_OFINCH(pgscParamDefIntegers[ePageScalingOffsetHeight].default_value); - - // - // Page Watermark - // - m_pOEMDev->iWMTransparency = wmParamDefIntegers[ePageWatermarkTransparency].default_value; - m_pOEMDev->iWMAngle = wmParamDefIntegers[ePageWatermarkAngle].default_value; - m_pOEMDev->iWMOffsetX = MICRON_TO_HUNDREDTH_OFINCH(wmParamDefIntegers[ePageWatermarkOriginWidth].default_value); - m_pOEMDev->iWMOffsetY = MICRON_TO_HUNDREDTH_OFINCH(wmParamDefIntegers[ePageWatermarkOriginHeight].default_value); - - m_pOEMDev->iWMFontSize = wmParamDefIntegers[ePageWatermarkTextFontSize].default_value; - m_pOEMDev->dwColText = wmParamDefIntegers[ePageWatermarkTextColor].default_value; - - try - { - CStringXD cstrWMText(wmParamDefStrings[ePageWatermarkTextText].default_value); - hr = StringCchCopyN(m_pOEMDev->strWMText, MAX_WATERMARK_TEXT, cstrWMText.GetBuffer(), cstrWMText.GetLength()); - } - catch (CXDException& e) - { - hr = e; - } - - m_pOEMDev->iWMWidth = MICRON_TO_HUNDREDTH_OFINCH(wmParamDefIntegers[ePageWatermarkSizeWidth].default_value); - m_pOEMDev->iWMHeight = MICRON_TO_HUNDREDTH_OFINCH(wmParamDefIntegers[ePageWatermarkSizeHeight].default_value); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUIProperties::Convert - -Routine Description: - - This method is used to convert the OEM private devmode portion of this IUIProperty interface - given another interface as input. - -Arguments: - - pUIProperties - Pointer to the source IUIProperty interface to be converted. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUIProperties::Convert( - _In_ CUIProperties * pUIProperties - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pUIProperties, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pUIProperties->m_pOEMDev, E_PENDING)) && - SUCCEEDED(hr = CHECK_POINTER(m_pOEMDev, E_PENDING))) - { - // - // Check OEM Signature, if it doesn't match ours, - // then just assume DMIn is bad and use defaults. - // - if (m_pOEMDev->dmOEMExtra.dwSignature == pUIProperties->m_pOEMDev->dmOEMExtra.dwSignature) - { - if (SUCCEEDED(hr = SetDefaults())) - { - // Copy the old structure in to the new using which ever size is the smaller. - // Devmode maybe from newer Devmode (not likely since there is only one), or - // Devmode maybe a newer Devmode, in which case it maybe larger, - // but the first part of the structure should be the same. - - // DESIGN ASSUMPTION: the private DEVMODE structure only gets added to; - // the fields that are in the DEVMODE never change only new fields get added to the end. - - DWORD dwSize = __min(m_pOEMDev->dmOEMExtra.dwSize, pUIProperties->m_pOEMDev->dmOEMExtra.dwSize); - memcpy(m_pOEMDev, pUIProperties->m_pOEMDev, dwSize); - - // Re-fill in the size and version fields to indicated - // that the DEVMODE is the current private DEVMODE version. - hr = SetHeader(); - } - } - else - { - hr = SetDefaults(); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUIProperties::Validate - -Routine Description: - - This method is used to ensure that the OEM private devmode is validated. - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUIProperties::Validate() -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(m_pOEMDev, E_PENDING))) - { - // - // ASSUMPTION: pOEMDevmode is large enough to contain OEMDEV structure. - // Make sure that dmOEMExtra indicates the current OEMDEV structure. - // - if (SUCCEEDED(hr = SetHeader())) - { - // - // Page Scaling Members - // - if (m_pOEMDev->dwPgScaleX < static_cast<DWORD>(pgscParamDefIntegers[ePageScalingScaleWidth].min_length) || - m_pOEMDev->dwPgScaleX > static_cast<DWORD>(pgscParamDefIntegers[ePageScalingScaleWidth].max_length)) - { - m_pOEMDev->dwPgScaleX = static_cast<DWORD>(pgscParamDefIntegers[ePageScalingScaleWidth].default_value); - } - - if (m_pOEMDev->dwPgScaleY < static_cast<DWORD>(pgscParamDefIntegers[ePageScalingScaleHeight].min_length) || - m_pOEMDev->dwPgScaleY > static_cast<DWORD>(pgscParamDefIntegers[ePageScalingScaleHeight].max_length)) - { - m_pOEMDev->dwPgScaleY = static_cast<DWORD>(pgscParamDefIntegers[ePageScalingScaleHeight].default_value); - } - - if (m_pOEMDev->iPgOffsetX < MICRON_TO_HUNDREDTH_OFINCH(pgscParamDefIntegers[ePageScalingOffsetWidth].min_length) || - m_pOEMDev->iPgOffsetX > MICRON_TO_HUNDREDTH_OFINCH(pgscParamDefIntegers[ePageScalingOffsetWidth].max_length)) - { - m_pOEMDev->iPgOffsetX = MICRON_TO_HUNDREDTH_OFINCH(pgscParamDefIntegers[ePageScalingOffsetWidth].default_value); - } - - if (m_pOEMDev->iPgOffsetY < MICRON_TO_HUNDREDTH_OFINCH(pgscParamDefIntegers[ePageScalingOffsetHeight].min_length) || - m_pOEMDev->iPgOffsetY > MICRON_TO_HUNDREDTH_OFINCH(pgscParamDefIntegers[ePageScalingOffsetHeight].max_length)) - { - m_pOEMDev->iPgOffsetY = MICRON_TO_HUNDREDTH_OFINCH(pgscParamDefIntegers[ePageScalingOffsetHeight].default_value); - } - - // - // Watermark Members - // - if (m_pOEMDev->iWMTransparency < wmParamDefIntegers[ePageWatermarkTransparency].min_length || - m_pOEMDev->iWMTransparency > wmParamDefIntegers[ePageWatermarkTransparency].max_length) - { - m_pOEMDev->iWMTransparency = wmParamDefIntegers[ePageWatermarkTransparency].default_value; - } - - if (m_pOEMDev->iWMAngle < wmParamDefIntegers[ePageWatermarkAngle].min_length || - m_pOEMDev->iWMAngle > wmParamDefIntegers[ePageWatermarkAngle].max_length) - { - m_pOEMDev->iWMAngle = wmParamDefIntegers[ePageWatermarkAngle].default_value; - } - - if (m_pOEMDev->iWMOffsetX < MICRON_TO_HUNDREDTH_OFINCH(wmParamDefIntegers[ePageWatermarkOriginWidth].min_length) || - m_pOEMDev->iWMOffsetX > MICRON_TO_HUNDREDTH_OFINCH(wmParamDefIntegers[ePageWatermarkOriginWidth].max_length)) - { - m_pOEMDev->iWMOffsetX = MICRON_TO_HUNDREDTH_OFINCH(wmParamDefIntegers[ePageWatermarkOriginWidth].default_value); - } - - if (m_pOEMDev->iWMOffsetY < MICRON_TO_HUNDREDTH_OFINCH(wmParamDefIntegers[ePageWatermarkOriginHeight].min_length) || - m_pOEMDev->iWMOffsetY > MICRON_TO_HUNDREDTH_OFINCH(wmParamDefIntegers[ePageWatermarkOriginHeight].max_length)) - { - m_pOEMDev->iWMOffsetY = MICRON_TO_HUNDREDTH_OFINCH(wmParamDefIntegers[ePageWatermarkOriginHeight].default_value); - } - - if (m_pOEMDev->iWMFontSize < wmParamDefIntegers[ePageWatermarkTextFontSize].min_length || - m_pOEMDev->iWMFontSize > wmParamDefIntegers[ePageWatermarkTextFontSize].max_length) - { - m_pOEMDev->iWMFontSize = wmParamDefIntegers[ePageWatermarkTextFontSize].default_value; - } - - if (m_pOEMDev->dwColText < static_cast<DWORD>(wmParamDefIntegers[ePageWatermarkTextColor].min_length) || - m_pOEMDev->dwColText > static_cast<DWORD>(wmParamDefIntegers[ePageWatermarkTextColor].max_length)) - { - m_pOEMDev->dwColText = wmParamDefIntegers[ePageWatermarkTextColor].default_value; - } - - if (m_pOEMDev->iWMWidth < MICRON_TO_HUNDREDTH_OFINCH(wmParamDefIntegers[ePageWatermarkSizeWidth].min_length) || - m_pOEMDev->iWMWidth > MICRON_TO_HUNDREDTH_OFINCH(wmParamDefIntegers[ePageWatermarkSizeWidth].max_length)) - { - m_pOEMDev->iWMWidth = MICRON_TO_HUNDREDTH_OFINCH(wmParamDefIntegers[ePageWatermarkSizeWidth].default_value); - } - - if (m_pOEMDev->iWMHeight < MICRON_TO_HUNDREDTH_OFINCH(wmParamDefIntegers[ePageWatermarkSizeHeight].min_length) || - m_pOEMDev->iWMHeight > MICRON_TO_HUNDREDTH_OFINCH(wmParamDefIntegers[ePageWatermarkSizeHeight].max_length)) - { - m_pOEMDev->iWMHeight = MICRON_TO_HUNDREDTH_OFINCH(wmParamDefIntegers[ePageWatermarkSizeHeight].default_value); - } - - // - // Valid text is a NULL terminated string of length < MAX_WATERMARK_TEXT - // - size_t cch = 0; - if (FAILED(StringCchLength(m_pOEMDev->strWMText, MAX_WATERMARK_TEXT, &cch))) - { - try - { - CStringXD cstrWMText(wmParamDefStrings[ePageWatermarkTextText].default_value); - hr = StringCchCopyN(m_pOEMDev->strWMText, MAX_WATERMARK_TEXT, cstrWMText.GetBuffer(), cstrWMText.GetLength()); - } - catch (CXDException& e) - { - hr = e; - } - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUIProperties::GetOptItem - -Routine Description: - - This method is used to get properties in the GPD. - -Arguments: - - pOemCUIPParam - Pointer to the POEMCUIPPARAM function. - pFeatureName - Pointer to a GPD property name. - ppOptItem - Address of a pointer that will be filled out with an OPTITEM structure. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUIProperties::GetOptItem( - _In_ POEMCUIPPARAM pOemCUIPParam, - _In_ PCSTR pFeatureName, - _Outptr_result_maybenull_ POPTITEM* ppOptItem - ) -{ - HRESULT hr = S_OK; - POPTITEM pOIResult = NULL; - - if (SUCCEEDED(hr = CHECK_POINTER(pOemCUIPParam, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pOemCUIPParam->pDrvOptItems, E_PENDING)) && - SUCCEEDED(hr = CHECK_POINTER(pFeatureName, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(ppOptItem, E_POINTER))) - { - *ppOptItem = NULL; - - for (DWORD indexOptItem = 0; indexOptItem < pOemCUIPParam->cDrvOptItems; indexOptItem++) - { - pOIResult = &(pOemCUIPParam->pDrvOptItems[indexOptItem]); - - if (pOIResult->UserData != NULL) - { - PUSERDATA pUserData = reinterpret_cast<PUSERDATA>(pOIResult->UserData); - if (SUCCEEDED(hr = CHECK_POINTER(pUserData->pKeyWordName, E_FAIL))) - { - if (strncmp(pUserData->pKeyWordName, pFeatureName, strlen(pFeatureName)) == 0) - { - hr = S_OK; - *ppOptItem = pOIResult; - break; - } - else - { - hr = E_ELEMENT_NOT_FOUND; - } - } - } - else - { - hr = E_FAIL; - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUIProperties::HideOptItems - -Routine Description: - - Ensures that all GPD settings managed by the UI Plug-in are removed from the main Unidrv driver UI. - -Arguments: - - pOemCUIPParam - Pointer to the POEMCUIPPARAM function. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUIProperties::HideOptItems( - _In_ POEMCUIPPARAM pOemCUIPParam - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pOemCUIPParam, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pOemCUIPParam->pDrvOptItems, E_PENDING))) - { - POPTITEM pOptItem = NULL; - - try - { - UIOptItemList::const_iterator iterOptItem = m_OptItemList.begin(); - - for (; iterOptItem != m_OptItemList.end() && SUCCEEDED(hr); iterOptItem++) - { - if (SUCCEEDED(hr = GetOptItem(pOemCUIPParam, *iterOptItem, &pOptItem)) && - SUCCEEDED(hr = CHECK_POINTER(pOptItem, E_FAIL))) - { - pOptItem->Flags |= OPTIF_HIDE; - } - } - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - - diff --git a/print/XPSDrvSmpl/src/ui/uiproperties.h b/print/XPSDrvSmpl/src/ui/uiproperties.h deleted file mode 100644 index 7fe0ab85..00000000 --- a/print/XPSDrvSmpl/src/ui/uiproperties.h +++ /dev/null @@ -1,111 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - uiproperties.h - -Abstract: - - This class encapsulates all handling of GPD and OEM private devmode settings - used in the XPSDrv feature sample UI. - ---*/ - -#pragma once - -#include "devmode.h" - -extern PCSTR g_pszPSScaleWidth; -extern PCSTR g_pszPSScaleHeight; -extern PCSTR g_pszOffsetWidth; -extern PCSTR g_pszOffsetHeight; -extern PCSTR g_pszWMTransparency; -extern PCSTR g_pszWMAngle; -extern PCSTR g_pszWMOffsetWidth; -extern PCSTR g_pszWMOffsetHeight; -extern PCSTR g_pszWMSizeWidth; -extern PCSTR g_pszWMSizeHeight; -extern PCSTR g_pszWMFontSize; -extern PCSTR g_pszWMFontColor; -extern PCSTR g_pszWMText; - -// -// Forward declaration -// -class CUIProperties; - -typedef VOID UIProperty; - -typedef pair<SIZE_T, SIZE_T> UIPropertyPair; -typedef map<CStringXDA, UIPropertyPair> UIPropertyMap; - -typedef vector<CStringXDA> UIOptItemList; - -class CUIProperties -{ -public: - CUIProperties(); - - CUIProperties(POEMDEV pOEMDev); - - virtual ~CUIProperties(); - - HRESULT - GetItem( - _In_ PCSTR pFeatureName, - _Out_writes_bytes_(cbSize) UIProperty* pUIProperty, - _In_ SIZE_T cbSize - ); - - HRESULT - SetItem( - _In_ PCSTR pFeatureName, - _In_reads_bytes_(cbSize) CONST UIProperty* pUIProperty, - _In_ SIZE_T cbSize - ); - - HRESULT - SetDefaults(); - - HRESULT - Validate(); - - HRESULT - Convert( - _In_ CUIProperties* pUIProperties - ); - - HRESULT - GetOptItem( - _In_ POEMCUIPPARAM pOemCUIPParam, - _In_ PCSTR pFeatureName, - _Outptr_result_maybenull_ POPTITEM* ppOptItem - ); - - HRESULT - HideOptItems( - _In_ POEMCUIPPARAM pOemCUIPParam - ); - -private: - HRESULT SetHeader(); - - HRESULT InitialiseMap(); - -private: - POEMDEV m_pOEMDev; - - UIPropertyMap m_PropertyMap; - - UIOptItemList m_OptItemList; -}; - diff --git a/print/XPSDrvSmpl/src/ui/wmctrls.cpp b/print/XPSDrvSmpl/src/ui/wmctrls.cpp deleted file mode 100644 index 66647cc3..00000000 --- a/print/XPSDrvSmpl/src/ui/wmctrls.cpp +++ /dev/null @@ -1,1381 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - wmctrls.cpp - -Abstract: - - Implementation of the watermark specific UI controls. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "resource.h" -#include "wmctrls.h" -#include "privatedefs.h" - -PCSTR CUICtrlWMTypeCombo::m_pszWMType = "PageWatermarkType"; - -PCSTR CUICtrlWMLayeringCombo::m_pszWMLayering = "PageWatermarkLayering"; -PCSTR CUICtrlWMTransparencyEdit::m_pszWMTransparency = "PageWatermarkTransparency"; -PCSTR CUICtrlWMTransparencySpin::m_pszWMTransparency = "PageWatermarkTransparency"; -PCSTR CUICtrlWMAngleEdit::m_pszWMAngle = "PageWatermarkTextAngle"; -PCSTR CUICtrlWMAngleSpin::m_pszWMAngle = "PageWatermarkTextAngle"; -PCSTR CUICtrlWMOffsetXEdit::m_pszWMOffsetX = "PageWatermarkOriginWidth"; -PCSTR CUICtrlWMOffsetXSpin::m_pszWMOffsetX = "PageWatermarkOriginWidth"; -PCSTR CUICtrlWMOffsetYEdit::m_pszWMOffsetY = "PageWatermarkOriginHeight"; -PCSTR CUICtrlWMOffsetYSpin::m_pszWMOffsetY = "PageWatermarkOriginHeight"; - -PCSTR CUICtrlWMWidthEdit::m_pszWMWidth = "PageWatermarkSizeWidth"; -PCSTR CUICtrlWMWidthSpin::m_pszWMWidth = "PageWatermarkSizeWidth"; -PCSTR CUICtrlWMHeightEdit::m_pszWMHeight = "PageWatermarkSizeHeight"; -PCSTR CUICtrlWMHeightSpin::m_pszWMHeight = "PageWatermarkSizeHeight"; - -PCSTR CUICtrlWMTextEdit::m_pszWMText = "PageWatermarkTextText"; - -PCSTR CUICtrlWMFontSizeEdit::m_pszWMFontSize = "PageWatermarkTextFontSize"; -PCSTR CUICtrlWMFontSizeSpin::m_pszWMFontSize = "PageWatermarkTextFontSize"; - -PCSTR CUICtrlColorBtn::m_pszWMFontColor = "PageWatermarkTextColor"; - -#define WMTYPE_NONE_SEL 0 -#define WMTYPE_TEXT_SEL 1 -#define WMTYPE_RAST_SEL 2 -#define WMTYPE_VECT_SEL 3 - -// -// Watermark type combo box control -// -/*++ - -Routine Name: - - CUICtrlWMTypeCombo::CUICtrlWMTypeCombo - -Routine Description: - - CUICtrlWMTypeCombo class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMTypeCombo::CUICtrlWMTypeCombo() : - CUICtrlDefaultCombo(m_pszWMType, IDC_COMBO_WMTYPE) -{ -} - -/*++ - -Routine Name: - - CUICtrlWMTypeCombo::~CUICtrlWMTypeCombo - -Routine Description: - - CUICtrlWMTypeCombo class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMTypeCombo::~CUICtrlWMTypeCombo() -{ -} - -/*++ - -Routine Name: - - CUICtrlWMTypeCombo::OnInit - -Routine Description: - - This is responsible for initialising the control and is called when - the WM_INITDIALOG message is recieved. This method populates the combo - box with the appropriate option strings. - -Arguments: - - hDlg - handle to the parent window - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlWMTypeCombo::OnInit( - _In_ CONST HWND hDlg - ) -{ - HRESULT hr = S_OK; - - // - // Populate the combo box - // - if (SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_NONE)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_TEXT)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_RASTERIMAGE))) - { - hr = AddString(hDlg, g_hInstance, IDS_GPD_VECTORIMAGE); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUICtrlWMTypeCombo::EnableDependentCtrls - -Routine Description: - - This method is used to enable or disable other controls in the UI based on the - current combo box selection. - -Arguments: - - hDlg - handle to the parent window - lSel - current combo box selection - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlWMTypeCombo::EnableDependentCtrls( - _In_ CONST HWND hDlg, - _In_ CONST LONG lSel - ) -{ - HRESULT hr = S_OK; - HWND hWnd = NULL; - - BOOL bWatermarkEnabled = (lSel != WMTYPE_NONE_SEL); - BOOL bRasterType = (lSel == WMTYPE_RAST_SEL); - BOOL bVectorType = (lSel == WMTYPE_VECT_SEL); - BOOL bTextType = (lSel == WMTYPE_TEXT_SEL); - - // - // Common Watermark Properties - // - // Here we are enabling/disabling common watermark controls based off the current - // watermark option. - // - // If a watermark is selected we enable the layering, transparentcy offset and angle controls - // - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_COMBO_WMLAYERING), E_HANDLE))) - { - EnableWindow(hWnd, bWatermarkEnabled); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_TXT_WMLAYERING), E_HANDLE))) - { - EnableWindow(hWnd, bWatermarkEnabled); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_EDIT_WMTRANSPARENCY), E_HANDLE))) - { - EnableWindow(hWnd, bWatermarkEnabled); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_SPIN_WMTRANSPARENCY), E_HANDLE))) - { - EnableWindow(hWnd, bWatermarkEnabled); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_TXT_WMTRANSPARENCY), E_HANDLE))) - { - EnableWindow(hWnd, bWatermarkEnabled); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_EDIT_WMANGLE), E_HANDLE))) - { - EnableWindow(hWnd, bWatermarkEnabled); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_SPIN_WMANGLE), E_HANDLE))) - { - EnableWindow(hWnd, bWatermarkEnabled); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_TXT_WMANGLE), E_HANDLE))) - { - EnableWindow(hWnd, bWatermarkEnabled); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_EDIT_WMOFFX), E_HANDLE))) - { - EnableWindow(hWnd, bWatermarkEnabled); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_SPIN_WMOFFX), E_HANDLE))) - { - EnableWindow(hWnd, bWatermarkEnabled); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_TXT_WMOFFX), E_HANDLE))) - { - EnableWindow(hWnd, bWatermarkEnabled); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_EDIT_WMOFFY), E_HANDLE))) - { - EnableWindow(hWnd, bWatermarkEnabled); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_SPIN_WMOFFY), E_HANDLE))) - { - EnableWindow(hWnd, bWatermarkEnabled); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_TXT_WMOFFY), E_HANDLE))) - { - EnableWindow(hWnd, bWatermarkEnabled); - } - - // - // Vector / Bitmap Watermark Properties - // - // Here we are enabling/disabling vector/bitmap watermark controls based off the current - // watermark option. - // - // If a vector or bitmap watermark is selected we enable the width and height controls - // - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_EDIT_WMWIDTH), E_HANDLE))) - { - EnableWindow(hWnd, (bRasterType || bVectorType)); - ShowWindow(hWnd, (bRasterType || bVectorType) ? SW_SHOW : SW_HIDE); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_SPIN_WMWIDTH), E_HANDLE))) - { - EnableWindow(hWnd, (bRasterType || bVectorType)); - ShowWindow(hWnd, (bRasterType || bVectorType) ? SW_SHOW : SW_HIDE); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_TXT_WMWIDTH), E_HANDLE))) - { - EnableWindow(hWnd, (bRasterType || bVectorType)); - ShowWindow(hWnd, (bRasterType || bVectorType) ? SW_SHOW : SW_HIDE); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_EDIT_WMHEIGHT), E_HANDLE))) - { - EnableWindow(hWnd, (bRasterType || bVectorType)); - ShowWindow(hWnd, (bRasterType || bVectorType) ? SW_SHOW : SW_HIDE); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_SPIN_WMHEIGHT), E_HANDLE))) - { - EnableWindow(hWnd, (bRasterType || bVectorType)); - ShowWindow(hWnd, (bRasterType || bVectorType) ? SW_SHOW : SW_HIDE); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_TXT_WMHEIGHT), E_HANDLE))) - { - EnableWindow(hWnd, (bRasterType || bVectorType)); - ShowWindow(hWnd, (bRasterType || bVectorType) ? SW_SHOW : SW_HIDE); - } - - // - // Text Watermark Properties - // - // Here we are enabling/disabling text watermark controls based off the current - // watermark option. - // - // If a text watermark is selected we enable the text and font controls - // - if (SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_EDIT_WMTEXT), E_HANDLE))) - { - EnableWindow(hWnd, bTextType); - ShowWindow(hWnd, bTextType ? SW_SHOW : SW_HIDE); - } - - if (SUCCEEDED(hr) && - (SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_TXT_WMTEXT), E_HANDLE)))) - { - EnableWindow(hWnd, bTextType); - ShowWindow(hWnd, bTextType ? SW_SHOW : SW_HIDE); - } - - if (SUCCEEDED(hr) && - (SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_EDIT_WMSIZE), E_HANDLE)))) - { - EnableWindow(hWnd, bTextType); - ShowWindow(hWnd, bTextType ? SW_SHOW : SW_HIDE); - } - - if (SUCCEEDED(hr) && - (SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_SPIN_WMSIZE), E_HANDLE)))) - { - EnableWindow(hWnd, bTextType); - ShowWindow(hWnd, bTextType ? SW_SHOW : SW_HIDE); - } - - if (SUCCEEDED(hr) && - (SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_TXT_WMSIZE), E_HANDLE)))) - { - EnableWindow(hWnd, bTextType); - ShowWindow(hWnd, bTextType ? SW_SHOW : SW_HIDE); - } - - if (SUCCEEDED(hr) && - (SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_BUTTON_WMCOLOR), E_HANDLE)))) - { - EnableWindow(hWnd, bTextType); - ShowWindow(hWnd, bTextType ? SW_SHOW : SW_HIDE); - } - - if (FAILED(hr)) - { - hr = HRESULT_FROM_WIN32(GetLastError()); - } - - ERR_ON_HR(hr); - return hr; -} - -// -// Watermark Layering combo box control -// -/*++ - -Routine Name: - - CUICtrlWMLayeringCombo::CUICtrlWMLayeringCombo - -Routine Description: - - CUICtrlWMLayeringCombo class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMLayeringCombo::CUICtrlWMLayeringCombo() : - CUICtrlDefaultCombo(m_pszWMLayering, IDC_COMBO_WMLAYERING) -{ -} - -/*++ - -Routine Name: - - CUICtrlWMLayeringCombo::~CUICtrlWMLayeringCombo - -Routine Description: - - CUICtrlWMLayeringCombo class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMLayeringCombo::~CUICtrlWMLayeringCombo() -{ -} - -/*++ - -Routine Name: - - CUICtrlWMLayeringCombo::OnInit - -Routine Description: - - This is responsible for initialising the control and is called when - the WM_INITDIALOG message is recieved. This method populates the combo - box with the appropriate option strings. - -Arguments: - - hDlg - handle to the parent window - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlWMLayeringCombo::OnInit( - _In_ CONST HWND hDlg - ) -{ - HRESULT hr = S_OK; - - // - // Populate the combo box - // - if (SUCCEEDED (hr = AddString(hDlg, g_hInstance, IDS_GPD_OVERLAYED))) - { - hr = AddString(hDlg, g_hInstance, IDS_GPD_UNDERLAYED); - } - - ERR_ON_HR(hr); - return hr; -} - -// -// Watermark text combo box control -// -/*++ - -Routine Name: - - CUICtrlWMTextEdit::CUICtrlWMTextEdit - -Routine Description: - - CUICtrlWMTextEdit class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMTextEdit::CUICtrlWMTextEdit() : - CUICtrlDefaultEditText(m_pszWMText, - IDC_EDIT_WMTEXT, - MAX_WATERMARK_TEXT) -{ -} - -/*++ - -Routine Name: - - CUICtrlWMTextEdit::~CUICtrlWMTextEdit - -Routine Description: - - CUICtrlWMTextEdit class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMTextEdit::~CUICtrlWMTextEdit() -{ -} - -// -// Page Watermark Transparency -// - -/*++ - -Routine Name: - - CUICtrlWMTransparencyEdit::CUICtrlWMTransparencyEdit - -Routine Description: - - CUICtrlWMTransparencyEdit class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMTransparencyEdit::CUICtrlWMTransparencyEdit() : - CUICtrlDefaultEditNum(m_pszWMTransparency, - IDC_EDIT_WMTRANSPARENCY, - wmParamDefIntegers[ePageWatermarkTransparency].min_length, - wmParamDefIntegers[ePageWatermarkTransparency].max_length, - IDC_SPIN_WMTRANSPARENCY) -{ -} - -/*++ - -Routine Name: - - CUICtrlWMTransparencyEdit::~CUICtrlWMTransparencyEdit - -Routine Description: - - CUICtrlWMTransparencyEdit class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMTransparencyEdit::~CUICtrlWMTransparencyEdit() -{ -} - -/*++ - -Routine Name: - - CUICtrlWMTransparencySpin::CUICtrlWMTransparencySpin - -Routine Description: - - CUICtrlWMTransparencySpin class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMTransparencySpin::CUICtrlWMTransparencySpin( - _In_ CUICtrlDefaultEditNum* pEdit - ) : - CUICtrlDefaultSpin(pEdit) -{ -} - -/*++ - -Routine Name: - - CUICtrlWMTransparencySpin::~CUICtrlWMTransparencySpin - -Routine Description: - - CUICtrlWMTransparencySpin class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMTransparencySpin::~CUICtrlWMTransparencySpin() -{ -} - -// -// Page Watermark Angle -// - -/*++ - -Routine Name: - - CUICtrlWMAngleEdit::CUICtrlWMAngleEdit - -Routine Description: - - CUICtrlWMAngleEdit class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMAngleEdit::CUICtrlWMAngleEdit() : - CUICtrlDefaultEditNum(m_pszWMAngle, - IDC_EDIT_WMANGLE, - wmParamDefIntegers[ePageWatermarkAngle].min_length, - wmParamDefIntegers[ePageWatermarkAngle].max_length, - IDC_SPIN_WMANGLE) -{ -} - -/*++ - -Routine Name: - - CUICtrlWMAngleEdit::~CUICtrlWMAngleEdit - -Routine Description: - - CUICtrlWMAngleEdit class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMAngleEdit::~CUICtrlWMAngleEdit() -{ -} - -/*++ - -Routine Name: - - CUICtrlWMAngleSpin::CUICtrlWMAngleSpin - -Routine Description: - - CUICtrlWMAngleSpin class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMAngleSpin::CUICtrlWMAngleSpin( - _In_ CUICtrlDefaultEditNum* pEdit - ) : - CUICtrlDefaultSpin(pEdit) -{ -} - -/*++ - -Routine Name: - - CUICtrlWMAngleSpin::~CUICtrlWMAngleSpin - -Routine Description: - - CUICtrlWMAngleSpin class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMAngleSpin::~CUICtrlWMAngleSpin() -{ -} - -// -// Page Watermark Offset X -// - -/*++ - -Routine Name: - - CUICtrlWMOffsetXEdit::CUICtrlWMOffsetXEdit - -Routine Description: - - CUICtrlWMOffsetXEdit class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMOffsetXEdit::CUICtrlWMOffsetXEdit() : - CUICtrlDefaultEditNum(m_pszWMOffsetX, - IDC_EDIT_WMOFFX, - MICRON_TO_HUNDREDTH_OFINCH(wmParamDefIntegers[ePageWatermarkOriginWidth].min_length), - MICRON_TO_HUNDREDTH_OFINCH(wmParamDefIntegers[ePageWatermarkOriginWidth].max_length), - IDC_SPIN_WMOFFX) -{ -} - -/*++ - -Routine Name: - - CUICtrlWMOffsetXEdit::~CUICtrlWMOffsetXEdit - -Routine Description: - - CUICtrlWMOffsetXEdit class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMOffsetXEdit::~CUICtrlWMOffsetXEdit() -{ -} - -/*++ - -Routine Name: - - CUICtrlWMOffsetXSpin::CUICtrlWMOffsetXSpin - -Routine Description: - - CUICtrlWMOffsetXSpin class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMOffsetXSpin::CUICtrlWMOffsetXSpin( - _In_ CUICtrlDefaultEditNum* pEdit - ) : - CUICtrlDefaultSpin(pEdit) -{ -} - -/*++ - -Routine Name: - - CUICtrlWMOffsetXSpin::~CUICtrlWMOffsetXSpin - -Routine Description: - - CUICtrlWMOffsetXSpin class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMOffsetXSpin::~CUICtrlWMOffsetXSpin() -{ -} - -// -// Page Watermark Offset Y -// - -/*++ - -Routine Name: - - CUICtrlWMOffsetYEdit::CUICtrlWMOffsetYEdit - -Routine Description: - - CUICtrlWMOffsetYEdit class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMOffsetYEdit::CUICtrlWMOffsetYEdit() : - CUICtrlDefaultEditNum(m_pszWMOffsetY, - IDC_EDIT_WMOFFY, - MICRON_TO_HUNDREDTH_OFINCH(wmParamDefIntegers[ePageWatermarkOriginHeight].min_length), - MICRON_TO_HUNDREDTH_OFINCH(wmParamDefIntegers[ePageWatermarkOriginHeight].max_length), - IDC_SPIN_WMOFFY) -{ -} - -/*++ - -Routine Name: - - CUICtrlWMOffsetYEdit::~CUICtrlWMOffsetYEdit - -Routine Description: - - CUICtrlWMOffsetYEdit class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMOffsetYEdit::~CUICtrlWMOffsetYEdit() -{ -} - -/*++ - -Routine Name: - - CUICtrlWMOffsetYSpin::CUICtrlWMOffsetYSpin - -Routine Description: - - CUICtrlWMOffsetYSpin class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMOffsetYSpin::CUICtrlWMOffsetYSpin( - _In_ CUICtrlDefaultEditNum* pEdit - ) : - CUICtrlDefaultSpin(pEdit) -{ -} - -/*++ - -Routine Name: - - CUICtrlWMOffsetYSpin::~CUICtrlWMOffsetYSpin - -Routine Description: - - CUICtrlWMOffsetYSpin class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMOffsetYSpin::~CUICtrlWMOffsetYSpin() -{ -} - -// -// Page Watermark Width -// - -/*++ - -Routine Name: - - CUICtrlWMWidthEdit::CUICtrlWMWidthEdit - -Routine Description: - - CUICtrlWMWidthEdit class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMWidthEdit::CUICtrlWMWidthEdit() : - CUICtrlDefaultEditNum(m_pszWMWidth, - IDC_EDIT_WMWIDTH, - MICRON_TO_HUNDREDTH_OFINCH(wmParamDefIntegers[ePageWatermarkSizeWidth].min_length), - MICRON_TO_HUNDREDTH_OFINCH(wmParamDefIntegers[ePageWatermarkSizeWidth].max_length), - IDC_SPIN_WMWIDTH) -{ -} - -/*++ - -Routine Name: - - CUICtrlWMWidthEdit::~CUICtrlWMWidthEdit - -Routine Description: - - CUICtrlWMWidthEdit class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMWidthEdit::~CUICtrlWMWidthEdit() -{ -} - -/*++ - -Routine Name: - - CUICtrlWMWidthSpin::CUICtrlWMWidthSpin - -Routine Description: - - CUICtrlWMWidthSpin class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMWidthSpin::CUICtrlWMWidthSpin( - _In_ CUICtrlDefaultEditNum* pEdit - ) : - CUICtrlDefaultSpin(pEdit) -{ -} - -/*++ - -Routine Name: - - CUICtrlWMWidthSpin::~CUICtrlWMWidthSpin - -Routine Description: - - CUICtrlWMWidthSpin class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMWidthSpin::~CUICtrlWMWidthSpin() -{ -} - -// -// Page Watermark Height -// - -/*++ - -Routine Name: - - CUICtrlWMHeightEdit::CUICtrlWMHeightEdit - -Routine Description: - - CUICtrlWMHeightEdit class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMHeightEdit::CUICtrlWMHeightEdit() : - CUICtrlDefaultEditNum(m_pszWMHeight, - IDC_EDIT_WMHEIGHT, - MICRON_TO_HUNDREDTH_OFINCH(wmParamDefIntegers[ePageWatermarkSizeHeight].min_length), - MICRON_TO_HUNDREDTH_OFINCH(wmParamDefIntegers[ePageWatermarkSizeHeight].max_length), - IDC_SPIN_WMHEIGHT) -{ -} - -/*++ - -Routine Name: - - CUICtrlWMHeightEdit::~CUICtrlWMHeightEdit - -Routine Description: - - CUICtrlWMHeightEdit class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMHeightEdit::~CUICtrlWMHeightEdit() -{ -} - -/*++ - -Routine Name: - - CUICtrlWMHeightSpin::CUICtrlWMHeightSpin - -Routine Description: - - CUICtrlWMHeightSpin class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMHeightSpin::CUICtrlWMHeightSpin( - _In_ CUICtrlDefaultEditNum* pEdit - ) : - CUICtrlDefaultSpin(pEdit) -{ -} - -/*++ - -Routine Name: - - CUICtrlWMHeightSpin::~CUICtrlWMHeightSpin - -Routine Description: - - CUICtrlWMHeightSpin class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMHeightSpin::~CUICtrlWMHeightSpin() -{ -} - -// -// Page Watermark Font Size -// - -/*++ - -Routine Name: - - CUICtrlWMFontSizeEdit::CUICtrlWMFontSizeEdit - -Routine Description: - - CUICtrlWMFontSizeEdit class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMFontSizeEdit::CUICtrlWMFontSizeEdit() : - CUICtrlDefaultEditNum(m_pszWMFontSize, - IDC_EDIT_WMSIZE, - wmParamDefIntegers[ePageWatermarkTextFontSize].min_length, - wmParamDefIntegers[ePageWatermarkTextFontSize].max_length, - IDC_SPIN_WMSIZE) -{ -} - -/*++ - -Routine Name: - - CUICtrlWMFontSizeEdit::~CUICtrlWMFontSizeEdit - -Routine Description: - - CUICtrlWMFontSizeEdit class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMFontSizeEdit::~CUICtrlWMFontSizeEdit() -{ -} - -/*++ - -Routine Name: - - CUICtrlWMHeightSpin::CUICtrlWMHeightSpin - -Routine Description: - - CUICtrlWMHeightSpin class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMFontSizeSpin::CUICtrlWMFontSizeSpin( - _In_ CUICtrlDefaultEditNum* pEdit - ) : - CUICtrlDefaultSpin(pEdit) -{ -} - -/*++ - -Routine Name: - - CUICtrlWMFontSizeSpin::~CUICtrlWMFontSizeSpin - -Routine Description: - - CUICtrlWMFontSizeSpin class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMFontSizeSpin::~CUICtrlWMFontSizeSpin() -{ -} - -/*++ - -Routine Name: - - CUICtrlWMFontSizeSpin::~CUICtrlWMFontSizeSpin - -Routine Description: - - CUICtrlWMFontSizeSpin class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlColorBtn::CUICtrlColorBtn() : - CUICtrlDefaultBtn(m_pszWMFontColor, IDC_BUTTON_WMCOLOR) -{ -} - -/*++ - -Routine Name: - - CUICtrlColorBtn::~CUICtrlColorBtn - -Routine Description: - - CUICtrlColorBtn class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlColorBtn::~CUICtrlColorBtn() -{ -} - -/*++ - -Routine Name: - - CUICtrlColorBtn::OnBnClicked - -Routine Description: - - Color button clicked handler - -Arguments: - - hDlg - handle to the parent window - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlColorBtn::OnBnClicked( - _In_ CONST HWND hDlg - ) -{ - HRESULT hr = S_OK; - - ASSERTMSG(m_pUIProperties != NULL, "NULL pointer to UI properties interface.\n"); - - DWORD colorText = 0; - if (SUCCEEDED(hr = CHECK_HANDLE(hDlg, E_HANDLE)) && - SUCCEEDED(hr = CHECK_POINTER(m_pUIProperties, E_PENDING)) && - SUCCEEDED(hr = m_pUIProperties->GetItem(m_szPropertyString, reinterpret_cast<UIProperty*>(&colorText), sizeof(colorText)))) - { - PBYTE pChannels = reinterpret_cast<PBYTE>(&colorText); - - COLORREF colorsCust[16] = {0}; - COLORREF rgbIn = RGB(pChannels[2], pChannels[1], pChannels[0]); - - colorsCust[0] = rgbIn; - - CHOOSECOLOR chooseColor = { - sizeof(CHOOSECOLOR), - hDlg, - NULL, - colorText, - colorsCust, - CC_RGBINIT | CC_SOLIDCOLOR, - NULL, - NULL, - NULL - }; - - if (ChooseColor(&chooseColor) && - chooseColor.rgbResult != rgbIn) - { - pChannels[2] = GetRValue(chooseColor.rgbResult); - pChannels[1] = GetGValue(chooseColor.rgbResult); - pChannels[0] = GetBValue(chooseColor.rgbResult); - - if (SUCCEEDED(hr = m_pUIProperties->SetItem(m_szPropertyString, reinterpret_cast<UIProperty*>(&colorText), sizeof(colorText)))) - { - PropSheet_Changed(GetParent(hDlg), hDlg); - } - } - } - - ERR_ON_HR(hr); - return hr; -} - - diff --git a/print/XPSDrvSmpl/src/ui/wmctrls.h b/print/XPSDrvSmpl/src/ui/wmctrls.h deleted file mode 100644 index ed5e7d98..00000000 --- a/print/XPSDrvSmpl/src/ui/wmctrls.h +++ /dev/null @@ -1,259 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - wmctrls.h - -Abstract: - - Definition of the watermark specific UI controls. - ---*/ - -#pragma once - -#include "uictrl.h" - -class CUICtrlWMTypeCombo : public CUICtrlDefaultCombo -{ -public: - CUICtrlWMTypeCombo(); - - virtual ~CUICtrlWMTypeCombo(); - - HRESULT - OnInit( - _In_ CONST HWND hDlg - ); - -private: - HRESULT - EnableDependentCtrls( - _In_ CONST HWND hDlg, - _In_ CONST LONG lSel - ); - -private: - static PCSTR m_pszWMType; -}; - -class CUICtrlWMLayeringCombo : public CUICtrlDefaultCombo -{ -public: - CUICtrlWMLayeringCombo(); - - virtual ~CUICtrlWMLayeringCombo(); - - HRESULT - OnInit( - _In_ CONST HWND hDlg - ); - -private: - static PCSTR m_pszWMLayering; -}; - -class CUICtrlWMTextEdit : public CUICtrlDefaultEditText -{ -public: - CUICtrlWMTextEdit(); - - virtual ~CUICtrlWMTextEdit(); - -private: - static PCSTR m_pszWMText; -}; - -class CUICtrlWMTransparencyEdit : public CUICtrlDefaultEditNum -{ -public: - CUICtrlWMTransparencyEdit(); - - virtual ~CUICtrlWMTransparencyEdit(); - -private: - static PCSTR m_pszWMTransparency; -}; - -class CUICtrlWMTransparencySpin : public CUICtrlDefaultSpin -{ -public: - CUICtrlWMTransparencySpin( - _In_ CUICtrlDefaultEditNum* pEdit - ); - - virtual ~CUICtrlWMTransparencySpin(); - -private: - static PCSTR m_pszWMTransparency; -}; - -class CUICtrlWMAngleEdit : public CUICtrlDefaultEditNum -{ -public: - CUICtrlWMAngleEdit(); - - virtual ~CUICtrlWMAngleEdit(); - -private: - static PCSTR m_pszWMAngle; -}; - -class CUICtrlWMAngleSpin : public CUICtrlDefaultSpin -{ -public: - CUICtrlWMAngleSpin( - _In_ CUICtrlDefaultEditNum* pEdit - ); - - virtual ~CUICtrlWMAngleSpin(); - -private: - static PCSTR m_pszWMAngle; -}; - -class CUICtrlWMOffsetXEdit : public CUICtrlDefaultEditNum -{ -public: - CUICtrlWMOffsetXEdit(); - - virtual ~CUICtrlWMOffsetXEdit(); - -private: - static PCSTR m_pszWMOffsetX; -}; - -class CUICtrlWMOffsetXSpin : public CUICtrlDefaultSpin -{ -public: - CUICtrlWMOffsetXSpin( - _In_ CUICtrlDefaultEditNum* pEdit - ); - - virtual ~CUICtrlWMOffsetXSpin(); - -private: - static PCSTR m_pszWMOffsetX; -}; - -class CUICtrlWMOffsetYEdit : public CUICtrlDefaultEditNum -{ -public: - CUICtrlWMOffsetYEdit(); - - virtual ~CUICtrlWMOffsetYEdit(); - -private: - static PCSTR m_pszWMOffsetY; -}; - -class CUICtrlWMOffsetYSpin : public CUICtrlDefaultSpin -{ -public: - CUICtrlWMOffsetYSpin( - _In_ CUICtrlDefaultEditNum* pEdit - ); - - virtual ~CUICtrlWMOffsetYSpin(); - -private: - static PCSTR m_pszWMOffsetY; -}; - -class CUICtrlWMWidthEdit : public CUICtrlDefaultEditNum -{ -public: - CUICtrlWMWidthEdit(); - - virtual ~CUICtrlWMWidthEdit(); - -private: - static PCSTR m_pszWMWidth; -}; - -class CUICtrlWMWidthSpin : public CUICtrlDefaultSpin -{ -public: - CUICtrlWMWidthSpin( - _In_ CUICtrlDefaultEditNum* pEdit - ); - - virtual ~CUICtrlWMWidthSpin(); - -private: - static PCSTR m_pszWMWidth; -}; - -class CUICtrlWMHeightEdit : public CUICtrlDefaultEditNum -{ -public: - CUICtrlWMHeightEdit(); - - virtual ~CUICtrlWMHeightEdit(); - -private: - static PCSTR m_pszWMHeight; -}; - -class CUICtrlWMHeightSpin : public CUICtrlDefaultSpin -{ -public: - CUICtrlWMHeightSpin( - _In_ CUICtrlDefaultEditNum* pEdit - ); - - virtual ~CUICtrlWMHeightSpin(); - -private: - static PCSTR m_pszWMHeight; -}; - -class CUICtrlWMFontSizeEdit : public CUICtrlDefaultEditNum -{ -public: - CUICtrlWMFontSizeEdit(); - - virtual ~CUICtrlWMFontSizeEdit(); - -private: - static PCSTR m_pszWMFontSize; -}; - -class CUICtrlWMFontSizeSpin : public CUICtrlDefaultSpin -{ -public: - CUICtrlWMFontSizeSpin( - _In_ CUICtrlDefaultEditNum* pEdit - ); - - virtual ~CUICtrlWMFontSizeSpin(); - -private: - static PCSTR m_pszWMFontSize; -}; - -class CUICtrlColorBtn : public CUICtrlDefaultBtn -{ -public: - CUICtrlColorBtn(); - - ~CUICtrlColorBtn(); - - HRESULT - OnBnClicked( - _In_ CONST HWND hDlg - ); - -private: - static PCSTR m_pszWMFontColor; -}; - diff --git a/print/XPSDrvSmpl/src/ui/wmdmptcnv.cpp b/print/XPSDrvSmpl/src/ui/wmdmptcnv.cpp deleted file mode 100644 index 22cfde42..00000000 --- a/print/XPSDrvSmpl/src/ui/wmdmptcnv.cpp +++ /dev/null @@ -1,591 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - wmdmptcnv.cpp - -Abstract: - - PageWatermark devmode <-> PrintTicket conversion class implementation. - The class defines a common data representation between the DevMode (GPD) and PrintTicket - representations and implements the conversion and validation methods required - by CFeatureDMPTConvert. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "wmdmptcnv.h" -#include "wmpchndlr.h" - -using XDPrintSchema::PageWatermark::WatermarkData; -using XDPrintSchema::PageWatermark::EWatermarkOption; -using XDPrintSchema::PageWatermark::NoWatermark; -using XDPrintSchema::PageWatermark::TextWatermark; -using XDPrintSchema::PageWatermark::BitmapWatermark; -using XDPrintSchema::PageWatermark::VectorWatermark; -using XDPrintSchema::PageWatermark::WatermarkData; -using XDPrintSchema::PageWatermark::WatermarkData; -using XDPrintSchema::PageWatermark::WatermarkData; -using XDPrintSchema::PageWatermark::WatermarkData; - -using XDPrintSchema::PageWatermark::Layering::ELayeringOption; -using XDPrintSchema::PageWatermark::Layering::Overlay; -using XDPrintSchema::PageWatermark::Layering::Underlay; - -// -// Look-up data converting GPD PageWatermarkType feature options to -// watermark type enumeration -// -PCSTR g_pszWatermarkTypeFeature = "PageWatermarkType"; -static GPDStringToOption<EWatermarkOption> g_watermarkTypeOption[] = { - {"None", NoWatermark}, - {"Text", TextWatermark}, - {"Raster", BitmapWatermark}, - {"Vector", VectorWatermark}, -}; -UINT g_cWatermarkTypeOption = sizeof(g_watermarkTypeOption)/sizeof(GPDStringToOption<EWatermarkOption>); - -// -// Look-up data converting GPD PageWatermarkLayering feature options to -// watermark layering enumeration -// -PCSTR g_pszLayeringFeature = "PageWatermarkLayering"; -static GPDStringToOption<ELayeringOption> g_watermarkLayeringOption[] = { - {"Overlay", Overlay}, - {"Underlay", Underlay}, -}; -UINT g_cLayeringOption = sizeof(g_watermarkLayeringOption)/sizeof(GPDStringToOption<ELayeringOption>); - -/*++ - -Routine Name: - - CWatermarkDMPTConv::CWatermarkDMPTConv - -Routine Description: - - CWatermarkDMPTConv class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CWatermarkDMPTConv::CWatermarkDMPTConv() -{ -} - -/*++ - -Routine Name: - - CWatermarkDMPTConv::~CWatermarkDMPTConv - -Routine Description: - - CWatermarkDMPTConv class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CWatermarkDMPTConv::~CWatermarkDMPTConv() -{ -} - -/*++ - -Routine Name: - - CWatermarkDMPTConv::GetPTDataSettingsFromDM - -Routine Description: - - Populates the watermark data structure from the Devmode passed in. - -Arguments: - - pDevmode - pointer to input devmode buffer. - cbDevmode - size in bytes of full input devmode. - pPrivateDevmode - pointer to input private devmode buffer. - cbDrvPrivateSize - size in bytes of private devmode. - pDataSettings - Pointer to watermark data structure to be updated. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWatermarkDMPTConv::GetPTDataSettingsFromDM( - _In_ PDEVMODE pDevmode, - _In_ ULONG cbDevmode, - _In_ PVOID pPrivateDevmode, - _In_ ULONG cbDrvPrivateSize, - _Out_ WatermarkData* pDataSettings - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pDevmode, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pPrivateDevmode, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pDataSettings, E_POINTER))) - { - if (cbDevmode < sizeof(DEVMODE) || - cbDrvPrivateSize == 0) - { - hr = E_INVALIDARG; - } - } - - // - // Retrieve the GPD and devmode controlled settings - // - CUIProperties uiProperties(static_cast<POEMDEV>(pPrivateDevmode)); - - DWORD dwTextColor = 0; - if (SUCCEEDED(hr) && - SUCCEEDED(hr = GetOptionFromGPDString<EWatermarkOption>(pDevmode, - cbDevmode, - g_pszWatermarkTypeFeature, - g_watermarkTypeOption, - g_cWatermarkTypeOption, - pDataSettings->type)) && - SUCCEEDED(hr = GetOptionFromGPDString<ELayeringOption>(pDevmode, - cbDevmode, - g_pszLayeringFeature, - g_watermarkLayeringOption, - g_cLayeringOption, - pDataSettings->layering)) && - SUCCEEDED(hr = uiProperties.GetItem(g_pszWMOffsetWidth, &pDataSettings->widthOrigin, sizeof(pDataSettings->widthOrigin))) && - SUCCEEDED(hr = uiProperties.GetItem(g_pszWMOffsetHeight, &pDataSettings->heightOrigin, sizeof(pDataSettings->heightOrigin))) && - SUCCEEDED(hr = uiProperties.GetItem(g_pszWMSizeWidth, &pDataSettings->widthExtent, sizeof(pDataSettings->widthExtent))) && - SUCCEEDED(hr = uiProperties.GetItem(g_pszWMSizeHeight, &pDataSettings->heightExtent, sizeof(pDataSettings->heightExtent))) && - SUCCEEDED(hr = uiProperties.GetItem(g_pszWMTransparency, &pDataSettings->transparency, sizeof(pDataSettings->transparency))) && - SUCCEEDED(hr = uiProperties.GetItem(g_pszWMAngle, &pDataSettings->angle, sizeof(pDataSettings->angle))) && - SUCCEEDED(hr = uiProperties.GetItem(g_pszWMFontSize, &pDataSettings->txtData.fontSize, sizeof(pDataSettings->txtData.fontSize))) && - SUCCEEDED(hr = uiProperties.GetItem(g_pszWMFontColor, &dwTextColor, sizeof(dwTextColor)))) - { - // - // Convert the color to the txtData BSTR - // - try - { - CStringXDW cstrColor; - cstrColor.Format(L"#%08X", dwTextColor); - pDataSettings->txtData.bstrFontColor.Empty(); - pDataSettings->txtData.bstrFontColor.Attach(cstrColor.AllocSysString()); - } - catch (CXDException& e) - { - hr = e; - } - - TCHAR text[MAX_WATERMARK_TEXT + 1] = {0}; - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = uiProperties.GetItem(g_pszWMText, text, MAX_WATERMARK_TEXT * sizeof(TCHAR)))) - { - pDataSettings->txtData.bstrText = text; - - // - // Convert measurements from 100ths of an inch to microns - // - pDataSettings->widthOrigin = HUNDREDTH_OFINCH_TO_MICRON(pDataSettings->widthOrigin); - pDataSettings->heightOrigin = HUNDREDTH_OFINCH_TO_MICRON(pDataSettings->heightOrigin); - pDataSettings->widthExtent = HUNDREDTH_OFINCH_TO_MICRON(pDataSettings->widthExtent); - pDataSettings->heightExtent = HUNDREDTH_OFINCH_TO_MICRON(pDataSettings->heightExtent); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWatermarkDMPTConv::MergePTDataSettingsWithPT - -Routine Description: - - This method updates the watermark data structure from a PrintTicket description. - -Arguments: - - pPrintTicket - Pointer to the input PrintTicket. - pDataSettings - Pointer to the watermark data structure - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWatermarkDMPTConv::MergePTDataSettingsWithPT( - _In_ IXMLDOMDocument2* pPrintTicket, - _Inout_ WatermarkData* pDataSettings - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_POINTER(pPrintTicket, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pDataSettings, E_POINTER))) - { - try - { - // - // Get the watermark settings from the PrintTicket and set the options in - // the input Watermark data structure - // - WatermarkData wmData; - CWMPTHandler wmPTHndlr(pPrintTicket); - - if (SUCCEEDED(hr = wmPTHndlr.GetData(&wmData))) - { - // - // Only update settings relevant to the feature so that we do not unset - // other watermark settings in the devmode - // - pDataSettings->type = NoWatermark; - switch (wmData.type) - { - case TextWatermark: - { - pDataSettings->type = TextWatermark; - pDataSettings->widthOrigin = wmData.widthOrigin; - pDataSettings->heightOrigin = wmData.heightOrigin; - pDataSettings->transparency = wmData.transparency; - pDataSettings->angle = wmData.angle; - pDataSettings->layering = wmData.layering; - pDataSettings->txtData.bstrFontColor = wmData.txtData.bstrFontColor; - pDataSettings->txtData.fontSize = wmData.txtData.fontSize; - pDataSettings->txtData.bstrText = wmData.txtData.bstrText; - } - break; - - case BitmapWatermark: - { - pDataSettings->type = BitmapWatermark; - pDataSettings->widthOrigin = wmData.widthOrigin; - pDataSettings->heightOrigin = wmData.heightOrigin; - pDataSettings->widthExtent = wmData.widthExtent; - pDataSettings->heightExtent = wmData.heightExtent; - pDataSettings->transparency = wmData.transparency; - pDataSettings->angle = wmData.angle; - pDataSettings->layering = wmData.layering; - } - break; - - case VectorWatermark: - { - pDataSettings->type = VectorWatermark; - pDataSettings->widthOrigin = wmData.widthOrigin; - pDataSettings->heightOrigin = wmData.heightOrigin; - pDataSettings->widthExtent = wmData.widthExtent; - pDataSettings->heightExtent = wmData.heightExtent; - pDataSettings->transparency = wmData.transparency; - pDataSettings->angle = wmData.angle; - pDataSettings->layering = wmData.layering; - } - break; - - case NoWatermark: - break; - - default: - { - WARNING("Unrecognized watermark feature - setting to default\n"); - } - break; - } - } - else if (hr == E_ELEMENT_NOT_FOUND) - { - // - // Watermark setting not in the PT - this is not an error. Just - // leave the type as NoWatermark and reset the HRESULT to S_OK - // - hr = S_OK; - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWatermarkDMPTConv::SetPTDataInDM - -Routine Description: - - This method updates the watermark options in the devmode from the UI Settings. - -Arguments: - - dataSettings - Reference to watermark data settings to be updated. - pDevmode - pointer to devmode to be updated. - cbDevmode - size in bytes of full devmode. - pPrivateDevmode - pointer to input private devmode buffer. - cbDrvPrivateSize - size in bytes of private devmode. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWatermarkDMPTConv::SetPTDataInDM( - _In_ CONST WatermarkData& dataSettings, - _Inout_ PDEVMODE pDevmode, - _In_ ULONG cbDevmode, - _Inout_ PVOID pPrivateDevmode, - _In_ ULONG cbDrvPrivateSize - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pDevmode, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pPrivateDevmode, E_POINTER))) - { - if (cbDevmode < sizeof(DEVMODE) || - cbDrvPrivateSize == 0) - { - hr = E_INVALIDARG; - } - } - - // - // Convert from microns to 100ths of an inch before writing to the DevMode - // - if (SUCCEEDED(hr)) - { - INT widthOrigin = MICRON_TO_HUNDREDTH_OFINCH(dataSettings.widthOrigin); - INT heightOrigin = MICRON_TO_HUNDREDTH_OFINCH(dataSettings.heightOrigin); - INT widthExtent = MICRON_TO_HUNDREDTH_OFINCH(dataSettings.widthExtent); - INT heightExtent = MICRON_TO_HUNDREDTH_OFINCH(dataSettings.heightExtent); - - // - // Set the GPD and devmode controlled settings - // - CUIProperties uiProperties(static_cast<POEMDEV>(pPrivateDevmode)); - if (SUCCEEDED(hr = SetGPDStringFromOption<EWatermarkOption>(pDevmode, - cbDevmode, - g_pszWatermarkTypeFeature, - g_watermarkTypeOption, - g_cWatermarkTypeOption, - dataSettings.type)) && - SUCCEEDED(hr = SetGPDStringFromOption<ELayeringOption>(pDevmode, - cbDevmode, - g_pszLayeringFeature, - g_watermarkLayeringOption, - g_cLayeringOption, - dataSettings.layering)) && - SUCCEEDED(hr = uiProperties.SetItem(g_pszWMOffsetWidth, &widthOrigin, sizeof(widthOrigin))) && - SUCCEEDED(hr = uiProperties.SetItem(g_pszWMOffsetHeight, &heightOrigin, sizeof(heightOrigin))) && - SUCCEEDED(hr = uiProperties.SetItem(g_pszWMSizeWidth, &widthExtent, sizeof(widthExtent))) && - SUCCEEDED(hr = uiProperties.SetItem(g_pszWMSizeHeight, &heightExtent, sizeof(heightExtent))) && - SUCCEEDED(hr = uiProperties.SetItem(g_pszWMTransparency, &dataSettings.transparency, sizeof(dataSettings.transparency))) && - SUCCEEDED(hr = uiProperties.SetItem(g_pszWMAngle, &dataSettings.angle, sizeof(dataSettings.angle))) && - SUCCEEDED(hr = uiProperties.SetItem(g_pszWMFontSize, &dataSettings.txtData.fontSize, sizeof(dataSettings.txtData.fontSize)))) - { - try - { - // - // Convert the font color to a channel array - // - BYTE fontColor[4] = {0}; - CStringXDW cstrFontColor(dataSettings.txtData.bstrFontColor); - cstrFontColor.Trim(); - if (cstrFontColor.Find(L"#") == 0) - { - cstrFontColor.Delete(0); - cstrFontColor.Trim(); - } - - cstrFontColor.Truncate(8); - INT cChannel = 3; - while (cstrFontColor.GetLength() > 0 && - cChannel < sizeof(DWORD) && - cChannel >= 0) - { - // - // Add the data a channel at a time so we dont overflow wcstol - // -#pragma prefast(suppress:__WARNING_MUST_USE, "All possible two-digit hex numbers are valid.") - fontColor[cChannel] = static_cast<BYTE>(wcstol(cstrFontColor.Left(2), NULL, 16)); - - // - // Delete the channel from the color ref string - // - cstrFontColor.Delete(0, 2); - - // - // Traverse array in reverse to correct for endianness - // - cChannel--; - } - - hr = uiProperties.SetItem(g_pszWMFontColor, fontColor, sizeof(DWORD)); - - // - // Set the text string - // - if (SUCCEEDED(hr)) - { - CStringXD text(dataSettings.txtData.bstrText); - text.Truncate(MAX_WATERMARK_TEXT); - - hr = uiProperties.SetItem(g_pszWMText, text.GetBuffer(), (text.GetLength() + 1) * sizeof(TCHAR)); - } - } - catch (CXDException& e) - { - hr = e; - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWatermarkDMPTConv::SetPTDataInPT - -Routine Description: - - This method updates the watemark PrintTicket description from watermark data structure. - -Arguments: - - drvSettings - Reference to watermark data structure to update from. - pPrintTicket - Pointer to the PrintTicket to be updated. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWatermarkDMPTConv::SetPTDataInPT( - _In_ CONST WatermarkData& dataSettings, - _Inout_ IXMLDOMDocument2* pPrintTicket - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pPrintTicket, E_POINTER))) - { - try - { - CWMPTHandler wmPTHndlr(pPrintTicket); - hr = wmPTHndlr.SetData(&dataSettings); - } - catch (CXDException& e) - { - hr = e; - } - } - else - { - hr = E_POINTER; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWatermarkDMPTConv::CompletePrintCapabilities - -Routine Description: - - Unidrv calls this routine with an input Device Capabilities Document - that is partially populated with Device capabilities information - filled in by Unidrv for features that it understands. The plug-in - needs to read any private features in the input PrintTicket, delete - them and add them back under Printschema namespace so that higher - level applications can understand them and make use of them. - -Arguments: - - pPrintTicket - pointer to input PrintTicket - pCapabilities - pointer to Device Capabilities Document. - -Return Value: - - HRESULT - S_OK - Always - ---*/ -HRESULT STDMETHODCALLTYPE -CWatermarkDMPTConv::CompletePrintCapabilities( - _In_opt_ IXMLDOMDocument2*, - _Inout_ IXMLDOMDocument2* pPrintCapabilities - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pPrintCapabilities, E_POINTER))) - { - try - { - CWMPCHandler watermarkpcHandler(pPrintCapabilities); - watermarkpcHandler.SetCapabilities(); - } - catch(CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/ui/wmdmptcnv.h b/print/XPSDrvSmpl/src/ui/wmdmptcnv.h deleted file mode 100644 index 37b8a8ae..00000000 --- a/print/XPSDrvSmpl/src/ui/wmdmptcnv.h +++ /dev/null @@ -1,75 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - wmdmptcnv.h - -Abstract: - - PageWatermark devmode <-> PrintTicket conversion class definition. - The class defines a common data representation between the DevMode (GPD) and PrintTicket - representations and implements the conversion and validation methods required - by CFeatureDMPTConvert. - ---*/ - -#pragma once - -#include "ftrdmptcnv.h" -#include "wmpthndlr.h" -#include "uiproperties.h" - -class CWatermarkDMPTConv : public CFeatureDMPTConvert<XDPrintSchema::PageWatermark::WatermarkData> -{ -public: - CWatermarkDMPTConv(); - - ~CWatermarkDMPTConv(); - -private: - HRESULT - GetPTDataSettingsFromDM( - _In_ PDEVMODE pDevmode, - _In_ ULONG cbDevmode, - _In_ PVOID pPrivateDevmode, - _In_ ULONG cbDrvPrivateSize, - _Out_ XDPrintSchema::PageWatermark::WatermarkData* pDataSettings - ); - - HRESULT - MergePTDataSettingsWithPT( - _In_ IXMLDOMDocument2* pPrintTicket, - _Inout_ XDPrintSchema::PageWatermark::WatermarkData* pDrvSettings - ); - - HRESULT - SetPTDataInDM( - _In_ CONST XDPrintSchema::PageWatermark::WatermarkData& drvSettings, - _Inout_ PDEVMODE pDevmode, - _In_ ULONG cbDevmode, - _Inout_ PVOID pPrivateDevmode, - _In_ ULONG cbDrvPrivateSize - ); - - HRESULT - SetPTDataInPT( - _In_ CONST XDPrintSchema::PageWatermark::WatermarkData& drvSettings, - _Inout_ IXMLDOMDocument2* pPrintTicket - ); - - HRESULT STDMETHODCALLTYPE - CompletePrintCapabilities( - _In_opt_ IXMLDOMDocument2*, - _Inout_ IXMLDOMDocument2* pPrintCapabilities - ); -}; - diff --git a/print/XPSDrvSmpl/src/ui/wmppg.cpp b/print/XPSDrvSmpl/src/ui/wmppg.cpp deleted file mode 100644 index 64faee63..00000000 --- a/print/XPSDrvSmpl/src/ui/wmppg.cpp +++ /dev/null @@ -1,268 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - wmppg.cpp - -Abstract: - - Implementation of the watermark property page. This class is - responsible for initialising and registering the color management - property page and its controls. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdexcept.h" -#include "xdstring.h" -#include "resource.h" -#include "wmppg.h" -#include "wmctrls.h" - -/*++ - -Routine Name: - - CWatermarkPropPage::CWatermarkPropPage - -Routine Description: - - CWatermarkPropPage class constructor. - Creates a handler class object for every control on the watermark property page. - Each of these handlers is stored in a collection. - -Arguments: - - None - -Return Value: - - None - Throws CXDException(HRESULT) on an error - ---*/ -CWatermarkPropPage::CWatermarkPropPage() -{ - HRESULT hr = S_OK; - - try - { - CUIControl* pControl = new(std::nothrow) CUICtrlWMTypeCombo(); - - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY))) - { - hr = AddUIControl(IDC_COMBO_WMTYPE, pControl); - } - - if (SUCCEEDED(hr)) - { - pControl = new(std::nothrow) CUICtrlWMLayeringCombo(); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY))) - { - hr = AddUIControl(IDC_COMBO_WMLAYERING, pControl); - } - } - - if (SUCCEEDED(hr)) - { - pControl = new(std::nothrow) CUICtrlWMTextEdit(); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY))) - { - hr = AddUIControl(IDC_EDIT_WMTEXT, pControl); - } - } - - if (SUCCEEDED(hr)) - { - pControl = new(std::nothrow) CUICtrlWMTransparencyEdit(); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY)) && - SUCCEEDED(hr = AddUIControl(IDC_EDIT_WMTRANSPARENCY, pControl))) - { - pControl = new(std::nothrow) CUICtrlWMTransparencySpin(reinterpret_cast<CUICtrlDefaultEditNum *>(pControl)); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY))) - { - hr = AddUIControl(IDC_SPIN_WMTRANSPARENCY, pControl); - } - } - } - - if (SUCCEEDED(hr)) - { - pControl = new(std::nothrow) CUICtrlWMAngleEdit(); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY)) && - SUCCEEDED(hr = AddUIControl(IDC_EDIT_WMANGLE, pControl))) - { - pControl = new(std::nothrow) CUICtrlWMAngleSpin(reinterpret_cast<CUICtrlDefaultEditNum *>(pControl)); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY))) - { - hr = AddUIControl(IDC_SPIN_WMANGLE, pControl); - } - } - } - - if (SUCCEEDED(hr)) - { - pControl = new(std::nothrow) CUICtrlWMOffsetXEdit(); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY)) && - SUCCEEDED(hr = AddUIControl(IDC_EDIT_WMOFFX, pControl))) - { - pControl = new(std::nothrow) CUICtrlWMOffsetXSpin(reinterpret_cast<CUICtrlDefaultEditNum *>(pControl)); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY))) - { - hr = AddUIControl(IDC_SPIN_WMOFFX, pControl); - } - } - } - - if (SUCCEEDED(hr)) - { - pControl = new(std::nothrow) CUICtrlWMOffsetYEdit(); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY)) && - SUCCEEDED(hr = AddUIControl(IDC_EDIT_WMOFFY, pControl))) - { - pControl = new(std::nothrow) CUICtrlWMOffsetYSpin(reinterpret_cast<CUICtrlDefaultEditNum *>(pControl)); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY))) - { - hr = AddUIControl(IDC_SPIN_WMOFFY, pControl); - } - } - } - - if (SUCCEEDED(hr)) - { - pControl = new(std::nothrow) CUICtrlWMWidthEdit(); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY)) && - SUCCEEDED(hr = AddUIControl(IDC_EDIT_WMWIDTH, pControl))) - { - pControl = new(std::nothrow) CUICtrlWMWidthSpin(reinterpret_cast<CUICtrlDefaultEditNum *>(pControl)); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY))) - { - hr = AddUIControl(IDC_SPIN_WMWIDTH, pControl); - } - } - } - - if (SUCCEEDED(hr)) - { - pControl = new(std::nothrow) CUICtrlWMHeightEdit(); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY)) && - SUCCEEDED(hr = AddUIControl(IDC_EDIT_WMHEIGHT, pControl))) - { - pControl = new(std::nothrow) CUICtrlWMHeightSpin(reinterpret_cast<CUICtrlDefaultEditNum *>(pControl)); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY))) - { - hr = AddUIControl(IDC_SPIN_WMHEIGHT, pControl); - } - } - } - - if (SUCCEEDED(hr)) - { - pControl = new(std::nothrow) CUICtrlWMFontSizeEdit(); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY)) && - SUCCEEDED(hr = AddUIControl(IDC_EDIT_WMSIZE, pControl))) - { - pControl = new(std::nothrow) CUICtrlWMFontSizeSpin(reinterpret_cast<CUICtrlDefaultEditNum *>(pControl)); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY))) - { - hr = AddUIControl(IDC_SPIN_WMSIZE, pControl); - } - } - } - - if (SUCCEEDED(hr)) - { - pControl = new(std::nothrow) CUICtrlColorBtn(); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY))) - { - hr = AddUIControl(IDC_BUTTON_WMCOLOR, pControl); - } - } - } - catch (CXDException& e) - { - hr = e; - } - - if (FAILED(hr)) - { - DestroyUIComponents(); - throw CXDException(hr); - } -} - -/*++ - -Routine Name: - - CWatermarkPropPage::~CWatermarkPropPage - -Routine Description: - - CWatermarkPropPage class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CWatermarkPropPage::~CWatermarkPropPage() -{ -} - -/*++ - -Routine Name: - - CWatermarkPropPage::InitDlgBox - -Routine Description: - - Provides the base class with the data required to intialise the dialog box. - -Arguments: - - ppszTemplate - Pointer to dialog box template to be intialised. - ppszTitle - Pointer to dialog box title to be intialised. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWatermarkPropPage::InitDlgBox( - _Out_ LPCTSTR* ppszTemplate, - _Out_ LPCTSTR* ppszTitle - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppszTemplate, E_POINTER)) || - SUCCEEDED(hr = CHECK_POINTER(ppszTitle, E_POINTER))) - { - *ppszTemplate = MAKEINTRESOURCE(IDD_WATERMARK); - *ppszTitle = MAKEINTRESOURCE(IDS_WMARK); - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/ui/wmppg.h b/print/XPSDrvSmpl/src/ui/wmppg.h deleted file mode 100644 index e28d5ea5..00000000 --- a/print/XPSDrvSmpl/src/ui/wmppg.h +++ /dev/null @@ -1,42 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - wmppg.h - -Abstract: - - Definiiion of the watermark property page. This class is - responsible for initialising and registering the color management - property page and its controls. - ---*/ - -#pragma once - -#include "precomp.h" -#include "docppg.h" - -class CWatermarkPropPage : public CDocPropPage -{ -public: - CWatermarkPropPage(); - - virtual ~CWatermarkPropPage(); - - HRESULT - InitDlgBox( - _Out_ LPCTSTR* ppszTemplate, - _Out_ LPCTSTR* ppszTitle - ); -}; - diff --git a/print/XPSDrvSmpl/src/ui/xdsmplcf.cpp b/print/XPSDrvSmpl/src/ui/xdsmplcf.cpp deleted file mode 100644 index abbdb3e4..00000000 --- a/print/XPSDrvSmpl/src/ui/xdsmplcf.cpp +++ /dev/null @@ -1,192 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - xdsmplcf.cpp - -Abstract: - - XPSDrv feature sample class factory implementation. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdexcept.h" -#include "xdstring.h" -#include "xdsmplcf.h" -#include "xdsmplui.h" -#include "xdsmplptprov.h" - -/*++ - -Routine Name: - - CXDSmplUICF::CreateInstance - -Routine Description: - - Creates an object of the specified CLSID and retrieves an interface pointer to this object. - The supported class objects are currently IPrintOemUI and IPrintOemPrintTicketProvider. - -Arguments: - - pUnkOuter - This must be NULL, as aggregare object creation is not supported. - riid - The IID of the requested interface. - ppvObject - A pointer to the interface pointer identified by riid. - If the object does not support this interface, ppvObj is set to NULL. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXDSmplUICF::CreateInstance( - _In_opt_ LPUNKNOWN pUnkOuter, - _In_ REFIID riid, - _Outptr_ PVOID* ppvObject - ) -{ - HRESULT hr = S_OK; - - if (ppvObject == NULL) - { - hr = E_POINTER; - goto Exit; - } - *ppvObject = NULL; - - if (pUnkOuter == NULL) - { - // - // Create UI component - // - CXDSmplUI* pXDSmplUI = NULL; - - try - { - pXDSmplUI = new(std::nothrow) CXDSmplUI; - hr = CHECK_POINTER(pXDSmplUI, E_OUTOFMEMORY); - } - catch (CXDException& e) - { - hr = e; - } - catch (...) - { - hr = E_FAIL; - } - - if (SUCCEEDED(hr)) - { - // - // Get the requested interface - // - hr = pXDSmplUI->QueryInterface(riid, ppvObject) ; - - // - // Release the IUnknown pointer. If QueryInterface failed - // the Release() call will clean up - // - pXDSmplUI->Release(); - - // - // If QueryInterface failed this could be a request for the - // PTProvider Interface - // - if (FAILED(hr)) - { - CXDSmplPTProvider* pXDSmplPT = NULL; - - try - { - pXDSmplPT = new(std::nothrow) CXDSmplPTProvider; - hr = CHECK_POINTER(pXDSmplPT, E_OUTOFMEMORY); - } - catch (CXDException& e) - { - _Analysis_assume_((*ppvObject) == NULL); - hr = e; - } - catch (...) - { - hr = E_FAIL; - } - - if (SUCCEEDED(hr)) - { - hr = pXDSmplPT->QueryInterface(riid, ppvObject) ; - - // - // Release the IUnknown pointer. - // (If QueryInterface failed, component will delete itself.) - // - pXDSmplPT->Release(); - } - } - } - } - else - { - // - // Cannot aggregate - // - hr = CLASS_E_NOAGGREGATION; - } - -Exit: - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXDSmplUICF::LockServer - -Routine Description: - - Increments and decrements the UI Plug-in Module lock count. - -Arguments: - - bLock - If TRUE, the lock count is incremented; otherwise, the lock count is decremented. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXDSmplUICF::LockServer( - BOOL bLock - ) -{ - if (bLock) - { - InterlockedIncrement(&g_cServerLocks); - } - else - { - InterlockedDecrement(&g_cServerLocks); - } - - return S_OK; -} - diff --git a/print/XPSDrvSmpl/src/ui/xdsmplcf.h b/print/XPSDrvSmpl/src/ui/xdsmplcf.h deleted file mode 100644 index ae1a78c8..00000000 --- a/print/XPSDrvSmpl/src/ui/xdsmplcf.h +++ /dev/null @@ -1,56 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - xdsmplcf.cpp - -Abstract: - - XPSDrv feature sample class factory definition. - ---*/ - -#pragma once - -#include "cunknown.h" - -class CXDSmplUICF : public CUnknown<IClassFactory> -{ -public: - // - // Constructor and Destruction - // - CXDSmplUICF() : - CUnknown<IClassFactory>(IID_IClassFactory) - { - } - - virtual ~CXDSmplUICF() - { - } - - // - // IClassFactory methods - // - virtual HRESULT STDMETHODCALLTYPE - CreateInstance( - _In_opt_ LPUNKNOWN pUnkOuter, - _In_ REFIID riid, - _Outptr_ PVOID* ppvObject - ); - - virtual HRESULT STDMETHODCALLTYPE - LockServer( - BOOL bLock - ); -}; - diff --git a/print/XPSDrvSmpl/src/ui/xdsmpldlg.rc b/print/XPSDrvSmpl/src/ui/xdsmpldlg.rc deleted file mode 100644 index bfbdee3f..00000000 --- a/print/XPSDrvSmpl/src/ui/xdsmpldlg.rc +++ /dev/null @@ -1,326 +0,0 @@ -// -// Copyright (c) 2005 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. -// -// File Name: -// -// xdsmpldlg.rc -// -// Abstract: -// -// XPSDrv sample driver UI plug-in resource file. -// -// - -#include "winres.h" -#include "resource.h" -#include <ntverp.h> - -#define VER_FILETYPE VFT_DLL -#define VER_FILESUBTYPE VFT2_UNKNOWN -#define VER_FILEDESCRIPTION_STR "XPSDrv Sample UI Plug-In" -#define VER_INTERNALNAME_STR "PrintFeatureFilters" - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// - -#include "common.ver" - - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE -BEGIN - "#include ""winres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_COL_MANAGE DIALOGEX 0, 0, 296, 200 -STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | WS_CHILD | WS_DISABLED -FONT 8, "MS Shell Dlg", 0, 0, 0x0 -BEGIN - LISTBOX IDC_LIST_COLPROF,21,63,252,82,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP - LTEXT "Select color profile",IDC_TEXT_COLPROF,22,51,89,8 - GROUPBOX "",IDC_GRP_COLPROF,4,4,288,192 - COMBOBOX IDC_COMBO_COL_MANAGE,137,28,135,88,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - LTEXT "Select Color Management Method",IDC_TXT_COL_MANAGE,24,31,108,8 - LTEXT "Select ICM Rendering Intent",IDC_TXT_COL_INTENT,24,164,92,8 - COMBOBOX IDC_COMBO_COL_INTENT,137,162,135,88,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP -END - -IDD_WATERMARK DIALOGEX 0, 0, 296, 200 -STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | WS_CHILD | WS_DISABLED -FONT 8, "MS Shell Dlg", 0, 0, 0x0 -BEGIN - COMBOBOX IDC_COMBO_WMTYPE,14,32,107,88,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - LTEXT "Watermark Type",IDC_TXT_WMTYPE,14,21,65,8 - COMBOBOX IDC_COMBO_WMLAYERING,14,66,75,88,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - LTEXT "Layering",IDC_TXT_WMLAYERING,14,55,65,8 - GROUPBOX "Settings",IDC_GRP_WM,4,4,284,192 - EDITTEXT IDC_EDIT_WMTEXT,14,131,107,14, ES_AUTOHSCROLL - LTEXT "Text",IDC_TXT_WMTEXT,14,120,65,8 - EDITTEXT IDC_EDIT_WMTRANSPARENCY,236,65,33,14,ES_AUTOHSCROLL | ES_NUMBER - CONTROL "",IDC_SPIN_WMTRANSPARENCY,"msctls_updown32",UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,260,65,11,14 - EDITTEXT IDC_EDIT_WMANGLE,133,66,33,14,ES_AUTOHSCROLL | ES_NUMBER - CONTROL "",IDC_SPIN_WMANGLE,"msctls_updown32",UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,157,66,11,14 - EDITTEXT IDC_EDIT_WMOFFX,70,96,50,14,ES_AUTOHSCROLL | ES_NUMBER - CONTROL "",IDC_SPIN_WMOFFX,"msctls_updown32",UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,109,96,11,14 - EDITTEXT IDC_EDIT_WMOFFY,190,96,50,14,ES_AUTOHSCROLL | ES_NUMBER - CONTROL "",IDC_SPIN_WMOFFY,"msctls_updown32",UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,229,96,11,14 - LTEXT "Transparency",IDC_TXT_WMTRANSPARENCY,186,68,45,8 - LTEXT "Angle",IDC_TXT_WMANGLE,104,68,23,8 - LTEXT "Offset X .01""",IDC_TXT_WMOFFX,17,99,43,8 - LTEXT "Offset Y .01""",IDC_TXT_WMOFFY,140,98,43,8 - EDITTEXT IDC_EDIT_WMWIDTH,70,125,50,14,ES_AUTOHSCROLL | ES_NUMBER - CONTROL "",IDC_SPIN_WMWIDTH,"msctls_updown32",UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,108,125,11,14 - EDITTEXT IDC_EDIT_WMHEIGHT,190,125,50,14,ES_AUTOHSCROLL | ES_NUMBER - CONTROL "",IDC_SPIN_WMHEIGHT,"msctls_updown32",UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,229,125,11,14 - LTEXT "Width .01""",IDC_TXT_WMWIDTH,17,128,51,8 - LTEXT "Height .01""",IDC_TXT_WMHEIGHT,140,127,37,8 - EDITTEXT IDC_EDIT_WMSIZE,129,163,33,14,ES_AUTOHSCROLL | ES_NUMBER - CONTROL "",IDC_SPIN_WMSIZE,"msctls_updown32",UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,158,163,11,14 - LTEXT "Size",IDC_TXT_WMSIZE,104,166,18,8 - PUSHBUTTON "Color",IDC_BUTTON_WMCOLOR,27,163,50,14 -END - -IDD_FEATURES DIALOGEX 0, 0, 296, 200 -STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | WS_CHILD | WS_DISABLED -FONT 8, "MS Shell Dlg", 0, 0, 0x0 -BEGIN - GROUPBOX "Page Scaling",IDC_GRP_PGSCALE,4,2,285,56 - GROUPBOX "Document Multi-Up",IDC_GRP_DOCNUP,4,61,285,45 - COMBOBOX IDC_COMBO_PGSCALE,11,28,88,88,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - LTEXT "Scaling Option",IDC_TXT_PGSCALE,11,18,46,8 - COMBOBOX IDC_COMBO_SCALEOFF,144,28,114,88,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - LTEXT "Scale Offset Alignment",IDC_TXT_SCALEOFF,144,17,88,8 - EDITTEXT IDC_EDIT_PGSCALEX,138,14,40,14,ES_AUTOHSCROLL | ES_NUMBER - CONTROL "",IDC_SPIN_PGSCALEX,"msctls_updown32",UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,168,14,10,14 - EDITTEXT IDC_EDIT_PGOFFX,234,14,50,14,ES_AUTOHSCROLL | ES_NUMBER - CONTROL "",IDC_SPIN_PGOFFX,"msctls_updown32",UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,273,14,10,14 - EDITTEXT IDC_EDIT_PGSCALEY,138,38,40,14,ES_AUTOHSCROLL | ES_NUMBER - CONTROL "",IDC_SPIN_PGSCALEY,"msctls_updown32",UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,168,38,10,14 - EDITTEXT IDC_EDIT_PGOFFY,234,38,50,14,ES_AUTOHSCROLL | ES_NUMBER - CONTROL "",IDC_SPIN_PGOFFY,"msctls_updown32",UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,273,38,10,14 - LTEXT "Scale X",IDC_TXT_PGSCALEX,108,18,25,8 - LTEXT "Scale Y",IDC_TXT_PGSCALEY,108,40,25,8 - LTEXT "Offset X .01""",IDC_TXT_PGOFFX,187,17,42,8 - LTEXT "Offset Y .01""",IDC_TXT_PGOFFY,187,40,42,8 - COMBOBOX IDC_COMBO_NUP,11,81,114,88,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_COMBO_NUP_ORDER,155,81,114,88,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - LTEXT "Number Up",IDC_TXT_NUP,11,70,36,8 - LTEXT "Presentation Order",IDC_TXT_NUP_ORDER,155,70,88,8 - COMBOBOX IDC_COMBO_PHOTO_INTENT,93,176,83,88,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - LTEXT "Page Photo Printing Intent",IDC_TXT_PHOTO_INTENT,93,165,86,8 - CONTROL "Enable Borderless Pages",IDC_CHECK_BORDERLESS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,187,177,94,10 - COMBOBOX IDC_COMBO_DOCDUPLEX,11,176,68,88,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - LTEXT "Duplex Option",IDC_TXT_DOCDUPLEX,11,165,46,8 - GROUPBOX "Other",IDC_STATIC,4,157,285,38 - LTEXT "Job Binding (all documents)",IDC_TXT_JOBBIND,11,118,100,8 - COMBOBOX IDC_COMBO_JOBBIND,11,129,115,88,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - GROUPBOX "Binding Option",IDC_STATIC,4,109,285,45 - LTEXT "Document Binding",IDC_TXT_DOCBIND,155,118,100,8 - COMBOBOX IDC_COMBO_DOCBIND,155,129,114,88,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP -END - - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE -BEGIN - IDS_COLMAN "Color Management" - IDS_WMARK "Watermarks" - IDS_FEATURE "Features" -END - -STRINGTABLE -BEGIN - IDS_GPD_1PPS "1 Page per Sheet" - IDS_GPD_2PPS "2 Page per Sheet" - IDS_GPD_4PPS "4 Page per Sheet" - IDS_GPD_6PPS "6 Page per Sheet" - IDS_GPD_8PPS "8 Page per Sheet" - IDS_GPD_9PPS "9 Page per Sheet" - IDS_GPD_16PPS "16 Page per Sheet" - IDS_GPD_RES1200 "1200 x 1200 dpi" - IDS_GPD_RES600 "600 x 600 dpi" - IDS_GPD_AUTOMATIC "Automatic" - IDS_GPD_BORDERED "Bordered" - IDS_GPD_BORDERLESS "Borderless" - IDS_GPD_BTOT "Bottom to Top" - IDS_GPD_BTOTLTOR "Bottom to Top, Left to Right" - IDS_GPD_BTOTRTOL "Bottom to Top, Right to Left" - IDS_GPD_CMYK "CMYK" -END - -STRINGTABLE -BEGIN - IDS_GPD_COLOR "Color" - IDS_GPD_CONFIDENTIAL "Confidential" - IDS_GPD_CUSTSQUARE "Custom Square" - IDS_GPD_CUSTOM "Custom" - IDS_GPD_SRCCOLPROF "Source Color Profile" - IDS_GPD_DEVICE "Device" - IDS_GPD_DOCBIND "Document Binding" - IDS_GPD_PAGECOLMAN "Page Color Management" - IDS_GPD_PAGEPHOTINTENT "Page Photo Printing Intent" - IDS_GPD_DOCDUPLEX "Document Duplex" - IDS_GPD_DOCNUP "Document NUp" - IDS_GPD_DOCNUPPRESENTORDER "Document NUp Presentation Order" - IDS_GPD_DRAFT "Draft" - IDS_GPD_DRIVER "Driver" - IDS_GPD_DUPLEX "Duplex" - IDS_GPD_FAX "Fax" -END - -STRINGTABLE -BEGIN - IDS_GPD_FITBLEED "Fit Bleed Size" - IDS_GPD_FITCONTENT "Fit Content Size" - IDS_GPD_FITPAGE "Fit Page Size" - IDS_GPD_GLOSSY "Glossy" - IDS_GPD_GRAYSCALE "Grayscale" - IDS_GPD_HIGH "High" - IDS_GPD_HORIZONTAL "Horizontal" - IDS_GPD_JOBBINDING "Job Binding (all documents)" - IDS_GPD_JOBNUPPRESENTORDER "Job NUp Presentation Order" - IDS_GPD_JOBNUP "Job NUp (contigously)" - IDS_GPD_JOBPAGEORDER "Job Page Order" - IDS_GPD_LANDSCAPE "Landscape" - IDS_GPD_LTOR "Left to Right" - IDS_GPD_LTORBTOT "Left to Right, Bottom to Top" - IDS_GPD_LTORTTOB "Left to Right, Top to Bottom" - IDS_GPD_MEDIATYPE "Media Type" -END - -STRINGTABLE -BEGIN - IDS_GPD_MONO "Mono" - IDS_GPD_NONE "None" - IDS_GPD_NORMAL "Normal" - IDS_GPD_OFF "Off" - IDS_GPD_ON "On" - IDS_GPD_ORIENATION "Orientation" - IDS_GPD_OVERLAYED "Overlaid" - IDS_GPD_PAGEBORDER "Page Border" - IDS_GPD_PAGEQUALITY "Page Output Quality" - IDS_GPD_PAGESCALING "Page Scaling" - IDS_GPD_PAPERSOURCE "Paper Source" - IDS_GPD_PHOTOGRAPHIC "Photographic" - IDS_GPD_PORTRAIT "Portrait" - IDS_GPD_RASTERIMAGE "Raster Image" - IDS_GPD_RESOLUTION "Resolution" - IDS_GPD_REVERSELANDSCAPE "Reverse Landscape" -END - -STRINGTABLE -BEGIN - IDS_GPD_REVERSE "Reverse" - IDS_GPD_RTOL "Right to Left" - IDS_GPD_RTOLBTOT "Right to Left, Bottom to Top" - IDS_GPD_RTOLTTOB "Right to Left, Top to Bottom" - IDS_GPD_SCALEPAGETOPAGE "Scale Page to Page" - IDS_GPD_SCRGB "scRGB" - IDS_GPD_STANDARD "Standard" - IDS_GPD_TEXT "Text" - IDS_GPD_TTOB "Top to Bottom" - IDS_GPD_TTOBLTOR "Top to Bottom, Left to Right" - IDS_GPD_TTOBRTOL "Top to Bottom, Right to Left" - IDS_GPD_TRANSPARENCY "Transparency" - IDS_GPD_TRANSPARENT "Transparent" - IDS_GPD_UNDERLAYED "Underlayed" - IDS_GPD_UPPER "Upper" - IDS_GPD_VECTORIMAGE "Vector Image" -END - -STRINGTABLE -BEGIN - IDS_GPD_VERTICAL "Vertical" - IDS_GPD_WATERMARKLAYERING "Watermark Layering" - IDS_GPD_WATERMARKTEXT "Watermark Text" - IDS_GPD_WATERMARKTYPE "Watermark Type" - IDS_GPD_BEST "Best" - IDS_GPD_PAGEICMINTENT "Page ICM Rendering Intent" - IDS_GPD_ABSCOLINTENT "Absolute Colorimetric" - IDS_GPD_RELCOLINTENT "Relative Colorimetric" - IDS_GPD_PHOTOINTENT "Photographs" - IDS_GPD_BIZINTENT "Business Graphics" - IDS_GPD_SYSTEM "System" - IDS_GPD_WATERMARKTEXTCOLOR "Watermark Text Color" - IDS_GPD_RED "Red" - IDS_GPD_GREEN "Green" - IDS_GPD_BLUE "Blue" - IDS_GPD_MAGENTA "Magenta" - IDS_GPD_CYAN "Cyan" - IDS_GPD_YELLOW "Yellow" - IDS_GPD_BLACK "Black" -END - -STRINGTABLE -BEGIN - IDS_GPD_SCALE_ALIGN "Scale Offset Alignment" - IDS_GPD_SCALE_ALIGN_BC "Bottom Centre" - IDS_GPD_SCALE_ALIGN_BL "Bottom Left" - IDS_GPD_SCALE_ALIGN_BR "Bottom Right" - IDS_GPD_SCALE_ALIGN_CC "Centre" - IDS_GPD_SCALE_ALIGN_LC "Centre Left" - IDS_GPD_SCALE_ALIGN_CR "Centre Right" - IDS_GPD_SCALE_ALIGN_CT "Centre Top" - IDS_GPD_SCALE_ALIGN_TL "Top Left" - IDS_GPD_SCALE_ALIGN_TR "Top Right" -END - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/print/XPSDrvSmpl/src/ui/xdsmplptprov.cpp b/print/XPSDrvSmpl/src/ui/xdsmplptprov.cpp deleted file mode 100644 index 5e0f521f..00000000 --- a/print/XPSDrvSmpl/src/ui/xdsmplptprov.cpp +++ /dev/null @@ -1,891 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - xdsmplptprov.cpp - -Abstract: - - Implementation of the PrintTicket provider plugin. This is responsible for - handling PrintTicket features that are too complex for the GPD->PrintTicket - automapping facility. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdexcept.h" -#include "xdstring.h" -#include "xdsmplptprov.h" -#include "wmdmptcnv.h" -#include "pgscdmptcnv.h" -#include "bkdmptcnv.h" -#include "nupptcnv.h" -#include "coldmptcnv.h" -#include "pthndlr.h" -#include "pchndlr.h" - -static LPCWSTR PRIVATE_URI = L"http://schemas.microsoft.com/windows/2003/08/printing/XPSDrv_Feature_Sample"; - - -/*++ - -Routine Name: - - CXDSmplPTProvider::CXDSmplPTProvider - -Routine Description: - - CXDSmplPTProvider class constructor - -Arguments: - - None - -Return Value: - - None - Throws CXDException(HRESULT) on an error - ---*/ -CXDSmplPTProvider::CXDSmplPTProvider() : - CUnknown<IPrintOemPrintTicketProvider>(IID_IPrintOemPrintTicketProvider), - m_hPrinterCached(NULL), - m_pCoreHelper(NULL), - m_bstrPrivateNS(PRIVATE_URI) -{ - HRESULT hr = S_OK; - IFeatureDMPTConvert* pHandler = NULL; - -// -// This Prefast warning indicates that memory could be leaked -// in the event of an exception. We suppress this false positive because we -// know that the local try/catch block will clean up a single -// IFeatureDMPTConvert, and the destructor will clean up any that are -// successfully added to the vector. -// -#pragma prefast(push) -#pragma prefast(disable:__WARNING_ALIASED_MEMORY_LEAK_EXCEPTION) - try - { - // - // Populate the feature DM<->PT conversion vector - // - pHandler = new(std::nothrow) CWatermarkDMPTConv(); - - hr = AddConverter(pHandler); - - if (SUCCEEDED(hr)) - { - pHandler = new(std::nothrow) CPageScalingDMPTConv(); - - hr = AddConverter(pHandler); - } - - if (SUCCEEDED(hr)) - { - pHandler = new(std::nothrow) CBookletDMPTConv(); - - hr = AddConverter(pHandler); - } - - if (SUCCEEDED(hr)) - { - pHandler = new(std::nothrow) CNUpDMPTConv(); - - hr = AddConverter(pHandler); - } - - if (SUCCEEDED(hr)) - { - pHandler = new(std::nothrow) CColorProfileDMPTConv(); - - hr = AddConverter(pHandler); - } - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - - hr = E_FAIL; - } - - if (FAILED(hr)) - { - // - // If we successfully created a handler but failed to push it onto - // the handler vector we need to free the allocated handler - // - if (pHandler != NULL) - { - delete pHandler; - pHandler = NULL; - } - - // - // Delete any DM<->PT converters that were successfully instantiated - // - DeleteConverters(); - - throw CXDException(hr); - } -#pragma prefast(pop) -} - -/*++ - -Routine Name: - - CXDSmplPTProvider::~CXDSmplPTProvider - -Routine Description: - - CXDSmplPTProvider class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CXDSmplPTProvider::~CXDSmplPTProvider() -{ - // - // Clean up all DM<->PT converters - // - DeleteConverters(); -} - -/*++ - -Routine Name: - - CXDSmplPTProvider::GetSupportedVersions - -Routine Description: - - The routine returns major versions of Printschema schema supported by the plug-in Provider. - -Arguments: - - hPrinter - Printer Handle - ppVersions - OUT pointer to array of version numbers to be filled in by the plug-in - cVersions - OUT pointer to count of Number of versions supported by plug-in - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT STDMETHODCALLTYPE -CXDSmplPTProvider::GetSupportedVersions( - _In_ HANDLE, - _Outptr_result_buffer_(*pcVersions) INT* ppVersions[], - _Out_ INT* pcVersions - ) -{ - HRESULT hr = S_OK; - - // - // Check if input parameters are valid - // - if (SUCCEEDED(hr = CHECK_POINTER(ppVersions, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pcVersions, E_POINTER))) - { - *pcVersions = 0; - - // - // The Plug-in Provider need to allocate memory for the input version array and - // then fill it with version information - // - *ppVersions = static_cast<INT*>(CoTaskMemAlloc(sizeof(INT))); - - if (*ppVersions != NULL) - { - // - // version number 1 is the only version supported currently - // - *pcVersions = 1; - (*ppVersions)[0] = PRINTSCHEMA_VERSION_NUMBER; - } - else - { - hr = E_OUTOFMEMORY; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXDSmplPTProvider::BindPrinter - -Routine Description: - - Bind Printer is the part of the Unidrv's activity to bind to a device. It allows the plug-in to cache - certain information that can be used later on such as the private namespaces used by the plug-in. - -Arguments: - - hPrinter - Printer Handle supplied by Unidrv - version - version of Printschema - pOptions - Flags passed out to set configurable options supported by caller - cNamespaces - Count of private namespaces of plug-in - ppNamespaces - OUT pointer to the array of Namespace URIs filled in by plug-in - -Return Value: - - HRESULT - S_OK - On success - E_VERSION_NOT_SUPPORTED - if printer version specified is not supported by plug-in - E_* - On any other failure - ---*/ -HRESULT STDMETHODCALLTYPE -CXDSmplPTProvider::BindPrinter( - _In_ HANDLE hPrinter, - INT version, - _Out_ POEMPTOPTS pOptions, - _Out_ INT* pcNamespaces, - _Outptr_result_buffer_maybenull_(*pcNamespaces) BSTR** ppNamespaces - ) -{ - HRESULT hr = S_OK; - - // - // Printer Handle should be provided by Unidrv in this call, which is cached by plug-in provider and - // is later on used while making calls to Plug-in Helper Interface methods. - // - if (SUCCEEDED(hr = CHECK_POINTER(pOptions, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pcNamespaces, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(ppNamespaces, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(hPrinter, E_HANDLE))) - { - *ppNamespaces = NULL; - *pcNamespaces = 0; - - // - // Agree on the Printschema version with Unidrv Version 1 is the only - // version currently supported - // - if (PRINTSCHEMA_VERSION_NUMBER == version) - { - // - // Cache the printer handle for further use - // - m_hPrinterCached = hPrinter; - - // - // Flags to set configurable options, OEMPT_DEFAULT defined in prcomoem.h - // - *pOptions = OEMPT_NOSNAPSHOT; - - // - // Publish the private namespace - // - *pcNamespaces = 1; - *ppNamespaces = static_cast<BSTR*>(CoTaskMemAlloc(sizeof(BSTR))); - - if (SUCCEEDED(hr = CHECK_POINTER(*ppNamespaces, E_OUTOFMEMORY))) - { - hr = m_bstrPrivateNS.CopyTo(*ppNamespaces); - } - } - else - { - hr = E_VERSION_NOT_SUPPORTED; - } - } - - ERR_ON_HR_EXC(hr, E_VERSION_NOT_SUPPORTED); - return hr; -} - -/*++ - -Routine Name: - - CXDSmplPTProvider::PublishPrintTicketHelperInterface - -Routine Description: - - For a number of operations, the plug-in needs to use the Helper Interface utilities provided by - Unidrv. Unidrv uses this method to publish the PrintTicket Helper Interface, IPrintCoreHelper. - Plug-in should return SUCCESS after successfully incrementing the reference count of the interface. - -Arguments: - - pHelper - IPrintCoreHelper interface pointer - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT STDMETHODCALLTYPE -CXDSmplPTProvider::PublishPrintTicketHelperInterface( - _In_ IUnknown *pHelper - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pHelper, E_POINTER))) - { - // - // Need to store pointer to Driver Helper functions, if we already haven't. - // - if (m_pCoreHelper == NULL) - { - hr = pHelper->QueryInterface(IID_IPrintCoreHelperUni, reinterpret_cast<VOID**>(&m_pCoreHelper)); - } - - // - // It's possible that this routine will publish other interfaces in the future. - // If the object published did not support the desired interface, this routine - // should still succeed. - // - // If the helper interface is needed, but for some reason was not published - // (this would be an error on the OS's part), you should detect this and fail - // during the call-back where you intended to use the helper interface. - // - if (E_NOINTERFACE == hr) - { - hr = S_OK; - } - else - { - try - { - // - // Iterate over all PrintTicket feature converters publishing the helper interface - // - DMPTConvCollection::iterator iterConverters = m_vectFtrDMPTConverters.begin(); - - for (; iterConverters != m_vectFtrDMPTConverters.end() && SUCCEEDED(hr); iterConverters++) - { - hr = (*iterConverters)->PublishPrintTicketHelperInterface(m_pCoreHelper); - } - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXDSmplPTProvider::QueryDeviceDefaultNamespace - -Routine Description: - - This method provides the plug-in with the opportunity to specify the name of the - Private namespace URI that Unidrv should be using to handle any features defined - in the GPD that Unidrv does not recognize. The plug-in may specify a set of - namespaces as a result of the call to BindPrinter method, and Unidrv needs to know - which of them is to be used as default namespace so that, for all the features that - Unidrv does not recognize, it will put them under this namespace in the PrintTicket. - - Note: It is Unidrv's responsibility to add the private namespace URI that plug-in - has specified through this call in the root node of the DOM document, and also define - a prefix for it so that plug-in should use the prefix defined by Unidrv when it wishes - to add any new node to the PrintTicket under its private namespace. Plug-in should - not define its own prefix for this default private namespace URI. - -Arguments: - - pbstrNamespaceUri - OUT Pointer to namespace URI to be filled in and returned by plug-in - -Return Value: - - HRESULT - S_OK - On success - E_NOTIMPL - The plugin does not require a private namespace - E_* - On error - ---*/ -HRESULT STDMETHODCALLTYPE -CXDSmplPTProvider::QueryDeviceDefaultNamespace( - _Out_ BSTR* pbstrNamespaceUri - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrNamespaceUri, E_POINTER))) - { - hr = m_bstrPrivateNS.CopyTo(pbstrNamespaceUri); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXDSmplPTProvider::ConvertPrintTicketToDevMode - -Routine Description: - - Unidrv will call this routine before it performs its part of PT->DM - conversion. The plug-in is passed with an input PrintTicket that is - fully populated, and Devmode which has default settings in it. - - This routine merely passes the call on to the individual feature handlers. - -Arguments: - - pPrintTicket - pointer to input PrintTicket - cbDevmode - size in bytes of input full devmode - pDevmode - pointer to input full devmode buffer - cbDrvPrivateSize - buffer size in bytes of plug-in private devmode - pPrivateDevmode - pointer to plug-in private devmode buffer - - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT STDMETHODCALLTYPE -CXDSmplPTProvider::ConvertPrintTicketToDevMode( - _In_ IXMLDOMDocument2* pPrintTicket, - ULONG cbDevmode, - _Inout_updates_bytes_(cbDevmode) - PDEVMODE pDevmode, - ULONG cbDrvPrivateSize, - _Inout_ PVOID pPrivateDevmode - ) -{ - HRESULT hr = S_OK; - - // - // Validate parameters - // - if (SUCCEEDED(hr = CHECK_POINTER(pDevmode, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pPrivateDevmode, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pPrintTicket, E_POINTER))) - { - if (cbDevmode < sizeof(DEVMODE) || - cbDrvPrivateSize == 0) - { - hr = E_INVALIDARG; - } - } - - try - { - if (SUCCEEDED(hr)) - { - // - // Iterate over all PrintTicket feature converters letting them - // provide the conversion - // - DMPTConvCollection::iterator iterConverters = m_vectFtrDMPTConverters.begin(); - - for (; iterConverters != m_vectFtrDMPTConverters.end() && SUCCEEDED(hr); iterConverters++) - { - hr = (*iterConverters)->ConvertPrintTicketToDevMode(pPrintTicket, cbDevmode, pDevmode, cbDrvPrivateSize, pPrivateDevmode); - } - } - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXDSmplPTProvider::ConvertDevModeToPrintTicket - -Routine Description: - - Unidrv will call the routine with an Input PrintTicket that is populated - with public and Unidrv private features. For those features in the GPD that - Unidrv does not understand, it puts them in the PT under the private namespace - (either specified by the plug-in through QueryDeviceDefaultNamespace or created - by itself). It is the plug-in's responsibility to read the corresponding features - from the input PT and put them in public printschema namespace, so that any higher - level application making use of a PrintTicket can read and interpret these settings. - - This routine merely passes the call on to the individual feature handlers. - - -Arguments: - - cbDevmode - size in bytes of input full devmode - pDevmode - pointer to input full devmode buffer - cbDrvPrivateSize - buffer size in bytes of plug-in private devmode - pPrivateDevmode - pointer to plug-in private devmode buffer - pPrintTicket - pointer to input PrintTicket - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT STDMETHODCALLTYPE -CXDSmplPTProvider::ConvertDevModeToPrintTicket( - ULONG cbDevmode, - _Inout_updates_bytes_(cbDevmode) - PDEVMODE pDevmode, - ULONG cbDrvPrivateSize, - _Inout_ PVOID pPrivateDevmode, - _Inout_ IXMLDOMDocument2* pPrintTicket - ) -{ - HRESULT hr = S_OK; - - // - // Validate parameters - // - if (SUCCEEDED(hr = CHECK_POINTER(pDevmode, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pPrivateDevmode, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pPrintTicket, E_POINTER))) - { - if (cbDevmode < sizeof(DEVMODE) || - cbDrvPrivateSize == 0) - { - hr = E_INVALIDARG; - } - } - - try - { - if (SUCCEEDED(hr)) - { - // - // Iterate over all PrintTicket feature converters letting them - // provide the conversion - // - DMPTConvCollection::iterator iterConverters = m_vectFtrDMPTConverters.begin(); - - for (; iterConverters != m_vectFtrDMPTConverters.end() && SUCCEEDED(hr); iterConverters++) - { - hr = (*iterConverters)->ConvertDevModeToPrintTicket(cbDevmode, pDevmode, cbDrvPrivateSize, pPrivateDevmode, pPrintTicket); - } - - // - // Delete all the private features generated by the Unidrv parser from the GPD. - // These are not required in the PrintTicket as they are only used to control - // features in the public PrintSchema and have no meaning outside the config - // module. - // - if (SUCCEEDED(hr)) - { - CPTHandler ptHandler(pPrintTicket); - hr = ptHandler.DeletePrivateFeatures(m_bstrPrivateNS); - } - } - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXDSmplPTProvider::CompletePrintCapabilities - -Routine Description: - - Unidrv calls this routine with an input Device Capabilities Document - that is partially populated with Device capabilities information - filled in by Unidrv for features that it understands. The plug-in - needs to read any private features in the input PrintTicket, delete - them and add them back under Printschema namespace so that higher - level applications can understand them and make use of them. - - The XPSDrv sample driver does not define any private device capabilities - so this method merely returns S_OK - -Arguments: - - pPrintTicket - pointer to input PrintTicket - pCapabilities - pointer to Device Capabilities Document. - -Return Value: - - HRESULT - S_OK - Always - ---*/ -HRESULT STDMETHODCALLTYPE -CXDSmplPTProvider::CompletePrintCapabilities( - _In_opt_ IXMLDOMDocument2* pPrintTicket, - _Inout_ IXMLDOMDocument2* pPrintCapabilities - ) -{ - HRESULT hr = S_OK; - - // - // Validate parameters - // - if (SUCCEEDED(hr = CHECK_POINTER(pPrintCapabilities, E_POINTER))) - { - try - { - // - // Iterate over all PrintTicket feature converters letting them - // provide the conversion - // - DMPTConvCollection::iterator iterConverters = m_vectFtrDMPTConverters.begin(); - - for (; iterConverters != m_vectFtrDMPTConverters.end() && SUCCEEDED(hr); iterConverters++) - { - hr = (*iterConverters)->CompletePrintCapabilities(pPrintTicket, pPrintCapabilities); - } - - // - // Delete all the private features generated by the Unidrv parser from the GPD. - // These are not required in the PrintCapabilities as they are only used to control - // features in the public PrintSchema and have no meaning outside the config - // module. - // - if (SUCCEEDED(hr)) - { - CPCHandler pcHandler(pPrintCapabilities); - hr = pcHandler.DeletePrivateFeatures(m_bstrPrivateNS); - } - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXDSmplPTProvider::ExpandIntentOptions - -Routine Description: - - As part of its Merge and Validate Procedure, the Unidrv/Postscript driver - will call this routine to give the plug-in a chance to expand options - which represent intent into their individual settings in other features - in the PrintTicket. This has two important effects: the client sees the - results of the intent expansion, and unidrv resolves constraints against - the individual features which are affected by the intent. - - The XPSDrv sample driver plug-in does not support any intent features, therefore - simply returns S_OK. - -Arguments: - - pPrintTicket - Pointer to input PrintTicket. - -Return Value: - - HRESULT - S_OK - Always - ---*/ -HRESULT STDMETHODCALLTYPE -CXDSmplPTProvider::ExpandIntentOptions( - _Inout_ IXMLDOMDocument2 * - ) -{ - return S_OK; -} - -/*++ - -Routine Name: - - CXDSmplPTProvider::ValidatePrintTicket - -Routine Description: - - The plug-in might need to delete any feature under private namespace - from input PT that are also in the public namespace because of Merge - and Validate. - - The Validate method should also perform any conflict resolution if - necessary looking at the settings made in public and unidrv private - part of PrintTicket, to make sure that the resultant PrintTicket is a - valid one, and has all constraints resolved. - - This routine merely passes the validate call on to the feature handlers - -Arguments: - - pPrintTicket - Pointer to input PrintTicket. - -Return Value: - - HRESULT - S_NO_CONFLICT/S_CONFLICT_RESOLVED - On success - E_* - On error - ---*/ -HRESULT STDMETHODCALLTYPE -CXDSmplPTProvider::ValidatePrintTicket( - _Inout_ IXMLDOMDocument2* pPrintTicket - ) -{ - HRESULT hr = S_NO_CONFLICT; - - // - // Validate parameters - // - if (pPrintTicket != NULL) - { - try - { - // - // Iterate over all PrintTicket feature converters letting them - // provide the validation - // - DMPTConvCollection::iterator iterConverters = m_vectFtrDMPTConverters.begin(); - - for (; iterConverters != m_vectFtrDMPTConverters.end() && SUCCEEDED(hr); iterConverters++) - { - HRESULT hrConverter = (*iterConverters)->ValidatePrintTicket(pPrintTicket); - - if (FAILED(hrConverter) || - hrConverter == static_cast<HRESULT>(S_CONFLICT_RESOLVED)) - { - hr = hrConverter; - } - } - } - catch (...) - { - hr = E_FAIL; - } - } - else - { - hr = E_POINTER; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXDSmplPTProvider::DeleteConverters - -Routine Description: - - This routine cleans up the vector of DM <-> PT converters. - -Arguments: - - NONE - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXDSmplPTProvider::DeleteConverters( - VOID - ) -{ - HRESULT hr = S_OK; - - try - { - while (!m_vectFtrDMPTConverters.empty()) - { - if (m_vectFtrDMPTConverters.back() != NULL) - { - delete m_vectFtrDMPTConverters.back(); - m_vectFtrDMPTConverters.back() = NULL; - } - - m_vectFtrDMPTConverters.pop_back(); - } - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - - ERR_ON_HR(hr); - return hr; -} - -// -// Use __drv_aliasesMem annotation to avoid PREfast warning 28197: Possibly leaking memory, -// -HRESULT -// Prefast warning 28194: The function was declared as aliasing the value in variable and exited without doing so. -// We suppress this false positive because STL vector does not have annotation, and we know the pointer has been saved -// to STL vector, which is released in DeleteConverters(). -#pragma warning(suppress: 28194) -CXDSmplPTProvider::AddConverter( - _In_opt_ __drv_aliasesMem IFeatureDMPTConvert *pHandler - ) -{ - HRESULT hr = CHECK_POINTER(pHandler, E_OUTOFMEMORY); - - if (SUCCEEDED(hr)) - { - m_vectFtrDMPTConverters.push_back(pHandler); - } - - return hr; -} diff --git a/print/XPSDrvSmpl/src/ui/xdsmplptprov.h b/print/XPSDrvSmpl/src/ui/xdsmplptprov.h deleted file mode 100644 index 3286944f..00000000 --- a/print/XPSDrvSmpl/src/ui/xdsmplptprov.h +++ /dev/null @@ -1,124 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - xdsmplptprov.h - -Abstract: - - Definition of the PrintTicket provider plugin. This is responsible for - handling PrintTicket features that are too complex for the GPD->PrintTicket - automapping facility. - ---*/ - -#pragma once - -#include "cunknown.h" -#include "schema.h" -#include "ftrdmptcnv.h" - -typedef vector<IFeatureDMPTConvert*> DMPTConvCollection; - -class CXDSmplPTProvider : public CUnknown<IPrintOemPrintTicketProvider> -{ -public: - CXDSmplPTProvider(); - - virtual ~CXDSmplPTProvider(); - - // - // IPrintOemPrintTicketProvider methods - // - virtual HRESULT STDMETHODCALLTYPE - GetSupportedVersions( - _In_ HANDLE hPrinter, - _Outptr_result_buffer_(*pcVersions) INT* ppVersions[], - _Out_ INT* pcVersions - ); - - virtual HRESULT STDMETHODCALLTYPE - BindPrinter( - _In_ HANDLE hPrinter, - INT version, - _Out_ POEMPTOPTS pOptions, - _Out_ INT* pcNamespaces, - _Outptr_result_buffer_maybenull_(*pcNamespaces) BSTR** ppNamespaces - ); - - virtual HRESULT STDMETHODCALLTYPE - PublishPrintTicketHelperInterface( - _In_ IUnknown* pHelper - ); - - virtual HRESULT STDMETHODCALLTYPE - QueryDeviceDefaultNamespace( - _Out_ BSTR* pbstrNamespaceUri - ); - - virtual HRESULT STDMETHODCALLTYPE - ConvertPrintTicketToDevMode( - _In_ IXMLDOMDocument2* pPrintTicket, - ULONG cbDevmode, - _Inout_updates_bytes_(cbDevmode) - PDEVMODE pDevmode, - ULONG cbDrvPrivateSize, - _Inout_ PVOID pPrivateDevmode - ); - - virtual HRESULT STDMETHODCALLTYPE - ConvertDevModeToPrintTicket( - ULONG cbDevmode, - _Inout_updates_bytes_(cbDevmode) - PDEVMODE pDevmode, - ULONG cbDrvPrivateSize, - _Inout_ PVOID pPrivateDevmode, - _Inout_ IXMLDOMDocument2* pPrintTicket - ); - - virtual HRESULT STDMETHODCALLTYPE - CompletePrintCapabilities( - _In_opt_ IXMLDOMDocument2* pPrintTicket, - _Inout_ IXMLDOMDocument2* pCapabilities - ); - - virtual HRESULT STDMETHODCALLTYPE - ExpandIntentOptions( - _Inout_ IXMLDOMDocument2* pPrintTicket - ); - - virtual HRESULT STDMETHODCALLTYPE - ValidatePrintTicket( - _Inout_ IXMLDOMDocument2* pPrintTicket - ); - -private: - HRESULT - DeleteConverters( - VOID - ); - - HRESULT - AddConverter( - _In_opt_ __drv_aliasesMem IFeatureDMPTConvert* pHandler - ); - -private: - HANDLE m_hPrinterCached; - - CComPtr<IPrintCoreHelperUni> m_pCoreHelper; - - DMPTConvCollection m_vectFtrDMPTConverters; - - CComBSTR m_bstrPrivateNS; -}; - diff --git a/print/XPSDrvSmpl/src/ui/xdsmplui.cpp b/print/XPSDrvSmpl/src/ui/xdsmplui.cpp deleted file mode 100644 index b41116a6..00000000 --- a/print/XPSDrvSmpl/src/ui/xdsmplui.cpp +++ /dev/null @@ -1,1018 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - xdsmplui.cpp - -Abstract: - - Implementation of the UI plugin. This is responsible for initialising and maintaining - the property pages used in the XPSDrv feature sample UI. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdexcept.h" -#include "xdstring.h" -#include "xdsmplui.h" -#include "colppg.h" -#include "wmppg.h" -#include "ftrppg.h" -#include "UIProperties.h" - -/*++ - -Routine Name: - - CXDSmplUI::CXDSmplUI - -Routine Description: - - CXDSmplUI class constructor. - Creates a handler class object for every property page added in Unidrv UI Plug-in. - Each of these handlers is stored in a collection. - - -Arguments: - - None - -Return Value: - - None - ---*/ -CXDSmplUI::CXDSmplUI() : - CUnknown<IPrintOemUI>(IID_IPrintOemUI), - m_pDriverUIHelp(NULL), - m_pOemCUIPParam(NULL), - m_pUIProperties(NULL) -{ -} - -/*++ - -Routine Name: - - CXDSmplUI::~CXDSmplUI - -Routine Description: - - CXDSmplUI class destructor. - -Arguments: - - None - -Return Value: - - None. - ---*/ -CXDSmplUI::~CXDSmplUI() -{ - DestroyPropPages(); -} - -/*++ - -Routine Name: - - CXDSmplUI::PublishDriverInterface - -Routine Description: - - The PublishDriverInterface method allows a user interface plug-in to obtain - the Unidrv driver's IPrintOemDriverUI interface. - -Arguments: - - pIUnknown - Caller-supplied pointer to the IUnknown interface of the driver's - IPrintOemDriverUI COM Interface. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXDSmplUI::PublishDriverInterface( - _In_ IUnknown* pIUnknown - ) -{ - HRESULT hr = E_FAIL; - PVOID pInterface = NULL; - - if (m_pDriverUIHelp == NULL && - SUCCEEDED(hr = pIUnknown->QueryInterface(IID_IPrintOemDriverUI, &pInterface))) - { - m_pDriverUIHelp = reinterpret_cast<IPrintOemDriverUI*>(pInterface); - hr = S_OK; - } - - return hr; -} - -/*++ - -Routine Name: - - CXDSmplUI::GetInfo - -Routine Description: - - Unidrv will call this routine to obtain identification information. - -Arguments: - - dwMode - Supported modes are OEMGI_GETSIGNATURE and OEMGI_GETVERSION. - pBuffer - Caller-supplied pointer to memory allocated to receive the information specified by dwMode. - cbSize - Caller-supplied size of the buffer pointed to by pBuffer. - pcbNeeded - Caller-supplied pointer to a location to receive the number of bytes written into the buffer pointed to by pBuffer. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXDSmplUI::GetInfo( - _In_ DWORD dwMode, - _Out_writes_bytes_(cbSize) PVOID pBuffer, - _In_ DWORD cbSize, - _Out_ PDWORD pcbNeeded - ) -{ - HRESULT hr = S_OK; - - if ((NULL == pcbNeeded) || - ((OEMGI_GETSIGNATURE != dwMode) && - (OEMGI_GETVERSION != dwMode) && - (OEMGI_GETREQUESTEDHELPERINTERFACES != dwMode))) - { - SetLastError(ERROR_INVALID_PARAMETER); - hr = E_INVALIDARG; - } - else - { - *pcbNeeded = sizeof(DWORD); - - if ((cbSize < *pcbNeeded) || - (NULL == pBuffer)) - { - SetLastError(ERROR_INSUFFICIENT_BUFFER); - hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); - } - else - { - switch (dwMode) - { - case OEMGI_GETSIGNATURE: - { - *reinterpret_cast<PDWORD>(pBuffer) = OEM_SIGNATURE; - } - break; - - case OEMGI_GETVERSION: - { - *reinterpret_cast<PDWORD>(pBuffer) = OEM_VERSION; - } - break; - - default: - { - *pcbNeeded = 0; - hr = E_NOTIMPL; - } - break; - } - } - } - - ERR_ON_HR_EXC(hr, E_NOTIMPL); - return hr; -} - -/*++ - -Routine Name: - - CXDSmplUI::DevMode - -Routine Description: - - Performs operation on UI Plugins Private DevMode Members. - Called via IPrintOemUI::DevMode - -Arguments: - - dwMode - Supported modes are OEMDM_SIZE, OEMDM_DEFAULT, OEMDM_CONVERT and OEMDM_MERGE. - pOemDMParam - Caller-supplied pointer to an OEMDMPARAM structure. - Dependent on which dwMode is set. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXDSmplUI::DevMode( - _In_ DWORD dwMode, - _In_ POEMDMPARAM pOemDMParam - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pOemDMParam, E_POINTER))) - { - if ((OEMDM_SIZE != dwMode) && - (OEMDM_DEFAULT != dwMode) && - (OEMDM_CONVERT != dwMode)&& - (OEMDM_MERGE != dwMode)) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - switch (dwMode) - { - // - // The method should return the size of the memory allocation needed to store the UI plugin Private DEVMODE. - // - case OEMDM_SIZE: - { - pOemDMParam->cbBufSize = sizeof(OEMDEV); - } - break; - - // - // Should fill the Private DEVMODE with the default values. - // - case OEMDM_DEFAULT: - { - try - { - if (SUCCEEDED(hr = CHECK_POINTER(pOemDMParam->pOEMDMOut, E_POINTER))) - { - CUIProperties oemDevOut = CUIProperties(reinterpret_cast<POEMDEV>(pOemDMParam->pOEMDMOut)); - - hr = oemDevOut.SetDefaults(); - } - } - catch (CXDException &e) - { - hr = e; - } - catch (...) - { - hr = E_FAIL; - } - } - break; - - // - // The method should convert private DEVMODE members to the current version, if necessary. - // - case OEMDM_CONVERT: - { - try - { - if (SUCCEEDED(hr = CHECK_POINTER(pOemDMParam->pOEMDMOut, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pOemDMParam->pOEMDMIn, E_POINTER))) - { - CUIProperties oemDevIn = CUIProperties(reinterpret_cast<POEMDEV>(pOemDMParam->pOEMDMIn)); - CUIProperties oemDevOut = CUIProperties(reinterpret_cast<POEMDEV>(pOemDMParam->pOEMDMOut)); - - hr = oemDevOut.Convert(&oemDevIn); - } - } - catch (CXDException &e) - { - hr = e; - } - catch (...) - { - hr = E_FAIL; - } - } - break; - - // - //The method should validate the information contained in private DEVMODE members and merge validated values into a private DEVMODE structure containing default values - // - case OEMDM_MERGE: - { - try - { - if (SUCCEEDED(hr = CHECK_POINTER(pOemDMParam->pOEMDMOut, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pOemDMParam->pOEMDMIn, E_POINTER))) - { - CUIProperties oemDevIn = CUIProperties(reinterpret_cast<POEMDEV>(pOemDMParam->pOEMDMIn)); - CUIProperties oemDevOut = CUIProperties(reinterpret_cast<POEMDEV>(pOemDMParam->pOEMDMOut)); - - if (SUCCEEDED(hr = oemDevOut.Convert(&oemDevIn))) - { - hr = oemDevOut.Validate(); - } - } - } - catch (CXDException &e) - { - hr = e; - } - catch (...) - { - hr = E_FAIL; - } - } - break; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXDSmplUI::CommonUIProp - -Routine Description: - - This method allows a user interface plug-in to modify an existing printer property sheet page. - -Arguments: - - dwMode - Supported modes are OEMCUIP_DOCPROP and OEMCUIP_PRNPROP. - pOemCUIPParam - Caller-supplied pointer to an OEMCUIPPARAM structure. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXDSmplUI::CommonUIProp( - _In_ DWORD dwMode, - _In_ POEMCUIPPARAM pOemCUIPParam - ) -{ - HRESULT hr = S_OK; - - if (dwMode == OEMCUIP_PRNPROP) - { - // - // We do not implement any printer property sheets - // - hr = E_NOTIMPL; - } - else if (dwMode != OEMCUIP_DOCPROP) - { - // - // Unknown mode encountered - // - hr = E_INVALIDARG; - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_POINTER(pOemCUIPParam, E_POINTER))) - { - // - // Store the OEMCUIPPARAM pointer so we can modify data and OPTITEMS. - // - m_pOemCUIPParam = pOemCUIPParam; - - // - // The pDrvOptItems member is NULL on the first call through to CommonUIProp(). - // - if (pOemCUIPParam->pDrvOptItems != NULL) - { - try - { - CUIProperties uiProperties; - hr = uiProperties.HideOptItems(pOemCUIPParam); - } - catch (CXDException& e) - { - hr = e; - } - catch (...) - { - hr = E_FAIL; - } - } - } - - ERR_ON_HR_EXC(hr, E_NOTIMPL); - return hr; -} - -/*++ - -Routine Name: - - CXDSmplUI::DocumentPropertySheets - -Routine Description: - - This method allows a user interface plug-in to append a new page to a printer device's - document property sheet. - -Arguments: - - pPSUIInfo - Caller-supplied pointer to a PROPSHEETUI_INFO structure. - lParam - Caller-supplied value that depends on the reason value in pPSUIInfo->Reason. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXDSmplUI::DocumentPropertySheets( - _In_ PPROPSHEETUI_INFO pPSUIInfo, - _In_ LPARAM lParam - ) -{ - HRESULT hr = S_OK; - - if (pPSUIInfo == NULL || - pPSUIInfo->Version != PROPSHEETUI_INFO_VERSION) - { - SetLastError(ERROR_INVALID_PARAMETER); - hr = E_INVALIDARG; - } - else - { - switch (pPSUIInfo->Reason) - { - case PROPSHEETUI_REASON_INIT: - { - // - // We need to report the OEMCUIPPARAM structure to the prop sheet - // so ASSERT it is valid. We will let the prop sheet decide if it - // is critical to have a valid pointer or not - // - ASSERTMSG(m_pOemCUIPParam != NULL, "NULL pointer to OEMCUIPPARAM structure.\n"); - - try - { - // - // Create the UI properties object - // - m_pUIProperties = new(std::nothrow) CUIProperties(reinterpret_cast<POEMDEV>(m_pOemCUIPParam->pOEMDM)); - - // - // Create the property pages for the document property sheet - // - if (SUCCEEDED(hr = CHECK_POINTER(m_pUIProperties, E_OUTOFMEMORY)) && - SUCCEEDED(hr = CreatePropertyPages())) - { - DocPropertyPageMap::iterator iterPropSheets = m_vectPropPages.begin(); - - // - // Make sure the helper interfaces and the OEMCUIPPARAM structure - // are published to the page first. This allows the prop sheet to - // propogate these interfaces to the UI control objects when initializing - // - while (iterPropSheets != m_vectPropPages.end() && - SUCCEEDED(hr = CHECK_POINTER(*iterPropSheets, E_FAIL)) && - SUCCEEDED(hr = (*iterPropSheets)->SetPrintOemDriverUI(m_pDriverUIHelp)) && - SUCCEEDED(hr = (*iterPropSheets)->SetOemCUIPParam(m_pOemCUIPParam))&& - SUCCEEDED(hr = (*iterPropSheets)->SetUIProperties(m_pUIProperties))&& - SUCCEEDED(hr = (*iterPropSheets)->PropPageInit(pPSUIInfo))) - { - iterPropSheets++; - } - } - } - catch (CXDException &e) - { - hr = e; - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - break; - - case PROPSHEETUI_REASON_GET_INFO_HEADER: - { - if (SUCCEEDED(hr = CHECK_POINTER(pPSUIInfo, E_POINTER))) - { - pPSUIInfo->Result = TRUE; - } - } - break; - - case PROPSHEETUI_REASON_DESTROY: - { - if (SUCCEEDED(hr = CHECK_POINTER(pPSUIInfo, E_POINTER))) - { - pPSUIInfo->Result = TRUE; - } - } - break; - - case PROPSHEETUI_REASON_SET_RESULT: - { - if (SUCCEEDED(hr = CHECK_POINTER(pPSUIInfo, E_POINTER))) - { - pPSUIInfo->Result = reinterpret_cast<PSETRESULT_INFO>(lParam)->Result; - } - } - break; - - case PROPSHEETUI_REASON_GET_ICON: - { - if (SUCCEEDED(hr = CHECK_POINTER(pPSUIInfo, E_POINTER))) - { - // - // No icon - // - pPSUIInfo->Result = FALSE; - } - } - break; - - default: - { - hr = E_FAIL; - } - break; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXDSmplUI::DevicePropertySheets - -Routine Description: - - This method allows a user interface plug-in to append a new page to a printer device's - printer property sheet. - -Arguments: - - None referenced. - -Return Value: - - HRESULT - E_NOTIMPL - Method not implemented - ---*/ -HRESULT -CXDSmplUI::DevicePropertySheets( - _In_ PPROPSHEETUI_INFO, - _In_ LPARAM - ) -{ - return E_NOTIMPL; -} - -/*++ - -Routine Name: - - CXDSmplUI::DevQueryPrintEx - -Routine Description: - - This method allows a user interface plug-in to help determine if a print job is printable. - -Arguments: - - None referenced. - -Return Value: - - HRESULT - E_NOTIMPL - Method not implemented - ---*/ -HRESULT -CXDSmplUI::DevQueryPrintEx( - _In_ POEMUIOBJ, - _In_ PDEVQUERYPRINT_INFO, - _In_ PDEVMODE, - _In_ PVOID - ) -{ - return E_NOTIMPL; -} - -/*++ - -Routine Name: - - CXDSmplUI::DeviceCapabilities - -Routine Description: - - This method enables a user interface plug-in to specify customized device capabilities. - -Arguments: - - None referenced. - -Return Value: - - HRESULT - E_NOTIMPL - Method not implemented - ---*/ -HRESULT -CXDSmplUI::DeviceCapabilities( - _In_ POEMUIOBJ, - _In_ HANDLE, - _In_z_ PWSTR, - _In_ WORD, - _In_ PVOID, - _In_ PDEVMODE, - _In_ PVOID, - _In_ DWORD, - _In_ DWORD* - ) -{ - return E_NOTIMPL; -} - -/*++ - -Routine Name: - - CXDSmplUI::UpgradePrinter - -Routine Description: - - This method allows a user interface plug-in to upgrade device option values - that are stored in the registry. - -Arguments: - - None referenced. - -Return Value: - - HRESULT - E_NOTIMPL - Method not implemented - ---*/ -HRESULT -CXDSmplUI::UpgradePrinter( - _In_ DWORD, - _In_ PBYTE - ) -{ - return E_NOTIMPL; -} - -/*++ - -Routine Name: - - CXDSmplUI::PrinterEvent - -Routine Description: - - This method allows a user interface plug-in to process printer events. - -Arguments: - - None referenced. - -Return Value: - - HRESULT - E_NOTIMPL - Method not implemented - ---*/ -HRESULT -CXDSmplUI::PrinterEvent( - _In_ PWSTR , - _In_ INT , - _In_ DWORD , - _In_ LPARAM - ) -{ - return E_NOTIMPL; -} - -/*++ - -Routine Name: - - CXDSmplUI::DriverEvent - -Routine Description: - - The printer driver's DrvDriverEvent function calls a user interface plug-in's - IPrintOemUI::DriverEvent method for additional processing of printer driver events. - -Arguments: - - None referenced. - -Return Value: - - HRESULT - E_NOTIMPL - Method not implemented - ---*/ -HRESULT -CXDSmplUI::DriverEvent( - _In_ DWORD , - _In_ DWORD , - _In_reads_(_Inexpressible_("varies")) PBYTE , - _In_ LPARAM - ) -{ - return E_NOTIMPL; -} - -/*++ - -Routine Name: - - CXDSmplUI::QueryColorProfile - -Routine Description: - - This method allows a user interface plug-in to specify an ICC profile to use for color management. - -Arguments: - - None referenced. - -Return Value: - - HRESULT - E_NOTIMPL - Method not implemented - ---*/ -HRESULT -CXDSmplUI::QueryColorProfile( - _In_ HANDLE , - _In_ POEMUIOBJ , - _In_ PDEVMODE , - _In_ PVOID , - _In_ ULONG , - _Out_writes_(*pcbProfileData) VOID* , - _Inout_ ULONG* pcbProfileData, - _Out_ FLONG* - ) -{ - UNREFERENCED_PARAMETER(pcbProfileData); - return E_NOTIMPL; -} - -/*++ - -Routine Name: - - CXDSmplUI::FontInstallerDlgProc - -Routine Description: - - A user interface plug-in's IPrintOemUI::FontInstallerDlgProc method replaces - the Unidrv font installer's user interface. - -Arguments: - - None referenced. - -Return Value: - - HRESULT - E_NOTIMPL - Method not implemented - ---*/ -HRESULT -CXDSmplUI::FontInstallerDlgProc( - _In_ HWND , - _In_ UINT , - _In_ WPARAM , - _In_ LPARAM - ) -{ - return E_NOTIMPL; -} - -/*++ - -Routine Name: - - CXDSmplUI::UpdateExternalFonts - -Routine Description: - - This allows a user interface plug-in to update a printer's Unidrv Font Format Files (.uff file). - -Arguments: - - None referenced. - -Return Value: - - HRESULT - E_NOTIMPL - Method not implemented - ---*/ -HRESULT -CXDSmplUI::UpdateExternalFonts( - _In_ HANDLE, - _In_ HANDLE, - _In_z_ PWSTR - ) -{ - return E_NOTIMPL; -} - -/*++ - -Routine Name: - - CXDSmplUI::CreatePropertyPages - -Routine Description: - - Creates all property page handler objects. - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXDSmplUI::CreatePropertyPages( - VOID - ) -{ - HRESULT hr = S_OK; - CDocPropPage* pPropPage = NULL; - -// -// This Prefast warning indicates that memory could be leaked -// in the event of an exception. We suppress this false positive because we -// know that the local try/catch block will clean up a single -// CDocPropPage, and the destructor will clean up any that are -// successfully added to the vector. -// -#pragma prefast(push) -#pragma prefast(disable:__WARNING_ALIASED_MEMORY_LEAK_EXCEPTION) - - try - { - // - // Populate the property page vector - // - pPropPage = new(std::nothrow) CColorPropPage(); - - hr = AddPropPage(pPropPage); - - if (SUCCEEDED(hr)) - { - pPropPage = new(std::nothrow) CWatermarkPropPage(); - hr = AddPropPage(pPropPage); - } - - if (SUCCEEDED(hr)) - { - pPropPage = new(std::nothrow) CFeaturePropPage(); - hr = AddPropPage(pPropPage); - } - } - catch (CXDException &e) - { - hr = e; - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - - if (FAILED(hr)) - { - // - // If we successfully created a property page but failed to push it onto - // the vector we need to free the allocated property page - // - if (pPropPage != NULL) - { - delete pPropPage; - pPropPage = NULL; - } - } - -#pragma prefast(pop) - - return hr; -} - -/*++ - -Routine Name: - - CXDSmplUI::DestroyPropPages - -Routine Description: - - Destroy all property page handler classes that have been added into the collection. - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -inline VOID -CXDSmplUI::DestroyPropPages( - VOID - ) -{ - while (!m_vectPropPages.empty()) - { - if (m_vectPropPages.back() != NULL) - { - delete m_vectPropPages.back(); - m_vectPropPages.back() = NULL; - } - - m_vectPropPages.pop_back(); - } - - if (m_pUIProperties != NULL) - { - delete m_pUIProperties; - m_pUIProperties = NULL; - } -} - -// -// Use __drv_aliasesMem annotation to avoid PREfast warning 28197: Possibly leaking memory, -// -HRESULT -// Prefast warning 28194: The function was declared as aliasing the value in variable and exited without doing so. -// We suppress this false positive because STL vector does not have annotation, and we know the pointer has been saved -// to STL vector, which is released in DestroyPropPages(). -#pragma warning(suppress: 28194) -CXDSmplUI::AddPropPage( - _In_opt_ __drv_aliasesMem CDocPropPage* pPropPage - ) -{ - HRESULT hr = CHECK_POINTER(pPropPage, E_OUTOFMEMORY); - - if (SUCCEEDED(hr)) - { - m_vectPropPages.push_back(pPropPage); - } - - return hr; -} - diff --git a/print/XPSDrvSmpl/src/ui/xdsmplui.def b/print/XPSDrvSmpl/src/ui/xdsmplui.def deleted file mode 100644 index dccec9d5..00000000 --- a/print/XPSDrvSmpl/src/ui/xdsmplui.def +++ /dev/null @@ -1,23 +0,0 @@ -; -; Copyright (c) 2005 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. -; -; File Name: -; -; xdsmplui.def -; -; Abstract: -; -; XPSDrv feature sample config plugin module definition file -; - -LIBRARY XDSmplUI -EXPORTS DllGetClassObject PRIVATE - DllCanUnloadNow PRIVATE - diff --git a/print/XPSDrvSmpl/src/ui/xdsmplui.h b/print/XPSDrvSmpl/src/ui/xdsmplui.h deleted file mode 100644 index c175de88..00000000 --- a/print/XPSDrvSmpl/src/ui/xdsmplui.h +++ /dev/null @@ -1,161 +0,0 @@ -/*++ - -Copyright (c) 2005 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. - -File Name: - - xdsmplui.h - -Abstract: - - Definition of the UI plugin. This is responsible for initialising and maintining - the property pages used in the XPSDrv feature sample UI. - ---*/ - -#pragma once - -#include "cunknown.h" -#include "docppg.h" - -typedef std::vector<CDocPropPage*> DocPropertyPageMap; - -class CXDSmplUI : public CUnknown<IPrintOemUI> -{ -public: - // - // Construction and Destruction - // - CXDSmplUI(); - - virtual ~CXDSmplUI(); - - // - // IPrintOemUI methods - // - STDMETHOD(PublishDriverInterface)(THIS_ - _In_ IUnknown* pIUnknown - ); - - STDMETHOD(GetInfo)(THIS_ - _In_ DWORD dwMode, - _Out_writes_bytes_(cbSize) PVOID pBuffer, - _In_ DWORD cbSize, - _Out_ PDWORD pcbNeeded - ); - - STDMETHOD(DevMode)(THIS_ - _In_ DWORD dwMode, - _In_ POEMDMPARAM pOemDMParam - ); - - STDMETHOD(CommonUIProp)(THIS_ - _In_ DWORD dwMode, - _In_ POEMCUIPPARAM pOemCUIPParam - ); - - STDMETHOD(DocumentPropertySheets)(THIS_ - _In_ PPROPSHEETUI_INFO pPSUIInfo, - _In_ LPARAM lParam - ); - - STDMETHOD(DevicePropertySheets)(THIS_ - _In_ PPROPSHEETUI_INFO pPSUIInfo, - _In_ LPARAM lParam - ); - - STDMETHOD(DevQueryPrintEx)(THIS_ - _In_ POEMUIOBJ poemuiobj, - _In_ PDEVQUERYPRINT_INFO pDQPInfo, - _In_ PDEVMODE pPublicDM, - _In_ PVOID pOEMDM - ); - - STDMETHOD(DeviceCapabilities)(THIS_ - _In_ POEMUIOBJ poemuiobj, - _In_ HANDLE hPrinter, - _In_z_ PWSTR pDeviceName, - _In_ WORD wCapability, - _In_ PVOID pOutput, - _In_ PDEVMODE pPublicDM, - _In_ PVOID pOEMDM, - _In_ DWORD dwOld, - _In_ DWORD* dwResult - ); - - STDMETHOD(UpgradePrinter)(THIS_ - _In_ DWORD dwLevel, - _In_ PBYTE pDriverUpgradeInfo - ); - - STDMETHOD(PrinterEvent)(THIS_ - _In_ PWSTR pPrinterName, - _In_ INT iDriverEvent, - _In_ DWORD dwFlags, - _In_ LPARAM lParam - ); - - STDMETHOD(DriverEvent)(THIS_ - _In_ DWORD dwDriverEvent, - _In_ DWORD dwLevel, - _In_reads_(_Inexpressible_("varies")) PBYTE pDriverInfo, - _In_ LPARAM lParam - ); - - STDMETHOD(QueryColorProfile)(THIS_ - _In_ HANDLE hPrinter, - _In_ POEMUIOBJ poemuiobj, - _In_ PDEVMODE pPublicDM, - _In_ PVOID pOEMDM, - _In_ ULONG ulReserved, - _Out_writes_(*pcbProfileData) VOID* pvProfileData, - _Inout_ ULONG* pcbProfileData, - _Out_ FLONG* pflProfileData - ); - - STDMETHOD(FontInstallerDlgProc)(THIS_ - _In_ HWND hWnd, - _In_ UINT usMsg, - _In_ WPARAM wParam, - _In_ LPARAM lParam - ); - - STDMETHOD(UpdateExternalFonts)(THIS_ - _In_ HANDLE hPrinter, - _In_ HANDLE hHeap, - _In_z_ PWSTR pwstrCartridges - ); - -private: - HRESULT - CreatePropertyPages( - VOID - ); - - HRESULT - AddPropPage( - _In_opt_ __drv_aliasesMem CDocPropPage* pPropPage - ); - - inline VOID - DestroyPropPages( - VOID - ); - -private: - POEMCUIPPARAM m_pOemCUIPParam; - - CUIProperties* m_pUIProperties; - - CComPtr<IPrintOemDriverUI> m_pDriverUIHelp; - - DocPropertyPageMap m_vectPropPages; -}; - diff --git a/print/XPSDrvSmpl/src/ui/xdsmplui.vcxproj b/print/XPSDrvSmpl/src/ui/xdsmplui.vcxproj deleted file mode 100644 index 74f727cb..00000000 --- a/print/XPSDrvSmpl/src/ui/xdsmplui.vcxproj +++ /dev/null @@ -1,582 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <ItemGroup Label="ProjectConfigurations"> - <ProjectConfiguration Include="Debug|ARM"> - <Configuration>Debug</Configuration> - <Platform>ARM</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Debug|ARM64"> - <Configuration>Debug</Configuration> - <Platform>ARM64</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Debug|Win32"> - <Configuration>Debug</Configuration> - <Platform>Win32</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release|ARM"> - <Configuration>Release</Configuration> - <Platform>ARM</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release|ARM64"> - <Configuration>Release</Configuration> - <Platform>ARM64</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release|Win32"> - <Configuration>Release</Configuration> - <Platform>Win32</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Debug|x64"> - <Configuration>Debug</Configuration> - <Platform>x64</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release|x64"> - <Configuration>Release</Configuration> - <Platform>x64</Platform> - </ProjectConfiguration> - </ItemGroup> - <PropertyGroup Label="Globals"> - <ProjectGuid>{7441D7F2-F509-4A47-9404-3EB8653AE037}</ProjectGuid> - <RootNamespace>$(MSBuildProjectName)</RootNamespace> - <SupportsPackaging>false</SupportsPackaging> - <RequiresPackageProject>true</RequiresPackageProject> - <Configuration Condition="'$(Configuration)' == ''">Debug</Configuration> - <Platform Condition="'$(Platform)' == ''">Win32</Platform> - <SampleGuid>{84F0AEE3-8A8E-436B-A381-D88F6D804CB0}</SampleGuid> - </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> - <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>False</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>DynamicLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>False</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>DynamicLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>False</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>DynamicLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>True</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>DynamicLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>True</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>DynamicLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>True</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>DynamicLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>False</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>DynamicLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>True</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>DynamicLibrary</ConfigurationType> - </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> - <PropertyGroup> - <OutDir>$(IntDir)</OutDir> - </PropertyGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ItemGroup Label="WrappedTaskItems" /> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <Link> - <EntryPointSymbol Condition="'$(Platform)'=='win32'">_DllMainCRTStartup@12</EntryPointSymbol> - <EntryPointSymbol Condition="'$(Platform)'!='win32'">_DllMainCRTStartup</EntryPointSymbol> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'"> - <Link> - <EntryPointSymbol Condition="'$(Platform)'=='win32'">_DllMainCRTStartup@12</EntryPointSymbol> - <EntryPointSymbol Condition="'$(Platform)'!='win32'">_DllMainCRTStartup</EntryPointSymbol> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> - <Link> - <EntryPointSymbol Condition="'$(Platform)'=='win32'">_DllMainCRTStartup@12</EntryPointSymbol> - <EntryPointSymbol Condition="'$(Platform)'!='win32'">_DllMainCRTStartup</EntryPointSymbol> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <Link> - <EntryPointSymbol Condition="'$(Platform)'=='win32'">_DllMainCRTStartup@12</EntryPointSymbol> - <EntryPointSymbol Condition="'$(Platform)'!='win32'">_DllMainCRTStartup</EntryPointSymbol> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'"> - <Link> - <EntryPointSymbol Condition="'$(Platform)'=='win32'">_DllMainCRTStartup@12</EntryPointSymbol> - <EntryPointSymbol Condition="'$(Platform)'!='win32'">_DllMainCRTStartup</EntryPointSymbol> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> - <Link> - <EntryPointSymbol Condition="'$(Platform)'=='win32'">_DllMainCRTStartup@12</EntryPointSymbol> - <EntryPointSymbol Condition="'$(Platform)'!='win32'">_DllMainCRTStartup</EntryPointSymbol> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <Link> - <EntryPointSymbol Condition="'$(Platform)'=='win32'">_DllMainCRTStartup@12</EntryPointSymbol> - <EntryPointSymbol Condition="'$(Platform)'!='win32'">_DllMainCRTStartup</EntryPointSymbol> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <Link> - <EntryPointSymbol Condition="'$(Platform)'=='win32'">_DllMainCRTStartup@12</EntryPointSymbol> - <EntryPointSymbol Condition="'$(Platform)'!='win32'">_DllMainCRTStartup</EntryPointSymbol> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <ClCompile> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'"> - <ClCompile> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> - <ClCompile> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <ClCompile> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'"> - <ClCompile> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> - <ClCompile> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <ClCompile> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <ClCompile> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary> - <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - </ItemDefinitionGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <TargetName>xdsmplui</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'"> - <TargetName>xdsmplui</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> - <TargetName>xdsmplui</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <TargetName>xdsmplui</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'"> - <TargetName>xdsmplui</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> - <TargetName>xdsmplui</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <TargetName>xdsmplui</TargetName> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <TargetName>xdsmplui</TargetName> - </PropertyGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE</PreprocessorDefinitions> - <PreprocessorDefinitions>%(PreprocessorDefinitions);PLUGIN_PRINTTICKET</PreprocessorDefinitions> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\inc;..\debug;..\common;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE</PreprocessorDefinitions> - <PreprocessorDefinitions>%(PreprocessorDefinitions);PLUGIN_PRINTTICKET</PreprocessorDefinitions> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\inc;..\debug;..\common;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE</PreprocessorDefinitions> - <PreprocessorDefinitions>%(PreprocessorDefinitions);PLUGIN_PRINTTICKET</PreprocessorDefinitions> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\inc;..\debug;..\common;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;msxml6.lib;uuid.lib;Comdlg32.lib;.\..\debug\$(IntDir)\xdsdbg.lib;.\..\common\$(IntDir)\xdsmplcmn.lib</AdditionalDependencies> - <ModuleDefinitionFile>xdsmplui.def</ModuleDefinitionFile> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE</PreprocessorDefinitions> - <PreprocessorDefinitions>%(PreprocessorDefinitions);PLUGIN_PRINTTICKET</PreprocessorDefinitions> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\inc;..\debug;..\common;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE</PreprocessorDefinitions> - <PreprocessorDefinitions>%(PreprocessorDefinitions);PLUGIN_PRINTTICKET</PreprocessorDefinitions> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\inc;..\debug;..\common;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE</PreprocessorDefinitions> - <PreprocessorDefinitions>%(PreprocessorDefinitions);PLUGIN_PRINTTICKET</PreprocessorDefinitions> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\inc;..\debug;..\common;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;msxml6.lib;uuid.lib;Comdlg32.lib;.\..\debug\$(IntDir)\xdsdbg.lib;.\..\common\$(IntDir)\xdsmplcmn.lib</AdditionalDependencies> - <ModuleDefinitionFile>xdsmplui.def</ModuleDefinitionFile> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE</PreprocessorDefinitions> - <PreprocessorDefinitions>%(PreprocessorDefinitions);PLUGIN_PRINTTICKET</PreprocessorDefinitions> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\inc;..\debug;..\common;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE</PreprocessorDefinitions> - <PreprocessorDefinitions>%(PreprocessorDefinitions);PLUGIN_PRINTTICKET</PreprocessorDefinitions> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\inc;..\debug;..\common;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE</PreprocessorDefinitions> - <PreprocessorDefinitions>%(PreprocessorDefinitions);PLUGIN_PRINTTICKET</PreprocessorDefinitions> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\inc;..\debug;..\common;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;msxml6.lib;uuid.lib;Comdlg32.lib;.\..\debug\$(IntDir)\xdsdbg.lib;.\..\common\$(IntDir)\xdsmplcmn.lib</AdditionalDependencies> - <ModuleDefinitionFile>xdsmplui.def</ModuleDefinitionFile> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE</PreprocessorDefinitions> - <PreprocessorDefinitions>%(PreprocessorDefinitions);PLUGIN_PRINTTICKET</PreprocessorDefinitions> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\inc;..\debug;..\common;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE</PreprocessorDefinitions> - <PreprocessorDefinitions>%(PreprocessorDefinitions);PLUGIN_PRINTTICKET</PreprocessorDefinitions> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\inc;..\debug;..\common;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE</PreprocessorDefinitions> - <PreprocessorDefinitions>%(PreprocessorDefinitions);PLUGIN_PRINTTICKET</PreprocessorDefinitions> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\inc;..\debug;..\common;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;msxml6.lib;uuid.lib;Comdlg32.lib;.\..\debug\$(IntDir)\xdsdbg.lib;.\..\common\$(IntDir)\xdsmplcmn.lib</AdditionalDependencies> - <ModuleDefinitionFile>xdsmplui.def</ModuleDefinitionFile> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE</PreprocessorDefinitions> - <PreprocessorDefinitions>%(PreprocessorDefinitions);PLUGIN_PRINTTICKET</PreprocessorDefinitions> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\inc;..\debug;..\common;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE</PreprocessorDefinitions> - <PreprocessorDefinitions>%(PreprocessorDefinitions);PLUGIN_PRINTTICKET</PreprocessorDefinitions> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\inc;..\debug;..\common;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE</PreprocessorDefinitions> - <PreprocessorDefinitions>%(PreprocessorDefinitions);PLUGIN_PRINTTICKET</PreprocessorDefinitions> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\inc;..\debug;..\common;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;msxml6.lib;uuid.lib;Comdlg32.lib;.\..\debug\$(IntDir)\xdsdbg.lib;.\..\common\$(IntDir)\xdsmplcmn.lib</AdditionalDependencies> - <ModuleDefinitionFile>xdsmplui.def</ModuleDefinitionFile> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE</PreprocessorDefinitions> - <PreprocessorDefinitions>%(PreprocessorDefinitions);PLUGIN_PRINTTICKET</PreprocessorDefinitions> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\inc;..\debug;..\common;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE</PreprocessorDefinitions> - <PreprocessorDefinitions>%(PreprocessorDefinitions);PLUGIN_PRINTTICKET</PreprocessorDefinitions> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\inc;..\debug;..\common;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE</PreprocessorDefinitions> - <PreprocessorDefinitions>%(PreprocessorDefinitions);PLUGIN_PRINTTICKET</PreprocessorDefinitions> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\inc;..\debug;..\common;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;msxml6.lib;uuid.lib;Comdlg32.lib;.\..\debug\$(IntDir)\xdsdbg.lib;.\..\common\$(IntDir)\xdsmplcmn.lib</AdditionalDependencies> - <ModuleDefinitionFile>xdsmplui.def</ModuleDefinitionFile> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE</PreprocessorDefinitions> - <PreprocessorDefinitions>%(PreprocessorDefinitions);PLUGIN_PRINTTICKET</PreprocessorDefinitions> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\inc;..\debug;..\common;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE</PreprocessorDefinitions> - <PreprocessorDefinitions>%(PreprocessorDefinitions);PLUGIN_PRINTTICKET</PreprocessorDefinitions> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\inc;..\debug;..\common;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE</PreprocessorDefinitions> - <PreprocessorDefinitions>%(PreprocessorDefinitions);PLUGIN_PRINTTICKET</PreprocessorDefinitions> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\inc;..\debug;..\common;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;msxml6.lib;uuid.lib;Comdlg32.lib;.\..\debug\$(IntDir)\xdsdbg.lib;.\..\common\$(IntDir)\xdsmplcmn.lib</AdditionalDependencies> - <ModuleDefinitionFile>xdsmplui.def</ModuleDefinitionFile> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE</PreprocessorDefinitions> - <PreprocessorDefinitions>%(PreprocessorDefinitions);PLUGIN_PRINTTICKET</PreprocessorDefinitions> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\inc;..\debug;..\common;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE</PreprocessorDefinitions> - <PreprocessorDefinitions>%(PreprocessorDefinitions);PLUGIN_PRINTTICKET</PreprocessorDefinitions> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\inc;..\debug;..\common;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE</PreprocessorDefinitions> - <PreprocessorDefinitions>%(PreprocessorDefinitions);PLUGIN_PRINTTICKET</PreprocessorDefinitions> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\inc;..\debug;..\common;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus</AdditionalIncludeDirectories> - </ResourceCompile> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;msxml6.lib;uuid.lib;Comdlg32.lib;.\..\debug\$(IntDir)\xdsdbg.lib;.\..\common\$(IntDir)\xdsmplcmn.lib</AdditionalDependencies> - <ModuleDefinitionFile>xdsmplui.def</ModuleDefinitionFile> - </Link> - </ItemDefinitionGroup> - <ItemGroup> - <ClCompile Include="bkdmptcnv.cpp"> - <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="colctrls.cpp"> - <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="coldmptcnv.cpp"> - <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="colppg.cpp"> - <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="dllentry.cpp"> - <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="docppg.cpp"> - <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="ftrctrls.cpp"> - <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="ftrppg.cpp"> - <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="nupptcnv.cpp"> - <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="pgscdmptcnv.cpp"> - <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="precompsrc.cpp"> - <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Create</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="uictrl.cpp"> - <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="uiproperties.cpp"> - <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="wmctrls.cpp"> - <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="wmdmptcnv.cpp"> - <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="wmppg.cpp"> - <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="xdsmplcf.cpp"> - <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="xdsmplptprov.cpp"> - <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="xdsmplui.cpp"> - <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ResourceCompile Include="xdsmpldlg.rc" /> - </ItemGroup> - <ItemGroup> - <Inf Exclude="@(Inf)" Include="*.inf" /> - <FilesToPackage Include="$(TargetPath)" Condition="'$(ConfigurationType)'=='Driver' or '$(ConfigurationType)'=='DynamicLibrary'" /> - </ItemGroup> - <ItemGroup> - <None Exclude="@(None)" Include="*.txt;*.htm;*.html" /> - <None Exclude="@(None)" Include="*.ico;*.cur;*.bmp;*.dlg;*.rct;*.gif;*.jpg;*.jpeg;*.wav;*.jpe;*.tiff;*.tif;*.png;*.rc2" /> - <None Exclude="@(None)" Include="*.def;*.bat;*.hpj;*.asmx" /> - </ItemGroup> - <ItemGroup> - <ClInclude Exclude="@(ClInclude)" Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd" /> - </ItemGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> -</Project>
\ No newline at end of file diff --git a/print/XPSDrvSmpl/src/ui/xdsmplui.vcxproj.Filters b/print/XPSDrvSmpl/src/ui/xdsmplui.vcxproj.Filters deleted file mode 100644 index cf11c7f8..00000000 --- a/print/XPSDrvSmpl/src/ui/xdsmplui.vcxproj.Filters +++ /dev/null @@ -1,611 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <ItemGroup> - <Filter Include="Source Files"> - <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;*</Extensions> - <UniqueIdentifier>{2AD80BD3-541F-43F0-BAF3-C9D1407DB40F}</UniqueIdentifier> - </Filter> - <Filter Include="Header Files"> - <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions> - <UniqueIdentifier>{1C5775CA-818E-4201-BF0E-79C149173495}</UniqueIdentifier> - </Filter> - <Filter Include="Resource Files"> - <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms;man;xml</Extensions> - <UniqueIdentifier>{4155F8D0-42D6-4420-B759-01020F4BFE90}</UniqueIdentifier> - </Filter> - </ItemGroup> - <ItemGroup> - <ClCompile Include="bkdmptcnv.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="colctrls.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="coldmptcnv.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="colppg.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="dllentry.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="docppg.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="ftrctrls.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="ftrppg.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="nupptcnv.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="pgscdmptcnv.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="precompsrc.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="uictrl.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="uiproperties.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="wmctrls.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="wmdmptcnv.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="wmppg.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="xdsmplcf.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="xdsmplptprov.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="xdsmplui.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - </ItemGroup> - <ItemGroup> - <ResourceCompile Include="xdsmpldlg.rc"> - <Filter>Resource Files</Filter> - </ResourceCompile> - </ItemGroup> - <ItemGroup> - <ClInclude Include="bkdmptcnv.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="colctrls.h" /> - <ClInclude Include="coldmptcnv.h" /> - <ClInclude Include="colppg.h" /> - <ClInclude Include="devmode.h" /> - <ClInclude Include="docppg.h" /> - <ClInclude Include="ftrctrls.h" /> - <ClInclude Include="ftrdmptcnv.h" /> - <ClInclude Include="ftrppg.h" /> - <ClInclude Include="nupptcnv.h" /> - <ClInclude Include="pgscdmptcnv.h" /> - <ClInclude Include="precomp.h" /> - <ClInclude Include="resource.h" /> - <ClInclude Include="uictrl.h" /> - <ClInclude Include="uiproperties.h" /> - <ClInclude Include="wmctrls.h" /> - <ClInclude Include="wmdmptcnv.h" /> - <ClInclude Include="wmppg.h" /> - <ClInclude Include="xdsmplcf.h" /> - <ClInclude Include="xdsmplptprov.h" /> - <ClInclude Include="xdsmplui.h" /> - <ClInclude Include="bkdmptcnv.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="colctrls.h" /> - <ClInclude Include="coldmptcnv.h" /> - <ClInclude Include="colppg.h" /> - <ClInclude Include="devmode.h" /> - <ClInclude Include="docppg.h" /> - <ClInclude Include="ftrctrls.h" /> - <ClInclude Include="ftrdmptcnv.h" /> - <ClInclude Include="ftrppg.h" /> - <ClInclude Include="nupptcnv.h" /> - <ClInclude Include="pgscdmptcnv.h" /> - <ClInclude Include="precomp.h" /> - <ClInclude Include="resource.h" /> - <ClInclude Include="uictrl.h" /> - <ClInclude Include="uiproperties.h" /> - <ClInclude Include="wmctrls.h" /> - <ClInclude Include="wmdmptcnv.h" /> - <ClInclude Include="wmppg.h" /> - <ClInclude Include="xdsmplcf.h" /> - <ClInclude Include="xdsmplptprov.h" /> - <ClInclude Include="xdsmplui.h" /> - <ClInclude Include="bkdmptcnv.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="colctrls.h" /> - <ClInclude Include="coldmptcnv.h" /> - <ClInclude Include="colppg.h" /> - <ClInclude Include="devmode.h" /> - <ClInclude Include="docppg.h" /> - <ClInclude Include="ftrctrls.h" /> - <ClInclude Include="ftrdmptcnv.h" /> - <ClInclude Include="ftrppg.h" /> - <ClInclude Include="nupptcnv.h" /> - <ClInclude Include="pgscdmptcnv.h" /> - <ClInclude Include="precomp.h" /> - <ClInclude Include="resource.h" /> - <ClInclude Include="uictrl.h" /> - <ClInclude Include="uiproperties.h" /> - <ClInclude Include="wmctrls.h" /> - <ClInclude Include="wmdmptcnv.h" /> - <ClInclude Include="wmppg.h" /> - <ClInclude Include="xdsmplcf.h" /> - <ClInclude Include="xdsmplptprov.h" /> - <ClInclude Include="xdsmplui.h" /> - <ClInclude Include="bkdmptcnv.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="colctrls.h" /> - <ClInclude Include="coldmptcnv.h" /> - <ClInclude Include="colppg.h" /> - <ClInclude Include="devmode.h" /> - <ClInclude Include="docppg.h" /> - <ClInclude Include="ftrctrls.h" /> - <ClInclude Include="ftrdmptcnv.h" /> - <ClInclude Include="ftrppg.h" /> - <ClInclude Include="nupptcnv.h" /> - <ClInclude Include="pgscdmptcnv.h" /> - <ClInclude Include="precomp.h" /> - <ClInclude Include="resource.h" /> - <ClInclude Include="uictrl.h" /> - <ClInclude Include="uiproperties.h" /> - <ClInclude Include="wmctrls.h" /> - <ClInclude Include="wmdmptcnv.h" /> - <ClInclude Include="wmppg.h" /> - <ClInclude Include="xdsmplcf.h" /> - <ClInclude Include="xdsmplptprov.h" /> - <ClInclude Include="xdsmplui.h" /> - <ClInclude Include="bkdmptcnv.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="colctrls.h" /> - <ClInclude Include="coldmptcnv.h" /> - <ClInclude Include="colppg.h" /> - <ClInclude Include="devmode.h" /> - <ClInclude Include="docppg.h" /> - <ClInclude Include="ftrctrls.h" /> - <ClInclude Include="ftrdmptcnv.h" /> - <ClInclude Include="ftrppg.h" /> - <ClInclude Include="nupptcnv.h" /> - <ClInclude Include="pgscdmptcnv.h" /> - <ClInclude Include="precomp.h" /> - <ClInclude Include="resource.h" /> - <ClInclude Include="uictrl.h" /> - <ClInclude Include="uiproperties.h" /> - <ClInclude Include="wmctrls.h" /> - <ClInclude Include="wmdmptcnv.h" /> - <ClInclude Include="wmppg.h" /> - <ClInclude Include="xdsmplcf.h" /> - <ClInclude Include="xdsmplptprov.h" /> - <ClInclude Include="xdsmplui.h" /> - <ClInclude Include="bkdmptcnv.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="colctrls.h" /> - <ClInclude Include="coldmptcnv.h" /> - <ClInclude Include="colppg.h" /> - <ClInclude Include="devmode.h" /> - <ClInclude Include="docppg.h" /> - <ClInclude Include="ftrctrls.h" /> - <ClInclude Include="ftrdmptcnv.h" /> - <ClInclude Include="ftrppg.h" /> - <ClInclude Include="nupptcnv.h" /> - <ClInclude Include="pgscdmptcnv.h" /> - <ClInclude Include="precomp.h" /> - <ClInclude Include="resource.h" /> - <ClInclude Include="uictrl.h" /> - <ClInclude Include="uiproperties.h" /> - <ClInclude Include="wmctrls.h" /> - <ClInclude Include="wmdmptcnv.h" /> - <ClInclude Include="wmppg.h" /> - <ClInclude Include="xdsmplcf.h" /> - <ClInclude Include="xdsmplptprov.h" /> - <ClInclude Include="xdsmplui.h" /> - <ClInclude Include="bkdmptcnv.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="colctrls.h" /> - <ClInclude Include="coldmptcnv.h" /> - <ClInclude Include="colppg.h" /> - <ClInclude Include="devmode.h" /> - <ClInclude Include="docppg.h" /> - <ClInclude Include="ftrctrls.h" /> - <ClInclude Include="ftrdmptcnv.h" /> - <ClInclude Include="ftrppg.h" /> - <ClInclude Include="nupptcnv.h" /> - <ClInclude Include="pgscdmptcnv.h" /> - <ClInclude Include="precomp.h" /> - <ClInclude Include="resource.h" /> - <ClInclude Include="uictrl.h" /> - <ClInclude Include="uiproperties.h" /> - <ClInclude Include="wmctrls.h" /> - <ClInclude Include="wmdmptcnv.h" /> - <ClInclude Include="wmppg.h" /> - <ClInclude Include="xdsmplcf.h" /> - <ClInclude Include="xdsmplptprov.h" /> - <ClInclude Include="xdsmplui.h" /> - <ClInclude Include="bkdmptcnv.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="colctrls.h" /> - <ClInclude Include="coldmptcnv.h" /> - <ClInclude Include="colppg.h" /> - <ClInclude Include="devmode.h" /> - <ClInclude Include="docppg.h" /> - <ClInclude Include="ftrctrls.h" /> - <ClInclude Include="ftrdmptcnv.h" /> - <ClInclude Include="ftrppg.h" /> - <ClInclude Include="nupptcnv.h" /> - <ClInclude Include="pgscdmptcnv.h" /> - <ClInclude Include="precomp.h" /> - <ClInclude Include="resource.h" /> - <ClInclude Include="uictrl.h" /> - <ClInclude Include="uiproperties.h" /> - <ClInclude Include="wmctrls.h" /> - <ClInclude Include="wmdmptcnv.h" /> - <ClInclude Include="wmppg.h" /> - <ClInclude Include="xdsmplcf.h" /> - <ClInclude Include="xdsmplptprov.h" /> - <ClInclude Include="xdsmplui.h" /> - <ClInclude Include="bkdmptcnv.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="colctrls.h" /> - <ClInclude Include="coldmptcnv.h" /> - <ClInclude Include="colppg.h" /> - <ClInclude Include="devmode.h" /> - <ClInclude Include="docppg.h" /> - <ClInclude Include="ftrctrls.h" /> - <ClInclude Include="ftrdmptcnv.h" /> - <ClInclude Include="ftrppg.h" /> - <ClInclude Include="nupptcnv.h" /> - <ClInclude Include="pgscdmptcnv.h" /> - <ClInclude Include="precomp.h" /> - <ClInclude Include="resource.h" /> - <ClInclude Include="uictrl.h" /> - <ClInclude Include="uiproperties.h" /> - <ClInclude Include="wmctrls.h" /> - <ClInclude Include="wmdmptcnv.h" /> - <ClInclude Include="wmppg.h" /> - <ClInclude Include="xdsmplcf.h" /> - <ClInclude Include="xdsmplptprov.h" /> - <ClInclude Include="xdsmplui.h" /> - <ClInclude Include="bkdmptcnv.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="colctrls.h" /> - <ClInclude Include="coldmptcnv.h" /> - <ClInclude Include="colppg.h" /> - <ClInclude Include="devmode.h" /> - <ClInclude Include="docppg.h" /> - <ClInclude Include="ftrctrls.h" /> - <ClInclude Include="ftrdmptcnv.h" /> - <ClInclude Include="ftrppg.h" /> - <ClInclude Include="nupptcnv.h" /> - <ClInclude Include="pgscdmptcnv.h" /> - <ClInclude Include="precomp.h" /> - <ClInclude Include="resource.h" /> - <ClInclude Include="uictrl.h" /> - <ClInclude Include="uiproperties.h" /> - <ClInclude Include="wmctrls.h" /> - <ClInclude Include="wmdmptcnv.h" /> - <ClInclude Include="wmppg.h" /> - <ClInclude Include="xdsmplcf.h" /> - <ClInclude Include="xdsmplptprov.h" /> - <ClInclude Include="xdsmplui.h" /> - <ClInclude Include="bkdmptcnv.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="colctrls.h" /> - <ClInclude Include="coldmptcnv.h" /> - <ClInclude Include="colppg.h" /> - <ClInclude Include="devmode.h" /> - <ClInclude Include="docppg.h" /> - <ClInclude Include="ftrctrls.h" /> - <ClInclude Include="ftrdmptcnv.h" /> - <ClInclude Include="ftrppg.h" /> - <ClInclude Include="nupptcnv.h" /> - <ClInclude Include="pgscdmptcnv.h" /> - <ClInclude Include="precomp.h" /> - <ClInclude Include="resource.h" /> - <ClInclude Include="uictrl.h" /> - <ClInclude Include="uiproperties.h" /> - <ClInclude Include="wmctrls.h" /> - <ClInclude Include="wmdmptcnv.h" /> - <ClInclude Include="wmppg.h" /> - <ClInclude Include="xdsmplcf.h" /> - <ClInclude Include="xdsmplptprov.h" /> - <ClInclude Include="xdsmplui.h" /> - <ClInclude Include="bkdmptcnv.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="colctrls.h" /> - <ClInclude Include="coldmptcnv.h" /> - <ClInclude Include="colppg.h" /> - <ClInclude Include="devmode.h" /> - <ClInclude Include="docppg.h" /> - <ClInclude Include="ftrctrls.h" /> - <ClInclude Include="ftrdmptcnv.h" /> - <ClInclude Include="ftrppg.h" /> - <ClInclude Include="nupptcnv.h" /> - <ClInclude Include="pgscdmptcnv.h" /> - <ClInclude Include="precomp.h" /> - <ClInclude Include="resource.h" /> - <ClInclude Include="uictrl.h" /> - <ClInclude Include="uiproperties.h" /> - <ClInclude Include="wmctrls.h" /> - <ClInclude Include="wmdmptcnv.h" /> - <ClInclude Include="wmppg.h" /> - <ClInclude Include="xdsmplcf.h" /> - <ClInclude Include="xdsmplptprov.h" /> - <ClInclude Include="xdsmplui.h" /> - <ClInclude Include="bkdmptcnv.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="colctrls.h" /> - <ClInclude Include="coldmptcnv.h" /> - <ClInclude Include="colppg.h" /> - <ClInclude Include="devmode.h" /> - <ClInclude Include="docppg.h" /> - <ClInclude Include="ftrctrls.h" /> - <ClInclude Include="ftrdmptcnv.h" /> - <ClInclude Include="ftrppg.h" /> - <ClInclude Include="nupptcnv.h" /> - <ClInclude Include="pgscdmptcnv.h" /> - <ClInclude Include="precomp.h" /> - <ClInclude Include="resource.h" /> - <ClInclude Include="uictrl.h" /> - <ClInclude Include="uiproperties.h" /> - <ClInclude Include="wmctrls.h" /> - <ClInclude Include="wmdmptcnv.h" /> - <ClInclude Include="wmppg.h" /> - <ClInclude Include="xdsmplcf.h" /> - <ClInclude Include="xdsmplptprov.h" /> - <ClInclude Include="xdsmplui.h" /> - <ClInclude Include="bkdmptcnv.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="colctrls.h" /> - <ClInclude Include="coldmptcnv.h" /> - <ClInclude Include="colppg.h" /> - <ClInclude Include="devmode.h" /> - <ClInclude Include="docppg.h" /> - <ClInclude Include="ftrctrls.h" /> - <ClInclude Include="ftrdmptcnv.h" /> - <ClInclude Include="ftrppg.h" /> - <ClInclude Include="nupptcnv.h" /> - <ClInclude Include="pgscdmptcnv.h" /> - <ClInclude Include="precomp.h" /> - <ClInclude Include="resource.h" /> - <ClInclude Include="uictrl.h" /> - <ClInclude Include="uiproperties.h" /> - <ClInclude Include="wmctrls.h" /> - <ClInclude Include="wmdmptcnv.h" /> - <ClInclude Include="wmppg.h" /> - <ClInclude Include="xdsmplcf.h" /> - <ClInclude Include="xdsmplptprov.h" /> - <ClInclude Include="xdsmplui.h" /> - <ClInclude Include="bkdmptcnv.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="colctrls.h" /> - <ClInclude Include="coldmptcnv.h" /> - <ClInclude Include="colppg.h" /> - <ClInclude Include="devmode.h" /> - <ClInclude Include="docppg.h" /> - <ClInclude Include="ftrctrls.h" /> - <ClInclude Include="ftrdmptcnv.h" /> - <ClInclude Include="ftrppg.h" /> - <ClInclude Include="nupptcnv.h" /> - <ClInclude Include="pgscdmptcnv.h" /> - <ClInclude Include="precomp.h" /> - <ClInclude Include="resource.h" /> - <ClInclude Include="uictrl.h" /> - <ClInclude Include="uiproperties.h" /> - <ClInclude Include="wmctrls.h" /> - <ClInclude Include="wmdmptcnv.h" /> - <ClInclude Include="wmppg.h" /> - <ClInclude Include="xdsmplcf.h" /> - <ClInclude Include="xdsmplptprov.h" /> - <ClInclude Include="xdsmplui.h" /> - <ClInclude Include="bkdmptcnv.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="colctrls.h" /> - <ClInclude Include="coldmptcnv.h" /> - <ClInclude Include="colppg.h" /> - <ClInclude Include="devmode.h" /> - <ClInclude Include="docppg.h" /> - <ClInclude Include="ftrctrls.h" /> - <ClInclude Include="ftrdmptcnv.h" /> - <ClInclude Include="ftrppg.h" /> - <ClInclude Include="nupptcnv.h" /> - <ClInclude Include="pgscdmptcnv.h" /> - <ClInclude Include="precomp.h" /> - <ClInclude Include="resource.h" /> - <ClInclude Include="uictrl.h" /> - <ClInclude Include="uiproperties.h" /> - <ClInclude Include="wmctrls.h" /> - <ClInclude Include="wmdmptcnv.h" /> - <ClInclude Include="wmppg.h" /> - <ClInclude Include="xdsmplcf.h" /> - <ClInclude Include="xdsmplptprov.h" /> - <ClInclude Include="xdsmplui.h" /> - <ClInclude Include="bkdmptcnv.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="colctrls.h" /> - <ClInclude Include="coldmptcnv.h" /> - <ClInclude Include="colppg.h" /> - <ClInclude Include="devmode.h" /> - <ClInclude Include="docppg.h" /> - <ClInclude Include="ftrctrls.h" /> - <ClInclude Include="ftrdmptcnv.h" /> - <ClInclude Include="ftrppg.h" /> - <ClInclude Include="nupptcnv.h" /> - <ClInclude Include="pgscdmptcnv.h" /> - <ClInclude Include="precomp.h" /> - <ClInclude Include="resource.h" /> - <ClInclude Include="uictrl.h" /> - <ClInclude Include="uiproperties.h" /> - <ClInclude Include="wmctrls.h" /> - <ClInclude Include="wmdmptcnv.h" /> - <ClInclude Include="wmppg.h" /> - <ClInclude Include="xdsmplcf.h" /> - <ClInclude Include="xdsmplptprov.h" /> - <ClInclude Include="xdsmplui.h" /> - <ClInclude Include="bkdmptcnv.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="colctrls.h" /> - <ClInclude Include="coldmptcnv.h" /> - <ClInclude Include="colppg.h" /> - <ClInclude Include="devmode.h" /> - <ClInclude Include="docppg.h" /> - <ClInclude Include="ftrctrls.h" /> - <ClInclude Include="ftrdmptcnv.h" /> - <ClInclude Include="ftrppg.h" /> - <ClInclude Include="nupptcnv.h" /> - <ClInclude Include="pgscdmptcnv.h" /> - <ClInclude Include="precomp.h" /> - <ClInclude Include="resource.h" /> - <ClInclude Include="uictrl.h" /> - <ClInclude Include="uiproperties.h" /> - <ClInclude Include="wmctrls.h" /> - <ClInclude Include="wmdmptcnv.h" /> - <ClInclude Include="wmppg.h" /> - <ClInclude Include="xdsmplcf.h" /> - <ClInclude Include="xdsmplptprov.h" /> - <ClInclude Include="xdsmplui.h" /> - <ClInclude Include="bkdmptcnv.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="colctrls.h" /> - <ClInclude Include="coldmptcnv.h" /> - <ClInclude Include="colppg.h" /> - <ClInclude Include="devmode.h" /> - <ClInclude Include="docppg.h" /> - <ClInclude Include="ftrctrls.h" /> - <ClInclude Include="ftrdmptcnv.h" /> - <ClInclude Include="ftrppg.h" /> - <ClInclude Include="nupptcnv.h" /> - <ClInclude Include="pgscdmptcnv.h" /> - <ClInclude Include="precomp.h" /> - <ClInclude Include="resource.h" /> - <ClInclude Include="uictrl.h" /> - <ClInclude Include="uiproperties.h" /> - <ClInclude Include="wmctrls.h" /> - <ClInclude Include="wmdmptcnv.h" /> - <ClInclude Include="wmppg.h" /> - <ClInclude Include="xdsmplcf.h" /> - <ClInclude Include="xdsmplptprov.h" /> - <ClInclude Include="xdsmplui.h" /> - <ClInclude Include="bkdmptcnv.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="colctrls.h" /> - <ClInclude Include="coldmptcnv.h" /> - <ClInclude Include="colppg.h" /> - <ClInclude Include="devmode.h" /> - <ClInclude Include="docppg.h" /> - <ClInclude Include="ftrctrls.h" /> - <ClInclude Include="ftrdmptcnv.h" /> - <ClInclude Include="ftrppg.h" /> - <ClInclude Include="nupptcnv.h" /> - <ClInclude Include="pgscdmptcnv.h" /> - <ClInclude Include="precomp.h" /> - <ClInclude Include="resource.h" /> - <ClInclude Include="uictrl.h" /> - <ClInclude Include="uiproperties.h" /> - <ClInclude Include="wmctrls.h" /> - <ClInclude Include="wmdmptcnv.h" /> - <ClInclude Include="wmppg.h" /> - <ClInclude Include="xdsmplcf.h" /> - <ClInclude Include="xdsmplptprov.h" /> - <ClInclude Include="xdsmplui.h" /> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd"> - <Filter>Header Files</Filter> - </ClInclude> - </ItemGroup> - <ItemGroup> - <None Include="*.def;*.bat;*.hpj;*.asmx"> - <Filter>Source Files</Filter> - </None> - </ItemGroup> -</Project>
\ No newline at end of file |
