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
18 #include <splash/SplashTypes.h>
19 #include <SplashOutputDev.h>
20 #include <TextOutputDev.h>
22 //------------------------------------------------------------------------
24 #define xOutMaxRGBCube 6 // max size of RGB color cube
26 //------------------------------------------------------------------------
28 //------------------------------------------------------------------------
30 class GDKSplashOutputDev: public SplashOutputDev {
33 GDKSplashOutputDev(GdkScreen *screen,
34 void (*redrawCbkA)(void *data),
35 void *redrawCbkDataA);
37 virtual ~GDKSplashOutputDev();
39 //----- initialization and control
42 virtual void startPage(int pageNum, GfxState *state);
45 virtual void endPage();
47 // Dump page contents to display.
50 //----- update text state
51 virtual void updateFont(GfxState *state);
54 virtual void drawChar(GfxState *state, double x, double y,
56 double originX, double originY,
57 CharCode code, Unicode *u, int uLen);
58 virtual GBool beginType3Char(GfxState *state, double x, double y,
60 CharCode code, Unicode *u, int uLen);
62 //----- special access
64 // Clear out the document (used when displaying an empty window).
67 // Copy the rectangle (srcX, srcY, width, height) to (destX, destY)
69 void redraw(int srcX, int srcY,
70 GdkDrawable *drawable,
72 int width, int height);
74 void drawToPixbuf(GdkPixbuf *pixbuf, int pageNum);
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 GooString *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