devicePRT.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // Wengier: MISC fix
  2. #ifndef vDOS_DEVICEPRT_H
  3. #define vDOS_DEVICEPRT_H
  4. #ifndef VDOS_H
  5. #include "vDos.h"
  6. #endif
  7. #ifndef vDOS_INOUT_H
  8. #include "inout.h"
  9. #endif
  10. #ifndef LPT_SHORTTIMEOUT
  11. #define LPT_SHORTTIMEOUT 1000 // Printers timeout after 1 sec after closing device w/o last formfeed
  12. #define LPT_LONGTIMEOUT 5000 // and after 5 secs w/o receiving any data
  13. #endif
  14. #include "dos_inc.h"
  15. #include <vector>
  16. void LPT_CheckTimeOuts(Bit32u mSecsCurr);
  17. class device_PRT : public DOS_Device
  18. {
  19. public:
  20. // Creates a LPT device that communicates with the num-th parallel port, i.e. is LPTnum
  21. device_PRT(const char* pname, const char* cmd);
  22. ~device_PRT();
  23. void Close();
  24. bool Read(Bit8u * data, Bit16u * size);
  25. bool Write(Bit8u * data, Bit16u * size);
  26. bool Seek(Bit32u * pos, Bit32u type);
  27. Bit16u GetInformation(void);
  28. bool spool; // Collect print data? (postpone printing)
  29. std::string destination; // where to send the output to
  30. char value[255];
  31. private:
  32. void CommitData();
  33. char tmpAscii[10];
  34. char tmpUnicode[10];
  35. bool useDP;
  36. bool nothingSet;
  37. bool fastCommit;
  38. intptr_t DPhandle; // Handle to previous DOSPrinter process
  39. Bit32u DPexitcode;
  40. std::string rawdata; // the raw data sent to LPTx...
  41. };
  42. #endif