2 * Copyright (C) 2005, Net Integration Technologies, Inc.
3 * Copyright (C) 2010, Albert Astals Cid <aacid@kde.org>
4 * Copyright (C) 2013 Adrian Johnson <ajohnson@redneon.com>
5 * Copyright (C) 2015, Arseniy Lartsev <arseniy@alumni.chalmers.se>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2, or (at your option)
12 * This program 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
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
22 #ifdef USE_GCC_PRAGMAS
23 #pragma implementation
26 #include "PageTransition.h"
28 //------------------------------------------------------------------------
30 //------------------------------------------------------------------------
32 PageTransition::PageTransition (Object
*trans
) {
36 type
= transitionReplace
;
38 alignment
= transitionHorizontal
;
39 direction
= transitionInward
;
45 if (!trans
|| !trans
->isDict ()) {
50 dict
= trans
->getDict();
53 if (dict
->lookup("S", &obj
)->isName()) {
54 const char *s
= obj
.getName();
56 if (strcmp("R", s
) == 0)
57 type
= transitionReplace
;
58 else if (strcmp("Split", s
) == 0)
59 type
= transitionSplit
;
60 else if (strcmp("Blinds", s
) == 0)
61 type
= transitionBlinds
;
62 else if (strcmp("Box", s
) == 0)
64 else if (strcmp("Wipe", s
) == 0)
65 type
= transitionWipe
;
66 else if (strcmp("Dissolve", s
) == 0)
67 type
= transitionDissolve
;
68 else if (strcmp("Glitter", s
) == 0)
69 type
= transitionGlitter
;
70 else if (strcmp("Fly", s
) == 0)
72 else if (strcmp("Push", s
) == 0)
73 type
= transitionPush
;
74 else if (strcmp("Cover", s
) == 0)
75 type
= transitionCover
;
76 else if (strcmp("Uncover", s
) == 0)
77 type
= transitionUncover
;
78 else if (strcmp("Fade", s
) == 0)
79 type
= transitionFade
;
84 if (dict
->lookup("D", &obj
)->isNum()) {
85 duration
= obj
.getNum();
90 if (dict
->lookup("Dm", &obj
)->isName()) {
91 const char *dm
= obj
.getName();
93 if (strcmp("H", dm
) == 0)
94 alignment
= transitionHorizontal
;
95 else if (strcmp("V", dm
) == 0)
96 alignment
= transitionVertical
;
101 if (dict
->lookup("M", &obj
)->isName()) {
102 const char *m
= obj
.getName();
104 if (strcmp("I", m
) == 0)
105 direction
= transitionInward
;
106 else if (strcmp("O", m
) == 0)
107 direction
= transitionOutward
;
112 if (dict
->lookup("Di", &obj
)->isInt()) {
113 angle
= obj
.getInt();
117 if (dict
->lookup("Di", &obj
)->isName()) {
118 if (strcmp("None", obj
.getName()) == 0)
124 if (dict
->lookup("SS", &obj
)->isNum()) {
125 scale
= obj
.getNum();
130 if (dict
->lookup("B", &obj
)->isBool()) {
131 rectangular
= obj
.getBool();
136 PageTransition::~PageTransition()