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


C++ MediaValues类代码示例

本文整理汇总了C++中MediaValues的典型用法代码示例。如果您正苦于以下问题:C++ MediaValues类的具体用法?C++ MediaValues怎么用?C++ MediaValues使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了MediaValues类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: transform3dMediaFeatureEval

static bool transform3dMediaFeatureEval(const MediaQueryExpValue& value, MediaFeaturePrefix op, const MediaValues& mediaValues)
{
    UseCounter::count(mediaValues.document(), UseCounter::PrefixedTransform3dMediaFeature);

    bool returnValueIfNoParameter;
    int have3dRendering;

    bool threeDEnabled = mediaValues.threeDEnabled();

    returnValueIfNoParameter = threeDEnabled;
    have3dRendering = threeDEnabled ? 1 : 0;

    if (value.isValid()) {
        float number;
        return numberValue(value, number) && compareValue(have3dRendering, static_cast<int>(number), op);
    }
    return returnValueIfNoParameter;
}
开发者ID:smishenk,项目名称:chromium-crosswalk,代码行数:18,代码来源:MediaQueryEvaluator.cpp

示例2: colorMediaFeatureEval

static bool colorMediaFeatureEval(const MediaQueryExpValue& value, MediaFeaturePrefix op, const MediaValues& mediaValues)
{
    float number;
    int bitsPerComponent = mediaValues.colorBitsPerComponent();
    if (value.isValid())
        return numberValue(value, number) && compareValue(bitsPerComponent, static_cast<int>(number), op);

    return bitsPerComponent != 0;
}
开发者ID:coinpayee,项目名称:blink,代码行数:9,代码来源:MediaQueryEvaluator.cpp

示例3: deviceWidthMediaFeatureEval

static bool deviceWidthMediaFeatureEval(const MediaQueryExpValue& value, MediaFeaturePrefix op, const MediaValues& mediaValues)
{
    if (value.isValid())
        return computeLengthAndCompare(value, op, mediaValues, mediaValues.deviceWidth());

    // ({,min-,max-}device-width)
    // assume if we have a device, assume non-zero
    return true;
}
开发者ID:smishenk,项目名称:chromium-crosswalk,代码行数:9,代码来源:MediaQueryEvaluator.cpp

示例4: heightMediaFeatureEval

static bool heightMediaFeatureEval(const MediaQueryExpValue& value, MediaFeaturePrefix op, const MediaValues& mediaValues)
{
    int height = mediaValues.viewportHeight();
    if (value.isValid()) {
        int length;
        return computeLength(value, mediaValues, length) && compareValue(height, length, op);
    }

    return height;
}
开发者ID:Drakey83,项目名称:steamlink-sdk,代码行数:10,代码来源:MediaQueryEvaluator.cpp

示例5: widthMediaFeatureEval

static bool widthMediaFeatureEval(const MediaQueryExpValue& value, MediaFeaturePrefix op, const MediaValues& mediaValues)
{
    int width = mediaValues.viewportWidth();
    if (value.isValid()) {
        int length;
        return computeLength(value, mediaValues, length) && compareValue(width, length, op);
    }

    return width;
}
开发者ID:Drakey83,项目名称:steamlink-sdk,代码行数:10,代码来源:MediaQueryEvaluator.cpp

示例6: monochromeMediaFeatureEval

static bool monochromeMediaFeatureEval(const MediaQueryExpValue& value, MediaFeaturePrefix op, const MediaValues& mediaValues)
{
    if (!mediaValues.monochromeBitsPerComponent()) {
        if (value.isValid()) {
            float number;
            return numberValue(value, number) && compareValue(0, static_cast<int>(number), op);
        }
        return false;
    }

    return colorMediaFeatureEval(value, op, mediaValues);
}
开发者ID:Drakey83,项目名称:steamlink-sdk,代码行数:12,代码来源:MediaQueryEvaluator.cpp

示例7: pointerMediaFeatureEval

static bool pointerMediaFeatureEval(const MediaQueryExpValue& value, MediaFeaturePrefix, const MediaValues& mediaValues)
{
    PointerType pointer = mediaValues.primaryPointerType();

    if (!value.isValid())
        return pointer != PointerTypeNone;

    if (!value.isID)
        return false;

    return (pointer == PointerTypeNone && value.id == CSSValueNone)
        || (pointer == PointerTypeCoarse && value.id == CSSValueCoarse)
        || (pointer == PointerTypeFine && value.id == CSSValueFine);
}
开发者ID:335969568,项目名称:Blink-1,代码行数:14,代码来源:MediaQueryEvaluator.cpp

示例8: hoverMediaFeatureEval

static bool hoverMediaFeatureEval(const MediaQueryExpValue& value, MediaFeaturePrefix, const MediaValues& mediaValues)
{
    HoverType hover = mediaValues.primaryHoverType();

    if (!value.isValid())
        return hover != HoverTypeNone;

    if (!value.isID)
        return false;

    return (hover == HoverTypeNone && value.id == CSSValueNone)
        || (hover == HoverTypeOnDemand && value.id == CSSValueOnDemand)
        || (hover == HoverTypeHover && value.id == CSSValueHover);
}
开发者ID:smishenk,项目名称:chromium-crosswalk,代码行数:14,代码来源:MediaQueryEvaluator.cpp

示例9: scanMediaFeatureEval

static bool scanMediaFeatureEval(const MediaQueryExpValue& value, MediaFeaturePrefix, const MediaValues& mediaValues)
{
    if (!mediaValues.scanMediaType())
        return false;

    if (!value.isValid())
        return true;

    if (!value.isID)
        return false;

    // If a platform interface supplies progressive/interlace info for TVs in the
    // future, it needs to be handled here. For now, assume a modern TV with
    // progressive display.
    return (value.id == CSSValueProgressive);
}
开发者ID:Drakey83,项目名称:steamlink-sdk,代码行数:16,代码来源:MediaQueryEvaluator.cpp

示例10: displayModeMediaFeatureEval

static bool displayModeMediaFeatureEval(const MediaQueryExpValue& value, MediaFeaturePrefix, const MediaValues& mediaValues)
{
    if (!value.isID)
        return false;

    WebDisplayMode mode = mediaValues.displayMode();
    switch (value.id) {
    case CSSValueFullscreen:
        return mode == WebDisplayModeFullscreen;
    case CSSValueStandalone:
        return mode == WebDisplayModeStandalone;
    case CSSValueMinimalUi:
        return mode == WebDisplayModeMinimalUi;
    case CSSValueBrowser:
        return mode == WebDisplayModeBrowser;
    default:
        ASSERT_NOT_REACHED();
        return false;
    }
}
开发者ID:smishenk,项目名称:chromium-crosswalk,代码行数:20,代码来源:MediaQueryEvaluator.cpp

示例11: pointerMediaFeatureEval

static bool pointerMediaFeatureEval(const MediaQueryExpValue& value, MediaFeaturePrefix, const MediaValues& mediaValues)
{
    MediaValues::PointerDeviceType pointer = mediaValues.pointer();

    // If we're on a port that hasn't explicitly opted into providing pointer device information
    // (or otherwise can't be confident in the pointer hardware available), then behave exactly
    // as if this feature feature isn't supported.
    if (pointer == MediaValues::UnknownPointer)
        return false;

    if (!value.isValid())
        return pointer != MediaValues::NoPointer;

    if (!value.isID)
        return false;

    return (pointer == MediaValues::NoPointer && value.id == CSSValueNone)
        || (pointer == MediaValues::TouchPointer && value.id == CSSValueCoarse)
        || (pointer == MediaValues::MousePointer && value.id == CSSValueFine);
}
开发者ID:Drakey83,项目名称:steamlink-sdk,代码行数:20,代码来源:MediaQueryEvaluator.cpp

示例12: hoverMediaFeatureEval

static bool hoverMediaFeatureEval(const MediaQueryExpValue& value, MediaFeaturePrefix, const MediaValues& mediaValues)
{
    MediaValues::PointerDeviceType pointer = mediaValues.pointer();

    // If we're on a port that hasn't explicitly opted into providing pointer device information
    // (or otherwise can't be confident in the pointer hardware available), then behave exactly
    // as if this feature feature isn't supported.
    if (pointer == MediaValues::UnknownPointer)
        return false;

    float number = 1;
    if (value.isValid()) {
        if (!numberValue(value, number))
            return false;
    }

    return (pointer == MediaValues::NoPointer && !number)
        || (pointer == MediaValues::TouchPointer && !number)
        || (pointer == MediaValues::MousePointer && number == 1);
}
开发者ID:Drakey83,项目名称:steamlink-sdk,代码行数:20,代码来源:MediaQueryEvaluator.cpp

示例13: anyHoverMediaFeatureEval

static bool anyHoverMediaFeatureEval(const MediaQueryExpValue& value, MediaFeaturePrefix, const MediaValues& mediaValues)
{
    int availableHoverTypes = mediaValues.availableHoverTypes();

    if (!value.isValid())
        return availableHoverTypes & ~HoverTypeNone;

    if (!value.isID)
        return false;

    switch (value.id) {
    case CSSValueNone:
        return availableHoverTypes & HoverTypeNone;
    case CSSValueOnDemand:
        return availableHoverTypes & HoverTypeOnDemand;
    case CSSValueHover:
        return availableHoverTypes & HoverTypeHover;
    default:
        ASSERT_NOT_REACHED();
        return false;
    }
}
开发者ID:smishenk,项目名称:chromium-crosswalk,代码行数:22,代码来源:MediaQueryEvaluator.cpp

示例14: anyPointerMediaFeatureEval

static bool anyPointerMediaFeatureEval(const MediaQueryExpValue& value, MediaFeaturePrefix, const MediaValues& mediaValues)
{
    int availablePointers = mediaValues.availablePointerTypes();

    if (!value.isValid())
        return availablePointers & ~PointerTypeNone;

    if (!value.isID)
        return false;

    switch (value.id) {
    case CSSValueCoarse:
        return availablePointers & PointerTypeCoarse;
    case CSSValueFine:
        return availablePointers & PointerTypeFine;
    case CSSValueNone:
        return availablePointers & PointerTypeNone;
    default:
        ASSERT_NOT_REACHED();
        return false;
    }
}
开发者ID:smishenk,项目名称:chromium-crosswalk,代码行数:22,代码来源:MediaQueryEvaluator.cpp

示例15:

MediaQueryEvaluator::MediaQueryEvaluator(const String& acceptedMediaType, const MediaValues& mediaValues)
    : m_mediaType(acceptedMediaType)
    , m_expectedResult(false) // Doesn't matter when we have mediaValues.
    , m_mediaValues(mediaValues.copy())
{
}
开发者ID:Drakey83,项目名称:steamlink-sdk,代码行数:6,代码来源:MediaQueryEvaluator.cpp


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