本文整理汇总了C++中SVGPathElement类的典型用法代码示例。如果您正苦于以下问题:C++ SVGPathElement类的具体用法?C++ SVGPathElement怎么用?C++ SVGPathElement使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SVGPathElement类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createSVGPathSegCurvetoQuadraticSmoothRelCallback
static v8::Handle<v8::Value> createSVGPathSegCurvetoQuadraticSmoothRelCallback(const v8::Arguments& args)
{
SVGPathElement* imp = V8SVGPathElement::toNative(args.Holder());
V8TRYCATCH(float, x, static_cast<float>(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)->NumberValue()));
V8TRYCATCH(float, y, static_cast<float>(MAYBE_MISSING_PARAMETER(args, 1, DefaultIsUndefined)->NumberValue()));
return toV8Fast(imp->createSVGPathSegCurvetoQuadraticSmoothRel(x, y), args, imp);
}
示例2: xmlspaceAttrSetter
static void xmlspaceAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
SVGPathElement* imp = V8SVGPathElement::toNative(info.Holder());
V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, v, value);
imp->setXmlspace(v);
return;
}
示例3: createSVGPathSegCurvetoCubicAbsCallback
static v8::Handle<v8::Value> createSVGPathSegCurvetoCubicAbsCallback(const v8::Arguments& args)
{
SVGPathElement* imp = V8SVGPathElement::toNative(args.Holder());
V8TRYCATCH(float, x, static_cast<float>(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)->NumberValue()));
V8TRYCATCH(float, y, static_cast<float>(MAYBE_MISSING_PARAMETER(args, 1, DefaultIsUndefined)->NumberValue()));
V8TRYCATCH(float, x1, static_cast<float>(MAYBE_MISSING_PARAMETER(args, 2, DefaultIsUndefined)->NumberValue()));
V8TRYCATCH(float, y1, static_cast<float>(MAYBE_MISSING_PARAMETER(args, 3, DefaultIsUndefined)->NumberValue()));
V8TRYCATCH(float, x2, static_cast<float>(MAYBE_MISSING_PARAMETER(args, 4, DefaultIsUndefined)->NumberValue()));
V8TRYCATCH(float, y2, static_cast<float>(MAYBE_MISSING_PARAMETER(args, 5, DefaultIsUndefined)->NumberValue()));
return toV8Fast(imp->createSVGPathSegCurvetoCubicAbs(x, y, x1, y1, x2, y2), args, imp);
}
示例4: createSVGPathSegArcRelCallback
static v8::Handle<v8::Value> createSVGPathSegArcRelCallback(const v8::Arguments& args)
{
SVGPathElement* imp = V8SVGPathElement::toNative(args.Holder());
V8TRYCATCH(float, x, static_cast<float>(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)->NumberValue()));
V8TRYCATCH(float, y, static_cast<float>(MAYBE_MISSING_PARAMETER(args, 1, DefaultIsUndefined)->NumberValue()));
V8TRYCATCH(float, r1, static_cast<float>(MAYBE_MISSING_PARAMETER(args, 2, DefaultIsUndefined)->NumberValue()));
V8TRYCATCH(float, r2, static_cast<float>(MAYBE_MISSING_PARAMETER(args, 3, DefaultIsUndefined)->NumberValue()));
V8TRYCATCH(float, angle, static_cast<float>(MAYBE_MISSING_PARAMETER(args, 4, DefaultIsUndefined)->NumberValue()));
V8TRYCATCH(bool, largeArcFlag, MAYBE_MISSING_PARAMETER(args, 5, DefaultIsUndefined)->BooleanValue());
V8TRYCATCH(bool, sweepFlag, MAYBE_MISSING_PARAMETER(args, 6, DefaultIsUndefined)->BooleanValue());
return toV8Fast(imp->createSVGPathSegArcRel(x, y, r1, r2, angle, largeArcFlag, sweepFlag), args, imp);
}
示例5: getTransformToElementCallback
static v8::Handle<v8::Value> getTransformToElementCallback(const v8::Arguments& args)
{
SVGPathElement* imp = V8SVGPathElement::toNative(args.Holder());
ExceptionCode ec = 0;
{
V8TRYCATCH(SVGElement*, element, V8SVGElement::HasInstance(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)) ? V8SVGElement::toNative(v8::Handle<v8::Object>::Cast(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined))) : 0);
SVGMatrix result = imp->getTransformToElement(element, ec);
if (UNLIKELY(ec))
goto fail;
return toV8Fast(WTF::getPtr(SVGPropertyTearOff<SVGMatrix>::create(result)), args, imp);
}
fail:
return setDOMException(ec, args.GetIsolate());
}
示例6: animationPath
Path SVGAnimateMotionElement::animationPath()
{
for (Node* child = firstChild(); child; child->nextSibling()) {
if (child->hasTagName(SVGNames::mpathTag)) {
SVGMPathElement* mPath = static_cast<SVGMPathElement*>(child);
SVGPathElement* pathElement = mPath->pathElement();
if (pathElement)
return pathElement->toPathData();
// The spec would probably have us throw up an error here, but instead we try to fall back to the d value
}
}
if (hasAttribute(SVGNames::dAttr))
return m_path;
return Path();
}
示例7: animationPath
Path SVGAnimateMotionElement::animationPath() const
{
for (Node* child = firstChild(); child; child = child->nextSibling()) {
if (child->hasTagName(SVGNames::mpathTag)) {
SVGMPathElement* mPath = static_cast<SVGMPathElement*>(child);
SVGPathElement* pathElement = mPath->pathElement();
Path path;
if (pathElement)
pathElement->toPathData(path);
return path;
}
}
if (hasAttribute(SVGNames::pathAttr))
return m_path;
return Path();
}
示例8: switch
void JSSVGPathElement::putValueProperty(ExecState* exec, int token, JSValue* value, int /*attr*/)
{
switch (token) {
case XmllangAttrNum: {
SVGPathElement* imp = static_cast<SVGPathElement*>(impl());
imp->setXmllang(value->toString(exec));
break;
}
case XmlspaceAttrNum: {
SVGPathElement* imp = static_cast<SVGPathElement*>(impl());
imp->setXmlspace(value->toString(exec));
break;
}
}
}
示例9: writePositionAndStyle
static TextStream& operator<<(TextStream& ts, const RenderSVGShape& shape)
{
writePositionAndStyle(ts, shape);
ASSERT(shape.node()->isSVGElement());
SVGElement* svgElement = toSVGElement(shape.node());
SVGLengthContext lengthContext(svgElement);
if (svgElement->hasTagName(SVGNames::rectTag)) {
SVGRectElement* element = static_cast<SVGRectElement*>(svgElement);
writeNameValuePair(ts, "x", element->x().value(lengthContext));
writeNameValuePair(ts, "y", element->y().value(lengthContext));
writeNameValuePair(ts, "width", element->width().value(lengthContext));
writeNameValuePair(ts, "height", element->height().value(lengthContext));
} else if (svgElement->hasTagName(SVGNames::lineTag)) {
SVGLineElement* element = static_cast<SVGLineElement*>(svgElement);
writeNameValuePair(ts, "x1", element->x1().value(lengthContext));
writeNameValuePair(ts, "y1", element->y1().value(lengthContext));
writeNameValuePair(ts, "x2", element->x2().value(lengthContext));
writeNameValuePair(ts, "y2", element->y2().value(lengthContext));
} else if (svgElement->hasTagName(SVGNames::ellipseTag)) {
SVGEllipseElement* element = static_cast<SVGEllipseElement*>(svgElement);
writeNameValuePair(ts, "cx", element->cx().value(lengthContext));
writeNameValuePair(ts, "cy", element->cy().value(lengthContext));
writeNameValuePair(ts, "rx", element->rx().value(lengthContext));
writeNameValuePair(ts, "ry", element->ry().value(lengthContext));
} else if (svgElement->hasTagName(SVGNames::circleTag)) {
SVGCircleElement* element = static_cast<SVGCircleElement*>(svgElement);
writeNameValuePair(ts, "cx", element->cx().value(lengthContext));
writeNameValuePair(ts, "cy", element->cy().value(lengthContext));
writeNameValuePair(ts, "r", element->r().value(lengthContext));
} else if (svgElement->hasTagName(SVGNames::polygonTag) || svgElement->hasTagName(SVGNames::polylineTag)) {
SVGPolyElement* element = static_cast<SVGPolyElement*>(svgElement);
writeNameAndQuotedValue(ts, "points", element->pointList().valueAsString());
} else if (svgElement->hasTagName(SVGNames::pathTag)) {
SVGPathElement* element = toSVGPathElement(svgElement);
String pathString;
// FIXME: We should switch to UnalteredParsing here - this will affect the path dumping output of dozens of tests.
buildStringFromByteStream(element->pathByteStream(), pathString, NormalizedParsing);
writeNameAndQuotedValue(ts, "data", pathString);
} else
ASSERT_NOT_REACHED();
return ts;
}
示例10: RebuildPathAndVerticesFromMpathElem
void SVGMotionSMILAnimationFunction::RebuildPathAndVerticesFromMpathElem(
SVGMPathElement* aMpathElem) {
mPathSourceType = ePathSourceType_Mpath;
// Use the path that's the target of our chosen <mpath> child.
SVGPathElement* pathElem = aMpathElem->GetReferencedPath();
if (pathElem) {
const SVGPathData& path = pathElem->GetAnimPathSegList()->GetAnimValue();
// Path data must contain of at least one path segment (if the path data
// doesn't begin with a valid "M", then it's invalid).
if (path.Length()) {
bool ok =
path.GetDistancesFromOriginToEndsOfVisibleSegments(&mPathVertices);
if (ok && mPathVertices.Length()) {
mPath = pathElem->GetOrBuildPathForMeasuring();
}
}
}
}
示例11: Path
Path RenderSVGTextPath::layoutPath() const
{
SVGTextPathElement* textPathElement = static_cast<SVGTextPathElement*>(element());
String pathId = SVGURIReference::getTarget(textPathElement->href());
Element* targetElement = textPathElement->document()->getElementById(pathId);
if (!targetElement || !targetElement->hasTagName(SVGNames::pathTag))
return Path();
SVGPathElement* pathElement = static_cast<SVGPathElement*>(targetElement);
Path pathData = pathElement->toPathData();
// Spec: The transform attribute on the referenced 'path' element represents a
// supplemental transformation relative to the current user coordinate system for
// the current 'text' element, including any adjustments to the current user coordinate
// system due to a possible transform attribute on the current 'text' element.
// http://www.w3.org/TR/SVG/text.html#TextPathElement
pathData.transform(pathElement->animatedLocalTransform());
return pathData;
}
示例12: getPresentationAttributeCallback
static v8::Handle<v8::Value> getPresentationAttributeCallback(const v8::Arguments& args)
{
SVGPathElement* imp = V8SVGPathElement::toNative(args.Holder());
V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, name, MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined));
return toV8Fast(imp->getPresentationAttribute(name), args, imp);
}
示例13: getPointAtLengthCallback
static v8::Handle<v8::Value> getPointAtLengthCallback(const v8::Arguments& args)
{
SVGPathElement* imp = V8SVGPathElement::toNative(args.Holder());
V8TRYCATCH(float, distance, static_cast<float>(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)->NumberValue()));
return toV8Fast(WTF::getPtr(SVGPropertyTearOff<FloatPoint>::create(imp->getPointAtLength(distance))), args, imp);
}
示例14: pathSegListAttrGetter
static v8::Handle<v8::Value> pathSegListAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
SVGPathElement* imp = V8SVGPathElement::toNative(info.Holder());
return toV8Fast(WTF::getPtr(imp->pathSegList()), info, imp);
}
示例15: pathLengthAttrGetter
static v8::Handle<v8::Value> pathLengthAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
SVGPathElement* imp = V8SVGPathElement::toNative(info.Holder());
return toV8Fast(imp->pathLengthAnimated(), info, imp);
}