1 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
2 
3 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_ANDROID_VIEW_DISPLAYCUTOUT_PROTO_H_
4 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_ANDROID_VIEW_DISPLAYCUTOUT_PROTO_H_
5 
6 #include <stddef.h>
7 #include <stdint.h>
8 
9 #include "perfetto/protozero/field_writer.h"
10 #include "perfetto/protozero/message.h"
11 #include "perfetto/protozero/packed_repeated_fields.h"
12 #include "perfetto/protozero/proto_decoder.h"
13 #include "perfetto/protozero/proto_utils.h"
14 
15 namespace perfetto {
16 namespace protos {
17 namespace pbzero {
18 class RectProto;
19 } // Namespace pbzero.
20 } // Namespace protos.
21 } // Namespace perfetto.
22 
23 namespace perfetto {
24 namespace protos {
25 namespace pbzero {
26 
27 class DisplayCutoutProto_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/8, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
28  public:
DisplayCutoutProto_Decoder(const uint8_t * data,size_t len)29   DisplayCutoutProto_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
DisplayCutoutProto_Decoder(const std::string & raw)30   explicit DisplayCutoutProto_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
DisplayCutoutProto_Decoder(const::protozero::ConstBytes & raw)31   explicit DisplayCutoutProto_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
has_insets()32   bool has_insets() const { return at<1>().valid(); }
insets()33   ::protozero::ConstBytes insets() const { return at<1>().as_bytes(); }
has_bound_left()34   bool has_bound_left() const { return at<3>().valid(); }
bound_left()35   ::protozero::ConstBytes bound_left() const { return at<3>().as_bytes(); }
has_bound_top()36   bool has_bound_top() const { return at<4>().valid(); }
bound_top()37   ::protozero::ConstBytes bound_top() const { return at<4>().as_bytes(); }
has_bound_right()38   bool has_bound_right() const { return at<5>().valid(); }
bound_right()39   ::protozero::ConstBytes bound_right() const { return at<5>().as_bytes(); }
has_bound_bottom()40   bool has_bound_bottom() const { return at<6>().valid(); }
bound_bottom()41   ::protozero::ConstBytes bound_bottom() const { return at<6>().as_bytes(); }
has_waterfall_insets()42   bool has_waterfall_insets() const { return at<7>().valid(); }
waterfall_insets()43   ::protozero::ConstBytes waterfall_insets() const { return at<7>().as_bytes(); }
has_side_overrides()44   bool has_side_overrides() const { return at<8>().valid(); }
side_overrides()45   ::protozero::RepeatedFieldIterator<int32_t> side_overrides() const { return GetRepeated<int32_t>(8); }
46 };
47 
48 class DisplayCutoutProto : public ::protozero::Message {
49  public:
50   using Decoder = DisplayCutoutProto_Decoder;
51   enum : int32_t {
52     kInsetsFieldNumber = 1,
53     kBoundLeftFieldNumber = 3,
54     kBoundTopFieldNumber = 4,
55     kBoundRightFieldNumber = 5,
56     kBoundBottomFieldNumber = 6,
57     kWaterfallInsetsFieldNumber = 7,
58     kSideOverridesFieldNumber = 8,
59   };
GetName()60   static constexpr const char* GetName() { return ".perfetto.protos.DisplayCutoutProto"; }
61 
62 
63   using FieldMetadata_Insets =
64     ::protozero::proto_utils::FieldMetadata<
65       1,
66       ::protozero::proto_utils::RepetitionType::kNotRepeated,
67       ::protozero::proto_utils::ProtoSchemaType::kMessage,
68       RectProto,
69       DisplayCutoutProto>;
70 
71   static constexpr FieldMetadata_Insets kInsets{};
set_insets()72   template <typename T = RectProto> T* set_insets() {
73     return BeginNestedMessage<T>(1);
74   }
75 
76 
77   using FieldMetadata_BoundLeft =
78     ::protozero::proto_utils::FieldMetadata<
79       3,
80       ::protozero::proto_utils::RepetitionType::kNotRepeated,
81       ::protozero::proto_utils::ProtoSchemaType::kMessage,
82       RectProto,
83       DisplayCutoutProto>;
84 
85   static constexpr FieldMetadata_BoundLeft kBoundLeft{};
set_bound_left()86   template <typename T = RectProto> T* set_bound_left() {
87     return BeginNestedMessage<T>(3);
88   }
89 
90 
91   using FieldMetadata_BoundTop =
92     ::protozero::proto_utils::FieldMetadata<
93       4,
94       ::protozero::proto_utils::RepetitionType::kNotRepeated,
95       ::protozero::proto_utils::ProtoSchemaType::kMessage,
96       RectProto,
97       DisplayCutoutProto>;
98 
99   static constexpr FieldMetadata_BoundTop kBoundTop{};
set_bound_top()100   template <typename T = RectProto> T* set_bound_top() {
101     return BeginNestedMessage<T>(4);
102   }
103 
104 
105   using FieldMetadata_BoundRight =
106     ::protozero::proto_utils::FieldMetadata<
107       5,
108       ::protozero::proto_utils::RepetitionType::kNotRepeated,
109       ::protozero::proto_utils::ProtoSchemaType::kMessage,
110       RectProto,
111       DisplayCutoutProto>;
112 
113   static constexpr FieldMetadata_BoundRight kBoundRight{};
set_bound_right()114   template <typename T = RectProto> T* set_bound_right() {
115     return BeginNestedMessage<T>(5);
116   }
117 
118 
119   using FieldMetadata_BoundBottom =
120     ::protozero::proto_utils::FieldMetadata<
121       6,
122       ::protozero::proto_utils::RepetitionType::kNotRepeated,
123       ::protozero::proto_utils::ProtoSchemaType::kMessage,
124       RectProto,
125       DisplayCutoutProto>;
126 
127   static constexpr FieldMetadata_BoundBottom kBoundBottom{};
set_bound_bottom()128   template <typename T = RectProto> T* set_bound_bottom() {
129     return BeginNestedMessage<T>(6);
130   }
131 
132 
133   using FieldMetadata_WaterfallInsets =
134     ::protozero::proto_utils::FieldMetadata<
135       7,
136       ::protozero::proto_utils::RepetitionType::kNotRepeated,
137       ::protozero::proto_utils::ProtoSchemaType::kMessage,
138       RectProto,
139       DisplayCutoutProto>;
140 
141   static constexpr FieldMetadata_WaterfallInsets kWaterfallInsets{};
set_waterfall_insets()142   template <typename T = RectProto> T* set_waterfall_insets() {
143     return BeginNestedMessage<T>(7);
144   }
145 
146 
147   using FieldMetadata_SideOverrides =
148     ::protozero::proto_utils::FieldMetadata<
149       8,
150       ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
151       ::protozero::proto_utils::ProtoSchemaType::kInt32,
152       int32_t,
153       DisplayCutoutProto>;
154 
155   static constexpr FieldMetadata_SideOverrides kSideOverrides{};
add_side_overrides(int32_t value)156   void add_side_overrides(int32_t value) {
157     static constexpr uint32_t field_id = FieldMetadata_SideOverrides::kFieldId;
158     // Call the appropriate protozero::Message::Append(field_id, ...)
159     // method based on the type of the field.
160     ::protozero::internal::FieldWriter<
161       ::protozero::proto_utils::ProtoSchemaType::kInt32>
162         ::Append(*this, field_id, value);
163   }
164 };
165 
166 } // Namespace.
167 } // Namespace.
168 } // Namespace.
169 #endif  // Include guard.
170