]> Shamusworld >> Repos - ttedit/blob - src/painter.h
Added rectangle point selection, canvas zooming.
[ttedit] / src / painter.h
1 #ifndef __PAINTER_H__
2 #define __PAINTER_H__
3
4 #include <stdint.h>
5 #include <QtWidgets>
6 #include "vector.h"
7 #include "glyphpoints.h"
8
9 //#define SCREEN_ZOOM  (1.0 / 4.0)
10
11 // Forward declarations
12
13 class Painter
14 {
15         public:
16                 Painter(QPainter * p = 0);
17                 ~Painter();
18
19                 void SetRenderHint(int);
20                 void SetPen(QPen);
21                 void SetPen(uint32_t, float size = 0, int style = 0);
22                 void SetBrush(QBrush);
23                 void SetBrush(uint32_t);
24                 void SetFont(QFont);
25                 void DrawAngledText(Vector, double, QString, double);
26                 void DrawTextObject(Vector, QString, double, double angle = 0);
27                 void DrawArc(Vector, double, double, double);
28                 void DrawEllipse(Vector, double, double);
29                 void DrawHandle(Vector);
30                 void DrawArrowHandle(Vector, double);
31                 void DrawArrowToLineHandle(Vector, double);
32                 void DrawLine(int, int, int, int);
33                 void DrawLine(Vector, Vector);
34                 void DrawPoint(int, int);
35                 void DrawRoundedRect(QRectF, double, double);
36                 void DrawPaddedRect(QRectF);
37                 void DrawRect(QRectF);
38                 void DrawText(QRectF, int, QString);
39                 void DrawArrowhead(Vector, Vector, double);
40                 void DrawCrosshair(Vector);
41                 void DrawInformativeText(QString);
42                 void DrawBezier(Point, Point, Point);
43                 void DrawBezier(IPoint, IPoint, IPoint);
44                 void DrawSquareDot(Vector);
45                 void DrawRoundDot(Vector);
46                 void DrawSquareDotN(Vector, uint32_t);
47                 void DrawRoundDotN(Vector, uint32_t);
48
49         public:
50                 static Vector CartesianToQtCoords(Vector);
51                 static Vector QtToCartesianCoords(Vector);
52
53         public:
54                 // Class variables
55 //              static Vector origin;           // The window origin, not location of the origin
56 //              static double zoom;                     // Window zoom factor
57 //              static Vector screenSize;       // Width & height of the window we're drawing on
58
59         private:
60                 QPainter * painter;
61 };
62
63 #endif  // __PAINTER_H__