Adam Lesinski | 59e04c6 | 2016-02-04 15:59:23 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2016 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 17 | syntax = "proto3"; |
| 18 | |
Adam Lesinski | b58c3ef | 2017-09-12 17:39:52 -0700 | [diff] [blame] | 19 | import "frameworks/base/tools/aapt2/Configuration.proto"; |
| 20 | |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 21 | package aapt.pb; |
Adam Lesinski | 59e04c6 | 2016-02-04 15:59:23 -0800 | [diff] [blame] | 22 | |
Adam Lesinski | 4ffea04 | 2017-08-10 15:37:28 -0700 | [diff] [blame] | 23 | option java_package = "com.android.aapt"; |
Adam Lesinski | 59e04c6 | 2016-02-04 15:59:23 -0800 | [diff] [blame] | 24 | option optimize_for = LITE_RUNTIME; |
| 25 | |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 26 | // A string pool that wraps the binary form of the C++ class android::ResStringPool. |
Adam Lesinski | 59e04c6 | 2016-02-04 15:59:23 -0800 | [diff] [blame] | 27 | message StringPool { |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 28 | bytes data = 1; |
Adam Lesinski | 59e04c6 | 2016-02-04 15:59:23 -0800 | [diff] [blame] | 29 | } |
| 30 | |
Adam Lesinski | 4ffea04 | 2017-08-10 15:37:28 -0700 | [diff] [blame] | 31 | // The position of a declared entity within a file. |
| 32 | message SourcePosition { |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 33 | uint32 line_number = 1; |
| 34 | uint32 column_number = 2; |
Adam Lesinski | 4ffea04 | 2017-08-10 15:37:28 -0700 | [diff] [blame] | 35 | } |
| 36 | |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 37 | // Developer friendly source file information for an entity in the resource table. |
Adam Lesinski | 59e04c6 | 2016-02-04 15:59:23 -0800 | [diff] [blame] | 38 | message Source { |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 39 | // The index of the string path within the source string pool of a ResourceTable. |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 40 | uint32 path_idx = 1; |
| 41 | SourcePosition position = 2; |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 42 | } |
| 43 | |
Ryan Mitchell | 34039b2 | 2019-03-18 08:57:47 -0700 | [diff] [blame] | 44 | // The name and version fingerprint of a build tool. |
| 45 | message ToolFingerprint { |
| 46 | string tool = 1; |
| 47 | string version = 2; |
| 48 | } |
| 49 | |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 50 | // Top level message representing a resource table. |
| 51 | message ResourceTable { |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 52 | // The string pool containing source paths referenced throughout the resource table. This does |
| 53 | // not end up in the final binary ARSC file. |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 54 | StringPool source_pool = 1; |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 55 | |
| 56 | // Resource definitions corresponding to an Android package. |
Adam Lesinski | 4ffea04 | 2017-08-10 15:37:28 -0700 | [diff] [blame] | 57 | repeated Package package = 2; |
Ryan Mitchell | 54237ff | 2018-12-13 15:44:29 -0800 | [diff] [blame] | 58 | |
| 59 | // The <overlayable> declarations within the resource table. |
| 60 | repeated Overlayable overlayable = 3; |
Ryan Mitchell | 34039b2 | 2019-03-18 08:57:47 -0700 | [diff] [blame] | 61 | |
| 62 | // The version fingerprints of the tools that built the resource table. |
| 63 | repeated ToolFingerprint tool_fingerprint = 4; |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 64 | } |
| 65 | |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 66 | // A package ID in the range [0x00, 0xff]. |
| 67 | message PackageId { |
| 68 | uint32 id = 1; |
| 69 | } |
| 70 | |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 71 | // Defines resources for an Android package. |
| 72 | message Package { |
| 73 | // The package ID of this package, in the range [0x00, 0xff]. |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 74 | // - ID 0x00 is reserved for shared libraries, or when the ID is assigned at run-time. |
| 75 | // - ID 0x01 is reserved for the 'android' package (framework). |
| 76 | // - ID range [0x02, 0x7f) is reserved for auto-assignment to shared libraries at run-time. |
| 77 | // - ID 0x7f is reserved for the application package. |
| 78 | // - IDs > 0x7f are reserved for the application as well and are treated as feature splits. |
| 79 | // This may not be set if no ID was assigned. |
| 80 | PackageId package_id = 1; |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 81 | |
| 82 | // The Java compatible Android package name of the app. |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 83 | string package_name = 2; |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 84 | |
| 85 | // The series of types defined by the package. |
Adam Lesinski | 4ffea04 | 2017-08-10 15:37:28 -0700 | [diff] [blame] | 86 | repeated Type type = 3; |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 87 | } |
| 88 | |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 89 | // A type ID in the range [0x01, 0xff]. |
| 90 | message TypeId { |
| 91 | uint32 id = 1; |
| 92 | } |
| 93 | |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 94 | // A set of resources grouped under a common type. Such types include string, layout, xml, dimen, |
| 95 | // attr, etc. This maps to the second part of a resource identifier in Java (R.type.entry). |
| 96 | message Type { |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 97 | // The ID of the type. This may not be set if no ID was assigned. |
| 98 | TypeId type_id = 1; |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 99 | |
| 100 | // The name of the type. This corresponds to the 'type' part of a full resource name of the form |
| 101 | // package:type/entry. The set of legal type names is listed in Resource.cpp. |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 102 | string name = 2; |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 103 | |
| 104 | // The entries defined for this type. |
Adam Lesinski | 4ffea04 | 2017-08-10 15:37:28 -0700 | [diff] [blame] | 105 | repeated Entry entry = 3; |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 106 | } |
| 107 | |
Adam Lesinski | 71be705 | 2017-12-12 16:48:07 -0800 | [diff] [blame] | 108 | // The Visibility of a symbol/entry (public, private, undefined). |
| 109 | message Visibility { |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 110 | // The visibility of the resource outside of its package. |
Adam Lesinski | 71be705 | 2017-12-12 16:48:07 -0800 | [diff] [blame] | 111 | enum Level { |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 112 | // No visibility was explicitly specified. This is typically treated as private. |
| 113 | // The distinction is important when two separate R.java files are generated: a public and |
| 114 | // private one. An unknown visibility, in this case, would cause the resource to be omitted |
| 115 | // from either R.java. |
Adam Lesinski | 4ffea04 | 2017-08-10 15:37:28 -0700 | [diff] [blame] | 116 | UNKNOWN = 0; |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 117 | |
| 118 | // A resource was explicitly marked as private. This means the resource can not be accessed |
| 119 | // outside of its package unless the @*package:type/entry notation is used (the asterisk being |
| 120 | // the private accessor). If two R.java files are generated (private + public), the resource |
| 121 | // will only be emitted to the private R.java file. |
Adam Lesinski | 4ffea04 | 2017-08-10 15:37:28 -0700 | [diff] [blame] | 122 | PRIVATE = 1; |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 123 | |
| 124 | // A resource was explicitly marked as public. This means the resource can be accessed |
| 125 | // from any package, and is emitted into all R.java files, public and private. |
Adam Lesinski | 4ffea04 | 2017-08-10 15:37:28 -0700 | [diff] [blame] | 126 | PUBLIC = 2; |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 127 | } |
| 128 | |
Adam Lesinski | 71be705 | 2017-12-12 16:48:07 -0800 | [diff] [blame] | 129 | Level level = 1; |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 130 | |
| 131 | // The path at which this entry's visibility was defined (eg. public.xml). |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 132 | Source source = 2; |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 133 | |
| 134 | // The comment associated with the <public> tag. |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 135 | string comment = 3; |
Adam Lesinski | 71be705 | 2017-12-12 16:48:07 -0800 | [diff] [blame] | 136 | } |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 137 | |
Adam Lesinski | 71be705 | 2017-12-12 16:48:07 -0800 | [diff] [blame] | 138 | // Whether a resource comes from a compile-time overlay and is explicitly allowed to not overlay an |
| 139 | // existing resource. |
| 140 | message AllowNew { |
| 141 | // Where this was defined in source. |
| 142 | Source source = 1; |
| 143 | |
| 144 | // Any comment associated with the declaration. |
| 145 | string comment = 2; |
| 146 | } |
| 147 | |
Ryan Mitchell | 54237ff | 2018-12-13 15:44:29 -0800 | [diff] [blame] | 148 | // Represents a set of overlayable resources. |
Adam Lesinski | 71be705 | 2017-12-12 16:48:07 -0800 | [diff] [blame] | 149 | message Overlayable { |
Winson | b2d7f53 | 2019-02-04 16:32:43 -0800 | [diff] [blame] | 150 | // The name of the <overlayable>. |
Ryan Mitchell | 54237ff | 2018-12-13 15:44:29 -0800 | [diff] [blame] | 151 | string name = 1; |
| 152 | |
Winson | b2d7f53 | 2019-02-04 16:32:43 -0800 | [diff] [blame] | 153 | // The location of the <overlayable> declaration in the source. |
Ryan Mitchell | 54237ff | 2018-12-13 15:44:29 -0800 | [diff] [blame] | 154 | Source source = 2; |
| 155 | |
| 156 | // The component responsible for enabling and disabling overlays targeting this <overlayable>. |
| 157 | string actor = 3; |
| 158 | } |
| 159 | |
| 160 | // Represents an overlayable <item> declaration within an <overlayable> tag. |
| 161 | message OverlayableItem { |
Ryan Mitchell | e4e989c | 2018-10-29 02:21:50 -0700 | [diff] [blame] | 162 | enum Policy { |
Winson | 6bee425 | 2019-02-13 07:57:24 -0800 | [diff] [blame] | 163 | NONE = 0; |
| 164 | PUBLIC = 1; |
| 165 | SYSTEM = 2; |
| 166 | VENDOR = 3; |
| 167 | PRODUCT = 4; |
| 168 | SIGNATURE = 5; |
Ryan Mitchell | 939df09 | 2019-04-09 17:13:50 -0700 | [diff] [blame] | 169 | ODM = 6; |
| 170 | OEM = 7; |
Ryan Mitchell | e4e989c | 2018-10-29 02:21:50 -0700 | [diff] [blame] | 171 | } |
| 172 | |
Ryan Mitchell | 54237ff | 2018-12-13 15:44:29 -0800 | [diff] [blame] | 173 | // The location of the <item> declaration in source. |
Adam Lesinski | 71be705 | 2017-12-12 16:48:07 -0800 | [diff] [blame] | 174 | Source source = 1; |
| 175 | |
| 176 | // Any comment associated with the declaration. |
| 177 | string comment = 2; |
Ryan Mitchell | e4e989c | 2018-10-29 02:21:50 -0700 | [diff] [blame] | 178 | |
Ryan Mitchell | 54237ff | 2018-12-13 15:44:29 -0800 | [diff] [blame] | 179 | // The policy defined by the enclosing <policy> tag of this <item>. |
Ryan Mitchell | 1bb1fe0 | 2018-11-16 11:21:41 -0800 | [diff] [blame] | 180 | repeated Policy policy = 3; |
Ryan Mitchell | 54237ff | 2018-12-13 15:44:29 -0800 | [diff] [blame] | 181 | |
| 182 | // The index into overlayable list that points to the <overlayable> tag that contains |
| 183 | // this <item>. |
| 184 | uint32 overlayable_idx = 4; |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 185 | } |
| 186 | |
| 187 | // An entry ID in the range [0x0000, 0xffff]. |
| 188 | message EntryId { |
| 189 | uint32 id = 1; |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 190 | } |
| 191 | |
| 192 | // An entry declaration. An entry has a full resource ID that is the combination of package ID, |
| 193 | // type ID, and its own entry ID. An entry on its own has no value, but values are defined for |
| 194 | // various configurations/variants. |
| 195 | message Entry { |
| 196 | // The ID of this entry. Together with the package ID and type ID, this forms a full resource ID |
| 197 | // of the form 0xPPTTEEEE, where PP is the package ID, TT is the type ID, and EEEE is the entry |
| 198 | // ID. |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 199 | // This may not be set if no ID was assigned. |
| 200 | EntryId entry_id = 1; |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 201 | |
| 202 | // The name of this entry. This corresponds to the 'entry' part of a full resource name of the |
| 203 | // form package:type/entry. |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 204 | string name = 2; |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 205 | |
Adam Lesinski | 71be705 | 2017-12-12 16:48:07 -0800 | [diff] [blame] | 206 | // The visibility of this entry (public, private, undefined). |
| 207 | Visibility visibility = 3; |
| 208 | |
| 209 | // Whether this resource, when originating from a compile-time overlay, is allowed to NOT overlay |
| 210 | // any existing resources. |
| 211 | AllowNew allow_new = 4; |
| 212 | |
| 213 | // Whether this resource can be overlaid by a runtime resource overlay (RRO). |
Ryan Mitchell | 54237ff | 2018-12-13 15:44:29 -0800 | [diff] [blame] | 214 | OverlayableItem overlayable_item = 5; |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 215 | |
| 216 | // The set of values defined for this entry, each corresponding to a different |
| 217 | // configuration/variant. |
Adam Lesinski | 71be705 | 2017-12-12 16:48:07 -0800 | [diff] [blame] | 218 | repeated ConfigValue config_value = 6; |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 219 | } |
| 220 | |
| 221 | // A Configuration/Value pair. |
| 222 | message ConfigValue { |
Adam Lesinski | b58c3ef | 2017-09-12 17:39:52 -0700 | [diff] [blame] | 223 | Configuration config = 1; |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 224 | Value value = 2; |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 225 | } |
| 226 | |
| 227 | // The generic meta-data for every value in a resource table. |
| 228 | message Value { |
| 229 | // Where the value was defined. |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 230 | Source source = 1; |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 231 | |
| 232 | // Any comment associated with the value. |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 233 | string comment = 2; |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 234 | |
| 235 | // Whether the value can be overridden. |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 236 | bool weak = 3; |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 237 | |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 238 | // The value is either an Item or a CompoundValue. |
| 239 | oneof value { |
| 240 | Item item = 4; |
| 241 | CompoundValue compound_value = 5; |
| 242 | } |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 243 | } |
| 244 | |
| 245 | // An Item is an abstract type. It represents a value that can appear inline in many places, such |
| 246 | // as XML attribute values or on the right hand side of style attribute definitions. The concrete |
| 247 | // type is one of the types below. Only one can be set. |
| 248 | message Item { |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 249 | oneof value { |
| 250 | Reference ref = 1; |
| 251 | String str = 2; |
| 252 | RawString raw_str = 3; |
| 253 | StyledString styled_str = 4; |
| 254 | FileReference file = 5; |
| 255 | Id id = 6; |
| 256 | Primitive prim = 7; |
| 257 | } |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 258 | } |
| 259 | |
| 260 | // A CompoundValue is an abstract type. It represents a value that is a made of other values. |
| 261 | // These can only usually appear as top-level resources. The concrete type is one of the types |
| 262 | // below. Only one can be set. |
| 263 | message CompoundValue { |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 264 | oneof value { |
| 265 | Attribute attr = 1; |
| 266 | Style style = 2; |
| 267 | Styleable styleable = 3; |
| 268 | Array array = 4; |
| 269 | Plural plural = 5; |
| 270 | } |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 271 | } |
| 272 | |
| 273 | // A value that is a reference to another resource. This reference can be by name or resource ID. |
Adam Lesinski | 59e04c6 | 2016-02-04 15:59:23 -0800 | [diff] [blame] | 274 | message Reference { |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 275 | enum Type { |
| 276 | // A plain reference (@package:type/entry). |
Adam Lesinski | 4ffea04 | 2017-08-10 15:37:28 -0700 | [diff] [blame] | 277 | REFERENCE = 0; |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 278 | |
| 279 | // A reference to a theme attribute (?package:type/entry). |
Adam Lesinski | 4ffea04 | 2017-08-10 15:37:28 -0700 | [diff] [blame] | 280 | ATTRIBUTE = 1; |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 281 | } |
| 282 | |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 283 | Type type = 1; |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 284 | |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 285 | // The resource ID (0xPPTTEEEE) of the resource being referred. This is optional. |
| 286 | uint32 id = 2; |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 287 | |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 288 | // The name of the resource being referred. This is optional if the resource ID is set. |
| 289 | string name = 3; |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 290 | |
| 291 | // Whether this reference is referencing a private resource (@*package:type/entry). |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 292 | bool private = 4; |
Adam Lesinski | 59e04c6 | 2016-02-04 15:59:23 -0800 | [diff] [blame] | 293 | } |
| 294 | |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 295 | // A value that represents an ID. This is just a placeholder, as ID values are used to occupy a |
| 296 | // resource ID (0xPPTTEEEE) as a unique identifier. Their value is unimportant. |
Adam Lesinski | 59e04c6 | 2016-02-04 15:59:23 -0800 | [diff] [blame] | 297 | message Id { |
| 298 | } |
| 299 | |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 300 | // A value that is a string. |
Adam Lesinski | 59e04c6 | 2016-02-04 15:59:23 -0800 | [diff] [blame] | 301 | message String { |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 302 | string value = 1; |
Adam Lesinski | 59e04c6 | 2016-02-04 15:59:23 -0800 | [diff] [blame] | 303 | } |
| 304 | |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 305 | // A value that is a raw string, which is unescaped/uninterpreted. This is typically used to |
| 306 | // represent the value of a style attribute before the attribute is compiled and the set of |
| 307 | // allowed values is known. |
Adam Lesinski | 59e04c6 | 2016-02-04 15:59:23 -0800 | [diff] [blame] | 308 | message RawString { |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 309 | string value = 1; |
Adam Lesinski | 0853500 | 2017-08-04 16:15:17 -0700 | [diff] [blame] | 310 | } |
| 311 | |
| 312 | // A string with styling information, like html tags that specify boldness, italics, etc. |
| 313 | message StyledString { |
| 314 | // The raw text of the string. |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 315 | string value = 1; |
Adam Lesinski | 0853500 | 2017-08-04 16:15:17 -0700 | [diff] [blame] | 316 | |
| 317 | // A Span marks a region of the string text that is styled. |
| 318 | message Span { |
| 319 | // The name of the tag, and its attributes, encoded as follows: |
| 320 | // tag_name;attr1=value1;attr2=value2;[...] |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 321 | string tag = 1; |
Adam Lesinski | 0853500 | 2017-08-04 16:15:17 -0700 | [diff] [blame] | 322 | |
| 323 | // The first character position this span applies to, in UTF-16 offset. |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 324 | uint32 first_char = 2; |
Adam Lesinski | 0853500 | 2017-08-04 16:15:17 -0700 | [diff] [blame] | 325 | |
| 326 | // The last character position this span applies to, in UTF-16 offset. |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 327 | uint32 last_char = 3; |
Adam Lesinski | 0853500 | 2017-08-04 16:15:17 -0700 | [diff] [blame] | 328 | } |
| 329 | |
| 330 | repeated Span span = 2; |
Adam Lesinski | 59e04c6 | 2016-02-04 15:59:23 -0800 | [diff] [blame] | 331 | } |
| 332 | |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 333 | // A value that is a reference to an external entity, like an XML file or a PNG. |
Adam Lesinski | 59e04c6 | 2016-02-04 15:59:23 -0800 | [diff] [blame] | 334 | message FileReference { |
Adam Lesinski | e59f0d8 | 2017-10-13 09:36:53 -0700 | [diff] [blame] | 335 | enum Type { |
| 336 | UNKNOWN = 0; |
| 337 | PNG = 1; |
| 338 | BINARY_XML = 2; |
| 339 | PROTO_XML = 3; |
| 340 | } |
| 341 | |
Adam Lesinski | 0853500 | 2017-08-04 16:15:17 -0700 | [diff] [blame] | 342 | // Path to a file within the APK (typically res/type-config/entry.ext). |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 343 | string path = 1; |
Adam Lesinski | e59f0d8 | 2017-10-13 09:36:53 -0700 | [diff] [blame] | 344 | |
| 345 | // The type of file this path points to. For UAM bundle, this cannot be |
| 346 | // BINARY_XML. |
| 347 | Type type = 2; |
Adam Lesinski | 59e04c6 | 2016-02-04 15:59:23 -0800 | [diff] [blame] | 348 | } |
| 349 | |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 350 | // A value that represents a primitive data type (float, int, boolean, etc.). |
Michael Wachenschwanz | 8b74927 | 2018-04-18 18:52:47 -0700 | [diff] [blame] | 351 | // Refer to Res_value in ResourceTypes.h for info on types and formatting |
Adam Lesinski | 59e04c6 | 2016-02-04 15:59:23 -0800 | [diff] [blame] | 352 | message Primitive { |
Michael Wachenschwanz | d06f1f3 | 2018-01-11 18:36:22 -0800 | [diff] [blame] | 353 | message NullType { |
| 354 | } |
| 355 | message EmptyType { |
| 356 | } |
| 357 | oneof oneof_value { |
| 358 | NullType null_value = 1; |
| 359 | EmptyType empty_value = 2; |
| 360 | float float_value = 3; |
Michael Wachenschwanz | 8b74927 | 2018-04-18 18:52:47 -0700 | [diff] [blame] | 361 | uint32 dimension_value = 13; |
| 362 | uint32 fraction_value = 14; |
Michael Wachenschwanz | d06f1f3 | 2018-01-11 18:36:22 -0800 | [diff] [blame] | 363 | int32 int_decimal_value = 6; |
Dave Ingram | 22ed412 | 2018-01-30 16:11:52 -0800 | [diff] [blame] | 364 | uint32 int_hexadecimal_value = 7; |
Michael Wachenschwanz | d06f1f3 | 2018-01-11 18:36:22 -0800 | [diff] [blame] | 365 | bool boolean_value = 8; |
| 366 | uint32 color_argb8_value = 9; |
| 367 | uint32 color_rgb8_value = 10; |
| 368 | uint32 color_argb4_value = 11; |
| 369 | uint32 color_rgb4_value = 12; |
Michael Wachenschwanz | 8b74927 | 2018-04-18 18:52:47 -0700 | [diff] [blame] | 370 | float dimension_value_deprecated = 4 [deprecated=true]; |
| 371 | float fraction_value_deprecated = 5 [deprecated=true]; |
Michael Wachenschwanz | d06f1f3 | 2018-01-11 18:36:22 -0800 | [diff] [blame] | 372 | } |
Adam Lesinski | 59e04c6 | 2016-02-04 15:59:23 -0800 | [diff] [blame] | 373 | } |
| 374 | |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 375 | // A value that represents an XML attribute and what values it accepts. |
Adam Lesinski | 59e04c6 | 2016-02-04 15:59:23 -0800 | [diff] [blame] | 376 | message Attribute { |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 377 | // A Symbol used to represent an enum or a flag. |
| 378 | message Symbol { |
| 379 | // Where the enum/flag item was defined. |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 380 | Source source = 1; |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 381 | |
| 382 | // Any comments associated with the enum or flag. |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 383 | string comment = 2; |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 384 | |
| 385 | // The name of the enum/flag as a reference. Enums/flag items are generated as ID resource |
| 386 | // values. |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 387 | Reference name = 3; |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 388 | |
| 389 | // The value of the enum/flag. |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 390 | uint32 value = 4; |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 391 | } |
| 392 | |
Adam Lesinski | 4ffea04 | 2017-08-10 15:37:28 -0700 | [diff] [blame] | 393 | // Bitmask of formats allowed for an attribute. |
| 394 | enum FormatFlags { |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 395 | NONE = 0x0; // Proto3 requires a default of 0. |
Adam Lesinski | 4ffea04 | 2017-08-10 15:37:28 -0700 | [diff] [blame] | 396 | ANY = 0x0000ffff; // Allows any type except ENUM and FLAGS. |
| 397 | REFERENCE = 0x01; // Allows Reference values. |
| 398 | STRING = 0x02; // Allows String/StyledString values. |
| 399 | INTEGER = 0x04; // Allows any integer BinaryPrimitive values. |
| 400 | BOOLEAN = 0x08; // Allows any boolean BinaryPrimitive values. |
| 401 | COLOR = 0x010; // Allows any color BinaryPrimitive values. |
| 402 | FLOAT = 0x020; // Allows any float BinaryPrimitive values. |
| 403 | DIMENSION = 0x040; // Allows any dimension BinaryPrimitive values. |
| 404 | FRACTION = 0x080; // Allows any fraction BinaryPrimitive values. |
| 405 | ENUM = 0x00010000; // Allows enums that are defined in the Attribute's symbols. |
| 406 | // ENUM and FLAGS cannot BOTH be set. |
| 407 | FLAGS = 0x00020000; // Allows flags that are defined in the Attribute's symbols. |
| 408 | // ENUM and FLAGS cannot BOTH be set. |
| 409 | } |
| 410 | |
| 411 | // A bitmask of types that this XML attribute accepts. Corresponds to the flags in the |
| 412 | // enum FormatFlags. |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 413 | uint32 format_flags = 1; |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 414 | |
| 415 | // The smallest integer allowed for this XML attribute. Only makes sense if the format includes |
Adam Lesinski | 4ffea04 | 2017-08-10 15:37:28 -0700 | [diff] [blame] | 416 | // FormatFlags::INTEGER. |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 417 | int32 min_int = 2; |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 418 | |
| 419 | // The largest integer allowed for this XML attribute. Only makes sense if the format includes |
Adam Lesinski | 4ffea04 | 2017-08-10 15:37:28 -0700 | [diff] [blame] | 420 | // FormatFlags::INTEGER. |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 421 | int32 max_int = 3; |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 422 | |
| 423 | // The set of enums/flags defined in this attribute. Only makes sense if the format includes |
Adam Lesinski | 4ffea04 | 2017-08-10 15:37:28 -0700 | [diff] [blame] | 424 | // either FormatFlags::ENUM or FormatFlags::FLAGS. Having both is an error. |
| 425 | repeated Symbol symbol = 4; |
Adam Lesinski | 59e04c6 | 2016-02-04 15:59:23 -0800 | [diff] [blame] | 426 | } |
| 427 | |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 428 | // A value that represents a style. |
Adam Lesinski | 59e04c6 | 2016-02-04 15:59:23 -0800 | [diff] [blame] | 429 | message Style { |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 430 | // An XML attribute/value pair defined in the style. |
| 431 | message Entry { |
| 432 | // Where the entry was defined. |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 433 | Source source = 1; |
Adam Lesinski | 59e04c6 | 2016-02-04 15:59:23 -0800 | [diff] [blame] | 434 | |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 435 | // Any comments associated with the entry. |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 436 | string comment = 2; |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 437 | |
| 438 | // A reference to the XML attribute. |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 439 | Reference key = 3; |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 440 | |
| 441 | // The Item defined for this XML attribute. |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 442 | Item item = 4; |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 443 | } |
| 444 | |
| 445 | // The optinal style from which this style inherits attributes. |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 446 | Reference parent = 1; |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 447 | |
| 448 | // The source file information of the parent inheritance declaration. |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 449 | Source parent_source = 2; |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 450 | |
| 451 | // The set of XML attribute/value pairs for this style. |
Adam Lesinski | 4ffea04 | 2017-08-10 15:37:28 -0700 | [diff] [blame] | 452 | repeated Entry entry = 3; |
Adam Lesinski | 59e04c6 | 2016-02-04 15:59:23 -0800 | [diff] [blame] | 453 | } |
| 454 | |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 455 | // A value that represents a <declare-styleable> XML resource. These are not real resources and |
| 456 | // only end up as Java fields in the generated R.java. They do not end up in the binary ARSC file. |
Adam Lesinski | 59e04c6 | 2016-02-04 15:59:23 -0800 | [diff] [blame] | 457 | message Styleable { |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 458 | // An attribute defined for this styleable. |
| 459 | message Entry { |
| 460 | // Where the attribute was defined within the <declare-styleable> block. |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 461 | Source source = 1; |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 462 | |
| 463 | // Any comments associated with the declaration. |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 464 | string comment = 2; |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 465 | |
| 466 | // The reference to the attribute. |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 467 | Reference attr = 3; |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 468 | } |
| 469 | |
| 470 | // The set of attribute declarations. |
Adam Lesinski | 4ffea04 | 2017-08-10 15:37:28 -0700 | [diff] [blame] | 471 | repeated Entry entry = 1; |
Adam Lesinski | 59e04c6 | 2016-02-04 15:59:23 -0800 | [diff] [blame] | 472 | } |
| 473 | |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 474 | // A value that represents an array of resource values. |
Adam Lesinski | 59e04c6 | 2016-02-04 15:59:23 -0800 | [diff] [blame] | 475 | message Array { |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 476 | // A single element of the array. |
Adam Lesinski | 4ffea04 | 2017-08-10 15:37:28 -0700 | [diff] [blame] | 477 | message Element { |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 478 | // Where the element was defined. |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 479 | Source source = 1; |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 480 | |
| 481 | // Any comments associated with the element. |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 482 | string comment = 2; |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 483 | |
| 484 | // The value assigned to this element. |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 485 | Item item = 3; |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 486 | } |
| 487 | |
| 488 | // The list of array elements. |
Adam Lesinski | 4ffea04 | 2017-08-10 15:37:28 -0700 | [diff] [blame] | 489 | repeated Element element = 1; |
Adam Lesinski | 59e04c6 | 2016-02-04 15:59:23 -0800 | [diff] [blame] | 490 | } |
| 491 | |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 492 | // A value that represents a string and its many variations based on plurality. |
Adam Lesinski | 59e04c6 | 2016-02-04 15:59:23 -0800 | [diff] [blame] | 493 | message Plural { |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 494 | // The arity of the plural. |
| 495 | enum Arity { |
Adam Lesinski | 4ffea04 | 2017-08-10 15:37:28 -0700 | [diff] [blame] | 496 | ZERO = 0; |
| 497 | ONE = 1; |
| 498 | TWO = 2; |
| 499 | FEW = 3; |
| 500 | MANY = 4; |
| 501 | OTHER = 5; |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 502 | } |
Adam Lesinski | 59e04c6 | 2016-02-04 15:59:23 -0800 | [diff] [blame] | 503 | |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 504 | // The plural value for a given arity. |
| 505 | message Entry { |
| 506 | // Where the plural was defined. |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 507 | Source source = 1; |
Adam Lesinski | 59e04c6 | 2016-02-04 15:59:23 -0800 | [diff] [blame] | 508 | |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 509 | // Any comments associated with the plural. |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 510 | string comment = 2; |
Adam Lesinski | 59e04c6 | 2016-02-04 15:59:23 -0800 | [diff] [blame] | 511 | |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 512 | // The arity of the plural. |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 513 | Arity arity = 3; |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 514 | |
| 515 | // The value assigned to this plural. |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 516 | Item item = 4; |
Adam Lesinski | 0c80895 | 2017-07-10 05:40:39 -0700 | [diff] [blame] | 517 | } |
| 518 | |
| 519 | // The set of arity/plural mappings. |
Adam Lesinski | 4ffea04 | 2017-08-10 15:37:28 -0700 | [diff] [blame] | 520 | repeated Entry entry = 1; |
| 521 | } |
| 522 | |
| 523 | // Defines an abstract XmlNode that must be either an XmlElement, or |
| 524 | // a text node represented by a string. |
| 525 | message XmlNode { |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 526 | oneof node { |
| 527 | XmlElement element = 1; |
| 528 | string text = 2; |
| 529 | } |
Adam Lesinski | 4ffea04 | 2017-08-10 15:37:28 -0700 | [diff] [blame] | 530 | |
| 531 | // Source line and column info. |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 532 | SourcePosition source = 3; |
Adam Lesinski | 4ffea04 | 2017-08-10 15:37:28 -0700 | [diff] [blame] | 533 | } |
| 534 | |
| 535 | // An <element> in an XML document. |
| 536 | message XmlElement { |
| 537 | // Namespaces defined on this element. |
| 538 | repeated XmlNamespace namespace_declaration = 1; |
| 539 | |
| 540 | // The namespace URI of this element. |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 541 | string namespace_uri = 2; |
Adam Lesinski | 4ffea04 | 2017-08-10 15:37:28 -0700 | [diff] [blame] | 542 | |
| 543 | // The name of this element. |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 544 | string name = 3; |
Adam Lesinski | 4ffea04 | 2017-08-10 15:37:28 -0700 | [diff] [blame] | 545 | |
| 546 | // The attributes of this element. |
| 547 | repeated XmlAttribute attribute = 4; |
| 548 | |
| 549 | // The children of this element. |
| 550 | repeated XmlNode child = 5; |
| 551 | } |
| 552 | |
| 553 | // A namespace declaration on an XmlElement (xmlns:android="http://..."). |
| 554 | message XmlNamespace { |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 555 | string prefix = 1; |
| 556 | string uri = 2; |
Adam Lesinski | 4ffea04 | 2017-08-10 15:37:28 -0700 | [diff] [blame] | 557 | |
| 558 | // Source line and column info. |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 559 | SourcePosition source = 3; |
Adam Lesinski | 4ffea04 | 2017-08-10 15:37:28 -0700 | [diff] [blame] | 560 | } |
| 561 | |
| 562 | // An attribute defined on an XmlElement (android:text="..."). |
| 563 | message XmlAttribute { |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 564 | string namespace_uri = 1; |
| 565 | string name = 2; |
| 566 | string value = 3; |
Adam Lesinski | 4ffea04 | 2017-08-10 15:37:28 -0700 | [diff] [blame] | 567 | |
| 568 | // Source line and column info. |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 569 | SourcePosition source = 4; |
Adam Lesinski | 4ffea04 | 2017-08-10 15:37:28 -0700 | [diff] [blame] | 570 | |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 571 | // The optional resource ID (0xPPTTEEEE) of the attribute. |
| 572 | uint32 resource_id = 5; |
Adam Lesinski | 4ffea04 | 2017-08-10 15:37:28 -0700 | [diff] [blame] | 573 | |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 574 | // The optional interpreted/compiled version of the `value` string. |
| 575 | Item compiled_item = 6; |
Adam Lesinski | 59e04c6 | 2016-02-04 15:59:23 -0800 | [diff] [blame] | 576 | } |