Skip to content

Commit 97ad5c0

Browse files
authored
Adds XSD for WFF v4 (#86)
1 parent c788440 commit 97ad5c0

File tree

104 files changed

+5527
-6
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+5527
-6
lines changed

play-validations/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ in Google Play reviews, but these represent reasonable settings for evaluation:
3939

4040
```shell
4141
java -jar ./memory-footprint.jar --watch-face MyWatchFace.apk \
42-
--schema-version 2 \
42+
--schema-version 4 \
4343
--ambient-limit-mb 10 \
4444
--active-limit-mb 100 \
4545
--apply-v1-offload-limitations \

play-validations/memory-footprint/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ plugins {
1818
id 'org.jetbrains.kotlin.jvm' version "2.0.21"
1919
}
2020

21-
def baseVersion = "1.4.2"
21+
def baseVersion = "1.5.0"
2222

2323
dependencies {
2424
implementation 'com.twelvemonkeys.imageio:imageio-webp:3.9.4'

play-validations/memory-footprint/src/main/java/com/google/wear/watchface/dfx/memory/EvaluationSettings.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ class EvaluationSettings(
221221
private const val HONEYFACE_VERSION = "honeyface"
222222
private const val GREEDY_DEFAULT_LIMIT = 10_000_000
223223

224-
private val SUPPORTED_VERSIONS: List<String> = ImmutableList.of(HONEYFACE_VERSION, "1", "2", "3")
224+
private val SUPPORTED_VERSIONS: List<String> = ImmutableList.of(HONEYFACE_VERSION, "1", "2", "3", "4")
225225

226226
@JvmStatic
227227
fun parseFromArguments(vararg arguments: String): Optional<EvaluationSettings> =

third_party/wff/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ java -jar wff-validator.jar <format-version> <any options> <your-watchface.xml>
3535
For example:
3636

3737
```shell
38-
java -jar wff-validator.jar 2 ~/MyWatchface/res/raw/watchface.xml
38+
java -jar wff-validator.jar 4 ~/MyWatchface/res/raw/watchface.xml
3939
```
4040

4141
[xsd-files]: specification/documents/1
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
Copyright 2023 Samsung Electronics Co., Ltd All Rights Reserved
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
18+
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
19+
<xs:include schemaLocation="common/attributes/geometricAttributes.xsd"/>
20+
21+
22+
<xs:complexType name="_characterBitmapImportDataType">
23+
<xs:attribute name="name" use="required">
24+
<xs:simpleType>
25+
<xs:restriction base="xs:string">
26+
<xs:pattern value="."/>
27+
</xs:restriction>
28+
</xs:simpleType>
29+
</xs:attribute>
30+
31+
<xs:attribute name="resource" type="xs:string" use="required"/>
32+
<xs:attributeGroup ref="sizeAttributesRequired"/>
33+
<xs:attributeGroup ref="margins"/>
34+
</xs:complexType>
35+
36+
<xs:complexType name="_wordBitmapImportDataType">
37+
<xs:attribute name="name" use="required">
38+
<xs:simpleType>
39+
<xs:restriction base="xs:string">
40+
<xs:pattern value=".{1,}"/>
41+
</xs:restriction>
42+
</xs:simpleType>
43+
</xs:attribute>
44+
45+
<xs:attribute name="resource" type="xs:string" use="required"/>
46+
<xs:attributeGroup ref="sizeAttributesRequired"/>
47+
<xs:attributeGroup ref="margins"/>
48+
</xs:complexType>
49+
50+
<xs:element name="BitmapFonts">
51+
<xs:complexType>
52+
<xs:annotation>
53+
<xs:documentation>
54+
User-defined bitmap fonts can be declared in this scope.
55+
</xs:documentation>
56+
</xs:annotation>
57+
58+
<xs:choice maxOccurs="unbounded">
59+
<xs:element name="BitmapFont" minOccurs="1" maxOccurs="unbounded">
60+
<xs:complexType>
61+
<xs:annotation>
62+
<xs:documentation>
63+
User-defined bitmap font can be declared with this element.
64+
Put the name for the family attribute in the font element.
65+
</xs:documentation>
66+
</xs:annotation>
67+
68+
<xs:choice minOccurs="1" maxOccurs="unbounded">
69+
<xs:choice>
70+
<xs:element name="Character" type="_characterBitmapImportDataType"/>
71+
<xs:element name="Word" type="_wordBitmapImportDataType"/>
72+
</xs:choice>
73+
</xs:choice>
74+
75+
<xs:attribute name="name" type="xs:string" use="required"/>
76+
</xs:complexType>
77+
78+
<xs:unique name="Validation.Unique.BitmapFont.Child.Name">
79+
<xs:selector xpath="*"/>
80+
<xs:field xpath="@name"/>
81+
</xs:unique>
82+
</xs:element>
83+
</xs:choice>
84+
</xs:complexType>
85+
</xs:element>
86+
</xs:schema>
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
Copyright 2023 Samsung Electronics Co., Ltd All Rights Reserved
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
18+
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
19+
<xs:include schemaLocation="../group/renderModeType.xsd"/>
20+
<xs:include schemaLocation="../common/attributes/geometricAttributes.xsd"/>
21+
<xs:include schemaLocation="../common/transform/pivotType.xsd"/>
22+
<xs:include schemaLocation="../common/variant/variantElements.xsd" />
23+
<xs:include schemaLocation="hourHand.xsd"/>
24+
<xs:include schemaLocation="minuteHand.xsd"/>
25+
<xs:include schemaLocation="secondHand.xsd"/>
26+
27+
<xs:element name="AnalogClock">
28+
<xs:annotation>
29+
<xs:documentation>
30+
AnalogClock is a container that represents a traditional clock with
31+
rotating hands.
32+
</xs:documentation>
33+
</xs:annotation>
34+
<xs:complexType>
35+
<xs:all>
36+
<xs:element ref="HourHand" minOccurs="0" maxOccurs="2"/>
37+
<xs:element ref="MinuteHand" minOccurs="0" maxOccurs="2"/>
38+
<xs:element ref="SecondHand" minOccurs="0" maxOccurs="2"/>
39+
<xs:element ref="Localization" minOccurs="0" maxOccurs="1"/>
40+
<xs:element ref="Variant" minOccurs="0" maxOccurs="unbounded"/>
41+
</xs:all>
42+
43+
<xs:attributeGroup ref="geometricAttributesRequired"/>
44+
<xs:attributeGroup ref="pivot2D"/>
45+
<xs:attribute name="angle" type="angleType"/>
46+
<xs:attribute ref="alpha"/>
47+
<xs:attribute name="scaleX" type='xs:float'/>
48+
<xs:attribute name="scaleY" type='xs:float'/>
49+
<xs:attribute name="renderMode" type="renderModeType" default="SOURCE"/>
50+
<xs:attribute name="tintColor" type='colorAttributeType'/>
51+
</xs:complexType>
52+
</xs:element>
53+
</xs:schema>
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
Copyright 2023 Samsung Electronics Co., Ltd All Rights Reserved
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
18+
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
19+
<xs:include schemaLocation="../group/renderModeType.xsd"/>
20+
<xs:include schemaLocation="../common/attributes/geometricAttributes.xsd"/>
21+
<xs:include schemaLocation="../common/transform/pivotType.xsd"/>
22+
<xs:include schemaLocation="../userConfiguration/listConfigurationElement.xsd"/>
23+
<xs:include schemaLocation="../common/variant/variantElements.xsd" />
24+
<xs:include schemaLocation="timeText.xsd"/>
25+
26+
<xs:element name="DigitalClock">
27+
<xs:annotation>
28+
<xs:documentation>
29+
DigitalClock is a container for text-based formatted time.
30+
</xs:documentation>
31+
</xs:annotation>
32+
<xs:complexType>
33+
<xs:all>
34+
<xs:element ref="Localization" minOccurs="0" maxOccurs="1"/>
35+
<xs:element ref="Variant" minOccurs="0" maxOccurs="unbounded"/>
36+
<xs:element ref="TimeText" minOccurs="1" maxOccurs="unbounded"/>
37+
</xs:all>
38+
39+
<xs:attributeGroup ref="geometricAttributesRequired"/>
40+
<xs:attributeGroup ref="pivot2D"/>
41+
<xs:attribute name="angle" type="angleType"/>
42+
<xs:attribute ref="alpha"/>
43+
<xs:attribute name="scaleX" type='xs:float'/>
44+
<xs:attribute name="scaleY" type='xs:float'/>
45+
<xs:attribute name="renderMode" type="renderModeType" default="SOURCE"/>
46+
<xs:attribute name="tintColor" type='colorAttributeType'/>
47+
</xs:complexType>
48+
</xs:element>
49+
</xs:schema>
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
Copyright 2023 Samsung Electronics Co., Ltd All Rights Reserved
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
18+
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
19+
<xs:include schemaLocation="../common/attributes/geometricAttributes.xsd"/>
20+
<xs:include schemaLocation="../common/transform/pivotType.xsd"/>
21+
<xs:include schemaLocation="../userConfiguration/listConfigurationElement.xsd"/>
22+
<xs:include schemaLocation="../common/variant/variantElements.xsd" />
23+
24+
<xs:element name="HourHand">
25+
<xs:annotation>
26+
<xs:documentation>
27+
A image that represents an hour hand, it rotates 360 degree in 12 hours.
28+
</xs:documentation>
29+
</xs:annotation>
30+
<xs:complexType>
31+
<xs:choice maxOccurs="unbounded">
32+
<xs:element ref="Variant" minOccurs="0" maxOccurs="unbounded"/>
33+
</xs:choice>
34+
35+
<xs:attribute name="resource" type="xs:string" use="required"/>
36+
<xs:attributeGroup ref="geometricAttributesRequired"/>
37+
<xs:attributeGroup ref="pivot2D"/>
38+
<xs:attribute ref="alpha"/>
39+
<xs:attribute name="tintColor" type='colorAttributeType'/>
40+
</xs:complexType>
41+
</xs:element>
42+
</xs:schema>
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
Copyright 2023 Samsung Electronics Co., Ltd All Rights Reserved
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
18+
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
19+
<xs:include schemaLocation="../common/attributes/geometricAttributes.xsd"/>
20+
<xs:include schemaLocation="../common/transform/pivotType.xsd"/>
21+
<xs:include schemaLocation="../userConfiguration/listConfigurationElement.xsd"/>
22+
<xs:include schemaLocation="../common/variant/variantElements.xsd" />
23+
24+
<xs:element name="MinuteHand">
25+
<xs:annotation>
26+
<xs:documentation>
27+
A image that represent a minute hand, it rotates 360 degree in 1 hour.
28+
</xs:documentation>
29+
</xs:annotation>
30+
<xs:complexType>
31+
<xs:choice maxOccurs="unbounded">
32+
<xs:element ref="Variant" minOccurs="0" maxOccurs="unbounded"/>
33+
</xs:choice>
34+
35+
<xs:attribute name="resource" type="xs:string" use="required"/>
36+
<xs:attributeGroup ref="geometricAttributesRequired"/>
37+
<xs:attributeGroup ref="pivot2D"/>
38+
<xs:attribute ref="alpha"/>
39+
<xs:attribute name="tintColor" type='colorAttributeType'/>
40+
</xs:complexType>
41+
</xs:element>
42+
</xs:schema>

0 commit comments

Comments
 (0)