1use std::{any::TypeId, collections::BTreeSet, marker::PhantomData};
5
6use crate::legacy::{layout::symbol_feature::SymbolGeometryTileFeature, CanonicalTileID};
7
8#[derive(Clone, Copy, PartialEq)]
10pub enum SymbolPlacementType {
11 Point,
12 Line,
13 LineCenter,
14}
15#[derive(Clone, Copy, PartialEq)]
17pub enum SymbolAnchorType {
18 Center,
19 Left,
20 Right,
21 Top,
22 Bottom,
23 TopLeft,
24 TopRight,
25 BottomLeft,
26 BottomRight,
27}
28
29#[derive(Clone, Copy, PartialEq)]
31pub enum TextJustifyType {
32 Auto,
33 Center,
34 Left,
35 Right,
36}
37#[derive(Clone, Copy, PartialEq)]
39pub enum IconTextFitType {
40 None,
41 Both,
42 Width,
43 Height,
44}
45
46#[derive(PartialOrd, Ord, PartialEq, Eq, Copy, Clone, Debug)]
48pub enum TextWritingModeType {
49 Horizontal = 0,
50 Vertical = 1,
51}
52
53pub type TextVariableAnchorType = SymbolAnchorType;
55
56#[derive(Clone, Copy, PartialEq)]
58pub enum AlignmentType {
59 Map,
60 Viewport,
61 Auto,
62}
63#[derive(Clone, Copy, PartialEq)]
65pub enum TextTransformType {
66 None,
67 Uppercase,
68 Lowercase,
69}
70#[derive(Clone, Copy, PartialEq)]
72pub enum SymbolZOrderType {
73 Auto,
74 ViewportY,
75 Source,
76}
77#[derive(Clone, PartialEq)]
79pub struct PropertyValue<T> {
80 value: expression::Value,
81 _phandom: PhantomData<T>,
82}
83
84impl<T> Default for PropertyValue<T> {
85 fn default() -> Self {
87 PropertyValue {
89 value: expression::Value::f64(0.0),
90 _phandom: Default::default(),
91 }
92 }
93}
94
95impl<T> PropertyValue<T> {
96 pub fn is_undefined(&self) -> bool {
98 false
100 }
101 pub fn is_data_driven(&self) -> bool {
103 false
105 }
106
107 pub fn is_zoomant(&self) -> bool {
109 false
111 }
112}
113
114#[derive(Clone, PartialEq)]
116pub struct PossiblyEvaluatedPropertyValue<T> {
117 value: expression::Value,
118 _phandom: PhantomData<T>,
119}
120
121impl<T> Default for PossiblyEvaluatedPropertyValue<T> {
122 fn default() -> Self {
124 PossiblyEvaluatedPropertyValue {
126 value: expression::Value::f64(0.0),
127 _phandom: Default::default(),
128 }
129 }
130}
131
132impl<T> PossiblyEvaluatedPropertyValue<T> {
133 pub fn constant_or(&self, constant: T) -> T {
135 todo!()
136 }
137}
138
139pub trait LayoutProperty {
140 type UnevaluatedType;
144 type PossiblyEvaluatedType;
148
149 type Type;
150 const IS_DATA_DRIVEN: bool = false;
151 const IS_OVERRIDABLE: bool = false;
152
153 fn name() -> &'static str;
154
155 fn default_value() -> Self::Type;
156}
157
158pub trait DataDrivenLayoutProperty {
159 type UnevaluatedType: Default;
163 type PossiblyEvaluatedTyp: Default;
167
168 type Type;
169 const IS_DATA_DRIVEN: bool = true;
170 const IS_OVERRIDABLE: bool = false;
171
172 fn name() -> &'static str;
173
174 fn default_value() -> Self::Type;
175}
176
177pub struct IconAllowOverlap {}
180
181impl LayoutProperty for IconAllowOverlap {
182 type UnevaluatedType = PropertyValue<Self::Type>;
183
184 type PossiblyEvaluatedType = Self::Type;
185
186 type Type = bool;
187
188 fn name() -> &'static str {
189 "icon-allow-overlap"
190 }
191
192 fn default_value() -> <Self as LayoutProperty>::Type {
193 false
194 }
195}
196
197pub struct IconAnchor {}
199
200impl DataDrivenLayoutProperty for IconAnchor {
201 type UnevaluatedType = PropertyValue<Self::Type>;
202
203 type PossiblyEvaluatedTyp = PossiblyEvaluatedPropertyValue<Self::Type>;
204
205 type Type = SymbolAnchorType;
206
207 fn name() -> &'static str {
208 "icon-anchor"
209 }
210
211 fn default_value() -> <Self as DataDrivenLayoutProperty>::Type {
212 SymbolAnchorType::Center
213 }
214}
215
216pub struct IconIgnorePlacement {}
218
219impl LayoutProperty for IconIgnorePlacement {
220 type UnevaluatedType = PropertyValue<Self::Type>;
221
222 type PossiblyEvaluatedType = Self::Type;
223
224 type Type = bool;
225
226 fn name() -> &'static str {
227 "icon-ignore-placement"
228 }
229
230 fn default_value() -> <Self as LayoutProperty>::Type {
231 false
232 }
233}
234
235pub struct IconImage {}
237
238impl DataDrivenLayoutProperty for IconImage {
239 type UnevaluatedType = PropertyValue<Self::Type>;
240
241 type PossiblyEvaluatedTyp = PossiblyEvaluatedPropertyValue<Self::Type>;
242
243 type Type = expression::Image;
244
245 fn name() -> &'static str {
246 "icon-image"
247 }
248
249 fn default_value() -> <Self as DataDrivenLayoutProperty>::Type {
250 expression::Image::default()
251 }
252}
253
254pub struct IconKeepUpright {}
256
257impl LayoutProperty for IconKeepUpright {
258 type UnevaluatedType = PropertyValue<Self::Type>;
259
260 type PossiblyEvaluatedType = Self::Type;
261
262 type Type = bool;
263
264 fn name() -> &'static str {
265 "icon-keep-upright"
266 }
267
268 fn default_value() -> <Self as LayoutProperty>::Type {
269 false
270 }
271}
272
273pub struct IconOffset {}
275
276impl DataDrivenLayoutProperty for IconOffset {
277 type UnevaluatedType = PropertyValue<Self::Type>;
278
279 type PossiblyEvaluatedTyp = PossiblyEvaluatedPropertyValue<Self::Type>;
280
281 type Type = [f64; 2];
282
283 fn name() -> &'static str {
284 "icon-offset"
285 }
286
287 fn default_value() -> <Self as DataDrivenLayoutProperty>::Type {
288 [0.0, 0.0]
289 }
290}
291
292pub struct IconOptional {}
294
295impl LayoutProperty for IconOptional {
296 type UnevaluatedType = PropertyValue<Self::Type>;
297
298 type PossiblyEvaluatedType = Self::Type;
299
300 type Type = bool;
301
302 fn name() -> &'static str {
303 "icon-optional"
304 }
305
306 fn default_value() -> <Self as LayoutProperty>::Type {
307 false
308 }
309}
310
311pub struct IconPadding {}
313
314impl LayoutProperty for IconPadding {
315 type UnevaluatedType = PropertyValue<Self::Type>;
316
317 type PossiblyEvaluatedType = Self::Type;
318
319 type Type = f64;
320
321 fn name() -> &'static str {
322 "icon-padding"
323 }
324
325 fn default_value() -> <Self as LayoutProperty>::Type {
326 2.0
327 }
328}
329
330pub struct IconPitchAlignment {}
332
333impl LayoutProperty for IconPitchAlignment {
334 type UnevaluatedType = PropertyValue<Self::Type>;
335
336 type PossiblyEvaluatedType = Self::Type;
337
338 type Type = AlignmentType;
339
340 fn name() -> &'static str {
341 "icon-pitch-alignment"
342 }
343
344 fn default_value() -> <Self as LayoutProperty>::Type {
345 AlignmentType::Auto
346 }
347}
348
349pub struct IconRotate {}
351
352impl DataDrivenLayoutProperty for IconRotate {
353 type UnevaluatedType = PropertyValue<Self::Type>;
354
355 type PossiblyEvaluatedTyp = PossiblyEvaluatedPropertyValue<Self::Type>;
356
357 type Type = f64;
358
359 fn name() -> &'static str {
360 "icon-rotate"
361 }
362
363 fn default_value() -> <Self as DataDrivenLayoutProperty>::Type {
364 0.0
365 }
366}
367
368pub struct IconRotationAlignment {}
370
371impl LayoutProperty for IconRotationAlignment {
372 type UnevaluatedType = PropertyValue<Self::Type>;
373
374 type PossiblyEvaluatedType = Self::Type;
375
376 type Type = AlignmentType;
377
378 fn name() -> &'static str {
379 "icon-rotation-alignment"
380 }
381
382 fn default_value() -> <Self as LayoutProperty>::Type {
383 AlignmentType::Auto
384 }
385}
386pub struct IconSize {}
388
389impl DataDrivenLayoutProperty for IconSize {
390 type UnevaluatedType = PropertyValue<Self::Type>;
391
392 type PossiblyEvaluatedTyp = PossiblyEvaluatedPropertyValue<Self::Type>;
393
394 type Type = f64;
395
396 fn name() -> &'static str {
397 "icon-size"
398 }
399
400 fn default_value() -> <Self as DataDrivenLayoutProperty>::Type {
401 1.0
402 }
403}
404
405pub struct IconTextFit {}
407
408impl LayoutProperty for IconTextFit {
409 type UnevaluatedType = PropertyValue<Self::Type>;
410
411 type PossiblyEvaluatedType = Self::Type;
412
413 type Type = IconTextFitType;
414
415 fn name() -> &'static str {
416 "icon-text-fit"
417 }
418
419 fn default_value() -> <Self as LayoutProperty>::Type {
420 IconTextFitType::None
421 }
422}
423pub struct IconTextFitPadding {}
425impl LayoutProperty for IconTextFitPadding {
426 type UnevaluatedType = PropertyValue<Self::Type>;
427
428 type PossiblyEvaluatedType = Self::Type;
429
430 type Type = [f64; 4];
431
432 fn name() -> &'static str {
433 "icon-text-fit-padding"
434 }
435
436 fn default_value() -> <Self as LayoutProperty>::Type {
437 [0.0, 0.0, 0.0, 0.0]
438 }
439}
440
441pub struct SymbolAvoidEdges {}
443
444impl LayoutProperty for SymbolAvoidEdges {
445 type UnevaluatedType = PropertyValue<Self::Type>;
446
447 type PossiblyEvaluatedType = Self::Type;
448
449 type Type = bool;
450
451 fn name() -> &'static str {
452 "symbol-avoid-edges"
453 }
454
455 fn default_value() -> <Self as LayoutProperty>::Type {
456 false
457 }
458}
459
460pub struct SymbolPlacement {}
462
463impl LayoutProperty for SymbolPlacement {
464 type UnevaluatedType = PropertyValue<Self::Type>;
465
466 type PossiblyEvaluatedType = Self::Type;
467
468 type Type = SymbolPlacementType;
469
470 fn name() -> &'static str {
471 "symbol-placement"
472 }
473
474 fn default_value() -> <Self as LayoutProperty>::Type {
475 SymbolPlacementType::Point
476 }
477}
478
479pub struct SymbolSortKey {}
481
482impl DataDrivenLayoutProperty for SymbolSortKey {
483 type UnevaluatedType = PropertyValue<Self::Type>;
484
485 type PossiblyEvaluatedTyp = PossiblyEvaluatedPropertyValue<Self::Type>;
486
487 type Type = f64;
488
489 fn name() -> &'static str {
490 "symbol-sort-key"
491 }
492
493 fn default_value() -> <Self as DataDrivenLayoutProperty>::Type {
494 0.0
495 }
496}
497
498pub struct SymbolSpacing {}
500
501impl LayoutProperty for SymbolSpacing {
502 type UnevaluatedType = PropertyValue<Self::Type>;
503
504 type PossiblyEvaluatedType = Self::Type;
505
506 type Type = f64;
507
508 fn name() -> &'static str {
509 "symbol-spacing"
510 }
511
512 fn default_value() -> <Self as LayoutProperty>::Type {
513 250.0
514 }
515}
516
517pub struct SymbolZOrder {}
519
520impl LayoutProperty for SymbolZOrder {
521 type UnevaluatedType = PropertyValue<Self::Type>;
522
523 type PossiblyEvaluatedType = Self::Type;
524
525 type Type = SymbolZOrderType;
526
527 fn name() -> &'static str {
528 "symbol-z-order"
529 }
530
531 fn default_value() -> <Self as LayoutProperty>::Type {
532 SymbolZOrderType::Auto
533 }
534}
535pub struct TextAllowOverlap {}
537
538impl LayoutProperty for TextAllowOverlap {
539 type UnevaluatedType = PropertyValue<Self::Type>;
540
541 type PossiblyEvaluatedType = Self::Type;
542
543 type Type = bool;
544
545 fn name() -> &'static str {
546 "text-allow-overlap"
547 }
548
549 fn default_value() -> <Self as LayoutProperty>::Type {
550 false
551 }
552}
553
554pub struct TextAnchor {}
556
557impl DataDrivenLayoutProperty for TextAnchor {
558 type UnevaluatedType = PropertyValue<Self::Type>;
559
560 type PossiblyEvaluatedTyp = PossiblyEvaluatedPropertyValue<Self::Type>;
561
562 type Type = SymbolAnchorType;
563
564 fn name() -> &'static str {
565 "text-anchor"
566 }
567
568 fn default_value() -> <Self as DataDrivenLayoutProperty>::Type {
569 SymbolAnchorType::Center
570 }
571}
572
573pub struct TextField {}
575impl DataDrivenLayoutProperty for TextField {
576 type UnevaluatedType = PropertyValue<Self::Type>;
577
578 type PossiblyEvaluatedTyp = PossiblyEvaluatedPropertyValue<Self::Type>;
579
580 type Type = expression::Formatted;
581
582 fn name() -> &'static str {
583 "text-field"
584 }
585
586 fn default_value() -> <Self as DataDrivenLayoutProperty>::Type {
587 expression::Formatted::default()
588 }
589}
590
591pub struct TextFont {}
593
594impl DataDrivenLayoutProperty for TextFont {
595 type UnevaluatedType = PropertyValue<Self::Type>;
596
597 type PossiblyEvaluatedTyp = PossiblyEvaluatedPropertyValue<Self::Type>;
598
599 type Type = Vec<String>;
600
601 fn name() -> &'static str {
602 "text-font"
603 }
604
605 fn default_value() -> <Self as DataDrivenLayoutProperty>::Type {
606 vec![
607 "Open Sans Regular".to_string(),
608 "Arial Unicode MS Regular".to_string(),
609 ]
610 }
611}
612
613pub struct TextIgnorePlacement {}
615
616impl LayoutProperty for TextIgnorePlacement {
617 type UnevaluatedType = PropertyValue<Self::Type>;
618
619 type PossiblyEvaluatedType = Self::Type;
620
621 type Type = bool;
622
623 fn name() -> &'static str {
624 "text-ignore-placement"
625 }
626
627 fn default_value() -> <Self as LayoutProperty>::Type {
628 false
629 }
630}
631
632pub struct TextJustify {}
634
635impl DataDrivenLayoutProperty for TextJustify {
636 type UnevaluatedType = PropertyValue<Self::Type>;
637
638 type PossiblyEvaluatedTyp = PossiblyEvaluatedPropertyValue<Self::Type>;
639
640 type Type = TextJustifyType;
641
642 fn name() -> &'static str {
643 "text-justify"
644 }
645
646 fn default_value() -> <Self as DataDrivenLayoutProperty>::Type {
647 TextJustifyType::Center
648 }
649}
650
651pub struct TextKeepUpright {}
653
654impl TextKeepUpright {}
655impl LayoutProperty for TextKeepUpright {
656 type UnevaluatedType = PropertyValue<Self::Type>;
657
658 type PossiblyEvaluatedType = Self::Type;
659
660 type Type = bool;
661
662 fn name() -> &'static str {
663 "text-keep-upright"
664 }
665
666 fn default_value() -> <Self as LayoutProperty>::Type {
667 true
668 }
669}
670
671pub struct TextLetterSpacing {}
673
674impl TextLetterSpacing {}
675impl DataDrivenLayoutProperty for TextLetterSpacing {
676 type UnevaluatedType = PropertyValue<Self::Type>;
677
678 type PossiblyEvaluatedTyp = PossiblyEvaluatedPropertyValue<Self::Type>;
679
680 type Type = f64;
681
682 fn name() -> &'static str {
683 "text-letter-spacing"
684 }
685
686 fn default_value() -> <Self as DataDrivenLayoutProperty>::Type {
687 0.0
688 }
689}
690
691pub struct TextLineHeight {}
693
694impl TextLineHeight {}
695impl LayoutProperty for TextLineHeight {
696 type UnevaluatedType = PropertyValue<Self::Type>;
697
698 type PossiblyEvaluatedType = Self::Type;
699
700 type Type = f64;
701
702 fn name() -> &'static str {
703 "text-line-height"
704 }
705
706 fn default_value() -> <Self as LayoutProperty>::Type {
707 1.2
708 }
709}
710
711pub struct TextMaxAngle {}
713
714impl LayoutProperty for TextMaxAngle {
715 type UnevaluatedType = PropertyValue<Self::Type>;
716
717 type PossiblyEvaluatedType = Self::Type;
718
719 type Type = f64;
720
721 fn name() -> &'static str {
722 "text-max-angle"
723 }
724
725 fn default_value() -> <Self as LayoutProperty>::Type {
726 45.0
727 }
728}
729
730pub struct TextMaxWidth {}
732
733impl DataDrivenLayoutProperty for TextMaxWidth {
734 type UnevaluatedType = PropertyValue<Self::Type>;
735
736 type PossiblyEvaluatedTyp = PossiblyEvaluatedPropertyValue<Self::Type>;
737
738 type Type = f64;
739
740 fn name() -> &'static str {
741 "text-max-width"
742 }
743
744 fn default_value() -> <Self as DataDrivenLayoutProperty>::Type {
745 10.0
746 }
747}
748
749pub struct TextOffset {}
751
752impl DataDrivenLayoutProperty for TextOffset {
753 type UnevaluatedType = PropertyValue<Self::Type>;
754
755 type PossiblyEvaluatedTyp = PossiblyEvaluatedPropertyValue<Self::Type>;
756
757 type Type = [f64; 2];
758
759 fn name() -> &'static str {
760 "text-offset"
761 }
762
763 fn default_value() -> <Self as DataDrivenLayoutProperty>::Type {
764 [0.0, 0.0]
765 }
766}
767
768pub struct TextOptional {}
770
771impl LayoutProperty for TextOptional {
772 type UnevaluatedType = PropertyValue<Self::Type>;
773
774 type PossiblyEvaluatedType = Self::Type;
775
776 type Type = bool;
777
778 fn name() -> &'static str {
779 "text-optional"
780 }
781
782 fn default_value() -> <Self as LayoutProperty>::Type {
783 false
784 }
785}
786
787pub struct TextPadding {}
789
790impl LayoutProperty for TextPadding {
791 type UnevaluatedType = PropertyValue<Self::Type>;
792
793 type PossiblyEvaluatedType = Self::Type;
794
795 type Type = f64;
796
797 fn name() -> &'static str {
798 "text-padding"
799 }
800
801 fn default_value() -> <Self as LayoutProperty>::Type {
802 2.0
803 }
804}
805
806pub struct TextPitchAlignment {}
808
809impl TextPitchAlignment {}
810impl LayoutProperty for TextPitchAlignment {
811 type UnevaluatedType = PropertyValue<Self::Type>;
812
813 type PossiblyEvaluatedType = Self::Type;
814
815 type Type = AlignmentType;
816
817 fn name() -> &'static str {
818 "text-pitch-alignment"
819 }
820
821 fn default_value() -> <Self as LayoutProperty>::Type {
822 AlignmentType::Auto
823 }
824}
825
826pub struct TextRadialOffset {}
828
829impl DataDrivenLayoutProperty for TextRadialOffset {
830 type UnevaluatedType = PropertyValue<Self::Type>;
831
832 type PossiblyEvaluatedTyp = PossiblyEvaluatedPropertyValue<Self::Type>;
833
834 type Type = f64;
835
836 fn name() -> &'static str {
837 "text-radial-offset"
838 }
839
840 fn default_value() -> <Self as DataDrivenLayoutProperty>::Type {
841 0.0
842 }
843}
844
845pub struct TextRotate {}
847
848impl DataDrivenLayoutProperty for TextRotate {
849 type UnevaluatedType = PropertyValue<Self::Type>;
850
851 type PossiblyEvaluatedTyp = PossiblyEvaluatedPropertyValue<Self::Type>;
852
853 type Type = f64;
854
855 fn name() -> &'static str {
856 "text-rotate"
857 }
858
859 fn default_value() -> <Self as DataDrivenLayoutProperty>::Type {
860 0.0
861 }
862}
863
864pub struct TextRotationAlignment {}
866
867impl LayoutProperty for TextRotationAlignment {
868 type UnevaluatedType = PropertyValue<Self::Type>;
869 type PossiblyEvaluatedType = Self::Type;
870
871 type Type = AlignmentType;
872
873 fn name() -> &'static str {
874 "text-rotation-alignment"
875 }
876
877 fn default_value() -> <Self as LayoutProperty>::Type {
878 AlignmentType::Auto
879 }
880}
881
882pub struct TextSize {}
884
885impl DataDrivenLayoutProperty for TextSize {
886 type UnevaluatedType = PropertyValue<Self::Type>;
887
888 type PossiblyEvaluatedTyp = PossiblyEvaluatedPropertyValue<Self::Type>;
889
890 type Type = f64;
891
892 fn name() -> &'static str {
893 "text-size"
894 }
895
896 fn default_value() -> <Self as DataDrivenLayoutProperty>::Type {
897 16.0
898 }
899}
900
901pub struct TextTransform {}
903
904impl DataDrivenLayoutProperty for TextTransform {
905 type UnevaluatedType = PropertyValue<Self::Type>;
906
907 type PossiblyEvaluatedTyp = PossiblyEvaluatedPropertyValue<Self::Type>;
908
909 type Type = TextTransformType;
910
911 fn name() -> &'static str {
912 "text-transform"
913 }
914
915 fn default_value() -> <Self as DataDrivenLayoutProperty>::Type {
916 TextTransformType::None
917 }
918}
919
920pub struct TextVariableAnchor {}
922
923impl TextVariableAnchor {}
924impl LayoutProperty for TextVariableAnchor {
925 type UnevaluatedType = PropertyValue<Self::Type>;
926 type PossiblyEvaluatedType = Self::Type;
927
928 type Type = Vec<TextVariableAnchorType>;
929
930 fn name() -> &'static str {
931 "text-variable-anchor"
932 }
933
934 fn default_value() -> <Self as LayoutProperty>::Type {
935 Vec::new()
936 }
937}
938
939pub struct TextWritingMode {}
941
942impl LayoutProperty for TextWritingMode {
943 type UnevaluatedType = PropertyValue<Self::Type>;
944
945 type PossiblyEvaluatedType = Self::Type;
946
947 type Type = Vec<TextWritingModeType>;
948
949 fn name() -> &'static str {
950 "text-writing-mode"
951 }
952
953 fn default_value() -> <Self as LayoutProperty>::Type {
954 Vec::new()
955 }
956}
957
958#[derive(Clone, Debug)]
960pub struct SymbolLayoutProperties_Unevaluated;
961#[derive(Clone, Debug)]
963pub struct SymbolLayoutProperties_PossiblyEvaluated;
964
965impl SymbolLayoutProperties_PossiblyEvaluated {
966 pub fn has<T: 'static>(&self) -> bool {
968 TypeId::of::<T>() == TypeId::of::<TextField>()
972 || TypeId::of::<T>() == TypeId::of::<TextFont>()
973 }
974}
975
976#[derive(Clone)]
978pub struct SymbolLayoutProperties_Evaluated;
979
980pub mod expression {
981 use std::{
982 collections::{BTreeSet, HashMap},
983 rc::Rc,
984 };
985
986 use csscolorparser::Color;
987
988 use crate::legacy::{
989 font_stack::FontStack, layout::symbol_feature::SymbolGeometryTileFeature, CanonicalTileID,
990 };
991
992 #[derive(Clone, PartialEq)]
994 pub enum Value {
995 Color(Color),
996 f64(f64),
997 Object(HashMap<String, Value>),
998 }
999
1000 #[derive(Default, Clone)]
1003 pub struct Image {
1004 pub image_id: String,
1005 pub available: bool,
1006 }
1007 pub struct Formatted {
1009 pub sections: Vec<FormattedSection>,
1010 }
1011
1012 impl Default for Formatted {
1013 fn default() -> Self {
1015 Formatted {
1017 sections: vec![FormattedSection {
1018 text: "Aller Anfang ist schwer".to_string(),
1019 image: None,
1020 font_scale: None,
1021 font_stack: None,
1022 text_color: None,
1023 }],
1024 }
1025 }
1026 }
1027
1028 impl Formatted {
1029 fn to_string() -> String {
1031 todo!()
1032 }
1033 fn to_object() -> Value {
1035 todo!()
1036 }
1037
1038 fn empty() -> bool {
1040 todo!()
1041 }
1042 }
1043
1044 impl PartialEq for Formatted {
1045 fn eq(&self, other: &Self) -> bool {
1047 todo!()
1048 }
1049 }
1050
1051 #[derive(Default)]
1053 pub struct FormattedSection {
1054 pub text: String,
1055 pub image: Option<Image>,
1056 pub font_scale: Option<f64>,
1057 pub font_stack: Option<FontStack>,
1058 pub text_color: Option<Color>,
1059 }
1060
1061 pub const K_FORMATTED_SECTION_FONT_SCALE: &str = "font-scale";
1062 pub const K_FORMATTED_SECTION_TEXT_FONT: &str = "text-font";
1063 pub const K_FORMATTED_SECTION_TEXT_COLOR: &str = "text-color";
1064
1065 pub type FeatureState = Value;
1068
1069 pub struct EvaluationContext {
1071 zoom: Option<f64>,
1072 accumulated: Option<Value>,
1073 feature: Rc<SymbolGeometryTileFeature>,
1074 color_ramp_parameter: Option<f64>,
1075 formatted_section: Rc<Value>,
1077 feature_state: Rc<FeatureState>,
1078 available_images: Rc<BTreeSet<String>>,
1079 canonical: Rc<CanonicalTileID>,
1080 }
1081}
1082
1083pub struct PropertyEvaluationParameters(pub f64);
1086
1087impl SymbolLayoutProperties_Unevaluated {
1088 pub fn get_dynamic<T: DataDrivenLayoutProperty>(&self) -> T::UnevaluatedType {
1090 T::UnevaluatedType::default()
1091 }
1092
1093 pub fn evaluate(
1095 &self,
1096 p0: PropertyEvaluationParameters,
1097 ) -> SymbolLayoutProperties_PossiblyEvaluated {
1098 SymbolLayoutProperties_PossiblyEvaluated
1100 }
1101}
1102
1103impl SymbolLayoutProperties_PossiblyEvaluated {
1105 pub fn get<T: LayoutProperty>(&self) -> T::Type {
1107 T::default_value()
1109 }
1110 pub fn set<T: LayoutProperty>(&mut self, value: T::Type) {
1112 }
1114
1115 pub fn get_dynamic<T: DataDrivenLayoutProperty>(&self) -> T::PossiblyEvaluatedTyp {
1117 T::PossiblyEvaluatedTyp::default()
1118 }
1119
1120 pub fn evaluate<T: DataDrivenLayoutProperty>(
1122 &self,
1123 p0: f64,
1124 p1: &SymbolGeometryTileFeature,
1125 p2: CanonicalTileID,
1126 ) -> T::Type {
1127 T::default_value()
1129 }
1130
1131 pub fn evaluate_feature(
1133 &self,
1134 p0: f64,
1135 p1: &SymbolGeometryTileFeature,
1136 ) -> SymbolLayoutProperties_Evaluated {
1137 SymbolLayoutProperties_Evaluated
1139 }
1140
1141 pub fn evaluate4<T: DataDrivenLayoutProperty>(
1143 &self,
1144 p0: f64,
1145 p1: &SymbolGeometryTileFeature,
1146 available_images: &BTreeSet<String>,
1147 p2: CanonicalTileID,
1148 ) -> T::Type {
1149 T::default_value()
1154 }
1155
1156 pub fn evaluate_static<T: LayoutProperty>(
1158 &self,
1159 p0: f64,
1160 p1: &SymbolGeometryTileFeature,
1161 p2: CanonicalTileID,
1162 ) -> T::Type {
1163 T::default_value()
1165 }
1166}
1167
1168impl SymbolLayoutProperties_Evaluated {
1169 pub fn get<T: LayoutProperty>(&self) -> T::Type {
1171 T::default_value()
1173 }
1174 pub fn set<T: LayoutProperty>(&mut self, value: T::Type) {
1176 }
1178
1179 pub fn get_dynamic<T: DataDrivenLayoutProperty>(&self) -> T::PossiblyEvaluatedTyp {
1181 T::PossiblyEvaluatedTyp::default()
1183 }
1184
1185 pub fn get_eval<T: DataDrivenLayoutProperty>(&self) -> T::Type {
1187 T::default_value()
1189 }
1190
1191 pub fn evaluate<T: DataDrivenLayoutProperty>(
1193 &self,
1194 p0: f64,
1195 p1: &SymbolGeometryTileFeature,
1196 p2: CanonicalTileID,
1197 ) -> T::Type {
1198 T::default_value()
1200 }
1201
1202 pub fn evaluate_static<T: LayoutProperty>(
1204 &self,
1205 p0: f64,
1206 p1: &SymbolGeometryTileFeature,
1207 p2: CanonicalTileID,
1208 ) -> T::Type {
1209 T::default_value()
1211 }
1212}