X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;ds=inline;f=pdf%2Fxpdf%2FXPDFCore.h;h=59fc19c5270715b0e8c81b5d2570630deedb60ee;hb=6d7f9e7cf7678b48828be0722ae2e998ce85b7a7;hp=348486f0ff9c786bfe8f994a98c40b6d638f8bb5;hpb=6112dfe4b45b0305c7a6f61bd8a847f69f892cbb;p=evince.git diff --git a/pdf/xpdf/XPDFCore.h b/pdf/xpdf/XPDFCore.h index 348486f0..59fc19c5 100644 --- a/pdf/xpdf/XPDFCore.h +++ b/pdf/xpdf/XPDFCore.h @@ -2,7 +2,7 @@ // // XPDFCore.h // -// Copyright 2002 Glyph & Cog, LLC +// Copyright 2002-2003 Glyph & Cog, LLC // //======================================================================== @@ -21,23 +21,23 @@ #include #include "gtypes.h" #include "gfile.h" // for time_t +#include "SplashTypes.h" class GString; class GList; +class BaseStream; class PDFDoc; class LinkAction; class LinkDest; -class XPixmapOutputDev; +class XSplashOutputDev; //------------------------------------------------------------------------ // zoom factor //------------------------------------------------------------------------ -#define minZoom -5 -#define maxZoom 5 -#define zoomPage 100 -#define zoomWidth 101 -#define defZoom 1 +#define zoomPage -1 +#define zoomWidth -2 +#define defZoom 125 //------------------------------------------------------------------------ // XPDFHistory @@ -57,8 +57,9 @@ struct XPDFHistory { struct XPDFRegion { int page; double xMin, yMin, xMax, yMax; - Gulong color; - Gulong selectColor; + SplashRGB8 color; + SplashRGB8 selectColor; + GBool selectable; }; //------------------------------------------------------------------------ @@ -86,8 +87,8 @@ public: // Create viewer core inside . XPDFCore(Widget shellA, Widget parentWidgetA, - Gulong paperColorA, GBool fullScreenA, GBool reverseVideo, - GBool installCmap, int rgbCubeSize); + SplashRGB8 paperColorA, GBool fullScreenA, + GBool reverseVideo, GBool installCmap, int rgbCubeSize); ~XPDFCore(); @@ -97,6 +98,11 @@ public: int loadFile(GString *fileName, GString *ownerPassword = NULL, GString *userPassword = NULL); + // Load a new file, via a Stream instead of a file name. Returns + // pdfOk or error code. + int loadFile(BaseStream *stream, GString *ownerPassword = NULL, + GString *userPassword = NULL); + // Resize the window to fit page of the current document. void resizeToPage(int pg); @@ -107,11 +113,11 @@ public: // set, the window is vertically scrolled to the top; otherwise, no // scrolling is done. If is set, this page change is // added to the history list. - void displayPage(int pageA, int zoomA, int rotateA, + void displayPage(int pageA, double zoomA, int rotateA, GBool scrollToTop, GBool addToHist); // Display a link destination. - void displayDest(LinkDest *dest, int zoomA, int rotateA, + void displayDest(LinkDest *dest, double zoomA, int rotateA, GBool addToHist); //----- page/position changes @@ -144,7 +150,7 @@ public: //----- find - void find(char *s); + void find(char *s, GBool next = gFalse); //----- simple modal dialogs @@ -157,9 +163,9 @@ public: Widget getWidget() { return scrolledWin; } Widget getDrawAreaWidget() { return drawArea; } PDFDoc *getDoc() { return doc; } - XPixmapOutputDev *getOutputDev() { return out; } + XSplashOutputDev *getOutputDev() { return out; } int getPageNum() { return page; } - int getZoom() { return zoom; } + double getZoom() { return zoom; } double getZoomDPI() { return dpi; } int getRotate() { return rotate; } GBool canGoBack() { return historyBLen > 1; } @@ -169,6 +175,7 @@ public: int getDrawAreaWidth() { return drawAreaWidth; } int getDrawAreaHeight() { return drawAreaHeight; } void setBusyCursor(GBool busy); + Cursor getBusyCursor() { return busyCursor; } void takeFocus(); void enableHyperlinks(GBool on) { hyperlinksEnabled = on; } void enableSelect(GBool on) { selectEnabled = on; } @@ -186,8 +193,9 @@ public: private: //----- hyperlinks - void doLink(int mx, int my); + GBool doLink(int mx, int my); void runCommand(GString *cmdFmt, GString *arg); + GString *mungeURL(GString *url); //----- selection static Boolean convertSelectionCbk(Widget widget, Atom *selection, @@ -221,7 +229,7 @@ private: static void dialogCancelCbk(Widget widget, XtPointer ptr, XtPointer callData); - Gulong paperColor; + SplashRGB8 paperColor; GBool fullScreen; Display *display; @@ -238,8 +246,6 @@ private: Cursor busyCursor, linkCursor, selectCursor; Cursor currentCursor; GC drawAreaGC; // GC for blitting into drawArea - GC selectGC; - GC highlightGC; int drawAreaWidth, drawAreaHeight; int scrollX, scrollY; // current upper-left corner @@ -252,6 +258,7 @@ private: GBool lastDragTop; // last dragged selection edge was top/bottom static GString *currentSelection; // selected text static XPDFCore *currentSelectionOwner; + static Atom targetsAtom; GBool panning; int panMX, panMY; @@ -266,7 +273,7 @@ private: PDFDoc *doc; // current PDF file int page; // current page number - int zoom; // current zoom level + double zoom; // current zoom level, in percent of 72 dpi double dpi; // current zoom level, in DPI int rotate; // current page rotation time_t modTime; // last modification time of PDF file @@ -288,7 +295,7 @@ private: GBool hyperlinksEnabled; GBool selectEnabled; - XPixmapOutputDev *out; + XSplashOutputDev *out; int dialogDone; };