1 /* 2 * PS.h 3 * Copyright 1999-2000 Y.Takagi. All Rights Reserved. 4 */ 5 #ifndef __PS_H 6 #define __PS_H 7 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* message, PrinterData* printerData, 19 const PrinterCap* printerCap); 20 21 protected: 22 virtual bool StartDocument(); 23 virtual bool StartPage(int page); 24 virtual bool NextBand(BBitmap* bitmap, BPoint* offset); 25 virtual bool EndPage(int page); 26 virtual bool EndDocument(bool success); 27 28 private: 29 void _SetupCTM(); 30 void _JobStart(); 31 void _StartRasterGraphics(int x, int y, int width, 32 int height, int widthByte); 33 void _EndRasterGraphics(); 34 void _RasterGraphics(int compression_method, 35 const uchar* buffer, 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