34#include <osl/diagnose.h>
45 : mrLayouter(rSlideSorter.GetView().GetLayouter()),
46 mpCache(rSlideSorter.GetView().GetPreviewCache()),
47 mpTheme(rSlideSorter.GetTheme()),
48 mpPageNumberFont(
Theme::
GetFont(
Theme::Font_PageNumber, *rSlideSorter.GetContentWindow()->GetOutDev())),
55 sal_uInt16 nHue, nSat, nBri;
76 rDevice.
SetAntialiasing(nSavedAntialiasingMode & ~AntialiasingFlags::Enable);
79 PaintPreview(pPageObjectLayouter, rDevice, rpDescriptor);
82 if (rpDescriptor->GetPage()->hasAnimationNode())
92 if ( ! pPageObjectLayouter)
94 OSL_FAIL(
"no page object layouter");
115 SdPage* pPage = rpDescriptor->GetPage();
116 if (pPage !=
nullptr)
120 const ::tools::Rectangle aPreviewBox (pPageObjectLayouter->
GetBoundingBox(
133 const ::tools::Rectangle aBox (pPageObjectLayouter->
GetBoundingBox(
141 const SdrPage* pPage = rpDescriptor->GetPage();
142 mpCache->SetPreciousFlag(pPage,
true);
148 rDevice.
DrawBitmapEx(aBox.TopLeft(), aBox.GetSize(), aPreview);
161 if (pReferenceDevice !=
nullptr)
165 pDevice->SetOutputSizePixel(rSize);
167 pDevice->DrawBitmapEx(
Point(0,0), rSize, rPreview);
172 if (nIconWidth>0 && nIconHeight>0)
176 pDevice->DrawBitmapEx(
Point(nX,nY), rOverlay);
178 return pDevice->GetBitmapEx(
Point(0,0), rSize);
185 const SdrPage* pPage = rpDescriptor->GetPage();
193 const ::tools::Rectangle aPreviewBox (pPageObjectLayouter->
GetBoundingBox(
200 aPreviewBox.GetSize(),
201 mpCache->GetPreviewBitmap(pPage,
true),
204 mpCache->SetMarkedPreviewBitmap(pPage, aMarkedPreview);
206 return aMarkedPreview;
210 return mpCache->GetPreviewBitmap(pPage,
false);
219 const ::tools::Rectangle aBox (pPageObjectLayouter->
GetBoundingBox(
237 const sal_Int32 nBackgroundLuminance (aBackgroundColor.
GetLuminance());
240 if (nBackgroundLuminance == 0)
247 const sal_Int32 nFontLuminance (aPageNumberColor.
GetLuminance());
248 if (
abs(nBackgroundLuminance - nFontLuminance) < 60)
250 if (nBackgroundLuminance > nFontLuminance-30)
259 OSL_ASSERT(rpDescriptor->GetPage()!=
nullptr);
260 const sal_Int32 nPageNumber ((rpDescriptor->GetPage()->GetPageNum() - 1) / 2 + 1);
261 const OUString sPageNumber(OUString::number(nPageNumber));
264 rDevice.
DrawText(aBox, sPageNumber, DrawTextFlags::Right | DrawTextFlags::VCenter);
272 const SdPage* pPage = rpDescriptor->GetPage();
275 const ::tools::Rectangle aBox (pPageObjectLayouter->
GetBoundingBox(
291 SdPage* pPage = rpDescriptor->GetPage();
292 std::shared_ptr< MainSequence > aMainSequence = pPage->
getMainSequence();
293 EffectSequence::iterator aIter = aMainSequence->getBegin();
294 EffectSequence::iterator aEnd = aMainSequence->getEnd();
297 const ::tools::Rectangle aBox (pPageObjectLayouter->
GetBoundingBox(
318 bool bHasFocusBorder;
325 bHasFocusBorder =
true;
330 bHasFocusBorder =
false;
335 bHasFocusBorder =
false;
340 bHasFocusBorder =
true;
345 bHasFocusBorder =
true;
350 bHasFocusBorder =
false;
355 bHasFocusBorder =
true;
361 bHasFocusBorder =
false;
365 const ::tools::Rectangle aFocusSize (pPageObjectLayouter->
GetBoundingBox(
370 const ::tools::Rectangle aPageObjectBox (pPageObjectLayouter->
GetBoundingBox(
385 if (aTopColor != aBottomColor)
387 Gradient gradient(css::awt::GradientStyle_LINEAR, aTopColor, aBottomColor);
404 const ::tools::Rectangle aBox (pPageObjectLayouter->
GetBoundingBox(
408 ::tools::Rectangle aFrameBox (aBox.Left()-1,aBox.Top()-1,aBox.Right()+1,aBox.Bottom()+1);
415 const ::tools::Rectangle& rBox)
const
421 const int nDelta (
nIndex);
424 Point(rBox.Left()-nDelta, rBox.Top()-nDelta),
425 Point(rBox.Left()-nDelta, rBox.Bottom()+nDelta));
427 Point(rBox.Left()-nDelta, rBox.Bottom()+nDelta),
428 Point(rBox.Right()+nDelta, rBox.Bottom()+nDelta));
430 Point(rBox.Right()+nDelta, rBox.Bottom()+nDelta),
431 Point(rBox.Right()+nDelta, rBox.Top()-nDelta));
435 Point(rBox.Left()-nDelta, rBox.Top()-nDelta),
436 Point(rBox.Right()+nDelta, rBox.Top()-nDelta));
const Size & GetSizePixel() const
sal_uInt8 GetLuminance() const
void RGBtoHSB(sal_uInt16 &nHue, sal_uInt16 &nSaturation, sal_uInt16 &nBrightness) const
static Color HSBtoRGB(sal_uInt16 nHue, sal_uInt16 nSaturation, sal_uInt16 nBrightness)
BitmapEx GetBitmapEx() const
void DrawBitmapEx(const Point &rDestPt, const BitmapEx &rBitmapEx)
void SetAntialiasing(AntialiasingFlags nMode)
void SetFont(const vcl::Font &rNewFont)
void DrawRect(const tools::Rectangle &rRect)
void DrawLine(const Point &rStartPt, const Point &rEndPt)
void SetTextColor(const Color &rColor)
void DrawGradient(const tools::Rectangle &rRect, const Gradient &rGradient)
AntialiasingFlags GetAntialiasing() const
void DrawText(const Point &rStartPt, const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, std::vector< tools::Rectangle > *pVector=nullptr, OUString *pDisplayText=nullptr, const SalLayoutGlyphs *pLayoutCache=nullptr)
void disposeAndReset(reference_type *pBody)
sal_Int16 getTransitionType() const
std::shared_ptr< sd::MainSequence > const & getMainSequence()
returns a helper class to manipulate effects inside the main sequence
Color GetPageBackgroundColor() const
constexpr tools::Long Height() const
constexpr tools::Long Width() const
Show previews for all the slides in a document and allow the user to insert or delete slides and modi...
std::shared_ptr< PageObjectLayouter > const & GetPageObjectLayouter() const
In contrast to the Layouter that places page objects in the view, the PageObjectLayouter places the p...
::tools::Rectangle GetBoundingBox(const model::SharedPageDescriptor &rpPageDescriptor, const Part ePart, const CoordinateSystem eCoordinateSystem, bool bIgnoreLocation=false)
Return the bounding box of the page object or one of its graphical parts.
const Image & GetTransitionEffectIcon() const
const Image & GetCustomAnimationEffectIcon() const
@ TransitionEffectIndicator
@ CustomAnimationEffectIndicator
bool UpdatePageObjectLayouter()
Update the local pointer to the page object layouter to the one owned by the general layouter.
void PaintPageNumber(PageObjectLayouter *pPageObjectLayouter, OutputDevice &rDevice, const model::SharedPageDescriptor &rpDescriptor) const
std::shared_ptr< cache::PageCache > mpCache
void PaintPageObject(OutputDevice &rDevice, const model::SharedPageDescriptor &rpDescriptor)
static BitmapEx CreateMarkedPreview(const Size &rSize, const BitmapEx &rPreview, const BitmapEx &rOverlay, const OutputDevice *pReferenceDevice)
std::shared_ptr< vcl::Font > mpPageNumberFont
void SetTheme(const std::shared_ptr< view::Theme > &rpTheme)
Called when the theme changes, either because it is replaced with another or because the system color...
BitmapEx GetPreviewBitmap(const model::SharedPageDescriptor &rpDescriptor, const OutputDevice *pReferenceDevice) const
Return a preview bitmap for the given page descriptor.
static void PaintTransitionEffect(PageObjectLayouter *pPageObjectLayouter, OutputDevice &rDevice, const model::SharedPageDescriptor &rpDescriptor)
void PaintPreview(PageObjectLayouter *pPageObjectLayouter, OutputDevice &rDevice, const model::SharedPageDescriptor &rpDescriptor) const
PageObjectPainter(const SlideSorter &rSlideSorter)
const Layouter & mrLayouter
static void PaintCustomAnimationEffect(PageObjectLayouter *pPageObjectLayouter, OutputDevice &rDevice, const model::SharedPageDescriptor &rpDescriptor)
void PaintBackgroundDetail(PageObjectLayouter *pPageObjectLayouter, OutputDevice &rDevice, const model::SharedPageDescriptor &rpDescriptor) const
std::unique_ptr< FramePainter > mpFocusBorderPainter
std::unique_ptr< FramePainter > mpShadowPainter
void PaintBackground(PageObjectLayouter *pPageObjectLayouter, OutputDevice &rDevice, const model::SharedPageDescriptor &rpDescriptor) const
std::shared_ptr< view::Theme > mpTheme
void PaintBorder(OutputDevice &rDevice, const Theme::GradientColorType eColorType, const ::tools::Rectangle &rBox) const
Collection of colors and styles that are used to paint the slide sorter view.
@ Gradient_MouseOverSelected
@ Gradient_MouseOverSelectedAndFocusedPage
@ Gradient_SelectedAndFocusedPage
@ Color_PageNumberHighContrast
@ Color_PageNumberBrightBackground
@ Color_PageNumberDarkBackground
@ Color_PageNumberDefault
std::shared_ptr< PageDescriptor > SharedPageDescriptor
vcl::Font GetFont(vcl::Font const &rFont, DrawModeFlags nDrawMode, StyleSettings const &rStyleSettings)
SwNodeOffset abs(const SwNodeOffset &a)