openMSX
Classes | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
openmsx::ImagePrinter Class Referenceabstract

#include <Printer.hh>

Inheritance diagram for openmsx::ImagePrinter:
Inheritance graph
[legend]
Collaboration diagram for openmsx::ImagePrinter:
Collaboration graph
[legend]

Classes

struct  FontInfo
 

Public Member Functions

void write (byte data) override
 
void forceFormFeed () override
 
- Public Member Functions inherited from openmsx::PrinterCore
bool getStatus (EmuTime::param time) override
 Returns the STATUS signal: false = low = ready, true = high = not ready. More...
 
void setStrobe (bool strobe, EmuTime::param time) override
 Sets the strobe signal: false = low, true = high. More...
 
void writeData (byte data, EmuTime::param time) override
 Sets the data signals. More...
 
void plugHelper (Connector &connector, EmuTime::param time) override
 
void unplugHelper (EmuTime::param time) override
 
- Public Member Functions inherited from openmsx::PrinterPortDevice
virtual bool getStatus (EmuTime::param time)=0
 Returns the STATUS signal: false = low = ready, true = high = not ready. More...
 
virtual void setStrobe (bool strobe, EmuTime::param time)=0
 Sets the strobe signal: false = low, true = high. More...
 
virtual void writeData (byte data, EmuTime::param time)=0
 Sets the data signals. More...
 
std::string_view getClass () const final
 A pluggable belongs to a certain class. More...
 
- Public Member Functions inherited from openmsx::Pluggable
virtual ~Pluggable ()=default
 
virtual std::string_view getName () const
 Name used to identify this pluggable. More...
 
virtual std::string_view getClass () const =0
 A pluggable belongs to a certain class. More...
 
virtual std::string_view getDescription () const =0
 Description for this pluggable. More...
 
void plug (Connector &connector, EmuTime::param time)
 This method is called when this pluggable is inserted in a connector. More...
 
void unplug (EmuTime::param time)
 This method is called when this pluggable is removed from a connector. More...
 
ConnectorgetConnector () const
 Get the connector this Pluggable is plugged into. More...
 
bool isPluggedIn () const
 Returns true if this pluggable is currently plugged into a connector. More...
 

Protected Types

enum  CountryCode {
  CC_USA = 0 , CC_FRANCE = 1 , CC_GERMANY = 2 , CC_UNITED_KINGDOM = 3 ,
  CC_DENMARK = 4 , CC_SWEDEN = 5 , CC_ITALY = 6 , CC_SPAIN = 7 ,
  CC_JAPAN = 8
}
 

Protected Member Functions

 ImagePrinter (MSXMotherBoard &motherBoard, bool graphicsHiLo)
 
 ~ImagePrinter () override
 
void resetEmulatedPrinter ()
 
void printGraphicByte (byte data)
 
void seekPrinterHeadRelative (double offset)
 
void ensurePrintPage ()
 
void flushEmulatedPrinter ()
 
void printVisibleCharacter (byte data)
 
void plot9Dots (double x, double y, unsigned pattern)
 
virtual std::pair< unsigned, unsigned > getNumberOfDots ()=0
 
virtual void resetSettings ()=0
 
virtual unsigned calcEscSequenceLength (byte character)=0
 
virtual void processEscSequence ()=0
 
virtual void processCharacter (byte data)=0
 
- Protected Member Functions inherited from openmsx::PrinterCore
 PrinterCore ()=default
 
 ~PrinterCore () override=default
 
virtual void write (byte data)=0
 
virtual void forceFormFeed ()=0
 
- Protected Member Functions inherited from openmsx::Pluggable
 Pluggable ()
 
virtual void plugHelper (Connector &newConnector, EmuTime::param time)=0
 
virtual void unplugHelper (EmuTime::param time)=0
 
void setConnector (Connector *conn)
 

Protected Attributes

double graphDensity
 
double fontDensity
 
double hpos
 
double vpos
 
double pageTop
 
double lineFeed
 
double pageHeight
 
double printAreaTop = -1.0
 
double printAreaBottom = 0.0
 
double pixelSizeX
 
double pixelSizeY
 
int eightBit = 0
 
unsigned perforationSkip = 0
 
unsigned leftBorder
 
unsigned rightBorder
 
unsigned fontWidth
 
unsigned remainingCommandBytes = 0
 
unsigned sizeEscPos = 0
 
unsigned sizeRemainingDataBytes = 0
 
unsigned ramLoadOffset = 0
 
unsigned ramLoadEnd = 0
 
unsigned lines
 
CountryCode countryCode = CC_USA
 
byte abEscSeq [MAX_ESC_CMDSIZE]
 
struct openmsx::ImagePrinter::FontInfo fontInfo
 
bool letterQuality = false
 
bool bold = false
 
bool proportional = false
 
bool italic = false
 
bool superscript = false
 
bool subscript = false
 
bool doubleWidth = false
 
bool underline = false
 
bool doubleStrike = false
 
bool escSequence = false
 
bool alternateChar = false
 
bool detectPaperOut = false
 
bool japanese = false
 
bool normalAfterLine = false
 
bool ninePinGraphics = false
 
bool leftToRight = false
 
bool elite = false
 
bool compressed = false
 
bool noHighEscapeCodes = false
 

Static Protected Attributes

static constexpr unsigned PIXEL_WIDTH = 8
 
static constexpr int MAX_ESC_CMDSIZE = 8
 
static constexpr int MAX_FONT_WIDTH = 12
 

Detailed Description

Definition at line 69 of file Printer.hh.

Member Enumeration Documentation

◆ CountryCode

Enumerator
CC_USA 
CC_FRANCE 
CC_GERMANY 
CC_UNITED_KINGDOM 
CC_DENMARK 
CC_SWEDEN 
CC_ITALY 
CC_SPAIN 
CC_JAPAN 

Definition at line 118 of file Printer.hh.

Constructor & Destructor Documentation

◆ ImagePrinter()

openmsx::ImagePrinter::ImagePrinter ( MSXMotherBoard motherBoard,
bool  graphicsHiLo 
)
protected

Definition at line 109 of file Printer.cc.

◆ ~ImagePrinter()

openmsx::ImagePrinter::~ImagePrinter ( )
overrideprotected

Definition at line 120 of file Printer.cc.

References flushEmulatedPrinter().

Member Function Documentation

◆ calcEscSequenceLength()

virtual unsigned openmsx::ImagePrinter::calcEscSequenceLength ( byte  character)
protectedpure virtual

Referenced by write().

◆ ensurePrintPage()

void openmsx::ImagePrinter::ensurePrintPage ( )
protected

Definition at line 216 of file Printer.cc.

References getNumberOfDots(), pixelSizeX, and pixelSizeY.

Referenced by printGraphicByte(), and printVisibleCharacter().

◆ flushEmulatedPrinter()

void openmsx::ImagePrinter::flushEmulatedPrinter ( )
protected

◆ forceFormFeed()

void openmsx::ImagePrinter::forceFormFeed ( )
overridevirtual

Implements openmsx::PrinterCore.

Definition at line 160 of file Printer.cc.

References flushEmulatedPrinter().

◆ getNumberOfDots()

virtual std::pair< unsigned, unsigned > openmsx::ImagePrinter::getNumberOfDots ( )
protectedpure virtual

Referenced by ensurePrintPage().

◆ plot9Dots()

void openmsx::ImagePrinter::plot9Dots ( double  x,
double  y,
unsigned  pattern 
)
protected

Definition at line 174 of file Printer.cc.

References pixelSizeY, openmsx::x, and xrange().

Referenced by printGraphicByte(), and printVisibleCharacter().

◆ printGraphicByte()

void openmsx::ImagePrinter::printGraphicByte ( byte  data)
protected

◆ printVisibleCharacter()

void openmsx::ImagePrinter::printVisibleCharacter ( byte  data)
protected

◆ processCharacter()

virtual void openmsx::ImagePrinter::processCharacter ( byte  data)
protectedpure virtual

Referenced by write().

◆ processEscSequence()

virtual void openmsx::ImagePrinter::processEscSequence ( )
protectedpure virtual

Referenced by write().

◆ resetEmulatedPrinter()

void openmsx::ImagePrinter::resetEmulatedPrinter ( )
protected

◆ resetSettings()

virtual void openmsx::ImagePrinter::resetSettings ( )
protectedpure virtual

Referenced by resetEmulatedPrinter().

◆ seekPrinterHeadRelative()

void openmsx::ImagePrinter::seekPrinterHeadRelative ( double  offset)
protected

◆ write()

void openmsx::ImagePrinter::write ( byte  data)
overridevirtual

Member Data Documentation

◆ abEscSeq

byte openmsx::ImagePrinter::abEscSeq[MAX_ESC_CMDSIZE]
protected

Definition at line 132 of file Printer.hh.

Referenced by write().

◆ alternateChar

bool openmsx::ImagePrinter::alternateChar = false
protected

Definition at line 153 of file Printer.hh.

◆ bold

bool openmsx::ImagePrinter::bold = false
protected

Definition at line 144 of file Printer.hh.

Referenced by printVisibleCharacter().

◆ compressed

bool openmsx::ImagePrinter::compressed = false
protected

Definition at line 160 of file Printer.hh.

◆ countryCode

CountryCode openmsx::ImagePrinter::countryCode = CC_USA
protected

Definition at line 129 of file Printer.hh.

◆ detectPaperOut

bool openmsx::ImagePrinter::detectPaperOut = false
protected

Definition at line 154 of file Printer.hh.

◆ doubleStrike

bool openmsx::ImagePrinter::doubleStrike = false
protected

Definition at line 151 of file Printer.hh.

Referenced by printVisibleCharacter().

◆ doubleWidth

bool openmsx::ImagePrinter::doubleWidth = false
protected

Definition at line 149 of file Printer.hh.

Referenced by printVisibleCharacter(), and seekPrinterHeadRelative().

◆ eightBit

int openmsx::ImagePrinter::eightBit = 0
protected

Definition at line 107 of file Printer.hh.

Referenced by write().

◆ elite

bool openmsx::ImagePrinter::elite = false
protected

Definition at line 159 of file Printer.hh.

◆ escSequence

bool openmsx::ImagePrinter::escSequence = false
protected

Definition at line 152 of file Printer.hh.

Referenced by write().

◆ fontDensity

double openmsx::ImagePrinter::fontDensity
protected

Definition at line 97 of file Printer.hh.

Referenced by printVisibleCharacter().

◆ fontInfo

struct openmsx::ImagePrinter::FontInfo openmsx::ImagePrinter::fontInfo
protected

Referenced by printVisibleCharacter(), and write().

◆ fontWidth

unsigned openmsx::ImagePrinter::fontWidth
protected

Definition at line 111 of file Printer.hh.

◆ graphDensity

double openmsx::ImagePrinter::graphDensity
protected

Definition at line 96 of file Printer.hh.

Referenced by printGraphicByte().

◆ hpos

double openmsx::ImagePrinter::hpos
protected

◆ italic

bool openmsx::ImagePrinter::italic = false
protected

Definition at line 146 of file Printer.hh.

◆ japanese

bool openmsx::ImagePrinter::japanese = false
protected

Definition at line 155 of file Printer.hh.

◆ leftBorder

unsigned openmsx::ImagePrinter::leftBorder
protected

Definition at line 109 of file Printer.hh.

Referenced by flushEmulatedPrinter(), resetEmulatedPrinter(), and seekPrinterHeadRelative().

◆ leftToRight

bool openmsx::ImagePrinter::leftToRight = false
protected

Definition at line 158 of file Printer.hh.

◆ letterQuality

bool openmsx::ImagePrinter::letterQuality = false
protected

Definition at line 143 of file Printer.hh.

◆ lineFeed

double openmsx::ImagePrinter::lineFeed
protected

Definition at line 101 of file Printer.hh.

Referenced by resetEmulatedPrinter(), and seekPrinterHeadRelative().

◆ lines

unsigned openmsx::ImagePrinter::lines
protected

Definition at line 117 of file Printer.hh.

Referenced by resetEmulatedPrinter().

◆ MAX_ESC_CMDSIZE

constexpr int openmsx::ImagePrinter::MAX_ESC_CMDSIZE = 8
staticconstexprprotected

Definition at line 131 of file Printer.hh.

◆ MAX_FONT_WIDTH

constexpr int openmsx::ImagePrinter::MAX_FONT_WIDTH = 12
staticconstexprprotected

Definition at line 134 of file Printer.hh.

◆ ninePinGraphics

bool openmsx::ImagePrinter::ninePinGraphics = false
protected

Definition at line 157 of file Printer.hh.

◆ noHighEscapeCodes

bool openmsx::ImagePrinter::noHighEscapeCodes = false
protected

Definition at line 161 of file Printer.hh.

◆ normalAfterLine

bool openmsx::ImagePrinter::normalAfterLine = false
protected

Definition at line 156 of file Printer.hh.

Referenced by seekPrinterHeadRelative().

◆ pageHeight

double openmsx::ImagePrinter::pageHeight
protected

Definition at line 102 of file Printer.hh.

Referenced by resetEmulatedPrinter(), and seekPrinterHeadRelative().

◆ pageTop

double openmsx::ImagePrinter::pageTop
protected

Definition at line 100 of file Printer.hh.

Referenced by flushEmulatedPrinter(), and resetEmulatedPrinter().

◆ perforationSkip

unsigned openmsx::ImagePrinter::perforationSkip = 0
protected

Definition at line 108 of file Printer.hh.

◆ PIXEL_WIDTH

constexpr unsigned openmsx::ImagePrinter::PIXEL_WIDTH = 8
staticconstexprprotected

Definition at line 94 of file Printer.hh.

◆ pixelSizeX

double openmsx::ImagePrinter::pixelSizeX
protected

Definition at line 105 of file Printer.hh.

Referenced by ensurePrintPage(), printGraphicByte(), and printVisibleCharacter().

◆ pixelSizeY

double openmsx::ImagePrinter::pixelSizeY
protected

Definition at line 106 of file Printer.hh.

Referenced by ensurePrintPage(), plot9Dots(), printGraphicByte(), and printVisibleCharacter().

◆ printAreaBottom

double openmsx::ImagePrinter::printAreaBottom = 0.0
protected

Definition at line 104 of file Printer.hh.

Referenced by flushEmulatedPrinter(), printGraphicByte(), and printVisibleCharacter().

◆ printAreaTop

double openmsx::ImagePrinter::printAreaTop = -1.0
protected

Definition at line 103 of file Printer.hh.

Referenced by flushEmulatedPrinter(), printGraphicByte(), and printVisibleCharacter().

◆ proportional

bool openmsx::ImagePrinter::proportional = false
protected

Definition at line 145 of file Printer.hh.

Referenced by printVisibleCharacter().

◆ ramLoadEnd

unsigned openmsx::ImagePrinter::ramLoadEnd = 0
protected

Definition at line 116 of file Printer.hh.

Referenced by write().

◆ ramLoadOffset

unsigned openmsx::ImagePrinter::ramLoadOffset = 0
protected

Definition at line 115 of file Printer.hh.

Referenced by write().

◆ remainingCommandBytes

unsigned openmsx::ImagePrinter::remainingCommandBytes = 0
protected

Definition at line 112 of file Printer.hh.

Referenced by write().

◆ rightBorder

unsigned openmsx::ImagePrinter::rightBorder
protected

Definition at line 110 of file Printer.hh.

Referenced by seekPrinterHeadRelative().

◆ sizeEscPos

unsigned openmsx::ImagePrinter::sizeEscPos = 0
protected

Definition at line 113 of file Printer.hh.

Referenced by write().

◆ sizeRemainingDataBytes

unsigned openmsx::ImagePrinter::sizeRemainingDataBytes = 0
protected

Definition at line 114 of file Printer.hh.

Referenced by write().

◆ subscript

bool openmsx::ImagePrinter::subscript = false
protected

Definition at line 148 of file Printer.hh.

Referenced by printVisibleCharacter().

◆ superscript

bool openmsx::ImagePrinter::superscript = false
protected

Definition at line 147 of file Printer.hh.

Referenced by printVisibleCharacter().

◆ underline

bool openmsx::ImagePrinter::underline = false
protected

Definition at line 150 of file Printer.hh.

Referenced by printVisibleCharacter().

◆ vpos

double openmsx::ImagePrinter::vpos
protected

The documentation for this class was generated from the following files: