From 1538ebaf220ebc25243f2f71eb26c91cdf10548a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20Ka=CC=88fer?= Date: Mon, 27 Jan 2014 17:21:48 +0100 Subject: cascade styles --- proto/style.proto | 44 +++++++++++++++++++++++++++++++++++++------- 1 file changed, 37 insertions(+), 7 deletions(-) (limited to 'proto') diff --git a/proto/style.proto b/proto/style.proto index d5f1c6c9f5..5a977d799c 100644 --- a/proto/style.proto +++ b/proto/style.proto @@ -2,6 +2,8 @@ enum bucket_type { fill = 1; line = 2; point = 3; + + background = 15; } enum cap_type { @@ -13,6 +15,17 @@ enum join_type { bevel = 2; } +enum winding_type { + evenodd = 1; + nonzero = 2; +} + +enum property_type { + null = 1; + constant = 2; + stops = 3; +} + message value { // Exactly one of these values may be present in a valid message optional string string_value = 1; @@ -49,21 +62,38 @@ message layer { repeated layer child_layer = 3; } -message width { - optional string scaling = 1; +message property { + required property_type function = 1; repeated float value = 2 [ packed = true ]; } -message layer_style { +message fill_style { + required string layer_name = 1; + optional property hidden = 2; + optional winding_type winding = 3 [ default = nonzero ]; + optional property antialias = 4; + optional fixed32 fill_color = 5 [ default = 0x000000FF ]; // rgba (=> rgb << 8 | 0xFF for opaque!) + optional fixed32 stroke_color = 6; // if none is specified, no stroke will be painted + optional property opacity = 7; // values from 0..1 + // TODO: translate x/y +} + +message stroke_style { required string layer_name = 1; - optional fixed32 color = 2; // rgba (=> rgb << 8 | 0xFF for opaque!) - optional bool antialias = 3; - optional width width = 4; + optional property hidden = 2; + optional fixed32 color = 3 [ default = 0x000000FF ]; // rgba (=> rgb << 8 | 0xFF for opaque!) + optional property width = 4; + optional property offset = 5; + // line join + line cap are already defined in the + // TODO: dasharray + // TODO: image/icon + // TODO: translate x/y } message class { required string name = 1; - repeated layer_style layer = 2; + repeated fill_style fill = 2; + repeated stroke_style stroke = 3; } // root level object -- cgit v1.2.1