]> www.fi.muni.cz Git - evince.git/blob - pdf/xpdf/GDKSplashOutputDev.h
New file with some random thoughts.
[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   void drawToPixbuf(GdkPixbuf *pixbuf, int pageNum);
77
78   // Find a string.  If <startAtTop> is true, starts looking at the
79   // top of the page; else if <startAtLast> is true, starts looking
80   // immediately after the last find result; else starts looking at
81   // <xMin>,<yMin>.  If <stopAtBottom> is true, stops looking at the
82   // bottom of the page; else if <stopAtLast> is true, stops looking
83   // just before the last find result; else stops looking at
84   // <xMax>,<yMax>.
85   GBool findText(Unicode *s, int len,
86                  GBool startAtTop, GBool stopAtBottom,
87                  GBool startAtLast, GBool stopAtLast,
88                  int *xMin, int *yMin,
89                  int *xMax, int *yMax);
90
91   // Get the text which is inside the specified rectangle.
92   GString *getText(int xMin, int yMin, int xMax, int yMax);
93
94 private:
95
96   int incrementalUpdate;
97   void (*redrawCbk)(void *data);
98   void *redrawCbkData;
99   TextPage *text;               // text from the current page
100 };
101
102 #endif