本文整理汇总了C++中DeviceOrientationEvent类的典型用法代码示例。如果您正苦于以下问题:C++ DeviceOrientationEvent类的具体用法?C++ DeviceOrientationEvent怎么用?C++ DeviceOrientationEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了DeviceOrientationEvent类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: absolute
JSValue JSDeviceOrientationEvent::absolute(ExecState*) const
{
DeviceOrientationEvent* imp = static_cast<DeviceOrientationEvent*>(impl());
if (!imp->orientation()->canProvideAbsolute())
return jsNull();
return jsBoolean(imp->orientation()->absolute());
}
示例2: gamma
JSValue JSDeviceOrientationEvent::gamma(ExecState*) const
{
DeviceOrientationEvent* imp = static_cast<DeviceOrientationEvent*>(impl());
if (!imp->orientation()->canProvideGamma())
return jsNull();
return jsNumber(imp->orientation()->gamma());
}
示例3: INC_STATS
v8::Handle<v8::Value> V8DeviceOrientationEvent::gammaAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
INC_STATS("DOM.DeviceOrientationEvent.gamma._get");
v8::Handle<v8::Object> holder = info.Holder();
DeviceOrientationEvent* imp = V8DeviceOrientationEvent::toNative(holder);
if (!imp->orientation()->canProvideGamma())
return v8::Null();
return v8::Number::New(imp->orientation()->gamma());
}
示例4: STRING_TO_V8PARAMETER_EXCEPTION_BLOCK
v8::Handle<v8::Value> V8DeviceOrientationEvent::initDeviceOrientationEventCallback(const v8::Arguments& args)
{
DeviceOrientationEvent* imp = V8DeviceOrientationEvent::toNative(args.Holder());
STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, type, args[0]);
bool bubbles = args[1]->BooleanValue();
bool cancelable = args[2]->BooleanValue();
// If alpha, beta or gamma are null or undefined, mark them as not provided.
// Otherwise, use the standard JavaScript conversion.
bool alphaProvided = !isUndefinedOrNull(args[3]);
double alpha = args[3]->NumberValue();
bool betaProvided = !isUndefinedOrNull(args[4]);
double beta = args[4]->NumberValue();
bool gammaProvided = !isUndefinedOrNull(args[5]);
double gamma = args[5]->NumberValue();
RefPtr<DeviceOrientation> orientation = DeviceOrientation::create(alphaProvided, alpha, betaProvided, beta, gammaProvided, gamma);
imp->initDeviceOrientationEvent(type, bubbles, cancelable, orientation.get());
return v8::Handle<v8::Value>();
}
示例5: TOSTRING_VOID
void V8DeviceOrientationEvent::initDeviceOrientationEventMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
{
DeviceOrientationEvent* impl = V8DeviceOrientationEvent::toNative(info.Holder());
TOSTRING_VOID(V8StringResource<>, type, info[0]);
bool bubbles = info[1]->BooleanValue();
bool cancelable = info[2]->BooleanValue();
// If alpha, beta, gamma or absolute are null or undefined, mark them as not provided.
// Otherwise, use the standard JavaScript conversion.
bool alphaProvided = !isUndefinedOrNull(info[3]);
double alpha = info[3]->NumberValue();
bool betaProvided = !isUndefinedOrNull(info[4]);
double beta = info[4]->NumberValue();
bool gammaProvided = !isUndefinedOrNull(info[5]);
double gamma = info[5]->NumberValue();
bool absoluteProvided = !isUndefinedOrNull(info[6]);
bool absolute = info[6]->BooleanValue();
RefPtrWillBeRawPtr<DeviceOrientationData> orientation = DeviceOrientationData::create(alphaProvided, alpha, betaProvided, beta, gammaProvided, gamma, absoluteProvided, absolute);
impl->initDeviceOrientationEvent(type, bubbles, cancelable, orientation.get());
}
示例6: V8TRYCATCH_FOR_V8STRINGRESOURCE
v8::Handle<v8::Value> V8DeviceOrientationEvent::initDeviceOrientationEventCallback(const v8::Arguments& args)
{
DeviceOrientationEvent* imp = V8DeviceOrientationEvent::toNative(args.Holder());
V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, type, args[0]);
bool bubbles = args[1]->BooleanValue();
bool cancelable = args[2]->BooleanValue();
// If alpha, beta, gamma or absolute are null or undefined, mark them as not provided.
// Otherwise, use the standard JavaScript conversion.
bool alphaProvided = !isUndefinedOrNull(args[3]);
double alpha = args[3]->NumberValue();
bool betaProvided = !isUndefinedOrNull(args[4]);
double beta = args[4]->NumberValue();
bool gammaProvided = !isUndefinedOrNull(args[5]);
double gamma = args[5]->NumberValue();
bool absoluteProvided = !isUndefinedOrNull(args[6]);
bool absolute = args[6]->BooleanValue();
RefPtr<DeviceOrientationData> orientation = DeviceOrientationData::create(alphaProvided, alpha, betaProvided, beta, gammaProvided, gamma, absoluteProvided, absolute);
imp->initDeviceOrientationEvent(type, bubbles, cancelable, orientation.get());
return v8Undefined();
}
示例7: ustringToString
JSValue JSDeviceOrientationEvent::initDeviceOrientationEvent(ExecState* exec)
{
const String& type = ustringToString(exec->argument(0).toString(exec)->value(exec));
bool bubbles = exec->argument(1).toBoolean(exec);
bool cancelable = exec->argument(2).toBoolean(exec);
// If alpha, beta or gamma are null or undefined, mark them as not provided.
// Otherwise, use the standard JavaScript conversion.
bool alphaProvided = !exec->argument(3).isUndefinedOrNull();
double alpha = exec->argument(3).toNumber(exec);
bool betaProvided = !exec->argument(4).isUndefinedOrNull();
double beta = exec->argument(4).toNumber(exec);
bool gammaProvided = !exec->argument(5).isUndefinedOrNull();
double gamma = exec->argument(5).toNumber(exec);
bool absoluteProvided = !exec->argument(5).isUndefinedOrNull();
bool absolute = exec->argument(6).toBoolean(exec);
RefPtr<DeviceOrientation> orientation = DeviceOrientation::create(alphaProvided, alpha, betaProvided, beta, gammaProvided, gamma, absoluteProvided, absolute);
DeviceOrientationEvent* imp = static_cast<DeviceOrientationEvent*>(impl());
imp->initDeviceOrientationEvent(type, bubbles, cancelable, orientation.get());
return jsUndefined();
}
示例8: toDeviceOrientationEvent
bool DeviceOrientationController::isNullEvent(Event* event)
{
DeviceOrientationEvent* orientationEvent = toDeviceOrientationEvent(event);
return !orientationEvent->orientation()->canProvideEventData();
}
示例9: ASSERT
bool NewDeviceOrientationController::isNullEvent(Event* event)
{
ASSERT(event->type() == eventNames().deviceorientationEvent);
DeviceOrientationEvent* orientationEvent = static_cast<DeviceOrientationEvent*>(event);
return !orientationEvent->orientation()->canProvideEventData();
}
开发者ID:IllusionRom-deprecated,项目名称:android_platform_external_chromium_org_third_party_WebKit,代码行数:6,代码来源:NewDeviceOrientationController.cpp