summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCiorba Edmond <edmond_ciorba@yahoo.com>2013-06-13 22:19:38 +0300
committerAndras Timar <atimar@suse.com>2013-06-25 12:29:13 +0200
commite5990a9dcd97c2231115eae83770f9e6e7e130e9 (patch)
tree282ac2ae9b57072f245c1ee04a472fd3b306589b
parentb2d9ebf1b95867f7df335b74f3e3c5328647f34a (diff)
fdo#65456 - Provide visual clues in slidesorter for custom animation.
Change-Id: I08666492fea76395fd24b0ebd02647821f49573d
-rw-r--r--sd/source/ui/app/res_bmp.src5
-rw-r--r--sd/source/ui/inc/res_bmp.hrc1
-rw-r--r--sd/source/ui/slidesorter/controller/SlsAnimator.cxx3
-rw-r--r--sd/source/ui/slidesorter/inc/controller/SlsAnimator.hxx1
-rw-r--r--sd/source/ui/slidesorter/inc/view/SlsPageObjectLayouter.hxx8
-rw-r--r--sd/source/ui/slidesorter/inc/view/SlsPageObjectPainter.hxx3
-rw-r--r--sd/source/ui/slidesorter/view/SlsPageObjectLayouter.cxx16
-rw-r--r--sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx28
8 files changed, 55 insertions, 10 deletions
diff --git a/sd/source/ui/app/res_bmp.src b/sd/source/ui/app/res_bmp.src
index 31145878bfe1..246f23092e6f 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 ec354360aea8..efdd47a8f588 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 a8ce2dcd1bdd..7b28c7d6ab53 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 c3915cb16cb6..c9e78d7e6121 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 1c50da9871ce..2303c835759f 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 3f73b56d9c9f..a4bd18246e8c 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 21c42ad78591..ebbd8391f278 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 8c725f882ec5..a87d7a77711f 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,