update emoji autocorrect entries from po-files
[LibreOffice.git] / vcl / source / gdi / animate.cxx
blob8e76d7e29cf339f1743d7c97a8ef410400ed51bf
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <vcl/animate.hxx>
21 #include <tools/debug.hxx>
22 #include <tools/stream.hxx>
23 #include <rtl/crc.h>
24 #include <vcl/virdev.hxx>
25 #include <vcl/window.hxx>
26 #include <impanmvw.hxx>
27 #include <vcl/dibtools.hxx>
29 #define MIN_TIMEOUT 2L
30 #define INC_TIMEOUT 0L
32 sal_uLong Animation::mnAnimCount = 0UL;
34 BitmapChecksum AnimationBitmap::GetChecksum() const
36 BitmapChecksum nCrc = aBmpEx.GetChecksum();
37 SVBT32 aBT32;
39 UInt32ToSVBT32( aPosPix.X(), aBT32 );
40 nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
42 UInt32ToSVBT32( aPosPix.Y(), aBT32 );
43 nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
45 UInt32ToSVBT32( aSizePix.Width(), aBT32 );
46 nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
48 UInt32ToSVBT32( aSizePix.Height(), aBT32 );
49 nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
51 UInt32ToSVBT32( (long) nWait, aBT32 );
52 nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
54 UInt32ToSVBT32( (long) eDisposal, aBT32 );
55 nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
57 UInt32ToSVBT32( (long) bUserInput, aBT32 );
58 nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
60 return nCrc;
63 Animation::Animation() :
64 mnLoopCount ( 0 ),
65 mnLoops ( 0 ),
66 mnPos ( 0 ),
67 meCycleMode ( CYCLE_NORMAL ),
68 mbIsInAnimation ( false ),
69 mbLoopTerminated ( false ),
70 mbIsWaiting ( false )
72 maTimer.SetTimeoutHdl( LINK( this, Animation, ImplTimeoutHdl ) );
75 Animation::Animation( const Animation& rAnimation ) :
76 maBitmapEx ( rAnimation.maBitmapEx ),
77 maGlobalSize ( rAnimation.maGlobalSize ),
78 mnLoopCount ( rAnimation.mnLoopCount ),
79 mnPos ( rAnimation.mnPos ),
80 meCycleMode ( rAnimation.meCycleMode ),
81 mbIsInAnimation ( false ),
82 mbLoopTerminated ( rAnimation.mbLoopTerminated ),
83 mbIsWaiting ( rAnimation.mbIsWaiting )
86 for( size_t i = 0, nCount = rAnimation.maList.size(); i < nCount; i++ )
87 maList.push_back( new AnimationBitmap( *rAnimation.maList[ i ] ) );
89 maTimer.SetTimeoutHdl( LINK( this, Animation, ImplTimeoutHdl ) );
90 mnLoops = mbLoopTerminated ? 0 : mnLoopCount;
93 Animation::~Animation()
96 if( mbIsInAnimation )
97 Stop();
99 for( size_t i = 0, n = maList.size(); i < n; ++i )
100 delete maList[ i ];
102 for( size_t i = 0, n = maViewList.size(); i < n; ++i )
103 delete maViewList[ i ];
106 Animation& Animation::operator=( const Animation& rAnimation )
108 Clear();
110 for( size_t i = 0, nCount = rAnimation.maList.size(); i < nCount; i++ )
111 maList.push_back( new AnimationBitmap( *rAnimation.maList[ i ] ) );
113 maGlobalSize = rAnimation.maGlobalSize;
114 maBitmapEx = rAnimation.maBitmapEx;
115 meCycleMode = rAnimation.meCycleMode;
116 mnLoopCount = rAnimation.mnLoopCount;
117 mnPos = rAnimation.mnPos;
118 mbLoopTerminated = rAnimation.mbLoopTerminated;
119 mbIsWaiting = rAnimation.mbIsWaiting;
120 mnLoops = mbLoopTerminated ? 0 : mnLoopCount;
122 return *this;
125 bool Animation::operator==( const Animation& rAnimation ) const
127 const size_t nCount = maList.size();
128 bool bRet = false;
130 if( rAnimation.maList.size() == nCount
131 && rAnimation.maBitmapEx == maBitmapEx
132 && rAnimation.maGlobalSize == maGlobalSize
133 && rAnimation.meCycleMode == meCycleMode
136 bRet = true;
138 for( size_t n = 0; n < nCount; n++ )
140 if( ( *maList[ n ] ) != ( *rAnimation.maList[ n ] ) )
142 bRet = false;
143 break;
148 return bRet;
151 void Animation::Clear()
153 maTimer.Stop();
154 mbIsInAnimation = false;
155 maGlobalSize = Size();
156 maBitmapEx.SetEmpty();
158 for( size_t i = 0, n = maList.size(); i < n; ++i )
159 delete maList[ i ];
160 maList.clear();
162 for( size_t i = 0, n = maViewList.size(); i < n; ++i )
163 delete maViewList[ i ];
164 maViewList.clear();
167 bool Animation::IsTransparent() const
169 Point aPoint;
170 Rectangle aRect( aPoint, maGlobalSize );
171 bool bRet = false;
173 // If some small bitmap needs to be replaced by the background,
174 // we need to be transparent, in order to be displayed correctly
175 // as the application (?) does not invalidate on non-transparent
176 // graphics due to performance reasons.
177 for( size_t i = 0, nCount = maList.size(); i < nCount; i++ )
179 const AnimationBitmap* pAnimBmp = maList[ i ];
181 if( DISPOSE_BACK == pAnimBmp->eDisposal
182 && Rectangle( pAnimBmp->aPosPix, pAnimBmp->aSizePix ) != aRect
185 bRet = true;
186 break;
190 if( !bRet )
191 bRet = maBitmapEx.IsTransparent();
193 return bRet;
196 sal_uLong Animation::GetSizeBytes() const
198 sal_uLong nSizeBytes = GetBitmapEx().GetSizeBytes();
200 for( size_t i = 0, nCount = maList.size(); i < nCount; i++ )
202 const AnimationBitmap* pAnimBmp = maList[ i ];
203 nSizeBytes += pAnimBmp->aBmpEx.GetSizeBytes();
206 return nSizeBytes;
209 BitmapChecksum Animation::GetChecksum() const
211 SVBT32 aBT32;
212 BitmapChecksumOctetArray aBCOA;
213 BitmapChecksum nCrc = GetBitmapEx().GetChecksum();
215 UInt32ToSVBT32( maList.size(), aBT32 );
216 nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
218 UInt32ToSVBT32( maGlobalSize.Width(), aBT32 );
219 nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
221 UInt32ToSVBT32( maGlobalSize.Height(), aBT32 );
222 nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
224 UInt32ToSVBT32( (long) meCycleMode, aBT32 );
225 nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
227 for( size_t i = 0, nCount = maList.size(); i < nCount; i++ )
229 BCToBCOA( maList[ i ]->GetChecksum(), aBCOA );
230 nCrc = vcl_get_checksum( nCrc, aBCOA, BITMAP_CHECKSUM_SIZE );
233 return nCrc;
236 bool Animation::Start( OutputDevice* pOut, const Point& rDestPt, const Size& rDestSz, long nExtraData,
237 OutputDevice* pFirstFrameOutDev )
239 bool bRet = false;
241 if( !maList.empty() )
243 if( ( pOut->GetOutDevType() == OUTDEV_WINDOW )
244 && !mbLoopTerminated
245 && ( ANIMATION_TIMEOUT_ON_CLICK != maList[ mnPos ]->nWait )
248 ImplAnimView* pView;
249 ImplAnimView* pMatch = NULL;
251 for( size_t i = 0; i < maViewList.size(); ++i )
253 pView = maViewList[ i ];
254 if( pView->matches( pOut, nExtraData ) )
256 if( pView->getOutPos() == rDestPt &&
257 pView->getOutSizePix() == pOut->LogicToPixel( rDestSz ) )
259 pView->repaint();
260 pMatch = pView;
262 else
264 delete maViewList[ i ];
265 maViewList.erase( maViewList.begin() + i );
266 pView = NULL;
269 break;
273 if( maViewList.empty() )
275 maTimer.Stop();
276 mbIsInAnimation = false;
277 mnPos = 0UL;
280 if( !pMatch )
281 maViewList.push_back( new ImplAnimView( this, pOut, rDestPt, rDestSz, nExtraData, pFirstFrameOutDev ) );
283 if( !mbIsInAnimation )
285 ImplRestartTimer( maList[ mnPos ]->nWait );
286 mbIsInAnimation = true;
289 else
290 Draw( pOut, rDestPt, rDestSz );
292 bRet = true;
295 return bRet;
298 void Animation::Stop( OutputDevice* pOut, long nExtraData )
300 for( size_t i = 0; i < maViewList.size(); )
303 ImplAnimView* pView = maViewList[ i ];
304 if( pView->matches( pOut, nExtraData ) )
306 delete pView;
307 maViewList.erase( maViewList.begin() + i );
309 else
310 i++;
313 if( maViewList.empty() )
315 maTimer.Stop();
316 mbIsInAnimation = false;
320 void Animation::Draw( OutputDevice* pOut, const Point& rDestPt ) const
322 Draw( pOut, rDestPt, pOut->PixelToLogic( maGlobalSize ) );
325 void Animation::Draw( OutputDevice* pOut, const Point& rDestPt, const Size& rDestSz ) const
327 const size_t nCount = maList.size();
329 if( nCount )
331 AnimationBitmap* pObj = maList[ std::min( mnPos, nCount - 1 ) ];
333 if( pOut->GetConnectMetaFile()
334 || ( pOut->GetOutDevType() == OUTDEV_PRINTER )
336 maList[ 0 ]->aBmpEx.Draw( pOut, rDestPt, rDestSz );
337 else if( ANIMATION_TIMEOUT_ON_CLICK == pObj->nWait )
338 pObj->aBmpEx.Draw( pOut, rDestPt, rDestSz );
339 else
341 const size_t nOldPos = mnPos;
342 const_cast<Animation*>(this)->mnPos = mbLoopTerminated ? ( nCount - 1UL ) : mnPos;
343 delete new ImplAnimView( const_cast<Animation*>(this), pOut, rDestPt, rDestSz, 0 );
344 const_cast<Animation*>(this)->mnPos = nOldPos;
349 void Animation::ImplRestartTimer( sal_uLong nTimeout )
351 maTimer.SetTimeout( std::max( nTimeout, (sal_uLong)(MIN_TIMEOUT + ( mnAnimCount - 1 ) * INC_TIMEOUT) ) * 10L );
352 maTimer.Start();
355 typedef ::std::vector< AInfo* > AInfoList_impl;
357 IMPL_LINK_NOARG_TYPED(Animation, ImplTimeoutHdl, Timer *, void)
359 const size_t nAnimCount = maList.size();
360 AInfoList_impl aAInfoList;
362 if( nAnimCount )
364 ImplAnimView* pView;
365 bool bGlobalPause = true;
367 if( maNotifyLink.IsSet() )
369 // create AInfo-List
370 for( size_t i = 0, n = maViewList.size(); i < n; ++i )
371 aAInfoList.push_back( maViewList[ i ]->createAInfo() );
373 maNotifyLink.Call( this );
375 // set view state from AInfo structure
376 for( size_t i = 0, n = aAInfoList.size(); i < n; ++i )
378 AInfo* pAInfo = aAInfoList[ i ];
379 if( !pAInfo->pViewData )
381 pView = new ImplAnimView( this, pAInfo->pOutDev,
382 pAInfo->aStartOrg, pAInfo->aStartSize, pAInfo->nExtraData );
384 maViewList.push_back( pView );
386 else
387 pView = static_cast<ImplAnimView*>(pAInfo->pViewData);
389 pView->pause( pAInfo->bPause );
390 pView->setMarked( true );
393 // delete AInfo structures
394 for( size_t i = 0, n = aAInfoList.size(); i < n; ++i )
395 delete aAInfoList[ i ];
396 aAInfoList.clear();
398 // delete all unmarked views and reset marked state
399 for( size_t i = 0; i < maViewList.size(); )
401 pView = maViewList[ i ];
402 if( !pView->isMarked() )
404 delete pView;
405 maViewList.erase( maViewList.begin() + i );
407 else
409 if( !pView->isPause() )
410 bGlobalPause = false;
412 pView->setMarked( false );
413 i++;
417 else
418 bGlobalPause = false;
420 if( maViewList.empty() )
421 Stop();
422 else if( bGlobalPause )
423 ImplRestartTimer( 10 );
424 else
426 AnimationBitmap* pStepBmp = (++mnPos < maList.size()) ? maList[ mnPos ] : NULL;
428 if( !pStepBmp )
430 if( mnLoops == 1 )
432 Stop();
433 mbLoopTerminated = true;
434 mnPos = nAnimCount - 1UL;
435 maBitmapEx = maList[ mnPos ]->aBmpEx;
436 return;
438 else
440 if( mnLoops )
441 mnLoops--;
443 mnPos = 0;
444 pStepBmp = maList[ mnPos ];
448 // Paint all views; after painting check, if view is
449 // marked; in this case remove view, because area of output
450 // lies out of display area of window; mark state is
451 // set from view itself
452 for( size_t i = 0; i < maViewList.size(); )
454 pView = maViewList[ i ];
455 pView->draw( mnPos );
457 if( pView->isMarked() )
459 delete pView;
460 maViewList.erase( maViewList.begin() + i );
462 else
463 i++;
466 // stop or restart timer
467 if( maViewList.empty() )
468 Stop();
469 else
470 ImplRestartTimer( pStepBmp->nWait );
473 else
474 Stop();
477 bool Animation::Insert( const AnimationBitmap& rStepBmp )
479 bool bRet = false;
481 if( !IsInAnimation() )
483 Point aPoint;
484 Rectangle aGlobalRect( aPoint, maGlobalSize );
486 maGlobalSize = aGlobalRect.Union( Rectangle( rStepBmp.aPosPix, rStepBmp.aSizePix ) ).GetSize();
487 maList.push_back( new AnimationBitmap( rStepBmp ) );
489 // As a start, we make the first BitmapEx the replacement BitmapEx
490 if( maList.size() == 1 )
491 maBitmapEx = rStepBmp.aBmpEx;
493 bRet = true;
496 return bRet;
499 const AnimationBitmap& Animation::Get( sal_uInt16 nAnimation ) const
501 DBG_ASSERT( ( nAnimation < maList.size() ), "No object at this position" );
502 return *maList[ nAnimation ];
505 void Animation::Replace( const AnimationBitmap& rNewAnimationBitmap, sal_uInt16 nAnimation )
507 DBG_ASSERT( ( nAnimation < maList.size() ), "No object at this position" );
509 delete maList[ nAnimation ];
510 maList[ nAnimation ] = new AnimationBitmap( rNewAnimationBitmap );
512 // If we insert at first position we also need to
513 // update the replacement BitmapEx
514 if ( ( !nAnimation
515 && ( !mbLoopTerminated
516 || ( maList.size() == 1 )
520 ( ( nAnimation == maList.size() - 1 )
521 && mbLoopTerminated
525 maBitmapEx = rNewAnimationBitmap.aBmpEx;
529 void Animation::SetLoopCount( const sal_uLong nLoopCount )
531 mnLoopCount = nLoopCount;
532 ResetLoopCount();
535 void Animation::ResetLoopCount()
537 mnLoops = mnLoopCount;
538 mbLoopTerminated = false;
541 bool Animation::Convert( BmpConversion eConversion )
543 DBG_ASSERT( !IsInAnimation(), "Animation modified while it is animated" );
545 bool bRet;
547 if( !IsInAnimation() && !maList.empty() )
549 bRet = true;
551 for( size_t i = 0, n = maList.size(); ( i < n ) && bRet; ++i )
552 bRet = maList[ i ]->aBmpEx.Convert( eConversion );
554 maBitmapEx.Convert( eConversion );
556 else
557 bRet = false;
559 return bRet;
562 bool Animation::ReduceColors( sal_uInt16 nNewColorCount, BmpReduce eReduce )
564 DBG_ASSERT( !IsInAnimation(), "Animation modified while it is animated" );
566 bool bRet;
568 if( !IsInAnimation() && !maList.empty() )
570 bRet = true;
572 for( size_t i = 0, n = maList.size(); ( i < n ) && bRet; ++i )
573 bRet = maList[ i ]->aBmpEx.ReduceColors( nNewColorCount, eReduce );
575 maBitmapEx.ReduceColors( nNewColorCount, eReduce );
577 else
578 bRet = false;
580 return bRet;
583 bool Animation::Invert()
585 DBG_ASSERT( !IsInAnimation(), "Animation modified while it is animated" );
587 bool bRet;
589 if( !IsInAnimation() && !maList.empty() )
591 bRet = true;
593 for( size_t i = 0, n = maList.size(); ( i < n ) && bRet; ++i )
594 bRet = maList[ i ]->aBmpEx.Invert();
596 maBitmapEx.Invert();
598 else
599 bRet = false;
601 return bRet;
604 bool Animation::Mirror( BmpMirrorFlags nMirrorFlags )
606 DBG_ASSERT( !IsInAnimation(), "Animation modified while it is animated" );
608 bool bRet;
610 if( !IsInAnimation() && !maList.empty() )
612 bRet = true;
614 if( nMirrorFlags != BmpMirrorFlags::NONE )
616 for( size_t i = 0, n = maList.size(); ( i < n ) && bRet; ++i )
618 AnimationBitmap* pStepBmp = maList[ i ];
619 if( ( bRet = pStepBmp->aBmpEx.Mirror( nMirrorFlags ) ) )
621 if( nMirrorFlags & BmpMirrorFlags::Horizontal )
622 pStepBmp->aPosPix.X() = maGlobalSize.Width() - pStepBmp->aPosPix.X() - pStepBmp->aSizePix.Width();
624 if( nMirrorFlags & BmpMirrorFlags::Vertical )
625 pStepBmp->aPosPix.Y() = maGlobalSize.Height() - pStepBmp->aPosPix.Y() - pStepBmp->aSizePix.Height();
629 maBitmapEx.Mirror( nMirrorFlags );
632 else
633 bRet = false;
635 return bRet;
638 bool Animation::Adjust( short nLuminancePercent, short nContrastPercent,
639 short nChannelRPercent, short nChannelGPercent, short nChannelBPercent,
640 double fGamma, bool bInvert )
642 DBG_ASSERT( !IsInAnimation(), "Animation modified while it is animated" );
644 bool bRet;
646 if( !IsInAnimation() && !maList.empty() )
648 bRet = true;
650 for( size_t i = 0, n = maList.size(); ( i < n ) && bRet; ++i )
652 bRet = maList[ i ]->aBmpEx.Adjust( nLuminancePercent,
653 nContrastPercent,
654 nChannelRPercent,
655 nChannelGPercent,
656 nChannelBPercent,
657 fGamma, bInvert
661 maBitmapEx.Adjust( nLuminancePercent, nContrastPercent,
662 nChannelRPercent, nChannelGPercent, nChannelBPercent,
663 fGamma, bInvert );
665 else
666 bRet = false;
668 return bRet;
671 bool Animation::Filter( BmpFilter eFilter, const BmpFilterParam* pFilterParam, const Link<>* pProgress )
673 DBG_ASSERT( !IsInAnimation(), "Animation modified while it is animated" );
675 bool bRet;
677 if( !IsInAnimation() && !maList.empty() )
679 bRet = true;
681 for( size_t i = 0, n = maList.size(); ( i < n ) && bRet; ++i )
682 bRet = maList[ i ]->aBmpEx.Filter( eFilter, pFilterParam, pProgress );
684 (void)maBitmapEx.Filter(eFilter, pFilterParam, pProgress);
686 else
687 bRet = false;
689 return bRet;
692 SvStream& WriteAnimation( SvStream& rOStm, const Animation& rAnimation )
694 const sal_uInt16 nCount = rAnimation.Count();
696 if( nCount )
698 const sal_uInt32 nDummy32 = 0UL;
700 // If no BitmapEx was set we write the first Bitmap of
701 // the Animation
702 if( !rAnimation.GetBitmapEx().GetBitmap() )
703 WriteDIBBitmapEx(rAnimation.Get( 0 ).aBmpEx, rOStm);
704 else
705 WriteDIBBitmapEx(rAnimation.GetBitmapEx(), rOStm);
707 // Write identifier ( SDANIMA1 )
708 rOStm.WriteUInt32( 0x5344414e ).WriteUInt32( 0x494d4931 );
710 for( sal_uInt16 i = 0; i < nCount; i++ )
712 const AnimationBitmap& rAnimBmp = rAnimation.Get( i );
713 const sal_uInt16 nRest = nCount - i - 1;
715 // Write AnimationBitmap
716 WriteDIBBitmapEx(rAnimBmp.aBmpEx, rOStm);
717 WritePair( rOStm, rAnimBmp.aPosPix );
718 WritePair( rOStm, rAnimBmp.aSizePix );
719 WritePair( rOStm, rAnimation.maGlobalSize );
720 rOStm.WriteUInt16( ( ANIMATION_TIMEOUT_ON_CLICK == rAnimBmp.nWait ) ? 65535 : rAnimBmp.nWait );
721 rOStm.WriteUInt16( rAnimBmp.eDisposal );
722 rOStm.WriteBool( rAnimBmp.bUserInput );
723 rOStm.WriteUInt32( rAnimation.mnLoopCount );
724 rOStm.WriteUInt32( nDummy32 ); // Unused
725 rOStm.WriteUInt32( nDummy32 ); // Unused
726 rOStm.WriteUInt32( nDummy32 ); // Unused
727 write_uInt16_lenPrefixed_uInt8s_FromOString(rOStm, OString()); // dummy
728 rOStm.WriteUInt16( nRest ); // Count of remaining structures
732 return rOStm;
735 SvStream& ReadAnimation( SvStream& rIStm, Animation& rAnimation )
737 Bitmap aBmp;
738 sal_uLong nStmPos = rIStm.Tell();
739 sal_uInt32 nAnimMagic1, nAnimMagic2;
740 SvStreamEndian nOldFormat = rIStm.GetEndian();
741 bool bReadAnimations = false;
743 rIStm.SetEndian( SvStreamEndian::LITTLE );
744 nStmPos = rIStm.Tell();
745 rIStm.ReadUInt32( nAnimMagic1 ).ReadUInt32( nAnimMagic2 );
747 rAnimation.Clear();
749 // If the BitmapEx at the beginning have already been read (by Graphic)
750 // we can start reading the AnimationBitmaps right away
751 if( ( nAnimMagic1 == 0x5344414e ) && ( nAnimMagic2 == 0x494d4931 ) && !rIStm.GetError() )
752 bReadAnimations = true;
753 // Else, we try reading the Bitmap(-Ex)
754 else
756 rIStm.Seek( nStmPos );
757 ReadDIBBitmapEx(rAnimation.maBitmapEx, rIStm);
758 nStmPos = rIStm.Tell();
759 rIStm.ReadUInt32( nAnimMagic1 ).ReadUInt32( nAnimMagic2 );
761 if( ( nAnimMagic1 == 0x5344414e ) && ( nAnimMagic2 == 0x494d4931 ) && !rIStm.GetError() )
762 bReadAnimations = true;
763 else
764 rIStm.Seek( nStmPos );
767 // Read AnimationBitmaps
768 if( bReadAnimations )
770 AnimationBitmap aAnimBmp;
771 BitmapEx aBmpEx;
772 sal_uInt32 nTmp32;
773 sal_uInt16 nTmp16;
774 bool cTmp;
778 ReadDIBBitmapEx(aAnimBmp.aBmpEx, rIStm);
779 ReadPair( rIStm, aAnimBmp.aPosPix );
780 ReadPair( rIStm, aAnimBmp.aSizePix );
781 ReadPair( rIStm, rAnimation.maGlobalSize );
782 rIStm.ReadUInt16( nTmp16 ); aAnimBmp.nWait = ( ( 65535 == nTmp16 ) ? ANIMATION_TIMEOUT_ON_CLICK : nTmp16 );
783 rIStm.ReadUInt16( nTmp16 ); aAnimBmp.eDisposal = ( Disposal) nTmp16;
784 rIStm.ReadCharAsBool( cTmp ); aAnimBmp.bUserInput = cTmp;
785 rIStm.ReadUInt32( nTmp32 ); rAnimation.mnLoopCount = (sal_uInt16) nTmp32;
786 rIStm.ReadUInt32( nTmp32 ); // Unused
787 rIStm.ReadUInt32( nTmp32 ); // Unused
788 rIStm.ReadUInt32( nTmp32 ); // Unused
789 read_uInt16_lenPrefixed_uInt8s_ToOString(rIStm); // Unused
790 rIStm.ReadUInt16( nTmp16 ); // The rest to read
792 rAnimation.Insert( aAnimBmp );
794 while( nTmp16 && !rIStm.GetError() );
796 rAnimation.ResetLoopCount();
799 rIStm.SetEndian( nOldFormat );
801 return rIStm;
804 AInfo::AInfo() : pOutDev( NULL ),
805 pViewData( NULL ),
806 nExtraData( 0L ),
807 bWithSize( false ),
808 bPause( false ) {}
810 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */