[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    koffice/kpresenter
From:       Jan Hambrecht <jaham () gmx ! net>
Date:       2008-02-24 17:50:44
Message-ID: 1203875444.082120.11773.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 778822 by jaham:

implemented another page effect: fourBoxWipe

It feels very wrong to change KPrPageEffect and KPrPageEffectDocker
when adding a new page effect. I think it would be better if the 
particular effect strategy would return the subtype string which 
then gets picked up by the page effect docker via the effect factory.



 M  +5 -1      part/dockers/KPrPageEffectDocker.cpp  
 M  +5 -1      part/pageeffects/KPrPageEffect.h  
 M  +4 -0      plugins/pageeffects/edgewipe/CMakeLists.txt  
 M  +2 -0      plugins/pageeffects/edgewipe/Plugin.cpp  
 A             plugins/pageeffects/edgewipe/fourboxwipe (directory)  
 A             plugins/pageeffects/edgewipe/fourboxwipe/CornersInWipeStrategy.cpp   \
[License: LGPL (v2+)]  A             \
plugins/pageeffects/edgewipe/fourboxwipe/CornersInWipeStrategy.h   [License: LGPL \
(v2+)]  A             \
plugins/pageeffects/edgewipe/fourboxwipe/CornersOutWipeStrategy.cpp   [License: LGPL \
(v2+)]  A             \
plugins/pageeffects/edgewipe/fourboxwipe/CornersOutWipeStrategy.h   [License: LGPL \
(v2+)]  A             \
plugins/pageeffects/edgewipe/fourboxwipe/FourBoxWipeEffectFactory.cpp   [License: \
LGPL (v2+)]  A             \
plugins/pageeffects/edgewipe/fourboxwipe/FourBoxWipeEffectFactory.h   [License: LGPL \
(v2+)]  M  +4 -2      \
plugins/pageeffects/edgewipe/miscdiagonalwipe/DoubleBarnDoorWipeStrategy.cpp  


--- trunk/koffice/kpresenter/part/dockers/KPrPageEffectDocker.cpp #778821:778822
@@ -57,7 +57,11 @@
     I18N_NOOP( "From Six Counterclockwise" ),
     I18N_NOOP( "From Nine Counterclockwise" ),
     I18N_NOOP( "Double Barn Door" ),
-    I18N_NOOP( "Double Diamond" )
+    I18N_NOOP( "Double Diamond" ),
+    I18N_NOOP( "Corners In" ),
+    I18N_NOOP( "Corners In Reverse" ),
+    I18N_NOOP( "Corners Out" ),
+    I18N_NOOP( "Corners Out Reverse" )
 };
 
 KPrPageEffectDocker::KPrPageEffectDocker( QWidget* parent, Qt::WindowFlags flags )
--- trunk/koffice/kpresenter/part/pageeffects/KPrPageEffect.h #778821:778822
@@ -62,7 +62,11 @@
         FromSixCounterClockwise,
         FromNineCounterClockwise,
         DoubleBarnDoor,
-        DoubleDiamond
+        DoubleDiamond,
+        CornersIn,
+        CornersInReverse,
+        CornersOut,
+        CornersOutReverse
     };
 
     /**
--- trunk/koffice/kpresenter/plugins/pageeffects/edgewipe/CMakeLists.txt \
#778821:778822 @@ -6,6 +6,10 @@
     miscdiagonalwipe/MiscDiagonalWipeEffectFactory.cpp
     miscdiagonalwipe/DoubleBarnDoorWipeStrategy.cpp
     miscdiagonalwipe/DoubleDiamondWipeStrategy.cpp
+
+    fourboxwipe/FourBoxWipeEffectFactory.cpp
+    fourboxwipe/CornersInWipeStrategy.cpp
+    fourboxwipe/CornersOutWipeStrategy.cpp
     )
 
 kde4_add_plugin(kpr_pageeffect_edgewipe ${kpr_pageeffect_edgewipe_SRCS})
--- trunk/koffice/kpresenter/plugins/pageeffects/edgewipe/Plugin.cpp #778821:778822
@@ -22,6 +22,7 @@
 #include <KPrPageEffectRegistry.h>
 
 #include "miscdiagonalwipe/MiscDiagonalWipeEffectFactory.h"
+#include "fourboxwipe/FourBoxWipeEffectFactory.h"
 
 K_EXPORT_COMPONENT_FACTORY( kpr_pageeffect_edgewipe, KGenericFactory<Plugin>( \
"KPrPageEffect" ) )  
@@ -29,6 +30,7 @@
     : QObject(parent)
 {
     KPrPageEffectRegistry::instance()->add(new MiscDiagonalWipeEffectFactory());
+    KPrPageEffectRegistry::instance()->add(new FourBoxWipeEffectFactory());
 }
 
 #include "Plugin.moc"
--- trunk/koffice/kpresenter/plugins/pageeffects/edgewipe/miscdiagonalwipe/DoubleBarnDoorWipeStrategy.cpp \
#778821:778822 @@ -40,6 +40,7 @@
 void DoubleBarnDoorWipeStrategy::paintStep( QPainter &p, int currPos, const \
KPrPageEffect::Data &data )  {
     p.drawPixmap( QPoint( 0, 0 ), data.m_oldPage, data.m_widget->rect() );
+    p.setClipRegion( clipRegion( currPos, data.m_widget->rect() ) );
     p.drawPixmap( QPoint( 0, 0 ), data.m_newPage, data.m_widget->rect() );
 }
 
@@ -60,8 +61,9 @@
     int width_2 = area.width() >> 1;
     int height_2 = area.height() >> 1;
 
-    int stepx = static_cast<int>( width_2 * step / StepCount );
-    int stepy = static_cast<int>( height_2 * step / StepCount );
+    qreal percent = static_cast<qreal>( step ) / static_cast<qreal>( StepCount );
+    int stepx = static_cast<int>( width_2 * percent );
+    int stepy = static_cast<int>( height_2 * percent );
 
     QPolygon poly;
     poly.append( area.topLeft() );


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic