87 rRenderContext.
Erase();
103 rRenderContext.
Pop();
113 CustomWidgetController::SetDrawingArea(pDrawingArea);
126 "DockingAnimation",
"modules/simpress/ui/dockinganimation.ui")
128 , m_xCtlDisplayWin(new
weld::CustomWeld(*m_xBuilder,
"preview", *m_xCtlDisplay))
129 , m_xBtnFirst(m_xBuilder->weld_button(
"first"))
130 , m_xBtnReverse(m_xBuilder->weld_button(
"prev"))
131 , m_xBtnStop(m_xBuilder->weld_button(
"stop"))
132 , m_xBtnPlay(m_xBuilder->weld_button(
"next"))
133 , m_xBtnLast(m_xBuilder->weld_button(
"last"))
134 , m_xNumFldBitmap(m_xBuilder->weld_spin_button(
"numbitmap"))
135 , m_xTimeField(m_xBuilder->weld_formatted_spin_button(
"duration"))
136 , m_xFormatter(new
weld::TimeFormatter(*m_xTimeField))
137 , m_xLbLoopCount(m_xBuilder->weld_combo_box(
"loopcount"))
138 , m_xBtnGetOneObject(m_xBuilder->weld_button(
"getone"))
139 , m_xBtnGetAllObjects(m_xBuilder->weld_button(
"getall"))
140 , m_xBtnRemoveBitmap(m_xBuilder->weld_button(
"delone"))
141 , m_xBtnRemoveAll(m_xBuilder->weld_button(
"delall"))
142 , m_xFiCount(m_xBuilder->weld_label(
"count"))
143 , m_xRbtGroup(m_xBuilder->weld_radio_button(
"group"))
144 , m_xRbtBitmap(m_xBuilder->weld_radio_button(
"bitmap"))
145 , m_xFtAdjustment(m_xBuilder->weld_label(
"alignmentft"))
146 , m_xLbAdjustment(m_xBuilder->weld_combo_box(
"alignment"))
147 , m_xBtnCreateGroup(m_xBuilder->weld_button(
"create"))
148 , m_xBtnHelp(m_xBuilder->weld_button(
"help"))
149 , m_nCurrentFrame(EMPTY_FRAMELIST)
162 pMyDoc->InsertPage(pPage.get());
234 m_nCurrentFrame = (m_FrameList.empty()) ? EMPTY_FRAMELIST : 0;
248 bool bDisableCtrls =
false;
249 size_t const nCount = m_FrameList.size();
250 bool bReverse = &rButton == m_xBtnReverse.get();
253 bool bRbtGroupEnabled = m_xRbtGroup->get_sensitive();
254 bool bBtnGetAllObjectsEnabled = m_xBtnGetAllObjects->get_sensitive();
255 bool bBtnGetOneObjectEnabled = m_xBtnGetOneObject->get_sensitive();
260 if( m_xRbtBitmap->get_active() )
264 aTime += m_FrameList[
i].second;
275 std::unique_ptr<SfxProgress> pProgress;
276 if( nFullTime >= 1000 )
278 bDisableCtrls =
true;
279 m_xBtnStop->set_sensitive(
true);
280 pProgress.reset(
new SfxProgress(
nullptr,
"Animator:", nFullTime ));
290 while( bCount && bMovie )
293 assert(
i < m_FrameList.size());
296 UpdateControl(bDisableCtrls);
298 if( m_xRbtBitmap->get_active() )
302 m_xFormatter->
SetTime( rTime );
305 WaitInEffect( nTime, nTmpTime, pProgress.get() );
310 WaitInEffect( 100, nTmpTime, pProgress.get() );
342 assert(
i == m_nCurrentFrame);
349 m_xBtnStop->set_sensitive(
false);
352 m_xRbtGroup->set_sensitive( bRbtGroupEnabled );
353 m_xBtnGetAllObjects->set_sensitive( bBtnGetAllObjectsEnabled );
354 m_xBtnGetOneObject->set_sensitive( bBtnGetOneObjectEnabled );
360 (m_FrameList.empty()) ? EMPTY_FRAMELIST : m_FrameList.size() - 1 ;
366 if (m_FrameList.empty() || m_xRbtGroup->get_active())
368 m_xTimeField->set_text( OUString() );
369 m_xTimeField->set_sensitive(
false );
370 m_xLbLoopCount->set_sensitive(
false );
372 else if (m_xRbtBitmap->get_active())
378 m_xFormatter->
SetTime( rTime );
379 m_xFormatter->ReFormat();
381 m_xTimeField->set_sensitive(
true);
382 m_xLbLoopCount->set_sensitive(
true);
394 bAllObjects = &rBtn == m_xBtnGetAllObjects.get();
400 SID_ANIMATOR_ADD, SfxCallMode::SLOT | SfxCallMode::RECORD, { &aItem });
409 if (&rBtn == m_xBtnRemoveBitmap.get() && EMPTY_FRAMELIST != m_nCurrentFrame)
411 m_FrameList.erase(m_FrameList.begin() + m_nCurrentFrame);
424 if (m_nCurrentFrame >= m_FrameList.size())
427 m_nCurrentFrame = m_FrameList.empty() ? EMPTY_FRAMELIST : m_FrameList.size() - 1;
433 VclMessageType::Warning, VclButtonsType::YesNo,
434 SdResId(STR_ASK_DELETE_ALL_PICTURES)));
435 short nReturn = xWarn->run();
440 for (
size_t i = m_FrameList.size();
i > 0; )
453 m_nCurrentFrame = EMPTY_FRAMELIST;
458 if (m_FrameList.empty())
460 m_xBtnCreateGroup->set_sensitive(
false);
463 m_xRbtGroup->set_sensitive(
true);
468 m_xCtlDisplay->SetScale(aFrac);
479 SfxCallMode::SLOT | SfxCallMode::RECORD, { &aItem });
484 sal_uLong nBmp = m_xNumFldBitmap->get_value();
486 if (nBmp > m_FrameList.size())
488 nBmp = m_FrameList.size();
491 m_nCurrentFrame = nBmp - 1;
502 rTime = m_xFormatter->
GetTime();
521 aMap.SetMapUnit( MapUnit::Map100thMM );
522 aMap.SetOrigin( aOrigin );
523 pVD->SetMapMode(
aMap );
524 pVD->SetOutputSize( aObjSize );
531 pObject->SingleObjectPainter( *pVD );
532 aBmp = pVD->GetBitmapEx( aObjRect.
TopLeft(), aObjSize );
577 if(
bMovie && bDisableCtrls )
619 while (aCurrent < aEnd)
624 pProgress->
SetState( nTime + nMilliSeconds + aCurrent - aEnd );
653 aFrac =
Fraction( std::min(
static_cast<double>(aDisplaySize.
Width()) /
static_cast<double>(aBmpSize.
Width()),
654 static_cast<double>(aDisplaySize.
Height()) /
static_cast<double>(aBmpSize.
Height()) ) );
677 SID_ANIMATION_OBJECTS, SfxCallMode::ASYNCHRON | SfxCallMode::RECORD,
703 bool bAnimObj =
false;
704 if( nMarkCount == 1 )
713 if( nInv == SdrInventor::Default &&
nId == SdrObjKind::Graphic &&
static_cast<SdrGrafObj*
>(
pObject )->IsAnimated() )
746 ::std::make_pair(rAnimationFrame.
maBitmapEx, aTime));
762 for(
size_t nObject = 0; nObject < pObjList->
GetObjCount(); ++nObject )
783 if( !bAnimObj && !(
bAllObjects && nMarkCount > 1 ) )
792 ::std::make_pair(aBitmapEx, aTime));
796 if( nMarkCount == 1 && !bAnimObj )
805 else if (nMarkCount > 1)
810 for(
size_t nObject= 0; nObject < nMarkCount; ++nObject )
832 SdrObjList* pObjList = pCloneGroup->GetSubList();
834 for (
size_t nObject= 0; nObject < nMarkCount; ++nObject)
868 DBG_ASSERT( pOutWin,
"Window does not exist!" );
871 const MapMode aMap100( MapUnit::Map100thMM );
884 const Graphic aGraphic( rBmpEx );
912 nTime += rTime.
GetSec() * 100;
964 sal_uInt32 nLoopCount = 0;
973 aAnimationFrame.
mnWait = nTime;
977 aAnimation.
Insert( aAnimationFrame );
985 const Point aOrg( aWindowCenter.
X() - ( aMaxSizeLog.
Width() >> 1 ), aWindowCenter.
Y() - ( aMaxSizeLog.
Height() >> 1 ) );
1046 Size aMoveSize( aMovePt.
X(), aMovePt.
Y() );
1072 aTemp = aMaxSizeLog;
1075 pGroup->NbcMove(aTemp);
1088 SfxDockingWindow::DataChanged( rDCEvt );
1090 if ( (rDCEvt.
GetType() == DataChangedEventType::SETTINGS) && (rDCEvt.
GetFlags() & AllSettingsFlags::STYLE) )
1104 pAnimationWin( pAnimWin )
1111 if( eState >= SfxItemState::DEFAULT && nSId == SID_ANIMATOR_STATE )
const StyleSettings & GetStyleSettings() const
void SetLoopCount(const sal_uInt32 nLoopCount)
const AnimationFrame & Get(sal_uInt16 nAnimation) const
sal_uInt32 GetLoopCount() const
void SetDisplaySizePixel(const Size &rSize)
bool Insert(const AnimationFrame &rAnimationFrame)
static OutputDevice * GetDefaultDevice()
static const AllSettings & GetSettings()
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, const ILibreOfficeKitNotifier *pNotifier=nullptr)
static bool Reschedule(bool bHandleAllCurrentEvents=false)
bool Erase(const Color &rFillColor)
Bitmap GetBitmap(Color aTransparentReplaceColor) const
void Draw(OutputDevice *pOutDev, const Point &rDestPt) const
const Size & GetSizePixel() const
Size GetSizePixel() const
sal_uInt16 GetValue() const
DataChangedEventType GetType() const
AllSettingsFlags GetFlags() const
virtual void InsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE) override
Animation GetAnimation() const
BitmapEx GetBitmapEx(const GraphicConversionParameters &rParameters=GraphicConversionParameters()) const
MapMode GetPrefMapMode() const
MapUnit GetMapUnit() const
SAL_WARN_UNUSED_RESULT Point PixelToLogic(const Point &rDevicePt) const
SAL_WARN_UNUSED_RESULT Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
SAL_WARN_UNUSED_RESULT Point LogicToPixel(const Point &rLogicPt) const
void Push(vcl::PushFlags nFlags=vcl::PushFlags::ALL)
virtual vcl::Window * GetOwnerWindow() const
constexpr tools::Long Y() const
void setX(tools::Long nX)
void setY(tools::Long nY)
constexpr tools::Long X() const
bool mbIsMovie
if group object than it is a sequence of them.
static SAL_DLLPRIVATE SdAnimationInfo * GetAnimationInfo(SdrObject *pObject)
deprecated
virtual rtl::Reference< SdrObject > RemoveObject(size_t nObjNum) override
bool InsertObjectAtView(SdrObject *pObj, SdrPageView &rPV, SdrInsertFlags nOptions=SdrInsertFlags::NONE)
Graphic GetAllMarkedGraphic() const
static Graphic GetObjGraphic(const SdrObject &rSdrObject, bool bSVG=false)
Graphic GetTransformedGraphic(SdrGrafObjTransformsAttrs nTransformFlags=SdrGrafObjTransformsAttrs::ALL) const
size_t GetMarkCount() const
SdrMark * GetMark(size_t nNum) const
const SdrMarkList & GetMarkedObjectList() const
SdrObject * GetMarkedSdrObj() const
virtual bool IsTextEdit() const final override
virtual void InsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE)
SdrObject * GetObj(size_t nNum) const
size_t GetObjCount() const
virtual const tools::Rectangle & GetSnapRect() const
virtual rtl::Reference< SdrObject > CloneSdrObject(SdrModel &rTargetModel) const=0
virtual void NbcMove(const Size &rSiz)
SdrPage * GetPage() const
SdrModel & getSdrModelFromSdrPage() const
OutputDevice * GetFirstOutputDevice() const
SdrModel & getSdrModelFromSdrView() const
SdrPageView * GetSdrPageView() const
SfxDispatcher * GetDispatcher() const
const SfxPoolItem * ExecuteList(sal_uInt16 nSlot, SfxCallMode nCall, std::initializer_list< SfxPoolItem const * > args, std::initializer_list< SfxPoolItem const * > internalargs=std::initializer_list< SfxPoolItem const * >())
virtual void Resize() override
SfxBindings & GetBindings() const
virtual bool Close() override
virtual void dispose() override
void SetMinOutputSizePixel(const Size &rSize)
void SetState(sal_uInt32 nVal, sal_uInt32 nNewRange=0)
constexpr tools::Long Height() const
tools::Long AdjustHeight(tools::Long n)
void setWidth(tools::Long nWidth)
tools::Long AdjustWidth(tools::Long n)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
bool GetHighContrastMode() const
const Color & GetFieldColor() const
AnimationControllerItem(sal_uInt16, AnimationWindow *, SfxBindings *)
ControllerItem for Animator.
virtual void StateChangedAtToolBoxControl(sal_uInt16 nSId, SfxItemState eState, const SfxPoolItem *pState) override
VclPtr< AnimationWindow > pAnimationWin
std::unique_ptr< weld::RadioButton > m_xRbtBitmap
std::unique_ptr< weld::ComboBox > m_xLbLoopCount
void WaitInEffect(sal_uLong nMilliSeconds, sal_uLong nTime, SfxProgress *pStbMgr) const
virtual bool Close() override
void CreateAnimObj(::sd::View &rView)
std::unique_ptr< weld::Button > m_xBtnStop
std::unique_ptr< weld::Button > m_xBtnRemoveAll
std::unique_ptr< AnimationControllerItem > pControllerItem
virtual void Resize() override
void UpdateControl(bool bDisableCtrls=false)
std::unique_ptr< weld::SpinButton > m_xNumFldBitmap
friend class AnimationControllerItem
std::unique_ptr< weld::ComboBox > m_xLbAdjustment
std::unique_ptr< SdDrawDocument > pMyDoc
std::unique_ptr< weld::Button > m_xBtnFirst
std::unique_ptr< SdDisplay > m_xCtlDisplay
std::unique_ptr< weld::RadioButton > m_xRbtGroup
std::unique_ptr< weld::Button > m_xBtnRemoveBitmap
std::unique_ptr< weld::TimeFormatter > m_xFormatter
std::unique_ptr< weld::Button > m_xBtnReverse
std::unique_ptr< weld::Label > m_xFiCount
virtual void dispose() override
::std::vector< ::std::pair< BitmapEx, ::tools::Time > > m_FrameList
virtual void DataChanged(const DataChangedEvent &rDCEvt) override
void AddObj(::sd::View &rView)
std::unique_ptr< weld::FormattedSpinButton > m_xTimeField
std::unique_ptr< weld::Button > m_xBtnPlay
std::unique_ptr< weld::Button > m_xBtnGetAllObjects
AnimationWindow(SfxBindings *pBindings, SfxChildWindow *pCW, vcl::Window *pParent)
AnimationWindow - FloatingWindow.
std::unique_ptr< weld::Button > m_xBtnCreateGroup
std::unique_ptr< weld::Button > m_xBtnGetOneObject
virtual ~AnimationWindow() override
std::unique_ptr< weld::Button > m_xBtnLast
std::unique_ptr< weld::Label > m_xFtAdjustment
static const size_t EMPTY_FRAMELIST
std::unique_ptr< weld::CustomWeld > m_xCtlDisplayWin
std::unique_ptr< weld::Button > m_xBtnHelp
static void CreateAnimatedGroup(SdrObjGroup const &rGroupObj, SdPage &rPage)
void SetBitmapEx(BitmapEx const *pBmpEx)
void SetScale(const Fraction &rFrac)
SdDisplay()
SdDisplay - Control.
virtual ~SdDisplay() override
virtual void Paint(vcl::RenderContext &rRenderContext, const ::tools::Rectangle &rRect) override
virtual void SetDrawingArea(weld::DrawingArea *pDrawingArea) override
virtual SdrEndTextEditKind SdrEndTextEdit(bool bDontDeleteReally=false) override
ends current text editing
Point PixelToLogic(const Point &rDevicePt) const
Size GetOutputSizePixel() const
virtual OutputDevice & get_ref_device()=0
#define DBG_ASSERT(sCon, aError)
weld::Window * GetFrameWeld(const SfxFrame *pFrame)
virtual void SetText(const OUString &rStr) override
virtual SfxBindings & GetBindings() override
EmbeddedObjectRef * pObject
#define LINK(Instance, Class, Member)
constexpr OUStringLiteral first
const DrawModeFlags OUTPUT_DRAWMODE_CONTRAST
IMPL_LINK_NOARG(MainSequence, onTimerHdl, Timer *, void)
IMPL_LINK(SdCharHeightPropertyBox, implMenuSelectHdl, const OUString &, rIdent, void)
const DrawModeFlags OUTPUT_DRAWMODE_COLOR
HashMap_OWString_Interface aMap
Reference< XNameAccess > m_xContainer
OUString SdResId(TranslateId aId)