Example #1
0
static int PTRCALL
declClose(PROLOG_STATE *state,
          int tok,
          const char *ptr,
          const char *end,
          const ENCODING *enc)
{
  switch (tok) {
  case XML_TOK_PROLOG_S:
    return state->role_none;
  case XML_TOK_DECL_CLOSE:
    setTopLevel(state);
    return state->role_none;
  }
  return common(state, tok);
}
Example #2
0
static
int declClose(PROLOG_STATE *state,
	      int tok,
	      const char *ptr,
	      const char *end,
	      const ENCODING *enc)
{
  switch (tok) {
  case XML_TOK_PROLOG_S:
    return XML_ROLE_NONE;
  case XML_TOK_DECL_CLOSE:
    setTopLevel(state);
    return XML_ROLE_NONE;
  }
  return common(state, tok);
}
Example #3
0
static int PTRCALL
entity10(PROLOG_STATE *state,
         int tok,
         const char *ptr,
         const char *end,
         const ENCODING *enc)
{
  switch (tok) {
  case XML_TOK_PROLOG_S:
    return XML_ROLE_ENTITY_NONE;
  case XML_TOK_DECL_CLOSE:
    setTopLevel(state);
    return XML_ROLE_ENTITY_COMPLETE;
  }
  return common(state, tok);
}
Example #4
0
void Menu::rebuildMenu() {
	_controller->clear();
	if (!_menu) {
		return;
	}

	auto &menuItems = _menu->getItems();
	for (auto &item : menuItems) {
		if (item->getType() == MenuSourceItem::Type::Separator) {
			_controller->addItem([this, item] (const ScrollController::Item &) -> cocos2d::Node * {
				auto div = createSeparator();
				div->setTopLevel(false);
				div->setMenuSourceItem(item);
				div->setMenu(this);
				return div;
			}, metrics::menuVerticalPadding(_metrics));
		} else if (item->getType() == MenuSourceItem::Type::Button) {
			_controller->addItem([this, item] (const ScrollController::Item &) -> cocos2d::Node * {
				auto btn = createButton();
				btn->setMenu(this);
				btn->setMenuSourceItem(item);
				return btn;
			}, metrics::menuItemHeight(_metrics));
		} else if (item->getType() == MenuSourceItem::Type::Custom) {
			auto customItem = static_cast<MenuSourceCustom *>(item);
			auto func = customItem->getFactoryFunction();
			if (func) {
				float height = customItem->getHeight();
				if (customItem->isRelativeHeight()) {
					height = _contentSize.width * height;
				}
				_controller->addItem([this, func, item] (const ScrollController::Item &) -> cocos2d::Node * {
					auto node = func();
					if (auto i = dynamic_cast<MenuItemInterface *>(node)) {
						i->setMenu(this);
						i->setMenuSourceItem(item);
					}
					return node;
				}, height);
			}
		}
	}
	_scroll->setScrollDirty(true);
}
Example #5
0
static
int notation4(PROLOG_STATE *state,
	      int tok,
	      const char *ptr,
	      const char *end,
	      const ENCODING *enc)
{
  switch (tok) {
  case XML_TOK_PROLOG_S:
    return XML_ROLE_NONE;
  case XML_TOK_LITERAL:
    state->handler = declClose;
    return XML_ROLE_NOTATION_SYSTEM_ID;
  case XML_TOK_DECL_CLOSE:
    setTopLevel(state);
    return XML_ROLE_NOTATION_NO_SYSTEM_ID;
  }
  return common(state, tok);
}
Example #6
0
static int PTRCALL
attlist1(PROLOG_STATE *state,
         int tok,
         const char *ptr,
         const char *end,
         const ENCODING *enc)
{
  switch (tok) {
  case XML_TOK_PROLOG_S:
    return XML_ROLE_ATTLIST_NONE;
  case XML_TOK_DECL_CLOSE:
    setTopLevel(state);
    return XML_ROLE_ATTLIST_NONE;
  case XML_TOK_NAME:
  case XML_TOK_PREFIXED_NAME:
    state->handler = attlist2;
    return XML_ROLE_ATTRIBUTE_NAME;
  }
  return common(state, tok);
}
Example #7
0
static int PTRCALL
notation4(PROLOG_STATE *state,
          int tok,
          const char *UNUSED_P(ptr),
          const char *UNUSED_P(end),
          const ENCODING *UNUSED_P(enc))
{
  switch (tok) {
  case XML_TOK_PROLOG_S:
    return XML_ROLE_NOTATION_NONE;
  case XML_TOK_LITERAL:
    state->handler = declClose;
    state->role_none = XML_ROLE_NOTATION_NONE;
    return XML_ROLE_NOTATION_SYSTEM_ID;
  case XML_TOK_DECL_CLOSE:
    setTopLevel(state);
    return XML_ROLE_NOTATION_NO_SYSTEM_ID;
  }
  return common(state, tok);
}
Example #8
0
static int PTRCALL
entity5(PROLOG_STATE *state,
        int tok,
        const char *ptr,
        const char *end,
        const ENCODING *enc)
{
  switch (tok) {
  case XML_TOK_PROLOG_S:
    return XML_ROLE_ENTITY_NONE;
  case XML_TOK_DECL_CLOSE:
    setTopLevel(state);
    return XML_ROLE_ENTITY_COMPLETE;
  case XML_TOK_NAME:
    if (XmlNameMatchesAscii(enc, ptr, end, KW_NDATA)) {
      state->handler = entity6;
      return XML_ROLE_ENTITY_NONE;
    }
    break;
  }
  return common(state, tok);
}
void ReceiveQuestion::exec()
{
    setTopLevel();
    timer->start(1000);
    QDialog::exec();
}