diff options
-rw-r--r-- | xmloff/dtd/drawing.mod | 10 | ||||
-rw-r--r-- | xmloff/inc/xmlkywd.hxx | 5 | ||||
-rw-r--r-- | xmloff/source/draw/animexp.cxx | 142 | ||||
-rw-r--r-- | xmloff/source/draw/animimp.cxx | 25 |
4 files changed, 116 insertions, 66 deletions
diff --git a/xmloff/dtd/drawing.mod b/xmloff/dtd/drawing.mod index b5ebf18ab49d..949ee1ffdfc6 100644 --- a/xmloff/dtd/drawing.mod +++ b/xmloff/dtd/drawing.mod @@ -1,5 +1,5 @@ <!-- - $Id: drawing.mod,v 1.52 2001-05-21 10:18:49 mib Exp $ + $Id: drawing.mod,v 1.53 2001-05-23 11:53:10 cl Exp $ The Contents of this file are made available subject to the terms of either of the following licenses @@ -215,7 +215,7 @@ <!ATTLIST draw:control %text-anchor;> <!ATTLIST draw:control draw:layer %layerName; #IMPLIED> -<!ELEMENT draw:g (%shapes;)* > +<!ELEMENT draw:g ( office:events?, (%shapes;)* ) > <!ATTLIST draw:g %draw-transform; > <!ATTLIST draw:g %draw-style-name; > <!ATTLIST draw:g %zindex;> @@ -480,7 +480,11 @@ <!ATTLIST presentation:dim draw:shape-id %shapeId; #REQUIRED> <!ATTLIST presentation:dim draw:color %color; #REQUIRED> -<!ELEMENT presentation:animations (presentation:show-shape|presentation:show-text|presentation:hide-shape|presentation:hide-text|presentation:dim)*> +<!ELEMENT presentation:play EMPTY> +<!ATTLIST presentation:play draw:shape-id %shapeId; #REQUIRED> +<!ATTLIST presentation:play presentation:speed %presentationSpeeds; "medium"> + +<!ELEMENT presentation:animations (presentation:show-shape|presentation:show-text|presentation:hide-shape|presentation:hide-text|presentation:dim|presentation:play)*> <!ELEMENT presentation:show EMPTY> <!ATTLIST presentation:show presentation:name %styleName; #REQUIRED> diff --git a/xmloff/inc/xmlkywd.hxx b/xmloff/inc/xmlkywd.hxx index b4cd45bdb79d..cfaf8e112f17 100644 --- a/xmloff/inc/xmlkywd.hxx +++ b/xmloff/inc/xmlkywd.hxx @@ -2,9 +2,9 @@ * * $RCSfile: xmlkywd.hxx,v $ * - * $Revision: 1.159 $ + * $Revision: 1.160 $ * - * last change: $Author: cl $ $Date: 2001-05-18 07:01:05 $ + * last change: $Author: cl $ $Date: 2001-05-23 11:59:50 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -2005,4 +2005,5 @@ XML_CONSTASCII_ACTION( sXML_straight_line, "straight-line" ); XML_CONSTASCII_ACTION( sXML_angled_line, "angled-line" ); XML_CONSTASCII_ACTION( sXML_angled_connector_line, "angled-connector-line" ); +XML_CONSTASCII_ACTION( sXML_play, "play" ); #endif diff --git a/xmloff/source/draw/animexp.cxx b/xmloff/source/draw/animexp.cxx index cb70afe808cd..41d916727157 100644 --- a/xmloff/source/draw/animexp.cxx +++ b/xmloff/source/draw/animexp.cxx @@ -2,9 +2,9 @@ * * $RCSfile: animexp.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: sab $ $Date: 2001-03-16 14:35:56 $ + * last change: $Author: cl $ $Date: 2001-05-23 11:55:10 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -324,7 +324,8 @@ enum XMLActionKind { XMLE_SHOW, XMLE_HIDE, - XMLE_DIM + XMLE_DIM, + XMLE_PLAY }; struct XMLEffectHint @@ -370,6 +371,7 @@ public: OUString msSoundOn; OUString msSpeed; OUString msTextEffect; + OUString msIsAnimation; OUString msAnimPath; AnimExpImpl() @@ -383,7 +385,8 @@ public: msSoundOn( RTL_CONSTASCII_USTRINGPARAM( "SoundOn" ) ), msSpeed( RTL_CONSTASCII_USTRINGPARAM( "Speed" ) ), msTextEffect( RTL_CONSTASCII_USTRINGPARAM( "TextEffect" ) ), - msAnimPath( RTL_CONSTASCII_USTRINGPARAM( "AnimationPath" ) ) + msAnimPath( RTL_CONSTASCII_USTRINGPARAM( "AnimationPath" ) ), + msIsAnimation( RTL_CONSTASCII_USTRINGPARAM( "IsAnimation" ) ) {} }; @@ -427,77 +430,94 @@ void XMLAnimationsExporter::collect( Reference< XShape > xShape ) xProps->getPropertyValue( mpImpl->msPresOrder ) >>= aEffect.mnPresId; xProps->getPropertyValue( mpImpl->msSpeed ) >>= aEffect.meSpeed; - xProps->getPropertyValue( mpImpl->msEffect ) >>= eEffect; - if( eEffect != AnimationEffect_NONE ) - { - sal_Bool bIn = sal_True; - SdXMLImplSetEffect( eEffect, aEffect.meEffect, aEffect.meDirection, aEffect.mnStartScale, bIn ); - aEffect.meKind = bIn ? XMLE_SHOW : XMLE_HIDE; + + sal_Bool bIsAnimation; + xProps->getPropertyValue( mpImpl->msIsAnimation ) >>= bIsAnimation; + if( bIsAnimation ) + { + aEffect.meKind = XMLE_PLAY; mpImpl->mxShapeExp->createShapeId( xShape ); aEffect.mnShapeId = mpImpl->mxShapeExp->getShapeId( xShape ); - if( eEffect == AnimationEffect_PATH ) - { - Reference< XShape > xPath; - xProps->getPropertyValue( mpImpl->msAnimPath ) >>= xPath; - if( xPath.is() ) - { - mpImpl->mxShapeExp->createShapeId( xPath ); - aEffect.mnPathShapeId = mpImpl->mxShapeExp->getShapeId( xPath ); - } - } mpImpl->maEffects.push_back( aEffect ); - - aEffect.mnPathShapeId = -1; - aEffect.maSoundURL = aEmptyStr; } - - xProps->getPropertyValue( mpImpl->msTextEffect ) >>= eEffect; - if( eEffect != AnimationEffect_NONE ) + else { - sal_Bool bIn = sal_True; - SdXMLImplSetEffect( eEffect, aEffect.meEffect, aEffect.meDirection, aEffect.mnStartScale, bIn ); - aEffect.meKind = bIn ? XMLE_SHOW : XMLE_HIDE; - aEffect.mbTextEffect = sal_True; - if( aEffect.mnShapeId == -1 ) + xProps->getPropertyValue( mpImpl->msEffect ) >>= eEffect; + if( eEffect != AnimationEffect_NONE ) { + sal_Bool bIn = sal_True; + SdXMLImplSetEffect( eEffect, aEffect.meEffect, aEffect.meDirection, aEffect.mnStartScale, bIn ); + + aEffect.meKind = bIn ? XMLE_SHOW : XMLE_HIDE; + mpImpl->mxShapeExp->createShapeId( xShape ); aEffect.mnShapeId = mpImpl->mxShapeExp->getShapeId( xShape ); - } - mpImpl->maEffects.push_back( aEffect ); - aEffect.mbTextEffect = sal_False; - aEffect.maSoundURL = aEmptyStr; - } + if( eEffect == AnimationEffect_PATH ) + { + Reference< XShape > xPath; + xProps->getPropertyValue( mpImpl->msAnimPath ) >>= xPath; + if( xPath.is() ) + { + mpImpl->mxShapeExp->createShapeId( xPath ); + aEffect.mnPathShapeId = mpImpl->mxShapeExp->getShapeId( xPath ); + } + } + mpImpl->maEffects.push_back( aEffect ); - sal_Bool bDimPrev; - sal_Bool bDimHide; - xProps->getPropertyValue( mpImpl->msDimPrev ) >>= bDimPrev; - xProps->getPropertyValue( mpImpl->msDimHide ) >>= bDimHide; - if( bDimPrev || bDimHide ) - { - aEffect.meKind = bDimPrev ? XMLE_DIM : XMLE_HIDE; - aEffect.meEffect = EK_none; - aEffect.meDirection = ED_none; - aEffect.meSpeed = AnimationSpeed_MEDIUM; - if( bDimPrev ) - { - sal_Int32 nColor; - xProps->getPropertyValue( mpImpl->msDimColor ) >>= nColor; - aEffect.maDimColor.SetColor( nColor ); + aEffect.mnPathShapeId = -1; + aEffect.maSoundURL = aEmptyStr; } - if( aEffect.mnShapeId == -1 ) + xProps->getPropertyValue( mpImpl->msTextEffect ) >>= eEffect; + if( eEffect != AnimationEffect_NONE ) { - mpImpl->mxShapeExp->createShapeId( xShape ); - aEffect.mnShapeId = mpImpl->mxShapeExp->getShapeId( xShape ); + sal_Bool bIn = sal_True; + SdXMLImplSetEffect( eEffect, aEffect.meEffect, aEffect.meDirection, aEffect.mnStartScale, bIn ); + aEffect.meKind = bIn ? XMLE_SHOW : XMLE_HIDE; + aEffect.mbTextEffect = sal_True; + + if( aEffect.mnShapeId == -1 ) + { + mpImpl->mxShapeExp->createShapeId( xShape ); + aEffect.mnShapeId = mpImpl->mxShapeExp->getShapeId( xShape ); + } + + mpImpl->maEffects.push_back( aEffect ); + aEffect.mbTextEffect = sal_False; + aEffect.maSoundURL = aEmptyStr; } - mpImpl->maEffects.push_back( aEffect ); - aEffect.maSoundURL = aEmptyStr; + sal_Bool bDimPrev; + sal_Bool bDimHide; + xProps->getPropertyValue( mpImpl->msDimPrev ) >>= bDimPrev; + xProps->getPropertyValue( mpImpl->msDimHide ) >>= bDimHide; + if( bDimPrev || bDimHide ) + { + aEffect.meKind = bDimPrev ? XMLE_DIM : XMLE_HIDE; + aEffect.meEffect = EK_none; + aEffect.meDirection = ED_none; + aEffect.meSpeed = AnimationSpeed_MEDIUM; + if( bDimPrev ) + { + sal_Int32 nColor; + xProps->getPropertyValue( mpImpl->msDimColor ) >>= nColor; + aEffect.maDimColor.SetColor( nColor ); + } + + if( aEffect.mnShapeId == -1 ) + { + mpImpl->mxShapeExp->createShapeId( xShape ); + aEffect.mnShapeId = mpImpl->mxShapeExp->getShapeId( xShape ); + } + + mpImpl->maEffects.push_back( aEffect ); + aEffect.maSoundURL = aEmptyStr; + } } } } @@ -537,6 +557,16 @@ void XMLAnimationsExporter::exportAnimations( SvXMLExport& rExport ) SvXMLElementExport aElem( rExport, XML_NAMESPACE_PRESENTATION, sXML_dim, sal_True, sal_True ); } + else if( rEffect.meKind == XMLE_PLAY ) + { + if( rEffect.meSpeed != AnimationSpeed_MEDIUM ) + { + SvXMLUnitConverter::convertEnum( sTmp, rEffect.meSpeed, aXML_AnimationSpeed_EnumMap ); + rExport.AddAttribute( XML_NAMESPACE_PRESENTATION, sXML_speed, sTmp.makeStringAndClear() ); + } + + SvXMLElementExport aElem( rExport, XML_NAMESPACE_PRESENTATION, sXML_play, sal_True, sal_True ); + } else { diff --git a/xmloff/source/draw/animimp.cxx b/xmloff/source/draw/animimp.cxx index f128b9c3bb95..9f3dd64766c8 100644 --- a/xmloff/source/draw/animimp.cxx +++ b/xmloff/source/draw/animimp.cxx @@ -2,9 +2,9 @@ * * $RCSfile: animimp.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: cl $ $Date: 2001-05-23 08:56:35 $ + * last change: $Author: cl $ $Date: 2001-05-23 11:55:10 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -351,6 +351,7 @@ public: OUString msTextEffect; OUString msPresShapeService; OUString msAnimPath; + OUString msIsAnimation; AnimImpImpl() : mnPresOrder( 0 ), @@ -366,7 +367,8 @@ public: msSpeed( RTL_CONSTASCII_USTRINGPARAM( "Speed" ) ), msTextEffect( RTL_CONSTASCII_USTRINGPARAM( "TextEffect" ) ), msPresShapeService( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.presentation.shape" ) ), - msAnimPath( RTL_CONSTASCII_USTRINGPARAM( "AnimationPath" ) ) + msAnimPath( RTL_CONSTASCII_USTRINGPARAM( "AnimationPath" ) ), + msIsAnimation( RTL_CONSTASCII_USTRINGPARAM( "IsAnimation" ) ) {} }; @@ -376,7 +378,8 @@ enum XMLActionKind { XMLE_SHOW, XMLE_HIDE, - XMLE_DIM + XMLE_DIM, + XMLE_PLAY }; class XMLAnimationsEffectContext : public SvXMLImportContext @@ -494,6 +497,10 @@ XMLAnimationsEffectContext::XMLAnimationsEffectContext( SvXMLImport& rImport, s { meKind = XMLE_DIM; } + else if( rLocalName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sXML_play ) ) ) + { + meKind = XMLE_PLAY; + } else { // unknown action, overread @@ -605,12 +612,20 @@ void XMLAnimationsEffectContext::EndElement() { if( meKind == XMLE_DIM ) { - aAny = bool2any( sal_True ); + aAny <<= (sal_Bool)sal_True; xSet->setPropertyValue( mpImpl->msDimPrev, aAny ); aAny <<= (sal_Int32)maDimColor.GetColor(); xSet->setPropertyValue( mpImpl->msDimColor, aAny ); } + else if( meKind == XMLE_PLAY ) + { + aAny <<= (sal_Bool)sal_True; + xSet->setPropertyValue( mpImpl->msIsAnimation, aAny ); + + aAny <<= meSpeed; + xSet->setPropertyValue( mpImpl->msSpeed, aAny ); + } else { if( meKind == XMLE_HIDE && !mbTextEffect && meEffect == EK_none ) |