/* SPDX-License-Identifier: LGPL-2.1-or-later */
/*
 * Copyright (C) 2022, Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
 *
 * Python bindings - Auto-generated {{mode}}
 *
 * This file is auto-generated. Do not edit.
 */

#include <libcamera/{{header}}>

#include <pybind11/pybind11.h>

#include "py_main.h"

namespace py = pybind11;

class Py{{mode|capitalize}}
{
};

{% for vendor in vendors -%}
class Py{{vendor|capitalize}}{{mode|capitalize}}
{
};

{% endfor -%}

void init_py_{{mode}}_generated(py::module& m)
{
	auto {{mode}} = py::class_<Py{{mode|capitalize}}>(m, "{{mode}}");
{%- for vendor in vendors %}
	auto {{vendor}} = py::class_<Py{{vendor|capitalize}}{{mode|capitalize}}>({{mode}}, "{{vendor}}");
{%- endfor %}

{% for ctrl in controls %}
        {{ctrl.klass}}.def_readonly_static("{{ctrl.name}}", static_cast<const libcamera::ControlId *>(&libcamera::{{mode}}::{{ctrl.namespace}}{{ctrl.name}}));
{%- if ctrl.is_enum %}

        py::enum_<libcamera::{{mode}}::{{ctrl.namespace}}{{ctrl.name}}Enum>({{ctrl.klass}}, "{{ctrl.name}}Enum")
{%- for enum in ctrl.enum_values %}
                .value("{{enum.py_name}}", libcamera::{{mode}}::{{ctrl.namespace}}{{enum.name}})
{%- endfor %}
        ;
{%- endif %}
{% endfor -%}
}
