Commit 4ae7d43b authored by Albert Astals Cid's avatar Albert Astals Cid

* goo/GooVector.h: Rename guard from _VECTOR_H to GOO_VECTOR_H

        * goo/gfile.cc: GString -> GooString in Windows code
        * poppler/GlobalParams.cc: GString -> GooString in Windows code
        * splash/SplashT1FontEngine.cc
        * splash/SplashT1FontEngine.h
        * splash/SplashT1FontFile.cc
        * splash/SplashT1FontFile.h: T1 code is not supported, but at least
        make it compile :-D
parent 7bd125ce
2007-07-11 Albert Astals Cid <aacid@kde.org>
* goo/GooVector.h: Rename guard from _VECTOR_H to GOO_VECTOR_H
* goo/gfile.cc: GString -> GooString in Windows code
* poppler/GlobalParams.cc: GString -> GooString in Windows code
* splash/SplashT1FontEngine.cc
* splash/SplashT1FontEngine.h
* splash/SplashT1FontFile.cc
* splash/SplashT1FontFile.h: T1 code is not supported, but at least
make it compile :-D
2007-07-11 Carlos Garcia Campos <carlosgc@gnome.org>
* poppler/Form.cc:
......
#ifndef _VECTOR_H
#define _VECTOR_H
#ifndef GOO_VECTOR_H
#define GOO_VECTOR_H
#include "goo/gtypes.h"
......
......@@ -443,7 +443,7 @@ GBool openTempFile(GooString **name, FILE **f, char *mode, char *ext) {
#if defined(WIN32)
//---------- Win32 ----------
char *tempDir;
GString *s, *s2;
GooString *s, *s2;
char buf[32];
FILE *f2;
int t, i;
......@@ -452,10 +452,10 @@ GBool openTempFile(GooString **name, FILE **f, char *mode, char *ext) {
// a better way to generate temp file names with extensions on
// Windows
if ((tempDir = getenv("TEMP"))) {
s = new GString(tempDir);
s = new GooString(tempDir);
s->append('\\');
} else {
s = new GString();
s = new GooString();
}
s->append("x");
t = (int)time(NULL);
......
......@@ -130,18 +130,18 @@ public:
GBool bold, italic;
static WinFontInfo *make(GString *nameA, GBool boldA, GBool italicA,
static WinFontInfo *make(GooString *nameA, GBool boldA, GBool italicA,
HKEY regKey, char *winFontDir);
WinFontInfo(GString *nameA, GBool boldA, GBool italicA,
GString *fileNameA);
WinFontInfo(GooString *nameA, GBool boldA, GBool italicA,
GooString *fileNameA);
virtual ~WinFontInfo();
GBool equals(WinFontInfo *fi);
};
WinFontInfo *WinFontInfo::make(GString *nameA, GBool boldA, GBool italicA,
WinFontInfo *WinFontInfo::make(GooString *nameA, GBool boldA, GBool italicA,
HKEY regKey, char *winFontDir) {
GString *regName;
GString *fileNameA;
GooString *regName;
GooString *fileNameA;
char buf[MAX_PATH];
DWORD n;
char c;
......@@ -160,7 +160,7 @@ WinFontInfo *WinFontInfo::make(GString *nameA, GBool boldA, GBool italicA,
n = sizeof(buf);
if (RegQueryValueEx(regKey, regName->getCString(), NULL, NULL,
(LPBYTE)buf, &n) == ERROR_SUCCESS) {
fileNameA = new GString(winFontDir);
fileNameA = new GooString(winFontDir);
fileNameA->append('\\')->append(buf);
}
delete regName;
......@@ -183,8 +183,8 @@ WinFontInfo *WinFontInfo::make(GString *nameA, GBool boldA, GBool italicA,
return new WinFontInfo(nameA, boldA, italicA, fileNameA);
}
WinFontInfo::WinFontInfo(GString *nameA, GBool boldA, GBool italicA,
GString *fileNameA):
WinFontInfo::WinFontInfo(GooString *nameA, GBool boldA, GBool italicA,
GooString *fileNameA):
DisplayFontParam(nameA, displayFontTT)
{
bold = boldA;
......@@ -208,7 +208,7 @@ public:
WinFontList(char *winFontDirA);
~WinFontList();
WinFontInfo *find(GString *font);
WinFontInfo *find(GooString *font);
private:
......@@ -265,8 +265,8 @@ void WinFontList::add(WinFontInfo *fi) {
fonts->append(fi);
}
WinFontInfo *WinFontList::find(GString *font) {
GString *name;
WinFontInfo *WinFontList::find(GooString *font) {
GooString *name;
GBool bold, italic;
WinFontInfo *fi;
char c;
......@@ -352,7 +352,7 @@ int CALLBACK WinFontList::enumFunc2(CONST LOGFONT *font,
WinFontInfo *fi;
if (type & TRUETYPE_FONTTYPE) {
if ((fi = WinFontInfo::make(new GString(font->lfFaceName),
if ((fi = WinFontInfo::make(new GooString(font->lfFaceName),
font->lfWeight >= 600,
font->lfItalic ? gTrue : gFalse,
fl->regKey, fl->winFontDir))) {
......
......@@ -148,7 +148,7 @@ SplashFontFile *SplashFontEngine::loadType1CFont(SplashFontFileID *idA,
fontFile = NULL;
#if HAVE_T1LIB_H
if (!fontFile && t1Engine) {
fontFile = t1Engine->loadType1CFont(idA, sec, enc);
fontFile = t1Engine->loadType1CFont(idA, src, enc);
}
#endif
#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
......
......@@ -84,7 +84,7 @@ SplashT1FontEngine::~SplashT1FontEngine() {
SplashFontFile *SplashT1FontEngine::loadType1Font(SplashFontFileID *idA,
SplashFontSrc *src,
char **enc) {
return SplashT1FontFile::loadType1Font(this, idA, fileName, deleteFile, enc);
return SplashT1FontFile::loadType1Font(this, idA, src, enc);
}
SplashFontFile *SplashT1FontEngine::loadType1CFont(SplashFontFileID *idA,
......@@ -98,12 +98,12 @@ SplashFontFile *SplashT1FontEngine::loadType1CFont(SplashFontFileID *idA,
SplashFontSrc *newsrc;
if (src->isFile)
ff = FoFiType1C::load(src->fileName);
ff = FoFiType1C::load(src->fileName->getCString());
else
ff = new FoFiType1C(src->buf, src->bufLen, gFalse);
ff = FoFiType1C::make(src->buf, src->bufLen);
if (! ff)
return NULL;
}
tmpFileName = NULL;
if (!openTempFile(&tmpFileName, &tmpFile, "wb", NULL)) {
delete ff;
......
......@@ -17,6 +17,7 @@
class SplashFontFile;
class SplashFontFileID;
class SplashFontSrc;
//------------------------------------------------------------------------
// SplashT1FontEngine
......@@ -30,10 +31,8 @@ public:
~SplashT1FontEngine();
// Load fonts.
SplashFontFile *loadType1Font(SplashFontFileID *idA, char *fileName,
GBool deleteFile, char **enc);
SplashFontFile *loadType1CFont(SplashFontFileID *idA, char *fileName,
GBool deleteFile, char **enc);
SplashFontFile *loadType1Font(SplashFontFileID *idA, SplashFontSrc *src, char **enc);
SplashFontFile *loadType1CFont(SplashFontFileID *idA, SplashFontSrc *src, char **enc);
private:
......
......@@ -14,6 +14,8 @@
#include <string.h>
#include <t1lib.h>
#include "goo/GooString.h"
#include "goo/gfile.h"
#include "goo/gmem.h"
#include "SplashT1FontEngine.h"
#include "SplashT1Font.h"
......@@ -34,12 +36,12 @@ SplashFontFile *SplashT1FontFile::loadType1Font(SplashT1FontEngine *engineA,
char *encPtr;
int i;
GString *fileNameA;
GooString *fileNameA;
SplashFontSrc *newsrc = NULL;
SplashFontFile *ff;
if (! src->isFile) {
GString *tmpFileName;
GooString *tmpFileName;
FILE *tmpFile;
if (!openTempFile(&tmpFileName, &tmpFile, "wb", NULL))
return NULL;
......@@ -52,7 +54,7 @@ SplashFontFile *SplashT1FontFile::loadType1Font(SplashT1FontEngine *engineA,
}
fileNameA = src->fileName;
// load the font file
if ((t1libIDA = T1_AddFont(fileNameA)) < 0) {
if ((t1libIDA = T1_AddFont(fileNameA->getCString())) < 0) {
delete newsrc;
return NULL;
}
......
......@@ -26,7 +26,7 @@ public:
static SplashFontFile *loadType1Font(SplashT1FontEngine *engineA,
SplashFontFileID *idA,
char *fileNameA,
SplashFontSrc *src,
char **encA);
virtual ~SplashT1FontFile();
......@@ -40,7 +40,7 @@ private:
SplashT1FontFile(SplashT1FontEngine *engineA,
SplashFontFileID *idA,
char *fileNameA,
SplashFontSrc *src,
int t1libIDA, char **encA, char *encStrA);
SplashT1FontEngine *engine;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment