1 /* 2 * PS.h 3 * Copyright 1999-2000 Y.Takagi. All Rights Reserved. 4 */ 5 6 #ifndef __PS_H 7 #define __PS_H 8 9 #include "GraphicsDriver.h" 10 11 12 class FilterIO; 13 class Halftone; 14 15 16 class PSDriver : public GraphicsDriver { 17 public: 18 PSDriver(BMessage *msg, PrinterData *printer_data, const PrinterCap *printer_cap); 19 20 protected: 21 virtual bool startDoc(); 22 virtual bool startPage(int page); 23 virtual bool nextBand(BBitmap *bitmap, BPoint *offset); 24 virtual bool endPage(int page); 25 virtual bool endDoc(bool success); 26 27 private: 28 void setupCTM(); 29 void jobStart(); 30 void startRasterGraphics(int x, int y, int width, int height, int widthByte); 31 void endRasterGraphics(); 32 void rasterGraphics( 33 int compression_method, 34 const uchar *buffer, 35 int size); 36 void jobEnd(); 37 38 void StartFilterIfNeeded(); 39 void FlushFilterIfNeeded(); 40 void writePSString(const char *format, ...); 41 void writePSData(const void *data, size_t size); 42 43 int fPrintedPages; 44 int fCompressionMethod; 45 Halftone *fHalftone; 46 FilterIO *fFilterIO; 47 }; 48 49 #endif /* __PS_H */ 50