Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

OutputDev.h

Go to the documentation of this file.
00001 //========================================================================
00002 //
00003 // OutputDev.h
00004 //
00005 // Copyright 1996-2002 Glyph & Cog, LLC
00006 //
00007 //========================================================================
00008 
00009 #ifndef OUTPUTDEV_H
00010 #define OUTPUTDEV_H
00011 
00012 #ifdef __GNUC__
00013 #pragma interface
00014 #endif
00015 
00016 #include "gtypes.h"
00017 #include "CharTypes.h"
00018 
00019 class GString;
00020 class GfxState;
00021 class GfxColorSpace;
00022 class GfxImageColorMap;
00023 class Stream;
00024 class Link;
00025 class Catalog;
00026 
00027 //------------------------------------------------------------------------
00028 // OutputDev
00029 //------------------------------------------------------------------------
00030 
00031 class OutputDev {
00032 public:
00033 
00034   // Constructor.
00035   OutputDev() {}
00036 
00037   // Destructor.
00038   virtual ~OutputDev() {}
00039 
00040   //----- get info about output device
00041 
00042   // Does this device use upside-down coordinates?
00043   // (Upside-down means (0,0) is the top left corner of the page.)
00044   virtual GBool upsideDown() = 0;
00045 
00046   // Does this device use drawChar() or drawString()?
00047   virtual GBool useDrawChar() = 0;
00048 
00049   // Does this device use beginType3Char/endType3Char?  Otherwise,
00050   // text in Type 3 fonts will be drawn with drawChar/drawString.
00051   virtual GBool interpretType3Chars() = 0;
00052 
00053   // Does this device need non-text content?
00054   virtual GBool needNonText() { return gTrue; }
00055 
00056   //----- initialization and control
00057 
00058   // Set default transform matrix.
00059   virtual void setDefaultCTM(fouble *ctm);
00060 
00061   // Start a page.
00062   virtual void startPage(int pageNum, GfxState *state) {}
00063 
00064   // End a page.
00065   virtual void endPage() {}
00066 
00067   // Dump page contents to display.
00068   virtual void dump() {}
00069 
00070   //----- coordinate conversion
00071 
00072   // Convert between device and user coordinates.
00073   virtual void cvtDevToUser(int dx, int dy, fouble *ux, fouble *uy);
00074   virtual void cvtUserToDev(fouble ux, fouble uy, int *dx, int *dy);
00075 
00076   //----- link borders
00077   virtual void drawLink(Link *link, Catalog *catalog) {}
00078 
00079   //----- save/restore graphics state
00080   virtual void saveState(GfxState *state) {}
00081   virtual void restoreState(GfxState *state) {}
00082 
00083   //----- update graphics state
00084   virtual void updateAll(GfxState *state);
00085   virtual void updateCTM(GfxState *state, fouble m11, fouble m12,
00086                          fouble m21, fouble m22, fouble m31, fouble m32) {}
00087   virtual void updateLineDash(GfxState *state) {}
00088   virtual void updateFlatness(GfxState *state) {}
00089   virtual void updateLineJoin(GfxState *state) {}
00090   virtual void updateLineCap(GfxState *state) {}
00091   virtual void updateMiterLimit(GfxState *state) {}
00092   virtual void updateLineWidth(GfxState *state) {}
00093   virtual void updateFillColor(GfxState *state) {}
00094   virtual void updateStrokeColor(GfxState *state) {}
00095   virtual void updateFillOpacity(GfxState *state) {}
00096   virtual void updateStrokeOpacity(GfxState *state) {}
00097 
00098   //----- update text state
00099   virtual void updateFont(GfxState *state) {}
00100   virtual void updateTextMat(GfxState *state) {}
00101   virtual void updateCharSpace(GfxState *state) {}
00102   virtual void updateRender(GfxState *state) {}
00103   virtual void updateRise(GfxState *state) {}
00104   virtual void updateWordSpace(GfxState *state) {}
00105   virtual void updateHorizScaling(GfxState *state) {}
00106   virtual void updateTextPos(GfxState *state) {}
00107   virtual void updateTextShift(GfxState *state, fouble shift) {}
00108 
00109   //----- path painting
00110   virtual void stroke(GfxState *state) {}
00111   virtual void fill(GfxState *state) {}
00112   virtual void eoFill(GfxState *state) {}
00113 
00114   //----- path clipping
00115   virtual void clip(GfxState *state) {}
00116   virtual void eoClip(GfxState *state) {}
00117 
00118   //----- text drawing
00119   virtual void beginString(GfxState *state, GString *s) {}
00120   virtual void endString(GfxState *state) {}
00121   virtual void drawChar(GfxState *state, fouble x, fouble y,
00122                         fouble dx, fouble dy,
00123                         fouble originX, fouble originY,
00124                         CharCode code, Unicode *u, int uLen) {}
00125   virtual void drawString(GfxState *state, GString *s) {}
00126   virtual GBool beginType3Char(GfxState *state,
00127                                CharCode code, Unicode *u, int uLen);
00128   virtual void endType3Char(GfxState *state) {}
00129 
00130   //----- image drawing
00131   virtual void drawImageMask(GfxState *state, Object *ref, Stream *str,
00132                              int width, int height, GBool invert,
00133                              GBool inlineImg);
00134   virtual void drawImage(GfxState *state, Object *ref, Stream *str,
00135                          int width, int height, GfxImageColorMap *colorMap,
00136                          int *maskColors, GBool inlineImg);
00137 
00138 #if OPI_SUPPORT
00139   //----- OPI functions
00140   virtual void opiBegin(GfxState *state, Dict *opiDict);
00141   virtual void opiEnd(GfxState *state, Dict *opiDict);
00142 #endif
00143 
00144   //----- Type 3 font operators
00145   virtual void type3D0(GfxState *state, fouble wx, fouble wy) {}
00146   virtual void type3D1(GfxState *state, fouble wx, fouble wy,
00147                        fouble llx, fouble lly, fouble urx, fouble ury) {}
00148 
00149   //----- PostScript XObjects
00150   virtual void psXObject(Stream *psStream, Stream *level1Stream) {}
00151 
00152 private:
00153 
00154   fouble defCTM[6];             // default coordinate transform matrix
00155   fouble defICTM[6];            // inverse of default CTM
00156 };
00157 
00158 #endif

Generated on Sat Nov 5 16:18:16 2005 for OPIE by  doxygen 1.4.2