Skip to content

Commit 6ad2859

Browse files
committed
clean: remove dead code
1 parent ff36dc3 commit 6ad2859

File tree

6 files changed

+268
-39
lines changed

6 files changed

+268
-39
lines changed

float-pigment-css/float_pigment_css.h

Lines changed: 107 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ struct Angle;
1919
struct CalcExpr;
2020

2121

22+
static const uint16_t TEMP_SHEET_INDEX = UINT16_MAX;
23+
2224
enum class AnimationDirectionItem {
2325
Normal,
2426
Reverse,
@@ -2643,6 +2645,97 @@ struct JustifyItemsType {
26432645
};
26442646
};
26452647

2648+
struct GapType {
2649+
enum class Tag {
2650+
Invalid,
2651+
Initial,
2652+
Inherit,
2653+
Unset,
2654+
Var,
2655+
VarInShorthand,
2656+
Invalid0,
2657+
Invalid7,
2658+
Invalid8,
2659+
Invalid9,
2660+
InvalidA,
2661+
InvalidB,
2662+
InvalidC,
2663+
InvalidD,
2664+
InvalidE,
2665+
InvalidF,
2666+
Invalid10,
2667+
Invalid11,
2668+
Invalid12,
2669+
Invalid13,
2670+
Invalid14,
2671+
Invalid15,
2672+
Invalid16,
2673+
Invalid17,
2674+
Invalid18,
2675+
Invalid19,
2676+
Invalid1A,
2677+
Invalid1B,
2678+
Invalid1C,
2679+
Invalid1D,
2680+
Invalid1E,
2681+
Invalid1F,
2682+
Invalid20,
2683+
Invalid21,
2684+
Invalid22,
2685+
Invalid23,
2686+
Invalid24,
2687+
Invalid25,
2688+
Invalid26,
2689+
Invalid27,
2690+
Invalid28,
2691+
Invalid29,
2692+
Invalid2A,
2693+
Invalid2B,
2694+
Invalid2C,
2695+
Invalid2D,
2696+
Invalid2E,
2697+
Invalid2F,
2698+
Invalid30,
2699+
Invalid31,
2700+
Invalid32,
2701+
Invalid33,
2702+
Invalid34,
2703+
Invalid35,
2704+
Invalid36,
2705+
Invalid37,
2706+
Invalid38,
2707+
Invalid39,
2708+
Invalid3A,
2709+
Invalid3B,
2710+
Invalid3C,
2711+
Invalid3D,
2712+
Invalid3E,
2713+
Invalid3F,
2714+
Normal,
2715+
Length,
2716+
};
2717+
2718+
struct Var_Body {
2719+
Box<StrRef> _0;
2720+
};
2721+
2722+
struct VarInShorthand_Body {
2723+
Box<StrRef> _0;
2724+
Box<StrRef> _1;
2725+
};
2726+
2727+
struct Length_Body {
2728+
Length _0;
2729+
};
2730+
2731+
Tag tag;
2732+
union {
2733+
Var_Body var;
2734+
VarInShorthand_Body var_in_shorthand;
2735+
Length_Body length;
2736+
};
2737+
};
2738+
26462739
struct Color {
26472740
enum class Tag {
26482741
Undefined,
@@ -7717,8 +7810,8 @@ struct Property {
77177810
FlexBasis,
77187811
JustifyItems,
77197812
Order,
7720-
Invalid2C,
7721-
Invalid2D,
7813+
RowGap,
7814+
ColumnGap,
77227815
Invalid2E,
77237816
Invalid2F,
77247817
Invalid30,
@@ -8043,6 +8136,14 @@ struct Property {
80438136
NumberType _0;
80448137
};
80458138

8139+
struct RowGap_Body {
8140+
GapType _0;
8141+
};
8142+
8143+
struct ColumnGap_Body {
8144+
GapType _0;
8145+
};
8146+
80468147
struct BackgroundColor_Body {
80478148
ColorType _0;
80488149
};
@@ -8490,6 +8591,8 @@ struct Property {
84908591
FlexBasis_Body flex_basis;
84918592
JustifyItems_Body justify_items;
84928593
Order_Body order;
8594+
RowGap_Body row_gap;
8595+
ColumnGap_Body column_gap;
84938596
BackgroundColor_Body background_color;
84948597
BackgroundImage_Body background_image;
84958598
BackgroundSize_Body background_size;
@@ -9042,6 +9145,6 @@ const char *substitute_variable(const char *expr_ptr,
90429145
CustomPropertyGetter getter,
90439146
CustomPropertySetter setter);
90449147

9045-
} // extern "C"
9148+
} // extern "C"
90469149

9047-
} // namespace float_pigment
9150+
} // namespace float_pigment

float-pigment-forest/float_pigment_layout.h

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,15 @@ using MeasureMaxContentWidth = float;
5151

5252
using MeasureMaxContentHeight = float;
5353

54-
using MeasureFunc = Size(*)(NodePtr, MeasureMaxWidth, MeasureMode, MeasureMaxHeight, MeasureMode, MeasureMinWidth, MeasureMinHeight, MeasureMaxContentWidth, MeasureMaxContentHeight);
54+
using MeasureFunc = Size(*)(NodePtr,
55+
MeasureMaxWidth,
56+
MeasureMode,
57+
MeasureMaxHeight,
58+
MeasureMode,
59+
MeasureMinWidth,
60+
MeasureMinHeight,
61+
MeasureMaxContentWidth,
62+
MeasureMaxContentHeight);
5563

5664
using CalcHandle = int32_t;
5765

@@ -238,6 +246,14 @@ void NodeStyleSetBottomPercentage(NodePtr node, float value);
238246

239247
void NodeStyleSetBoxSizing(NodePtr node, BoxSizingType value);
240248

249+
void NodeStyleSetColumnGap(NodePtr node, float value);
250+
251+
void NodeStyleSetColumnGapCalcHandle(NodePtr node, int32_t calc_handle);
252+
253+
void NodeStyleSetColumnGapNormal(NodePtr node);
254+
255+
void NodeStyleSetColumnGapPercentage(NodePtr node, float value);
256+
241257
void NodeStyleSetDisplay(NodePtr node, DisplayType value);
242258

243259
void NodeStyleSetFlexBasis(NodePtr node, float value);
@@ -418,6 +434,14 @@ void NodeStyleSetRightNone(NodePtr node);
418434

419435
void NodeStyleSetRightPercentage(NodePtr node, float value);
420436

437+
void NodeStyleSetRowGap(NodePtr node, float value);
438+
439+
void NodeStyleSetRowGapCalcHandle(NodePtr node, int32_t calc_handle);
440+
441+
void NodeStyleSetRowGapNormal(NodePtr node);
442+
443+
void NodeStyleSetRowGapPercentage(NodePtr node, float value);
444+
421445
void NodeStyleSetTextAlign(NodePtr node, TextAlignType value);
422446

423447
void NodeStyleSetTop(NodePtr node, float value);
@@ -444,6 +468,6 @@ void NodeStyleSetWritingMode(NodePtr node, WritingModeType value);
444468

445469
const char *NodeToString(NodePtr node, bool recursive, bool layout, bool style);
446470

447-
} // extern "C"
471+
} // extern "C"
448472

449-
} // namespace float_pigment
473+
} // namespace float_pigment

float-pigment-layout/src/special_positioned.rs

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -454,26 +454,3 @@ pub(crate) fn compute_special_position<T: LayoutTreeNode>(
454454

455455
layout_unit.gen_origin(axis_info, **parent.inner_size, offset_main, offset_cross);
456456
}
457-
458-
pub(crate) fn compute_position_relative<T: LayoutTreeNode>(
459-
node: &T,
460-
parent_inner_size: Normalized<Size<T::Length>>,
461-
) {
462-
let mut layout_unit = node.layout_node().unit();
463-
let style = node.style();
464-
// apply relative offset
465-
let left = style.left().resolve_num(parent_inner_size.width, node);
466-
let right = style.right().resolve_num(parent_inner_size.width, node);
467-
let top = style.top().resolve_num(parent_inner_size.height, node);
468-
let bottom = style.bottom().resolve_num(parent_inner_size.height, node);
469-
if let Some(left) = left.val() {
470-
layout_unit.result.origin.x += left;
471-
} else if let Some(right) = right.val() {
472-
layout_unit.result.origin.x -= right;
473-
}
474-
if let Some(top) = top.val() {
475-
layout_unit.result.origin.y += top;
476-
} else if let Some(bottom) = bottom.val() {
477-
layout_unit.result.origin.y -= bottom;
478-
}
479-
}

float-pigment/float_pigment_css.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,6 @@ void *map,
136136
CustomPropertyGetter getter,
137137
CustomPropertySetter setter);
138138

139-
} // extern "C"
139+
} // extern "C"
140140

141-
} // namespace float_pigment
141+
} // namespace float_pigment

float-pigment/float_pigment_layout.h

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,15 @@ using MeasureMaxContentWidth = float;
5151

5252
using MeasureMaxContentHeight = float;
5353

54-
using MeasureFunc = Size(*)(NodePtr, MeasureMaxWidth, MeasureMode, MeasureMaxHeight, MeasureMode, MeasureMinWidth, MeasureMinHeight, MeasureMaxContentWidth, MeasureMaxContentHeight);
54+
using MeasureFunc = Size(*)(NodePtr,
55+
MeasureMaxWidth,
56+
MeasureMode,
57+
MeasureMaxHeight,
58+
MeasureMode,
59+
MeasureMinWidth,
60+
MeasureMinHeight,
61+
MeasureMaxContentWidth,
62+
MeasureMaxContentHeight);
5563

5664
using CalcHandle = int32_t;
5765

@@ -238,6 +246,14 @@ void NodeStyleSetBottomPercentage(NodePtr node, float value);
238246

239247
void NodeStyleSetBoxSizing(NodePtr node, BoxSizingType value);
240248

249+
void NodeStyleSetColumnGap(NodePtr node, float value);
250+
251+
void NodeStyleSetColumnGapCalcHandle(NodePtr node, int32_t calc_handle);
252+
253+
void NodeStyleSetColumnGapNormal(NodePtr node);
254+
255+
void NodeStyleSetColumnGapPercentage(NodePtr node, float value);
256+
241257
void NodeStyleSetDisplay(NodePtr node, DisplayType value);
242258

243259
void NodeStyleSetFlexBasis(NodePtr node, float value);
@@ -418,6 +434,14 @@ void NodeStyleSetRightNone(NodePtr node);
418434

419435
void NodeStyleSetRightPercentage(NodePtr node, float value);
420436

437+
void NodeStyleSetRowGap(NodePtr node, float value);
438+
439+
void NodeStyleSetRowGapCalcHandle(NodePtr node, int32_t calc_handle);
440+
441+
void NodeStyleSetRowGapNormal(NodePtr node);
442+
443+
void NodeStyleSetRowGapPercentage(NodePtr node, float value);
444+
421445
void NodeStyleSetTextAlign(NodePtr node, TextAlignType value);
422446

423447
void NodeStyleSetTop(NodePtr node, float value);
@@ -444,6 +468,6 @@ void NodeStyleSetWritingMode(NodePtr node, WritingModeType value);
444468

445469
const char *NodeToString(NodePtr node, bool recursive, bool layout, bool style);
446470

447-
} // extern "C"
471+
} // extern "C"
448472

449-
} // namespace float_pigment
473+
} // namespace float_pigment

0 commit comments

Comments
 (0)