VaKeR CYBER ARMY
Logo of a company Server : Apache/2.4.41 (Ubuntu)
System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64
User : www-data ( 33)
PHP Version : 7.4.33
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Directory :  /usr/share/emscripten/tests/poppler/poppler/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/share/emscripten/tests/poppler/poppler/PageTransition.cc
/* PageTransition.cc
 * Copyright (C) 2005, Net Integration Technologies, Inc.
 * Copyright (C) 2010, Albert Astals Cid <aacid@kde.org>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2, or (at your option)
 * any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
 */

#ifdef USE_GCC_PRAGMAS
#pragma implementation
#endif

#include "PageTransition.h"

//------------------------------------------------------------------------
// PageTransition
//------------------------------------------------------------------------

PageTransition::PageTransition (Object *trans) {
  Object obj;
  Dict *dict;

  type = transitionReplace;
  duration = 1;
  alignment = transitionHorizontal;
  direction = transitionInward;
  angle = 0;
  scale = 1.0;
  rectangular = gFalse;
  ok = gTrue;

  if (!trans || !trans->isDict ()) {
    ok = gFalse;
    return;
  }

  dict = trans->getDict();

  // get type
  if (dict->lookup("S", &obj)->isName()) {
    const char *s = obj.getName();
    
    if (strcmp("R", s) == 0)
      type = transitionReplace;
    else if (strcmp("Split", s) == 0)
      type = transitionSplit;
    else if (strcmp("Blinds", s) == 0)
      type = transitionBlinds;
    else if (strcmp("Box", s) == 0)
      type = transitionBox;
    else if (strcmp("Wipe", s) == 0)
      type = transitionWipe;
    else if (strcmp("Dissolve", s) == 0)
      type = transitionDissolve;
    else if (strcmp("Glitter", s) == 0)
      type = transitionGlitter;
    else if (strcmp("Fly", s) == 0)
      type = transitionFly;
    else if (strcmp("Push", s) == 0)
      type = transitionPush;
    else if (strcmp("Cover", s) == 0)
      type = transitionCover;
    else if (strcmp("Uncover", s) == 0)
      type = transitionUncover;
    else if (strcmp("Fade", s) == 0)
      type = transitionFade;
  }
  obj.free();

  // get duration
  if (dict->lookup("D", &obj)->isInt()) {
    duration = obj.getInt();
  }
  obj.free();

  // get alignment
  if (dict->lookup("Dm", &obj)->isName()) {
    const char *dm = obj.getName();
    
    if (strcmp("H", dm) == 0)
      alignment = transitionHorizontal;
    else if (strcmp("V", dm) == 0)
      alignment = transitionVertical;
  }
  obj.free();

  // get direction
  if (dict->lookup("M", &obj)->isName()) {
    const char *m = obj.getName();
    
    if (strcmp("I", m) == 0)
      direction = transitionInward;
    else if (strcmp("O", m) == 0)
      direction = transitionOutward;
  }
  obj.free();

  // get angle
  if (dict->lookup("Di", &obj)->isInt()) {
    angle = obj.getInt();
  }
  obj.free();

  if (dict->lookup("Di", &obj)->isName()) {
    if (strcmp("None", obj.getName()) == 0)
      angle = 0;
  }
  obj.free();

  // get sacle
  if (dict->lookup("SS", &obj)->isReal()) {
    scale = obj.getReal();
  }
  obj.free();

  // get rectangular
  if (dict->lookup("B", &obj)->isBool()) {
    rectangular = obj.getBool();
  }
  obj.free();
}

PageTransition::~PageTransition()
{
}


VaKeR 2022