]> www.fi.muni.cz Git - evince.git/blob - pdf/xpdf/XSplashOutputDev.h
Show a wait cursor while the page is rendering
[evince.git] / pdf / xpdf / XSplashOutputDev.h
1 //========================================================================
2 //
3 // XSplashOutputDev.h
4 //
5 // Copyright 2003 Glyph & Cog, LLC
6 //
7 //========================================================================
8
9 #ifndef XSPLASHOUTPUTDEV_H
10 #define XSPLASHOUTPUTDEV_H
11
12 #ifdef USE_GCC_PRAGMAS
13 #pragma interface
14 #endif
15
16 #include <X11/Xlib.h>
17 #include "SplashTypes.h"
18 #include "SplashOutputDev.h"
19
20 //------------------------------------------------------------------------
21
22 #define xOutMaxRGBCube 6        // max size of RGB color cube
23
24 //------------------------------------------------------------------------
25 // XSplashOutputDev
26 //------------------------------------------------------------------------
27
28 class XSplashOutputDev: public SplashOutputDev {
29 public:
30
31   XSplashOutputDev(Display *displayA, int screenNumA,
32                    Visual *visualA, Colormap colormapA,
33                    GBool reverseVideoA, SplashColor paperColorA,
34                    GBool installCmapA, int rgbCubeSizeA,
35                    GBool incrementalUpdateA,
36                    void (*redrawCbkA)(void *data),
37                    void *redrawCbkDataA);
38
39   virtual ~XSplashOutputDev();
40
41   //----- initialization and control
42
43   // Start a page.
44   virtual void startPage(int pageNum, GfxState *state);
45
46   // End a page.
47   virtual void endPage();
48
49   // Dump page contents to display.
50   virtual void dump();
51
52   //----- update text state
53   virtual void updateFont(GfxState *state);
54
55   //----- text drawing
56   virtual void drawChar(GfxState *state, double x, double y,
57                         double dx, double dy,
58                         double originX, double originY,
59                         CharCode code, Unicode *u, int uLen);
60   virtual GBool beginType3Char(GfxState *state, double x, double y,
61                                double dx, double dy,
62                                CharCode code, Unicode *u, int uLen);
63
64   //----- special access
65
66   // Clear out the document (used when displaying an empty window).
67   void clear();
68
69   // Copy the rectangle (srcX, srcY, width, height) to (destX, destY)
70   // in destDC.
71   void redraw(int srcX, int srcY,
72               Drawable destDrawable, GC destGC,
73               int destX, int destY,
74               int width, int height);
75
76   // Find a string.  If <startAtTop> is true, starts looking at the
77   // top of the page; else if <startAtLast> is true, starts looking
78   // immediately after the last find result; else starts looking at
79   // <xMin>,<yMin>.  If <stopAtBottom> is true, stops looking at the
80   // bottom of the page; else if <stopAtLast> is true, stops looking
81   // just before the last find result; else stops looking at
82   // <xMax>,<yMax>.
83   GBool findText(Unicode *s, int len,
84                  GBool startAtTop, GBool stopAtBottom,
85                  GBool startAtLast, GBool stopAtLast,
86                  int *xMin, int *yMin,
87                  int *xMax, int *yMax);
88
89   // Get the text which is inside the specified rectangle.
90   GString *getText(int xMin, int yMin, int xMax, int yMax);
91
92 private:
93
94   GBool incrementalUpdate;      // incrementally update the display?
95   void (*redrawCbk)(void *data);
96   void *redrawCbkData;
97   TextPage *text;               // text from the current page
98
99   Display *display;             // X display pointer
100   Visual *visual;               // X visual
101   Guint depth;                  // visual depth
102   GBool trueColor;              // set if using a TrueColor visual
103   int rDiv, gDiv, bDiv;         // RGB right shifts (for TrueColor)
104   int rShift, gShift, bShift;   // RGB left shifts (for TrueColor)
105   int rgbCubeSize;              // size of color cube (for non-TrueColor)
106   Gulong                        // color cube (for non-TrueColor)
107     colors[xOutMaxRGBCube * xOutMaxRGBCube * xOutMaxRGBCube];
108 };
109
110 #endif