chromium/third_party/blink/renderer/core/layout/geometry/axis.h

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

#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_GEOMETRY_AXIS_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_GEOMETRY_AXIS_H_

#include "base/types/strong_alias.h"
#include "third_party/blink/renderer/platform/text/writing_mode.h"

namespace blink {

enum class LogicalAxis : uint8_t {};
enum class PhysicalAxis : uint8_t {};

PhysicalAxes;
LogicalAxes;

inline constexpr LogicalAxes operator|(LogicalAxes a, LogicalAxes b) {}

inline constexpr LogicalAxes& operator|=(LogicalAxes& a, LogicalAxes b) {}

inline constexpr LogicalAxes operator&(LogicalAxes a, LogicalAxes b) {}

inline constexpr LogicalAxes operator&=(LogicalAxes& a, LogicalAxes b) {}

inline constexpr PhysicalAxes operator|(PhysicalAxes a, PhysicalAxes b) {}

inline constexpr PhysicalAxes& operator|=(PhysicalAxes& a, PhysicalAxes b) {}

inline constexpr PhysicalAxes operator&(PhysicalAxes a, PhysicalAxes b) {}

inline constexpr PhysicalAxes operator&=(PhysicalAxes& a, PhysicalAxes b) {}

inline constexpr PhysicalAxes operator^(PhysicalAxes a, PhysicalAxes b) {}

inline constexpr PhysicalAxes operator^=(PhysicalAxes& a, PhysicalAxes b) {}

inline constexpr LogicalAxes kLogicalAxesNone =;
inline constexpr LogicalAxes kLogicalAxesInline =;
inline constexpr LogicalAxes kLogicalAxesBlock =;
inline constexpr LogicalAxes kLogicalAxesBoth =;

inline constexpr PhysicalAxes kPhysicalAxesNone =;
inline constexpr PhysicalAxes kPhysicalAxesHorizontal =;
inline constexpr PhysicalAxes kPhysicalAxesVertical =;
inline constexpr PhysicalAxes kPhysicalAxesBoth =;

// ConvertAxes relies on the fact that the underlying values for
// for Inline/Horizontal are the same, and that the underlying values for
// Block/Vertical are the same.
static_assert;
static_assert;
static_assert;
static_assert;

template <typename FromType, typename ToType>
inline ToType ConvertAxes(FromType from, WritingMode mode) {}

inline PhysicalAxes ToPhysicalAxes(LogicalAxes logical, WritingMode mode) {}

inline LogicalAxes ToLogicalAxes(PhysicalAxes physical, WritingMode mode) {}

}  // namespace blink

#endif  // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_GEOMETRY_AXIS_H_