renaissance1: #i107215# Increased minimal slide width. Replaced some icons. Insert indicator shows exclusion indicator.
This commit is contained in:
@@ -409,7 +409,7 @@ void Clipboard::CreateSlideTransferable (
|
||||
// previews are included into the transferable so that an insertion
|
||||
// indicator can be rendered.
|
||||
aSelectedPages.Rewind();
|
||||
::std::vector<Bitmap> aRepresentatives;
|
||||
::std::vector<Transferable::Representative> aRepresentatives;
|
||||
aRepresentatives.reserve(3);
|
||||
::boost::shared_ptr<cache::PageCache> pPreviewCache (
|
||||
mrSlideSorter.GetView().GetPreviewCache());
|
||||
@@ -419,7 +419,9 @@ void Clipboard::CreateSlideTransferable (
|
||||
if ( ! pDescriptor || pDescriptor->GetPage()==NULL)
|
||||
continue;
|
||||
Bitmap aPreview (pPreviewCache->GetPreviewBitmap(pDescriptor->GetPage(), false));
|
||||
aRepresentatives.push_back(aPreview);
|
||||
aRepresentatives.push_back(Transferable::Representative(
|
||||
aPreview,
|
||||
pDescriptor->HasState(model::PageDescriptor::ST_Excluded)));
|
||||
if (aRepresentatives.size() >= 3)
|
||||
break;
|
||||
}
|
||||
|
@@ -40,7 +40,7 @@ Transferable::Transferable (
|
||||
::sd::View* pWorkView,
|
||||
BOOL bInitOnGetData,
|
||||
SlideSorterViewShell* pViewShell,
|
||||
const ::std::vector<Bitmap>& rRepresentatives)
|
||||
const ::std::vector<Representative>& rRepresentatives)
|
||||
: SdTransferable (pSrcDoc, pWorkView, bInitOnGetData),
|
||||
mpViewShell(pViewShell),
|
||||
maRepresentatives(rRepresentatives)
|
||||
@@ -92,7 +92,7 @@ void Transferable::Notify (SfxBroadcaster& rBroadcaster, const SfxHint& rHint)
|
||||
|
||||
|
||||
|
||||
const ::std::vector<Bitmap>& Transferable::GetRepresentatives (void) const
|
||||
const ::std::vector<Transferable::Representative>& Transferable::GetRepresentatives (void) const
|
||||
{
|
||||
return maRepresentatives;
|
||||
}
|
||||
|
@@ -45,22 +45,34 @@ class Transferable
|
||||
: public SdTransferable
|
||||
{
|
||||
public:
|
||||
class Representative
|
||||
{
|
||||
public:
|
||||
Representative (const Bitmap& rBitmap, const bool bIsExcluded)
|
||||
: maBitmap(rBitmap), mbIsExcluded(bIsExcluded) {}
|
||||
Representative (const Representative& rOther)
|
||||
: maBitmap(rOther.maBitmap), mbIsExcluded(rOther.mbIsExcluded) {}
|
||||
const Bitmap maBitmap;
|
||||
const bool mbIsExcluded;
|
||||
};
|
||||
|
||||
|
||||
Transferable (
|
||||
SdDrawDocument* pSrcDoc,
|
||||
::sd::View* pWorkView,
|
||||
BOOL bInitOnGetData,
|
||||
SlideSorterViewShell* pViewShell,
|
||||
const ::std::vector<Bitmap>& rRepresentatives);
|
||||
const ::std::vector<Representative>& rRepresentatives);
|
||||
|
||||
virtual ~Transferable (void);
|
||||
|
||||
virtual void DragFinished (sal_Int8 nDropAction);
|
||||
|
||||
const ::std::vector<Bitmap>& GetRepresentatives (void) const;
|
||||
const ::std::vector<Representative>& GetRepresentatives (void) const;
|
||||
|
||||
private:
|
||||
SlideSorterViewShell* mpViewShell;
|
||||
const ::std::vector<Bitmap> maRepresentatives;
|
||||
const ::std::vector<Representative> maRepresentatives;
|
||||
|
||||
virtual void Notify (SfxBroadcaster& rBroadcaster, const SfxHint& rHint);
|
||||
};
|
||||
|
@@ -188,6 +188,9 @@ private:
|
||||
const model::SharedPageDescriptor& rpDescriptor,
|
||||
const double nTargetAlpha,
|
||||
const bool bFadeIn);
|
||||
|
||||
void AcquireLock (void);
|
||||
void ReleaseLock (void);
|
||||
};
|
||||
|
||||
|
||||
|
@@ -30,6 +30,7 @@
|
||||
|
||||
#include "model/SlsSharedPageDescriptor.hxx"
|
||||
#include "view/SlsILayerPainter.hxx"
|
||||
#include "controller/SlsTransferable.hxx"
|
||||
|
||||
#include <tools/gen.hxx>
|
||||
#include <vcl/bitmapex.hxx>
|
||||
@@ -109,7 +110,7 @@ private:
|
||||
OutputDevice& rContent,
|
||||
const Size aPreviewSize,
|
||||
const sal_Int32 nOffset,
|
||||
const ::std::vector<Bitmap>& rPages) const;
|
||||
const ::std::vector<controller::Transferable::Representative>& rPages) const;
|
||||
void PaintPageCount (
|
||||
OutputDevice& rDevice,
|
||||
const sal_Int32 nSelectionCount,
|
||||
@@ -119,7 +120,7 @@ private:
|
||||
scaled down previews of some of the selected pages.
|
||||
*/
|
||||
void Create (
|
||||
const ::std::vector<Bitmap>& rPages,
|
||||
const ::std::vector<controller::Transferable::Representative>& rPages,
|
||||
const sal_Int32 nSelectionCount);
|
||||
};
|
||||
|
||||
|
@@ -72,6 +72,21 @@ public:
|
||||
*/
|
||||
void SetTheme (const ::boost::shared_ptr<view::Theme>& rpTheme);
|
||||
|
||||
/** Return a preview bitmap for the given page descriptor. When the
|
||||
page is excluded from the show then the preview is marked
|
||||
accordingly.
|
||||
@rpDescriptor
|
||||
Defines the page for which to return the preview.
|
||||
@pReferenceDevice
|
||||
When not <NULL/> then this reference device is used to created a
|
||||
compatible bitmap.
|
||||
@return
|
||||
The returned bitmap may have a different size then the preview area.
|
||||
*/
|
||||
Bitmap GetPreviewBitmap (
|
||||
const model::SharedPageDescriptor& rpDescriptor,
|
||||
const OutputDevice* pReferenceDevice) const;
|
||||
|
||||
private:
|
||||
const Layouter& mrLayouter;
|
||||
::boost::shared_ptr<PageObjectLayouter> mpPageObjectLayouter;
|
||||
@@ -119,7 +134,7 @@ private:
|
||||
const Size& rSize,
|
||||
const Bitmap& rPreview,
|
||||
const BitmapEx& rOverlay,
|
||||
const OutputDevice& TemplateDevice) const;
|
||||
const OutputDevice* pReferenceDevice) const;
|
||||
};
|
||||
|
||||
} } } // end of namespace sd::slidesorter::view
|
||||
|
@@ -159,7 +159,7 @@ namespace {
|
||||
ButtonBar::Lock::Lock (SlideSorter& rSlideSorter)
|
||||
: mrButtonBar(rSlideSorter.GetView().GetButtonBar())
|
||||
{
|
||||
++mrButtonBar.mnLockCount;
|
||||
mrButtonBar.AcquireLock();
|
||||
}
|
||||
|
||||
|
||||
@@ -167,7 +167,7 @@ ButtonBar::Lock::Lock (SlideSorter& rSlideSorter)
|
||||
|
||||
ButtonBar::Lock::~Lock (void)
|
||||
{
|
||||
--mrButtonBar.mnLockCount;
|
||||
mrButtonBar.ReleaseLock();
|
||||
}
|
||||
|
||||
|
||||
@@ -730,6 +730,28 @@ void ButtonBar::StartFadeAnimation (
|
||||
|
||||
|
||||
|
||||
void ButtonBar::AcquireLock (void)
|
||||
{
|
||||
if (mnLockCount == 0 && mpDescriptor)
|
||||
RequestFadeOut(mpDescriptor, true);
|
||||
|
||||
++mnLockCount;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void ButtonBar::ReleaseLock (void)
|
||||
{
|
||||
--mnLockCount;
|
||||
|
||||
if (mnLockCount == 0 && mpDescriptor)
|
||||
RequestFadeIn(mpDescriptor, true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//===== BackgroundTheme =====================================================
|
||||
|
||||
ButtonBar::BackgroundTheme::BackgroundTheme (
|
||||
|
@@ -36,7 +36,6 @@
|
||||
#include "view/SlsPageObjectLayouter.hxx"
|
||||
#include "view/SlsTheme.hxx"
|
||||
#include "cache/SlsPageCache.hxx"
|
||||
#include "controller/SlsTransferable.hxx"
|
||||
#include "SlsFramePainter.hxx"
|
||||
#include "SlsLayeredDevice.hxx"
|
||||
#include "DrawDocShell.hxx"
|
||||
@@ -129,7 +128,7 @@ void InsertionIndicatorOverlay::Create (const controller::Transferable* pTransfe
|
||||
|
||||
|
||||
void InsertionIndicatorOverlay::Create (
|
||||
const ::std::vector<Bitmap>& rRepresentatives,
|
||||
const ::std::vector<controller::Transferable::Representative>& rRepresentatives,
|
||||
const sal_Int32 nSelectionCount)
|
||||
{
|
||||
view::Layouter& rLayouter (mrSlideSorter.GetView().GetLayouter());
|
||||
@@ -195,13 +194,14 @@ Point InsertionIndicatorOverlay::PaintRepresentatives (
|
||||
OutputDevice& rContent,
|
||||
const Size aPreviewSize,
|
||||
const sal_Int32 nOffset,
|
||||
const ::std::vector<Bitmap>& rRepresentatives) const
|
||||
const ::std::vector<controller::Transferable::Representative>& rRepresentatives) const
|
||||
{
|
||||
const Point aOffset (0,rRepresentatives.size()==1 ? -nOffset : 0);
|
||||
|
||||
// Paint the pages.
|
||||
Point aPageOffset (0,0);
|
||||
double nTransparency (0);
|
||||
const BitmapEx aExclusionOverlay (mrSlideSorter.GetTheme()->GetIcon(Theme::Icon_HideSlideOverlay));
|
||||
for (sal_Int32 nIndex=2; nIndex>=0; --nIndex)
|
||||
{
|
||||
if (rRepresentatives.size() <= sal_uInt32(nIndex))
|
||||
@@ -225,15 +225,32 @@ Point InsertionIndicatorOverlay::PaintRepresentatives (
|
||||
aPageOffset.X() += gnShadowBorder;
|
||||
aPageOffset.Y() += gnShadowBorder;
|
||||
|
||||
::boost::shared_ptr<cache::PageCache> pPreviewCache (
|
||||
mrSlideSorter.GetView().GetPreviewCache());
|
||||
Bitmap aPreview (rRepresentatives[nIndex]);
|
||||
// Paint the preview.
|
||||
Bitmap aPreview (rRepresentatives[nIndex].maBitmap);
|
||||
const Size aSuperSampleSize(
|
||||
aPreviewSize.Width()*gnSuperScaleFactor,
|
||||
aPreviewSize.Height()*gnSuperScaleFactor);
|
||||
aPreview.Scale(aPreviewSize, BMP_SCALE_INTERPOLATE);
|
||||
rContent.DrawBitmapEx(aPageOffset, aPreview);
|
||||
|
||||
// When the page is marked as excluded from the slide show then
|
||||
// paint an overlay that visualizes this.
|
||||
if (rRepresentatives[nIndex].mbIsExcluded)
|
||||
{
|
||||
const Region aSavedClipRegion (rContent.GetClipRegion());
|
||||
rContent.IntersectClipRegion(Rectangle(aPageOffset, aPreviewSize));
|
||||
// Paint bitmap tiled over the preview to mark it as excluded.
|
||||
const sal_Int32 nIconWidth (aExclusionOverlay.GetSizePixel().Width());
|
||||
const sal_Int32 nIconHeight (aExclusionOverlay.GetSizePixel().Height());
|
||||
if (nIconWidth>0 && nIconHeight>0)
|
||||
{
|
||||
for (sal_Int32 nX=0; nX<aPreviewSize.Width(); nX+=nIconWidth)
|
||||
for (sal_Int32 nY=0; nY<aPreviewSize.Height(); nY+=nIconHeight)
|
||||
rContent.DrawBitmapEx(Point(nX,nY)+aPageOffset, aExclusionOverlay);
|
||||
}
|
||||
rContent.SetClipRegion(aSavedClipRegion);
|
||||
}
|
||||
|
||||
// Tone down the bitmap. The further back the darker it becomes.
|
||||
Rectangle aBox (
|
||||
aPageOffset.X(),
|
||||
|
@@ -591,7 +591,7 @@ Layouter::Implementation::Implementation (const SharedSdWindow& rpWindow)
|
||||
mnBottomBorder(5),
|
||||
mnVerticalGap (10),
|
||||
mnHorizontalGap(10),
|
||||
maMinimalSize(100,75),
|
||||
maMinimalSize(120,90),
|
||||
maPreferredSize(200,150),
|
||||
maMaximalSize(300,200),
|
||||
mnMinimalColumnCount(1),
|
||||
|
@@ -52,6 +52,7 @@
|
||||
#include <vcl/svapp.hxx>
|
||||
#include <vcl/vclenum.hxx>
|
||||
#include <vcl/virdev.hxx>
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
|
||||
using namespace ::drawinglayer::primitive2d;
|
||||
|
||||
@@ -199,6 +200,20 @@ void PageObjectPainter::PaintBackground (
|
||||
|
||||
const Bitmap& rBackground (GetBackgroundForState(rpDescriptor, rDevice));
|
||||
rDevice.DrawBitmap(aBox.TopLeft(), rBackground);
|
||||
|
||||
// Fill the interior of the preview area with the default background
|
||||
// color of the page.
|
||||
SdPage* pPage = rpDescriptor->GetPage();
|
||||
if (pPage != NULL)
|
||||
{
|
||||
rDevice.SetFillColor(pPage->GetPageBackgroundColor(NULL));
|
||||
rDevice.SetLineColor(pPage->GetPageBackgroundColor(NULL));
|
||||
const Rectangle aPreviewBox (mpPageObjectLayouter->GetBoundingBox(
|
||||
rpDescriptor,
|
||||
PageObjectLayouter::Preview,
|
||||
PageObjectLayouter::ModelCoordinateSystem));
|
||||
rDevice.DrawRect(aPreviewBox);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -213,37 +228,17 @@ void PageObjectPainter::PaintPreview (
|
||||
PageObjectLayouter::Preview,
|
||||
PageObjectLayouter::ModelCoordinateSystem));
|
||||
|
||||
const bool bIsExcluded (rpDescriptor->GetVisualState().GetCurrentVisualState()
|
||||
== model::VisualState::VS_Excluded);
|
||||
|
||||
if (mpCache != NULL)
|
||||
{
|
||||
const SdrPage* pPage = rpDescriptor->GetPage();
|
||||
mpCache->SetPreciousFlag(pPage, true);
|
||||
|
||||
if (bIsExcluded)
|
||||
{
|
||||
Bitmap aMarkedPreview (mpCache->GetMarkedPreviewBitmap(pPage,false));
|
||||
if (aMarkedPreview.IsEmpty() || aMarkedPreview.GetSizePixel()!=aBox.GetSize())
|
||||
{
|
||||
aMarkedPreview = CreateMarkedPreview(
|
||||
aBox.GetSize(),
|
||||
mpCache->GetPreviewBitmap(pPage,true),
|
||||
mpTheme->GetIcon(Theme::Icon_HideSlideOverlay),
|
||||
rDevice);
|
||||
mpCache->SetMarkedPreviewBitmap(pPage, aMarkedPreview);
|
||||
}
|
||||
rDevice.DrawBitmap(aBox.TopLeft(), aMarkedPreview);
|
||||
}
|
||||
else
|
||||
{
|
||||
const Bitmap aPreview (mpCache->GetPreviewBitmap(pPage,false));
|
||||
if ( ! aPreview.IsEmpty())
|
||||
if (aPreview.GetSizePixel() != aBox.GetSize())
|
||||
rDevice.DrawBitmap(aBox.TopLeft(), aBox.GetSize(), aPreview);
|
||||
else
|
||||
rDevice.DrawBitmap(aBox.TopLeft(), aPreview);
|
||||
}
|
||||
const Bitmap aPreview (GetPreviewBitmap(rpDescriptor, &rDevice));
|
||||
if ( ! aPreview.IsEmpty())
|
||||
if (aPreview.GetSizePixel() != aBox.GetSize())
|
||||
rDevice.DrawBitmap(aBox.TopLeft(), aBox.GetSize(), aPreview);
|
||||
else
|
||||
rDevice.DrawBitmap(aBox.TopLeft(), aPreview);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -254,12 +249,16 @@ Bitmap PageObjectPainter::CreateMarkedPreview (
|
||||
const Size& rSize,
|
||||
const Bitmap& rPreview,
|
||||
const BitmapEx& rOverlay,
|
||||
const OutputDevice& rReferenceDevice) const
|
||||
const OutputDevice* pReferenceDevice) const
|
||||
{
|
||||
VirtualDevice aDevice (rReferenceDevice);
|
||||
aDevice.SetOutputSizePixel(rSize);
|
||||
::boost::scoped_ptr<VirtualDevice> pDevice;
|
||||
if (pReferenceDevice != NULL)
|
||||
pDevice.reset(new VirtualDevice(*pReferenceDevice));
|
||||
else
|
||||
pDevice.reset(new VirtualDevice());
|
||||
pDevice->SetOutputSizePixel(rSize);
|
||||
|
||||
aDevice.DrawBitmap(Point(0,0), rSize, rPreview);
|
||||
pDevice->DrawBitmap(Point(0,0), rSize, rPreview);
|
||||
|
||||
// Paint bitmap tiled over the preview to mark it as excluded.
|
||||
const sal_Int32 nIconWidth (rOverlay.GetSizePixel().Width());
|
||||
@@ -268,9 +267,44 @@ Bitmap PageObjectPainter::CreateMarkedPreview (
|
||||
{
|
||||
for (sal_Int32 nX=0; nX<rSize.Width(); nX+=nIconWidth)
|
||||
for (sal_Int32 nY=0; nY<rSize.Height(); nY+=nIconHeight)
|
||||
aDevice.DrawBitmapEx(Point(nX,nY), rOverlay);
|
||||
pDevice->DrawBitmapEx(Point(nX,nY), rOverlay);
|
||||
}
|
||||
return pDevice->GetBitmap(Point(0,0), rSize);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Bitmap PageObjectPainter::GetPreviewBitmap (
|
||||
const model::SharedPageDescriptor& rpDescriptor,
|
||||
const OutputDevice* pReferenceDevice) const
|
||||
{
|
||||
const SdrPage* pPage = rpDescriptor->GetPage();
|
||||
const bool bIsExcluded (rpDescriptor->GetVisualState().GetCurrentVisualState()
|
||||
== model::VisualState::VS_Excluded);
|
||||
|
||||
if (bIsExcluded)
|
||||
{
|
||||
Bitmap aMarkedPreview (mpCache->GetMarkedPreviewBitmap(pPage,false));
|
||||
const Rectangle aPreviewBox (mpPageObjectLayouter->GetBoundingBox(
|
||||
rpDescriptor,
|
||||
PageObjectLayouter::Preview,
|
||||
PageObjectLayouter::ModelCoordinateSystem));
|
||||
if (aMarkedPreview.IsEmpty() || aMarkedPreview.GetSizePixel()!=aPreviewBox.GetSize())
|
||||
{
|
||||
aMarkedPreview = CreateMarkedPreview(
|
||||
aPreviewBox.GetSize(),
|
||||
mpCache->GetPreviewBitmap(pPage,true),
|
||||
mpTheme->GetIcon(Theme::Icon_HideSlideOverlay),
|
||||
pReferenceDevice);
|
||||
mpCache->SetMarkedPreviewBitmap(pPage, aMarkedPreview);
|
||||
}
|
||||
return aMarkedPreview;
|
||||
}
|
||||
else
|
||||
{
|
||||
return mpCache->GetPreviewBitmap(pPage,false);
|
||||
}
|
||||
return aDevice.GetBitmap(Point(0,0), rSize);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user