当前位置: 首页>>代码示例>>C++>>正文


C++ popState函数代码示例

本文整理汇总了C++中popState函数的典型用法代码示例。如果您正苦于以下问题:C++ popState函数的具体用法?C++ popState怎么用?C++ popState使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了popState函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: popState

bool KHTMLReader::parse_ul(DOM::Element e)
{
    _list_depth++;
    bool popstateneeded = false;
    for (DOM::Node items = e.firstChild();!items.isNull();items = items.nextSibling()) {
        if (items.nodeName().string().toLower() == "li") {
            if (popstateneeded) {
                popState();
                //popstateneeded = false;
            }
            pushNewState();
            startNewLayout();
            popstateneeded = true;
            _writer->layoutAttribute(state()->paragraph, "COUNTER", "numberingtype", "1");
            _writer->layoutAttribute(state()->paragraph, "COUNTER", "righttext", ".");
            if (e.tagName().string().toLower() == "ol") {
                _writer->layoutAttribute(state()->paragraph, "COUNTER", "type", "1");
                _writer->layoutAttribute(state()->paragraph, "COUNTER", "numberingtype", "1");
                _writer->layoutAttribute(state()->paragraph, "COUNTER", "righttext", ".");
            } else {
                _writer->layoutAttribute(state()->paragraph, "COUNTER", "type", "10");
                _writer->layoutAttribute(state()->paragraph, "COUNTER", "numberingtype", "");
                _writer->layoutAttribute(state()->paragraph, "COUNTER", "righttext", "");
            }
            _writer->layoutAttribute(state()->paragraph, "COUNTER", "depth", QString("%1").arg(_list_depth - 1));
        }
        parseNode(items);
    }
    if (popstateneeded)
        popState();
    _list_depth--;
    return false;
}
开发者ID:KDE,项目名称:koffice,代码行数:33,代码来源:khtmlreader.cpp

示例2: if

void RTF::Reader::insertUnicodeSymbol(qint32 value)
{
	m_cursor.insertText(QChar(value));

	for (int i = m_state.skip; i > 0;) {
		m_token.readNext();

		if (m_token.type() == TextToken) {
			int len = m_token.text().count();
			if (len > i) {
				m_cursor.insertText(m_codec->toUnicode(m_token.text().mid(i)));
				break;
			} else {
				i -= len;
			}
		} else if (m_token.type() == ControlWordToken) {
			--i;
		} else if (m_token.type() == StartGroupToken) {
			pushState();
			break;
		} else if (m_token.type() == EndGroupToken) {
			popState();
			break;
		}
	}
}
开发者ID:YAPLLE,项目名称:manual-indexing,代码行数:26,代码来源:rtf_reader.cpp

示例3: switch

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;
}
开发者ID:JBRPG,项目名称:Solo_Project_build,代码行数:35,代码来源:game.cpp

示例4: popState

void StateManager::changeState(State *state) {
	// pop the current state
	popState();

	// push the new state
	pushState(state);
}
开发者ID:kidaa,项目名称:final-fantasy-1-clone,代码行数:7,代码来源:statemanager.cpp

示例5: popState

void Game::changeState(GameState* state) {
    if(!this->states.empty())
        popState();
    pushState(state);

    return;
}
开发者ID:CFelipe,项目名称:Xadribol,代码行数:7,代码来源:Game.cpp

示例6: while

Game::~Game()
{
	while (!states.empty())
	{
		popState();
	}
}
开发者ID:LateXD,项目名称:LateTactics,代码行数:7,代码来源:Game.cpp

示例7: popState

void App::changeState(AppState* state) {
    if(!this->states.empty())
        popState();
    pushState(state);
    
    return;
}
开发者ID:CFelipe,项目名称:fcbmidi,代码行数:7,代码来源:App.cpp

示例8: popStateOrRevert

void StateMachine::popStateOrRevert()
{
	if(!popState())
	{
		pushState(previousState);
	}
}
开发者ID:foxostro,项目名称:heroman,代码行数:7,代码来源:StateMachine.cpp

示例9: while

void CursorDropdown::onStateDeactivate(StateEvent* event)
{
    if (!_deactivated)
    {
        auto game = Game::getInstance();
        auto mouse = game->mouse();
        // workaround to get rid of cursor disappearing issues
        std::vector<unsigned int> icons;
        while (mouse->states()->size() > _initialMouseStack)
        {
            icons.push_back(mouse->state());
            mouse->popState();
        }
        if (icons.size() > 0)
        {
            icons.pop_back(); // remove empty icon from CursorDropdown state
            // place only new icons back in stack
            for (auto it = icons.rbegin(); it != icons.rend(); it++)
            {
                mouse->pushState(*it);
            }
        }
        mouse->setX(_initialX);
        mouse->setY(_initialY);
        _deactivated = true;
    }
}
开发者ID:McGr3g0r,项目名称:falltergeist,代码行数:27,代码来源:CursorDropdown.cpp

示例10: while

GameManager::~GameManager()
{
	while (!gameState.empty())
	{
		popState();	//Delete happens in pop.
	}
}
开发者ID:MadReza,项目名称:RiskGame,代码行数:7,代码来源:GameManager.cpp

示例11: state

void KHTMLReader::parseNode(DOM::Node node)
{

    // check if this is a text node.
    DOM::Text t = node;
    if (!t.isNull()) {
        _writer->addText(state()->paragraph, t.data().string(), 1, state()->in_pre_mode);
        return; // no children anymore...
    }

    // is this really needed ? it can't do harm anyway.
    state()->format = _writer->currentFormat(state()->paragraph, true);
    state()->layout = _writer->currentLayout(state()->paragraph);
    pushNewState();

    DOM::Element e = node;

    bool go_recursive = true;

    if (!e.isNull()) {
        // get the CSS information
        parseStyle(e);
        // get the tag information
        go_recursive = parseTag(e);
    }
    if (go_recursive) {
        for (DOM::Node q = node.firstChild(); !q.isNull(); q = q.nextSibling()) {
            parseNode(q);
        }
    }
    popState();


}
开发者ID:KDE,项目名称:koffice,代码行数:34,代码来源:khtmlreader.cpp

示例12: popState

void
NextLevelState::keyPressed
(const OIS::KeyEvent &e) {
  // Tecla p --> Estado anterior.
  if (e.key == OIS::KC_P or e.key == OIS::KC_ESCAPE) {
    popState();
  }
}
开发者ID:RiballoJose,项目名称:Get-the-Cup,代码行数:8,代码来源:NextLevelState.cpp

示例13: while

/*****************************************************************************************************************************************************************
*   changeState() removes the top state, and completely replaces it
*   param1  :   a state to push to the end of the state stack
**************************************************************************************************************************************************************/
void StateHandler::changeState(const statePtr& state)
{
    while( !mStates.empty( ) ) {
        popState();
    }

    mStates.emplace( state );
}
开发者ID:Hopson97,项目名称:Faster-Than-Wind,代码行数:12,代码来源:statehandler.cpp

示例14: popState

void GameManager::changeState(GameState* state)
{
	if (!gameState.empty())
	{
		popState();
	}
	pushState(state);
}
开发者ID:MadReza,项目名称:RiskGame,代码行数:8,代码来源:GameManager.cpp

示例15: popState

void Game::changeState(GameState* state)
{
	if (!states.empty())
	{
		popState();
	}
	pushState(state);
}
开发者ID:LateXD,项目名称:LateTactics,代码行数:8,代码来源:Game.cpp


注:本文中的popState函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。