Kaydet (Commit) e5990a9d authored tarafından Ciorba Edmond's avatar Ciorba Edmond Kaydeden (comit) Andras Timar

fdo#65456 - Provide visual clues in slidesorter for custom animation.

Change-Id: I08666492fea76395fd24b0ebd02647821f49573d
üst b2d9ebf1
......@@ -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";
......
......@@ -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
......
......@@ -140,9 +140,6 @@ Animator::AnimationId Animator::AddAnimation (
return pAnimation->mnAnimationId;
}
void Animator::RemoveAnimation (const Animator::AnimationId nId)
{
OSL_ASSERT( ! mbIsDisposed);
......
......@@ -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.
......
......@@ -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);
......
......@@ -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,
......
......@@ -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
......
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment