void FTVHelp::generateTree(QTextStream &t, const QList<FTVNode> &nl,int level) { QCString spaces; spaces.fill(' ',level*2+8); QListIterator<FTVNode> nli(nl); FTVNode *n; for (nli.toFirst();(n=nli.current());++nli) { t << spaces << "<p>"; generateIndent(t,n,0); if (n->isDir) { t << "<img " << FTV_IMGATTRIBS(folderclosed) << "onclick=\"toggleFolder('folder" << folderId << "', this)\"/>"; generateLink(t,n); t << "</p>\n"; t << spaces << "<div id=\"folder" << folderId << "\">\n"; folderId++; generateTree(t,n->children,level+1); t << spaces << "</div>\n"; } else { t << "<img " << FTV_IMGATTRIBS(doc) << "/>"; generateLink(t,n); t << "</p>\n"; } } }
void KPDFOutputDev::processLink( Link * link, Catalog * catalog ) { if ( !link->isOk() ) return; if ( m_generateLinks ) { // create the link descriptor KPDFLink * l = generateLink( link->getAction() ); if ( l ) { // create the page rect representing the link double x1, y1, x2, y2; link->getRect( &x1, &y1, &x2, &y2 ); int left, top, right, bottom; cvtUserToDev( x1, y1, &left, &top ); cvtUserToDev( x2, y2, &right, &bottom ); double nl = (double)left / (double)m_pixmapWidth, nt = (double)top / (double)m_pixmapHeight, nr = (double)right / (double)m_pixmapWidth, nb = (double)bottom / (double)m_pixmapHeight; // create the rect using normalized coords and attach the KPDFLink to it ObjectRect * rect = new ObjectRect( nl, nt, nr, nb, ObjectRect::Link, l ); // add the ObjectRect to the vector container m_rects.push_front( rect ); } } SplashOutputDev::processLink( link, catalog ); }
LinkDialog::LinkDialog(QTreeWidget *tree, QWidget *parent) : QDialog(parent), ui(new Ui::LinkDialog) { ui->setupUi(this); connect(this, SIGNAL(accepted()), SLOT(generateLink())); generateBasketList(tree, 0, 0); }
void generate(Type type, int resolution, int lodFactor_, bool leftLod, bool rightLod, bool upLod, bool downLod, unsigned char *clipBuffer) { faceAmount = 0; lodFactor = lodFactor_; int bufferSize = (resolution - 1) * (resolution - 1) * 6 * sizeof(short); indexBuffer.create((resolution - 1) * (resolution - 1) * 2, false); boost::scoped_array<unsigned short> tempBuffer(new unsigned short[bufferSize / sizeof(short)]); if(!tempBuffer) return; if(type == FullBuffer) generateCenter(tempBuffer.get(), resolution, clipBuffer); generateLink(tempBuffer.get(), resolution, leftLod, rightLod, upLod, downLod, clipBuffer); unsigned short *buffer = indexBuffer.lock(); memcpy(buffer, tempBuffer.get(), faceAmount * sizeof(short)); faceAmount /= 3; indexBuffer.unlock(); }
void generate(IndexStorage16& storage, Type type, int resolution, int lodFactor_, bool leftLod, bool rightLod, bool upLod, bool downLod, unsigned char *clipBuffer) { faceAmount = 0; lodFactor = lodFactor_; int idxCount = (resolution - 1) * (resolution - 1) * 6; allocId = storage.alloc(idxCount); if (!allocId) return; uint16_t* indices = storage.lock(allocId); if (type == FullBuffer) generateCenter(indices, resolution, clipBuffer); generateLink(indices, resolution, leftLod, rightLod, upLod, downLod, clipBuffer); storage.unlock(); faceAmount /= 3; baseIndex = storage.baseIndex(allocId); }
void FTVHelp::generateTree(FTextStream &t, const QList<FTVNode> &nl,int level,int maxLevel,int &index) { QListIterator<FTVNode> nli(nl); FTVNode *n; for (nli.toFirst(); (n=nli.current()); ++nli) { t << "<tr id=\"row_" << generateIndentLabel(n,0) << "\""; if ((index&1)==0) // even row t << " class=\"even\""; if (level>=maxLevel) // item invisible by default t << " style=\"display:none;\""; else // item visible by default index++; t << "><td class=\"entry\">"; bool nodeOpened = level+1<maxLevel; generateIndent(t,n,nodeOpened); if (n->isDir) { if (n->def && n->def->definitionType()==Definition::TypeGroup) { // no icon } else if (n->def && n->def->definitionType()==Definition::TypePage) { // no icon } else if (n->def && n->def->definitionType()==Definition::TypeNamespace) { t << "<span class=\"icona\"><span class=\"icon\">N</span></span>"; } else if (n->def && n->def->definitionType()==Definition::TypeClass) { t << "<span class=\"icona\"><span class=\"icon\">C</span></span>"; } else { t << "<span id=\"img_" << generateIndentLabel(n,0) << "\" class=\"iconf" << (nodeOpened?"open":"closed") << "\" onclick=\"toggleFolder('" << generateIndentLabel(n,0) << "')\"> </span>"; } generateLink(t,n); t << "</td><td class=\"desc\">"; if (n->def) { generateBriefDoc(t,n->def); } t << "</td></tr>" << endl; folderId++; generateTree(t,n->children,level+1,maxLevel,index); } else // leaf node { FileDef *srcRef=0; if (n->def && n->def->definitionType()==Definition::TypeFile && ((FileDef*)n->def)->generateSourceFile()) { srcRef = (FileDef*)n->def; } if (srcRef) { t << "<a href=\"" << srcRef->getSourceFileBase() << Doxygen::htmlFileExtension << "\">"; } if (n->def && n->def->definitionType()==Definition::TypeGroup) { // no icon } else if (n->def && n->def->definitionType()==Definition::TypePage) { // no icon } else if (n->def && n->def->definitionType()==Definition::TypeNamespace) { t << "<span class=\"icona\"><span class=\"icon\">N</span></span>"; } else if (n->def && n->def->definitionType()==Definition::TypeClass) { t << "<span class=\"icona\"><span class=\"icon\">C</span></span>"; } else { t << "<span class=\"icondoc\"></span>"; } if (srcRef) { t << "</a>"; } generateLink(t,n); t << "</td><td class=\"desc\">"; if (n->def) { generateBriefDoc(t,n->def); } t << "</td></tr>" << endl; } } }
void FTVHelp::generateTree(QTextStream &t, const QList<FTVNode *> &nl, int level, int maxLevel, int &index, enum PageType outputType) { static bool isStyleBB = Config::getBool("bb-style"); for (auto n : nl) { t << "<tr id=\"row_" << generateIndentLabel(n, 0) << "\""; if ((index & 1) == 0) { // even row t << " class=\"even\""; } if (level >= maxLevel) { // item invisible by default t << " style=\"display:none;\""; } else { // item visible by default index++; } t << "><td class=\"entry\">"; bool nodeOpened = level + 1 < maxLevel; generateIndent(t, n, nodeOpened); if (n->isDir) { if (n->def && n->def->definitionType() == Definition::TypeGroup) { // no icon } else if (n->def && n->def->definitionType() == Definition::TypePage) { // no icon } else if (n->def && n->def->definitionType() == Definition::TypeNamespace) { t << "<span class=\"icona\"><span class=\"icon\">N</span></span>"; } else if (n->def && n->def->definitionType() == Definition::TypeClass) { t << "<span class=\"icona\"><span class=\"icon\">C</span></span>"; } else { t << "<span id=\"img_" << generateIndentLabel(n, 0) << "\" class=\"iconf" << (nodeOpened ? "open" : "closed") << "\" onclick=\"toggleFolder('" << generateIndentLabel(n, 0) << "')\"> </span>"; } generateLink(t, n); t << "</td>"; if (isStyleBB && outputType == FTVHelp::Modules) { // modules.html only QString text = n->def->getDefFileName(); text = text.mid( text.lastIndexOf('/')+1 ); t << "<td class=\"hint\">"; t << text; t << "</td>"; } // brief description t << "<td class=\"desc\">"; if (n->def) { generateBriefDoc(t, n->def); } t << "</td></tr>" << endl; folderId++; generateTree(t, n->children, level + 1, maxLevel, index, outputType); } else { // leaf node QSharedPointer<FileDef> srcRef; if (n->def && n->def->definitionType() == Definition::TypeFile && (n->def.dynamicCast<FileDef>())->generateSourceFile()) { srcRef = n->def.dynamicCast<FileDef>(); } if (srcRef) { t << "<a href=\"" << srcRef->getSourceFileBase() << Doxy_Globals::htmlFileExtension << "\">"; } if (n->def && n->def->definitionType() == Definition::TypeGroup) { // no icon } else if (n->def && n->def->definitionType() == Definition::TypePage) { // no icon } else if (n->def && n->def->definitionType() == Definition::TypeNamespace) { t << "<span class=\"icona\"><span class=\"icon\">N</span></span>"; } else if (n->def && n->def->definitionType() == Definition::TypeClass) { t << "<span class=\"icona\"><span class=\"icon\">C</span></span>"; } else { t << "<span class=\"icondoc\"></span>"; } if (srcRef) { t << "</a>"; } generateLink(t, n); t << "</td>"; if (isStyleBB && outputType == FTVHelp::Modules) { // modules.html only QString text = n->def->getDefFileName(); text = text.mid( text.lastIndexOf('/')+1 ); t << "<td class=\"hint\">"; t << text; t << "</td>"; } // brief description t << "<td class=\"desc\">"; if (n->def) { generateBriefDoc(t, n->def); } t << "</td></tr>" << endl; } } }