]> www.fi.muni.cz Git - evince.git/blob - pdf/xpdf/GDKSplashOutputDev.h
Import of xpdf code from gpdf.
[evince.git] / pdf / xpdf / GDKSplashOutputDev.h
1 //========================================================================
2 //
3 // GDKSplashOutputDev.h
4 //
5 // Copyright 2003 Glyph & Cog, LLC
6 // Copyright 2004 Red Hat, Inc. (GDK port)
7 //
8 //========================================================================
9
10 #ifndef XSPLASHOUTPUTDEV_H
11 #define XSPLASHOUTPUTDEV_H
12
13 #ifdef USE_GCC_PRAGMAS
14 #pragma interface
15 #endif
16
17 #include "gpdf-g-switch.h"
18 #  include <gdk/gdk.h>
19 #include "gpdf-g-switch.h"
20 #include "SplashTypes.h"
21 #include "SplashOutputDev.h"
22 #include "TextOutputDev.h"
23
24 //------------------------------------------------------------------------
25
26 #define xOutMaxRGBCube 6        // max size of RGB color cube
27
28 //------------------------------------------------------------------------
29 // GDKSplashOutputDev
30 //------------------------------------------------------------------------
31
32 class GDKSplashOutputDev: public SplashOutputDev {
33 public:
34
35   GDKSplashOutputDev(GdkScreen *screen,
36                      void (*redrawCbkA)(void *data),
37                      void *redrawCbkDataA);
38   
39   virtual ~GDKSplashOutputDev();
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               GdkDrawable *drawable,
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   int incrementalUpdate;
95   void (*redrawCbk)(void *data);
96   void *redrawCbkData;
97   TextPage *text;               // text from the current page
98 };
99
100 #endif