feat: file dispatch system, file-type icons, multi-instance notepad

- Add extension-based dispatch to driver.storage.filedispatch with typed
  union (variant record THandlerKind = hkMagic/hkExtension)
- Extract file-type icon constants and mapping to core.gfx.fileicons
- Add core.search utility (getFileExtension, fmtFileSize, sortStringArray)
- Generate PUA bitmap icon fonts (32/64/128px) from Font Awesome via
  gen_file_icons.py + compile_icons.sh toolchain
- Integrate file dispatch into file browser (double-click triggers dispatch)
- Register notepad as handler for text file extensions
- Fix init order in app.mgr (filedispatch.init before app inits)
- Refactor notepad from singleton to multi-instance (up to 8 windows)
  using instance array, findStateByWid, and LVGL user_data on msgboxes
This commit is contained in:
Aaron committed 2026-03-11 19:41:49 +00:00
1 parent 140d3d6d68
commit 5628c1ddbf
78 files changed
+74877 -238

No files matched your search

+1
View File
@@ -26,6 +26,7 @@ declare -a run_steps=(
"compile_stub.sh" "Failed to compile stub!"
"compile_vergen.sh" "Versions failed to compile"
"compile_lvgl.sh" "Failed to compile LVGL!"
"compile_icons.sh" "Failed to generate icons!"
"compile_wasuro.sh" "Failed to pull Wasuro!"
"compile_sources.sh" "Failed to compile FPC Sources!"
"compile_link.sh" "Failed linking!"
+60
View File
@@ -0,0 +1,60 @@
#!/usr/bin/env bash
# compile_icons.sh — Generate file-type icon bitmap fonts from Font Awesome.
# Runs gen_file_icons.py to produce asuro_icons_{32,64,128}.c in lvglh/,
# then compiles each into a .o in lib/ for linking.
set -e
TOOLCHAIN_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
CONF_DIR="$(pwd)/lvglh"
OUT_DIR="$(pwd)/lib"
FONT_CACHE="$(pwd)/img"
LVGL_DIR="/tmp/lvgl"
CACHE_DIR="/code/lvgl"
# Use cached LVGL source (or /tmp clone) for include paths
if [ -d "${CACHE_DIR}/src" ]; then
LVGL_INC="${CACHE_DIR}"
elif [ -d "${LVGL_DIR}/src" ]; then
LVGL_INC="${LVGL_DIR}"
else
LVGL_INC="${CACHE_DIR}"
fi
CC="gcc"
CFLAGS="-m32 -march=i686 -ffreestanding \
-fno-builtin -fno-stack-protector -fno-pic -fno-pie \
-O2 -Wall -Wno-unused-function -Wno-unused-variable \
-I${CONF_DIR} \
-I${LVGL_INC} \
-I${LVGL_INC}/.. \
-DLV_CONF_INCLUDE_SIMPLE"
echo " "
echo "======================="
echo " "
echo "Generating file-type icons..."
echo " "
# Run the Python generator
python3 "${TOOLCHAIN_DIR}/gen_file_icons.py" "${CONF_DIR}" --font-dir "${FONT_CACHE}"
# Compile generated C files into object files
ERRORS=0
for src in "${CONF_DIR}"/asuro_icons_*.c; do
[ -f "$src" ] || continue
base="$(basename "${src%.c}")"
echo " Compiling ${base}.c ..."
if ! $CC $CFLAGS -c "$src" -o "${OUT_DIR}/${base}.o" 2>&1; then
echo " FAILED: ${base}.c"
ERRORS=$((ERRORS + 1))
fi
done
if [ "$ERRORS" -ne 0 ]; then
echo "Icon compilation FAILED (${ERRORS} errors)."
exit 1
fi
echo " "
echo "Icons generated and compiled."
echo " "
File diff suppressed because it is too large. Load diff