Fix for a crash which happened when a document couldn't be opened.
[AROS-Contrib.git] / arospdf / xpdf / AROSPDFApp.h
blob0cff9960604a4f4e40a974e71e1d7e6293d4d4c6
1 //========================================================================
2 //
3 // AROSPDFApp.cc
4 //
5 // Copyright 2005 Vijay Kumar B. <vijaykumar@bravegnu.org>
6 //
7 //========================================================================
9 #ifndef AROSPDFAPP_H
10 #define AROSPDFAPP_H
12 #define BITMAPX 600
13 #define BITMAPY 400
14 #define SCROLLSPEED 20
15 #include "AROSSplashOutputDev.h"
16 #include <libraries/asl.h>
17 #include <proto/asl.h>
18 #include <proto/dos.h>
19 #include <proto/icon.h>
20 #include <proto/alib.h>
21 #include "gtypes.h"
22 #include "SplashTypes.h"
23 #include <string.h>
24 #include <devices/rawkeycodes.h>
25 #include <math.h>
27 class GString;
28 class PDFDoc;
29 class AROSSplashOutputDev;
31 class AROSPDFApp {
32 public:
34 AROSPDFApp(GString *fileNameA, GString *ownerPWA, GString *userPWA);
35 AROSPDFApp();
36 ~AROSPDFApp();
37 void OpenFile(GString *fileNameA, GString *ownerPWA, GString *userPWA);
38 int run();
39 void quit();
40 GBool isOk() { return ok; };
41 static void redraw(AROSPDFApp *data);
42 void zoomIn(int n);
43 void zoomOut(int n);
44 bool isReady() { return ready; };
45 void setVert(int n);
46 void setHoriz(int n);
47 Object * getBM() { return Bmp; };
48 void ResizeBitMap(int width, int height);
49 void AboutMenu();
50 void RequestOpenFile();
51 void ZoomInOut(bool In);
52 void PageForwardBack(bool Forward);
53 void JumpToPage(int pageno);
54 void JumpToPageTextbox();
55 void ZoomToFit(bool WidthOnly);
56 void ToggleFitWidth() { FitWidth =!FitWidth; };
57 void ToggleBestFit() { BestFit =!BestFit; };
58 void ScrollUpDown(bool Down);
59 void DisableBestFit();
60 void DisableFitWidth();
61 void EnableDisableGUI();
62 void ToggleFullscreen();
63 void BackFillFullScreen();
64 private:
65 int initAROS();
66 void exitAROS();
68 PDFDoc *doc;
69 AROSSplashOutputDev *splashOut;
70 struct RastPort * rp;
71 struct RastPort * oldrp;
72 int dispW, dispH;
73 int resolution;
74 GBool ok;
75 int posX, posY;
76 int page;
77 bool ready;
78 bool docLoaded;
79 bool FitWidth;
80 bool BestFit;
81 bool FullScreen;
82 GBool resLowLimit, resHiLimit;
83 Object *wnd, *muiapp, *but,*Bmp,*vslider,*hslider, *txt, *rct,
84 *butFirst,*butPrev,*butNext,*butLast,*txtPage, *txtPageCount,
85 *menustrip, *butZoomOut, *butZoomIn;
86 struct BitMap *bm;
87 struct DrawInfo *dri;
88 struct Screen *fsscreen;
89 struct Window *fswindow;
90 struct Screen *origscreen;
91 ULONG pen1;
92 struct MUI_CustomClass *mcc;
93 struct DiskObject *dobj;
96 #endif