xref: /haiku/src/add-ons/print/drivers/pcl6/PCL6.h (revision 1345706a9ff6ad0dc041339a02d4259998b0765d)
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* msg, PrinterData* printer_data,
22 						const PrinterCap* printer_cap);
23 
24 			void	write(const uint8* data, uint32 size);
25 
26 protected:
27 	virtual	bool	startDoc();
28 	virtual	bool	startPage(int page);
29 	virtual	bool	nextBand(BBitmap* bitmap, BPoint* offset);
30 	virtual	bool	endPage(int page);
31 	virtual	bool	endDoc(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