本文整理汇总了C++中SVGPaint::setPaint方法的典型用法代码示例。如果您正苦于以下问题:C++ SVGPaint::setPaint方法的具体用法?C++ SVGPaint::setPaint怎么用?C++ SVGPaint::setPaint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SVGPaint
的用法示例。
在下文中一共展示了SVGPaint::setPaint方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: jsSVGPaintPrototypeFunctionSetPaint
JSValue JSC_HOST_CALL jsSVGPaintPrototypeFunctionSetPaint(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
{
UNUSED_PARAM(args);
if (!thisValue.inherits(&JSSVGPaint::s_info))
return throwError(exec, TypeError);
JSSVGPaint* castedThisObj = static_cast<JSSVGPaint*>(asObject(thisValue));
SVGPaint* imp = static_cast<SVGPaint*>(castedThisObj->impl());
ExceptionCode ec = 0;
SVGPaint::SVGPaintType paintType = static_cast<SVGPaint::SVGPaintType>(args.at(0).toInt32(exec));
const UString& uri = args.at(1).toString(exec);
const UString& rgbColor = args.at(2).toString(exec);
const UString& iccColor = args.at(3).toString(exec);
imp->setPaint(paintType, uri, rgbColor, iccColor, ec);
setDOMException(exec, ec);
return jsUndefined();
}
示例2: throwError
static v8::Handle<v8::Value> setPaintCallback(const v8::Arguments& args)
{
INC_STATS("DOM.SVGPaint.setPaint");
if (args.Length() < 4)
return throwError("Not enough arguments", V8Proxy::TypeError);
SVGPaint* imp = V8SVGPaint::toNative(args.Holder());
ExceptionCode ec = 0;
{
EXCEPTION_BLOCK(int, paintType, toUInt32(MAYBE_MISSING_PARAMETER(args, 0, MissingIsUndefined)));
STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, uri, MAYBE_MISSING_PARAMETER(args, 1, MissingIsUndefined));
STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, rgbColor, MAYBE_MISSING_PARAMETER(args, 2, MissingIsUndefined));
STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, iccColor, MAYBE_MISSING_PARAMETER(args, 3, MissingIsUndefined));
imp->setPaint(paintType, uri, rgbColor, iccColor, ec);
if (UNLIKELY(ec))
goto fail;
return v8::Handle<v8::Value>();
}
fail:
V8Proxy::setDOMException(ec);
return v8::Handle<v8::Value>();
}