]> git.lyx.org Git - lyx.git/blob - src/frontends/NullPainter.h
6984e7ca50e941de1674169f2e70a587f27cab1c
[lyx.git] / src / frontends / NullPainter.h
1 // -*- C++ -*-
2 /**
3  * \file NullPainter.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author unknown
8  * \author John Levon
9  * \author Jean-Marc Lasgouttes
10  *
11  * Full author contact details are available in file CREDITS.
12  */
13
14 #ifndef NULLPAINTER_H
15 #define NULLPAINTER_H
16
17 #include "Painter.h"
18
19 namespace lyx {
20
21 namespace frontend {
22
23 /**
24  * NullPainter - A painter instance that does nothing
25  */
26 class NullPainter : public Painter {
27 public:
28         NullPainter() : Painter(1, false) {}
29
30         ~NullPainter() {}
31
32         /// draw a line from point to point
33         void line(int, int, int, int, Color,
34                 line_style = line_solid, int = thin_line) {}
35
36         ///
37         void lines(int const *, int const *, int, Color,
38                 fill_style = fill_none, line_style = line_solid,
39                 int = thin_line) {}
40
41         ///
42         void path(int const *, int const *, int const *, int const *,
43                 int const *, int const *, int, Color,
44                 fill_style = fill_none, line_style = line_solid, int = thin_line) {}
45
46         /// draw a rectangle
47         void rectangle(int, int, int, int, Color,
48                 line_style = line_solid, int = thin_line) {}
49
50         /// draw a filled rectangle
51         void fillRectangle(int, int, int, int, Color) {}
52
53         /// draw an arc
54         void arc(int, int, unsigned int, unsigned int, int, int, Color) {}
55
56         /// draw a pixel
57         void point(int, int, Color) {}
58
59         /// draw an image from the image cache
60         void image(int, int, int, int, graphics::Image const &) {}
61
62         /// draw a string
63         void text(int, int, docstring const &, FontInfo const &) {}
64
65         /// draw a char
66         void text(int, int, char_type, FontInfo const &) {}
67
68         /// draw a string
69         void text(int, int, docstring const &, Font const &, double, double) {}
70
71         ///
72         void text(int, int, docstring const &, Font const &,
73                   Color, size_type, size_type, double, double) {}
74
75         /// This painter does not paint
76         bool isNull() const { return true; }
77
78         /// draw the underbar, strikeout, xout, uuline and uwave font attributes
79         void textDecoration(FontInfo const &, int, int, int) {}
80
81         /**
82          * Draw a string and enclose it inside a rectangle. If
83          * back color is specified, the background is cleared with
84          * the given color. If frame is specified, a thin frame is drawn
85          * around the text with the given color.
86          */
87         void rectText(int, int, docstring const &,
88                       FontInfo const &, Color, Color) {}
89
90         /// draw a string and enclose it inside a button frame
91         void buttonText(int, int, docstring const &,
92                         FontInfo const &, Color, Color, int) {}
93
94         /// draw a character of a preedit string for cjk support.
95         int preeditText(int, int, char_type, FontInfo const &,
96                         preedit_style) { return 0; }
97
98         /// start monochrome painting mode, i.e. map every color into [min,max]
99         void enterMonochromeMode(Color const &, Color const &) {}
100         /// leave monochrome painting mode
101         void leaveMonochromeMode() {}
102         /// draws a wavy line that can be used for underlining.
103         void wavyHorizontalLine(int, int, int, ColorCode) {}
104 };
105
106 } // namespace frontend
107 } // namespace lyx
108
109 #endif // NULLPAINTER_H