当前位置: 首页>>代码示例>>C++>>正文


C++ DeviceOrientationEvent类代码示例

本文整理汇总了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());
}
开发者ID:CannedFish,项目名称:deepin-webkit,代码行数:7,代码来源:JSDeviceOrientationEventCustom.cpp

示例2: gamma

JSValue JSDeviceOrientationEvent::gamma(ExecState*) const
{
    DeviceOrientationEvent* imp = static_cast<DeviceOrientationEvent*>(impl());
    if (!imp->orientation()->canProvideGamma())
        return jsNull();
    return jsNumber(imp->orientation()->gamma());
}
开发者ID:CannedFish,项目名称:deepin-webkit,代码行数:7,代码来源:JSDeviceOrientationEventCustom.cpp

示例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());
}
开发者ID:0omega,项目名称:platform_external_webkit,代码行数:9,代码来源:V8DeviceOrientationEventCustom.cpp

示例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>();
}
开发者ID:0omega,项目名称:platform_external_webkit,代码行数:18,代码来源:V8DeviceOrientationEventCustom.cpp

示例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());
}
开发者ID:Drakey83,项目名称:steamlink-sdk,代码行数:19,代码来源:V8DeviceOrientationEventCustom.cpp

示例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();
}
开发者ID:jiezh,项目名称:h5vcc,代码行数:20,代码来源:V8DeviceOrientationEventCustom.cpp

示例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();
}
开发者ID:CannedFish,项目名称:deepin-webkit,代码行数:20,代码来源:JSDeviceOrientationEventCustom.cpp

示例8: toDeviceOrientationEvent

bool DeviceOrientationController::isNullEvent(Event* event)
{
    DeviceOrientationEvent* orientationEvent = toDeviceOrientationEvent(event);
    return !orientationEvent->orientation()->canProvideEventData();
}
开发者ID:kublaj,项目名称:blink,代码行数:5,代码来源:DeviceOrientationController.cpp

示例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


注:本文中的DeviceOrientationEvent类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。