[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.0' - 14 commits - basebmp/inc basebmp/Library_basebmp.mk basebmp/source basebmp/StaticLibrary_basebmp.mk desktop/inc desktop/qa desktop/source drawinglayer/source include/basebmp include/drawinglayer include/LibreOfficeKit include/vcl sd/source svx/source sw/inc sw/source vcl/source

Miklos Vajna vmiklos at collabora.co.uk
Wed Oct 7 02:10:30 PDT 2015


 basebmp/Library_basebmp.mk                                      |    5 
 basebmp/StaticLibrary_basebmp.mk                                |    5 
 basebmp/inc/accessor.hxx                                        |  113 +
 basebmp/inc/accessoradapters.hxx                                |  520 +++++++
 basebmp/inc/accessorfunctors.hxx                                |  181 ++
 basebmp/inc/accessortraits.hxx                                  |  126 +
 basebmp/inc/clippedlinerenderer.hxx                             |  438 ++++++
 basebmp/inc/colorblendaccessoradapter.hxx                       |  142 ++
 basebmp/inc/colormisc.hxx                                       |  185 ++
 basebmp/inc/colortraits.hxx                                     |  144 ++
 basebmp/inc/compositeiterator.hxx                               |  395 +++++
 basebmp/inc/endian.hxx                                          |   51 
 basebmp/inc/fillimage.hxx                                       |   63 
 basebmp/inc/genericcolorimageaccessor.hxx                       |   76 +
 basebmp/inc/greylevelformats.hxx                                |  129 +
 basebmp/inc/iteratortraits.hxx                                  |   49 
 basebmp/inc/metafunctions.hxx                                   |  217 +++
 basebmp/inc/nonstandarditerator.hxx                             |   39 
 basebmp/inc/packedpixeliterator.hxx                             |  670 ++++++++++
 basebmp/inc/paletteformats.hxx                                  |  139 ++
 basebmp/inc/paletteimageaccessor.hxx                            |  162 ++
 basebmp/inc/pixelformatadapters.hxx                             |  102 +
 basebmp/inc/pixeliterator.hxx                                   |  349 +++++
 basebmp/inc/polypolygonrenderer.hxx                             |  360 +++++
 basebmp/inc/rgb24pixelformats.hxx                               |   92 +
 basebmp/inc/rgbmaskpixelformats.hxx                             |  355 +++++
 basebmp/inc/scaleimage.hxx                                      |  189 ++
 basebmp/inc/stridedarrayiterator.hxx                            |  108 +
 basebmp/inc/tools.hxx                                           |   85 +
 basebmp/source/bitmapdevice.cxx                                 |   36 
 basebmp/source/polypolygonrenderer.cxx                          |    2 
 desktop/inc/lib/init.hxx                                        |   12 
 desktop/qa/desktop_lib/test_desktop_lib.cxx                     |   41 
 desktop/source/lib/init.cxx                                     |  129 +
 drawinglayer/source/primitive2d/backgroundcolorprimitive2d.cxx  |    6 
 drawinglayer/source/processor2d/vclpixelprocessor2d.cxx         |    4 
 include/LibreOfficeKit/LibreOfficeKit.h                         |    6 
 include/LibreOfficeKit/LibreOfficeKit.hxx                       |   35 
 include/basebmp/accessor.hxx                                    |  113 -
 include/basebmp/accessoradapters.hxx                            |  520 -------
 include/basebmp/accessorfunctors.hxx                            |  181 --
 include/basebmp/accessortraits.hxx                              |  126 -
 include/basebmp/clippedlinerenderer.hxx                         |  438 ------
 include/basebmp/colorblendaccessoradapter.hxx                   |  142 --
 include/basebmp/colormisc.hxx                                   |  185 --
 include/basebmp/colortraits.hxx                                 |  144 --
 include/basebmp/compositeiterator.hxx                           |  395 -----
 include/basebmp/endian.hxx                                      |   51 
 include/basebmp/fillimage.hxx                                   |   63 
 include/basebmp/genericcolorimageaccessor.hxx                   |   76 -
 include/basebmp/greylevelformats.hxx                            |  129 -
 include/basebmp/iteratortraits.hxx                              |   49 
 include/basebmp/metafunctions.hxx                               |  217 ---
 include/basebmp/nonstandarditerator.hxx                         |   39 
 include/basebmp/packedpixeliterator.hxx                         |  670 ----------
 include/basebmp/paletteformats.hxx                              |  139 --
 include/basebmp/paletteimageaccessor.hxx                        |  162 --
 include/basebmp/pixelformatadapters.hxx                         |  102 -
 include/basebmp/pixeliterator.hxx                               |  349 -----
 include/basebmp/polypolygonrenderer.hxx                         |  360 -----
 include/basebmp/rgb24pixelformats.hxx                           |   92 -
 include/basebmp/rgbmaskpixelformats.hxx                         |  355 -----
 include/basebmp/scaleimage.hxx                                  |  189 --
 include/basebmp/stridedarrayiterator.hxx                        |  108 -
 include/basebmp/tools.hxx                                       |   85 -
 include/drawinglayer/primitive2d/backgroundcolorprimitive2d.hxx |    5 
 include/vcl/ITiledRenderable.hxx                                |    8 
 include/vcl/virdev.hxx                                          |    2 
 sd/source/ui/inc/DrawViewShell.hxx                              |    6 
 sd/source/ui/view/drviews1.cxx                                  |   18 
 sd/source/ui/view/drviews5.cxx                                  |    8 
 sd/source/ui/view/drviewsa.cxx                                  |    3 
 svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx           |    2 
 sw/inc/crsrsh.hxx                                               |    2 
 sw/inc/unotxdoc.hxx                                             |    2 
 sw/source/core/crsr/crsrsh.cxx                                  |   14 
 sw/source/uibase/config/viewopt.cxx                             |    3 
 sw/source/uibase/uno/unotxdoc.cxx                               |   11 
 vcl/source/gdi/bmpacc2.cxx                                      |    6 
 vcl/source/gdi/virdev.cxx                                       |   12 
 80 files changed, 5793 insertions(+), 5548 deletions(-)

New commits:
commit 5a6e5f1abd0d86b9f2fc7f58e1f823d503082b52
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Fri Oct 2 15:01:52 2015 +0200

    sd tiled rendering: default to transparent background outside slide area
    
    (cherry picked from commit 474228f89128487ea7a216580df0a8bc5e06f87e)
    
    Conflicts:
    	sd/source/ui/view/drviews1.cxx
    
    Change-Id: Ic9023640c34c3d7efd00e2eb0894ed4d01109d8d

diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx
index da1df67..6270438 100644
--- a/sd/source/ui/view/drviews1.cxx
+++ b/sd/source/ui/view/drviews1.cxx
@@ -81,6 +81,7 @@
 
 #include <sfx2/request.hxx>
 #include <boost/bind.hpp>
+#include <comphelper/lok.hxx>
 
 using namespace com::sun::star;
 
@@ -381,6 +382,8 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool bIsLayerModeActive)
 
         svtools::ColorConfig aColorConfig;
         Color aFillColor = Color( aColorConfig.GetColorValue( svtools::APPBACKGROUND ).nColor );
+        if (comphelper::LibreOfficeKit::isActive())
+            aFillColor = COL_TRANSPARENT;
 
         if (meEditMode == EM_PAGE)
         {
commit 9dc6c3c49385cf7f1be62ca2736bf3334776d16b
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date:   Thu Jun 25 09:47:37 2015 +0200

    tdf#87905: Use darker background colour for master view
    
    for the area behind the slide, that is
    
    Change-Id: Ie020f43a81e5eaa257c20d0a7b6feffce1614205
    Reviewed-on: https://gerrit.libreoffice.org/16466
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Philippe Jung <phil.jung at free.fr>
    (cherry picked from commit 1c481fe6522f4c7d883e77a4ac32f855b9bcb323)

diff --git a/sd/source/ui/inc/DrawViewShell.hxx b/sd/source/ui/inc/DrawViewShell.hxx
index 405e7af..d77ece6 100644
--- a/sd/source/ui/inc/DrawViewShell.hxx
+++ b/sd/source/ui/inc/DrawViewShell.hxx
@@ -376,6 +376,9 @@ public:
 
     OUString GetSidebarContextName() const;
 
+    const Color& GetAppBackgroundColor() const { return mnAppBackgroundColor; }
+    void SetAppBackgroundColor( Color nNewColor )  { mnAppBackgroundColor = nNewColor; }
+
     //move this method to ViewShell.
     //void  NotifyAccUpdate();
 protected:
@@ -507,6 +510,9 @@ private:
     ::std::unique_ptr< ViewOverlayManager > mpViewOverlayManager;
 
     std::vector<std::unique_ptr<SdrExternalToolEdit>> m_ExternalEdits;
+
+    // The colour of the area behind the slide (used to be called "Wiese")
+    Color mnAppBackgroundColor;
 };
 
 } // end of namespace sd
diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx
index 3b74941..da1df67 100644
--- a/sd/source/ui/view/drviews1.cxx
+++ b/sd/source/ui/view/drviews1.cxx
@@ -316,6 +316,7 @@ bool DrawViewShell::PrepareClose( bool bUI )
     return true;
 }
 
+
 /**
  * Set status (enabled/disabled) of menu SfxSlots
  */
@@ -378,6 +379,9 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool bIsLayerModeActive)
                 GetViewShellBase().GetToolBarManager()->ResetToolBars(ToolBarManager::TBG_COMMON_TASK);
         }
 
+        svtools::ColorConfig aColorConfig;
+        Color aFillColor = Color( aColorConfig.GetColorValue( svtools::APPBACKGROUND ).nColor );
+
         if (meEditMode == EM_PAGE)
         {
             /******************************************************************
@@ -403,6 +407,8 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool bIsLayerModeActive)
 
             maTabControl->SetCurPageId(nActualPageNum + 1);
 
+            SetAppBackgroundColor( aFillColor );
+
             SwitchPage(nActualPageNum);
         }
         else
@@ -439,6 +445,9 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool bIsLayerModeActive)
                 }
             }
 
+            aFillColor.DecreaseLuminance( 64 );
+            SetAppBackgroundColor( aFillColor );
+
             maTabControl->SetCurPageId(nActualMasterPageNum + 1);
             SwitchPage(nActualMasterPageNum);
         }
@@ -478,6 +487,7 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool bIsLayerModeActive)
         Invalidate( SID_TITLE_MASTERPAGE );
         Invalidate( SID_NOTES_MASTERPAGE );
         Invalidate( SID_HANDOUT_MASTERPAGE );
+        InvalidateWindows();
 
         SetContextName(GetSidebarContextName());
     }
diff --git a/sd/source/ui/view/drviews5.cxx b/sd/source/ui/view/drviews5.cxx
index 030c676..db43564 100644
--- a/sd/source/ui/view/drviews5.cxx
+++ b/sd/source/ui/view/drviews5.cxx
@@ -406,19 +406,13 @@ void DrawViewShell::PrePaint()
  */
 void DrawViewShell::Paint(const Rectangle& rRect, ::sd::Window* pWin)
 {
-    // Fill var FillColor here to have it available on later call
-    svtools::ColorConfig aColorConfig;
-    Color aFillColor;
-
-    aFillColor = Color( aColorConfig.GetColorValue( svtools::APPBACKGROUND ).nColor );
-
     /* This is done before each text edit, so why not do it before every paint.
                 The default language is only used if the outliner only contains one
                 character in a symbol font */
     GetDoc()->GetDrawOutliner( NULL ).SetDefaultLanguage( GetDoc()->GetLanguage( EE_CHAR_LANGUAGE ) );
 
     // Set Application Background color for usage in SdrPaintView(s)
-    mpDrawView->SetApplicationBackgroundColor(aFillColor);
+    mpDrawView->SetApplicationBackgroundColor(GetAppBackgroundColor());
 
     /* This is done before each text edit, so why not do it before every paint.
                 The default language is only used if the outliner only contains one
diff --git a/sd/source/ui/view/drviewsa.cxx b/sd/source/ui/view/drviewsa.cxx
index d7c1a55..df28598 100644
--- a/sd/source/ui/view/drviewsa.cxx
+++ b/sd/source/ui/view/drviewsa.cxx
@@ -208,6 +208,9 @@ void DrawViewShell::Construct(DrawDocShell* pDocSh, PageKind eInitialPageKind)
     mbPastePossible = false;
     mbIsLayerModeActive = false;
 
+    svtools::ColorConfig aColorConfig;
+    mnAppBackgroundColor = Color( aColorConfig.GetColorValue( svtools::APPBACKGROUND ).nColor );
+
     mpFrameView->Connect();
 
     OSL_ASSERT (GetViewShell()!=NULL);
commit 5a3f165b1202a95aabaea037b1dc1e97eb9e31c8
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Fri Oct 2 14:12:20 2015 +0200

    svx, drawinglayer: handle tools Color <-> BackgroundColorPrimitive2D roundtrip
    
    Change-Id: Ia8c080ef50e1ddbfce17b5c5d357a240edea46f2
    (cherry picked from commit b1a9aba3bc33524dcf0dc1c4afc5c1aeeb5ba4d1)

diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index 1240437..a2d9a69 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -1161,7 +1161,9 @@ namespace drawinglayer
 
                     // create color for fill
                     const basegfx::BColor aPolygonColor(maBColorModifierStack.getModifiedColor(rPrimitive.getBColor()));
-                    mpOutputDevice->SetFillColor(Color(aPolygonColor));
+                    Color aFillColor(aPolygonColor);
+                    aFillColor.SetTransparency(sal_uInt8((rPrimitive.getTransparency() * 255.0) + 0.5));
+                    mpOutputDevice->SetFillColor(aFillColor);
                     mpOutputDevice->SetLineColor();
 
                     // create rectangle for fill
diff --git a/svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx b/svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx
index 4ca35ba..dcb8325 100644
--- a/svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx
@@ -142,7 +142,7 @@ drawinglayer::primitive2d::Primitive2DSequence ViewObjectContactOfPageBackground
         // init background with InitColor
         xRetval.realloc(1);
         const basegfx::BColor aRGBColor(aInitColor.getBColor());
-        xRetval[0] = drawinglayer::primitive2d::Primitive2DReference(new drawinglayer::primitive2d::BackgroundColorPrimitive2D(aRGBColor));
+        xRetval[0] = drawinglayer::primitive2d::Primitive2DReference(new drawinglayer::primitive2d::BackgroundColorPrimitive2D(aRGBColor, aInitColor.GetTransparency() / 255.0));
     }
 
     return xRetval;
commit e97e59a61f2d74e2cee337ee75d3cc33c0419b77
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Fri Oct 2 13:48:17 2015 +0200

    drawinglayer: add transparency support to BackgroundColorPrimitive2D
    
    Impress has tools Color that is wrapped in this primitive, then later
    drawinglayer::processor2d::VclPixelProcessor2D::processBasePrimitive2D()
    converts it back to tools Color. Problem is that the primitive uses basegfx
    BColor, so the alpha channel is lost.
    
    Add member and API to survive this roundtrip.
    
    Change-Id: I940e60f6e352022306abac3223636d19dd859355
    (cherry picked from commit 9824134ab3c19aa0a00943c65a0e09c36ef23899)

diff --git a/drawinglayer/source/primitive2d/backgroundcolorprimitive2d.cxx b/drawinglayer/source/primitive2d/backgroundcolorprimitive2d.cxx
index 3441483..ea10d20 100644
--- a/drawinglayer/source/primitive2d/backgroundcolorprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/backgroundcolorprimitive2d.cxx
@@ -50,9 +50,11 @@ namespace drawinglayer
         }
 
         BackgroundColorPrimitive2D::BackgroundColorPrimitive2D(
-            const basegfx::BColor& rBColor)
+            const basegfx::BColor& rBColor,
+            double fTransparency)
         :   BufferedDecompositionPrimitive2D(),
             maBColor(rBColor),
+            mfTransparency(fTransparency),
             maLastViewport()
         {
         }
@@ -63,7 +65,7 @@ namespace drawinglayer
             {
                 const BackgroundColorPrimitive2D& rCompare = static_cast<const BackgroundColorPrimitive2D&>(rPrimitive);
 
-                return (getBColor() == rCompare.getBColor());
+                return (getBColor() == rCompare.getBColor() && getTransparency() == rCompare.getTransparency());
             }
 
             return false;
diff --git a/include/drawinglayer/primitive2d/backgroundcolorprimitive2d.hxx b/include/drawinglayer/primitive2d/backgroundcolorprimitive2d.hxx
index 3b789eb..def2b43 100644
--- a/include/drawinglayer/primitive2d/backgroundcolorprimitive2d.hxx
+++ b/include/drawinglayer/primitive2d/backgroundcolorprimitive2d.hxx
@@ -48,6 +48,7 @@ namespace drawinglayer
         private:
             /// the fill color to use
             basegfx::BColor                             maBColor;
+            double mfTransparency;
 
             /// the last used viewInformation, used from getDecomposition for buffering
             basegfx::B2DRange                           maLastViewport;
@@ -59,10 +60,12 @@ namespace drawinglayer
         public:
             /// constructor
             explicit BackgroundColorPrimitive2D(
-                const basegfx::BColor& rBColor);
+                const basegfx::BColor& rBColor,
+                double fTransparency = 0);
 
             /// data read access
             const basegfx::BColor& getBColor() const { return maBColor; }
+            double getTransparency() const { return mfTransparency; }
 
             /// compare operator
             virtual bool operator==(const BasePrimitive2D& rPrimitive) const SAL_OVERRIDE;
commit 72852df904bf1bf3efcde20371a0414052a798d8
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Fri Oct 2 10:31:35 2015 +0200

    vcl tiled rendering: avoid 'Pixel represents color values!' warnings
    
    Which happens e.g. during rendering tiles:
    OutputDevice::BlendBitmapWithAlpha() produces an RGB alpha
    (255,255,255), then tries to set a pixel in the 8bit alpha channel using
    it, so when BitmapReadAccess::SetPixelFor_8BIT_PAL() tries to get the
    color index, we try to get it from a color that is not indexed.
    
    Let's assume that when the color is not indexed, it's always gray, so it
    doesn't matter what color we pick for the alpha mask needs.
    
    Change-Id: I325c1d70514fd176fdc9cc39683b444447adf07f
    (cherry picked from commit 4caaa09d4da0f7bd5aa0fae3233d66bd977f185e)

diff --git a/vcl/source/gdi/bmpacc2.cxx b/vcl/source/gdi/bmpacc2.cxx
index d664c4b..286ea8f 100644
--- a/vcl/source/gdi/bmpacc2.cxx
+++ b/vcl/source/gdi/bmpacc2.cxx
@@ -79,7 +79,11 @@ BitmapColor BitmapReadAccess::GetPixelFor_8BIT_PAL(ConstScanline pScanline, long
 
 void BitmapReadAccess::SetPixelFor_8BIT_PAL(Scanline pScanline, long nX, const BitmapColor& rBitmapColor, const ColorMask&)
 {
-    pScanline[ nX ] = rBitmapColor.GetIndex();
+    if (rBitmapColor.IsIndex())
+        pScanline[ nX ] = rBitmapColor.GetIndex();
+    else
+        // Let's hope that the RGB color values equal, so it doesn't matter what do we pick
+        pScanline[ nX ] = rBitmapColor.GetBlueOrIndex();
 }
 
 BitmapColor BitmapReadAccess::GetPixelFor_8BIT_TC_MASK(ConstScanline pScanline, long nX, const ColorMask& rMask)
commit 07d2ca25fe7d4ac0d0b809d8b5a1e5d73583e099
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Oct 1 16:43:00 2015 +0200

    sw tiled rendering: default to transparent background outside page frames
    
    Change-Id: Ie018a878eb7d7ef14a80a6b86020c114ff14da88
    (cherry picked from commit 4fe010cce872ef035fec376298e416f9799c4a21)

diff --git a/sw/source/uibase/config/viewopt.cxx b/sw/source/uibase/config/viewopt.cxx
index 190a6e3..7597589 100644
--- a/sw/source/uibase/config/viewopt.cxx
+++ b/sw/source/uibase/config/viewopt.cxx
@@ -38,6 +38,7 @@
 #include <unotools/syslocale.hxx>
 
 #include <editeng/acorrcfg.hxx>
+#include <comphelper/lok.hxx>
 
 #ifdef DBG_UTIL
 bool SwViewOption::s_bTest9 = false;        //DrawingLayerNotLoading
@@ -206,6 +207,8 @@ SwViewOption::SwViewOption() :
     m_bTest1 = m_bTest2 = m_bTest3 = m_bTest4 =
              m_bTest5 = m_bTest6 = m_bTest7 = m_bTest8 = m_bTest10 = false;
 #endif
+    if (comphelper::LibreOfficeKit::isActive())
+        aAppBackgroundColor = COL_TRANSPARENT;
 }
 
 SwViewOption::SwViewOption(const SwViewOption& rVOpt)
commit 2b3b3f84838927d5d5d4fa103b541d276b5a95f3
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Oct 1 14:17:21 2015 +0200

    desktop, vcl: support transparency in VirtualDevices with user-provided memory
    
    Change-Id: I65c31995c02a644aa436aecd065255fab38045e4
    (cherry picked from commit 1d3b613318654ceb2d34996ef8ca653cfe32a8ea)

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index a4d904c..47a50b7 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -757,10 +757,21 @@ void doc_paintTile (LibreOfficeKitDocument* pThis,
     InitSvpForLibreOfficeKit();
 
     ScopedVclPtrInstance< VirtualDevice > pDevice(nullptr, Size(1, 1), (sal_uInt16)32) ;
+
+    // Set background to transparent by default.
+    memset(pBuffer, 0, nCanvasWidth * nCanvasHeight * 4);
+    pDevice->SetBackground(Wallpaper(Color(COL_TRANSPARENT)));
+
     boost::shared_array< sal_uInt8 > aBuffer( pBuffer, NoDelete< sal_uInt8 >() );
+
+    // Allocate a separate buffer for the alpha device.
+    std::vector<sal_uInt8> aAlpha(nCanvasWidth * nCanvasHeight);
+    memset(aAlpha.data(), 0, nCanvasWidth * nCanvasHeight);
+    boost::shared_array<sal_uInt8> aAlphaBuffer(aAlpha.data(), NoDelete<sal_uInt8>());
+
     pDevice->SetOutputSizePixelScaleOffsetAndBuffer(
                 Size(nCanvasWidth, nCanvasHeight), Fraction(1.0), Point(),
-                aBuffer, true );
+                aBuffer, aAlphaBuffer, true );
 
     pDoc->paintTile(*pDevice.get(), nCanvasWidth, nCanvasHeight,
                     nTilePosX, nTilePosY, nTileWidth, nTileHeight);
@@ -774,6 +785,17 @@ void doc_paintTile (LibreOfficeKitDocument* pThis,
                     nTilePosX, nTilePosY, nTileWidth, nTileHeight);
 #endif
 
+    // Overwrite pBuffer's alpha channel with the separate alpha buffer.
+    for (int nRow = 0; nRow < nCanvasHeight; ++nRow)
+    {
+        for (int nCol = 0; nCol < nCanvasWidth; ++nCol)
+        {
+            const int nOffset = (nCanvasHeight * nRow) + nCol;
+            // VCL's transparent is 0, RGBA's transparent is 0xff.
+            pBuffer[nOffset * 4 +3] = 0xff - aAlpha[nOffset];
+        }
+    }
+
     static bool bDebug = getenv("LOK_DEBUG") != 0;
     if (bDebug)
     {
diff --git a/include/vcl/virdev.hxx b/include/vcl/virdev.hxx
index 3720a19..85e0afd 100644
--- a/include/vcl/virdev.hxx
+++ b/include/vcl/virdev.hxx
@@ -48,6 +48,7 @@ private:
                                                      const bool bTopDown );
     SAL_DLLPRIVATE bool ImplSetOutputSizePixel( const Size& rNewSize, bool bErase,
                                                 const basebmp::RawMemorySharedArray &pBuffer,
+                                                const basebmp::RawMemorySharedArray &pAlphaBuffer,
                                                 const bool bTopDown );
 
     VirtualDevice (const VirtualDevice &) SAL_DELETED_FUNCTION;
@@ -127,6 +128,7 @@ public:
                                                                 const Fraction& rScale,
                                                                 const Point& rNewOffset,
                                                                 const basebmp::RawMemorySharedArray &pBuffer,
+                                                                const basebmp::RawMemorySharedArray &pAlphaBuffer,
                                                                 const bool bTopDown = false );
     bool                SetOutputSize( const Size& rNewSize, bool bErase = true )
                             { return SetOutputSizePixel( LogicToPixel( rNewSize ), bErase ); }
diff --git a/vcl/source/gdi/virdev.cxx b/vcl/source/gdi/virdev.cxx
index 04ac2d7..be42332 100644
--- a/vcl/source/gdi/virdev.cxx
+++ b/vcl/source/gdi/virdev.cxx
@@ -391,6 +391,7 @@ void VirtualDevice::ImplFillOpaqueRectangle( const Rectangle& rRect )
 
 bool VirtualDevice::ImplSetOutputSizePixel( const Size& rNewSize, bool bErase,
                                             const basebmp::RawMemorySharedArray &pBuffer,
+                                            const basebmp::RawMemorySharedArray &pAlphaBuffer,
                                             const bool bTopDown )
 {
     if( InnerImplSetOutputSizePixel(rNewSize, bErase, pBuffer, bTopDown) )
@@ -407,7 +408,7 @@ bool VirtualDevice::ImplSetOutputSizePixel( const Size& rNewSize, bool bErase,
             {
                 mpAlphaVDev = VclPtr<VirtualDevice>::Create( *this, mnAlphaDepth );
                 mpAlphaVDev->InnerImplSetOutputSizePixel(rNewSize, bErase,
-                                                         basebmp::RawMemorySharedArray(),
+                                                         pAlphaBuffer,
                                                          bTopDown );
             }
 
@@ -441,13 +442,16 @@ void VirtualDevice::EnableRTL( bool bEnable )
 
 bool VirtualDevice::SetOutputSizePixel( const Size& rNewSize, bool bErase )
 {
-    return ImplSetOutputSizePixel( rNewSize, bErase, basebmp::RawMemorySharedArray(), false );
+    return ImplSetOutputSizePixel( rNewSize, bErase, basebmp::RawMemorySharedArray(), basebmp::RawMemorySharedArray(), false );
 }
 
 bool VirtualDevice::SetOutputSizePixelScaleOffsetAndBuffer(
     const Size& rNewSize, const Fraction& rScale, const Point& rNewOffset,
-    const basebmp::RawMemorySharedArray &pBuffer, const bool bTopDown )
+    const basebmp::RawMemorySharedArray &pBuffer, const basebmp::RawMemorySharedArray &pAlphaBuffer, const bool bTopDown )
 {
+    if (pAlphaBuffer)
+        mnAlphaDepth = 8;
+
     if (pBuffer) {
         MapMode mm = GetMapMode();
         mm.SetOrigin( rNewOffset );
@@ -455,7 +459,7 @@ bool VirtualDevice::SetOutputSizePixelScaleOffsetAndBuffer(
         mm.SetScaleY( rScale );
         SetMapMode( mm );
     }
-    return ImplSetOutputSizePixel( rNewSize, true, pBuffer, bTopDown );
+    return ImplSetOutputSizePixel( rNewSize, true, pBuffer, pAlphaBuffer, bTopDown );
 }
 
 void VirtualDevice::SetReferenceDevice( RefDevMode i_eRefDevMode )
commit ba7a4cdc714f929b3294d30bdf5ceea543fe57ff
Author: Mihai Varga <mihai.varga at collabora.com>
Date:   Fri Aug 7 09:03:26 2015 +0300

    Impress: set current page Id before showing the new page
    
    For tiled rendering this has the effect of not invalidating the
    previous slide when switching slides. After switching slides, an
    invalidation occurs caused by showing the new slide, and calling
    'GetPart' before 'SwitchPage' finishes returned the old part number.
    
    Change-Id: I1cafd0e51cd39be3a80d0559ae3051238b8df744
    Reviewed-on: https://gerrit.libreoffice.org/17562
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
    Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
    (cherry picked from commit 45576ea3b3c19d8fe545e984bf23708df90b1990)

diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx
index ec19247..3b74941 100644
--- a/sd/source/ui/view/drviews1.cxx
+++ b/sd/source/ui/view/drviews1.cxx
@@ -964,6 +964,7 @@ bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage)
             }
 
             mpDrawView->HideSdrPage();
+            maTabControl->SetCurPageId(nSelectedPage+1);
             mpDrawView->ShowSdrPage(mpActualPage);
             GetViewShellBase().GetDrawController().FireSwitchCurrentPage(mpActualPage);
 
@@ -989,7 +990,6 @@ bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage)
                 }
             }
 
-            maTabControl->SetCurPageId(nSelectedPage+1);
             OUString aPageName = mpActualPage->GetName();
 
             if (maTabControl->GetPageText(nSelectedPage+1) != aPageName)
@@ -1025,6 +1025,7 @@ bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage)
             }
 
             mpDrawView->HideSdrPage();
+            maTabControl->SetCurPageId(nSelectedPage+1);
 
             SdPage* pMaster = GetDoc()->GetMasterSdPage(nSelectedPage, mePageKind);
 
@@ -1063,8 +1064,6 @@ bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage)
             if (nPos != -1)
                 aLayoutName = aLayoutName.copy(0, nPos);
 
-            maTabControl->SetCurPageId(nSelectedPage+1);
-
             if (maTabControl->GetPageText(nSelectedPage+1) != aLayoutName)
             {
                 maTabControl->SetPageText(nSelectedPage+1, aLayoutName);
commit 3ec894756d5927866df4b87201a2690a58574750
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Oct 1 14:51:31 2015 +0200

    basebmp: fix Android build
    
    Change-Id: Ie84f41ab8ad032de5a31e4f566ec5b2358adcf37
    (cherry picked from commit 13a609e27476f4a9589f95e60417428a4aaa888b)

diff --git a/basebmp/StaticLibrary_basebmp.mk b/basebmp/StaticLibrary_basebmp.mk
index c80427f..e98e266 100644
--- a/basebmp/StaticLibrary_basebmp.mk
+++ b/basebmp/StaticLibrary_basebmp.mk
@@ -11,6 +11,11 @@ $(eval $(call gb_StaticLibrary_StaticLibrary,basebmp))
 
 $(eval $(call gb_StaticLibrary_use_sdk_api,basebmp))
 
+$(eval $(call gb_StaticLibrary_set_include,basebmp,\
+	-I$(SRCDIR)/basebmp/inc \
+	$$(INCLUDE) \
+))
+
 $(eval $(call gb_StaticLibrary_use_externals,basebmp,\
 	boost_headers \
 	vigra_headers \
commit eddba840ac368e1bb9fc2d329ef9a3268a37abc8
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Oct 1 08:31:24 2015 +0200

    basebmp: these headers are not used from other modules
    
    Change-Id: I88c5c341b88a6ea62730e5d3dd1962365c531f70
    (cherry picked from commit 8e27c68847c6461c7bc0bdbff44412d6bfb0b1e8)

diff --git a/basebmp/Library_basebmp.mk b/basebmp/Library_basebmp.mk
index 12a2dec..809671c 100644
--- a/basebmp/Library_basebmp.mk
+++ b/basebmp/Library_basebmp.mk
@@ -11,6 +11,11 @@ $(eval $(call gb_Library_Library,basebmp))
 
 $(eval $(call gb_Library_use_sdk_api,basebmp))
 
+$(eval $(call gb_Library_set_include,basebmp,\
+	-I$(SRCDIR)/basebmp/inc \
+	$$(INCLUDE) \
+))
+
 $(eval $(call gb_Library_use_externals,basebmp,\
 	boost_headers \
 	vigra_headers \
diff --git a/include/basebmp/accessor.hxx b/basebmp/inc/accessor.hxx
similarity index 95%
rename from include/basebmp/accessor.hxx
rename to basebmp/inc/accessor.hxx
index b77af90..828d8fe 100644
--- a/include/basebmp/accessor.hxx
+++ b/basebmp/inc/accessor.hxx
@@ -17,8 +17,8 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_BASEBMP_ACCESSOR_HXX
-#define INCLUDED_BASEBMP_ACCESSOR_HXX
+#ifndef INCLUDED_BASEBMP_INC_ACCESSOR_HXX
+#define INCLUDED_BASEBMP_INC_ACCESSOR_HXX
 
 #include <vigra/numerictraits.hxx>
 
@@ -108,6 +108,6 @@ public:
 
 } // namespace basebmp
 
-#endif /* INCLUDED_BASEBMP_ACCESSOR_HXX */
+#endif /* INCLUDED_BASEBMP_INC_ACCESSOR_HXX */
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basebmp/accessoradapters.hxx b/basebmp/inc/accessoradapters.hxx
similarity index 99%
rename from include/basebmp/accessoradapters.hxx
rename to basebmp/inc/accessoradapters.hxx
index 0d0122e..8680565 100644
--- a/include/basebmp/accessoradapters.hxx
+++ b/basebmp/inc/accessoradapters.hxx
@@ -17,8 +17,8 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_BASEBMP_ACCESSORADAPTERS_HXX
-#define INCLUDED_BASEBMP_ACCESSORADAPTERS_HXX
+#ifndef INCLUDED_BASEBMP_INC_ACCESSORADAPTERS_HXX
+#define INCLUDED_BASEBMP_INC_ACCESSORADAPTERS_HXX
 
 #include <vigra/numerictraits.hxx>
 
@@ -515,6 +515,6 @@ public:
 
 } // namespace basebmp
 
-#endif /* INCLUDED_BASEBMP_ACCESSORADAPTERS_HXX */
+#endif /* INCLUDED_BASEBMP_INC_ACCESSORADAPTERS_HXX */
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basebmp/accessorfunctors.hxx b/basebmp/inc/accessorfunctors.hxx
similarity index 96%
rename from include/basebmp/accessorfunctors.hxx
rename to basebmp/inc/accessorfunctors.hxx
index 02e3aba..cae37ba 100644
--- a/include/basebmp/accessorfunctors.hxx
+++ b/basebmp/inc/accessorfunctors.hxx
@@ -17,11 +17,11 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_BASEBMP_ACCESSORFUNCTORS_HXX
-#define INCLUDED_BASEBMP_ACCESSORFUNCTORS_HXX
+#ifndef INCLUDED_BASEBMP_INC_ACCESSORFUNCTORS_HXX
+#define INCLUDED_BASEBMP_INC_ACCESSORFUNCTORS_HXX
 
 #include <osl/diagnose.h>
-#include <basebmp/metafunctions.hxx>
+#include <metafunctions.hxx>
 
 #include <functional>
 
@@ -176,6 +176,6 @@ public:
 
 } // namespace basebmp
 
-#endif /* INCLUDED_BASEBMP_ACCESSORFUNCTORS_HXX */
+#endif /* INCLUDED_BASEBMP_INC_ACCESSORFUNCTORS_HXX */
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basebmp/accessortraits.hxx b/basebmp/inc/accessortraits.hxx
similarity index 94%
rename from include/basebmp/accessortraits.hxx
rename to basebmp/inc/accessortraits.hxx
index eeabae0..24a7af2 100644
--- a/include/basebmp/accessortraits.hxx
+++ b/basebmp/inc/accessortraits.hxx
@@ -17,12 +17,12 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_BASEBMP_ACCESSORTRAITS_HXX
-#define INCLUDED_BASEBMP_ACCESSORTRAITS_HXX
+#ifndef INCLUDED_BASEBMP_INC_ACCESSORTRAITS_HXX
+#define INCLUDED_BASEBMP_INC_ACCESSORTRAITS_HXX
 
-#include <basebmp/accessorfunctors.hxx>
-#include <basebmp/accessoradapters.hxx>
-#include <basebmp/metafunctions.hxx>
+#include <accessorfunctors.hxx>
+#include <accessoradapters.hxx>
+#include <metafunctions.hxx>
 
 #include <o3tl/compat_functional.hxx>
 
@@ -121,6 +121,6 @@ template< class Accessor > struct AccessorTraits
 
 } // namespace basebmp
 
-#endif /* INCLUDED_BASEBMP_ACCESSORTRAITS_HXX */
+#endif /* INCLUDED_BASEBMP_INC_ACCESSORTRAITS_HXX */
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basebmp/clippedlinerenderer.hxx b/basebmp/inc/clippedlinerenderer.hxx
similarity index 98%
rename from include/basebmp/clippedlinerenderer.hxx
rename to basebmp/inc/clippedlinerenderer.hxx
index 0265a65..e863872 100644
--- a/include/basebmp/clippedlinerenderer.hxx
+++ b/basebmp/inc/clippedlinerenderer.hxx
@@ -17,8 +17,8 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_BASEBMP_CLIPPEDLINERENDERER_HXX
-#define INCLUDED_BASEBMP_CLIPPEDLINERENDERER_HXX
+#ifndef INCLUDED_BASEBMP_INC_CLIPPEDLINERENDERER_HXX
+#define INCLUDED_BASEBMP_INC_CLIPPEDLINERENDERER_HXX
 
 #include <basegfx/tools/rectcliptools.hxx>
 #include <basegfx/point/b2ipoint.hxx>
@@ -433,6 +433,6 @@ void renderClippedLine( basegfx::B2IPoint             aPt1,
 
 } // namespace basebmp
 
-#endif /* INCLUDED_BASEBMP_CLIPPEDLINERENDERER_HXX */
+#endif /* INCLUDED_BASEBMP_INC_CLIPPEDLINERENDERER_HXX */
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basebmp/colorblendaccessoradapter.hxx b/basebmp/inc/colorblendaccessoradapter.hxx
similarity index 95%
rename from include/basebmp/colorblendaccessoradapter.hxx
rename to basebmp/inc/colorblendaccessoradapter.hxx
index 59055b0..b9465fb 100644
--- a/include/basebmp/colorblendaccessoradapter.hxx
+++ b/basebmp/inc/colorblendaccessoradapter.hxx
@@ -17,10 +17,10 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_BASEBMP_COLORBLENDACCESSORADAPTER_HXX
-#define INCLUDED_BASEBMP_COLORBLENDACCESSORADAPTER_HXX
+#ifndef INCLUDED_BASEBMP_INC_COLORBLENDACCESSORADAPTER_HXX
+#define INCLUDED_BASEBMP_INC_COLORBLENDACCESSORADAPTER_HXX
 
-#include <basebmp/colortraits.hxx>
+#include <colortraits.hxx>
 
 namespace basebmp
 {
@@ -137,6 +137,6 @@ public:
 
 } // namespace basebmp
 
-#endif /* INCLUDED_BASEBMP_COLORBLENDACCESSORADAPTER_HXX */
+#endif /* INCLUDED_BASEBMP_INC_COLORBLENDACCESSORADAPTER_HXX */
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basebmp/colormisc.hxx b/basebmp/inc/colormisc.hxx
similarity index 96%
rename from include/basebmp/colormisc.hxx
rename to basebmp/inc/colormisc.hxx
index 233c318..84b9d85 100644
--- a/include/basebmp/colormisc.hxx
+++ b/basebmp/inc/colormisc.hxx
@@ -17,13 +17,13 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_BASEBMP_COLORMISC_HXX
-#define INCLUDED_BASEBMP_COLORMISC_HXX
+#ifndef INCLUDED_BASEBMP_INC_COLORMISC_HXX
+#define INCLUDED_BASEBMP_INC_COLORMISC_HXX
 
 #include <osl/diagnose.h>
 #include <basebmp/color.hxx>
-#include <basebmp/colortraits.hxx>
-#include <basebmp/accessortraits.hxx>
+#include <colortraits.hxx>
+#include <accessortraits.hxx>
 #include <vigra/mathutil.hxx>
 
 // Contents of this header moved out of color.hxx, as it is not useful
@@ -180,6 +180,6 @@ struct NumericTraits<basebmp::Color>
 
 } // namespace vigra
 
-#endif /* INCLUDED_BASEBMP_COLORMISC_HXX */
+#endif /* INCLUDED_BASEBMP_INC_COLORMISC_HXX */
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basebmp/colortraits.hxx b/basebmp/inc/colortraits.hxx
similarity index 95%
rename from include/basebmp/colortraits.hxx
rename to basebmp/inc/colortraits.hxx
index 0b0c492..5cbfeed 100644
--- a/include/basebmp/colortraits.hxx
+++ b/basebmp/inc/colortraits.hxx
@@ -17,11 +17,11 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_BASEBMP_COLORTRAITS_HXX
-#define INCLUDED_BASEBMP_COLORTRAITS_HXX
+#ifndef INCLUDED_BASEBMP_INC_COLORTRAITS_HXX
+#define INCLUDED_BASEBMP_INC_COLORTRAITS_HXX
 
-#include <basebmp/accessoradapters.hxx>
-#include <basebmp/metafunctions.hxx>
+#include <accessoradapters.hxx>
+#include <metafunctions.hxx>
 
 #include <vigra/mathutil.hxx>
 
@@ -139,6 +139,6 @@ template< typename ColorType > struct ColorTraits
 
 } // namespace basebmp
 
-#endif /* INCLUDED_BASEBMP_COLORTRAITS_HXX */
+#endif /* INCLUDED_BASEBMP_INC_COLORTRAITS_HXX */
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basebmp/compositeiterator.hxx b/basebmp/inc/compositeiterator.hxx
similarity index 98%
rename from include/basebmp/compositeiterator.hxx
rename to basebmp/inc/compositeiterator.hxx
index 1823181..2db654a 100644
--- a/include/basebmp/compositeiterator.hxx
+++ b/basebmp/inc/compositeiterator.hxx
@@ -17,13 +17,13 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_BASEBMP_COMPOSITEITERATOR_HXX
-#define INCLUDED_BASEBMP_COMPOSITEITERATOR_HXX
+#ifndef INCLUDED_BASEBMP_INC_COMPOSITEITERATOR_HXX
+#define INCLUDED_BASEBMP_INC_COMPOSITEITERATOR_HXX
 
 #include <sal/types.h>
 #include <osl/diagnose.h>
 
-#include <basebmp/nonstandarditerator.hxx>
+#include <nonstandarditerator.hxx>
 #include <vigra/tuple.hxx>
 #include <vigra/iteratortraits.hxx>
 
@@ -390,6 +390,6 @@ public:
 
 } // namespace basebmp
 
-#endif /* INCLUDED_BASEBMP_COMPOSITEITERATOR_HXX */
+#endif /* INCLUDED_BASEBMP_INC_COMPOSITEITERATOR_HXX */
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basebmp/endian.hxx b/basebmp/inc/endian.hxx
similarity index 92%
rename from include/basebmp/endian.hxx
rename to basebmp/inc/endian.hxx
index 22c32b6..a924f5a 100644
--- a/include/basebmp/endian.hxx
+++ b/basebmp/inc/endian.hxx
@@ -17,8 +17,8 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_BASEBMP_ENDIAN_HXX
-#define INCLUDED_BASEBMP_ENDIAN_HXX
+#ifndef INCLUDED_BASEBMP_INC_ENDIAN_HXX
+#define INCLUDED_BASEBMP_INC_ENDIAN_HXX
 
 #include <osl/endian.h>
 
@@ -46,6 +46,6 @@ BASEBMP_BYTE_SWAP(sal_uInt32,OSL_SWAPDWORD)
 
 } // namespace basebmp
 
-#endif /* INCLUDED_BASEBMP_ENDIAN_HXX */
+#endif /* INCLUDED_BASEBMP_INC_ENDIAN_HXX */
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basebmp/fillimage.hxx b/basebmp/inc/fillimage.hxx
similarity index 93%
rename from include/basebmp/fillimage.hxx
rename to basebmp/inc/fillimage.hxx
index 561b029..7acd901 100644
--- a/include/basebmp/fillimage.hxx
+++ b/basebmp/inc/fillimage.hxx
@@ -17,8 +17,8 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_BASEBMP_FILLIMAGE_HXX
-#define INCLUDED_BASEBMP_FILLIMAGE_HXX
+#ifndef INCLUDED_BASEBMP_INC_FILLIMAGE_HXX
+#define INCLUDED_BASEBMP_INC_FILLIMAGE_HXX
 
 #include <vigra/tuple.hxx>
 #include <vigra/iteratortraits.hxx>
@@ -58,6 +58,6 @@ inline void fillImage( vigra::triple<DestIterator,DestIterator,DestAccessor> con
 
 } // namespace basebmp
 
-#endif /* INCLUDED_BASEBMP_FILLIMAGE_HXX */
+#endif /* INCLUDED_BASEBMP_INC_FILLIMAGE_HXX */
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basebmp/genericcolorimageaccessor.hxx b/basebmp/inc/genericcolorimageaccessor.hxx
similarity index 93%
rename from include/basebmp/genericcolorimageaccessor.hxx
rename to basebmp/inc/genericcolorimageaccessor.hxx
index 5aaa953..c8fbe55 100644
--- a/include/basebmp/genericcolorimageaccessor.hxx
+++ b/basebmp/inc/genericcolorimageaccessor.hxx
@@ -17,8 +17,8 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_BASEBMP_GENERICCOLORIMAGEACCESSOR_HXX
-#define INCLUDED_BASEBMP_GENERICCOLORIMAGEACCESSOR_HXX
+#ifndef INCLUDED_BASEBMP_INC_GENERICCOLORIMAGEACCESSOR_HXX
+#define INCLUDED_BASEBMP_INC_GENERICCOLORIMAGEACCESSOR_HXX
 
 #include <basebmp/color.hxx>
 #include <basebmp/bitmapdevice.hxx>
@@ -71,6 +71,6 @@ namespace basebmp
     };
 }
 
-#endif /* INCLUDED_BASEBMP_GENERICCOLORIMAGEACCESSOR_HXX */
+#endif /* INCLUDED_BASEBMP_INC_GENERICCOLORIMAGEACCESSOR_HXX */
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basebmp/greylevelformats.hxx b/basebmp/inc/greylevelformats.hxx
similarity index 91%
rename from include/basebmp/greylevelformats.hxx
rename to basebmp/inc/greylevelformats.hxx
index 705c26d..a758fa9 100644
--- a/include/basebmp/greylevelformats.hxx
+++ b/basebmp/inc/greylevelformats.hxx
@@ -17,16 +17,16 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_BASEBMP_GREYLEVELFORMATS_HXX
-#define INCLUDED_BASEBMP_GREYLEVELFORMATS_HXX
+#ifndef INCLUDED_BASEBMP_INC_GREYLEVELFORMATS_HXX
+#define INCLUDED_BASEBMP_INC_GREYLEVELFORMATS_HXX
 
 #include <basebmp/color.hxx>
-#include <basebmp/colortraits.hxx>
-#include <basebmp/accessor.hxx>
-#include <basebmp/pixeliterator.hxx>
-#include <basebmp/packedpixeliterator.hxx>
-#include <basebmp/pixelformatadapters.hxx>
-#include <basebmp/metafunctions.hxx>
+#include <colortraits.hxx>
+#include <accessor.hxx>
+#include <pixeliterator.hxx>
+#include <packedpixeliterator.hxx>
+#include <pixelformatadapters.hxx>
+#include <metafunctions.hxx>
 
 #include <vigra/numerictraits.hxx>
 #include <vigra/metaprogramming.hxx>
@@ -124,6 +124,6 @@ BASEBMP_SPECIALIZE_ACCESSORTRAITS(PixelFormatTraits_GREY8::getter_type,
 
 } // namespace basebmp
 
-#endif /* INCLUDED_BASEBMP_GREYLEVELFORMATS_HXX */
+#endif /* INCLUDED_BASEBMP_INC_GREYLEVELFORMATS_HXX */
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basebmp/iteratortraits.hxx b/basebmp/inc/iteratortraits.hxx
similarity index 88%
rename from include/basebmp/iteratortraits.hxx
rename to basebmp/inc/iteratortraits.hxx
index 5d87df7..a0b65f5 100644
--- a/include/basebmp/iteratortraits.hxx
+++ b/basebmp/inc/iteratortraits.hxx
@@ -17,11 +17,11 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_BASEBMP_ITERATORTRAITS_HXX
-#define INCLUDED_BASEBMP_ITERATORTRAITS_HXX
+#ifndef INCLUDED_BASEBMP_INC_ITERATORTRAITS_HXX
+#define INCLUDED_BASEBMP_INC_ITERATORTRAITS_HXX
 
-#include <basebmp/accessor.hxx>
-#include <basebmp/nonstandarditerator.hxx>
+#include <accessor.hxx>
+#include <nonstandarditerator.hxx>
 
 namespace basebmp
 {
@@ -44,6 +44,6 @@ template< class Iterator > struct IteratorTraits
 
 } // namespace basebmp
 
-#endif /* INCLUDED_BASEBMP_ITERATORTRAITS_HXX */
+#endif /* INCLUDED_BASEBMP_INC_ITERATORTRAITS_HXX */
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basebmp/metafunctions.hxx b/basebmp/inc/metafunctions.hxx
similarity index 97%
rename from include/basebmp/metafunctions.hxx
rename to basebmp/inc/metafunctions.hxx
index 1f3f180..16ee261 100644
--- a/include/basebmp/metafunctions.hxx
+++ b/basebmp/inc/metafunctions.hxx
@@ -17,8 +17,8 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_BASEBMP_METAFUNCTIONS_HXX
-#define INCLUDED_BASEBMP_METAFUNCTIONS_HXX
+#ifndef INCLUDED_BASEBMP_INC_METAFUNCTIONS_HXX
+#define INCLUDED_BASEBMP_INC_METAFUNCTIONS_HXX
 
 #include <boost/mpl/integral_c.hpp>
 #include <vigra/metaprogramming.hxx>
@@ -212,6 +212,6 @@ template< typename T > inline T shiftRight( T v, int shift )
 
 } // namespace basebmp
 
-#endif /* INCLUDED_BASEBMP_METAFUNCTIONS_HXX */
+#endif /* INCLUDED_BASEBMP_INC_METAFUNCTIONS_HXX */
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basebmp/nonstandarditerator.hxx b/basebmp/inc/nonstandarditerator.hxx
similarity index 88%
rename from include/basebmp/nonstandarditerator.hxx
rename to basebmp/inc/nonstandarditerator.hxx
index ff51c59..fbf9683 100644
--- a/include/basebmp/nonstandarditerator.hxx
+++ b/basebmp/inc/nonstandarditerator.hxx
@@ -17,8 +17,8 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_BASEBMP_NONSTANDARDITERATOR_HXX
-#define INCLUDED_BASEBMP_NONSTANDARDITERATOR_HXX
+#ifndef INCLUDED_BASEBMP_INC_NONSTANDARDITERATOR_HXX
+#define INCLUDED_BASEBMP_INC_NONSTANDARDITERATOR_HXX
 
 #include <vigra/metaprogramming.hxx>
 
@@ -34,6 +34,6 @@ namespace basebmp
 
 } // namespace basebmp
 
-#endif /* INCLUDED_BASEBMP_NONSTANDARDITERATOR_HXX */
+#endif /* INCLUDED_BASEBMP_INC_NONSTANDARDITERATOR_HXX */
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basebmp/packedpixeliterator.hxx b/basebmp/inc/packedpixeliterator.hxx
similarity index 98%
rename from include/basebmp/packedpixeliterator.hxx
rename to basebmp/inc/packedpixeliterator.hxx
index a536cec..b7bcac0 100644
--- a/include/basebmp/packedpixeliterator.hxx
+++ b/basebmp/inc/packedpixeliterator.hxx
@@ -17,13 +17,13 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_BASEBMP_PACKEDPIXELITERATOR_HXX
-#define INCLUDED_BASEBMP_PACKEDPIXELITERATOR_HXX
+#ifndef INCLUDED_BASEBMP_INC_PACKEDPIXELITERATOR_HXX
+#define INCLUDED_BASEBMP_INC_PACKEDPIXELITERATOR_HXX
 
-#include <basebmp/metafunctions.hxx>
-#include <basebmp/stridedarrayiterator.hxx>
-#include <basebmp/nonstandarditerator.hxx>
-#include <basebmp/accessortraits.hxx>
+#include <metafunctions.hxx>
+#include <stridedarrayiterator.hxx>
+#include <nonstandarditerator.hxx>
+#include <accessortraits.hxx>
 
 #include <vigra/metaprogramming.hxx>
 #include <vigra/diff2d.hxx>
@@ -665,6 +665,6 @@ template< class Accessor,
 
 } // namespace basebmp
 
-#endif /* INCLUDED_BASEBMP_PACKEDPIXELITERATOR_HXX */
+#endif /* INCLUDED_BASEBMP_INC_PACKEDPIXELITERATOR_HXX */
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basebmp/paletteformats.hxx b/basebmp/inc/paletteformats.hxx
similarity index 91%
rename from include/basebmp/paletteformats.hxx
rename to basebmp/inc/paletteformats.hxx
index 083164c..f42424c 100644
--- a/include/basebmp/paletteformats.hxx
+++ b/basebmp/inc/paletteformats.hxx
@@ -17,17 +17,17 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_BASEBMP_PALETTEFORMATS_HXX
-#define INCLUDED_BASEBMP_PALETTEFORMATS_HXX
+#ifndef INCLUDED_BASEBMP_INC_PALETTEFORMATS_HXX
+#define INCLUDED_BASEBMP_INC_PALETTEFORMATS_HXX
 
 #include <basebmp/color.hxx>
-#include <basebmp/colortraits.hxx>
-#include <basebmp/accessor.hxx>
-#include <basebmp/pixeliterator.hxx>
-#include <basebmp/packedpixeliterator.hxx>
-#include <basebmp/pixelformatadapters.hxx>
-#include <basebmp/paletteimageaccessor.hxx>
-#include <basebmp/metafunctions.hxx>
+#include <colortraits.hxx>
+#include <accessor.hxx>
+#include <pixeliterator.hxx>
+#include <packedpixeliterator.hxx>
+#include <pixelformatadapters.hxx>
+#include <paletteimageaccessor.hxx>
+#include <metafunctions.hxx>
 
 #include <vigra/numerictraits.hxx>
 #include <vigra/metaprogramming.hxx>
@@ -134,6 +134,6 @@ typedef PixelFormatTraitsTemplate_Palette<
 
 } // namespace basebmp
 
-#endif // INCLUDED_BASEBMP_PALETTEFORMATS_HXX
+#endif // INCLUDED_BASEBMP_INC_PALETTEFORMATS_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basebmp/paletteimageaccessor.hxx b/basebmp/inc/paletteimageaccessor.hxx
similarity index 95%
rename from include/basebmp/paletteimageaccessor.hxx
rename to basebmp/inc/paletteimageaccessor.hxx
index d19cd03..85d5488 100644
--- a/include/basebmp/paletteimageaccessor.hxx
+++ b/basebmp/inc/paletteimageaccessor.hxx
@@ -17,11 +17,11 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_BASEBMP_PALETTEIMAGEACCESSOR_HXX
-#define INCLUDED_BASEBMP_PALETTEIMAGEACCESSOR_HXX
+#ifndef INCLUDED_BASEBMP_INC_PALETTEIMAGEACCESSOR_HXX
+#define INCLUDED_BASEBMP_INC_PALETTEIMAGEACCESSOR_HXX
 
-#include <basebmp/colortraits.hxx>
-#include <basebmp/accessortraits.hxx>
+#include <colortraits.hxx>
+#include <accessortraits.hxx>
 
 #include <vigra/numerictraits.hxx>
 #include <vigra/metaprogramming.hxx>
@@ -157,6 +157,6 @@ public:
 
 } // namespace basebmp
 
-#endif /* INCLUDED_BASEBMP_PALETTEIMAGEACCESSOR_HXX */
+#endif /* INCLUDED_BASEBMP_INC_PALETTEIMAGEACCESSOR_HXX */
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basebmp/pixelformatadapters.hxx b/basebmp/inc/pixelformatadapters.hxx
similarity index 94%
rename from include/basebmp/pixelformatadapters.hxx
rename to basebmp/inc/pixelformatadapters.hxx
index 3789b7e..9a6a11d 100644
--- a/include/basebmp/pixelformatadapters.hxx
+++ b/basebmp/inc/pixelformatadapters.hxx
@@ -17,11 +17,11 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_BASEBMP_PIXELFORMATADAPTERS_HXX
-#define INCLUDED_BASEBMP_PIXELFORMATADAPTERS_HXX
+#ifndef INCLUDED_BASEBMP_INC_PIXELFORMATADAPTERS_HXX
+#define INCLUDED_BASEBMP_INC_PIXELFORMATADAPTERS_HXX
 
-#include <basebmp/accessortraits.hxx>
-#include <basebmp/accessoradapters.hxx>
+#include <accessortraits.hxx>
+#include <accessoradapters.hxx>
 
 #include <vigra/metaprogramming.hxx>
 
@@ -97,6 +97,6 @@ template< class Accessor > struct AccessorTraits<                 \
 
 } // namespace basebmp
 
-#endif /* INCLUDED_BASEBMP_PIXELFORMATADAPTERS_HXX */
+#endif /* INCLUDED_BASEBMP_INC_PIXELFORMATADAPTERS_HXX */
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basebmp/pixeliterator.hxx b/basebmp/inc/pixeliterator.hxx
similarity index 97%
rename from include/basebmp/pixeliterator.hxx
rename to basebmp/inc/pixeliterator.hxx
index e629af2..d38af98 100644
--- a/include/basebmp/pixeliterator.hxx
+++ b/basebmp/inc/pixeliterator.hxx
@@ -17,11 +17,11 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_BASEBMP_PIXELITERATOR_HXX
-#define INCLUDED_BASEBMP_PIXELITERATOR_HXX
+#ifndef INCLUDED_BASEBMP_INC_PIXELITERATOR_HXX
+#define INCLUDED_BASEBMP_INC_PIXELITERATOR_HXX
 
-#include <basebmp/metafunctions.hxx>
-#include <basebmp/stridedarrayiterator.hxx>
+#include <metafunctions.hxx>
+#include <stridedarrayiterator.hxx>
 
 #include <vigra/metaprogramming.hxx>
 #include <vigra/diff2d.hxx>
@@ -344,6 +344,6 @@ public:
 
 } // namespace basebmp
 
-#endif /* INCLUDED_BASEBMP_PIXELITERATOR_HXX */
+#endif /* INCLUDED_BASEBMP_INC_PIXELITERATOR_HXX */
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basebmp/polypolygonrenderer.hxx b/basebmp/inc/polypolygonrenderer.hxx
similarity index 98%
rename from include/basebmp/polypolygonrenderer.hxx
rename to basebmp/inc/polypolygonrenderer.hxx
index 88963ae..1c83f32 100644
--- a/include/basebmp/polypolygonrenderer.hxx
+++ b/basebmp/inc/polypolygonrenderer.hxx
@@ -17,8 +17,8 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_BASEBMP_POLYPOLYGONRENDERER_HXX
-#define INCLUDED_BASEBMP_POLYPOLYGONRENDERER_HXX
+#ifndef INCLUDED_BASEBMP_INC_POLYPOLYGONRENDERER_HXX
+#define INCLUDED_BASEBMP_INC_POLYPOLYGONRENDERER_HXX
 
 #include <basegfx/point/b2dpoint.hxx>
 #include <basegfx/range/b2drange.hxx>
@@ -355,6 +355,6 @@ namespace basebmp
 
 } // namespace basebmp
 
-#endif /* INCLUDED_BASEBMP_POLYPOLYGONRENDERER_HXX */
+#endif /* INCLUDED_BASEBMP_INC_POLYPOLYGONRENDERER_HXX */
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basebmp/rgb24pixelformats.hxx b/basebmp/inc/rgb24pixelformats.hxx
similarity index 91%
rename from include/basebmp/rgb24pixelformats.hxx
rename to basebmp/inc/rgb24pixelformats.hxx
index 50c110a..6b7edd7 100644
--- a/include/basebmp/rgb24pixelformats.hxx
+++ b/basebmp/inc/rgb24pixelformats.hxx
@@ -17,13 +17,13 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_BASEBMP_RGB24PIXELFORMATS_HXX
-#define INCLUDED_BASEBMP_RGB24PIXELFORMATS_HXX
+#ifndef INCLUDED_BASEBMP_INC_RGB24PIXELFORMATS_HXX
+#define INCLUDED_BASEBMP_INC_RGB24PIXELFORMATS_HXX
 
 #include <basebmp/color.hxx>
-#include <basebmp/accessor.hxx>
-#include <basebmp/pixeliterator.hxx>
-#include <basebmp/pixelformatadapters.hxx>
+#include <accessor.hxx>
+#include <pixeliterator.hxx>
+#include <pixelformatadapters.hxx>
 
 #include <vigra/rgbvalue.hxx>
 
@@ -87,6 +87,6 @@ BASEBMP_SPECIALIZE_ACCESSORTRAITS(PixelFormatTraits_BGR24::getter_type,
 
 } // namespace basebmp
 
-#endif /* INCLUDED_BASEBMP_RGB24PIXELFORMATS_HXX */
+#endif /* INCLUDED_BASEBMP_INC_RGB24PIXELFORMATS_HXX */
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basebmp/rgbmaskpixelformats.hxx b/basebmp/inc/rgbmaskpixelformats.hxx
similarity index 97%
rename from include/basebmp/rgbmaskpixelformats.hxx
rename to basebmp/inc/rgbmaskpixelformats.hxx
index 262b17e..6306882 100644
--- a/include/basebmp/rgbmaskpixelformats.hxx
+++ b/basebmp/inc/rgbmaskpixelformats.hxx
@@ -17,16 +17,16 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_BASEBMP_RGBMASKPIXELFORMATS_HXX
-#define INCLUDED_BASEBMP_RGBMASKPIXELFORMATS_HXX
+#ifndef INCLUDED_BASEBMP_INC_RGBMASKPIXELFORMATS_HXX
+#define INCLUDED_BASEBMP_INC_RGBMASKPIXELFORMATS_HXX
 
 #include <basebmp/color.hxx>
-#include <basebmp/colortraits.hxx>
-#include <basebmp/accessor.hxx>
-#include <basebmp/pixeliterator.hxx>
-#include <basebmp/pixelformatadapters.hxx>
-#include <basebmp/metafunctions.hxx>
-#include <basebmp/endian.hxx>
+#include <colortraits.hxx>
+#include <accessor.hxx>
+#include <pixeliterator.hxx>
+#include <pixelformatadapters.hxx>
+#include <metafunctions.hxx>
+#include <endian.hxx>
 
 #include <vigra/numerictraits.hxx>
 #include <vigra/metaprogramming.hxx>
@@ -350,6 +350,6 @@ BASEBMP_SPECIALIZE_ACCESSORTRAITS(PixelFormatTraits_BGRX32_8888::getter_type,
 
 } // namespace basebmp
 
-#endif /* INCLUDED_BASEBMP_RGBMASKPIXELFORMATS_HXX */
+#endif /* INCLUDED_BASEBMP_INC_RGBMASKPIXELFORMATS_HXX */
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basebmp/scaleimage.hxx b/basebmp/inc/scaleimage.hxx
similarity index 97%
rename from include/basebmp/scaleimage.hxx
rename to basebmp/inc/scaleimage.hxx
index fc90223..69beaf6 100644
--- a/include/basebmp/scaleimage.hxx
+++ b/basebmp/inc/scaleimage.hxx
@@ -17,8 +17,8 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_BASEBMP_SCALEIMAGE_HXX
-#define INCLUDED_BASEBMP_SCALEIMAGE_HXX
+#ifndef INCLUDED_BASEBMP_INC_SCALEIMAGE_HXX
+#define INCLUDED_BASEBMP_INC_SCALEIMAGE_HXX
 
 #include <osl/diagnose.h>
 
@@ -184,6 +184,6 @@ inline void scaleImage( vigra::triple<SourceIter,SourceIter,SourceAcc> const& sr
 
 }
 
-#endif /* INCLUDED_BASEBMP_SCALEIMAGE_HXX */
+#endif /* INCLUDED_BASEBMP_INC_SCALEIMAGE_HXX */
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basebmp/stridedarrayiterator.hxx b/basebmp/inc/stridedarrayiterator.hxx
similarity index 94%
rename from include/basebmp/stridedarrayiterator.hxx
rename to basebmp/inc/stridedarrayiterator.hxx
index 6f5772e..821d3aa 100644
--- a/include/basebmp/stridedarrayiterator.hxx
+++ b/basebmp/inc/stridedarrayiterator.hxx
@@ -17,10 +17,10 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_BASEBMP_STRIDEDARRAYITERATOR_HXX
-#define INCLUDED_BASEBMP_STRIDEDARRAYITERATOR_HXX
+#ifndef INCLUDED_BASEBMP_INC_STRIDEDARRAYITERATOR_HXX
+#define INCLUDED_BASEBMP_INC_STRIDEDARRAYITERATOR_HXX
 
-#include <basebmp/metafunctions.hxx>
+#include <metafunctions.hxx>
 
 namespace basebmp
 {
@@ -103,6 +103,6 @@ private:
 
 } // namespace basebmp
 
-#endif /* INCLUDED_BASEBMP_STRIDEDARRAYITERATOR_HXX */
+#endif /* INCLUDED_BASEBMP_INC_STRIDEDARRAYITERATOR_HXX */
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basebmp/tools.hxx b/basebmp/inc/tools.hxx
similarity index 96%
rename from include/basebmp/tools.hxx
rename to basebmp/inc/tools.hxx
index 31854a1..c562a30 100644
--- a/include/basebmp/tools.hxx
+++ b/basebmp/inc/tools.hxx
@@ -17,8 +17,8 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_BASEBMP_TOOLS_HXX
-#define INCLUDED_BASEBMP_TOOLS_HXX
+#ifndef INCLUDED_BASEBMP_INC_TOOLS_HXX
+#define INCLUDED_BASEBMP_INC_TOOLS_HXX
 
 #include <basegfx/range/b2ibox.hxx>
 #include <basegfx/point/b2ipoint.hxx>
@@ -80,6 +80,6 @@ namespace basebmp
     }
 }
 
-#endif /* INCLUDED_BASEBMP_TOOLS_HXX */
+#endif /* INCLUDED_BASEBMP_INC_TOOLS_HXX */
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/basebmp/source/bitmapdevice.cxx b/basebmp/source/bitmapdevice.cxx
index 04d4892..4ef38f0 100644
--- a/basebmp/source/bitmapdevice.cxx
+++ b/basebmp/source/bitmapdevice.cxx
@@ -24,31 +24,31 @@
 
 #include <basebmp/bitmapdevice.hxx>
 
-#include <basebmp/compositeiterator.hxx>
-#include <basebmp/iteratortraits.hxx>
+#include <compositeiterator.hxx>
+#include <iteratortraits.hxx>
 
-#include <basebmp/accessor.hxx>
-#include <basebmp/accessortraits.hxx>
-#include <basebmp/accessoradapters.hxx>
-#include <basebmp/colorblendaccessoradapter.hxx>
+#include <accessor.hxx>
+#include <accessortraits.hxx>
+#include <accessoradapters.hxx>
+#include <colorblendaccessoradapter.hxx>
 
 #include <basebmp/color.hxx>
-#include <basebmp/colormisc.hxx>
-#include <basebmp/colortraits.hxx>
+#include <colormisc.hxx>
+#include <colortraits.hxx>
 
-#include <basebmp/greylevelformats.hxx>
-#include <basebmp/paletteformats.hxx>
-#include <basebmp/rgbmaskpixelformats.hxx>
-#include <basebmp/rgb24pixelformats.hxx>
+#include <greylevelformats.hxx>
+#include <paletteformats.hxx>
+#include <rgbmaskpixelformats.hxx>
+#include <rgb24pixelformats.hxx>
 
 #include <basebmp/scanlineformats.hxx>
-#include <basebmp/fillimage.hxx>
-#include <basebmp/scaleimage.hxx>
-#include <basebmp/clippedlinerenderer.hxx>
-#include <basebmp/polypolygonrenderer.hxx>
-#include <basebmp/genericcolorimageaccessor.hxx>
+#include <fillimage.hxx>
+#include <scaleimage.hxx>
+#include <clippedlinerenderer.hxx>
+#include <polypolygonrenderer.hxx>
+#include <genericcolorimageaccessor.hxx>
 
-#include <basebmp/tools.hxx>
+#include <tools.hxx>
 #include "intconversion.hxx"
 
 #include <rtl/alloc.h>
diff --git a/basebmp/source/polypolygonrenderer.cxx b/basebmp/source/polypolygonrenderer.cxx
index 55d6d69..91cd273 100644
--- a/basebmp/source/polypolygonrenderer.cxx
+++ b/basebmp/source/polypolygonrenderer.cxx
@@ -17,7 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include <basebmp/polypolygonrenderer.hxx>
+#include <polypolygonrenderer.hxx>
 
 #include <algorithm>
 
commit 6bb268db9ea30224d3858098b5eae71f32729846
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Tue Sep 29 10:47:31 2015 +0200

    lok: add Document::getPartPageRectangles()
    
    Change-Id: I20acd44f7a81471982ba96ad3894a9124e035c5f
    (cherry picked from commit d355207b45755cfe1eef0147bc25ead931741684)

diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index d7b9347..a7696d8 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -52,12 +52,14 @@ public:
     void testGetFonts();
     void testCreateView();
     void testGetFilterTypes();
+    void testGetPartPageRectangles();
 
     CPPUNIT_TEST_SUITE(DesktopLOKTest);
     CPPUNIT_TEST(testGetStyles);
     CPPUNIT_TEST(testGetFonts);
     CPPUNIT_TEST(testCreateView);
     CPPUNIT_TEST(testGetFilterTypes);
+    CPPUNIT_TEST(testGetPartPageRectangles);
     CPPUNIT_TEST_SUITE_END();
 
     uno::Reference<lang::XComponent> mxComponent;
@@ -152,6 +154,29 @@ void DesktopLOKTest::testCreateView()
     closeDoc();
 }
 
+void DesktopLOKTest::testGetPartPageRectangles()
+{
+    // Test that we get as many page rectangles as expected: blank document is
+    // one page.
+    LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
+    char* pRectangles = pDocument->pClass->getPartPageRectangles(pDocument);
+    OUString sRectangles = OUString::fromUtf8(pRectangles);
+
+    std::vector<OUString> aRectangles;
+    sal_Int32 nIndex = 0;
+    do
+    {
+        OUString aRectangle = sRectangles.getToken(0, ';', nIndex);
+        if (!aRectangle.isEmpty())
+            aRectangles.push_back(aRectangle);
+    }
+    while (nIndex >= 0);
+    CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aRectangles.size());
+
+    free(pRectangles);
+    closeDoc();
+}
+
 void DesktopLOKTest::testGetFilterTypes()
 {
     LibLibreOffice_Impl aOffice;
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index ea849f2..a4d904c 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -207,6 +207,7 @@ static void doc_destroy(LibreOfficeKitDocument* pThis);
 static int  doc_saveAs(LibreOfficeKitDocument* pThis, const char* pUrl, const char* pFormat, const char* pFilterOptions);
 static int doc_getDocumentType(LibreOfficeKitDocument* pThis);
 static int doc_getParts(LibreOfficeKitDocument* pThis);
+static char* doc_getPartPageRectangles(LibreOfficeKitDocument* pThis);
 static int doc_getPart(LibreOfficeKitDocument* pThis);
 static void doc_setPart(LibreOfficeKitDocument* pThis, int nPart);
 static char* doc_getPartName(LibreOfficeKitDocument* pThis, int nPart);
@@ -269,6 +270,7 @@ LibLODocument_Impl::LibLODocument_Impl(const uno::Reference <css::lang::XCompone
         m_pDocumentClass->saveAs = doc_saveAs;
         m_pDocumentClass->getDocumentType = doc_getDocumentType;
         m_pDocumentClass->getParts = doc_getParts;
+        m_pDocumentClass->getPartPageRectangles = doc_getPartPageRectangles;
         m_pDocumentClass->getPart = doc_getPart;
         m_pDocumentClass->setPart = doc_setPart;
         m_pDocumentClass->getPartName = doc_getPartName;
@@ -661,6 +663,23 @@ static void doc_setPart(LibreOfficeKitDocument* pThis, int nPart)
     pDoc->setPart( nPart );
 }
 
+static char* doc_getPartPageRectangles(LibreOfficeKitDocument* pThis)
+{
+    ITiledRenderable* pDoc = getTiledRenderable(pThis);
+    if (!pDoc)
+    {
+        gImpl->maLastExceptionMsg = "Document doesn't support tiled rendering";
+        return 0;
+    }
+
+    OUString sRectangles = pDoc->getPartPageRectangles();
+    OString aString = OUStringToOString(sRectangles, RTL_TEXTENCODING_UTF8);
+    char* pMemory = static_cast<char*>(malloc(aString.getLength() + 1));
+    strcpy(pMemory, aString.getStr());
+    return pMemory;
+
+}
+
 static char* doc_getPartName(LibreOfficeKitDocument* pThis, int nPart)
 {
     ITiledRenderable* pDoc = getTiledRenderable(pThis);
diff --git a/include/LibreOfficeKit/LibreOfficeKit.h b/include/LibreOfficeKit/LibreOfficeKit.h
index d5094bd..d83dd49 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/include/LibreOfficeKit/LibreOfficeKit.h
@@ -85,6 +85,9 @@ struct _LibreOfficeKitDocumentClass
     /// @see lok::Document::getParts().
     int (*getParts) (LibreOfficeKitDocument* pThis);
 
+    /// @see lok::Document::getPartPageRectangles().
+    char* (*getPartPageRectangles) (LibreOfficeKitDocument* pThis);
+
     /// @see lok::Document::getPart().
     int (*getPart) (LibreOfficeKitDocument* pThis);
 
diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx b/include/LibreOfficeKit/LibreOfficeKit.hxx
index 207a9ce..cd12ad6 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -76,6 +76,20 @@ public:
         return mpDoc->pClass->getParts(mpDoc);
     }
 
+    /**
+     * Get the logical rectangle of each part in the document.
+     *
+     * A part refers to an individual page in Writer and has no relevant for
+     * Calc or Impress.
+     *
+     * @return a rectangle list, using the same format as
+     * LOK_CALLBACK_TEXT_SELECTION.
+     */
+    inline char* getPartPageRectangles()
+    {
+        return mpDoc->pClass->getPartPageRectangles(mpDoc);
+    }
+
     /// Get the current part of the document.
     inline int getPart()
     {
diff --git a/include/vcl/ITiledRenderable.hxx b/include/vcl/ITiledRenderable.hxx
index 18bd3a4..69889fc 100644
--- a/include/vcl/ITiledRenderable.hxx
+++ b/include/vcl/ITiledRenderable.hxx
@@ -139,6 +139,14 @@ public:
      * @see lok::Document::resetSelection().
      */
     virtual void resetSelection() = 0;
+
+    /**
+     * @see lok::Document::getPartPageRectangles().
+     */
+    virtual OUString getPartPageRectangles()
+    {
+        return OUString();
+    }
 };
 
 } // namespace vcl
diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx
index 0345c42..1528811 100644
--- a/sw/inc/crsrsh.hxx
+++ b/sw/inc/crsrsh.hxx
@@ -854,6 +854,8 @@ public:
     OUString GetCrsrDescr() const;
 
     virtual void dumpAsXml(struct _xmlTextWriter* pWriter) const SAL_OVERRIDE;
+    /// Implementation of lok::Document::getPartPageRectangles() for Writer.
+    OUString getPageRectangles();
 };
 
 // Cursor Inlines:
diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx
index 9f0b03b..311147e 100644
--- a/sw/inc/unotxdoc.hxx
+++ b/sw/inc/unotxdoc.hxx
@@ -431,6 +431,8 @@ public:
     virtual void setGraphicSelection(int nType, int nX, int nY) SAL_OVERRIDE;
     /// @see vcl::ITiledRenderable::resetSelection().
     virtual void resetSelection() SAL_OVERRIDE;
+    /// @see vcl::ITiledRenderable::getPartPageRectangles().
+    virtual OUString getPartPageRectangles() SAL_OVERRIDE;
 
     // ::com::sun::star::tiledrendering::XTiledRenderable
     virtual void SAL_CALL paintTile( const ::css::uno::Any& Parent, ::sal_Int32 nOutputWidth, ::sal_Int32 nOutputHeight, ::sal_Int32 nTilePosX, ::sal_Int32 nTilePosY, ::sal_Int32 nTileWidth, ::sal_Int32 nTileHeight ) throw (::css::uno::RuntimeException, ::std::exception) SAL_OVERRIDE;
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 4339937..b23843c 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -1201,6 +1201,20 @@ sal_uInt16 SwCrsrShell::GetPageCnt()
     return GetLayout()->GetPageNum();
 }
 
+OUString SwCrsrShell::getPageRectangles()
+{
+    CurrShell aCurr(this);
+    SwRootFrm* pLayout = GetLayout();
+    std::stringstream ss;
+    for (const SwFrm* pFrm = pLayout->GetLower(); pFrm; pFrm = pFrm->GetNext())
+    {
+        if (pFrm != pLayout->GetLower())
+            ss << "; ";
+        ss << pFrm->Frm().Left() << ", " << pFrm->Frm().Top() << ", " << pFrm->Frm().Width() << ", " << pFrm->Frm().Height();
+    }
+    return OUString::fromUtf8(ss.str().c_str());
+}
+
 /// go to the next SSelection
 bool SwCrsrShell::GoNextCrsr()
 {
diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx
index b0f37a8..0abbdfc 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -3177,6 +3177,17 @@ int SwXTextDocument::getParts()
     return pWrtShell->GetPageCnt();
 }
 
+OUString SwXTextDocument::getPartPageRectangles()
+{
+    SolarMutexGuard aGuard;
+
+    SwWrtShell* pWrtShell = pDocShell->GetWrtShell();
+    if (!pWrtShell)
+        return OUString();
+
+    return pWrtShell->getPageRectangles();
+}
+
 int SwXTextDocument::getPart()
 {
     SolarMutexGuard aGuard;
commit ecfca0c7c29262070a9b3f4abd9e86302c8574d5
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Fri Sep 25 09:06:28 2015 +0200

    Add lok::Office::getFilterTypes() testcase
    
    Change-Id: I9fa710288729b904f2f1c5b3c575212ef21c8a79
    (cherry picked from commit edb9ef41f29bf3477b8985ee409ce2d22214e63f)

diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index 0cd88ce..d7b9347 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -51,11 +51,13 @@ public:
     void testGetStyles();
     void testGetFonts();
     void testCreateView();
+    void testGetFilterTypes();
 
     CPPUNIT_TEST_SUITE(DesktopLOKTest);
     CPPUNIT_TEST(testGetStyles);
     CPPUNIT_TEST(testGetFonts);
     CPPUNIT_TEST(testCreateView);
+    CPPUNIT_TEST(testGetFilterTypes);
     CPPUNIT_TEST_SUITE_END();
 
     uno::Reference<lang::XComponent> mxComponent;
@@ -150,6 +152,20 @@ void DesktopLOKTest::testCreateView()
     closeDoc();
 }
 
+void DesktopLOKTest::testGetFilterTypes()
+{
+    LibLibreOffice_Impl aOffice;
+    char* pJSON = aOffice.m_pOfficeClass->getFilterTypes(&aOffice);
+
+    std::stringstream aStream(pJSON);
+    boost::property_tree::ptree aTree;
+    boost::property_tree::read_json(aStream, aTree);
+
+    CPPUNIT_ASSERT(aTree.size() > 0);
+    CPPUNIT_ASSERT_EQUAL(std::string("application/vnd.oasis.opendocument.text"), aTree.get_child("writer8").get_child("MediaType").get_value<std::string>());
+    free(pJSON);
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(DesktopLOKTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
commit 3f70d2d2a2fd1a243430db9bf2e6313ccbea417d
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Fri Sep 25 01:06:31 2015 +0200

    desktop: make LibLibreOffice_Impl visible to testcases
    
    (cherry picked from commit 14a9a7d52074104afa24278a7a350f05d6df572a)
    
    Conflicts:
    	desktop/source/lib/init.cxx
    
    Change-Id: I345a6cab57cc594614e348700bb3c1c9a0673989

diff --git a/desktop/inc/lib/init.hxx b/desktop/inc/lib/init.hxx
index b17f825..0bfbbe3 100644
--- a/desktop/inc/lib/init.hxx
+++ b/desktop/inc/lib/init.hxx
@@ -11,6 +11,7 @@
 #include <com/sun/star/lang/XComponent.hpp>
 #include <boost/shared_ptr.hpp>
 #include "../../source/inc/desktopdllapi.h"
+#include <osl/thread.h>
 
 using namespace css;
 using namespace boost;
@@ -24,4 +25,15 @@ namespace desktop {
         explicit LibLODocument_Impl(const uno::Reference <css::lang::XComponent> &xComponent);
         ~LibLODocument_Impl();
     };
+
+    struct DESKTOP_DLLPUBLIC LibLibreOffice_Impl : public _LibreOfficeKit
+    {
+        OUString maLastExceptionMsg;
+        boost::shared_ptr< LibreOfficeKitClass > m_pOfficeClass;
+        oslThread maThread;
+        LibreOfficeKitCallback mpCallback;
+        void *mpCallbackData;
+
+        LibLibreOffice_Impl();
+    };
 }
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index bb6df59..ea849f2 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -88,8 +88,6 @@ using namespace utl;
 
 using namespace boost;
 
-struct LibLibreOffice_Impl;
-
 static LibLibreOffice_Impl *gImpl = NULL;
 static weak_ptr< LibreOfficeKitClass > gOfficeClass;
 static weak_ptr< LibreOfficeKitDocumentClass > gDocumentClass;
@@ -322,36 +320,27 @@ static void                    lo_registerCallback (LibreOfficeKit* pThis,
                                                     void* pData);
 static char* lo_getFilterTypes(LibreOfficeKit* pThis);
 
-struct LibLibreOffice_Impl : public _LibreOfficeKit
+LibLibreOffice_Impl::LibLibreOffice_Impl()
+    : maThread(0)
+    , mpCallback(nullptr)
+    , mpCallbackData(nullptr)
 {
-    OUString maLastExceptionMsg;
-    shared_ptr< LibreOfficeKitClass > m_pOfficeClass;
-    oslThread maThread;
-    LibreOfficeKitCallback mpCallback;
-    void *mpCallbackData;
-
-    LibLibreOffice_Impl()
-        : maThread(0)
-        , mpCallback(nullptr)
-        , mpCallbackData(nullptr)
-    {
-        if(!(m_pOfficeClass = gOfficeClass.lock())) {
-            m_pOfficeClass.reset(new LibreOfficeKitClass);
-            m_pOfficeClass->nSize = sizeof(LibreOfficeKitClass);
-
-            m_pOfficeClass->destroy = lo_destroy;
-            m_pOfficeClass->documentLoad = lo_documentLoad;
-            m_pOfficeClass->getError = lo_getError;
-            m_pOfficeClass->documentLoadWithOptions = lo_documentLoadWithOptions;
-            m_pOfficeClass->registerCallback = lo_registerCallback;
-            m_pOfficeClass->getFilterTypes = lo_getFilterTypes;
-
-            gOfficeClass = m_pOfficeClass;
-        }
-
-        pClass = m_pOfficeClass.get();
+    if(!(m_pOfficeClass = gOfficeClass.lock())) {
+        m_pOfficeClass.reset(new LibreOfficeKitClass);
+        m_pOfficeClass->nSize = sizeof(LibreOfficeKitClass);
+
+        m_pOfficeClass->destroy = lo_destroy;
+        m_pOfficeClass->documentLoad = lo_documentLoad;
+        m_pOfficeClass->getError = lo_getError;
+        m_pOfficeClass->documentLoadWithOptions = lo_documentLoadWithOptions;
+        m_pOfficeClass->registerCallback = lo_registerCallback;
+        m_pOfficeClass->getFilterTypes = lo_getFilterTypes;
+
+        gOfficeClass = m_pOfficeClass;
     }
-};
+
+    pClass = m_pOfficeClass.get();
+}
 
 namespace
 {
commit 2c049ea3d3906303116004f32443b8a21da2350a
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Fri Sep 25 01:02:23 2015 +0200

    lok: add Office::getFilterTypes()
    
    Change-Id: I3b1f4e11f2495e5ccb41f85802f243c0190695ee
    (cherry picked from commit 9b9f2ad9c819421c9f24bcbca98ee147f70d85b2)

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index fea4ec6..bb6df59 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -320,6 +320,8 @@ static LibreOfficeKitDocument* lo_documentLoadWithOptions  (LibreOfficeKit* pThi
 static void                    lo_registerCallback (LibreOfficeKit* pThis,
                                                     LibreOfficeKitCallback pCallback,
                                                     void* pData);
+static char* lo_getFilterTypes(LibreOfficeKit* pThis);
+
 struct LibLibreOffice_Impl : public _LibreOfficeKit
 {
     OUString maLastExceptionMsg;
@@ -342,6 +344,7 @@ struct LibLibreOffice_Impl : public _LibreOfficeKit
             m_pOfficeClass->getError = lo_getError;
             m_pOfficeClass->documentLoadWithOptions = lo_documentLoadWithOptions;
             m_pOfficeClass->registerCallback = lo_registerCallback;
+            m_pOfficeClass->getFilterTypes = lo_getFilterTypes;
 
             gOfficeClass = m_pOfficeClass;
         }
@@ -1097,6 +1100,42 @@ static char* lo_getError (LibreOfficeKit *pThis)
     return pMemory;
 }
 
+static char* lo_getFilterTypes(LibreOfficeKit* pThis)
+{
+    LibLibreOffice_Impl* pImpl = static_cast<LibLibreOffice_Impl*>(pThis);
+
+    if (!xSFactory.is())
+        xSFactory = comphelper::getProcessServiceFactory();
+
+    if (!xSFactory.is())
+    {
+        pImpl->maLastExceptionMsg = "Service factory is not available";
+        return 0;
+    }
+
+    uno::Reference<container::XNameAccess> xTypeDetection(xSFactory->createInstance("com.sun.star.document.TypeDetection"), uno::UNO_QUERY);
+    uno::Sequence<OUString> aTypes = xTypeDetection->getElementNames();
+    boost::property_tree::ptree aTree;
+    for (const OUString& rType : aTypes)
+    {
+        uno::Sequence<beans::PropertyValue> aValues;
+        if (xTypeDetection->getByName(rType) >>= aValues)
+        {
+            auto it = std::find_if(aValues.begin(), aValues.end(), [](const beans::PropertyValue& rValue) { return rValue.Name == "MediaType"; });
+            OUString aValue;
+            if (it != aValues.end() && (it->Value >>= aValue) && !aValue.isEmpty())
+            {
+                boost::property_tree::ptree aChild;
+                aChild.put("MediaType", aValue.toUtf8());
+                aTree.add_child(rType.toUtf8().getStr(), aChild);
+            }
+        }
+    }
+    std::stringstream aStream;
+    boost::property_tree::write_json(aStream, aTree);
+    return strdup(aStream.str().c_str());
+}
+
 static void force_c_locale()
 {
     // force locale (and resource files loaded) to en-US
diff --git a/include/LibreOfficeKit/LibreOfficeKit.h b/include/LibreOfficeKit/LibreOfficeKit.h
index 4c3e1fa..d5094bd 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/include/LibreOfficeKit/LibreOfficeKit.h
@@ -54,6 +54,9 @@ struct _LibreOfficeKitClass
     void (*registerCallback) (LibreOfficeKit* pThis,
                               LibreOfficeKitCallback pCallback,
                               void* pData);
+
+    /// @see lok::Office::getFilterTypes().
+    char* (*getFilterTypes) (LibreOfficeKit* pThis);
 #endif
 };
 
diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx b/include/LibreOfficeKit/LibreOfficeKit.hxx
index 7f96e19..207a9ce 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -353,6 +353,27 @@ public:
     {
         return mpThis->pClass->getError(mpThis);
     }
+
+#ifdef LOK_USE_UNSTABLE_API
+    /**
+     * Returns details of filter types.
+     *
+     * Example returned string:
+     *
+     * {
+     *     "writer8": {
+     *         "MediaType": "application/vnd.oasis.opendocument.text"
+     *     },
+     *     "calc8": {
+     *         "MediaType": "application/vnd.oasis.opendocument.spreadsheet"
+     *     }
+     * }
+     */
+    inline char* getFilterTypes()
+    {
+        return mpThis->pClass->getFilterTypes(mpThis);
+    }
+#endif // LOK_USE_UNSTABLE_API
 };
 
 /// Factory method to create a lok::Office instance.


More information about the Libreoffice-commits mailing list