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:
NullPainter()28 	NullPainter() : Painter(1) {}
29 
~NullPainter()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
fillRectangle(int,int,int,int,Color)51 	void fillRectangle(int, int, int, int, Color) {}
52 
53 	/// draw an arc
arc(int,int,unsigned int,unsigned int,int,int,Color)54 	void arc(int, int, unsigned int, unsigned int, int, int, Color) {}
55 
56 	/// draw a pixel
point(int,int,Color)57 	void point(int, int, Color) {}
58 
59 	/// draw an image from the image cache
image(int,int,int,int,graphics::Image const &)60 	void image(int, int, int, int, graphics::Image const &) {}
61 
62 	/// draw a string
text(int,int,docstring const &,FontInfo const &)63 	void text(int, int, docstring const &, FontInfo const &) {}
64 
65 	/// draw a char
text(int,int,char_type,FontInfo const &)66 	void text(int, int, char_type, FontInfo const &) {}
67 
68 	/// draw a string
text(int,int,docstring const &,Font const &,double,double)69 	void text(int, int, docstring const &, Font const &, double, double) {}
70 
71 	///
text(int,int,docstring const &,Font const &,Color,size_type,size_type,double,double)72 	void text(int, int, docstring const &, Font const &,
73 	          Color, size_type, size_type, double, double) {}
74 
75 	/// This painter does not paint
isNull()76 	bool isNull() const { return true; }
77 
78  	/// draw the underbar, strikeout, xout, uuline and uwave font attributes
textDecoration(FontInfo const &,int,int,int)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 	 */
rectText(int,int,docstring const &,FontInfo const &,Color,Color)87 	void rectText(int, int, docstring const &,
88 	              FontInfo const &, Color, Color) {}
89 
90 	/// draw a string and enclose it inside a button frame
buttonText(int,int,docstring const &,FontInfo const &,Color,Color,int)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.
preeditText(int,int,char_type,FontInfo const &,preedit_style)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]
enterMonochromeMode(Color const &,Color const &)99 	void enterMonochromeMode(Color const &, Color const &) {}
100 	/// leave monochrome painting mode
leaveMonochromeMode()101 	void leaveMonochromeMode() {}
102 	/// draws a wavy line that can be used for underlining.
wavyHorizontalLine(int,int,int,ColorCode)103 	void wavyHorizontalLine(int, int, int, ColorCode) {}
104 };
105 
106 } // namespace frontend
107 } // namespace lyx
108 
109 #endif // NULLPAINTER_H
110