| 1 | #cxx . . $ `<file>/HercPrinter/Stationery.cpp`/include "Stationery.h"cxx . . $ `<file>/HercPrinter/Stationery.h`/ |
| 2 | #include "HerculesStudio.h"cxx . . $ `<file>/HercStudio/HerculesStudio.h`/ |
| 3 | |
| 4 | static const char *paperSizeNamescxx . . $ paperSizeNames.[] = |
| 5 | { |
| 6 | "Letter", |
| 7 | "Legal", |
| 8 | "Ledger/Tabloid", |
| 9 | "Letter FanFold", |
| 10 | "Legal FanFold", |
| 11 | "Std FanFold", |
| 12 | "A0", |
| 13 | "A1", |
| 14 | "A2", |
| 15 | "A3", |
| 16 | "A4", |
| 17 | "A5", |
| 18 | "Custom" |
| 19 | }; |
| 20 | |
| 21 | const char *Stationerycxx . . $ Stationery#::mBarsColorNamescxx . . $ Stationery#mBarsColorNames.[] = |
| 22 | { |
| 23 | "Green", |
| 24 | "Gray", |
| 25 | "Light Blue", |
| 26 | "None", |
| 27 | "Custom" |
| 28 | }; |
| 29 | |
| 30 | |
| 31 | const int barsColorscxx . . $ barsColors.[][3] = |
| 32 | { |
| 33 | {0xdd, 0xff, 0xdd}, // Green |
| 34 | {0xd2, 0xd2, 0xd2}, // Gray |
| 35 | {0xe0, 0xf0, 0xf0}, // Light Blue |
| 36 | {0xff, 0xff, 0xff} // None |
| 37 | }; |
| 38 | |
| 39 | Stationerycxx . . $ Stationery#::Stationerycxx . . $ Stationery#Stationery(98916b0b04ef2070).(const QStringcxx . . $ QString#& name, const QStringcxx . . $ QString#& paperSize, const QStringcxx . . $ QString#& size1, const QStringcxx . . $ QString#& size2, |
| 40 | int topMargin, bool millimeters, bool portrait, const QStringcxx . . $ QString#& barsColor, |
| 41 | const QStringcxx . . $ QString#& barsRGB, bool Decorated, bool tractorFeedHoles) : |
| 42 | mNamecxx . . $ Stationery#mName.(name), |
| 43 | mPaperSizecxx . . $ Stationery#mPaperSize.(paperSize), |
| 44 | mSize1cxx . . $ Stationery#mSize1.(size1), |
| 45 | mSize2cxx . . $ Stationery#mSize2.(size2), |
| 46 | mTopMargincxx . . $ Stationery#mTopMargin.(topMargin), |
| 47 | mMillimeterscxx . . $ Stationery#mMillimeters.(millimeters), |
| 48 | mPortraitcxx . . $ Stationery#mPortrait.(portrait), |
| 49 | mBarsColorcxx . . $ Stationery#mBarsColor.(barsColor), |
| 50 | mBarsRGBcxx . . $ Stationery#mBarsRGB.(barsRGB), |
| 51 | mDecoratedcxx . . $ Stationery#mDecorated.(Decorated), |
| 52 | mTractorFeedHolescxx . . $ Stationery#mTractorFeedHoles.(tractorFeedHoles) |
| 53 | { |
| 54 | } |
| 55 | |
| 56 | unsigned int Stationerycxx . . $ Stationery#::paperSizescxx . . $ Stationery#paperSizes(db52760e79bf9054).() |
| 57 | { |
| 58 | return sizeof(paperSizeNamescxx . . $ paperSizeNames.)/sizeof(char *); |
| 59 | } |
| 60 | |
| 61 | const char *Stationerycxx . . $ Stationery#::paperSizecxx . . $ Stationery#paperSize(81a3ae90da26a711).(unsigned int i) |
| 62 | { |
| 63 | return paperSizeNamescxx . . $ paperSizeNames.[i]; |
| 64 | } |
| 65 | |
| 66 | |
| 67 | int Stationerycxx . . $ Stationery#::getBarsColorIndexcxx . . $ Stationery#getBarsColorIndex(b126dc7c1de90089).() |
| 68 | { |
| 69 | for (int i=0; i<4; i++) |
| 70 | { |
| 71 | if (mBarsColorcxx . . $ Stationery#mBarsColor..comparecxx . . $ QString#compare(38964227c2ffb4ec).(mBarsColorNamescxx . . $ QString#QString(85c52e162fed56f9).[i]) == 0) |
| 72 | return i; |
| 73 | } |
| 74 | return -1; |
| 75 | } |
| 76 | |
| 77 | int * Stationerycxx . . $ Stationery#::getBarsColorcxx . . $ Stationery#getBarsColor(4650b16577b4e630).(int *fill) |
| 78 | { |
| 79 | if (mBarsColorcxx . . $ Stationery#mBarsColor..comparecxx . . $ QString#compare(38964227c2ffb4ec).("Custom"cxx . . $ QString#QString(85c52e162fed56f9).) == 0) |
| 80 | { |
| 81 | QStringcxx . . $ QString# hex = QStringcxx . . $ QString#QString(3520e46b33348bf6).("0x") +cxx . . $ operator+(fab9b4f80031f353). mBarsRGBcxx . . $ Stationery#mBarsRGB..rightcxx . . $ QString#right(3f3c3d0e9c0eb37f).(6); |
| 82 | int color = hex.toIntcxx . . $ QString#toInt(d7972accae11ee1f).(0,16); |
| 83 | fill[0] = color >> 16; |
| 84 | fill[1] = (color >> 8) & 0xff; |
| 85 | fill[2] = color & 0xff; |
| 86 | return fill; |
| 87 | } |
| 88 | int index = getBarsColorIndexcxx . . $ Stationery#getBarsColorIndex(b126dc7c1de90089).(); |
| 89 | memcpy(fill, barsColorscxx . . $ barsColors.[index], 3*sizeof(int)); |
| 90 | return fill; |
| 91 | } |