📄 renderpages.h
字号:
/* * * renderpages.h * Copyright (C) 2006 Michael H. Overlin This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Contact at poster_printer@yahoo.com */#ifndef RENDERPAGES_H#define RENDERPAGES_H#include "types.h"#include <windows.h>struct RenderSpec { enum SizeMode { eZoom, eMosaic }; // WHEN SIZE IS BASED ON MOSAIC, ALL AVAILABLE SPACE IN ONE DIMENSION IS USED // REFERRED TO AS "FULL DIMENSION", ENUM BELOW enum MosaicFullDimension { eX, eY }; SizeMode mode; //WORD wZoom; // IF MODE IS NOT eZoom THIS IS NOT USED, ZOOM CALCULATED FROM MOSAIC SIZE // HOWEVER CURRENTLY THIS VALUE IS KEPT ACCURATE, AS IS szMosaic, NO MATTER THE MODE double dZoom; // 5/29 ADD bCenter (WOULD ASSUME THAT THE SPOOLER METAFILE IS RELATIVE TO TOP LEFT - SO CENTER IS FALSE // WHEN DISPLAYING THE ORIGINAL - CHECK THIS THRU TESTING) BOOL bCenter; // DEBUG / FIX SHOULD HAVE SETTING FOR WHETHER ABSOLUTE, OR AUTOMATIC CUT GUIDES // CURRENTLY THIS SHOULD BE AUTO IGNORED WHEN PAGESPEC PRINTALBE SPACE IS ENTIRE PAGE BOOL bCutGuides; //BOOL bBW; SIZE szMosaic; // 5/30 MOVE MARGINS TO THE PAGE SPEC, EDGE MARGIN VALUES DEPEND ON PAGE SPEC VALUES // AND WHEN THE PAGE SPEC IS ROTATED, ALSO HAVE TO BE ROTATED. IF OTHER MARGINS ARE MADE MORE // SPECIFIC, WOULD ALSO PROBABLY WANT TO ROTATE THEM //double dOverlapMargin_Inches; //double dCutGuideMargin_Inches; //RECTD rdEdgeMargins_Inches;};struct MarginSpec { // 5/30 MOVED FROM RenderSpec - ROTATE EDGE MARGIN WITH THE PAGE double dOverlapMargin_Inches; double dCutGuideMargin_Inches; RECTD rdEdgeMargins_Inches;};struct PageSpec { // IN PIXELS SIZEL szlPhysicalPage; POINT ptlOffsetPrintable; SIZEL szlPrintable; SIZED szdPhysicalPage_Inches; // 6/11 LandscapeRot::LandscapeRot rotDir; BOOL bLandscape; //// 6/3 //// HAS X/Y BEEN FLIPPED RELATIVE TO SOME REFERENCE (SUCH AS PRINTER'S PAGE SPECS) //BOOL bReflected; // 6/4 MOVE TO STRUCT ::MarginSpec ms;};struct SourceSpec { // IN INCHES RECTD rdTotalImage_Inches; RECTD rdSelection_Inches;};void RenderMosaicPage( OUT HDC hdc, IN const RECT& rlDest, IN const POINT& ptPage, IN const RenderSpec& rs, IN const PageSpec& ps, IN HENHMETAFILE hMeta, IN const SourceSpec &ss ) ;void CalculateMosaicSizeFromZoom( OUT SIZE& szMosaic, IN double dZoom, IN const RenderSpec& rs, IN const PageSpec& ps, IN const SourceSpec &ss ) ;void CalculateMosaicSizeFromZoomWithRotation( OUT SIZE& szMosaic, OUT BOOL& bRotated, IN double dZoom, IN const RenderSpec& rs, IN const PageSpec& ps, IN const SourceSpec &ss ) ;void CalculatePageLogPix(OUT POINTD& ptdLogPix, IN const PageSpec& ps) ;void CalculateReneredImageBoundsRelPrintable( OUT RECTD& rdRenderedImageBounds_Inches, IN const POINT& ptPage, IN const ::RenderSpec& rs, IN const ::PageSpec& ps, IN const ::SourceSpec& ss );double CalculateZoomFromMosaicSize( IN const SIZE& szMosaic, IN const RenderSpec& rs, IN const PageSpec& ps, IN const SourceSpec &ss, OUT RenderSpec::MosaicFullDimension& fulldim ) ;BOOL GetPageSpec( OUT ::PageSpec &ps, IN const ::MarginSpec& ms, IN ::PCDEVMODE pdm, LPCTSTR lptstrPrinterName, IN BOOL bEvenMargins, IN BOOL bAllowNonStandardMargins ) ;void EnforceMinimumMargins(IN OUT ::PageSpec &ps, IN BOOL bEvenMargins) ;double FindNextLargerMosaicSize(IN OUT SIZE& szMosaic, IN double dZoomCurrent, IN const ::RenderSpec rs, IN const ::PageSpec& ps, IN const ::SourceSpec& ss) ;double FindNextLargerMosaicSizeWithRotation(IN OUT SIZE& szMosaic, OUT BOOL& bRotate, IN double dZoomCurrent, IN const ::RenderSpec rs, IN const ::PageSpec& ps, IN const ::SourceSpec& ss) ;double FindNextSmallerMosaicSize(IN OUT SIZE& szMosaic, IN const ::RenderSpec& rs, IN const ::PageSpec& ps, IN const ::SourceSpec& ss) ;double FindNextSmallerMosaicSizeWithRotation(IN OUT SIZE& szMosaic, OUT BOOL& bRotate, IN double dZoomCurrent, IN const ::RenderSpec rs, IN const ::PageSpec& ps, IN const ::SourceSpec& ss) ;void GetMinimumPageMargins(OUT RECTD& rdMargins_Inches, IN const PageSpec& ps) ;BOOL IsPageSpecValid(IN const ::PageSpec& ps, IN double dMinPrintable_Inches, IN BOOL bAllowNonStandardMargins) ;void MakeZoomSettingsConsistent(IN OUT ::RenderSpec& rs, IN const ::PageSpec& ps, IN const ::SourceSpec& ss, IN BOOL bAllowRotation, OUT BOOL& bRotated) ;void LandscapeRotatePageSpec(OUT PageSpec& psDest, IN const PageSpec& psSrc) ;inline void LandscapeRotatePageSpec(IN OUT PageSpec& ps) { LandscapeRotatePageSpec(ps, ps); }//void ReflectPageSpec(OUT PageSpec &psDest, IN const PageSpec& psSrc) ;//inline void ReflectPageSpec(IN OUT PageSpec &ps) { ::ReflectPageSpec(ps, ps); }#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -