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 ...@@ -338,6 +338,11 @@ Bitmap BMP_FADE_EFFECT_INDICATOR
File = "fade_effect_indicator.bmp"; File = "fade_effect_indicator.bmp";
}; };
Bitmap BMP_CUSTOM_ANIMATION_INDICATOR
{
File = "click_16.bmp";
};
Bitmap BMP_COMMENTS_INDICATOR Bitmap BMP_COMMENTS_INDICATOR
{ {
File = "comments_indicator.bmp"; File = "comments_indicator.bmp";
......
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
// additional effects // additional effects
#define BMP_FADE_EFFECT_INDICATOR RID_SD_START+331 #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 #define BMP_COMMENTS_INDICATOR RID_SD_START+338
......
...@@ -140,9 +140,6 @@ Animator::AnimationId Animator::AddAnimation ( ...@@ -140,9 +140,6 @@ Animator::AnimationId Animator::AddAnimation (
return pAnimation->mnAnimationId; return pAnimation->mnAnimationId;
} }
void Animator::RemoveAnimation (const Animator::AnimationId nId) void Animator::RemoveAnimation (const Animator::AnimationId nId)
{ {
OSL_ASSERT( ! mbIsDisposed); OSL_ASSERT( ! mbIsDisposed);
......
...@@ -86,6 +86,7 @@ public: ...@@ -86,6 +86,7 @@ public:
*/ */
void RemoveAnimation (const AnimationId nAnimationId); void RemoveAnimation (const AnimationId nAnimationId);
/** A typical use case for this method is the temporary shutdown of the /** 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 slidesorter when the slide sorter bar is put into a cache due to a
change of the edit mode. change of the edit mode.
......
...@@ -67,7 +67,10 @@ public: ...@@ -67,7 +67,10 @@ public:
Name, Name,
// Indicator whether or not there is a slide transition associated // Indicator whether or not there is a slide transition associated
// with this slide. // 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 /** Two coordinate systems are supported. They differ only in
translation not in scale. Both relate to pixel values in the window. translation not in scale. Both relate to pixel values in the window.
...@@ -109,6 +112,7 @@ public: ...@@ -109,6 +112,7 @@ public:
const CoordinateSystem eCoordinateSystem); const CoordinateSystem eCoordinateSystem);
Image GetTransitionEffectIcon (void) const; Image GetTransitionEffectIcon (void) const;
Image GetCustomAnimationEffectIcon (void) const;
private: private:
SharedSdWindow mpWindow; SharedSdWindow mpWindow;
...@@ -118,7 +122,9 @@ private: ...@@ -118,7 +122,9 @@ private:
Rectangle maPageNumberAreaBoundingBox; Rectangle maPageNumberAreaBoundingBox;
Rectangle maPreviewBoundingBox; Rectangle maPreviewBoundingBox;
Rectangle maTransitionEffectBoundingBox; Rectangle maTransitionEffectBoundingBox;
Rectangle maCustomAnimationEffectBoundingBox;
const Image maTransitionEffectIcon; const Image maTransitionEffectIcon;
const Image maCustomAnimationEffectIcon;
const ::boost::shared_ptr<Font> mpPageNumberFont; const ::boost::shared_ptr<Font> mpPageNumberFont;
Size GetPageNumberAreaSize (const int nPageCount); Size GetPageNumberAreaSize (const int nPageCount);
......
...@@ -100,6 +100,9 @@ private: ...@@ -100,6 +100,9 @@ private:
void PaintTransitionEffect ( void PaintTransitionEffect (
OutputDevice& rDevice, OutputDevice& rDevice,
const model::SharedPageDescriptor& rpDescriptor) const; const model::SharedPageDescriptor& rpDescriptor) const;
void PaintCustomAnimationEffect (
OutputDevice& rDevice,
const model::SharedPageDescriptor& rpDescriptor) const;
void PaintBorder ( void PaintBorder (
OutputDevice& rDevice, OutputDevice& rDevice,
const Theme::GradientColorType eColorType, const Theme::GradientColorType eColorType,
......
...@@ -48,6 +48,7 @@ PageObjectLayouter::PageObjectLayouter ( ...@@ -48,6 +48,7 @@ PageObjectLayouter::PageObjectLayouter (
maPreviewBoundingBox(), maPreviewBoundingBox(),
maTransitionEffectBoundingBox(), maTransitionEffectBoundingBox(),
maTransitionEffectIcon(IconCache::Instance().GetIcon(BMP_FADE_EFFECT_INDICATOR)), maTransitionEffectIcon(IconCache::Instance().GetIcon(BMP_FADE_EFFECT_INDICATOR)),
maCustomAnimationEffectIcon(IconCache::Instance().GetIcon(BMP_CUSTOM_ANIMATION_INDICATOR)),
mpPageNumberFont(Theme::GetFont(Theme::Font_PageNumber, *rpWindow)) mpPageNumberFont(Theme::GetFont(Theme::Font_PageNumber, *rpWindow))
{ {
const Size aPageNumberAreaSize (GetPageNumberAreaSize(nPageCount)); const Size aPageNumberAreaSize (GetPageNumberAreaSize(nPageCount));
...@@ -81,9 +82,14 @@ PageObjectLayouter::PageObjectLayouter ( ...@@ -81,9 +82,14 @@ PageObjectLayouter::PageObjectLayouter (
const Size aIconSize (maTransitionEffectIcon.GetSizePixel()); const Size aIconSize (maTransitionEffectIcon.GetSizePixel());
maTransitionEffectBoundingBox = Rectangle( maTransitionEffectBoundingBox = Rectangle(
Point( Point(
(maPreviewBoundingBox.Left() - aIconSize.Width()) / 2, (maPreviewBoundingBox.Left() - 2*aIconSize.Width()) / 2,
maPreviewBoundingBox.Bottom() - aIconSize.Height()), maPreviewBoundingBox.Bottom() - aIconSize.Height()),
aIconSize); aIconSize);
maCustomAnimationEffectBoundingBox = Rectangle(
Point(
(maPreviewBoundingBox.Left() - 2*aIconSize.Width()) / 2,
maPreviewBoundingBox.Bottom() - 2*aIconSize.Height()),
aIconSize);
} }
...@@ -207,6 +213,9 @@ Rectangle PageObjectLayouter::GetBoundingBox ( ...@@ -207,6 +213,9 @@ Rectangle PageObjectLayouter::GetBoundingBox (
case TransitionEffectIndicator: case TransitionEffectIndicator:
aBoundingBox = maTransitionEffectBoundingBox; aBoundingBox = maTransitionEffectBoundingBox;
break; break;
case CustomAnimationEffectIndicator:
aBoundingBox = maCustomAnimationEffectBoundingBox;
break;
} }
// Adapt coordinates to the requested coordinate system. // Adapt coordinates to the requested coordinate system.
...@@ -272,6 +281,11 @@ Image PageObjectLayouter::GetTransitionEffectIcon (void) const ...@@ -272,6 +281,11 @@ Image PageObjectLayouter::GetTransitionEffectIcon (void) const
return maTransitionEffectIcon; return maTransitionEffectIcon;
} }
Image PageObjectLayouter::GetCustomAnimationEffectIcon (void) const
{
return maCustomAnimationEffectIcon;
}
} } } // end of namespace ::sd::slidesorter::view } } } // end of namespace ::sd::slidesorter::view
......
...@@ -35,9 +35,11 @@ ...@@ -35,9 +35,11 @@
#include <vcl/vclenum.hxx> #include <vcl/vclenum.hxx>
#include <vcl/virdev.hxx> #include <vcl/virdev.hxx>
#include <boost/scoped_ptr.hpp> #include <boost/scoped_ptr.hpp>
#include "CustomAnimationEffect.hxx"
using namespace ::drawinglayer::primitive2d; using namespace ::drawinglayer::primitive2d;
namespace sd { namespace slidesorter { namespace view { namespace sd { namespace slidesorter { namespace view {
//===== PageObjectPainter ===================================================== //===== PageObjectPainter =====================================================
...@@ -70,7 +72,6 @@ PageObjectPainter::PageObjectPainter ( ...@@ -70,7 +72,6 @@ PageObjectPainter::PageObjectPainter (
PageObjectPainter::~PageObjectPainter (void) PageObjectPainter::~PageObjectPainter (void)
{ {
} }
...@@ -93,7 +94,7 @@ void PageObjectPainter::PaintPageObject ( ...@@ -93,7 +94,7 @@ void PageObjectPainter::PaintPageObject (
PaintPreview(rDevice, rpDescriptor); PaintPreview(rDevice, rpDescriptor);
PaintPageNumber(rDevice, rpDescriptor); PaintPageNumber(rDevice, rpDescriptor);
PaintTransitionEffect(rDevice, rpDescriptor); PaintTransitionEffect(rDevice, rpDescriptor);
PaintCustomAnimationEffect(rDevice, rpDescriptor);
rDevice.SetAntialiasing(nSavedAntialiasingMode); rDevice.SetAntialiasing(nSavedAntialiasingMode);
} }
} }
...@@ -352,13 +353,30 @@ void PageObjectPainter::PaintTransitionEffect ( ...@@ -352,13 +353,30 @@ void PageObjectPainter::PaintTransitionEffect (
PageObjectLayouter::ModelCoordinateSystem)); PageObjectLayouter::ModelCoordinateSystem));
rDevice.DrawBitmapEx( rDevice.DrawBitmapEx(
aBox.TopLeft(), aBox.TopCenter(),
mpPageObjectLayouter->GetTransitionEffectIcon().GetBitmapEx()); 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 ( Bitmap& PageObjectPainter::GetBackgroundForState (
const model::SharedPageDescriptor& rpDescriptor, 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