[Libreoffice-commits] .: 9 commits - filter/source xmloff/inc xmloff/Package_inc.mk xmloff/source
Thorsten Behrens
thorsten at kemper.freedesktop.org
Fri Aug 26 09:25:39 PDT 2011
filter/source/svg/svgexport.cxx | 243
filter/source/svg/svgfilter.cxx | 28
filter/source/svg/svgfilter.hxx | 32
filter/source/svg/svgscript.hxx | 8796 +++++++++---
xmloff/Package_inc.mk | 2
xmloff/inc/animationexport.hxx | 58
xmloff/inc/unointerfacetouniqueidentifiermapper.hxx | 55
xmloff/inc/xmloff/animationexport.hxx | 62
xmloff/inc/xmloff/unointerfacetouniqueidentifiermapper.hxx | 59
xmloff/source/core/unointerfacetouniqueidentifiermapper.cxx | 2
xmloff/source/core/xmlexp.cxx | 2
xmloff/source/core/xmlimp.cxx | 2
xmloff/source/draw/animationexport.cxx | 27
xmloff/source/draw/animationimport.cxx | 2
xmloff/source/draw/animexp.cxx | 2
xmloff/source/draw/animimp.cxx | 2
xmloff/source/draw/sdxmlexp.cxx | 4
xmloff/source/draw/shapeexport.cxx | 2
xmloff/source/draw/shapeexport2.cxx | 2
xmloff/source/draw/shapeimport.cxx | 2
xmloff/source/draw/ximpbody.cxx | 2
xmloff/source/draw/ximppage.cxx | 2
xmloff/source/draw/ximpshap.cxx | 2
xmloff/source/text/txtparae.cxx | 2
xmloff/source/text/txtparai.cxx | 2
25 files changed, 7660 insertions(+), 1734 deletions(-)
New commits:
commit dcb783a8546b760f0807a73b52966c8f3d1428d3
Author: Thorsten Behrens <tbehrens at novell.com>
Date: Fri Aug 26 17:57:29 2011 +0200
Cleanup, and made svg animation export experimental
Added the PagePos parameter back (to export single slide via API),
some whitespace cleanup, and made the ecma script / animation engine
only active via the experimental flag.
diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index 0bddfb3..c68f292 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -40,6 +40,7 @@
#include "svgscript.hxx"
#include "impsvgdialog.hxx"
+#include <svtools/miscopt.hxx>
#include <svtools/FilterConfigItem.hxx>
#include <svx/unopage.hxx>
#include <svx/unoshape.hxx>
@@ -743,7 +744,10 @@ sal_Bool SVGFilter::implExportDocument()
sal_Bool bRet = sal_False;
sal_Int32 nLastPage = mSelectedPages.getLength() - 1;
- mbSinglePage = (nLastPage == 0);
+ SvtMiscOptions aMiscOptions;
+ const bool bExperimentalMode = aMiscOptions.IsExperimentalMode();
+
+ mbSinglePage = (nLastPage == 0) || !bExperimentalMode;
mnVisiblePage = -1;
mnVisibleMasterPage = -1;
@@ -837,7 +841,8 @@ sal_Bool SVGFilter::implExportDocument()
if( !mbSinglePage )
{
implGenerateMetaData();
- implExportAnimations();
+ if( bExperimentalMode )
+ implExportAnimations();
}
else
{
@@ -1322,7 +1327,7 @@ sal_Bool SVGFilter::implExportPages( const SVGFilter::XDrawPageSequence & rxPage
mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", sPageId );
OUString sPageName = implGetInterfaceName( rxPages[i] );
- if( sPageName.getLength() )
+ if( sPageName.getLength() && !mbSinglePage )
mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, aOOOAttrName, sPageName );
{
diff --git a/filter/source/svg/svgfilter.cxx b/filter/source/svg/svgfilter.cxx
index 4baaa80..236e933 100644
--- a/filter/source/svg/svgfilter.cxx
+++ b/filter/source/svg/svgfilter.cxx
@@ -163,10 +163,22 @@ sal_Bool SAL_CALL SVGFilter::filter( const Sequence< PropertyValue >& rDescripto
}
/*
- * Export all slides
+ * Export all slides, or requested "PagePos"
*/
if( !mSelectedPages.hasElements() )
{
+ sal_Int32 nLength = rDescriptor.getLength();
+ const PropertyValue* pValue = rDescriptor.getConstArray();
+ sal_Int32 nPageToExport = -1;
+
+ for ( sal_Int32 i = 0 ; i < nLength; ++i)
+ {
+ if( pValue[ i ].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "PagePos" ) ) )
+ {
+ pValue[ i ].Value >>= nPageToExport;
+ }
+ }
+
uno::Reference< drawing::XMasterPagesSupplier > xMasterPagesSupplier( mxSrcDoc, uno::UNO_QUERY );
uno::Reference< drawing::XDrawPagesSupplier > xDrawPagesSupplier( mxSrcDoc, uno::UNO_QUERY );
@@ -179,12 +191,20 @@ sal_Bool SAL_CALL SVGFilter::filter( const Sequence< PropertyValue >& rDescripto
{
sal_Int32 nDPCount = xDrawPages->getCount();
- mSelectedPages.realloc( nDPCount );
+ mSelectedPages.realloc( nPageToExport != -1 ? 1 : nDPCount );
sal_Int32 i;
for( i = 0; i < nDPCount; ++i )
{
- uno::Reference< drawing::XDrawPage > xDrawPage( xDrawPages->getByIndex( i ), uno::UNO_QUERY );
- mSelectedPages[i] = xDrawPage;
+ if( nPageToExport != -1 && nPageToExport == i )
+ {
+ uno::Reference< drawing::XDrawPage > xDrawPage( xDrawPages->getByIndex( i ), uno::UNO_QUERY );
+ mSelectedPages[0] = xDrawPage;
+ }
+ else
+ {
+ uno::Reference< drawing::XDrawPage > xDrawPage( xDrawPages->getByIndex( i ), uno::UNO_QUERY );
+ mSelectedPages[i] = xDrawPage;
+ }
}
}
}
diff --git a/filter/source/svg/svgscript.hxx b/filter/source/svg/svgscript.hxx
index 7cbed89..6164489 100644
--- a/filter/source/svg/svgscript.hxx
+++ b/filter/source/svg/svgscript.hxx
@@ -1,4 +1,3 @@
-
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
commit ee7239396401fff5115058259d686676074e8d22
Author: Marco Cecchetti <mrcekets at gmail.com>
Date: Mon Aug 22 17:54:25 2011 +0200
Added detailed license notice to the embedded script and fixed a bug.
The source code has been partitioned in separated parts according to the
license the code is subject to.
Fixed the following bug: when in index page mode you select the same
slide shown before switching to index mode no slide is shown (all slides
are hidden)
diff --git a/filter/source/svg/svgscript.hxx b/filter/source/svg/svgscript.hxx
index dfbd2cc..7cbed89 100644
--- a/filter/source/svg/svgscript.hxx
+++ b/filter/source/svg/svgscript.hxx
@@ -34,1263 +34,83 @@
static const char aSVGScript0[] =
"<![CDATA[\n\
\n\
-\n\
- /** * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \n\
- * - Presentation Engine v5.0 -\n\
- * \n\
- ** * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \n\
- * This program is free software: you can redistribute it and/or modify \n\
- * it under the terms of the GNU General Public License as published by \n\
- * the Free Software Foundation, either version 3 of the License, or \n\
- * (at your option) any later version. \n\
- * \n\
- * This program is distributed in the hope that it will be useful, \n\
- * but WITHOUT ANY WARRANTY; without even the implied warranty of \n\
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the \n\
- * GNU General Public License for more details. \n\
- * \n\
- * You should have received a copy of the GNU General Public License \n\
- * along with this program. If not, see http://www.gnu.org/licenses/. \n\
- * \n\
- ** * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \n\
- * Some parts of this script are based on the JessyInk project:\n\
- * http://code.google.com/p/jessyink/\n\
- * \n\
- ** * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */\n\
-\n\
-\n\
-\n\
- window.onload = init;\n\
-\n\
-\n\
- var aOOOElemMetaSlides = 'ooo:meta_slides';\n\
- var aOOOElemMetaSlide = 'ooo:meta_slide';\n\
- var aOOOElemTextField = 'ooo:text_field';\n\
-\n\
- var aOOOAttrNumberOfSlides = 'number-of-slides';\n\
- var aOOOAttrNumberingType = 'page-numbering-type';\n\
-\n\
- var aOOOAttrSlide = 'slide';\n\
- var aOOOAttrMaster = 'master';\n\
- var aOOOAttrBackgroundVisibility = 'background-visibility';\n\
- var aOOOAttrMasterObjectsVisibility = 'master-objects-visibility';\n\
- var aOOOAttrPageNumberVisibility = 'page-number-visibility';\n\
- var aOOOAttrDateTimeVisibility = 'date-time-visibility';\n\
- var aOOOAttrFooterVisibility = 'footer-visibility';\n\
- var aOOOAttrHeaderVisibility = 'header-visibility';\n\
- var aOOOAttrDateTimeField = 'date-time-field';\n\
- var aOOOAttrFooterField = 'footer-field';\n\
- var aOOOAttrHeaderField = 'header-field';\n\
-\n\
- var aOOOAttrDateTimeFormat = 'date-time-format';\n\
-\n\
- var aOOOAttrTextAdjust = 'text-adjust';\n\
-\n\
- var aSlideNumberClassName = 'Slide_Number';\n\
- var aDateTimeClassName = 'Date/Time';\n\
- var aFooterClassName = 'Footer';\n\
- var aHeaderClassName = 'Header';\n\
-\n\
- var NSS = new Object();\n\
- NSS['svg']='http://www.w3.org/2000/svg';\n\
- NSS['rdf']='http://www.w3.org/1999/02/22-rdf-syntax-ns#';\n\
- NSS['xlink']='http://www.w3.org/1999/xlink';\n\
- NSS['xml']='http://www.w3.org/XML/1998/namespace';\n\
- NSS['ooo'] = 'http://xml.openoffice.org/svg/export';\n\
-\n\
- var SLIDE_MODE = 1;\n\
- var INDEX_MODE = 2;\n\
-\n\
- var MOUSE_UP = 1;\n\
- var MOUSE_DOWN = 2;\n\
- var MOUSE_MOVE = 3;\n\
- var MOUSE_WHEEL = 4;\n\
-\n\
- var LEFT_KEY = 37; // cursor left keycode\n\
- var UP_KEY = 38; // cursor up keycode\n\
- var RIGHT_KEY = 39; // cursor right keycode\n\
- var DOWN_KEY = 40; // cursor down keycode\n\
- var PAGE_UP_KEY = 33; // page up keycode\n\
- var PAGE_DOWN_KEY = 34; // page down keycode\n\
- var HOME_KEY = 36; // home keycode\n\
- var END_KEY = 35; // end keycode\n\
- var ENTER_KEY = 13;\n\
- var SPACE_KEY = 32;\n\
- var ESCAPE_KEY = 27;\n\
-\n\
- var HIDDEN = 0;\n\
- var VISIBLE = 1;\n\
- var INHERIT = 2;\n\
- var aVisibilityAttributeValue = [ 'hidden', 'visible', 'inherit' ];\n\
- var aVisibilityValue = { 'hidden' : HIDDEN, 'visible' : VISIBLE, 'inherit' : INHERIT };\n\
-\n\
- var ROOT_NODE = document.getElementsByTagNameNS( NSS['svg'], 'svg' )[0];\n\
- var WIDTH = 0;\n\
- var HEIGHT = 0;\n\
- var INDEX_COLUMNS_DEFAULT = 3;\n\
- var INDEX_OFFSET = 0;\n\
-\n\
- var theMetaDoc;\n\
- var theSlideIndexPage;\n\
- var currentMode = SLIDE_MODE;\n\
- var processingEffect = false;\n\
- var nCurSlide = 0;\n\
-\n\
- var charCodeDictionary = getDefaultCharCodeDictionary();\n\
- var keyCodeDictionary = getDefaultKeyCodeDictionary();\n\
-\n\
- var mouseHandlerDictionary = getDefaultMouseHandlerDictionary();\n\
-\n\
-\n\
- function object( aObject )\n\
- {\n\
- var F = function() {};\n\
- F.prototype = aObject;\n\
- return new F();\n\
- }\n\
-\n\
-\n\
- function extend( aSubType, aSuperType )\n\
- {\n\
- if (!aSuperType || !aSubType) {\n\
- alert('extend failed, verify dependencies');\n\
- }\n\
- var OP = Object.prototype;\n\
- var sp = aSuperType.prototype;\n\
- var rp = object( sp );\n\
- aSubType.prototype = rp;\n\
-\n\
- rp.constructor = aSubType;\n\
- aSubType.superclass = sp;\n\
-\n\
- if (aSuperType != Object && sp.constructor == OP.constructor) {\n\
- sp.constructor = aSuperType;\n\
- }\n\
-\n\
- return aSubType;\n\
- }\n\
-\n\
-\n\
- function instantiate( TemplateClass, BaseType )\n\
- {\n\
- if( !TemplateClass.instanceSet )\n\
- TemplateClass.instanceSet = new Array();\n\
-\n\
- var nSize = TemplateClass.instanceSet.length;\n\
-\n\
- for( var i = 0; i < nSize; ++i )\n\
- {\n\
- if( TemplateClass.instanceSet[i].base === BaseType )\n\
- return TemplateClass.instanceSet[i].instance;\n\
- }\n\
-\n\
- TemplateClass.instanceSet[ nSize ] = new Object();\n\
- TemplateClass.instanceSet[ nSize ].base = BaseType;\n\
- TemplateClass.instanceSet[ nSize ].instance = TemplateClass( BaseType );\n\
-\n\
- return TemplateClass.instanceSet[ nSize ].instance;\n\
- };\n\
-\n\
-\n\
- function Rectangle( aSVGRectElem )\n\
- {\n\
- var x = parseInt( aSVGRectElem.getAttribute( 'x' ) );\n\
- var y = parseInt( aSVGRectElem.getAttribute( 'y' ) );\n\
- var width = parseInt( aSVGRectElem.getAttribute( 'width' ) );\n\
- var height = parseInt( aSVGRectElem.getAttribute( 'height' ) );\n\
-\n\
- this.left = x;\n\
- this.right = x + width;\n\
- this.top = y;\n\
- this.bottom = y + height;\n\
- }\n\
-\n\
- function log( message )\n\
- {\n\
- if( typeof console == 'object' )\n\
- {\n\
- console.log( message );\n\
- }\n\
- else if( typeof opera == 'object' )\n\
- {\n\
- opera.postError( message );\n\
- }\n\
- else if( typeof java == 'object' && typeof java.lang == 'object' )\n\
- {\n\
- java.lang.System.out.println( message );\n\
- }\n\
- }\n\
-\n\
- function getNSAttribute( sNSPrefix, aElem, sAttrName )\n\
- {\n\
- if( !aElem ) return null;\n\
- if( aElem.hasAttributeNS( NSS[sNSPrefix], sAttrName ) )\n\
- {\n\
- return aElem.getAttributeNS( NSS[sNSPrefix], sAttrName );\n\
- }\n\
- return null;\n\
- }\n\
-\n\
- function getOOOAttribute( aElem, sAttrName )\n\
-";
-
-static const char aSVGScript1[] =
-"\
- {\n\
- return getNSAttribute( 'ooo', aElem, sAttrName );\n\
- }\n\
-\n\
- function setNSAttribute( sNSPrefix, aElem, sAttrName, aValue )\n\
- {\n\
- if( !aElem ) return false;\n\
- if( 'setAttributeNS' in aElem )\n\
- {\n\
- aElem.setAttributeNS( NSS[sNSPrefix], sAttrName, aValue );\n\
- return true;\n\
- }\n\
- else\n\
- {\n\
- aElem.setAttribute(sNSPrefix + ':' + sAttrName, aValue );\n\
- return true;\n\
- }\n\
- }\n\
-\n\
- function setOOOAttribute( aElem, sAttrName, aValue )\n\
- {\n\
- return setNSAttribute( 'ooo', aElem, sAttrName, aValue );\n\
- }\n\
-\n\
- function checkElemAndSetAttribute( aElem, sAttrName, aValue )\n\
- {\n\
- if( aElem )\n\
- aElem.setAttribute( sAttrName, aValue );\n\
- }\n\
-\n\
- function getElementsByProperty( node, name )\n\
- {\n\
- var elems = new Array();\n\
-\n\
- if( node.getAttribute( name ) )\n\
- elems.push( node );\n\
-\n\
- for( var counter = 0; counter < node.childNodes.length; ++counter )\n\
- {\n\
- if( node.childNodes[counter].nodeType == 1 )\n\
- elems = elems.concat( getElementsByProperty( node.childNodes[counter], name ) );\n\
- }\n\
- return elems;\n\
- }\n\
-\n\
- function getElementsByClassName( aElem, sClassName )\n\
- {\n\
-\n\
- var aElementSet = new Array();\n\
- if( 'getElementsByClassName' in aElem )\n\
- {\n\
- aElementSet = aElem.getElementsByClassName( sClassName );\n\
- }\n\
- else\n\
- {\n\
- var aElementSetByClassProperty = getElementsByProperty( aElem, 'class' );\n\
- for( var i = 0; i < aElementSetByClassProperty.length; ++i )\n\
- {\n\
- var sAttrClassName = aElementSetByClassProperty[i].getAttribute( 'class' );\n\
- if( sAttrClassName == sClassName )\n\
- {\n\
- aElementSet.push( aElementSetByClassProperty[i] );\n\
- }\n\
- }\n\
- }\n\
- return aElementSet;\n\
- }\n\
-\n\
- function getElementByClassName( aElem, sClassName /*, sTagName */)\n\
- {\n\
- var aElementSet = getElementsByClassName( aElem, sClassName );\n\
- if ( aElementSet.length == 1 )\n\
- return aElementSet[0];\n\
- else\n\
- return null;\n\
- }\n\
-\n\
- function getClassAttribute( aElem )\n\
- {\n\
- if( aElem )\n\
- return aElem.getAttribute( 'class' );\n\
- return '';\n\
- }\n\
-\n\
- function initVisibilityProperty( aElement )\n\
- {\n\
- var nVisibility = VISIBLE;\n\
- var sVisibility = aElement.getAttribute( 'visibility' );\n\
- if( sVisibility ) nVisibility = aVisibilityValue[ sVisibility ];\n\
- return nVisibility;\n\
- }\n\
-\n\
- function setElementVisibility( aElement, nCurrentVisibility, nNewVisibility )\n\
- {\n\
- if( nCurrentVisibility != nNewVisibility )\n\
- {\n\
- checkElemAndSetAttribute( aElement, 'visibility', aVisibilityAttributeValue[nNewVisibility] );\n\
- return nNewVisibility;\n\
- }\n\
- return nCurrentVisibility;\n\
- }\n\
-\n\
- function getSafeIndex( nIndex, nMin, nMax )\n\
- {\n\
- if( nIndex < nMin )\n\
- return nMin;\n\
- else if( nIndex > nMax )\n\
- return nMax;\n\
- else\n\
- return nIndex;\n\
- }\n\
-\n\
-\n\
-\n\
-\n\
- function DebugPrinter()\n\
- {\n\
- this.bEnabled = false;\n\
- }\n\
-\n\
-\n\
- DebugPrinter.prototype.on = function()\n\
- {\n\
- this.bEnabled = true;\n\
- };\n\
-\n\
- DebugPrinter.prototype.off = function()\n\
- {\n\
- this.bEnabled = false;\n\
- };\n\
-\n\
- DebugPrinter.prototype.isEnabled = function()\n\
- {\n\
- return this.bEnabled;\n\
- };\n\
-\n\
- DebugPrinter.prototype.print = function( sMessage, nTime )\n\
- {\n\
- if( this.isEnabled() )\n\
- {\n\
- sInfo = 'DBG: ' + sMessage;\n\
- if( nTime )\n\
- sInfo += ' (at: ' + String( nTime / 1000 ) + 's)';\n\
- log( sInfo );\n\
- }\n\
- };\n\
-\n\
-\n\
- var NAVDBG = new DebugPrinter();\n\
- NAVDBG.off();\n\
-\n\
- var ANIMDBG = new DebugPrinter();\n\
- ANIMDBG.off();\n\
-\n\
- var aRegisterEventDebugPrinter = new DebugPrinter();\n\
- aRegisterEventDebugPrinter.off();\n\
-\n\
- var aTimerEventQueueDebugPrinter = new DebugPrinter();\n\
- aTimerEventQueueDebugPrinter.off();\n\
-\n\
- var aEventMultiplexerDebugPrinter = new DebugPrinter();\n\
- aEventMultiplexerDebugPrinter.off();\n\
-\n\
- var aNextEffectEventArrayDebugPrinter = new DebugPrinter();\n\
- aNextEffectEventArrayDebugPrinter.off();\n\
-\n\
- var aActivityQueueDebugPrinter = new DebugPrinter();\n\
- aActivityQueueDebugPrinter.off();\n\
-\n\
- var aAnimatedElementDebugPrinter = new DebugPrinter();\n\
- aAnimatedElementDebugPrinter.off();\n\
-\n\
-\n\
-\n\
-\n\
- function MetaDocument( aMetaDocElem )\n\
- {\n\
- this.nNumberOfSlides = parseInt( aMetaDocElem.getAttributeNS( NSS['ooo'], aOOOAttrNumberOfSlides ) );\n\
- assert( typeof this.nNumberOfSlides == 'number' && this.nNumberOfSlides > 0,\n\
- 'MetaDocument: number of slides is zero or undefined.' );\n\
- this.startSlideNumber = 0;\n\
- this.sPageNumberingType = aMetaDocElem.getAttributeNS( NSS['ooo'], aOOOAttrNumberingType ) || 'arabic';\n\
- this.aMetaSlideSet = new Array();\n\
- this.aMasterPageSet = new Object();\n\
- this.aTextFieldSet = new Array();\n\
- this.slideNumberField = new SlideNumberField( this.sPageNumberingType );\n\
-\n\
- this.aSlideAnimationsMap = new Object();\n\
- this.initSlideAnimationsMap();\n\
-\n\
-\n\
- for( var i = 0; i < this.nNumberOfSlides; ++i )\n\
- {\n\
- var sMetaSlideId = aOOOElemMetaSlide + '_' + i;\n\
- this.aMetaSlideSet.push( new MetaSlide( sMetaSlideId, this ) );\n\
- }\n\
- assert( this.aMetaSlideSet.length == this.nNumberOfSlides,\n\
- 'MetaDocument: aMetaSlideSet.length != nNumberOfSlides.' );\n\
- this.aMetaSlideSet[ this.startSlideNumber ].show();\n\
-\n\
-";
-
-static const char aSVGScript2[] =
-"\
- }\n\
-\n\
- MetaDocument.prototype.initPlaceholderShapes = function()\n\
- {\n\
- this.aMetaSlideSet[0].initPlaceholderShapes();\n\
- };\n\
-\n\
- MetaDocument.prototype.initSlideAnimationsMap = function()\n\
- {\n\
- var aAnimationsSection = document.getElementById( 'presentation-animations' );\n\
- if( aAnimationsSection )\n\
- {\n\
- var aAnimationsDefSet = aAnimationsSection.getElementsByTagName( 'defs' );\n\
-\n\
- for( var i = 0; i < aAnimationsDefSet.length; ++i )\n\
- {\n\
- var sSlideId = aAnimationsDefSet[i].getAttributeNS( NSS['ooo'], aOOOAttrSlide );\n\
- var aChildSet = getElementChildren( aAnimationsDefSet[i] );\n\
- if( sSlideId && ( aChildSet.length == 1 ) )\n\
- {\n\
- this.aSlideAnimationsMap[ sSlideId ] = aChildSet[0];\n\
- }\n\
- }\n\
- }\n\
- };\n\
-\n\
-\n\
-\n\
- function MetaSlide( sMetaSlideId, aMetaDoc )\n\
- {\n\
- this.theDocument = document;\n\
- this.id = sMetaSlideId;\n\
- this.theMetaDoc = aMetaDoc;\n\
- this.element = this.theDocument.getElementById( this.id );\n\
- assert( this.element, 'MetaSlide: meta_slide element <' + this.id + '> not found.' );\n\
- this.slideId = this.element.getAttributeNS( NSS['ooo'], aOOOAttrSlide );\n\
- this.slideElement = this.theDocument.getElementById( this.slideId );\n\
- assert( this.slideElement, 'MetaSlide: slide element <' + this.slideId + '> not found.' );\n\
- this.masterPage = this.initMasterPage();\n\
- this.nAreMasterObjectsVisible = this.initVisibilityProperty( aOOOAttrMasterObjectsVisibility, VISIBLE );\n\
- this.nIsBackgroundVisible = this.initVisibilityProperty( aOOOAttrBackgroundVisibility, VISIBLE );\n\
- this.nIsPageNumberVisible = this.initVisibilityProperty( aOOOAttrPageNumberVisibility, HIDDEN );\n\
- this.nIsDateTimeVisible = this.initVisibilityProperty( aOOOAttrDateTimeVisibility, VISIBLE );\n\
- this.nIsFooterVisible = this.initVisibilityProperty( aOOOAttrFooterVisibility, VISIBLE );\n\
- this.nIsHeaderVisible = this.initVisibilityProperty( aOOOAttrHeaderVisibility, VISIBLE );\n\
- this.aMPTextFieldSet = new Object();\n\
- this.aMPTextFieldSet[aSlideNumberClassName] = this.initSlideNumberField();\n\
- this.aMPTextFieldSet[aDateTimeClassName] = this.initDateTimeField( aOOOAttrDateTimeField );\n\
- this.aMPTextFieldSet[aFooterClassName] = this.initFixedTextField( aOOOAttrFooterField );\n\
- this.aMPTextFieldSet[aHeaderClassName] = this.initFixedTextField( aOOOAttrHeaderField );\n\
-\n\
- this.aSlideAnimationsHandler = new SlideAnimations( aSlideShow.getContext() );\n\
- this.aSlideAnimationsHandler.importAnimations( this.getSlideAnimationsRoot() );\n\
- this.aSlideAnimationsHandler.parseElements();\n\
- if( false && this.aSlideAnimationsHandler.aRootNode )\n\
- log( this.aSlideAnimationsHandler.aRootNode.info( true ) );\n\
- }\n\
-\n\
- MetaSlide.prototype =\n\
- {\n\
- hide : function()\n\
- {\n\
- checkElemAndSetAttribute( this.slideElement, 'visibility', 'hidden' );\n\
-\n\
- this.masterPage.hide();\n\
- this.masterPage.hideBackground();\n\
-\n\
- var aFieldSet = this.aMPTextFieldSet;\n\
- var aShapeSet = this.masterPage.aPlaceholderShapeSet;\n\
- if( aFieldSet[aSlideNumberClassName] ) aFieldSet[aSlideNumberClassName].hide( aShapeSet[aSlideNumberClassName] );\n\
- if( aFieldSet[aDateTimeClassName] ) aFieldSet[aDateTimeClassName].hide( aShapeSet[aDateTimeClassName] );\n\
- if( aFieldSet[aFooterClassName] ) aFieldSet[aFooterClassName].hide( aShapeSet[aFooterClassName] );\n\
- if( aFieldSet[aHeaderClassName] ) aFieldSet[aHeaderClassName].hide( aShapeSet[aHeaderClassName] );\n\
- },\n\
-\n\
- hideExceptMaster : function()\n\
- {\n\
- checkElemAndSetAttribute( this.slideElement, 'visibility', 'hidden' );\n\
- },\n\
-\n\
- show : function()\n\
- {\n\
- checkElemAndSetAttribute( this.slideElement, 'visibility', 'visible' );\n\
-\n\
- this.masterPage.setVisibility( this.nAreMasterObjectsVisible );\n\
- this.masterPage.setVisibilityBackground( this.nIsBackgroundVisible );\n\
-\n\
-\n\
- this.setTextFieldVisibility( aSlideNumberClassName, this.nIsPageNumberVisible );\n\
- this.setTextFieldVisibility( aDateTimeClassName, this.nIsDateTimeVisible );\n\
- this.setTextFieldVisibility( aFooterClassName, this.nIsFooterVisible );\n\
- this.setTextFieldVisibility( aHeaderClassName, this.nIsHeaderVisible );\n\
- },\n\
-\n\
- getMasterPageId : function()\n\
- {\n\
- return this.masterPage.id;\n\
- },\n\
-\n\
- getMasterPageElement : function()\n\
- {\n\
- return this.masterPage.element;\n\
- },\n\
-\n\
- getBackground : function()\n\
- {\n\
- return getElementByClassName( this.slideElement, 'Background' );\n\
- },\n\
-\n\
- getMasterPageBackground : function()\n\
- {\n\
- return this.masterPage.background;\n\
- },\n\
-\n\
- initMasterPage : function()\n\
- {\n\
- var sMasterPageId = this.element.getAttributeNS( NSS['ooo'], aOOOAttrMaster );\n\
- if( !this.theMetaDoc.aMasterPageSet.hasOwnProperty( sMasterPageId ) )\n\
- this.theMetaDoc.aMasterPageSet[ sMasterPageId ] = new MasterPage( sMasterPageId );\n\
- return this.theMetaDoc.aMasterPageSet[ sMasterPageId ];\n\
- },\n\
-\n\
- initVisibilityProperty : function( aVisibilityAttribute, nDefaultValue )\n\
- {\n\
- var nVisibility = nDefaultValue;\n\
- var sVisibility = getOOOAttribute( this.element, aVisibilityAttribute );\n\
- if( sVisibility )\n\
- nVisibility = aVisibilityValue[ sVisibility ];\n\
- return nVisibility;\n\
- },\n\
-\n\
- initSlideNumberField : function()\n\
- {\n\
- return this.theMetaDoc.slideNumberField;\n\
- },\n\
-\n\
- initDateTimeField : function( aOOOAttrDateTimeField )\n\
- {\n\
- var sTextFieldId = getOOOAttribute( this.element, aOOOAttrDateTimeField );\n\
- if( !sTextFieldId ) return null;\n\
-\n\
- var nLength = aOOOElemTextField.length + 1;\n\
- var nIndex = parseInt(sTextFieldId.substring( nLength ) );\n\
- if( typeof nIndex != 'number') return null;\n\
-\n\
- if( !this.theMetaDoc.aTextFieldSet[ nIndex ] )\n\
- {\n\
- var aTextField;\n\
- var aTextFieldElem = document.getElementById( sTextFieldId );\n\
- var sClassName = getClassAttribute( aTextFieldElem );\n\
- if( sClassName == 'FixedDateTimeField' )\n\
- {\n\
- aTextField = new FixedTextField( aTextFieldElem );\n\
- }\n\
- else if( sClassName == 'VariableDateTimeField' )\n\
- {\n\
- aTextField = new VariableDateTimeField( aTextFieldElem );\n\
- }\n\
- else\n\
- {\n\
- aTextField = null;\n\
- }\n\
- this.theMetaDoc.aTextFieldSet[ nIndex ] = aTextField;\n\
- }\n\
- return this.theMetaDoc.aTextFieldSet[ nIndex ];\n\
- },\n\
-\n\
- initFixedTextField : function( aOOOAttribute )\n\
- {\n\
- var sTextFieldId = getOOOAttribute( this.element, aOOOAttribute );\n\
- if( !sTextFieldId ) return null;\n\
-\n\
- var nLength = aOOOElemTextField.length + 1;\n\
- var nIndex = parseInt( sTextFieldId.substring( nLength ) );\n\
- if( typeof nIndex != 'number') return null;\n\
-\n\
- if( !this.theMetaDoc.aTextFieldSet[ nIndex ] )\n\
- {\n\
- var aTextFieldElem = document.getElementById( sTextFieldId );\n\
- this.theMetaDoc.aTextFieldSet[ nIndex ]\n\
- = new FixedTextField( aTextFieldElem );\n\
- }\n\
- return this.theMetaDoc.aTextFieldSet[ nIndex ];\n\
- },\n\
-\n\
- setTextFieldVisibility : function( sClassName, nVisible )\n\
- {\n\
- var aTextField = this.aMPTextFieldSet[ sClassName ];\n\
- var aPlaceholderShape = this.masterPage.aPlaceholderShapeSet[ sClassName ];\n\
- if( !aTextField ) return;\n\
- aTextField.setVisibility( this.nAreMasterObjectsVisible & nVisible, aPlaceholderShape );\n\
- },\n\
-\n\
- getSlideAnimationsRoot : function()\n\
- {\n\
- return this.theMetaDoc.aSlideAnimationsMap[ this.slideId ];\n\
- }\n\
-\n\
- };\n\
-\n\
-";
-
-static const char aSVGScript3[] =
-"\
- function MasterPage( sMasterPageId )\n\
- {\n\
- this.id = sMasterPageId;\n\
- this.element = document.getElementById( this.id );\n\
- assert( this.element, 'MasterPage: master page element <' + this.id + '> not found.' );\n\
- this.background = getElementByClassName( this.element, 'Background' );\n\
- this.backgroundId = this.background.getAttribute( 'id' );\n\
- this.backgroundVisibility = initVisibilityProperty( this.background );\n\
- this.backgroundObjects = getElementByClassName( this.element, 'BackgroundObjects' );\n\
- this.backgroundObjectsId = this.backgroundObjects.getAttribute( 'id' );\n\
- this.backgroundObjectsVisibility = initVisibilityProperty( this.backgroundObjects );\n\
- this.aPlaceholderShapeSet = new Object();\n\
- this.initPlaceholderShapes();\n\
- }\n\
-\n\
- MasterPage.prototype =\n\
- {\n\
- setVisibility : function( nVisibility )\n\
- {\n\
- this.backgroundObjectsVisibility = setElementVisibility( this.backgroundObjects, this.backgroundObjectsVisibility, nVisibility );\n\
- },\n\
-\n\
- setVisibilityBackground : function( nVisibility )\n\
- {\n\
- this.backgroundVisibility = setElementVisibility( this.background, this.backgroundVisibility, nVisibility );\n\
- },\n\
-\n\
- hide : function()\n\
- {\n\
- this.setVisibility( HIDDEN );\n\
- },\n\
-\n\
- show : function()\n\
- {\n\
- this.setVisibility( VISIBLE );\n\
- },\n\
-\n\
- hideBackground : function()\n\
- {\n\
- this.setVisibilityBackground( HIDDEN );\n\
- },\n\
-\n\
- showBackground : function()\n\
- {\n\
- this.setVisibilityBackground( VISIBLE );\n\
- },\n\
-\n\
- initPlaceholderShapes : function()\n\
- {\n\
- this.aPlaceholderShapeSet[ aSlideNumberClassName ] = new PlaceholderShape( this, aSlideNumberClassName );\n\
- this.aPlaceholderShapeSet[ aDateTimeClassName ] = new PlaceholderShape( this, aDateTimeClassName );\n\
- this.aPlaceholderShapeSet[ aFooterClassName ] = new PlaceholderShape( this, aFooterClassName );\n\
- this.aPlaceholderShapeSet[ aHeaderClassName ] = new PlaceholderShape( this, aHeaderClassName );\n\
- }\n\
- };\n\
-\n\
- function PlaceholderShape( aMasterPage, sClassName )\n\
- {\n\
- this.masterPage = aMasterPage;\n\
- this.className = sClassName;\n\
- this.element = null;\n\
- this.textElement = null;\n\
-\n\
- this.init();\n\
- }\n\
-\n\
- PlaceholderShape.prototype.setTextContent = function( sText )\n\
- {\n\
- if( !this.textElement )\n\
- {\n\
- log( 'error: PlaceholderShape.setTextContent: text element is not valid in placeholder of type '\n\
- + this.className + ' that belongs to master slide ' + this.masterPage.id );\n\
- return;\n\
- }\n\
- this.textElement.textContent = sText;\n\
- };\n\
-\n\
- PlaceholderShape.prototype.setVisibility = function( nVisibility )\n\
- {\n\
- this.element.setAttribute( 'visibility', aVisibilityAttributeValue[nVisibility] );\n\
- };\n\
-\n\
- PlaceholderShape.prototype.show = function()\n\
- {\n\
- this.element.setAttribute( 'visibility', 'visible' );\n\
- };\n\
-\n\
- PlaceholderShape.prototype.hide = function()\n\
- {\n\
- this.element.setAttribute( 'visibility', 'hidden' );\n\
- };\n\
-\n\
- PlaceholderShape.prototype.init = function()\n\
- {\n\
- var aShapeElem = getElementByClassName( this.masterPage.backgroundObjects, this.className );\n\
- if( !aShapeElem ) return;\n\
-\n\
- this.element = aShapeElem;\n\
- this.element.setAttribute( 'visibility', 'hidden' );\n\
-\n\
- this.textElement = getElementByClassName( this.element , 'PlaceholderText' );\n\
- if( !this.textElement ) return;\n\
-\n\
-\n\
- var aSVGRectElemSet = this.element.getElementsByTagName( 'rect' );\n\
- if( aSVGRectElemSet.length != 1) return;\n\
-\n\
- var aRect = new Rectangle( aSVGRectElemSet[0] );\n\
-\n\
- var sTextAdjust = getOOOAttribute( this.element, aOOOAttrTextAdjust ) || 'left';\n\
- var sTextAnchor, sX;\n\
- if( sTextAdjust == 'left' )\n\
- {\n\
- sTextAnchor = 'start';\n\
- sX = String( aRect.left );\n\
- }\n\
- else if( sTextAdjust == 'right' )\n\
- {\n\
- sTextAnchor = 'end';\n\
- sX = String( aRect.right );\n\
- }\n\
- else if( sTextAdjust == 'center' )\n\
- {\n\
- sTextAnchor = 'middle';\n\
- var nMiddle = ( aRect.left + aRect.right ) / 2;\n\
- sX = String( parseInt( String( nMiddle ) ) );\n\
- }\n\
-\n\
-\n\
- this.textElement.setAttribute( 'text-anchor', sTextAnchor );\n\
- this.textElement.setAttribute( 'x', sX );\n\
- };\n\
-\n\
-\n\
-\n\
- function TextField( aTextFieldElem )\n\
- {\n\
- this.bIsUpdated = false;\n\
- }\n\
-\n\
- TextField.prototype.getShapeElement = function()\n\
- {\n\
- return this.shapeElement;\n\
- };\n\
-\n\
- TextField.prototype.setVisibility = function( nVisibility, aPlaceholderShape )\n\
- {\n\
- if( !this.bIsUpdated )\n\
- {\n\
- if( nVisibility )\n\
- {\n\
- this.update( aPlaceholderShape );\n\
- this.bIsUpdated = true;\n\
- }\n\
- aPlaceholderShape.setVisibility( nVisibility );\n\
- }\n\
- else if( !nVisibility )\n\
- {\n\
- aPlaceholderShape.hide();\n\
- this.bIsUpdated = false;\n\
- }\n\
- };\n\
-\n\
- TextField.prototype.show = function( aPlaceholderShape )\n\
- {\n\
- this.setVisibility( VISIBLE, aPlaceholderShape );\n\
- };\n\
-\n\
- TextField.prototype.hide = function( aPlaceholderShape )\n\
- {\n\
- this.setVisibility( HIDDEN, aPlaceholderShape );\n\
- };\n\
-\n\
-\n\
- function FixedTextField( aTextFieldElem )\n\
- {\n\
- TextField.call( this, aTextFieldElem );\n\
- this.text = aTextFieldElem.textContent;\n\
- }\n\
- extend( FixedTextField, TextField );\n\
-\n\
- FixedTextField.prototype.update = function( aPlaceholderShape )\n\
- {\n\
- aPlaceholderShape.setTextContent( this.text );\n\
- };\n\
-\n\
-\n\
- function VariableDateTimeField( aTextFieldElem )\n\
- {\n\
- VariableDateTimeField.superclass.constructor.call( this, aTextFieldElem );\n\
- this.dateTimeFormat = getOOOAttribute( aTextFieldElem, aOOOAttrDateTimeFormat );\n\
- }\n\
- extend( VariableDateTimeField, TextField );\n\
-\n\
- VariableDateTimeField.prototype.update = function( aPlaceholderShape )\n\
- {\n\
- var sText = this.createDateTimeText( this.dateTimeFormat );\n\
- aPlaceholderShape.setTextContent( sText );\n\
- };\n\
-\n\
-";
-
-static const char aSVGScript4[] =
-"\
- VariableDateTimeField.prototype.createDateTimeText = function( sDateTimeFormat )\n\
- {\n\
- var aDate = Date();\n\
- var sDate = aDate.toLocaleString();\n\
- return sDate;\n\
- };\n\
-\n\
- function SlideNumberField( sPageNumberingType )\n\
- {\n\
- SlideNumberField.superclass.constructor.call( this, null );\n\
- this.pageNumberingType = sPageNumberingType;\n\
- }\n\
- extend( SlideNumberField, TextField );\n\
-\n\
- SlideNumberField.prototype.getNumberingType = function()\n\
- {\n\
- return this.pageNumberingType;\n\
- };\n\
-\n\
- SlideNumberField.prototype.update = function( aPlaceholderShape )\n\
- {\n\
- var sText = this.createSlideNumberText( nCurSlide + 1, this.getNumberingType() );\n\
- aPlaceholderShape.setTextContent( sText );\n\
- };\n\
-\n\
- SlideNumberField.prototype.createSlideNumberText = function( nSlideNumber, sNumberingType )\n\
- {\n\
- return String( nSlideNumber );\n\
- };\n\
-\n\
-\n\
-\n\
-\n\
- function SlideIndexPage()\n\
- {\n\
- this.pageElementId = 'slide_index';\n\
- this.pageBgColor = 'rgb(252,252,252)';\n\
- this.pageElement = this.createPageElement();\n\
- assert( this.pageElement, 'SlideIndexPage: pageElement is not valid' );\n\
- this.indexColumns = INDEX_COLUMNS_DEFAULT;\n\
- this.totalThumbnails = this.indexColumns * this.indexColumns;\n\
- this.selectedSlideIndex = nCurSlide;\n\
-\n\
- this.xSpacingFactor = 600/28000;\n\
- this.ySpacingFactor = 450/21000;\n\
- this.xSpacing = WIDTH * this.xSpacingFactor;\n\
- this.ySpacing = HEIGHT * this.ySpacingFactor;\n\
- this.halfBorderWidthFactor = ( 300/28000 ) * ( this.indexColumns / 3 );\n\
- this.halfBorderWidth = WIDTH * this.halfBorderWidthFactor;\n\
- this.borderWidth = 2 * this.halfBorderWidth;\n\
- this.scaleFactor = ( 1 - ( this.indexColumns + 1 ) * this.xSpacingFactor ) /\n\
- ( this.indexColumns * ( 1 + 2 * this.halfBorderWidthFactor ) );\n\
-\n\
- this.thumbnailMouseAreaTemplateId = 'thumbnail_mouse_area';\n\
- this.thumbnailMouseAreaTemplateElement = null;\n\
- this.thumbnailBorderTemplateId = 'thumbnail_border';\n\
- this.thumbnailBorderTemplateElement = null;\n\
- this.createTemplateElements();\n\
-\n\
- this.aThumbnailSet = new Array( this.totalThumbnails );\n\
- for( var i = 0; i < this.totalThumbnails; ++i )\n\
- {\n\
- this.aThumbnailSet[i] = new Thumbnail( this, i );\n\
- this.aThumbnailSet[i].updateView();\n\
- }\n\
-\n\
- this.curThumbnailIndex = this.selectedSlideIndex % this.totalThumbnails;\n\
- this.aThumbnailSet[ this.curThumbnailIndex ].select();\n\
- }\n\
-\n\
-\n\
- SlideIndexPage.prototype.getTotalThumbnails = function()\n\
- {\n\
- return this.totalThumbnails;\n\
- };\n\
-\n\
- SlideIndexPage.prototype.show = function()\n\
- {\n\
- this.pageElement.setAttribute( 'display', 'inherit' );\n\
- };\n\
-\n\
- SlideIndexPage.prototype.hide = function()\n\
- {\n\
- this.pageElement.setAttribute( 'display', 'none' );\n\
- };\n\
-\n\
- SlideIndexPage.prototype.setSelection = function( nIndex )\n\
- {\n\
- nIndex = getSafeIndex( nIndex, 0, this.getTotalThumbnails() - 1 );\n\
- if( this.curThumbnailIndex != nIndex )\n\
- {\n\
- this.aThumbnailSet[ this.curThumbnailIndex ].unselect();\n\
- this.aThumbnailSet[ nIndex ].select();\n\
- this.curThumbnailIndex = nIndex;\n\
- }\n\
- this.selectedSlideIndex = this.aThumbnailSet[ nIndex ].slideIndex;\n\
- };\n\
-\n\
- SlideIndexPage.prototype.createPageElement = function()\n\
- {\n\
- var aPageElement = document.createElementNS( NSS['svg'], 'g' );\n\
- aPageElement.setAttribute( 'id', this.pageElementId );\n\
- aPageElement.setAttribute( 'display', 'none' );\n\
-\n\
- var sPageBgColor = this.pageBgColor + ';';\n\
- var aRectElement = document.createElementNS( NSS['svg'], 'rect' );\n\
- aRectElement.setAttribute( 'x', 0 );\n\
- aRectElement.setAttribute( 'y', 0 );\n\
- aRectElement.setAttribute( 'width', WIDTH );\n\
- aRectElement.setAttribute( 'height', HEIGHT );\n\
- aRectElement.setAttribute( 'style', 'stroke:none;fill:' + sPageBgColor );\n\
-\n\
- aPageElement.appendChild( aRectElement );\n\
- ROOT_NODE.appendChild( aPageElement );\n\
- return( document.getElementById( this.pageElementId ) );\n\
- };\n\
-\n\
- SlideIndexPage.prototype.createTemplateElements = function()\n\
- {\n\
- var aDefsElement = document.createElementNS( NSS['svg'], 'defs' );\n\
- var aRectElement = document.createElementNS( NSS['svg'], 'rect' );\n\
- aRectElement.setAttribute( 'id', this.thumbnailBorderTemplateId );\n\
- aRectElement.setAttribute( 'x', -this.halfBorderWidth );\n\
- aRectElement.setAttribute( 'y', -this.halfBorderWidth );\n\
- aRectElement.setAttribute( 'rx', this.halfBorderWidth );\n\
- aRectElement.setAttribute( 'ry', this.halfBorderWidth );\n\
- aRectElement.setAttribute( 'width', WIDTH + this.halfBorderWidth );\n\
- aRectElement.setAttribute( 'height', HEIGHT + this.halfBorderWidth );\n\
- aRectElement.setAttribute( 'stroke-width', this.borderWidth );\n\
- aRectElement.setAttribute( 'fill', 'none' );\n\
- aDefsElement.appendChild( aRectElement );\n\
-\n\
- aRectElement = document.createElementNS( NSS['svg'], 'rect' );\n\
- aRectElement.setAttribute( 'id', this.thumbnailMouseAreaTemplateId );\n\
- aRectElement.setAttribute( 'x', 0 );\n\
- aRectElement.setAttribute( 'y', 0 );\n\
- aRectElement.setAttribute( 'width', WIDTH );\n\
- aRectElement.setAttribute( 'height', HEIGHT );\n\
- aRectElement.setAttribute( 'fill', this.pageBgColor );\n\
- aDefsElement.appendChild( aRectElement );\n\
-\n\
- this.pageElement.appendChild( aDefsElement );\n\
-\n\
- this.thumbnailMouseAreaTemplateElement = document.getElementById( this.thumbnailMouseAreaTemplateId );\n\
- this.thumbnailBorderTemplateElement = document.getElementById( this.thumbnailBorderTemplateId );\n\
- };\n\
-\n\
- SlideIndexPage.prototype.decreaseNumberOfColumns = function()\n\
- {\n\
- this.setNumberOfColumns( this.indexColumns - 1 );\n\
- };\n\
-\n\
- SlideIndexPage.prototype.increaseNumberOfColumns = function()\n\
- {\n\
- this.setNumberOfColumns( this.indexColumns + 1 );\n\
- };\n\
-\n\
- SlideIndexPage.prototype.resetNumberOfColumns = function()\n\
- {\n\
- this.setNumberOfColumns( INDEX_COLUMNS_DEFAULT );\n\
- };\n\
-\n\
- SlideIndexPage.prototype.setNumberOfColumns = function( nNumberOfColumns )\n\
- {\n\
- if( this.indexColumns == nNumberOfColumns ) return;\n\
- if( nNumberOfColumns < 2 || nNumberOfColumns > 6 ) return;\n\
-\n\
- var suspendHandle = ROOT_NODE.suspendRedraw(500);\n\
-\n\
- var nOldTotalThumbnails = this.totalThumbnails;\n\
- this.indexColumns = nNumberOfColumns;\n\
- this.totalThumbnails = nNumberOfColumns * nNumberOfColumns;;\n\
-\n\
- this.aThumbnailSet[this.curThumbnailIndex].unselect();\n\
-\n\
- for( var i = this.totalThumbnails; i < nOldTotalThumbnails; ++i )\n\
- {\n\
- this.aThumbnailSet[i].removeElement();\n\
- };\n\
-\n\
- for( var i = nOldTotalThumbnails; i < this.totalThumbnails; ++i )\n\
- {\n\
- this.aThumbnailSet[i] = new Thumbnail( this, i );\n\
- };\n\
-\n\
- this.halfBorderWidthFactor = ( 300/28000 ) * ( this.indexColumns / 3 );\n\
- this.halfBorderWidth = WIDTH * this.halfBorderWidthFactor;\n\
- this.borderWidth = 2 * this.halfBorderWidth;\n\
- this.scaleFactor = ( 1 - ( this.indexColumns + 1 ) * this.xSpacingFactor ) /\n\
- ( this.indexColumns * ( 1 + 2 * this.halfBorderWidthFactor ) );\n\
-\n\
- var aRectElement = this.thumbnailBorderTemplateElement;\n\
- aRectElement.setAttribute( 'x', -this.halfBorderWidth );\n\
- aRectElement.setAttribute( 'y', -this.halfBorderWidth );\n\
- aRectElement.setAttribute( 'rx', this.halfBorderWidth );\n\
- aRectElement.setAttribute( 'ry', this.halfBorderWidth );\n\
- aRectElement.setAttribute( 'width', WIDTH + this.halfBorderWidth );\n\
- aRectElement.setAttribute( 'height', HEIGHT + this.halfBorderWidth );\n\
- aRectElement.setAttribute( 'stroke-width', this.borderWidth );\n\
-\n\
-";
-
-static const char aSVGScript5[] =
-"\
- for( var i = 0; i < this.totalThumbnails; ++i )\n\
- {\n\
- this.aThumbnailSet[i].updateView();\n\
- }\n\
-\n\
- this.curThumbnailIndex = this.selectedSlideIndex % this.totalThumbnails;\n\
- this.aThumbnailSet[this.curThumbnailIndex].select();\n\
-\n\
- INDEX_OFFSET = -1;\n\
- indexSetPageSlide( this.selectedSlideIndex );\n\
-\n\
- ROOT_NODE.unsuspendRedraw( suspendHandle );\n\
- ROOT_NODE.forceRedraw();\n\
- };\n\
-\n\
-\n\
- function Thumbnail( aSlideIndexPage, nIndex )\n\
- {\n\
- this.container = aSlideIndexPage;\n\
- this.index = nIndex;//= getSafeIndex( nIndex, 0, this.container.getTotalThumbnails() );\n\
- this.pageElement = this.container.pageElement;\n\
- this.thumbnailId = 'thumbnail' + this.index;\n\
- this.thumbnailElement = this.createThumbnailElement();\n\
- this.slideElement = getElementByClassName( this.thumbnailElement, 'Slide' );\n\
- this.backgroundElement = getElementByClassName( this.thumbnailElement, 'Background' );\n\
- this.backgroundObjectsElement = getElementByClassName( this.thumbnailElement, 'BackgroundObjects' );\n\
- this.borderElement = getElementByClassName( this.thumbnailElement, 'Border' );\n\
- this.aTransformSet = new Array( 3 );\n\
- this.visibility = VISIBLE;\n\
- this.isSelected = false;\n\
- };\n\
-\n\
- Thumbnail.prototype.sNormalBorderColor = 'rgb(216,216,216)';\n\
- Thumbnail.prototype.sSelectionBorderColor = 'rgb(92,92,255)';\n\
-\n\
- Thumbnail.prototype.removeElement = function()\n\
- {\n\
- if( this.thumbnailElement )\n\
- this.container.pageElement.removeChild( this.thumbnailElement );\n\
- };\n\
-\n\
- Thumbnail.prototype.show = function()\n\
- {\n\
- if( this.visibility == HIDDEN )\n\
- {\n\
- this.thumbnailElement.setAttribute( 'display', 'inherit' );\n\
- this.visibility = VISIBLE;\n\
- }\n\
- };\n\
-\n\
- Thumbnail.prototype.hide = function()\n\
- {\n\
- if( this.visibility == VISIBLE )\n\
- {\n\
- this.thumbnailElement.setAttribute( 'display', 'none' );\n\
- this.visibility = HIDDEN;\n\
- }\n\
- };\n\
-\n\
- Thumbnail.prototype.select = function()\n\
- {\n\
- if( !this.isSelected )\n\
- {\n\
- this.borderElement.setAttribute( 'stroke', this.sSelectionBorderColor );\n\
- this.isSelected = true;\n\
- }\n\
- };\n\
-\n\
- Thumbnail.prototype.unselect = function()\n\
- {\n\
- if( this.isSelected )\n\
- {\n\
- this.borderElement.setAttribute( 'stroke', this.sNormalBorderColor );\n\
- this.isSelected = false;\n\
- }\n\
- };\n\
-\n\
- Thumbnail.prototype.updateView = function()\n\
- {\n\
- this.column = this.index % this.container.indexColumns;\n\
- this.row = ( this.index - this.column ) / this.container.indexColumns;\n\
- this.halfBorderWidth = this.container.halfBorderWidth;\n\
- this.borderWidth = this.container.borderWidth;\n\
- this.width = ( WIDTH + this.borderWidth ) * this.container.scaleFactor;\n\
- this.height = ( HEIGHT + this.borderWidth ) * this.container.scaleFactor;\n\
- this.aTransformSet[2] = 'translate(' + this.halfBorderWidth + ' ' + this.halfBorderWidth + ')';\n\
- this.aTransformSet[1] = 'scale(' + this.container.scaleFactor + ')';\n\
- var sTransformAttrValue = this.computeTransform();\n\
- this.thumbnailElement.setAttribute( 'transform', sTransformAttrValue );\n\
- this.thumbnailElement.setAttribute( 'onmouseover', 'theSlideIndexPage.aThumbnailSet[' + this.index + '].onMouseOver()' );\n\
- };\n\
-\n\
- Thumbnail.prototype.update = function( nIndex )\n\
- {\n\
- if( this.slideIndex == nIndex ) return;\n\
-\n\
- var aMetaSlide = theMetaDoc.aMetaSlideSet[nIndex];\n\
- setNSAttribute( 'xlink', this.slideElement, 'href', '#' + aMetaSlide.slideId );\n\
- if( aMetaSlide.nIsBackgroundVisible )\n\
- {\n\
- setNSAttribute( 'xlink', this.backgroundElement, 'href', '#' + aMetaSlide.masterPage.backgroundId );\n\
- this.backgroundElement.setAttribute( 'visibility', 'inherit' );\n\
- }\n\
- else\n\
- {\n\
- this.backgroundElement.setAttribute( 'visibility', 'hidden' );\n\
- }\n\
- if( aMetaSlide.nAreMasterObjectsVisible )\n\
- {\n\
- setNSAttribute( 'xlink', this.backgroundObjectsElement, 'href', '#' + aMetaSlide.masterPage.backgroundObjectsId );\n\
- this.backgroundObjectsElement.setAttribute( 'visibility', 'inherit' );\n\
- }\n\
- else\n\
- {\n\
- this.backgroundObjectsElement.setAttribute( 'visibility', 'hidden' );\n\
- }\n\
- this.slideIndex = nIndex;\n\
- };\n\
-\n\
- Thumbnail.prototype.clear = function( nIndex )\n\
- {\n\
- setNSAttribute( 'xlink', this.slideElement, 'href', '' );\n\
- setNSAttribute( 'xlink', this.backgroundElement, 'href', '' );\n\
- setNSAttribute( 'xlink', this.backgroundObjectsElement, 'href', '' );\n\
- };\n\
-\n\
- Thumbnail.prototype.createThumbnailElement = function()\n\
- {\n\
- var aThumbnailElement = document.createElementNS( NSS['svg'], 'g' );\n\
- aThumbnailElement.setAttribute( 'id', this.thumbnailId );\n\
- aThumbnailElement.setAttribute( 'display', 'inherit' );\n\
-\n\
- var aMouseAreaElement = document.createElementNS( NSS['svg'], 'use' );\n\
- setNSAttribute( 'xlink', aMouseAreaElement, 'href', '#' + this.container.thumbnailMouseAreaTemplateId );\n\
- aMouseAreaElement.setAttribute( 'class', 'MouseArea' );\n\
- aThumbnailElement.appendChild( aMouseAreaElement );\n\
-\n\
- var aBackgroundElement = document.createElementNS( NSS['svg'], 'use' );\n\
- setNSAttribute( 'xlink', aBackgroundElement, 'href', '' );\n\
- aBackgroundElement.setAttribute( 'visibility', 'inherit');\n\
- aBackgroundElement.setAttribute( 'class', 'Background' );\n\
- aThumbnailElement.appendChild( aBackgroundElement );\n\
-\n\
- var aBackgroundObjectsElement = document.createElementNS( NSS['svg'], 'use' );\n\
- setNSAttribute( 'xlink', aBackgroundObjectsElement, 'href', '' );\n\
- aBackgroundObjectsElement.setAttribute( 'visibility', 'inherit');\n\
- aBackgroundObjectsElement.setAttribute( 'class', 'BackgroundObjects' );\n\
- aThumbnailElement.appendChild( aBackgroundObjectsElement );\n\
-\n\
- var aSlideElement = document.createElementNS( NSS['svg'], 'use' );\n\
- setNSAttribute( 'xlink', aSlideElement, 'href', '' );\n\
- aSlideElement.setAttribute( 'class', 'Slide' );\n\
- aThumbnailElement.appendChild( aSlideElement );\n\
-\n\
- var aBorderElement = document.createElementNS( NSS['svg'], 'use' );\n\
- setNSAttribute( 'xlink', aBorderElement, 'href', '#' + this.container.thumbnailBorderTemplateId );\n\
- aBorderElement.setAttribute( 'stroke', this.sNormalBorderColor );\n\
- aBorderElement.setAttribute( 'class', 'Border' );\n\
- aThumbnailElement.appendChild( aBorderElement );\n\
-\n\
- this.container.pageElement.appendChild( aThumbnailElement );\n\
- return( document.getElementById( this.thumbnailId ) );\n\
- };\n\
-\n\
- Thumbnail.prototype.computeTransform = function()\n\
- {\n\
- var nXSpacing = this.container.xSpacing;\n\
- var nYSpacing = this.container.ySpacing;\n\
-\n\
- var nXOffset = nXSpacing + ( this.width + nXSpacing ) * this.column;\n\
- var nYOffset = nYSpacing + ( this.height + nYSpacing ) * this.row;\n\
-\n\
- this.aTransformSet[0] = 'translate(' + nXOffset + ' ' + nYOffset + ')';\n\
-\n\
- sTransform = this.aTransformSet.join( ' ' );\n\
-\n\
- return sTransform;\n\
- };\n\
-\n\
- Thumbnail.prototype.onMouseOver = function()\n\
- {\n\
- if( ( currentMode == INDEX_MODE ) && ( this.container.curThumbnailIndex != this.index ) )\n\
- {\n\
- this.container.setSelection( this.index );\n\
- }\n\
- };\n\
-\n\
-\n\
-\n\
-\n\
- function init()\n\
- {\n\
- var VIEWBOX = ROOT_NODE.getAttribute('viewBox');\n\
-\n\
- if( VIEWBOX )\n\
- {\n\
- WIDTH = ROOT_NODE.viewBox.animVal.width;\n\
- HEIGHT = ROOT_NODE.viewBox.animVal.height;\n\
- }\n\
-\n\
-";
-
-static const char aSVGScript6[] =
-"\
- var aMetaDocElem = document.getElementById( aOOOElemMetaSlides );\n\
- assert( aMetaDocElem, 'init: meta document element not found' );\n\
- aSlideShow = new SlideShow();\n\
- theMetaDoc = new MetaDocument( aMetaDocElem );\n\
- theSlideIndexPage = new SlideIndexPage();\n\
-\n\
-\n\
-\n\
-\n\
-\n\
-\n\
- }\n\
-\n\
- function presentationEngineStop()\n\
- {\n\
- alert( 'We are sorry! An unexpected error occurred.\\nThe presentation engine will be stopped' );\n\
- document.onkeydown = null;\n\
- document.onkeypress = null;\n\
- document.onclick = null;\n\
- window.onmousewheel = null;\n\
- }\n\
-\n\
- function assert( condition, message )\n\
- {\n\
- if (!condition)\n\
- {\n\
- presentationEngineStop();\n\
- if (typeof console == 'object')\n\
- console.trace();\n\
- throw new Error( message );\n\
- }\n\
- }\n\
-\n\
- function onKeyDown( aEvt )\n\
- {\n\
+ /***** * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *****\n\
+ * - Presentation Engine v5.0.1 - *\n\
+ ***** * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *****/\n\
+\n\
+\n\
+ /*****\n\
+ * @licstart\n\
+ *\n\
+ * The following is the license notice for the part of JavaScript code of this\n\
+ * page included between the '@jessyinkstart' and the '@jessyinkend' notes.\n\
+ */\n\
+\n\
+ /***** ******************************************************************\n\
+ *\n\
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.\n\
+ *\n\
+ * Copyright 2008, 2009 Hannes Hochreiner\n\
+ *\n\
+ * The JavaScript code included between the start note '@jessyinkstart'\n\
+ * and the end note '@jessyinkend' is free software: you can\n\
+ * redistribute it and/or modify it under the terms of the GNU\n\
+ * General Public License (GNU GPL) as published by the Free Software\n\
+ * Foundation, either version 3 of the License, or (at your option)\n\
+ * any later version. The code is distributed WITHOUT ANY WARRANTY;\n\
+ * without even the implied warranty of MERCHANTABILITY or FITNESS\n\
+ * FOR A PARTICULAR PURPOSE. See the GNU GPL for more details.\n\
+ *\n\
+ * As additional permission under GNU GPL version 3 section 7, you\n\
+ * may distribute non-source (e.g., minimized or compacted) forms of\n\
+ * that code without the copy of the GNU GPL normally required by\n\
+ * section 4, provided you include this license notice and a URL\n\
+ * through which recipients can access the Corresponding Source.\n\
+ *\n\
+ *************************************************************************/\n\
+\n\
+ /*****\n\
+ * You can find the complete source code of the JessyInk project at:\n\
+ * @source http://code.google.com/p/jessyink/\n\
+ */\n\
+\n\
+ /*****\n\
+ * @licend\n\
+ *\n\
+ * The above is the license notice for the part of JavaScript code of this\n\
+ * page included between the '@jessyinkstart' and the '@jessyinkend' notes.\n\
+ */\n\
+\n\
+\n\
+ /*****\n\
+ * @jessyinkstart\n\
+ *\n\
+ * The following code is a derivative work of some parts of the JessyInk\n\
+ * project.\n\
+ * @source http://code.google.com/p/jessyink/\n\
+ */\n\
+\n\
+\n\
+ function getElementsByProperty( node, name )\n\
+ {\n\
+ var elems = new Array();\n\
+\n\
+ if( node.getAttribute( name ) )\n\
+ elems.push( node );\n\
+\n\
+ for( var counter = 0; counter < node.childNodes.length; ++counter )\n\
+ {\n\
+ if( node.childNodes[counter].nodeType == 1 )\n\
+ {\n\
+ var subElems = getElementsByProperty( node.childNodes[counter], name );\n\
+ elems = elems.concat( subElems );\n\
+ }\n\
+ }\n\
+ return elems;\n\
+ }\n\
+\n\
+ function onKeyDown( aEvt )\n\
+ {\n\
if ( !aEvt )\n\
aEvt = window.event;\n\
\n\
@@ -1300,11 +120,11 @@ static const char aSVGScript6[] =
return keyCodeDictionary[currentMode][code]();\n\
else\n\
document.onkeypress = onKeyPress;\n\
- }\n\
- document.onkeydown = onKeyDown;\n\
+ }\n\
+ document.onkeydown = onKeyDown;\n\
\n\
- function onKeyPress( aEvt )\n\
- {\n\
+ function onKeyPress( aEvt )\n\
+ {\n\
document.onkeypress = null;\n\
\n\
if ( !aEvt )\n\
@@ -1314,61 +134,87 @@ static const char aSVGScript6[] =
\n\
if ( !processingEffect && charCodeDictionary[currentMode] && charCodeDictionary[currentMode][str] )\n\
return charCodeDictionary[currentMode][str]();\n\
- }\n\
+ }\n\
\n\
- function getDefaultKeyCodeDictionary()\n\
- {\n\
+ function getDefaultKeyCodeDictionary()\n\
+ {\n\
var keyCodeDict = new Object();\n\
\n\
keyCodeDict[SLIDE_MODE] = new Object();\n\
keyCodeDict[INDEX_MODE] = new Object();\n\
\n\
- keyCodeDict[SLIDE_MODE][LEFT_KEY] = function() { return dispatchEffects(-1); };\n\
- keyCodeDict[SLIDE_MODE][RIGHT_KEY] = function() { return dispatchEffects(1); };\n\
- keyCodeDict[SLIDE_MODE][UP_KEY] = function() { return skipEffects(-1); };\n\
- keyCodeDict[SLIDE_MODE][DOWN_KEY] = function() { return skipEffects(1); };\n\
- keyCodeDict[SLIDE_MODE][PAGE_UP_KEY] = function() { return switchSlide( -1, true ); };\n\
- keyCodeDict[SLIDE_MODE][PAGE_DOWN_KEY] = function() { return switchSlide( 1, true ); };\n\
- keyCodeDict[SLIDE_MODE][HOME_KEY] = function() { return aSlideShow.displaySlide( 0, true ); };\n\
- keyCodeDict[SLIDE_MODE][END_KEY] = function() { return aSlideShow.displaySlide( theMetaDoc.nNumberOfSlides - 1, true ); };\n\
- keyCodeDict[SLIDE_MODE][SPACE_KEY] = function() { return dispatchEffects(1); };\n\
-\n\
- keyCodeDict[INDEX_MODE][LEFT_KEY] = function() { return indexSetPageSlide( theSlideIndexPage.selectedSlideIndex - 1 ); };\n\
- keyCodeDict[INDEX_MODE][RIGHT_KEY] = function() { return indexSetPageSlide( theSlideIndexPage.selectedSlideIndex + 1 ); };\n\
- keyCodeDict[INDEX_MODE][UP_KEY] = function() { return indexSetPageSlide( theSlideIndexPage.selectedSlideIndex - theSlideIndexPage.indexColumns ); };\n\
- keyCodeDict[INDEX_MODE][DOWN_KEY] = function() { return indexSetPageSlide( theSlideIndexPage.selectedSlideIndex + theSlideIndexPage.indexColumns ); };\n\
- keyCodeDict[INDEX_MODE][PAGE_UP_KEY] = function() { return indexSetPageSlide( theSlideIndexPage.selectedSlideIndex - theSlideIndexPage.getTotalThumbnails() ); };\n\
- keyCodeDict[INDEX_MODE][PAGE_DOWN_KEY] = function() { return indexSetPageSlide( theSlideIndexPage.selectedSlideIndex + theSlideIndexPage.getTotalThumbnails() ); };\n\
- keyCodeDict[INDEX_MODE][HOME_KEY] = function() { return indexSetPageSlide( 0 ); };\n\
- keyCodeDict[INDEX_MODE][END_KEY] = function() { return indexSetPageSlide( theMetaDoc.nNumberOfSlides - 1 ); };\n\
- keyCodeDict[INDEX_MODE][ENTER_KEY] = function() { return toggleSlideIndex(); };\n\
- keyCodeDict[INDEX_MODE][SPACE_KEY] = function() { return toggleSlideIndex(); };\n\
- keyCodeDict[INDEX_MODE][ESCAPE_KEY] = function() { return abandonIndexMode(); };\n\
+ keyCodeDict[SLIDE_MODE][LEFT_KEY]\n\
+ = function() { return dispatchEffects(-1); };\n\
+ keyCodeDict[SLIDE_MODE][RIGHT_KEY]\n\
+ = function() { return dispatchEffects(1); };\n\
+ keyCodeDict[SLIDE_MODE][UP_KEY]\n\
+ = function() { return skipEffects(-1); };\n\
+ keyCodeDict[SLIDE_MODE][DOWN_KEY]\n\
+ = function() { return skipEffects(1); };\n\
+ keyCodeDict[SLIDE_MODE][PAGE_UP_KEY]\n\
+ = function() { return switchSlide( -1, true ); };\n\
+ keyCodeDict[SLIDE_MODE][PAGE_DOWN_KEY]\n\
+ = function() { return switchSlide( 1, true ); };\n\
+ keyCodeDict[SLIDE_MODE][HOME_KEY]\n\
+ = function() { return aSlideShow.displaySlide( 0, true ); };\n\
+ keyCodeDict[SLIDE_MODE][END_KEY]\n\
+ = function() { return aSlideShow.displaySlide( theMetaDoc.nNumberOfSlides - 1, true ); };\n\
+ keyCodeDict[SLIDE_MODE][SPACE_KEY]\n\
+ = function() { return dispatchEffects(1); };\n\
+\n\
+ keyCodeDict[INDEX_MODE][LEFT_KEY]\n\
+ = function() { return indexSetPageSlide( theSlideIndexPage.selectedSlideIndex - 1 ); };\n\
+ keyCodeDict[INDEX_MODE][RIGHT_KEY]\n\
+ = function() { return indexSetPageSlide( theSlideIndexPage.selectedSlideIndex + 1 ); };\n\
+ keyCodeDict[INDEX_MODE][UP_KEY]\n\
+ = function() { return indexSetPageSlide( theSlideIndexPage.selectedSlideIndex - theSlideIndexPage.indexColumns ); };\n\
+ keyCodeDict[INDEX_MODE][DOWN_KEY]\n\
+ = function() { return indexSetPageSlide( theSlideIndexPage.selectedSlideIndex + theSlideIndexPage.indexColumns ); };\n\
+ keyCodeDict[INDEX_MODE][PAGE_UP_KEY]\n\
+ = function() { return indexSetPageSlide( theSlideIndexPage.selectedSlideIndex - theSlideIndexPage.getTotalThumbnails() ); };\n\
+ keyCodeDict[INDEX_MODE][PAGE_DOWN_KEY]\n\
+ = function() { return indexSetPageSlide( theSlideIndexPage.selectedSlideIndex + theSlideIndexPage.getTotalThumbnails() ); };\n\
+ keyCodeDict[INDEX_MODE][HOME_KEY]\n\
+ = function() { return indexSetPageSlide( 0 ); };\n\
+ keyCodeDict[INDEX_MODE][END_KEY]\n\
+ = function() { return indexSetPageSlide( theMetaDoc.nNumberOfSlides - 1 ); };\n\
+ keyCodeDict[INDEX_MODE][ENTER_KEY]\n\
+ = function() { return toggleSlideIndex(); };\n\
+ keyCodeDict[INDEX_MODE][SPACE_KEY]\n\
+ = function() { return toggleSlideIndex(); };\n\
+ keyCodeDict[INDEX_MODE][ESCAPE_KEY]\n\
+ = function() { return abandonIndexMode(); };\n\
\n\
return keyCodeDict;\n\
- }\n\
+ }\n\
\n\
- function getDefaultCharCodeDictionary()\n\
- {\n\
+ function getDefaultCharCodeDictionary()\n\
+ {\n\
var charCodeDict = new Object();\n\
\n\
charCodeDict[SLIDE_MODE] = new Object();\n\
charCodeDict[INDEX_MODE] = new Object();\n\
\n\
- charCodeDict[SLIDE_MODE]['i'] = function () { return toggleSlideIndex(); };\n\
+ charCodeDict[SLIDE_MODE]['i']\n\
+ = function () { return toggleSlideIndex(); };\n\
\n\
- charCodeDict[INDEX_MODE]['i'] = function () { return toggleSlideIndex(); };\n\
- charCodeDict[INDEX_MODE]['-'] = function () { return theSlideIndexPage.decreaseNumberOfColumns(); };\n\
- charCodeDict[INDEX_MODE]['='] = function () { return theSlideIndexPage.increaseNumberOfColumns(); };\n\
- charCodeDict[INDEX_MODE]['+'] = function () { return theSlideIndexPage.increaseNumberOfColumns(); };\n\
- charCodeDict[INDEX_MODE]['0'] = function () { return theSlideIndexPage.resetNumberOfColumns(); };\n\
+ charCodeDict[INDEX_MODE]['i']\n\
+ = function () { return toggleSlideIndex(); };\n\
+ charCodeDict[INDEX_MODE]['-']\n\
+ = function () { return theSlideIndexPage.decreaseNumberOfColumns(); };\n\
+ charCodeDict[INDEX_MODE]['=']\n\
+ = function () { return theSlideIndexPage.increaseNumberOfColumns(); };\n\
+ charCodeDict[INDEX_MODE]['+']\n\
+ = function () { return theSlideIndexPage.increaseNumberOfColumns(); };\n\
+ charCodeDict[INDEX_MODE]['0']\n\
+ = function () { return theSlideIndexPage.resetNumberOfColumns(); };\n\
\n\
return charCodeDict;\n\
- }\n\
+ }\n\
\n\
\n\
- function slideOnMouseDown( aEvt )\n\
- {\n\
+ function slideOnMouseDown( aEvt )\n\
+ {\n\
if (!aEvt)\n\
aEvt = window.event;\n\
\n\
@@ -1381,11 +227,15 @@ static const char aSVGScript6[] =
\n\
if( 0 != nOffset )\n\
dispatchEffects( nOffset );\n\
- }\n\
+ }\n\
\n\
- function slideOnMouseWheel(aEvt)\n\
- {\n\
+ function slideOnMouseWheel(aEvt)\n\
+ {\n\
var delta = 0;\n\
+";
+
+static const char aSVGScript1[] =
+"\
\n\
if (!aEvt)\n\
aEvt = window.event;\n\
@@ -1408,17 +258,18 @@ static const char aSVGScript6[] =
aEvt.preventDefault();\n\
\n\
aEvt.returnValue = false;\n\
- }\n\
+ }\n\
\n\
- if( window.addEventListener )\n\
- {\n\
+ if( window.addEventListener )\n\
+ {\n\
window.addEventListener( 'DOMMouseScroll', function( aEvt ) { return mouseHandlerDispatch( aEvt, MOUSE_WHEEL ); }, false );\n\
- }\n\
+ }\n\
\n\
- window.onmousewheel = function( aEvt ) { return mouseHandlerDispatch( aEvt, MOUSE_WHEEL ); };\n\
+ window.onmousewheel\n\
+ = function( aEvt ) { return mouseHandlerDispatch( aEvt, MOUSE_WHEEL ); };\n\
\n\
- function mouseHandlerDispatch( aEvt, anAction )\n\
- {\n\
+ function mouseHandlerDispatch( aEvt, anAction )\n\
+ {\n\
if( !aEvt )\n\
aEvt = window.event;\n\
\n\
@@ -1438,5977 +289,7174 @@ static const char aSVGScript6[] =
aEvt.returnValue = retVal;\n\
\n\
return retVal;\n\
- }\n\
+ }\n\
\n\
- document.onmousedown = function( aEvt ) { return mouseHandlerDispatch( aEvt, MOUSE_DOWN ); };\n\
+ document.onmousedown = function( aEvt ) { return mouseHandlerDispatch( aEvt, MOUSE_DOWN ); };\n\
\n\
- function getDefaultMouseHandlerDictionary()\n\
- {\n\
+ function getDefaultMouseHandlerDictionary()\n\
+ {\n\
var mouseHandlerDict = new Object();\n\
\n\
mouseHandlerDict[SLIDE_MODE] = new Object();\n\
mouseHandlerDict[INDEX_MODE] = new Object();\n\
\n\
+ mouseHandlerDict[SLIDE_MODE][MOUSE_DOWN]\n\
+ = function( aEvt ) { return slideOnMouseDown( aEvt ); };\n\
+ mouseHandlerDict[SLIDE_MODE][MOUSE_WHEEL]\n\
+ = function( aEvt ) { return slideOnMouseWheel( aEvt ); };\n\
\n\
- mouseHandlerDict[SLIDE_MODE][MOUSE_DOWN] = function( aEvt ) { return slideOnMouseDown( aEvt ); };\n\
- mouseHandlerDict[SLIDE_MODE][MOUSE_WHEEL] = function( aEvt ) { return slideOnMouseWheel( aEvt ); };\n\
-\n\
- mouseHandlerDict[INDEX_MODE][MOUSE_DOWN] = function( aEvt ) { return toggleSlideIndex(); };\n\
+ mouseHandlerDict[INDEX_MODE][MOUSE_DOWN]\n\
+ = function( aEvt ) { return toggleSlideIndex(); };\n\
\n\
return mouseHandlerDict;\n\
+ }\n\
+\n\
+ function indexSetPageSlide( nIndex )\n\
+ {\n\
+ var aMetaSlideSet = theMetaDoc.aMetaSlideSet;\n\
+ nIndex = getSafeIndex( nIndex, 0, aMetaSlideSet.length - 1 );\n\
+\n\
+ var nSelectedThumbnailIndex = nIndex % theSlideIndexPage.getTotalThumbnails();\n\
+ var offset = nIndex - nSelectedThumbnailIndex;\n\
+\n\
+ if( offset < 0 )\n\
+ offset = 0;\n\
+\n\
+ if( offset != INDEX_OFFSET )\n\
+ {\n\
+ INDEX_OFFSET = offset;\n\
+ displayIndex( INDEX_OFFSET );\n\
+ }\n\
+\n\
+ theSlideIndexPage.setSelection( nSelectedThumbnailIndex );\n\
+ }\n\
+\n\
+\n\
+ /*****\n\
+ * @jessyinkend\n\
+ *\n\
+ * The above code is a derivative work of some parts of the JessyInk project.\n\
+ * @source http://code.google.com/p/jessyink/\n\
+ */\n\
+\n\
+\n\
+ /*****\n\
+ * @licstart\n\
+ *\n\
+ * The following is the license notice for the part of JavaScript code of this\n\
+ * page included between the '@stdlibstart' and the '@stdlibend' notes.\n\
+ */\n\
+\n\
+ /***** ******************************************************************\n\
+ *\n\
+ * Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009\n\
+ * Free Software Foundation, Inc.\n\
+ *\n\
+ * The code included between the start note '@stdlibstart' and the end\n\
+ * note '@stdlibend' is a derivative work of the GNU ISO C++ Library.\n\
+ * This library is free software; you can redistribute it and/or modify\n\
+ * it under the terms of the GNU General Public License as published by\n\
+ * the Free Software Foundation; either version 3, or (at your option)\n\
+ * any later version.\n\
+ *\n\
+ * This library is distributed in the hope that it will be useful,\n\
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\n\
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n\
+ * GNU General Public License for more details.\n\
+ *\n\
+ * Under Section 7 of GPL version 3, you are granted additional\n\
+ * permissions described in the GCC Runtime Library Exception, version\n\
+ * 3.1, as published by the Free Software Foundation.\n\
+ *\n\
+ * You should have received a copy of the GNU General Public License and\n\
+ * a copy of the GCC Runtime Library Exception along with this program;\n\
+ * see the files COPYING3 and COPYING.RUNTIME respectively. If not, see\n\
+ * <http://www.gnu.org/licenses/>.\n\
+ *\n\
+ *************************************************************************/\n\
+\n\
+ /*****\n\
+ *\n\
+ * Copyright (c) 1994\n\
+ * Hewlett-Packard Company\n\
+ *\n\
+ * Permission to use, copy, modify, distribute and sell this software\n\
+ * and its documentation for any purpose is hereby granted without fee,\n\
+ * provided that the above copyright notice appear in all copies and\n\
+ * that both that copyright notice and this permission notice appear\n\
+ * in supporting documentation. Hewlett-Packard Company makes no\n\
+ * representations about the suitability of this software for any\n\
+ * purpose. It is provided 'as is' without express or implied warranty.\n\
+ *\n\
+ *\n\
+ * Copyright (c) 1996,1997\n\
+ * Silicon Graphics Computer Systems, Inc.\n\
+ *\n\
+ * Permission to use, copy, modify, distribute and sell this software\n\
+ * and its documentation for any purpose is hereby granted without fee,\n\
+ * provided that the above copyright notice appear in all copies and\n\
+ * that both that copyright notice and this permission notice appear\n\
+ * in supporting documentation. Silicon Graphics makes no\n\
+ * representations about the suitability of this software for any\n\
+ * purpose. It is provided 'as is' without express or implied warranty.\n\
+ *\n\
+ ************************************************************************/\n\
+\n\
+ /*****\n\
+ * @licend\n\
+ *\n\
+ * The above is the license notice for the part of JavaScript code of this\n\
+ * page included between the '@stdlibstart' and the '@stdlibend' notes.\n\
+ */\n\
+\n\
+\n\
+ /*****\n\
+ * @stdlibstart\n\
+ *\n\
+ * The following code is a porting, performed on August 2011, of a part of\n\
+ * the C++ code included into the source file stl_queue.h that is part of\n\
+ * the GNU ISO C++ Library.\n\
+ */\n\
+\n\
+\n\
+ function PriorityQueue( aCompareFunc )\n\
+ {\n\
+ this.aSequence = new Array();\n\
+ this.aCompareFunc = aCompareFunc;\n\
+ }\n\
+\n\
+ PriorityQueue.prototype.top = function()\n\
+ {\n\
+ return this.aSequence[0];\n\
+ };\n\
+\n\
+ PriorityQueue.prototype.isEmpty = function()\n\
+ {\n\
+ return ( this.size() === 0 );\n\
+ };\n\
+\n\
+ PriorityQueue.prototype.size = function()\n\
";
-static const char aSVGScript7[] =
+static const char aSVGScript2[] =
"\
- }\n\
-\n\
- function dispatchEffects(dir)\n\
- {\n\
-\n\
- if( dir == 1 )\n\
- {\n\
- var bRet = aSlideShow.nextEffect();\n\
-\n\
- if( !bRet )\n\
- {\n\
- switchSlide( 1 );\n\
- }\n\
- }\n\
- else\n\
- {\n\
- switchSlide( dir );\n\
- }\n\
- }\n\
-\n\
- function skipEffects(dir)\n\
- {\n\
- switchSlide(dir);\n\
- }\n\
-\n\
- function switchSlide( nOffset, bSkipTransition )\n\
- {\n\
- var nNextSlide = nCurSlide + nOffset;\n\
- aSlideShow.displaySlide( nNextSlide, bSkipTransition );\n\
- }\n\
-\n\
- function displayIndex( offsetNumber )\n\
- {\n\
- var aMetaSlideSet = theMetaDoc.aMetaSlideSet;\n\
- offsetNumber = getSafeIndex( offsetNumber, 0, aMetaSlideSet.length - 1 );\n\
-\n\
- var nTotalThumbnails = theSlideIndexPage.getTotalThumbnails();\n\
- var nEnd = Math.min( offsetNumber + nTotalThumbnails, aMetaSlideSet.length);\n\
-\n\
- var aThumbnailSet = theSlideIndexPage.aThumbnailSet;\n\
- var j = 0;\n\
- for( var i = offsetNumber; i < nEnd; ++i, ++j )\n\
- {\n\
- aThumbnailSet[j].update( i );\n\
- aThumbnailSet[j].show();\n\
- }\n\
- for( ; j < nTotalThumbnails; ++j )\n\
- {\n\
- aThumbnailSet[j].hide();\n\
- }\n\
-\n\
- if (INDEX_OFFSET != offsetNumber)\n\
- INDEX_OFFSET = offsetNumber;\n\
- }\n\
-\n\
- function slideSetActiveSlide( nNewSlide )\n\
- {\n\
- var aMetaDoc = theMetaDoc;\n\
- var nSlides = aMetaDoc.nNumberOfSlides;\n\
- if( nNewSlide < 0 && nSlides > 0 )\n\
- nNewSlide = nSlides - 1;\n\
- else if( nNewSlide >= nSlides )\n\
- nNewSlide = 0;\n\
-\n\
- if( nNewSlide == nCurSlide ) return;\n\
- var nOldSlide = nCurSlide;\n\
- nCurSlide = nNewSlide;\n\
-\n\
- var oldMetaSlide = aMetaDoc.aMetaSlideSet[nOldSlide];\n\
- var newMetaSlide = aMetaDoc.aMetaSlideSet[nNewSlide];\n\
-\n\
- oldMetaSlide.hide();\n\
- newMetaSlide.show();\n\
- }\n\
-\n\
- function indexSetPageSlide( nIndex )\n\
- {\n\
- var aMetaSlideSet = theMetaDoc.aMetaSlideSet;\n\
- nIndex = getSafeIndex( nIndex, 0, aMetaSlideSet.length - 1 );\n\
-\n\
- var nSelectedThumbnailIndex = nIndex % theSlideIndexPage.getTotalThumbnails();\n\
- var offset = nIndex - nSelectedThumbnailIndex;\n\
-\n\
- if( offset < 0 )\n\
- offset = 0;\n\
-\n\
- if( offset != INDEX_OFFSET )\n\
- {\n\
- INDEX_OFFSET = offset;\n\
- displayIndex( INDEX_OFFSET );\n\
- }\n\
-\n\
- theSlideIndexPage.setSelection( nSelectedThumbnailIndex );\n\
- }\n\
-\n\
- function toggleSlideIndex()\n\
- {\n\
- var suspendHandle = ROOT_NODE.suspendRedraw(500);\n\
- var aMetaSlideSet = theMetaDoc.aMetaSlideSet;\n\
-\n\
- if (currentMode == SLIDE_MODE)\n\
- {\n\
- aMetaSlideSet[nCurSlide].hide();\n\
- for( var counter = 0; counter < aMetaSlideSet.length; ++counter )\n\
- {\n\
- checkElemAndSetAttribute( aMetaSlideSet[counter].slideElement, 'visibility', 'inherit' );\n\
- aMetaSlideSet[counter].masterPage.setVisibilityBackground( INHERIT );\n\
- aMetaSlideSet[counter].masterPage.setVisibility( INHERIT );\n\
- }\n\
- INDEX_OFFSET = -1;\n\
- indexSetPageSlide( nCurSlide );\n\
- theSlideIndexPage.show();\n\
- currentMode = INDEX_MODE;\n\
- }\n\
- else if (currentMode == INDEX_MODE)\n\
- {\n\
- theSlideIndexPage.hide();\n\
- var nNewSlide = theSlideIndexPage.selectedSlideIndex;\n\
-\n\
- for( var counter = 0; counter < aMetaSlideSet.length; ++counter )\n\
- {\n\
- var aMetaSlide = aMetaSlideSet[counter];\n\
- aMetaSlide.slideElement.setAttribute( 'visibility', 'hidden' );\n\
- aMetaSlide.masterPage.setVisibilityBackground( HIDDEN );\n\
- aMetaSlide.masterPage.setVisibility( HIDDEN );\n\
- }\n\
-\n\
- aSlideShow.displaySlide( nNewSlide, true );\n\
-\n\
- currentMode = SLIDE_MODE;\n\
- }\n\
-\n\
- ROOT_NODE.unsuspendRedraw(suspendHandle);\n\
- ROOT_NODE.forceRedraw();\n\
- }\n\
-\n\
- function abandonIndexMode()\n\
- {\n\
- theSlideIndexPage.selectedSlideIndex = nCurSlide;\n\
- toggleSlideIndex();\n\
- }\n\
-\n\
-\n\
-\n\
-\n\
-\n\
-\n\
-function AA() {}\n\
-function ANIMATIONS_ANIMATIONS_ANIMATIONS_() {}\n\
-function ZZ() {}\n\
-\n\
-\n\
-\n\
-\n\
-\n\
-\n\
-\n\
-\n\
-\n\
- var CURR_UNIQUE_ID = 0;\n\
-\n\
- function getUniqueId()\n\
- {\n\
- ++CURR_UNIQUE_ID;\n\
- return CURR_UNIQUE_ID;\n\
- }\n\
-\n\
- function mem_fn( sMethodName )\n\
- {\n\
- return function( aObject )\n\
- {\n\
- var aMethod = aObject[ sMethodName ];\n\
- if( aMethod )\n\
- aMethod.call( aObject );\n\
- else\n\
- log( 'method sMethodName not found' );\n\
- };\n\
- }\n\
-\n\
- function bind( aObject, aMethod )\n\
- {\n\
- return function()\n\
- {\n\
- return aMethod.call( aObject, arguments[0] );\n\
- };\n\
- }\n\
-\n\
- function getCurrentSystemTime()\n\
- {\n\
- return ( new Date() ).getTime();\n\
- }\n\
-\n\
- function getSlideAnimationsRoot( sSlideId )\n\
- {\n\
- return theMetaDoc.aSlideAnimationsMap[ sSlideId ];\n\
- }\n\
-\n\
- function getElementChildren( aElement )\n\
- {\n\
- var aChildrenArray = new Array();\n\
+ {\n\
+ return this.aSequence.length;\n\
+ };\n\
+\n\
+ PriorityQueue.prototype.push = function( aValue )\n\
+ {\n\
+ this.implPushHeap( 0, this.aSequence.length, 0, aValue );\n\
+ };\n\
+\n\
+ PriorityQueue.prototype.clear = function()\n\
+ {\n\
+ return this.aSequence = new Array();\n\
+ };\n\
+\n\
+\n\
+ PriorityQueue.prototype.pop = function()\n\
+ {\n\
+ if( this.isEmpty() )\n\
+ return;\n\
+\n\
+ var nLast = this.aSequence.length - 1;\n\
+ var aValue = this.aSequence[ nLast ];\n\
+ this.aSequence[ nLast ] = this.aSequence[ 0 ];\n\
+ this.implAdjustHeap( 0, 0, nLast, aValue );\n\
+ this.aSequence.pop();\n\
+ };\n\
+\n\
+ PriorityQueue.prototype.implAdjustHeap = function( nFirst, nHoleIndex, nLength, aValue )\n\
+ {\n\
+ var nTopIndex = nHoleIndex;\n\
+ var nSecondChild = nHoleIndex;\n\
+\n\
+ while( nSecondChild < Math.floor( ( nLength - 1 ) / 2 ) )\n\
+ {\n\
+ nSecondChild = 2 * ( nSecondChild + 1 );\n\
+ if( this.aCompareFunc( this.aSequence[ nFirst + nSecondChild ],\n\
+ this.aSequence[ nFirst + nSecondChild - 1] ) )\n\
+ {\n\
+ --nSecondChild;\n\
+ }\n\
+ this.aSequence[ nFirst + nHoleIndex ] = this.aSequence[ nFirst + nSecondChild ];\n\
+ nHoleIndex = nSecondChild;\n\
+ }\n\
+\n\
+ if( ( ( nLength & 1 ) === 0 ) && ( nSecondChild === Math.floor( ( nLength - 2 ) / 2 ) ) )\n\
+ {\n\
+ nSecondChild = 2 * ( nSecondChild + 1 );\n\
+ this.aSequence[ nFirst + nHoleIndex ] = this.aSequence[ nFirst + nSecondChild - 1];\n\
+ nHoleIndex = nSecondChild - 1;\n\
+ }\n\
+\n\
+ this.implPushHeap( nFirst, nHoleIndex, nTopIndex, aValue );\n\
+ };\n\
+\n\
+ PriorityQueue.prototype.implPushHeap = function( nFirst, nHoleIndex, nTopIndex, aValue )\n\
+ {\n\
+ var nParent = Math.floor( ( nHoleIndex - 1 ) / 2 );\n\
+\n\
+ while( ( nHoleIndex > nTopIndex ) &&\n\
+ this.aCompareFunc( this.aSequence[ nFirst + nParent ], aValue ) )\n\
+ {\n\
+ this.aSequence[ nFirst + nHoleIndex ] = this.aSequence[ nFirst + nParent ];\n\
+ nHoleIndex = nParent;\n\
+ nParent = Math.floor( ( nHoleIndex - 1 ) / 2 );\n\
+ }\n\
+ this.aSequence[ nFirst + nHoleIndex ] = aValue;\n\
+ };\n\
+\n\
+\n\
+ /*****\n\
+ * @stdlibend\n\
+ *\n\
+ * The above code is a porting, performed on August 2011, of a part of\n\
+ * the C++ code included into the source file stl_queue.h that is part of\n\
+ * the GNU ISO C++ Library.\n\
+ */\n\
+\n\
+\n\
+ /*****\n\
+ * @licstart\n\
+ *\n\
+ * The following is the license notice for the part of JavaScript code of\n\
+ * this page included between the '@libreofficestart' and the '@libreofficeend'\n\
+ * notes.\n\
+ */\n\
+\n\
+ /***** ******************************************************************\n\
+ *\n\
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.\n\
+ *\n\
+ * Copyright 2000, 2010 Oracle and/or its affiliates.\n\
+ *\n\
+ * OpenOffice.org - a multi-platform office productivity suite\n\
+ *\n\
+ * This file is part of OpenOffice.org.\n\
+ *\n\
+ * OpenOffice.org is free software: you can redistribute it and/or modify\n\
+ * it under the terms of the GNU Lesser General Public License version 3\n\
+ * only, as published by the Free Software Foundation.\n\
+ *\n\
+ * OpenOffice.org is distributed in the hope that it will be useful,\n\
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\n\
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n\
+ * GNU Lesser General Public License version 3 for more details\n\
+ * (a copy is included in the LICENSE file that accompanied this code).\n\
+ *\n\
+ * You should have received a copy of the GNU Lesser General Public License\n\
+ * version 3 along with OpenOffice.org. If not, see\n\
+ * <http://www.openoffice.org/license.html>\n\
+ * for a copy of the LGPLv3 License.\n\
+ *\n\
+ ************************************************************************/\n\
+\n\
+ /*****\n\
+ * @licend\n\
+ *\n\
+ * The above is the license notice for the part of JavaScript code of\n\
+ * this page included between the '@libreofficestart' and the '@libreofficeend'\n\
+ * notes.\n\
+ */\n\
+\n\
+\n\
+ /*****\n\
+ * @libreofficestart\n\
+ *\n\
+ * Several parts of the following code are the result of the porting,\n\
+ * started on August 2011, of the C++ code included in the source files\n\
+ * placed under the folder '/slideshow/source' and subfolders.\n\
+ * @source http://cgit.freedesktop.org/libreoffice/core/tree/slideshow/source\n\
+ *\n\
+ */\n\
+\n\
+\n\
+ window.onload = init;\n\
+\n\
+\n\
+ var aOOOElemMetaSlides = 'ooo:meta_slides';\n\
+ var aOOOElemMetaSlide = 'ooo:meta_slide';\n\
+ var aOOOElemTextField = 'ooo:text_field';\n\
+\n\
+ var aOOOAttrNumberOfSlides = 'number-of-slides';\n\
+ var aOOOAttrNumberingType = 'page-numbering-type';\n\
+\n\
+ var aOOOAttrSlide = 'slide';\n\
+ var aOOOAttrMaster = 'master';\n\
+ var aOOOAttrBackgroundVisibility = 'background-visibility';\n\
+ var aOOOAttrMasterObjectsVisibility = 'master-objects-visibility';\n\
+ var aOOOAttrPageNumberVisibility = 'page-number-visibility';\n\
+ var aOOOAttrDateTimeVisibility = 'date-time-visibility';\n\
+ var aOOOAttrFooterVisibility = 'footer-visibility';\n\
+ var aOOOAttrHeaderVisibility = 'header-visibility';\n\
+ var aOOOAttrDateTimeField = 'date-time-field';\n\
+ var aOOOAttrFooterField = 'footer-field';\n\
+ var aOOOAttrHeaderField = 'header-field';\n\
+\n\
+ var aOOOAttrDateTimeFormat = 'date-time-format';\n\
+\n\
+ var aOOOAttrTextAdjust = 'text-adjust';\n\
+\n\
+ var aSlideNumberClassName = 'Slide_Number';\n\
+ var aDateTimeClassName = 'Date/Time';\n\
+ var aFooterClassName = 'Footer';\n\
+ var aHeaderClassName = 'Header';\n\
+\n\
+ var NSS = new Object();\n\
+ NSS['svg']='http://www.w3.org/2000/svg';\n\
+ NSS['rdf']='http://www.w3.org/1999/02/22-rdf-syntax-ns#';\n\
+ NSS['xlink']='http://www.w3.org/1999/xlink';\n\
+ NSS['xml']='http://www.w3.org/XML/1998/namespace';\n\
+ NSS['ooo'] = 'http://xml.openoffice.org/svg/export';\n\
+\n\
+ var SLIDE_MODE = 1;\n\
+ var INDEX_MODE = 2;\n\
+\n\
+ var MOUSE_UP = 1;\n\
+ var MOUSE_DOWN = 2;\n\
+ var MOUSE_MOVE = 3;\n\
+ var MOUSE_WHEEL = 4;\n\
+\n\
+ var LEFT_KEY = 37; // cursor left keycode\n\
+ var UP_KEY = 38; // cursor up keycode\n\
+ var RIGHT_KEY = 39; // cursor right keycode\n\
+ var DOWN_KEY = 40; // cursor down keycode\n\
+ var PAGE_UP_KEY = 33; // page up keycode\n\
+ var PAGE_DOWN_KEY = 34; // page down keycode\n\
+ var HOME_KEY = 36; // home keycode\n\
+ var END_KEY = 35; // end keycode\n\
+ var ENTER_KEY = 13;\n\
+ var SPACE_KEY = 32;\n\
+ var ESCAPE_KEY = 27;\n\
+\n\
+ var HIDDEN = 0;\n\
+ var VISIBLE = 1;\n\
+ var INHERIT = 2;\n\
+ var aVisibilityAttributeValue = [ 'hidden', 'visible', 'inherit' ];\n\
+ var aVisibilityValue = { 'hidden' : HIDDEN, 'visible' : VISIBLE, 'inherit' : INHERIT };\n\
+\n\
+ var ROOT_NODE = document.getElementsByTagNameNS( NSS['svg'], 'svg' )[0];\n\
+ var WIDTH = 0;\n\
+ var HEIGHT = 0;\n\
";
-static const char aSVGScript8[] =
+static const char aSVGScript3[] =
+"\
+ var INDEX_COLUMNS_DEFAULT = 3;\n\
+ var INDEX_OFFSET = 0;\n\
+\n\
+ var theMetaDoc;\n\
+ var theSlideIndexPage;\n\
+ var currentMode = SLIDE_MODE;\n\
+ var processingEffect = false;\n\
+ var nCurSlide = 0;\n\
+\n\
+ var charCodeDictionary = getDefaultCharCodeDictionary();\n\
+ var keyCodeDictionary = getDefaultKeyCodeDictionary();\n\
+\n\
+ var mouseHandlerDictionary = getDefaultMouseHandlerDictionary();\n\
+\n\
+\n\
+ function object( aObject )\n\
+ {\n\
+ var F = function() {};\n\
+ F.prototype = aObject;\n\
+ return new F();\n\
+ }\n\
+\n\
+\n\
+ function extend( aSubType, aSuperType )\n\
+ {\n\
+ if (!aSuperType || !aSubType)\n\
+ {\n\
+ alert('extend failed, verify dependencies');\n\
+ }\n\
+ var OP = Object.prototype;\n\
+ var sp = aSuperType.prototype;\n\
+ var rp = object( sp );\n\
+ aSubType.prototype = rp;\n\
+\n\
+ rp.constructor = aSubType;\n\
+ aSubType.superclass = sp;\n\
+\n\
+ if (aSuperType != Object && sp.constructor == OP.constructor)\n\
+ {\n\
+ sp.constructor = aSuperType;\n\
+ }\n\
+\n\
+ return aSubType;\n\
+ }\n\
+\n\
+\n\
+ function instantiate( TemplateClass, BaseType )\n\
+ {\n\
+ if( !TemplateClass.instanceSet )\n\
+ TemplateClass.instanceSet = new Array();\n\
+\n\
+ var nSize = TemplateClass.instanceSet.length;\n\
+\n\
+ for( var i = 0; i < nSize; ++i )\n\
+ {\n\
+ if( TemplateClass.instanceSet[i].base === BaseType )\n\
+ return TemplateClass.instanceSet[i].instance;\n\
+ }\n\
+\n\
+ TemplateClass.instanceSet[ nSize ] = new Object();\n\
+ TemplateClass.instanceSet[ nSize ].base = BaseType;\n\
+ TemplateClass.instanceSet[ nSize ].instance = TemplateClass( BaseType );\n\
+\n\
+ return TemplateClass.instanceSet[ nSize ].instance;\n\
+ };\n\
+\n\
+\n\
+ function Rectangle( aSVGRectElem )\n\
+ {\n\
+ var x = parseInt( aSVGRectElem.getAttribute( 'x' ) );\n\
+ var y = parseInt( aSVGRectElem.getAttribute( 'y' ) );\n\
+ var width = parseInt( aSVGRectElem.getAttribute( 'width' ) );\n\
+ var height = parseInt( aSVGRectElem.getAttribute( 'height' ) );\n\
+\n\
+ this.left = x;\n\
+ this.right = x + width;\n\
+ this.top = y;\n\
+ this.bottom = y + height;\n\
+ }\n\
+\n\
+ function log( message )\n\
+ {\n\
+ if( typeof console == 'object' )\n\
+ {\n\
+ console.log( message );\n\
+ }\n\
+ else if( typeof opera == 'object' )\n\
+ {\n\
+ opera.postError( message );\n\
+ }\n\
+ else if( typeof java == 'object' && typeof java.lang == 'object' )\n\
+ {\n\
+ java.lang.System.out.println( message );\n\
+ }\n\
+ }\n\
+\n\
+ function getNSAttribute( sNSPrefix, aElem, sAttrName )\n\
+ {\n\
+ if( !aElem ) return null;\n\
+ if( aElem.hasAttributeNS( NSS[sNSPrefix], sAttrName ) )\n\
+ {\n\
+ return aElem.getAttributeNS( NSS[sNSPrefix], sAttrName );\n\
+ }\n\
+ return null;\n\
+ }\n\
+\n\
+ function getOOOAttribute( aElem, sAttrName )\n\
+ {\n\
+ return getNSAttribute( 'ooo', aElem, sAttrName );\n\
+ }\n\
+\n\
+ function setNSAttribute( sNSPrefix, aElem, sAttrName, aValue )\n\
+ {\n\
+ if( !aElem ) return false;\n\
+ if( 'setAttributeNS' in aElem )\n\
+ {\n\
+ aElem.setAttributeNS( NSS[sNSPrefix], sAttrName, aValue );\n\
+ return true;\n\
+ }\n\
+ else\n\
+ {\n\
+ aElem.setAttribute(sNSPrefix + ':' + sAttrName, aValue );\n\
+ return true;\n\
+ }\n\
+ }\n\
+\n\
+ function setOOOAttribute( aElem, sAttrName, aValue )\n\
+ {\n\
+ return setNSAttribute( 'ooo', aElem, sAttrName, aValue );\n\
+ }\n\
+\n\
+ function checkElemAndSetAttribute( aElem, sAttrName, aValue )\n\
+ {\n\
+ if( aElem )\n\
+ aElem.setAttribute( sAttrName, aValue );\n\
+ }\n\
+\n\
+ function getElementsByClassName( aElem, sClassName )\n\
+ {\n\
+\n\
+ var aElementSet = new Array();\n\
+ if( 'getElementsByClassName' in aElem )\n\
+ {\n\
+ aElementSet = aElem.getElementsByClassName( sClassName );\n\
+ }\n\
+ else\n\
+ {\n\
+ var aElementSetByClassProperty = getElementsByProperty( aElem, 'class' );\n\
+ for( var i = 0; i < aElementSetByClassProperty.length; ++i )\n\
+ {\n\
+ var sAttrClassName = aElementSetByClassProperty[i].getAttribute( 'class' );\n\
+ if( sAttrClassName == sClassName )\n\
+ {\n\
+ aElementSet.push( aElementSetByClassProperty[i] );\n\
+ }\n\
+ }\n\
+ }\n\
+ return aElementSet;\n\
+ }\n\
+\n\
+ function getElementByClassName( aElem, sClassName /*, sTagName */)\n\
+ {\n\
+ var aElementSet = getElementsByClassName( aElem, sClassName );\n\
+ if ( aElementSet.length == 1 )\n\
+ return aElementSet[0];\n\
+ else\n\
+ return null;\n\
+ }\n\
+\n\
+ function getClassAttribute( aElem )\n\
+ {\n\
+ if( aElem )\n\
+ return aElem.getAttribute( 'class' );\n\
+ return '';\n\
+ }\n\
+\n\
+ function initVisibilityProperty( aElement )\n\
+ {\n\
+ var nVisibility = VISIBLE;\n\
+ var sVisibility = aElement.getAttribute( 'visibility' );\n\
+ if( sVisibility ) nVisibility = aVisibilityValue[ sVisibility ];\n\
+ return nVisibility;\n\
+ }\n\
+\n\
+ function setElementVisibility( aElement, nCurrentVisibility, nNewVisibility )\n\
+ {\n\
+ if( nCurrentVisibility != nNewVisibility )\n\
+ {\n\
+ checkElemAndSetAttribute( aElement, 'visibility', aVisibilityAttributeValue[nNewVisibility] );\n\
+ return nNewVisibility;\n\
+ }\n\
+ return nCurrentVisibility;\n\
+ }\n\
+\n\
+ function getSafeIndex( nIndex, nMin, nMax )\n\
+ {\n\
+ if( nIndex < nMin )\n\
+ return nMin;\n\
+ else if( nIndex > nMax )\n\
+ return nMax;\n\
+";
+
+static const char aSVGScript4[] =
+"\
+ else\n\
+ return nIndex;\n\
+ }\n\
+\n\
+\n\
+ function DebugPrinter()\n\
+ {\n\
+ this.bEnabled = false;\n\
+ }\n\
+\n\
+\n\
+ DebugPrinter.prototype.on = function()\n\
+ {\n\
+ this.bEnabled = true;\n\
+ };\n\
+\n\
+ DebugPrinter.prototype.off = function()\n\
+ {\n\
+ this.bEnabled = false;\n\
+ };\n\
+\n\
+ DebugPrinter.prototype.isEnabled = function()\n\
+ {\n\
+ return this.bEnabled;\n\
+ };\n\
+\n\
+ DebugPrinter.prototype.print = function( sMessage, nTime )\n\
+ {\n\
+ if( this.isEnabled() )\n\
+ {\n\
+ sInfo = 'DBG: ' + sMessage;\n\
+ if( nTime )\n\
+ sInfo += ' (at: ' + String( nTime / 1000 ) + 's)';\n\
+ log( sInfo );\n\
+ }\n\
+ };\n\
+\n\
+\n\
+ var NAVDBG = new DebugPrinter();\n\
+ NAVDBG.off();\n\
+\n\
+ var ANIMDBG = new DebugPrinter();\n\
+ ANIMDBG.off();\n\
+\n\
+ var aRegisterEventDebugPrinter = new DebugPrinter();\n\
+ aRegisterEventDebugPrinter.off();\n\
+\n\
+ var aTimerEventQueueDebugPrinter = new DebugPrinter();\n\
+ aTimerEventQueueDebugPrinter.off();\n\
+\n\
+ var aEventMultiplexerDebugPrinter = new DebugPrinter();\n\
+ aEventMultiplexerDebugPrinter.off();\n\
+\n\
+ var aNextEffectEventArrayDebugPrinter = new DebugPrinter();\n\
+ aNextEffectEventArrayDebugPrinter.off();\n\
+\n\
+ var aActivityQueueDebugPrinter = new DebugPrinter();\n\
+ aActivityQueueDebugPrinter.off();\n\
+\n\
+ var aAnimatedElementDebugPrinter = new DebugPrinter();\n\
+ aAnimatedElementDebugPrinter.off();\n\
+\n\
+\n\
+ function MetaDocument( aMetaDocElem )\n\
+ {\n\
+ this.nNumberOfSlides = parseInt( aMetaDocElem.getAttributeNS( NSS['ooo'], aOOOAttrNumberOfSlides ) );\n\
+ assert( typeof this.nNumberOfSlides == 'number' && this.nNumberOfSlides > 0,\n\
+ 'MetaDocument: number of slides is zero or undefined.' );\n\
+ this.startSlideNumber = 0;\n\
+ this.sPageNumberingType = aMetaDocElem.getAttributeNS( NSS['ooo'], aOOOAttrNumberingType ) || 'arabic';\n\
+ this.aMetaSlideSet = new Array();\n\
+ this.aMasterPageSet = new Object();\n\
+ this.aTextFieldSet = new Array();\n\
+ this.slideNumberField = new SlideNumberField( this.sPageNumberingType );\n\
+\n\
+ this.aSlideAnimationsMap = new Object();\n\
+ this.initSlideAnimationsMap();\n\
+\n\
+\n\
+ for( var i = 0; i < this.nNumberOfSlides; ++i )\n\
+ {\n\
+ var sMetaSlideId = aOOOElemMetaSlide + '_' + i;\n\
+ this.aMetaSlideSet.push( new MetaSlide( sMetaSlideId, this ) );\n\
+ }\n\
+ assert( this.aMetaSlideSet.length == this.nNumberOfSlides,\n\
+ 'MetaDocument: aMetaSlideSet.length != nNumberOfSlides.' );\n\
+ this.aMetaSlideSet[ this.startSlideNumber ].show();\n\
+\n\
+ }\n\
+\n\
+ MetaDocument.prototype.initPlaceholderShapes = function()\n\
+ {\n\
+ this.aMetaSlideSet[0].initPlaceholderShapes();\n\
+ };\n\
+\n\
+ MetaDocument.prototype.initSlideAnimationsMap = function()\n\
+ {\n\
+ var aAnimationsSection = document.getElementById( 'presentation-animations' );\n\
+ if( aAnimationsSection )\n\
+ {\n\
+ var aAnimationsDefSet = aAnimationsSection.getElementsByTagName( 'defs' );\n\
+\n\
+ for( var i = 0; i < aAnimationsDefSet.length; ++i )\n\
+ {\n\
+ var sSlideId = aAnimationsDefSet[i].getAttributeNS( NSS['ooo'], aOOOAttrSlide );\n\
+ var aChildSet = getElementChildren( aAnimationsDefSet[i] );\n\
+ if( sSlideId && ( aChildSet.length == 1 ) )\n\
+ {\n\
+ this.aSlideAnimationsMap[ sSlideId ] = aChildSet[0];\n\
+ }\n\
+ }\n\
+ }\n\
+ };\n\
+\n\
+\n\
+ function MetaSlide( sMetaSlideId, aMetaDoc )\n\
+ {\n\
+ this.theDocument = document;\n\
+ this.id = sMetaSlideId;\n\
+ this.theMetaDoc = aMetaDoc;\n\
+ this.element = this.theDocument.getElementById( this.id );\n\
+ assert( this.element, 'MetaSlide: meta_slide element <' + this.id + '> not found.' );\n\
+ this.slideId = this.element.getAttributeNS( NSS['ooo'], aOOOAttrSlide );\n\
+ this.slideElement = this.theDocument.getElementById( this.slideId );\n\
+ assert( this.slideElement, 'MetaSlide: slide element <' + this.slideId + '> not found.' );\n\
+ this.masterPage = this.initMasterPage();\n\
+ this.nAreMasterObjectsVisible = this.initVisibilityProperty( aOOOAttrMasterObjectsVisibility, VISIBLE );\n\
+ this.nIsBackgroundVisible = this.initVisibilityProperty( aOOOAttrBackgroundVisibility, VISIBLE );\n\
+ this.nIsPageNumberVisible = this.initVisibilityProperty( aOOOAttrPageNumberVisibility, HIDDEN );\n\
+ this.nIsDateTimeVisible = this.initVisibilityProperty( aOOOAttrDateTimeVisibility, VISIBLE );\n\
+ this.nIsFooterVisible = this.initVisibilityProperty( aOOOAttrFooterVisibility, VISIBLE );\n\
+ this.nIsHeaderVisible = this.initVisibilityProperty( aOOOAttrHeaderVisibility, VISIBLE );\n\
+ this.aMPTextFieldSet = new Object();\n\
+ this.aMPTextFieldSet[aSlideNumberClassName] = this.initSlideNumberField();\n\
+ this.aMPTextFieldSet[aDateTimeClassName] = this.initDateTimeField( aOOOAttrDateTimeField );\n\
+ this.aMPTextFieldSet[aFooterClassName] = this.initFixedTextField( aOOOAttrFooterField );\n\
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list