Coverage Report

Created: 2026-02-26 07:15

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/xpdf-4.06/xpdf/GlobalParams.h
Line
Count
Source
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
37.7k
#define xpdfKeyCodeTab                0x1000
131
0
#define xpdfKeyCodeReturn             0x1001
132
0
#define xpdfKeyCodeEnter              0x1002
133
0
#define xpdfKeyCodeBackspace          0x1003
134
18.8k
#define xpdfKeyCodeEsc                0x1004
135
0
#define xpdfKeyCodeInsert             0x1005
136
0
#define xpdfKeyCodeDelete             0x1006
137
37.7k
#define xpdfKeyCodeHome               0x1007
138
37.7k
#define xpdfKeyCodeEnd                0x1008
139
56.6k
#define xpdfKeyCodePgUp               0x1009
140
56.6k
#define xpdfKeyCodePgDn               0x100a
141
37.7k
#define xpdfKeyCodeLeft               0x100b
142
37.7k
#define xpdfKeyCodeRight              0x100c
143
56.6k
#define xpdfKeyCodeUp                 0x100d
144
56.6k
#define xpdfKeyCodeDown               0x100e
145
0
#define xpdfKeyCodeF1                 0x1100
146
#define xpdfKeyCodeF35                0x1122
147
37.7k
#define xpdfKeyCodeMousePress1        0x2001
148
18.8k
#define xpdfKeyCodeMousePress2        0x2002
149
18.8k
#define xpdfKeyCodeMousePress3        0x2003
150
37.7k
#define xpdfKeyCodeMousePress4        0x2004
151
37.7k
#define xpdfKeyCodeMousePress5        0x2005
152
18.8k
#define xpdfKeyCodeMousePress6        0x2006
153
18.8k
#define xpdfKeyCodeMousePress7        0x2007
154
// ...
155
#define xpdfKeyCodeMousePress32       0x2020
156
37.7k
#define xpdfKeyCodeMouseRelease1      0x2101
157
18.8k
#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
18.8k
#define xpdfKeyCodeMouseClick1        0x2201
166
18.8k
#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
18.8k
#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
18.8k
#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
491k
#define xpdfKeyModNone            0
193
56.6k
#define xpdfKeyModShift           (1 << 0)
194
585k
#define xpdfKeyModCtrl            (1 << 1)
195
37.7k
#define xpdfKeyModAlt             (1 << 2)
196
1.03M
#define xpdfKeyContextAny         0
197
18.8k
#define xpdfKeyContextFullScreen  (1 << 0)
198
0
#define xpdfKeyContextWindow      (2 << 0)
199
0
#define xpdfKeyContextContinuous  (1 << 2)
200
0
#define xpdfKeyContextSinglePage  (2 << 2)
201
18.8k
#define xpdfKeyContextOverLink    (1 << 4)
202
0
#define xpdfKeyContextOffLink     (2 << 4)
203
0
#define xpdfKeyContextOutline     (1 << 6)
204
0
#define xpdfKeyContextMainWin     (2 << 6)
205
75.5k
#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
  GBool getInitialMaximized();
307
  int getMaxTileWidth();
308
  int getMaxTileHeight();
309
  int getTileCacheSize();
310
  int getWorkerThreads();
311
  GBool getEnableFreeType();
312
  GBool getDisableFreeTypeHinting();
313
  GBool getAntialias();
314
  GBool getVectorAntialias();
315
  GBool getImageMaskAntialias();
316
  GBool getAntialiasPrinting();
317
  StrokeAdjustMode getStrokeAdjust();
318
  ScreenType getScreenType();
319
  int getScreenSize();
320
  int getScreenDotRadius();
321
  double getScreenGamma();
322
  double getScreenBlackThreshold();
323
  double getScreenWhiteThreshold();
324
  double getMinLineWidth();
325
  GBool getEnablePathSimplification();
326
  GBool getDrawAnnotations();
327
  GBool getDrawFormFields();
328
  GBool getEnableXFA();
329
  GBool getPreferXFAFieldValues();
330
179k
  GBool getOverprintPreview() { return overprintPreview; }
331
  GString *getPaperColor();
332
  GString *getMatteColor();
333
  GString *getFullScreenMatteColor();
334
  GString *getSelectionColor();
335
  GBool getReverseVideoInvertImages();
336
  GBool getAllowLinksToChangeZoom();
337
0
  GString *getLaunchCommand() { return launchCommand; }
338
0
  GString *getMovieCommand() { return movieCommand; }
339
  GString *getDefaultPrinter();
340
  GBool getMapNumericCharNames();
341
  GBool getMapUnknownCharNames();
342
  GBool getMapExtTrueTypeFontsViaUnicode();
343
  GBool getUseTrueTypeUnicodeMapping();
344
  GBool getIgnoreWrongSizeToUnicode();
345
  GBool isDroppedFont(const char *fontName);
346
  GBool getSeparateRotatedText();
347
  GBool getDiscardCoveredText();
348
  GList *getKeyBinding(int code, int mods, int context);
349
  GList *getAllKeyBindings();
350
  int getNumPopupMenuCmds();
351
  PopupMenuCmd *getPopupMenuCmd(int idx);
352
  GString *getPagesFile();
353
  GString *getTabStateFile();
354
  GString *getSessionFile();
355
  GBool getSaveSessionOnQuit();
356
  GBool getSavePageNumbers();
357
  GBool getPrintCommands();
358
  GBool getPrintStatusInfo();
359
  GBool getErrQuiet();
360
  GString *getDebugLogFile();
361
  void debugLogPrintf(const char *fmt, ...);
362
363
  CharCodeToUnicode *getCIDToUnicode(GString *collection);
364
  CharCodeToUnicode *getUnicodeToUnicode(GString *fontName);
365
  UnicodeMap *getUnicodeMap(GString *encodingName);
366
  CMap *getCMap(GString *collection, GString *cMapName);
367
  UnicodeMap *getTextEncoding();
368
369
  //----- functions to set parameters
370
371
  void addUnicodeRemapping(Unicode in, Unicode *out, int len);
372
  void addFontFile(GString *fontName, GString *path);
373
  GBool setPSPaperSize(char *size);
374
  void setPSPaperWidth(int width);
375
  void setPSPaperHeight(int height);
376
  void setPSImageableArea(int llx, int lly, int urx, int ury);
377
  void setPSDuplex(GBool duplex);
378
  void setPSCrop(GBool crop);
379
  void setPSUseCropBoxAsPage(GBool crop);
380
  void setPSExpandSmaller(GBool expand);
381
  void setPSShrinkLarger(GBool shrink);
382
  void setPSCenter(GBool center);
383
  void setPSLevel(PSLevel level);
384
  void setPSEmbedType1(GBool embed);
385
  void setPSEmbedTrueType(GBool embed);
386
  void setPSEmbedCIDPostScript(GBool embed);
387
  void setPSEmbedCIDTrueType(GBool embed);
388
  void setPSFontPassthrough(GBool passthrough);
389
  void setPSPreload(GBool preload);
390
  void setPSOPI(GBool opi);
391
  void setPSASCIIHex(GBool hex);
392
  void setTextEncoding(const char *encodingName);
393
  GBool setTextEOL(char *s);
394
  void setTextPageBreaks(GBool pageBreaks);
395
  void setTextKeepTinyChars(GBool keep);
396
  void setInitialZoom(char *s);
397
  void setDefaultFitZoom(int z);
398
  GBool setEnableFreeType(char *s);
399
  GBool setAntialias(char *s);
400
  GBool setVectorAntialias(char *s);
401
  void setScreenType(ScreenType t);
402
  void setScreenSize(int size);
403
  void setScreenDotRadius(int r);
404
  void setScreenGamma(double gamma);
405
  void setScreenBlackThreshold(double thresh);
406
  void setScreenWhiteThreshold(double thresh);
407
  void setDrawFormFields(GBool draw);
408
  void setOverprintPreview(GBool preview);
409
  void setMapNumericCharNames(GBool map);
410
  void setMapUnknownCharNames(GBool map);
411
  void setMapExtTrueTypeFontsViaUnicode(GBool map);
412
  void setTabStateFile(char *tabStateFileA);
413
  void setSessionFile(char *sessionFileA);
414
  void setPrintCommands(GBool printCommandsA);
415
  void setPrintStatusInfo(GBool printStatusInfoA);
416
  void setErrQuiet(GBool errQuietA);
417
418
#ifdef _WIN32
419
  void setWin32ErrorInfo(const char *func, DWORD code);
420
  XpdfWin32ErrorInfo *getWin32ErrorInfo();
421
#endif
422
423
  static const char *defaultTextEncoding;
424
425
private:
426
427
  void setDataDirVar();
428
  void createDefaultKeyBindings();
429
  void initStateFilePaths();
430
  FILE *openConfigFile(const char *cfgFileName, GString **fileName);
431
  void parseFile(GString *fileName, FILE *f);
432
  GList *parseLineTokens(char *buf, GString *fileName, int line);
433
  void parseNameToUnicode(GList *tokens, GString *fileName, int line);
434
  void parseCIDToUnicode(GList *tokens, GString *fileName, int line);
435
  void parseUnicodeToUnicode(GList *tokens, GString *fileName, int line);
436
  void parseUnicodeMap(GList *tokens, GString *fileName, int line);
437
  void parseCMapDir(GList *tokens, GString *fileName, int line);
438
  void parseToUnicodeDir(GList *tokens, GString *fileName, int line);
439
  void parseUnicodeRemapping(GList *tokens, GString *fileName, int line);
440
  void parseFontFile(GList *tokens, GString *fileName, int line);
441
  void parseFontDir(GList *tokens, GString *fileName, int line);
442
  void parseFontFileCC(GList *tokens, GString *fileName,
443
           int line);
444
  void parsePSPaperSize(GList *tokens, GString *fileName, int line);
445
  void parsePSImageableArea(GList *tokens, GString *fileName, int line);
446
  void parsePSLevel(GList *tokens, GString *fileName, int line);
447
  void parsePSResidentFont(GList *tokens, GString *fileName, int line);
448
  void parsePSResidentFont16(GList *tokens, GString *fileName, int line);
449
  void parsePSResidentFontCC(GList *tokens, GString *fileName, int line);
450
  void parseTextEOL(GList *tokens, GString *fileName, int line);
451
  void parseStrokeAdjust(GList *tokens, GString *fileName, int line);
452
  void parseScreenType(GList *tokens, GString *fileName, int line);
453
  void parseDropFont(GList *tokens, GString *fileName, int line);
454
  void parseBind(GList *tokens, GString *fileName, int line);
455
  void parseUnbind(GList *tokens, GString *fileName, int line);
456
  GBool parseKey(GString *modKeyStr, GString *contextStr,
457
     int *code, int *mods, int *context,
458
     const char *cmdName,
459
     GList *tokens, GString *fileName, int line);
460
  void parsePopupMenuCmd(GList *tokens, GString *fileName, int line);
461
  void parseZoomScaleFactor(GList *tokens, GString *fileName, int line);
462
  void parseZoomValues(GList *tokens, GString *fileName, int line);
463
  void parseYesNo(const char *cmdName, GBool *flag,
464
      GList *tokens, GString *fileName, int line);
465
  GBool parseYesNo2(char *token, GBool *flag);
466
  void parseString(const char *cmdName, GString **s,
467
       GList *tokens, GString *fileName, int line);
468
  void parseInteger(const char *cmdName, int *val,
469
        GList *tokens, GString *fileName, int line);
470
  void parseFloat(const char *cmdName, double *val,
471
      GList *tokens, GString *fileName, int line);
472
  UnicodeMap *getUnicodeMap2(GString *encodingName);
473
474
  //----- static tables
475
476
  NameToCharCode *    // mapping from char name to
477
    macRomanReverseMap;   //   MacRomanEncoding index
478
479
  //----- meta settings
480
481
  GString *baseDir;   // base directory - for plugins, etc.
482
  GHash *configFileVars;  // variables for use in the config file
483
        //   [GString]
484
485
  //----- user-modifiable settings
486
487
  NameToCharCode *    // mapping from char name to Unicode
488
    nameToUnicode;
489
  GHash *cidToUnicodes;   // files for mappings from char collections
490
        //   to Unicode, indexed by collection name
491
        //   [GString]
492
  GHash *unicodeToUnicodes; // files for Unicode-to-Unicode mappings,
493
        //   indexed by font name pattern [GString]
494
  GHash *residentUnicodeMaps; // mappings from Unicode to char codes,
495
        //   indexed by encoding name [UnicodeMap]
496
  GHash *unicodeMaps;   // files for mappings from Unicode to char
497
        //   codes, indexed by encoding name [GString]
498
  GHash *cMapDirs;    // list of CMap dirs, indexed by collection
499
        //   name [GList[GString]]
500
  GList *toUnicodeDirs;   // list of ToUnicode CMap dirs [GString]
501
  UnicodeRemapping *    // Unicode remapping for text output
502
    unicodeRemapping;
503
  GHash *fontFiles;   // font files: font name mapped to path
504
        //   [GString]
505
  GList *fontDirs;    // list of font dirs [GString]
506
  GHash *ccFontFiles;   // character collection font files:
507
        //   collection name  mapped to path [GString]
508
  GHash *base14SysFonts;  // Base-14 system font files: font name
509
        //   mapped to path [Base14FontInfo]
510
  SysFontList *sysFonts;  // system fonts
511
  int psPaperWidth;   // paper size, in PostScript points, for
512
  int psPaperHeight;    //   PostScript output
513
  int psImageableLLX,   // imageable area, in PostScript points,
514
      psImageableLLY,   //   for PostScript output
515
      psImageableURX,
516
      psImageableURY;
517
  GBool psCrop;     // crop PS output to CropBox
518
  GBool psUseCropBoxAsPage; // use CropBox as page size
519
  GBool psExpandSmaller;  // expand smaller pages to fill paper
520
  GBool psShrinkLarger;   // shrink larger pages to fit paper
521
  GBool psCenter;   // center pages on the paper
522
  GBool psDuplex;   // enable duplexing in PostScript?
523
  PSLevel psLevel;    // PostScript level to generate
524
  GHash *psResidentFonts; // 8-bit fonts resident in printer:
525
        //   PDF font name mapped to PS font name
526
        //   [GString]
527
  GList *psResidentFonts16; // 16-bit fonts resident in printer:
528
        //   PDF font name mapped to font info
529
        //   [PSFontParam16]
530
  GList *psResidentFontsCC; // 16-bit character collection fonts
531
        //   resident in printer: collection name
532
        //   mapped to font info [PSFontParam16]
533
  GBool psEmbedType1;   // embed Type 1 fonts?
534
  GBool psEmbedTrueType;  // embed TrueType fonts?
535
  GBool psEmbedCIDPostScript; // embed CID PostScript fonts?
536
  GBool psEmbedCIDTrueType; // embed CID TrueType fonts?
537
  GBool psFontPassthrough;  // pass all fonts through as-is?
538
  GBool psPreload;    // preload PostScript images and forms into
539
        //   memory
540
  GBool psOPI;      // generate PostScript OPI comments?
541
  GBool psASCIIHex;   // use ASCIIHex instead of ASCII85?
542
  GBool psLZW;      // false to use RLE instead of LZW
543
  GBool psUncompressPreloadedImages;  // uncompress all preloaded images
544
  double psMinLineWidth;  // minimum line width for PostScript output
545
  double psRasterResolution;  // PostScript rasterization resolution (dpi)
546
  GBool psRasterMono;   // true to do PostScript rasterization
547
        //   in monochrome (gray); false to do it
548
        //   in color (RGB/CMYK)
549
  int psRasterSliceSize;  // maximum size (pixels) of PostScript
550
        //   rasterization slice
551
  GBool psAlwaysRasterize;  // force PostScript rasterization
552
  GBool psNeverRasterize; // prevent PostScript rasterization
553
  GString *textEncoding;  // encoding (unicodeMap) to use for text
554
        //   output
555
  EndOfLineKind textEOL;  // type of EOL marker to use for text
556
        //   output
557
  GBool textPageBreaks;   // insert end-of-page markers?
558
  GBool textKeepTinyChars;  // keep all characters in text output
559
  GString *initialZoom;   // initial zoom level
560
  int defaultFitZoom;   // default zoom factor if initialZoom is
561
        //   'page' or 'width'
562
  double zoomScaleFactor; // displayed zoom values are scaled by this
563
  GList *zoomValues;    // zoom values for the combo box
564
  GString *initialDisplayMode;  // initial display mode (single,
565
        //   continuous, etc.)
566
  GBool initialToolbarState;  // initial toolbar state - open (true)
567
        //   or closed (false)
568
  GBool initialSidebarState;  // initial sidebar state - open (true)
569
        //   or closed (false)
570
  int initialSidebarWidth;  // initial sidebar width
571
  GString *initialSelectMode; // initial selection mode (block or linear)
572
  GBool initialMaximized; // initial window maximized state
573
  int maxTileWidth;   // maximum rasterization tile width
574
  int maxTileHeight;    // maximum rasterization tile height
575
  int tileCacheSize;    // number of rasterization tiles in cache
576
  int workerThreads;    // number of rasterization worker threads
577
  GBool enableFreeType;   // FreeType enable flag
578
  GBool disableFreeTypeHinting; // FreeType hinting disable flag
579
  GBool antialias;    // font anti-aliasing enable flag
580
  GBool vectorAntialias;  // vector anti-aliasing enable flag
581
  GBool imageMaskAntialias; // image mask anti-aliasing enable flag
582
  GBool antialiasPrinting;  // allow anti-aliasing when printing
583
  StrokeAdjustMode strokeAdjust; // stroke adjustment mode
584
  ScreenType screenType;  // halftone screen type
585
  int screenSize;   // screen matrix size
586
  int screenDotRadius;    // screen dot radius
587
  double screenGamma;   // screen gamma correction
588
  double screenBlackThreshold;  // screen black clamping threshold
589
  double screenWhiteThreshold;  // screen white clamping threshold
590
  double minLineWidth;    // minimum line width
591
  GBool       // enable path simplification
592
    enablePathSimplification;
593
  GBool drawAnnotations;  // draw annotations or not
594
  GBool drawFormFields;   // draw form fields or not
595
  GBool enableXFA;    // enable XFA form parsing
596
  GBool preferXFAFieldValues; // prefer XFA field values over AcroForm values
597
  GBool overprintPreview; // enable overprint preview
598
  GString *paperColor;    // paper (page background) color
599
  GString *matteColor;    // matte (background outside of page) color
600
  GString *fullScreenMatteColor; // matte color in full-screen mode
601
  GString *selectionColor;  // selection color
602
  GBool reverseVideoInvertImages; // invert images in reverse video mode
603
  GBool allowLinksToChangeZoom; // allow clicking on a link to change the zoom
604
  GString *launchCommand; // command executed for 'launch' links
605
  GString *movieCommand;  // command executed for movie annotations
606
  GString *defaultPrinter;  // default printer (for interactive printing
607
        //   from the viewer)
608
  GBool mapNumericCharNames;  // map numeric char names (from font subsets)?
609
  GBool mapUnknownCharNames;  // map unknown char names?
610
  GBool mapExtTrueTypeFontsViaUnicode;  // map char codes to GID via Unicode
611
                //   for external TrueType fonts?
612
  GBool useTrueTypeUnicodeMapping;  // use the Unicode cmaps in TrueType
613
          //   fonts, rather than the PDF
614
          //   ToUnicode mapping
615
  GBool ignoreWrongSizeToUnicode;  // ignore ToUnicode CMaps if their size
616
           //   (8-bit vs 16-bit) doesn't match the font
617
  GHash *droppedFonts;    // dropped fonts [int]
618
  GBool separateRotatedText;  // separate text at each rotation
619
  GBool discardCoveredText; // discard text covered by fill or image
620
  GList *keyBindings;   // key & mouse button bindings [KeyBinding]
621
  GList *popupMenuCmds;   // popup menu commands [PopupMenuCmd]
622
  GString *pagesFile;   // path for the page number save file
623
  GString *tabStateFile;  // path for the tab state save file
624
  GString *sessionFile;   // path for the session save file
625
  GBool saveSessionOnQuit;  // save session info when xpdf is quit
626
  GBool savePageNumbers;  // save page number when file is closed
627
        //   and restore page number when opened
628
  GBool printCommands;    // print the drawing commands
629
  GBool printStatusInfo;  // print status info for each page
630
  GBool errQuiet;   // suppress error messages?
631
  GString *debugLogFile;  // path for debug log file
632
633
  CharCodeToUnicodeCache *cidToUnicodeCache;
634
  CharCodeToUnicodeCache *unicodeToUnicodeCache;
635
  UnicodeMapCache *unicodeMapCache;
636
  CMapCache *cMapCache;
637
638
#if MULTITHREADED
639
  GMutex mutex;
640
  GMutex unicodeMapCacheMutex;
641
  GMutex cMapCacheMutex;
642
#endif
643
#ifdef _WIN32
644
  DWORD tlsWin32ErrorInfo;  // TLS index for error info
645
#endif
646
};
647
648
#endif