@@ -754,10 +754,24 @@ pub enum Expression {
754754 /// So this looks like `layout_cache_prop[layout_cache_prop[index] + repeater_index]`
755755 repeater_index : Option < Box < Expression > > ,
756756 } ,
757+
758+ /// Organize a grid layout, i.e. decide what goes where
759+ OrganizeGridLayout ( crate :: layout:: GridLayout ) ,
760+
757761 /// Compute the LayoutInfo for the given layout.
758762 /// The orientation is the orientation of the cache, not the orientation of the layout
759763 ComputeLayoutInfo ( crate :: layout:: Layout , crate :: layout:: Orientation ) ,
764+ ComputeGridLayoutInfo {
765+ layout_organized_data_prop : NamedReference ,
766+ layout : crate :: layout:: GridLayout ,
767+ orientation : crate :: layout:: Orientation ,
768+ } ,
760769 SolveLayout ( crate :: layout:: Layout , crate :: layout:: Orientation ) ,
770+ SolveGridLayout {
771+ layout_organized_data_prop : NamedReference ,
772+ layout : crate :: layout:: GridLayout ,
773+ orientation : crate :: layout:: Orientation ,
774+ } ,
761775
762776 MinMax {
763777 ty : Type ,
@@ -889,8 +903,11 @@ impl Expression {
889903 // invalid because the expression is unreachable
890904 Expression :: ReturnStatement ( _) => Type :: Invalid ,
891905 Expression :: LayoutCacheAccess { .. } => Type :: LogicalLength ,
906+ Expression :: OrganizeGridLayout ( ..) => typeregister:: organized_layout_type ( ) . into ( ) ,
892907 Expression :: ComputeLayoutInfo ( ..) => typeregister:: layout_info_type ( ) . into ( ) ,
908+ Expression :: ComputeGridLayoutInfo { .. } => typeregister:: layout_info_type ( ) . into ( ) ,
893909 Expression :: SolveLayout ( ..) => Type :: LayoutCache ,
910+ Expression :: SolveGridLayout { .. } => Type :: LayoutCache ,
894911 Expression :: MinMax { ty, .. } => ty. clone ( ) ,
895912 Expression :: EmptyComponentFactory => Type :: ComponentFactory ,
896913 Expression :: DebugHook { expression, .. } => expression. ty ( ) ,
@@ -987,8 +1004,11 @@ impl Expression {
9871004 Expression :: LayoutCacheAccess { repeater_index, .. } => {
9881005 repeater_index. as_deref ( ) . map ( visitor) ;
9891006 }
1007+ Expression :: OrganizeGridLayout ( ..) => { }
9901008 Expression :: ComputeLayoutInfo ( ..) => { }
1009+ Expression :: ComputeGridLayoutInfo { .. } => { }
9911010 Expression :: SolveLayout ( ..) => { }
1011+ Expression :: SolveGridLayout { .. } => { }
9921012 Expression :: MinMax { lhs, rhs, .. } => {
9931013 visitor ( lhs) ;
9941014 visitor ( rhs) ;
@@ -1090,8 +1110,11 @@ impl Expression {
10901110 Expression :: LayoutCacheAccess { repeater_index, .. } => {
10911111 repeater_index. as_deref_mut ( ) . map ( visitor) ;
10921112 }
1113+ Expression :: OrganizeGridLayout ( ..) => { }
10931114 Expression :: ComputeLayoutInfo ( ..) => { }
1115+ Expression :: ComputeGridLayoutInfo { .. } => { }
10941116 Expression :: SolveLayout ( ..) => { }
1117+ Expression :: SolveGridLayout { .. } => { }
10951118 Expression :: MinMax { lhs, rhs, .. } => {
10961119 visitor ( lhs) ;
10971120 visitor ( rhs) ;
@@ -1183,8 +1206,11 @@ impl Expression {
11831206 }
11841207 // TODO: detect constant property within layouts
11851208 Expression :: LayoutCacheAccess { .. } => false ,
1209+ Expression :: OrganizeGridLayout { .. } => false ,
11861210 Expression :: ComputeLayoutInfo ( ..) => false ,
1211+ Expression :: ComputeGridLayoutInfo { .. } => false ,
11871212 Expression :: SolveLayout ( ..) => false ,
1213+ Expression :: SolveGridLayout { .. } => false ,
11881214 Expression :: MinMax { lhs, rhs, .. } => lhs. is_constant ( ga) && rhs. is_constant ( ga) ,
11891215 Expression :: EmptyComponentFactory => true ,
11901216 Expression :: DebugHook { .. } => false ,
@@ -1858,8 +1884,11 @@ pub fn pretty_print(f: &mut dyn std::fmt::Write, expression: &Expression) -> std
18581884 if repeater_index. is_some( ) { " + $index" } else { "" }
18591885 )
18601886 }
1887+ Expression :: OrganizeGridLayout ( ..) => write ! ( f, "organize_grid_layout(..)" ) ,
18611888 Expression :: ComputeLayoutInfo ( ..) => write ! ( f, "layout_info(..)" ) ,
1889+ Expression :: ComputeGridLayoutInfo { .. } => write ! ( f, "grid_layout_info(..)" ) ,
18621890 Expression :: SolveLayout ( ..) => write ! ( f, "solve_layout(..)" ) ,
1891+ Expression :: SolveGridLayout { .. } => write ! ( f, "solve_grid_layout(..)" ) ,
18631892 Expression :: MinMax { ty : _, op, lhs, rhs } => {
18641893 match op {
18651894 MinMaxOp :: Min => write ! ( f, "min(" ) ?,
0 commit comments