• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ popState函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: popState

void StateManager::popAllStates()
{
	if (!states.empty())
	{
		popState();
		popAllStates();
	}
}
开发者ID:imaginationac,项目名称:Aquaria,代码行数:8,代码来源:StateManager.cpp


示例17: popState

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


示例18: Turnstile_pop_state

void Turnstile_pop_state(Context* ctxt) {
    SatsukiKeyboard *keyboard = reinterpret_cast<SatsukiKeyboard*>(ctxt);
    printf("pop state!!!!!!!!!\n");
    popState(&(keyboard->mSatsukiContext));
    if ((keyboard->mSatsukiContext._state)->Exit != NULL) {
        (keyboard->mSatsukiContext._state)->Exit(&keyboard->mSatsukiContext);
    }
};
开发者ID:ryoqun,项目名称:SatsukiKeyboard,代码行数:8,代码来源:engine.cpp


示例19: while

/**
 * Pops all the states currently in stack and pushes in the new state.
 * A shortcut for cleaning up all the old states when they're not necessary
 * like in one-way transitions.
 * @param state Pointer to the new state.
 */
void Game::setState(State *state)
{
	while (!_states.empty())
	{
		popState();
	}
	pushState(state);
	_init = false;
}
开发者ID:oculushut,项目名称:OpenXcom,代码行数:15,代码来源:Game.cpp


示例20: while

//TODO: this destroys the stack if you try to pop to a state not in it, should just use a list instead of a stack
void StateManager::popToState(GameState *state) {
    while (state != activeState()) {
        if (_states.empty()) {                
            throw std::runtime_error("Can't pop to state not in the stack.");
        } else {
            popState();
        }
    }
}
开发者ID:danset,项目名称:sfml-playground,代码行数:10,代码来源:StateManager.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ port_to_gser函数代码示例发布时间:2022-05-31
下一篇:
C++ popFrame函数代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap