void Game::executeStackChanges() { // Parameters expected in mStackAction and mStackParam. switch (rStackAction) { case SAID::POP: { popState(); break; } case SAID::PUSH: { pushState(rStackParam); break; } case SAID::SWAP: { swapState(rStackParam); break; } case SAID::RETURN_TO: { returnToState(rStackParam); break; } case SAID::CLEAR: { clearStateStack(); break; } default: break; } // Finally, reset stack action requests: rStackAction = SAID::NOTHING; }
void Hook::Remapper::remapPriv(Hook::ControllerState &state) const { ControllerState swapState(state); for (auto& iter : mMappings) { setButtonValue(state, iter.first, getButtonValue(swapState, iter.second)); } }
Reply::~Reply() { if (getCallStack().size() > 0) { string backtrace = vespalib::getStackTrace(0); LOG(warning, "Deleted reply %p with non-empty call-stack. Deleted at:\n%s", this, backtrace.c_str()); Reply::UP reply(new EmptyReply()); swapState(*reply); reply->addError(Error(ErrorCode::FATAL_ERROR, "The reply object was deleted while containing state information; " "generating an auto-reply.")); IReplyHandler &handler = reply->getCallStack().pop(*reply); handler.handleReply(std::move(reply)); } }
GUI_ListBox::GUI_ListBox(RECT _mRect, int _id, GUI_ElementStyle *_style, bool _selectBox, bool _noSelect) : GUI_BaseElement(_mRect, _id, _style) { swapState(new GUI_ListBoxState(this)); //calculating how many lines the ListBox can display and max length of line style = _style; lineSpace = 2; nLines = (height - style->MarginBottom() - style->MarginTop()) / (font->GetfHeight() + lineSpace); //default justification is left listJustification = T_LEFT; //line position selected = 2; auto s = cState(); s->SetSelectBox(_selectBox); s->SetnoSelect(_noSelect); createScrollbar(); src = GUI_Looks::GetResource(this); }