// ui/gl/mojom/gl_implementation.mojom-data-view.h is auto generated by mojom_bindings_generator.py, do not edit

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

// This file defines XDataView for type traits and can be included in
// _mojom_traits.h definitions but otherwise please use .mojom-forward.h,
// .mojom-shared.h or .mojom.h.

// IWYU pragma: private
// IWYU pragma: friend "traits"

#ifndef UI_GL_MOJOM_GL_IMPLEMENTATION_MOJOM_DATA_VIEW_H_
#define UI_GL_MOJOM_GL_IMPLEMENTATION_MOJOM_DATA_VIEW_H_

#include <stdint.h>

#include <functional>
#include <iosfwd>
#include <type_traits>
#include <utility>
#include "mojo/public/cpp/bindings/array_data_view.h"
#include "mojo/public/cpp/bindings/string_data_view.h"
#include "mojo/public/cpp/bindings/lib/serialization.h"

#include "ui/gl/mojom/gl_implementation.mojom-shared-internal.h"


namespace gl::mojom {
class GLImplementationPartsDataView;



}  // gl::mojom


namespace mojo {
namespace internal {

template <>
struct MojomTypeTraits<::gl::mojom::GLImplementationPartsDataView> {
  using Data = ::gl::mojom::internal::GLImplementationParts_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

}  // namespace internal
}  // namespace mojo


namespace gl::mojom {


enum class GLImplementation : int32_t {
  
  kGLImplementationNone = 0,
  
  kGLImplementationEGLGLES2 = 1,
  
  kGLImplementationMockGL = 2,
  
  kGLImplementationStubGL = 3,
  
  kGLImplementationDisabled = 4,
  
  kGLImplementationEGLANGLE = 5,
  kMinValue = 0,
  kMaxValue = 5,
};

COMPONENT_EXPORT(GL_MOJOM_SHARED) std::ostream& operator<<(std::ostream& os, GLImplementation value);
inline bool IsKnownEnumValue(GLImplementation value) {
  return internal::GLImplementation_Data::IsKnownValue(
      static_cast<int32_t>(value));
}

// Returns true if the enum has an infallible conversion from the mojom enum.
consteval bool HasInfallibleConversion(GLImplementation) {
  return true;
}


enum class ANGLEImplementation : int32_t {
  
  kNone = 0,
  
  kD3D11 = 1,
  
  kOpenGL = 2,
  
  kOpenGLES = 3,
  
  kNull = 4,
  
  kVulkan = 5,
  
  kSwiftShader = 6,
  
  kMetal = 7,
  
  kD3D11Warp = 8,
  
  kDefault = 9,
  kMinValue = 0,
  kMaxValue = 9,
};

COMPONENT_EXPORT(GL_MOJOM_SHARED) std::ostream& operator<<(std::ostream& os, ANGLEImplementation value);
inline bool IsKnownEnumValue(ANGLEImplementation value) {
  return internal::ANGLEImplementation_Data::IsKnownValue(
      static_cast<int32_t>(value));
}

// Returns true if the enum has an infallible conversion from the mojom enum.
consteval bool HasInfallibleConversion(ANGLEImplementation) {
  return true;
}


class GLImplementationPartsDataView {
 public:
  GLImplementationPartsDataView() = default;

  GLImplementationPartsDataView(
      internal::GLImplementationParts_Data* data,
      mojo::Message* message)
      : data_(data) {}

  bool is_null() const { return !data_; }
  template <typename UserType>
  [[nodiscard]] bool ReadGl(UserType* output) const {
    auto data_value = data_->gl;
    return mojo::internal::Deserialize<::gl::mojom::GLImplementation>(
        data_value, output);
  }
  GLImplementation gl() const {
    return ::mojo::internal::ToKnownEnumValueHelper(
          static_cast<::gl::mojom::GLImplementation>(data_->gl));
  }
  template <typename UserType>
  [[nodiscard]] bool ReadAngle(UserType* output) const {
    auto data_value = data_->angle;
    return mojo::internal::Deserialize<::gl::mojom::ANGLEImplementation>(
        data_value, output);
  }
  ANGLEImplementation angle() const {
    return ::mojo::internal::ToKnownEnumValueHelper(
          static_cast<::gl::mojom::ANGLEImplementation>(data_->angle));
  }
 private:
  internal::GLImplementationParts_Data* data_ = nullptr;
};


}  // gl::mojom

#endif  // UI_GL_MOJOM_GL_IMPLEMENTATION_MOJOM_DATA_VIEW_H_