| 1 | /*************************************************************************** |
| 2 | style.cpp |
| 3 | ------------------- |
| 4 | AHA-like style class |
| 5 | ------------------- |
| 6 | Copyright 1999-2008, David Johnson |
| 7 | Please see the header file for copyright and license information |
| 8 | ***************************************************************************/ |
| 9 | |
| 10 | #include "resource.h"cxx . . $ `<file>/src/resource.h`/ |
| 11 | #include "style.h"cxx . . $ `<file>/src/style.h`/ |
| 12 | |
| 13 | using namespace Resource; |
| 14 | |
| 15 | ////////////////////////////////////////////////////////////////////////////// |
| 16 | // Construction, Destruction // |
| 17 | ////////////////////////////////////////////////////////////////////////////// |
| 18 | |
| 19 | Stylecxx . . $ Style#::Stylecxx . . $ Style#Style(49f6e7a06ebc5aa8).() |
| 20 | : name_cxx . . $ Style#name_.("Generic Ale"), oglow_cxx . . $ Style#oglow_.(0.0), oghi_cxx . . $ Style#oghi_.(0.0), fglow_cxx . . $ Style#fglow_.(0.0), fghi_cxx . . $ Style#fghi_.(0.0), |
| 21 | ibulow_cxx . . $ Style#ibulow_.(0), ibuhi_cxx . . $ Style#ibuhi_.(100), srmlow_cxx . . $ Style#srmlow_.(0), srmhi_cxx . . $ Style#srmhi_.(40) |
| 22 | { ; } |
| 23 | |
| 24 | ////////////////////////////////////////////////////////////////////////////// |
| 25 | // Style() |
| 26 | // ------- |
| 27 | // Constructor |
| 28 | |
| 29 | Stylecxx . . $ Style#::Stylecxx . . $ Style#Style(1f541e414bac11ab).(const QStringcxx . . $ QString# name, const double &oglow, const double &oghi, |
| 30 | const double &fglow, const double &fghi, |
| 31 | const int &ibulow, const int &ibuhi, |
| 32 | const int &srmlow, const int &srmhi) |
| 33 | : name_cxx . . $ Style#name_.(name), oglow_cxx . . $ Style#oglow_.(oglow), oghi_cxx . . $ Style#oghi_.(oghi), fglow_cxx . . $ Style#fglow_.(fglow), fghi_cxx . . $ Style#fghi_.(fghi), |
| 34 | ibulow_cxx . . $ Style#ibulow_.(ibulow), ibuhi_cxx . . $ Style#ibuhi_.(ibuhi), srmlow_cxx . . $ Style#srmlow_.(srmlow), srmhi_cxx . . $ Style#srmhi_.(srmhi) |
| 35 | { |
| 36 | // older qbrewdata files might not have FG values |
| 37 | if (fglow_cxx . . $ Style#fglow_. == 0.0) fglow_cxx . . $ Style#fglow_. = ((oglow_cxx . . $ Style#oglow_. - 1.0) * 0.25) + 1.0; |
| 38 | if (fghi_cxx . . $ Style#fghi_. == 0.0) fghi_cxx . . $ Style#fghi_. = ((oghi_cxx . . $ Style#oghi_. - 1.0) * 0.25) + 1.0; |
| 39 | } |
| 40 | |
| 41 | Stylecxx . . $ Style#::Stylecxx . . $ Style#Style(29d9cc28be3d2322).(const Stylecxx . . $ Style# &s) |
| 42 | : name_cxx . . $ Style#name_.(s.name_cxx . . $ Style#name_.), oglow_cxx . . $ Style#oglow_.(s.oglow_cxx . . $ Style#oglow_.), oghi_cxx . . $ Style#oghi_.(s.oghi_cxx . . $ Style#oghi_.), fglow_cxx . . $ Style#fglow_.(s.fglow_cxx . . $ Style#fglow_.), |
| 43 | fghi_cxx . . $ Style#fghi_.(s.fghi_cxx . . $ Style#fghi_.), ibulow_cxx . . $ Style#ibulow_.(s.ibulow_cxx . . $ Style#ibulow_.), ibuhi_cxx . . $ Style#ibuhi_.(s.ibuhi_cxx . . $ Style#ibuhi_.), |
| 44 | srmlow_cxx . . $ Style#srmlow_.(s.srmlow_cxx . . $ Style#srmlow_.), srmhi_cxx . . $ Style#srmhi_.(s.srmhi_cxx . . $ Style#srmhi_.) |
| 45 | { ; } |
| 46 | |
| 47 | Stylecxx . . $ Style#::~cxx . . $ Style#`~Style`(ced63f7c635d850d).Stylecxx . . $ Style#() { ; } |
| 48 | |
| 49 | ////////////////////////////////////////////////////////////////////////////// |
| 50 | // Miscellaneous // |
| 51 | ////////////////////////////////////////////////////////////////////////////// |
| 52 | |
| 53 | ////////////////////////////////////////////////////////////////////////////// |
| 54 | // operator= |
| 55 | // --------- |
| 56 | // Assignment operator |
| 57 | |
| 58 | Stylecxx . . $ Style# Stylecxx . . $ Style#::operatorcxx . . $ Style#`operator=`(73c14b8dd1039aa8).=(const Stylecxx . . $ Style# &s) |
| 59 | { |
| 60 | if (&s != this) { |
| 61 | name_cxx . . $ Style#name_. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). s.name_cxx . . $ Style#name_.; |
| 62 | oglow_cxx . . $ Style#oglow_. = s.oglow_cxx . . $ Style#oglow_.; oghi_cxx . . $ Style#oghi_. = s.oghi_cxx . . $ Style#oghi_.; |
| 63 | fglow_cxx . . $ Style#fglow_. = s.fglow_cxx . . $ Style#fglow_.; fghi_cxx . . $ Style#fghi_. = s.fghi_cxx . . $ Style#fghi_.; |
| 64 | ibulow_cxx . . $ Style#ibulow_. = s.ibulow_cxx . . $ Style#ibulow_.; ibuhi_cxx . . $ Style#ibuhi_. = s.ibuhi_cxx . . $ Style#ibuhi_.; |
| 65 | srmlow_cxx . . $ Style#srmlow_. = s.srmlow_cxx . . $ Style#srmlow_.; srmhi_cxx . . $ Style#srmhi_. = s.srmhi_cxx . . $ Style#srmhi_.; |
| 66 | } |
| 67 | return *cxx . . $ Style#Style(29d9cc28be3d2322).this; |
| 68 | } |
| 69 | |
| 70 | ////////////////////////////////////////////////////////////////////////////// |
| 71 | // operator== |
| 72 | // ---------- |
| 73 | // Equivalence operator |
| 74 | |
| 75 | bool Stylecxx . . $ Style#::operatorcxx . . $ Style#`operator==`(1bb77a824eb57384).==(const Stylecxx . . $ Style# &s) const |
| 76 | { |
| 77 | return ( (name_cxx . . $ Style#name_. ==cxx . . $ `operator==`(5bc2975d2d751687). s.name_cxx . . $ Style#name_.) && |
| 78 | (oglow_cxx . . $ Style#oglow_. == s.oglow_cxx . . $ Style#oglow_.) && |
| 79 | (oghi_cxx . . $ Style#oghi_. == s.oghi_cxx . . $ Style#oghi_.) && |
| 80 | (fglow_cxx . . $ Style#fglow_. == s.fglow_cxx . . $ Style#fglow_.) && |
| 81 | (fghi_cxx . . $ Style#fghi_. == s.fghi_cxx . . $ Style#fghi_.) && |
| 82 | (ibulow_cxx . . $ Style#ibulow_. == s.ibulow_cxx . . $ Style#ibulow_.) && |
| 83 | (ibuhi_cxx . . $ Style#ibuhi_. == s.ibuhi_cxx . . $ Style#ibuhi_.) && |
| 84 | (srmlow_cxx . . $ Style#srmlow_. == s.srmlow_cxx . . $ Style#srmlow_.) && |
| 85 | (srmhi_cxx . . $ Style#srmhi_. == s.srmhi_cxx . . $ Style#srmhi_.) ); |
| 86 | } |