20#include "KPrEffectHandler.h"
23#include "KPrDocument.h"
27#include <KoZoomHandler.h>
28#include <tdeapplication.h>
31#include <tqpaintdevice.h>
36KPrEffectHandler::KPrEffectHandler(
PresStep step,
bool back, TQPaintDevice *dst, TQPixmap *src,
37 const TQPtrList<KPrObject> &objects, KPrView *view,
int _presSpeed )
38: m_effectStep(0), m_step(step), m_back(back), m_dst(dst),
39 m_paint(*src), m_objects(objects), m_view(view), m_soundEffect(TQString()),
42 m_src =
new TQPixmap( *src );
44 TQPtrListIterator<KPrObject> it( m_objects );
45 for ( ; it.current(); ++it )
47 KPrObject *
object = it.current();
48 if ( object->getAppearStep() == m_step.m_step
49 && ( m_step.m_subStep == 0
50 || ( object->getType() == OT_TEXT
51 && object->getEffect2() == EF2T_PARA ) ) )
53 m_appearEffectObjects.append(
object );
54 if ( object->getAppearSoundEffect() )
56 m_soundEffect =
object->getAppearSoundEffectFileName();
59 if ( object->getAppearTimer() > m_objectTimer )
61 m_objectTimer =
object->getAppearTimer();
64 else if ( object->getDisappear() && object->getDisappearStep() == m_step.m_step )
66 m_disappearEffectObjects.append(
object );
67 if ( object->getDisappearSoundEffect() )
69 m_soundEffect =
object->getDisappearSoundEffectFileName();
72 if ( object->getDisappearTimer() > m_objectTimer )
74 m_objectTimer =
object->getDisappearTimer();
79 float speedFactor = 150.0 /
static_cast<float>( _presSpeed + 2 );
80 m_stepWidth =
static_cast<int>( m_src->width() / speedFactor );
81 m_stepHeight =
static_cast<int>( m_src->height() / speedFactor );
82 m_lastRepaintRects.setAutoDelete(
true );
86KPrEffectHandler::~KPrEffectHandler()
92bool KPrEffectHandler::doEffect()
94 if ( m_effectStep == 0 )
96 if ( !m_view->kPresenterDoc()->spManualSwitch() )
98 m_view->stopAutoPresTimer();
101 if ( !m_soundEffect.isNull() )
103 m_view->getCanvas()->stopSound();
104 m_view->getCanvas()->playSound( m_soundEffect );
107 if ( !m_appearEffectObjects.isEmpty() || !m_disappearEffectObjects.isEmpty() )
109 TQPtrList<TQRect> m_removeRects;
110 KPrObject *appearObject = m_appearEffectObjects.first();
111 KPrObject *disappearObject = m_disappearEffectObjects.first();
112 TQPtrListIterator<KPrObject> it( m_objects );
115 while ( (
object = it.current() ) != 0 )
117 int speed[] = { 50, 35, 20 };
120 if (
object == appearObject )
124 double speedFactor = speed[
object->getAppearSpeed()];
126 m_stepWidth =
static_cast<int>( m_src->width() / speedFactor );
127 m_stepHeight =
static_cast<int>( m_src->height() / speedFactor );
129 if ( doAppearEffectStep(
object ) )
131 m_removeRects.append( m_repaintRects.getLast() );
132 if ( appearObject != m_appearEffectObjects.getLast() )
136 m_appearEffectObjects.remove();
139 drawObject(
object, 0, 0, m_src );
142 appearObject = m_appearEffectObjects.next();
144 appearObject = m_appearEffectObjects.current();
146 else if (
object == disappearObject )
150 double speedFactor = speed[
object->getDisappearSpeed()];
152 m_stepWidth =
static_cast<int>( m_src->width() / speedFactor );
153 m_stepHeight =
static_cast<int>( m_src->height() / speedFactor );
155 if ( doDisappearEffectStep(
object ) )
157 if ( disappearObject != m_disappearEffectObjects.getLast() )
161 m_disappearEffectObjects.remove();
165 disappearObject = m_disappearEffectObjects.next();
167 disappearObject = m_disappearEffectObjects.current();
174 TQPtrListIterator<TQRect> it_debug(m_repaintRects);
175 while( ( r = it_debug.current() ) != 0 )
178 TQPainter p( &m_paint );
179 TQPen pen = TQPen( TQt::red, 1, TQt::DashLine );
184 TQPtrListIterator<TQRect> it_debug2(m_lastRepaintRects);
185 while( ( r = it_debug2.current() ) != 0 )
188 TQPainter p( &m_paint );
189 TQPen pen = TQPen( TQt::green, 1, TQt::DashLine );
196 TQPtrListIterator<TQRect> it_r(m_repaintRects);
198 while( ( r = it_r.current() ) != 0 )
202 bitBlt( m_dst, r->x() - 5, r->y() - 5, &m_paint, r->x() - 5, r->y() - 5, r->width() + 10, r->height() + 10 );
204 TQPtrListIterator<TQRect> it2(m_lastRepaintRects);
205 while( ( r = it2.current() ) != 0 )
209 bitBlt( m_dst, r->x() - 5, r->y() - 5, &m_paint, r->x() - 5, r->y() - 5, r->width() + 10, r->height() + 10 );
212 bitBlt( m_dst, 0, 0, &m_paint);
215 m_lastRepaintRects = m_repaintRects;
216 TQPtrListIterator<TQRect> it3(m_removeRects);
217 while( ( r = it3.current() ) != 0 )
220 m_lastRepaintRects.remove( r );
223 m_repaintRects.clear();
228 bool retval = ( m_appearEffectObjects.isEmpty() && m_disappearEffectObjects.isEmpty() );
230 if ( retval && !m_view->kPresenterDoc()->spManualSwitch() )
232 m_view->setAutoPresTimer( m_objectTimer );
238void KPrEffectHandler::finish()
240 KPrObject *appearObject = m_appearEffectObjects.first();
241 KPrObject *disappearObject = m_disappearEffectObjects.first();
242 TQPtrListIterator<KPrObject> it( m_objects );
245 while ( (
object = it.current() ) != 0 )
248 if (
object == appearObject )
252 TQRect objectRect = m_view->zoomHandler()->zoomRect( object->getRealRect() );
253 m_repaintRects.append(
new TQRect( objectRect ) );
255 if ( appearObject != m_appearEffectObjects.getLast() )
259 m_appearEffectObjects.remove();
262 drawObject(
object, 0, 0, m_src );
265 appearObject = m_appearEffectObjects.next();
267 appearObject = m_appearEffectObjects.current();
269 else if (
object == disappearObject )
273 if ( disappearObject != m_disappearEffectObjects.getLast() )
277 m_disappearEffectObjects.remove();
280 disappearObject = m_disappearEffectObjects.next();
282 disappearObject = m_disappearEffectObjects.current();
285 bitBlt( m_dst, 0, 0, m_src );
287 if ( !m_view->kPresenterDoc()->spManualSwitch() && m_objectTimer > 0 )
289 m_view->setAutoPresTimer( m_objectTimer );
294bool KPrEffectHandler::doAppearEffectStep( KPrObject *
object )
296 bool positionReached =
true;
298 switch( object->getEffect() )
301 positionReached = appearNone(
object );
304 positionReached = appearComeLeft(
object );
307 positionReached = appearComeTop(
object );
310 positionReached = appearComeRight(
object );
313 positionReached = appearComeBottom(
object );
315 case EF_COME_LEFT_TOP:
316 positionReached = appearComeLeftTop(
object );
318 case EF_COME_LEFT_BOTTOM:
319 positionReached = appearComeLeftBottom(
object );
321 case EF_COME_RIGHT_TOP:
322 positionReached = appearComeRightTop(
object );
324 case EF_COME_RIGHT_BOTTOM:
325 positionReached = appearComeRightBottom(
object );
328 positionReached = appearWipeLeft(
object );
331 positionReached = appearWipeRight(
object );
334 positionReached = appearWipeTop(
object );
337 positionReached = appearWipeBottom(
object );
342 return positionReached;
346bool KPrEffectHandler::doDisappearEffectStep( KPrObject *
object )
348 bool positionReached =
true;
350 switch( object->getEffect3() )
355 positionReached = disappearGoLeft(
object );
358 positionReached = disappearGoTop(
object );
361 positionReached = disappearGoRight(
object );
364 positionReached = disappearGoBottom(
object );
366 case EF3_GO_LEFT_TOP:
367 positionReached = disappearGoLeftTop(
object );
369 case EF3_GO_LEFT_BOTTOM:
370 positionReached = disappearGoLeftBottom(
object );
372 case EF3_GO_RIGHT_TOP:
373 positionReached = disappearGoRightTop(
object );
375 case EF3_GO_RIGHT_BOTTOM:
376 positionReached = disappearGoRightBottom(
object );
379 positionReached = disappearWipeLeft(
object );
382 positionReached = disappearWipeRight(
object );
385 positionReached = disappearWipeTop(
object );
387 case EF3_WIPE_BOTTOM:
388 positionReached = disappearWipeBottom(
object );
393 return positionReached;
396bool KPrEffectHandler::appearNone( KPrObject *
object )
398 TQRect objectRect = m_view->zoomHandler()->zoomRect( object->getRealRect() );
399 m_repaintRects.append(
new TQRect( objectRect ) );
400 drawObject(
object, 0, 0, &m_paint );
405bool KPrEffectHandler::appearComeLeft( KPrObject *
object )
407 TQRect objectRect = m_view->zoomHandler()->zoomRect( object->getRealRect() );
408 TQRect repaintRect = m_view->zoomHandler()->zoomRect( object->getRepaintRect() );
409 int ox = objectRect.x();
410 int xdiff = repaintRect.x() - ox;
412 bool positionReached =
false;
413 int x = m_effectStep * m_stepWidth - objectRect.width();
417 positionReached =
true;
419 repaintRect.moveLeft( x + xdiff );
420 m_repaintRects.append(
new TQRect( repaintRect ) );
423 drawObject(
object, x - ox, 0, &m_paint );
425 return positionReached;
429bool KPrEffectHandler::appearComeTop( KPrObject *
object )
431 TQRect objectRect = m_view->zoomHandler()->zoomRect( object->getRealRect() );
432 TQRect repaintRect = m_view->zoomHandler()->zoomRect( object->getRepaintRect() );
433 int oy = objectRect.y();
434 int ydiff = repaintRect.y() - oy;
436 bool positionReached =
false;
437 int y = m_effectStep * m_stepHeight - objectRect.height();
441 positionReached =
true;
443 repaintRect.moveTop( y + ydiff );
444 m_repaintRects.append(
new TQRect( repaintRect ) );
447 drawObject(
object, 0, y - oy, &m_paint );
449 return positionReached;
453bool KPrEffectHandler::appearComeRight( KPrObject *
object )
455 TQRect objectRect = m_view->zoomHandler()->zoomRect( object->getRealRect() );
456 TQRect repaintRect = m_view->zoomHandler()->zoomRect( object->getRepaintRect() );
457 int ox = objectRect.x();
458 int xdiff = repaintRect.x() - ox;
460 bool positionReached =
false;
461 int x = m_src->width() - m_effectStep * m_stepWidth;
465 positionReached =
true;
467 repaintRect.moveLeft( x + xdiff );
468 m_repaintRects.append(
new TQRect( repaintRect ) );
471 drawObject(
object, x - ox, 0, &m_paint );
473 return positionReached;
477bool KPrEffectHandler::appearComeBottom( KPrObject *
object )
479 TQRect objectRect = m_view->zoomHandler()->zoomRect( object->getRealRect() );
480 TQRect repaintRect = m_view->zoomHandler()->zoomRect( object->getRepaintRect() );
481 int oy = objectRect.y();
482 int ydiff = repaintRect.y() - oy;
484 bool positionReached =
false;
485 int y = m_src->height() - m_effectStep * m_stepHeight;
489 positionReached =
true;
491 repaintRect.moveTop( y + ydiff );
492 m_repaintRects.append(
new TQRect( repaintRect ) );
495 drawObject(
object, 0, y - oy, &m_paint );
497 return positionReached;
501bool KPrEffectHandler::appearComeLeftTop( KPrObject *
object )
503 TQRect objectRect = m_view->zoomHandler()->zoomRect( object->getRealRect() );
504 TQRect repaintRect = m_view->zoomHandler()->zoomRect( object->getRepaintRect() );
505 int ox = objectRect.x();
506 int oy = objectRect.y();
507 int xdiff = repaintRect.x() - ox;
508 int ydiff = repaintRect.y() - oy;
510 bool positionReached =
false;
511 int x = m_effectStep * m_stepWidth - objectRect.width();
512 int y = m_effectStep * m_stepHeight - objectRect.height();
520 if ( x == ox && y == oy )
521 positionReached =
true;
523 repaintRect.moveLeft( x + xdiff );
524 repaintRect.moveTop( y + ydiff );
525 m_repaintRects.append(
new TQRect( repaintRect ) );
528 drawObject(
object, x - ox, y - oy, &m_paint );
530 return positionReached;
534bool KPrEffectHandler::appearComeLeftBottom( KPrObject *
object )
536 TQRect objectRect = m_view->zoomHandler()->zoomRect( object->getRealRect() );
537 TQRect repaintRect = m_view->zoomHandler()->zoomRect( object->getRepaintRect() );
538 int ox = objectRect.x();
539 int oy = objectRect.y();
540 int xdiff = repaintRect.x() - ox;
541 int ydiff = repaintRect.y() - oy;
543 bool positionReached =
false;
544 int x = m_effectStep * m_stepWidth - objectRect.width();
545 int y = m_src->height() - m_effectStep * m_stepHeight;
553 if ( x == ox && y == oy )
554 positionReached =
true;
556 repaintRect.moveLeft( x + xdiff );
557 repaintRect.moveTop( y + ydiff );
558 m_repaintRects.append(
new TQRect( repaintRect ) );
561 drawObject(
object, x - ox, y - oy, &m_paint );
563 return positionReached;
567bool KPrEffectHandler::appearComeRightTop( KPrObject *
object )
569 TQRect objectRect = m_view->zoomHandler()->zoomRect( object->getRealRect() );
570 TQRect repaintRect = m_view->zoomHandler()->zoomRect( object->getRepaintRect() );
571 int ox = objectRect.x();
572 int oy = objectRect.y();
573 int xdiff = repaintRect.x() - ox;
574 int ydiff = repaintRect.y() - oy;
576 bool positionReached =
false;
577 int x = m_src->width() - m_effectStep * m_stepWidth;
578 int y = m_effectStep * m_stepHeight - objectRect.height();
586 if ( x == ox && y == oy )
587 positionReached =
true;
589 repaintRect.moveLeft( x + xdiff );
590 repaintRect.moveTop( y + ydiff );
591 m_repaintRects.append(
new TQRect( repaintRect ) );
594 drawObject(
object, x - ox, y - oy, &m_paint );
596 return positionReached;
600bool KPrEffectHandler::appearComeRightBottom( KPrObject *
object )
602 TQRect objectRect = m_view->zoomHandler()->zoomRect( object->getRealRect() );
603 TQRect repaintRect = m_view->zoomHandler()->zoomRect( object->getRepaintRect() );
604 int ox = objectRect.x();
605 int oy = objectRect.y();
606 int xdiff = repaintRect.x() - ox;
607 int ydiff = repaintRect.y() - oy;
609 bool positionReached =
false;
610 int x = m_src->width() - m_effectStep * m_stepWidth;
611 int y = m_src->height() - m_effectStep * m_stepHeight;
619 if ( x == ox && y == oy )
620 positionReached =
true;
622 repaintRect.moveLeft( x + xdiff );
623 repaintRect.moveTop( y + ydiff );
624 m_repaintRects.append(
new TQRect( repaintRect ) );
627 drawObject(
object, x - ox, y - oy, &m_paint );
629 return positionReached;
633bool KPrEffectHandler::appearWipeLeft( KPrObject *
object )
635 TQRect repaintRect = m_view->zoomHandler()->zoomRect( object->getRepaintRect() );
636 int ow = repaintRect.width();
638 bool positionReached =
false;
639 int w = m_effectStep * m_stepWidth;
643 positionReached =
true;
646 repaintRect.setWidth( w );
647 m_repaintRects.append(
new TQRect( repaintRect ) );
648 drawObject(
object, 0, 0, &m_paint, &repaintRect );
650 return positionReached;
653bool KPrEffectHandler::appearWipeRight( KPrObject *
object )
655 TQRect repaintRect = m_view->zoomHandler()->zoomRect( object->getRepaintRect() );
656 int ow = repaintRect.width();
658 bool positionReached =
false;
659 int w = m_effectStep * m_stepWidth;
663 positionReached =
true;
666 repaintRect.setLeft( repaintRect.right() - w );
667 m_repaintRects.append(
new TQRect( repaintRect ) );
668 drawObject(
object, 0, 0, &m_paint, &repaintRect );
670 return positionReached;
674bool KPrEffectHandler::appearWipeTop( KPrObject *
object )
676 TQRect repaintRect = m_view->zoomHandler()->zoomRect( object->getRepaintRect() );
677 int oh = repaintRect.height();
679 bool positionReached =
false;
680 int h = m_effectStep * m_stepHeight;
684 positionReached =
true;
687 repaintRect.setHeight( h );
688 m_repaintRects.append(
new TQRect( repaintRect ) );
689 drawObject(
object, 0, 0, &m_paint, &repaintRect );
691 return positionReached;
695bool KPrEffectHandler::appearWipeBottom( KPrObject *
object )
697 TQRect repaintRect = m_view->zoomHandler()->zoomRect( object->getRepaintRect() );
698 int oh = repaintRect.height();
700 bool positionReached =
false;
701 int h = m_effectStep * m_stepHeight;
705 positionReached =
true;
708 repaintRect.setTop( repaintRect.bottom() - h );
709 m_repaintRects.append(
new TQRect( repaintRect ) );
710 drawObject(
object, 0, 0, &m_paint, &repaintRect );
712 return positionReached;
716bool KPrEffectHandler::disappearGoLeft( KPrObject *
object )
718 TQRect objectRect = m_view->zoomHandler()->zoomRect( object->getRealRect() );
719 TQRect repaintRect = m_view->zoomHandler()->zoomRect( object->getRepaintRect() );
720 int ox = objectRect.x();
722 bool positionReached =
false;
723 int x = m_effectStep * m_stepWidth;
724 if ( ox - x <= -objectRect.width() )
726 positionReached =
true;
730 repaintRect.moveBy( -x, 0 );
731 m_repaintRects.append(
new TQRect( repaintRect ) );
733 drawObject(
object, -x, 0, &m_paint );
736 return positionReached;
740bool KPrEffectHandler::disappearGoTop( KPrObject *
object )
742 TQRect objectRect = m_view->zoomHandler()->zoomRect( object->getRealRect() );
743 TQRect repaintRect = m_view->zoomHandler()->zoomRect( object->getRepaintRect() );
744 int oy = objectRect.y();
746 bool positionReached =
false;
747 int y = m_effectStep * m_stepHeight;
748 if ( oy - y <= -objectRect.height() )
750 positionReached =
true;
754 repaintRect.moveBy( 0, -y );
755 m_repaintRects.append(
new TQRect( repaintRect ) );
757 drawObject(
object, 0, -y, &m_paint );
760 return positionReached;
764bool KPrEffectHandler::disappearGoRight( KPrObject *
object )
766 int ox = m_view->zoomHandler()->zoomItX( object->getRealRect().x() );
767 TQRect repaintRect = m_view->zoomHandler()->zoomRect( object->getRepaintRect() );
769 bool positionReached =
false;
770 int x = m_effectStep * m_stepWidth;
771 if ( x + ox >= m_src->width() )
773 positionReached =
true;
777 repaintRect.moveBy( x, 0 );
778 m_repaintRects.append(
new TQRect( repaintRect ) );
780 drawObject(
object, x, 0, &m_paint );
783 return positionReached;
787bool KPrEffectHandler::disappearGoBottom( KPrObject *
object )
789 int oy = m_view->zoomHandler()->zoomItY( object->getRealRect().y() );
790 TQRect repaintRect = m_view->zoomHandler()->zoomRect( object->getRepaintRect() );
792 bool positionReached =
false;
793 int y = m_effectStep * m_stepHeight;
794 if ( oy + y >= m_src->height() )
796 positionReached =
true;
800 repaintRect.moveBy( 0, y );
801 m_repaintRects.append(
new TQRect( repaintRect ) );
803 drawObject(
object, 0, y, &m_paint );
806 return positionReached;
810bool KPrEffectHandler::disappearGoLeftTop( KPrObject *
object )
812 TQRect objectRect = m_view->zoomHandler()->zoomRect( object->getRealRect() );
813 TQRect repaintRect = m_view->zoomHandler()->zoomRect( object->getRepaintRect() );
814 int ox = objectRect.x();
815 int oy = objectRect.y();
817 bool positionReached =
false;
818 int x = m_effectStep * m_stepWidth;
819 int y = m_effectStep * m_stepHeight;
820 if ( ox - x <= -objectRect.width() || oy - y <= -objectRect.height() )
822 positionReached =
true;
826 repaintRect.moveBy( -x, -y );
827 m_repaintRects.append(
new TQRect( repaintRect ) );
829 drawObject(
object, -x, -y, &m_paint );
832 return positionReached;
836bool KPrEffectHandler::disappearGoLeftBottom( KPrObject *
object )
838 TQRect objectRect = m_view->zoomHandler()->zoomRect( object->getRealRect() );
839 TQRect repaintRect = m_view->zoomHandler()->zoomRect( object->getRepaintRect() );
840 int ox = objectRect.x();
841 int oy = objectRect.y();
843 bool positionReached =
false;
844 int x = m_effectStep * m_stepWidth;
845 int y = m_effectStep * m_stepHeight;
846 if ( ox - x <= -objectRect.width() || oy + y >= m_src->height() )
848 positionReached =
true;
852 repaintRect.moveBy( -x, y );
853 m_repaintRects.append(
new TQRect( repaintRect ) );
855 drawObject(
object, -x, y, &m_paint );
858 return positionReached;
862bool KPrEffectHandler::disappearGoRightTop( KPrObject *
object )
864 TQRect objectRect = m_view->zoomHandler()->zoomRect( object->getRealRect() );
865 TQRect repaintRect = m_view->zoomHandler()->zoomRect( object->getRepaintRect() );
866 int ox = objectRect.x();
867 int oy = objectRect.y();
869 bool positionReached =
false;
870 int x = m_effectStep * m_stepWidth;
871 int y = m_effectStep * m_stepHeight;
872 if ( ox + x >= m_src->width() || oy - y <= -objectRect.height() )
874 positionReached =
true;
878 repaintRect.moveBy( x, -y );
879 m_repaintRects.append(
new TQRect( repaintRect ) );
881 drawObject(
object, x, -y, &m_paint );
884 return positionReached;
888bool KPrEffectHandler::disappearGoRightBottom( KPrObject *
object )
890 TQRect objectRect = m_view->zoomHandler()->zoomRect( object->getRealRect() );
891 TQRect repaintRect = m_view->zoomHandler()->zoomRect( object->getRepaintRect() );
892 int ox = objectRect.x();
893 int oy = objectRect.y();
895 bool positionReached =
false;
896 int x = m_effectStep * m_stepWidth;
897 int y = m_effectStep * m_stepHeight;
898 if ( ox + x >= m_src->width() || oy + y >= m_src->height() )
900 positionReached =
true;
904 repaintRect.moveBy( x, y );
905 m_repaintRects.append(
new TQRect( repaintRect ) );
907 drawObject(
object, x, y, &m_paint );
910 return positionReached;
914bool KPrEffectHandler::disappearWipeLeft( KPrObject *
object )
916 TQRect repaintRect = m_view->zoomHandler()->zoomRect( object->getRepaintRect() );
917 int ow = repaintRect.width();
919 bool positionReached =
false;
920 int w = ow - m_effectStep * m_stepWidth;
923 positionReached =
true;
927 repaintRect.setWidth( w );
928 m_repaintRects.append(
new TQRect( repaintRect ) );
929 drawObject(
object, 0, 0, &m_paint, &repaintRect );
932 return positionReached;
936bool KPrEffectHandler::disappearWipeRight( KPrObject *
object )
938 TQRect repaintRect = m_view->zoomHandler()->zoomRect( object->getRepaintRect() );
939 int ow = repaintRect.width();
941 bool positionReached =
false;
942 int w = ow - m_effectStep * m_stepWidth;
945 positionReached =
true;
949 repaintRect.setLeft( repaintRect.right() - w );
950 m_repaintRects.append(
new TQRect( repaintRect ) );
951 drawObject(
object, 0, 0, &m_paint, &repaintRect );
954 return positionReached;
958bool KPrEffectHandler::disappearWipeTop( KPrObject *
object )
960 TQRect repaintRect = m_view->zoomHandler()->zoomRect( object->getRepaintRect() );
961 int oh = repaintRect.height();
963 bool positionReached =
false;
964 int h = oh - m_effectStep * m_stepHeight;
967 positionReached =
true;
971 repaintRect.setHeight( h );
972 m_repaintRects.append(
new TQRect( repaintRect ) );
973 drawObject(
object, 0, 0, &m_paint, &repaintRect );
976 return positionReached;
980bool KPrEffectHandler::disappearWipeBottom( KPrObject *
object )
982 TQRect repaintRect = m_view->zoomHandler()->zoomRect( object->getRepaintRect() );
983 int oh = repaintRect.height();
985 bool positionReached =
false;
986 int h = oh - m_effectStep * m_stepHeight;
989 positionReached =
true;
993 repaintRect.setTop( repaintRect.bottom() - h );
994 m_repaintRects.append(
new TQRect( repaintRect ) );
995 drawObject(
object, 0, 0, &m_paint, &repaintRect );
998 return positionReached;
1002void KPrEffectHandler::drawObject( KPrObject *
object,
int x,
int y, TQPixmap *screen, TQRect *clipRect )
1008 p.setClipRect( *clipRect, TQPainter::CoordPainter );
1011 p.translate( x, y );
1013 if ( object->getAppearStep() == m_step.m_step && ! m_back )
1015 object->setSubPresStep( m_step.m_subStep );
1016 object->doSpecificEffects(
true );
1019 object->draw( &p, m_view->zoomHandler(), m_step.m_pageNumber, SM_NONE,
false );
1021 if ( object->getAppearStep() == m_step.m_step && ! m_back )
1023 object->setSubPresStep( 0 );
1024 object->doSpecificEffects(
false );
1027 p.translate( -x, -y );
1030 m_objects.findRef(
object );
1032 while ( ( obj = m_objects.next() ) != 0 )
1034 if ( ( obj->getAppearStep() < m_step.m_step
1035 || obj->getAppearStep() == m_step.m_step && !m_appearEffectObjects.containsRef( obj ) )
1036 && ( ( obj->getDisappear() && obj->getDisappearStep() > m_step.m_step ) || ! obj->getDisappear() )
1037 && m_view->zoomHandler()->zoomRect( obj->getRealRect()).intersects(*m_repaintRects.getLast()) )
1039 if ( obj->getAppearStep() == m_step.m_step && ! m_back )
1041 obj->setSubPresStep( m_step.m_subStep );
1042 obj->doSpecificEffects(
true );
1044 obj->draw( &p, m_view->zoomHandler(), m_step.m_pageNumber, SM_NONE,
false );
1045 if ( obj->getAppearStep() == m_step.m_step && ! m_back )
1047 obj->setSubPresStep( 0 );
1048 obj->doSpecificEffects(
false );
Class for keeping a presentation step m_pageNumber the current page number 0 based m_step the current...