From 207c9e1c1d73dc062d68bf0dbb27a0b58c7581a2 Mon Sep 17 00:00:00 2001 From: Paul Elder Date: Wed, 3 Aug 2022 19:51:06 +0900 Subject: utils: ipc: Add support for Flags Add Flags as a supported type in the IPA interface. It is used in mojom with the [flags] attribute. Any field or parameter type E that is prefixed with the [flags] attribute will direct the code generator to generate the type name "Flags" and appropriate serialization/deserialization code for Flags instead of for E. It is usable and has been tested in struct members, function input and output parameters, and Signal parameters. This does not add support for returning Flags as direct return values. Additionally, the [scopedEnum] attribute can be used on enum definitions, which will instruct the code generator to convert it to an enum class instead of a raw enum. Signed-off-by: Paul Elder Reviewed-by: Laurent Pinchart Reviewed-by: Jacopo Mondi --- utils/ipc/generators/libcamera_templates/definition_functions.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'utils/ipc/generators/libcamera_templates/definition_functions.tmpl') diff --git a/utils/ipc/generators/libcamera_templates/definition_functions.tmpl b/utils/ipc/generators/libcamera_templates/definition_functions.tmpl index 94bb4918..8b8509f3 100644 --- a/utils/ipc/generators/libcamera_templates/definition_functions.tmpl +++ b/utils/ipc/generators/libcamera_templates/definition_functions.tmpl @@ -9,7 +9,7 @@ # \param enum Enum object whose definition is to be generated #} {%- macro define_enum(enum) -%} -enum {{enum.mojom_name}} { +enum{{" class" if enum|is_scoped}} {{enum.mojom_name}} { {%- for field in enum.fields %} {{field.mojom_name}} = {{field.numeric_value}}, {%- endfor %} -- cgit v1.2.1