Coverage Report

Created: 2025-08-26 06:28

/src/xpdf-4.05/xpdf/GlobalParams.h
Line
Count
Source (jump to first uncovered line)
1
//========================================================================
2
//
3
// GlobalParams.h
4
//
5
// Copyright 2001-2003 Glyph & Cog, LLC
6
//
7
//========================================================================
8
9
#ifndef GLOBALPARAMS_H
10
#define GLOBALPARAMS_H
11
12
#include <aconf.h>
13
14
#include <stdio.h>
15
#ifdef _WIN32
16
#  include <windows.h>
17
#endif
18
#include "gtypes.h"
19
#include "CharTypes.h"
20
21
#if MULTITHREADED
22
#include "GMutex.h"
23
#endif
24
25
class GString;
26
class GList;
27
class GHash;
28
class NameToCharCode;
29
class CharCodeToUnicode;
30
class CharCodeToUnicodeCache;
31
class UnicodeMap;
32
class UnicodeMapCache;
33
class UnicodeRemapping;
34
class CMap;
35
class CMapCache;
36
struct XpdfSecurityHandler;
37
class GlobalParams;
38
class SysFontList;
39
40
//------------------------------------------------------------------------
41
42
// The global parameters object.
43
extern GlobalParams *globalParams;
44
45
//------------------------------------------------------------------------
46
47
enum SysFontType {
48
  sysFontPFA,
49
  sysFontPFB,
50
  sysFontTTF,
51
  sysFontTTC,
52
  sysFontOTF
53
};
54
55
//------------------------------------------------------------------------
56
57
class PSFontParam16 {
58
public:
59
60
  GString *name;    // PDF font name for psResidentFont16;
61
        //   char collection name for psResidentFontCC
62
  int wMode;      // writing mode (0=horiz, 1=vert)
63
  GString *psFontName;    // PostScript font name
64
  GString *encoding;    // encoding
65
66
  PSFontParam16(GString *nameA, int wModeA,
67
    GString *psFontNameA, GString *encodingA);
68
  ~PSFontParam16();
69
};
70
71
//------------------------------------------------------------------------
72
73
enum PSLevel {
74
  psLevel1,
75
  psLevel1Sep,
76
  psLevel2,
77
  psLevel2Gray,
78
  psLevel2Sep,
79
  psLevel3,
80
  psLevel3Gray,
81
  psLevel3Sep,
82
};
83
84
//------------------------------------------------------------------------
85
86
enum EndOfLineKind {
87
  eolUnix,      // LF
88
  eolDOS,     // CR+LF
89
  eolMac      // CR
90
};
91
92
//------------------------------------------------------------------------
93
94
enum StrokeAdjustMode {
95
  strokeAdjustOff,
96
  strokeAdjustNormal,
97
  strokeAdjustCAD
98
};
99
100
//------------------------------------------------------------------------
101
102
enum ScreenType {
103
  screenUnset,
104
  screenDispersed,
105
  screenClustered,
106
  screenStochasticClustered
107
};
108
109
//------------------------------------------------------------------------
110
111
class KeyBinding {
112
public:
113
114
  int code;     // 0x20 .. 0xfe = ASCII,
115
        //   >=0x10000 = special keys, mouse buttons,
116
        //   etc. (xpdfKeyCode* symbols)
117
  int mods;     // modifiers (xpdfKeyMod* symbols, or-ed
118
        //   together)
119
  int context;      // context (xpdfKeyContext* symbols, or-ed
120
        //   together)
121
  GList *cmds;      // list of commands [GString]
122
123
  KeyBinding(int codeA, int modsA, int contextA, const char *cmd0);
124
  KeyBinding(int codeA, int modsA, int contextA,
125
       const char *cmd0, const char *cmd1);
126
  KeyBinding(int codeA, int modsA, int contextA, GList *cmdsA);
127
  ~KeyBinding();
128
};
129
130
4.81k
#define xpdfKeyCodeTab                0x1000
131
0
#define xpdfKeyCodeReturn             0x1001
132
0
#define xpdfKeyCodeEnter              0x1002
133
0
#define xpdfKeyCodeBackspace          0x1003
134
2.40k
#define xpdfKeyCodeEsc                0x1004
135
0
#define xpdfKeyCodeInsert             0x1005
136
0
#define xpdfKeyCodeDelete             0x1006
137
4.81k
#define xpdfKeyCodeHome               0x1007
138
4.81k
#define xpdfKeyCodeEnd                0x1008
139
7.21k
#define xpdfKeyCodePgUp               0x1009
140
7.21k
#define xpdfKeyCodePgDn               0x100a
141
4.81k
#define xpdfKeyCodeLeft               0x100b
142
4.81k
#define xpdfKeyCodeRight              0x100c
143
7.21k
#define xpdfKeyCodeUp                 0x100d
144
7.21k
#define xpdfKeyCodeDown               0x100e
145
0
#define xpdfKeyCodeF1                 0x1100
146
#define xpdfKeyCodeF35                0x1122
147
4.81k
#define xpdfKeyCodeMousePress1        0x2001
148
2.40k
#define xpdfKeyCodeMousePress2        0x2002
149
2.40k
#define xpdfKeyCodeMousePress3        0x2003
150
4.81k
#define xpdfKeyCodeMousePress4        0x2004
151
4.81k
#define xpdfKeyCodeMousePress5        0x2005
152
2.40k
#define xpdfKeyCodeMousePress6        0x2006
153
2.40k
#define xpdfKeyCodeMousePress7        0x2007
154
// ...
155
#define xpdfKeyCodeMousePress32       0x2020
156
4.81k
#define xpdfKeyCodeMouseRelease1      0x2101
157
2.40k
#define xpdfKeyCodeMouseRelease2      0x2102
158
#define xpdfKeyCodeMouseRelease3      0x2103
159
#define xpdfKeyCodeMouseRelease4      0x2104
160
#define xpdfKeyCodeMouseRelease5      0x2105
161
#define xpdfKeyCodeMouseRelease6      0x2106
162
#define xpdfKeyCodeMouseRelease7      0x2107
163
// ...
164
#define xpdfKeyCodeMouseRelease32     0x2120
165
2.40k
#define xpdfKeyCodeMouseClick1        0x2201
166
2.40k
#define xpdfKeyCodeMouseClick2        0x2202
167
#define xpdfKeyCodeMouseClick3        0x2203
168
#define xpdfKeyCodeMouseClick4        0x2204
169
#define xpdfKeyCodeMouseClick5        0x2205
170
#define xpdfKeyCodeMouseClick6        0x2206
171
#define xpdfKeyCodeMouseClick7        0x2207
172
// ...
173
#define xpdfKeyCodeMouseClick32       0x2220
174
2.40k
#define xpdfKeyCodeMouseDoubleClick1  0x2301
175
#define xpdfKeyCodeMouseDoubleClick2  0x2302
176
#define xpdfKeyCodeMouseDoubleClick3  0x2303
177
#define xpdfKeyCodeMouseDoubleClick4  0x2304
178
#define xpdfKeyCodeMouseDoubleClick5  0x2305
179
#define xpdfKeyCodeMouseDoubleClick6  0x2306
180
#define xpdfKeyCodeMouseDoubleClick7  0x2307
181
// ...
182
#define xpdfKeyCodeMouseDoubleClick32 0x2320
183
2.40k
#define xpdfKeyCodeMouseTripleClick1  0x2401
184
#define xpdfKeyCodeMouseTripleClick2  0x2402
185
#define xpdfKeyCodeMouseTripleClick3  0x2403
186
#define xpdfKeyCodeMouseTripleClick4  0x2404
187
#define xpdfKeyCodeMouseTripleClick5  0x2405
188
#define xpdfKeyCodeMouseTripleClick6  0x2406
189
#define xpdfKeyCodeMouseTripleClick7  0x2407
190
// ...
191
#define xpdfKeyCodeMouseTripleClick32 0x2420
192
62.5k
#define xpdfKeyModNone            0
193
7.21k
#define xpdfKeyModShift           (1 << 0)
194
74.5k
#define xpdfKeyModCtrl            (1 << 1)
195
4.81k
#define xpdfKeyModAlt             (1 << 2)
196
132k
#define xpdfKeyContextAny         0
197
2.40k
#define xpdfKeyContextFullScreen  (1 << 0)
198
0
#define xpdfKeyContextWindow      (2 << 0)
199
0
#define xpdfKeyContextContinuous  (1 << 2)
200
0
#define xpdfKeyContextSinglePage  (2 << 2)
201
2.40k
#define xpdfKeyContextOverLink    (1 << 4)
202
0
#define xpdfKeyContextOffLink     (2 << 4)
203
0
#define xpdfKeyContextOutline     (1 << 6)
204
0
#define xpdfKeyContextMainWin     (2 << 6)
205
9.62k
#define xpdfKeyContextScrLockOn   (1 << 8)
206
0
#define xpdfKeyContextScrLockOff  (2 << 8)
207
208
//------------------------------------------------------------------------
209
210
class PopupMenuCmd {
211
public:
212
213
  GString *label;   // label for display in the menu
214
  GList *cmds;      // list of commands [GString]
215
216
  PopupMenuCmd(GString *labelA, GList *cmdsA);
217
  ~PopupMenuCmd();
218
};
219
220
//------------------------------------------------------------------------
221
222
#ifdef _WIN32
223
struct XpdfWin32ErrorInfo {
224
  const char *func;   // last Win32 API function call to fail
225
  DWORD code;     // error code returned by that function
226
};
227
#endif
228
229
//------------------------------------------------------------------------
230
231
class GlobalParams {
232
public:
233
234
  // Initialize the global parameters by attempting to read a config
235
  // file.
236
  GlobalParams(const char *cfgFileName);
237
238
  ~GlobalParams();
239
240
  void setBaseDir(const char *dir);
241
  void setupBaseFonts(const char *dir);
242
243
  void parseLine(char *buf, GString *fileName, int line);
244
245
  //----- accessors
246
247
  CharCode getMacRomanCharCode(char *charName);
248
249
  GString *getBaseDir();
250
  Unicode mapNameToUnicode(const char *charName);
251
  UnicodeMap *getResidentUnicodeMap(GString *encodingName);
252
  FILE *getUnicodeMapFile(GString *encodingName);
253
  FILE *findCMapFile(GString *collection, GString *cMapName);
254
  FILE *findToUnicodeFile(GString *name);
255
  UnicodeRemapping *getUnicodeRemapping();
256
  GString *findFontFile(GString *fontName);
257
  GString *findBase14FontFile(GString *fontName, int *fontNum,
258
            double *oblique);
259
  GString *findSystemFontFile(GString *fontName, SysFontType *type,
260
            int *fontNum);
261
  GString *findCCFontFile(GString *collection);
262
  int getPSPaperWidth();
263
  int getPSPaperHeight();
264
  void getPSImageableArea(int *llx, int *lly, int *urx, int *ury);
265
  GBool getPSDuplex();
266
  GBool getPSCrop();
267
  GBool getPSUseCropBoxAsPage();
268
  GBool getPSExpandSmaller();
269
  GBool getPSShrinkLarger();
270
  GBool getPSCenter();
271
  PSLevel getPSLevel();
272
  GString *getPSResidentFont(GString *fontName);
273
  GList *getPSResidentFonts();
274
  PSFontParam16 *getPSResidentFont16(GString *fontName, int wMode);
275
  PSFontParam16 *getPSResidentFontCC(GString *collection, int wMode);
276
  GBool getPSEmbedType1();
277
  GBool getPSEmbedTrueType();
278
  GBool getPSEmbedCIDPostScript();
279
  GBool getPSEmbedCIDTrueType();
280
  GBool getPSFontPassthrough();
281
  GBool getPSPreload();
282
  GBool getPSOPI();
283
  GBool getPSASCIIHex();
284
  GBool getPSLZW();
285
  GBool getPSUncompressPreloadedImages();
286
  double getPSMinLineWidth();
287
  double getPSRasterResolution();
288
  GBool getPSRasterMono();
289
  int getPSRasterSliceSize();
290
  GBool getPSAlwaysRasterize();
291
  GBool getPSNeverRasterize();
292
  GString *getTextEncodingName();
293
  GList *getAvailableTextEncodings();
294
  EndOfLineKind getTextEOL();
295
  GBool getTextPageBreaks();
296
  GBool getTextKeepTinyChars();
297
  GString *getInitialZoom();
298
  int getDefaultFitZoom();
299
  double getZoomScaleFactor();
300
  GList *getZoomValues();
301
  GString *getInitialDisplayMode();
302
  GBool getInitialToolbarState();
303
  GBool getInitialSidebarState();
304
  int getInitialSidebarWidth();
305
  GString *getInitialSelectMode();
306
  int getMaxTileWidth();
307
  int getMaxTileHeight();
308
  int getTileCacheSize();
309
  int getWorkerThreads();
310
  GBool getEnableFreeType();
311
  GBool getDisableFreeTypeHinting();
312
  GBool getAntialias();
313
  GBool getVectorAntialias();
314
  GBool getImageMaskAntialias();
315
  GBool getAntialiasPrinting();
316
  StrokeAdjustMode getStrokeAdjust();
317
  ScreenType getScreenType();
318
  int getScreenSize();
319
  int getScreenDotRadius();
320
  double getScreenGamma();
321
  double getScreenBlackThreshold();
322
  double getScreenWhiteThreshold();
323
  double getMinLineWidth();
324
  GBool getEnablePathSimplification();
325
  GBool getDrawAnnotations();
326
  GBool getDrawFormFields();
327
  GBool getEnableXFA();
328
0
  GBool getOverprintPreview() { return overprintPreview; }
329
  GString *getPaperColor();
330
  GString *getMatteColor();
331
  GString *getFullScreenMatteColor();
332
  GString *getSelectionColor();
333
  GBool getReverseVideoInvertImages();
334
  GBool getAllowLinksToChangeZoom();
335
0
  GString *getLaunchCommand() { return launchCommand; }
336
0
  GString *getMovieCommand() { return movieCommand; }
337
  GString *getDefaultPrinter();
338
  GBool getMapNumericCharNames();
339
  GBool getMapUnknownCharNames();
340
  GBool getMapExtTrueTypeFontsViaUnicode();
341
  GBool getUseTrueTypeUnicodeMapping();
342
  GBool getIgnoreWrongSizeToUnicode();
343
  GBool isDroppedFont(const char *fontName);
344
  GBool getSeparateRotatedText();
345
  GList *getKeyBinding(int code, int mods, int context);
346
  GList *getAllKeyBindings();
347
  int getNumPopupMenuCmds();
348
  PopupMenuCmd *getPopupMenuCmd(int idx);
349
  GString *getPagesFile();
350
  GString *getTabStateFile();
351
  GString *getSessionFile();
352
  GBool getSaveSessionOnQuit();
353
  GBool getSavePageNumbers();
354
  GBool getPrintCommands();
355
  GBool getPrintStatusInfo();
356
  GBool getErrQuiet();
357
  GString *getDebugLogFile();
358
  void debugLogPrintf(const char *fmt, ...);
359
360
  CharCodeToUnicode *getCIDToUnicode(GString *collection);
361
  CharCodeToUnicode *getUnicodeToUnicode(GString *fontName);
362
  UnicodeMap *getUnicodeMap(GString *encodingName);
363
  CMap *getCMap(GString *collection, GString *cMapName);
364
  UnicodeMap *getTextEncoding();
365
366
  //----- functions to set parameters
367
368
  void addUnicodeRemapping(Unicode in, Unicode *out, int len);
369
  void addFontFile(GString *fontName, GString *path);
370
  GBool setPSPaperSize(char *size);
371
  void setPSPaperWidth(int width);
372
  void setPSPaperHeight(int height);
373
  void setPSImageableArea(int llx, int lly, int urx, int ury);
374
  void setPSDuplex(GBool duplex);
375
  void setPSCrop(GBool crop);
376
  void setPSUseCropBoxAsPage(GBool crop);
377
  void setPSExpandSmaller(GBool expand);
378
  void setPSShrinkLarger(GBool shrink);
379
  void setPSCenter(GBool center);
380
  void setPSLevel(PSLevel level);
381
  void setPSEmbedType1(GBool embed);
382
  void setPSEmbedTrueType(GBool embed);
383
  void setPSEmbedCIDPostScript(GBool embed);
384
  void setPSEmbedCIDTrueType(GBool embed);
385
  void setPSFontPassthrough(GBool passthrough);
386
  void setPSPreload(GBool preload);
387
  void setPSOPI(GBool opi);
388
  void setPSASCIIHex(GBool hex);
389
  void setTextEncoding(const char *encodingName);
390
  GBool setTextEOL(char *s);
391
  void setTextPageBreaks(GBool pageBreaks);
392
  void setTextKeepTinyChars(GBool keep);
393
  void setInitialZoom(char *s);
394
  void setDefaultFitZoom(int z);
395
  GBool setEnableFreeType(char *s);
396
  GBool setAntialias(char *s);
397
  GBool setVectorAntialias(char *s);
398
  void setScreenType(ScreenType t);
399
  void setScreenSize(int size);
400
  void setScreenDotRadius(int r);
401
  void setScreenGamma(double gamma);
402
  void setScreenBlackThreshold(double thresh);
403
  void setScreenWhiteThreshold(double thresh);
404
  void setDrawFormFields(GBool draw);
405
  void setOverprintPreview(GBool preview);
406
  void setMapNumericCharNames(GBool map);
407
  void setMapUnknownCharNames(GBool map);
408
  void setMapExtTrueTypeFontsViaUnicode(GBool map);
409
  void setTabStateFile(char *tabStateFileA);
410
  void setSessionFile(char *sessionFileA);
411
  void setPrintCommands(GBool printCommandsA);
412
  void setPrintStatusInfo(GBool printStatusInfoA);
413
  void setErrQuiet(GBool errQuietA);
414
415
#ifdef _WIN32
416
  void setWin32ErrorInfo(const char *func, DWORD code);
417
  XpdfWin32ErrorInfo *getWin32ErrorInfo();
418
#endif
419
420
  static const char *defaultTextEncoding;
421
422
private:
423
424
  void setDataDirVar();
425
  void createDefaultKeyBindings();
426
  void initStateFilePaths();
427
  void parseFile(GString *fileName, FILE *f);
428
  GList *parseLineTokens(char *buf, GString *fileName, int line);
429
  void parseNameToUnicode(GList *tokens, GString *fileName, int line);
430
  void parseCIDToUnicode(GList *tokens, GString *fileName, int line);
431
  void parseUnicodeToUnicode(GList *tokens, GString *fileName, int line);
432
  void parseUnicodeMap(GList *tokens, GString *fileName, int line);
433
  void parseCMapDir(GList *tokens, GString *fileName, int line);
434
  void parseToUnicodeDir(GList *tokens, GString *fileName, int line);
435
  void parseUnicodeRemapping(GList *tokens, GString *fileName, int line);
436
  void parseFontFile(GList *tokens, GString *fileName, int line);
437
  void parseFontDir(GList *tokens, GString *fileName, int line);
438
  void parseFontFileCC(GList *tokens, GString *fileName,
439
           int line);
440
  void parsePSPaperSize(GList *tokens, GString *fileName, int line);
441
  void parsePSImageableArea(GList *tokens, GString *fileName, int line);
442
  void parsePSLevel(GList *tokens, GString *fileName, int line);
443
  void parsePSResidentFont(GList *tokens, GString *fileName, int line);
444
  void parsePSResidentFont16(GList *tokens, GString *fileName, int line);
445
  void parsePSResidentFontCC(GList *tokens, GString *fileName, int line);
446
  void parseTextEOL(GList *tokens, GString *fileName, int line);
447
  void parseStrokeAdjust(GList *tokens, GString *fileName, int line);
448
  void parseScreenType(GList *tokens, GString *fileName, int line);
449
  void parseDropFont(GList *tokens, GString *fileName, int line);
450
  void parseBind(GList *tokens, GString *fileName, int line);
451
  void parseUnbind(GList *tokens, GString *fileName, int line);
452
  GBool parseKey(GString *modKeyStr, GString *contextStr,
453
     int *code, int *mods, int *context,
454
     const char *cmdName,
455
     GList *tokens, GString *fileName, int line);
456
  void parsePopupMenuCmd(GList *tokens, GString *fileName, int line);
457
  void parseZoomScaleFactor(GList *tokens, GString *fileName, int line);
458
  void parseZoomValues(GList *tokens, GString *fileName, int line);
459
  void parseYesNo(const char *cmdName, GBool *flag,
460
      GList *tokens, GString *fileName, int line);
461
  GBool parseYesNo2(char *token, GBool *flag);
462
  void parseString(const char *cmdName, GString **s,
463
       GList *tokens, GString *fileName, int line);
464
  void parseInteger(const char *cmdName, int *val,
465
        GList *tokens, GString *fileName, int line);
466
  void parseFloat(const char *cmdName, double *val,
467
      GList *tokens, GString *fileName, int line);
468
  UnicodeMap *getUnicodeMap2(GString *encodingName);
469
470
  //----- static tables
471
472
  NameToCharCode *    // mapping from char name to
473
    macRomanReverseMap;   //   MacRomanEncoding index
474
475
  //----- meta settings
476
477
  GString *baseDir;   // base directory - for plugins, etc.
478
  GHash *configFileVars;  // variables for use in the config file
479
        //   [GString]
480
481
  //----- user-modifiable settings
482
483
  NameToCharCode *    // mapping from char name to Unicode
484
    nameToUnicode;
485
  GHash *cidToUnicodes;   // files for mappings from char collections
486
        //   to Unicode, indexed by collection name
487
        //   [GString]
488
  GHash *unicodeToUnicodes; // files for Unicode-to-Unicode mappings,
489
        //   indexed by font name pattern [GString]
490
  GHash *residentUnicodeMaps; // mappings from Unicode to char codes,
491
        //   indexed by encoding name [UnicodeMap]
492
  GHash *unicodeMaps;   // files for mappings from Unicode to char
493
        //   codes, indexed by encoding name [GString]
494
  GHash *cMapDirs;    // list of CMap dirs, indexed by collection
495
        //   name [GList[GString]]
496
  GList *toUnicodeDirs;   // list of ToUnicode CMap dirs [GString]
497
  UnicodeRemapping *    // Unicode remapping for text output
498
    unicodeRemapping;
499
  GHash *fontFiles;   // font files: font name mapped to path
500
        //   [GString]
501
  GList *fontDirs;    // list of font dirs [GString]
502
  GHash *ccFontFiles;   // character collection font files:
503
        //   collection name  mapped to path [GString]
504
  GHash *base14SysFonts;  // Base-14 system font files: font name
505
        //   mapped to path [Base14FontInfo]
506
  SysFontList *sysFonts;  // system fonts
507
  int psPaperWidth;   // paper size, in PostScript points, for
508
  int psPaperHeight;    //   PostScript output
509
  int psImageableLLX,   // imageable area, in PostScript points,
510
      psImageableLLY,   //   for PostScript output
511
      psImageableURX,
512
      psImageableURY;
513
  GBool psCrop;     // crop PS output to CropBox
514
  GBool psUseCropBoxAsPage; // use CropBox as page size
515
  GBool psExpandSmaller;  // expand smaller pages to fill paper
516
  GBool psShrinkLarger;   // shrink larger pages to fit paper
517
  GBool psCenter;   // center pages on the paper
518
  GBool psDuplex;   // enable duplexing in PostScript?
519
  PSLevel psLevel;    // PostScript level to generate
520
  GHash *psResidentFonts; // 8-bit fonts resident in printer:
521
        //   PDF font name mapped to PS font name
522
        //   [GString]
523
  GList *psResidentFonts16; // 16-bit fonts resident in printer:
524
        //   PDF font name mapped to font info
525
        //   [PSFontParam16]
526
  GList *psResidentFontsCC; // 16-bit character collection fonts
527
        //   resident in printer: collection name
528
        //   mapped to font info [PSFontParam16]
529
  GBool psEmbedType1;   // embed Type 1 fonts?
530
  GBool psEmbedTrueType;  // embed TrueType fonts?
531
  GBool psEmbedCIDPostScript; // embed CID PostScript fonts?
532
  GBool psEmbedCIDTrueType; // embed CID TrueType fonts?
533
  GBool psFontPassthrough;  // pass all fonts through as-is?
534
  GBool psPreload;    // preload PostScript images and forms into
535
        //   memory
536
  GBool psOPI;      // generate PostScript OPI comments?
537
  GBool psASCIIHex;   // use ASCIIHex instead of ASCII85?
538
  GBool psLZW;      // false to use RLE instead of LZW
539
  GBool psUncompressPreloadedImages;  // uncompress all preloaded images
540
  double psMinLineWidth;  // minimum line width for PostScript output
541
  double psRasterResolution;  // PostScript rasterization resolution (dpi)
542
  GBool psRasterMono;   // true to do PostScript rasterization
543
        //   in monochrome (gray); false to do it
544
        //   in color (RGB/CMYK)
545
  int psRasterSliceSize;  // maximum size (pixels) of PostScript
546
        //   rasterization slice
547
  GBool psAlwaysRasterize;  // force PostScript rasterization
548
  GBool psNeverRasterize; // prevent PostScript rasterization
549
  GString *textEncoding;  // encoding (unicodeMap) to use for text
550
        //   output
551
  EndOfLineKind textEOL;  // type of EOL marker to use for text
552
        //   output
553
  GBool textPageBreaks;   // insert end-of-page markers?
554
  GBool textKeepTinyChars;  // keep all characters in text output
555
  GString *initialZoom;   // initial zoom level
556
  int defaultFitZoom;   // default zoom factor if initialZoom is
557
        //   'page' or 'width'
558
  double zoomScaleFactor; // displayed zoom values are scaled by this
559
  GList *zoomValues;    // zoom values for the combo box
560
  GString *initialDisplayMode;  // initial display mode (single,
561
        //   continuous, etc.)
562
  GBool initialToolbarState;  // initial toolbar state - open (true)
563
        //   or closed (false)
564
  GBool initialSidebarState;  // initial sidebar state - open (true)
565
        //   or closed (false)
566
  int initialSidebarWidth;  // initial sidebar width
567
  GString *initialSelectMode; // initial selection mode (block or linear)
568
  int maxTileWidth;   // maximum rasterization tile width
569
  int maxTileHeight;    // maximum rasterization tile height
570
  int tileCacheSize;    // number of rasterization tiles in cache
571
  int workerThreads;    // number of rasterization worker threads
572
  GBool enableFreeType;   // FreeType enable flag
573
  GBool disableFreeTypeHinting; // FreeType hinting disable flag
574
  GBool antialias;    // font anti-aliasing enable flag
575
  GBool vectorAntialias;  // vector anti-aliasing enable flag
576
  GBool imageMaskAntialias; // image mask anti-aliasing enable flag
577
  GBool antialiasPrinting;  // allow anti-aliasing when printing
578
  StrokeAdjustMode strokeAdjust; // stroke adjustment mode
579
  ScreenType screenType;  // halftone screen type
580
  int screenSize;   // screen matrix size
581
  int screenDotRadius;    // screen dot radius
582
  double screenGamma;   // screen gamma correction
583
  double screenBlackThreshold;  // screen black clamping threshold
584
  double screenWhiteThreshold;  // screen white clamping threshold
585
  double minLineWidth;    // minimum line width
586
  GBool       // enable path simplification
587
    enablePathSimplification;
588
  GBool drawAnnotations;  // draw annotations or not
589
  GBool drawFormFields;   // draw form fields or not
590
  GBool enableXFA;    // enable XFA form parsing
591
  GBool overprintPreview; // enable overprint preview
592
  GString *paperColor;    // paper (page background) color
593
  GString *matteColor;    // matte (background outside of page) color
594
  GString *fullScreenMatteColor; // matte color in full-screen mode
595
  GString *selectionColor;  // selection color
596
  GBool reverseVideoInvertImages; // invert images in reverse video mode
597
  GBool allowLinksToChangeZoom; // allow clicking on a link to change the zoom
598
  GString *launchCommand; // command executed for 'launch' links
599
  GString *movieCommand;  // command executed for movie annotations
600
  GString *defaultPrinter;  // default printer (for interactive printing
601
        //   from the viewer)
602
  GBool mapNumericCharNames;  // map numeric char names (from font subsets)?
603
  GBool mapUnknownCharNames;  // map unknown char names?
604
  GBool mapExtTrueTypeFontsViaUnicode;  // map char codes to GID via Unicode
605
                //   for external TrueType fonts?
606
  GBool useTrueTypeUnicodeMapping;  // use the Unicode cmaps in TrueType
607
          //   fonts, rather than the PDF
608
          //   ToUnicode mapping
609
  GBool ignoreWrongSizeToUnicode;  // ignore ToUnicode CMaps if their size
610
           //   (8-bit vs 16-bit) doesn't match the font
611
  GHash *droppedFonts;    // dropped fonts [int]
612
  GBool separateRotatedText;  // separate text at each rotation
613
  GList *keyBindings;   // key & mouse button bindings [KeyBinding]
614
  GList *popupMenuCmds;   // popup menu commands [PopupMenuCmd]
615
  GString *pagesFile;   // path for the page number save file
616
  GString *tabStateFile;  // path for the tab state save file
617
  GString *sessionFile;   // path for the session save file
618
  GBool saveSessionOnQuit;  // save session info when xpdf is quit
619
  GBool savePageNumbers;  // save page number when file is closed
620
        //   and restore page number when opened
621
  GBool printCommands;    // print the drawing commands
622
  GBool printStatusInfo;  // print status info for each page
623
  GBool errQuiet;   // suppress error messages?
624
  GString *debugLogFile;  // path for debug log file
625
626
  CharCodeToUnicodeCache *cidToUnicodeCache;
627
  CharCodeToUnicodeCache *unicodeToUnicodeCache;
628
  UnicodeMapCache *unicodeMapCache;
629
  CMapCache *cMapCache;
630
631
#if MULTITHREADED
632
  GMutex mutex;
633
  GMutex unicodeMapCacheMutex;
634
  GMutex cMapCacheMutex;
635
#endif
636
#ifdef _WIN32
637
  DWORD tlsWin32ErrorInfo;  // TLS index for error info
638
#endif
639
};
640
641
#endif