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


C++ SVGPathSegList类代码示例

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


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

示例1: impl

JSValue JSSVGPathSegList::clear(ExecState* exec, const ArgList&)
{
    ExceptionCode ec = 0;

    SVGPathSegList* list = impl();
    list->clear(ec);

    setDOMException(exec, ec);

    JSSVGContextCache::propagateSVGDOMChange(this, list->associatedAttributeName());
    return jsUndefined();
}
开发者ID:flwh,项目名称:Alcatel_OT_985_kernel,代码行数:12,代码来源:JSSVGPathSegListCustom.cpp

示例2: ASSERT

PassRefPtr<PathSVGInterpolation> PathSVGInterpolation::maybeCreate(SVGPropertyBase* start, SVGPropertyBase* end, PassRefPtrWillBeRawPtr<SVGAnimatedPropertyBase> attribute)
{
    ASSERT(start->type() == SVGPathSegList::classType());
    ASSERT(end->type() == SVGPathSegList::classType());

    SVGPathSegList* startList = static_cast<SVGPathSegList*>(start);
    SVGPathSegList* endList = static_cast<SVGPathSegList*>(end);
    size_t length = startList->length();
    if (length != endList->length())
        return nullptr;

    Vector<SVGPathSegType> pathSegTypes(length);
    OwnPtr<InterpolableList> startValue = InterpolableList::create(length);
    OwnPtr<InterpolableList> endValue = InterpolableList::create(length);
    SubPathCoordinates startCoordinates;
    SubPathCoordinates endCoordinates;
    for (size_t i = 0; i < length; i++) {
        if (absolutePathSegType(*startList->at(i)) != absolutePathSegType(*endList->at(i)))
            return nullptr;

        // Like Firefox SMIL, we use the final path seg type.
        startValue->set(i, pathSegToInterpolableValue(*startList->at(i), startCoordinates, nullptr));
        endValue->set(i, pathSegToInterpolableValue(*endList->at(i), endCoordinates, &pathSegTypes.at(i)));
    }

    return adoptRef(new PathSVGInterpolation(startValue.release(), endValue.release(), attribute, pathSegTypes));
}
开发者ID:OctiumBrowser,项目名称:octium-main,代码行数:27,代码来源:PathSVGInterpolation.cpp

示例3: toSVGPathSeg

JSValue JSSVGPathSegList::appendItem(ExecState* exec, const ArgList& args)
{
    ExceptionCode ec = 0;
    SVGPathSeg* newItem = toSVGPathSeg(args.at(0));

    SVGPathSegList* list = impl();
    SVGElement* context = JSSVGContextCache::svgContextForDOMObject(this);

    JSValue result = toJS(exec, globalObject(), WTF::getPtr(list->appendItem(newItem, ec)), context);
    setDOMException(exec, ec);

    JSSVGContextCache::propagateSVGDOMChange(this, list->associatedAttributeName());
    return result;
}
开发者ID:flwh,项目名称:Alcatel_OT_985_kernel,代码行数:14,代码来源:JSSVGPathSegListCustom.cpp

示例4: clearCallback

static v8::Handle<v8::Value> clearCallback(const v8::Arguments& args)
{
    INC_STATS("DOM.SVGPathSegList.clear");
    SVGPathSegList* imp = V8SVGPathSegList::toNative(args.Holder());
    ExceptionCode ec = 0;
    {
    imp->clear(ec);
    if (UNLIKELY(ec))
        goto fail;
    SVGElement* context = V8Proxy::svgContext(imp);
    context->svgAttributeChanged(imp->associatedAttributeName());
    return v8::Handle<v8::Value>();
    }
    fail:
    V8Proxy::setDOMException(ec);
    return v8::Handle<v8::Value>();
}
开发者ID:Treeeater,项目名称:chrome_bindings,代码行数:17,代码来源:V8SVGPathSegList.cpp

示例5: buildSVGPathByteStreamFromSVGPathSegList

bool buildSVGPathByteStreamFromSVGPathSegList(const SVGPathSegList& list, SVGPathByteStream& result, PathParsingMode parsingMode)
{
    result.clear();
    if (list.isEmpty())
        return true;

    SVGPathSegListSource source(list);
    return SVGPathParser::parseToByteStream(source, result, parsingMode);
}
开发者ID:Comcast,项目名称:WebKitForWayland,代码行数:9,代码来源:SVGPathUtilities.cpp

示例6: buildStringFromSVGPathSegList

bool buildStringFromSVGPathSegList(const SVGPathSegList& list, String& result, PathParsingMode parsingMode)
{
    result = String();
    if (list.isEmpty())
        return true;

    SVGPathSegListSource source(list);
    return SVGPathParser::parseToString(source, result, parsingMode);
}
开发者ID:Comcast,项目名称:WebKitForWayland,代码行数:9,代码来源:SVGPathUtilities.cpp

示例7: getItemCallback

static v8::Handle<v8::Value> getItemCallback(const v8::Arguments& args)
{
    INC_STATS("DOM.SVGPathSegList.getItem");
    SVGPathSegList* imp = V8SVGPathSegList::toNative(args.Holder());
    ExceptionCode ec = 0;
    {
    EXCEPTION_BLOCK(unsigned, index, toUInt32(args[0]));
    RefPtr<SVGPathSeg> result = imp->getItem(index, ec);
    if (UNLIKELY(ec))
        goto fail;
    SVGElement* context = V8Proxy::svgContext(imp);
    V8Proxy::setSVGContext(result.get(), context);
    return toV8(result.release());
    }
    fail:
    V8Proxy::setDOMException(ec);
    return v8::Handle<v8::Value>();
}
开发者ID:Treeeater,项目名称:chrome_bindings,代码行数:18,代码来源:V8SVGPathSegList.cpp

示例8: setDOMException

JSValue JSSVGPathSegList::getItem(ExecState* exec, const ArgList& args)
{
    ExceptionCode ec = 0;

    bool indexOk;
    unsigned index = args.at(0).toInt32(exec, indexOk);
    if (!indexOk) {
        setDOMException(exec, TYPE_MISMATCH_ERR);
        return jsUndefined();
    }

    SVGPathSegList* list = impl();
    SVGPathSeg* obj = WTF::getPtr(list->getItem(index, ec));
    SVGElement* context = JSSVGContextCache::svgContextForDOMObject(this);

    JSValue result = toJS(exec, globalObject(), obj, context);
    setDOMException(exec, ec);
    return result;
}
开发者ID:flwh,项目名称:Alcatel_OT_985_kernel,代码行数:19,代码来源:JSSVGPathSegListCustom.cpp

示例9: initializeCallback

static v8::Handle<v8::Value> initializeCallback(const v8::Arguments& args)
{
    INC_STATS("DOM.SVGPathSegList.initialize");
    SVGPathSegList* imp = V8SVGPathSegList::toNative(args.Holder());
    ExceptionCode ec = 0;
    {
    EXCEPTION_BLOCK(SVGPathSeg*, newItem, V8SVGPathSeg::HasInstance(args[0]) ? V8SVGPathSeg::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0);
    RefPtr<SVGPathSeg> result = imp->initialize(newItem, ec);
    if (UNLIKELY(ec))
        goto fail;
    SVGElement* context = V8Proxy::svgContext(imp);
    V8Proxy::setSVGContext(result.get(), context);
    context->svgAttributeChanged(imp->associatedAttributeName());
    return toV8(result.release());
    }
    fail:
    V8Proxy::setDOMException(ec);
    return v8::Handle<v8::Value>();
}
开发者ID:Treeeater,项目名称:chrome_bindings,代码行数:19,代码来源:V8SVGPathSegList.cpp

示例10: buildStringFromSVGPathSegList

bool buildStringFromSVGPathSegList(const SVGPathSegList& list, String& result, PathParsingMode parsingMode)
{
    result = String();
    if (list.isEmpty())
        return true;

    SVGPathStringBuilder* builder = globalSVGPathStringBuilder();

    auto source = std::make_unique<SVGPathSegListSource>(list);
    SVGPathParser* parser = globalSVGPathParser(source.get(), builder);
    bool ok = parser->parsePathDataFromSource(parsingMode);
    result = builder->result();
    parser->cleanup();
    return ok;
}
开发者ID:clbr,项目名称:webkitfltk,代码行数:15,代码来源:SVGPathUtilities.cpp

示例11: buildSVGPathByteStreamFromSVGPathSegList

bool buildSVGPathByteStreamFromSVGPathSegList(const SVGPathSegList& list, SVGPathByteStream* result, PathParsingMode parsingMode)
{
    ASSERT(result);
    result->clear();
    if (list.isEmpty())
        return true;

    SVGPathByteStreamBuilder* builder = globalSVGPathByteStreamBuilder(result);

    auto source = std::make_unique<SVGPathSegListSource>(list);
    SVGPathParser* parser = globalSVGPathParser(source.get(), builder);
    bool ok = parser->parsePathDataFromSource(parsingMode);
    parser->cleanup();
    return ok;
}
开发者ID:clbr,项目名称:webkitfltk,代码行数:15,代码来源:SVGPathUtilities.cpp

示例12: buildStringFromSVGPathSegList

bool buildStringFromSVGPathSegList(const SVGPathSegList& list, String& result, PathParsingMode parsingMode)
{
    result = String();
    if (list.isEmpty())
        return false;

    SVGPathStringBuilder* builder = globalSVGPathStringBuilder();

    OwnPtr<SVGPathSegListSource> source = SVGPathSegListSource::create(list);
    SVGPathParser* parser = globalSVGPathParser(source.get(), builder);
    bool ok = parser->parsePathDataFromSource(parsingMode);
    result = builder->result();
    parser->cleanup();
    return ok;
}
开发者ID:Tkkg1994,项目名称:Platfrom-kccat6,代码行数:15,代码来源:SVGPathUtilities.cpp

示例13: numberOfItemsAttrGetter

static v8::Handle<v8::Value> numberOfItemsAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    INC_STATS("DOM.SVGPathSegList.numberOfItems._get");
    SVGPathSegList* imp = V8SVGPathSegList::toNative(info.Holder());
    return v8::Integer::NewFromUnsigned(imp->numberOfItems());
}
开发者ID:Treeeater,项目名称:chrome_bindings,代码行数:6,代码来源:V8SVGPathSegList.cpp


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