~ubuntu-branches/ubuntu/precise/ipe/precise

« back to all changes in this revision

Viewing changes to src/ipecanvas/ipecanvas.h

  • Committer: Bazaar Package Importer
  • Author(s): Steve M. Robbins
  • Date: 2007-01-09 23:14:51 UTC
  • mfrom: (3.1.4 feisty)
  • Revision ID: james.westby@ubuntu.com-20070109231451-3nd095g7ishc108l
Tags: 6.0pre27-3
* debian/gsfonts-fontmap.xml: New.  Fontmap for fonts from gsfonts package.
* debian/rules: Use gsfonts-fontmap.xml instead of tetex-fontmap.xml.
* debian/control: Add texlive-latex-base dependency as alternative to
  tetex-bin (for pdflatex) and replace tetex-extra by gsfonts (for font
  files).  Patch courtesy of Norbert Preining.  Closes: #378537.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
/*
6
6
 
7
7
    This file is part of the extensible drawing editor Ipe.
8
 
    Copyright (C) 1993-2004  Otfried Cheong
 
8
    Copyright (C) 1993-2005  Otfried Cheong
9
9
 
10
10
    Ipe is free software; you can redistribute it and/or modify it
11
11
    under the terms of the GNU General Public License as published by
38
38
#include "ipepainter.h"
39
39
#include "ipefonts.h"
40
40
 
41
 
#include <qwidget.h>
42
 
#include <qpixmap.h>
43
 
#include <qpainter.h>
 
41
#include <QWidget>
 
42
#include <QPixmap>
 
43
#include <QPainter>
44
44
 
45
45
// --------------------------------------------------------------------
46
46
 
62
62
 
63
63
class IpeCanvasServices : public IpeFontsServices {
64
64
public:
 
65
  virtual ~IpeCanvasServices() { /* nothing */ } // placate compiler
65
66
  //! Request an IpeOverlay object because of this mouse press.
66
67
  virtual void CvSvcRequestOverlay(QMouseEvent *ev) = 0;
67
68
  //! Notify application whether a drawing is active.
97
98
  virtual void DoDrawText(const IpeText *text);
98
99
 
99
100
private:
 
101
  void DimColor(QColor &col);
100
102
  bool DrawChar(int ch, QRgb rgb, int x, int y);
101
103
  void Execute(const IpeBuffer &buffer);
102
104
  void ClearArgs();
105
107
  void OpTf();
106
108
  void OpTd();
107
109
  void OpTJ();
 
110
  void Opk(bool stroke);
108
111
  void Opg(bool stroke);
109
112
  void Oprg(bool stroke);
110
113
  void Opw();
124
127
  enum TVertexType { EMoveTo, ELineTo, ECurveTo,
125
128
                     EEndPath, EEndClosedPath };
126
129
 
127
 
  std::vector<QPoint> iV;
 
130
  std::vector<QPointF> iV;
128
131
  std::vector<TVertexType> iType;
129
132
 
130
133
  IpeAttribute iDash[4]; // dash, dot, dash dot, dash dot dot
131
134
 
132
135
  // PDF operator drawing
133
136
  std::vector<const IpePdfObj *> iArgs;
 
137
  uint iTextRgb;
134
138
  uint iStrokeRgb;
135
139
  uint iFillRgb;
136
140
  double iLineWid;
148
152
 
149
153
public:
150
154
  IpeCanvas(IpeCanvasServices *services, QStatusBar *statusBar,
151
 
            QWidget* parent, WFlags f=0);
 
155
            bool doubleBuffer, QWidget* parent, int bitmapSize,
 
156
            Qt::WFlags f=0);
152
157
  ~IpeCanvas();
153
158
 
154
159
  void SetPage(const IpePage *page, int view, const IpeStyleSheet *sheet,
155
160
               const IpeRect &media, IpeAttribute pageColor);
156
 
  void SetFontPool(bool antiAlias, const IpeFontPool *fontPool);
 
161
  void SetFontPool(const IpeFontPool *fontPool);
 
162
  void SetAntiAlias(bool antiAlias);
157
163
  void SetPan(const IpeVector &v);
158
164
  void SetZoom(double zoom);
159
165
  void SetSnap(const IpeSnapData &s);
197
203
  IpeVector UserToDev(const IpeVector &arg) const;
198
204
 
199
205
protected:
 
206
  virtual bool event(QEvent *ev);
200
207
  virtual void resizeEvent(QResizeEvent *ev);
201
208
  virtual void paintEvent(QPaintEvent *ev);
202
209
  virtual void mousePressEvent(QMouseEvent *ev) ;
221
228
  QStatusBar *iStatusBar;
222
229
  IpeAttribute iPageColor;
223
230
  IpeRect iMediaBox;
 
231
  int iBitmapSize;
224
232
 
225
233
  IpeVector iPan;
226
234
  double iZoom;
228
236
  bool iDimmed;
229
237
  bool iDoubleBuffer;
230
238
  bool iAutoSnap;
 
239
  bool iAntiAlias;
231
240
  IpeVector iAutoOrigin;
232
241
 
233
242
  IpeOverlay *iOverlay;