chromium/third_party/blink/renderer/modules/gamepad/gamepad_comparisons.cc

// Copyright 2018 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/351564777): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "third_party/blink/renderer/modules/gamepad/gamepad_comparisons.h"

#include "third_party/blink/renderer/modules/gamepad/gamepad.h"

namespace blink {

namespace {

// A button press must have a value at least this large to qualify as a user
// activation. The selected value should be greater than 0.5 so that axes
// incorrectly mapped as triggers do not generate activations in the idle
// position.
const double kButtonActivationThreshold =;

template <typename Collection>
bool HasSameNumberofElements(const Collection* lhs, const Collection* rhs) {}

bool HasSameNumberofElements(const GamepadTouchVector* lhs,
                             const GamepadTouchVector* rhs) {}

template <typename T>
auto Begin(const T* col) {}

template <typename T>
auto End(const T* col) {}

auto Begin(const GamepadTouchVector* col) {}

auto End(const GamepadTouchVector* col) {}

template <typename Collection,
          typename Pred = std::equal_to<typename Collection::ValueType>>
bool Compare(const Collection* old_array,
             const Collection* new_array,
             Pred pred = Pred{}

}  // namespace

// static
bool GamepadComparisons::HasUserActivation(
    const HeapVector<Member<Gamepad>> gamepads) {}

// static
void GamepadComparisons::HasGamepadConnectionChanged(bool old_connected,
                                                     bool new_connected,
                                                     bool id_changed,
                                                     bool* gamepad_found,
                                                     bool* gamepad_lost) {}

GamepadStateCompareResult::GamepadStateCompareResult(
    const HeapVector<Member<Gamepad>> old_gamepads,
    const HeapVector<Member<Gamepad>> new_gamepads,
    bool compare_all_axes,
    bool compare_all_buttons) {}

bool GamepadStateCompareResult::IsDifferent() const {}

bool GamepadStateCompareResult::IsGamepadConnected(size_t pad_index) const {}

bool GamepadStateCompareResult::IsGamepadDisconnected(size_t pad_index) const {}

bool GamepadStateCompareResult::IsAxisChanged(size_t pad_index,
                                              size_t axis_index) const {}

bool GamepadStateCompareResult::IsButtonChanged(size_t pad_index,
                                                size_t button_index) const {}

bool GamepadStateCompareResult::IsButtonDown(size_t pad_index,
                                             size_t button_index) const {}

bool GamepadStateCompareResult::IsButtonUp(size_t pad_index,
                                           size_t button_index) const {}

bool GamepadStateCompareResult::CompareGamepads(
    const HeapVector<Member<Gamepad>> old_gamepads,
    const HeapVector<Member<Gamepad>> new_gamepads,
    bool compare_all_axes,
    bool compare_all_buttons) {}

bool GamepadStateCompareResult::CompareAxes(Gamepad* old_gamepad,
                                            Gamepad* new_gamepad,
                                            size_t index,
                                            bool compare_all) {}

bool GamepadStateCompareResult::CompareButtons(Gamepad* old_gamepad,
                                               Gamepad* new_gamepad,
                                               size_t index,
                                               bool compare_all) {}

bool GamepadStateCompareResult::CompareTouches(Gamepad* old_gamepad,
                                               Gamepad* new_gamepad) {}

GamepadStateCompareResult GamepadComparisons::Compare(
    const HeapVector<Member<Gamepad>> old_gamepads,
    const HeapVector<Member<Gamepad>> new_gamepads,
    bool compare_all_axes,
    bool compare_all_buttons) {}

}  // namespace blink