~ubuntu-branches/ubuntu/breezy/koffice/breezy

« back to all changes in this revision

Viewing changes to kpresenter/kppageeffects.cc

  • Committer: Bazaar Package Importer
  • Author(s): Ben Burton
  • Date: 2004-05-09 11:33:00 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040509113300-vfrdadqsvjfuhn3b
Tags: 1:1.3.1-1
* New upstream bugfix release.
* Built against newer imagemagick (closes: #246623).
* Made koffice-libs/kformula recommend/depend on latex-xft-fonts, which
  provides mathematical fonts that the formula editor can use.  Also
  patched the kformula part to make these fonts the default.
* Changed kword menu hint from "WordProcessors" to "Word processors"
  (closes: #246209).
* Spellchecker configuration is now fixed (closes: #221256, #227568).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
/* This file is part of the KDE project
 
3
   Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
 
4
   Copyright (C) 2002 Ariya Hidayat <ariya@kde.org>
 
5
   Copyright (C) 2002 Harri Porten <porten@kde.org>
 
6
 
 
7
   This library is free software; you can redistribute it and/or
 
8
   modify it under the terms of the GNU Library General Public
 
9
   License as published by the Free Software Foundation; either
 
10
   version 2 of the License, or (at your option) any later version.
 
11
 
 
12
   This library is distributed in the hope that it will be useful,
 
13
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
15
   Library General Public License for more details.
 
16
 
 
17
   You should have received a copy of the GNU Library General Public License
 
18
   along with this library; see the file COPYING.LIB.  If not, write to
 
19
   the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 
20
   Boston, MA 02111-1307, USA.
 
21
*/
 
22
 
 
23
#include "kppageeffects.h"
 
24
#include <kapplication.h>
 
25
#include <krandomsequence.h>
 
26
#include <qpixmap.h>
 
27
#include <qdatetime.h>
 
28
#include <qwidget.h>
 
29
#include <qwmatrix.h>
 
30
 
 
31
void kPchangePages( QWidget *canv, const QPixmap &_pix1, const QPixmap &_pix2,
 
32
                    PageEffect effect, float speedFaktor )
 
33
{
 
34
    Q_ASSERT( _pix1.size() == _pix2.size() );
 
35
    int width = _pix1.width();
 
36
    int height = _pix1.height();
 
37
    QTime _time;
 
38
    int _step = 0, _steps = 0, _h = 0, _w = 0;
 
39
    int hsteps = static_cast<int>( height / speedFaktor );
 
40
    int wsteps = static_cast<int>( width / speedFaktor );
 
41
    switch ( effect )
 
42
    {
 
43
 
 
44
    case PEF_NONE:
 
45
        bitBlt( canv, 0, 0, &_pix2, 0, 0, width, height );
 
46
        break;
 
47
 
 
48
    case PEF_CLOSE_HORZ:
 
49
    {
 
50
        _steps = hsteps;
 
51
        _time.start();
 
52
 
 
53
        for ( _h = 0; _step < _steps ; )
 
54
        {
 
55
            kapp->processEvents();
 
56
            if ( _time.elapsed() >= 1 )
 
57
            {
 
58
                _step++;
 
59
                _h = (int )(0.5 * height * _step / _steps);
 
60
                _h = kMin( _h, height / 2 );
 
61
 
 
62
                bitBlt( canv, 0, 0, &_pix2, 0, height / 2 - _h, width, _h );
 
63
                bitBlt( canv, 0, height - _h, &_pix2, 0, height / 2, width, _h );
 
64
 
 
65
                _time.restart();
 
66
            }
 
67
            if ( _h >= height / 2 ) break;
 
68
        }
 
69
    } break;
 
70
 
 
71
    case PEF_CLOSE_VERT:
 
72
    {
 
73
        _steps = wsteps;
 
74
        _time.start();
 
75
 
 
76
        for ( _w = 0; _step < _steps ; )
 
77
        {
 
78
            kapp->processEvents();
 
79
            if ( _time.elapsed() >= 1 )
 
80
            {
 
81
                _step++;
 
82
                _w =(int)( 0.5 * width * _step / _steps);
 
83
                _w = kMin( _w, width / 2 );
 
84
 
 
85
                bitBlt( canv, 0, 0, &_pix2, width / 2 - _w, 0, _w, height );
 
86
                bitBlt( canv, width - _w, 0, &_pix2, width / 2, 0, _w, height );
 
87
 
 
88
                _time.restart();
 
89
            }
 
90
            if ( _w >= width / 2 ) break;
 
91
        }
 
92
    } break;
 
93
 
 
94
    case PEF_CLOSE_ALL:
 
95
    {
 
96
        _steps = wsteps;
 
97
        _time.start();
 
98
 
 
99
        for ( ; _step < _steps ; )
 
100
        {
 
101
            kapp->processEvents();
 
102
            if ( _time.elapsed() >= 1 )
 
103
            {
 
104
                _step++;
 
105
                _w =(int)( 0.5 * width * _step / _steps);
 
106
                _w = kMin( _w, width / 2 );
 
107
                _h =(int)( 0.5 * height * _step / _steps);
 
108
                _h = kMin( _h, height / 2 );
 
109
 
 
110
                bitBlt( canv, 0, 0, &_pix2, 0, 0, _w, _h );
 
111
                bitBlt( canv, width - _w, 0, &_pix2, width - _w, 0, _w, _h );
 
112
                bitBlt( canv, 0, height - _h, &_pix2, 0, height - _h, _w, _h );
 
113
                bitBlt( canv, width - _w, height - _h, &_pix2, width - _w, height - _h, _w, _h );
 
114
 
 
115
                _time.restart();
 
116
            }
 
117
            if ( ( _w >= width / 2 ) && ( _h >= height / 2 ) ) break;
 
118
        }
 
119
    } break;
 
120
 
 
121
    case PEF_OPEN_HORZ:
 
122
    {
 
123
        _steps = hsteps;
 
124
        _time.start();
 
125
 
 
126
        for ( _h = 0; _step < _steps ; )
 
127
        {
 
128
            kapp->processEvents();
 
129
            if ( _time.elapsed() >= 1 )
 
130
            {
 
131
                _step++;
 
132
                _h =(int)( 0.5 * height * _step / _steps);
 
133
                _h = kMin( _h, height / 2 );
 
134
 
 
135
                bitBlt( canv, 0, height / 2 - _h, &_pix2, 0, 0, width, _h );
 
136
                bitBlt( canv, 0, height / 2, &_pix2, 0, height - _h, width, _h );
 
137
 
 
138
                _time.restart();
 
139
            }
 
140
            if ( _h >= height / 2 ) break;
 
141
        }
 
142
    } break;
 
143
 
 
144
    case PEF_OPEN_VERT:
 
145
    {
 
146
        _steps = wsteps;
 
147
        _time.start();
 
148
 
 
149
        for ( _w = 0; _step < _steps ; )
 
150
        {
 
151
            kapp->processEvents();
 
152
            if ( _time.elapsed() >= 1 )
 
153
            {
 
154
                _step++;
 
155
                _w =(int)( 0.5 * width * _step / _steps);
 
156
                _w = kMin( _w, width / 2 );
 
157
 
 
158
                bitBlt( canv, width / 2 - _w, 0, &_pix2, 0, 0, _w, height );
 
159
                bitBlt( canv, width / 2, 0, &_pix2, width - _w, 0, _w, height );
 
160
 
 
161
                _time.restart();
 
162
            }
 
163
            if ( _w >= width / 2 ) break;
 
164
        }
 
165
    } break;
 
166
 
 
167
    case PEF_OPEN_ALL:
 
168
    {
 
169
        _steps = wsteps;
 
170
        _time.start();
 
171
 
 
172
        for ( ; _step < _steps ; )
 
173
        {
 
174
            kapp->processEvents();
 
175
            if ( _time.elapsed() >= 1 )
 
176
            {
 
177
                _step++;
 
178
                _w =(int)( 0.5 * width * _step / _steps);
 
179
                _w = kMin( _w, width / 2 );
 
180
                _h =(int)( 0.5 * height * _step / _steps);
 
181
                _h = kMin( _h, height / 2 );
 
182
 
 
183
                bitBlt( canv, width / 2 - _w, height / 2 - _h, &_pix2, 0, 0, _w, _h );
 
184
                bitBlt( canv, width / 2, height / 2 - _h, &_pix2, width - _w, 0, _w, _h );
 
185
                bitBlt( canv, width / 2 - _w, height / 2, &_pix2, 0, height - _h, _w, _h );
 
186
                bitBlt( canv, width / 2, height / 2, &_pix2, width - _w, height - _h, _w, _h );
 
187
 
 
188
                _time.restart();
 
189
            }
 
190
            if ( ( _w >= width / 2 ) && ( _h >= height / 2 ) ) break;
 
191
        }
 
192
    } break;
 
193
 
 
194
    case PEF_INTERLOCKING_HORZ_1:
 
195
    case PEF_INTERLOCKING_HORZ_2:
 
196
    {
 
197
        _steps = hsteps;
 
198
 
 
199
        int w0 = 0;
 
200
        int h4 = height / 4;
 
201
        int loff = 0; // vertical offset for upper stripe coming from left
 
202
        int roff = h4;
 
203
        if ( effect == PEF_INTERLOCKING_HORZ_2 ) {
 
204
            loff = h4;
 
205
            roff = 0;
 
206
        }
 
207
 
 
208
        _time.start();
 
209
 
 
210
        for ( _w = 0 ;  _step < _steps ; )
 
211
        {
 
212
            kapp->processEvents();
 
213
            if ( _time.elapsed() >= 1 )
 
214
            {
 
215
                _step++;
 
216
                _w = width * _step / _steps;
 
217
                _w = kMin( _w, width );
 
218
 
 
219
                bitBlt( canv, w0, loff, &_pix2, w0, loff, _w - w0, h4 );
 
220
                bitBlt( canv, w0, loff + 2 * h4,
 
221
                        &_pix2, w0, loff + 2 * h4, _w - w0, h4 );
 
222
                bitBlt( canv, width - _w, roff,
 
223
                        &_pix2, width - _w, roff, _w - w0, h4 );
 
224
                bitBlt( canv, width - _w, roff + 2 * h4, &_pix2, width - _w,
 
225
                        roff + 2 * h4, _w - w0, h4 );
 
226
                w0 = _w;
 
227
 
 
228
                _time.restart();
 
229
            }
 
230
            if ( _w >= width ) break;
 
231
        }
 
232
    } break;
 
233
 
 
234
    case PEF_INTERLOCKING_VERT_1:
 
235
    case PEF_INTERLOCKING_VERT_2:
 
236
    {
 
237
        _steps = wsteps;
 
238
 
 
239
        int h0 = 0;
 
240
        int w4 = width / 4;
 
241
        int toff = 0; // horizontal offset for left-most stripe from top
 
242
        int boff = w4;
 
243
        if ( effect == PEF_INTERLOCKING_VERT_2 ) {
 
244
            toff = w4;
 
245
            boff = 0;
 
246
        }
 
247
        _time.start();
 
248
 
 
249
        for ( _h = 0 ; _step < _steps ; )
 
250
        {
 
251
            kapp->processEvents();
 
252
            if ( _time.elapsed() >= 1 )
 
253
            {
 
254
                _step++;
 
255
                _h = height * _step / _steps;
 
256
                _h = kMin( _h, height );
 
257
 
 
258
                bitBlt( canv, toff, h0, &_pix2, toff, h0, w4, _h - h0 );
 
259
                bitBlt( canv, toff + 2 * w4, h0,
 
260
                        &_pix2, toff + 2 * w4, h0, w4, _h - h0 );
 
261
                bitBlt( canv, boff, height - _h,
 
262
                        &_pix2, boff, height - _h, w4, _h - h0 );
 
263
                bitBlt( canv, boff + 2 * w4, height - _h,
 
264
                        &_pix2, boff + 2 * w4, height - _h, w4, _h - h0 );
 
265
                h0 = _h;
 
266
 
 
267
                _time.restart();
 
268
            }
 
269
            if ( _h >= height ) break;
 
270
        }
 
271
    } break;
 
272
 
 
273
    case PEF_SURROUND1:
 
274
    {
 
275
        int wid = width / 10;
 
276
        int hei = height / 10;
 
277
 
 
278
        int curr = 1;
 
279
        int curr2 = 1;
 
280
 
 
281
        _steps = wsteps;
 
282
        _time.start();
 
283
 
 
284
        for ( ; curr < 22 ; )
 
285
        {
 
286
            kapp->processEvents();
 
287
            if ( _time.elapsed() >= 1 )
 
288
            {
 
289
                _step++;
 
290
 
 
291
                if ( curr == 1 || curr == 5 || curr == 9 || curr == 13 || curr == 17 )
 
292
                {
 
293
                    int dx = ( curr2 / 4 ) * wid;
 
294
                    int dy = ( curr2 / 4 ) * hei;
 
295
                    _h = height * _step / _steps;
 
296
                    if ( _h >= height - 2 * dy )
 
297
                    {
 
298
                        _h = height - 2 * dy;
 
299
                        curr++;
 
300
                        _step = 0;
 
301
                    }
 
302
                    bitBlt( canv, dx, dy, &_pix2, dx, dy, wid, _h );
 
303
                }
 
304
                else if ( curr == 2 || curr == 6 || curr == 10 || curr == 14 || curr == 18 )
 
305
                {
 
306
                    int dx = ( curr2 / 4 ) * wid;
 
307
                    int dy = ( curr2 / 4 ) * hei;
 
308
                    _w = width * _step / _steps;
 
309
                    if ( _w >= width - wid - 2 * dx )
 
310
                    {
 
311
                        _w = width - wid - 2 * dx;
 
312
                        curr++;
 
313
                        _step = 0;
 
314
                    }
 
315
                    bitBlt( canv, dx + wid, height - hei - dy, &_pix2, dx + wid, height - hei - dy, _w, hei );
 
316
                }
 
317
                else if ( curr == 3 || curr == 7 || curr == 11 || curr == 15 || curr == 19 )
 
318
                {
 
319
                    int dx = ( curr2 / 4 ) * wid;
 
320
                    int dy = ( curr2 / 4 ) * hei;
 
321
                    _h = height * _step / _steps;
 
322
                    if ( _h >= height - hei - 2 * dy )
 
323
                    {
 
324
                        _h = height - hei - 2 * dy;
 
325
                        curr++;
 
326
                        _step = 0;
 
327
                    }
 
328
                    bitBlt( canv, width - wid - dx, height - hei - dy - _h, &_pix2,
 
329
                            width - wid - dx, height - hei - dy - _h, wid, _h );
 
330
                }
 
331
                else if ( curr == 4 || curr == 8 || curr == 12 || curr == 16 || curr == 20 )
 
332
                {
 
333
                    int dx = ( curr2 / 4 ) * wid;
 
334
                    int dy = ( curr2 / 4 ) * hei;
 
335
                    _w = width * _step / _steps;
 
336
                    if ( _w >= width - 2 * wid - 2 * dx )
 
337
                    {
 
338
                        _w = width - 2 * wid - 2 * dx;
 
339
                        _steps *= 2;
 
340
                        _steps = static_cast<int>( static_cast<float>( _steps ) / 1.5 );
 
341
                        curr++;
 
342
                        curr2 += 4;
 
343
                        _step = 0;
 
344
                    }
 
345
                    bitBlt( canv, width - dx - wid - _w, dy, &_pix2, width - dx - wid - _w,
 
346
                            dy, _w, hei );
 
347
                }
 
348
                _time.restart();
 
349
            }
 
350
            if ( curr == 21 )
 
351
            {
 
352
                bitBlt( canv, 0, 0, &_pix2, 0, 0, width, height );
 
353
                break;
 
354
            }
 
355
        }
 
356
    } break;
 
357
 
 
358
    case PEF_FLY1:
 
359
    {
 
360
        _steps = hsteps;
 
361
        _time.start();
 
362
 
 
363
        int _psteps = _steps / 5;
 
364
        QRect oldRect( 0, 0, width, height );
 
365
        QSize ps;
 
366
        QPixmap pix3;
 
367
 
 
368
        for ( ; _step < _steps ; )
 
369
        {
 
370
            kapp->processEvents();
 
371
            if ( _time.elapsed() >= 1 )
 
372
            {
 
373
                _step++;
 
374
                if ( _step < _psteps )
 
375
                {
 
376
                    pix3 = QPixmap( _pix1 );
 
377
                    QPixmap pix4( _pix2 );
 
378
                    float dw = static_cast<float>( _step * ( ( pix3.width() - ( pix3.width() / 10 ) ) /
 
379
                                                             ( 2 * _psteps ) ) );
 
380
                    float dh = static_cast<float>( _step * ( ( pix3.height() - ( pix3.height() / 10 ) ) /
 
381
                                                             ( 2 * _psteps ) ) );
 
382
 
 
383
                    dw *= 2;
 
384
                    dh *= 2;
 
385
 
 
386
                    QWMatrix m;
 
387
                    m.scale( static_cast<float>( pix3.width() - dw ) / static_cast<float>( pix3.width() ),
 
388
                             static_cast<float>( pix3.height() - dh ) / static_cast<float>( pix3.height() ) );
 
389
                    pix3 = pix3.xForm( m );
 
390
                    ps = pix3.size();
 
391
 
 
392
                    bitBlt( &pix4, ( pix4.width() - pix3.width() ) / 2, ( pix4.height() - pix3.height() ) / 2,
 
393
                            &pix3, 0, 0, pix3.width(), pix3.height() );
 
394
                    QRect newRect( ( pix4.width() - pix3.width() ) / 2, ( pix4.height() - pix3.height() ) / 2,
 
395
                                   pix3.width(), pix3.height() );
 
396
                    QRect r = newRect.unite( oldRect );
 
397
                    bitBlt( canv, r.x(), r.y(), &pix4, r.x(), r.y(), r.width(), r.height() );
 
398
                    oldRect = newRect;
 
399
                }
 
400
                if ( _step > _psteps && _step < _psteps * 2 )
 
401
                {
 
402
                    QPixmap pix4( _pix2 );
 
403
                    int yy = ( height - pix3.height() ) / 2 - ( ( ( height - pix3.height() ) / 2 ) /
 
404
                                                                _psteps ) * ( _step - _psteps );
 
405
 
 
406
                    bitBlt( &pix4, ( pix4.width() - pix3.width() ) / 2, yy,
 
407
                            &pix3, 0, 0, pix3.width(), pix3.height() );
 
408
                    QRect newRect( ( pix4.width() - pix3.width() ) / 2, yy,
 
409
                                   pix3.width(), pix3.height() );
 
410
                    QRect r = newRect.unite( oldRect );
 
411
                    bitBlt( canv, r.x(), r.y(), &pix4, r.x(), r.y(), r.width(), r.height() );
 
412
                    oldRect = newRect;
 
413
                }
 
414
                if ( _step > 2 * _psteps && _step < _psteps * 3 )
 
415
                {
 
416
                    QPixmap pix4( _pix2 );
 
417
                    int xx = ( width - pix3.width() ) / 2 - ( ( ( width - pix3.width() ) / 2 ) /
 
418
                                                              _psteps ) * ( _step - 2 * _psteps );
 
419
                    int yy = ( ( ( height - pix3.height() ) / 2 ) / _psteps ) * ( _step - 2 * _psteps );
 
420
 
 
421
                    bitBlt( &pix4, xx, yy, &pix3, 0, 0, pix3.width(), pix3.height() );
 
422
                    QRect newRect( xx, yy, pix3.width(), pix3.height() );
 
423
                    QRect r = newRect.unite( oldRect );
 
424
                    bitBlt( canv, r.x(), r.y(), &pix4, r.x(), r.y(), r.width(), r.height() );
 
425
                    oldRect = newRect;
 
426
                }
 
427
                if ( _step > 3 * _psteps && _step < _psteps * 5 )
 
428
                {
 
429
                    QPixmap pix4( _pix2 );
 
430
                    int xx = ( ( width - pix3.width() ) / _psteps ) * ( _step - 3 * _psteps );
 
431
                    int yy = ( ( height - pix3.height() ) / 2 ) +
 
432
                             ( ( ( height - pix3.height() ) / 2 ) / _psteps ) * ( _step - 3 * _psteps );
 
433
 
 
434
                    bitBlt( &pix4, xx, yy, &pix3, 0, 0, pix3.width(), pix3.height() );
 
435
                    QRect newRect( xx, yy, pix3.width(), pix3.height() );
 
436
                    QRect r = newRect.unite( oldRect );
 
437
                    bitBlt( canv, r.x(), r.y(), &pix4, r.x(), r.y(), r.width(), r.height() );
 
438
                    oldRect = newRect;
 
439
                }
 
440
                _time.restart();
 
441
            }
 
442
            if ( _step >= _steps )
 
443
            {
 
444
                bitBlt( canv, 0, 0, &_pix2, 0, 0, width, height );
 
445
                break;
 
446
            }
 
447
        }
 
448
    } break;
 
449
 
 
450
    // Blinds Horizontal
 
451
    case PEF_BLINDS_HOR:
 
452
    {
 
453
        int blockSize = height / 8;
 
454
        _steps = hsteps;
 
455
        if( _steps < 1 ) _steps = 1;
 
456
 
 
457
        _time.start();
 
458
 
 
459
        _h = 0;
 
460
        int h0 = 0;
 
461
        for ( ; _step < _steps ; )
 
462
        {
 
463
            kapp->processEvents();
 
464
            if ( _time.elapsed() >= 1 )
 
465
            {
 
466
                _step++;
 
467
                _h = _step * blockSize / _steps;
 
468
 
 
469
                for ( int i=0; i < height; i += blockSize )
 
470
                    bitBlt( canv, 0, h0 + i, &_pix2, 0, h0 + i, width, _h - h0 );
 
471
 
 
472
                h0 = _h;
 
473
 
 
474
                _time.restart();
 
475
            }
 
476
            if( _h >= blockSize ) break;
 
477
        }
 
478
    } break;
 
479
 
 
480
    // Blinds Vertical
 
481
    case PEF_BLINDS_VER:
 
482
    {
 
483
        int blockSize = width / 8;
 
484
        _steps = wsteps;
 
485
 
 
486
        _time.start();
 
487
 
 
488
        _w = 0;
 
489
        int w0 = 0;
 
490
        for ( ; _step < _steps ; )
 
491
        {
 
492
            kapp->processEvents();
 
493
            if ( _time.elapsed() >= 1 )
 
494
            {
 
495
                _step++;
 
496
                _w = _step * blockSize / _steps;
 
497
 
 
498
                for( int i=0; i < width; i += blockSize )
 
499
                    bitBlt( canv, w0 + i, 0, &_pix2, w0 + i, 0, _w - w0, height );
 
500
 
 
501
                w0 = _w;
 
502
 
 
503
                _time.restart();
 
504
            }
 
505
            if( _w >= blockSize ) break;
 
506
        }
 
507
    } break;
 
508
 
 
509
    // Box In
 
510
    case PEF_BOX_IN:
 
511
    {
 
512
        _steps = wsteps;
 
513
        _time.start();
 
514
 
 
515
        _w = _h = 0;
 
516
        for ( ; _step < _steps ; )
 
517
        {
 
518
            kapp->processEvents();
 
519
            if ( _time.elapsed() >= 1 )
 
520
            {
 
521
                _step++;
 
522
                _w = width - ( width * _step / _steps );
 
523
                if( _w < 0 ) _w = 0;
 
524
                _h = _w * height / width;
 
525
                if( _h < 0 ) _h = 0;
 
526
 
 
527
                bitBlt( canv, 0, 0, &_pix2, 0, 0, width, (height-_h)/2 );
 
528
                bitBlt( canv, 0, (height-_h)/2, &_pix2, 0, (height-_h)/2, (width-_w)/2, _h );
 
529
                bitBlt( canv, (width+_w)/2, (height-_h)/2, &_pix2, (width+_w)/2, (height-_h)/2, (width-_w)/2, _h );
 
530
                bitBlt( canv, 0, (height+_h)/2, &_pix2, 0, (height+_h)/2, width, (height-_h)/2 );
 
531
                _time.restart();
 
532
            }
 
533
            if( _w < 0 ) break;
 
534
        }
 
535
    } break;
 
536
 
 
537
    // Box Out
 
538
    case PEF_BOX_OUT:
 
539
    {
 
540
        _steps = wsteps;
 
541
        _time.start();
 
542
 
 
543
        _w = _h = 0;
 
544
        for ( ; _step < _steps ; )
 
545
        {
 
546
            kapp->processEvents();
 
547
            if ( _time.elapsed() >= 1 )
 
548
            {
 
549
                _step++;
 
550
                _w = width * _step / _steps;
 
551
                if( _w  > width ) _w = width;
 
552
                _h = _w * height / width;
 
553
                if( _h  > height ) _h = height;
 
554
 
 
555
                bitBlt( canv, (width-_w)/2, (height-_h)/2, &_pix2,
 
556
                        (width-_w)/2, (height-_h)/2, _w, _h );
 
557
                _time.restart();
 
558
            }
 
559
            if( _w >= width ) break;
 
560
        }
 
561
    } break;
 
562
 
 
563
    // Checkboard Across
 
564
    case PEF_CHECKBOARD_ACROSS:
 
565
    {
 
566
        _steps = wsteps;
 
567
        _time.start();
 
568
 
 
569
        int blocksize = height / 8;
 
570
 
 
571
        _steps /= 2;
 
572
        int w0 = 0;
 
573
        while ( w0 < 2 * blocksize )
 
574
        {
 
575
            kapp->processEvents();
 
576
            if ( _time.elapsed() >= 1 )
 
577
            {
 
578
                _step++;
 
579
                _w = blocksize * _step / _steps;
 
580
                _w = kMin( _w, (blocksize * 2) );
 
581
 
 
582
                for( int yp = 0; yp < height; yp += blocksize )
 
583
                {
 
584
                    int xp = ((yp/blocksize) & 1) ? blocksize : 0;
 
585
                    if( ( xp > 0 ) && ( _w > blocksize ) )
 
586
                        bitBlt( canv, w0-blocksize, yp, &_pix2, w0-blocksize,
 
587
                                yp, _w-w0, blocksize );
 
588
                    for( ; xp < width; xp += 2*blocksize )
 
589
                        bitBlt( canv, xp + w0, yp,
 
590
                                &_pix2, xp + w0, yp, _w - w0, blocksize );
 
591
                }
 
592
 
 
593
                _time.restart();
 
594
                w0 = _w;
 
595
            }
 
596
        }
 
597
    } break;
 
598
 
 
599
    // Checkboard Down
 
600
    case PEF_CHECKBOARD_DOWN:
 
601
    {
 
602
        _steps = wsteps;
 
603
        _time.start();
 
604
 
 
605
        int blocksize = height / 8;
 
606
 
 
607
        _steps /= 2;
 
608
        int h0 = 0;
 
609
        while ( h0 < 2 * blocksize )
 
610
        {
 
611
            kapp->processEvents();
 
612
            if ( _time.elapsed() >= 1 )
 
613
            {
 
614
                _step++;
 
615
                _h = blocksize * _step / _steps;
 
616
                _h = kMin ( _h, (blocksize * 2) );
 
617
 
 
618
                for( int xp = 0; xp < width; xp += blocksize )
 
619
                {
 
620
                    int yp = ((xp/blocksize) & 1) ? blocksize : 0;
 
621
                    if( ( yp > 0 ) && ( _h > blocksize ) )
 
622
                        bitBlt( canv, xp, h0-blocksize, &_pix2, xp, h0-blocksize,
 
623
                                blocksize, _h-h0 );
 
624
                    for( ; yp < height; yp += 2*blocksize )
 
625
                        bitBlt( canv, xp, yp + h0,
 
626
                                &_pix2, xp, yp + h0, blocksize, _h - h0 );
 
627
                }
 
628
 
 
629
                h0 = _h;
 
630
                _time.restart();
 
631
            }
 
632
        }
 
633
    } break;
 
634
 
 
635
    // Cover Down
 
636
    case PEF_COVER_DOWN:
 
637
    {
 
638
        _steps = wsteps;
 
639
        _time.start();
 
640
 
 
641
        for ( _h = 0 ; _step < _steps ; )
 
642
        {
 
643
            kapp->processEvents();
 
644
            if ( _time.elapsed() >= 1 )
 
645
            {
 
646
                _step++;
 
647
                _h = _step * height/ _steps;
 
648
                _h = _h > height ? height : _h;
 
649
 
 
650
                bitBlt( canv, 0, 0, &_pix2, 0, height-_h, width, _h );
 
651
 
 
652
                _time.restart();
 
653
            }
 
654
            if( _h >= height ) break;
 
655
        }
 
656
    } break;
 
657
 
 
658
    // Uncover Down
 
659
    case PEF_UNCOVER_DOWN:
 
660
    {
 
661
        _steps = wsteps;
 
662
        _time.start();
 
663
 
 
664
        for ( _h = 0 ; _step < _steps ; )
 
665
        {
 
666
            kapp->processEvents();
 
667
            if ( _time.elapsed() >= 1 )
 
668
            {
 
669
                _step++;
 
670
                _h = _step * height/ _steps;
 
671
                _h = _h > height ? height : _h;
 
672
 
 
673
                bitBlt( canv, 0, 0, &_pix2, 0, 0, width, _h );
 
674
                bitBlt( canv, 0, _h, &_pix1, 0, 0, width, height-_h );
 
675
 
 
676
                _time.restart();
 
677
            }
 
678
            if( _h >= height ) break;
 
679
        }
 
680
 
 
681
    } break;
 
682
 
 
683
    // Cover Up
 
684
    case PEF_COVER_UP:
 
685
    {
 
686
        _steps = wsteps;
 
687
        _time.start();
 
688
 
 
689
        for ( _h = 0 ; _step < _steps ; )
 
690
        {
 
691
            kapp->processEvents();
 
692
            if ( _time.elapsed() >= 1 )
 
693
            {
 
694
                _step++;
 
695
                _h = _step * height/ _steps;
 
696
                _h = _h > height ? height : _h;
 
697
 
 
698
                bitBlt( canv, 0, height-_h, &_pix2, 0, 0, width, _h );
 
699
 
 
700
                _time.restart();
 
701
            }
 
702
            if( _h >= height ) break;
 
703
        }
 
704
    } break;
 
705
 
 
706
    // Uncover Up
 
707
    case PEF_UNCOVER_UP:
 
708
    {
 
709
        _steps = wsteps;
 
710
        _time.start();
 
711
 
 
712
        for ( _h = 0 ; _step < _steps ; )
 
713
        {
 
714
            kapp->processEvents();
 
715
            if ( _time.elapsed() >= 1 )
 
716
            {
 
717
                _step++;
 
718
                _h = _step * height/ _steps;
 
719
                _h = _h > height ? height : _h;
 
720
 
 
721
                bitBlt( canv, 0, height-_h, &_pix2, 0, height-_h, width, _h );
 
722
                bitBlt( canv, 0, 0, &_pix1, 0, _h, width, height-_h );
 
723
 
 
724
                _time.restart();
 
725
            }
 
726
            if( _h >= height ) break;
 
727
        }
 
728
 
 
729
    } break;
 
730
 
 
731
    // Cover Left
 
732
    case PEF_COVER_LEFT:
 
733
    {
 
734
        _steps = wsteps;
 
735
        _time.start();
 
736
 
 
737
        for ( _w = 0; _step < _steps ; )
 
738
        {
 
739
            kapp->processEvents();
 
740
            if ( _time.elapsed() >= 1 )
 
741
            {
 
742
                _step++;
 
743
                _w = _step * width / _steps;
 
744
                _w = _w > width ? width : _w;
 
745
 
 
746
                bitBlt( canv, width-_w, 0, &_pix2, 0, 0, _w, height );
 
747
 
 
748
                _time.restart();
 
749
            }
 
750
            if( _w >= width ) break;
 
751
        }
 
752
    } break;
 
753
 
 
754
    // Uncover Left
 
755
    case PEF_UNCOVER_LEFT:
 
756
    {
 
757
        _steps = wsteps;
 
758
        _time.start();
 
759
 
 
760
        for ( _w = 0; _step < _steps ; )
 
761
        {
 
762
            kapp->processEvents();
 
763
            if ( _time.elapsed() >= 1 )
 
764
            {
 
765
                _step++;
 
766
                _w = _step * width / _steps;
 
767
                _w = _w > width ? width : _w;
 
768
 
 
769
                bitBlt( canv, 0, 0, &_pix1, _w, 0, width-_w, height );
 
770
                bitBlt( canv, width-_w, 0, &_pix2, width-_w, 0, _w, height );
 
771
 
 
772
                _time.restart();
 
773
            }
 
774
            if( _w >= width ) break;
 
775
        }
 
776
    } break;
 
777
 
 
778
    // Cover Right
 
779
    case PEF_COVER_RIGHT:
 
780
    {
 
781
        _steps = wsteps;
 
782
        _time.start();
 
783
 
 
784
        for ( _w = 0; _step < _steps ; )
 
785
        {
 
786
            kapp->processEvents();
 
787
            if ( _time.elapsed() >= 1 )
 
788
            {
 
789
                _step++;
 
790
                _w = _step * width / _steps;
 
791
                _w = _w > width ? width : _w;
 
792
 
 
793
                bitBlt( canv, 0, 0, &_pix2, width-_w, 0, _w, height );
 
794
 
 
795
                _time.restart();
 
796
            }
 
797
            if( _w >= width ) break;
 
798
        }
 
799
    } break;
 
800
 
 
801
    // Uncover Right
 
802
    case PEF_UNCOVER_RIGHT:
 
803
    {
 
804
        _steps = wsteps;
 
805
        _time.start();
 
806
 
 
807
        for ( _w = 0; _step < _steps ; )
 
808
        {
 
809
            kapp->processEvents();
 
810
            if ( _time.elapsed() >= 1 )
 
811
            {
 
812
                _step++;
 
813
                _w = _step * width / _steps;
 
814
                _w = _w > width ? width : _w;
 
815
 
 
816
                bitBlt( canv, _w, 0, &_pix1, 0, 0, width-_w, height );
 
817
                bitBlt( canv, 0, 0, &_pix2, 0, 0, _w, height );
 
818
 
 
819
                _time.restart();
 
820
            }
 
821
            if( _w >= width ) break;
 
822
        }
 
823
    } break;
 
824
 
 
825
    // Cover Left-Up
 
826
    case PEF_COVER_LEFT_UP:
 
827
    {
 
828
        _steps = wsteps;
 
829
        _time.start();
 
830
 
 
831
        for ( _w = _h = 0; _step < _steps ; )
 
832
        {
 
833
            kapp->processEvents();
 
834
            if ( _time.elapsed() >= 1 )
 
835
            {
 
836
                _step++;
 
837
                _w = _step * width / _steps;
 
838
                _w = _w > width ? width : _w;
 
839
                _h = _step * height/ _steps;
 
840
                _h = _h > height ? height : _h;
 
841
 
 
842
                bitBlt( canv, width-_w, height-_h, &_pix2, 0, 0, _w, _h );
 
843
 
 
844
                _time.restart();
 
845
            }
 
846
            if( _w >= width ) break;
 
847
        }
 
848
    } break;
 
849
 
 
850
    // Uncover Left-Up
 
851
    case PEF_UNCOVER_LEFT_UP:
 
852
    {
 
853
        _steps = wsteps;
 
854
        _time.start();
 
855
 
 
856
        for ( _w = _h = 0; _step < _steps ; )
 
857
        {
 
858
            kapp->processEvents();
 
859
            if ( _time.elapsed() >= 1 )
 
860
            {
 
861
                _step++;
 
862
                _w = _step * width / _steps;
 
863
                _w = _w > width ? width : _w;
 
864
                _h = _step * height/ _steps;
 
865
                _h = _h > height ? height : _h;
 
866
 
 
867
                bitBlt( canv, 0, 0, &_pix1, _w, _h, width-_w, height-_h );
 
868
                bitBlt( canv, width-_w, 0, &_pix2, width-_w, 0, _w, height );
 
869
                bitBlt( canv, 0, height-_h, &_pix2, 0, height-_h, width, _h );
 
870
 
 
871
                _time.restart();
 
872
            }
 
873
            if( _w >= width ) break;
 
874
        }
 
875
    } break;
 
876
 
 
877
    // Cover Left-Down
 
878
    case PEF_COVER_LEFT_DOWN:
 
879
    {
 
880
        _steps = wsteps;
 
881
        _time.start();
 
882
 
 
883
        for ( _w = _h = 0; _step < _steps ; )
 
884
        {
 
885
            kapp->processEvents();
 
886
            if ( _time.elapsed() >= 1 )
 
887
            {
 
888
                _step++;
 
889
                _w = _step * width / _steps;
 
890
                _w = _w > width ? width : _w;
 
891
                _h = _step * height/ _steps;
 
892
                _h = _h > height ? height : _h;
 
893
 
 
894
                bitBlt( canv, width-_w, 0, &_pix2, 0, height-_h, _w, _h );
 
895
 
 
896
                _time.restart();
 
897
            }
 
898
            if( _w >= width ) break;
 
899
        }
 
900
    } break;
 
901
 
 
902
    // Uncover Left-Down
 
903
    case PEF_UNCOVER_LEFT_DOWN:
 
904
    {
 
905
        _steps = wsteps;
 
906
        _time.start();
 
907
 
 
908
        for ( _w = _h = 0; _step < _steps ; )
 
909
        {
 
910
            kapp->processEvents();
 
911
            if ( _time.elapsed() >= 1 )
 
912
            {
 
913
                _step++;
 
914
                _w = _step * width / _steps;
 
915
                _w = _w > width ? width : _w;
 
916
                _h = _step * height/ _steps;
 
917
                _h = _h > height ? height : _h;
 
918
 
 
919
                bitBlt( canv, 0, _h, &_pix1, _w, 0, width-_w, height-_h );
 
920
                bitBlt( canv, width-_w, 0, &_pix2, width-_w, 0, _w, height );
 
921
                bitBlt( canv, 0, 0, &_pix2, 0, 0, width, _h );
 
922
 
 
923
                _time.restart();
 
924
            }
 
925
            if( _w >= width ) break;
 
926
        }
 
927
    } break;
 
928
 
 
929
    // Cover Right-Up
 
930
    case PEF_COVER_RIGHT_UP:
 
931
    {
 
932
        _steps = wsteps;
 
933
        _time.start();
 
934
 
 
935
        for ( _w = _h = 0; _step < _steps ; )
 
936
        {
 
937
            kapp->processEvents();
 
938
            if ( _time.elapsed() >= 1 )
 
939
            {
 
940
                _step++;
 
941
                _w = _step * width / _steps;
 
942
                _w = _w > width ? width : _w;
 
943
                _h = _step * height/ _steps;
 
944
                _h = _h > height ? height : _h;
 
945
 
 
946
                bitBlt( canv, 0, height-_h, &_pix2, width-_w, 0, _w, _h );
 
947
 
 
948
                _time.restart();
 
949
            }
 
950
            if( _w >= width ) break;
 
951
        }
 
952
    } break;
 
953
 
 
954
    // Uncover Right-Up
 
955
    case PEF_UNCOVER_RIGHT_UP:
 
956
    {
 
957
        _steps = wsteps;
 
958
        _time.start();
 
959
 
 
960
        for ( _w = _h = 0; _step < _steps ; )
 
961
        {
 
962
            kapp->processEvents();
 
963
            if ( _time.elapsed() >= 1 )
 
964
            {
 
965
                _step++;
 
966
                _w = _step * width / _steps;
 
967
                _w = _w > width ? width : _w;
 
968
                _h = _step * height/ _steps;
 
969
                _h = _h > height ? height : _h;
 
970
 
 
971
                bitBlt( canv, _w, 0, &_pix1, 0, _h, width-_w, height-_h );
 
972
                bitBlt( canv, 0, 0, &_pix2, 0, 0, _w, height );
 
973
                bitBlt( canv, 0, height-_h, &_pix2, 0, height-_h, width, _h );
 
974
 
 
975
                _time.restart();
 
976
            }
 
977
            if( _w >= width ) break;
 
978
        }
 
979
    } break;
 
980
 
 
981
    // Cover Right-Down
 
982
    case PEF_COVER_RIGHT_DOWN:
 
983
    {
 
984
        _steps = wsteps;
 
985
        _time.start();
 
986
 
 
987
        for ( _w = _h = 0; _step < _steps ; )
 
988
        {
 
989
            kapp->processEvents();
 
990
            if ( _time.elapsed() >= 1 )
 
991
            {
 
992
                _step++;
 
993
                _w = _step * width / _steps;
 
994
                _w = _w > width ? width : _w;
 
995
                _h = _step * height/ _steps;
 
996
                _h = _h > height ? height : _h;
 
997
 
 
998
                bitBlt( canv, 0, 0, &_pix2, width-_w, height-_h, _w, _h );
 
999
 
 
1000
                _time.restart();
 
1001
            }
 
1002
            if( _w >= width ) break;
 
1003
        }
 
1004
    } break;
 
1005
 
 
1006
    // Uncover Right-Down
 
1007
    case PEF_UNCOVER_RIGHT_DOWN:
 
1008
    {
 
1009
        _steps = wsteps;
 
1010
        _time.start();
 
1011
 
 
1012
        for ( _w = _h = 0; _step < _steps ; )
 
1013
        {
 
1014
            kapp->processEvents();
 
1015
            if ( _time.elapsed() >= 1 )
 
1016
            {
 
1017
                _step++;
 
1018
                _w = _step * width / _steps;
 
1019
                _w = _w > width ? width : _w;
 
1020
                _h = _step * height/ _steps;
 
1021
                _h = _h > height ? height : _h;
 
1022
 
 
1023
                bitBlt( canv, _w, _h, &_pix1, 0, 0, width-_w, height-_h );
 
1024
                bitBlt( canv, 0, 0, &_pix2, 0, 0, _w, height );
 
1025
                bitBlt( canv, 0, 0, &_pix2, 0, 0, width, _h );
 
1026
 
 
1027
                _time.restart();
 
1028
            }
 
1029
            if( _w >= width ) break;
 
1030
        }
 
1031
    } break;
 
1032
 
 
1033
    // Dissolve
 
1034
    case PEF_DISSOLVE:
 
1035
    {
 
1036
        KRandomSequence random;
 
1037
 
 
1038
        unsigned blockSize = height / 32; // small enough
 
1039
        unsigned rowno = ( height + blockSize - 1 ) / blockSize;
 
1040
        unsigned colno = ( width + blockSize - 1 ) / blockSize;
 
1041
        unsigned cellno = rowno * colno;
 
1042
 
 
1043
        QValueList<int> cells;
 
1044
        for( unsigned c = 0; c < cellno; c++ )
 
1045
            cells.append( c );
 
1046
 
 
1047
        _steps = hsteps;
 
1048
 
 
1049
        _steps *= 10;
 
1050
 
 
1051
        while( !cells.isEmpty() )
 
1052
        {
 
1053
            kapp->processEvents();
 
1054
            if ( _time.elapsed() >= 1 )
 
1055
            {
 
1056
                _step++;
 
1057
                unsigned k = cellno - cellno * _step / _steps;
 
1058
 
 
1059
                while( cells.count() > k )
 
1060
                {
 
1061
                    unsigned index = random.getLong( cells.count() );
 
1062
                    QValueListIterator<int> it = cells.at( index );
 
1063
                    unsigned y = *it / colno;
 
1064
                    unsigned x = *it % colno;
 
1065
                    cells.remove( it );
 
1066
 
 
1067
                    bitBlt( canv, x * blockSize, y * blockSize, &_pix2,
 
1068
                            x * blockSize, y * blockSize, blockSize, blockSize );
 
1069
                }
 
1070
 
 
1071
                _time.restart();
 
1072
            }
 
1073
        }
 
1074
 
 
1075
    } break;
 
1076
 
 
1077
    // Strips Left-Up
 
1078
    case PEF_STRIPS_LEFT_UP:
 
1079
    {
 
1080
        _steps = wsteps;
 
1081
 
 
1082
        unsigned blocks = _steps / 2;
 
1083
        unsigned blockSize = width / blocks;
 
1084
 
 
1085
        _time.start();
 
1086
 
 
1087
        for ( ; _step < _steps;  )
 
1088
        {
 
1089
            kapp->processEvents();
 
1090
            if ( _time.elapsed() >= 1 )
 
1091
            {
 
1092
                for ( int x = 0; x <= _step; ++x )
 
1093
                {
 
1094
                    int y = _step - x;
 
1095
 
 
1096
                    bitBlt( canv, width - x * blockSize, height - y * blockSize, &_pix2,
 
1097
                            width - x * blockSize, height - y * blockSize,
 
1098
                            blockSize, blockSize );
 
1099
                }
 
1100
 
 
1101
                _step++;
 
1102
                _time.restart();
 
1103
            }
 
1104
        }
 
1105
 
 
1106
    } break;
 
1107
 
 
1108
    // Strips Left-Down
 
1109
    case PEF_STRIPS_LEFT_DOWN:
 
1110
    {
 
1111
        _steps = wsteps;
 
1112
 
 
1113
        unsigned blocks = _steps / 2;
 
1114
        unsigned blockSize = width / blocks;
 
1115
 
 
1116
        _time.start();
 
1117
 
 
1118
        for ( ; _step < _steps;  )
 
1119
        {
 
1120
            kapp->processEvents();
 
1121
            if ( _time.elapsed() >= 1 )
 
1122
            {
 
1123
                for ( int x = 0; x <= _step; ++x )
 
1124
                {
 
1125
                    int y = _step - x;
 
1126
 
 
1127
                    bitBlt( canv, width - x * blockSize, y * blockSize, &_pix2,
 
1128
                            width - x * blockSize, y * blockSize, blockSize, blockSize );
 
1129
                }
 
1130
 
 
1131
                _step++;
 
1132
                _time.restart();
 
1133
            }
 
1134
        }
 
1135
 
 
1136
    } break;
 
1137
 
 
1138
    // Strips Right-Up
 
1139
    case PEF_STRIPS_RIGHT_UP:
 
1140
    {
 
1141
        _steps = wsteps;
 
1142
 
 
1143
        unsigned blocks = _steps / 2;
 
1144
        unsigned blockSize = width / blocks;
 
1145
 
 
1146
        _time.start();
 
1147
 
 
1148
        for ( ; _step < _steps;  )
 
1149
        {
 
1150
            kapp->processEvents();
 
1151
            if ( _time.elapsed() >= 1 )
 
1152
            {
 
1153
                for ( int x = 0; x <= _step; ++x )
 
1154
                {
 
1155
                    int y = _step - x;
 
1156
                    bitBlt( canv, x * blockSize, height - y * blockSize,
 
1157
                            &_pix2, x * blockSize, height - y * blockSize,
 
1158
                            blockSize, blockSize );
 
1159
                }
 
1160
 
 
1161
                _step++;
 
1162
                _time.restart();
 
1163
            }
 
1164
        }
 
1165
 
 
1166
    } break;
 
1167
 
 
1168
    // Strips Right-Down
 
1169
    case PEF_STRIPS_RIGHT_DOWN:
 
1170
    {
 
1171
        _steps = wsteps;
 
1172
 
 
1173
        unsigned blocks = _steps / 2;
 
1174
        unsigned blockSize = width / blocks;
 
1175
 
 
1176
        _time.start();
 
1177
 
 
1178
        for ( ; _step < _steps;  )
 
1179
        {
 
1180
            kapp->processEvents();
 
1181
            if ( _time.elapsed() >= 1 )
 
1182
            {
 
1183
                for ( int x = 0; x <= _step; ++x )
 
1184
                {
 
1185
                    int y = _step - x;
 
1186
 
 
1187
                    bitBlt( canv, x * blockSize, y * blockSize, &_pix2,
 
1188
                            x * blockSize, y * blockSize, blockSize, blockSize );
 
1189
                }
 
1190
 
 
1191
                _step++;
 
1192
                _time.restart();
 
1193
            }
 
1194
        }
 
1195
 
 
1196
    } break;
 
1197
 
 
1198
    // Melting
 
1199
    case PEF_MELTING:
 
1200
    {
 
1201
        KRandomSequence random;
 
1202
 
 
1203
        unsigned count = 32;
 
1204
        int delta[32];
 
1205
        for( unsigned i = 0; i < count; i++ )
 
1206
          delta[i]= 0;
 
1207
 
 
1208
        _steps = hsteps * 10;
 
1209
 
 
1210
        unsigned strip_width = (width + count-1) / count;
 
1211
        unsigned rn = 10 * height / _steps;
 
1212
 
 
1213
        for ( _h = 0 ; _step < _steps ; )
 
1214
        {
 
1215
            kapp->processEvents();
 
1216
            if ( _time.elapsed() >= 1 )
 
1217
            {
 
1218
                _step++;
 
1219
                _h = _step * height/ _steps;
 
1220
                _h = _h > height ? height : _h;
 
1221
 
 
1222
                for( unsigned k = 0; k < count; k++ )
 
1223
                {
 
1224
                  unsigned x = k * width / count;
 
1225
                  delta[k] += ( 1+ random.getLong( rn ) );
 
1226
                  if( delta[k] > height ) delta[k] = height;
 
1227
                  if( delta[k] <= height )
 
1228
                  {
 
1229
                     bitBlt( canv, x, 0, &_pix2, x, 0, strip_width, delta[k] );
 
1230
                     bitBlt( canv, x, delta[k], &_pix1, x, 0, strip_width, height - delta[k] );
 
1231
                  }
 
1232
                }
 
1233
 
 
1234
                _time.restart();
 
1235
            }
 
1236
            if( _h >= height ) break;
 
1237
        }
 
1238
 
 
1239
    } break;
 
1240
 
 
1241
    // Random (just pick up one of the above effect)
 
1242
    case PEF_RANDOM:
 
1243
    case PEF_LAST_MARKER:
 
1244
    {
 
1245
        KRandomSequence random;
 
1246
 
 
1247
        kPchangePages( canv, _pix1, _pix2, static_cast<PageEffect>( random.getLong( PEF_LAST_MARKER ) ),
 
1248
                       speedFaktor );
 
1249
 
 
1250
    } break;
 
1251
 
 
1252
    }
 
1253
}