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
17syntax = "proto2";
18
19option optimize_for = LITE_RUNTIME;
20
21package aapt.pb;
22
23message ConfigDescription {
24	optional bytes data = 1;
25	optional string product = 2;
26}
27
28message StringPool {
29	optional bytes data = 1;
30}
31
32message CompiledFile {
33	message Symbol {
34		optional string resource_name = 1;
35		optional uint32 line_no = 2;
36	}
37
38	optional string resource_name = 1;
39	optional ConfigDescription config = 2;
40	optional string source_path = 3;
41	repeated Symbol exported_symbols = 4;
42}
43
44message ResourceTable {
45	optional StringPool string_pool = 1;
46	optional StringPool source_pool = 2;
47	optional StringPool symbol_pool = 3;
48	repeated Package packages = 4;
49}
50
51message Package {
52	optional uint32 package_id = 1;
53	optional string package_name = 2;
54	repeated Type types = 3;
55}
56
57message Type {
58	optional uint32 id = 1;
59	optional string name = 2;
60	repeated Entry entries = 3;
61}
62
63message SymbolStatus {
64	enum Visibility {
65		Unknown = 0;
66		Private = 1;
67		Public = 2;
68	}
69	optional Visibility visibility = 1;
70	optional Source source = 2;
71	optional string comment = 3;
72	optional bool allow_new = 4;
73}
74
75message Entry {
76	optional uint32 id = 1;
77	optional string name = 2;
78	optional SymbolStatus symbol_status = 3;
79	repeated ConfigValue config_values = 4;
80}
81
82message ConfigValue {
83	optional ConfigDescription config = 1;
84	optional Value value = 2;
85}
86
87message Source {
88	optional uint32 path_idx = 1;
89	optional uint32 line_no = 2;
90	optional uint32 col_no = 3;
91}
92
93message Reference {
94	enum Type {
95		Ref = 0;
96		Attr = 1;
97	}
98	optional Type type = 1;
99	optional uint32 id = 2;
100	optional uint32 symbol_idx = 3;
101	optional bool private = 4;
102}
103
104message Id {
105}
106
107message String {
108	optional uint32 idx = 1;
109}
110
111message RawString {
112	optional uint32 idx = 1;
113}
114
115message FileReference {
116	optional uint32 path_idx = 1;
117}
118
119message Primitive {
120	optional uint32 type = 1;
121	optional uint32 data = 2;
122}
123
124message Attribute {
125	message Symbol {
126		optional Source source = 1;
127		optional string comment = 2;
128		optional Reference name = 3;
129		optional uint32 value = 4;
130	}
131	optional uint32 format_flags = 1;
132	optional int32 min_int = 2;
133	optional int32 max_int = 3;
134	repeated Symbol symbols = 4;
135}
136
137message Style {
138	message Entry {
139		optional Source source = 1;
140		optional string comment = 2;
141		optional Reference key = 3;
142		optional Item item = 4;
143	}
144
145	optional Reference parent = 1;
146	optional Source parent_source = 2;
147	repeated Entry entries = 3;
148}
149
150message Styleable {
151	message Entry {
152		optional Source source = 1;
153		optional string comment = 2;
154		optional Reference attr = 3;
155	}
156	repeated Entry entries = 1;
157}
158
159message Array {
160	message Entry {
161		optional Source source = 1;
162		optional string comment = 2;
163		optional Item item = 3;
164	}
165	repeated Entry entries = 1;
166}
167
168message Plural {
169	enum Arity {
170		Zero = 0;
171		One = 1;
172		Two = 2;
173		Few = 3;
174		Many = 4;
175		Other = 5;
176	}
177
178	message Entry {
179		optional Source source = 1;
180		optional string comment = 2;
181		optional Arity arity = 3;
182		optional Item item = 4;
183	}
184	repeated Entry entries = 1;
185}
186
187message Item {
188	optional Reference ref = 1;
189	optional String str = 2;
190	optional RawString raw_str = 3;
191	optional FileReference file = 4;
192	optional Id id = 5;
193	optional Primitive prim = 6;
194}
195
196message CompoundValue {
197	optional Attribute attr = 1;
198	optional Style style = 2;
199	optional Styleable styleable = 3;
200	optional Array array = 4;
201	optional Plural plural = 5;
202}
203
204message Value {
205	optional Source source = 1;
206	optional string comment = 2;
207	optional bool weak = 3;
208
209	optional Item item = 4;
210	optional CompoundValue compound_value = 5;
211}
212