diff options
Diffstat (limited to 'vcl/source')
49 files changed, 62 insertions, 3689 deletions
diff --git a/vcl/source/filter/FilterConfigCache.cxx b/vcl/source/filter/FilterConfigCache.cxx index ca579e22fe1f..bcab60c7ce08 100644 --- a/vcl/source/filter/FilterConfigCache.cxx +++ b/vcl/source/filter/FilterConfigCache.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "FilterConfigCache.hxx" +#include "filter/FilterConfigCache.hxx" #include <vcl/graphicfilter.hxx> #include <com/sun/star/uno/Any.h> diff --git a/vcl/source/filter/FilterConfigCache.hxx b/vcl/source/filter/FilterConfigCache.hxx deleted file mode 100644 index 8c52991e4636..000000000000 --- a/vcl/source/filter/FilterConfigCache.hxx +++ /dev/null @@ -1,124 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_VCL_SOURCE_FILTER_FILTERCONFIGCACHE_HXX -#define INCLUDED_VCL_SOURCE_FILTER_FILTERCONFIGCACHE_HXX - -#include <com/sun/star/uno/Sequence.h> -#include <com/sun/star/uno/Reference.h> -#include <com/sun/star/beans/PropertyValue.hpp> -#include <com/sun/star/container/XNameAccess.hpp> -#include <rtl/ustring.hxx> -#include <vector> - -/** Cache to keep list of graphic filters + the filters themselves. */ -class FilterConfigCache -{ - struct FilterConfigCacheEntry - { - OUString sInternalFilterName; - OUString sType; - css::uno::Sequence< OUString > lExtensionList; - OUString sUIName; - OUString sExternalFilterName; - - OUString sMediaType; - OUString sFilterType; - - sal_Int32 nFlags; - - // user data - OUString sFilterName; - bool bIsInternalFilter : 1; - bool bIsPixelFormat : 1; - - bool CreateFilterName( const OUString& rUserDataEntry ); - OUString GetShortName( ); - - static const char* InternalPixelFilterNameList[]; - static const char* InternalVectorFilterNameList[]; - static const char* ExternalPixelFilterNameList[]; - }; - - typedef std::vector< FilterConfigCacheEntry > CacheVector; - - CacheVector aImport; - CacheVector aExport; - bool bUseConfig; - - static bool bInitialized; - static sal_Int32 nIndType; - static sal_Int32 nIndUIName; - static sal_Int32 nIndDocumentService; - static sal_Int32 nIndFilterService; - static sal_Int32 nIndFlags; - static sal_Int32 nIndUserData; - static sal_Int32 nIndFileFormatVersion; - static sal_Int32 nIndTemplateName; - - static const char* InternalFilterListForSvxLight[]; - - void ImplInit(); - void ImplInitSmart(); - -public: - - sal_uInt16 GetImportFormatCount() const - { return sal::static_int_cast< sal_uInt16 >(aImport.size()); }; - sal_uInt16 GetImportFormatNumber( const OUString& rFormatName ); - sal_uInt16 GetImportFormatNumberForShortName( const OUString& rShortName ); - sal_uInt16 GetImportFormatNumberForTypeName( const OUString& rType ); - sal_uInt16 GetImportFormatNumberForExtension( const OUString& rExt ); - OUString GetImportFilterName( sal_uInt16 nFormat ); - OUString GetImportFormatName( sal_uInt16 nFormat ); - OUString GetImportFormatExtension( sal_uInt16 nFormat, sal_Int32 nEntry = 0); - OUString GetImportFormatMediaType( sal_uInt16 nFormat ); - OUString GetImportFormatShortName( sal_uInt16 nFormat ); - OUString GetImportWildcard( sal_uInt16 nFormat, sal_Int32 nEntry ); - OUString GetImportFilterType( sal_uInt16 nFormat ); - OUString GetImportFilterTypeName( sal_uInt16 nFormat ); - OUString GetExternalFilterName(sal_uInt16 nFormat, bool bExport); - - - bool IsImportInternalFilter( sal_uInt16 nFormat ); - - sal_uInt16 GetExportFormatCount() const - { return sal::static_int_cast< sal_uInt16 >(aExport.size()); }; - sal_uInt16 GetExportFormatNumber( const OUString& rFormatName ); - sal_uInt16 GetExportFormatNumberForMediaType( const OUString& rMediaType ); - sal_uInt16 GetExportFormatNumberForShortName( const OUString& rShortName ); - sal_uInt16 GetExportFormatNumberForTypeName( const OUString& rType ); - OUString GetExportFilterName( sal_uInt16 nFormat ); - OUString GetExportFormatName( sal_uInt16 nFormat ); - OUString GetExportFormatExtension( sal_uInt16 nFormat, sal_Int32 nEntry = 0 ); - OUString GetExportFormatMediaType( sal_uInt16 nFormat ); - OUString GetExportFormatShortName( sal_uInt16 nFormat ); - OUString GetExportWildcard( sal_uInt16 nFormat, sal_Int32 nEntry ); - OUString GetExportInternalFilterName( sal_uInt16 nFormat ); - - bool IsExportInternalFilter( sal_uInt16 nFormat ); - bool IsExportPixelFormat( sal_uInt16 nFormat ); - - explicit FilterConfigCache( bool bUseConfig ); - ~FilterConfigCache(); -}; - -#endif // INCLUDED_VCL_SOURCE_FILTER_FILTERCONFIGCACHE_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/filter/GraphicNativeMetadata.cxx b/vcl/source/filter/GraphicNativeMetadata.cxx index 532e2d4284ab..43359ab100fc 100644 --- a/vcl/source/filter/GraphicNativeMetadata.cxx +++ b/vcl/source/filter/GraphicNativeMetadata.cxx @@ -21,7 +21,7 @@ #include <vcl/gfxlink.hxx> -#include "jpeg/Exif.hxx" +#include "filter/Exif.hxx" #include <memory> GraphicNativeMetadata::GraphicNativeMetadata() : diff --git a/vcl/source/filter/GraphicNativeTransform.cxx b/vcl/source/filter/GraphicNativeTransform.cxx index 11a17a5f091f..b0dd5b1cdb02 100644 --- a/vcl/source/filter/GraphicNativeTransform.cxx +++ b/vcl/source/filter/GraphicNativeTransform.cxx @@ -24,8 +24,8 @@ #include <com/sun/star/uno/Sequence.hxx> #include <com/sun/star/beans/XPropertySet.hpp> -#include "jpeg/Exif.hxx" -#include "jpeg/JpegTransform.hxx" +#include "filter/Exif.hxx" +#include "filter/JpegTransform.hxx" GraphicNativeTransform::GraphicNativeTransform(Graphic& rGraphic) : mrGraphic(rGraphic) diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx index 7b3d34c554a5..f62bbacc5e59 100644 --- a/vcl/source/filter/graphicfilter.cxx +++ b/vcl/source/filter/graphicfilter.cxx @@ -40,12 +40,11 @@ #include <vcl/FilterConfigItem.hxx> #include <vcl/wmf.hxx> #include <vcl/settings.hxx> -#include "igif/gifread.hxx" -#include "jpeg/jpeg.hxx" -#include "ixbm/xbmread.hxx" -#include "ixpm/xpmread.hxx" -#include "sgffilt.hxx" -#include "osl/module.hxx" +#include <unotools/ucbstreamhelper.hxx> +#include <rtl/bootstrap.hxx> +#include <rtl/instance.hxx> +#include <vcl/metaact.hxx> + #include <com/sun/star/uno/Reference.h> #include <com/sun/star/awt/Size.hpp> #include <com/sun/star/uno/XInterface.hpp> @@ -59,15 +58,19 @@ #include <com/sun/star/xml/sax/XDocumentHandler.hpp> #include <com/sun/star/xml/sax/Writer.hpp> #include <com/sun/star/ucb/CommandAbortedException.hpp> -#include <unotools/ucbstreamhelper.hxx> -#include <rtl/bootstrap.hxx> -#include <rtl/instance.hxx> -#include <vcl/metaact.hxx> + #include <vector> #include <memory> -#include "FilterConfigCache.hxx" -#include "graphicfilter_internal.hxx" +#include "filter/gifread.hxx" +#include "filter/jpeg.hxx" +#include "filter/xbmread.hxx" +#include "filter/xpmread.hxx" +#include "filter/sgffilt.hxx" +#include "osl/module.hxx" + +#include "filter/FilterConfigCache.hxx" +#include "filter/graphicfilter_internal.hxx" #define PMGCHUNG_msOG 0x6d734f47 // Microsoft Office Animated GIF diff --git a/vcl/source/filter/graphicfilter2.cxx b/vcl/source/filter/graphicfilter2.cxx index 822452bd450e..05c78a55c902 100644 --- a/vcl/source/filter/graphicfilter2.cxx +++ b/vcl/source/filter/graphicfilter2.cxx @@ -23,7 +23,7 @@ #include <vcl/outdev.hxx> #include <vcl/graphicfilter.hxx> #include <unotools/ucbstreamhelper.hxx> -#include "graphicfilter_internal.hxx" +#include "filter/graphicfilter_internal.hxx" #define DATA_SIZE 640 diff --git a/vcl/source/filter/graphicfilter_internal.hxx b/vcl/source/filter/graphicfilter_internal.hxx deleted file mode 100644 index 8f3931ec2994..000000000000 --- a/vcl/source/filter/graphicfilter_internal.hxx +++ /dev/null @@ -1,31 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_VCL_SOURCE_FILTER_GRAPHICFILTER_INTERNAL_HXX -#define INCLUDED_VCL_SOURCE_FILTER_GRAPHICFILTER_INTERNAL_HXX - -#include "tools/solar.h" - -sal_uInt8* ImplSearchEntry( sal_uInt8*, sal_uInt8 const *, sal_uLong, sal_uLong ); - -extern bool isPCT(SvStream& rStream, sal_uLong nStreamPos, sal_uLong nStreamLen); - -#endif // INCLUDED_VCL_SOURCE_FILTER_GRAPHICFILTER_INTERNAL_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/filter/igif/decode.cxx b/vcl/source/filter/igif/decode.cxx index b0454d2cb270..42a3aeb9c8a6 100644 --- a/vcl/source/filter/igif/decode.cxx +++ b/vcl/source/filter/igif/decode.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "decode.hxx" +#include "filter/decode.hxx" struct GIFLZWTableEntry { diff --git a/vcl/source/filter/igif/decode.hxx b/vcl/source/filter/igif/decode.hxx deleted file mode 100644 index 93840f1ade1b..000000000000 --- a/vcl/source/filter/igif/decode.hxx +++ /dev/null @@ -1,59 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_VCL_SOURCE_FILTER_IGIF_DECODE_HXX -#define INCLUDED_VCL_SOURCE_FILTER_IGIF_DECODE_HXX - -#include <vcl/bmpacc.hxx> - -struct GIFLZWTableEntry; - -class GIFLZWDecompressor -{ - GIFLZWTableEntry* pTable; - sal_uInt8* pOutBuf; - sal_uInt8* pOutBufData; - sal_uInt8* pBlockBuf; - sal_uLong nInputBitsBuf; - sal_uInt16 nTableSize; - sal_uInt16 nClearCode; - sal_uInt16 nEOICode; - sal_uInt16 nCodeSize; - sal_uInt16 nOldCode; - sal_uInt16 nOutBufDataLen; - sal_uInt16 nInputBitsBufSize; - bool bEOIFound; - sal_uInt8 nDataSize; - sal_uInt8 nBlockBufSize; - sal_uInt8 nBlockBufPos; - - bool AddToTable(sal_uInt16 nPrevCode, sal_uInt16 nCodeFirstData); - bool ProcessOneCode(); - -public: - - explicit GIFLZWDecompressor( sal_uInt8 cDataSize ); - ~GIFLZWDecompressor(); - - sal_uInt8* DecompressBlock( sal_uInt8* pSrc, sal_uInt8 cBufSize, sal_uLong& rCount, bool& rEOI ); -}; - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/filter/igif/gifread.cxx b/vcl/source/filter/igif/gifread.cxx index cb0e0ee79201..26fd5fcc304b 100644 --- a/vcl/source/filter/igif/gifread.cxx +++ b/vcl/source/filter/igif/gifread.cxx @@ -19,8 +19,8 @@ #define _GIFPRIVATE -#include "decode.hxx" -#include "gifread.hxx" +#include "filter/decode.hxx" +#include "filter/gifread.hxx" #include <memory> #define NO_PENDING( rStm ) ( ( rStm ).GetError() != ERRCODE_IO_PENDING ) diff --git a/vcl/source/filter/igif/gifread.hxx b/vcl/source/filter/igif/gifread.hxx deleted file mode 100644 index b6489a0c9360..000000000000 --- a/vcl/source/filter/igif/gifread.hxx +++ /dev/null @@ -1,119 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_VCL_SOURCE_FILTER_IGIF_GIFREAD_HXX -#define INCLUDED_VCL_SOURCE_FILTER_IGIF_GIFREAD_HXX - -#include <vcl/graph.hxx> -#include <vcl/bmpacc.hxx> - -#ifdef _GIFPRIVATE - -enum GIFAction -{ - GLOBAL_HEADER_READING, - MARKER_READING, - EXTENSION_READING, - LOCAL_HEADER_READING, - FIRST_BLOCK_READING, - NEXT_BLOCK_READING, - ABORT_READING, - END_READING -}; - -enum ReadState -{ - GIFREAD_OK, - GIFREAD_ERROR, - GIFREAD_NEED_MORE -}; - -class GIFLZWDecompressor; - -class SvStream; - -class GIFReader : public GraphicReader -{ - Graphic aImGraphic; - Animation aAnimation; - Bitmap aBmp8; - Bitmap aBmp1; - BitmapPalette aGPalette; - BitmapPalette aLPalette; - SvStream& rIStm; - sal_uInt8* pSrcBuf; - GIFLZWDecompressor* pDecomp; - BitmapWriteAccess* pAcc8; - BitmapWriteAccess* pAcc1; - long nYAcc; - long nLastPos; - sal_uInt32 nLogWidth100; - sal_uInt32 nLogHeight100; - sal_uInt16 nTimer; - sal_uInt16 nGlobalWidth; // maximum imagewidth from header - sal_uInt16 nGlobalHeight; // maximum imageheight from header - sal_uInt16 nImageWidth; // maximum screenwidth from header - sal_uInt16 nImageHeight; // maximum screenheight from header - sal_uInt16 nImagePosX; - sal_uInt16 nImagePosY; - sal_uInt16 nImageX; // maximum screenwidth from header - sal_uInt16 nImageY; // maximum screenheight from header - sal_uInt16 nLastImageY; - sal_uInt16 nLastInterCount; - sal_uInt16 nLoops; - GIFAction eActAction; - bool bStatus; - bool bGCTransparent; // is the image transparent, if yes: - bool bInterlaced; - bool bOverreadBlock; - bool bImGraphicReady; - bool bGlobalPalette; - sal_uInt8 nBackgroundColor; // backgroundcolour - sal_uInt8 nGCTransparentIndex; // pixels of this index are transparant - sal_uInt8 nGCDisposalMethod; // 'Disposal Method' (see GIF docs) - sal_uInt8 cTransIndex1; - sal_uInt8 cNonTransIndex1; - - void ReadPaletteEntries( BitmapPalette* pPal, sal_uLong nCount ); - void ClearImageExtensions(); - bool CreateBitmaps( long nWidth, long nHeight, BitmapPalette* pPal, bool bWatchForBackgroundColor ); - bool ReadGlobalHeader(); - bool ReadExtension(); - bool ReadLocalHeader(); - sal_uLong ReadNextBlock(); - void FillImages( sal_uInt8* pBytes, sal_uLong nCount ); - void CreateNewBitmaps(); - bool ProcessGIF(); - -public: - - ReadState ReadGIF( Graphic& rGraphic ); - const Graphic& GetIntermediateGraphic(); - - explicit GIFReader( SvStream& rStm ); - virtual ~GIFReader(); -}; - -#endif // _GIFPRIVATE - -VCL_DLLPUBLIC bool ImportGIF( SvStream& rStream, Graphic& rGraphic ); - -#endif // INCLUDED_VCL_SOURCE_FILTER_IGIF_GIFREAD_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/filter/ixbm/xbmread.cxx b/vcl/source/filter/ixbm/xbmread.cxx index b12aea3b973c..d6539a18543c 100644 --- a/vcl/source/filter/ixbm/xbmread.cxx +++ b/vcl/source/filter/ixbm/xbmread.cxx @@ -20,7 +20,7 @@ #define _XBMPRIVATE #include <ctype.h> #include <comphelper/string.hxx> -#include "xbmread.hxx" +#include "filter/xbmread.hxx" XBMReader::XBMReader( SvStream& rStm ) : rIStm ( rStm ), diff --git a/vcl/source/filter/ixbm/xbmread.hxx b/vcl/source/filter/ixbm/xbmread.hxx deleted file mode 100644 index 3794a374ca4b..000000000000 --- a/vcl/source/filter/ixbm/xbmread.hxx +++ /dev/null @@ -1,74 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_VCL_SOURCE_FILTER_IXBM_XBMREAD_HXX -#define INCLUDED_VCL_SOURCE_FILTER_IXBM_XBMREAD_HXX - -#include <vcl/graph.hxx> -#include <vcl/bmpacc.hxx> - -#ifdef _XBMPRIVATE - -enum XBMFormat -{ - XBM10, - XBM11 -}; - -enum ReadState -{ - XBMREAD_OK, - XBMREAD_ERROR, - XBMREAD_NEED_MORE -}; - -class XBMReader : public GraphicReader -{ - SvStream& rIStm; - Bitmap aBmp1; - BitmapWriteAccess* pAcc1; - short* pHexTable; - BitmapColor aWhite; - BitmapColor aBlack; - long nLastPos; - long nWidth; - long nHeight; - bool bStatus; - - void InitTable(); - OString FindTokenLine( SvStream* pInStm, const char* pTok1, - const char* pTok2 = nullptr, const char* pTok3 = nullptr ); - long ParseDefine( const sal_Char* pDefine ); - bool ParseData( SvStream* pInStm, const OString& aLastLine, XBMFormat eFormat ); - -public: - - explicit XBMReader( SvStream& rStm ); - virtual ~XBMReader(); - - ReadState ReadXBM( Graphic& rGraphic ); -}; - -#endif // _XBMPRIVATE - -VCL_DLLPUBLIC bool ImportXBM( SvStream& rStream, Graphic& rGraphic ); - -#endif // INCLUDED_VCL_SOURCE_FILTER_IXBM_XBMREAD_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/filter/ixpm/rgbtable.hxx b/vcl/source/filter/ixpm/rgbtable.hxx deleted file mode 100644 index 7dcc340938d8..000000000000 --- a/vcl/source/filter/ixpm/rgbtable.hxx +++ /dev/null @@ -1,694 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_VCL_SOURCE_FILTER_IXPM_RGBTABLE_HXX -#define INCLUDED_VCL_SOURCE_FILTER_IXPM_RGBTABLE_HXX - -struct XPMRGBTab -{ - const char* name; - sal_uInt8 red; - sal_uInt8 green; - sal_uInt8 blue; -}; - -static const XPMRGBTab pRGBTable[] = { -{ "white", 255, 255, 255 }, -{ "black", 0, 0, 0 }, -{ "snow", 255, 250, 250 }, -{ "GhostWhite", 248, 248, 255 }, -{ "WhiteSmoke", 245, 245, 245 }, -{ "gainsboro", 220, 220, 220 }, -{ "FloralWhite", 255, 250, 240 }, -{ "OldLace", 253, 245, 230 }, -{ "linen", 250, 240, 230 }, -{ "AntiqueWhite", 250, 235, 215 }, -{ "PapayaWhip", 255, 239, 213 }, -{ "BlanchedAlmond", 255, 235, 205 }, -{ "bisque", 255, 228, 196 }, -{ "PeachPuff", 255, 218, 185 }, -{ "NavajoWhite", 255, 222, 173 }, -{ "moccasin", 255, 228, 181 }, -{ "cornsilk", 255, 248, 220 }, -{ "ivory", 255, 255, 240 }, -{ "LemonChiffon", 255, 250, 205 }, -{ "seashell", 255, 245, 238 }, -{ "honeydew", 240, 255, 240 }, -{ "MintCream", 245, 255, 250 }, -{ "azure", 240, 255, 255 }, -{ "AliceBlue", 240, 248, 255 }, -{ "lavender", 230, 230, 250 }, -{ "LavenderBlush", 255, 240, 245 }, -{ "MistyRose", 255, 228, 225 }, -{ "DarkSlateGray", 47, 79, 79 }, -{ "DarkSlateGrey", 47, 79, 79 }, -{ "DimGray", 105, 105, 105 }, -{ "DimGrey", 105, 105, 105 }, -{ "SlateGray", 112, 128, 144 }, -{ "SlateGrey", 112, 128, 144 }, -{ "LightSlateGray", 119, 136, 153 }, -{ "LightSlateGrey", 119, 136, 153 }, -{ "gray", 190, 190, 190 }, -{ "grey", 190, 190, 190 }, -{ "LightGrey", 211, 211, 211 }, -{ "LightGray", 211, 211, 211 }, -{ "MidnightBlue", 25, 25, 112 }, -{ "navy", 0, 0, 128 }, -{ "NavyBlue", 0, 0, 128 }, -{ "CornflowerBlue", 100, 149, 237 }, -{ "DarkSlateBlue", 72, 61, 139 }, -{ "SlateBlue", 106, 90, 205 }, -{ "MediumSlateBlue", 123, 104, 238 }, -{ "LightSlateBlue", 132, 112, 255 }, -{ "MediumBlue", 0, 0, 205 }, -{ "RoyalBlue", 65, 105, 225 }, -{ "blue", 0, 0, 255 }, -{ "DodgerBlue", 30, 144, 255 }, -{ "DeepSkyBlue", 0, 191, 255 }, -{ "SkyBlue", 135, 206, 235 }, -{ "LightSkyBlue", 135, 206, 250 }, -{ "SteelBlue", 70, 130, 180 }, -{ "LightSteelBlue", 176, 196, 222 }, -{ "LightBlue", 173, 216, 230 }, -{ "PowderBlue", 176, 224, 230 }, -{ "PaleTurquoise", 175, 238, 238 }, -{ "DarkTurquoise", 0, 206, 209 }, -{ "MediumTurquoise", 72, 209, 204 }, -{ "turquoise", 64, 224, 208 }, -{ "cyan", 0, 255, 255 }, -{ "LightCyan", 224, 255, 255 }, -{ "CadetBlue", 95, 158, 160 }, -{ "MediumAquamarine", 102, 205, 170 }, -{ "aquamarine", 127, 255, 212 }, -{ "DarkGreen", 0, 100, 0 }, -{ "DarkOliveGreen", 85, 107, 47 }, -{ "DarkSeaGreen", 143, 188, 143 }, -{ "SeaGreen", 46, 139, 87 }, -{ "MediumSeaGreen", 60, 179, 113 }, -{ "LightSeaGreen", 32, 178, 170 }, -{ "PaleGreen", 152, 251, 152 }, -{ "SpringGreen", 0, 255, 127 }, -{ "LawnGreen", 124, 252, 0 }, -{ "green", 0, 255, 0 }, -{ "chartreuse", 127, 255, 0 }, -{ "MediumSpringGreen", 0, 250, 154 }, -{ "GreenYellow", 173, 255 , 47 }, -{ "LimeGreen", 50, 205, 50 }, -{ "YellowGreen", 154, 205, 50 }, -{ "ForestGreen", 34, 139, 34 }, -{ "OliveDrab", 107, 142, 35 }, -{ "DarkKhaki", 189, 183, 107 }, -{ "khaki", 240, 230, 140 }, -{ "PaleGoldenrod", 238, 232, 170 }, -{ "LightGoldenrodYellow", 250, 250, 210 }, -{ "LightYellow", 255, 255, 224 }, -{ "yellow", 255, 255, 0 }, -{ "gold", 255, 215, 0 }, -{ "LightGoldenrod", 238, 221, 130 }, -{ "goldenrod", 218, 165, 32 }, -{ "DarkGoldenrod", 184, 134, 11 }, -{ "RosyBrown", 188, 143, 143 }, -{ "IndianRed", 205, 92, 92 }, -{ "SaddleBrown", 139, 69, 19 }, -{ "sienna", 160, 82, 45 }, -{ "peru", 205, 133, 63 }, -{ "burlywood", 222, 184, 135 }, -{ "beige", 245, 245, 220 }, -{ "wheat", 245, 222, 179 }, -{ "SandyBrown", 244, 164, 96 }, -{ "tan", 210, 180, 140 }, -{ "chocolate", 210, 105, 30 }, -{ "firebrick", 178, 34, 34 }, -{ "brown", 165, 42, 42 }, -{ "DarkSalmon", 233, 150, 122 }, -{ "salmon", 250, 128, 114 }, -{ "LightSalmon", 255, 160, 122 }, -{ "orange", 255, 165, 0 }, -{ "DarkOrange", 255, 140, 0 }, -{ "coral", 255, 127, 80 }, -{ "LightCoral", 240, 128, 128 }, -{ "tomato", 255, 99, 71 }, -{ "OrangeRed", 255, 69, 0 }, -{ "red", 255, 0, 0 }, -{ "HotPink", 255, 105, 180 }, -{ "DeepPink", 255, 20, 147 }, -{ "pink", 255, 192, 203 }, -{ "LightPink", 255, 182, 193 }, -{ "PaleVioletRed", 219, 112, 147 }, -{ "maroon", 176, 48, 96 }, -{ "MediumVioletRed", 199, 21, 133 }, -{ "VioletRed", 208, 32, 144 }, -{ "magenta", 255, 0, 255 }, -{ "violet", 238, 130, 238 }, -{ "plum", 221, 160, 221 }, -{ "orchid", 218, 112, 214 }, -{ "MediumOrchid", 186, 85, 211 }, -{ "DarkOrchid", 153, 50, 204 }, -{ "DarkViolet", 148, 0, 211 }, -{ "BlueViolet", 138, 43, 226 }, -{ "purple", 160, 32, 240 }, -{ "MediumPurple", 147, 112, 219 }, -{ "thistle", 216, 191, 216 }, -{ "snow1", 255, 250, 250 }, -{ "snow2", 238, 233, 233 }, -{ "snow3", 205, 201, 201 }, -{ "snow4", 139, 137, 137 }, -{ "seashell1", 255, 245, 238 }, -{ "seashell2", 238, 229, 222 }, -{ "seashell3", 205, 197, 191 }, -{ "seashell4", 139, 134, 130 }, -{ "AntiqueWhite1", 255, 239, 219 }, -{ "AntiqueWhite2", 238, 223, 204 }, -{ "AntiqueWhite3", 205, 192, 176 }, -{ "AntiqueWhite4", 139, 131, 120 }, -{ "bisque1", 255, 228, 196 }, -{ "bisque2", 238, 213, 183 }, -{ "bisque3", 205, 183, 158 }, -{ "bisque4", 139, 125, 107 }, -{ "PeachPuff1", 255, 218, 185 }, -{ "PeachPuff2", 238, 203, 173 }, -{ "PeachPuff3", 205, 175, 149 }, -{ "PeachPuff4", 139, 119, 101 }, -{ "NavajoWhite1", 255, 222, 173 }, -{ "NavajoWhite2", 238, 207, 161 }, -{ "NavajoWhite3", 205, 179, 139 }, -{ "NavajoWhite4", 139, 121, 94 }, -{ "LemonChiffon1", 255, 250, 205 }, -{ "LemonChiffon2", 238, 233, 191 }, -{ "LemonChiffon3", 205, 201, 165 }, -{ "LemonChiffon4", 139, 137, 112 }, -{ "cornsilk1", 255, 248, 220 }, -{ "cornsilk2", 238, 232, 205 }, -{ "cornsilk3", 205, 200, 177 }, -{ "cornsilk4", 139, 136, 120 }, -{ "ivory1", 255, 255, 240 }, -{ "ivory2", 238, 238, 224 }, -{ "ivory3", 205, 205, 193 }, -{ "ivory4", 139, 139, 131 }, -{ "honeydew1", 240, 255, 240 }, -{ "honeydew2", 224, 238, 224 }, -{ "honeydew3", 193, 205, 193 }, -{ "honeydew4", 131, 139, 131 }, -{ "LavenderBlush1", 255, 240, 245 }, -{ "LavenderBlush2", 238, 224, 229 }, -{ "LavenderBlush3", 205, 193, 197 }, -{ "LavenderBlush4", 139, 131, 134 }, -{ "MistyRose1", 255, 228, 225 }, -{ "MistyRose2", 238, 213, 210 }, -{ "MistyRose3", 205, 183, 181 }, -{ "MistyRose4", 139, 125, 123 }, -{ "azure1", 240, 255, 255 }, -{ "azure2", 224, 238, 238 }, -{ "azure3", 193, 205, 205 }, -{ "azure4", 131, 139, 139 }, -{ "SlateBlue1", 131, 111, 255 }, -{ "SlateBlue2", 122, 103, 238 }, -{ "SlateBlue3", 105, 89, 205 }, -{ "SlateBlue4", 71, 60, 139 }, -{ "RoyalBlue1", 72, 118, 255 }, -{ "RoyalBlue2", 67, 110, 238 }, -{ "RoyalBlue3", 58, 95, 205 }, -{ "RoyalBlue4", 39, 64, 139 }, -{ "blue1", 0, 0, 255 }, -{ "blue2", 0, 0, 238 }, -{ "blue3", 0, 0, 205 }, -{ "blue4", 0, 0, 139 }, -{ "DodgerBlue1", 30, 144, 255 }, -{ "DodgerBlue2", 28, 134, 238 }, -{ "DodgerBlue3", 24, 116, 205 }, -{ "DodgerBlue4", 16, 78, 139 }, -{ "SteelBlue1", 99, 184, 255 }, -{ "SteelBlue2", 92, 172, 238 }, -{ "SteelBlue3", 79, 148, 205 }, -{ "SteelBlue4", 54, 100, 139 }, -{ "DeepSkyBlue1", 0, 191, 255 }, -{ "DeepSkyBlue2", 0, 178, 238 }, -{ "DeepSkyBlue3", 0, 154, 205 }, -{ "DeepSkyBlue4", 0, 104, 139 }, -{ "SkyBlue1", 135, 206, 255 }, -{ "SkyBlue2", 126, 192, 238 }, -{ "SkyBlue3", 108, 166, 205 }, -{ "SkyBlue4", 74, 112, 139 }, -{ "LightSkyBlue1", 176, 226, 255 }, -{ "LightSkyBlue2", 164, 211, 238 }, -{ "LightSkyBlue3", 141, 182, 205 }, -{ "LightSkyBlue4", 96, 123, 139 }, -{ "SlateGray1", 198, 226, 255 }, -{ "SlateGray2", 185, 211, 238 }, -{ "SlateGray3", 159, 182, 205 }, -{ "SlateGray4", 108, 123, 139 }, -{ "LightSteelBlue1", 202, 225, 255 }, -{ "LightSteelBlue2", 188, 210, 238 }, -{ "LightSteelBlue3", 162, 181, 205 }, -{ "LightSteelBlue4", 110, 123, 139 }, -{ "LightBlue1", 191, 239, 255 }, -{ "LightBlue2", 178, 223, 238 }, -{ "LightBlue3", 154, 192, 205 }, -{ "LightBlue4", 104, 131, 139 }, -{ "LightCyan1", 224, 255, 255 }, -{ "LightCyan2", 209, 238, 238 }, -{ "LightCyan3", 180, 205, 205 }, -{ "LightCyan4", 122, 139, 139 }, -{ "PaleTurquoise1", 187, 255, 255 }, -{ "PaleTurquoise2", 174, 238, 238 }, -{ "PaleTurquoise3", 150, 205, 205 }, -{ "PaleTurquoise4", 102, 139, 139 }, -{ "CadetBlue1", 152, 245, 255 }, -{ "CadetBlue2", 142, 229, 238 }, -{ "CadetBlue3", 122, 197, 205 }, -{ "CadetBlue4", 83, 134, 139 }, -{ "turquoise1", 0, 245, 255 }, -{ "turquoise2", 0, 229, 238 }, -{ "turquoise3", 0, 197, 205 }, -{ "turquoise4", 0, 134, 139 }, -{ "cyan1", 0, 255, 255 }, -{ "cyan2", 0, 238, 238 }, -{ "cyan3", 0, 205, 205 }, -{ "cyan4", 0, 139, 139 }, -{ "DarkSlateGray1", 151, 255, 255 }, -{ "DarkSlateGray2", 141, 238, 238 }, -{ "DarkSlateGray3", 121, 205, 205 }, -{ "DarkSlateGray4", 82, 139, 139 }, -{ "aquamarine1", 127, 255, 212 }, -{ "aquamarine2", 118, 238, 198 }, -{ "aquamarine3", 102, 205, 170 }, -{ "aquamarine4", 69, 139, 116 }, -{ "DarkSeaGreen1", 193, 255, 193 }, -{ "DarkSeaGreen2", 180, 238, 180 }, -{ "DarkSeaGreen3", 155, 205, 155 }, -{ "DarkSeaGreen4", 105, 139, 105 }, -{ "SeaGreen1", 84, 255, 159 }, -{ "SeaGreen2", 78, 238, 148 }, -{ "SeaGreen3", 67, 205, 128 }, -{ "SeaGreen4", 46, 139, 87 }, -{ "PaleGreen1", 154, 255, 154 }, -{ "PaleGreen2", 144, 238, 144 }, -{ "PaleGreen3", 124, 205, 124 }, -{ "PaleGreen4", 84, 139, 84 }, -{ "SpringGreen1", 0, 255, 127 }, -{ "SpringGreen2", 0, 238, 118 }, -{ "SpringGreen3", 0, 205, 102 }, -{ "SpringGreen4", 0, 139, 69 }, -{ "green1", 0, 255, 0 }, -{ "green2", 0, 238, 0 }, -{ "green3", 0, 205, 0 }, -{ "green4", 0, 139, 0 }, -{ "chartreuse1", 127, 255, 0 }, -{ "chartreuse2", 118, 238, 0 }, -{ "chartreuse3", 102, 205, 0 }, -{ "chartreuse4", 69, 139, 0 }, -{ "OliveDrab1", 192, 255, 62 }, -{ "OliveDrab2", 179, 238, 58 }, -{ "OliveDrab3", 154, 205, 50 }, -{ "OliveDrab4", 105, 139, 34 }, -{ "DarkOliveGreen1", 202, 255, 112 }, -{ "DarkOliveGreen2", 188, 238, 104 }, -{ "DarkOliveGreen3", 162, 205, 90 }, -{ "DarkOliveGreen4", 110, 139, 61 }, -{ "khaki1", 255, 246, 143 }, -{ "khaki2", 238, 230, 133 }, -{ "khaki3", 205, 198, 115 }, -{ "khaki4", 139, 134, 78 }, -{ "LightGoldenrod1", 255, 236, 139 }, -{ "LightGoldenrod2", 238, 220, 130 }, -{ "LightGoldenrod3", 205, 190, 112 }, -{ "LightGoldenrod4", 139, 129, 76 }, -{ "LightYellow1", 255, 255, 224 }, -{ "LightYellow2", 238, 238, 209 }, -{ "LightYellow3", 205, 205, 180 }, -{ "LightYellow4", 139, 139, 122 }, -{ "yellow1", 255, 255, 0 }, -{ "yellow2", 238, 238, 0 }, -{ "yellow3", 205, 205, 0 }, -{ "yellow4", 139, 139, 0 }, -{ "gold1", 255, 215, 0 }, -{ "gold2", 238, 201, 0 }, -{ "gold3", 205, 173, 0 }, -{ "gold4", 139, 117, 0 }, -{ "goldenrod1", 255, 193, 37 }, -{ "goldenrod2", 238, 180, 34 }, -{ "goldenrod3", 205, 155, 29 }, -{ "goldenrod4", 139, 105, 20 }, -{ "DarkGoldenrod1", 255, 185, 15 }, -{ "DarkGoldenrod2", 238, 173, 14 }, -{ "DarkGoldenrod3", 205, 149, 12 }, -{ "DarkGoldenrod4", 139, 101, 8 }, -{ "RosyBrown1", 255, 193, 193 }, -{ "RosyBrown2", 238, 180, 180 }, -{ "RosyBrown3", 205, 155, 155 }, -{ "RosyBrown4", 139, 105, 105 }, -{ "IndianRed1", 255, 106, 106 }, -{ "IndianRed2", 238, 99, 99 }, -{ "IndianRed3", 205, 85, 85 }, -{ "IndianRed4", 139, 58, 58 }, -{ "sienna1", 255, 130, 71 }, -{ "sienna2", 238, 121, 66 }, -{ "sienna3", 205, 104, 57 }, -{ "sienna4", 139, 71, 38 }, -{ "burlywood1", 255, 211, 155 }, -{ "burlywood2", 238, 197, 145 }, -{ "burlywood3", 205, 170, 125 }, -{ "burlywood4", 139, 115, 85 }, -{ "wheat1", 255, 231, 186 }, -{ "wheat2", 238, 216, 174 }, -{ "wheat3", 205, 186, 150 }, -{ "wheat4", 139, 126, 102 }, -{ "tan1", 255, 165, 79 }, -{ "tan2", 238, 154, 73 }, -{ "tan3", 205, 133, 63 }, -{ "tan4", 139 , 90, 43 }, -{ "chocolate1", 255, 127, 36 }, -{ "chocolate2", 238, 118, 33 }, -{ "chocolate3", 205, 102, 29 }, -{ "chocolate4", 139, 69, 19 }, -{ "firebrick1", 255, 48, 48 }, -{ "firebrick2", 238, 44, 44 }, -{ "firebrick3", 205, 38, 38 }, -{ "firebrick4", 139, 26, 26 }, -{ "brown1", 255, 64, 64 }, -{ "brown2", 238, 59, 59 }, -{ "brown3", 205, 51, 51 }, -{ "brown4", 139, 35, 35 }, -{ "salmon1", 255, 140, 105 }, -{ "salmon2", 238, 130, 98 }, -{ "salmon3", 205, 112, 84 }, -{ "salmon4", 139, 76, 57 }, -{ "LightSalmon1", 255, 160, 122 }, -{ "LightSalmon2", 238, 149, 114 }, -{ "LightSalmon3", 205, 129, 98 }, -{ "LightSalmon4", 139, 87, 66 }, -{ "orange1", 255, 165, 0 }, -{ "orange2", 238, 154, 0 }, -{ "orange3", 205, 133, 0 }, -{ "orange4", 139 , 90, 0 }, -{ "DarkOrange1", 255, 127, 0 }, -{ "DarkOrange2", 238, 118, 0 }, -{ "DarkOrange3", 205, 102, 0 }, -{ "DarkOrange4", 139 , 69, 0 }, -{ "coral1", 255, 114, 86 }, -{ "coral2", 238, 106, 80 }, -{ "coral3", 205, 91, 69 }, -{ "coral4", 139, 62, 47 }, -{ "tomato1", 255, 99, 71 }, -{ "tomato2", 238, 92, 66 }, -{ "tomato3", 205, 79, 57 }, -{ "tomato4", 139, 54, 38 }, -{ "OrangeRed1", 255, 69, 0 }, -{ "OrangeRed2", 238, 64, 0 }, -{ "OrangeRed3", 205, 55, 0 }, -{ "OrangeRed4", 139, 37, 0 }, -{ "red1", 255, 0, 0 }, -{ "red2", 238, 0, 0 }, -{ "red3", 205, 0, 0 }, -{ "red4", 139, 0, 0 }, -{ "DeepPink1", 255, 20, 147 }, -{ "DeepPink2", 238, 18, 137 }, -{ "DeepPink3", 205, 16, 118 }, -{ "DeepPink4", 139, 10, 80 }, -{ "HotPink1", 255, 110, 180 }, -{ "HotPink2", 238, 106, 167 }, -{ "HotPink3", 205, 96, 144 }, -{ "HotPink4", 139, 58, 98 }, -{ "pink1", 255, 181, 197 }, -{ "pink2", 238, 169, 184 }, -{ "pink3", 205, 145, 158 }, -{ "pink4", 139, 99, 108 }, -{ "LightPink1", 255, 174, 185 }, -{ "LightPink2", 238, 162, 173 }, -{ "LightPink3", 205, 140, 149 }, -{ "LightPink4", 139, 95, 101 }, -{ "PaleVioletRed1", 255, 130, 171 }, -{ "PaleVioletRed2", 238, 121, 159 }, -{ "PaleVioletRed3", 205, 104, 137 }, -{ "PaleVioletRed4", 139, 71, 93 }, -{ "maroon1", 255, 52, 179 }, -{ "maroon2", 238, 48, 167 }, -{ "maroon3", 205, 41, 144 }, -{ "maroon4", 139, 28, 98 }, -{ "VioletRed1", 255, 62, 150 }, -{ "VioletRed2", 238, 58, 140 }, -{ "VioletRed3", 205, 50, 120 }, -{ "VioletRed4", 139, 34, 82 }, -{ "magenta1", 255, 0, 255 }, -{ "magenta2", 238, 0, 238 }, -{ "magenta3", 205, 0, 205 }, -{ "magenta4", 139, 0, 139 }, -{ "orchid1", 255, 131, 250 }, -{ "orchid2", 238, 122, 233 }, -{ "orchid3", 205, 105, 201 }, -{ "orchid4", 139, 71, 137 }, -{ "plum1", 255, 187, 255 }, -{ "plum2", 238, 174, 238 }, -{ "plum3", 205, 150, 205 }, -{ "plum4", 139, 102, 139 }, -{ "MediumOrchid1", 224, 102, 255 }, -{ "MediumOrchid2", 209, 95, 238 }, -{ "MediumOrchid3", 180, 82, 205 }, -{ "MediumOrchid4", 122, 55, 139 }, -{ "DarkOrchid1", 191, 62, 255 }, -{ "DarkOrchid2", 178, 58, 238 }, -{ "DarkOrchid3", 154, 50, 205 }, -{ "DarkOrchid4", 104, 34, 139 }, -{ "purple1", 155, 48, 255 }, -{ "purple2", 145, 44, 238 }, -{ "purple3", 125, 38, 205 }, -{ "purple4", 85, 26, 139 }, -{ "MediumPurple1", 171, 130, 255 }, -{ "MediumPurple2", 159, 121, 238 }, -{ "MediumPurple3", 137, 104, 205 }, -{ "MediumPurple4", 93, 71, 139 }, -{ "thistle1", 255, 225, 255 }, -{ "thistle2", 238, 210, 238 }, -{ "thistle3", 205, 181, 205 }, -{ "thistle4", 139, 123, 139 }, -{ "gray0", 0, 0, 0 }, -{ "grey0", 0, 0, 0 }, -{ "gray1", 3, 3, 3 }, -{ "grey1", 3, 3, 3 }, -{ "gray2", 5, 5, 5 }, -{ "grey2", 5, 5, 5 }, -{ "gray3", 8, 8, 8 }, -{ "grey3", 8, 8, 8 }, -{ "gray4", 10, 10, 10 }, -{ "grey4", 10, 10, 10 }, -{ "gray5", 13, 13, 13 }, -{ "grey5", 13, 13, 13 }, -{ "gray6", 15, 15, 15 }, -{ "grey6", 15, 15, 15 }, -{ "gray7", 18, 18, 18 }, -{ "grey7", 18, 18, 18 }, -{ "gray8", 20, 20, 20 }, -{ "grey8", 20, 20, 20 }, -{ "gray9", 23, 23, 23 }, -{ "grey9", 23, 23, 23 }, -{ "gray10", 26, 26, 26 }, -{ "grey10", 26, 26, 26 }, -{ "gray11", 28, 28, 28 }, -{ "grey11", 28, 28, 28 }, -{ "gray12", 31, 31, 31 }, -{ "grey12", 31, 31, 31 }, -{ "gray13", 33, 33, 33 }, -{ "grey13", 33, 33, 33 }, -{ "gray14", 36, 36, 36 }, -{ "grey14", 36, 36, 36 }, -{ "gray15", 38, 38, 38 }, -{ "grey15", 38, 38, 38 }, -{ "gray16", 41, 41, 41 }, -{ "grey16", 41, 41, 41 }, -{ "gray17", 43, 43, 43 }, -{ "grey17", 43, 43, 43 }, -{ "gray18", 46, 46, 46 }, -{ "grey18", 46, 46, 46 }, -{ "gray19", 48, 48, 48 }, -{ "grey19", 48, 48, 48 }, -{ "gray20", 51, 51, 51 }, -{ "grey20", 51, 51, 51 }, -{ "gray21", 54, 54, 54 }, -{ "grey21", 54, 54, 54 }, -{ "gray22", 56, 56, 56 }, -{ "grey22", 56, 56, 56 }, -{ "gray23", 59, 59, 59 }, -{ "grey23", 59, 59, 59 }, -{ "gray24", 61, 61, 61 }, -{ "grey24", 61, 61, 61 }, -{ "gray25", 64, 64, 64 }, -{ "grey25", 64, 64, 64 }, -{ "gray26", 66, 66, 66 }, -{ "grey26", 66, 66, 66 }, -{ "gray27", 69, 69, 69 }, -{ "grey27", 69, 69, 69 }, -{ "gray28", 71, 71, 71 }, -{ "grey28", 71, 71, 71 }, -{ "gray29", 74, 74, 74 }, -{ "grey29", 74, 74, 74 }, -{ "gray30", 77, 77, 77 }, -{ "grey30", 77, 77, 77 }, -{ "gray31", 79, 79, 79 }, -{ "grey31", 79, 79, 79 }, -{ "gray32", 82, 82, 82 }, -{ "grey32", 82, 82, 82 }, -{ "gray33", 84, 84, 84 }, -{ "grey33", 84, 84, 84 }, -{ "gray34", 87, 87, 87 }, -{ "grey34", 87, 87, 87 }, -{ "gray35", 89, 89, 89 }, -{ "grey35", 89, 89, 89 }, -{ "gray36", 92, 92, 92 }, -{ "grey36", 92, 92, 92 }, -{ "gray37", 94, 94, 94 }, -{ "grey37", 94, 94, 94 }, -{ "gray38", 97, 97, 97 }, -{ "grey38", 97, 97, 97 }, -{ "gray39", 99, 99, 99 }, -{ "grey39", 99, 99, 99 }, -{ "gray40", 102, 102, 102 }, -{ "grey40", 102, 102, 102 }, -{ "gray41", 105, 105, 105 }, -{ "grey41", 105, 105, 105 }, -{ "gray42", 107, 107, 107 }, -{ "grey42", 107, 107, 107 }, -{ "gray43", 110, 110, 110 }, -{ "grey43", 110, 110, 110 }, -{ "gray44", 112, 112, 112 }, -{ "grey44", 112, 112, 112 }, -{ "gray45", 115, 115, 115 }, -{ "grey45", 115, 115, 115 }, -{ "gray46", 117, 117, 117 }, -{ "grey46", 117, 117, 117 }, -{ "gray47", 120, 120, 120 }, -{ "grey47", 120, 120, 120 }, -{ "gray48", 122, 122, 122 }, -{ "grey48", 122, 122, 122 }, -{ "gray49", 125, 125, 125 }, -{ "grey49", 125, 125, 125 }, -{ "gray50", 127, 127, 127 }, -{ "grey50", 127, 127, 127 }, -{ "gray51", 130, 130, 130 }, -{ "grey51", 130, 130, 130 }, -{ "gray52", 133, 133, 133 }, -{ "grey52", 133, 133, 133 }, -{ "gray53", 135, 135, 135 }, -{ "grey53", 135, 135, 135 }, -{ "gray54", 138, 138, 138 }, -{ "grey54", 138, 138, 138 }, -{ "gray55", 140, 140, 140 }, -{ "grey55", 140, 140, 140 }, -{ "gray56", 143, 143, 143 }, -{ "grey56", 143, 143, 143 }, -{ "gray57", 145, 145, 145 }, -{ "grey57", 145, 145, 145 }, -{ "gray58", 148, 148, 148 }, -{ "grey58", 148, 148, 148 }, -{ "gray59", 150, 150, 150 }, -{ "grey59", 150, 150, 150 }, -{ "gray60", 153, 153, 153 }, -{ "grey60", 153, 153, 153 }, -{ "gray61", 156, 156, 156 }, -{ "grey61", 156, 156, 156 }, -{ "gray62", 158, 158, 158 }, -{ "grey62", 158, 158, 158 }, -{ "gray63", 161, 161, 161 }, -{ "grey63", 161, 161, 161 }, -{ "gray64", 163, 163, 163 }, -{ "grey64", 163, 163, 163 }, -{ "gray65", 166, 166, 166 }, -{ "grey65", 166, 166, 166 }, -{ "gray66", 168, 168, 168 }, -{ "grey66", 168, 168, 168 }, -{ "gray67", 171, 171, 171 }, -{ "grey67", 171, 171, 171 }, -{ "gray68", 173, 173, 173 }, -{ "grey68", 173, 173, 173 }, -{ "gray69", 176, 176, 176 }, -{ "grey69", 176, 176, 176 }, -{ "gray70", 179, 179, 179 }, -{ "grey70", 179, 179, 179 }, -{ "gray71", 181, 181, 181 }, -{ "grey71", 181, 181, 181 }, -{ "gray72", 184, 184, 184 }, -{ "grey72", 184, 184, 184 }, -{ "gray73", 186, 186, 186 }, -{ "grey73", 186, 186, 186 }, -{ "gray74", 189, 189, 189 }, -{ "grey74", 189, 189, 189 }, -{ "gray75", 191, 191, 191 }, -{ "grey75", 191, 191, 191 }, -{ "gray76", 194, 194, 194 }, -{ "grey76", 194, 194, 194 }, -{ "gray77", 196, 196, 196 }, -{ "grey77", 196, 196, 196 }, -{ "gray78", 199, 199, 199 }, -{ "grey78", 199, 199, 199 }, -{ "gray79", 201, 201, 201 }, -{ "grey79", 201, 201, 201 }, -{ "gray80", 204, 204, 204 }, -{ "grey80", 204, 204, 204 }, -{ "gray81", 207, 207, 207 }, -{ "grey81", 207, 207, 207 }, -{ "gray82", 209, 209, 209 }, -{ "grey82", 209, 209, 209 }, -{ "gray83", 212, 212, 212 }, -{ "grey83", 212, 212, 212 }, -{ "gray84", 214, 214, 214 }, -{ "grey84", 214, 214, 214 }, -{ "gray85", 217, 217, 217 }, -{ "grey85", 217, 217, 217 }, -{ "gray86", 219, 219, 219 }, -{ "grey86", 219, 219, 219 }, -{ "gray87", 222, 222, 222 }, -{ "grey87", 222, 222, 222 }, -{ "gray88", 224, 224, 224 }, -{ "grey88", 224, 224, 224 }, -{ "gray89", 227, 227, 227 }, -{ "grey89", 227, 227, 227 }, -{ "gray90", 229, 229, 229 }, -{ "grey90", 229, 229, 229 }, -{ "gray91", 232, 232, 232 }, -{ "grey91", 232, 232, 232 }, -{ "gray92", 235, 235, 235 }, -{ "grey92", 235, 235, 235 }, -{ "gray93", 237, 237, 237 }, -{ "grey93", 237, 237, 237 }, -{ "gray94", 240, 240, 240 }, -{ "grey94", 240, 240, 240 }, -{ "gray95", 242, 242, 242 }, -{ "grey95", 242, 242, 242 }, -{ "gray96", 245, 245, 245 }, -{ "grey96", 245, 245, 245 }, -{ "gray97", 247, 247, 247 }, -{ "grey97", 247, 247, 247 }, -{ "gray98", 250, 250, 250 }, -{ "grey98", 250, 250, 250 }, -{ "gray99", 252, 252, 252 }, -{ "grey99", 252, 252, 252 }, -{ "gray100", 255, 255, 255 }, -{ "grey100", 255, 255, 255 }, -{ "DarkGrey", 169, 169, 169 }, -{ "DarkGray", 169, 169, 169 }, -{ "DarkBlue", 0, 0, 139 }, -{ "DarkCyan", 0, 139, 139 }, -{ "DarkMagenta", 139, 0, 139 }, -{ "DarkRed", 139, 0, 0 }, -{ "LightGreen", 144, 238, 144 }, -{ nullptr, 0 , 0, 0} -}; - -#endif // INCLUDED_VCL_SOURCE_FILTER_IXPM_RGBTABLE_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/filter/ixpm/xpmread.cxx b/vcl/source/filter/ixpm/xpmread.cxx index cfc7956f33cd..b7fec06e6b52 100644 --- a/vcl/source/filter/ixpm/xpmread.cxx +++ b/vcl/source/filter/ixpm/xpmread.cxx @@ -19,9 +19,9 @@ #include <vcl/bmpacc.hxx> #include <vcl/graph.hxx> -#include "rgbtable.hxx" +#include "filter/rgbtable.hxx" #define _XPMPRIVATE -#include "xpmread.hxx" +#include "filter/xpmread.hxx" #include <cstring> XPMReader::XPMReader(SvStream& rStm) diff --git a/vcl/source/filter/ixpm/xpmread.hxx b/vcl/source/filter/ixpm/xpmread.hxx deleted file mode 100644 index 141f4b2b23f2..000000000000 --- a/vcl/source/filter/ixpm/xpmread.hxx +++ /dev/null @@ -1,110 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_VCL_SOURCE_FILTER_IXPM_XPMREAD_HXX -#define INCLUDED_VCL_SOURCE_FILTER_IXPM_XPMREAD_HXX - -#include <vcl/bitmap.hxx> - -#ifdef _XPMPRIVATE - -#define XPMTEMPBUFSIZE 0x00008000 -#define XPMSTRINGBUF 0x00008000 - -#define XPMIDENTIFIER 0x00000001 // mnIdentifier includes on of the six phases -#define XPMDEFINITION 0x00000002 // the XPM format consists of -#define XPMVALUES 0x00000003 -#define XPMCOLORS 0x00000004 -#define XPMPIXELS 0x00000005 -#define XPMEXTENSIONS 0x00000006 -#define XPMENDEXT 0x00000007 - -#define XPMREMARK 0x00000001 // defines used by mnStatus -#define XPMDOUBLE 0x00000002 -#define XPMSTRING 0x00000004 -#define XPMFINISHED 0x00000008 - -#define XPMCASESENSITIVE 0x00000001 -#define XPMCASENONSENSITIVE 0x00000002 - -enum ReadState -{ - XPMREAD_OK, - XPMREAD_ERROR, - XPMREAD_NEED_MORE -}; - -class BitmapWriteAccess; -class Graphic; - -class XPMReader : public GraphicReader -{ -private: - - SvStream& mrIStm; - Bitmap maBmp; - BitmapWriteAccess* mpAcc; - Bitmap maMaskBmp; - BitmapWriteAccess* mpMaskAcc; - long mnLastPos; - - sal_uLong mnWidth; - sal_uLong mnHeight; - sal_uLong mnColors; - sal_uLong mnCpp; // characters per pix - bool mbTransparent; - bool mbStatus; - sal_uLong mnStatus; - sal_uLong mnIdentifier; - sal_uInt8 mcThisByte; - sal_uInt8 mcLastByte; - sal_uLong mnTempAvail; - sal_uInt8* mpTempBuf; - sal_uInt8* mpTempPtr; - sal_uInt8* mpFastColorTable; - sal_uInt8* mpColMap; - sal_uLong mnStringSize; - sal_uInt8* mpStringBuf; - sal_uLong mnParaSize; - sal_uInt8* mpPara; - - bool ImplGetString(); - bool ImplGetColor( sal_uLong ); - bool ImplGetScanLine( sal_uLong ); - bool ImplGetColSub( sal_uInt8* ); - bool ImplGetColKey( sal_uInt8 ); - void ImplGetRGBHex( sal_uInt8*, sal_uLong ); - bool ImplGetPara( sal_uLong numb ); - static bool ImplCompare( sal_uInt8 const *, sal_uInt8 const *, sal_uLong, sal_uLong nmode = XPMCASENONSENSITIVE ); - sal_uLong ImplGetULONG( sal_uLong nPara ); - -public: - explicit XPMReader( SvStream& rStm ); - virtual ~XPMReader(); - - ReadState ReadXPM( Graphic& rGraphic ); -}; - -#endif // _XPMPRIVATE - -VCL_DLLPUBLIC bool ImportXPM( SvStream& rStream, Graphic& rGraphic ); - -#endif // INCLUDED_VCL_SOURCE_FILTER_IXPM_XPMREAD_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/filter/jpeg/Exif.cxx b/vcl/source/filter/jpeg/Exif.cxx index b1a4034532ea..7694fb2457c7 100644 --- a/vcl/source/filter/jpeg/Exif.cxx +++ b/vcl/source/filter/jpeg/Exif.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "Exif.hxx" +#include "filter/Exif.hxx" #include <memory> Exif::Exif() : diff --git a/vcl/source/filter/jpeg/Exif.hxx b/vcl/source/filter/jpeg/Exif.hxx deleted file mode 100644 index 2f440f6573c7..000000000000 --- a/vcl/source/filter/jpeg/Exif.hxx +++ /dev/null @@ -1,92 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_VCL_SOURCE_FILTER_JPEG_EXIF_HXX -#define INCLUDED_VCL_SOURCE_FILTER_JPEG_EXIF_HXX - -#include <osl/endian.h> -#include <vcl/graph.hxx> -#include <vcl/fltcall.hxx> -#include <com/sun/star/uno/Sequence.h> -#include <com/sun/star/beans/PropertyValue.hpp> -#include <com/sun/star/task/XStatusIndicator.hpp> - -enum Orientation { - TOP_LEFT = 1, - TOP_RIGHT = 2, - BOTTOM_RIGHT = 3, - BOTTOM_LEFT = 4, - LEFT_TOP = 5, - RIGHT_TOP = 6, - RIGHT_BOTTOM = 7, - LEFT_BOTTOM = 8 -}; - -enum Tag { - ORIENTATION = 0x0112, - X_RESOLUTION = 0x011a, - Y_RESOLUTION = 0x011b, - EXIF_OFFSET = 0x8769, - INTEROP_OFFSET = 0xa005 -}; - -class Exif -{ -private: - Orientation maOrientation; - bool mbExifPresent; - - bool processJpeg(SvStream& rStream, bool bSetValue); - bool processExif(SvStream& rStream, sal_uInt16 aLength, bool bSetValue); - bool processIFD(sal_uInt8* pExifData, sal_uInt16 aLength, sal_uInt16 aOffset, sal_uInt16 aNumberOfTags, bool bSetValue, bool bMoto); - - struct ExifIFD { - sal_uInt16 tag; - sal_uInt16 type; - sal_uInt32 count; - sal_uInt32 offset; - }; - - struct TiffHeader { - sal_uInt16 byteOrder; - sal_uInt16 tagAlign; - sal_uInt32 offset; - }; - - static Orientation convertToOrientation(sal_Int32 value); - -public: - Exif(); - virtual ~Exif(); - - bool hasExif() { return mbExifPresent;} - - Orientation getOrientation() { return maOrientation;} - sal_Int32 getRotation(); - - void setOrientation(Orientation orientation); - - bool read(SvStream& rStream); - bool write(SvStream& rStream); - -}; - -#endif // INCLUDED_VCL_SOURCE_FILTER_JPEG_EXIF_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/filter/jpeg/JpegReader.cxx b/vcl/source/filter/jpeg/JpegReader.cxx index 5f42009d6ca9..c8479cfb64e2 100644 --- a/vcl/source/filter/jpeg/JpegReader.cxx +++ b/vcl/source/filter/jpeg/JpegReader.cxx @@ -19,11 +19,11 @@ #include <sal/config.h> -#include "jpeg.h" +#include "filter/jpeg.h" #include <jpeglib.h> #include <jerror.h> -#include "JpegReader.hxx" +#include "filter/JpegReader.hxx" #include <vcl/bmpacc.hxx> #include <vcl/FilterConfigItem.hxx> #include <vcl/graphicfilter.hxx> diff --git a/vcl/source/filter/jpeg/JpegReader.hxx b/vcl/source/filter/jpeg/JpegReader.hxx deleted file mode 100644 index c45b697fb617..000000000000 --- a/vcl/source/filter/jpeg/JpegReader.hxx +++ /dev/null @@ -1,75 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_VCL_SOURCE_FILTER_JPEG_JPEGREADER_HXX -#define INCLUDED_VCL_SOURCE_FILTER_JPEG_JPEGREADER_HXX - -#include <vcl/graph.hxx> -#include <vcl/fltcall.hxx> -#include <com/sun/star/uno/Sequence.h> -#include <com/sun/star/beans/PropertyValue.hpp> -#include <com/sun/star/task/XStatusIndicator.hpp> - -enum ReadState -{ - JPEGREAD_OK, - JPEGREAD_ERROR, - JPEGREAD_NEED_MORE -}; - -struct JPEGCreateBitmapParam -{ - unsigned long nWidth; - unsigned long nHeight; - unsigned long density_unit; - unsigned long X_density; - unsigned long Y_density; - long bGray; - - long nAlignedWidth; // these members will be filled by the - bool bTopDown; // CreateBitmap method in svtools -}; - -class JPEGReader : public GraphicReader -{ - SvStream& mrStream; - Bitmap maBmp; - Bitmap maBmp1; - BitmapWriteAccess* mpAcc; - BitmapWriteAccess* mpAcc1; - unsigned char * mpBuffer; - long mnLastPos; - long mnFormerPos; - long mnLastLines; - bool mbSetLogSize; - - Graphic CreateIntermediateGraphic( const Bitmap& rBitmap, long nLines ); - void FillBitmap(); - -public: - JPEGReader( SvStream& rStream, void* pCallData, bool bSetLogSize ); - virtual ~JPEGReader(); - - ReadState Read( Graphic& rGraphic ); - unsigned char * CreateBitmap( JPEGCreateBitmapParam& param ); -}; - -#endif // INCLUDED_VCL_SOURCE_FILTER_JPEG_JPEGREADER_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/filter/jpeg/JpegTransform.cxx b/vcl/source/filter/jpeg/JpegTransform.cxx index a71b816f3f50..496b8cc7d5e9 100644 --- a/vcl/source/filter/jpeg/JpegTransform.cxx +++ b/vcl/source/filter/jpeg/JpegTransform.cxx @@ -19,9 +19,8 @@ #include <sal/config.h> -#include "jpeg.h" - -#include "JpegTransform.hxx" +#include "filter/jpeg.h" +#include "filter/JpegTransform.hxx" JpegTransform::JpegTransform(SvStream& rInputStream, SvStream& rOutputStream) : maRotate ( 0 ), diff --git a/vcl/source/filter/jpeg/JpegTransform.hxx b/vcl/source/filter/jpeg/JpegTransform.hxx deleted file mode 100644 index 0711f2337673..000000000000 --- a/vcl/source/filter/jpeg/JpegTransform.hxx +++ /dev/null @@ -1,42 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_VCL_SOURCE_FILTER_JPEG_JPEGTRANSFORM_HXX -#define INCLUDED_VCL_SOURCE_FILTER_JPEG_JPEGTRANSFORM_HXX - -#include <vcl/graph.hxx> - -class JpegTransform -{ - sal_uInt16 maRotate; - SvStream& mrInputStream; - SvStream& mrOutputStream; - -public: - - JpegTransform(SvStream& rInputStream, SvStream& rOutputStream); - virtual ~JpegTransform(); - - void setRotate(sal_uInt16 aRotate); - bool perform(); -}; - -#endif // INCLUDED_VCL_SOURCE_FILTER_JPEG_JPEGTRANSFORM_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/filter/jpeg/JpegWriter.cxx b/vcl/source/filter/jpeg/JpegWriter.cxx index cb1a67f90712..648299a2eaad 100644 --- a/vcl/source/filter/jpeg/JpegWriter.cxx +++ b/vcl/source/filter/jpeg/JpegWriter.cxx @@ -19,11 +19,11 @@ #include <sal/config.h> -#include "jpeg.h" +#include "filter/jpeg.h" #include <jpeglib.h> #include <jerror.h> -#include "JpegWriter.hxx" +#include "filter/JpegWriter.hxx" #include <vcl/bmpacc.hxx> #include <vcl/FilterConfigItem.hxx> #include <vcl/graphicfilter.hxx> diff --git a/vcl/source/filter/jpeg/JpegWriter.hxx b/vcl/source/filter/jpeg/JpegWriter.hxx deleted file mode 100644 index 77822d667835..000000000000 --- a/vcl/source/filter/jpeg/JpegWriter.hxx +++ /dev/null @@ -1,57 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_VCL_SOURCE_FILTER_JPEG_JPEGWRITER_HXX -#define INCLUDED_VCL_SOURCE_FILTER_JPEG_JPEGWRITER_HXX - -#include <vcl/graph.hxx> -#include <vcl/fltcall.hxx> -#include <com/sun/star/uno/Sequence.h> -#include <com/sun/star/beans/PropertyValue.hpp> -#include <com/sun/star/task/XStatusIndicator.hpp> - -class JPEGWriter -{ - SvStream& mrStream; - BitmapReadAccess* mpReadAccess; - sal_uInt8* mpBuffer; - bool mbNative; - bool mbGreys; - sal_Int32 mnQuality; - sal_Int32 maChromaSubsampling; - - bool* mpExpWasGrey; - - css::uno::Reference< css::task::XStatusIndicator > mxStatusIndicator; - -public: - JPEGWriter( SvStream& rStream, - const css::uno::Sequence< css::beans::PropertyValue >* pFilterData, - bool* pExportWasGrey = nullptr ); - - virtual ~JPEGWriter() {}; - - void* GetScanline( long nY ); - bool Write( const Graphic& rGraphic ); - -}; - -#endif // INCLUDED_VCL_SOURCE_FILTER_JPEG_JPEGWRITER_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/filter/jpeg/jinclude.h b/vcl/source/filter/jpeg/jinclude.h deleted file mode 100644 index 4536a09c7acc..000000000000 --- a/vcl/source/filter/jpeg/jinclude.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - * jinclude.h - * - * Copyright (C) 1991-1994, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file exists to provide a single place to fix any problems with - * including the wrong system include files. (Common problems are taken - * care of by the standard jconfig symbols, but on really weird systems - * you may have to edit this file.) - * - * NOTE: this file is NOT intended to be included by applications using the - * JPEG library. Most applications need only include jpeglib.h. - */ - -/* Include auto-config file to find out which system include files we need. */ - -#include "jconfig.h" /* auto configuration options */ -#define JCONFIG_INCLUDED /* so that jpeglib.h doesn't do it again */ - -/* - * We need the NULL macro and size_t typedef. - * On an ANSI-conforming system it is sufficient to include <stddef.h>. - * Otherwise, we get them from <stdlib.h> or <stdio.h>; we may have to - * pull in <sys/types.h> as well. - * Note that the core JPEG library does not require <stdio.h>; - * only the default error handler and data source/destination modules do. - * But we must pull it in because of the references to FILE in jpeglib.h. - * You can remove those references if you want to compile without <stdio.h>. - */ - -#ifdef HAVE_STDDEF_H -#include <stddef.h> -#endif - -#ifdef HAVE_STDLIB_H -#include <stdlib.h> -#endif - -#ifdef NEED_SYS_TYPES_H -#include <sys/types.h> -#endif - -#include <stdio.h> - -/* - * We need memory copying and zeroing functions, plus strncpy(). - * ANSI and System V implementations declare these in <string.h>. - * BSD doesn't have the mem() functions, but it does have bcopy()/bzero(). - * Some systems may declare memset and memcpy in <memory.h>. - * - * NOTE: we assume the size parameters to these functions are of type size_t. - * Change the casts in these macros if not! - */ - -#ifdef NEED_BSD_STRINGS - -#include <strings.h> -#define MEMZERO(target,size) bzero((void *)(target), (size_t)(size)) -#define MEMCOPY(dest,src,size) bcopy((const void *)(src), (void *)(dest), (size_t)(size)) - -#else /* not BSD, assume ANSI/SysV string lib */ - -#include <string.h> -#define MEMZERO(target,size) memset((void *)(target), 0, (size_t)(size)) -#define MEMCOPY(dest,src,size) memcpy((void *)(dest), (const void *)(src), (size_t)(size)) - -#endif - -/* - * In ANSI C, and indeed any rational implementation, size_t is also the - * type returned by sizeof(). However, it seems there are some irrational - * implementations out there, in which sizeof() returns an int even though - * size_t is defined as long or unsigned long. To ensure consistent results - * we always use this SIZEOF() macro in place of using sizeof() directly. - */ - -#define SIZEOF(object) ((size_t) sizeof(object)) - - diff --git a/vcl/source/filter/jpeg/jpeg.cxx b/vcl/source/filter/jpeg/jpeg.cxx index b2e46720790d..f1e57734403f 100644 --- a/vcl/source/filter/jpeg/jpeg.cxx +++ b/vcl/source/filter/jpeg/jpeg.cxx @@ -17,9 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "JpegReader.hxx" -#include "JpegWriter.hxx" -#include "jpeg.hxx" +#include "filter/JpegReader.hxx" +#include "filter/JpegWriter.hxx" +#include "filter/jpeg.hxx" #include <vcl/bmpacc.hxx> #include <vcl/FilterConfigItem.hxx> diff --git a/vcl/source/filter/jpeg/jpeg.h b/vcl/source/filter/jpeg/jpeg.h deleted file mode 100644 index 1f8c21f62aac..000000000000 --- a/vcl/source/filter/jpeg/jpeg.h +++ /dev/null @@ -1,52 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_VCL_SOURCE_FILTER_JPEG_JPEG_H -#define INCLUDED_VCL_SOURCE_FILTER_JPEG_JPEG_H - -#include <sal/config.h> - -#include <com/sun/star/uno/Reference.hxx> -#include <sal/types.h> - -#include <jpeglib.h> - -namespace com { namespace sun { namespace star { namespace task { - class XStatusIndicator; -} } } } -class JPEGReader; -class JPEGWriter; -class Size; - -void jpeg_svstream_src (j_decompress_ptr cinfo, void* infile); - -void jpeg_svstream_dest (j_compress_ptr cinfo, void* outfile); - -bool WriteJPEG( JPEGWriter* pJPEGWriter, void* pOutputStream, long nWidth, long nHeight, bool bGreyScale, - long nQualityPercent, long aChromaSubsampling, - css::uno::Reference<css::task::XStatusIndicator> const & status); - -void ReadJPEG( JPEGReader* pJPEGReader, void* pInputStream, long* pLines, - Size const & previewSize ); - -long Transform( void* pInputStream, void* pOutputStream, long nAngle ); - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/filter/jpeg/jpeg.hxx b/vcl/source/filter/jpeg/jpeg.hxx deleted file mode 100644 index 701a8eaa53dc..000000000000 --- a/vcl/source/filter/jpeg/jpeg.hxx +++ /dev/null @@ -1,39 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_VCL_SOURCE_FILTER_JPEG_JPEG_HXX -#define INCLUDED_VCL_SOURCE_FILTER_JPEG_JPEG_HXX - -#include <vcl/graph.hxx> -#include <vcl/graphicfilter.hxx> -#include <vcl/fltcall.hxx> -#include <com/sun/star/uno/Sequence.h> -#include <com/sun/star/beans/PropertyValue.hpp> -#include <com/sun/star/task/XStatusIndicator.hpp> - -VCL_DLLPUBLIC bool ImportJPEG( SvStream& rInputStream, Graphic& rGraphic, void* pCallerData, GraphicFilterImportFlags nImportFlags ); - -bool ExportJPEG(SvStream& rOutputStream, - const Graphic& rGraphic, - const css::uno::Sequence< css::beans::PropertyValue >* pFilterData, - bool* pExportWasGrey = nullptr); - -#endif // INCLUDED_VCL_SOURCE_FILTER_JPEG_JPEG_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/filter/jpeg/jpegc.cxx b/vcl/source/filter/jpeg/jpegc.cxx index d42ae785b623..f184441fb62e 100644 --- a/vcl/source/filter/jpeg/jpegc.cxx +++ b/vcl/source/filter/jpeg/jpegc.cxx @@ -29,12 +29,12 @@ #include <osl/diagnose.h> extern "C" { -#include "transupp.h" +#include "filter/transupp.h" } -#include "jpeg.h" -#include <JpegReader.hxx> -#include <JpegWriter.hxx> +#include "filter/jpeg.h" +#include "filter/JpegReader.hxx" +#include "filter/JpegWriter.hxx" #include <memory> #ifdef _MSC_VER diff --git a/vcl/source/filter/jpeg/jpegcomp.h b/vcl/source/filter/jpeg/jpegcomp.h deleted file mode 100644 index ed9eeab8a1bb..000000000000 --- a/vcl/source/filter/jpeg/jpegcomp.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * jpegcomp.h - * - * Copyright (C) 2010, D. R. Commander - * For conditions of distribution and use, see the accompanying README file. - * - * JPEG compatibility macros - * These declarations are considered internal to the JPEG library; most - * applications using the library shouldn't need to include this file. - */ - -#if JPEG_LIB_VERSION >= 70 -#define _DCT_scaled_size DCT_h_scaled_size -#define _DCT_h_scaled_size DCT_h_scaled_size -#define _DCT_v_scaled_size DCT_v_scaled_size -#define _min_DCT_scaled_size min_DCT_h_scaled_size -#define _min_DCT_h_scaled_size min_DCT_h_scaled_size -#define _min_DCT_v_scaled_size min_DCT_v_scaled_size -#define _jpeg_width jpeg_width -#define _jpeg_height jpeg_height -#else -#define _DCT_scaled_size DCT_scaled_size -#define _DCT_h_scaled_size DCT_scaled_size -#define _DCT_v_scaled_size DCT_scaled_size -#define _min_DCT_scaled_size min_DCT_scaled_size -#define _min_DCT_h_scaled_size min_DCT_scaled_size -#define _min_DCT_v_scaled_size min_DCT_scaled_size -#define _jpeg_width image_width -#define _jpeg_height image_height -#endif diff --git a/vcl/source/filter/jpeg/transupp.c b/vcl/source/filter/jpeg/transupp.c index 323aa3018bec..e9fbbd0dddc6 100644 --- a/vcl/source/filter/jpeg/transupp.c +++ b/vcl/source/filter/jpeg/transupp.c @@ -19,8 +19,8 @@ #include "jinclude.h" #include "jerror.h" #include "jpeglib.h" -#include "transupp.h" /* My own external interface */ -#include "jpegcomp.h" +#include "filter/transupp.h" /* My own external interface */ +#include "filter/jpegcomp.h" #include <ctype.h> /* to declare isdigit() */ /* Definition of jdiv_round_up is copied here from jutils.c in jpeg-8c.tar.gz, diff --git a/vcl/source/filter/jpeg/transupp.h b/vcl/source/filter/jpeg/transupp.h deleted file mode 100644 index fe1b04ac5035..000000000000 --- a/vcl/source/filter/jpeg/transupp.h +++ /dev/null @@ -1,212 +0,0 @@ -/* - * transupp.h - * - * Copyright (C) 1997-2011, Thomas G. Lane, Guido Vollbeding. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains declarations for image transformation routines and - * other utility code used by the jpegtran sample application. These are - * NOT part of the core JPEG library. But we keep these routines separate - * from jpegtran.c to ease the task of maintaining jpegtran-like programs - * that have other user interfaces. - * - * NOTE: all the routines declared here have very specific requirements - * about when they are to be executed during the reading and writing of the - * source and destination files. See the comments in transupp.c, or see - * jpegtran.c for an example of correct usage. - */ - -/* If you happen not to want the image transform support, disable it here */ -#ifndef TRANSFORMS_SUPPORTED -#define TRANSFORMS_SUPPORTED 1 /* 0 disables transform code */ -#endif - -/* - * Although rotating and flipping data expressed as DCT coefficients is not - * hard, there is an asymmetry in the JPEG format specification for images - * whose dimensions aren't multiples of the iMCU size. The right and bottom - * image edges are padded out to the next iMCU boundary with junk data; but - * no padding is possible at the top and left edges. If we were to flip - * the whole image including the pad data, then pad garbage would become - * visible at the top and/or left, and real pixels would disappear into the - * pad margins --- perhaps permanently, since encoders & decoders may not - * bother to preserve DCT blocks that appear to be completely outside the - * nominal image area. So, we have to exclude any partial iMCUs from the - * basic transformation. - * - * Transpose is the only transformation that can handle partial iMCUs at the - * right and bottom edges completely cleanly. flip_h can flip partial iMCUs - * at the bottom, but leaves any partial iMCUs at the right edge untouched. - * Similarly flip_v leaves any partial iMCUs at the bottom edge untouched. - * The other transforms are defined as combinations of these basic transforms - * and process edge blocks in a way that preserves the equivalence. - * - * The "trim" option causes untransformable partial iMCUs to be dropped; - * this is not strictly lossless, but it usually gives the best-looking - * result for odd-size images. Note that when this option is active, - * the expected mathematical equivalences between the transforms may not hold. - * (For example, -rot 270 -trim trims only the bottom edge, but -rot 90 -trim - * followed by -rot 180 -trim trims both edges.) - * - * We also offer a lossless-crop option, which discards data outside a given - * image region but losslessly preserves what is inside. Like the rotate and - * flip transforms, lossless crop is restricted by the JPEG format: the upper - * left corner of the selected region must fall on an iMCU boundary. If this - * does not hold for the given crop parameters, we silently move the upper left - * corner up and/or left to make it so, simultaneously increasing the region - * dimensions to keep the lower right crop corner unchanged. (Thus, the - * output image covers at least the requested region, but may cover more.) - * The adjustment of the region dimensions may be optionally disabled. - * - * We also provide a lossless-resize option, which is kind of a lossless-crop - * operation in the DCT coefficient block domain - it discards higher-order - * coefficients and losslessly preserves lower-order coefficients of a - * sub-block. - * - * Rotate/flip transform, resize, and crop can be requested together in a - * single invocation. The crop is applied last --- that is, the crop region - * is specified in terms of the destination image after transform/resize. - * - * We also offer a "force to grayscale" option, which simply discards the - * chrominance channels of a YCbCr image. This is lossless in the sense that - * the luminance channel is preserved exactly. It's not the same kind of - * thing as the rotate/flip transformations, but it's convenient to handle it - * as part of this package, mainly because the transformation routines have to - * be aware of the option to know how many components to work on. - */ - -/* Short forms of external names for systems with brain-damaged linkers. */ - -#ifdef NEED_SHORT_EXTERNAL_NAMES -#define jtransform_parse_crop_spec jTrParCrop -#define jtransform_request_workspace jTrRequest -#define jtransform_adjust_parameters jTrAdjust -#define jtransform_execute_transform jTrExec -#define jtransform_perfect_transform jTrPerfect -#define jcopy_markers_setup jCMrkSetup -#define jcopy_markers_execute jCMrkExec -#endif /* NEED_SHORT_EXTERNAL_NAMES */ - -/* - * Codes for supported types of image transformations. - */ - -typedef enum { - JXFORM_NONE, /* no transformation */ - JXFORM_FLIP_H, /* horizontal flip */ - JXFORM_FLIP_V, /* vertical flip */ - JXFORM_TRANSPOSE, /* transpose across UL-to-LR axis */ - JXFORM_TRANSVERSE, /* transpose across UR-to-LL axis */ - JXFORM_ROT_90, /* 90-degree clockwise rotation */ - JXFORM_ROT_180, /* 180-degree rotation */ - JXFORM_ROT_270 /* 270-degree clockwise (or 90 ccw) */ -} JXFORM_CODE; - -/* - * Codes for crop parameters, which can individually be unspecified, - * positive or negative for xoffset or yoffset, - * positive or forced for width or height. - */ - -typedef enum { - JCROP_UNSET, - JCROP_POS, - JCROP_NEG, - JCROP_FORCE -} JCROP_CODE; - -/* - * Transform parameters struct. - * NB: application must not change any elements of this struct after - * calling jtransform_request_workspace. - */ - -typedef struct { - /* Options: set by caller */ - JXFORM_CODE transform; /* image transform operator */ - boolean perfect; /* if TRUE, fail if partial MCUs are requested */ - boolean trim; /* if TRUE, trim partial MCUs as needed */ - boolean force_grayscale; /* if TRUE, convert color image to grayscale */ - boolean crop; /* if TRUE, crop source image */ - boolean slow_hflip; /* For best performance, the JXFORM_FLIP_H transform - normally modifies the source coefficients in place. - Setting this to TRUE will instead use a slower, - double-buffered algorithm, which leaves the source - coefficients in tact (necessary if other transformed - images must be generated from the same set of - coefficients. */ - - /* Crop parameters: application need not set these unless crop is TRUE. - * These can be filled in by jtransform_parse_crop_spec(). - */ - JDIMENSION crop_width; /* Width of selected region */ - JCROP_CODE crop_width_set; /* (forced disables adjustment) */ - JDIMENSION crop_height; /* Height of selected region */ - JCROP_CODE crop_height_set; /* (forced disables adjustment) */ - JDIMENSION crop_xoffset; /* X offset of selected region */ - JCROP_CODE crop_xoffset_set; /* (negative measures from right edge) */ - JDIMENSION crop_yoffset; /* Y offset of selected region */ - JCROP_CODE crop_yoffset_set; /* (negative measures from bottom edge) */ - - /* Internal workspace: caller should not touch these */ - int num_components; /* # of components in workspace */ - jvirt_barray_ptr * workspace_coef_arrays; /* workspace for transformations */ - JDIMENSION output_width; /* cropped destination dimensions */ - JDIMENSION output_height; - JDIMENSION x_crop_offset; /* destination crop offsets measured in iMCUs */ - JDIMENSION y_crop_offset; - int iMCU_sample_width; /* destination iMCU size */ - int iMCU_sample_height; -} jpeg_transform_info; - -#if TRANSFORMS_SUPPORTED - -/* Request any required workspace */ -EXTERN(boolean) jtransform_request_workspace - (j_decompress_ptr srcinfo, jpeg_transform_info *info); -/* Adjust output image parameters */ -EXTERN(jvirt_barray_ptr *) jtransform_adjust_parameters - (j_decompress_ptr srcinfo, j_compress_ptr dstinfo, - jvirt_barray_ptr *src_coef_arrays, - jpeg_transform_info *info); -/* Execute the actual transformation, if any */ -EXTERN(void) jtransform_execute_transform - (j_decompress_ptr srcinfo, j_compress_ptr dstinfo, - jvirt_barray_ptr *src_coef_arrays, - jpeg_transform_info *info); -/* Determine whether lossless transformation is perfectly - * possible for a specified image and transformation. - */ -EXTERN(boolean) jtransform_perfect_transform - (JDIMENSION image_width, JDIMENSION image_height, - int MCU_width, int MCU_height, - JXFORM_CODE transform); - -/* jtransform_execute_transform used to be called - * jtransform_execute_transformation, but some compilers complain about - * routine names that long. This macro is here to avoid breaking any - * old source code that uses the original name... - */ -#define jtransform_execute_transformation jtransform_execute_transform - -#endif /* TRANSFORMS_SUPPORTED */ - -/* - * Support for copying optional markers from source to destination file. - */ - -typedef enum { - JCOPYOPT_NONE, /* copy no optional markers */ - JCOPYOPT_COMMENTS, /* copy only comment (COM) markers */ - JCOPYOPT_ALL /* copy all optional markers */ -} JCOPY_OPTION; - - -/* Setup decompression object to save desired markers in memory */ -EXTERN(void) jcopy_markers_setup - (j_decompress_ptr srcinfo, JCOPY_OPTION option); -/* Copy markers saved in the given source object to the destination object */ -EXTERN(void) jcopy_markers_execute - (j_decompress_ptr srcinfo, j_compress_ptr dstinfo, - JCOPY_OPTION option); diff --git a/vcl/source/filter/sgfbram.cxx b/vcl/source/filter/sgfbram.cxx index c449afcc9eed..f02f249437f3 100644 --- a/vcl/source/filter/sgfbram.cxx +++ b/vcl/source/filter/sgfbram.cxx @@ -24,8 +24,8 @@ #include <vcl/gdimtf.hxx> #include <tools/color.hxx> #include <vcl/virdev.hxx> -#include "sgffilt.hxx" -#include "sgfbram.hxx" +#include "filter/sgffilt.hxx" +#include "filter/sgfbram.hxx" #include <memory> SgfHeader::SgfHeader() diff --git a/vcl/source/filter/sgfbram.hxx b/vcl/source/filter/sgfbram.hxx deleted file mode 100644 index 9e0eeedcd7c3..000000000000 --- a/vcl/source/filter/sgfbram.hxx +++ /dev/null @@ -1,142 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_VCL_SOURCE_FILTER_SGFBRAM_HXX -#define INCLUDED_VCL_SOURCE_FILTER_SGFBRAM_HXX - -#define SgfBitImag0 1 /* Bitmap */ -#define SgfBitImag1 4 /* Bitmap */ -#define SgfBitImag2 5 /* Bitmap */ -#define SgfBitImgMo 6 /* Monochrome bitmap */ -#define SgfSimpVect 2 /* Simple vectorformat */ -#define SgfPostScrp 3 /* Postscript file */ -#define SgfStarDraw 7 /* StarDraw SGV-file */ - -// constants for SgfHeader.SwGrCol -#define SgfVectFarb 4 /* use colours in lines */ -#define SgfVectGray 5 /* use greyscale for lines only for */ -#define SgfVectWdth 6 /* use line widths for lines SimpVector */ - -#define SgfHeaderSize 42 -class SgfHeader -{ -public: - sal_uInt16 Magic; - sal_uInt16 Version; - sal_uInt16 Typ; - sal_uInt16 Xsize; - sal_uInt16 Ysize; - sal_Int16 Xoffs; - sal_Int16 Yoffs; - sal_uInt16 Planes; // Layer - sal_uInt16 SwGrCol; - char Autor[10]; - char Programm[10]; - sal_uInt16 OfsLo,OfsHi; // DWord allignment is necessary (38 mod 4 =2) ! - - sal_uInt32 GetOffset(); - friend SvStream& ReadSgfHeader(SvStream& rIStream, SgfHeader& rHead); - bool ChkMagic(); - SgfHeader(); -}; - -#define SgfEntrySize 22 -class SgfEntry -{ -public: - sal_uInt16 Typ; - sal_uInt16 iFrei; - sal_uInt16 lFreiLo,lFreiHi; - char cFrei[10]; - sal_uInt16 OfsLo,OfsHi; // DWord allignment is necessary (18 mod 4 =2) ! - - sal_uInt32 GetOffset(); - friend SvStream& ReadSgfEntry(SvStream& rIStream, SgfEntry& rEntr); - SgfEntry(); -}; - -#define SgfVectorSize 10 -class SgfVector -{ -public: - sal_uInt16 Flag; - sal_Int16 x; - sal_Int16 y; - sal_uInt16 OfsLo,OfsHi; // DWord allignment is necessary (6 mod 4 =2) ! - - friend SvStream& ReadSgfVector(SvStream& rIStream, SgfVector& rEntr); -}; - -extern long SgfVectXofs; -extern long SgfVectYofs; -extern long SgfVectXmul; -extern long SgfVectYmul; -extern long SgfVectXdiv; -extern long SgfVectYdiv; -extern bool SgfVectScal; - -#define BmpFileHeaderSize 14 -class BmpFileHeader -{ -public: - sal_uInt16 Typ; // = "BM" - sal_uInt16 SizeLo,SizeHi; // filesize in bytes - sal_uInt16 Reserve1; // reserved - sal_uInt16 Reserve2; // reserved - sal_uInt16 OfsLo,OfsHi; // Offset? - - void SetSize(sal_uInt32 Size); - void SetOfs(sal_uInt32 Size); - sal_uInt32 GetOfs(); - friend SvStream& WriteBmpFileHeader(SvStream& rOStream, BmpFileHeader& rHead); -}; - -#define BmpInfoHeaderSize 40 -class BmpInfoHeader -{ -public: - sal_uInt32 Size; // size of BmpInfoHeaders - sal_Int32 Width; // width in Pixel - sal_Int32 Hight; // height in Pixel - sal_uInt16 Planes; // number of planes (always 1) - sal_uInt16 PixBits; // number of bits per pixel (1,4,8 or 24) - sal_uInt32 Compress; // datakompression - sal_uInt32 ImgSize; // size of image in bytes. Without compression also 0 is allowed. - sal_Int32 xDpmm; // Dot per Meter (0 is allowed) - sal_Int32 yDpmm; // Dot per Meter (0 is allowed) - sal_uInt32 ColUsed; // number of colours used (0=all - sal_uInt32 ColMust; // number of important colours (0=all) - - friend SvStream& WriteBmpInfoHeader(SvStream& rOStream, BmpInfoHeader& rHead); -}; - -#define RGBQuadSize 4 -class RGBQuad { -private: - sal_uInt8 Red; - sal_uInt8 Grn; - sal_uInt8 Blu; - sal_uInt8 Fil; -public: - RGBQuad(sal_uInt8 R, sal_uInt8 G, sal_uInt8 B) { Red=R; Grn=G; Blu=B; Fil=0; } -}; - -#endif // INCLUDED_VCL_SOURCE_FILTER_SGFBRAM_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/filter/sgffilt.hxx b/vcl/source/filter/sgffilt.hxx deleted file mode 100644 index 9256c61770fc..000000000000 --- a/vcl/source/filter/sgffilt.hxx +++ /dev/null @@ -1,40 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_VCL_SOURCE_FILTER_SGFFILT_HXX -#define INCLUDED_VCL_SOURCE_FILTER_SGFFILT_HXX -#include <tools/urlobj.hxx> - -sal_uInt8 CheckSgfTyp(SvStream& rInp, sal_uInt16& nVersion); -bool SgfBMapFilter(SvStream& rInp, SvStream& rOut); -bool SgfVectFilter(SvStream& rInp, GDIMetaFile& rMtf); -bool SgfSDrwFilter(SvStream& rInp, GDIMetaFile& rMtf, const INetURLObject& aIniPath ); - -// constants for CheckSgfTyp() -#define SGF_BITIMAGE 1 /* Bitmap */ -#define SGF_SIMPVECT 2 /* simple vectorformat */ -#define SGF_POSTSCRP 3 /* Postscript file */ -#define SGF_STARDRAW 7 /* StarDraw SGV file */ -#define SGF_DONTKNOW 255 /* unknown or no SGF/SGV */ - -#define SGV_VERSION 3 /* reject SGV with other version */ - /* 3 matches StarDraw 2.00/2.01 march'93 */ -#endif // INCLUDED_VCL_SOURCE_FILTER_SGFFILT_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/filter/sgvmain.cxx b/vcl/source/filter/sgvmain.cxx index 18e2d2ce16bc..9b96af91ef1d 100644 --- a/vcl/source/filter/sgvmain.cxx +++ b/vcl/source/filter/sgvmain.cxx @@ -23,10 +23,10 @@ #include <tools/poly.hxx> #include <tools/fract.hxx> #include <vcl/graphicfilter.hxx> -#include "sgffilt.hxx" -#include "sgfbram.hxx" -#include "sgvmain.hxx" -#include "sgvspln.hxx" +#include "filter/sgffilt.hxx" +#include "filter/sgfbram.hxx" +#include "filter/sgvmain.hxx" +#include "filter/sgvspln.hxx" #include <unotools/ucbstreamhelper.hxx> #if defined OSL_BIGENDIAN diff --git a/vcl/source/filter/sgvmain.hxx b/vcl/source/filter/sgvmain.hxx deleted file mode 100644 index 9ff404016a5e..000000000000 --- a/vcl/source/filter/sgvmain.hxx +++ /dev/null @@ -1,364 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_VCL_SOURCE_FILTER_SGVMAIN_HXX -#define INCLUDED_VCL_SOURCE_FILTER_SGVMAIN_HXX - -#include <vcl/font.hxx> -#include <vcl/outdev.hxx> -#include <vcl/virdev.hxx> - -#define UCHAR unsigned char - -struct PointType { - sal_Int16 x; - sal_Int16 y; - PointType() - : x(0) - , y(0) - { - } -}; - -#define SgfDpmm 40 - -#define DtHdSize 256 -class DtHdType { -public: - sal_uInt8 Reserved[256]; - friend void DtHdOverSeek(SvStream& rInp); -}; - -struct Seitenformat { - PointType Size; // 0.00mm...819.175mm (papersize) - sal_Int16 RandL; // left border on - sal_Int16 RandR; // right paper - sal_Int16 RandO; // upper border on - sal_Int16 RandU; // lower paper - sal_uInt8 PColor; // future use - sal_uInt8 PIntens; // future use -}; - -#define PageSize 146 -class PageType { -public: - sal_uInt32 Next; // next page - sal_uInt32 nList; // objectdata, first record - sal_uInt32 ListEnd; // objectdata, last record - Seitenformat Paper; // data of paper - bool BorderClip; // clip objects at border (cheat due to alignment in NT) - sal_uInt8 StdPg; // insert which standardpage ? - PointType U; // origin - sal_Int16 HlpLnH[20]; // guides - sal_Int16 HlpLnV[20]; - sal_uInt8 LnAnzH; - sal_uInt8 LnAnzV; - UCHAR PgName[32]; // page name - friend SvStream& ReadPageType(SvStream& rIStream, PageType& rPage); - PageType(); -}; - -enum ObjArtType {ObjStrk,ObjRect,ObjPoly,ObjCirc,ObjSpln, - ObjText,ObjGrup,ObjBmap,ObjVirt,ObjTxtX,ObjMaxi}; - -struct ObjLineType { - sal_uInt8 LFarbe; // [Index] - sal_uInt8 LBFarbe; // [Index] - sal_uInt8 LIntens; // [%] - sal_uInt8 LMuster; // [Index] including transparency - sal_Int16 LMSize; // [coefficient/100] - sal_Int16 LDicke; // line thickness -}; - -struct ObjAreaType { - sal_uInt8 FFarbe; // [Index] - sal_uInt8 FBFarbe; // [Index] - sal_uInt8 FIntens; // [%] - // Despite the "Dummy" in the name, and not being used anywhere in - // the code, these two fields are *essential*. These structs are - // 1:1 mappings of actual on-disk/wire file format structures... - // So don't clean the "unused dummy" fields away. (Actually it - // might well be that many other fields around here are never used - // in our code either.) - sal_uInt8 FDummy1; - sal_Int16 FDummy2; - sal_uInt16 FMuster; // [Index] incl. Invers, transparency - - ObjAreaType() - : FFarbe(0) - , FBFarbe(0) - , FIntens(0) - , FDummy1(0) - , FDummy2(0) - , FMuster(0) - { - } -}; - -#define ObjTextTypeSize 64 -class ObjTextType { -public: - ObjLineType L; // text outline (future) - ObjAreaType F; // inner text - sal_uInt16 FontLo,FontHi; // e.g. 92500 (CG Times), split due to DWordAllign in TextType. - sal_uInt16 Grad; // 0.5..32767.5 pt - we should stop at 1000 pt - sal_uInt16 Breite; // 1..65535% please not more as 500% - sal_uInt8 Justify; // 2 bit vertical (Hi), 3 bit horizontal (Lo) - sal_uInt8 Kapit; // 1..255% - sal_uInt16 Schnitt; // 8 flags - sal_uInt16 LnFeed; // 1..32767% of max font size of the line - sal_uInt16 Slant; // slant angle 0.00..89.99deg default 15.00deg viewed double width) - sal_uInt8 ZAbst; // character spacing 0..255% (0=on the line; 100=normal; 200=Zeichen wird als - signed char ChrVPos; // vertical position of char. Default 0=on baseline, 10=5Pt below (-64..63") - ObjLineType ShdL; // shadow outline (new 2.0) - ObjAreaType ShdF; // shadow inside (new 2.0) - PointType ShdVers; // shadow offset max. 300.00% - bool ShdAbs; // True-> shadow offset is absolute instead of relative to font size - bool NoSpc; // True-> no space (for background area) - ObjAreaType BackF; // background area - sal_uInt32 GetFont(); - void SetFont(sal_uInt32 FontID); -}; - -#define ObjkSize 20 /* should be 21. due to alignment we shifted the flag */ -class ObjkType { // basic componenents of all Stardraw objects -public: - sal_uInt32 Last; - sal_uInt32 Next; - sal_uInt16 MemSize; // in bytes - PointType ObjMin; // XY minimum of the object - PointType ObjMax; // XY maximum of the object - sal_uInt8 Art; - sal_uInt8 Layer; - ObjkType() - : Last(0) - , Next(0) - , MemSize(0) - , Art(0) - , Layer(0) - { - } - virtual ~ObjkType() {} - friend SvStream& ReadObjkType(SvStream& rIStream, ObjkType& rObjk); - virtual void Draw(OutputDevice& rOut); -}; - -#define StrkSize 38 -class StrkType: public ObjkType { -public: - sal_uInt8 Flags; // (cheat due to alignment in NT) - sal_uInt8 LEnden; // line ends - ObjLineType L; - PointType Pos1; // start point - PointType Pos2; // end point - friend SvStream& ReadStrkType(SvStream& rIStream, StrkType& rStrk); - virtual void Draw(OutputDevice& rOut) override; -}; - -#define RectSize 52 -class RectType: public ObjkType { -public: - sal_uInt8 Flags; // (cheat due to alignment in NT) - sal_uInt8 Reserve; - ObjLineType L; - ObjAreaType F; - PointType Pos1; // lower left corner = reference point - PointType Pos2; // right corner - sal_Int16 Radius; // radius of corner - sal_uInt16 RotationAngle; // 315...<45 - sal_uInt16 Slant; // >270...<90 - friend SvStream& ReadRectType(SvStream& rIStream, RectType& rRect); - virtual void Draw(OutputDevice& rOut) override; -}; - -#define PolySize 44 -class PolyType: public ObjkType { // identical to spline ! -public: - sal_uInt8 Flags; // (cheat due to alignment in NT) - sal_uInt8 LEnden; // only for polyline - ObjLineType L; - ObjAreaType F; // not for polyline - sal_uInt8 nPoints; - sal_uInt8 Reserve; - sal_uInt32 SD_EckP; // pointer to corner point (StarDraw) - PointType* EckP; // pointer to corner points (StarView (is not read from disk!)) - friend SvStream& ReadPolyType(SvStream& rIStream, PolyType& rPoly); - virtual void Draw(OutputDevice& rOut) override; -}; -#define PolyClosBit 0x01 // kinds of Poly: 0: polyLine 1: polygon - -#define SplnSize 44 -class SplnType: public ObjkType { // identical to Poly ! -public: - sal_uInt8 Flags; // (cheat due to alignment in NT) - sal_uInt8 LEnden; // only for nSpline - ObjLineType L; - ObjAreaType F; // not for nSpline - sal_uInt8 nPoints; - sal_uInt8 Reserve; - sal_uInt32 SD_EckP; // pointer to corner points (StarDraw) - PointType* EckP; // pointer to corner points (StarView (is not read from disk!)) - friend SvStream& ReadSplnType(SvStream& rIStream, SplnType& rSpln); - virtual void Draw(OutputDevice& rOut) override; -}; -// kinds of Spline: see Poly - -#define CircSize 52 -class CircType: public ObjkType { -public: - sal_uInt8 Flags; // (cheat due to alignment in NT) - sal_uInt8 LEnden; // only arcs (circle & ellips) - ObjLineType L; - ObjAreaType F; // not for arcs (circle & ellips) - PointType Center; // center - PointType Radius; // radius - sal_uInt16 RotationAngle; // only ellipses - sal_uInt16 StartAngle; // and not for full circles - sal_uInt16 RelAngle; // and full ellipses - friend SvStream& ReadCircType(SvStream& rIStream, CircType& rCirc); - virtual void Draw(OutputDevice& rOut) override; -}; -#define CircFull 0x00 /* kinds of circle: 0: full circle */ -#define CircSect 0x01 /* 1: circle sector */ -#define CircAbsn 0x02 /* 2: circle segment */ -#define CircArc 0x03 /* 3: circle arc */ - -#define TextSize 116 -class TextType: public ObjkType { -public: - sal_uInt8 Flags; // (cheat due to alignment in NT) - sal_uInt8 Reserve; // for Word Allign - ObjTextType T; // 64 bytes << DWord-Allign needed for FontID - PointType Pos1; // reference point (upper left) - PointType Pos2; // (lower right) - sal_Int16 TopOfs; // from upper side to start of text (future for vJustify) - sal_uInt16 RotationAngle; // 0...<360 - sal_uInt16 BoxSlant; // >270...<90 (only Box) - sal_uInt16 BufSize; // size of buffer for Load, Save, Copy etc. - sal_uInt16 BufLo,BufHi; // (UCHAR*) pointer to Textbuffer << ShortArr, otherwise DWord-Allign needed - sal_uInt16 ExtLo,ExtHi; // (Ptr) text over more frames << ShortArr, otherwise DWord-Allign needed - PointType FitSize; // size of origin for Fit2Size - sal_Int16 FitBreit; // width to format for Fit2Size - UCHAR* Buffer; // this variable is not set by reading from disk, but explicit! - friend SvStream& ReadTextType(SvStream& rIStream, TextType& rText); - virtual void Draw(OutputDevice& rOut) override; -}; -#define TextOutlBit 0x01 /* 1=Sourcecode for outliner (ignored byDrawObjekt()) */ -#define TextFitSBit 0x02 /* Bit1: 1=Text-Fit2Size, also outliner (2.0) */ -#define TextFitZBit 0x08 /* Bit3: 1=Fit2Size line by line (2.0) */ -#define TextFitBits (TextFitSBit | TextFitZBit) - -enum GrafStat {NoGraf,Pic,Pcx,Hpgl,Img,Msp,Tiff,Dxf,Lot,Usr,Sgf}; - -#define BmapSize 132 -class BmapType: public ObjkType { -public: - sal_uInt8 Flags; // (cheat due to alignment in NT) - sal_uInt8 Reserve; - ObjAreaType F; // colour and pattern of first plane bitmap - PointType Pos1; - PointType Pos2; - sal_uInt16 RotationAngle;// 315...<45 (future) - sal_uInt16 Slant; // >270...<90 (future) - UCHAR Filename[80]; // path - PointType PixSize; // size in Pixel (0 for vector) - GrafStat Format; // see: GpmDef.Pas - sal_uInt8 nPlanes; // number of bitplanes (0 for vector) - bool RawOut; // output as raw ? - bool InvOut; // output inverted ? - bool LightOut; // brighten? (SD20) - sal_uInt8 GrfFlg; // (SD20) 0=nSGF 1=Pcx 2=HPGL 4=Raw $FF=Undef (to fix DrawBmp) - INetURLObject aFltPath; // for GraphicFilter - - BmapType() - : Flags(0) - , Reserve(0) - , RotationAngle(0) - , Slant(0) - , Format(NoGraf) - , nPlanes(0) - , RawOut(false) - , InvOut(false) - , LightOut(false) - , GrfFlg(0) - { - memset(Filename, 0, sizeof(Filename)); - } - - friend SvStream& ReadBmapType(SvStream& rIStream, BmapType& rBmap); - virtual void Draw(OutputDevice& rOut) override; -}; - -#define GrupSize 48 -class GrupType: public ObjkType { -public: - sal_uInt8 Flags; // (cheat due to alignment in NT) - UCHAR Name[13]; // name of group - sal_uInt16 SbLo,SbHi; // (Ptr) group list << ShortArr, as otherwise DWord alignment needed - sal_uInt16 UpLo,UpHi; // (Ptr) parent list << ShortArr, as otherwise DWord alignment needed - sal_uInt16 ChartSize; // required amount of memory for structure of diagram structure - sal_uInt32 ChartPtr; // diagram structure - sal_uInt32 GetSubPtr(); // only to check if Sublist is empty - friend SvStream& ReadGrupType(SvStream& rIStream, GrupType& rGrup); -}; - -void SetLine(ObjLineType& rLine, OutputDevice& rOut); -void SetArea(ObjAreaType& rArea, OutputDevice& rOut); -Color Sgv2SvFarbe(sal_uInt8 nFrb1, sal_uInt8 nFrb2, sal_uInt8 nInts); -void RotatePoint(PointType& P, sal_Int16 cx, sal_Int16 cy, double sn, double cs); -void RotatePoint(Point& P, sal_Int16 cx, sal_Int16 cy, double sn, double cs); -sal_Int16 iMulDiv(sal_Int16 a, sal_Int16 Mul, sal_Int16 Div); -sal_uInt16 MulDiv(sal_uInt16 a, sal_uInt16 Mul, sal_uInt16 Div); - -class SgfFontOne { -public: - SgfFontOne* Next; // pointer to list - sal_uInt32 IFID; - bool Bold; - bool Ital; - bool Sans; - bool Serf; - bool Fixd; - FontFamily SVFamil; - rtl_TextEncoding SVChSet; - OUString SVFName; // e.g. "Times New Roman" = 15 chars - sal_uInt16 SVWidth; // average character width in % - SgfFontOne(); - void ReadOne(const OString& rID, OString& rDsc); -}; - -class SgfFontLst { -public: - OUString FNam; // complete filename of the Ini-file - SgfFontOne* pList; // start of list - SgfFontOne* Last; // end of list - sal_uInt32 LastID; // for faster access during repeats - SgfFontOne* LastLn; // for faster access during repeats - bool Tried; - SgfFontLst(); - ~SgfFontLst(); - void AssignFN(const OUString& rFName); - void ReadList(); - void RausList(); - SgfFontOne* GetFontDesc(sal_uInt32 ID); -}; - -#endif // INCLUDED_VCL_SOURCE_FILTER_SGVMAIN_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/filter/sgvspln.cxx b/vcl/source/filter/sgvspln.cxx index 762e310eb55e..6a55591f64a0 100644 --- a/vcl/source/filter/sgvspln.cxx +++ b/vcl/source/filter/sgvspln.cxx @@ -20,7 +20,7 @@ #include <tools/poly.hxx> #include <memory> -#include <sgvspln.hxx> +#include "filter/sgvspln.hxx" #include <cmath> #if defined(ANDROID) diff --git a/vcl/source/filter/sgvspln.hxx b/vcl/source/filter/sgvspln.hxx deleted file mode 100644 index 906dbe2c6f47..000000000000 --- a/vcl/source/filter/sgvspln.hxx +++ /dev/null @@ -1,46 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_VCL_SOURCE_FILTER_SGVSPLN_HXX -#define INCLUDED_VCL_SOURCE_FILTER_SGVSPLN_HXX - -/* - * Calculates the coefficients of parametrised natural or periodic cubic - * polynom-splines. The corner points of the polygon passed are used as - * support points. n returns the number of partial polynoms. This function - * returns TRUE if no error occurred. Only in this case memory for the - * coefficient array has been allocated, which can be freed by the caller - * using a delete. - */ -bool CalcSpline(tools::Polygon& rPoly, bool Periodic, sal_uInt16& n, - double*& ax, double*& ay, double*& bx, double*& by, - double*& cx, double*& cy, double*& dx, double*& dy, double*& T); - -/* - * Converts a parametrised cubic spline (natural or periodic) to an approximate - * polygon. The function returns false, if an error occurred during the - * calculation of the coefficients or the polygon became too large (>PolyMax=16380). - * In the first case the polygon has 0, in the second case PolyMax points. - * To prevent coordinate overflows we limit them to +/-32000. - */ -bool Spline2Poly(tools::Polygon& rSpln, bool Periodic, tools::Polygon& rPoly); - -#endif // INCLUDED_VCL_SOURCE_FILTER_SGVSPLN_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/filter/sgvtext.cxx b/vcl/source/filter/sgvtext.cxx index 976683b5dd42..43594624366c 100644 --- a/vcl/source/filter/sgvtext.cxx +++ b/vcl/source/filter/sgvtext.cxx @@ -25,9 +25,9 @@ #include <tools/config.hxx> #include <tools/fract.hxx> #include <vcl/graphicfilter.hxx> -#include "sgffilt.hxx" -#include "sgfbram.hxx" -#include "sgvmain.hxx" +#include "filter/sgffilt.hxx" +#include "filter/sgfbram.hxx" +#include "filter/sgvmain.hxx" #include <memory> #include <cstdlib> diff --git a/vcl/source/filter/wmf/emfwr.cxx b/vcl/source/filter/wmf/emfwr.cxx index 15375dd10394..93872578e5f1 100644 --- a/vcl/source/filter/wmf/emfwr.cxx +++ b/vcl/source/filter/wmf/emfwr.cxx @@ -21,7 +21,7 @@ #include <algorithm> -#include "emfwr.hxx" +#include "filter/emfwr.hxx" #include <rtl/strbuf.hxx> #include <tools/helpers.hxx> #include <tools/fract.hxx> diff --git a/vcl/source/filter/wmf/emfwr.hxx b/vcl/source/filter/wmf/emfwr.hxx deleted file mode 100644 index a7aa6fb3aab5..000000000000 --- a/vcl/source/filter/wmf/emfwr.hxx +++ /dev/null @@ -1,117 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_VCL_SOURCE_FILTER_WMF_EMFWR_HXX -#define INCLUDED_VCL_SOURCE_FILTER_WMF_EMFWR_HXX - -#include <vcl/metaact.hxx> -#include <vcl/graph.hxx> -#include <vcl/gdimtf.hxx> -#include <vcl/virdev.hxx> -#include <vcl/fltcall.hxx> - -class LineInfo; -namespace basegfx { class B2DPolygon; } - -class EMFWriter -{ -private: - - ScopedVclPtr<VirtualDevice> maVDev; - MapMode maDestMapMode; - SvStream& m_rStm; - bool* mpHandlesUsed; - sal_uLong mnHandleCount; - sal_uLong mnRecordCount; - sal_uLong mnRecordPos; - sal_uLong mnRecordPlusPos; - bool mbRecordOpen; - bool mbRecordPlusOpen; - bool mbLineChanged; - sal_uInt32 mnLineHandle; - bool mbFillChanged; - sal_uInt32 mnFillHandle; - bool mbTextChanged; - sal_uInt32 mnTextHandle; - sal_uInt32 mnHorTextAlign; - - void ImplBeginRecord( sal_uInt32 nType ); - void ImplEndRecord(); - void ImplBeginPlusRecord( sal_uInt16 nType, sal_uInt16 nFlags ); - void ImplEndPlusRecord(); - void ImplPlusRecord( sal_uInt16 nType, sal_uInt16 nFlags ); - void ImplBeginCommentRecord( sal_Int32 nCommentType ); - void ImplEndCommentRecord(); - - sal_uLong ImplAcquireHandle(); - void ImplReleaseHandle( sal_uLong nHandle ); - - bool ImplPrepareHandleSelect( sal_uInt32& rHandle, sal_uLong nSelectType ); - void ImplCheckLineAttr(); - void ImplCheckFillAttr(); - void ImplCheckTextAttr(); - - void ImplWriteColor( const Color& rColor ); - void ImplWriteRasterOp( RasterOp eRop ); - void ImplWriteExtent( long nExtent ); - void ImplWritePoint( const Point& rPoint ); - void ImplWriteSize( const Size& rSize); - void ImplWriteRect( const Rectangle& rRect ); - void ImplWritePath( const tools::PolyPolygon& rPolyPoly, bool bClose ); - void ImplWritePolygonRecord( const tools::Polygon& rPoly, bool bClose ); - void ImplWritePolyPolygonRecord( const tools::PolyPolygon& rPolyPoly ); - void ImplWriteBmpRecord( const Bitmap& rBmp, const Point& rPt, const Size& rSz, sal_uInt32 nROP ); - void ImplWriteTextRecord( const Point& rPos, const OUString& rText, const long* pDXArray, sal_uInt32 nWidth ); - - void Impl_handleLineInfoPolyPolygons(const LineInfo& rInfo, const basegfx::B2DPolygon& rLinePolygon); - void ImplWrite( const GDIMetaFile& rMtf ); - void WriteEMFPlusHeader( const Size &rMtfSizePix, const Size &rMtfSizeLog ); - void ImplWritePlusEOF(); - void ImplWritePlusFillPolygonRecord( const tools::Polygon& rPoly, const sal_uInt32& nTrans ); - void ImplWritePlusColor( const Color& rColor, const sal_uInt32& nTrans ); - void ImplWritePlusPoint( const Point& rPoint ); - -public: - - explicit EMFWriter(SvStream &rStream) - : maVDev( VclPtr<VirtualDevice>::Create() ) - , m_rStm(rStream) - , mpHandlesUsed(nullptr) - , mnHandleCount(0) - , mnRecordCount(0) - , mnRecordPos(0) - , mnRecordPlusPos(0) - , mbRecordOpen(false) - , mbRecordPlusOpen(false) - , mbLineChanged(false) - , mnLineHandle(0) - , mbFillChanged(false) - , mnFillHandle(0) - , mbTextChanged(false) - , mnTextHandle(0) - , mnHorTextAlign(0) - { - } - - bool WriteEMF(const GDIMetaFile& rMtf); -}; - -#endif // INCLUDED_VCL_SOURCE_FILTER_WMF_EMFWR_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/filter/wmf/enhwmf.cxx b/vcl/source/filter/wmf/enhwmf.cxx index 989e0aa9efeb..f10edd2eec82 100644 --- a/vcl/source/filter/wmf/enhwmf.cxx +++ b/vcl/source/filter/wmf/enhwmf.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "winmtf.hxx" +#include "filter/winmtf.hxx" #include <osl/endian.h> #include <basegfx/matrix/b2dhommatrix.hxx> #include <vcl/dibtools.hxx> diff --git a/vcl/source/filter/wmf/winmtf.cxx b/vcl/source/filter/wmf/winmtf.cxx index c19642ad9fb5..baa810d31426 100644 --- a/vcl/source/filter/wmf/winmtf.cxx +++ b/vcl/source/filter/wmf/winmtf.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "winmtf.hxx" +#include "filter/winmtf.hxx" #include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/polygon/b2dpolypolygontools.hxx> #include <vcl/metaact.hxx> diff --git a/vcl/source/filter/wmf/winmtf.hxx b/vcl/source/filter/wmf/winmtf.hxx deleted file mode 100644 index dc8074fb6e91..000000000000 --- a/vcl/source/filter/wmf/winmtf.hxx +++ /dev/null @@ -1,823 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_VCL_SOURCE_FILTER_WMF_WINMTF_HXX -#define INCLUDED_VCL_SOURCE_FILTER_WMF_WINMTF_HXX - -#include <sal/config.h> - -#include <vcl/graph.hxx> -#include <basegfx/tools/b2dclipstate.hxx> -#include <vcl/font.hxx> -#include <vcl/bmpacc.hxx> -#include <vcl/lineinfo.hxx> -#include <vcl/fltcall.hxx> - -#define ERROR 0 -#define NULLREGION 1 -#define COMPLEXREGION 3 - -#define RGN_AND 1 -#define RGN_OR 2 -#define RGN_XOR 3 -#define RGN_DIFF 4 -#define RGN_COPY 5 - -enum class BkMode -{ - NONE = 0, - Transparent = 1, - OPAQUE = 2, - LAST = 2 -}; - -/* xform stuff */ -#define MWT_IDENTITY 1 -#define MWT_LEFTMULTIPLY 2 -#define MWT_RIGHTMULTIPLY 3 -#define MWT_SET 4 - -#define ENHMETA_STOCK_OBJECT 0x80000000 - -/* Stock Logical Objects */ -#define WHITE_BRUSH 0 -#define LTGRAY_BRUSH 1 -#define GRAY_BRUSH 2 -#define DKGRAY_BRUSH 3 -#define BLACK_BRUSH 4 -#define NULL_BRUSH 5 -#define WHITE_PEN 6 -#define BLACK_PEN 7 -#define NULL_PEN 8 -#define ANSI_FIXED_FONT 11 -#define ANSI_VAR_FONT 12 -#define SYSTEM_FIXED_FONT 16 - -#define R2_BLACK 1 -#define R2_MASKNOTPEN 3 -#define R2_NOT 6 -#define R2_XORPEN 7 -#define R2_NOP 11 -#define R2_COPYPEN 13 - -/* Mapping modes */ -#define MM_TEXT 1 -#define MM_LOMETRIC 2 -#define MM_HIMETRIC 3 -#define MM_LOENGLISH 4 -#define MM_HIENGLISH 5 -#define MM_TWIPS 6 -#define MM_ISOTROPIC 7 -#define MM_ANISOTROPIC 8 - -/* Graphics modes */ -#define GM_COMPATIBLE 1 -#define GM_ADVANCED 2 - -/* StretchBlt() modes */ -#define BLACKONWHITE 1 -#define WHITEONBLACK 2 -#define COLORONCOLOR 3 -#define HALFTONE 4 -#define STRETCH_ANDSCANS BLACKONWHITE -#define STRETCH_ORSCANS WHITEONBLACK -#define STRETCH_DELETESCANS COLORONCOLOR - -#define LF_FACESIZE 32 - -struct LOGFONTW -{ - sal_Int32 lfHeight; - sal_Int32 lfWidth; - sal_Int32 lfEscapement; - sal_Int32 lfOrientation; - sal_Int32 lfWeight; - sal_uInt8 lfItalic; - sal_uInt8 lfUnderline; - sal_uInt8 lfStrikeOut; - sal_uInt8 lfCharSet; - sal_uInt8 lfOutPrecision; - sal_uInt8 lfClipPrecision; - sal_uInt8 lfQuality; - sal_uInt8 lfPitchAndFamily; - OUString alfFaceName; -}; -struct WMF_EXTERNALHEADER; - -#define TA_NOUPDATECP 0x0000 -#define TA_UPDATECP 0x0001 -#define TA_LEFT 0x0000 -#define TA_RIGHT 0x0002 -#define TA_CENTER 0x0006 -#define TA_RIGHT_CENTER (TA_RIGHT | TA_CENTER) -#define TA_TOP 0x0000 -#define TA_BOTTOM 0x0008 -#define TA_BASELINE 0x0018 - -#define SRCCOPY 0x00CC0020L -#define SRCPAINT 0x00EE0086L -#define SRCAND 0x008800C6L -#define SRCINVERT 0x00660046L -#define SRCERASE 0x00440328L -#define PATCOPY 0x00F00021L -#define PATINVERT 0x005A0049L -#define BLACKNESS 0x00000042L -#define WHITENESS 0x00FF0062L - -#define PS_SOLID 0 -#define PS_DASH 1 -#define PS_DOT 2 -#define PS_DASHDOT 3 -#define PS_DASHDOTDOT 4 -#define PS_NULL 5 -#define PS_INSIDEFRAME 6 -#define PS_STYLE_MASK 15 - -#define PS_ENDCAP_ROUND 0x000 -#define PS_ENDCAP_SQUARE 0x100 -#define PS_ENDCAP_FLAT 0x200 - -#define PS_JOIN_ROUND 0x0000 -#define PS_JOIN_BEVEL 0x1000 -#define PS_JOIN_MITER 0x2000 - - -#define ANSI_CHARSET 0 -#define DEFAULT_CHARSET 1 -#define SYMBOL_CHARSET 2 -#define SHIFTJIS_CHARSET 128 -#define HANGEUL_CHARSET 129 -#define GB2312_CHARSET 134 -#define CHINESEBIG5_CHARSET 136 -#define OEM_CHARSET 255 -/*WINVER >= 0x0400*/ -#define JOHAB_CHARSET 130 -#define HEBREW_CHARSET 177 -#define ARABIC_CHARSET 178 -#define GREEK_CHARSET 161 -#define TURKISH_CHARSET 162 -#define VIETNAMESE_CHARSET 163 -#define THAI_CHARSET 222 -#define EASTEUROPE_CHARSET 238 -#define RUSSIAN_CHARSET 204 -#define MAC_CHARSET 77 -#define BALTIC_CHARSET 186 - -#define ETO_CLIPPED 0x0004 -/*WINVER >= 0x0400*/ -#define ETO_GLYPH_INDEX 0x0010 -#define ETO_RTLREADING 0x0080 -/*_WIN32_WINNT >= 0x0500*/ -#define ETO_PDY 0x2000 - -#define DEFAULT_PITCH 0x00 -#define FIXED_PITCH 0x01 -#define VARIABLE_PITCH 0x02 - -/* Font Families */ -#define FF_DONTCARE 0x00 -#define FF_ROMAN 0x10 -#define FF_SWISS 0x20 -#define FF_MODERN 0x30 -#define FF_SCRIPT 0x40 -#define FF_DECORATIVE 0x50 - -#define FW_THIN 100 -#define FW_EXTRALIGHT 200 -#define FW_LIGHT 300 -#define FW_NORMAL 400 -#define FW_MEDIUM 500 -#define FW_SEMIBOLD 600 -#define FW_BOLD 700 -#define FW_EXTRABOLD 800 -#define FW_ULTRALIGHT 200 -#define FW_ULTRABOLD 800 -#define FW_BLACK 900 - -#define BS_SOLID 0 -#define BS_NULL 1 -#define BS_HOLLOW 1 -#define BS_HATCHED 2 -#define BS_PATTERN 3 -#define BS_INDEXED 4 -#define BS_DIBPATTERN 5 -#define BS_DIBPATTERNPT 6 -#define BS_PATTERN8X8 7 -#define BS_DIBPATTERN8X8 8 -#define BS_MONOPATTERN 9 - - -#define RDH_RECTANGLES 1 - -#define W_MFCOMMENT 15 - -#define PRIVATE_ESCAPE_UNICODE 2 - -//Scalar constants - -#define UNDOCUMENTED_WIN_RCL_RELATION 32 -#define MS_FIXPOINT_BITCOUNT_28_4 4 -#define HUNDREDTH_MILLIMETERS_PER_MILLIINCH 2.54 -#define MILLIINCH_PER_TWIPS 1.44 - -//============================ WMFReader ================================== - -class WinMtfClipPath -{ - basegfx::tools::B2DClipState maClip; - -public: - WinMtfClipPath(): maClip() {}; - - void setClipPath( const tools::PolyPolygon& rPolyPolygon, sal_Int32 nClippingMode ); - void intersectClipRect( const Rectangle& rRect ); - void excludeClipRect( const Rectangle& rRect ); - void moveClipRegion( const Size& rSize ); - void setDefaultClipPath(); - - bool isEmpty() const { return maClip.isCleared(); } - - basegfx::B2DPolyPolygon getClipPath() const; - - bool operator==( const WinMtfClipPath& rPath ) const - { - return maClip == rPath.maClip; - }; -}; - -class WinMtfPathObj : public tools::PolyPolygon -{ - bool bClosed; - -public: - - WinMtfPathObj() : - bClosed(true) - {} - - void Init() - { - Clear(); - bClosed = true; - } - - void ClosePath(); - void AddPoint( const Point& rPoint ); - void AddPolygon( const tools::Polygon& rPoly ); - void AddPolyLine( const tools::Polygon& rPoly ); - void AddPolyPolygon( const tools::PolyPolygon& rPolyPolygon ); -}; - -struct WinMtfFontStyle -{ - vcl::Font aFont; - - explicit WinMtfFontStyle( LOGFONTW& rLogFont ); -}; - - -typedef enum -{ - FillStyleSolid, - FillStylePattern -} WinMtfFillStyleType; - -struct WinMtfFillStyle -{ - Color aFillColor; - bool bTransparent; - WinMtfFillStyleType aType; - Bitmap aBmp; - - WinMtfFillStyle() - : aFillColor(Color(COL_BLACK)) - , bTransparent(false) - , aType(FillStyleSolid) - {} - - WinMtfFillStyle(const Color& rColor, bool bTrans = false) - : aFillColor(rColor) - , bTransparent(bTrans) - , aType(FillStyleSolid) - {} - - explicit WinMtfFillStyle(Bitmap& rBmp) - : bTransparent(false) - , aType(FillStylePattern) - , aBmp(rBmp) - {} - - bool operator==( const WinMtfFillStyle& rStyle ) - { - return aFillColor == rStyle.aFillColor - && bTransparent == rStyle.bTransparent - && aType == rStyle.aType; - } - - bool operator==(WinMtfFillStyle* pStyle) - { - return aFillColor == pStyle->aFillColor - && bTransparent == pStyle->bTransparent - && aType == pStyle->aType; - } - - WinMtfFillStyle& operator=(const WinMtfFillStyle& rStyle) - { - aFillColor = rStyle.aFillColor; - bTransparent = rStyle.bTransparent; - aBmp = rStyle.aBmp; - aType = rStyle.aType; - return *this; - } - - WinMtfFillStyle& operator=(WinMtfFillStyle* pStyle) - { - aFillColor = pStyle->aFillColor; - bTransparent = pStyle->bTransparent; - aBmp = pStyle->aBmp; - aType = pStyle->aType; - return *this; - } -}; - -struct WinMtfLineStyle -{ - Color aLineColor; - LineInfo aLineInfo; - bool bTransparent; - - WinMtfLineStyle() - : aLineColor (COL_BLACK) - , bTransparent(false) - {} - - WinMtfLineStyle(const Color& rColor, bool bTrans = false) - : aLineColor (rColor) - , bTransparent(bTrans) - {} - - WinMtfLineStyle( const Color& rColor, const LineInfo& rStyle, bool bTrans = false) - : aLineColor (rColor) - , aLineInfo (rStyle) - , bTransparent(bTrans) - {} - - bool operator==( const WinMtfLineStyle& rStyle ) - { - return aLineColor == rStyle.aLineColor - && bTransparent == rStyle.bTransparent - && aLineInfo == rStyle.aLineInfo; - } - - bool operator==(WinMtfLineStyle* pStyle) - { - return aLineColor == pStyle->aLineColor - && bTransparent == pStyle->bTransparent - && aLineInfo == pStyle->aLineInfo; - } - - WinMtfLineStyle& operator=( const WinMtfLineStyle& rStyle ) - { - aLineColor = rStyle.aLineColor; - bTransparent = rStyle.bTransparent; - aLineInfo = rStyle.aLineInfo; - return *this; - } - - WinMtfLineStyle& operator=( WinMtfLineStyle* pStyle ) - { - aLineColor = pStyle->aLineColor; - bTransparent = pStyle->bTransparent; - aLineInfo = pStyle->aLineInfo; - return *this; - } -}; - -struct XForm -{ - float eM11; - float eM12; - float eM21; - float eM22; - float eDx; - float eDy; - - XForm() - : eM11(1.0f) - , eM12(0.0f) - , eM21(0.0f) - , eM22(1.0f) - , eDx(0.0f) - , eDy(0.0f) - {} -}; - -struct SaveStruct -{ - BkMode nBkMode; - sal_uInt32 nMapMode, nGfxMode; - ComplexTextLayoutMode nTextLayoutMode; - sal_Int32 nWinOrgX, nWinOrgY, nWinExtX, nWinExtY; - sal_Int32 nDevOrgX, nDevOrgY, nDevWidth, nDevHeight; - - WinMtfLineStyle aLineStyle; - WinMtfFillStyle aFillStyle; - - vcl::Font aFont; - Color aBkColor; - Color aTextColor; - sal_uInt32 nTextAlign; - RasterOp eRasterOp; - - Point aActPos; - WinMtfPathObj aPathObj; - WinMtfClipPath aClipPath; - XForm aXForm; - - bool bFillStyleSelected; -}; - -typedef std::shared_ptr<SaveStruct> SaveStructPtr; - -struct BSaveStruct -{ - Bitmap aBmp; - Rectangle aOutRect; - sal_uInt32 nWinRop; - - BSaveStruct(const Bitmap& rBmp, const Rectangle& rOutRect, - sal_uInt32 nRop) - : aBmp(rBmp) - , aOutRect(rOutRect) - , nWinRop(nRop) - {} -}; - -typedef ::std::vector< BSaveStruct* > BSaveStructList_impl; - -enum GDIObjectType -{ - GDI_DUMMY = 0, - GDI_PEN = 1, - GDI_BRUSH = 2, - GDI_FONT = 3, - GDI_PALETTE = 4, - GDI_BITMAP = 5, - GDI_REGION = 6 -}; - -struct GDIObj -{ - void* pStyle; - GDIObjectType eType; - - GDIObj() - : pStyle (nullptr) - , eType (GDI_DUMMY) - {} - - GDIObj(GDIObjectType eT, void* pS) - { - pStyle = pS; - eType = eT; - } - - void Set(GDIObjectType eT, void* pS) - { - pStyle = pS; - eType = eT; - } - - void Delete() - { - if (pStyle == nullptr) - return; - - switch (eType) - { - case GDI_PEN : - delete static_cast<WinMtfLineStyle*>(pStyle); - break; - case GDI_BRUSH : - delete static_cast<WinMtfFillStyle*>(pStyle); - break; - case GDI_FONT : - delete static_cast<WinMtfFontStyle*>(pStyle); - break; - - default: - OSL_FAIL( "unsupported style deleted" ); - break; - } - pStyle = nullptr; - } - - ~GDIObj() - { - Delete(); - } -}; - -class WinMtfOutput -{ - WinMtfPathObj aPathObj; - WinMtfClipPath aClipPath; - - WinMtfLineStyle maLatestLineStyle; - WinMtfLineStyle maLineStyle; - WinMtfLineStyle m_NopLineStyle; - WinMtfFillStyle maLatestFillStyle; - WinMtfFillStyle maFillStyle; - WinMtfFillStyle m_NopFillStyle; - vcl::Font maLatestFont; - vcl::Font maFont; - sal_uInt32 mnLatestTextAlign; - sal_uInt32 mnTextAlign; - Color maLatestTextColor; - Color maTextColor; - Color maLatestBkColor; - Color maBkColor; - ComplexTextLayoutMode mnLatestTextLayoutMode; - ComplexTextLayoutMode mnTextLayoutMode; - BkMode mnLatestBkMode; - BkMode mnBkMode; - RasterOp meLatestRasterOp; - RasterOp meRasterOp; - - std::vector< GDIObj* > vGDIObj; - - Point maActPos; - - sal_uInt32 mnRop; - bool mbNopMode; - bool mbFillStyleSelected; - bool mbClipNeedsUpdate; - bool mbComplexClip; - - std::vector< SaveStructPtr > vSaveStack; - - sal_uInt32 mnGfxMode; - sal_uInt32 mnMapMode; - - XForm maXForm; - sal_Int32 mnDevOrgX, mnDevOrgY; - sal_Int32 mnDevWidth, mnDevHeight; - sal_Int32 mnWinOrgX, mnWinOrgY; // aktuel window origin - sal_Int32 mnWinExtX, mnWinExtY; // aktuel window extend - bool mbIsMapWinSet; - bool mbIsMapDevSet; - - sal_Int32 mnPixX, mnPixY; // Reference Device in pixel - sal_Int32 mnMillX, mnMillY; // Reference Device in Mill - Rectangle mrclFrame; // rectangle in logical units 1/100th mm - Rectangle mrclBounds; - - GDIMetaFile* mpGDIMetaFile; - - void UpdateLineStyle(); - void UpdateFillStyle(); - - Point ImplMap( const Point& rPt ); - Point ImplScale( const Point& rPt ); - Size ImplMap( const Size& rSize, bool bDoWorldTransform = true); - Rectangle ImplMap( const Rectangle& rRectangle ); - void ImplMap( vcl::Font& rFont ); - tools::Polygon& ImplMap( tools::Polygon& rPolygon ); - tools::PolyPolygon& ImplMap( tools::PolyPolygon& rPolyPolygon ); - tools::Polygon& ImplScale( tools::Polygon& rPolygon ); - tools::PolyPolygon& ImplScale( tools::PolyPolygon& rPolyPolygon ); - void ImplResizeObjectArry( sal_uInt32 nNewEntry ); - void ImplSetNonPersistentLineColorTransparenz(); - void ImplDrawClippedPolyPolygon( const tools::PolyPolygon& rPolyPoly ); - void ImplDrawBitmap( const Point& rPos, const Size& rSize, const BitmapEx& rBitmap ); - -public: - - void SetDevByWin(); //Hack to set varying defaults for incompletely defined files. - void SetDevOrg( const Point& rPoint ); - void SetDevOrgOffset( sal_Int32 nXAdd, sal_Int32 nYAdd ); - void SetDevExt( const Size& rSize ,bool regular = true); - void ScaleDevExt( double fX, double fY ); - - void SetWinOrg( const Point& rPoint , bool bIsEMF = false); - void SetWinOrgOffset( sal_Int32 nX, sal_Int32 nY ); - void SetWinExt( const Size& rSize , bool bIsEMF = false); - void ScaleWinExt( double fX, double fY ); - - void SetrclBounds( const Rectangle& rRect ); - void SetrclFrame( const Rectangle& rRect ); - void SetRefPix( const Size& rSize ); - void SetRefMill( const Size& rSize ); - - void SetMapMode( sal_uInt32 mnMapMode ); - void SetWorldTransform( const XForm& rXForm ); - void ModifyWorldTransform( const XForm& rXForm, sal_uInt32 nMode ); - - void Push(); - void Pop(); - - sal_uInt32 SetRasterOp( sal_uInt32 nRasterOp ); - void StrokeAndFillPath( bool bStroke, bool bFill ); - - void SetGfxMode( sal_Int32 nGfxMode ){ mnGfxMode = nGfxMode; }; - sal_Int32 GetGfxMode() const { return mnGfxMode; }; - void SetBkMode( BkMode nMode ); - void SetBkColor( const Color& rColor ); - void SetTextColor( const Color& rColor ); - void SetTextAlign( sal_uInt32 nAlign ); - void CreateObject( GDIObjectType, void* pStyle = nullptr ); - void CreateObject( sal_Int32 nIndex, GDIObjectType, void* pStyle = nullptr ); - void DeleteObject( sal_Int32 nIndex ); - void SelectObject( sal_Int32 nIndex ); - rtl_TextEncoding GetCharSet(){ return maFont.GetCharSet(); }; - WinMtfFillStyle& GetFillStyle () { return maFillStyle; } - const vcl::Font& GetFont() const { return maFont;} - void SetTextLayoutMode( ComplexTextLayoutMode nLayoutMode ); - - void ClearPath(){ aPathObj.Init(); }; - void ClosePath(){ aPathObj.ClosePath(); }; - const tools::PolyPolygon& GetPathObj(){ return aPathObj; }; - - void MoveTo( const Point& rPoint, bool bRecordPath = false ); - void LineTo( const Point& rPoint, bool bRecordPath = false ); - void DrawPixel( const Point& rSource, const Color& rColor ); - void DrawRect( const Rectangle& rRect, bool bEdge = true ); - void DrawRoundRect( const Rectangle& rRect, const Size& rSize ); - void DrawEllipse( const Rectangle& rRect ); - void DrawArc( - const Rectangle& rRect, - const Point& rStartAngle, - const Point& rEndAngle, - bool bDrawTo = false - ); - void DrawPie( - const Rectangle& rRect, - const Point& rStartAngle, - const Point& rEndAngle - ); - void DrawChord( - const Rectangle& rRect, - const Point& rStartAngle, - const Point& rEndAngle - ); - void DrawPolygon( tools::Polygon& rPolygon, bool bRecordPath = false ); - void DrawPolygon( tools::Polygon& rPolygon, bool /*bDrawTo*/, bool bRecordPath) - { - //For ReadAndDrawPolygon template compatibility - DrawPolygon(rPolygon, bRecordPath); - } - void DrawPolyPolygon( tools::PolyPolygon& rPolyPolygon, bool bRecordPath = false ); - void DrawPolyLine( tools::Polygon& rPolygon, - bool bDrawTo = false, - bool bRecordPath = false - ); - void DrawPolyBezier( tools::Polygon& rPolygin, - bool bDrawTo = false, - bool bRecordPath = false - ); - void DrawText( Point& rPosition, - OUString& rString, - long* pDXArry = nullptr, - bool bRecordPath = false, - sal_Int32 nGraphicsMode = GM_COMPATIBLE); - - void ResolveBitmapActions( BSaveStructList_impl& rSaveList ); - - void IntersectClipRect( const Rectangle& rRect ); - void ExcludeClipRect( const Rectangle& rRect ); - void MoveClipRegion( const Size& rSize ); - void SetClipPath( - const tools::PolyPolygon& rPolyPoly, - sal_Int32 nClippingMode, - bool bIsMapped - ); - void SetDefaultClipPath(); - void UpdateClipRegion(); - void AddFromGDIMetaFile( GDIMetaFile& rGDIMetaFile ); - - void PassEMFPlus( void* pBuffer, sal_uInt32 nLength ); - void PassEMFPlusHeaderInfo(); - - explicit WinMtfOutput( GDIMetaFile& rGDIMetaFile ); - virtual ~WinMtfOutput(); -}; - -class WinMtf -{ -protected: - - WinMtfOutput* pOut; - SvStream* pWMF; // the WMF/EMF file to be read - - sal_uInt32 nStartPos, nEndPos; - BSaveStructList_impl aBmpSaveList; - - FilterConfigItem* pFilterConfigItem; - - css::uno::Reference< css::task::XStatusIndicator > xStatusIndicator; - - // assures aSampledBrush is the actual brush of the GDIMetaFile - - Color ReadColor(); - void Callback( sal_uInt16 nPercent ); - - WinMtf( - WinMtfOutput* pOut, - SvStream& rStreamWMF, - FilterConfigItem* pConfigItem = nullptr - ); - ~WinMtf(); -}; - -class EnhWMFReader : public WinMtf -{ - bool bRecordPath; - sal_Int32 nRecordCount; - bool bEMFPlus; - - bool ReadHeader(); - // reads and converts the rectangle - static Rectangle ReadRectangle( sal_Int32, sal_Int32, sal_Int32, sal_Int32 ); - -public: - EnhWMFReader(SvStream& rStreamWMF, GDIMetaFile& rGDIMetaFile, FilterConfigItem* pConfigItem = nullptr); - ~EnhWMFReader(); - - bool ReadEnhWMF(); - void ReadEMFPlusComment(sal_uInt32 length, bool& bHaveDC); -private: - template <class T> void ReadAndDrawPolyPolygon(); - template <class T> void ReadAndDrawPolyLine(); - template <class T> tools::Polygon ReadPolygon(sal_uInt32 nStartIndex, sal_uInt32 nPoints); - template <class T, class Drawer> void ReadAndDrawPolygon(Drawer drawer, const bool skipFirst); - - Rectangle ReadRectangle(); -}; - -class WMFReader : public WinMtf -{ -private: - - sal_uInt16 nUnitsPerInch; - sal_uInt32 nRecSize; - - // embedded EMF data - SvMemoryStream* pEMFStream; - - // total number of comment records containing EMF data - sal_uInt32 nEMFRecCount; - - // number of EMF records read - sal_uInt32 nEMFRec; - - // total size of embedded EMF data - sal_uInt32 nEMFSize; - - sal_uInt32 nSkipActions; - sal_uInt32 nCurrentAction; - sal_uInt32 nUnicodeEscapeAction; - - WMF_EXTERNALHEADER* pExternalHeader; - - // reads header of the WMF-Datei - bool ReadHeader(); - - // reads parameters of the record with the functionnumber nFunction. - void ReadRecordParams( sal_uInt16 nFunction ); - - Point ReadPoint(); // reads and converts a point (first X then Y) - Point ReadYX(); // reads and converts a point (first Y then X) - Rectangle ReadRectangle(); // reads and converts a rectangle - Size ReadYXExt(); - bool GetPlaceableBound( Rectangle& rSize, SvStream* pStrm ); - -public: - - WMFReader(SvStream& rStreamWMF, GDIMetaFile& rGDIMetaFile, - FilterConfigItem* pConfigItem = nullptr, - WMF_EXTERNALHEADER* pExtHeader = nullptr); - ~WMFReader(); - - // read WMF file from stream and fill the GDIMetaFile - void ReadWMF(); -}; - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/filter/wmf/winwmf.cxx b/vcl/source/filter/wmf/winwmf.cxx index a142f765020a..25328b1e7234 100644 --- a/vcl/source/filter/wmf/winwmf.cxx +++ b/vcl/source/filter/wmf/winwmf.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "winmtf.hxx" +#include "filter/winmtf.hxx" #include <memory> #include <boost/optional.hpp> diff --git a/vcl/source/filter/wmf/wmf.cxx b/vcl/source/filter/wmf/wmf.cxx index 1b3972110792..e09e1c0a483f 100644 --- a/vcl/source/filter/wmf/wmf.cxx +++ b/vcl/source/filter/wmf/wmf.cxx @@ -17,9 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "winmtf.hxx" -#include "emfwr.hxx" -#include "wmfwr.hxx" +#include "filter/winmtf.hxx" +#include "filter/emfwr.hxx" +#include "filter/wmfwr.hxx" #include <vcl/wmf.hxx> #include <vcl/gdimetafiletools.hxx> #include <comphelper/scopeguard.hxx> diff --git a/vcl/source/filter/wmf/wmfwr.cxx b/vcl/source/filter/wmf/wmfwr.cxx index 73f0489da7e5..9a58880e2752 100644 --- a/vcl/source/filter/wmf/wmfwr.cxx +++ b/vcl/source/filter/wmf/wmfwr.cxx @@ -21,9 +21,10 @@ #include <algorithm> -#include "wmfwr.hxx" +#include "filter/wmfwr.hxx" +#include "filter/emfwr.hxx" + #include <unotools/fontcvt.hxx> -#include "emfwr.hxx" #include <rtl/crc.h> #include <rtl/strbuf.hxx> #include <rtl/tencinfo.h> diff --git a/vcl/source/filter/wmf/wmfwr.hxx b/vcl/source/filter/wmf/wmfwr.hxx deleted file mode 100644 index 32cf5cf6d1ae..000000000000 --- a/vcl/source/filter/wmf/wmfwr.hxx +++ /dev/null @@ -1,207 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_VCL_SOURCE_FILTER_WMF_WMFWR_HXX -#define INCLUDED_VCL_SOURCE_FILTER_WMF_WMFWR_HXX - -#include <vcl/metaact.hxx> -#include <vcl/graph.hxx> -#include <vcl/gdimtf.hxx> -#include <vcl/virdev.hxx> -#include <vcl/fltcall.hxx> - -#define MAXOBJECTHANDLES 16 - -struct WMFWriterAttrStackMember -{ - struct WMFWriterAttrStackMember * pSucc; - Color aLineColor; - Color aFillColor; - Color aTextColor; - LineInfo aLineInfo; - TextAlign eTextAlign; - RasterOp eRasterOp; - vcl::Font aFont; - MapMode aMapMode; - vcl::Region aClipRegion; - PushFlags nFlags; -}; - -class StarSymbolToMSMultiFont; -class LineInfo; -namespace basegfx { class B2DPolygon; } - -class WMFWriter -{ -private: - - bool bStatus; - - sal_uLong nLastPercent; // with which number pCallback was called last time. - - css::uno::Reference< css::task::XStatusIndicator > xStatusIndicator; - - SvStream* pWMF; - VclPtr<VirtualDevice> pVirDev; - MapMode aTargetMapMode; - Size aTargetSize; - - sal_uLong nMetafileHeaderPos; - sal_uInt32 nMaxRecordSize; // in words - sal_uLong nActRecordPos; - - // actual attribute in source metafile: - Color aSrcLineColor; - Color aSrcFillColor; - Color aSrcTextColor; - LineInfo aSrcLineInfo; - RasterOp eSrcRasterOp; - FontAlign eSrcTextAlign; - vcl::Font aSrcFont; - MapMode aSrcMapMode; - bool bSrcIsClipping; - vcl::Region aSrcClipRegion; - WMFWriterAttrStackMember * pAttrStack; - - sal_uInt16 eSrcHorTextAlign; - - // actual attribute in destination metafile: - Color aDstLineColor; - Color aDstFillColor; - Color aDstTextColor; - LineInfo aDstLineInfo; - RasterOp eDstROP2; - FontAlign eDstTextAlign; - vcl::Font aDstFont; - - sal_uInt16 eDstHorTextAlign; - - bool bDstIsClipping; // ???: not taken into account at the moment - vcl::Region aDstClipRegion; // ???: not taken into account at the moment - bool bHandleAllocated[MAXOBJECTHANDLES]; // which handles have been assigned - sal_uInt16 nDstPenHandle,nDstFontHandle,nDstBrushHandle; // which handles are owned by - // Selected-Objects - // 0xFFFF = none: - - // to prevent we have to compare all attributes at each operation: - - sal_uLong nNumberOfActions; // number of actions in the GDIMetafile - sal_uLong nNumberOfBitmaps; // number of bitmaps - sal_uLong nWrittenActions; // number of processed actions while writing the directory - sal_uLong nWrittenBitmaps; // number of bitmaps written - sal_uLong nActBitmapPercent; // percentage of next bitmap written. - - bool bEmbedEMF; // optionally embed EMF data into WMF - - void MayCallback(); - // this function calculates percentage using the above 5 parameters - // and triggers a callback if needed. Puts bStatus to FALSE if the - // users wants to abort. - - void CountActionsAndBitmaps(const GDIMetaFile & rMTF); - // Counts bitmaps and actions (nNumberOfActions and nNumberOfBitmaps should - // be initialised to 0 at start, as this method is recursive) - - void WritePointXY(const Point & rPoint); - void WritePointYX(const Point & rPoint); - sal_Int32 ScaleWidth( sal_Int32 nDX ); - void WriteSize(const Size & rSize); - void WriteHeightWidth(const Size & rSize); - void WriteRectangle(const Rectangle & rRect); - void WriteColor(const Color & rColor); - - void WriteRecordHeader(sal_uInt32 nSizeWords, sal_uInt16 nType); - // nSizeWords is the size of the all records in number of words. - // If nSizeWords is unknown, then use 0 (see UpdateRecordHeader()) - - void UpdateRecordHeader(); - // returns the size of the record after writing the parameters, if - // nSizeWords was unknown upon calling WriteRecordHeader(..) - // if needed it inserts a BYTE 0 to make number of bytes even - - void WMFRecord_Arc(const Rectangle& rRect, const Point& rStartPt, const Point& rEndPt); - void WMFRecord_Chord(const Rectangle& rRect, const Point& rStartPt, const Point& rEndPt); - void WMFRecord_CreateBrushIndirect(const Color& rColor); - void WMFRecord_CreateFontIndirect(const vcl::Font& rFont); - void WMFRecord_CreatePenIndirect(const Color& rColor, const LineInfo& rLineInfo ); - void WMFRecord_DeleteObject(sal_uInt16 nObjectHandle); - void WMFRecord_Ellipse(const Rectangle& rRect); - void WMFRecord_Escape( sal_uInt32 nEsc, sal_uInt32 nLen, const sal_Int8* pData ); - bool WMFRecord_Escape_Unicode( const Point& rPoint, const OUString& rStr, const long* pDXAry ); - void WMFRecord_ExtTextOut(const Point& rPoint, const OUString& rString, const long* pDXAry); - - void TrueExtTextOut(const Point& rPoint, const OUString& rString, - const OString& rByteString, const long* pDXAry); - void TrueTextOut(const Point& rPoint, const OString& rString); - void WMFRecord_LineTo(const Point & rPoint); - void WMFRecord_MoveTo(const Point & rPoint); - void WMFRecord_Pie(const Rectangle & rRect, const Point & rStartPt, const Point & rEndPt); - void WMFRecord_Polygon(const tools::Polygon & rPoly); - void WMFRecord_PolyLine(const tools::Polygon & rPoly); - void WMFRecord_PolyPolygon(const tools::PolyPolygon & rPolyPoly); - void WMFRecord_Rectangle(const Rectangle & rRect); - void WMFRecord_RestoreDC(); - void WMFRecord_RoundRect(const Rectangle & rRect, long nHorzRound, long nVertRound); - void WMFRecord_SaveDC(); - void WMFRecord_SelectObject(sal_uInt16 nObjectHandle); - void WMFRecord_SetBkMode(bool bTransparent); - void WMFRecord_SetStretchBltMode(); - void WMFRecord_SetPixel(const Point & rPoint, const Color & rColor); - void WMFRecord_SetROP2(RasterOp eROP); - void WMFRecord_SetTextAlign(FontAlign eFontAlign, sal_uInt16 eHorTextAlign); - void WMFRecord_SetTextColor(const Color & rColor); - void WMFRecord_SetWindowExt(const Size & rSize); - void WMFRecord_SetWindowOrg(const Point & rPoint); - void WMFRecord_StretchDIB(const Point & rPoint, const Size & rSize, const Bitmap & rBitmap, sal_uInt32 nROP = 0UL ); - void WMFRecord_TextOut(const Point & rPoint, const OUString & rString); - void WMFRecord_EndOfFile(); - void WMFRecord_IntersectClipRect( const Rectangle& rRect); - - sal_uInt16 AllocHandle(); - void FreeHandle(sal_uInt16 nObjectHandle); - void CreateSelectDeletePen( const Color& rColor, const LineInfo& rLineInfo ); - void CreateSelectDeleteFont(const vcl::Font & rFont); - void CreateSelectDeleteBrush(const Color& rColor); - - void SetLineAndFillAttr(); - void SetAllAttr(); - - void HandleLineInfoPolyPolygons(const LineInfo& rInfo, const basegfx::B2DPolygon& rLinePolygon); - void WriteRecords(const GDIMetaFile & rMTF); - - void WriteHeader(const GDIMetaFile & rMTF, bool bPlaceable); - void UpdateHeader(); - - void WriteEmbeddedEMF( const GDIMetaFile& rMTF ); - void WriteEMFRecord( SvMemoryStream& rStream, sal_uInt32 nCurSize, - sal_uInt32 nRemainingSize, - sal_uInt32 nTotalSize, - sal_uInt32 nRecCounts, - sal_uInt16 nCheckSum ); - - sal_uInt16 CalcSaveTargetMapMode(MapMode& rMapMode, const Size& rPrefSize); - -public: - WMFWriter(); - bool WriteWMF(const GDIMetaFile & rMTF, SvStream & rTargetStream, FilterConfigItem* pFilterConfigItem, bool bPlaceable=true); -}; - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |