1 //========================================================================
3 // GDKSplashOutputDev.h
5 // Copyright 2003 Glyph & Cog, LLC
6 // Copyright 2004 Red Hat, Inc. (GDK port)
8 //========================================================================
10 #ifndef XSPLASHOUTPUTDEV_H
11 #define XSPLASHOUTPUTDEV_H
13 #ifdef USE_GCC_PRAGMAS
17 #include "gpdf-g-switch.h"
19 #include "gpdf-g-switch.h"
20 #include "SplashTypes.h"
21 #include "SplashOutputDev.h"
22 #include "TextOutputDev.h"
24 //------------------------------------------------------------------------
26 #define xOutMaxRGBCube 6 // max size of RGB color cube
28 //------------------------------------------------------------------------
30 //------------------------------------------------------------------------
32 class GDKSplashOutputDev: public SplashOutputDev {
35 GDKSplashOutputDev(GdkScreen *screen,
36 void (*redrawCbkA)(void *data),
37 void *redrawCbkDataA);
39 virtual ~GDKSplashOutputDev();
41 //----- initialization and control
44 virtual void startPage(int pageNum, GfxState *state);
47 virtual void endPage();
49 // Dump page contents to display.
52 //----- update text state
53 virtual void updateFont(GfxState *state);
56 virtual void drawChar(GfxState *state, double x, double y,
58 double originX, double originY,
59 CharCode code, Unicode *u, int uLen);
60 virtual GBool beginType3Char(GfxState *state, double x, double y,
62 CharCode code, Unicode *u, int uLen);
64 //----- special access
66 // Clear out the document (used when displaying an empty window).
69 // Copy the rectangle (srcX, srcY, width, height) to (destX, destY)
71 void redraw(int srcX, int srcY,
72 GdkDrawable *drawable,
74 int width, int height);
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
83 GBool findText(Unicode *s, int len,
84 GBool startAtTop, GBool stopAtBottom,
85 GBool startAtLast, GBool stopAtLast,
87 int *xMax, int *yMax);
89 // Get the text which is inside the specified rectangle.
90 GString *getText(int xMin, int yMin, int xMax, int yMax);
94 int incrementalUpdate;
95 void (*redrawCbk)(void *data);
97 TextPage *text; // text from the current page