@@ -500,7 +500,7 @@ fn compute_layout_info(
500
500
llr_Expression:: ExtraBuiltinFunctionCall {
501
501
function : "grid_layout_info" . into ( ) ,
502
502
arguments : vec ! [ cells, spacing, padding] ,
503
- return_ty : crate :: layout :: layout_info_type ( ) ,
503
+ return_ty : crate :: typeregister :: layout_info_type ( ) ,
504
504
}
505
505
}
506
506
crate :: layout:: Layout :: BoxLayout ( layout) => {
@@ -510,13 +510,13 @@ fn compute_layout_info(
510
510
llr_Expression:: ExtraBuiltinFunctionCall {
511
511
function : "box_layout_info" . into ( ) ,
512
512
arguments : vec ! [ bld. cells, spacing, padding, bld. alignment] ,
513
- return_ty : crate :: layout :: layout_info_type ( ) ,
513
+ return_ty : crate :: typeregister :: layout_info_type ( ) ,
514
514
}
515
515
} else {
516
516
llr_Expression:: ExtraBuiltinFunctionCall {
517
517
function : "box_layout_info_ortho" . into ( ) ,
518
518
arguments : vec ! [ bld. cells, padding] ,
519
- return_ty : crate :: layout :: layout_info_type ( ) ,
519
+ return_ty : crate :: typeregister :: layout_info_type ( ) ,
520
520
}
521
521
} ;
522
522
match bld. compute_cells {
@@ -684,13 +684,7 @@ fn box_layout_data(
684
684
let repeater_count =
685
685
layout. elems . iter ( ) . filter ( |i| i. element . borrow ( ) . repeated . is_some ( ) ) . count ( ) ;
686
686
687
- let element_ty = Type :: Struct ( Rc :: new ( Struct {
688
- fields : IntoIterator :: into_iter ( [ ( "constraint" . into ( ) , crate :: layout:: layout_info_type ( ) ) ] )
689
- . collect ( ) ,
690
- name : Some ( "BoxLayoutCellData" . into ( ) ) ,
691
- node : None ,
692
- rust_attributes : None ,
693
- } ) ) ;
687
+ let element_ty = crate :: typeregister:: box_layout_cell_data_type ( ) ;
694
688
695
689
if repeater_count == 0 {
696
690
let cells = llr_Expression:: Array {
@@ -702,7 +696,7 @@ fn box_layout_data(
702
696
get_layout_info ( & li. element , ctx, & li. constraints , orientation) ;
703
697
make_struct (
704
698
"BoxLayoutCellData" ,
705
- [ ( "constraint" , crate :: layout :: layout_info_type ( ) , layout_info) ] ,
699
+ [ ( "constraint" , crate :: typeregister :: layout_info_type ( ) , layout_info) ] ,
706
700
)
707
701
} )
708
702
. collect ( ) ,
@@ -725,13 +719,13 @@ fn box_layout_data(
725
719
get_layout_info ( & item. element , ctx, & item. constraints , orientation) ;
726
720
elements. push ( Either :: Left ( make_struct (
727
721
"BoxLayoutCellData" ,
728
- [ ( "constraint" , crate :: layout :: layout_info_type ( ) , layout_info) ] ,
722
+ [ ( "constraint" , crate :: typeregister :: layout_info_type ( ) , layout_info) ] ,
729
723
) ) ) ;
730
724
}
731
725
}
732
726
let cells = llr_Expression:: ReadLocalVariable {
733
727
name : "cells" . into ( ) ,
734
- ty : Type :: Array ( Rc :: new ( crate :: layout :: layout_info_type ( ) ) ) ,
728
+ ty : Type :: Array ( Rc :: new ( crate :: typeregister :: layout_info_type ( ) ) ) ,
735
729
} ;
736
730
BoxLayoutDataResult { alignment, cells, compute_cells : Some ( ( "cells" . into ( ) , elements) ) }
737
731
}
@@ -755,7 +749,7 @@ fn grid_layout_cell_data(
755
749
make_struct (
756
750
"GridLayoutCellData" ,
757
751
[
758
- ( "constraint" , crate :: layout :: layout_info_type ( ) , layout_info) ,
752
+ ( "constraint" , crate :: typeregister :: layout_info_type ( ) , layout_info) ,
759
753
( "col_or_row" , Type :: Int32 , llr_Expression:: NumberLiteral ( col_or_row as _ ) ) ,
760
754
( "span" , Type :: Int32 , llr_Expression:: NumberLiteral ( span as _ ) ) ,
761
755
] ,
@@ -771,7 +765,7 @@ pub(super) fn grid_layout_cell_data_ty() -> Type {
771
765
fields : IntoIterator :: into_iter ( [
772
766
( SmolStr :: new_static ( "col_or_row" ) , Type :: Int32 ) ,
773
767
( SmolStr :: new_static ( "span" ) , Type :: Int32 ) ,
774
- ( SmolStr :: new_static ( "constraint" ) , crate :: layout :: layout_info_type ( ) ) ,
768
+ ( SmolStr :: new_static ( "constraint" ) , crate :: typeregister :: layout_info_type ( ) ) ,
775
769
] )
776
770
. collect ( ) ,
777
771
name : Some ( "GridLayoutCellData" . into ( ) ) ,
@@ -831,7 +825,7 @@ pub fn get_layout_info(
831
825
name : "layout_info" . into ( ) ,
832
826
value : layout_info. into ( ) ,
833
827
} ;
834
- let ty = crate :: layout :: layout_info_type ( ) ;
828
+ let ty = crate :: typeregister :: layout_info_type ( ) ;
835
829
let fields = match & ty {
836
830
Type :: Struct ( s) => & s. fields ,
837
831
_ => panic ! ( ) ,
@@ -869,12 +863,7 @@ fn compile_path(path: &crate::expression_tree::Path, ctx: &ExpressionContext) ->
869
863
fn llr_path_elements ( elements : Vec < llr_Expression > ) -> llr_Expression {
870
864
llr_Expression:: Cast {
871
865
from : llr_Expression:: Array {
872
- element_ty : Type :: Struct ( Rc :: new ( Struct {
873
- fields : Default :: default ( ) ,
874
- name : Some ( "PathElement" . into ( ) ) ,
875
- node : None ,
876
- rust_attributes : None ,
877
- } ) ) ,
866
+ element_ty : crate :: typeregister:: path_element_type ( ) ,
878
867
values : elements,
879
868
as_model : false ,
880
869
}
0 commit comments