summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorRadek Doulik <rodo@novell.com>2010-09-15 11:02:24 +0200
committerRadek Doulik <rodo@novell.com>2010-09-15 17:54:14 +0200
commitcc3f43692add98b83f3a344690698c5f7026dcb0 (patch)
treea00a457ab075809eefe90e10ec0e895182279aff /vcl
parent25a9a8773910d245977d57e8bdf4e5c7ab8c916b (diff)
emf+-vcl-bitmap.diff: emf+ import - create vcl bitmap from XBitmap
Diffstat (limited to 'vcl')
-rw-r--r--vcl/aqua/inc/salbmp.h3
-rw-r--r--vcl/aqua/source/gdi/salbmp.cxx7
-rw-r--r--vcl/inc/vcl/salbmp.hxx5
-rw-r--r--vcl/unx/headless/svpbmp.cxx5
-rw-r--r--vcl/unx/headless/svpbmp.hxx3
-rw-r--r--vcl/unx/inc/salbmp.h3
-rw-r--r--vcl/unx/source/gdi/salbmp.cxx26
-rw-r--r--vcl/win/inc/salbmp.h3
-rw-r--r--vcl/win/source/gdi/salbmp.cxx7
9 files changed, 62 insertions, 0 deletions
diff --git a/vcl/aqua/inc/salbmp.h b/vcl/aqua/inc/salbmp.h
index 1c427cce0cd5..532febb1e7a1 100644
--- a/vcl/aqua/inc/salbmp.h
+++ b/vcl/aqua/inc/salbmp.h
@@ -74,6 +74,9 @@ public:
bool Create( const SalBitmap& rSalBmp );
bool Create( const SalBitmap& rSalBmp, SalGraphics* pGraphics );
bool Create( const SalBitmap& rSalBmp, USHORT nNewBitCount );
+ virtual bool Create( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmapCanvas > xBitmapCanvas,
+ Size& rSize,
+ bool bMask = false );
void Destroy();
diff --git a/vcl/aqua/source/gdi/salbmp.cxx b/vcl/aqua/source/gdi/salbmp.cxx
index 0e58c35b5fad..ad1cf16830b4 100644
--- a/vcl/aqua/source/gdi/salbmp.cxx
+++ b/vcl/aqua/source/gdi/salbmp.cxx
@@ -153,6 +153,13 @@ bool AquaSalBitmap::Create( const SalBitmap& rSalBmp, USHORT nNewBitCount )
// ------------------------------------------------------------------
+bool AquaSalBitmap::Create( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmapCanvas > /*xBitmapCanvas*/, Size& /*rSize*/, bool /*bMask*/ )
+{
+ return false;
+}
+
+// ------------------------------------------------------------------
+
void AquaSalBitmap::Destroy()
{
DestroyContext();
diff --git a/vcl/inc/vcl/salbmp.hxx b/vcl/inc/vcl/salbmp.hxx
index 4aca4a9277e9..678b57fbf56f 100644
--- a/vcl/inc/vcl/salbmp.hxx
+++ b/vcl/inc/vcl/salbmp.hxx
@@ -33,6 +33,8 @@
#endif
#include <vcl/dllapi.h>
+#include <com/sun/star/rendering/XBitmapCanvas.hpp>
+
struct BitmapBuffer;
class SalGraphics;
class BitmapPalette;
@@ -52,6 +54,9 @@ public:
SalGraphics* pGraphics ) = 0;
virtual bool Create( const SalBitmap& rSalBmp,
USHORT nNewBitCount ) = 0;
+ virtual bool Create( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmapCanvas > xBitmapCanvas,
+ Size& rSize,
+ bool bMask = false ) = 0;
virtual void Destroy() = 0;
virtual Size GetSize() const = 0;
virtual USHORT GetBitCount() const = 0;
diff --git a/vcl/unx/headless/svpbmp.cxx b/vcl/unx/headless/svpbmp.cxx
index 7c84c4a7a579..885b2723aa19 100644
--- a/vcl/unx/headless/svpbmp.cxx
+++ b/vcl/unx/headless/svpbmp.cxx
@@ -116,6 +116,11 @@ bool SvpSalBitmap::Create( const SalBitmap& /*rSalBmp*/,
return false;
}
+bool SvpSalBitmap::Create( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmapCanvas > /*xBitmapCanvas*/, Size& /*rSize*/, bool /*bMask*/ )
+{
+ return false;
+}
+
void SvpSalBitmap::Destroy()
{
m_aBitmap.reset();
diff --git a/vcl/unx/headless/svpbmp.hxx b/vcl/unx/headless/svpbmp.hxx
index dc775e66aaf1..6b0e43006b0d 100644
--- a/vcl/unx/headless/svpbmp.hxx
+++ b/vcl/unx/headless/svpbmp.hxx
@@ -53,6 +53,9 @@ public:
SalGraphics* pGraphics );
virtual bool Create( const SalBitmap& rSalBmp,
USHORT nNewBitCount );
+ virtual bool Create( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmapCanvas > xBitmapCanvas,
+ Size& rSize,
+ bool bMask = false );
virtual void Destroy();
virtual Size GetSize() const;
virtual USHORT GetBitCount() const;
diff --git a/vcl/unx/inc/salbmp.h b/vcl/unx/inc/salbmp.h
index 23e038f30ab1..2d02c7d6b9b4 100644
--- a/vcl/unx/inc/salbmp.h
+++ b/vcl/unx/inc/salbmp.h
@@ -110,6 +110,9 @@ public:
SalGraphics* pGraphics );
virtual bool Create( const SalBitmap& rSalBmp,
USHORT nNewBitCount );
+ virtual bool Create( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmapCanvas > xBitmapCanvas,
+ Size& rSize,
+ bool bMask = false );
virtual void Destroy();
diff --git a/vcl/unx/source/gdi/salbmp.cxx b/vcl/unx/source/gdi/salbmp.cxx
index cc7934b0a798..3f8e8de564be 100644
--- a/vcl/unx/source/gdi/salbmp.cxx
+++ b/vcl/unx/source/gdi/salbmp.cxx
@@ -47,6 +47,7 @@
#include <salbmp.h>
#include <salinst.h>
#include <vcl/bitmap.hxx>
+#include <com/sun/star/beans/XFastPropertySet.hpp>
// -----------
// - Defines -
@@ -744,6 +745,31 @@ bool X11SalBitmap::Create( const SalBitmap&, USHORT )
// -----------------------------------------------------------------------------
+bool X11SalBitmap::Create( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmapCanvas > xBitmapCanvas, Size& rSize, bool bMask )
+{
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XFastPropertySet > xFastPropertySet( xBitmapCanvas, ::com::sun::star::uno::UNO_QUERY );
+ if( xFastPropertySet.get() ) {
+ long pixmapHandle;
+ sal_Int32 depth;
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > args;
+
+ if( xFastPropertySet->getFastPropertyValue(bMask ? 2 : 1) >>= args ) {
+ if( ( args[1] >>= pixmapHandle ) && ( args[2] >>= depth ) ) {
+ bool bSuccess = ImplCreateFromDrawable( pixmapHandle, 0, depth, 0, 0, (long) rSize.Width(), (long) rSize.Height() );
+ bool bFreePixmap;
+ if( bSuccess && (args[0] >>= bFreePixmap) && bFreePixmap )
+ XFreePixmap( GetX11SalData()->GetDisplay()->GetDisplay(), pixmapHandle );
+
+ return bSuccess;
+ }
+ }
+ }
+
+ return false;
+}
+
+// -----------------------------------------------------------------------------
+
void X11SalBitmap::Destroy()
{
if( mpDIB )
diff --git a/vcl/win/inc/salbmp.h b/vcl/win/inc/salbmp.h
index 7a31add2ae19..0705d27aa8dc 100644
--- a/vcl/win/inc/salbmp.h
+++ b/vcl/win/inc/salbmp.h
@@ -74,6 +74,9 @@ public:
virtual bool Create( const SalBitmap& rSalBmpImpl );
virtual bool Create( const SalBitmap& rSalBmpImpl, SalGraphics* pGraphics );
virtual bool Create( const SalBitmap& rSalBmpImpl, USHORT nNewBitCount );
+ virtual bool Create( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmapCanvas > xBitmapCanvas,
+ Size& rSize,
+ bool bMask = false );
virtual void Destroy();
diff --git a/vcl/win/source/gdi/salbmp.cxx b/vcl/win/source/gdi/salbmp.cxx
index 444df039dd69..2717a45bfbe0 100644
--- a/vcl/win/source/gdi/salbmp.cxx
+++ b/vcl/win/source/gdi/salbmp.cxx
@@ -264,6 +264,13 @@ bool WinSalBitmap::Create( const SalBitmap& rSSalBmp, USHORT nNewBitCount )
// ------------------------------------------------------------------
+bool WinSalBitmap::Create( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmapCanvas > /*xBitmapCanvas*/, Size& /*rSize*/, bool /*bMask*/ )
+{
+ return false;
+}
+
+// ------------------------------------------------------------------
+
void WinSalBitmap::Destroy()
{
if( mhDIB )