| 1 | #include "Layout/HardIconParts.h" |
| 2 | |
| 3 | #include "Library/Layout/LayoutActionFunction.h" |
| 4 | #include "Library/Layout/LayoutActor.h" |
| 5 | #include "Library/Nerve/NerveSetupUtil.h" |
| 6 | #include "Library/Nerve/NerveUtil.h" |
| 7 | |
| 8 | namespace { |
| 9 | NERVE_IMPL(HardIconParts, Hide); |
| 10 | NERVE_IMPL(HardIconParts, Appear); |
| 11 | NERVE_IMPL(HardIconParts, Wait); |
| 12 | NERVE_IMPL(HardIconParts, PageNext); |
| 13 | NERVE_IMPL(HardIconParts, PageEnd); |
| 14 | NERVE_IMPL(HardIconParts, End); |
| 15 | |
| 16 | NERVES_MAKE_NOSTRUCT(HardIconParts, Hide, Appear, Wait, PageNext, PageEnd, End); |
| 17 | } // namespace |
| 18 | |
| 19 | HardIconParts::HardIconParts(const char* name) : al::LayoutActor(name) { |
| 20 | initNerve(&Hide, 0); |
| 21 | } |
| 22 | |
| 23 | bool HardIconParts::isHide() const { |
| 24 | return al::isNerve(user: this, nerve: &Hide); |
| 25 | } |
| 26 | |
| 27 | bool HardIconParts::isWait() const { |
| 28 | return al::isNerve(user: this, nerve: &Wait); |
| 29 | } |
| 30 | |
| 31 | void HardIconParts::startHide() { |
| 32 | al::setNerve(user: this, nerve: &Hide); |
| 33 | } |
| 34 | |
| 35 | void HardIconParts::startAppear() { |
| 36 | al::setNerve(user: this, nerve: &Appear); |
| 37 | } |
| 38 | |
| 39 | void HardIconParts::startWait() { |
| 40 | al::setNerve(user: this, nerve: &Wait); |
| 41 | } |
| 42 | |
| 43 | void HardIconParts::startEnd() { |
| 44 | al::setNerve(user: this, nerve: &End); |
| 45 | } |
| 46 | |
| 47 | void HardIconParts::exeHide() { |
| 48 | if (al::isFirstStep(user: this)) |
| 49 | al::startAction(layout: this, actionName: "Hide" , paneName: nullptr); |
| 50 | } |
| 51 | |
| 52 | void HardIconParts::exeAppear() { |
| 53 | if (al::isFirstStep(user: this)) |
| 54 | al::startAction(layout: this, actionName: "Appear" , paneName: nullptr); |
| 55 | al::setNerveAtActionEnd(layout: this, nerve: &Wait); |
| 56 | } |
| 57 | |
| 58 | void HardIconParts::exeWait() { |
| 59 | if (al::isFirstStep(user: this)) |
| 60 | al::startAction(layout: this, actionName: "Wait" , paneName: nullptr); |
| 61 | } |
| 62 | |
| 63 | void HardIconParts::exePageNext() { |
| 64 | if (al::isFirstStep(user: this)) |
| 65 | al::startAction(layout: this, actionName: "PageNext" , paneName: nullptr); |
| 66 | al::setNerveAtActionEnd(layout: this, nerve: &Hide); |
| 67 | } |
| 68 | |
| 69 | void HardIconParts::exePageEnd() { |
| 70 | if (al::isFirstStep(user: this)) |
| 71 | al::startAction(layout: this, actionName: "PageEnd" , paneName: nullptr); |
| 72 | al::setNerveAtActionEnd(layout: this, nerve: &Hide); |
| 73 | } |
| 74 | |
| 75 | void HardIconParts::exeEnd() { |
| 76 | if (al::isFirstStep(user: this)) |
| 77 | al::startAction(layout: this, actionName: "End" , paneName: nullptr); |
| 78 | al::setNerveAtActionEnd(layout: this, nerve: &Hide); |
| 79 | } |
| 80 | |