animate.cxx (9f62ea84) | animate.cxx (45fd3b9a) |
---|---|
1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 18 unchanged lines hidden (view full) --- 27#define ENABLE_BYTESTRING_STREAM_OPERATORS 28#include <vcl/animate.hxx> 29#include <tools/debug.hxx> 30#include <tools/stream.hxx> 31#include <rtl/crc.h> 32#include <vcl/virdev.hxx> 33#include <vcl/window.hxx> 34#include <impanmvw.hxx> | 1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 18 unchanged lines hidden (view full) --- 27#define ENABLE_BYTESTRING_STREAM_OPERATORS 28#include <vcl/animate.hxx> 29#include <tools/debug.hxx> 30#include <tools/stream.hxx> 31#include <rtl/crc.h> 32#include <vcl/virdev.hxx> 33#include <vcl/window.hxx> 34#include <impanmvw.hxx> |
35#include <vcl/dibtools.hxx> 36 |
|
35DBG_NAME( Animation ) 36 37// ----------- 38// - Defines - 39// ----------- 40 41#define MIN_TIMEOUT 2L 42#define INC_TIMEOUT 0L --- 782 unchanged lines hidden (view full) --- 825 if( nCount ) 826 { 827 const ByteString aDummyStr; 828 const sal_uInt32 nDummy32 = 0UL; 829 830 // Falls keine BitmapEx gesetzt wurde, schreiben wir 831 // einfach die erste Bitmap der Animation 832 if( !rAnimation.GetBitmapEx().GetBitmap() ) | 37DBG_NAME( Animation ) 38 39// ----------- 40// - Defines - 41// ----------- 42 43#define MIN_TIMEOUT 2L 44#define INC_TIMEOUT 0L --- 782 unchanged lines hidden (view full) --- 827 if( nCount ) 828 { 829 const ByteString aDummyStr; 830 const sal_uInt32 nDummy32 = 0UL; 831 832 // Falls keine BitmapEx gesetzt wurde, schreiben wir 833 // einfach die erste Bitmap der Animation 834 if( !rAnimation.GetBitmapEx().GetBitmap() ) |
833 rOStm << rAnimation.Get( 0 ).aBmpEx; | 835 WriteDIBBitmapEx(rAnimation.Get( 0 ).aBmpEx, rOStm); |
834 else | 836 else |
835 rOStm << rAnimation.GetBitmapEx(); | 837 WriteDIBBitmapEx(rAnimation.GetBitmapEx(), rOStm); |
836 837 // Kennung schreiben ( SDANIMA1 ) 838 rOStm << (sal_uInt32) 0x5344414e << (sal_uInt32) 0x494d4931; 839 840 for( sal_uInt16 i = 0; i < nCount; i++ ) 841 { 842 const AnimationBitmap& rAnimBmp = rAnimation.Get( i ); 843 const sal_uInt16 nRest = nCount - i - 1; 844 845 // AnimationBitmap schreiben | 838 839 // Kennung schreiben ( SDANIMA1 ) 840 rOStm << (sal_uInt32) 0x5344414e << (sal_uInt32) 0x494d4931; 841 842 for( sal_uInt16 i = 0; i < nCount; i++ ) 843 { 844 const AnimationBitmap& rAnimBmp = rAnimation.Get( i ); 845 const sal_uInt16 nRest = nCount - i - 1; 846 847 // AnimationBitmap schreiben |
846 rOStm << rAnimBmp.aBmpEx; | 848 WriteDIBBitmapEx(rAnimBmp.aBmpEx, rOStm); |
847 rOStm << rAnimBmp.aPosPix; 848 rOStm << rAnimBmp.aSizePix; 849 rOStm << rAnimation.maGlobalSize; 850 rOStm << (sal_uInt16) ( ( ANIMATION_TIMEOUT_ON_CLICK == rAnimBmp.nWait ) ? 65535 : rAnimBmp.nWait ); 851 rOStm << (sal_uInt16) rAnimBmp.eDisposal; 852 rOStm << (sal_uInt8) rAnimBmp.bUserInput; 853 rOStm << (sal_uInt32) rAnimation.mnLoopCount; 854 rOStm << nDummy32; // unbenutzt --- 26 unchanged lines hidden (view full) --- 881 // Wenn die BitmapEx am Anfang schon gelesen 882 // wurde ( von Graphic ), koennen wir direkt die Animationsbitmaps einlesen 883 if( ( nAnimMagic1 == 0x5344414e ) && ( nAnimMagic2 == 0x494d4931 ) && !rIStm.GetError() ) 884 bReadAnimations = sal_True; 885 // ansonsten versuchen wir erstmal die Bitmap(-Ex) zu lesen 886 else 887 { 888 rIStm.Seek( nStmPos ); | 849 rOStm << rAnimBmp.aPosPix; 850 rOStm << rAnimBmp.aSizePix; 851 rOStm << rAnimation.maGlobalSize; 852 rOStm << (sal_uInt16) ( ( ANIMATION_TIMEOUT_ON_CLICK == rAnimBmp.nWait ) ? 65535 : rAnimBmp.nWait ); 853 rOStm << (sal_uInt16) rAnimBmp.eDisposal; 854 rOStm << (sal_uInt8) rAnimBmp.bUserInput; 855 rOStm << (sal_uInt32) rAnimation.mnLoopCount; 856 rOStm << nDummy32; // unbenutzt --- 26 unchanged lines hidden (view full) --- 883 // Wenn die BitmapEx am Anfang schon gelesen 884 // wurde ( von Graphic ), koennen wir direkt die Animationsbitmaps einlesen 885 if( ( nAnimMagic1 == 0x5344414e ) && ( nAnimMagic2 == 0x494d4931 ) && !rIStm.GetError() ) 886 bReadAnimations = sal_True; 887 // ansonsten versuchen wir erstmal die Bitmap(-Ex) zu lesen 888 else 889 { 890 rIStm.Seek( nStmPos ); |
889 rIStm >> rAnimation.maBitmapEx; | 891 ReadDIBBitmapEx(rAnimation.maBitmapEx, rIStm); |
890 nStmPos = rIStm.Tell(); 891 rIStm >> nAnimMagic1 >> nAnimMagic2; 892 893 if( ( nAnimMagic1 == 0x5344414e ) && ( nAnimMagic2 == 0x494d4931 ) && !rIStm.GetError() ) 894 bReadAnimations = sal_True; 895 else 896 rIStm.Seek( nStmPos ); 897 } --- 5 unchanged lines hidden (view full) --- 903 BitmapEx aBmpEx; 904 ByteString aDummyStr; 905 sal_uInt32 nTmp32; 906 sal_uInt16 nTmp16; 907 sal_uInt8 cTmp; 908 909 do 910 { | 892 nStmPos = rIStm.Tell(); 893 rIStm >> nAnimMagic1 >> nAnimMagic2; 894 895 if( ( nAnimMagic1 == 0x5344414e ) && ( nAnimMagic2 == 0x494d4931 ) && !rIStm.GetError() ) 896 bReadAnimations = sal_True; 897 else 898 rIStm.Seek( nStmPos ); 899 } --- 5 unchanged lines hidden (view full) --- 905 BitmapEx aBmpEx; 906 ByteString aDummyStr; 907 sal_uInt32 nTmp32; 908 sal_uInt16 nTmp16; 909 sal_uInt8 cTmp; 910 911 do 912 { |
911 rIStm >> aAnimBmp.aBmpEx; | 913 ReadDIBBitmapEx(aAnimBmp.aBmpEx, rIStm); |
912 rIStm >> aAnimBmp.aPosPix; 913 rIStm >> aAnimBmp.aSizePix; 914 rIStm >> rAnimation.maGlobalSize; 915 rIStm >> nTmp16; aAnimBmp.nWait = ( ( 65535 == nTmp16 ) ? ANIMATION_TIMEOUT_ON_CLICK : nTmp16 ); 916 rIStm >> nTmp16; aAnimBmp.eDisposal = ( Disposal) nTmp16; 917 rIStm >> cTmp; aAnimBmp.bUserInput = (sal_Bool) cTmp; 918 rIStm >> nTmp32; rAnimation.mnLoopCount = (sal_uInt16) nTmp32; 919 rIStm >> nTmp32; // unbenutzt --- 16 unchanged lines hidden --- | 914 rIStm >> aAnimBmp.aPosPix; 915 rIStm >> aAnimBmp.aSizePix; 916 rIStm >> rAnimation.maGlobalSize; 917 rIStm >> nTmp16; aAnimBmp.nWait = ( ( 65535 == nTmp16 ) ? ANIMATION_TIMEOUT_ON_CLICK : nTmp16 ); 918 rIStm >> nTmp16; aAnimBmp.eDisposal = ( Disposal) nTmp16; 919 rIStm >> cTmp; aAnimBmp.bUserInput = (sal_Bool) cTmp; 920 rIStm >> nTmp32; rAnimation.mnLoopCount = (sal_uInt16) nTmp32; 921 rIStm >> nTmp32; // unbenutzt --- 16 unchanged lines hidden --- |