1 /*
2  * 	raster.h		(C) 2006, Aurélien Croc (AP²C)
3  *
4  *  This program is free software; you can redistribute it and/or modify
5  *  it under the terms of the GNU General Public License as published by
6  *  the Free Software Foundation; version 2 of the License.
7  *
8  *  This program is distributed in the hope that it will be useful,
9  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11  *  GNU General Public License for more details.
12  *
13  *  You should have received a copy of the GNU General Public License
14  *  along with this program; if not, write to the
15  *  Free Software Foundation, Inc.,
16  *  59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
17  *
18  *  $Id$
19  *
20  */
21 #ifndef RASTER_H_
22 #define RASTER_H_
23 
24 #include "document.h"
25 #include <cups/raster.h>
26 
27 class Raster : public Document
28 {
29 	protected:
30 		const char*	_jobId;
31 		const char*	_user;
32 		const char*	_title;
33 		const char*	_copies;
34 		const char*	_options;
35 		const char*	_file;
36 		int		_fd;
37 
38 		cups_raster_t*	_ras;
39 		cups_page_header_t	_header;
40 
41 		unsigned long	_width;
42 		unsigned long	_height;
43 		unsigned long	_lineSize;
44 		unsigned long	_line;
45 		unsigned long	_page;
46 
47 
48 		unsigned char*	_lineBuffer;
49 
50 	public:
51 		Raster(const char *job, const char *user, const char *title,
52 			const char *copies, const char *options,
53 			const char *file);
54 		virtual ~Raster();
55 
56 	public:
57 		virtual void	unload();
58 		virtual int	load();
59 		virtual int	loadPage(Printer *printer);
60 
61 		virtual int	readLine();
62 
63 	public:
width()64 		virtual unsigned long	width() const {return _width;}
height()65 		virtual unsigned long	height() const  {return _height;}
lineSize()66 		virtual unsigned long	lineSize() const {return _lineSize;}
lineBuffer()67 		virtual unsigned char*	lineBuffer() const {return _lineBuffer;}
68 };
69 
70 #endif /* RASTER_H_ */
71 
72