| 1 | #cxx . . $ `<file>/HercPrinter/PrinterInterface.cpp`/include "PrinterInterface.h"cxx . . $ `<file>/HercPrinter/PrinterInterface.h`/ |
| 2 | #include "Environment.h"cxx . . $ `<file>/HercStudio/Environment.h`/ |
| 3 | #include "HerculesStudio.h"cxx . . $ `<file>/HercStudio/HerculesStudio.h`/ |
| 4 | |
| 5 | #include <QHostAddress> |
| 6 | #include <QTcpSocket> |
| 7 | #include <QPainter> //TODO move to PagePrinter |
| 8 | |
| 9 | BasicPrintercxx . . $ BasicPrinter#::BasicPrintercxx . . $ BasicPrinter#BasicPrinter(49f6e7a06ebc5aa8).() |
| 10 | { |
| 11 | } |
| 12 | |
| 13 | |
| 14 | GenericPagePrintercxx . . $ GenericPagePrinter#::GenericPagePrintercxx . . $ GenericPagePrinter#GenericPagePrinter(1dd650c547b18fb1).(StationeryPtrcxx . . $ StationeryPtr# &stationery, float scaling) : |
| 15 | mStationerycxx . . $ GenericPagePrinter#mStationery.(stationery), mPencxx . . $ GenericPagePrinter#mPen.(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!), mLogocxx . . $ GenericPagePrinter#mLogo.(QPixmapcxx . . $ QPixmap#QPixmap(3e454b8ccf442868).(2200,1200)), mLogoWidthcxx . . $ GenericPagePrinter#mLogoWidth.(0), mScalingcxx . . $ GenericPagePrinter#mScaling.(scaling) |
| 16 | { |
| 17 | mDecolationcxx . . $ GenericPagePrinter#mDecolation..clearcxx . . $ QSharedPointer#clear(49f6e7a06ebc5aa8).(); |
| 18 | mHeightInPixelscxx . . $ GenericPagePrinter#mHeightInPixels. = 4000; |
| 19 | mWidthInPixelscxx . . $ GenericPagePrinter#mWidthInPixels. = 1200; |
| 20 | mLeftMargincxx . . $ GenericPagePrinter#mLeftMargin. = 0; |
| 21 | mLogicalDpiXcxx . . $ GenericPagePrinter#mLogicalDpiX. = mLogicalDpiYcxx . . $ GenericPagePrinter#mLogicalDpiY. = 1200; |
| 22 | } |
| 23 | |
| 24 | void GenericPagePrintercxx . . $ GenericPagePrinter#::preparePagecxx . . $ GenericPagePrinter#preparePage(b45ddcbc8423892c).(bool eject) |
| 25 | { |
| 26 | int builtinMargin = 250; |
| 27 | const int penWidth = 20; |
| 28 | const int alternatingStripes = 20; |
| 29 | |
| 30 | setValuescxx . . $ GenericPagePrinter#setValues(b45ddcbc8423892c).(eject); |
| 31 | |
| 32 | mPencxx . . $ GenericPagePrinter#mPen.->fillRectcxx . . $ QPainter#fillRect(b6f7dd7f1bbb6c84).(0, 0, mWidthInPixelscxx . . $ GenericPagePrinter#mWidthInPixels., mHeightInPixelscxx . . $ GenericPagePrinter#mHeightInPixels.-mLeftMargincxx . . $ GenericPagePrinter#mLeftMargin., QColorcxx . . $ QColor#QColor(748afa4755bc9595).(0xff, 0xff, 0xff)); |
| 33 | |
| 34 | if (eject) mEndJobTriggercxx . . $ GenericPagePrinter#mEndJobTrigger..clearcxx . . $ QMap#clear(49f6e7a06ebc5aa8).(); |
| 35 | if (!mDecolationcxx . . $ GenericPagePrinter#mDecolation..isNullcxx . . $ QSharedPointer#isNull(50ce9a9e25b4a850).()) |
| 36 | { |
| 37 | for (int i=0; i<mDecolationcxx . . $ GenericPagePrinter#mDecolation.->cxx . . $ QSharedPointer#`operator->`(5a2a78a048fb49a8).mSeperatorcxx . . $ DecolationRules#mSeperator..mTriggerscxx . . $ Seperator#mTriggers..countcxx . . $ QList#count(455f465bc33b4cdf).(); i++) |
| 38 | { |
| 39 | Triggercxx . . $ Trigger# t = mDecolationcxx . . $ GenericPagePrinter#mDecolation.->cxx . . $ QSharedPointer#`operator->`(5a2a78a048fb49a8).mSeperatorcxx . . $ DecolationRules#mSeperator..mTriggerscxx . . $ Seperator#mTriggers.[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).i]; |
| 40 | mEndJobTriggercxx . . $ GenericPagePrinter#mEndJobTrigger..insertcxx . . $ QMultiMap#insert(9bf047f9fc4d1418).(t.linecxx . . $ Trigger#line(b126dc7c1de90089).(), t); |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | hOutDebugcxx . . $ `HercStudio/HerculesStudio.h:49:9`!(1, "in pixels: " <<mWidthInPixels << " " << mHeightInPixels); |
| 45 | hOutDebugcxx . . $ `HercStudio/HerculesStudio.h:49:9`!(1, "left margin " << mLeftMargin); |
| 46 | |
| 47 | int stripe = (mHeightInPixelscxx . . $ GenericPagePrinter#mHeightInPixels.-(mMargincxx . . $ GenericPagePrinter#mMargin.+mBottomMargincxx . . $ GenericPagePrinter#mBottomMargin.))/alternatingStripes*mScalingcxx . . $ GenericPagePrinter#mScaling.; |
| 48 | |
| 49 | if (mHeightInPixelscxx . . $ GenericPagePrinter#mHeightInPixels. > 0) |
| 50 | { |
| 51 | for (int i=mMargincxx . . $ GenericPagePrinter#mMargin.+stripe; i<=mMargincxx . . $ GenericPagePrinter#mMargin.+(alternatingStripes)*stripe; i+=2*stripe) |
| 52 | { |
| 53 | int barsR = mBarsColorcxx . . $ GenericPagePrinter#mBarsColor.[0]; |
| 54 | int barsG = mBarsColorcxx . . $ GenericPagePrinter#mBarsColor.[1]; |
| 55 | int barsB = mBarsColorcxx . . $ GenericPagePrinter#mBarsColor.[2]; |
| 56 | mPencxx . . $ GenericPagePrinter#mPen.->fillRectcxx . . $ QPainter#fillRect(b6f7dd7f1bbb6c84).(mLeftMargincxx . . $ GenericPagePrinter#mLeftMargin., i, mWidthInPixelscxx . . $ GenericPagePrinter#mWidthInPixels.-2*mLeftMargincxx . . $ GenericPagePrinter#mLeftMargin., stripe, QColorcxx . . $ QColor#QColor(748afa4755bc9595).(barsR, barsG, barsB)); |
| 57 | |
| 58 | // if (mStationery->mDecorated) |
| 59 | // { |
| 60 | // mPen->setPen(QPen(QColor(barsR-0x20, barsG-0x20, barsB-0x20), penWidth)); |
| 61 | // mPen->drawLine(leftMargin,i,widthInPixels-leftMargin,i); |
| 62 | // mPen->drawLine(leftMargin,i+stripe,widthInPixels-leftMargin,i+stripe); |
| 63 | // } |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | if (mStationerycxx . . $ GenericPagePrinter#mStationery.->cxx . . $ QSharedPointer#`operator->`(5a2a78a048fb49a8).mDecoratedcxx . . $ Stationery#mDecorated.) |
| 68 | { |
| 69 | int barsR = mBarsColorcxx . . $ GenericPagePrinter#mBarsColor.[0]; |
| 70 | int barsG = mBarsColorcxx . . $ GenericPagePrinter#mBarsColor.[1]; |
| 71 | int barsB = mBarsColorcxx . . $ GenericPagePrinter#mBarsColor.[2]; |
| 72 | mPencxx . . $ GenericPagePrinter#mPen.->setPencxx . . $ QPainter#setPen(af0a25dfda3214db).(QPencxx . . $ QPen#QPen(c1f9b1cc0228302b).(QColorcxx . . $ QBrush#QBrush(b50947b0752ea6ac).(barsR, barsG, barsB), penWidth*(mScalingcxx . . $ GenericPagePrinter#mScaling.==1.0 ? 1.0 : 0.1))); |
| 73 | mPencxx . . $ GenericPagePrinter#mPen.->drawRectcxx . . $ QPainter#drawRect(748afa4755bc9595).(mLeftMargincxx . . $ GenericPagePrinter#mLeftMargin., mMargincxx . . $ GenericPagePrinter#mMargin., mWidthInPixelscxx . . $ GenericPagePrinter#mWidthInPixels.-2*mLeftMargincxx . . $ GenericPagePrinter#mLeftMargin., stripe*(alternatingStripes));//heightInPixels-leftMargin); |
| 74 | } |
| 75 | |
| 76 | if (mStationerycxx . . $ GenericPagePrinter#mStationery.->cxx . . $ QSharedPointer#`operator->`(5a2a78a048fb49a8).mTractorFeedHolescxx . . $ Stationery#mTractorFeedHoles.) |
| 77 | { |
| 78 | QStringcxx . . $ QString# pixmapStrcxx . . $ QString#QString(85c52e162fed56f9).(Environmentcxx . . $ Environment#::getIconsPathcxx . . $ Environment#getIconsPath(75da78375bc7a3dd).().c_strcxx . . $ std/__cxx11/basic_string#c_str(1016ee5406d91ab9).()); |
| 79 | pixmapStr +=cxx . . $ QString#`operator+=`(d02845eef0c33901)."/Hole.png"; |
| 80 | QPixmapcxx . . $ QPixmap# pixmapcxx . . $ QPixmap#QPixmap(dec4543235ec9b46).(pixmapStr); |
| 81 | hOutDebugcxx . . $ `HercStudio/HerculesStudio.h:49:9`!(5, "hole width " << pixmap.width() << " " << pixmap.logicalDpiX() << " " << pixmap.physicalDpiX()); |
| 82 | float gap = mLogicalDpiYcxx . . $ GenericPagePrinter#mLogicalDpiY./2; |
| 83 | float holeStart = mLogicalDpiYcxx . . $ GenericPagePrinter#mLogicalDpiY./4 - builtinMargin; |
| 84 | if (mScalingcxx . . $ GenericPagePrinter#mScaling. < 1) |
| 85 | { |
| 86 | gap = 40; |
| 87 | holeStart = 20; |
| 88 | } |
| 89 | |
| 90 | for (int holePos=holeStart; holePos <= mHeightInPixelscxx . . $ GenericPagePrinter#mHeightInPixels.; holePos += gap) // image is 200 pixels |
| 91 | { |
| 92 | //TODO: automatic scaling? |
| 93 | if (mScalingcxx . . $ GenericPagePrinter#mScaling. < 1.0) |
| 94 | { |
| 95 | mPencxx . . $ GenericPagePrinter#mPen.->drawPixmapcxx . . $ QPainter#drawPixmap(6641b74c6b11f381).(50*mScalingcxx . . $ GenericPagePrinter#mScaling., holePos, 15, 15, pixmap, 0,0,200,200); |
| 96 | } |
| 97 | else |
| 98 | { |
| 99 | mPencxx . . $ GenericPagePrinter#mPen.->drawPixmapcxx . . $ QPainter#drawPixmap(c906314a67120896).(160, holePos, pixmap); |
| 100 | mPencxx . . $ GenericPagePrinter#mPen.->drawPixmapcxx . . $ QPainter#drawPixmap(c906314a67120896).(mWidthInPixelscxx . . $ GenericPagePrinter#mWidthInPixels.-160-200, holePos, pixmap); |
| 101 | } |
| 102 | } |
| 103 | } |
| 104 | //mPen->drawRect(0,0,mWidthInPixels, mHeightInPixels); //debug |
| 105 | |
| 106 | if (mLogoWidthcxx . . $ GenericPagePrinter#mLogoWidth. == 0) |
| 107 | { |
| 108 | mLogocxx . . $ GenericPagePrinter#mLogo..fillcxx . . $ QPixmap#fill(129a55e114526ad3).(QColorcxx . . $ QColor#QColor(748afa4755bc9595).(255,255,255,255)); |
| 109 | QPaintercxx . . $ QPainter# * logoPainter = new QPaintercxx . . $ QPainter#QPainter(dd2eedc069b0ab5f).(&mLogocxx . . $ GenericPagePrinter#mLogo.); |
| 110 | |
| 111 | const char * logo{"Printed With Hercules Studio"}; |
| 112 | logoPainter->setFontcxx . . $ QPainter#setFont(d0a4bd0c8524b912).(QFontcxx . . $ QFont#QFont(7ae16150a604556).("Verdana"cxx . . $ QString#QString(85c52e162fed56f9)., 110)); |
| 113 | logoPainter->setPencxx . . $ QPainter#setPen(129a55e114526ad3).(QColorcxx . . $ QColor#QColor(748afa4755bc9595).(mBarsColorcxx . . $ GenericPagePrinter#mBarsColor.[0], mBarsColorcxx . . $ GenericPagePrinter#mBarsColor.[1], mBarsColorcxx . . $ GenericPagePrinter#mBarsColor.[2])); |
| 114 | logoPainter->drawTextcxx . . $ QPainter#drawText(c89d651b24440698).(0, logoPainter->fontMetricscxx . . $ QPainter#fontMetrics(ee264e9e8967f9a7).().heightcxx . . $ QFontMetrics#height(455f465bc33b4cdf).() , logocxx . . $ QString#QString(85c52e162fed56f9).); |
| 115 | mLogoWidthcxx . . $ GenericPagePrinter#mLogoWidth. = logoPainter->fontMetricscxx . . $ QPainter#fontMetrics(ee264e9e8967f9a7).().widthcxx . . $ QFontMetrics#width(91f46685ef4c12b5).(logocxx . . $ QString#QString(85c52e162fed56f9).); |
| 116 | mLogoHeightcxx . . $ GenericPagePrinter#mLogoHeight. = logoPainter->fontMetricscxx . . $ QPainter#fontMetrics(ee264e9e8967f9a7).().heightcxx . . $ QFontMetrics#height(455f465bc33b4cdf).(); |
| 117 | logoPainter->endcxx . . $ QPainter#end(c9857a73d68e59ba).(); |
| 118 | } |
| 119 | mPencxx . . $ GenericPagePrinter#mPen.->drawPixmapcxx . . $ QPainter#drawPixmap(c906314a67120896).(mWidthInPixelscxx . . $ GenericPagePrinter#mWidthInPixels.-mLeftMargincxx . . $ GenericPagePrinter#mLeftMargin.-mLogoWidthcxx . . $ GenericPagePrinter#mLogoWidth., mHeightInPixelscxx . . $ GenericPagePrinter#mHeightInPixels. - mLogoHeightcxx . . $ GenericPagePrinter#mLogoHeight., mLogocxx . . $ GenericPagePrinter#mLogo.); |
| 120 | } |
| 121 | |
| 122 |