Add habit statistics and Russian localization

This commit is contained in:
waozi authored and Waozi committed 2026-07-11 18:49:15 -03:00
1 parent ae882bf838
commit 66f847a2e3
42 files changed
+4240 -1526

No files matched your search

+35
View File
@@ -259,6 +259,40 @@ jobs:
path: build/release/android/*
if-no-files-found: error
build-click:
name: Build Ubuntu Touch Click
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Install Nix
uses: cachix/install-nix-action@v27
with:
extra_nix_config: |
experimental-features = nix-command flakes
- name: Build and Review Click Package
run: |
set -euo pipefail
nix develop --command bash -lc 'make click-verify'
mkdir -p build/release/click
find build/dist/click -maxdepth 1 -type f -name '*.click' -exec cp {} build/release/click/ \;
test -n "$(find build/release/click -type f -name '*.click' -print -quit)"
(cd build/release/click && sha256sum ./*.click > SHA256SUMS)
- name: Upload Click Artifact
uses: actions/upload-artifact@v4
with:
name: release-click
path: build/release/click/*
if-no-files-found: error
release:
name: Release
runs-on: ubuntu-latest
@@ -267,6 +301,7 @@ jobs:
- build-linux
- build-windows
- build-android
- build-click
steps:
- name: Checkout Repository
+1
View File
@@ -19,6 +19,7 @@ node_modules
*.nix-profile
.claude.json
.bash_history
.env
*.exe
+5
View File
@@ -1,4 +1,9 @@
# Changelog
## [1.4.4] - 2026-06-20
### Fixed
- Build the Ubuntu Touch Click package with the OpenStore package id and review-compatible control metadata.
- Omit Click AppStream metadata by default to avoid OpenStore revision import failures.
## [1.4.3] - 2026-06-20
### Fixed
- Refresh expired native sync auth tokens before sending queued changes.
+200 -9
View File
@@ -26,6 +26,33 @@ LINUX_APPIMAGE_DIR := packaging/linux/appimage
LINUX_APPIMAGE_APPRUN := $(LINUX_APPIMAGE_DIR)/AppRun
LINUX_APPIMAGE_DESKTOP := $(LINUX_APPIMAGE_DIR)/$(APP_NAME).desktop
LINUX_APPIMAGE_ICON := $(LINUX_APPIMAGE_DIR)/$(APP_NAME).png
LINUX_APPIMAGE_APPDATA := $(LINUX_APPIMAGE_DIR)/$(APP_NAME).appdata.xml
CLICK_PACKAGE ?= inbe
CLICK_TITLE ?= $(APP_TITLE)
CLICK_MAINTAINER ?= Waozi Project <[email protected]>
CLICK_ARCH ?= arm64
CLICK_FRAMEWORK ?= ubuntu-sdk-20.04
CLICK_POLICY_VERSION ?= 20.04
CLICK_INCLUDE_METAINFO ?= 0
CLICK_DIR := packaging/click
CLICK_MANIFEST_TEMPLATE := $(CLICK_DIR)/manifest.json.in
CLICK_CONTROL_TEMPLATE := $(CLICK_DIR)/control.in
CLICK_APPARMOR_TEMPLATE := $(CLICK_DIR)/inbe.apparmor.in
CLICK_DESKTOP_TEMPLATE := $(CLICK_DIR)/inbe.desktop.in
CLICK_METAINFO_TEMPLATE := $(CLICK_DIR)/inbe.metainfo.xml.in
CLICK_RUNNER := $(CLICK_DIR)/run-inbe.sh
CLICK_BUILD_DIR := $(BUILD_OBJ_DIR)/click/$(CLICK_ARCH)
CLICK_ROOT := $(CLICK_BUILD_DIR)/$(CLICK_PACKAGE)
CLICK_CONTROL_DIR := $(CLICK_BUILD_DIR)/control
CLICK_BIN_DIR := $(BUILD_BIN_DIR)/click/$(CLICK_ARCH)
CLICK_DIST_DIR := $(BUILD_DIST_DIR)/click
CLICK_TARGET = $(CLICK_DIST_DIR)/$(CLICK_PACKAGE)_$(APP_VERSION)_$(CLICK_ARCH).click
CLICK_BIN := $(CLICK_BIN_DIR)/$(APP_NAME)
CLICK_BIN_INPUT := $(if $(strip $(CLICK_BIN_SOURCE)),$(CLICK_BIN_SOURCE),$(CLICK_BIN))
CLICK_RAYLIB_BUILD_DIR := $(VENDOR_BUILD_DIR)/click/$(CLICK_ARCH)/raylib
CLICK_RAYLIB_A := $(CLICK_RAYLIB_BUILD_DIR)/libraylib.a
CLICK_PATCHELF_INTERPRETER ?= /lib/ld-linux-aarch64.so.1
CLICK_RUNTIME_LIBS ?= $(AARCH64_CLICK_RUNTIME_LIBS)
WINDOWS_OBJ_DIR := $(BUILD_OBJ_DIR)/windows
WINDOWS_BIN_DIR := $(BUILD_BIN_DIR)/windows
WINDOWS_DIST_DIR := $(BUILD_DIST_DIR)/windows
@@ -134,6 +161,8 @@ APP_SRCS := \
src/practices/meditation/meditation_music.c \
src/core/theme.c \
src/storage/data.c \
src/storage/db.c \
src/storage/import.c \
src/storage/storage.c \
src/storage/sync_account.c \
src/storage/sync_client.c \
@@ -164,6 +193,7 @@ APP_RAYLIB_CONFIG := $(filter-out -DSUPPORT_MODULE_RAUDIO=0 -DSUPPORT_FILEFORMAT
CFLAGS := -Wall -Wextra -std=c99 -Os -D_DEFAULT_SOURCE -D_GNU_SOURCE -ffunction-sections -fdata-sections -DSUPPORT_FILEFORMAT_JPG=1 -DMINIZ_NO_ZLIB_COMPATIBLE_NAMES -DFLINT_EMBEDDED_ONLY=1 $(FLINT_RUNTIME_ASSET_CFLAGS)
WINDOWS_CFLAGS := -Wall -Wextra -std=c99 -Os -D_DEFAULT_SOURCE -D_GNU_SOURCE -ffunction-sections -fdata-sections -DSUPPORT_FILEFORMAT_JPG=1 -DMINIZ_NO_ZLIB_COMPATIBLE_NAMES -DFLINT_EMBEDDED_ONLY=1
WEB_CFLAGS := $(filter-out -std=c99,$(CFLAGS)) -std=gnu99
CLICK_CFLAGS := -Wall -Wextra -std=c99 -Os -D_DEFAULT_SOURCE -D_GNU_SOURCE -ffunction-sections -fdata-sections -DSUPPORT_FILEFORMAT_JPG=1 -DMINIZ_NO_ZLIB_COMPATIBLE_NAMES -DFLINT_EMBEDDED_ONLY=1 $(AARCH64_FLINT_CURL_CFLAGS)
LDFLAGS := -Wl,--gc-sections -s
WINDOWS_LDFLAGS := -Wl,--gc-sections -static -static-libgcc -mwindows
WINDOWS_LDLIBS := -lgdi32 -lwinmm -lopengl32 -luser32 -lshell32 -lole32 -lcomdlg32 -lcomctl32 -luuid -lwininet -lws2_32 -liphlpapi -lcrypt32 -lsecur32 -lbcrypt -ladvapi32 -lm
@@ -204,8 +234,8 @@ UNPACKAGED_AUDIO_DIR := unpackaged_assets/audio
UNPACKAGED_AUDIO_FILES := $(shell find $(UNPACKAGED_AUDIO_DIR) -type f 2>/dev/null)
MEDITATION_AUDIO_ZIP := web-assets/dl/inbe-meditation-audio-v1.zip
.PHONY: all native run test dist appimage vendor-prebuilds vendor-prebuilds-native vendor-prebuilds-web vendor-prebuilds-windows clean clean-linux clean-vendor-builds android-check-keystore android-copy-assets android-local-properties android-debug android-release android-bundle android-install android-install-release android-clean package-unpackaged-assets windows-runtime-assets-check windows windows64 windows32 web chrome-web-store
.NOTPARALLEL: dist windows windows64 windows32 android-release android-bundle
.PHONY: all native run test dist appimage click click-verify vendor-prebuilds vendor-prebuilds-native vendor-prebuilds-web vendor-prebuilds-windows clean clean-linux clean-vendor-builds android-check-keystore android-copy-assets android-local-properties android-debug android-release android-bundle android-install android-install-release android-clean package-unpackaged-assets windows-runtime-assets-check windows windows64 windows32 web chrome-web-store
.NOTPARALLEL: dist windows windows64 windows32 android-release android-bundle click
all: native
@@ -228,6 +258,7 @@ dist:
$(MAKE) package-unpackaged-assets && \
$(MAKE) web && \
$(MAKE) chrome-web-store && \
$(MAKE) click && \
$(MAKE) appimage && \
$(MAKE) windows && \
$(MAKE) android-release PASSWORD="$$password" && \
@@ -235,6 +266,15 @@ dist:
appimage: $(APPIMAGE_TARGET)
click: $(CLICK_TARGET)
click-verify: $(CLICK_TARGET)
@command -v clickable >/dev/null || { \
echo "clickable is missing. Re-enter the flake shell with: nix develop"; \
exit 1; \
}
clickable review $(CLICK_TARGET)
vendor-prebuilds: vendor-prebuilds-native vendor-prebuilds-web vendor-prebuilds-windows
vendor-prebuilds-native: $(RAYLIB_A) $(SQLITE_AMALGAMATION_C) $(SQLITE_AMALGAMATION_H) $(LIBOQS_A) $(CURL_PROTOCOL_CHECK)
@@ -253,11 +293,11 @@ test: $(STORAGE_IMPORT_TEST) $(FLINT_TEXT_SCALING_TEST) $(LOCALE_KEYS_TEST) $(SY
$(SYNC_URL_TEST)
$(SYNC_ACCOUNT_TEST)
$(STORAGE_IMPORT_TEST): tests/storage_import_test.c src/storage/storage.c src/storage/storage.h src/screens/habits_screen.c src/screens/habits_screen.h src/third_party/miniz.c src/third_party/miniz.h $(SQLITE_SRC) $(SQLITE_AMALGAMATION_H) | $(TEST_BIN_DIR)
$(STORAGE_IMPORT_TEST): tests/storage_import_test.c src/storage/storage.c src/storage/db.c src/storage/import.c src/storage/storage.h src/storage/db.h src/storage/import.h src/screens/habits_screen.c src/screens/habits_screen.h src/third_party/miniz.c src/third_party/miniz.h $(SQLITE_SRC) $(SQLITE_AMALGAMATION_H) | $(TEST_BIN_DIR)
$(CC) -Wall -Wextra -std=c99 -D_DEFAULT_SOURCE -D_GNU_SOURCE -DMINIZ_NO_ZLIB_COMPATIBLE_NAMES -ffunction-sections -fdata-sections \
-Isrc -Isrc/app -Isrc/core -Isrc/screens -Isrc/screens/settings -Isrc/practices -Isrc/practices/whm -Isrc/practices/meditation -Isrc/storage -Isrc/platform/android -Isrc/third_party -Ivendor/raylib/src $(FLINT_INCLUDE) $(SQLITE_INCLUDE) \
-o $@ \
tests/storage_import_test.c src/storage/storage.c src/screens/habits_screen.c src/third_party/miniz.c $(SQLITE_SRC) \
tests/storage_import_test.c src/storage/storage.c src/storage/db.c src/storage/import.c src/screens/habits_screen.c src/third_party/miniz.c $(SQLITE_SRC) \
-Wl,--gc-sections -lm -lpthread -ldl
$(FLINT_TEXT_SCALING_TEST): tests/flint_text_scaling_test.c flint/src/flint_text.c flint/src/flint_clip.c flint/src/flint_scaling.c flint/include/flint_text.h flint/include/flint_clip.h flint/include/flint_scaling.h | $(TEST_BIN_DIR)
@@ -278,14 +318,14 @@ $(SYNC_URL_TEST): tests/sync_url_test.c src/storage/sync_client.c src/storage/sy
tests/sync_url_test.c src/storage/sync_client.c \
-Wl,--gc-sections $(FLINT_CURL_LDLIBS)
$(SYNC_ACCOUNT_TEST): tests/sync_account_test.c src/storage/sync_account.c src/storage/sync_account.h src/storage/storage.c src/storage/storage.h src/third_party/miniz.c src/third_party/miniz.h $(SQLITE_SRC) $(SQLITE_AMALGAMATION_H) | $(TEST_BIN_DIR)
$(SYNC_ACCOUNT_TEST): tests/sync_account_test.c src/storage/sync_account.c src/storage/sync_account.h src/storage/storage.c src/storage/db.c src/storage/import.c src/storage/storage.h src/storage/db.h src/storage/import.h src/third_party/miniz.c src/third_party/miniz.h $(SQLITE_SRC) $(SQLITE_AMALGAMATION_H) | $(TEST_BIN_DIR)
$(CC) -Wall -Wextra -std=c99 -D_DEFAULT_SOURCE -D_GNU_SOURCE -DMINIZ_NO_ZLIB_COMPATIBLE_NAMES -ffunction-sections -fdata-sections \
-Isrc -Isrc/app -Isrc/core -Isrc/screens -Isrc/screens/settings -Isrc/practices -Isrc/practices/whm -Isrc/practices/meditation -Isrc/storage -Isrc/platform/android -Isrc/third_party -Ivendor/raylib/src $(SQLITE_INCLUDE) \
-o $@ \
tests/sync_account_test.c src/storage/sync_account.c src/storage/storage.c src/third_party/miniz.c $(SQLITE_SRC) \
tests/sync_account_test.c src/storage/sync_account.c src/storage/storage.c src/storage/db.c src/storage/import.c src/third_party/miniz.c $(SQLITE_SRC) \
-Wl,--gc-sections -lm -lpthread -ldl
$(BUILD_OBJ_DIR) $(LINUX_BIN_DIR) $(LINUX_DIST_DIR) $(LINUX_APPIMAGE_BUILD_DIR) $(WINDOWS_DIST_DIR) $(ANDROID_BUILD_DIR) $(TEST_BIN_DIR) $(WEB_OBJ_DIR) $(WEB_DIST_DIR) $(CHROME_WEB_STORE_DIR):
$(BUILD_OBJ_DIR) $(LINUX_BIN_DIR) $(LINUX_DIST_DIR) $(LINUX_APPIMAGE_BUILD_DIR) $(CLICK_BIN_DIR) $(CLICK_BUILD_DIR) $(CLICK_DIST_DIR) $(WINDOWS_DIST_DIR) $(ANDROID_BUILD_DIR) $(TEST_BIN_DIR) $(WEB_OBJ_DIR) $(WEB_DIST_DIR) $(CHROME_WEB_STORE_DIR):
mkdir -p $@
$(WINDOWS_BIN_DIR)/$(WIN64_ARCH) $(WINDOWS_BIN_DIR)/$(WIN32_ARCH):
@@ -338,6 +378,24 @@ $(WEB_RAYLIB_A): $(RAYLIB_SOURCES) | $(WEB_OBJ_DIR)
AR="$(WEB_AR)" \
CUSTOM_CFLAGS="$(APP_RAYLIB_CONFIG) -Os -ffunction-sections -fdata-sections"
$(CLICK_RAYLIB_A): $(RAYLIB_SOURCES)
rm -rf $(VENDOR_BUILD_DIR)/click/$(CLICK_ARCH)/raylib-src
mkdir -p $(VENDOR_BUILD_DIR)/click/$(CLICK_ARCH)/raylib-src $(CLICK_RAYLIB_BUILD_DIR)
cp -R $(RAYLIB_DIR)/. $(VENDOR_BUILD_DIR)/click/$(CLICK_ARCH)/raylib-src/
$(MAKE) -j1 -C $(VENDOR_BUILD_DIR)/click/$(CLICK_ARCH)/raylib-src \
PLATFORM=PLATFORM_DESKTOP_SDL \
GRAPHICS=GRAPHICS_API_OPENGL_ES2 \
RAYLIB_LIBTYPE=STATIC \
RAYLIB_RELEASE_PATH=../raylib \
RAYLIB_MODULE_AUDIO=TRUE \
RAYLIB_MODULE_MODELS=FALSE \
CC="$(AARCH64_CC)" \
AR="$(AARCH64_AR)" \
RANLIB="$(AARCH64_RANLIB)" \
SDL_INCLUDE_PATH="$(AARCH64_RAY_SDL_INCLUDE_DIR)" \
SDL_LIBRARIES="$(AARCH64_RAY_SDL_LDLIBS)" \
CUSTOM_CFLAGS="-DUSING_SDL2_PROJECT $(AARCH64_RAY_CFLAGS) $(APP_RAYLIB_CONFIG) -Os -ffunction-sections -fdata-sections"
$(WIN64_RAYLIB_A): $(RAYLIB_SOURCES)
rm -rf $(VENDOR_BUILD_DIR)/windows/$(WIN64_ARCH)/raylib-src
mkdir -p $(VENDOR_BUILD_DIR)/windows/$(WIN64_ARCH)/raylib-src $(WIN64_RAYLIB_BUILD_DIR)
@@ -532,6 +590,95 @@ $(TARGET): Makefile $(SRC) $(FLINT_SRCS) $(SQLITE_SRC) $(SQLITE_AMALGAMATION_H)
-lm -lpthread -ldl -lrt \
$(LDFLAGS)
$(CLICK_BIN): Makefile $(SRC) $(FLINT_SRCS) $(SQLITE_SRC) $(SQLITE_AMALGAMATION_H) $(FONT_OUTPUTS) $(EMBEDDED_ASSETS_C) $(CLICK_RAYLIB_A) | $(CLICK_BIN_DIR)
$(AARCH64_CC) $(CLICK_CFLAGS) \
$(APP_INCLUDE) \
$(FLINT_INCLUDE) \
$(SQLITE_INCLUDE) \
-I$(RAYLIB_DIR) \
$(AARCH64_RAY_CFLAGS) \
-DPLATFORM_DESKTOP \
-DSUPPORT_MODULE_RAUDIO=1 \
-DSUPPORT_FILEFORMAT_OGG=1 \
-DSUPPORT_FILEFORMAT_MP3=1 \
-o $@ \
$(SRC) \
$(FLINT_SRCS) \
$(SQLITE_SRC) \
$(CLICK_RAYLIB_A) \
$(AARCH64_RAY_LDLIBS) \
$(AARCH64_FLINT_CURL_LDLIBS) \
-lm -lpthread -ldl -lrt \
$(LDFLAGS)
@if command -v patchelf >/dev/null; then \
patchelf --set-interpreter "$(CLICK_PATCHELF_INTERPRETER)" --set-rpath '$$ORIGIN/../lib' $@; \
fi
$(CLICK_TARGET): $(CLICK_BIN_INPUT) $(CLICK_MANIFEST_TEMPLATE) $(CLICK_CONTROL_TEMPLATE) $(CLICK_APPARMOR_TEMPLATE) $(CLICK_DESKTOP_TEMPLATE) $(CLICK_METAINFO_TEMPLATE) $(CLICK_RUNNER) $(LINUX_APPIMAGE_ICON) | $(CLICK_BUILD_DIR) $(CLICK_DIST_DIR)
@command -v ar >/dev/null || { \
echo "ar is missing. Re-enter the flake shell with: nix develop"; \
exit 1; \
}
rm -rf $(CLICK_ROOT) $(CLICK_CONTROL_DIR)
rm -f $(CLICK_DIST_DIR)/$(CLICK_PACKAGE)_*_$(CLICK_ARCH).click
rm -f $(CLICK_BUILD_DIR)/debian-binary $(CLICK_BUILD_DIR)/control.tar.gz $(CLICK_BUILD_DIR)/data.tar.gz
mkdir -p $(CLICK_ROOT)/usr/bin $(CLICK_ROOT)/usr/lib $(CLICK_ROOT)/usr/share/applications $(CLICK_ROOT)/usr/share/icons/hicolor/512x512/apps $(CLICK_ROOT)/usr/share/metainfo
mkdir -p $(CLICK_CONTROL_DIR)
cp $(CLICK_BIN_INPUT) $(CLICK_ROOT)/usr/bin/$(APP_NAME)
cp $(CLICK_RUNNER) $(CLICK_ROOT)/run-inbe.sh
chmod +x $(CLICK_ROOT)/run-inbe.sh $(CLICK_ROOT)/usr/bin/$(APP_NAME)
@for lib in $(CLICK_RUNTIME_LIBS); do \
if [ -f "$$lib" ]; then \
cp -L "$$lib" $(CLICK_ROOT)/usr/lib/; \
fi; \
done
@if command -v patchelf >/dev/null; then \
for elf in $(CLICK_ROOT)/usr/lib/*.so*; do \
if [ -f "$$elf" ]; then patchelf --set-rpath '$$ORIGIN' "$$elf" >/dev/null 2>&1 || true; fi; \
done; \
fi
sed -e 's#__CLICK_PACKAGE__#$(CLICK_PACKAGE)#g' \
-e 's#__CLICK_TITLE__#$(CLICK_TITLE)#g' \
-e 's#__APP_VERSION__#$(APP_VERSION)#g' \
-e 's#__CLICK_ARCH__#$(CLICK_ARCH)#g' \
-e 's#__CLICK_FRAMEWORK__#$(CLICK_FRAMEWORK)#g' \
-e 's#__CLICK_MAINTAINER__#$(CLICK_MAINTAINER)#g' \
$(CLICK_MANIFEST_TEMPLATE) > $(CLICK_ROOT)/manifest.json
cp $(CLICK_ROOT)/manifest.json $(CLICK_CONTROL_DIR)/manifest
installed_size=$$(du -sk $(CLICK_ROOT) | awk '{ print $$1 }'); \
sed -e 's#__CLICK_PACKAGE__#$(CLICK_PACKAGE)#g' \
-e 's#__APP_VERSION__#$(APP_VERSION)#g' \
-e 's#__CLICK_ARCH__#$(CLICK_ARCH)#g' \
-e 's#__CLICK_TITLE__#$(CLICK_TITLE)#g' \
-e 's#__CLICK_MAINTAINER__#$(CLICK_MAINTAINER)#g' \
-e "s#__INSTALLED_SIZE__#$$installed_size#g" \
$(CLICK_CONTROL_TEMPLATE) > $(CLICK_CONTROL_DIR)/control
printf '%s\n' '#! /bin/sh' \
'echo "Click packages may not be installed directly using dpkg."' \
'echo "Use '\''click install'\'' instead."' \
'exit 1' > $(CLICK_CONTROL_DIR)/preinst
sed -e 's#__CLICK_POLICY_VERSION__#$(CLICK_POLICY_VERSION)#g' \
$(CLICK_APPARMOR_TEMPLATE) > $(CLICK_ROOT)/inbe.apparmor
sed -e 's#__CLICK_TITLE__#$(CLICK_TITLE)#g' \
$(CLICK_DESKTOP_TEMPLATE) > $(CLICK_ROOT)/inbe.desktop
@if [ "$(CLICK_INCLUDE_METAINFO)" = "1" ]; then \
sed -e 's#__CLICK_PACKAGE__#$(CLICK_PACKAGE)#g' \
-e 's#__APP_VERSION__#$(APP_VERSION)#g' \
-e 's#__RELEASE_DATE__#$(shell date -u +%Y-%m-%d)#g' \
$(CLICK_METAINFO_TEMPLATE) > $(CLICK_ROOT)/usr/share/metainfo/$(CLICK_PACKAGE).metainfo.xml; \
fi
cp $(LINUX_APPIMAGE_ICON) $(CLICK_ROOT)/inbe.png
cp $(LINUX_APPIMAGE_ICON) $(CLICK_ROOT)/usr/share/icons/hicolor/512x512/apps/inbe.png
cd $(CLICK_ROOT) && find . -type f -printf '%P\n' | LC_ALL=C sort | xargs md5sum > $(abspath $(CLICK_CONTROL_DIR)/md5sums)
printf '2.0\n' > $(CLICK_BUILD_DIR)/debian-binary
tar -C $(CLICK_CONTROL_DIR) --sort=name --owner=0 --group=0 --numeric-owner -czf $(abspath $(CLICK_BUILD_DIR)/control.tar.gz) control manifest md5sums preinst
tar -C $(CLICK_ROOT) --sort=name --owner=0 --group=0 --numeric-owner -czf $(abspath $(CLICK_BUILD_DIR)/data.tar.gz) inbe.apparmor inbe.desktop inbe.png manifest.json run-inbe.sh usr
cd $(CLICK_BUILD_DIR) && ar rcs $(abspath $@) debian-binary control.tar.gz data.tar.gz
test -f $@
ar t $@ | grep -qx debian-binary
ar t $@ | grep -qx control.tar.gz
ar t $@ | grep -qx data.tar.gz
$(WIN64_TARGET): Makefile $(SRC) $(FLINT_WINDOWS_SRCS) $(SQLITE_SRC) $(SQLITE_AMALGAMATION_H) $(FONT_OUTPUTS) $(EMBEDDED_ASSETS_C) $(WIN64_RAYLIB_A) $(WIN64_CURL_A) | $(WINDOWS_BIN_DIR)/$(WIN64_ARCH)
$(WIN64_CC) $(WINDOWS_CFLAGS) \
$(APP_INCLUDE) \
@@ -572,7 +719,7 @@ $(WIN32_TARGET): Makefile $(SRC) $(FLINT_WINDOWS_SRCS) $(SQLITE_SRC) $(SQLITE_AM
$(WINDOWS_LDFLAGS)
$(WIN32_STRIP) $@
$(APPIMAGE_TARGET): $(TARGET) $(LINUX_APPIMAGE_APPRUN) $(LINUX_APPIMAGE_DESKTOP) $(LINUX_APPIMAGE_ICON) | $(LINUX_DIST_DIR) $(LINUX_APPIMAGE_BUILD_DIR)
$(APPIMAGE_TARGET): $(TARGET) $(LINUX_APPIMAGE_APPRUN) $(LINUX_APPIMAGE_DESKTOP) $(LINUX_APPIMAGE_ICON) $(LINUX_APPIMAGE_APPDATA) | $(LINUX_DIST_DIR) $(LINUX_APPIMAGE_BUILD_DIR)
@command -v linuxdeploy-plugin-appimage >/dev/null || { \
echo "linuxdeploy-plugin-appimage is missing. Re-enter the flake shell with: nix develop"; \
exit 1; \
@@ -588,13 +735,29 @@ $(APPIMAGE_TARGET): $(TARGET) $(LINUX_APPIMAGE_APPRUN) $(LINUX_APPIMAGE_DESKTOP)
rm -rf $(LINUX_APPDIR)
rm -rf $(LINUX_DIST_DIR)/*.AppDir
rm -f $(LINUX_DIST_DIR)/*.AppImage
mkdir -p $(LINUX_APPDIR)/usr/bin $(LINUX_APPDIR)/usr/share/applications $(LINUX_APPDIR)/usr/share/icons/hicolor/512x512/apps
mkdir -p $(LINUX_APPDIR)/usr/bin $(LINUX_APPDIR)/usr/lib $(LINUX_APPDIR)/usr/share/applications $(LINUX_APPDIR)/usr/share/icons/hicolor/512x512/apps $(LINUX_APPDIR)/usr/share/metainfo
cp $(TARGET) $(LINUX_APPDIR)/usr/bin/$(APP_NAME)
patchelf --set-interpreter /lib64/ld-linux-x86-64.so.2 $(LINUX_APPDIR)/usr/bin/$(APP_NAME)
cp $(LINUX_APPIMAGE_APPRUN) $(LINUX_APPDIR)/AppRun
chmod +x $(LINUX_APPDIR)/AppRun
@loader=$$(LC_ALL=C readelf -l $(TARGET) | sed -n 's#.*Requesting program interpreter: \(.*\)]#\1#p'); \
if printf '%s\n' "$$loader" | grep -q '^/nix/store/.*glibc.*/'; then \
glibc_lib_dir=$$(dirname "$$loader"); \
echo "Bundling glibc loader: $$loader"; \
cp "$$loader" $(LINUX_APPDIR)/usr/lib/; \
for lib in libc.so.6 libm.so.6 libpthread.so.0 libdl.so.2 librt.so.1 libresolv.so.2 libnss_files.so.2; do \
if [ -f "$$glibc_lib_dir/$$lib" ]; then \
cp "$$glibc_lib_dir/$$lib" $(LINUX_APPDIR)/usr/lib/; \
chmod u+w $(LINUX_APPDIR)/usr/lib/$$lib; \
fi; \
done; \
chmod u+w $(LINUX_APPDIR)/usr/lib/$$(basename "$$loader"); \
else \
echo "Not bundling glibc; build interpreter is $$loader"; \
fi
cp $(LINUX_APPIMAGE_DESKTOP) $(LINUX_APPDIR)/$(APP_NAME).desktop
cp $(LINUX_APPIMAGE_DESKTOP) $(LINUX_APPDIR)/usr/share/applications/$(APP_NAME).desktop
cp $(LINUX_APPIMAGE_APPDATA) $(LINUX_APPDIR)/usr/share/metainfo/$(APP_NAME).appdata.xml
cp $(LINUX_APPIMAGE_ICON) $(LINUX_APPDIR)/$(APP_NAME).png
cp $(LINUX_APPIMAGE_ICON) $(LINUX_APPDIR)/usr/share/icons/hicolor/512x512/apps/$(APP_NAME).png
cd $(LINUX_APPIMAGE_BUILD_DIR) && env -u SOURCE_DATE_EPOCH ARCH=$(ARCH) LDAI_OUTPUT=$(abspath $(APPIMAGE_TARGET)) $(LINUXDEPLOY) \
@@ -630,6 +793,7 @@ $(WEB_TARGET): Makefile $(SRC) $(FLINT_WEB_SRCS) $(SQLITE_SRC) $(SQLITE_AMALGAMA
-sFETCH=1 \
-sALLOW_MEMORY_GROWTH=1 \
-sSTACK_SIZE=8388608 \
-sEXPORTED_FUNCTIONS=_main,_malloc,_free,_app_web_get_play_in_background,_app_web_set_backgrounded,_app_web_background_tick \
--shell-file src/web_shell.html \
-lidbfs.js \
-lm
@@ -849,3 +1013,30 @@ ifneq ($(shell v='$(FLINT_CURL_VERSION_HEX)'; if [ "$$v" = 075600 ] || [ "$$v" \
$(error libcurl >= 7.86.0 is required for websocket sync; found LIBCURL_VERSION_NUM=$(FLINT_CURL_VERSION_NUM))
endif
endif
NEEDS_CLICK_ENV := $(filter click click-verify,$(MAKECMDGOALS))
ifneq ($(strip $(NEEDS_CLICK_ENV)),)
ifeq ($(strip $(CLICK_BIN_SOURCE)),)
ifeq ($(strip $(AARCH64_CC)),)
$(error AARCH64_CC is not set. Enter the ray flake shell with 'nix develop' or pass CLICK_BIN_SOURCE=/path/to/inbe)
endif
ifeq ($(strip $(AARCH64_AR)),)
$(error AARCH64_AR is not set. Enter the ray flake shell with 'nix develop' or pass CLICK_BIN_SOURCE=/path/to/inbe)
endif
ifeq ($(strip $(AARCH64_RANLIB)),)
$(error AARCH64_RANLIB is not set. Enter the ray flake shell with 'nix develop' or pass CLICK_BIN_SOURCE=/path/to/inbe)
endif
ifeq ($(strip $(AARCH64_RAY_CFLAGS)),)
$(error AARCH64_RAY_CFLAGS is not set. Enter the ray flake shell with 'nix develop' or pass CLICK_BIN_SOURCE=/path/to/inbe)
endif
ifeq ($(strip $(AARCH64_RAY_LDLIBS)),)
$(error AARCH64_RAY_LDLIBS is not set. Enter the ray flake shell with 'nix develop' or pass CLICK_BIN_SOURCE=/path/to/inbe)
endif
ifeq ($(strip $(AARCH64_RAY_SDL_INCLUDE_DIR)),)
$(error AARCH64_RAY_SDL_INCLUDE_DIR is not set. Enter the ray flake shell with 'nix develop' or pass CLICK_BIN_SOURCE=/path/to/inbe)
endif
ifeq ($(strip $(AARCH64_FLINT_CURL_LDLIBS)),)
$(error AARCH64_FLINT_CURL_LDLIBS is not set. Enter the ray flake shell with 'nix develop' or pass CLICK_BIN_SOURCE=/path/to/inbe)
endif
endif
endif
+2061
View File
File diff suppressed because it is too large. Load diff

After

Width:  |  Height:  |  Size: 131 KiB

+2 -2
View File
@@ -35,8 +35,8 @@ android {
defaultConfig {
minSdk 21
targetSdk 35
versionCode 38
versionName "1.4.3"
versionCode 39
versionName "1.4.4"
}
+2
View File
@@ -108,6 +108,8 @@ add_library(main SHARED
"${SRC_DIR}/practices/meditation/meditation_music.c"
"${SRC_DIR}/core/theme.c"
"${SRC_DIR}/storage/data.c"
"${SRC_DIR}/storage/db.c"
"${SRC_DIR}/storage/import.c"
"${SRC_DIR}/storage/storage.c"
"${SRC_DIR}/storage/sync_account.c"
"${SRC_DIR}/storage/sync_client.c"
@@ -2,11 +2,9 @@ Eine freie, quelloffene App für Atmung, Meditation und Gewohnheiten.
Funktionen:
- Geführte Übungen mit visuellen und akustischen Hinweisen
- Mind, Yoga und Fitness für Gewohnheiten und Übungen
- Anpassbare Atemsitzungen und Meditationstimer
- Gewohnheitstracking mit Sitzungsverlauf
- Mind, Yoga und Fitness für verschiedene Übungsroutinen
- Anpassbare Atemsitzungen, Meditationstimer und Zähler
- Gewohnheitstracking mit Verlauf und verknüpften Übungszahlen
- Optionale Synchronisierung von Gewohnheiten, Sitzungen und Fortschritt
- Lokale Speicherung mit Import und Export
- Anpassbare Designs mit hellen und dunklen Varianten
- Touch-optimierte Oberfläche für Mobilgeräte
Verfügbare Plattformen: Linux, Windows, Android, WebAssembly.
@@ -1 +1 @@
Eine freie App für Atmung, Meditation und Gewohnheiten.
Atmung, Meditation und Gewohnheiten mit Synchronisierung.
@@ -0,0 +1,3 @@
### Fixed
- Build the Ubuntu Touch Click package with the OpenStore package id and review-compatible control metadata.
- Omit Click AppStream metadata by default to avoid OpenStore revision import failures.
@@ -2,11 +2,9 @@ A free, open-source practice app for breathing, meditation, and habit tracking.
Features:
- Guided practice sessions with visual and audio cues
- Mind, Yoga, and Fitness organization for habits and practice views
- Configurable breathing sessions and meditation timers
- Habit tracking with session history
- Mind, Yoga, and Fitness organization for different practice routines
- Customizable breathing sessions, meditation timers, and habit counters
- Habit tracking with session history and linked practice counts
- Optional sync for habits, sessions, and practice progress
- Local storage with import/export support
- Theme customization with light and dark variants
- Touch-optimized UI for mobile devices
Available platforms: Linux, Windows, Android, WebAssembly.
@@ -1 +1 @@
A free, open-source app for breathing, meditation, and habit tracking.
Syncable breathing, meditation, and habit practice app.
@@ -2,11 +2,9 @@ Una app libre y de código abierto para respiración, meditación y hábitos.
Funciones:
- Prácticas guiadas con señales visuales y de audio
- Organización Mind, Yoga y Fitness para hábitos y prácticas
- Sesiones de respiración y temporizadores de meditación configurables
- Seguimiento de hábitos con historial de sesiones
- Organización Mind, Yoga y Fitness para distintas rutinas de práctica
- Sesiones de respiración, temporizadores y contadores configurables
- Seguimiento de hábitos con historial y recuentos vinculados a prácticas
- Sincronización opcional de hábitos, sesiones y progreso
- Almacenamiento local con importación y exportación
- Temas personalizables con variantes claras y oscuras
- Interfaz optimizada para pantallas táctiles
Plataformas disponibles: Linux, Windows, Android, WebAssembly.
@@ -1 +1 @@
Una app libre para respiración, meditación y hábitos.
Respiración, meditación y hábitos con sincronización.
@@ -2,11 +2,9 @@ Une app libre et open source pour respiration, méditation et habitudes.
Fonctionnalités :
- Pratiques guidées avec repères visuels et audio
- Organisation Mind, Yoga et Fitness pour habitudes et pratiques
- Séances de respiration et minuteries de méditation configurables
- Suivi des habitudes avec historique des séances
- Organisation Mind, Yoga et Fitness pour différentes routines
- Séances de respiration, minuteries et compteurs personnalisables
- Suivi des habitudes avec historique et comptes liés aux pratiques
- Synchronisation optionnelle des habitudes, séances et progrès
- Stockage local avec import et export
- Thèmes personnalisables avec variantes claires et sombres
- Interface optimisée pour les écrans tactiles
Plateformes disponibles : Linux, Windows, Android, WebAssembly.
@@ -1 +1 @@
Une app libre pour respiration, méditation et habitudes.
Respiration, méditation et habitudes avec synchronisation.
@@ -2,11 +2,9 @@ Um app livre e de código aberto para respiração, meditação e hábitos.
Recursos:
- Práticas guiadas com sinais visuais e sonoros
- Organização Mind, Yoga e Fitness para hábitos e práticas
- Sessões de respiração e timers de meditação configuráveis
- Acompanhamento de hábitos com histórico de sessões
- Organização Mind, Yoga e Fitness para diferentes rotinas de prática
- Sessões de respiração, timers de meditação e contadores configuráveis
- Acompanhamento de hábitos com histórico e contagens ligadas às práticas
- Sincronização opcional de hábitos, sessões e progresso
- Armazenamento local com importação e exportação
- Temas personalizáveis com variantes claras e escuras
- Interface otimizada para toque em dispositivos móveis
Plataformas disponíveis: Linux, Windows, Android, WebAssembly.
@@ -1 +1 @@
Um app livre para respiração, meditação e hábitos.
Respiração, meditação e hábitos com sincronização.
+17
View File
@@ -86,9 +86,12 @@
aarch64PkgConfigPath = pkgs.lib.makeSearchPath "lib/pkgconfig" [
aarch64Pkgs.SDL2.dev
aarch64Pkgs.curl.dev
aarch64Pkgs.openssl.dev
aarch64Pkgs.libdrm.dev
aarch64Pkgs.libgbm
aarch64Pkgs.libglvnd.dev
aarch64Pkgs.zlib.dev
];
windowsTargetPkgs = pkgs.lib.optionals windowsCrossEnabled [
@@ -190,6 +193,8 @@ EOF
sdl2Pkgs.SDL2
sdl2Pkgs.SDL2.dev
butler
binutils
clickable
cmake
curl
curl.dev
@@ -200,6 +205,7 @@ EOF
gradle
imagemagick
jdk17
libxml2
libdrm
libdrm.dev
libgbm
@@ -215,6 +221,7 @@ EOF
ninja
openssl
openssl.dev
patchelf
pkg-config
pipewire
rsync
@@ -223,11 +230,17 @@ EOF
aarch64Pkgs.stdenv.cc
aarch64Pkgs.SDL2
aarch64Pkgs.SDL2.dev
aarch64Pkgs.curl
aarch64Pkgs.curl.dev
aarch64Pkgs.openssl
aarch64Pkgs.openssl.dev
aarch64Pkgs.libdrm
aarch64Pkgs.libdrm.dev
aarch64Pkgs.libgbm
aarch64Pkgs.libglvnd
aarch64Pkgs.libglvnd.dev
aarch64Pkgs.zlib
aarch64Pkgs.zlib.dev
] ++ windowsTargetPkgs;
profile = ''
@@ -264,6 +277,7 @@ EOF
export AARCH64_CC="${aarch64Pkgs.stdenv.cc}/bin/${aarch64Pkgs.stdenv.cc.targetPrefix}cc"
export AARCH64_AR="${aarch64Pkgs.stdenv.cc.bintools.bintools}/bin/${aarch64Pkgs.stdenv.cc.targetPrefix}ar"
export AARCH64_RANLIB="${aarch64Pkgs.stdenv.cc.bintools.bintools}/bin/${aarch64Pkgs.stdenv.cc.targetPrefix}ranlib"
export AARCH64_PKG_CONFIG_PATH="${aarch64PkgConfigPath}"
export AARCH64_RAY_SDL_CFLAGS="-D_GNU_SOURCE=1 -D_REENTRANT -I${aarch64Pkgs.SDL2.dev}/include -I${aarch64Pkgs.SDL2.dev}/include/SDL2"
export AARCH64_RAY_SDL_LDLIBS="-L${aarch64Pkgs.SDL2}/lib -lSDL2"
@@ -272,6 +286,9 @@ EOF
export AARCH64_RAY_CFLAGS="$AARCH64_RAY_SDL_CFLAGS $AARCH64_RAY_GL_CFLAGS"
export AARCH64_RAY_LDLIBS="$AARCH64_RAY_SDL_LDLIBS $AARCH64_RAY_GL_LDLIBS"
export AARCH64_RAY_SDL_INCLUDE_DIR="${aarch64Pkgs.SDL2.dev}/include"
export AARCH64_FLINT_CURL_CFLAGS="$(PKG_CONFIG_PATH="$AARCH64_PKG_CONFIG_PATH" pkg-config --cflags libcurl)"
export AARCH64_FLINT_CURL_LDLIBS="$(PKG_CONFIG_PATH="$AARCH64_PKG_CONFIG_PATH" pkg-config --libs libcurl)"
export AARCH64_CLICK_RUNTIME_LIBS="${aarch64Pkgs.SDL2}/lib/libSDL2-2.0.so.0 ${aarch64Pkgs.curl.out}/lib/libcurl.so.4 ${aarch64Pkgs.openssl.out}/lib/libssl.so.3 ${aarch64Pkgs.openssl.out}/lib/libcrypto.so.3 ${aarch64Pkgs.libdrm}/lib/libdrm.so.2 ${aarch64Pkgs.libgbm}/lib/libgbm.so.1 ${aarch64Pkgs.libglvnd}/lib/libEGL.so.1 ${aarch64Pkgs.libglvnd}/lib/libGLESv2.so.2 ${aarch64Pkgs.zlib}/lib/libz.so.1"
${windowsProfile}
+7
View File
@@ -0,0 +1,7 @@
Package: __CLICK_PACKAGE__
Version: __APP_VERSION__
Architecture: __CLICK_ARCH__
Maintainer: __CLICK_MAINTAINER__
Click-Version: 0.4
Installed-Size: __INSTALLED_SIZE__
Description: __CLICK_TITLE__
+6
View File
@@ -0,0 +1,6 @@
{
"policy_groups": [
"networking"
],
"policy_version": __CLICK_POLICY_VERSION__
}
+8
View File
@@ -0,0 +1,8 @@
[Desktop Entry]
Type=Application
Name=__CLICK_TITLE__
Exec=run-inbe.sh
Icon=inbe
Terminal=false
X-Ubuntu-Touch=true
X-Ubuntu-Supported-Orientations=portrait,landscape
+34
View File
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>__CLICK_PACKAGE__</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-3.0-or-later</project_license>
<name>Inner Breeze</name>
<summary>Syncable breathing, meditation, and habit practice app</summary>
<description>
<p>Inner Breeze is a free, open-source practice app for breathing, meditation, and habit tracking.</p>
<p>It provides guided practice sessions with visual and audio cues, meditation timers, habit counters, session history, import and export, theme customization, and optional sync for habits, sessions, and practice progress.</p>
</description>
<launchable type="desktop-id">inbe.desktop</launchable>
<categories>
<category>Utility</category>
</categories>
<keywords>
<keyword>breathing</keyword>
<keyword>meditation</keyword>
<keyword>habits</keyword>
<keyword>wellbeing</keyword>
</keywords>
<url type="homepage">https://inbe.waozi.xyz/</url>
<url type="bugtracker">https://github.com/waozixyz/inbe/issues</url>
<developer id="xyz.waozi">
<name>waozi</name>
</developer>
<provides>
<binary>inbe</binary>
</provides>
<releases>
<release version="__APP_VERSION__" date="__RELEASE_DATE__"/>
</releases>
<content_rating type="oars-1.1"/>
</component>
+15
View File
@@ -0,0 +1,15 @@
{
"name": "__CLICK_PACKAGE__",
"title": "__CLICK_TITLE__",
"version": "__APP_VERSION__",
"architecture": "__CLICK_ARCH__",
"framework": "__CLICK_FRAMEWORK__",
"description": "Syncable breathing, meditation, and habit practice app.",
"maintainer": "__CLICK_MAINTAINER__",
"hooks": {
"inbe": {
"apparmor": "inbe.apparmor",
"desktop": "inbe.desktop"
}
}
}
+4
View File
@@ -0,0 +1,4 @@
#!/bin/sh
HERE="${APP_DIR:-$(dirname "$(readlink -f "$0")")}"
export LD_LIBRARY_PATH="$HERE/usr/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
exec "$HERE/usr/bin/inbe" "$@"
+10 -1
View File
@@ -1,2 +1,11 @@
#!/bin/sh
exec "$APPDIR/usr/bin/inbe" "$@"
HERE="${APPDIR:-$(dirname "$(readlink -f "$0")")}"
LOADER="$HERE/usr/lib/ld-linux-x86-64.so.2"
SYSTEM_LIBRARY_PATH="/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/lib64:/usr/lib64:/lib:/usr/lib"
LIBRARY_PATH="$HERE/usr/lib:$HERE/usr/bin:$SYSTEM_LIBRARY_PATH"
if [ -x "$LOADER" ]; then
exec "$LOADER" --library-path "$LIBRARY_PATH${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" "$HERE/usr/bin/inbe" "$@"
fi
exec "$HERE/usr/bin/inbe" "$@"
+28
View File
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>inbe</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-3.0-or-later</project_license>
<name>Inner Breeze</name>
<summary>Syncable breathing, meditation, and habit practice app</summary>
<description>
<p>Inner Breeze is a free, open-source practice app for breathing, meditation, and habit tracking.</p>
<p>It provides guided practice sessions with visual and audio cues, meditation timers, habit counters, session history, import and export, theme customization, and optional sync for habits, sessions, and practice progress.</p>
</description>
<launchable type="desktop-id">inbe.desktop</launchable>
<categories>
<category>Utility</category>
</categories>
<url type="homepage">https://inbe.waozi.xyz/</url>
<url type="bugtracker">https://github.com/waozixyz/inbe/issues</url>
<developer id="xyz.waozi">
<name>waozi</name>
</developer>
<provides>
<binary>inbe</binary>
</provides>
<releases>
<release version="1.4.3" date="2026-06-20"/>
</releases>
<content_rating type="oars-1.1"/>
</component>
+78
View File
@@ -25,6 +25,7 @@
#include "flint_dpi.h"
#include "flint_text.h"
#include "flint_embedded_assets.h"
#include "practices/meditation/meditation_practice.h"
#include <limits.h>
#include <stdio.h>
@@ -49,6 +50,10 @@
void set_global_inbe_app(InbeApp *app);
#endif
#if defined(PLATFORM_WEB)
InbeApp *get_global_inbe_app(void);
#endif
#define INBE_DEFAULT_WIDTH 320
#define INBE_DEFAULT_HEIGHT 560
#define INBE_SYNC_SERVER_URL_KEY "sync_server_url"
@@ -68,6 +73,11 @@ static int g_sync_running = 0;
static int g_sync_refresh_pending = 0;
static int g_remote_sync_due = 0;
#if defined(PLATFORM_WEB)
static int g_web_background_remainder_ms = 0;
static int g_web_background_meditation_remainder_ms = 0;
#endif
#if !defined(PLATFORM_WEB)
typedef struct InbeSyncWorkerArgs {
char url[256];
@@ -1152,6 +1162,74 @@ app_init(void *vapp) {
app_auto_sync(app);
}
#if defined(PLATFORM_WEB)
EMSCRIPTEN_KEEPALIVE
int
app_web_get_play_in_background(void)
{
InbeApp *app = get_global_inbe_app();
return app != NULL && app->inbe.play_in_background;
}
EMSCRIPTEN_KEEPALIVE
void
app_web_set_backgrounded(int active)
{
InbeApp *app = get_global_inbe_app();
if(app == NULL)
return;
app->backgrounded = active ? 1 : 0;
if(!active) {
g_web_background_remainder_ms = 0;
g_web_background_meditation_remainder_ms = 0;
}
}
EMSCRIPTEN_KEEPALIVE
void
app_web_background_tick(int elapsed_ms)
{
InbeApp *app = get_global_inbe_app();
int frame_count;
int elapsed_total;
if(app == NULL || elapsed_ms <= 0)
return;
app->backgrounded = 1;
if(!app->inbe.play_in_background)
return;
if(app->inbe.screen == InbeScreenSession && !app->session_paused) {
g_web_background_meditation_remainder_ms = 0;
elapsed_total = elapsed_ms + g_web_background_remainder_ms;
if(elapsed_total > 5 * 60 * 1000)
elapsed_total = 5 * 60 * 1000;
frame_count = (elapsed_total * 60) / 1000;
g_web_background_remainder_ms = elapsed_total - (frame_count * 1000) / 60;
for(int i = 0; i < frame_count && app->inbe.screen == InbeScreenSession; i++) {
inbestep(&app->inbe);
practice_update_session_sounds(app);
}
return;
}
g_web_background_remainder_ms = 0;
if(app->inbe.screen == InbeScreenMeditation && !app->session_paused) {
elapsed_total = elapsed_ms + g_web_background_meditation_remainder_ms;
g_web_background_meditation_remainder_ms = elapsed_total % 1000;
meditation_background_tick(app, elapsed_total - g_web_background_meditation_remainder_ms);
if(app->inbe.screen == InbeScreenMeditation) {
const PracticeDefinition *practice = practice_get(PRACTICE_MEDITATION);
if(practice->update != NULL)
practice->update(app);
}
}
}
#endif
static void
handle_back_button(InbeApp *app)
{
+1 -1
View File
@@ -280,7 +280,7 @@ app_load_settings(InbeApp *app)
load_language_setting(app, settings_missing);
#ifdef __ANDROID__
#if defined(__ANDROID__) || defined(PLATFORM_WEB)
app->inbe.play_in_background =
storage_get_setting_int("play_in_background", 1) != 0;
TraceLog(LOG_INFO, "INBE: Loaded play_in_background setting = %d",
+2 -2
View File
@@ -3,7 +3,7 @@
#define INBE_VERSION_MAJOR 1
#define INBE_VERSION_MINOR 4
#define INBE_VERSION_PATCH 3
#define INBE_VERSION_STRING "1.4.3"
#define INBE_VERSION_PATCH 4
#define INBE_VERSION_STRING "1.4.4"
#endif
+23 -15
View File
@@ -187,6 +187,25 @@ android_clamp_content_size(int size, int leading_inset, int trailing_inset)
}
#endif
static void
draw_full_frame(int width, int height)
{
BeginDrawing();
ClearBackground(theme_get_bg());
app_update_draw(&inbe_app, (Rectangle){
0,
0,
(float)width,
(float)height
});
if(inbe_app.cursor_disabled)
SetMouseCursor(MOUSE_CURSOR_NOT_ALLOWED);
else if(inbe_app.cursor_clickable)
SetMouseCursor(MOUSE_CURSOR_POINTING_HAND);
else
SetMouseCursor(MOUSE_CURSOR_DEFAULT);
}
static void
frame(void)
{
@@ -222,7 +241,7 @@ frame(void)
int content_height = android_clamp_content_size(height, safe_top, safe_bottom);
BeginDrawing();
ClearBackground(theme_get_bg());
ClearBackground(BLACK);
flint_clip_begin(content_x, content_y, content_width, content_height);
app_update_draw(&inbe_app, (Rectangle){
(float)content_x,
@@ -231,21 +250,10 @@ frame(void)
(float)content_height
});
flint_clip_end();
#elif defined(PLATFORM_WEB)
draw_full_frame(width, height);
#else
BeginDrawing();
ClearBackground(theme_get_bg());
app_update_draw(&inbe_app, (Rectangle){
0,
0,
(float)width,
(float)height
});
if(inbe_app.cursor_disabled)
SetMouseCursor(MOUSE_CURSOR_NOT_ALLOWED);
else if(inbe_app.cursor_clickable)
SetMouseCursor(MOUSE_CURSOR_POINTING_HAND);
else
SetMouseCursor(MOUSE_CURSOR_DEFAULT);
draw_full_frame(width, height);
#endif
EndDrawing();
}
@@ -14,5 +14,6 @@ void meditation_config_screen_draw(InbeApp *app);
void meditation_draw_setup_modal(InbeApp *app);
void meditation_draw_screen(InbeApp *app, int center_x, int center_y);
void meditation_request_exit(InbeApp *app);
void meditation_background_tick(InbeApp *app, int elapsed_ms);
#endif
+39 -7
View File
@@ -71,6 +71,30 @@ meditation_finish(InbeApp *app)
app->inbe.screen = InbeScreenStart;
}
void
meditation_background_tick(InbeApp *app, int elapsed_ms)
{
int elapsed_seconds;
if(app == NULL || elapsed_ms <= 0)
return;
if(app->inbe.screen != InbeScreenMeditation || app->session_paused)
return;
elapsed_seconds = elapsed_ms / 1000;
if(elapsed_seconds <= 0)
return;
if(elapsed_seconds >= app->meditation.remaining_seconds)
app->meditation.remaining_seconds = 0;
else
app->meditation.remaining_seconds -= elapsed_seconds;
app->meditation.frame_ticks = 0;
if(app->meditation.remaining_seconds <= 0)
meditation_finish(app);
}
static int
meditation_elapsed_seconds(InbeApp *app)
{
@@ -331,12 +355,20 @@ meditation_draw_screen(InbeApp *app, int center_x, int center_y)
flint_ui_text_y(time_text, center_y - font, font * 2, font),
font, theme_get_text());
app->meditation.frame_ticks++;
if(app->meditation.frame_ticks >= 60) {
app->meditation.frame_ticks = 0;
if(app->meditation.remaining_seconds > 0)
app->meditation.remaining_seconds--;
if(app->meditation.remaining_seconds <= 0)
meditation_finish(app);
if(!(
#if defined(PLATFORM_WEB)
app->backgrounded
#else
0
#endif
)) {
app->meditation.frame_ticks++;
if(app->meditation.frame_ticks >= 60) {
app->meditation.frame_ticks = 0;
if(app->meditation.remaining_seconds > 0)
app->meditation.remaining_seconds--;
if(app->meditation.remaining_seconds <= 0)
meditation_finish(app);
}
}
}
+8 -2
View File
@@ -838,7 +838,13 @@ session_update_screen(InbeApp *app, int center_x, int center_y, int *hover)
draw_session_status(app, center_x, center_y);
draw_session_round_label(app);
if(!app->session_paused) {
if(!app->session_paused && !(
#if defined(PLATFORM_WEB)
app->backgrounded
#else
0
#endif
)) {
#if defined(PLATFORM_ANDROID) || defined(__ANDROID__) || defined(ANDROID)
pthread_mutex_t *timer_mutex = android_timer_get_mutex();
if(timer_mutex) {
@@ -855,7 +861,7 @@ session_update_screen(InbeApp *app, int center_x, int center_y, int *hover)
}
if(app->inbe.phase == InbePhaseHold) {
int breath_y = center_y + (int)(app->inbe.rmax * flint_dpi_scale() + 0.5f) + flint_px(24);
int breath_y = center_y + app->inbe.rmax + flint_px(24);
if(breath_y > breath_max_y)
breath_y = breath_max_y;
if(ui_draw_text_btn(center_x, breath_y, locale_get("breath_button"), hover))
+2 -2
View File
@@ -23,7 +23,7 @@ settings_device_content_height(void)
{
int height = flint_px(74) + flint_px(74) + flint_px(76) + flint_px(40);
#if defined(PLATFORM_ANDROID) || defined(__ANDROID__) || defined(ANDROID)
#if defined(PLATFORM_ANDROID) || defined(__ANDROID__) || defined(ANDROID) || defined(PLATFORM_WEB)
height += flint_px(76);
#endif
#if !defined(PLATFORM_ANDROID) && !defined(__ANDROID__) && !defined(ANDROID) && !defined(PLATFORM_WEB)
@@ -67,7 +67,7 @@ settings_device_draw(InbeApp *app, int x, int w, int *y, SettingsDeviceState *st
}
*y += flint_px(74);
#ifdef __ANDROID__
#if defined(__ANDROID__) || defined(PLATFORM_WEB)
{
int play_in_background = app->inbe.play_in_background;
flint_text_draw(locale_get("play_in_background_label"), x, *y,
+431
View File
@@ -0,0 +1,431 @@
#include "db.h"
#include "import.h"
#include "raylib.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <time.h>
#include <unistd.h>
#if defined(_WIN32)
#define INBE_MKDIR(path) mkdir(path)
#else
#define INBE_MKDIR(path) mkdir(path, 0700)
#endif
StorageState g_storage;
static void
make_user_id(char *out, size_t out_size)
{
unsigned int r = (unsigned int)rand();
snprintf(out, out_size, "local-%lld-%u", now_seconds(), r);
}
int
path_exists(const char *path)
{
struct stat st;
return path != NULL && stat(path, &st) == 0;
}
static int
dir_exists_local(const char *path)
{
struct stat st;
return path != NULL && stat(path, &st) == 0 && S_ISDIR(st.st_mode);
}
int
ensure_dir_local(const char *path)
{
char temp[INBE_STORAGE_PATH_SIZE];
char *p;
if(path == NULL || path[0] == '\0')
return 0;
if(dir_exists_local(path))
return 1;
snprintf(temp, sizeof(temp), "%s", path);
p = temp;
if(*p == '/')
p++;
while((p = strchr(p, '/')) != NULL) {
*p = '\0';
if(temp[0] != '\0' && !dir_exists_local(temp) && INBE_MKDIR(temp) != 0 && !dir_exists_local(temp)) {
*p = '/';
return 0;
}
*p = '/';
p++;
}
return INBE_MKDIR(path) == 0 || dir_exists_local(path);
}
int
exec_sql(const char *sql)
{
char *error = NULL;
int rc = SQLITE_OK;
for(int attempt = 0; attempt < 20; attempt++) {
rc = sqlite3_exec(g_storage.db, sql, NULL, NULL, &error);
if(rc == SQLITE_OK)
return 1;
if(rc != SQLITE_BUSY && rc != SQLITE_LOCKED)
break;
sqlite3_free(error);
error = NULL;
#if !defined(__EMSCRIPTEN__)
usleep(50000);
#endif
}
if(rc != SQLITE_OK) {
TraceLog(LOG_ERROR, "STORAGE: SQL failed: %s", error != NULL ? error : "unknown");
sqlite3_free(error);
return 0;
}
return 1;
}
int
table_has_column(const char *table, const char *column)
{
sqlite3_stmt *stmt = NULL;
char sql[128];
int found = 0;
if(table == NULL || column == NULL || g_storage.db == NULL)
return 0;
snprintf(sql, sizeof(sql), "PRAGMA table_info(%s)", table);
if(sqlite3_prepare_v2(g_storage.db, sql, -1, &stmt, NULL) != SQLITE_OK)
return 0;
while(sqlite3_step(stmt) == SQLITE_ROW) {
const char *name = (const char *)sqlite3_column_text(stmt, 1);
if(name != NULL && strcmp(name, column) == 0) {
found = 1;
break;
}
}
sqlite3_finalize(stmt);
return found;
}
int
table_exists(const char *table)
{
sqlite3_stmt *stmt = NULL;
int found = 0;
if(table == NULL || g_storage.db == NULL)
return 0;
if(sqlite3_prepare_v2(g_storage.db,
"SELECT 1 FROM sqlite_master WHERE type='table' AND name=?1 LIMIT 1",
-1, &stmt, NULL) != SQLITE_OK)
return 0;
bind_text(stmt, 1, table);
found = sqlite3_step(stmt) == SQLITE_ROW;
sqlite3_finalize(stmt);
return found;
}
long long
now_seconds(void)
{
return (long long)time(NULL);
}
int
bind_text(sqlite3_stmt *stmt, int index, const char *text)
{
return sqlite3_bind_text(stmt, index, text != NULL ? text : "", -1, SQLITE_TRANSIENT) == SQLITE_OK;
}
int
schema_create(void)
{
return exec_sql(
"PRAGMA journal_mode=DELETE;"
"PRAGMA foreign_keys=ON;"
"CREATE TABLE IF NOT EXISTS meta("
" key TEXT PRIMARY KEY,"
" value TEXT NOT NULL"
");"
"CREATE TABLE IF NOT EXISTS users("
" id TEXT PRIMARY KEY,"
" created_at INTEGER NOT NULL,"
" kind TEXT NOT NULL"
");"
"CREATE TABLE IF NOT EXISTS settings("
" user_id TEXT NOT NULL,"
" key TEXT NOT NULL,"
" value TEXT NOT NULL,"
" updated_at INTEGER NOT NULL,"
" PRIMARY KEY(user_id,key)"
");"
"CREATE TABLE IF NOT EXISTS sessions("
" id TEXT PRIMARY KEY,"
" user_id TEXT NOT NULL,"
" started_at INTEGER NOT NULL,"
" local_date INTEGER NOT NULL,"
" topic INTEGER NOT NULL DEFAULT 0,"
" activity INTEGER NOT NULL DEFAULT 0,"
" source TEXT NOT NULL,"
" imported_at INTEGER NOT NULL,"
" rounds_hash INTEGER NOT NULL,"
" deleted_at INTEGER NOT NULL DEFAULT 0,"
" updated_at INTEGER NOT NULL DEFAULT 0,"
" UNIQUE(user_id,started_at,rounds_hash)"
");"
"CREATE TABLE IF NOT EXISTS session_rounds("
" session_id TEXT NOT NULL,"
" round_index INTEGER NOT NULL,"
" seconds INTEGER NOT NULL,"
" PRIMARY KEY(session_id,round_index)"
");"
"CREATE TABLE IF NOT EXISTS habits("
" id TEXT PRIMARY KEY,"
" user_id TEXT NOT NULL,"
" name TEXT NOT NULL,"
" color_r INTEGER NOT NULL,"
" color_g INTEGER NOT NULL,"
" color_b INTEGER NOT NULL,"
" sync_mode INTEGER NOT NULL,"
" sync_activity INTEGER NOT NULL,"
" counter_enabled INTEGER NOT NULL DEFAULT 0,"
" sort_order INTEGER NOT NULL,"
" deleted_at INTEGER NOT NULL DEFAULT 0,"
" updated_at INTEGER NOT NULL DEFAULT 0"
");"
"CREATE TABLE IF NOT EXISTS habit_days("
" habit_id TEXT NOT NULL,"
" local_date INTEGER NOT NULL,"
" completed INTEGER NOT NULL,"
" count INTEGER NOT NULL DEFAULT 0,"
" session_count INTEGER NOT NULL DEFAULT 0,"
" updated_at INTEGER NOT NULL,"
" PRIMARY KEY(habit_id,local_date)"
");"
"CREATE TABLE IF NOT EXISTS imports("
" id TEXT PRIMARY KEY,"
" imported_at INTEGER NOT NULL,"
" format TEXT NOT NULL,"
" source_name TEXT NOT NULL,"
" session_count INTEGER NOT NULL,"
" habit_count INTEGER NOT NULL"
");"
"CREATE TABLE IF NOT EXISTS sync_outbox("
" seq INTEGER PRIMARY KEY AUTOINCREMENT,"
" entity_type TEXT NOT NULL,"
" entity_id TEXT NOT NULL,"
" local_date INTEGER NOT NULL DEFAULT 0,"
" queued_at INTEGER NOT NULL,"
" UNIQUE(entity_type,entity_id,local_date)"
");"
"INSERT OR IGNORE INTO meta(key,value) VALUES('schema_version','1');");
}
int
load_or_create_user(void)
{
sqlite3_stmt *stmt = NULL;
int rc;
if(sqlite3_prepare_v2(g_storage.db, "SELECT id FROM users WHERE kind='local' ORDER BY created_at LIMIT 1",
-1, &stmt, NULL) != SQLITE_OK)
return 0;
rc = sqlite3_step(stmt);
if(rc == SQLITE_ROW) {
snprintf(g_storage.user_id, sizeof(g_storage.user_id), "%s",
(const char *)sqlite3_column_text(stmt, 0));
sqlite3_finalize(stmt);
return 1;
}
sqlite3_finalize(stmt);
make_user_id(g_storage.user_id, sizeof(g_storage.user_id));
if(sqlite3_prepare_v2(g_storage.db,
"INSERT INTO users(id,created_at,kind) VALUES(?1,?2,'local')",
-1, &stmt, NULL) != SQLITE_OK)
return 0;
bind_text(stmt, 1, g_storage.user_id);
sqlite3_bind_int64(stmt, 2, now_seconds());
rc = sqlite3_step(stmt);
sqlite3_finalize(stmt);
return rc == SQLITE_DONE;
}
int
meta_equals(const char *key, const char *value)
{
sqlite3_stmt *stmt = NULL;
int ok = 0;
if(sqlite3_prepare_v2(g_storage.db, "SELECT value FROM meta WHERE key=?1", -1, &stmt, NULL) != SQLITE_OK)
return 0;
bind_text(stmt, 1, key);
if(sqlite3_step(stmt) == SQLITE_ROW) {
const char *text = (const char *)sqlite3_column_text(stmt, 0);
ok = text != NULL && strcmp(text, value) == 0;
}
sqlite3_finalize(stmt);
return ok;
}
void
set_meta(const char *key, const char *value)
{
sqlite3_stmt *stmt = NULL;
if(sqlite3_prepare_v2(g_storage.db,
"INSERT INTO meta(key,value) VALUES(?1,?2) "
"ON CONFLICT(key) DO UPDATE SET value=excluded.value",
-1, &stmt, NULL) != SQLITE_OK)
return;
bind_text(stmt, 1, key);
bind_text(stmt, 2, value);
sqlite3_step(stmt);
sqlite3_finalize(stmt);
}
long long
get_meta_int64(const char *key, long long fallback)
{
sqlite3_stmt *stmt = NULL;
long long value = fallback;
if(g_storage.db == NULL || key == NULL)
return fallback;
if(sqlite3_prepare_v2(g_storage.db, "SELECT value FROM meta WHERE key=?1", -1, &stmt, NULL) != SQLITE_OK)
return fallback;
bind_text(stmt, 1, key);
if(sqlite3_step(stmt) == SQLITE_ROW) {
const char *text = (const char *)sqlite3_column_text(stmt, 0);
if(text != NULL && text[0] != '\0')
value = atoll(text);
}
sqlite3_finalize(stmt);
return value;
}
void
set_meta_int64(const char *key, long long value)
{
char text[32];
snprintf(text, sizeof(text), "%lld", value);
set_meta(key, text);
}
int
migrate_schema(void)
{
long long now = now_seconds();
int had_outbox = table_exists("sync_outbox");
if(table_has_column("habits", "sync_topic")) {
if(!exec_sql(
"BEGIN IMMEDIATE;"
"ALTER TABLE habits RENAME TO habits_with_sync_topic;"
"CREATE TABLE habits("
" id TEXT PRIMARY KEY,"
" user_id TEXT NOT NULL,"
" name TEXT NOT NULL,"
" color_r INTEGER NOT NULL,"
" color_g INTEGER NOT NULL,"
" color_b INTEGER NOT NULL,"
" sync_mode INTEGER NOT NULL,"
" sync_activity INTEGER NOT NULL,"
" sort_order INTEGER NOT NULL,"
" deleted_at INTEGER NOT NULL DEFAULT 0,"
" updated_at INTEGER NOT NULL DEFAULT 0"
");"
"INSERT INTO habits(id,user_id,name,color_r,color_g,color_b,sync_mode,sync_activity,sort_order,deleted_at,updated_at)"
" SELECT id,user_id,name,color_r,color_g,color_b,sync_mode,sync_activity,sort_order,deleted_at,0"
" FROM habits_with_sync_topic;"
"DROP TABLE habits_with_sync_topic;"
"COMMIT;"))
return 0;
}
if(!table_has_column("habits", "counter_enabled") &&
!exec_sql("ALTER TABLE habits ADD COLUMN counter_enabled INTEGER NOT NULL DEFAULT 0"))
return 0;
if(!table_has_column("habit_days", "count") &&
!exec_sql("ALTER TABLE habit_days ADD COLUMN count INTEGER NOT NULL DEFAULT 0;"
"UPDATE habit_days SET count=CASE WHEN completed!=0 THEN 1 ELSE 0 END WHERE count=0"))
return 0;
if(!table_has_column("habit_days", "session_count") &&
!exec_sql("ALTER TABLE habit_days ADD COLUMN session_count INTEGER NOT NULL DEFAULT 0"))
return 0;
if(!table_has_column("habits", "updated_at")) {
char sql[160];
snprintf(sql, sizeof(sql), "ALTER TABLE habits ADD COLUMN updated_at INTEGER NOT NULL DEFAULT %lld", now);
if(!exec_sql(sql))
return 0;
}
if(!table_has_column("sessions", "updated_at")) {
char sql[160];
snprintf(sql, sizeof(sql), "ALTER TABLE sessions ADD COLUMN updated_at INTEGER NOT NULL DEFAULT %lld", now);
if(!exec_sql(sql))
return 0;
}
if(!exec_sql(
"CREATE TABLE IF NOT EXISTS sync_outbox("
" seq INTEGER PRIMARY KEY AUTOINCREMENT,"
" entity_type TEXT NOT NULL,"
" entity_id TEXT NOT NULL,"
" local_date INTEGER NOT NULL DEFAULT 0,"
" queued_at INTEGER NOT NULL,"
" UNIQUE(entity_type,entity_id,local_date)"
");"))
return 0;
if(!had_outbox) {
if(!exec_sql(
"INSERT OR IGNORE INTO sync_outbox(entity_type,entity_id,local_date,queued_at) "
"SELECT 'habit',id,0,updated_at FROM habits;"
"INSERT OR IGNORE INTO sync_outbox(entity_type,entity_id,local_date,queued_at) "
"SELECT 'habit_day',habit_id,local_date,updated_at FROM habit_days;"
"INSERT OR IGNORE INTO sync_outbox(entity_type,entity_id,local_date,queued_at) "
"SELECT 'session',id,0,updated_at FROM sessions;"))
return 0;
}
return 1;
}
int
storage_init(const char *root)
{
if(root == NULL || root[0] == '\0')
return 0;
snprintf(g_storage.root, sizeof(g_storage.root), "%s", root);
ensure_dir_local(g_storage.root);
snprintf(g_storage.db_path, sizeof(g_storage.db_path), "%s/inbe.db", g_storage.root);
if(sqlite3_open(g_storage.db_path, &g_storage.db) != SQLITE_OK) {
TraceLog(LOG_ERROR, "STORAGE: failed to open %s", g_storage.db_path);
return 0;
}
sqlite3_busy_timeout(g_storage.db, 1000);
if(!schema_create() || !migrate_schema() || !load_or_create_user())
return 0;
storage_materialize_session_habit_days();
migrate_legacy_file_sessions_once();
return 1;
}
void
storage_close(void)
{
if(g_storage.db != NULL) {
sqlite3_close(g_storage.db);
g_storage.db = NULL;
}
}
const char *
storage_db_path(void)
{
return g_storage.db_path;
}
+45
View File
@@ -0,0 +1,45 @@
#ifndef INBE_STORAGE_DB_H
#define INBE_STORAGE_DB_H
#include "storage.h"
#include <sqlite3.h>
#include <stddef.h>
typedef struct StorageState {
sqlite3 *db;
char root[INBE_STORAGE_PATH_SIZE];
char db_path[INBE_STORAGE_PATH_SIZE];
char user_id[INBE_STORAGE_ID_SIZE];
char text_value[8192];
int last_sync_changed;
int materialize_defer;
int materialize_needed;
long long pending_sync_outbox_seq;
} StorageState;
extern StorageState g_storage;
long long now_seconds(void);
int bind_text(sqlite3_stmt *stmt, int index, const char *text);
int path_exists(const char *path);
int ensure_dir_local(const char *path);
int exec_sql(const char *sql);
int table_has_column(const char *table, const char *column);
int table_exists(const char *table);
int schema_create(void);
int migrate_schema(void);
int load_or_create_user(void);
int meta_equals(const char *key, const char *value);
void set_meta(const char *key, const char *value);
long long get_meta_int64(const char *key, long long fallback);
void set_meta_int64(const char *key, long long value);
void storage_schedule_persist(void);
void storage_enqueue_all_sync_state(void);
int storage_materialize_session_habit_days(void);
int insert_session_at_ex(long long started_at, int local_date, const int *round_times,
int round_count, int topic, int activity, const char *source,
char *out_id, size_t out_id_size);
#endif
+1042
View File
File diff suppressed because it is too large. Load diff
+12
View File
@@ -0,0 +1,12 @@
#ifndef INBE_STORAGE_IMPORT_H
#define INBE_STORAGE_IMPORT_H
#include "storage.h"
int storage_export_zip(const char *path);
int storage_import_zip(const char *path);
int storage_import_zip_ex(const char *path, InbeStorageImportMode mode);
int storage_inspect_import(const char *path, InbeStorageImportInfo *info);
void migrate_legacy_file_sessions_once(void);
#endif
+5 -1442
View File
File diff suppressed because it is too large. Load diff
+84 -4
View File
@@ -17,9 +17,9 @@
<meta name="twitter:image" content="https://inbe.waozi.xyz/og.jpg">
<meta name="twitter:site" content="@waozixyz">
<meta name="twitter:creator" content="@waozixyz">
<link rel="icon" type="image/png" sizes="32x32" href="/web-assets/icons/favicon-32x32.png">
<link rel="apple-touch-icon" href="/web-assets/icons/apple-touch-icon.png">
<link rel="manifest" href="/manifest.json">
<link rel="icon" type="image/png" sizes="32x32" href="web-assets/icons/favicon-32x32.png">
<link rel="apple-touch-icon" href="web-assets/icons/apple-touch-icon.png">
<link rel="manifest" href="manifest.json">
<meta name="theme-color" content="#779999">
<style>
html, body {
@@ -147,7 +147,7 @@
<body>
<div class="loading-screen" id="loading-screen" role="status" aria-live="polite">
<div class="loading-panel">
<img class="loading-mark" src="/web-assets/icons/icon-192x192.png" alt="" width="76" height="76">
<img class="loading-mark" src="web-assets/icons/icon-192x192.png" alt="" width="76" height="76">
<h1 class="loading-title">Inner Breeze</h1>
<div id="status">Downloading...</div>
<progress value="0" max="100" id="progress" hidden></progress>
@@ -307,6 +307,86 @@
if (text) Module.printErr('[post-exception status] ' + text);
};
};
(function() {
var backgroundTimer = 0;
var lastBackgroundTick = 0;
function callExport(name, args) {
var fn = Module && Module['_' + name];
if (typeof fn !== 'function') return 0;
try {
return fn.apply(null, args || []);
} catch (e) {
console.error('Web background callback failed:', name, e);
return 0;
}
}
function playInBackgroundEnabled() {
return callExport('app_web_get_play_in_background') ? true : false;
}
function resumeWebAudio() {
var miniaudio = window.miniaudio;
if (!miniaudio || !miniaudio.devices) return;
miniaudio.devices.forEach(function(device) {
if (!device || !device.webaudio || device.state !== miniaudio.device_state.started) return;
if (device.webaudio.state !== 'running') {
device.webaudio.resume().catch(function(error) {
console.error('Failed to resume web audio:', error);
});
}
});
}
function runBackgroundTick() {
var now = performance.now();
var elapsed = lastBackgroundTick ? now - lastBackgroundTick : 0;
lastBackgroundTick = now;
resumeWebAudio();
if (elapsed > 0) callExport('app_web_background_tick', [Math.max(1, Math.round(elapsed))]);
}
function stopBackgroundTimer() {
if (backgroundTimer) {
clearInterval(backgroundTimer);
backgroundTimer = 0;
}
lastBackgroundTick = 0;
}
function startBackgroundTimer() {
if (backgroundTimer || !playInBackgroundEnabled()) return;
lastBackgroundTick = performance.now();
runBackgroundTick();
backgroundTimer = setInterval(runBackgroundTick, 250);
}
function applyVisibilityState() {
var hidden = document.hidden;
if (hidden) {
callExport('app_web_set_backgrounded', [1]);
startBackgroundTimer();
} else {
runBackgroundTick();
stopBackgroundTimer();
callExport('app_web_set_backgrounded', [0]);
resumeWebAudio();
}
}
document.addEventListener('visibilitychange', applyVisibilityState, false);
window.addEventListener('pagehide', function() {
callExport('app_web_set_backgrounded', [1]);
runBackgroundTick();
}, false);
window.addEventListener('pageshow', applyVisibilityState, false);
window.addEventListener('blur', function() {
if (document.hidden) applyVisibilityState();
}, false);
window.addEventListener('focus', applyVisibilityState, false);
})();
</script>
{{{ SCRIPT }}}
</body>
+4 -4
View File
@@ -3,8 +3,8 @@
IDI_APP_ICON ICON "inbe.ico"
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,4,3,0
PRODUCTVERSION 1,4,3,0
FILEVERSION 1,4,4,0
PRODUCTVERSION 1,4,4,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -21,11 +21,11 @@ BEGIN
BEGIN
VALUE "CompanyName", "waozi"
VALUE "FileDescription", "Inner Breeze"
VALUE "FileVersion", "1.4.3"
VALUE "FileVersion", "1.4.4"
VALUE "InternalName", "inbe"
VALUE "OriginalFilename", "inbe-windows-x86_64.exe"
VALUE "ProductName", "Inner Breeze"
VALUE "ProductVersion", "1.4.3"
VALUE "ProductVersion", "1.4.4"
END
END
BLOCK "VarFileInfo"