diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2015-09-10 06:46:36 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2015-09-10 06:46:36 +0000 |
commit | 659ec263572821f752f87ea4f7e4c13fcdd20461 (patch) | |
tree | 7809867cbb197f2ce93588b4077fd124a8f07a50 /Build/source/libs/poppler/poppler-0.36.0/splash/SplashFontFile.cc | |
parent | 1b3f4adac0a1d65102e83e1adb1f45d2ad35eb22 (diff) |
poppler 0.36.0
git-svn-id: svn://tug.org/texlive/trunk@38335 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/libs/poppler/poppler-0.36.0/splash/SplashFontFile.cc')
-rw-r--r-- | Build/source/libs/poppler/poppler-0.36.0/splash/SplashFontFile.cc | 124 |
1 files changed, 124 insertions, 0 deletions
diff --git a/Build/source/libs/poppler/poppler-0.36.0/splash/SplashFontFile.cc b/Build/source/libs/poppler/poppler-0.36.0/splash/SplashFontFile.cc new file mode 100644 index 00000000000..68e8608b6a7 --- /dev/null +++ b/Build/source/libs/poppler/poppler-0.36.0/splash/SplashFontFile.cc @@ -0,0 +1,124 @@ +//======================================================================== +// +// SplashFontFile.cc +// +//======================================================================== + +//======================================================================== +// +// Modified under the Poppler project - http://poppler.freedesktop.org +// +// All changes made under the Poppler project to this file are licensed +// under GPL version 2 or later +// +// Copyright (C) 2006 Takashi Iwai <tiwai@suse.de> +// Copyright (C) 2008 Albert Astals Cid <aacid@kde.org> +// +// To see a description of the changes please see the Changelog file that +// came with your tarball or type make ChangeLog if you are building from git +// +//======================================================================== + +#include <config.h> + +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + +#include <stdio.h> +#ifdef HAVE_UNISTD_H +#include <unistd.h> +#endif +#include "goo/gmem.h" +#include "goo/GooString.h" +#include "SplashFontFile.h" +#include "SplashFontFileID.h" + +#ifdef VMS +#if (__VMS_VER < 70000000) +extern "C" int unlink(char *filename); +#endif +#endif + +//------------------------------------------------------------------------ +// SplashFontFile +//------------------------------------------------------------------------ + +SplashFontFile::SplashFontFile(SplashFontFileID *idA, SplashFontSrc *srcA) { + id = idA; + src = srcA; + src->ref(); + refCnt = 0; + doAdjustMatrix = gFalse; +} + +SplashFontFile::~SplashFontFile() { + src->unref(); + delete id; +} + +void SplashFontFile::incRefCnt() { + ++refCnt; +} + +void SplashFontFile::decRefCnt() { + if (!--refCnt) { + delete this; + } +} + +// + +SplashFontSrc::SplashFontSrc() { + isFile = gFalse; + deleteSrc = gFalse; + fileName = NULL; + buf = NULL; + refcnt = 1; +} + +SplashFontSrc::~SplashFontSrc() { + if (deleteSrc) { + if (isFile) { + if (fileName) + unlink(fileName->getCString()); + } else { + if (buf) + gfree(buf); + } + } + + if (isFile && fileName) + delete fileName; +} + +void SplashFontSrc::ref() { + refcnt++; +} + +void SplashFontSrc::unref() { + if (! --refcnt) + delete this; +} + +void SplashFontSrc::setFile(GooString *file, GBool del) +{ + isFile = gTrue; + fileName = file->copy(); + deleteSrc = del; +} + +void SplashFontSrc::setFile(const char *file, GBool del) +{ + isFile = gTrue; + fileName = new GooString(file); + deleteSrc = del; +} + +void SplashFontSrc::setBuf(char *bufA, int bufLenA, GBool del) +{ + isFile = gFalse; + buf = bufA; + bufLen = bufLenA; + deleteSrc = del; +} |