Commits

Anonymous committed cd91e21

CWS-TOOLING: integrate CWS transogl03redux
2009-02-09 13:59:40 +0100 thb r267511 : #i96946# Added seemingly missing change for the color space selection for the slide textures
2009-02-04 10:47:12 +0100 cmc r267353 : #i96946# integrate ogltrans work

Comments (0)

Files changed (28)

   --enable-cairo          Determines whether to use Cairo library on
                           platforms where Cairo is available.
 
-  --enable-opengl         Determines whether to use OpenGL (for 3D transitions)
-                          This is built as an UNO extension and not deployed
-			  in the install per default.
+  --enable-opengl         Determines whether to build the OpenGL 3D slide
+                          transitions component
 
   --enable-dbus           Determines whether to enable presentation mode
                           screensaver control under GNOME via DBUS
 
   --enable-wiki-publisher      enables the build of the Wiki Publisher extension
 
-  --enable-ogltrans       enables the build of the OGLTrans extension
-
   --enable-report-builder  disables the build of the Report Builder extension
 
   --disable-neon          Disable neon and the compilation of webdav binding
 
 fi
 
-# Check whether --enable-ogltrans was given.
-if test "${enable_ogltrans+set}" = set; then
-  enableval=$enable_ogltrans;
-fi
-
 # Check whether --enable-report-builder was given.
 if test "${enable_report_builder+set}" = set; then
   enableval=$enable_report_builder;
 
 
 
-{ echo "$as_me:$LINENO: checking whether to build the OGLTrans extension" >&5
-echo $ECHO_N "checking whether to build the OGLTrans extension... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking whether to build the OpenGL Transitions component" >&5
+echo $ECHO_N "checking whether to build the OpenGL Transitions component... $ECHO_C" >&6; }
 ENABLE_OPENGL=
 
 if test "x$enable_opengl" != "xno" ; then
 [  --with-system-cairo      Use Cairo libraries already on system
 ],,)
 AC_ARG_ENABLE(opengl,
-[  --enable-opengl         Determines whether to use OpenGL (for 3D transitions)
-                          This is built as an UNO extension and not deployed
-			  in the install per default.
+[  --enable-opengl         Determines whether to build the OpenGL 3D slide 
+                          transitions component
 ],,enable_opengl=no)
 AC_ARG_ENABLE(dbus,
 [  --enable-dbus           Determines whether to enable presentation mode 
 [  --servlet-api-jar=JARFILE   Specify path to jarfile manually ],
 [ SERVLETAPI_JAR="$withval"
 ])
-AC_ARG_ENABLE(ogltrans,
-[  --enable-ogltrans       enables the build of the OGLTrans extension
-],,)
 AC_ARG_ENABLE(report-builder,
 [  --enable-report-builder  disables the build of the Report Builder extension
 ],,)
 dnl Check whether the OpenGL libraries are available
 dnl ===================================================================
 
-AC_MSG_CHECKING([whether to build the OGLTrans extension])
+AC_MSG_CHECKING([whether to build the OpenGL Transitions component])
 ENABLE_OPENGL=
 
 if test "x$enable_opengl" != "xno" ; then

offapi/com/sun/star/presentation/XSlideShowView.idl

 #ifndef __com_sun_star_rendering_XSpriteCanvas_idl__ 
 #include <com/sun/star/rendering/XSpriteCanvas.idl> 
 #endif 
-#ifndef __com_sun_star_geometry_RealRectangle2D_idl__ 
-#include <com/sun/star/geometry/RealRectangle2D.idl> 
-#endif 
 #ifndef __com_sun_star_util_XModifyListener_idl__ 
 #include <com/sun/star/util/XModifyListener.idl> 
 #endif 
 #ifndef __com_sun_star_awt_XMouseMotionListener_idl__ 
 #include <com/sun/star/awt/XMouseMotionListener.idl> 
 #endif 
+#ifndef __com_sun_star_awt_Rectangle_idl__ 
+#include <com/sun/star/awt/Rectangle.idl> 
+#endif 
 
 module com {  module sun {  module star {  module presentation {
 
      */
     void setMouseCursor( [in] short nPointerShape );
 
+    /** Get rectangle defining area inside of canvas device which
+	this slideshow view uses.
+    */
+    ::com::sun::star::awt::Rectangle getCanvasArea();
 };
 
 }; }; }; };

offapi/com/sun/star/presentation/XTransition.idl

 #include <com/sun/star/uno/XInterface.idl> 
 #endif 
 
-module com {  module sun {  module star {  module presentation {
+module com {  module sun {  module star {
+
+module rendering { interface XBitmap; };
+
+module presentation {
+
+interface XSlideShowView;
+
 /** Transition interface to render custom transitions over time.<p>
 
     @since OOo 2.4
         [0,1] range.
      */
     void update( [in] double t );
+
+    void viewChanged( [in] XSlideShowView                        view,
+		      [in] com::sun::star::rendering::XBitmap    leavingBitmap,
+		      [in] com::sun::star::rendering::XBitmap    enteringBitmap );
 };
 
 }; }; }; };

offapi/com/sun/star/presentation/XTransitionFactory.idl

                                   [in] short                                 transitionSubType,
                                   [in] XSlideShowView                        view,
                                   [in] com::sun::star::rendering::XBitmap    leavingBitmap,
-                                  [in] com::sun::star::rendering::XBitmap    enteringBitmap,
-                                  [in] com::sun::star::geometry::RealPoint2D slideOffset );
+                                  [in] com::sun::star::rendering::XBitmap    enteringBitmap );
 };
 
 service TransitionFactory : XTransitionFactory;

officecfg/registry/data/org/openoffice/Office/Impress.xcu

       </node>  
     </node>
   </node>
+  <node oor:name="Misc">
+    <prop oor:name="TransitionFiles" install:module="ogltrans">
+      <value oor:separator=";">vnd.sun.star.expand:$OOO_BASE_DIR/share/config/soffice.cfg/simpress/transitions.xml;vnd.sun.star.expand:$OOO_BASE_DIR/share/config/soffice.cfg/simpress/transitions-ogl.xml</value>
+    </prop>
+  </node>
 </oor:component-data>

officecfg/registry/data/org/openoffice/Office/UI/Effects.xcu

 					
 				</prop>
 			</node>
+      <node oor:name="tile-flip" oor:op="replace">
+        <prop oor:name="Label" oor:type="xs:string">
+          <value xml:lang="en-US">Flipping tiles</value>
+        </prop>
+      </node>
+      <node oor:name="outside-cube" oor:op="replace">
+        <prop oor:name="Label" oor:type="xs:string">
+          <value xml:lang="en-US">Outside turning cube</value>
+        </prop>
+      </node>
+      <node oor:name="revolving-circles" oor:op="replace">
+        <prop oor:name="Label" oor:type="xs:string">
+          <value xml:lang="en-US">Revolving circles</value>
+        </prop>
+      </node>
+      <node oor:name="turning-helix" oor:op="replace">
+        <prop oor:name="Label" oor:type="xs:string">
+          <value xml:lang="en-US">Turning helix</value>
+        </prop>
+      </node>
+      <node oor:name="inside-cube" oor:op="replace">
+        <prop oor:name="Label" oor:type="xs:string">
+          <value xml:lang="en-US">Inside turning cube</value>
+        </prop>
+      </node>
+      <node oor:name="fall" oor:op="replace">
+        <prop oor:name="Label" oor:type="xs:string">
+          <value xml:lang="en-US">Fall</value>
+        </prop>
+      </node>
+      <node oor:name="turn-around" oor:op="replace">
+        <prop oor:name="Label" oor:type="xs:string">
+          <value xml:lang="en-US">Turn around</value>
+        </prop>
+      </node>
+      <node oor:name="iris" oor:op="replace">
+        <prop oor:name="Label" oor:type="xs:string">
+          <value xml:lang="en-US">Iris</value>
+        </prop>
+      </node>
+      <node oor:name="turn-down" oor:op="replace">
+        <prop oor:name="Label" oor:type="xs:string">
+          <value xml:lang="en-US">Turn down</value>
+        </prop>
+      </node>
+      <node oor:name="rochade" oor:op="replace">
+        <prop oor:name="Label" oor:type="xs:string">
+          <value xml:lang="en-US">Rochade</value>
+        </prop>
+      </node>
+      <node oor:name="venetian3dv" oor:op="replace">
+        <prop oor:name="Label" oor:type="xs:string">
+          <value xml:lang="en-US">Venetian Blinds 3D Vertical</value>
+        </prop>
+      </node>
+      <node oor:name="venetian3dh" oor:op="replace">
+        <prop oor:name="Label" oor:type="xs:string">
+          <value xml:lang="en-US">Venetian Blinds 3D Horizontal</value>
+        </prop>
+      </node>
+      <node oor:name="static" oor:op="replace">
+        <prop oor:name="Label" oor:type="xs:string">
+          <value xml:lang="en-US">Static</value>
+        </prop>
+      </node>
+      <node oor:name="finedissolve" oor:op="replace">
+        <prop oor:name="Label" oor:type="xs:string">
+          <value xml:lang="en-US">Fine Dissolve</value>
+        </prop>
+      </node>
 		</node>
 	</node>	
 	<node oor:name="Presets">

officecfg/registry/data/org/openoffice/Office/makefile.mk

     Writer-defaultfontarial.xcu \
     Writer-directcursor.xcu \
     Writer-javamail.xcu \
+    Impress-ogltrans.xcu \
     Embedding-calc.xcu   \
     Embedding-chart.xcu   \
     Embedding-draw.xcu   \

scp2/source/impress/makefile.mk

         registryitem_impress.ulf        \
         folderitem_impress.ulf
 
+.IF "$(ENABLE_OPENGL)" == "TRUE"
+PARFILES+=\
+        module_ogltrans.par
+ULFFILES+=\
+	module_ogltrans.ulf
+.ENDIF
+
 # --- File ---------------------------------------------------------
 .INCLUDE :  target.mk

scp2/source/impress/module_ogltrans.scp

+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: module_impress.scp,v $
+ * $Revision: 1.21 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org.  If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "macros.inc"
+
+Module gid_Module_Optional_OGLTrans
+    PackageInfo = "packinfo_office.txt";
+    MOD_NAME_DESC(MODULE_OPTIONAL_OGLTRANS);
+    ParentID = gid_Module_Optional;
+    Files = ( gid_File_Lib_OpenGLTransitions, gid_File_Share_Config_Sofficecfg_Impress_Transitions_OGL_Xml, gid_File_Registry_Spool_Oo_Office_Impress_OGLTrans_Xcu );
+    Minimal = NO;
+    Default = NO;
+End
+
+File gid_File_Lib_OpenGLTransitions
+    TXT_FILE_BODY;
+    Styles = (PACKED,UNO_COMPONENT);
+    RegistryID = gid_Starregistry_Services_Rdb;
+    Dir = gid_Dir_Program;
+  #ifdef UNX
+    Name = STRING(CONCAT2(OGLTrans.uno,UNXSUFFIX));
+  #else
+    Name = "OGLTrans.uno.dll";
+  #endif
+End
+
+File gid_File_Share_Config_Sofficecfg_Impress_Transitions_OGL_Xml
+    TXT_FILE_BODY;
+    Styles = (PACKED);
+    Dir = gid_Dir_Share_Config_Sofficecfg_Simpress;
+    Name = "transitions-ogl.xml";
+End
+
+File gid_File_Registry_Spool_Oo_Office_Impress_OGLTrans_Xcu
+    TXT_FILE_BODY;
+    Styles = (PACKED);
+    Dir = gid_Dir_Share_Registry_Modules_Oo_Office_Impress;
+    Name = "registry/spool/org/openoffice/Office/Impress-ogltrans.xcu";
+End

scp2/source/impress/module_ogltrans.ulf

+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: module_impress.ulf,v $
+ * $Revision: 1.6 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org.  If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+MODULE_OPTIONAL_OGLTRANS
+
+[STR_NAME_MODULE_OPTIONAL_OGLTRANS]
+en-US = "OpenGL slide transitions for %PRODUCTNAME Impress"
+
+[STR_DESC_MODULE_MODULE_OPTIONAL_OGLTRANS]
+en-US = "OpenGL slide transitions for %PRODUCTNAME Impress."

scp2/source/ooo/directory_ooo.scp

     HostName = "Writer";
 End
 
+Directory gid_Dir_Share_Registry_Modules_Oo_Office_Impress
+    ParentID = gid_Dir_Share_Registry_Modules_Oo_Office;
+    HostName = "Impress";
+End
+
 Directory gid_Dir_Share_Registry_Modules_Oo_Office_Linguistic
     ParentID = gid_Dir_Share_Registry_Modules_Oo_Office;
     HostName = "Linguistic";

scp2/util/makefile.mk

              file_binfilter.par
 .ENDIF
 
+.IF "$(ENABLE_OPENGL)" == "TRUE"
+SCP1FILES +=                               \
+             module_ogltrans.par
+.ENDIF
+
 .IF "$(SOLAR_JAVA)"!=""
 SCP1FILES +=                               \
              module_javafilter.par         \

sd/source/ui/slideshow/slideshowviewimpl.cxx

 		mxWindowPeer->setPointer( mxPointer );
 }
 
+awt::Rectangle SAL_CALL SlideShowView::getCanvasArea(  ) throw (RuntimeException)
+{
+    awt::Rectangle aRectangle;
+
+    if( mxWindow.is() )
+	return mxWindow->getPosSize();
+
+    aRectangle.X = aRectangle.Y = aRectangle.Width = aRectangle.Height = 0;
+
+    return aRectangle;
+}
+
 void SlideShowView::updateimpl( ::osl::ClearableMutexGuard& rGuard, SlideshowImpl* pSlideShow )
 {
 	if( pSlideShow )

sd/source/ui/slideshow/slideshowviewimpl.hxx

     virtual void SAL_CALL addMouseMotionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseMotionListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
 	virtual void SAL_CALL removeMouseMotionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseMotionListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
     virtual void SAL_CALL setMouseCursor( sal_Int16 nPointerShape ) throw (::com::sun::star::uno::RuntimeException);
+    virtual ::com::sun::star::awt::Rectangle SAL_CALL getCanvasArea(  ) throw (::com::sun::star::uno::RuntimeException);
 
     // XWindowListener methods
     virtual void SAL_CALL windowResized( const ::com::sun::star::awt::WindowEvent& e ) throw (::com::sun::star::uno::RuntimeException);

sd/xml/transitions-ogl

-<?xml version="1.0"?>
-<anim:seq xmlns:office="urn:oasis:names:tc:openoffice:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:openoffice:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:openoffice:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:openoffice:xmlns:table:1.0" xmlns:draw="urn:oasis:names:tc:openoffice:xmlns:drawing:1.0" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:openoffice:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:openoffice:xmlns:datastyle:1.0" xmlns:pres="urn:oasis:names:tc:openoffice:xmlns:presentation:1.0" xmlns:svg="http://www.w3.org/2000/svg" xmlns:chart="urn:oasis:names:tc:openoffice:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:openoffice:xmlns:dr3d:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:openoffice:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:openoffice:xmlns:script:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:smil="http://www.w3.org/2001/SMIL20" xmlns:anim="urn:oasis:names:tc:openoffice:xmlns:animation:1.0" pres:node-type="main-sequence">
- <anim:par pres:preset-id="tile-flip">
-  <anim:transitionFilter smil:type="miscShapeWipe" smil:subtype="across"/>
- </anim:par>
- <anim:par pres:preset-id="outside-cube">
-  <anim:transitionFilter smil:type="miscShapeWipe" smil:subtype="cornersOut"/>
- </anim:par>
- <anim:par pres:preset-id="revolving-circles">
-  <anim:transitionFilter smil:type="miscShapeWipe" smil:subtype="circle"/>
- </anim:par>
- <anim:par pres:preset-id="turning-helix">
-  <anim:transitionFilter smil:type="miscShapeWipe" smil:subtype="fanOutHorizontal"/>
- </anim:par>
- <anim:par pres:preset-id="inside-cube">
-  <anim:transitionFilter smil:type="miscShapeWipe" smil:subtype="cornersIn"/>
- </anim:par>
- <anim:par pres:preset-id="fall">
-  <anim:transitionFilter smil:type="miscShapeWipe" smil:subtype="leftToRight"/>
- </anim:par>
- <anim:par pres:preset-id="turn-around">
-  <anim:transitionFilter smil:type="miscShapeWipe" smil:subtype="topToBottom"/>
- </anim:par>
- <anim:par pres:preset-id="iris">
-  <anim:transitionFilter smil:type="miscShapeWipe" smil:subtype="topLeft"/>
- </anim:par>
- <anim:par pres:preset-id="turn-down">
-  <anim:transitionFilter smil:type="miscShapeWipe" smil:subtype="topRight"/>
- </anim:par>
- <anim:par pres:preset-id="rochade">
-  <anim:transitionFilter smil:type="miscShapeWipe" smil:subtype="bottomRight"/>
- </anim:par>
- </anim:seq>

sd/xml/transitions-ogl.xml

+<?xml version="1.0"?>
+<anim:seq xmlns:office="urn:oasis:names:tc:openoffice:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:openoffice:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:openoffice:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:openoffice:xmlns:table:1.0" xmlns:draw="urn:oasis:names:tc:openoffice:xmlns:drawing:1.0" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:openoffice:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:openoffice:xmlns:datastyle:1.0" xmlns:pres="urn:oasis:names:tc:openoffice:xmlns:presentation:1.0" xmlns:svg="http://www.w3.org/2000/svg" xmlns:chart="urn:oasis:names:tc:openoffice:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:openoffice:xmlns:dr3d:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:openoffice:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:openoffice:xmlns:script:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:smil="http://www.w3.org/2001/SMIL20" xmlns:anim="urn:oasis:names:tc:openoffice:xmlns:animation:1.0" pres:node-type="main-sequence">
+ <anim:par pres:preset-id="tile-flip">
+  <anim:transitionFilter smil:type="miscShapeWipe" smil:subtype="across"/>
+ </anim:par>
+ <anim:par pres:preset-id="outside-cube">
+  <anim:transitionFilter smil:type="miscShapeWipe" smil:subtype="cornersOut"/>
+ </anim:par>
+ <anim:par pres:preset-id="revolving-circles">
+  <anim:transitionFilter smil:type="miscShapeWipe" smil:subtype="circle"/>
+ </anim:par>
+ <anim:par pres:preset-id="turning-helix">
+  <anim:transitionFilter smil:type="miscShapeWipe" smil:subtype="fanOutHorizontal"/>
+ </anim:par>
+ <anim:par pres:preset-id="inside-cube">
+  <anim:transitionFilter smil:type="miscShapeWipe" smil:subtype="cornersIn"/>
+ </anim:par>
+ <anim:par pres:preset-id="fall">
+  <anim:transitionFilter smil:type="miscShapeWipe" smil:subtype="leftToRight"/>
+ </anim:par>
+ <anim:par pres:preset-id="turn-around">
+  <anim:transitionFilter smil:type="miscShapeWipe" smil:subtype="topToBottom"/>
+ </anim:par>
+ <anim:par pres:preset-id="iris">
+  <anim:transitionFilter smil:type="miscShapeWipe" smil:subtype="topLeft"/>
+ </anim:par>
+ <anim:par pres:preset-id="turn-down">
+  <anim:transitionFilter smil:type="miscShapeWipe" smil:subtype="topRight"/>
+ </anim:par>
+ <anim:par pres:preset-id="rochade">
+  <anim:transitionFilter smil:type="miscShapeWipe" smil:subtype="bottomRight"/>
+ </anim:par>
+ </anim:seq>

sdext/source/presenter/PresenterSlideShowView.cxx

       mxPointer(),
       mxWindow(),
       mxViewWindow(),
+      mxTopPane(),
+      mxPresenterHelper(),
       mxBackgroundPolygon1(),
       mxBackgroundPolygon2(),
       mbIsViewAdded(false),
     if (xSlideShowComponent.is())
         xSlideShowComponent->addEventListener(static_cast<awt::XWindowListener*>(this));
 
+    Reference<lang::XMultiComponentFactory> xFactory (
+        mxComponentContext->getServiceManager(), UNO_QUERY_THROW);
+    mxPresenterHelper.set (xFactory->createInstanceWithContext(
+			       OUString::createFromAscii("com.sun.star.comp.Draw.PresenterHelper"),
+			       mxComponentContext),
+			   UNO_QUERY_THROW);
+
     // Use view id and controller to retrieve window and canvas from
     // configuration controller.
     Reference<XControllerManager> xCM (mxController, UNO_QUERY_THROW);
 
     if (xCC.is())
     {
+	mxTopPane.set(xCC->getResource(mxViewId->getAnchor()->getAnchor()), UNO_QUERY);
+
         Reference<XPane> xPane (xCC->getResource(mxViewId->getAnchor()), UNO_QUERY_THROW);
 
         mxWindow = xPane->getWindow();
     // Create a window for the actual slide show view.  It is places
     // centered and with maximal size inside the pane.
     mxViewWindow = CreateViewWindow(mxWindow);
-    mxViewCanvas = CreateViewCanvas(mxViewWindow,
-        Reference<XPane>(xCC->getResource(mxViewId->getAnchor()->getAnchor()), UNO_QUERY));
+
+    mxViewCanvas = CreateViewCanvas(mxViewWindow);
             
     if (mxViewWindow.is())
     {
 
 
 
+awt::Rectangle SAL_CALL PresenterSlideShowView::getCanvasArea(  ) throw (RuntimeException)
+{
+    if( mxViewWindow.is() && mxTopPane.is() )
+	return mxPresenterHelper->getWindowExtentsRelative( mxViewWindow, mxTopPane->getWindow() );
+
+    awt::Rectangle aRectangle;
+
+    aRectangle.X = aRectangle.Y = aRectangle.Width = aRectangle.Height = 0;
+
+    return aRectangle;
+}
+
+
 
 //----- lang::XEventListener --------------------------------------------------
 
 
 
 Reference<rendering::XCanvas> PresenterSlideShowView::CreateViewCanvas (
-    const Reference<awt::XWindow>& rxViewWindow,
-    const Reference<XPane>& rxParentPane) const
+    const Reference<awt::XWindow>& rxViewWindow) const
 {
     // Create a canvas for the view window.
-    Reference<lang::XMultiComponentFactory> xFactory (
-        mxComponentContext->getServiceManager(), UNO_QUERY_THROW);
-    Reference<drawing::XPresenterHelper> xPresenterHelper(
-        xFactory->createInstanceWithContext(
-            OUString::createFromAscii("com.sun.star.comp.Draw.PresenterHelper"),
-            mxComponentContext),
-        UNO_QUERY_THROW);
-    return xPresenterHelper->createSharedCanvas(
-        Reference<rendering::XSpriteCanvas>(rxParentPane->getCanvas(), UNO_QUERY),
-        rxParentPane->getWindow(),
-        rxParentPane->getCanvas(),
-        rxParentPane->getWindow(),
+    return mxPresenterHelper->createSharedCanvas(
+        Reference<rendering::XSpriteCanvas>(mxTopPane->getCanvas(), UNO_QUERY),
+        mxTopPane->getWindow(),
+        mxTopPane->getCanvas(),
+        mxTopPane->getWindow(),
         rxViewWindow);
 }
 

sdext/source/presenter/PresenterSlideShowView.hxx

     virtual void SAL_CALL setMouseCursor(::sal_Int16 nPointerShape)
         throw (css::uno::RuntimeException);
 
+    virtual ::com::sun::star::awt::Rectangle SAL_CALL getCanvasArea(  )
+	throw (::com::sun::star::uno::RuntimeException);
     
     // lang::XEventListener
     virtual void SAL_CALL disposing (const css::lang::EventObject& rEvent)
     css::uno::Reference<css::awt::XPointer> mxPointer;
     css::uno::Reference<css::awt::XWindow> mxWindow;
     css::uno::Reference<css::awt::XWindow> mxViewWindow;
+    css::uno::Reference<css::drawing::framework::XPane> mxTopPane;
+    css::uno::Reference<css::drawing::XPresenterHelper> mxPresenterHelper;
     css::uno::Reference<css::rendering::XPolyPolygon2D> mxBackgroundPolygon1;
     css::uno::Reference<css::rendering::XPolyPolygon2D> mxBackgroundPolygon2;
     bool mbIsViewAdded;
     css::uno::Reference<css::awt::XWindow> CreateViewWindow (
         const css::uno::Reference<css::awt::XWindow>& rxParentWindow) const;
     css::uno::Reference<css::rendering::XCanvas> CreateViewCanvas (
-        const css::uno::Reference<css::awt::XWindow>& rxWindow,
-        const css::uno::Reference<css::drawing::framework::XPane>& rxParentPane) const;
+        const css::uno::Reference<css::awt::XWindow>& rxWindow) const;
 
     void Resize (void);
 

setup_native/source/packinfo/packinfo_office.txt

 packageversion = "0.5.0.2"
 End
 
+Start
+module = "gid_Module_Optional_OGLTrans"
+solarispackagename = "%BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-ogltrans"
+solarisrequires = "%BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-impress"
+packagename = "%BASISPACKAGEPREFIX%OOOBASEVERSION-ogltrans"
+freebsdrequires = "%BASISPACKAGEPREFIX%OOOBASEVERSION-impress"
+requires = "%BASISPACKAGEPREFIX%OOOBASEVERSION-impress"
+copyright = "1999-2007 by OpenOffice.org"
+solariscopyright = "solariscopyrightfile"
+vendor = "OpenOffice.org"
+description = "OpenGL slide transitions module for OpenOffice.org %OOOBASEVERSION"
+destpath = "/opt"
+packageversion = "%OOOPACKAGEVERSION"
+End

slideshow/source/engine/OGLTrans/OGLTrans_Shaders.cxx

+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: $
+ * $Revision: $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org.  If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include <osl/diagnose.hxx>
+
+#include "OGLTrans_Shaders.hxx"
+
+namespace unx
+{
+#include <GL/glx.h>
+#include <GL/glxext.h>
+}
+
+bool OGLShaders::cbInitialized = false;
+
+#ifdef GL_VERSION_2_0
+
+PFNGLCREATESHADERPROC OGLShaders::glCreateShader = NULL;
+PFNGLSHADERSOURCEPROC OGLShaders::glShaderSource = NULL;
+PFNGLCOMPILESHADERPROC OGLShaders::glCompileShader = NULL;
+PFNGLGETSHADERIVPROC OGLShaders::glGetShaderiv = NULL;
+PFNGLGETSHADERINFOLOGPROC OGLShaders::glGetShaderInfoLog = NULL;
+PFNGLDELETESHADERPROC OGLShaders::glDeleteShader = NULL;
+PFNGLCREATEPROGRAMPROC OGLShaders::glCreateProgram = NULL;
+PFNGLATTACHSHADERPROC OGLShaders::glAttachShader = NULL;
+PFNGLLINKPROGRAMPROC OGLShaders::glLinkProgram = NULL;
+PFNGLGETPROGRAMIVPROC OGLShaders::glGetProgramiv = NULL;
+PFNGLGETPROGRAMINFOLOGPROC OGLShaders::glGetProgramInfoLog = NULL;
+PFNGLUSEPROGRAMPROC OGLShaders::glUseProgram = NULL;
+PFNGLDELETEPROGRAMPROC OGLShaders::glDeleteProgram = NULL;
+PFNGLGETUNIFORMLOCATIONPROC OGLShaders::glGetUniformLocation = NULL;
+PFNGLUNIFORM1IPROC OGLShaders::glUniform1i = NULL;
+PFNGLUNIFORM1FPROC OGLShaders::glUniform1f = NULL;
+#endif
+
+bool OGLShaders::Initialize()
+{
+#ifdef GL_VERSION_2_0
+    if( !cbInitialized ) {
+        glCreateShader = (PFNGLCREATESHADERPROC) unx::glXGetProcAddress( (unsigned char *) "glCreateShader" );
+        glShaderSource = (PFNGLSHADERSOURCEPROC) unx::glXGetProcAddress( (unsigned char *) "glShaderSource" );
+        glCompileShader = (PFNGLCOMPILESHADERPROC) unx::glXGetProcAddress( (unsigned char *) "glCompileShader" );
+        glGetShaderiv = (PFNGLGETSHADERIVPROC) unx::glXGetProcAddress( (unsigned char *) "glGetShaderiv" );
+        glGetShaderInfoLog = (PFNGLGETSHADERINFOLOGPROC) unx::glXGetProcAddress( (unsigned char *) "glGetShaderInfoLog" );
+        glDeleteShader = (PFNGLDELETESHADERPROC) unx::glXGetProcAddress( (unsigned char *) "glDeleteShader" );
+        glCreateProgram = (PFNGLCREATEPROGRAMPROC) unx::glXGetProcAddress( (unsigned char *) "glCreateProgram" );
+        glAttachShader = (PFNGLATTACHSHADERPROC) unx::glXGetProcAddress( (unsigned char *) "glAttachShader" );
+        glLinkProgram = (PFNGLLINKPROGRAMPROC) unx::glXGetProcAddress( (unsigned char *) "glLinkProgram" );
+        glGetProgramiv = (PFNGLGETPROGRAMIVPROC) unx::glXGetProcAddress( (unsigned char *) "glGetProgramiv" );
+        glGetProgramInfoLog = (PFNGLGETPROGRAMINFOLOGPROC) unx::glXGetProcAddress( (unsigned char *) "glGetProgramInfoLog" );
+        glUseProgram = (PFNGLUSEPROGRAMPROC) unx::glXGetProcAddress( (unsigned char *) "glUseProgram" );
+        glDeleteProgram = (PFNGLDELETEPROGRAMPROC) unx::glXGetProcAddress( (unsigned char *) "glDeleteProgram" );
+        glGetUniformLocation = (PFNGLGETUNIFORMLOCATIONPROC) unx::glXGetProcAddress( (unsigned char *) "glGetUniformLocation" );
+        glUniform1i = (PFNGLUNIFORM1IPROC) unx::glXGetProcAddress( (unsigned char *) "glUniform1i" );
+        glUniform1f = (PFNGLUNIFORM1FPROC) unx::glXGetProcAddress( (unsigned char *) "glUniform1f" );
+        cbInitialized = true;
+    }
+
+    return glCreateShader != NULL;
+#else
+    return false;
+#endif
+}
+
+GLuint OGLShaders::LinkProgram( const char *vertexShader, const char *fragmentShader )
+{
+#ifdef GL_VERSION_2_0
+    if( !Initialize() )
+        return 0;
+
+    GLhandleARB vertexObject, fragmentObject, programObject;
+    GLint vertexCompiled, fragmentCompiled, programLinked;
+    char log[1024];
+
+    vertexObject = glCreateShader( GL_VERTEX_SHADER );
+    fragmentObject = glCreateShader( GL_FRAGMENT_SHADER );
+    OSL_TRACE("checkpoint 1: shaders created (%d) vertex: %d fragment: %d", glGetError() == GL_NO_ERROR, vertexObject, fragmentObject );
+
+
+    glShaderSource( vertexObject, 1, &vertexShader, NULL );
+    glShaderSource( fragmentObject, 1, &fragmentShader, NULL );
+
+    glCompileShader( vertexObject );
+    glGetShaderInfoLog( vertexObject, sizeof( log ), NULL, log );
+    OSL_TRACE("vertex compile log: %s", log);
+    glGetShaderiv( vertexObject, GL_COMPILE_STATUS, &vertexCompiled );
+    glCompileShader( fragmentObject );
+    glGetShaderInfoLog( fragmentObject, sizeof( log ), NULL, log );
+    OSL_TRACE("fragment compile log: %s", log);
+    glGetShaderiv( fragmentObject, GL_COMPILE_STATUS, &fragmentCompiled );
+
+    if( !vertexCompiled || !fragmentCompiled )
+        return 0;
+
+    OSL_TRACE("checkpoint 2: shaders compiled (%d)", glGetError() == GL_NO_ERROR);
+
+    programObject = glCreateProgram();
+    glAttachShader( programObject, vertexObject );
+    glAttachShader( programObject, fragmentObject );
+
+    glLinkProgram( programObject );
+    glGetProgramInfoLog( programObject, sizeof( log ), NULL, log );
+    OSL_TRACE("program link log: %s", log);
+    glGetProgramiv( programObject, GL_LINK_STATUS, &programLinked );
+
+    if( !programLinked )
+        return 0;
+
+    OSL_TRACE("checkpoint 3: program linked (%d)", glGetError() == GL_NO_ERROR);
+
+    return programObject;
+#else
+    return 0;
+#endif
+}
+

slideshow/source/engine/OGLTrans/OGLTrans_Shaders.hxx

+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: $
+ * $Revision: $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org.  If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef INCLUDED_OGLTRANS_SHADERS_HXX_
+#define INCLUDED_OGLTRANS_SHADERS_HXX_
+
+#define GL_GLEXT_PROTOTYPES 1
+#include <GL/gl.h>
+#include <GL/glext.h>
+
+class OGLShaders {
+    static bool Initialize();
+    static bool cbInitialized;
+
+public:    
+
+    static GLuint LinkProgram( const char *vertexShader, const char *fragmentShader );
+
+    /** GL shader functions
+     */
+#ifdef GL_VERSION_2_0
+
+    static PFNGLCREATESHADERPROC glCreateShader;
+    static PFNGLSHADERSOURCEPROC glShaderSource;
+    static PFNGLCOMPILESHADERPROC glCompileShader;
+    static PFNGLGETSHADERIVPROC glGetShaderiv;
+    static PFNGLGETSHADERINFOLOGPROC glGetShaderInfoLog;
+    static PFNGLDELETESHADERPROC glDeleteShader;
+
+    static PFNGLCREATEPROGRAMPROC glCreateProgram;
+    static PFNGLATTACHSHADERPROC glAttachShader;
+    static PFNGLLINKPROGRAMPROC glLinkProgram;
+    static PFNGLGETPROGRAMIVPROC glGetProgramiv;
+    static PFNGLGETPROGRAMINFOLOGPROC glGetProgramInfoLog;
+    static PFNGLUSEPROGRAMPROC glUseProgram;
+    static PFNGLDELETEPROGRAMPROC glDeleteProgram;
+
+    static PFNGLGETUNIFORMLOCATIONPROC glGetUniformLocation;
+    static PFNGLUNIFORM1IPROC glUniform1i;
+    static PFNGLUNIFORM1FPROC glUniform1f;
+#endif
+};
+
+#endif

slideshow/source/engine/OGLTrans/OGLTrans_TransitionImpl.cxx

  * for a copy of the LGPLv3 License.
  *
  ************************************************************************/
+
 #include "OGLTrans_TransitionImpl.hxx"
-
+#include "OGLTrans_Shaders.hxx"
 #include <GL/gl.h>
+#include <math.h>
 
 
 void OGLTransitionImpl::clear()
     for(unsigned int i(0); i < maSceneObjects.size(); ++i)
         delete maSceneObjects[i];
     maSceneObjects.clear();
+
+    mbReflectSlides = false;
+
+#ifdef GL_VERSION_2_0
+    if( mProgramObject ) {
+        OGLShaders::glDeleteProgram( mProgramObject );
+        mProgramObject = 0;
+    }
+
+    if( mVertexObject ) {
+        OGLShaders::glDeleteShader( mVertexObject );
+        mVertexObject = 0;
+    }
+
+    if( mFragmentObject ) {
+        OGLShaders::glDeleteShader( mFragmentObject );
+        mFragmentObject = 0;
+    }
+#endif
+
+    if( maHelperTexture ) {
+        glDeleteTextures( 1, &maHelperTexture );
+        maHelperTexture = 0;
+    }
+
+    if( mmClearTransition )
+        (this->*mmClearTransition)();
 }
 
 OGLTransitionImpl::~OGLTransitionImpl()
     clear();
 }
 
-void OGLTransitionImpl::prepare()
+void OGLTransitionImpl::prepare( ::sal_Int32 glLeavingSlideTex, ::sal_Int32 glEnteringSlideTex )
 {
     for(unsigned int i(0); i < maSceneObjects.size(); ++i) {
         maSceneObjects[i]->prepare();
     }
+
+    if( mmPrepareTransition )
+        (this->*mmPrepareTransition)( glLeavingSlideTex, glEnteringSlideTex );
 }
 
 void OGLTransitionImpl::finish()
     }
 }
 
+static void blendSlide( double depth )
+{
+    double showHeight = -1 + depth*2;
+    GLfloat reflectionColor[] = {0, 0, 0, 0.25};
+
+    glDisable( GL_DEPTH_TEST );
+    glBegin( GL_QUADS );
+    glColor4fv( reflectionColor );
+    glVertex3f( -1, -1, 0 );
+    glColor4f( 0, 0, 0, 1 );
+    glVertex3f(-1,  showHeight, 0 );
+    glVertex3f( 1,  showHeight, 0 );
+    glColor4fv( reflectionColor );
+    glVertex3f( 1, -1, 0 );
+    glEnd();
+
+    glBegin( GL_QUADS );
+    glColor4f( 0, 0, 0, 1 );
+    glVertex3f( -1, showHeight, 0 );
+    glVertex3f( -1,  1, 0 );
+    glVertex3f(  1,  1, 0 );
+    glVertex3f(  1, showHeight, 0 );
+    glEnd();
+    glEnable( GL_DEPTH_TEST );
+}
+
+static void slideShadow( double nTime, Primitive& primitive, double sw, double sh )
+{
+    double reflectionDepth = 0.3;
+
+    glEnable(GL_BLEND);
+    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+    glDisable(GL_LIGHTING);
+
+    glPushMatrix();
+    primitive.applyOperations( nTime, sw, sh );
+    blendSlide( reflectionDepth );
+    glPopMatrix();
+
+    glDisable(GL_BLEND);
+    glEnable(GL_LIGHTING);
+}
+
 void OGLTransitionImpl::display( double nTime, ::sal_Int32 glLeavingSlideTex, ::sal_Int32 glEnteringSlideTex,
                                  double SlideWidth, double SlideHeight, double DispWidth, double DispHeight )
 {
     SlideWidthScale = SlideWidth/DispWidth;
     SlideHeightScale = SlideHeight/DispHeight;
 
+    if( mmPrepare ) {
+        clear();
+        (this->*mmPrepare)( nTime, SlideWidth, SlideHeight, DispWidth, DispHeight );
+    }
+
     glPushMatrix();
-    glEnable(GL_TEXTURE_2D);
-    //TODO change to foreach
+    displaySlides( nTime, glLeavingSlideTex, glEnteringSlideTex, SlideWidthScale, SlideHeightScale );
+    displayScene( nTime, SlideWidth, SlideHeight, DispWidth, DispHeight );
+    glPopMatrix();
+}
+
+void OGLTransitionImpl::applyOverallOperations( double nTime, double SlideWidthScale, double SlideHeightScale )
+{
     for(unsigned int i(0); i < OverallOperations.size(); ++i)
         OverallOperations[i]->interpolate(nTime,SlideWidthScale,SlideHeightScale);
-    glBindTexture(GL_TEXTURE_2D, glLeavingSlideTex);
-    for(unsigned int i(0); i < maLeavingSlidePrimitives.size(); ++i)
-        maLeavingSlidePrimitives[i].display(nTime,SlideWidthScale,SlideHeightScale);
-    glBindTexture(GL_TEXTURE_2D, glEnteringSlideTex);
-    for(unsigned int i(0); i < maEnteringSlidePrimitives.size(); ++i)
-        maEnteringSlidePrimitives[i].display(nTime,SlideWidthScale,SlideHeightScale);
+}
 
+void OGLTransitionImpl::displaySlide( double nTime, ::sal_Int32 glSlideTex, std::vector<Primitive>& primitives,
+                                      double SlideWidthScale, double SlideHeightScale )
+{
+   //TODO change to foreach
+    glBindTexture(GL_TEXTURE_2D, glSlideTex);
+
+    // display slide reflection
+    // note that depth test is turned off while blending the shadow
+    // so the slides has to be rendered in right order, see rochade as example
+    if( mbReflectSlides ) {
+        double surfaceLevel = -0.04;
+
+        /* reflected slides */
+        glPushMatrix();
+
+        glScaled( 1, -1, 1 );
+        glTranslated( 0, 2 - surfaceLevel, 0 );
+
+        glCullFace(GL_FRONT);
+	for(unsigned int i(0); i < primitives.size(); ++i)
+	    primitives[i].display(nTime, SlideWidthScale, SlideHeightScale);
+        glCullFace(GL_BACK);
+
+	slideShadow( nTime, primitives[0], SlideWidthScale, SlideHeightScale );
+
+        glPopMatrix();
+    }
+
+    for(unsigned int i(0); i < primitives.size(); ++i)
+        primitives[i].display(nTime, SlideWidthScale, SlideHeightScale);
+}
+
+void OGLTransitionImpl::displaySlides( double nTime, ::sal_Int32 glLeavingSlideTex, ::sal_Int32 glEnteringSlideTex,
+                                       double SlideWidthScale, double SlideHeightScale )
+{
+    if( mmDisplaySlides )
+        (this->*mmDisplaySlides)( nTime, glLeavingSlideTex, glEnteringSlideTex, SlideWidthScale, SlideHeightScale );
+    else {
+        applyOverallOperations( nTime, SlideWidthScale, SlideHeightScale );
+
+        glEnable(GL_TEXTURE_2D);
+        displaySlide( nTime, glLeavingSlideTex, maLeavingSlidePrimitives, SlideWidthScale, SlideHeightScale );
+        displaySlide( nTime, glEnteringSlideTex, maEnteringSlidePrimitives, SlideWidthScale, SlideHeightScale );
+    }
+}
+
+void OGLTransitionImpl::displayScene( double nTime, double SlideWidth, double SlideHeight, double DispWidth, double DispHeight )
+{
+    glEnable(GL_TEXTURE_2D);
     for(unsigned int i(0); i < maSceneObjects.size(); ++i)
         maSceneObjects[i]->display(nTime, SlideWidth, SlideHeight, DispWidth, DispHeight);
-    
-
-    glPopMatrix();
 }
 
 void Primitive::display(double nTime, double WidthScale, double HeightScale)
 {
     glPushMatrix();
-    for(unsigned int i(0); i < Operations.size(); ++i)
-        Operations[i]->interpolate( nTime ,WidthScale,HeightScale);
-    glScaled(WidthScale,HeightScale,1);
+
+    applyOperations( nTime, WidthScale, HeightScale );
 
     glEnableClientState( GL_VERTEX_ARRAY );
     if(!Normals.empty())
     glPopMatrix();
 }
 
+void Primitive::applyOperations(double nTime, double WidthScale, double HeightScale)
+{
+    for(unsigned int i(0); i < Operations.size(); ++i)
+        Operations[i]->interpolate( nTime ,WidthScale,HeightScale);
+    glScaled(WidthScale,HeightScale,1);
+}
+
 Primitive::~Primitive()
 {
     for(unsigned int i( 0 ); i < Operations.size(); ++i)
 
     Slide.Operations.push_back(new RotateAndScaleDepthByWidth(basegfx::B3DVector(1,0,0),basegfx::B3DVector(0,-1,0), 90,true,0.0,1.0));
     maLeavingSlidePrimitives.push_back(Slide);
+
+    mbUseMipMapEntering = false;
 }
 
 void OGLTransitionImpl::makeTurnAround()
 {
     clear();
     Primitive Slide;
+
+    mbReflectSlides = true;
     
     Slide.pushTriangle(basegfx::B2DVector(0,0),basegfx::B2DVector(1,0),basegfx::B2DVector(0,1));
     Slide.pushTriangle(basegfx::B2DVector(1,0),basegfx::B2DVector(0,1),basegfx::B2DVector(1,1));
     Slide.Operations.push_back(new SRotate (basegfx::B3DVector(0, 0, 1), basegfx::B3DVector(-1, 1, 0), -90, true, 0.0, 1.0));
     Slide.Operations.push_back(new SRotate (basegfx::B3DVector(0, 0, 1), basegfx::B3DVector(-1, 1, 0), 90, false, -1.0, 0.0));
     maEnteringSlidePrimitives.push_back(Slide);
+
+    mbUseMipMapLeaving = false;
 }
 
 void OGLTransitionImpl::makeIris()
     Slide.pushTriangle (basegfx::B2DVector (1,0), basegfx::B2DVector (0,1), basegfx::B2DVector (1,1));
     maEnteringSlidePrimitives.push_back (Slide);
 
-    Slide.Operations.push_back (new STranslate (basegfx::B3DVector (0, 0, 0.0001), false, -1, 0));
-    Slide.Operations.push_back (new STranslate (basegfx::B3DVector (0, 0, -0.0002), false, 0.5, 1));
+    Slide.Operations.push_back (new STranslate (basegfx::B3DVector (0, 0,  0.000001), false, -1, 0));
+    Slide.Operations.push_back (new STranslate (basegfx::B3DVector (0, 0, -0.000002), false, 0.5, 1));
     maLeavingSlidePrimitives.push_back (Slide);
 
 
     }
 
     maSceneObjects.push_back (pIris);
+
+    mbUseMipMapLeaving = mbUseMipMapEntering = false;
+}
+
+void OGLTransitionImpl::displaySlidesRochade( double nTime, ::sal_Int32 glLeavingSlideTex, ::sal_Int32 glEnteringSlideTex,
+					      double SlideWidthScale, double SlideHeightScale )
+{
+    applyOverallOperations( nTime, SlideWidthScale, SlideHeightScale );
+
+    glEnable(GL_TEXTURE_2D);
+
+    if( nTime > .5) {
+	displaySlide( nTime, glLeavingSlideTex, maLeavingSlidePrimitives, SlideWidthScale, SlideHeightScale );
+	displaySlide( nTime, glEnteringSlideTex, maEnteringSlidePrimitives, SlideWidthScale, SlideHeightScale );
+    } else {
+	displaySlide( nTime, glEnteringSlideTex, maEnteringSlidePrimitives, SlideWidthScale, SlideHeightScale );
+	displaySlide( nTime, glLeavingSlideTex, maLeavingSlidePrimitives, SlideWidthScale, SlideHeightScale );
+    }
 }
 
 void OGLTransitionImpl::makeRochade()
     clear();
     Primitive Slide;
     
+    mbReflectSlides = true;
+    mmDisplaySlides = &OGLTransitionImpl::displaySlidesRochade;
+
     double w, h;
 
     w = 2.2;
-    h = 5;
+    h = 10;
 
     Slide.pushTriangle(basegfx::B2DVector(0,0),basegfx::B2DVector(1,0),basegfx::B2DVector(0,1));
     Slide.pushTriangle(basegfx::B2DVector(1,0),basegfx::B2DVector(0,1),basegfx::B2DVector(1,1));
     bInterpolate = bInter;
 }
 
+RotateAndScaleDepthByHeight::RotateAndScaleDepthByHeight(const basegfx::B3DVector& Axis,const basegfx::B3DVector& Origin,double Angle, bool bInter, double T0, double T1):axis(Axis),origin(Origin),angle(Angle)
+{
+    nT0 = T0;
+    nT1 = T1;
+    bInterpolate = bInter;
+}
+
 
 STranslate::STranslate(const basegfx::B3DVector& Vector, bool bInter, double T0, double T1):vector(Vector)
 {
         t = nT1;
     t = intervalInter(t,nT0,nT1);
     glTranslated(SlideWidthScale*origin.getX(),SlideHeightScale*origin.getY(),origin.getZ());
+    glScaled(SlideWidthScale,SlideHeightScale,1);
     glRotated(t*angle,axis.getX(),axis.getY(),axis.getZ());
+    glScaled(1/SlideWidthScale,1/SlideHeightScale,1);
     glTranslated(-SlideWidthScale*origin.getX(),-SlideHeightScale*origin.getY(),-origin.getZ());
 }
 
     glTranslated(-SlideWidthScale*origin.getX(),-SlideHeightScale*origin.getY(),-SlideWidthScale*origin.getZ());
 }
 
+void RotateAndScaleDepthByHeight::interpolate(double t,double SlideWidthScale,double SlideHeightScale)
+{
+    if(t <= nT0)
+        return;
+    if(!bInterpolate || t > nT1)
+        t = nT1;
+    t = intervalInter(t,nT0,nT1);
+    glTranslated(SlideWidthScale*origin.getX(),SlideHeightScale*origin.getY(),SlideHeightScale*origin.getZ());
+    glRotated(t*angle,axis.getX(),axis.getY(),axis.getZ());
+    glTranslated(-SlideWidthScale*origin.getX(),-SlideHeightScale*origin.getY(),-SlideHeightScale*origin.getZ());
+}
+
 SEllipseTranslate::SEllipseTranslate(double dWidth, double dHeight, double dStartPosition, double dEndPosition, bool bInter, double T0, double T1)
 {
     nT0 = T0;
     return new RotateAndScaleDepthByWidth(*this);
 }
 
+RotateAndScaleDepthByHeight* RotateAndScaleDepthByHeight::clone()
+{
+    return new RotateAndScaleDepthByHeight(*this);
+}
+
 const Primitive& Primitive::operator=(const Primitive& rvalue)
 {
     for(unsigned int i( 0 ); i < rvalue.Operations.size(); ++i)
     Normals.push_back(basegfx::B3DVector(0,0,1));//all normals always face the screen when untransformed.
     Normals.push_back(basegfx::B3DVector(0,0,1));//all normals always face the screen when untransformed.
 }
+
+void OGLTransitionImpl::makeDiamond()
+{
+    mmPrepare = &OGLTransitionImpl::prepareDiamond;
+    mbUseMipMapLeaving = mbUseMipMapEntering = false;
+}
+
+void OGLTransitionImpl::prepareDiamond( double nTime, double /* SlideWidth */, double /* SlideHeight */, double /* DispWidth */, double /* DispHeight */ )
+{
+    Primitive Slide1, Slide2;
+
+    Slide1.pushTriangle (basegfx::B2DVector (0,0), basegfx::B2DVector (1,0), basegfx::B2DVector (0,1));
+    Slide1.pushTriangle (basegfx::B2DVector (1,0), basegfx::B2DVector (0,1), basegfx::B2DVector (1,1));
+    maEnteringSlidePrimitives.push_back (Slide1);
+
+    
+    if( nTime >= 0.5 ) {
+        double m = 1 - nTime;
+
+        Slide2.pushTriangle (basegfx::B2DVector (0,0), basegfx::B2DVector (m,0), basegfx::B2DVector (0,m));
+        Slide2.pushTriangle (basegfx::B2DVector (nTime,0), basegfx::B2DVector (1,0), basegfx::B2DVector (1,m));
+        Slide2.pushTriangle (basegfx::B2DVector (1,nTime), basegfx::B2DVector (1,1), basegfx::B2DVector (nTime,1));
+        Slide2.pushTriangle (basegfx::B2DVector (0,nTime), basegfx::B2DVector (m,1), basegfx::B2DVector (0,1));
+    } else {
+        double l = 0.5 - nTime;
+        double h = 0.5 + nTime;
+
+        Slide2.pushTriangle (basegfx::B2DVector (0,0), basegfx::B2DVector (1,0), basegfx::B2DVector (0.5,l));
+        Slide2.pushTriangle (basegfx::B2DVector (0.5,l), basegfx::B2DVector (1,0), basegfx::B2DVector (h,0.5));
+        Slide2.pushTriangle (basegfx::B2DVector (1,0), basegfx::B2DVector (1,1), basegfx::B2DVector (h,0.5));
+        Slide2.pushTriangle (basegfx::B2DVector (h,0.5), basegfx::B2DVector (1,1), basegfx::B2DVector (0.5,h));
+        Slide2.pushTriangle (basegfx::B2DVector (0.5,h), basegfx::B2DVector (1,1), basegfx::B2DVector (0,1));
+        Slide2.pushTriangle (basegfx::B2DVector (l,0.5), basegfx::B2DVector (0.5,h), basegfx::B2DVector (0,1));
+        Slide2.pushTriangle (basegfx::B2DVector (0,0), basegfx::B2DVector (l,0.5), basegfx::B2DVector (0,1));
+        Slide2.pushTriangle (basegfx::B2DVector (0,0), basegfx::B2DVector (0.5,l), basegfx::B2DVector (l,0.5));
+    }
+    Slide2.Operations.push_back (new STranslate (basegfx::B3DVector (0, 0, 0.00000001), false, -1, 0));
+    maLeavingSlidePrimitives.push_back (Slide2);
+}
+
+void OGLTransitionImpl::makeVenetianBlinds( bool vertical, int parts )
+{
+    static double t30 = tan( M_PI/6.0 );
+    double n, ln = 0;
+    double p = 1.0/parts;
+
+    for( int i=0; i<parts; i++ ) {
+        Primitive Slide;
+        n = (i + 1)/(double)parts;
+        if( vertical ) {
+            Slide.pushTriangle (basegfx::B2DVector (ln,0), basegfx::B2DVector (n,0), basegfx::B2DVector (ln,1));
+            Slide.pushTriangle (basegfx::B2DVector (n,0), basegfx::B2DVector (ln,1), basegfx::B2DVector (n,1));
+            Slide.Operations.push_back(new RotateAndScaleDepthByWidth(basegfx::B3DVector(0, 1, 0), basegfx::B3DVector(n + ln - 1, 0, -t30*p), -120, true, 0.0, 1.0));
+        } else {
+            Slide.pushTriangle (basegfx::B2DVector (0,ln), basegfx::B2DVector (1,ln), basegfx::B2DVector (0,n));
+            Slide.pushTriangle (basegfx::B2DVector (1,ln), basegfx::B2DVector (0,n), basegfx::B2DVector (1,n));
+            Slide.Operations.push_back(new RotateAndScaleDepthByHeight(basegfx::B3DVector(1, 0, 0), basegfx::B3DVector(0, 1 - n - ln, -t30*p), -120, true, 0.0, 1.0));
+        }
+        maLeavingSlidePrimitives.push_back (Slide);
+
+        if( vertical ) {
+            Slide.Operations.push_back(new SRotate(basegfx::B3DVector(0, 1, 0), basegfx::B3DVector(2*n - 1, 0, 0), -60, false, -1, 0));
+            Slide.Operations.push_back(new SRotate(basegfx::B3DVector(0, 1, 0), basegfx::B3DVector(n + ln - 1, 0, 0), 180, false, -1, 0));
+        } else {
+            Slide.Operations.push_back(new SRotate(basegfx::B3DVector(1, 0, 0), basegfx::B3DVector(0, 1 - 2*n, 0), -60, false, -1, 0));
+            Slide.Operations.push_back(new SRotate(basegfx::B3DVector(1, 0, 0), basegfx::B3DVector(0, 1 - n - ln, 0), 180, false, -1, 0));
+        }
+        maEnteringSlidePrimitives.push_back (Slide);
+        ln = n;
+    }
+}
+
+void OGLTransitionImpl::displaySlidesFadeSmoothly( double nTime, ::sal_Int32 glLeavingSlideTex, ::sal_Int32 glEnteringSlideTex, double SlideWidthScale, double SlideHeightScale )
+{
+    applyOverallOperations( nTime, SlideWidthScale, SlideHeightScale );
+
+    glDisable(GL_DEPTH_TEST);
+
+    displaySlide( nTime, glLeavingSlideTex, maLeavingSlidePrimitives, SlideWidthScale, SlideHeightScale );
+
+    glDisable(GL_LIGHTING);
+    glEnable(GL_BLEND);
+    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+    glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
+    glColor4f( 1, 1, 1, nTime );
+    displaySlide( nTime, glEnteringSlideTex, maEnteringSlidePrimitives, SlideWidthScale, SlideHeightScale );
+    glDisable(GL_BLEND);
+    glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
+    glEnable(GL_LIGHTING);
+
+    glEnable(GL_DEPTH_TEST);
+}
+
+void OGLTransitionImpl::makeFadeSmoothly()
+{ 
+    Primitive Slide;
+
+    Slide.pushTriangle (basegfx::B2DVector (0,0), basegfx::B2DVector (1,0), basegfx::B2DVector (0,1));
+    Slide.pushTriangle (basegfx::B2DVector (1,0), basegfx::B2DVector (0,1), basegfx::B2DVector (1,1));
+    maLeavingSlidePrimitives.push_back (Slide);
+    maEnteringSlidePrimitives.push_back (Slide);
+
+    mmDisplaySlides = &OGLTransitionImpl::displaySlidesFadeSmoothly;
+    mbUseMipMapLeaving = mbUseMipMapEntering = false;
+}
+
+void OGLTransitionImpl::displaySlidesFadeThroughBlack( double nTime, ::sal_Int32 glLeavingSlideTex, ::sal_Int32 glEnteringSlideTex, double SlideWidthScale, double SlideHeightScale )
+{
+    applyOverallOperations( nTime, SlideWidthScale, SlideHeightScale );
+
+    glDisable(GL_DEPTH_TEST);
+
+    glDisable(GL_LIGHTING);
+    glEnable(GL_BLEND);
+    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+    glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
+    if( nTime < 0.5 ) {
+	glColor4f( 1, 1, 1, 1 - nTime*2 );
+	displaySlide( nTime, glLeavingSlideTex, maLeavingSlidePrimitives, SlideWidthScale, SlideHeightScale );
+    } else {
+	glColor4f( 1, 1, 1, (nTime - 0.5)*2 );
+	displaySlide( nTime, glEnteringSlideTex, maEnteringSlidePrimitives, SlideWidthScale, SlideHeightScale );
+    }
+    glDisable(GL_BLEND);
+    glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
+    glEnable(GL_LIGHTING);
+
+    glEnable(GL_DEPTH_TEST);
+}
+
+void OGLTransitionImpl::makeFadeThroughBlack()
+{ 
+    Primitive Slide;
+
+    Slide.pushTriangle (basegfx::B2DVector (0,0), basegfx::B2DVector (1,0), basegfx::B2DVector (0,1));
+    Slide.pushTriangle (basegfx::B2DVector (1,0), basegfx::B2DVector (0,1), basegfx::B2DVector (1,1));
+    maLeavingSlidePrimitives.push_back (Slide);
+    maEnteringSlidePrimitives.push_back (Slide);
+
+    mmDisplaySlides = &OGLTransitionImpl::displaySlidesFadeThroughBlack;
+    mbUseMipMapLeaving = mbUseMipMapEntering = false;
+}
+
+static const char* basicVertexShader = "\n\
+varying vec2 v_texturePosition;\n\
+\n\
+void main( void )\n\
+{\n\
+	gl_Position = ftransform();\n\
+	v_texturePosition = gl_MultiTexCoord0.xy;\n\
+}\n\
+";
+
+static const char* staticFragmentShader = "\n\
+uniform sampler2D leavingSlideTexture;\n\
+uniform sampler2D enteringSlideTexture;\n\
+uniform sampler2D permTexture;\n\
+uniform float time;\n\
+varying vec2 v_texturePosition;\n\
+\n\
+float snoise(vec2 P) {\n\
+\n\
+  return texture2D(permTexture, P).r;\n\
+}\n\
+\n\
+\n\
+#define PART 0.5\n\
+#define START 0.4\n\
+#define END 0.9\n\
+\n\
+void main() {\n\
+    float sn = snoise(10.0*v_texturePosition+time*0.07);\n\
+    if( time < PART ) {\n\
+        float sn1 = snoise(vec2(time*15.0, 20.0*v_texturePosition.y));\n\
+        float sn2 = snoise(v_texturePosition);\n\
+        if (sn1 > 1.0 - time*time && sn2 < 2.0*time+0.1)\n\
+	        gl_FragColor = vec4(sn, sn, sn, 1.0);\n\
+        else if (time > START )\n\
+            gl_FragColor = ((time-START)/(PART - START))*vec4(sn, sn, sn, 1.0) + (1.0 - (time - START)/(PART - START))*texture2D(leavingSlideTexture, v_texturePosition);\n\
+        else\n\
+            gl_FragColor = texture2D(leavingSlideTexture, v_texturePosition);\n\
+    } else if ( time < PART ) {\n\
+            gl_FragColor = texture2D(leavingSlideTexture, v_texturePosition);\n\
+    } else if ( time > END ) {\n\
+        gl_FragColor = ((1.0 - time)/(1.0 - END))*vec4(sn, sn, sn, 1.0) + ((time - END)/(1.0 - END))*texture2D(enteringSlideTexture, v_texturePosition);\n\
+    } else \n\
+	    gl_FragColor = vec4(sn, sn, sn, 1.0);\n\
+}\n\
+";
+
+static const char* dissolveFragmentShader = "\n\
+uniform sampler2D leavingSlideTexture;\n\
+uniform sampler2D enteringSlideTexture;\n\
+uniform sampler2D permTexture;\n\
+uniform float time;\n\
+varying vec2 v_texturePosition;\n\
+\n\
+float snoise(vec2 P) {\n\
+\n\
+  return texture2D(permTexture, P).r;\n\
+}\n\
+\n\
+void main() {\n\
+     float sn = snoise(10.0*v_texturePosition);\n\
+     if( sn < time)\n\
+         gl_FragColor = texture2D(enteringSlideTexture, v_texturePosition);\n\
+     else\n\
+         gl_FragColor = texture2D(leavingSlideTexture, v_texturePosition);\n\
+}\n\
+";
+
+int permutation256 [256]= {
+215, 100, 200, 204, 233,  50,  85, 196, 
+ 71, 141, 122, 160,  93, 131, 243, 234, 
+162, 183,  36, 155,   4,  62,  35, 205, 
+ 40, 102,  33,  27, 255,  55, 214, 156, 
+ 75, 163, 134, 126, 249,  74, 197, 228, 
+ 72,  90, 206, 235,  17,  22,  49, 169, 
+227,  89,  16,   5, 117,  60, 248, 230, 
+217,  68, 138,  96, 194, 170, 136,  10, 
+112, 238, 184, 189, 176,  42, 225, 212, 
+ 84,  58, 175, 244, 150, 168, 219, 236, 
+101, 208, 123,  37, 164, 110, 158, 201, 
+ 78, 114,  57,  48,  70, 142, 106,  43, 
+232,  26,  32, 252, 239,  98, 191,  94, 
+ 59, 149,  39, 187, 203, 190,  19,  13, 
+133,  45,  61, 247,  23,  34,  20,  52, 
+118, 209, 146, 193, 222,  18,   1, 152, 
+ 46,  41,  91, 148, 115,  25, 135,  77, 
+254, 147, 224, 161,   9, 213, 223, 250, 
+231, 251, 127, 166,  63, 179,  81, 130, 
+139,  28, 120, 151, 241,  86, 111,   0, 
+ 88, 153, 172, 182, 159, 105, 178,  47, 
+ 51, 167,  65,  66,  92,  73, 198, 211, 
+245, 195,  31, 220, 140,  76, 221, 186, 
+154, 185,  56,  83,  38, 165, 109,  67, 
+124, 226, 132,  53, 229,  29,  12, 181, 
+121,  24, 207, 199, 177, 113,  30,  80, 
+  3,  97, 188,  79, 216, 173,   8, 145, 
+ 87, 128, 180, 237, 240, 137, 125, 104, 
+ 15, 242, 119, 246, 103, 143,  95, 144, 
+  2,  44,  69, 157, 192, 174,  14,  54, 
+218,  82,  64, 210,  11,   6, 129,  21, 
+116, 171,  99, 202,   7, 107, 253, 108
+};
+
+void initPermTexture(GLuint *texID)
+{
+  glGenTextures(1, texID);
+  glBindTexture(GL_TEXTURE_2D, *texID);
+
+  static bool initialized = false;
+  static unsigned char permutation2D[256*256*4];
+  if( !initialized ) {
+      int x, y;
+
+      for( y=0; y < 256; y++ )
+          for( x=0; x < 256; x++ )
+              permutation2D[x*4 + y*1024] = permutation256[(y + permutation256[x]) & 0xff];
+
+      initialized = true;
+  }
+
+  glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, 256, 256, 0, GL_RGBA, GL_UNSIGNED_BYTE, permutation2D );
+  glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
+  glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
+}
+
+void OGLTransitionImpl::preparePermShader()
+{
+#ifdef GL_VERSION_2_0
+    if( mProgramObject ) {
+        OGLShaders::glUseProgram( mProgramObject );
+
+        GLint location = OGLShaders::glGetUniformLocation( mProgramObject, "leavingSlideTexture" );
+        if( location != -1 ) {
+            OGLShaders::glUniform1i( location, 0 );  // texture unit 0
+        }
+
+        glActiveTexture(GL_TEXTURE1);
+        if( !maHelperTexture )
+            initPermTexture( &maHelperTexture );
+        glActiveTexture(GL_TEXTURE0);
+
+        location = OGLShaders::glGetUniformLocation( mProgramObject, "permTexture" );
+        if( location != -1 ) {
+            OGLShaders::glUniform1i( location, 1 );  // texture unit 1
+        }
+
+        location = OGLShaders::glGetUniformLocation( mProgramObject, "enteringSlideTexture" );
+        if( location != -1 ) {
+            OGLShaders::glUniform1i( location, 2 );  // texture unit 2
+        }
+    }
+#endif
+}
+
+void OGLTransitionImpl::prepareStatic( ::sal_Int32 /* glLeavingSlideTex */, ::sal_Int32 /* glEnteringSlideTex */ )
+{
+    mProgramObject = OGLShaders::LinkProgram( basicVertexShader, staticFragmentShader );
+
+    preparePermShader();
+}
+
+void OGLTransitionImpl::displaySlidesShaders( double nTime, ::sal_Int32 glLeavingSlideTex, ::sal_Int32 glEnteringSlideTex,
+                                              double SlideWidthScale, double SlideHeightScale )
+{
+    applyOverallOperations( nTime, SlideWidthScale, SlideHeightScale );
+
+#ifdef GL_VERSION_2_0
+    if( mProgramObject ) {
+        GLint location = OGLShaders::glGetUniformLocation( mProgramObject, "time" );
+        if( location != -1 ) {
+            OGLShaders::glUniform1f( location, nTime );
+        }
+    }
+
+    glActiveTexture( GL_TEXTURE2 );
+    glBindTexture( GL_TEXTURE_2D, glEnteringSlideTex );
+    glActiveTexture( GL_TEXTURE0 );
+#endif
+
+    displaySlide( nTime, glLeavingSlideTex, maLeavingSlidePrimitives, SlideWidthScale, SlideHeightScale );
+}
+
+void OGLTransitionImpl::makeStatic()
+{
+    Primitive Slide;
+
+    Slide.pushTriangle (basegfx::B2DVector (0,0), basegfx::B2DVector (1,0), basegfx::B2DVector (0,1));
+    Slide.pushTriangle (basegfx::B2DVector (1,0), basegfx::B2DVector (0,1), basegfx::B2DVector (1,1));
+    maLeavingSlidePrimitives.push_back (Slide);
+    maEnteringSlidePrimitives.push_back (Slide);
+
+    mmDisplaySlides = &OGLTransitionImpl::displaySlidesShaders;
+    mmPrepareTransition = &OGLTransitionImpl::prepareStatic;
+    mbUseMipMapLeaving = mbUseMipMapEntering = false;
+
+    mnRequiredGLVersion = 2.0;
+}
+
+void OGLTransitionImpl::prepareDissolve( ::sal_Int32 /* glLeavingSlideTex */, ::sal_Int32 /* glEnteringSlideTex */ )
+{
+    mProgramObject = OGLShaders::LinkProgram( basicVertexShader, dissolveFragmentShader );
+
+    preparePermShader();
+}
+
+void OGLTransitionImpl::makeDissolve()
+{
+    Primitive Slide;
+
+    Slide.pushTriangle (basegfx::B2DVector (0,0), basegfx::B2DVector (1,0), basegfx::B2DVector (0,1));
+    Slide.pushTriangle (basegfx::B2DVector (1,0), basegfx::B2DVector (0,1), basegfx::B2DVector (1,1));
+    maLeavingSlidePrimitives.push_back (Slide);
+    maEnteringSlidePrimitives.push_back (Slide);
+
+    mmDisplaySlides = &OGLTransitionImpl::displaySlidesShaders;
+    mmPrepareTransition = &OGLTransitionImpl::prepareDissolve;
+    mbUseMipMapLeaving = mbUseMipMapEntering = false;
+
+    mnRequiredGLVersion = 2.0;
+}
+
+void OGLTransitionImpl::makeNewsflash()
+{
+    Primitive Slide;
+    
+    Slide.pushTriangle(basegfx::B2DVector(0,0),basegfx::B2DVector(1,0),basegfx::B2DVector(0,1));
+    Slide.pushTriangle(basegfx::B2DVector(1,0),basegfx::B2DVector(0,1),basegfx::B2DVector(1,1));
+    Slide.Operations.push_back(new SRotate(basegfx::B3DVector(0,0,1),basegfx::B3DVector(0,0,0),3000,true,0,0.5));
+    Slide.Operations.push_back(new SScale(basegfx::B3DVector(0.01,0.01,0.01),basegfx::B3DVector(0,0,0),true,0,0.5));
+    Slide.Operations.push_back(new STranslate(basegfx::B3DVector(-10000, 0, 0),false, 0.5, 2));
+    maLeavingSlidePrimitives.push_back(Slide);
+
+    Slide.Operations.clear();
+    Slide.Operations.push_back(new SRotate(basegfx::B3DVector(0,0,1),basegfx::B3DVector(0,0,0),-3000,true,0.5,1));
+    Slide.Operations.push_back(new STranslate(basegfx::B3DVector(-100, 0, 0),false, -1, 1));
+    Slide.Operations.push_back(new STranslate(basegfx::B3DVector(100, 0, 0),false, 0.5, 1));
+    Slide.Operations.push_back(new SScale(basegfx::B3DVector(0.01,0.01,0.01),basegfx::B3DVector(0,0,0),false,-1,1));
+    Slide.Operations.push_back(new SScale(basegfx::B3DVector(100,100,100),basegfx::B3DVector(0,0,0),true,0.5,1));
+    maEnteringSlidePrimitives.push_back(Slide);
+
+    OverallOperations.push_back(new SRotate(basegfx::B3DVector(0,0,1),basegfx::B3DVector(0.2,0.2,0),1080,true,0,1));
+}
+

slideshow/source/engine/OGLTrans/OGLTrans_TransitionImpl.hxx

 {
 public:
     OGLTransitionImpl() :
+        mbUseMipMapLeaving( true ),
+        mbUseMipMapEntering( true ),
+        mnRequiredGLVersion( 1.0 ),
         maLeavingSlidePrimitives(),
         maEnteringSlidePrimitives(),
-        maSceneObjects()
+        maSceneObjects(),
+        mbReflectSlides( false ),
+        mVertexObject( 0 ),
+        mFragmentObject( 0 ),
+        mProgramObject( 0 ),
+        maHelperTexture( 0 ),
+        mmPrepare( NULL ),
+        mmPrepareTransition( NULL ),
+        mmClearTransition( NULL ),
+        mmDisplaySlides( NULL )
     {}
 
     ~OGLTransitionImpl();
     
-    void prepare();
-    void display( double nTime, ::sal_Int32 glLeavingSlideTex, ::sal_Int32 glEnteringSlideTex, double SlideWidth, double SlideHeight, double DispWidth, double DispHeight);
+    void prepare( ::sal_Int32 glLeavingSlideTex, ::sal_Int32 glEnteringSlideTex );
+    void display( double nTime, ::sal_Int32 glLeavingSlideTex, ::sal_Int32 glEnteringSlideTex, double SlideWidth, double SlideHeight, double DispWidth, double DispHeight );
     void finish();
 
     void makeOutsideCubeFaceToLeft();
     void makeTurnDown();
     void makeIris();
     void makeRochade();
+    void makeVenetianBlinds( bool vertical, int parts );
+    void makeStatic();
+    void makeDissolve();
+    void makeNewsflash();
+
+    /** 2D replacements
+     */
+    void makeDiamond();
+    void makeFadeSmoothly();
+    void makeFadeThroughBlack();
+
+    /** Whether to use mipmaping for slides textures
+     */
+    bool mbUseMipMapLeaving;
+    bool mbUseMipMapEntering;
+
+    /** which GL version does the transition require
+     */
+    float mnRequiredGLVersion;
 
 private:
     /** clears all the primitives and operations
     /** All the operations that should be applied to both leaving and entering slide primitives. These operations will be called in the order they were pushed back in. In OpenGL this effectively uses the operations in the opposite order they were pushed back.
 	*/
 	vector<Operation*> OverallOperations;
+
+	/** Whether to reflect slides, the reflection happens on flat surface beneath the slides.
+	 ** Now it only works with slides which keep their rectangular shape together.
+	 */
+	bool mbReflectSlides;
+
+	/** GLSL objects, shaders and program
+	 */
+	GLuint mVertexObject, mFragmentObject, mProgramObject;
+
+	/** various data */
+	GLuint maHelperTexture;
+
+	/** When this method is not NULL, it is called in display method to prepare the slides, scene, etc.
+	 ** We might later replace this by cleaner derived class.
+	 */
+	void (OGLTransitionImpl::*mmPrepare)( double nTime, double SlideWidth, double SlideHeight, double DispWidth, double DispHeight );
+
+	/** When this method is not NULL, it is called after glx context is ready to let the transition prepare GL related things, like GLSL program.
+	 ** We might later replace this by cleaner derived class.
+	 */
+	void (OGLTransitionImpl::*mmPrepareTransition)( ::sal_Int32 glLeavingSlideTex, ::sal_Int32 glEnteringSlideTex );
+
+	/** When this method is not NULL, it is called when the transition needs to clear after itself, like delete own textures etc.
+	 ** We might later replace this by cleaner derived class.
+	 */
+	void (OGLTransitionImpl::*mmClearTransition)();
+
+	/** When this method is not NULL, it is called in display method to display the slides.
+	 ** We might later replace this by cleaner derived class.
+	 */
+	void (OGLTransitionImpl::*mmDisplaySlides)( double nTime, ::sal_Int32 glLeavingSlideTex, ::sal_Int32 glEnteringSlideTex, double SlideWidthScale, double SlideHeightScale );
+
+	void displaySlides( double nTime, ::sal_Int32 glLeavingSlideTex, ::sal_Int32 glEnteringSlideTex, double SlideWidthScale, double SlideHeightScale );
+	void displaySlide( double nTime, ::sal_Int32 glSlideTex, std::vector<Primitive>& primitives, double SlideWidthScale, double SlideHeightScale );
+	void displayScene( double nTime, double SlideWidth, double SlideHeight, double DispWidth, double DispHeight);
+	void applyOverallOperations( double nTime, double SlideWidthScale, double SlideHeightScale );
+
+	/** various transitions helper methods
+	 */
+	void prepareDiamond( double nTime, double SlideWidth, double SlideHeight,double DispWidth, double DispHeight );
+	void displaySlidesFadeSmoothly( double nTime, ::sal_Int32 glLeavingSlideTex, ::sal_Int32 glEnteringSlideTex, double SlideWidthScale, double SlideHeightScale );
+        void displaySlidesFadeThroughBlack( double nTime, ::sal_Int32 glLeavingSlideTex, ::sal_Int32 glEnteringSlideTex, double SlideWidthScale, double SlideHeightScale );
+        void displaySlidesRochade( double nTime, ::sal_Int32 glLeavingSlideTex, ::sal_Int32 glEnteringSlideTex, double SlideWidthScale, double SlideHeightScale );
+	void displaySlidesShaders( double nTime, ::sal_Int32 glLeavingSlideTex, ::sal_Int32 glEnteringSlideTex, double SlideWidthScale, double SlideHeightScale );
+	void prepareStatic( ::sal_Int32 glLeavingSlideTex, ::sal_Int32 glEnteringSlideTex );
+	void prepareDissolve( ::sal_Int32 glLeavingSlideTex, ::sal_Int32 glEnteringSlideTex );
+	void preparePermShader();
 };
 
 class SceneObject
     Primitive(const Primitive& rvalue);
 	~Primitive();
 
+    void applyOperations(double nTime, double SlideWidthScale, double SlideHeightScale);
     void display(double nTime, double SlideWidthScale, double SlideHeightScale);
     const Primitive& operator=(const Primitive& rvalue);
     
 	double angle;
 };
 
+/** Same as SRotate, except the depth is scaled by the width of the slide divided by the height of the window.
+*/
+class RotateAndScaleDepthByHeight: public Operation
+{
+public:
+	void interpolate(double t,double SlideWidthScale,double SlideHeightScale);
+    RotateAndScaleDepthByHeight* clone();
+
+	RotateAndScaleDepthByHeight(const basegfx::B3DVector& Axis,const basegfx::B3DVector& Origin,double Angle,bool bInter, double T0, double T1);
+	~RotateAndScaleDepthByHeight(){}
+private:
+	basegfx::B3DVector axis;
+    basegfx::B3DVector origin;
+	double angle;
+};
+
 #endif // INCLUDED_SLIDESHOW_TRANSITION_HXX_
 

slideshow/source/engine/OGLTrans/OGLTrans_TransitionerImpl.cxx

  *
  ************************************************************************/
 
+#define GLX_GLXEXT_PROTOTYPES 1
 #include "OGLTrans_TransitionImpl.hxx"
 
+#include <com/sun/star/beans/XFastPropertySet.hpp>
 #include <com/sun/star/rendering/IntegerBitmapLayout.hpp>
 #include <com/sun/star/rendering/ColorComponentTag.hpp>
 #include <com/sun/star/rendering/ColorSpaceType.hpp>
 namespace unx
 {
 #include <X11/keysym.h>
+#include <X11/X.h>
 #include <GL/glx.h>
+#include <GL/glxext.h>
 }
 #endif
 
+#ifdef DEBUG
+#include <boost/date_time/posix_time/posix_time.hpp>
+using namespace ::boost::posix_time;
+
+static ptime t1;
+static ptime t2;
+
+#define DBG(x) x
+#else
+#define DBG(x)
+#endif
+
 using namespace ::com::sun::star;
+using ::com::sun::star::beans::XFastPropertySet;
+using ::com::sun::star::uno::Any;
+using ::com::sun::star::uno::Reference;
+using ::com::sun::star::uno::Sequence;
+using ::com::sun::star::uno::UNO_QUERY;
+using ::com::sun::star::uno::UNO_QUERY_THROW;
 
 namespace
 {
 
 typedef cppu::WeakComponentImplHelper1<presentation::XTransition> OGLTransitionerImplBase;
 
-/** This is the Transitioner class for OpenGL 3D transitions in
- * slideshow. At the moment, it's Linux only. This class is implicitly
- * constructed from XTransitionFactory.
-*/
-class OGLTransitionerImpl : private cppu::BaseMutex, private boost::noncopyable, public OGLTransitionerImplBase
-{
-public:
-    explicit OGLTransitionerImpl(OGLTransitionImpl* pOGLTransition);
-    void initWindowFromSlideShowView( const uno::Reference< presentation::XSlideShowView >& xView, double, double);
-    void setSlides( const uno::Reference< rendering::XBitmap >& xLeavingSlide , const uno::Reference< rendering::XBitmap >& xEnteringSlide );
-
-    // XTransition
-	virtual void SAL_CALL update( double nTime ) throw (uno::RuntimeException);
-    
-protected:
-    // WeakComponentImplHelperBase
-    virtual void SAL_CALL disposing();
-    
-    bool isDisposed() const
-    {
-        return (rBHelper.bDisposed || rBHelper.bInDispose);
-    }
-
-private:    
-    /** After the window has been created, and the slides have been set, we'll initialize the slides with OpenGL.
-    */
-    void GLInitSlides();
-
-
-    /// Holds the information of our new child window
-    struct GLWindow
-    {
-#if defined( WNT ) 
-			HWND					hWnd;
-			HDC						hDC;
-			HGLRC					hRC;
-#elif defined( OS2 )
-#elif defined( QUARTZ )
-#elif defined( UNX )
-    		unx::Display*           dpy;
-    		int						screen;
-    		unx::Window				win;
-    		unx::GLXContext			ctx;
-#endif
-    	unsigned int			bpp;
-    	unsigned int            Width;
-    	unsigned int            Height;
-    } GLWin;
-    
-    /** OpenGL handle to the leaving slide's texture
-    */
-    unsigned int GLleavingSlide;
-    /** OpenGL handle to the entering slide's texture
-    */
-    unsigned int GLenteringSlide;
-    
-    /** pointer to our window which we MIGHT create.
-    */
-    class SystemChildWindow* pWindow;
-    
-    /** raw bytes of the entering bitmap
-    */
-    uno::Sequence<sal_Int8> EnteringBytes;
-    
-    /** raw bytes of the leaving bitmap
-    */