filters

XPDFApp.h
1//========================================================================
2//
3// XPDFApp.h
4//
5// Copyright 2002 Glyph & Cog, LLC
6//
7//========================================================================
8
9#ifndef XPDFAPP_H
10#define XPDFAPP_H
11
12#include <aconf.h>
13
14#ifdef USE_GCC_PRAGMAS
15#pragma interface
16#endif
17
18#define Object XtObject
19#include <Xm/XmAll.h>
20#undef Object
21#include "gtypes.h"
22
23class GString;
24class GList;
25class XPDFViewer;
26
27//------------------------------------------------------------------------
28
29#define xpdfAppName "Xpdf"
30
31//------------------------------------------------------------------------
32// XPDFApp
33//------------------------------------------------------------------------
34
35class XPDFApp {
36public:
37
38 XPDFApp(int *argc, char *argv[]);
39 ~XPDFApp();
40
41 XPDFViewer *open(GString *fileName, int page = 1,
42 GString *ownerPassword = NULL,
43 GString *userPassword = NULL);
44 XPDFViewer *openAtDest(GString *fileName, GString *dest,
45 GString *ownerPassword = NULL,
46 GString *userPassword = NULL);
47 void close(XPDFViewer *viewer, GBool closeLast);
48 void quit();
49
50 void run();
51
52 //----- remote server
53 void setRemoteName(char *remoteName);
54 GBool remoteServerRunning();
55 void remoteOpen(GString *fileName, int page, GBool raise);
56 void remoteOpenAtDest(GString *fileName, GString *dest, GBool raise);
57 void remoteRaise();
58 void remoteQuit();
59
60 //----- resource/option values
61 GString *getGeometry() { return geometry; }
62 GString *getTitle() { return title; }
63 GBool getInstallCmap() { return installCmap; }
64 int getRGBCubeSize() { return rgbCubeSize; }
65 GBool getReverseVideo() { return reverseVideo; }
66 Gulong getPaperColor() { return paperColor; }
67 GString *getInitialZoom() { return initialZoom; }
68 GBool getViKeys() { return viKeys; }
69 void setFullScreen(GBool fullScreenA) { fullScreen = fullScreenA; }
70 GBool getFullScreen() { return fullScreen; }
71
72 XtAppContext getAppContext() { return appContext; }
73 Widget getAppShell() { return appShell; }
74
75private:
76
77 void getResources();
78 static void remoteMsgCbk(Widget widget, XtPointer ptr,
79 XEvent *event, Boolean *cont);
80
81 Display *display;
82 int screenNum;
83 XtAppContext appContext;
84 Widget appShell;
85 GList *viewers; // [XPDFViewer]
86
87 Atom remoteAtom;
88 Window remoteXWin;
89 XPDFViewer *remoteViewer;
90 Widget remoteWin;
91
92 //----- resource/option values
93 GString *geometry;
94 GString *title;
95 GBool installCmap;
96 int rgbCubeSize;
97 GBool reverseVideo;
98 Gulong paperColor;
99 GString *initialZoom;
100 GBool viKeys;
101 GBool fullScreen;
102};
103
104#endif