Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Java bindings #705

Open
wants to merge 32 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
c1bb7a9
wip: java bindings
adjabaev Aug 19, 2024
21ec83d
Pretty much usable (there are missing functions such as remove and so…
adjabaev Aug 20, 2024
65db9eb
rust fmt formatting (did i figure it out?)
adjabaev Aug 20, 2024
4fe722b
Fix Clippy issues
adjabaev Aug 20, 2024
9891bbb
java: turn into a maven project
adjabaev Aug 20, 2024
47bea2e
java: implement a few tests to ensure everything is working as intended
adjabaev Aug 21, 2024
3eabd6c
rust-java: Add most of methods in TaffyTree
adjabaev Aug 21, 2024
587c810
rust: rustfmt
adjabaev Aug 21, 2024
81dcdcd
java: utility
adjabaev Aug 21, 2024
b53ea74
rust: fix signatures
adjabaev Aug 21, 2024
a0dab92
rust-java: remove Taffy from classes & change signatures
adjabaev Aug 21, 2024
d778ff2
enums: enum generator (just to collect feedback)
adjabaev Aug 26, 2024
6d1beb2
enums: fix index parameter as we can get it with ordinal()
adjabaev Aug 26, 2024
71064b0
enums: write files to enum folder
adjabaev Aug 26, 2024
32865ee
enums: use autogenerated files
adjabaev Aug 26, 2024
1fd2c5b
enums: update refs
adjabaev Aug 27, 2024
8bf25f1
java: readded first example for reference
adjabaev Aug 28, 2024
5bae96d
java: add nested and somewhat tweak toString's
adjabaev Aug 28, 2024
9b412c8
java: gap & related util
adjabaev Aug 28, 2024
cbdb98c
rust: fix enum field stuff
adjabaev Aug 28, 2024
114a279
rust/ java: wip - more complex examples
adjabaev Aug 29, 2024
560fd19
genenums: move to to scripts folder
adjabaev Sep 2, 2024
9db2b69
genenums: auto generate "transformers"
adjabaev Sep 2, 2024
1697115
genenums: fix generics
adjabaev Sep 2, 2024
efebe81
genenums: add subfolders
adjabaev Sep 2, 2024
1735861
genenums: support default & remove usage of HashMap as it doesn't kee…
adjabaev Sep 2, 2024
a10e904
genenums: tweak file end line generation
adjabaev Sep 2, 2024
38b6576
genenums: try to fix rustfmt
adjabaev Sep 2, 2024
d7090fb
genenums: try to fix rustfmt
adjabaev Sep 2, 2024
798a82a
genenums: rustfmt stuff
adjabaev Sep 2, 2024
59a793f
genenums: add note for when intersperse is stabilised
adjabaev Sep 3, 2024
765ccd2
java: working on measure function stuff
adjabaev Sep 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
enums: use autogenerated files
adjabaev committed Aug 26, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 32865ee283699e4c6fce1157b105e53e3e9409c3
2 changes: 2 additions & 0 deletions bindings/java/.gitignore
Original file line number Diff line number Diff line change
@@ -2,3 +2,5 @@
*.iml
out
*.class
/target
/java/target
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
**********************************************************
** AUTOGENERATED CLASSES FOR TAFFY **
** This code was automatically generated. Do not edit. **
**********************************************************
*/
package com.dioxuslabs.taffy.enums;

public enum AlignContent {
START,
END,
FLEX_START,
FLEX_END,
CENTER,
STRETCH,
SPACE_BETWEEN,
SPACE_EVENLY,
SPACE_AROUND
;

private final int ordinal;

AlignContent() {
this.ordinal = ordinal();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
**********************************************************
** AUTOGENERATED CLASSES FOR TAFFY **
** This code was automatically generated. Do not edit. **
**********************************************************
*/
package com.dioxuslabs.taffy.enums;

public enum AlignItems {
START,
END,
FLEX_START,
FLEX_END,
CENTER,
BASELINE,
STRETCH
;

private final int ordinal;

AlignItems() {
this.ordinal = ordinal();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
**********************************************************
** AUTOGENERATED CLASSES FOR TAFFY **
** This code was automatically generated. Do not edit. **
**********************************************************
*/
package com.dioxuslabs.taffy.enums;

public enum BoxGenerationMode {
NORMAL,
NONE
;

private final int ordinal;

BoxGenerationMode() {
this.ordinal = ordinal();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
**********************************************************
** AUTOGENERATED CLASSES FOR TAFFY **
** This code was automatically generated. Do not edit. **
**********************************************************
*/
package com.dioxuslabs.taffy.enums;

public enum BoxSizing {
BORDER_BOX,
CONTENT_BOX
;

private final int ordinal;

BoxSizing() {
this.ordinal = ordinal();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
**********************************************************
** AUTOGENERATED CLASSES FOR TAFFY **
** This code was automatically generated. Do not edit. **
**********************************************************
*/
package com.dioxuslabs.taffy.enums;

public enum Display {
BLOCK,
FLEX,
GRID,
NONE
;

private final int ordinal;

Display() {
this.ordinal = ordinal();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
**********************************************************
** AUTOGENERATED CLASSES FOR TAFFY **
** This code was automatically generated. Do not edit. **
**********************************************************
*/
package com.dioxuslabs.taffy.enums;

public enum FlexDirection {
ROW,
COLUMN,
ROW_REVERSE,
COLUMN_REVERSE
;

private final int ordinal;

FlexDirection() {
this.ordinal = ordinal();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
**********************************************************
** AUTOGENERATED CLASSES FOR TAFFY **
** This code was automatically generated. Do not edit. **
**********************************************************
*/
package com.dioxuslabs.taffy.enums;

public enum FlexWrap {
NO_WRAP,
WRAP,
WRAP_REVERSE
;

private final int ordinal;

FlexWrap() {
this.ordinal = ordinal();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
**********************************************************
** AUTOGENERATED CLASSES FOR TAFFY **
** This code was automatically generated. Do not edit. **
**********************************************************
*/
package com.dioxuslabs.taffy.enums;

public enum GridAutoFlow {
ROW,
COLUMN,
ROW_DENSE,
COLUMN_DENSE
;

private final int ordinal;

GridAutoFlow() {
this.ordinal = ordinal();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
**********************************************************
** AUTOGENERATED CLASSES FOR TAFFY **
** This code was automatically generated. Do not edit. **
**********************************************************
*/
package com.dioxuslabs.taffy.enums;

public enum Overflow {
VISIBLE,
CLIP,
HIDDEN,
SCROLL
;

private final int ordinal;

Overflow() {
this.ordinal = ordinal();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
**********************************************************
** AUTOGENERATED CLASSES FOR TAFFY **
** This code was automatically generated. Do not edit. **
**********************************************************
*/
package com.dioxuslabs.taffy.enums;

public enum Position {
RELATIVE,
ABSOLUTE
;

private final int ordinal;

Position() {
this.ordinal = ordinal();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
**********************************************************
** AUTOGENERATED CLASSES FOR TAFFY **
** This code was automatically generated. Do not edit. **
**********************************************************
*/
package com.dioxuslabs.taffy.enums;

public enum TextAlign {
AUTO,
LEGACY_LEFT,
LEGACY_RIGHT,
LEGACY_CENTER
;

private final int ordinal;

TextAlign() {
this.ordinal = ordinal();
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.dioxuslabs.taffy.geom.grid;

import com.dioxuslabs.taffy.style.GridAutoFlow;
import com.dioxuslabs.taffy.enums.GridAutoFlow;

/**
* A grid line placement specification which is generic over the coordinate system that it uses to define

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.dioxuslabs.taffy.style;

import com.dioxuslabs.taffy.enums.*;
import com.dioxuslabs.taffy.geom.Line;
import com.dioxuslabs.taffy.geom.Point;
import com.dioxuslabs.taffy.geom.Rect;

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.dioxuslabs.taffy;

import com.dioxuslabs.taffy.enums.AlignContent;
import com.dioxuslabs.taffy.geom.Size;
import com.dioxuslabs.taffy.geom.measure.Dimension;
import com.dioxuslabs.taffy.style.AlignContent;
import com.dioxuslabs.taffy.style.Style;
import com.dioxuslabs.taffy.tree.Layout;
import org.junit.jupiter.api.Test;
5 changes: 5 additions & 0 deletions bindings/scripts/src/main.rs
Original file line number Diff line number Diff line change
@@ -14,6 +14,11 @@ fn main() {
enums.insert("GridAutoFlow", vec!["Row", "Column", "RowDense", "ColumnDense"]);
enums.insert("FlexWrap", vec!["NoWrap", "Wrap", "WrapReverse"]);
enums.insert("FlexDirection", vec!["Row", "Column", "RowReverse", "ColumnReverse"]);
enums.insert(
"AlignContent",
vec!["Start", "End", "FlexStart", "FlexEnd", "Center", "Stretch", "SpaceBetween", "SpaceEvenly", "SpaceAround"],
);
enums.insert("AlignItems", vec!["Start", "End", "FlexStart", "FlexEnd", "Center", "Baseline", "Stretch"]);

for (key, value) in enums.into_iter() {
create_enum(key, value);