Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3526afee37 | ||
|
|
d606232116 | ||
|
|
c7200216be | ||
|
|
a27554e4c8 | ||
|
|
183f4e6a42 | ||
|
|
9a1ef0653d | ||
|
|
b763e34510 | ||
|
|
aa7d1296f5 | ||
|
|
45e29839f4 | ||
|
|
4bc3b917bf | ||
|
|
e637e50f59 | ||
|
|
1ee815a636 | ||
|
|
67c4e768be | ||
|
|
c0c17f6c83 | ||
|
|
2151faabd4 | ||
|
|
17afae92cb | ||
|
|
1fed3f13fc |
No files matched your search
@@ -86,7 +86,7 @@ jobs:
|
||||
run: |
|
||||
set -euo pipefail
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y build-essential cmake libssl-dev pkg-config zlib1g-dev
|
||||
sudo apt-get install -y build-essential cmake libssl-dev pkg-config zlib1g-dev libsdl2-dev libdrm-dev libgbm-dev libegl1-mesa-dev libgles2-mesa-dev
|
||||
|
||||
- name: Build And Test
|
||||
run: |
|
||||
@@ -99,6 +99,7 @@ jobs:
|
||||
run: |
|
||||
set -euo pipefail
|
||||
make dist-static CMAKE=/usr/bin/cmake VERSION="${{ steps.ref.outputs.tag }}"
|
||||
make check-static-package CMAKE=/usr/bin/cmake VERSION="${{ steps.ref.outputs.tag }}"
|
||||
archive="$(find dist -maxdepth 1 -type f -name flint-*-static.tar.gz | head -n 1)"
|
||||
test -n "$archive"
|
||||
echo "FLINT_STATIC_ARCHIVE=$archive" >> "$GITHUB_ENV"
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
build/
|
||||
dist/
|
||||
libflint.a
|
||||
assets/fonts/
|
||||
assets/fonts/*
|
||||
|
||||
# Example binaries
|
||||
examples/01_file_dialog
|
||||
|
||||
@@ -7,3 +7,9 @@
|
||||
[submodule "vendor/curl"]
|
||||
path = vendor/curl
|
||||
url = https://github.com/curl/curl.git
|
||||
[submodule "vendor/cmark-gfm"]
|
||||
path = vendor/cmark-gfm
|
||||
url = https://github.com/github/cmark-gfm.git
|
||||
[submodule "vendor/fontchop"]
|
||||
path = vendor/fontchop
|
||||
url = [email protected]:waozixyz/fontchop.git
|
||||
@@ -0,0 +1,33 @@
|
||||
# Changelog
|
||||
|
||||
## [v0.1.3] - 2026-07-16
|
||||
|
||||
### Changed
|
||||
|
||||
- Add public Flint version metadata for release artifacts.
|
||||
- Move font atlas generation to the vendored fontchop submodule.
|
||||
- Replace the single implicit UI font with a registered font selection API.
|
||||
- Improve generated icon asset formatting and desktop/embedded fallbacks.
|
||||
|
||||
### Added
|
||||
|
||||
- Add Markdown support and text area UI.
|
||||
- Add pointer release helper APIs and modal layer input capture.
|
||||
|
||||
## [v0.1.2] - 2026-07-12
|
||||
|
||||
### Added
|
||||
|
||||
- Add web file dialog loading.
|
||||
|
||||
## [v0.1.1] - 2026-07-12
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix release CI vendor builds.
|
||||
|
||||
## [v0.1.0] - 2026-07-12
|
||||
|
||||
### Added
|
||||
|
||||
- Add Flint release automation.
|
||||
@@ -1,15 +1,18 @@
|
||||
CC ?= cc
|
||||
AR ?= ar
|
||||
BUILD_DIR ?= build
|
||||
PREFIX ?= /usr/local
|
||||
SITE_DIR ?= docs/site
|
||||
SITE_BUILD_DIR ?= $(BUILD_DIR)/site
|
||||
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || printf '%s' 0.0.0)
|
||||
VERSION_FILE ?= include/flint_version.h
|
||||
FLINT_VERSION_STRING := $(shell sed -n 's/^#define FLINT_VERSION_STRING "\([^"]*\)".*/\1/p' $(VERSION_FILE) 2>/dev/null)
|
||||
VERSION ?= $(if $(strip $(FLINT_VERSION_STRING)),$(FLINT_VERSION_STRING),$(shell git describe --tags --always --dirty 2>/dev/null || printf '%s' 0.0.0))
|
||||
DIST_DIR ?= dist
|
||||
STATIC_DIST_ROOT := $(BUILD_DIR)/dist/flint-$(VERSION)-static
|
||||
STATIC_DIST_ARCHIVE := $(DIST_DIR)/flint-$(VERSION)-static.tar.gz
|
||||
CFLAGS ?= -Wall -Wextra -O2
|
||||
CPPFLAGS_BASE = -Iinclude
|
||||
ICON_DIR ?= icons pfp
|
||||
ICON_DIR ?= icons language payments platforms tiles pfp
|
||||
ICON_FILES = $(foreach dir,$(ICON_DIR),$(wildcard $(dir)/*.png))
|
||||
ICON_ASSETS_C = src/ui/ui_icon_assets.c
|
||||
EMBED_ASSETS ?= themes
|
||||
@@ -17,16 +20,53 @@ EMBED_ASSET_FILES = $(shell find $(EMBED_ASSETS) -type f 2>/dev/null)
|
||||
EMBED_ASSETS_C = $(BUILD_DIR)/embedded_asset_data.c
|
||||
FLINT_COMPAT_GENERATOR = tools/generate-flint-compat.sh
|
||||
FLINT_BOUNDARY_CHECK = tools/check-flint-boundaries.sh
|
||||
FLINT_COMPAT_SYMBOL_CHECK = tools/check-raylib-compat-symbols.sh
|
||||
FLINT_COMPAT_HEADER = include/flint_compat.generated.h
|
||||
FLINT_BACKEND_RENAME_HEADER = $(BUILD_DIR)/generated/raylib_backend_rename.h
|
||||
FLINT_RAYLIB_WRAPPERS_C = $(BUILD_DIR)/generated/flint_raylib_wrappers.c
|
||||
FLINT_FONT_OUT ?= assets/fonts/locales
|
||||
FLINT_RAYLIB_GENERATED_PUBLIC_HEADER ?= $(FLINT_COMPAT_HEADER)
|
||||
FLINT_RAYLIB_BACKEND_RENAME_HEADER ?= $(FLINT_BACKEND_RENAME_HEADER)
|
||||
FLINT_FONT_OUT ?= assets/fonts/ui
|
||||
FLINT_FONT_OUTPUTS = $(FLINT_FONT_OUT).png $(FLINT_FONT_OUT).dat
|
||||
FLINT_FONT_LOCALES ?= locales/*.txt
|
||||
FLINT_FONT_LOCALE_FILES = $(wildcard $(FLINT_FONT_LOCALES))
|
||||
FLINT_FONT_FALLBACK_LOCALES = tools/otfchop/locales/en.txt
|
||||
FLINT_FONT_SOURCE ?= tools/otfchop/unifont-17.0.04.otf
|
||||
FLINT_OTFCHOP ?= tools/otfchop/otfchop
|
||||
FLINT_FONT_SOURCE ?= vendor/fontchop/fonts/unifont-17.0.04.otf
|
||||
FLINT_FONT_RANGES ?= ascii
|
||||
FLINT_FONT_MISSING ?= fail
|
||||
FLINT_FONTCHOP ?= vendor/fontchop/fontchop
|
||||
UNAME_S := $(shell uname -s 2>/dev/null)
|
||||
UNAME_M := $(shell uname -m 2>/dev/null)
|
||||
ifeq ($(UNAME_M),amd64)
|
||||
FLINT_ARCH := x86_64
|
||||
else
|
||||
FLINT_ARCH := $(UNAME_M)
|
||||
endif
|
||||
ifeq ($(UNAME_S),Linux)
|
||||
FLINT_PLATFORM := linux
|
||||
else ifeq ($(UNAME_S),FreeBSD)
|
||||
FLINT_PLATFORM := freebsd
|
||||
else ifeq ($(UNAME_S),Darwin)
|
||||
FLINT_PLATFORM := macos
|
||||
else
|
||||
FLINT_PLATFORM := $(UNAME_S)
|
||||
endif
|
||||
|
||||
RAYLIB_DIR ?= $(FLINT_DIR)/vendor/raylib/src
|
||||
RAYLIB_BUILD_DIR ?= $(BUILD_DIR)/raylib
|
||||
RAYLIB_A ?= $(RAYLIB_BUILD_DIR)/libraylib.a
|
||||
RAY_PKGS ?= sdl2 libdrm gbm egl glesv2
|
||||
RAY_SDL_CFLAGS ?= $(shell pkg-config --cflags sdl2 2>/dev/null)
|
||||
RAY_SDL_LDLIBS ?= $(shell pkg-config --libs sdl2 2>/dev/null)
|
||||
RAY_GL_CFLAGS ?= $(shell pkg-config --cflags libdrm gbm egl glesv2 2>/dev/null)
|
||||
RAY_GL_LDLIBS ?= $(shell pkg-config --libs libdrm gbm egl glesv2 2>/dev/null)
|
||||
RAY_CFLAGS ?= $(strip $(RAY_SDL_CFLAGS) $(RAY_GL_CFLAGS))
|
||||
RAY_LDLIBS ?= $(strip $(RAY_SDL_LDLIBS) $(RAY_GL_LDLIBS))
|
||||
RAY_SDL_INCLUDE_DIR ?= $(shell pkg-config --variable=includedir sdl2 2>/dev/null | sed 's,/SDL2$$,,')
|
||||
RAY_RAYLIB_CONFIG ?= -DSUPPORT_SCREEN_CAPTURE=0 -DSUPPORT_COMPRESSION_API=0 -DSUPPORT_AUTOMATION_EVENTS=0 -DSUPPORT_CLIPBOARD_IMAGE=0 -DSUPPORT_FILEFORMAT_BMP=0 -DSUPPORT_FILEFORMAT_GIF=0 -DSUPPORT_FILEFORMAT_QOI=0 -DSUPPORT_FILEFORMAT_DDS=0 -DSUPPORT_FILEFORMAT_TTF=1
|
||||
APP_RAYLIB_CONFIG ?= $(filter-out -DSUPPORT_MODULE_RAUDIO=0 -DSUPPORT_FILEFORMAT_PNG=0 -DSUPPORT_FILEFORMAT_JPG=0 -DSUPPORT_FILEFORMAT_OGG=0 -DSUPPORT_FILEFORMAT_MP3=0,$(RAY_RAYLIB_CONFIG)) -DSUPPORT_MODULE_RAUDIO=1 -DSUPPORT_FILEFORMAT_JPG=1 -DSUPPORT_FILEFORMAT_OGG=1 -DSUPPORT_FILEFORMAT_MP3=1
|
||||
FLINT_STATIC_PACKAGE_EXTERNAL_LIBS ?= $(RAY_LDLIBS) $(FLINT_OPENSSL_SSL_LDLIB) $(FLINT_OPENSSL_CRYPTO_LDLIB) -lpthread -lm
|
||||
FLINT_STATIC_PACKAGE_LIBS ?= -lflint -lraylib -loqs -lcurl -lcmark-gfm-extensions -lcmark-gfm $(FLINT_STATIC_PACKAGE_EXTERNAL_LIBS)
|
||||
FLINT_STATIC_PACKAGE_CFLAGS ?= -I$${includedir} -DHAS_LIBOQS=1 -DHAS_LIBCURL=1 -DCURL_STATICLIB -DFLINT_HAS_CMARK_GFM=1
|
||||
|
||||
# Check if we're in nix-shell and use its flags
|
||||
ifneq ($(NIX_CFLAGS_COMPILE),)
|
||||
@@ -38,13 +78,15 @@ ARFLAGS ?= rcs
|
||||
FLINT_DIR ?= .
|
||||
FLINT_VENDOR_BUILD_DIR ?= $(BUILD_DIR)/vendor
|
||||
include mk/vendor.mk
|
||||
include mk/raylib.mk
|
||||
|
||||
CPPFLAGS += -DHAS_LIBOQS=1 $(FLINT_LIBOQS_INCLUDE) \
|
||||
-DHAS_LIBCURL=1 $(FLINT_CURL_CFLAGS)
|
||||
-DHAS_LIBCURL=1 $(FLINT_CURL_CFLAGS) \
|
||||
$(FLINT_MARKDOWN_CFLAGS)
|
||||
|
||||
SRCS := $(shell find src -type f -name '*.c' | LC_ALL=C sort)
|
||||
|
||||
SRCS += $(EMBED_ASSETS_C)
|
||||
SRCS += $(EMBED_ASSETS_C) $(FLINT_RAYLIB_WRAPPERS_C)
|
||||
|
||||
SYSTEM_THEME_PKG := $(shell if pkg-config --exists gtk+-3.0 2>/dev/null; then printf '%s' gtk+-3.0; fi)
|
||||
ifneq ($(strip $(SYSTEM_THEME_PKG)),)
|
||||
@@ -59,8 +101,11 @@ LYRA_ACCOUNT_TEST = $(BUILD_DIR)/tests/lyra_account_test
|
||||
LYRA_SYNC_TEST = $(BUILD_DIR)/tests/lyra_sync_test
|
||||
TRANSITION_TEST = $(BUILD_DIR)/tests/transition_test
|
||||
FILE_DIALOG_BACKEND_TEST = $(BUILD_DIR)/tests/file_dialog_backend_test
|
||||
MARKDOWN_TEST = $(BUILD_DIR)/tests/markdown_test
|
||||
RAYLIB_COMPAT_TEST = $(BUILD_DIR)/tests/raylib_compat_test
|
||||
RAYLIB_COMPAT_LDLIBS ?= $(RAY_LDLIBS) -lpthread -lm $(if $(filter linux,$(FLINT_PLATFORM)),-ldl -lrt,)
|
||||
|
||||
.PHONY: all clean run font-assets docs-site test bsd-check flint-compat flint-compat-check flint-boundary-check dist-static
|
||||
.PHONY: all clean run font-assets docs-site test bsd-check flint-compat flint-compat-check flint-boundary-check version release-check dist-static check-static-package install-static
|
||||
|
||||
all: $(LIB)
|
||||
|
||||
@@ -73,7 +118,7 @@ run:
|
||||
|
||||
clean:
|
||||
rm -rf $(BUILD_DIR) $(LIB)
|
||||
$(MAKE) -C tools/otfchop clean
|
||||
$(MAKE) -C vendor/fontchop clean
|
||||
$(MAKE) -C examples web-clean
|
||||
|
||||
docs-site:
|
||||
@@ -82,11 +127,13 @@ docs-site:
|
||||
cp -R $(SITE_DIR)/. $(SITE_BUILD_DIR)/
|
||||
$(MAKE) -C examples web EXAMPLES_WEB_SITE_DIR="$(abspath $(SITE_BUILD_DIR))/examples"
|
||||
|
||||
test: flint-compat-check flint-boundary-check $(LYRA_ACCOUNT_TEST) $(LYRA_SYNC_TEST) $(TRANSITION_TEST) $(FILE_DIALOG_BACKEND_TEST)
|
||||
test: flint-compat-check flint-boundary-check $(LYRA_ACCOUNT_TEST) $(LYRA_SYNC_TEST) $(TRANSITION_TEST) $(FILE_DIALOG_BACKEND_TEST) $(MARKDOWN_TEST) $(RAYLIB_COMPAT_TEST)
|
||||
$(LYRA_ACCOUNT_TEST)
|
||||
$(LYRA_SYNC_TEST)
|
||||
$(TRANSITION_TEST)
|
||||
$(FILE_DIALOG_BACKEND_TEST)
|
||||
$(MARKDOWN_TEST)
|
||||
$(RAYLIB_COMPAT_TEST)
|
||||
|
||||
bsd-check:
|
||||
$(MAKE) clean
|
||||
@@ -101,26 +148,54 @@ flint-compat-check: | $(BUILD_DIR)
|
||||
$(BUILD_DIR)/check/raylib_backend_rename.h \
|
||||
$(BUILD_DIR)/check/flint_raylib_wrappers.c
|
||||
cmp $(FLINT_COMPAT_HEADER) $(BUILD_DIR)/check/flint_compat.generated.h
|
||||
sh $(FLINT_COMPAT_SYMBOL_CHECK) vendor/raylib/src/raylib.h \
|
||||
$(BUILD_DIR)/check/raylib_backend_rename.h \
|
||||
$(BUILD_DIR)/check/flint_raylib_wrappers.c
|
||||
|
||||
flint-boundary-check:
|
||||
sh $(FLINT_BOUNDARY_CHECK) .
|
||||
|
||||
$(LIB): $(FLINT_COMPAT_HEADER) $(OBJS) | $(FLINT_LIBOQS_A) $(FLINT_CURL_PROTOCOL_CHECK)
|
||||
$(AR) $(ARFLAGS) $@ $^
|
||||
$(LIB): $(OBJS) | $(FLINT_COMPAT_HEADER) $(FLINT_LIBOQS_A) $(FLINT_CURL_PROTOCOL_CHECK) $(FLINT_MARKDOWN_DEPS)
|
||||
$(AR) $(ARFLAGS) $@ $(OBJS)
|
||||
|
||||
dist-static: $(STATIC_DIST_ARCHIVE)
|
||||
version:
|
||||
@printf '%s\n' '$(VERSION)'
|
||||
|
||||
$(STATIC_DIST_ARCHIVE): $(LIB) $(FLINT_LIBOQS_A) $(FLINT_CURL_SO) README.md LICENSE docs/API.md
|
||||
release-check:
|
||||
@test -n '$(VERSION)'
|
||||
@grep -q '^## \[$(VERSION)\]' CHANGELOG.md
|
||||
|
||||
dist-static: release-check $(STATIC_DIST_ARCHIVE)
|
||||
|
||||
check-static-package: $(STATIC_DIST_ARCHIVE)
|
||||
sh scripts/check-static-package.sh $(STATIC_DIST_ARCHIVE)
|
||||
|
||||
install-static: $(STATIC_DIST_ARCHIVE)
|
||||
mkdir -p $(DESTDIR)$(PREFIX)
|
||||
tar -xzf $(STATIC_DIST_ARCHIVE) -C $(DESTDIR)$(PREFIX) --strip-components=1
|
||||
|
||||
$(STATIC_DIST_ARCHIVE): $(LIB) $(RAYLIB_A) $(FLINT_LIBOQS_A) $(FLINT_CURL_A) $(FLINT_MARKDOWN_DEPS) README.md LICENSE THIRD_PARTY_NOTICES.md CHANGELOG.md docs/API.md examples/package/minimal.c examples/package/markdown.c scripts/check-static-package.sh
|
||||
rm -rf $(STATIC_DIST_ROOT)
|
||||
mkdir -p $(STATIC_DIST_ROOT)/include $(STATIC_DIST_ROOT)/lib $(STATIC_DIST_ROOT)/lib/pkgconfig $(STATIC_DIST_ROOT)/docs $(DIST_DIR)
|
||||
mkdir -p $(STATIC_DIST_ROOT)/include $(STATIC_DIST_ROOT)/lib $(STATIC_DIST_ROOT)/lib/pkgconfig $(STATIC_DIST_ROOT)/lib/cmake/flint $(STATIC_DIST_ROOT)/share/doc/flint $(STATIC_DIST_ROOT)/share/licenses/flint $(STATIC_DIST_ROOT)/examples $(DIST_DIR)
|
||||
cp -R include/. $(STATIC_DIST_ROOT)/include/
|
||||
cp $(LIB) $(STATIC_DIST_ROOT)/lib/
|
||||
cp $(FLINT_LIBOQS_A) $(STATIC_DIST_ROOT)/lib/
|
||||
cp $(FLINT_CURL_A) $(STATIC_DIST_ROOT)/lib/
|
||||
cp README.md LICENSE $(STATIC_DIST_ROOT)/
|
||||
cp docs/API.md $(STATIC_DIST_ROOT)/docs/
|
||||
cp $(LIB) $(RAYLIB_A) $(FLINT_LIBOQS_A) $(FLINT_CURL_A) $(FLINT_MARKDOWN_DEPS) $(STATIC_DIST_ROOT)/lib/
|
||||
cp README.md $(STATIC_DIST_ROOT)/
|
||||
cp LICENSE $(STATIC_DIST_ROOT)/
|
||||
cp LICENSE THIRD_PARTY_NOTICES.md $(STATIC_DIST_ROOT)/share/licenses/flint/
|
||||
cp CHANGELOG.md docs/API.md $(STATIC_DIST_ROOT)/share/doc/flint/
|
||||
cp examples/package/*.c $(STATIC_DIST_ROOT)/examples/
|
||||
git submodule status > $(STATIC_DIST_ROOT)/SUBMODULES.txt
|
||||
printf '%s\n' '$(VERSION)' > $(STATIC_DIST_ROOT)/VERSION
|
||||
printf '%s\n' \
|
||||
'{' \
|
||||
' "name": "flint",' \
|
||||
' "version": "$(VERSION)",' \
|
||||
' "target": "$(FLINT_PLATFORM)-$(FLINT_ARCH)",' \
|
||||
' "compiler": "$(CC)",' \
|
||||
' "static_libraries": ["libflint.a", "libraylib.a", "liboqs.a", "libcurl.a", "libcmark-gfm-extensions.a", "libcmark-gfm.a"],' \
|
||||
' "external_libraries": "$(FLINT_STATIC_PACKAGE_EXTERNAL_LIBS)",' \
|
||||
' "pkg_config": "lib/pkgconfig/flint.pc"' \
|
||||
'}' > $(STATIC_DIST_ROOT)/manifest.json
|
||||
printf '%s\n' \
|
||||
'prefix=$${pcfiledir}/../..' \
|
||||
'exec_prefix=$${prefix}' \
|
||||
@@ -130,16 +205,22 @@ $(STATIC_DIST_ARCHIVE): $(LIB) $(FLINT_LIBOQS_A) $(FLINT_CURL_SO) README.md LICE
|
||||
'Name: Flint' \
|
||||
'Description: Flint C support library for raylib-style applications' \
|
||||
'Version: $(VERSION)' \
|
||||
'Cflags: -I$${includedir} -DHAS_LIBOQS=1 -DHAS_LIBCURL=1 -DCURL_STATICLIB' \
|
||||
'Libs: -L$${libdir} -lflint -loqs -lcurl -lssl -lcrypto -lpthread -lm' \
|
||||
'Cflags: $(FLINT_STATIC_PACKAGE_CFLAGS)' \
|
||||
'Libs: -L$${libdir} $(FLINT_STATIC_PACKAGE_LIBS)' \
|
||||
> $(STATIC_DIST_ROOT)/lib/pkgconfig/flint.pc
|
||||
printf '%s\n' \
|
||||
'include(CMakeFindDependencyMacro)' \
|
||||
'get_filename_component(FLINT_PACKAGE_PREFIX "$${CMAKE_CURRENT_LIST_DIR}/../../.." ABSOLUTE)' \
|
||||
'add_library(Flint::flint STATIC IMPORTED)' \
|
||||
'set_target_properties(Flint::flint PROPERTIES IMPORTED_LOCATION "$${FLINT_PACKAGE_PREFIX}/lib/libflint.a" INTERFACE_INCLUDE_DIRECTORIES "$${FLINT_PACKAGE_PREFIX}/include" INTERFACE_COMPILE_DEFINITIONS "HAS_LIBOQS=1;HAS_LIBCURL=1;CURL_STATICLIB;FLINT_HAS_CMARK_GFM=1")' \
|
||||
'add_library(Flint::raylib STATIC IMPORTED)' \
|
||||
'set_target_properties(Flint::raylib PROPERTIES IMPORTED_LOCATION "$${FLINT_PACKAGE_PREFIX}/lib/libraylib.a")' \
|
||||
'set(Flint_PACKAGE_LIBS "$${FLINT_PACKAGE_PREFIX}/lib/liboqs.a" "$${FLINT_PACKAGE_PREFIX}/lib/libcurl.a" "$${FLINT_PACKAGE_PREFIX}/lib/libcmark-gfm-extensions.a" "$${FLINT_PACKAGE_PREFIX}/lib/libcmark-gfm.a")' \
|
||||
'set_target_properties(Flint::flint PROPERTIES INTERFACE_LINK_LIBRARIES "Flint::raylib;$${Flint_PACKAGE_LIBS}")' \
|
||||
'set(Flint_LIBRARIES Flint::flint Flint::raylib $${Flint_PACKAGE_LIBS})' \
|
||||
> $(STATIC_DIST_ROOT)/lib/cmake/flint/FlintConfig.cmake
|
||||
tar -C $(BUILD_DIR)/dist -czf $@ flint-$(VERSION)-static
|
||||
|
||||
$(FLINT_COMPAT_HEADER) $(FLINT_BACKEND_RENAME_HEADER) $(FLINT_RAYLIB_WRAPPERS_C): $(FLINT_COMPAT_GENERATOR) vendor/raylib/src/raylib.h | $(BUILD_DIR)
|
||||
sh $(FLINT_COMPAT_GENERATOR) vendor/raylib/src/raylib.h \
|
||||
$(FLINT_COMPAT_HEADER) $(FLINT_BACKEND_RENAME_HEADER) \
|
||||
$(FLINT_RAYLIB_WRAPPERS_C)
|
||||
|
||||
$(LYRA_ACCOUNT_TEST): tests/lyra_account_test.c src/lyra/lyra_account.c include/lyra_account.h $(FLINT_LIBOQS_A) | $(BUILD_DIR)
|
||||
@mkdir -p $(dir $@)
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) -DHAS_LIBOQS=1 $(FLINT_LIBOQS_INCLUDE) \
|
||||
@@ -156,10 +237,22 @@ $(TRANSITION_TEST): tests/transition_test.c src/ui/ui_transition.c include/ui_tr
|
||||
@mkdir -p $(dir $@)
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) tests/transition_test.c src/ui/ui_transition.c -o $@
|
||||
|
||||
$(MARKDOWN_TEST): tests/markdown_test.c src/markdown.c include/markdown.h $(FLINT_MARKDOWN_DEPS) | $(BUILD_DIR)
|
||||
@mkdir -p $(dir $@)
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(FLINT_MARKDOWN_CFLAGS) \
|
||||
tests/markdown_test.c src/markdown.c \
|
||||
$(FLINT_MARKDOWN_LDLIBS) -o $@
|
||||
|
||||
$(FILE_DIALOG_BACKEND_TEST): tests/file_dialog_backend_test.c src/file_dialog/file_dialog.c include/file_dialog.h | $(BUILD_DIR)
|
||||
@mkdir -p $(dir $@)
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) tests/file_dialog_backend_test.c src/file_dialog/file_dialog.c -o $@
|
||||
|
||||
$(RAYLIB_COMPAT_TEST): tests/raylib_compat_test.c $(LIB) $(RAYLIB_A) | $(BUILD_DIR)
|
||||
@mkdir -p $(dir $@)
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) tests/raylib_compat_test.c \
|
||||
$(LIB) $(RAYLIB_A) $(RAYLIB_COMPAT_LDLIBS) \
|
||||
-o $@
|
||||
|
||||
$(ICON_ASSETS_C): $(ICON_FILES) scripts/embed-icons.sh include/ui_icons.h
|
||||
sh scripts/embed-icons.sh "$(ICON_DIR)" $@
|
||||
|
||||
@@ -169,30 +262,25 @@ src/ui/ui_icon_names.c: $(ICON_FILES) scripts/embed-icons.sh include/ui_icon_typ
|
||||
$(EMBED_ASSETS_C): $(EMBED_ASSET_FILES) $(FLINT_FONT_OUTPUTS) scripts/embed-assets.sh include/embedded_assets.h | $(BUILD_DIR)
|
||||
sh scripts/embed-assets.sh $@ $(EMBED_ASSETS) $(FLINT_FONT_OUTPUTS)
|
||||
|
||||
$(BUILD_DIR)/%.o: src/%.c | $(BUILD_DIR) $(FLINT_LIBOQS_A) $(FLINT_CURL_PROTOCOL_CHECK)
|
||||
$(BUILD_DIR)/%.o: src/%.c | $(BUILD_DIR) $(FLINT_LIBOQS_A) $(FLINT_CURL_PROTOCOL_CHECK) $(FLINT_MARKDOWN_DEPS)
|
||||
@mkdir -p $(dir $@)
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
|
||||
|
||||
$(BUILD_DIR)/%.o: $(BUILD_DIR)/%.c | $(BUILD_DIR) $(FLINT_LIBOQS_A) $(FLINT_CURL_PROTOCOL_CHECK)
|
||||
$(BUILD_DIR)/%.o: $(BUILD_DIR)/%.c | $(BUILD_DIR) $(FLINT_LIBOQS_A) $(FLINT_CURL_PROTOCOL_CHECK) $(FLINT_MARKDOWN_DEPS)
|
||||
@mkdir -p $(dir $@)
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
|
||||
|
||||
$(BUILD_DIR):
|
||||
mkdir -p $@
|
||||
|
||||
$(FLINT_OTFCHOP): tools/otfchop/otfchop.c tools/otfchop/stb_truetype.h tools/otfchop/stb_image_write.h
|
||||
$(MAKE) -C tools/otfchop otfchop
|
||||
$(FLINT_FONTCHOP): vendor/fontchop/fontchop.c vendor/fontchop/stb_truetype.h vendor/fontchop/stb_image_write.h
|
||||
$(MAKE) -C vendor/fontchop fontchop
|
||||
|
||||
font-assets: $(FLINT_FONT_OUTPUTS)
|
||||
|
||||
$(FLINT_FONT_OUTPUTS): $(FLINT_OTFCHOP) $(FLINT_FONT_SOURCE) $(FLINT_FONT_FALLBACK_LOCALES) $(FLINT_FONT_LOCALE_FILES)
|
||||
$(FLINT_FONT_OUTPUTS): $(FLINT_FONTCHOP) $(FLINT_FONT_SOURCE) $(FLINT_FONT_LOCALE_FILES)
|
||||
@mkdir -p $(dir $(FLINT_FONT_OUT))
|
||||
@set -- $(FLINT_FONT_LOCALES); \
|
||||
case "$(FLINT_FONT_LOCALES)" in \
|
||||
*\**|*\?*) \
|
||||
if [ "$$1" = "$(FLINT_FONT_LOCALES)" ]; then \
|
||||
set -- $(FLINT_FONT_FALLBACK_LOCALES); \
|
||||
fi; \
|
||||
;; \
|
||||
esac; \
|
||||
$(FLINT_OTFCHOP) $(FLINT_FONT_SOURCE) "$$@" $(FLINT_FONT_OUT)
|
||||
$(FLINT_FONTCHOP) --font "$(FLINT_FONT_SOURCE)" --output "$(FLINT_FONT_OUT)" \
|
||||
$(foreach range,$(FLINT_FONT_RANGES),--range "$(range)") \
|
||||
--missing "$(FLINT_FONT_MISSING)" \
|
||||
$(foreach input,$(FLINT_FONT_LOCALE_FILES),--input "$(input)")
|
||||
@@ -50,8 +50,19 @@ Build a distributable static-library archive with:
|
||||
make dist-static
|
||||
```
|
||||
|
||||
The archive contains `libflint.a`, public headers, API docs, `liboqs.a`,
|
||||
`libcurl.a`, a `flint.pc` file, and the submodule revisions used to build it.
|
||||
The archive is an extracted SDK layout. It contains `libflint.a`,
|
||||
`libraylib.a`, vendored static dependency libraries, public headers, API docs,
|
||||
example consumers, CMake and pkg-config metadata, third-party notices, a package
|
||||
manifest, and the submodule revisions used to build it. Validate it with:
|
||||
|
||||
```bash
|
||||
make check-static-package
|
||||
```
|
||||
|
||||
`libflint.a` stays focused on Flint object files. Companion libraries are shipped
|
||||
beside it and linked through `lib/pkgconfig/flint.pc`. OpenSSL is still treated
|
||||
as an external system/toolchain dependency unless explicit OpenSSL static library
|
||||
paths are supplied at build time.
|
||||
|
||||
## Releases
|
||||
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
# Third-Party Notices
|
||||
|
||||
The Flint static package includes third-party static libraries built from the
|
||||
repository submodules listed in `SUBMODULES.txt`.
|
||||
|
||||
- raylib: zlib/libpng license, see `vendor/raylib/LICENSE` in the source tree.
|
||||
- liboqs: MIT license, see `vendor/liboqs/LICENSE.txt` in the source tree.
|
||||
- curl/libcurl: curl license, see `vendor/curl/COPYING` in the source tree.
|
||||
- cmark-gfm: BSD-style license, see `vendor/cmark-gfm/COPYING` in the source tree.
|
||||
|
||||
OpenSSL is not vendored into the package by default. When `flint.pc` lists
|
||||
`-lssl -lcrypto`, those libraries are expected to come from the target system or
|
||||
from paths supplied with `OPENSSL_ROOT_DIR`, `OPENSSL_SSL_LIBRARY`, and
|
||||
`OPENSSL_CRYPTO_LIBRARY` at build time.
|
||||
@@ -277,18 +277,20 @@ void ResetUIClip(void);
|
||||
#### Font Management
|
||||
|
||||
```c
|
||||
void SetUIFont(Font font);
|
||||
void SetUISmallFont(Font font);
|
||||
Font GetUIFont(void);
|
||||
int RegisterUIFont(const char *name, Font font);
|
||||
int RegisterUISmallFont(const char *name, Font font);
|
||||
int UseUIFont(const char *name);
|
||||
int UIFontHasGlyph(Font font, int codepoint);
|
||||
```
|
||||
|
||||
#### Font Loading
|
||||
|
||||
```c
|
||||
Font LoadUIChoppedFont(const char *png_path, const char *dat_path, int base_size);
|
||||
Font LoadUIChoppedFontFromMemory(const unsigned char *png_data, unsigned int png_size,
|
||||
const unsigned char *dat_data, unsigned int dat_size, int base_size);
|
||||
void UnloadUIFont(Font *font);
|
||||
void ClearUIFonts(void);
|
||||
```
|
||||
|
||||
#### Text Measurement
|
||||
|
||||
@@ -186,21 +186,20 @@ int result = DrawUIActionModal((UIModalSpec){
|
||||
<section id="fonts" class="wrap section">
|
||||
<h2>Fonts</h2>
|
||||
<p>
|
||||
Flint ships <code>tools/otfchop</code> for generating bitmap font
|
||||
atlases and metadata. Load generated assets with
|
||||
<code>LoadUIChoppedFont</code>, then install the font with
|
||||
<code>SetUIFont</code> and <code>SetUISmallFont</code>.
|
||||
Flint vendors <code>fontchop</code> in <code>vendor/fontchop</code> for generating bitmap font
|
||||
atlases and metadata from OTF or TTF sources. Load generated assets
|
||||
with <code>LoadUIChoppedFontFromMemory</code>, register the result
|
||||
with <code>RegisterUIFont</code>, then switch fonts with
|
||||
<code>UseUIFont</code>.
|
||||
</p>
|
||||
<pre><code>Font font = LoadUIChoppedFont(
|
||||
"assets/fonts/locales.png",
|
||||
"assets/fonts/locales.dat",
|
||||
UI_TEXT_BASE_SIZE);
|
||||
SetUIFont(font);</code></pre>
|
||||
<pre><code>Font font = LoadUIChoppedFontFromMemory(png, png_size, dat, dat_size, UI_TEXT_BASE_SIZE);
|
||||
RegisterUIFont("ui", font);
|
||||
UseUIFont("ui");</code></pre>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<footer class="wrap footer">
|
||||
<p>Flint is documented in <code>docs/API.md</code>. This page is static and ready for Netlify.</p>
|
||||
<p>Flint is documented in <code>docs/API.md</code>.</p>
|
||||
</footer>
|
||||
<script src="highlight.js"></script>
|
||||
</body>
|
||||
|
||||
@@ -14,11 +14,13 @@ ifeq ($(UNAME_S),Linux)
|
||||
EXAMPLE_SYSTEM_LDLIBS += -ldl -lrt
|
||||
endif
|
||||
FLINT_DIR := ..
|
||||
FONT_OUTPUT := assets/fonts/locales
|
||||
FONT_OUTPUT := assets/fonts/ui
|
||||
FONT_OUTPUTS := $(FONT_OUTPUT).png $(FONT_OUTPUT).dat
|
||||
FONT_LOCALES := $(wildcard locales/*.txt)
|
||||
FONT_TOOL := ../tools/otfchop/otfchop
|
||||
FONT_SOURCE := ../tools/otfchop/unifont-17.0.04.otf
|
||||
FONT_TOOL := ../vendor/fontchop/fontchop
|
||||
FONT_SOURCE := ../vendor/fontchop/fonts/unifont-17.0.04.otf
|
||||
FONT_RANGES := ascii
|
||||
FONT_MISSING := fail
|
||||
BUILD_DIR ?= ../build/examples
|
||||
WEB_EMBED_ASSETS_C := $(BUILD_DIR)/embedded_asset_data.c
|
||||
WEB_EMBED_ASSET_FILES := $(shell find ../themes -type f 2>/dev/null)
|
||||
@@ -57,13 +59,13 @@ all: ../libflint.a $(EXAMPLES)
|
||||
@$(MAKE) -C ..
|
||||
|
||||
$(FONT_TOOL):
|
||||
@$(MAKE) -C ../tools/otfchop otfchop
|
||||
@$(MAKE) -C ../vendor/fontchop fontchop
|
||||
|
||||
font-assets: $(FONT_OUTPUTS)
|
||||
|
||||
$(FONT_OUTPUTS): $(FONT_LOCALES) $(FONT_TOOL) $(FONT_SOURCE)
|
||||
@mkdir -p assets/fonts
|
||||
@$(FONT_TOOL) $(FONT_SOURCE) $(FONT_LOCALES) $(FONT_OUTPUT)
|
||||
@$(FONT_TOOL) --font "$(FONT_SOURCE)" --output "$(FONT_OUTPUT)" $(foreach range,$(FONT_RANGES),--range "$(range)") --missing "$(FONT_MISSING)" $(foreach input,$(FONT_LOCALES),--input "$(input)")
|
||||
|
||||
%: %.c $(FONT_OUTPUTS)
|
||||
@echo "Building $@..."
|
||||
|
||||
@@ -4,31 +4,15 @@
|
||||
#include "ui_text.h"
|
||||
|
||||
#include "flint.h"
|
||||
#include <stdio.h>
|
||||
|
||||
static Font example_ui_font = {0};
|
||||
|
||||
static void
|
||||
LoadExampleUIFont(void)
|
||||
{
|
||||
example_ui_font = LoadUIChoppedFont("assets/fonts/locales.png",
|
||||
"assets/fonts/locales.dat",
|
||||
UI_TEXT_BASE_SIZE);
|
||||
if(example_ui_font.texture.id != 0) {
|
||||
SetTextureFilter(example_ui_font.texture, TEXTURE_FILTER_POINT);
|
||||
SetUIFont(example_ui_font);
|
||||
SetUISmallFont(example_ui_font);
|
||||
} else {
|
||||
fprintf(stderr, "warning: failed to load chopped example font assets\n");
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
UnloadExampleUIFont(void)
|
||||
{
|
||||
SetUIFont((Font){0});
|
||||
SetUISmallFont((Font){0});
|
||||
UnloadUIFont(&example_ui_font);
|
||||
ClearUIFonts();
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,18 @@
|
||||
#include "flint.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
int main(void) {
|
||||
const char *markdown = "# Flint\n\n- [x] packaged\n";
|
||||
char *html = FlintMarkdownToHTML(markdown, strlen(markdown), FLINT_MARKDOWN_GFM);
|
||||
if (!html) {
|
||||
return 1;
|
||||
}
|
||||
int ok = strstr(html, "<h1") != NULL && strstr(html, "<input") != NULL;
|
||||
if (!ok) {
|
||||
fputs(html, stderr);
|
||||
}
|
||||
FlintMarkdownFree(html);
|
||||
return ok ? 0 : 1;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
#include "flint.h"
|
||||
|
||||
int main(void) {
|
||||
Vector2 origin = {0.0f, 0.0f};
|
||||
SetTraceLogLevel(LOG_NONE);
|
||||
return (int)origin.x;
|
||||
}
|
||||
|
Before Width: | Height: | Size: 157 B |
|
Before Width: | Height: | Size: 192 B After Width: | Height: | Size: 379 B |
|
Before Width: | Height: | Size: 216 B After Width: | Height: | Size: 408 B |
|
Before Width: | Height: | Size: 213 B After Width: | Height: | Size: 408 B |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 979 B |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 856 B |
|
After Width: | Height: | Size: 1017 B |
|
After Width: | Height: | Size: 969 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 933 B |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 981 B |
|
After Width: | Height: | Size: 989 B |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 902 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 957 B |
|
After Width: | Height: | Size: 893 B |
|
After Width: | Height: | Size: 1019 B |
|
After Width: | Height: | Size: 981 B |
|
After Width: | Height: | Size: 989 B |
|
After Width: | Height: | Size: 900 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 907 B |
|
After Width: | Height: | Size: 996 B |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 900 B |
|
After Width: | Height: | Size: 856 B |
|
After Width: | Height: | Size: 863 B |
|
After Width: | Height: | Size: 829 B |
|
After Width: | Height: | Size: 853 B |
|
After Width: | Height: | Size: 950 B |
|
After Width: | Height: | Size: 742 B |
|
After Width: | Height: | Size: 851 B |
|
After Width: | Height: | Size: 941 B |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 948 B |
|
After Width: | Height: | Size: 1015 B |
|
After Width: | Height: | Size: 1022 B |
|
After Width: | Height: | Size: 974 B |
|
After Width: | Height: | Size: 129 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 594 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 196 KiB |
|
After Width: | Height: | Size: 48 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 335 B After Width: | Height: | Size: 450 B |
|
Before Width: | Height: | Size: 224 B After Width: | Height: | Size: 390 B |
|
Before Width: | Height: | Size: 343 B After Width: | Height: | Size: 425 B |
|
Before Width: | Height: | Size: 245 B After Width: | Height: | Size: 405 B |
|
Before Width: | Height: | Size: 266 B After Width: | Height: | Size: 418 B |
|
Before Width: | Height: | Size: 278 B After Width: | Height: | Size: 436 B |
|
Before Width: | Height: | Size: 216 B After Width: | Height: | Size: 385 B |
|
Before Width: | Height: | Size: 184 B After Width: | Height: | Size: 385 B |
@@ -1,6 +1,7 @@
|
||||
#ifndef FLINT_H
|
||||
#define FLINT_H
|
||||
|
||||
#include "flint_version.h"
|
||||
#include "flint_compat.generated.h"
|
||||
|
||||
#include "ui_color.h"
|
||||
@@ -21,5 +22,6 @@
|
||||
#include "web.h"
|
||||
#include "runtime_assets.h"
|
||||
#include "desktop_tray.h"
|
||||
#include "markdown.h"
|
||||
|
||||
#endif /* FLINT_H */
|
||||
@@ -0,0 +1,9 @@
|
||||
#ifndef FLINT_VERSION_H
|
||||
#define FLINT_VERSION_H
|
||||
|
||||
#define FLINT_VERSION_MAJOR 0
|
||||
#define FLINT_VERSION_MINOR 1
|
||||
#define FLINT_VERSION_PATCH 3
|
||||
#define FLINT_VERSION_STRING "v0.1.3"
|
||||
|
||||
#endif /* FLINT_VERSION_H */
|
||||
@@ -0,0 +1,23 @@
|
||||
#ifndef FLINT_MARKDOWN_H
|
||||
#define FLINT_MARKDOWN_H
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum FlintMarkdownOptions {
|
||||
FLINT_MARKDOWN_GFM = 1 << 0,
|
||||
FLINT_MARKDOWN_UNSAFE_HTML = 1 << 1,
|
||||
FLINT_MARKDOWN_SMART = 1 << 2
|
||||
} FlintMarkdownOptions;
|
||||
|
||||
char *FlintMarkdownToHTML(const char *markdown, size_t markdown_len, int options);
|
||||
void FlintMarkdownFree(char *text);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -76,6 +76,7 @@ bool IsSystemThemeAvailable(void);
|
||||
const char *GetSystemThemeName(void);
|
||||
const char *GetSystemThemeNameCached(void);
|
||||
bool RefreshSystemTheme(void);
|
||||
bool GetSystemDesktopBackground(char *out, int out_size);
|
||||
bool SystemThemePrefersDark(void);
|
||||
void SetSystemThemeDarkMode(bool dark);
|
||||
bool GetEffectiveThemeDarkMode(void);
|
||||
|
||||
@@ -424,6 +424,23 @@ typedef struct {
|
||||
int *commit_pressed;
|
||||
} UITextField;
|
||||
|
||||
typedef struct {
|
||||
Rectangle bounds;
|
||||
char *text;
|
||||
size_t text_size;
|
||||
int *cursor_position;
|
||||
int *focused;
|
||||
int *scroll_y;
|
||||
int max_codepoints;
|
||||
int font;
|
||||
int line_gap;
|
||||
int focus_id;
|
||||
const char *placeholder;
|
||||
UITextInputStyle style;
|
||||
UITextInputFilter filter;
|
||||
void *filter_user_data;
|
||||
} UITextArea;
|
||||
|
||||
typedef struct {
|
||||
const char *label;
|
||||
UITextField field;
|
||||
@@ -616,6 +633,7 @@ void BeginUIFrame(int width, int height, float dpi);
|
||||
void SetUIFrame(Camera2D camera);
|
||||
void ClearUIInputCaptures(void);
|
||||
void PushUIInputCapture(Rectangle bounds, int allow_inside);
|
||||
void BeginUIModalLayer(void);
|
||||
void PushUIInputClip(Rectangle bounds);
|
||||
void PopUIInputClip(void);
|
||||
void SetUIModalCapture(Rectangle bounds);
|
||||
@@ -626,6 +644,12 @@ void MarkUIClickable(void);
|
||||
void MarkUIDisabled(void);
|
||||
void SetUIIcons(Texture2D gear_icon, Texture2D x_icon);
|
||||
int UIInputCapturesClick(Vector2 point);
|
||||
int UIReleaseConsumed(void);
|
||||
void UIConsumeRelease(void);
|
||||
int UIPointerReleaseConsumed(void);
|
||||
void UIConsumePointerRelease(void);
|
||||
int UIPointerReleaseAvailable(Vector2 point);
|
||||
int UIPointerReleaseOutside(Rectangle bounds);
|
||||
int UIHoverEffectsEnabled(void);
|
||||
void SetUITransitionCuesEnabled(int enabled);
|
||||
int UITransitionCuesEnabled(void);
|
||||
@@ -649,6 +673,7 @@ int DrawUIIconButton(UIIconButton button);
|
||||
int DrawUIHref(UIHref link);
|
||||
int DrawUITextInputControl(UITextInput input);
|
||||
int DrawUITextField(UITextField field);
|
||||
int DrawUITextArea(UITextArea area);
|
||||
int GetUIReadonlyTextBoxHeight(const char *text, int font, int width, UITextInputStyle style, int line_gap);
|
||||
int DrawUIReadonlyTextBox(UIReadonlyTextBox box);
|
||||
int GetUIParagraphHeight(UIParagraph paragraph);
|
||||
|
||||
@@ -7,22 +7,15 @@ typedef enum {
|
||||
|
||||
UI_ICON_TYPE_AMEN,
|
||||
UI_ICON_TYPE_BACKWARD,
|
||||
UI_ICON_TYPE_BTC,
|
||||
UI_ICON_TYPE_CALENDAR,
|
||||
UI_ICON_TYPE_CHECK,
|
||||
UI_ICON_TYPE_DISCORD,
|
||||
UI_ICON_TYPE_DROID,
|
||||
UI_ICON_TYPE_EDIT,
|
||||
UI_ICON_TYPE_EYE_CLOSED,
|
||||
UI_ICON_TYPE_FDROID,
|
||||
UI_ICON_TYPE_FORWARD,
|
||||
UI_ICON_TYPE_GEAR,
|
||||
UI_ICON_TYPE_GITHUB,
|
||||
UI_ICON_TYPE_GLOBE,
|
||||
UI_ICON_TYPE_HABIT,
|
||||
UI_ICON_TYPE_HOME,
|
||||
UI_ICON_TYPE_INBE,
|
||||
UI_ICON_TYPE_ITCH,
|
||||
UI_ICON_TYPE_JUPITER,
|
||||
UI_ICON_TYPE_LEADERCAT,
|
||||
UI_ICON_TYPE_LEFT,
|
||||
@@ -32,7 +25,6 @@ typedef enum {
|
||||
UI_ICON_TYPE_MANUAL,
|
||||
UI_ICON_TYPE_MARS,
|
||||
UI_ICON_TYPE_MERCURY,
|
||||
UI_ICON_TYPE_MONERO,
|
||||
UI_ICON_TYPE_MOON,
|
||||
UI_ICON_TYPE_MUSIC,
|
||||
UI_ICON_TYPE_MUTE,
|
||||
@@ -40,11 +32,9 @@ typedef enum {
|
||||
UI_ICON_TYPE_PENCIL,
|
||||
UI_ICON_TYPE_PET,
|
||||
UI_ICON_TYPE_PLAY,
|
||||
UI_ICON_TYPE_PLAYSTORE,
|
||||
UI_ICON_TYPE_PLUS,
|
||||
UI_ICON_TYPE_PROFILE,
|
||||
UI_ICON_TYPE_QUEST,
|
||||
UI_ICON_TYPE_RAY,
|
||||
UI_ICON_TYPE_RETURN,
|
||||
UI_ICON_TYPE_RIGHT,
|
||||
UI_ICON_TYPE_ROCKET,
|
||||
@@ -56,31 +46,26 @@ typedef enum {
|
||||
UI_ICON_TYPE_SOUND1,
|
||||
UI_ICON_TYPE_SOUND2,
|
||||
UI_ICON_TYPE_SOUND3,
|
||||
UI_ICON_TYPE_SRHT,
|
||||
UI_ICON_TYPE_STACK,
|
||||
UI_ICON_TYPE_STAT,
|
||||
UI_ICON_TYPE_STRIPE,
|
||||
UI_ICON_TYPE_SUN,
|
||||
UI_ICON_TYPE_TCL,
|
||||
UI_ICON_TYPE_TELEGRAM,
|
||||
UI_ICON_TYPE_TEXT,
|
||||
UI_ICON_TYPE_TILE,
|
||||
UI_ICON_TYPE_TILE2,
|
||||
UI_ICON_TYPE_TILE3,
|
||||
UI_ICON_TYPE_TILE4,
|
||||
UI_ICON_TYPE_TIMELINE,
|
||||
UI_ICON_TYPE_TODOS,
|
||||
UI_ICON_TYPE_TRASH,
|
||||
UI_ICON_TYPE_TUX,
|
||||
UI_ICON_TYPE_UXN,
|
||||
UI_ICON_TYPE_VENUS,
|
||||
UI_ICON_TYPE_WAO,
|
||||
UI_ICON_TYPE_WASM,
|
||||
UI_ICON_TYPE_WASM4,
|
||||
UI_ICON_TYPE_WEEKLY,
|
||||
UI_ICON_TYPE_WIN,
|
||||
UI_ICON_TYPE_WRENCH,
|
||||
UI_ICON_TYPE_X,
|
||||
UI_ICON_TYPE_LANGUAGE_RAY,
|
||||
UI_ICON_TYPE_LANGUAGE_TCL,
|
||||
UI_ICON_TYPE_LANGUAGE_UXN,
|
||||
UI_ICON_TYPE_LANGUAGE_WASM,
|
||||
UI_ICON_TYPE_LANGUAGE_WASM4,
|
||||
UI_ICON_TYPE_PAYMENTS_BTC,
|
||||
UI_ICON_TYPE_PAYMENTS_MONERO,
|
||||
UI_ICON_TYPE_PAYMENTS_STRIPE,
|
||||
UI_ICON_TYPE_PFP_BAMBUS,
|
||||
UI_ICON_TYPE_PFP_BIRD,
|
||||
UI_ICON_TYPE_PFP_BOWL,
|
||||
@@ -106,8 +91,22 @@ typedef enum {
|
||||
UI_ICON_TYPE_PFP_TREE2,
|
||||
UI_ICON_TYPE_PFP_TREE3,
|
||||
UI_ICON_TYPE_PFP_TREE4,
|
||||
UI_ICON_TYPE_PLATFORMS_DISCORD,
|
||||
UI_ICON_TYPE_PLATFORMS_DROID,
|
||||
UI_ICON_TYPE_PLATFORMS_FDROID,
|
||||
UI_ICON_TYPE_PLATFORMS_GITHUB,
|
||||
UI_ICON_TYPE_PLATFORMS_ITCH,
|
||||
UI_ICON_TYPE_PLATFORMS_PLAYSTORE,
|
||||
UI_ICON_TYPE_PLATFORMS_SRHT,
|
||||
UI_ICON_TYPE_PLATFORMS_TELEGRAM,
|
||||
UI_ICON_TYPE_PLATFORMS_TUX,
|
||||
UI_ICON_TYPE_PLATFORMS_WIN,
|
||||
UI_ICON_TYPE_TILES_TILE,
|
||||
UI_ICON_TYPE_TILES_TILE2,
|
||||
UI_ICON_TYPE_TILES_TILE3,
|
||||
UI_ICON_TYPE_TILES_TILE4,
|
||||
|
||||
UI_ICON_TYPE_COUNT = 102
|
||||
UI_ICON_TYPE_COUNT = 101
|
||||
} UIIconType;
|
||||
|
||||
#endif /* UI_ICON_TYPES_H */
|
||||
@@ -9,12 +9,14 @@
|
||||
#define UI_TEXT_24 24
|
||||
#define UI_TEXT_BASE_SIZE 16
|
||||
|
||||
void SetUIFont(Font font);
|
||||
void SetUISmallFont(Font font);
|
||||
Font GetUIFont(void);
|
||||
Font LoadUIChoppedFont(const char *png_path, const char *dat_path, int base_size);
|
||||
int RegisterUIFont(const char *name, Font font);
|
||||
int RegisterUISmallFont(const char *name, Font font);
|
||||
int UseUIFont(const char *name);
|
||||
int UIFontHasGlyph(Font font, int codepoint);
|
||||
Font LoadUIChoppedFontFromMemory(const unsigned char *png_data, unsigned int png_size, const unsigned char *dat_data, unsigned int dat_size, int base_size);
|
||||
void UnloadUIFont(Font *font);
|
||||
void ClearUIFonts(void);
|
||||
int MeasureUIText(const char *text, int font_size);
|
||||
int GetUITextHeight(const char *text, int font_size);
|
||||
int GetUITextLineHeight(int font_size);
|
||||
|
||||
|
Before Width: | Height: | Size: 152 B After Width: | Height: | Size: 152 B |
|
Before Width: | Height: | Size: 325 B After Width: | Height: | Size: 325 B |
|
Before Width: | Height: | Size: 125 B After Width: | Height: | Size: 125 B |
|
Before Width: | Height: | Size: 182 B After Width: | Height: | Size: 182 B |
|
Before Width: | Height: | Size: 164 B After Width: | Height: | Size: 164 B |
@@ -100,14 +100,29 @@ LOCALE_FILES = $(wildcard locales/*.txt)
|
||||
THEME_FILES = $(wildcard $(FLINT_DIR)/themes/*.ini)
|
||||
IMAGE_FILES ?=
|
||||
SOUND_FILES ?=
|
||||
FONT_OUTPUTS ?= assets/fonts/locales.png assets/fonts/locales.dat
|
||||
FONT_FILES = $(FONT_OUTPUTS)
|
||||
FONT_TOOL ?= $(FLINT_DIR)/vendor/fontchop/fontchop
|
||||
FONT_SOURCE ?= $(FLINT_DIR)/vendor/fontchop/fonts/unifont-17.0.04.otf
|
||||
FONT_INPUTS ?= $(LOCALE_FILES)
|
||||
FONT_OUTPUT ?= assets/fonts/ui
|
||||
FONT_RANGES ?= ascii
|
||||
FONT_BASE_SIZE ?= 16
|
||||
FONT_CELL_SIZE ?= 32
|
||||
FONT_ATLAS_WIDTH ?= 512
|
||||
FONT_MISSING ?= fail
|
||||
FONT_SETS ?= default
|
||||
FONT_default_OUTPUT ?= $(FONT_OUTPUT)
|
||||
FONT_default_SOURCE ?= $(FONT_SOURCE)
|
||||
FONT_default_INPUTS ?= $(FONT_INPUTS)
|
||||
FONT_default_RANGES ?= $(FONT_RANGES)
|
||||
FONT_default_BASE_SIZE ?= $(FONT_BASE_SIZE)
|
||||
FONT_default_CELL_SIZE ?= $(FONT_CELL_SIZE)
|
||||
FONT_default_ATLAS_WIDTH ?= $(FONT_ATLAS_WIDTH)
|
||||
FONT_default_MISSING ?= $(FONT_MISSING)
|
||||
FONT_SET_OUTPUTS = $(foreach set,$(FONT_SETS),$(FONT_$(set)_OUTPUT).png $(FONT_$(set)_OUTPUT).dat)
|
||||
FONT_FILES = $(FONT_SET_OUTPUTS)
|
||||
EMBEDDED_ASSET_FILES = $(LOCALE_FILES) $(THEME_FILES) $(IMAGE_FILES) $(SOUND_FILES) $(FONT_FILES)
|
||||
EMBEDDED_ASSETS_C = $(BUILD_OBJ_DIR)/$(APP_NAME)_embedded_assets.c
|
||||
SRC += $(EMBEDDED_ASSETS_C)
|
||||
FONT_TOOL ?= $(FLINT_DIR)/tools/otfchop/otfchop
|
||||
FONT_SOURCE ?= $(FLINT_DIR)/tools/otfchop/unifont-17.0.04.otf
|
||||
FONT_INPUTS ?= $(LOCALE_FILES)
|
||||
APP_INCLUDE ?= -Isrc -Isrc/android
|
||||
RUNTIME_DIRS ?= assets locales themes
|
||||
RAY_PKGS ?= sdl2 libdrm gbm egl glesv2
|
||||
@@ -125,11 +140,15 @@ BUILD_MAKEFILES = Makefile $(FLINT_MAKEFILES)
|
||||
assets/fonts:
|
||||
mkdir -p $@
|
||||
|
||||
$(FONT_OUTPUTS): $(FONT_INPUTS) $(FONT_TOOL) | assets/fonts
|
||||
$(FONT_TOOL) $(FONT_SOURCE) $(FONT_INPUTS) $(basename $(firstword $(FONT_OUTPUTS)))
|
||||
define FLINT_FONT_RULE
|
||||
$(FONT_$(1)_OUTPUT).png $(FONT_$(1)_OUTPUT).dat: $$(FONT_$(1)_INPUTS) $$(FONT_$(1)_SOURCE) $$(FONT_TOOL) | assets/fonts
|
||||
$$(FONT_TOOL) --font "$$(FONT_$(1)_SOURCE)" --output "$$(FONT_$(1)_OUTPUT)" $$(foreach range,$$(FONT_$(1)_RANGES),--range "$$(range)") --base-size "$$(FONT_$(1)_BASE_SIZE)" --cell-size "$$(FONT_$(1)_CELL_SIZE)" --atlas-width "$$(FONT_$(1)_ATLAS_WIDTH)" --missing "$$(FONT_$(1)_MISSING)" $$(foreach input,$$(FONT_$(1)_INPUTS),--input "$$(input)")
|
||||
endef
|
||||
|
||||
$(FONT_TOOL): $(FLINT_DIR)/tools/otfchop/otfchop.c $(FLINT_DIR)/tools/otfchop/stb_truetype.h $(FLINT_DIR)/tools/otfchop/stb_image_write.h
|
||||
$(MAKE) -C $(FLINT_DIR)/tools/otfchop otfchop
|
||||
$(foreach set,$(FONT_SETS),$(eval $(call FLINT_FONT_RULE,$(set))))
|
||||
|
||||
$(FONT_TOOL): $(FLINT_DIR)/vendor/fontchop/fontchop.c $(FLINT_DIR)/vendor/fontchop/stb_truetype.h $(FLINT_DIR)/vendor/fontchop/stb_image_write.h
|
||||
$(MAKE) -C $(FLINT_DIR)/vendor/fontchop fontchop
|
||||
|
||||
$(EMBEDDED_ASSETS_C): $(EMBEDDED_ASSET_FILES) $(FLINT_DIR)/scripts/embed-assets.sh | $(BUILD_OBJ_DIR)
|
||||
sh $(FLINT_DIR)/scripts/embed-assets.sh $@ $(EMBEDDED_ASSET_FILES)
|
||||
|
||||
@@ -48,6 +48,29 @@ FLINT_CURL_BUILD_TYPE ?= MinSizeRel
|
||||
FLINT_CURL_EXTRA_CMAKE_FLAGS ?=
|
||||
FLINT_CURL_REQUIRE_WEBSOCKETS ?= 0
|
||||
|
||||
|
||||
FLINT_CMARK_GFM_DIR ?= $(FLINT_DIR)/vendor/cmark-gfm
|
||||
FLINT_CMARK_GFM_BUILD_DIR ?= $(FLINT_VENDOR_BUILD_DIR)/cmark-gfm
|
||||
FLINT_CMARK_GFM_A ?= $(FLINT_CMARK_GFM_BUILD_DIR)/src/libcmark-gfm.a
|
||||
FLINT_CMARK_GFM_EXTENSIONS_A ?= $(FLINT_CMARK_GFM_BUILD_DIR)/extensions/libcmark-gfm-extensions.a
|
||||
FLINT_CMARK_GFM_INCLUDE ?= -I$(FLINT_CMARK_GFM_DIR)/src -I$(FLINT_CMARK_GFM_DIR)/extensions -I$(FLINT_CMARK_GFM_BUILD_DIR)/src -I$(FLINT_CMARK_GFM_BUILD_DIR)/extensions
|
||||
FLINT_CMARK_GFM_BUILD_TYPE ?= MinSizeRel
|
||||
FLINT_MARKDOWN_DEPS ?= $(FLINT_CMARK_GFM_A) $(FLINT_CMARK_GFM_EXTENSIONS_A)
|
||||
FLINT_MARKDOWN_CFLAGS ?= -DFLINT_HAS_CMARK_GFM=1 $(FLINT_CMARK_GFM_INCLUDE)
|
||||
FLINT_MARKDOWN_LDLIBS ?= $(FLINT_CMARK_GFM_EXTENSIONS_A) $(FLINT_CMARK_GFM_A)
|
||||
|
||||
$(FLINT_CMARK_GFM_A) $(FLINT_CMARK_GFM_EXTENSIONS_A): $(FLINT_CMARK_GFM_DIR)/CMakeLists.txt | $(FLINT_VENDOR_ORDER_ONLY)
|
||||
@if [ -f "$(FLINT_CMARK_GFM_BUILD_DIR)/CMakeCache.txt" ] && ! grep -q "CMAKE_HOME_DIRECTORY:INTERNAL=$(abspath $(FLINT_CMARK_GFM_DIR))" "$(FLINT_CMARK_GFM_BUILD_DIR)/CMakeCache.txt"; then \
|
||||
rm -rf "$(FLINT_CMARK_GFM_BUILD_DIR)"; \
|
||||
fi
|
||||
$(CMAKE) -S $(FLINT_CMARK_GFM_DIR) -B $(FLINT_CMARK_GFM_BUILD_DIR) \
|
||||
-DCMAKE_BUILD_TYPE=$(FLINT_CMARK_GFM_BUILD_TYPE) \
|
||||
-DBUILD_SHARED_LIBS=OFF \
|
||||
-DCMARK_TESTS=OFF \
|
||||
-DCMARK_SHARED=OFF \
|
||||
-DCMARK_STATIC=ON
|
||||
$(CMAKE) --build $(FLINT_CMARK_GFM_BUILD_DIR) --target libcmark-gfm_static libcmark-gfm-extensions_static
|
||||
|
||||
FLINT_OPENSSL_ROOT_DIR ?= $(OPENSSL_ROOT_DIR)
|
||||
FLINT_OPENSSL_INCLUDE_DIR ?= $(OPENSSL_INCLUDE_DIR)
|
||||
FLINT_OPENSSL_SSL_LIBRARY ?= $(OPENSSL_SSL_LIBRARY)
|
||||
|
||||
|
Before Width: | Height: | Size: 246 B After Width: | Height: | Size: 246 B |
|
Before Width: | Height: | Size: 173 B After Width: | Height: | Size: 173 B |
|
Before Width: | Height: | Size: 180 B After Width: | Height: | Size: 180 B |
|
Before Width: | Height: | Size: 180 B After Width: | Height: | Size: 180 B |
|
Before Width: | Height: | Size: 170 B After Width: | Height: | Size: 170 B |
|
Before Width: | Height: | Size: 268 B After Width: | Height: | Size: 268 B |
|
Before Width: | Height: | Size: 332 B After Width: | Height: | Size: 332 B |
|
Before Width: | Height: | Size: 344 B After Width: | Height: | Size: 344 B |
|
Before Width: | Height: | Size: 263 B After Width: | Height: | Size: 263 B |
|
Before Width: | Height: | Size: 233 B After Width: | Height: | Size: 233 B |
|
Before Width: | Height: | Size: 182 B After Width: | Height: | Size: 182 B |
|
Before Width: | Height: | Size: 357 B After Width: | Height: | Size: 357 B |
|
Before Width: | Height: | Size: 159 B After Width: | Height: | Size: 159 B |