summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorArmin Le Grand <alg@apache.org>2013-01-10 16:28:40 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-06-13 14:50:46 +0100
commite0cce521f1ad0cc384d30ce2f1077ea229fffe62 (patch)
treeae40b74bceb4b036d87b79e861f5eef76ec41102 /include
parent6ed3ef87d2472bad71b719e9ec927e72acfd2850 (diff)
Resolves: #i121504# Support for alpha channel in clipboard for all systems
(cherry picked from commit ef3931ff410117e1237b3bef7bc090e8b83b9519) Conflicts: automation/source/server/statemnt.cxx basic/source/runtime/methods.cxx canvas/source/vcl/devicehelper.cxx canvas/source/vcl/spritedevicehelper.cxx drawinglayer/source/processor2d/vclhelperbufferdevice.cxx drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx drawinglayer/source/tools/converters.cxx dtrans/source/win32/dtobj/FmtFilter.cxx editeng/source/items/bulitem.cxx extensions/source/scanner/sanedlg.cxx external/gcc3_specific/makefile.mk filter/source/graphicfilter/eos2met/eos2met.cxx filter/source/graphicfilter/ios2met/ios2met.cxx filter/source/msfilter/msdffimp.cxx fpicker/source/office/iodlg.cxx framework/source/fwe/classes/addonsoptions.cxx framework/source/fwe/helper/actiontriggerhelper.cxx sc/source/filter/excel/xiescher.cxx sc/source/ui/docshell/docsh.cxx sc/source/ui/inc/viewfunc.hxx sd/source/ui/app/sdxfer.cxx sd/source/ui/unoidl/unopage.cxx sd/source/ui/view/sdview3.cxx sfx2/source/appl/fileobj.cxx sfx2/source/appl/linkmgr2.cxx sfx2/source/dialog/filedlghelper.cxx sfx2/source/dialog/intro.cxx sfx2/source/doc/docinf.cxx sot/inc/sot/formats.hxx sot/source/base/formats.cxx svtools/bmpmaker/bmpcore.cxx svtools/bmpmaker/bmpsum.cxx svtools/inc/svtools/transfer.hxx svtools/source/filter/filter.cxx svtools/source/filter/wmf/emfwr.cxx svtools/source/filter/wmf/enhwmf.cxx svtools/source/filter/wmf/winwmf.cxx svtools/source/filter/wmf/wmfwr.cxx svtools/source/graphic/graphic.cxx svtools/source/graphic/provider.cxx svtools/source/misc/transfer.cxx svx/inc/svx/xoutbmp.hxx svx/source/sdr/overlay/overlaymanagerbuffered.cxx svx/source/xoutdev/_xoutbmp.cxx sw/source/core/view/viewsh.cxx sw/source/filter/ww1/w1filter.cxx sw/source/filter/ww8/ww8par.hxx sw/source/ui/dochdl/swdtflvr.cxx toolkit/source/awt/vclxbitmap.cxx toolkit/source/helper/vclunohelper.cxx vcl/Library_vcl.mk vcl/Package_inc.mk vcl/aqua/source/dtrans/DataFlavorMapping.cxx vcl/aqua/source/dtrans/OSXTransferable.cxx vcl/aqua/source/dtrans/PictToBmpFlt.cxx vcl/aqua/source/dtrans/PictToBmpFlt.hxx vcl/inc/vcl/alpha.hxx vcl/inc/vcl/bitmap.hxx vcl/inc/vcl/bitmapex.hxx vcl/inc/vcl/pngwrite.hxx vcl/inc/vcl/salbtype.hxx vcl/inc/vcl/wall.hxx vcl/source/gdi/animate.cxx vcl/source/gdi/bitmap2.cxx vcl/source/gdi/bitmapex.cxx vcl/source/gdi/bmpconv.cxx vcl/source/gdi/cvtsvm.cxx vcl/source/gdi/impgraph.cxx vcl/source/gdi/impimagetree.cxx vcl/source/gdi/metaact.cxx vcl/source/gdi/wall.cxx Change-Id: I79938bc412c048c3d4e64f430f216e73bec16167
Diffstat (limited to 'include')
-rw-r--r--include/sot/formats.hxx3
-rw-r--r--include/svtools/transfer.hxx8
-rw-r--r--include/vcl/alpha.hxx17
-rw-r--r--include/vcl/bitmap.hxx24
-rw-r--r--include/vcl/bitmapex.hxx8
-rw-r--r--include/vcl/dibtools.hxx70
-rw-r--r--include/vcl/pngwrite.hxx2
-rw-r--r--include/vcl/salbtype.hxx16
-rw-r--r--include/vcl/wall.hxx2
9 files changed, 98 insertions, 52 deletions
diff --git a/include/sot/formats.hxx b/include/sot/formats.hxx
index 912947669e53..74d3552a0e26 100644
--- a/include/sot/formats.hxx
+++ b/include/sot/formats.hxx
@@ -175,7 +175,8 @@
#define SOT_FORMATSTR_ID_STARMATH_8_TEMPLATE ((sal_uLong)138)
#define SOT_FORMATSTR_ID_STARBASE_8 ((sal_uLong)139)
#define SOT_FORMATSTR_ID_HC_GDIMETAFILE ((sal_uLong)140)
-#define SOT_FORMATSTR_ID_USER_END SOT_FORMATSTR_ID_HC_GDIMETAFILE
+#define SOT_FORMATSTR_ID_PNG ((sal_uLong)141)
+#define SOT_FORMATSTR_ID_USER_END SOT_FORMATSTR_ID_PNG
#endif // _SOT_FORMATS_HXX
diff --git a/include/svtools/transfer.hxx b/include/svtools/transfer.hxx
index 5d63d166bfa5..4f8966bcb4bf 100644
--- a/include/svtools/transfer.hxx
+++ b/include/svtools/transfer.hxx
@@ -40,7 +40,7 @@
#include <com/sun/star/embed/Aspects.hpp>
#include <com/sun/star/io/XInputStream.hpp>
-class Bitmap;
+class BitmapEx;
class GDIMetaFile;
class Graphic;
class ImageMap;
@@ -224,7 +224,7 @@ protected:
sal_Bool SetAny( const ::com::sun::star::uno::Any& rAny, const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
sal_Bool SetString( const OUString& rString, const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
- sal_Bool SetBitmap( const Bitmap& rBitmap, const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ sal_Bool SetBitmapEx( const BitmapEx& rBitmap, const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
sal_Bool SetGDIMetaFile( const GDIMetaFile& rMtf, const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
sal_Bool SetGraphic( const Graphic& rGraphic, const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
sal_Bool SetImageMap( const ImageMap& rIMap, const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
@@ -321,8 +321,8 @@ public:
sal_Bool GetString( SotFormatStringId nFormat, OUString& rStr );
sal_Bool GetString( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, OUString& rStr );
- sal_Bool GetBitmap( SotFormatStringId nFormat, Bitmap& rBmp );
- sal_Bool GetBitmap( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, Bitmap& rBmp );
+ sal_Bool GetBitmapEx( SotFormatStringId nFormat, BitmapEx& rBmp );
+ sal_Bool GetBitmapEx( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, BitmapEx& rBmp );
sal_Bool GetGDIMetaFile( SotFormatStringId nFormat, GDIMetaFile& rMtf );
sal_Bool GetGDIMetaFile( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, GDIMetaFile& rMtf );
diff --git a/include/vcl/alpha.hxx b/include/vcl/alpha.hxx
index 95bb0ea29de2..4ad3e28f9fb6 100644
--- a/include/vcl/alpha.hxx
+++ b/include/vcl/alpha.hxx
@@ -32,11 +32,10 @@ class BitmapEx;
class VCL_DLLPUBLIC AlphaMask : private Bitmap
{
+private:
friend class BitmapEx;
friend class OutputDevice;
- friend VCL_DLLPUBLIC SvStream& operator<<( SvStream&, const ImageList& );
-
-private:
+ friend bool VCL_DLLPUBLIC ReadDIBBitmapEx(BitmapEx& rTarget, SvStream& rIStm);
SAL_DLLPRIVATE const Bitmap& ImplGetBitmap() const;
SAL_DLLPRIVATE void ImplSetBitmap( const Bitmap& rBitmap );
@@ -130,18 +129,6 @@ public:
ScopedReadAccess;
typedef vcl::ScopedBitmapAccess< BitmapWriteAccess, AlphaMask, &AlphaMask::AcquireWriteAccess >
ScopedWriteAccess;
-
- sal_Bool Read( SvStream& rIStm, sal_Bool bFileHeader = sal_True )
- {
- return Bitmap::Read( rIStm, bFileHeader );
- }
- sal_Bool Write( SvStream& rOStm, sal_Bool bCompressed = sal_True, sal_Bool bFileHeader = sal_True ) const
- {
- return Bitmap::Write( rOStm, bCompressed, bFileHeader );
- }
-
- friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStm, const BitmapEx& rBitmapEx );
- friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStm, BitmapEx& rBitmapEx );
};
#endif // _SV_ALPHA_HXX
diff --git a/include/vcl/bitmap.hxx b/include/vcl/bitmap.hxx
index a5388fa2c25d..b4e07fb77aa5 100644
--- a/include/vcl/bitmap.hxx
+++ b/include/vcl/bitmap.hxx
@@ -290,8 +290,6 @@ class BitmapWriteAccess;
class BitmapPalette;
class ImpBitmap;
class Color;
-class SvStream;
-struct DIBInfoHeader;
class ResId;
class GDIMetaFile;
class AlphaMask;
@@ -328,20 +326,6 @@ public:
SAL_DLLPRIVATE void ImplSetImpBitmap( ImpBitmap* pImpBmp );
SAL_DLLPRIVATE void ImplAssignWithSize( const Bitmap& rBitmap );
- SAL_DLLPRIVATE static sal_Bool ImplReadDIB( SvStream& rIStm, Bitmap& rBmp, sal_uLong nOffset, sal_Bool bMSOFormat = sal_False );
- SAL_DLLPRIVATE static sal_Bool ImplReadDIBFileHeader( SvStream& rIStm, sal_uLong& rOffset );
- SAL_DLLPRIVATE static sal_Bool ImplReadDIBInfoHeader( SvStream& rIStm, DIBInfoHeader& rHeader, sal_Bool& bTopDown, sal_Bool bMSOFormat = sal_False );
- SAL_DLLPRIVATE static sal_Bool ImplReadDIBPalette( SvStream& rIStm, BitmapWriteAccess& rAcc, sal_Bool bQuad );
- SAL_DLLPRIVATE static sal_Bool ImplReadDIBBits( SvStream& rIStm, DIBInfoHeader& rHeader, BitmapWriteAccess& rAcc, sal_Bool bTopDown );
- SAL_DLLPRIVATE sal_Bool ImplWriteDIB( SvStream& rOStm, BitmapReadAccess& rAcc, sal_Bool bCompressed ) const;
- SAL_DLLPRIVATE static sal_Bool ImplWriteDIBFileHeader( SvStream& rOStm, BitmapReadAccess& rAcc );
- SAL_DLLPRIVATE static sal_Bool ImplWriteDIBPalette( SvStream& rOStm, BitmapReadAccess& rAcc );
- SAL_DLLPRIVATE static sal_Bool ImplWriteDIBBits( SvStream& rOStm, BitmapReadAccess& rAcc,
- sal_uLong nCompression, sal_uInt32& rImageSize );
- SAL_DLLPRIVATE static void ImplDecodeRLE( sal_uInt8* pBuffer, DIBInfoHeader& rHeader,
- BitmapWriteAccess& rAcc, sal_Bool bRLE4 );
- SAL_DLLPRIVATE static sal_Bool ImplWriteRLE( SvStream& rOStm, BitmapReadAccess& rAcc, sal_Bool bRLE4 );
-
SAL_DLLPRIVATE void ImplAdaptBitCount(Bitmap& rNew) const;
SAL_DLLPRIVATE sal_Bool ImplScaleFast( const double& rScaleX, const double& rScaleY );
SAL_DLLPRIVATE sal_Bool ImplScaleInterpolate( const double& rScaleX, const double& rScaleY );
@@ -865,14 +849,6 @@ public:
ScopedReadAccess;
typedef vcl::ScopedBitmapAccess< BitmapWriteAccess, Bitmap, &Bitmap::AcquireWriteAccess >
ScopedWriteAccess;
-
-public:
-
- sal_Bool Read( SvStream& rIStm, sal_Bool bFileHeader = sal_True, sal_Bool bMSOFormat = sal_False );
- sal_Bool Write( SvStream& rOStm, sal_Bool bCompressed = sal_True, sal_Bool bFileHeader = sal_True ) const;
-
- friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStm, Bitmap& rBitmap );
- friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStm, const Bitmap& rBitmap );
};
inline sal_Bool Bitmap::operator!() const
diff --git a/include/vcl/bitmapex.hxx b/include/vcl/bitmapex.hxx
index ce1b2ae0bd99..f26ef9611d42 100644
--- a/include/vcl/bitmapex.hxx
+++ b/include/vcl/bitmapex.hxx
@@ -48,9 +48,9 @@ enum TransparentType
class VCL_DLLPUBLIC BitmapEx
{
- friend class ImpGraphic;
-
private:
+ friend class ImpGraphic;
+ friend bool VCL_DLLPUBLIC WriteDIBBitmapEx(const BitmapEx& rSource, SvStream& rOStm);
Bitmap aBitmap;
Bitmap aMask;
@@ -65,8 +65,6 @@ public:
SAL_DLLPRIVATE ImpBitmap* ImplGetBitmapImpBitmap() const { return aBitmap.ImplGetImpBitmap(); }
SAL_DLLPRIVATE ImpBitmap* ImplGetMaskImpBitmap() const { return aMask.ImplGetImpBitmap(); }
-public:
-
BitmapEx();
BitmapEx( const ResId& rResId );
BitmapEx( const BitmapEx& rBitmapEx );
@@ -385,8 +383,6 @@ public:
public:
- friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStm, const BitmapEx& rBitmapEx );
- friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStm, BitmapEx& rBitmapEx );
static BitmapEx AutoScaleBitmap(BitmapEx & aBitmap, const long aStandardSize);
/// populate from a canvas implementation
diff --git a/include/vcl/dibtools.hxx b/include/vcl/dibtools.hxx
new file mode 100644
index 000000000000..a8b0336b02a1
--- /dev/null
+++ b/include/vcl/dibtools.hxx
@@ -0,0 +1,70 @@
+/*
+ * 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 _SV_DIBTOOLS_HXX
+#define _SV_DIBTOOLS_HXX
+
+#include <vcl/dllapi.h>
+#include <vcl/mapmod.hxx>
+#include <tools/rc.hxx>
+#include <vcl/region.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+class SvStream;
+class BitmapEx;
+class Bitmap;
+
+//////////////////////////////////////////////////////////////////////////////
+
+bool VCL_DLLPUBLIC ReadDIB( // ReadDIB(rBitmap, rIStm, true);
+ Bitmap& rTarget,
+ SvStream& rIStm,
+ bool bFileHeader);
+
+bool VCL_DLLPUBLIC ReadDIBBitmapEx(
+ BitmapEx& rTarget,
+ SvStream& rIStm);
+
+bool VCL_DLLPUBLIC ReadDIBV5(
+ Bitmap& rTarget,
+ Bitmap& rTargetAlpha,
+ SvStream& rIStm);
+
+//////////////////////////////////////////////////////////////////////////////
+
+bool VCL_DLLPUBLIC WriteDIB( // WriteDIB(rBitmap, rOStm, false, true);
+ const Bitmap& rSource,
+ SvStream& rOStm,
+ bool bCompressed,
+ bool bFileHeader);
+
+bool VCL_DLLPUBLIC WriteDIBBitmapEx(
+ const BitmapEx& rSource,
+ SvStream& rOStm);
+
+bool VCL_DLLPUBLIC WriteDIBV5(
+ const Bitmap& rSource,
+ const Bitmap& rSourceAlpha,
+ SvStream& rOStm);
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif // _SV_DIBTOOLS_HXX
+
+//////////////////////////////////////////////////////////////////////////////
diff --git a/include/vcl/pngwrite.hxx b/include/vcl/pngwrite.hxx
index 921ad45ddf4d..bff25ad15041 100644
--- a/include/vcl/pngwrite.hxx
+++ b/include/vcl/pngwrite.hxx
@@ -40,7 +40,7 @@ namespace vcl
public:
- PNGWriter( const BitmapEx& BmpEx,
+ explicit PNGWriter( const BitmapEx&,
const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >* pFilterData = NULL );
~PNGWriter();
diff --git a/include/vcl/salbtype.hxx b/include/vcl/salbtype.hxx
index 3fc153dc0f2f..f926262c014c 100644
--- a/include/vcl/salbtype.hxx
+++ b/include/vcl/salbtype.hxx
@@ -240,6 +240,7 @@ public:
inline void SetColorFor24Bit( const BitmapColor& rColor, HPBYTE pPixel ) const;
inline void GetColorFor32Bit( BitmapColor& rColor, ConstHPBYTE pPixel ) const;
+ inline void GetColorAndAlphaFor32Bit( BitmapColor& rColor, sal_uInt8& rAlpha, ConstHPBYTE pPixel ) const;
inline void SetColorFor32Bit( const BitmapColor& rColor, HPBYTE pPixel ) const;
};
@@ -863,6 +864,21 @@ inline void ColorMask::GetColorFor32Bit( BitmapColor& rColor, ConstHPBYTE pPixel
// ------------------------------------------------------------------
+inline void ColorMask::GetColorAndAlphaFor32Bit( BitmapColor& rColor, sal_uInt8& rAlpha, ConstHPBYTE pPixel ) const
+{
+#ifdef OSL_BIGENDIAN
+ const sal_uInt32 nVal = (sal_uInt32) pPixel[ 0 ] | ( (sal_uInt32) pPixel[ 1 ] << 8UL ) |
+ ( (sal_uInt32) pPixel[ 2 ] << 16UL ) | ( (sal_uInt32) pPixel[ 3 ] << 24UL );
+#else
+ const sal_uInt32 nVal = *(sal_uInt32*) pPixel;
+#endif
+ rAlpha = (sal_uInt8)(nVal >> 24);
+
+ MASK_TO_COLOR( nVal, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift, rColor );
+}
+
+// ------------------------------------------------------------------
+
inline void ColorMask::SetColorFor32Bit( const BitmapColor& rColor, HPBYTE pPixel ) const
{
#ifdef OSL_BIGENDIAN
diff --git a/include/vcl/wall.hxx b/include/vcl/wall.hxx
index e18adf78f60b..18a90d3dccb9 100644
--- a/include/vcl/wall.hxx
+++ b/include/vcl/wall.hxx
@@ -92,7 +92,7 @@ public:
Wallpaper();
Wallpaper( const Wallpaper& rWallpaper );
Wallpaper( const Color& rColor );
- Wallpaper( const BitmapEx& rBmpEx );
+ explicit Wallpaper( const BitmapEx& rBmpEx );
Wallpaper( const Gradient& rGradient );
~Wallpaper();