summaryrefslogtreecommitdiffstats
path: root/kviewshell/renderedDocumentPagePixmap.h
blob: 2944075aa4c5f0906c991fdee49f3e85ebaa1fd4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// -*- C++ -*-
//
// Class: RenderedDocumentPagePixmap
//
// Widget for displaying TeX DVI files.
// Part of KDVI- A previewer for TeX DVI files.
//
// (C) 2004-2005 Stefan Kebekus. Distributed under the GPL.


#ifndef _rendereddocumentpagepixmap_h_
#define _rendereddocumentpagepixmap_h_

#include "renderedDocumentPage.h"

#include <tqpainter.h>
#include <tqpixmap.h>


// This class contains everything documentRenderer needs to know 
// about a certain page.
class RenderedDocumentPagePixmap: public RenderedDocumentPage, public TQPixmap
{
  Q_OBJECT
  

public:
  RenderedDocumentPagePixmap();

  virtual ~RenderedDocumentPagePixmap();

  /** Returns a pointer to the paintDevice (in most implementation
      either a TQPixmap, or a TQPrinter). The pointer returned is valid
      as long as *this RenderedDocumentPage exists. This method is
      used by the renderer to draw on the page. */
  virtual TQPainter *getPainter();

  /** This implementation delete the TQPainter *pt (and thereby initiates the drawing) */
  virtual void returnPainter(TQPainter *pt) {delete pt;}

  TQPixmap accessiblePixmap();

  void resize(const TQSize& size);
  void resize(int width, int height);

  virtual TQSize size() { return TQPixmap::size(); }
  virtual int width() { return TQPixmap::width(); }
  virtual int height() { return TQPixmap::height(); }

  /** Returns the amount of memory used by this pixmap */
  unsigned int memory();

private:
  TQPixmap* _accessiblePixmap;
  /** true if _accessiblePixmap needs updateing */
  bool dirty;
};


#endif