void Flow::show(spScene scene, const resultCallback& cb) { auto p = std::find(scenes.begin(), scenes.end(), scene); if (p != scenes.end()) log::error("you can't show scene '%s', it is already in the list", scene->getName().c_str()); OX_ASSERT(p == scenes.end()); scene->_resultCB = cb; scenes2show.push_back(scene); checkShow(); }
void Flow::update() { if (DebugActor::instance) { std::string str; for (size_t i = 1; i < scenes.size(); ++i) { str += scenes[i]->getName(); str += "->"; } if (!str.empty()) { str.pop_back(); str.pop_back(); str += "\n"; DebugActor::addDebugString(str.c_str()); } } bool quit = checkQuit(); static bool quitLast = false; if (quit && !quitLast) { _wasBackBlocked = true; } quitLast = quit; if (_transition) { if (_current->_transitionDone || (_trans && _trans->_done)) phaseEnd(); return; } checkDone(); if (!scenes2show.empty()) checkShow(); if (_transition) return; if (_wasBackBlocked && !scenes.empty()) { _wasBackBlocked = false; spScene current = scenes.back(); Event ev(Scene::EVENT_BACK); current->dispatchEvent(&ev); checkDone(); } }
qreal PdfElement::paint(QPainter *painter, const qint32 row, const qint32 maxrows) { PdfElementLine *_line; PdfElementCircle *_circle; PdfElementArc *_arc; PdfElementEllipse *_ellipse; PdfElementRectangle *_rectangle; PdfElementPolygon *_polygon; PdfElementText *_text; PdfElementImage *_image; qreal back = 0, bottom = 0; // Return if this Element-Group should not be printed if ((row > 0) && !checkShow(row, maxrows)) { return 0; } // Print all Elements in this group for (int i = 0; i < _nodes.size(); i++) { PdfElement e = _nodes.at(i); if ((row > 0) && !e.checkShow(row, maxrows)) { continue; } e.setVars(_variables, _repeating); e.setTop(_offsetY); switch (e.type()) { case PdfLine: _line = (PdfElementLine *)&e; back = _line->paint(painter); break; case PdfCircle: _circle = (PdfElementCircle *)&e; back = _circle->paint(painter); break; case PdfArc: _arc = (PdfElementArc *)&e; back = _arc->paint(painter); break; case PdfEllipse: _ellipse = (PdfElementEllipse *)&e; back = _ellipse->paint(painter); break; case PdfRectangle: _rectangle = (PdfElementRectangle *)&e; back = _rectangle->paint(painter); break; case PdfPolygon: _polygon = (PdfElementPolygon *)&e; back = _polygon->paint(painter); break; case PdfText: _text = (PdfElementText *)&e; back = _text->paint(painter); break; case PdfImage: _image = (PdfElementImage *)&e; back = _image->paint(painter); break; case PdfUnknown: default: back = 0; break; } bottom = back > bottom ? back : bottom; } return bottom + _offset; }