2
* Copyright (C) 2005, Net Integration Technologies, Inc.
3
* Copyright (C) 2010, Albert Astals Cid <aacid@kde.org>
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation; either version 2, or (at your option)
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
20
#ifdef USE_GCC_PRAGMAS
21
#pragma implementation
24
#include "PageTransition.h"
26
//------------------------------------------------------------------------
28
//------------------------------------------------------------------------
30
PageTransition::PageTransition (Object *trans) {
34
type = transitionReplace;
36
alignment = transitionHorizontal;
37
direction = transitionInward;
43
if (!trans || !trans->isDict ()) {
48
dict = trans->getDict();
51
if (dict->lookup("S", &obj)->isName()) {
52
const char *s = obj.getName();
54
if (strcmp("R", s) == 0)
55
type = transitionReplace;
56
else if (strcmp("Split", s) == 0)
57
type = transitionSplit;
58
else if (strcmp("Blinds", s) == 0)
59
type = transitionBlinds;
60
else if (strcmp("Box", s) == 0)
62
else if (strcmp("Wipe", s) == 0)
63
type = transitionWipe;
64
else if (strcmp("Dissolve", s) == 0)
65
type = transitionDissolve;
66
else if (strcmp("Glitter", s) == 0)
67
type = transitionGlitter;
68
else if (strcmp("Fly", s) == 0)
70
else if (strcmp("Push", s) == 0)
71
type = transitionPush;
72
else if (strcmp("Cover", s) == 0)
73
type = transitionCover;
74
else if (strcmp("Uncover", s) == 0)
75
type = transitionUncover;
76
else if (strcmp("Fade", s) == 0)
77
type = transitionFade;
82
if (dict->lookup("D", &obj)->isInt()) {
83
duration = obj.getInt();
88
if (dict->lookup("Dm", &obj)->isName()) {
89
const char *dm = obj.getName();
91
if (strcmp("H", dm) == 0)
92
alignment = transitionHorizontal;
93
else if (strcmp("V", dm) == 0)
94
alignment = transitionVertical;
99
if (dict->lookup("M", &obj)->isName()) {
100
const char *m = obj.getName();
102
if (strcmp("I", m) == 0)
103
direction = transitionInward;
104
else if (strcmp("O", m) == 0)
105
direction = transitionOutward;
110
if (dict->lookup("Di", &obj)->isInt()) {
111
angle = obj.getInt();
115
if (dict->lookup("Di", &obj)->isName()) {
116
if (strcmp("None", obj.getName()) == 0)
122
if (dict->lookup("SS", &obj)->isReal()) {
123
scale = obj.getReal();
128
if (dict->lookup("B", &obj)->isBool()) {
129
rectangular = obj.getBool();
134
PageTransition::~PageTransition()