本文整理汇总了C++中SVGLineElement类的典型用法代码示例。如果您正苦于以下问题:C++ SVGLineElement类的具体用法?C++ SVGLineElement怎么用?C++ SVGLineElement使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SVGLineElement类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: hasExtensionCallback
static v8::Handle<v8::Value> hasExtensionCallback(const v8::Arguments& args)
{
INC_STATS("DOM.SVGLineElement.hasExtension");
SVGLineElement* imp = V8SVGLineElement::toNative(args.Holder());
STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, extension, args[0]);
return v8Boolean(imp->hasExtension(extension));
}
示例2: getPresentationAttributeCallback
static v8::Handle<v8::Value> getPresentationAttributeCallback(const v8::Arguments& args)
{
INC_STATS("DOM.SVGLineElement.getPresentationAttribute");
SVGLineElement* imp = V8SVGLineElement::toNative(args.Holder());
STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, name, args[0]);
return toV8(imp->getPresentationAttribute(name));
}
示例3: xmlspaceAttrSetter
static void xmlspaceAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
INC_STATS("DOM.SVGLineElement.xmlspace._set");
SVGLineElement* imp = V8SVGLineElement::toNative(info.Holder());
V8Parameter<> v = value;
imp->setXmlspace(v);
return;
}
示例4: updatePathFromLineElement
static void updatePathFromLineElement(SVGElement* element, Path& path)
{
SVGLineElement* line = toSVGLineElement(element);
SVGLengthContext lengthContext(element);
path.moveTo(FloatPoint(line->x1().value(lengthContext), line->y1().value(lengthContext)));
path.addLineTo(FloatPoint(line->x2().value(lengthContext), line->y2().value(lengthContext)));
}
示例5: requiredFeaturesAttrGetter
static v8::Handle<v8::Value> requiredFeaturesAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
INC_STATS("DOM.SVGLineElement.requiredFeatures._get");
SVGLineElement* imp = V8SVGLineElement::toNative(info.Holder());
SVGElement* context = imp;
PassRefPtr<SVGStringList> resultAsPassRefPtr = V8Proxy::withSVGContext(imp->requiredFeatures(), context);
return toV8(resultAsPassRefPtr);
}
示例6: y2AttrGetter
static v8::Handle<v8::Value> y2AttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
INC_STATS("DOM.SVGLineElement.y2._get");
SVGLineElement* imp = V8SVGLineElement::toNative(info.Holder());
SVGElement* context = imp;
PassRefPtr<SVGAnimatedLength> resultAsPassRefPtr = V8Proxy::withSVGContext(imp->y2Animated(), context);
return toV8(resultAsPassRefPtr);
}
示例7: updatePathFromLineElement
static void updatePathFromLineElement(SVGElement* element, Path& path)
{
ASSERT_WITH_SECURITY_IMPLICATION(element->hasTagName(SVGNames::lineTag));
SVGLineElement* line = static_cast<SVGLineElement*>(element);
SVGLengthContext lengthContext(element);
path.moveTo(FloatPoint(line->x1().value(lengthContext), line->y1().value(lengthContext)));
path.addLineTo(FloatPoint(line->x2().value(lengthContext), line->y2().value(lengthContext)));
}
示例8: getBBoxCallback
static v8::Handle<v8::Value> getBBoxCallback(const v8::Arguments& args)
{
INC_STATS("DOM.SVGLineElement.getBBox");
SVGLineElement* imp = V8SVGLineElement::toNative(args.Holder());
FloatRect result = imp->getBBox();
RefPtr<V8SVGPODTypeWrapper<FloatRect> > wrapper = V8SVGStaticPODTypeWrapper<FloatRect>::create(result);
SVGElement* context = imp;
V8Proxy::setSVGContext(wrapper.get(), context);
return toV8(wrapper.release());
}
示例9: getScreenCTMCallback
static v8::Handle<v8::Value> getScreenCTMCallback(const v8::Arguments& args)
{
INC_STATS("DOM.SVGLineElement.getScreenCTM");
SVGLineElement* imp = V8SVGLineElement::toNative(args.Holder());
AffineTransform result = imp->getScreenCTM();
RefPtr<V8SVGPODTypeWrapper<AffineTransform> > wrapper = V8SVGStaticPODTypeWrapper<AffineTransform>::create(result);
SVGElement* context = imp;
V8Proxy::setSVGContext(wrapper.get(), context);
return toV8(wrapper.release());
}
示例10: jsSVGLineElementPrototypeFunctionGetBBox
JSValue* jsSVGLineElementPrototypeFunctionGetBBox(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
{
if (!thisValue->isObject(&JSSVGLineElement::s_info))
return throwError(exec, TypeError);
JSSVGLineElement* castedThisObj = static_cast<JSSVGLineElement*>(thisValue);
SVGLineElement* imp = static_cast<SVGLineElement*>(castedThisObj->impl());
JSC::JSValue* result = toJS(exec, JSSVGStaticPODTypeWrapper<FloatRect>::create(imp->getBBox()).get(), imp);
return result;
}
示例11: jsSVGLineElementPrototypeFunctionHasExtension
JSValue* jsSVGLineElementPrototypeFunctionHasExtension(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
{
if (!thisValue->isObject(&JSSVGLineElement::s_info))
return throwError(exec, TypeError);
JSSVGLineElement* castedThisObj = static_cast<JSSVGLineElement*>(thisValue);
SVGLineElement* imp = static_cast<SVGLineElement*>(castedThisObj->impl());
const UString& extension = args.at(exec, 0)->toString(exec);
JSC::JSValue* result = jsBoolean(imp->hasExtension(extension));
return result;
}
示例12: jsSVGLineElementPrototypeFunctionGetPresentationAttribute
JSValue* jsSVGLineElementPrototypeFunctionGetPresentationAttribute(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
{
if (!thisValue->isObject(&JSSVGLineElement::s_info))
return throwError(exec, TypeError);
JSSVGLineElement* castedThisObj = static_cast<JSSVGLineElement*>(thisValue);
SVGLineElement* imp = static_cast<SVGLineElement*>(castedThisObj->impl());
const UString& name = args.at(exec, 0)->toString(exec);
JSC::JSValue* result = toJS(exec, WTF::getPtr(imp->getPresentationAttribute(name)));
return result;
}
示例13: switch
void JSSVGLineElement::putValueProperty(ExecState* exec, int token, JSValue* value)
{
switch (token) {
case XmllangAttrNum: {
SVGLineElement* imp = static_cast<SVGLineElement*>(impl());
imp->setXmllang(value->toString(exec));
break;
}
case XmlspaceAttrNum: {
SVGLineElement* imp = static_cast<SVGLineElement*>(impl());
imp->setXmlspace(value->toString(exec));
break;
}
}
}
示例14: 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;
}
示例15: getTransformToElementCallback
static v8::Handle<v8::Value> getTransformToElementCallback(const v8::Arguments& args)
{
INC_STATS("DOM.SVGLineElement.getTransformToElement");
SVGLineElement* imp = V8SVGLineElement::toNative(args.Holder());
ExceptionCode ec = 0;
{
EXCEPTION_BLOCK(SVGElement*, element, V8SVGElement::HasInstance(args[0]) ? V8SVGElement::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0);
AffineTransform result = imp->getTransformToElement(element, ec);
if (UNLIKELY(ec))
goto fail;
RefPtr<V8SVGPODTypeWrapper<AffineTransform> > wrapper = V8SVGStaticPODTypeWrapper<AffineTransform>::create(result);
SVGElement* context = imp;
V8Proxy::setSVGContext(wrapper.get(), context);
return toV8(wrapper.release());
}
fail:
V8Proxy::setDOMException(ec);
return v8::Handle<v8::Value>();
}