xref: /haiku/src/add-ons/print/drivers/pcl6/PCL6.h (revision 220d04022750f40f8bac8f01fa551211e28d04f2)
1 /*
2  * PCL6.h
3  * Copyright 1999-2000 Y.Takagi. All Rights Reserved.
4  * Copyright 2003 Michael Pfeiffer.
5  */
6 #ifndef __PCL6_H
7 #define __PCL6_H
8 
9 
10 #include "GraphicsDriver.h"
11 #include "PCL6Cap.h"
12 #include "PCL6Writer.h"
13 
14 
15 class Halftone;
16 
17 
18 class PCL6Driver : public GraphicsDriver, public PCL6WriterStream
19 {
20 public:
21 					PCL6Driver(BMessage* message, PrinterData* printerData,
22 						const PrinterCap* printerCap);
23 
24 			void	Write(const uint8* data, uint32 size);
25 
26 protected:
27 	virtual	bool	StartDocument();
28 	virtual	bool	StartPage(int page);
29 	virtual	bool	NextBand(BBitmap* bitmap, BPoint* offset);
30 	virtual	bool	EndPage(int page);
31 	virtual	bool	EndDocument(bool success);
32 
33 private:
34 			bool	_SupportsRLECompression();
35 			bool	_SupportsDeltaRowCompression();
36 			bool	_UseColorMode();
37 			PCL6Writer::MediaSize _MediaSize(JobData::Paper paper);
38 			PCL6Writer::MediaSource	_MediaSource(JobData::PaperSource source);
39 			void	_Move(int x, int y);
40 			void	_JobStart();
41 			void	_WriteBitmap(const uchar* buffer, int outSize, int rowSize,
42 						int x, int y, int width, int height, int deltaRowSize);
43 			void	_StartRasterGraphics(int x, int y, int width, int height,
44 						PCL6Writer::Compression compressionMethod);
45 			void	_EndRasterGraphics();
46 			void	_RasterGraphics(const uchar* buffer, int bufferSize,
47 						int dataSize, int rowSize, int height,
48 						int compression_method);
49 			void	_JobEnd();
50 
51 			PCL6Writer*	fWriter;
52 			PCL6Writer::MediaSide fMediaSide; // side if in duplex mode
53 			Halftone*	fHalftone;
54 };
55 
56 #endif // __PCL6_H
57