Kaydet (Commit) e36f4150 authored tarafından Christian Lippka's avatar Christian Lippka

#87347# added support for group shapes created by the animator

üst 5efc4e02
<!-- <!--
$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 The Contents of this file are made available subject to the terms of
either of the following licenses either of the following licenses
...@@ -215,7 +215,7 @@ ...@@ -215,7 +215,7 @@
<!ATTLIST draw:control %text-anchor;> <!ATTLIST draw:control %text-anchor;>
<!ATTLIST draw:control draw:layer %layerName; #IMPLIED> <!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-transform; >
<!ATTLIST draw:g %draw-style-name; > <!ATTLIST draw:g %draw-style-name; >
<!ATTLIST draw:g %zindex;> <!ATTLIST draw:g %zindex;>
...@@ -480,7 +480,11 @@ ...@@ -480,7 +480,11 @@
<!ATTLIST presentation:dim draw:shape-id %shapeId; #REQUIRED> <!ATTLIST presentation:dim draw:shape-id %shapeId; #REQUIRED>
<!ATTLIST presentation:dim draw:color %color; #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> <!ELEMENT presentation:show EMPTY>
<!ATTLIST presentation:show presentation:name %styleName; #REQUIRED> <!ATTLIST presentation:show presentation:name %styleName; #REQUIRED>
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: xmlkywd.hxx,v $ * $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 * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -2005,4 +2005,5 @@ XML_CONSTASCII_ACTION( sXML_straight_line, "straight-line" ); ...@@ -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_line, "angled-line" );
XML_CONSTASCII_ACTION( sXML_angled_connector_line, "angled-connector-line" ); XML_CONSTASCII_ACTION( sXML_angled_connector_line, "angled-connector-line" );
XML_CONSTASCII_ACTION( sXML_play, "play" );
#endif #endif
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: animexp.cxx,v $ * $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 * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -324,7 +324,8 @@ enum XMLActionKind ...@@ -324,7 +324,8 @@ enum XMLActionKind
{ {
XMLE_SHOW, XMLE_SHOW,
XMLE_HIDE, XMLE_HIDE,
XMLE_DIM XMLE_DIM,
XMLE_PLAY
}; };
struct XMLEffectHint struct XMLEffectHint
...@@ -370,6 +371,7 @@ public: ...@@ -370,6 +371,7 @@ public:
OUString msSoundOn; OUString msSoundOn;
OUString msSpeed; OUString msSpeed;
OUString msTextEffect; OUString msTextEffect;
OUString msIsAnimation;
OUString msAnimPath; OUString msAnimPath;
AnimExpImpl() AnimExpImpl()
...@@ -383,7 +385,8 @@ public: ...@@ -383,7 +385,8 @@ public:
msSoundOn( RTL_CONSTASCII_USTRINGPARAM( "SoundOn" ) ), msSoundOn( RTL_CONSTASCII_USTRINGPARAM( "SoundOn" ) ),
msSpeed( RTL_CONSTASCII_USTRINGPARAM( "Speed" ) ), msSpeed( RTL_CONSTASCII_USTRINGPARAM( "Speed" ) ),
msTextEffect( RTL_CONSTASCII_USTRINGPARAM( "TextEffect" ) ), 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 ) ...@@ -427,77 +430,94 @@ void XMLAnimationsExporter::collect( Reference< XShape > xShape )
xProps->getPropertyValue( mpImpl->msPresOrder ) >>= aEffect.mnPresId; xProps->getPropertyValue( mpImpl->msPresOrder ) >>= aEffect.mnPresId;
xProps->getPropertyValue( mpImpl->msSpeed ) >>= aEffect.meSpeed; 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 ); mpImpl->mxShapeExp->createShapeId( xShape );
aEffect.mnShapeId = mpImpl->mxShapeExp->getShapeId( 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 ); mpImpl->maEffects.push_back( aEffect );
aEffect.mnPathShapeId = -1;
aEffect.maSoundURL = aEmptyStr;
} }
else
xProps->getPropertyValue( mpImpl->msTextEffect ) >>= 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;
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 ); mpImpl->mxShapeExp->createShapeId( xShape );
aEffect.mnShapeId = mpImpl->mxShapeExp->getShapeId( xShape ); aEffect.mnShapeId = mpImpl->mxShapeExp->getShapeId( xShape );
}
mpImpl->maEffects.push_back( aEffect ); if( eEffect == AnimationEffect_PATH )
aEffect.mbTextEffect = sal_False; {
aEffect.maSoundURL = aEmptyStr; 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; aEffect.mnPathShapeId = -1;
sal_Bool bDimHide; aEffect.maSoundURL = aEmptyStr;
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 ) xProps->getPropertyValue( mpImpl->msTextEffect ) >>= eEffect;
if( eEffect != AnimationEffect_NONE )
{ {
mpImpl->mxShapeExp->createShapeId( xShape ); sal_Bool bIn = sal_True;
aEffect.mnShapeId = mpImpl->mxShapeExp->getShapeId( xShape ); 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 ); sal_Bool bDimPrev;
aEffect.maSoundURL = aEmptyStr; 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 ) ...@@ -537,6 +557,16 @@ void XMLAnimationsExporter::exportAnimations( SvXMLExport& rExport )
SvXMLElementExport aElem( rExport, XML_NAMESPACE_PRESENTATION, sXML_dim, sal_True, sal_True ); 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 else
{ {
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: animimp.cxx,v $ * $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 * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -351,6 +351,7 @@ public: ...@@ -351,6 +351,7 @@ public:
OUString msTextEffect; OUString msTextEffect;
OUString msPresShapeService; OUString msPresShapeService;
OUString msAnimPath; OUString msAnimPath;
OUString msIsAnimation;
AnimImpImpl() AnimImpImpl()
: mnPresOrder( 0 ), : mnPresOrder( 0 ),
...@@ -366,7 +367,8 @@ public: ...@@ -366,7 +367,8 @@ public:
msSpeed( RTL_CONSTASCII_USTRINGPARAM( "Speed" ) ), msSpeed( RTL_CONSTASCII_USTRINGPARAM( "Speed" ) ),
msTextEffect( RTL_CONSTASCII_USTRINGPARAM( "TextEffect" ) ), msTextEffect( RTL_CONSTASCII_USTRINGPARAM( "TextEffect" ) ),
msPresShapeService( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.presentation.shape" ) ), 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 ...@@ -376,7 +378,8 @@ enum XMLActionKind
{ {
XMLE_SHOW, XMLE_SHOW,
XMLE_HIDE, XMLE_HIDE,
XMLE_DIM XMLE_DIM,
XMLE_PLAY
}; };
class XMLAnimationsEffectContext : public SvXMLImportContext class XMLAnimationsEffectContext : public SvXMLImportContext
...@@ -494,6 +497,10 @@ XMLAnimationsEffectContext::XMLAnimationsEffectContext( SvXMLImport& rImport, s ...@@ -494,6 +497,10 @@ XMLAnimationsEffectContext::XMLAnimationsEffectContext( SvXMLImport& rImport, s
{ {
meKind = XMLE_DIM; meKind = XMLE_DIM;
} }
else if( rLocalName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sXML_play ) ) )
{
meKind = XMLE_PLAY;
}
else else
{ {
// unknown action, overread // unknown action, overread
...@@ -605,12 +612,20 @@ void XMLAnimationsEffectContext::EndElement() ...@@ -605,12 +612,20 @@ void XMLAnimationsEffectContext::EndElement()
{ {
if( meKind == XMLE_DIM ) if( meKind == XMLE_DIM )
{ {
aAny = bool2any( sal_True ); aAny <<= (sal_Bool)sal_True;
xSet->setPropertyValue( mpImpl->msDimPrev, aAny ); xSet->setPropertyValue( mpImpl->msDimPrev, aAny );
aAny <<= (sal_Int32)maDimColor.GetColor(); aAny <<= (sal_Int32)maDimColor.GetColor();
xSet->setPropertyValue( mpImpl->msDimColor, aAny ); 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 else
{ {
if( meKind == XMLE_HIDE && !mbTextEffect && meEffect == EK_none ) if( meKind == XMLE_HIDE && !mbTextEffect && meEffect == EK_none )
......
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