1 /* 2 * Copyright 2017, Haiku. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Adrien Destugues <pulkomandy@pulkomandy.tk> 7 */ 8 #ifndef LPSTYL_H 9 #define LPSTYL_H 10 11 12 #include "GraphicsDriver.h" 13 14 15 enum PrinterType { 16 kStyleWriter, 17 kStyleWriter2, 18 kStyleWriter3, 19 kStyleWriter2400, 20 kStyleWriter2200, 21 kStyleWriter1500, 22 kStyleWriter2500 23 }; 24 25 26 class LpstylDriver: public GraphicsDriver { 27 public: 28 LpstylDriver(BMessage* message, PrinterData* printerData, 29 const PrinterCap* printerCap); 30 31 protected: 32 bool StartDocument(); 33 bool StartPage(); 34 bool NextBand(BBitmap* bitmap, BPoint* offset); 35 bool EndPage(int page); 36 bool EndDocument(bool success); 37 38 private: 39 void _EjectAndReset(void); 40 void _IdentifyPrinter(void); 41 bool _ColorCartridge(void); 42 43 void _WriteFFFx(char x); 44 int _GetStatus(char reg); 45 46 private: 47 PrinterType fPrinterType; 48 }; 49 50 51 #endif 52