diff --git a/.gitignore b/.gitignore index 87b38e4..3df608d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ *.o +*.a build/* **/.ccls-cache diff --git a/TODO b/TODO index 8ffaabc..aa82908 100644 --- a/TODO +++ b/TODO @@ -6,6 +6,8 @@ [ ] Write a README.md [ ] Use an arena allocator for cache [ ] Do not redraw if there was no update (no layout and no draw) +[ ] Better handling of the active and focused widgets, try + to maintain focus until mouse release (fix scroll bars) ## Commands [x] rect commads should have: @@ -19,11 +21,11 @@ ## Fonts [ ] Fix the missing alpha channel -[ ] Fix the allignment +[x] Fix the alignment ## Raylib [ ] Implement type (Rect, Color, Point) conversion functions between rl:: and ugui:: -[ ] Implement pixel radius rounding for border radius +[x] Implement pixel radius rounding for border radius ## Widgets [ ] Dynamic text box to implement an fps counter diff --git a/lib/libgrapheme.c3l/Makefile b/lib/libgrapheme.c3l/Makefile new file mode 100644 index 0000000..f753fc0 --- /dev/null +++ b/lib/libgrapheme.c3l/Makefile @@ -0,0 +1,3 @@ +all: + make -C thirdparty/libgrapheme + cp thirdparty/libgrapheme/libgrapheme.a linux-x64/libgrapheme.a diff --git a/lib/libgrapheme.c3l/libgrapheme.c3i b/lib/libgrapheme.c3l/libgrapheme.c3i new file mode 100644 index 0000000..076fb4b --- /dev/null +++ b/lib/libgrapheme.c3l/libgrapheme.c3i @@ -0,0 +1,46 @@ +module grapheme; + +const uint GRAPHEME_INVALID_CODEPOINT UINT32_C = 0xFFFD; + +enum BidirectionalDirection { + GRAPHEME_BIDIRECTIONAL_DIRECTION_NEUTRAL, + GRAPHEME_BIDIRECTIONAL_DIRECTION_LTR, + GRAPHEME_BIDIRECTIONAL_DIRECTION_RTL, +} + +fn isz bidirectional_get_line_embedding_levels(uint *, isz, ichar *, isz) @extern("grapheme_bidirectional_get_line_embedding_levels"); + +fn isz bidirectional_preprocess_paragraph(uint *, isz, BidirectionalDirection, uint *, isz, BidirectionalDirection *) @extern("grapheme_bidirectional_preprocess_paragraph"); + +fn isz bidirectional_reorder_line(uint *, uint *, isz, uint *, isz) @extern("grapheme_bidirectional_reorder_line"); + +fn isz decode_utf8(char *, isz, uint *) @extern("grapheme_decode_utf8"); +fn isz encode_utf8(uint, char *, isz) @extern("grapheme_encode_utf8"); + +fn bool is_character_break(uint, uint, ushort *) @extern("grapheme_is_character_break"); + +fn bool is_lowercase(uint *, isz, isz *) @extern("grapheme_is_lowercase"); +fn bool is_titlecase(uint *, isz, isz *) @extern("grapheme_is_titlecase"); +fn bool is_uppercase(uint *, isz, isz *) @extern("grapheme_is_uppercase"); + +fn bool is_lowercase_utf8(char *, isz, isz *) @extern("grapheme_is_lowercase_utf8"); +fn bool is_titlecase_utf8(char *, isz, isz *) @extern("grapheme_is_titlecase_utf8"); +fn bool is_uppercase_utf8(char *, isz, isz *) @extern("grapheme_is_uppercase_utf8"); + +fn isz next_character_break(uint *, isz) @extern("grapheme_next_character_break"); +fn isz next_line_break(uint *, isz) @extern("grapheme_next_line_break"); +fn isz next_sentence_break(uint *, isz) @extern("grapheme_next_sentence_break"); +fn isz next_word_break(uint *, isz) @extern("grapheme_next_word_break"); + +fn isz next_character_break_utf8(char *, isz) @extern("grapheme_next_character_break_utf8"); +fn isz next_line_break_utf8(char *, isz) @extern("grapheme_next_line_break_utf8"); +fn isz next_sentence_break_utf8(char *, isz) @extern("grapheme_next_sentence_break_utf8"); +fn isz next_word_break_utf8(char *, isz) @extern("grapheme_next_word_break_utf8"); + +fn isz to_lowercase(uint *, isz, uint *, isz) @extern("grapheme_to_lowercase"); +fn isz to_titlecase(uint *, isz, uint *, isz) @extern("grapheme_to_titlecase"); +fn isz to_uppercase(uint *, isz, uint *, isz) @extern("grapheme_to_uppercase"); + +fn isz to_lowercase_utf8(char *, isz, char *, isz) @extern("grapheme_to_lowercase_utf8"); +fn isz to_titlecase_utf8(char *, isz, char *, isz) @extern("grapheme_to_titlecase_utf8"); +fn isz to_uppercase_utf8(char *, isz, char *, isz) @extern("grapheme_to_uppercase_utf8"); diff --git a/lib/libgrapheme.c3l/manifest.json b/lib/libgrapheme.c3l/manifest.json new file mode 100644 index 0000000..97f04d0 --- /dev/null +++ b/lib/libgrapheme.c3l/manifest.json @@ -0,0 +1,9 @@ +{ + "provides": "grapheme", + "targets": { + "linux-x64": { + "dependencies": [], + "linked-libraries": ["grapheme", "c"] + } + } +} diff --git a/lib/libgrapheme.c3l/project.json b/lib/libgrapheme.c3l/project.json new file mode 100644 index 0000000..876ca0c --- /dev/null +++ b/lib/libgrapheme.c3l/project.json @@ -0,0 +1,44 @@ +{ + // Language version of C3. + "langrev": "1", + // Warnings used for all targets. + "warnings": ["no-unused"], + // Directories where C3 library files may be found. + "dependency-search-paths": [".."], + // Libraries to use for all targets. + "dependencies": ["grapheme"], + // Authors, optionally with email. + "authors": ["Alessandro Mauri