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


C++ StyleBaseImpl类代码示例

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


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

示例1: assert

void CSSStyleSheetImpl::recomputeNamespaceInfo()
{
    assert(!m_namespaces);

    m_namespaces = new QList<CSSNamespaceRuleImpl *>;
    m_defaultNamespace = NamespaceName::fromId(anyNamespace);

    // Compute list of all the @namespace nodes, as well as the default one.
    for (int i = 0; i < m_lstChildren->count(); ++i) {
        StyleBaseImpl *b = m_lstChildren->at(i);
        if (b->isRule() && static_cast<CSSRuleImpl *>(b)->type() == DOM::CSSRule::NAMESPACE_RULE) {
            CSSNamespaceRuleImpl *nr = static_cast<CSSNamespaceRuleImpl *>(b);
            DOM::DOMString prefix = nr->prefix();
            DOM::DOMString uri    = nr->namespaceURI();

            if (uri.isNull()) {
                continue;
            }

            if (nr->isDefault()) {
                m_defaultNamespace = NamespaceName::fromString(uri);
            }

            m_namespaces->append(nr);
        }
    }
}
开发者ID:KDE,项目名称:khtml,代码行数:27,代码来源:css_stylesheetimpl.cpp

示例2: deleteRule

void CSSStyleSheetImpl::deleteRule(unsigned long index, int &exceptioncode)
{
    exceptioncode = 0;
    if (index + 1 > (unsigned) m_lstChildren->count()) {
        exceptioncode = DOMException::INDEX_SIZE_ERR;
        return;
    }
    StyleBaseImpl *b = m_lstChildren->takeAt(index);

    if (b->isRule() && static_cast<CSSRuleImpl *>(b)->type() == DOM::CSSRule::NAMESPACE_RULE) {
        dirtyNamespaceInfo();
        if (static_cast<CSSNamespaceRuleImpl *>(b)->isDefault()) {
            recomputeNamespaceInfo();    // default may have changed
        }
        // ### too late for some rules?
    }

    // TreeShared requires delete not deref when removed from tree
    b->setParent(0);
    if (!b->refCount()) {
        delete b;
    }
    if (m_doc) {
        m_doc->updateStyleSelector(true /*shallow*/);
    }
}
开发者ID:KDE,项目名称:khtml,代码行数:26,代码来源:css_stylesheetimpl.cpp

示例3: stylesheet

StyleSheetImpl* StyleBaseImpl::stylesheet()
{
    StyleBaseImpl* b = this;
    while(b && !b->isStyleSheet())
        b = b->m_parent;
    return static_cast<StyleSheetImpl *>(b);
}
开发者ID:vasi,项目名称:kdelibs,代码行数:7,代码来源:css_base.cpp

示例4: setNonCSSHints

void CSSStyleSheetImpl::setNonCSSHints()
{
    StyleBaseImpl *rule = m_lstChildren->first();
    while(rule) {
        if(rule->isStyleRule()) {
            static_cast<CSSStyleRuleImpl *>(rule)->setNonCSSHints();
        }
        rule = m_lstChildren->next();
    }
}
开发者ID:crutchwalkfactory,项目名称:motocakerteam,代码行数:10,代码来源:css_stylesheetimpl.cpp

示例5: deleteRule

void CSSStyleSheetImpl::deleteRule( unsigned long index, int &exceptioncode )
{
    exceptioncode = 0;
    StyleBaseImpl *b = m_lstChildren->take(index);
    if(!b) {
        exceptioncode = DOMException::INDEX_SIZE_ERR;
        return;
    }
    b->deref();
}
开发者ID:crutchwalkfactory,项目名称:motocakerteam,代码行数:10,代码来源:css_stylesheetimpl.cpp

示例6:

StyleListImpl::~StyleListImpl()
{
    StyleBaseImpl *n;

    if(!m_lstChildren) return;

    for( n = m_lstChildren->first(); n != 0; n = m_lstChildren->next() )
    {
        n->setParent(0);
        if( !n->refCount() ) delete n;
    }
    delete m_lstChildren;
}
开发者ID:Fat-Zer,项目名称:tdelibs,代码行数:13,代码来源:css_base.cpp

示例7: StyleSheetImpl

CSSStyleSheetImpl::CSSStyleSheetImpl(CSSRuleImpl *ownerRule, CSSStyleSheetImpl *orig)
    : StyleSheetImpl(ownerRule, orig->m_strHref)
{
    m_lstChildren = new QPtrList<StyleBaseImpl>;
    StyleBaseImpl *rule;
    for ( rule = orig->m_lstChildren->first(); rule != 0; rule = orig->m_lstChildren->next() )
    {
        m_lstChildren->append(rule);
        rule->setParent(this);
    }
    m_doc  = 0;
    m_implicit = false;
}
开发者ID:crutchwalkfactory,项目名称:motocakerteam,代码行数:13,代码来源:css_stylesheetimpl.cpp

示例8:

CSSRuleList::CSSRuleList(StyleListImpl *lst)
{
    impl = new CSSRuleListImpl;
    impl->ref();
    if (lst)
    {
        for( unsigned long i = 0; i < lst->length() ; ++i )
        {
            StyleBaseImpl* style = lst->item( i );
            if ( style->isRule() )
                impl->insertRule( static_cast<CSSRuleImpl *>(style), impl->length() );
        }
    }
}
开发者ID:Fat-Zer,项目名称:tdelibs,代码行数:14,代码来源:css_rule.cpp

示例9: setChanged

void CSSStyleDeclarationImpl::setChanged()
{
    if (m_node) {
        m_node->setChanged();
        return;
    }

    // ### quick&dirty hack for KDE 3.0... make this MUCH better! (Dirk)
    for (StyleBaseImpl* stylesheet = this; stylesheet; stylesheet = stylesheet->parent())
        if (stylesheet->isCSSStyleSheet()) {
            static_cast<CSSStyleSheetImpl*>(stylesheet)->doc()->updateStyleSelector();
            break;
        }
}
开发者ID:crutchwalkfactory,项目名称:motocakerteam,代码行数:14,代码来源:css_valueimpl.cpp

示例10: it

StyleListImpl::~StyleListImpl()
{
    StyleBaseImpl *n;

    if(!m_lstChildren) return;

    QListIterator<StyleBaseImpl*> it( *m_lstChildren );
    while ( it.hasNext() )
    {
        n = it.next();
        n->setParent(0);
        if( !n->refCount() ) delete n;
    }
    delete m_lstChildren;
}
开发者ID:vasi,项目名称:kdelibs,代码行数:15,代码来源:css_base.cpp

示例11: CSSPrimitiveValueImpl

CSSImageValueImpl::CSSImageValueImpl(const DOMString &url, const DOMString &baseurl, StyleBaseImpl *style)
    : CSSPrimitiveValueImpl(url, CSSPrimitiveValue::CSS_URI)
{
    khtml::DocLoader *docLoader = 0;
    StyleBaseImpl *root = style;
    while (root->parent())
	root = root->parent();
    if (root->isCSSStyleSheet())
	docLoader = static_cast<CSSStyleSheetImpl*>(root)->docLoader();

    if (docLoader)
	m_image = docLoader->requestImage(url, baseurl);
    else
	m_image = khtml::Cache::requestImage(url, baseurl);

    if(m_image) m_image->ref(this);
}
开发者ID:BackupTheBerlios,项目名称:nirvana-svn,代码行数:17,代码来源:css_valueimpl.cpp

示例12: StyleSheetImpl

CSSStyleSheetImpl::CSSStyleSheetImpl(DOM::NodeImpl *parentNode, CSSStyleSheetImpl *orig)
    : StyleSheetImpl(parentNode, orig->m_strHref)
{
    m_lstChildren = new QList<StyleBaseImpl *>;
    StyleBaseImpl *rule;
    QListIterator<StyleBaseImpl *> it(*orig->m_lstChildren);
    while (it.hasNext()) {
        rule = it.next();
        m_lstChildren->append(rule);
        rule->setParent(this);
    }
    m_doc = parentNode->document();
    m_implicit = false;
    m_namespaces = 0;
    m_defaultNamespace = NamespaceName::fromId(anyNamespace);
    m_loadedHint = false;

    recomputeNamespaceInfo(); // as we cloned kids
}
开发者ID:KDE,项目名称:khtml,代码行数:19,代码来源:css_stylesheetimpl.cpp

示例13: isLoading

bool CSSStyleSheetImpl::isLoading()
{
    StyleBaseImpl *rule;
    for ( rule = m_lstChildren->first(); rule != 0; rule = m_lstChildren->next() )
    {
        if(rule->isImportRule())
        {
            CSSImportRuleImpl *import = static_cast<CSSImportRuleImpl *>(rule);
#ifdef CSS_STYLESHEET_DEBUG
            kdDebug( 6080 ) << "found import" << endl;
#endif
            if(import->isLoading())
            {
#ifdef CSS_STYLESHEET_DEBUG
                kdDebug( 6080 ) << "--> not loaded" << endl;
#endif
                return true;
            }
        }
    }
    return false;
}
开发者ID:crutchwalkfactory,项目名称:motocakerteam,代码行数:22,代码来源:css_stylesheetimpl.cpp

示例14: it

bool CSSStyleSheetImpl::isLoading() const
{
    StyleBaseImpl *rule;
    QListIterator<StyleBaseImpl *> it(*m_lstChildren);
    while (it.hasNext()) {
        rule = it.next();
        if (rule->isImportRule()) {
            CSSImportRuleImpl *import = static_cast<CSSImportRuleImpl *>(rule);
#ifdef CSS_STYLESHEET_DEBUG
            qDebug() << "found import";
#endif
            if (import->isLoading()) {
#ifdef CSS_STYLESHEET_DEBUG
                qDebug() << "--> not loaded";
#endif
                m_loadedHint = false;
                return true;
            }
        }
    }
    m_loadedHint = true;
    return false;
}
开发者ID:KDE,项目名称:khtml,代码行数:23,代码来源:css_stylesheetimpl.cpp


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