本文整理汇总了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();
}
示例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));
}
示例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;
}
示例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>();
}
示例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);
}
示例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);
}
示例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>();
}
示例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;
}
示例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>();
}
示例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;
}
示例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;
}
示例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;
}
示例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());
}