[Libreoffice-commits] core.git: sd/source
Ciorba Edmond
edmond_ciorba at yahoo.com
Tue Jun 25 04:25:34 PDT 2013
sd/source/ui/app/res_bmp.src | 5 ++
sd/source/ui/inc/res_bmp.hrc | 1
sd/source/ui/slidesorter/controller/SlsAnimator.cxx | 3 -
sd/source/ui/slidesorter/inc/controller/SlsAnimator.hxx | 1
sd/source/ui/slidesorter/inc/view/SlsPageObjectLayouter.hxx | 8 +++
sd/source/ui/slidesorter/inc/view/SlsPageObjectPainter.hxx | 3 +
sd/source/ui/slidesorter/view/SlsPageObjectLayouter.cxx | 16 ++++++
sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx | 28 +++++++++---
8 files changed, 55 insertions(+), 10 deletions(-)
New commits:
commit e5990a9dcd97c2231115eae83770f9e6e7e130e9
Author: Ciorba Edmond <edmond_ciorba at yahoo.com>
Date: Thu Jun 13 22:19:38 2013 +0300
fdo#65456 - Provide visual clues in slidesorter for custom animation.
Change-Id: I08666492fea76395fd24b0ebd02647821f49573d
diff --git a/sd/source/ui/app/res_bmp.src b/sd/source/ui/app/res_bmp.src
index 3114587..246f230 100644
--- a/sd/source/ui/app/res_bmp.src
+++ b/sd/source/ui/app/res_bmp.src
@@ -338,6 +338,11 @@ Bitmap BMP_FADE_EFFECT_INDICATOR
File = "fade_effect_indicator.bmp";
};
+Bitmap BMP_CUSTOM_ANIMATION_INDICATOR
+{
+ File = "click_16.bmp";
+};
+
Bitmap BMP_COMMENTS_INDICATOR
{
File = "comments_indicator.bmp";
diff --git a/sd/source/ui/inc/res_bmp.hrc b/sd/source/ui/inc/res_bmp.hrc
index ec35436..efdd47a 100644
--- a/sd/source/ui/inc/res_bmp.hrc
+++ b/sd/source/ui/inc/res_bmp.hrc
@@ -44,6 +44,7 @@
// additional effects
#define BMP_FADE_EFFECT_INDICATOR RID_SD_START+331
+#define BMP_CUSTOM_ANIMATION_INDICATOR RID_SD_START+332
#define BMP_COMMENTS_INDICATOR RID_SD_START+338
diff --git a/sd/source/ui/slidesorter/controller/SlsAnimator.cxx b/sd/source/ui/slidesorter/controller/SlsAnimator.cxx
index a8ce2dc..7b28c7d 100644
--- a/sd/source/ui/slidesorter/controller/SlsAnimator.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsAnimator.cxx
@@ -140,9 +140,6 @@ Animator::AnimationId Animator::AddAnimation (
return pAnimation->mnAnimationId;
}
-
-
-
void Animator::RemoveAnimation (const Animator::AnimationId nId)
{
OSL_ASSERT( ! mbIsDisposed);
diff --git a/sd/source/ui/slidesorter/inc/controller/SlsAnimator.hxx b/sd/source/ui/slidesorter/inc/controller/SlsAnimator.hxx
index c3915cb..c9e78d7 100644
--- a/sd/source/ui/slidesorter/inc/controller/SlsAnimator.hxx
+++ b/sd/source/ui/slidesorter/inc/controller/SlsAnimator.hxx
@@ -86,6 +86,7 @@ public:
*/
void RemoveAnimation (const AnimationId nAnimationId);
+
/** A typical use case for this method is the temporary shutdown of the
slidesorter when the slide sorter bar is put into a cache due to a
change of the edit mode.
diff --git a/sd/source/ui/slidesorter/inc/view/SlsPageObjectLayouter.hxx b/sd/source/ui/slidesorter/inc/view/SlsPageObjectLayouter.hxx
index 1c50da9..2303c83 100644
--- a/sd/source/ui/slidesorter/inc/view/SlsPageObjectLayouter.hxx
+++ b/sd/source/ui/slidesorter/inc/view/SlsPageObjectLayouter.hxx
@@ -67,7 +67,10 @@ public:
Name,
// Indicator whether or not there is a slide transition associated
// with this slide.
- TransitionEffectIndicator
+ TransitionEffectIndicator,
+ // Indicator whether or not there is a custom animation associated
+ // with this slide.
+ CustomAnimationEffectIndicator
};
/** Two coordinate systems are supported. They differ only in
translation not in scale. Both relate to pixel values in the window.
@@ -109,6 +112,7 @@ public:
const CoordinateSystem eCoordinateSystem);
Image GetTransitionEffectIcon (void) const;
+ Image GetCustomAnimationEffectIcon (void) const;
private:
SharedSdWindow mpWindow;
@@ -118,7 +122,9 @@ private:
Rectangle maPageNumberAreaBoundingBox;
Rectangle maPreviewBoundingBox;
Rectangle maTransitionEffectBoundingBox;
+ Rectangle maCustomAnimationEffectBoundingBox;
const Image maTransitionEffectIcon;
+ const Image maCustomAnimationEffectIcon;
const ::boost::shared_ptr<Font> mpPageNumberFont;
Size GetPageNumberAreaSize (const int nPageCount);
diff --git a/sd/source/ui/slidesorter/inc/view/SlsPageObjectPainter.hxx b/sd/source/ui/slidesorter/inc/view/SlsPageObjectPainter.hxx
index 3f73b56..a4bd182 100644
--- a/sd/source/ui/slidesorter/inc/view/SlsPageObjectPainter.hxx
+++ b/sd/source/ui/slidesorter/inc/view/SlsPageObjectPainter.hxx
@@ -100,6 +100,9 @@ private:
void PaintTransitionEffect (
OutputDevice& rDevice,
const model::SharedPageDescriptor& rpDescriptor) const;
+ void PaintCustomAnimationEffect (
+ OutputDevice& rDevice,
+ const model::SharedPageDescriptor& rpDescriptor) const;
void PaintBorder (
OutputDevice& rDevice,
const Theme::GradientColorType eColorType,
diff --git a/sd/source/ui/slidesorter/view/SlsPageObjectLayouter.cxx b/sd/source/ui/slidesorter/view/SlsPageObjectLayouter.cxx
index 21c42ad..ebbd839 100644
--- a/sd/source/ui/slidesorter/view/SlsPageObjectLayouter.cxx
+++ b/sd/source/ui/slidesorter/view/SlsPageObjectLayouter.cxx
@@ -48,6 +48,7 @@ PageObjectLayouter::PageObjectLayouter (
maPreviewBoundingBox(),
maTransitionEffectBoundingBox(),
maTransitionEffectIcon(IconCache::Instance().GetIcon(BMP_FADE_EFFECT_INDICATOR)),
+ maCustomAnimationEffectIcon(IconCache::Instance().GetIcon(BMP_CUSTOM_ANIMATION_INDICATOR)),
mpPageNumberFont(Theme::GetFont(Theme::Font_PageNumber, *rpWindow))
{
const Size aPageNumberAreaSize (GetPageNumberAreaSize(nPageCount));
@@ -81,9 +82,14 @@ PageObjectLayouter::PageObjectLayouter (
const Size aIconSize (maTransitionEffectIcon.GetSizePixel());
maTransitionEffectBoundingBox = Rectangle(
Point(
- (maPreviewBoundingBox.Left() - aIconSize.Width()) / 2,
+ (maPreviewBoundingBox.Left() - 2*aIconSize.Width()) / 2,
maPreviewBoundingBox.Bottom() - aIconSize.Height()),
aIconSize);
+ maCustomAnimationEffectBoundingBox = Rectangle(
+ Point(
+ (maPreviewBoundingBox.Left() - 2*aIconSize.Width()) / 2,
+ maPreviewBoundingBox.Bottom() - 2*aIconSize.Height()),
+ aIconSize);
}
@@ -207,6 +213,9 @@ Rectangle PageObjectLayouter::GetBoundingBox (
case TransitionEffectIndicator:
aBoundingBox = maTransitionEffectBoundingBox;
break;
+ case CustomAnimationEffectIndicator:
+ aBoundingBox = maCustomAnimationEffectBoundingBox;
+ break;
}
// Adapt coordinates to the requested coordinate system.
@@ -272,6 +281,11 @@ Image PageObjectLayouter::GetTransitionEffectIcon (void) const
return maTransitionEffectIcon;
}
+Image PageObjectLayouter::GetCustomAnimationEffectIcon (void) const
+{
+ return maCustomAnimationEffectIcon;
+}
+
} } } // end of namespace ::sd::slidesorter::view
diff --git a/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx b/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx
index 8c725f8..a87d7a7 100644
--- a/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx
+++ b/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx
@@ -35,9 +35,11 @@
#include <vcl/vclenum.hxx>
#include <vcl/virdev.hxx>
#include <boost/scoped_ptr.hpp>
+#include "CustomAnimationEffect.hxx"
using namespace ::drawinglayer::primitive2d;
+
namespace sd { namespace slidesorter { namespace view {
//===== PageObjectPainter =====================================================
@@ -70,7 +72,6 @@ PageObjectPainter::PageObjectPainter (
-
PageObjectPainter::~PageObjectPainter (void)
{
}
@@ -93,7 +94,7 @@ void PageObjectPainter::PaintPageObject (
PaintPreview(rDevice, rpDescriptor);
PaintPageNumber(rDevice, rpDescriptor);
PaintTransitionEffect(rDevice, rpDescriptor);
-
+ PaintCustomAnimationEffect(rDevice, rpDescriptor);
rDevice.SetAntialiasing(nSavedAntialiasingMode);
}
}
@@ -352,13 +353,30 @@ void PageObjectPainter::PaintTransitionEffect (
PageObjectLayouter::ModelCoordinateSystem));
rDevice.DrawBitmapEx(
- aBox.TopLeft(),
+ aBox.TopCenter(),
mpPageObjectLayouter->GetTransitionEffectIcon().GetBitmapEx());
}
}
-
-
+void PageObjectPainter::PaintCustomAnimationEffect (
+ OutputDevice& rDevice,
+ const model::SharedPageDescriptor& rpDescriptor) const
+{
+ SdPage* pPage = rpDescriptor->GetPage();
+ boost::shared_ptr< MainSequence > aMainSequence = pPage->getMainSequence();
+ EffectSequence::iterator aIter = aMainSequence->getBegin();
+ EffectSequence::iterator aEnd = aMainSequence->getEnd();
+ if ( aIter != aEnd )
+ {
+ const Rectangle aBox (mpPageObjectLayouter->GetBoundingBox(
+ rpDescriptor,
+ PageObjectLayouter::CustomAnimationEffectIndicator,
+ PageObjectLayouter::ModelCoordinateSystem));
+ rDevice.DrawBitmapEx(
+ aBox.TopCenter(),
+ mpPageObjectLayouter->GetCustomAnimationEffectIcon().GetBitmapEx());
+ }
+}
Bitmap& PageObjectPainter::GetBackgroundForState (
const model::SharedPageDescriptor& rpDescriptor,
More information about the Libreoffice-commits
mailing list