home *** CD-ROM | disk | FTP | other *** search
/ Enigma Amiga Life 110 / EnigmaAmiga110CD.iso / indispensabili / utility / apdf / xpdf-0.80 / xpdf / ltkoutputdev.cc < prev    next >
C/C++ Source or Header  |  1998-11-27  |  1KB  |  58 lines

  1. //========================================================================
  2. //
  3. // LTKOutputDev.cc
  4. //
  5. // Copyright 1998 Derek B. Noonburg
  6. //
  7. //========================================================================
  8.  
  9. #ifdef __GNUC__
  10. #pragma implementation
  11. #endif
  12.  
  13. #include <stdio.h>
  14. #include <stdlib.h>
  15. #include <stddef.h>
  16. #include <string.h>
  17. #include "gmem.h"
  18. #include "GString.h"
  19. #include "LTKWindow.h"
  20. #include "LTKScrollingCanvas.h"
  21. #include "Object.h"
  22. #include "Stream.h"
  23. #include "GfxState.h"
  24. #include "GfxFont.h"
  25. #include "Error.h"
  26. #include "Params.h"
  27. #include "LTKOutputDev.h"
  28.  
  29. //------------------------------------------------------------------------
  30.  
  31. LTKOutputDev::LTKOutputDev(LTKWindow *win1, unsigned long paperColor):
  32.   XOutputDev(win1->getDisplay(),
  33.          ((LTKScrollingCanvas *)win1->findWidget("canvas"))->getPixmap(),
  34.          0, win1->getColormap(), paperColor)
  35. {
  36.   win = win1;
  37.   canvas = (LTKScrollingCanvas *)win->findWidget("canvas");
  38.   setPixmap(canvas->getPixmap(),
  39.         canvas->getRealWidth(), canvas->getRealHeight());
  40. }
  41.  
  42. LTKOutputDev::~LTKOutputDev() {
  43. }
  44.  
  45. void LTKOutputDev::startPage(int pageNum, GfxState *state) {
  46.   canvas->resize((int)(state->getPageWidth() + 0.5),
  47.          (int)(state->getPageHeight() + 0.5));
  48.   setPixmap(canvas->getPixmap(),
  49.         canvas->getRealWidth(), canvas->getRealHeight());
  50.   XOutputDev::startPage(pageNum, state);
  51.   canvas->redraw();
  52. }
  53.  
  54. void LTKOutputDev::dump() {
  55.   canvas->redraw();
  56.   XOutputDev::dump();
  57. }
  58.