home *** CD-ROM | disk | FTP | other *** search
- //========================================================================
- //
- // OutputDev.cc
- //
- // Copyright 1996 Derek B. Noonburg
- //
- //========================================================================
- //
- // Ported to EPOC by Sander van der Wal
- //
- // $Log: OutputDev.cpp $
- // Revision 1.3 2000-09-24 21:08:55+02 svdwal
- // clearPath() removed
- //
- // Revision 1.2 2000-09-17 13:38:22+02 svdwal
- // Ported
- //
-
- #ifdef __GNUC__
- #pragma implementation
- #endif
-
- #ifndef __E32DEF_H__
- #include <e32def.h> // remove warning about NULL redefinition
- #endif
-
- #include <stddef.h>
-
- #include "Object.h"
- #include "Stream.h"
- #include "GfxState.h"
- #include "OutputDev.h"
-
- //------------------------------------------------------------------------
- // OutputDev
- //------------------------------------------------------------------------
-
-
- OutputDev::~OutputDev() {}
-
- void OutputDev::setDefaultCTM(double *ctm1) {
- int i;
- double det;
-
- for (i = 0; i < 6; ++i)
- ctm[i] = ctm1[i];
-
- det = 1 / (ctm[0] * ctm[3] - ctm[1] * ctm[2]);
- ictm[0] = ctm[3] * det;
- ictm[1] = -ctm[1] * det;
- ictm[2] = -ctm[2] * det;
- ictm[3] = ctm[0] * det;
- ictm[4] = (ctm[2] * ctm[5] - ctm[3] * ctm[4]) * det;
- ictm[5] = (ctm[1] * ctm[4] - ctm[0] * ctm[5]) * det;
- }
-
- // Start a page.
- void OutputDev::startPageL(int , GfxState *) {}
-
- // End a page.
- void OutputDev::endPage() {}
-
- // Dump page contents to display.
- void OutputDev::dump() {}
-
- //----- coordinate conversion
- void OutputDev::cvtDevToUser(int dx, int dy, double *ux, double *uy) {
- *ux = ictm[0] * dx + ictm[2] * dy + ictm[4];
- *uy = ictm[1] * dx + ictm[3] * dy + ictm[5];
- }
-
- void OutputDev::cvtUserToDev(double ux, double uy, int *dx, int *dy) {
- *dx = (int)(ctm[0] * ux + ctm[2] * uy + ctm[4] + 0.5);
- *dy = (int)(ctm[1] * ux + ctm[3] * uy + ctm[5] + 0.5);
- }
-
- //----- link borders
- void OutputDev::drawLinkBorder(double , double , double , double , double) {}
-
- //----- save/restore graphics state
- void OutputDev::saveState(GfxState *) {}
- void OutputDev::restoreState(GfxState *) {}
-
- //----- update graphics state
- void OutputDev::updateAll(GfxState *state) {
- updateLineDash(state);
- updateFlatness(state);
- updateLineJoin(state);
- updateLineCap(state);
- updateMiterLimit(state);
- updateLineWidth(state);
- updateFillColor(state);
- updateStrokeColor(state);
- updateFont(state);
- }
-
- void OutputDev::updateCropBox(GfxState* state, double cropX1, double cropY1, double cropX2, double cropY2)
- {
- state->moveTo(cropX1, cropY1);
- state->lineTo(cropX2, cropY1);
- state->lineTo(cropX2, cropY2);
- state->lineTo(cropX1, cropY2);
- state->closePath();
- clip(state);
- state->clearPath();
- }
-
- void OutputDev::updateCTM(GfxState *, double , double , double , double , double , double ) {}
- void OutputDev::updateLineDash(GfxState *) {}
- void OutputDev::updateFlatness(GfxState *) {}
- void OutputDev::updateLineJoin(GfxState *) {}
- void OutputDev::updateLineCap(GfxState *) {}
- void OutputDev::updateMiterLimit(GfxState *) {}
- void OutputDev::updateLineWidth(GfxState *) {}
- void OutputDev::updateFillColor(GfxState *) {}
- void OutputDev::updateStrokeColor(GfxState *) {}
-
- //----- update text state
- void OutputDev::updateFont(GfxState *) {}
- void OutputDev::updateTextMat(GfxState *) {}
- void OutputDev::updateCharSpace(GfxState *) {}
- void OutputDev::updateRender(GfxState *) {}
- void OutputDev::updateRise(GfxState *) {}
- void OutputDev::updateWordSpace(GfxState *) {}
- void OutputDev::updateHorizScaling(GfxState *) {}
- void OutputDev::updateTextPos(GfxState *) {}
- void OutputDev::updateTextShift(GfxState *, double ) {}
-
- //----- path painting
- void OutputDev::stroke(GfxState *) {}
- void OutputDev::fill(GfxState *, GBool) {}
- void OutputDev::eoFill(GfxState *, GBool) {}
-
- //----- path clipping
- void OutputDev::clip(GfxState *) {}
- void OutputDev::eoClip(GfxState *) {}
-
- //----- text drawing
- void OutputDev::beginString(GfxState *, GString *) {}
- void OutputDev::endString(GfxState *) {}
- void OutputDev::drawChar(GfxState *, double , double ,
- double , double , Guchar ) {}
- void OutputDev::drawChar16(GfxState *, double , double ,
- double , double , int ) {}
- void OutputDev::drawString(GfxState *, GString *) {}
- void OutputDev::drawString16(GfxState *, GString *) {}
-
- //----- image drawing
- void OutputDev::drawImageMask(GfxState * /* state */, Stream *str,
- int width, int height, GBool /*invert */,
- GBool inlineImg) {
- int i, j;
-
- if (inlineImg) {
- str->reset();
- j = height * ((width + 7) / 8);
- for (i = 0; i < j; ++i)
- str->getChar();
- }
- }
-
- void OutputDev::drawImage(GfxState * /* state */, Stream *str, int width,
- int height, GfxImageColorMap *colorMap,
- GBool inlineImg) {
- int i, j;
-
- if (inlineImg) {
- str->reset();
- j = height * ((width * colorMap->getNumPixelComps() *
- colorMap->getBits() + 7) / 8);
- for (i = 0; i < j; ++i)
- str->getChar();
- }
- }
-