1 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT. 2 3 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_ANDROID_VIEW_DISPLAYINFO_PROTO_H_ 4 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_ANDROID_VIEW_DISPLAYINFO_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 DisplayCutoutProto; 19 } // Namespace pbzero. 20 } // Namespace protos. 21 } // Namespace perfetto. 22 23 namespace perfetto { 24 namespace protos { 25 namespace pbzero { 26 27 class DisplayInfoProto_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/7, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> { 28 public: DisplayInfoProto_Decoder(const uint8_t * data,size_t len)29 DisplayInfoProto_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {} DisplayInfoProto_Decoder(const std::string & raw)30 explicit DisplayInfoProto_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {} DisplayInfoProto_Decoder(const::protozero::ConstBytes & raw)31 explicit DisplayInfoProto_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {} has_logical_width()32 bool has_logical_width() const { return at<1>().valid(); } logical_width()33 int32_t logical_width() const { return at<1>().as_int32(); } has_logical_height()34 bool has_logical_height() const { return at<2>().valid(); } logical_height()35 int32_t logical_height() const { return at<2>().as_int32(); } has_app_width()36 bool has_app_width() const { return at<3>().valid(); } app_width()37 int32_t app_width() const { return at<3>().as_int32(); } has_app_height()38 bool has_app_height() const { return at<4>().valid(); } app_height()39 int32_t app_height() const { return at<4>().as_int32(); } has_name()40 bool has_name() const { return at<5>().valid(); } name()41 ::protozero::ConstChars name() const { return at<5>().as_string(); } has_flags()42 bool has_flags() const { return at<6>().valid(); } flags()43 int32_t flags() const { return at<6>().as_int32(); } has_cutout()44 bool has_cutout() const { return at<7>().valid(); } cutout()45 ::protozero::ConstBytes cutout() const { return at<7>().as_bytes(); } 46 }; 47 48 class DisplayInfoProto : public ::protozero::Message { 49 public: 50 using Decoder = DisplayInfoProto_Decoder; 51 enum : int32_t { 52 kLogicalWidthFieldNumber = 1, 53 kLogicalHeightFieldNumber = 2, 54 kAppWidthFieldNumber = 3, 55 kAppHeightFieldNumber = 4, 56 kNameFieldNumber = 5, 57 kFlagsFieldNumber = 6, 58 kCutoutFieldNumber = 7, 59 }; GetName()60 static constexpr const char* GetName() { return ".perfetto.protos.DisplayInfoProto"; } 61 62 63 using FieldMetadata_LogicalWidth = 64 ::protozero::proto_utils::FieldMetadata< 65 1, 66 ::protozero::proto_utils::RepetitionType::kNotRepeated, 67 ::protozero::proto_utils::ProtoSchemaType::kInt32, 68 int32_t, 69 DisplayInfoProto>; 70 71 static constexpr FieldMetadata_LogicalWidth kLogicalWidth{}; set_logical_width(int32_t value)72 void set_logical_width(int32_t value) { 73 static constexpr uint32_t field_id = FieldMetadata_LogicalWidth::kFieldId; 74 // Call the appropriate protozero::Message::Append(field_id, ...) 75 // method based on the type of the field. 76 ::protozero::internal::FieldWriter< 77 ::protozero::proto_utils::ProtoSchemaType::kInt32> 78 ::Append(*this, field_id, value); 79 } 80 81 using FieldMetadata_LogicalHeight = 82 ::protozero::proto_utils::FieldMetadata< 83 2, 84 ::protozero::proto_utils::RepetitionType::kNotRepeated, 85 ::protozero::proto_utils::ProtoSchemaType::kInt32, 86 int32_t, 87 DisplayInfoProto>; 88 89 static constexpr FieldMetadata_LogicalHeight kLogicalHeight{}; set_logical_height(int32_t value)90 void set_logical_height(int32_t value) { 91 static constexpr uint32_t field_id = FieldMetadata_LogicalHeight::kFieldId; 92 // Call the appropriate protozero::Message::Append(field_id, ...) 93 // method based on the type of the field. 94 ::protozero::internal::FieldWriter< 95 ::protozero::proto_utils::ProtoSchemaType::kInt32> 96 ::Append(*this, field_id, value); 97 } 98 99 using FieldMetadata_AppWidth = 100 ::protozero::proto_utils::FieldMetadata< 101 3, 102 ::protozero::proto_utils::RepetitionType::kNotRepeated, 103 ::protozero::proto_utils::ProtoSchemaType::kInt32, 104 int32_t, 105 DisplayInfoProto>; 106 107 static constexpr FieldMetadata_AppWidth kAppWidth{}; set_app_width(int32_t value)108 void set_app_width(int32_t value) { 109 static constexpr uint32_t field_id = FieldMetadata_AppWidth::kFieldId; 110 // Call the appropriate protozero::Message::Append(field_id, ...) 111 // method based on the type of the field. 112 ::protozero::internal::FieldWriter< 113 ::protozero::proto_utils::ProtoSchemaType::kInt32> 114 ::Append(*this, field_id, value); 115 } 116 117 using FieldMetadata_AppHeight = 118 ::protozero::proto_utils::FieldMetadata< 119 4, 120 ::protozero::proto_utils::RepetitionType::kNotRepeated, 121 ::protozero::proto_utils::ProtoSchemaType::kInt32, 122 int32_t, 123 DisplayInfoProto>; 124 125 static constexpr FieldMetadata_AppHeight kAppHeight{}; set_app_height(int32_t value)126 void set_app_height(int32_t value) { 127 static constexpr uint32_t field_id = FieldMetadata_AppHeight::kFieldId; 128 // Call the appropriate protozero::Message::Append(field_id, ...) 129 // method based on the type of the field. 130 ::protozero::internal::FieldWriter< 131 ::protozero::proto_utils::ProtoSchemaType::kInt32> 132 ::Append(*this, field_id, value); 133 } 134 135 using FieldMetadata_Name = 136 ::protozero::proto_utils::FieldMetadata< 137 5, 138 ::protozero::proto_utils::RepetitionType::kNotRepeated, 139 ::protozero::proto_utils::ProtoSchemaType::kString, 140 std::string, 141 DisplayInfoProto>; 142 143 static constexpr FieldMetadata_Name kName{}; set_name(const char * data,size_t size)144 void set_name(const char* data, size_t size) { 145 AppendBytes(FieldMetadata_Name::kFieldId, data, size); 146 } set_name(::protozero::ConstChars chars)147 void set_name(::protozero::ConstChars chars) { 148 AppendBytes(FieldMetadata_Name::kFieldId, chars.data, chars.size); 149 } set_name(std::string value)150 void set_name(std::string value) { 151 static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId; 152 // Call the appropriate protozero::Message::Append(field_id, ...) 153 // method based on the type of the field. 154 ::protozero::internal::FieldWriter< 155 ::protozero::proto_utils::ProtoSchemaType::kString> 156 ::Append(*this, field_id, value); 157 } 158 159 using FieldMetadata_Flags = 160 ::protozero::proto_utils::FieldMetadata< 161 6, 162 ::protozero::proto_utils::RepetitionType::kNotRepeated, 163 ::protozero::proto_utils::ProtoSchemaType::kInt32, 164 int32_t, 165 DisplayInfoProto>; 166 167 static constexpr FieldMetadata_Flags kFlags{}; set_flags(int32_t value)168 void set_flags(int32_t value) { 169 static constexpr uint32_t field_id = FieldMetadata_Flags::kFieldId; 170 // Call the appropriate protozero::Message::Append(field_id, ...) 171 // method based on the type of the field. 172 ::protozero::internal::FieldWriter< 173 ::protozero::proto_utils::ProtoSchemaType::kInt32> 174 ::Append(*this, field_id, value); 175 } 176 177 using FieldMetadata_Cutout = 178 ::protozero::proto_utils::FieldMetadata< 179 7, 180 ::protozero::proto_utils::RepetitionType::kNotRepeated, 181 ::protozero::proto_utils::ProtoSchemaType::kMessage, 182 DisplayCutoutProto, 183 DisplayInfoProto>; 184 185 static constexpr FieldMetadata_Cutout kCutout{}; set_cutout()186 template <typename T = DisplayCutoutProto> T* set_cutout() { 187 return BeginNestedMessage<T>(7); 188 } 189 190 }; 191 192 } // Namespace. 193 } // Namespace. 194 } // Namespace. 195 #endif // Include guard. 196