Fix orientation resizing and habit import merge
No files matched your search
@@ -26,6 +26,8 @@ node_modules
|
||||
/main
|
||||
!droid/app/src/main
|
||||
droid/app/src/main/assets
|
||||
droid/*.apk
|
||||
droid/*.aab
|
||||
|
||||
.direnv/
|
||||
.node-repl-history
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
# Changelog
|
||||
## [1.3.1] - 2026-06-17
|
||||
### Fixed
|
||||
- Fixed Android orientation resizing and habit import merging by name.
|
||||
|
||||
## [1.3.0] - 2026-06-14
|
||||
### Added
|
||||
- Habit tracking with default Mind, Yoga, and Fitness habits.
|
||||
- Implemented 1-bit habit tracker synced with practice data
|
||||
- Habit editing, custom colors, sync options, and deletion.
|
||||
- Practice tabs with configurable themes.
|
||||
### Changed
|
||||
- App theme now follows the active practice theme globally.
|
||||
- Add monochrome theme
|
||||
- Add simple meditation exercise with background music
|
||||
|
||||
## [1.2.6] - 2026-06-12
|
||||
### Fixed
|
||||
|
||||
@@ -8,6 +8,8 @@ ANDROID_ACTIVITY := xyz.waozi.inbe.MainActivity
|
||||
CC ?= gcc
|
||||
GRADLE ?= gradle
|
||||
ARCH := $(shell uname -m)
|
||||
ANDROID_KEYSTORE ?= $(HOME)/.android/flint-release.keystore
|
||||
ANDROID_KEY_ALIAS ?= inbe-key
|
||||
|
||||
BUILD_DIR := build
|
||||
BUILD_OBJ_DIR := $(BUILD_DIR)/obj
|
||||
@@ -16,13 +18,38 @@ BUILD_DIST_DIR := $(BUILD_DIR)/dist
|
||||
LINUX_OBJ_DIR := $(BUILD_OBJ_DIR)/linux
|
||||
LINUX_BIN_DIR := $(BUILD_BIN_DIR)/linux
|
||||
LINUX_DIST_DIR := $(BUILD_DIST_DIR)/linux
|
||||
LINUX_APPIMAGE_BUILD_DIR := $(BUILD_OBJ_DIR)/appimage/linux
|
||||
LINUX_APPDIR := $(LINUX_APPIMAGE_BUILD_DIR)/$(APP_NAME).AppDir
|
||||
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
|
||||
WINDOWS_OBJ_DIR := $(BUILD_OBJ_DIR)/windows
|
||||
WINDOWS_BIN_DIR := $(BUILD_BIN_DIR)/windows
|
||||
WINDOWS_DIST_DIR := $(BUILD_DIST_DIR)/windows
|
||||
ANDROID_BUILD_DIR := $(BUILD_DIR)/android
|
||||
WEB_OBJ_DIR := $(BUILD_OBJ_DIR)/web
|
||||
WEB_DIST_DIR := $(BUILD_DIST_DIR)/web
|
||||
VERSION_FILE := src/core/version.h
|
||||
APP_VERSION := $(shell sed -n 's/^#define INBE_VERSION_STRING "\([^"]*\)".*/\1/p' $(VERSION_FILE) 2>/dev/null)
|
||||
|
||||
RAYLIB_DIR := vendor/raylib/src
|
||||
RAYLIB_BUILD_DIR := $(LINUX_OBJ_DIR)/$(ARCH)/native/raylib
|
||||
RAYLIB_A := $(RAYLIB_BUILD_DIR)/libraylib.a
|
||||
WIN64_ARCH := x86_64
|
||||
WIN64_CC ?= $(or $(WIN_CC),x86_64-w64-mingw32-gcc)
|
||||
WIN64_AR ?= $(or $(WIN_AR),x86_64-w64-mingw32-ar)
|
||||
WIN64_RANLIB ?= $(or $(WIN_RANLIB),x86_64-w64-mingw32-ranlib)
|
||||
WIN64_STRIP ?= $(or $(WIN_STRIP),x86_64-w64-mingw32-strip)
|
||||
WIN32_ARCH := i686
|
||||
WIN32_CC ?= i686-w64-mingw32-gcc
|
||||
WIN32_AR ?= i686-w64-mingw32-ar
|
||||
WIN32_RANLIB ?= i686-w64-mingw32-ranlib
|
||||
WIN32_STRIP ?= i686-w64-mingw32-strip
|
||||
WIN64_RAYLIB_BUILD_DIR := $(WINDOWS_OBJ_DIR)/$(WIN64_ARCH)/raylib
|
||||
WIN64_RAYLIB_A := $(WIN64_RAYLIB_BUILD_DIR)/libraylib.a
|
||||
WIN32_RAYLIB_BUILD_DIR := $(WINDOWS_OBJ_DIR)/$(WIN32_ARCH)/raylib
|
||||
WIN32_RAYLIB_A := $(WIN32_RAYLIB_BUILD_DIR)/libraylib.a
|
||||
WEB_RAYLIB_BUILD_DIR := $(WEB_OBJ_DIR)/raylib
|
||||
WEB_RAYLIB_A := $(WEB_RAYLIB_BUILD_DIR)/libraylib.web.a
|
||||
RAYLIB_SOURCES := $(wildcard $(RAYLIB_DIR)/*.c) $(wildcard $(RAYLIB_DIR)/*.h)
|
||||
@@ -32,6 +59,7 @@ FLINT_ICON_FILES := $(wildcard $(FLINT_DIR)/icons/*.png)
|
||||
FLINT_ICON_ASSETS_C := $(FLINT_DIR)/src/flint_icon_assets.c
|
||||
FLINT_SRCS := $(filter-out $(FLINT_ICON_ASSETS_C),$(wildcard $(FLINT_DIR)/src/*.c)) $(FLINT_ICON_ASSETS_C)
|
||||
FLINT_WEB_SRCS := $(filter-out $(FLINT_DIR)/src/flint_file_dialog.c,$(FLINT_SRCS))
|
||||
FLINT_WINDOWS_SRCS := $(filter-out $(FLINT_DIR)/src/flint_file_dialog.c,$(FLINT_SRCS))
|
||||
FLINT_INCLUDE := -I$(FLINT_DIR)/include
|
||||
FLINT_CURL_CFLAGS ?= $(shell pkg-config --cflags libcurl 2>/dev/null)
|
||||
FLINT_CURL_LDLIBS ?= $(shell pkg-config --libs libcurl 2>/dev/null)
|
||||
@@ -43,6 +71,7 @@ SQLITE_SRC := $(SQLITE_AMALGAMATION_C)
|
||||
SQLITE_INCLUDE := -I$(SQLITE_BUILD_DIR)
|
||||
TEST_BIN_DIR := $(BUILD_BIN_DIR)/tests
|
||||
STORAGE_IMPORT_TEST := $(TEST_BIN_DIR)/storage_import_test
|
||||
FLINT_TEXT_SCALING_TEST := $(TEST_BIN_DIR)/flint_text_scaling_test
|
||||
ifneq ($(strip $(FLINT_CURL_LDLIBS)),)
|
||||
FLINT_RUNTIME_ASSET_CFLAGS := -DFLINT_HAS_LIBCURL=1 $(FLINT_CURL_CFLAGS)
|
||||
FLINT_RUNTIME_ASSET_LDLIBS := $(FLINT_CURL_LDLIBS)
|
||||
@@ -53,40 +82,63 @@ endif
|
||||
|
||||
APP_SRCS := \
|
||||
src/main.c \
|
||||
src/inbe.c \
|
||||
src/app.c \
|
||||
src/app_preferences.c \
|
||||
src/app_session.c \
|
||||
src/habits/habits.c \
|
||||
src/meditation_music.c \
|
||||
src/locale.c \
|
||||
src/theme.c \
|
||||
src/data.c \
|
||||
src/storage.c \
|
||||
src/miniz.c \
|
||||
src/android/android_device.c \
|
||||
src/tabs/language_tab.c \
|
||||
src/tabs/manual_tab.c \
|
||||
src/tabs/settings_tab.c
|
||||
src/core/breath_engine.c \
|
||||
src/app/app.c \
|
||||
src/app/device_preferences.c \
|
||||
src/session/session.c \
|
||||
src/screens/habits_screen.c \
|
||||
src/session/meditation_music.c \
|
||||
src/core/locale.c \
|
||||
src/core/theme.c \
|
||||
src/storage/data.c \
|
||||
src/storage/storage.c \
|
||||
src/third_party/miniz.c \
|
||||
src/platform/android/android_device.c \
|
||||
src/screens/practice_screen.c \
|
||||
src/screens/language_screen.c \
|
||||
src/screens/manual_screen.c \
|
||||
src/screens/settings/settings_screen.c
|
||||
|
||||
LOCALE_FILES := $(wildcard locales/*.txt)
|
||||
IMAGE_FILES := assets/whm/1.jpg assets/whm/2.jpg
|
||||
SOUND_FILES := $(wildcard assets/sounds/*.ogg)
|
||||
FONT_OUTPUTS := assets/fonts/locales.png assets/fonts/locales.dat
|
||||
FONT_TOOL := vendor/otfchop/otfchop
|
||||
FONT_SOURCE := vendor/otfchop/unifont-17.0.04.otf
|
||||
FONT_OUTPUTS := assets/fonts/locales.png assets/fonts/locales.dat assets/fonts/locales-8.png assets/fonts/locales-8.dat
|
||||
OTFCHOP_DIR ?= vendor/otfchop
|
||||
FONT_TOOL := $(OTFCHOP_DIR)/otfchop
|
||||
FONT_SOURCE := $(OTFCHOP_DIR)/unifont-17.0.04.otf
|
||||
EMBEDDED_ASSETS_C := $(BUILD_OBJ_DIR)/$(APP_NAME)_embedded_assets.c
|
||||
EMBEDDED_ASSET_FILES := $(LOCALE_FILES) $(IMAGE_FILES) $(SOUND_FILES) $(FONT_OUTPUTS)
|
||||
SRC := $(APP_SRCS) $(EMBEDDED_ASSETS_C)
|
||||
|
||||
APP_INCLUDE := -Isrc -Isrc/android
|
||||
APP_INCLUDE := -Isrc -Isrc/app -Isrc/core -Isrc/screens -Isrc/screens/settings -Isrc/session -Isrc/storage -Isrc/platform/android -Isrc/third_party
|
||||
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
|
||||
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
|
||||
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 -lm
|
||||
ifneq ($(strip $(MCFGTHREADS)),)
|
||||
WIN64_THREAD_LDFLAGS := -L$(MCFGTHREADS)/lib
|
||||
else
|
||||
WIN64_THREAD_LDFLAGS :=
|
||||
endif
|
||||
ifneq ($(strip $(WIN32_MCFGTHREADS)),)
|
||||
WIN32_THREAD_LDFLAGS := -L$(WIN32_MCFGTHREADS)/lib
|
||||
else
|
||||
WIN32_THREAD_LDFLAGS :=
|
||||
endif
|
||||
|
||||
BINARY_NAME := $(APP_NAME)-linux-$(ARCH)
|
||||
TARGET := $(LINUX_BIN_DIR)/$(BINARY_NAME)
|
||||
WIN64_BINARY_NAME := $(APP_NAME)-windows-$(WIN64_ARCH).exe
|
||||
WIN64_TARGET := $(WINDOWS_BIN_DIR)/$(WIN64_ARCH)/$(WIN64_BINARY_NAME)
|
||||
WIN32_BINARY_NAME := $(APP_NAME)-windows-$(WIN32_ARCH).exe
|
||||
WIN32_TARGET := $(WINDOWS_BIN_DIR)/$(WIN32_ARCH)/$(WIN32_BINARY_NAME)
|
||||
WINDOWS_DIST := $(WINDOWS_DIST_DIR)/$(APP_NAME)-windows.zip
|
||||
APPIMAGE_NAME := $(APP_NAME)-linux-$(ARCH).AppImage
|
||||
APPIMAGE_TARGET := $(LINUX_DIST_DIR)/$(APPIMAGE_NAME)
|
||||
LINUXDEPLOY ?= linuxdeploy
|
||||
WEB_CC ?= emcc
|
||||
WEB_AR ?= emar
|
||||
WEB_CACHE_BUSTER ?= $(shell git rev-parse --short HEAD 2>/dev/null || date +%s)
|
||||
@@ -95,26 +147,61 @@ WEB_ASSET_FILES := $(shell find web-assets -type f 2>/dev/null)
|
||||
UNPACKAGED_AUDIO_DIR := unpackaged_assets/audio
|
||||
MEDITATION_AUDIO_ZIP := web-assets/dl/inbe-meditation-audio-v1.zip
|
||||
|
||||
.PHONY: all native run test clean clean-linux clean-raylib android-copy-assets android-debug android-release android-bundle android-install android-install-release android-clean package-unpackaged-assets windows web
|
||||
.PHONY: all native run test dist appimage clean clean-linux clean-raylib android-check-keystore android-copy-assets android-debug android-release android-bundle android-install android-install-release android-clean package-unpackaged-assets windows windows64 windows32 web
|
||||
.NOTPARALLEL: dist windows windows64 windows32 android-release android-bundle
|
||||
|
||||
all: native
|
||||
|
||||
native: $(TARGET)
|
||||
|
||||
dist:
|
||||
@password="$(PASSWORD)"; \
|
||||
if [ -z "$$password" ]; then \
|
||||
printf "Android release keystore password: "; \
|
||||
stty -echo; \
|
||||
read password; \
|
||||
stty echo; \
|
||||
printf "\n"; \
|
||||
fi; \
|
||||
if [ -z "$$password" ]; then \
|
||||
echo "Set PASSWORD=your-keystore-password for release builds"; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
$(MAKE) android-check-keystore PASSWORD="$$password" && \
|
||||
$(MAKE) package-unpackaged-assets && \
|
||||
$(MAKE) web && \
|
||||
$(MAKE) appimage && \
|
||||
$(MAKE) windows && \
|
||||
$(MAKE) android-release PASSWORD="$$password" && \
|
||||
$(MAKE) android-bundle PASSWORD="$$password"
|
||||
|
||||
appimage: $(APPIMAGE_TARGET)
|
||||
|
||||
run: $(TARGET)
|
||||
./$(TARGET)
|
||||
|
||||
test: $(STORAGE_IMPORT_TEST)
|
||||
test: $(STORAGE_IMPORT_TEST) $(FLINT_TEXT_SCALING_TEST)
|
||||
$(STORAGE_IMPORT_TEST)
|
||||
$(FLINT_TEXT_SCALING_TEST)
|
||||
|
||||
$(STORAGE_IMPORT_TEST): tests/storage_import_test.c src/storage.c src/storage.h src/habits/habits.c src/habits/habits.h src/miniz.c src/miniz.h $(SQLITE_SRC) $(SQLITE_AMALGAMATION_H) | $(TEST_BIN_DIR)
|
||||
$(CC) -Wall -Wextra -std=c99 -D_DEFAULT_SOURCE -D_GNU_SOURCE -DRINI_IMPLEMENTATION -DMINIZ_NO_ZLIB_COMPATIBLE_NAMES \
|
||||
-Isrc -Ivendor/raylib/src $(SQLITE_INCLUDE) \
|
||||
$(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)
|
||||
$(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/session -Isrc/storage -Isrc/platform/android -Isrc/third_party -Ivendor/raylib/src $(FLINT_INCLUDE) $(SQLITE_INCLUDE) \
|
||||
-o $@ \
|
||||
tests/storage_import_test.c src/storage.c src/habits/habits.c src/miniz.c $(SQLITE_SRC) \
|
||||
-lm -lpthread -ldl
|
||||
tests/storage_import_test.c src/storage/storage.c src/screens/habits_screen.c src/third_party/miniz.c $(SQLITE_SRC) \
|
||||
-Wl,--gc-sections -lm -lpthread -ldl
|
||||
|
||||
$(BUILD_OBJ_DIR) $(LINUX_BIN_DIR) $(LINUX_DIST_DIR) $(ANDROID_BUILD_DIR) $(TEST_BIN_DIR) $(WEB_OBJ_DIR) $(WEB_DIST_DIR):
|
||||
$(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)
|
||||
$(CC) -Wall -Wextra -std=c99 -ffunction-sections -fdata-sections \
|
||||
-Iflint/include -Ivendor/raylib/src \
|
||||
-o $@ \
|
||||
tests/flint_text_scaling_test.c flint/src/flint_text.c flint/src/flint_clip.c flint/src/flint_scaling.c \
|
||||
-Wl,--gc-sections -lm
|
||||
|
||||
$(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):
|
||||
mkdir -p $@
|
||||
|
||||
$(WINDOWS_BIN_DIR)/$(WIN64_ARCH) $(WINDOWS_BIN_DIR)/$(WIN32_ARCH):
|
||||
mkdir -p $@
|
||||
|
||||
assets/fonts:
|
||||
@@ -123,8 +210,11 @@ assets/fonts:
|
||||
$(FONT_TOOL): vendor/otfchop/otfchop.c vendor/otfchop/stb_truetype.h vendor/otfchop/stb_image_write.h
|
||||
$(MAKE) -C vendor/otfchop otfchop
|
||||
|
||||
$(FONT_OUTPUTS): $(LOCALE_FILES) $(FONT_TOOL) | assets/fonts
|
||||
$(FONT_TOOL) $(FONT_SOURCE) $(LOCALE_FILES) assets/fonts/locales
|
||||
assets/fonts/locales.png assets/fonts/locales.dat: $(LOCALE_FILES) $(FONT_TOOL) | assets/fonts
|
||||
$(FONT_TOOL) --size 16 $(FONT_SOURCE) $(LOCALE_FILES) assets/fonts/locales
|
||||
|
||||
assets/fonts/locales-8.png assets/fonts/locales-8.dat: $(LOCALE_FILES) $(FONT_TOOL) | assets/fonts
|
||||
$(FONT_TOOL) --size 8 $(FONT_SOURCE) $(LOCALE_FILES) assets/fonts/locales-8
|
||||
|
||||
$(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)
|
||||
@@ -161,6 +251,40 @@ $(WEB_RAYLIB_A): $(RAYLIB_SOURCES) | $(WEB_OBJ_DIR)
|
||||
AR="$(WEB_AR)" \
|
||||
CUSTOM_CFLAGS="$(APP_RAYLIB_CONFIG) -Os -ffunction-sections -fdata-sections"
|
||||
|
||||
$(WIN64_RAYLIB_A): $(RAYLIB_SOURCES)
|
||||
rm -rf $(WINDOWS_OBJ_DIR)/$(WIN64_ARCH)/raylib-src
|
||||
mkdir -p $(WINDOWS_OBJ_DIR)/$(WIN64_ARCH)/raylib-src $(WIN64_RAYLIB_BUILD_DIR)
|
||||
cp -R $(RAYLIB_DIR)/. $(WINDOWS_OBJ_DIR)/$(WIN64_ARCH)/raylib-src/
|
||||
$(MAKE) -j1 -C $(WINDOWS_OBJ_DIR)/$(WIN64_ARCH)/raylib-src \
|
||||
OS=Windows_NT \
|
||||
PLATFORM=PLATFORM_DESKTOP_RGFW \
|
||||
GRAPHICS=GRAPHICS_API_OPENGL_11 \
|
||||
RAYLIB_LIBTYPE=STATIC \
|
||||
RAYLIB_RELEASE_PATH=../raylib \
|
||||
RAYLIB_MODULE_AUDIO=TRUE \
|
||||
RAYLIB_MODULE_MODELS=FALSE \
|
||||
CC="$(WIN64_CC)" \
|
||||
AR="$(WIN64_AR)" \
|
||||
RANLIB="$(WIN64_RANLIB)" \
|
||||
CUSTOM_CFLAGS="$(APP_RAYLIB_CONFIG) -Os -ffunction-sections -fdata-sections"
|
||||
|
||||
$(WIN32_RAYLIB_A): $(RAYLIB_SOURCES)
|
||||
rm -rf $(WINDOWS_OBJ_DIR)/$(WIN32_ARCH)/raylib-src
|
||||
mkdir -p $(WINDOWS_OBJ_DIR)/$(WIN32_ARCH)/raylib-src $(WIN32_RAYLIB_BUILD_DIR)
|
||||
cp -R $(RAYLIB_DIR)/. $(WINDOWS_OBJ_DIR)/$(WIN32_ARCH)/raylib-src/
|
||||
$(MAKE) -j1 -C $(WINDOWS_OBJ_DIR)/$(WIN32_ARCH)/raylib-src \
|
||||
OS=Windows_NT \
|
||||
PLATFORM=PLATFORM_DESKTOP_RGFW \
|
||||
GRAPHICS=GRAPHICS_API_OPENGL_11 \
|
||||
RAYLIB_LIBTYPE=STATIC \
|
||||
RAYLIB_RELEASE_PATH=../raylib \
|
||||
RAYLIB_MODULE_AUDIO=TRUE \
|
||||
RAYLIB_MODULE_MODELS=FALSE \
|
||||
CC="$(WIN32_CC)" \
|
||||
AR="$(WIN32_AR)" \
|
||||
RANLIB="$(WIN32_RANLIB)" \
|
||||
CUSTOM_CFLAGS="$(APP_RAYLIB_CONFIG) -Os -ffunction-sections -fdata-sections"
|
||||
|
||||
$(SQLITE_AMALGAMATION_C) $(SQLITE_AMALGAMATION_H): $(SQLITE_DIR)/configure $(SQLITE_DIR)/manifest | $(BUILD_OBJ_DIR)
|
||||
mkdir -p $(SQLITE_BUILD_DIR)
|
||||
cd $(SQLITE_BUILD_DIR) && ../../../$(SQLITE_DIR)/configure
|
||||
@@ -186,6 +310,68 @@ $(TARGET): Makefile $(SRC) $(FLINT_SRCS) $(SQLITE_SRC) $(SQLITE_AMALGAMATION_H)
|
||||
-lm -lpthread -ldl -lrt \
|
||||
$(LDFLAGS)
|
||||
|
||||
$(WIN64_TARGET): Makefile $(SRC) $(FLINT_WINDOWS_SRCS) $(SQLITE_SRC) $(SQLITE_AMALGAMATION_H) $(FONT_OUTPUTS) $(EMBEDDED_ASSETS_C) $(WIN64_RAYLIB_A) | $(WINDOWS_BIN_DIR)/$(WIN64_ARCH)
|
||||
$(WIN64_CC) $(WINDOWS_CFLAGS) \
|
||||
$(APP_INCLUDE) \
|
||||
$(FLINT_INCLUDE) \
|
||||
$(SQLITE_INCLUDE) \
|
||||
-I$(RAYLIB_DIR) \
|
||||
-DPLATFORM_DESKTOP \
|
||||
-o $@ \
|
||||
$(SRC) \
|
||||
$(FLINT_WINDOWS_SRCS) \
|
||||
$(SQLITE_SRC) \
|
||||
$(WIN64_RAYLIB_A) \
|
||||
$(WINDOWS_LDLIBS) \
|
||||
$(WIN64_THREAD_LDFLAGS) \
|
||||
$(WINDOWS_LDFLAGS)
|
||||
$(WIN64_STRIP) $@
|
||||
|
||||
$(WIN32_TARGET): Makefile $(SRC) $(FLINT_WINDOWS_SRCS) $(SQLITE_SRC) $(SQLITE_AMALGAMATION_H) $(FONT_OUTPUTS) $(EMBEDDED_ASSETS_C) $(WIN32_RAYLIB_A) | $(WINDOWS_BIN_DIR)/$(WIN32_ARCH)
|
||||
$(WIN32_CC) $(WINDOWS_CFLAGS) \
|
||||
$(APP_INCLUDE) \
|
||||
$(FLINT_INCLUDE) \
|
||||
$(SQLITE_INCLUDE) \
|
||||
-I$(RAYLIB_DIR) \
|
||||
-DPLATFORM_DESKTOP \
|
||||
-o $@ \
|
||||
$(SRC) \
|
||||
$(FLINT_WINDOWS_SRCS) \
|
||||
$(SQLITE_SRC) \
|
||||
$(WIN32_RAYLIB_A) \
|
||||
$(WINDOWS_LDLIBS) \
|
||||
$(WIN32_THREAD_LDFLAGS) \
|
||||
$(WINDOWS_LDFLAGS)
|
||||
$(WIN32_STRIP) $@
|
||||
|
||||
$(APPIMAGE_TARGET): $(TARGET) $(LINUX_APPIMAGE_APPRUN) $(LINUX_APPIMAGE_DESKTOP) $(LINUX_APPIMAGE_ICON) | $(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; \
|
||||
}
|
||||
@command -v appimagetool >/dev/null || { \
|
||||
echo "appimagetool is missing. Re-enter the flake shell with: nix develop"; \
|
||||
exit 1; \
|
||||
}
|
||||
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
|
||||
cp $(TARGET) $(LINUX_APPDIR)/usr/bin/$(APP_NAME)
|
||||
cp $(LINUX_APPIMAGE_APPRUN) $(LINUX_APPDIR)/AppRun
|
||||
chmod +x $(LINUX_APPDIR)/AppRun
|
||||
cp $(LINUX_APPIMAGE_DESKTOP) $(LINUX_APPDIR)/$(APP_NAME).desktop
|
||||
cp $(LINUX_APPIMAGE_DESKTOP) $(LINUX_APPDIR)/usr/share/applications/$(APP_NAME).desktop
|
||||
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) \
|
||||
--appdir $(APP_NAME).AppDir \
|
||||
--executable $(abspath $(LINUX_APPDIR)/usr/bin/$(APP_NAME)) \
|
||||
--desktop-file $(abspath $(LINUX_APPIMAGE_DESKTOP)) \
|
||||
--icon-file $(abspath $(LINUX_APPDIR)/usr/share/icons/hicolor/512x512/apps/$(APP_NAME).png) \
|
||||
--output appimage
|
||||
test -f $@
|
||||
|
||||
$(WEB_TARGET): Makefile $(SRC) $(FLINT_WEB_SRCS) $(SQLITE_SRC) $(SQLITE_AMALGAMATION_H) $(FONT_OUTPUTS) $(EMBEDDED_ASSETS_C) $(WEB_RAYLIB_A) src/web_shell.html manifest.json $(WEB_ASSET_FILES) | $(WEB_DIST_DIR)
|
||||
$(WEB_CC) $(WEB_CFLAGS) \
|
||||
$(APP_INCLUDE) \
|
||||
@@ -219,22 +405,46 @@ android-copy-assets:
|
||||
rm -rf droid/app/src/main/assets
|
||||
mkdir -p droid/app/src/main/assets
|
||||
|
||||
android-check-keystore:
|
||||
@if [ -z "$(PASSWORD)" ]; then \
|
||||
echo "Set PASSWORD=your-keystore-password for release builds"; \
|
||||
exit 1; \
|
||||
fi
|
||||
@if [ ! -f "$(ANDROID_KEYSTORE)" ]; then \
|
||||
echo "Android release keystore not found: $(ANDROID_KEYSTORE)"; \
|
||||
exit 1; \
|
||||
fi
|
||||
@command -v keytool >/dev/null || { \
|
||||
echo "keytool is missing. Re-enter the Android/JDK build environment."; \
|
||||
exit 1; \
|
||||
}
|
||||
@if ! keytool -list -keystore "$(ANDROID_KEYSTORE)" -storepass "$(PASSWORD)" -alias "$(ANDROID_KEY_ALIAS)" >/dev/null 2>&1; then \
|
||||
echo "Android release keystore password or alias is invalid"; \
|
||||
echo "Checked keystore: $(ANDROID_KEYSTORE)"; \
|
||||
echo "Checked alias: $(ANDROID_KEY_ALIAS)"; \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
android-debug: android-copy-assets
|
||||
unset ANDROID_HOME; $(GRADLE) -p droid assembleDebug
|
||||
$(MAKE) android-copy-debug-apks
|
||||
|
||||
android-release: android-copy-assets
|
||||
android-release:
|
||||
$(MAKE) android-check-keystore PASSWORD="$(PASSWORD)"
|
||||
$(MAKE) android-copy-assets
|
||||
@if [ -n "$(PASSWORD)" ]; then \
|
||||
unset ANDROID_HOME; $(GRADLE) -p droid assembleRelease -Pkeystore.password="$(PASSWORD)" || exit $$?; \
|
||||
unset ANDROID_HOME; $(GRADLE) -p droid assembleRelease -Pkeystore.path="$(ANDROID_KEYSTORE)" -Pkeystore.alias="$(ANDROID_KEY_ALIAS)" -Pkeystore.password="$(PASSWORD)" || exit $$?; \
|
||||
else \
|
||||
echo "Set PASSWORD=your-keystore-password for release builds"; \
|
||||
exit 1; \
|
||||
fi
|
||||
$(MAKE) android-copy-release-apks
|
||||
|
||||
android-bundle: android-copy-assets
|
||||
android-bundle:
|
||||
$(MAKE) android-check-keystore PASSWORD="$(PASSWORD)"
|
||||
$(MAKE) android-copy-assets
|
||||
@if [ -n "$(PASSWORD)" ]; then \
|
||||
unset ANDROID_HOME; $(GRADLE) -p droid bundleRelease -Pkeystore.password="$(PASSWORD)" || exit $$?; \
|
||||
unset ANDROID_HOME; $(GRADLE) -p droid bundleRelease -Pkeystore.path="$(ANDROID_KEYSTORE)" -Pkeystore.alias="$(ANDROID_KEY_ALIAS)" -Pkeystore.password="$(PASSWORD)" || exit $$?; \
|
||||
else \
|
||||
echo "Set PASSWORD=your-keystore-password for bundle builds"; \
|
||||
exit 1; \
|
||||
@@ -242,19 +452,55 @@ android-bundle: android-copy-assets
|
||||
$(MAKE) android-copy-bundle
|
||||
|
||||
android-copy-debug-apks: | $(ANDROID_BUILD_DIR)
|
||||
@for apk in droid/app/build/outputs/apk/debug/*.apk; do \
|
||||
if [ -f "$$apk" ]; then cp "$$apk" "$(ANDROID_BUILD_DIR)/$$(basename "$$apk")"; fi; \
|
||||
done
|
||||
@found=0; \
|
||||
for apk in droid/app/build/outputs/apk/debug/*.apk; do \
|
||||
if [ -f "$$apk" ]; then \
|
||||
cp "$$apk" "$(ANDROID_BUILD_DIR)/$$(basename "$$apk")"; \
|
||||
found=1; \
|
||||
fi; \
|
||||
done; \
|
||||
if [ "$$found" -eq 0 ]; then \
|
||||
echo "No debug APKs were produced"; \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
android-copy-release-apks: | $(ANDROID_BUILD_DIR)
|
||||
@for apk in droid/app/build/outputs/apk/release/*.apk; do \
|
||||
if [ -f "$$apk" ]; then cp "$$apk" "$(ANDROID_BUILD_DIR)/$$(basename "$$apk")"; fi; \
|
||||
done
|
||||
@found=0; \
|
||||
for apk in droid/app/build/outputs/apk/release/*.apk; do \
|
||||
if [ -f "$$apk" ]; then \
|
||||
cp "$$apk" "$(ANDROID_BUILD_DIR)/$$(basename "$$apk")"; \
|
||||
found=1; \
|
||||
fi; \
|
||||
done; \
|
||||
if [ "$$found" -eq 0 ]; then \
|
||||
echo "No release APKs were produced"; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
if [ -z "$(APP_VERSION)" ]; then \
|
||||
echo "Could not read INBE_VERSION_STRING from $(VERSION_FILE)"; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
universal="$$(find droid/app/build/outputs/apk/release -maxdepth 1 -name '*universal*release*.apk' | head -n 1)"; \
|
||||
if [ -z "$$universal" ]; then universal="$$(find droid/app/build/outputs/apk/release -maxdepth 1 -name '*release*.apk' | head -n 1)"; fi; \
|
||||
if [ -z "$$universal" ]; then \
|
||||
echo "No release APK was available for versioned copy"; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
cp "$$universal" "$(ANDROID_BUILD_DIR)/$(APP_NAME)-$(APP_VERSION).apk"; \
|
||||
cp "$$universal" "$(ANDROID_BUILD_DIR)/$(APP_NAME)-latest.apk"
|
||||
|
||||
android-copy-bundle: | $(ANDROID_BUILD_DIR)
|
||||
@for bundle in droid/app/build/outputs/bundle/release/*.aab; do \
|
||||
if [ -f "$$bundle" ]; then cp "$$bundle" "$(ANDROID_BUILD_DIR)/$$(basename "$$bundle")"; fi; \
|
||||
done
|
||||
@found=0; \
|
||||
for bundle in droid/app/build/outputs/bundle/release/*.aab; do \
|
||||
if [ -f "$$bundle" ]; then \
|
||||
cp "$$bundle" "$(ANDROID_BUILD_DIR)/$$(basename "$$bundle")"; \
|
||||
found=1; \
|
||||
fi; \
|
||||
done; \
|
||||
if [ "$$found" -eq 0 ]; then \
|
||||
echo "No release AAB was produced"; \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
android-install: android-debug
|
||||
@ABI=$$(adb shell getprop ro.product.cpu.abi | tr -d '\r'); \
|
||||
@@ -279,9 +525,19 @@ package-unpackaged-assets:
|
||||
rm -f $(MEDITATION_AUDIO_ZIP)
|
||||
cd $(UNPACKAGED_AUDIO_DIR) && find . -mindepth 2 -type f -name '*.ogg' -exec zip -9 -r $(abspath $(MEDITATION_AUDIO_ZIP)) {} + && zip -9 -r $(abspath $(MEDITATION_AUDIO_ZIP)) LICENSE.md MANIFEST.txt
|
||||
|
||||
windows64: $(WIN64_TARGET)
|
||||
|
||||
windows32: $(WIN32_TARGET)
|
||||
|
||||
windows:
|
||||
@echo "Windows packaging was removed with the Flint CLI layer. Add a focused script when it is needed."
|
||||
@exit 1
|
||||
$(MAKE) windows64
|
||||
$(MAKE) windows32
|
||||
mkdir -p $(WINDOWS_DIST_DIR)
|
||||
rm -f $(WINDOWS_DIST_DIR)/$(APP_NAME)-windows-*.zip
|
||||
rm -f $(WINDOWS_DIST)
|
||||
cd $(WINDOWS_BIN_DIR) && zip -9 -j $(abspath $(WINDOWS_DIST)) \
|
||||
$(WIN64_ARCH)/$(WIN64_BINARY_NAME) \
|
||||
$(WIN32_ARCH)/$(WIN32_BINARY_NAME)
|
||||
|
||||
web:
|
||||
$(MAKE) $(WEB_TARGET)
|
||||
@@ -295,7 +551,7 @@ clean-linux:
|
||||
clean-raylib:
|
||||
rm -rf $(RAYLIB_BUILD_DIR) $(LINUX_OBJ_DIR)/*/native/raylib-src vendor/raylib/build
|
||||
|
||||
NEEDS_NATIVE_ENV := $(if $(MAKECMDGOALS),$(filter all native run,$(MAKECMDGOALS)),native)
|
||||
NEEDS_NATIVE_ENV := $(if $(MAKECMDGOALS),$(filter all native run dist appimage,$(MAKECMDGOALS)),native)
|
||||
ifneq ($(strip $(NEEDS_NATIVE_ENV)),)
|
||||
ifeq ($(strip $(RAY_CFLAGS)),)
|
||||
$(error RAY_CFLAGS is not set. Enter the ray flake shell with 'nix develop')
|
||||
|
||||
|
After Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 72 KiB |
@@ -18,8 +18,8 @@ android {
|
||||
keystoreProps.load(new FileInputStream(keystorePropsFile))
|
||||
}
|
||||
|
||||
def getKeystorePath = { -> keystoreProps['keystore.path'] ?: System.getenv("HOME") + "/.android/inbe-release.keystore" }
|
||||
def getKeystoreAlias = { -> keystoreProps['keystore.alias'] ?: "inbe-key" }
|
||||
def getKeystorePath = { -> project.findProperty('keystore.path') ?: keystoreProps['keystore.path'] ?: System.getenv("HOME") + "/.android/flint-release.keystore" }
|
||||
def getKeystoreAlias = { -> project.findProperty('keystore.alias') ?: keystoreProps['keystore.alias'] ?: "inbe-key" }
|
||||
|
||||
def releasePassword = project.findProperty('keystore.password') ?: ""
|
||||
|
||||
@@ -35,8 +35,8 @@ android {
|
||||
defaultConfig {
|
||||
minSdk 19
|
||||
targetSdk 35
|
||||
versionCode 28
|
||||
versionName "1.3.0"
|
||||
versionCode 29
|
||||
versionName "1.3.1"
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||
<application
|
||||
android:hasCode="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
|
||||
@@ -20,6 +20,8 @@ set(INBE_EMBEDDED_INPUTS
|
||||
assets/whm/2.jpg
|
||||
assets/fonts/locales.png
|
||||
assets/fonts/locales.dat
|
||||
assets/fonts/locales-8.png
|
||||
assets/fonts/locales-8.dat
|
||||
${INBE_SOUND_ASSETS}
|
||||
)
|
||||
set(INBE_EMBEDDED_DEPS)
|
||||
@@ -84,36 +86,44 @@ target_include_directories(raylib PUBLIC
|
||||
|
||||
add_library(main SHARED
|
||||
"${SRC_DIR}/main.c"
|
||||
"${SRC_DIR}/inbe.c"
|
||||
"${SRC_DIR}/app.c"
|
||||
"${SRC_DIR}/app_preferences.c"
|
||||
"${SRC_DIR}/app_session.c"
|
||||
"${SRC_DIR}/habits/habits.c"
|
||||
"${SRC_DIR}/meditation_music.c"
|
||||
"${SRC_DIR}/locale.c"
|
||||
"${SRC_DIR}/theme.c"
|
||||
"${SRC_DIR}/data.c"
|
||||
"${SRC_DIR}/storage.c"
|
||||
"${SRC_DIR}/miniz.c"
|
||||
"${SRC_DIR}/core/breath_engine.c"
|
||||
"${SRC_DIR}/app/app.c"
|
||||
"${SRC_DIR}/app/device_preferences.c"
|
||||
"${SRC_DIR}/session/session.c"
|
||||
"${SRC_DIR}/screens/habits_screen.c"
|
||||
"${SRC_DIR}/session/meditation_music.c"
|
||||
"${SRC_DIR}/core/locale.c"
|
||||
"${SRC_DIR}/core/theme.c"
|
||||
"${SRC_DIR}/storage/data.c"
|
||||
"${SRC_DIR}/storage/storage.c"
|
||||
"${SRC_DIR}/third_party/miniz.c"
|
||||
"${SQLITE_AMALGAMATION_C}"
|
||||
"${SRC_DIR}/android/android_device.c"
|
||||
"${SRC_DIR}/android/android_import.c"
|
||||
"${SRC_DIR}/android/android_runtime_assets.c"
|
||||
"${SRC_DIR}/android/android_share.c"
|
||||
"${SRC_DIR}/tabs/language_tab.c"
|
||||
"${SRC_DIR}/tabs/manual_tab.c"
|
||||
"${SRC_DIR}/tabs/settings_tab.c"
|
||||
"${SRC_DIR}/platform/android/android_device.c"
|
||||
"${SRC_DIR}/platform/android/android_import.c"
|
||||
"${SRC_DIR}/platform/android/android_runtime_assets.c"
|
||||
"${SRC_DIR}/platform/android/android_share.c"
|
||||
"${SRC_DIR}/screens/practice_screen.c"
|
||||
"${SRC_DIR}/screens/language_screen.c"
|
||||
"${SRC_DIR}/screens/manual_screen.c"
|
||||
"${SRC_DIR}/screens/settings/settings_screen.c"
|
||||
"${INBE_EMBEDDED_ASSETS_C}"
|
||||
${FLINT_SOURCES}
|
||||
"${SRC_DIR}/android/android_insets.c"
|
||||
"${SRC_DIR}/android/android_wakelock.c"
|
||||
"${SRC_DIR}/android/android_timer.c"
|
||||
"${SRC_DIR}/platform/android/android_insets.c"
|
||||
"${SRC_DIR}/platform/android/android_wakelock.c"
|
||||
"${SRC_DIR}/platform/android/android_timer.c"
|
||||
"${NATIVE_APP_GLUE_DIR}/android_native_app_glue.c"
|
||||
)
|
||||
|
||||
target_include_directories(main PRIVATE
|
||||
"${SRC_DIR}"
|
||||
"${SRC_DIR}/android"
|
||||
"${SRC_DIR}/app"
|
||||
"${SRC_DIR}/core"
|
||||
"${SRC_DIR}/screens"
|
||||
"${SRC_DIR}/screens/settings"
|
||||
"${SRC_DIR}/session"
|
||||
"${SRC_DIR}/storage"
|
||||
"${SRC_DIR}/platform/android"
|
||||
"${SRC_DIR}/third_party"
|
||||
"${NATIVE_APP_GLUE_DIR}"
|
||||
"${FLINT_DIR}/include"
|
||||
"${SQLITE_BUILD_DIR}"
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
package xyz.waozi.inbe;
|
||||
|
||||
import android.Manifest;
|
||||
import android.app.Notification;
|
||||
import android.app.NotificationChannel;
|
||||
import android.app.NotificationManager;
|
||||
import android.app.NativeActivity;
|
||||
import android.content.pm.ActivityInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Configuration;
|
||||
@@ -12,10 +17,12 @@ import android.os.Bundle;
|
||||
import android.os.PowerManager;
|
||||
import android.util.Log;
|
||||
import android.view.DisplayCutout;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewTreeObserver;
|
||||
import android.view.WindowInsets;
|
||||
import android.view.WindowManager;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.InputStream;
|
||||
@@ -25,6 +32,9 @@ import java.net.URL;
|
||||
public class MainActivity extends NativeActivity {
|
||||
private static final String TAG = "InbeMainActivity";
|
||||
private static final int REQUEST_IMPORT_ZIP = 1001;
|
||||
private static final int REQUEST_POST_NOTIFICATIONS = 1002;
|
||||
private static final String DOWNLOAD_CHANNEL_ID = "runtime_downloads";
|
||||
private static final int DOWNLOAD_NOTIFICATION_ID = 2001;
|
||||
|
||||
static {
|
||||
System.loadLibrary("main");
|
||||
@@ -51,7 +61,114 @@ public class MainActivity extends NativeActivity {
|
||||
private native void nativeImportSelectedFile(String path);
|
||||
private native void nativeImportCancelled();
|
||||
private native void nativeRuntimeAssetDownloadSucceeded(long handle, long bytes, int httpStatus);
|
||||
private native void nativeRuntimeAssetDownloadProgress(long handle, long bytes, long totalBytes);
|
||||
private native void nativeRuntimeAssetDownloadFailed(long handle, int httpStatus, String error);
|
||||
private native void nativeTextInputCommit(int codepoint);
|
||||
private native void nativeTextInputBackspace();
|
||||
private native void nativeTextInputEnter();
|
||||
|
||||
private void requestDownloadNotificationPermissionIfNeeded() {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU &&
|
||||
checkSelfPermission(Manifest.permission.POST_NOTIFICATIONS) != PackageManager.PERMISSION_GRANTED) {
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU &&
|
||||
checkSelfPermission(Manifest.permission.POST_NOTIFICATIONS) != PackageManager.PERMISSION_GRANTED) {
|
||||
requestPermissions(new String[] { Manifest.permission.POST_NOTIFICATIONS },
|
||||
REQUEST_POST_NOTIFICATIONS);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private NotificationManager getDownloadNotificationManager() {
|
||||
requestDownloadNotificationPermissionIfNeeded();
|
||||
NotificationManager manager = (NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
if (manager != null && Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
NotificationChannel channel = new NotificationChannel(
|
||||
DOWNLOAD_CHANNEL_ID,
|
||||
"Downloads",
|
||||
NotificationManager.IMPORTANCE_LOW
|
||||
);
|
||||
manager.createNotificationChannel(channel);
|
||||
}
|
||||
return manager;
|
||||
}
|
||||
|
||||
private void showDownloadNotification(NotificationManager manager, long written, long total) {
|
||||
if (manager == null) return;
|
||||
|
||||
Notification.Builder builder = Build.VERSION.SDK_INT >= Build.VERSION_CODES.O
|
||||
? new Notification.Builder(this, DOWNLOAD_CHANNEL_ID)
|
||||
: new Notification.Builder(this);
|
||||
builder.setSmallIcon(android.R.drawable.stat_sys_download)
|
||||
.setContentTitle("Downloading audio")
|
||||
.setOngoing(true)
|
||||
.setOnlyAlertOnce(true);
|
||||
if (total > 0) {
|
||||
int progress = (int)Math.max(0, Math.min(100, (written * 100) / total));
|
||||
builder.setProgress(100, progress, false)
|
||||
.setContentText(progress + "%");
|
||||
} else {
|
||||
builder.setProgress(0, 0, true);
|
||||
}
|
||||
manager.notify(DOWNLOAD_NOTIFICATION_ID, builder.build());
|
||||
}
|
||||
|
||||
private void clearDownloadNotification(NotificationManager manager) {
|
||||
if (manager != null) {
|
||||
manager.cancel(DOWNLOAD_NOTIFICATION_ID);
|
||||
}
|
||||
}
|
||||
|
||||
public void setSoftKeyboardVisible(final boolean visible) {
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
View view = getWindow() != null ? getWindow().getDecorView() : null;
|
||||
if (imm == null || view == null) return;
|
||||
|
||||
if (visible) {
|
||||
view.requestFocus();
|
||||
imm.showSoftInput(view, InputMethodManager.SHOW_FORCED);
|
||||
} else {
|
||||
imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean dispatchKeyEvent(KeyEvent event) {
|
||||
if (event != null && event.getAction() == KeyEvent.ACTION_DOWN) {
|
||||
int keyCode = event.getKeyCode();
|
||||
if (keyCode == KeyEvent.KEYCODE_DEL) {
|
||||
nativeTextInputBackspace();
|
||||
} else if (keyCode == KeyEvent.KEYCODE_ENTER ||
|
||||
keyCode == KeyEvent.KEYCODE_NUMPAD_ENTER) {
|
||||
nativeTextInputEnter();
|
||||
} else {
|
||||
int unicode = event.getUnicodeChar();
|
||||
if (unicode >= 32) {
|
||||
nativeTextInputCommit(unicode);
|
||||
}
|
||||
}
|
||||
} else if (event != null && event.getAction() == KeyEvent.ACTION_MULTIPLE &&
|
||||
event.getCharacters() != null) {
|
||||
String chars = event.getCharacters();
|
||||
for (int i = 0; i < chars.length();) {
|
||||
int codepoint = chars.codePointAt(i);
|
||||
if (codepoint >= 32) {
|
||||
nativeTextInputCommit(codepoint);
|
||||
}
|
||||
i += Character.charCount(codepoint);
|
||||
}
|
||||
}
|
||||
return super.dispatchKeyEvent(event);
|
||||
}
|
||||
|
||||
public void applyOrientationMode(final int mode) {
|
||||
runOnUiThread(new Runnable() {
|
||||
@@ -60,10 +177,10 @@ public class MainActivity extends NativeActivity {
|
||||
int requested = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
|
||||
switch (mode) {
|
||||
case 1:
|
||||
requested = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;
|
||||
requested = ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT;
|
||||
break;
|
||||
case 2:
|
||||
requested = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
|
||||
requested = ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE;
|
||||
break;
|
||||
case 3:
|
||||
requested = ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR;
|
||||
@@ -86,8 +203,11 @@ public class MainActivity extends NativeActivity {
|
||||
HttpURLConnection connection = null;
|
||||
int status = 0;
|
||||
long written = 0;
|
||||
long total = 0;
|
||||
long lastNotify = 0;
|
||||
File outputFile = new File(path);
|
||||
File parent = outputFile.getParentFile();
|
||||
NotificationManager notificationManager = getDownloadNotificationManager();
|
||||
|
||||
try {
|
||||
if (parent != null && !parent.exists() && !parent.mkdirs()) {
|
||||
@@ -108,6 +228,10 @@ public class MainActivity extends NativeActivity {
|
||||
return;
|
||||
}
|
||||
|
||||
total = connection.getContentLengthLong();
|
||||
nativeRuntimeAssetDownloadProgress(handle, written, total);
|
||||
showDownloadNotification(notificationManager, written, total);
|
||||
|
||||
try (InputStream input = connection.getInputStream();
|
||||
FileOutputStream output = new FileOutputStream(outputFile)) {
|
||||
byte[] buffer = new byte[32768];
|
||||
@@ -115,6 +239,12 @@ public class MainActivity extends NativeActivity {
|
||||
while ((read = input.read(buffer)) != -1) {
|
||||
output.write(buffer, 0, read);
|
||||
written += read;
|
||||
nativeRuntimeAssetDownloadProgress(handle, written, total);
|
||||
long now = android.os.SystemClock.uptimeMillis();
|
||||
if (now - lastNotify > 250 || (total > 0 && written >= total)) {
|
||||
showDownloadNotification(notificationManager, written, total);
|
||||
lastNotify = now;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,6 +253,7 @@ public class MainActivity extends NativeActivity {
|
||||
outputFile.delete();
|
||||
nativeRuntimeAssetDownloadFailed(handle, status, e.getMessage());
|
||||
} finally {
|
||||
clearDownloadNotification(notificationManager);
|
||||
if (connection != null) {
|
||||
connection.disconnect();
|
||||
}
|
||||
@@ -141,9 +272,9 @@ public class MainActivity extends NativeActivity {
|
||||
intent.setType("*/*");
|
||||
intent.putExtra(Intent.EXTRA_MIME_TYPES, new String[] {
|
||||
"application/zip",
|
||||
"application/octet-stream",
|
||||
"application/x-zip-compressed",
|
||||
"application/vnd.sqlite3",
|
||||
"application/x-sqlite",
|
||||
"application/x-sqlite3"
|
||||
});
|
||||
startActivityForResult(intent, REQUEST_IMPORT_ZIP);
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
### Fixed
|
||||
- Fixed Android orientation changes so forced landscape and portrait resize the app viewport correctly.
|
||||
@@ -16,9 +16,26 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs-sdl2": {
|
||||
"locked": {
|
||||
"lastModified": 1751274312,
|
||||
"narHash": "sha256-/bVBlRpECLVzjV19t5KMdMFWSwKLtb5RyXdjz3LJT+g=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "50ab793786d9de88ee30ec4e4c24fb4236fc2674",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-24.11",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs"
|
||||
"nixpkgs": "nixpkgs",
|
||||
"nixpkgs-sdl2": "nixpkgs-sdl2"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -3,9 +3,10 @@
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
nixpkgs-sdl2.url = "github:NixOS/nixpkgs/nixos-24.11";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs }:
|
||||
outputs = { self, nixpkgs, nixpkgs-sdl2 }:
|
||||
let
|
||||
systems = [
|
||||
"x86_64-linux"
|
||||
@@ -26,6 +27,13 @@
|
||||
mkShell = system:
|
||||
let
|
||||
pkgs = mkPkgs system;
|
||||
sdl2Pkgs = import nixpkgs-sdl2 {
|
||||
inherit system;
|
||||
config = {
|
||||
allowUnfree = true;
|
||||
allowUnsupportedSystem = true;
|
||||
};
|
||||
};
|
||||
aarch64Pkgs = pkgs.pkgsCross.aarch64-multiplatform;
|
||||
|
||||
windowsCrossEnabled = system == "x86_64-linux";
|
||||
@@ -68,7 +76,7 @@
|
||||
ndkPath = "${sdk}/libexec/android-sdk/ndk-bundle";
|
||||
|
||||
pkgConfigPath = pkgs.lib.makeSearchPath "lib/pkgconfig" [
|
||||
pkgs.SDL2.dev
|
||||
sdl2Pkgs.SDL2.dev
|
||||
pkgs.curl.dev
|
||||
pkgs.libdrm.dev
|
||||
pkgs.libgbm
|
||||
@@ -91,6 +99,66 @@
|
||||
mcfgthreads32
|
||||
];
|
||||
|
||||
linuxdeployPluginAppImage = pkgs.stdenvNoCC.mkDerivation {
|
||||
pname = "linuxdeploy-plugin-appimage";
|
||||
version = "1-alpha-20250213-1";
|
||||
|
||||
src = pkgs.fetchurl {
|
||||
url = "https://github.com/linuxdeploy/linuxdeploy-plugin-appimage/releases/download/1-alpha-20250213-1/linuxdeploy-plugin-appimage-x86_64.AppImage";
|
||||
hash = "sha256-mS1QKiSOFKsYVEjd9vbn0lVYy4TUYjw1TDrzUMJfzLM=";
|
||||
};
|
||||
|
||||
dontUnpack = true;
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
cp "$src" linuxdeploy-plugin-appimage.AppImage
|
||||
chmod +x linuxdeploy-plugin-appimage.AppImage
|
||||
./linuxdeploy-plugin-appimage.AppImage --appimage-extract >/dev/null
|
||||
|
||||
mkdir -p "$out/bin"
|
||||
cp squashfs-root/AppRun "$out/bin/linuxdeploy-plugin-appimage"
|
||||
chmod +x "$out/bin/linuxdeploy-plugin-appimage"
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
};
|
||||
|
||||
appimagetool = pkgs.stdenvNoCC.mkDerivation {
|
||||
pname = "appimagetool";
|
||||
version = "continuous";
|
||||
|
||||
src = pkgs.fetchurl {
|
||||
url = "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage";
|
||||
hash = "sha256-uQ9KixiWdUX9p4pEWydoChZC8e+UiM7Si2U5jyvnrdI=";
|
||||
};
|
||||
|
||||
extracted = pkgs.appimageTools.extract {
|
||||
pname = "appimagetool";
|
||||
version = "continuous";
|
||||
src = pkgs.fetchurl {
|
||||
url = "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage";
|
||||
hash = "sha256-uQ9KixiWdUX9p4pEWydoChZC8e+UiM7Si2U5jyvnrdI=";
|
||||
};
|
||||
};
|
||||
|
||||
dontUnpack = true;
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p "$out/bin"
|
||||
cat > "$out/bin/appimagetool" <<EOF
|
||||
#!${pkgs.runtimeShell}
|
||||
exec "$extracted/AppRun" "\$@"
|
||||
EOF
|
||||
chmod +x "$out/bin/appimagetool"
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
};
|
||||
|
||||
windowsProfile = pkgs.lib.optionalString windowsCrossEnabled ''
|
||||
export WIN_CC="x86_64-w64-mingw32-gcc"
|
||||
export WIN_CXX="x86_64-w64-mingw32-g++"
|
||||
@@ -118,8 +186,8 @@
|
||||
extraOutputsToInstall = [ "dev" ];
|
||||
|
||||
targetPkgs = pkgs: with pkgs; [
|
||||
SDL2
|
||||
SDL2.dev
|
||||
sdl2Pkgs.SDL2
|
||||
sdl2Pkgs.SDL2.dev
|
||||
butler
|
||||
cmake
|
||||
curl
|
||||
@@ -135,6 +203,9 @@
|
||||
libgbm
|
||||
libglvnd
|
||||
libglvnd.dev
|
||||
appimagetool
|
||||
linuxdeploy
|
||||
linuxdeployPluginAppImage
|
||||
mesa
|
||||
ncurses
|
||||
ninja
|
||||
@@ -179,6 +250,8 @@
|
||||
export WEB_AR="emar"
|
||||
export WEB_RANLIB="emranlib"
|
||||
|
||||
export LINUXDEPLOY="linuxdeploy"
|
||||
|
||||
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_PKG_CONFIG_PATH="${aarch64PkgConfigPath}"
|
||||
|
||||
|
Before Width: | Height: | Size: 174 B After Width: | Height: | Size: 169 B |
|
After Width: | Height: | Size: 187 B |
|
Before Width: | Height: | Size: 222 B After Width: | Height: | Size: 208 B |
|
After Width: | Height: | Size: 179 B |
|
Before Width: | Height: | Size: 184 B |
|
Before Width: | Height: | Size: 175 B |
|
Before Width: | Height: | Size: 332 B After Width: | Height: | Size: 325 B |
|
After Width: | Height: | Size: 159 B |
|
Before Width: | Height: | Size: 365 B |
|
After Width: | Height: | Size: 174 B |
|
After Width: | Height: | Size: 194 B |
@@ -5,6 +5,7 @@
|
||||
#include "flint_scaling.h"
|
||||
#include "flint_dpi.h"
|
||||
#include "flint_layout.h"
|
||||
#include "flint_clip.h"
|
||||
#include "flint_icons.h"
|
||||
#include "flint_text.h"
|
||||
#include "flint_ui.h"
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
#ifndef FLINT_CLIP_H
|
||||
#define FLINT_CLIP_H
|
||||
|
||||
#include "raylib.h"
|
||||
|
||||
Rectangle flint_clip_intersection(Rectangle a, Rectangle b);
|
||||
Rectangle flint_clip_effective(Rectangle bounds);
|
||||
void flint_clip_begin(int x, int y, int w, int h);
|
||||
void flint_clip_end(void);
|
||||
void flint_clip_reset(void);
|
||||
|
||||
#endif
|
||||
@@ -41,6 +41,13 @@ int flint_file_dialog_load(FlintFileDialog *dlg, const char *title);
|
||||
/* Select folder dialog - returns 1 if folder selected, 0 if cancelled */
|
||||
int flint_file_dialog_select_folder(FlintFileDialog *dlg, const char *title);
|
||||
|
||||
/* Begin non-blocking dialogs. Call flint_file_dialog_update() each frame while active. */
|
||||
void flint_file_dialog_begin_load(FlintFileDialog *dlg, const char *title);
|
||||
void flint_file_dialog_begin_save(FlintFileDialog *dlg, const char *title, const char *default_filename);
|
||||
|
||||
/* Draw/update active dialog: 1 confirmed, 0 cancelled, -1 still active. */
|
||||
int flint_file_dialog_update(FlintFileDialog *dlg);
|
||||
|
||||
/* Get selected file path */
|
||||
const char *flint_file_dialog_get_path(FlintFileDialog *dlg);
|
||||
|
||||
|
||||
@@ -19,6 +19,8 @@ const FlintIconAsset *flint_icon_asset(UIIconType type);
|
||||
const FlintIconAsset *flint_icon_asset_by_name(const char *name);
|
||||
Texture2D flint_load_icon_texture(UIIconType type);
|
||||
Texture2D flint_load_icon_texture_by_name(const char *name);
|
||||
void flint_load_all_icons(Texture2D *icons);
|
||||
void flint_unload_all_icons(Texture2D *icons);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -17,7 +17,8 @@ typedef struct FlintRuntimeAssetDownload {
|
||||
char path[512];
|
||||
char error[256];
|
||||
long http_status;
|
||||
size_t bytes;
|
||||
volatile size_t bytes;
|
||||
volatile size_t total_bytes;
|
||||
void *platform;
|
||||
} FlintRuntimeAssetDownload;
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
#include "raylib.h"
|
||||
|
||||
#define FLINT_TEXT_8 8
|
||||
#define FLINT_TEXT_12 12
|
||||
#define FLINT_TEXT_14 14
|
||||
#define FLINT_TEXT_16 16
|
||||
@@ -13,6 +14,7 @@
|
||||
#define FLINT_TEXT_BASE_SIZE 16
|
||||
|
||||
void flint_text_set_font(Font font);
|
||||
void flint_text_set_small_font(Font font);
|
||||
Font flint_text_font(void);
|
||||
Font flint_text_load_chopped_font(const char *png_path, const char *dat_path, int base_size);
|
||||
Font flint_text_load_chopped_font_from_memory(const unsigned char *png_data, unsigned int png_size, const unsigned char *dat_data, unsigned int dat_size, int base_size);
|
||||
@@ -20,6 +22,7 @@ void flint_text_unload_font(Font *font);
|
||||
int flint_text_size(int preferred_size);
|
||||
int flint_text_dpi_size(int base_size);
|
||||
int flint_text_measure(const char *text, int font_size);
|
||||
int flint_text_height(const char *text, int font_size);
|
||||
int flint_text_measure_scaled(const char *text, int scale);
|
||||
void flint_text_draw(const char *text, int x, int y, int font_size, Color color);
|
||||
void flint_text_draw_scaled(const char *text, int x, int y, int scale, Color color);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#define FLINT_THEME_COUNT 6
|
||||
#define FLINT_THEME_COUNT 10
|
||||
|
||||
typedef enum {
|
||||
FLINT_THEME_SKY = 0,
|
||||
@@ -13,7 +13,11 @@ typedef enum {
|
||||
FLINT_THEME_FOREST = 2,
|
||||
FLINT_THEME_SUNSET = 3,
|
||||
FLINT_THEME_LAVENDER = 4,
|
||||
FLINT_THEME_CHERRY = 5
|
||||
FLINT_THEME_CHERRY = 5,
|
||||
FLINT_THEME_DAWN = 6,
|
||||
FLINT_THEME_SAGE = 7,
|
||||
FLINT_THEME_INK = 8,
|
||||
FLINT_THEME_MONO = 9
|
||||
} FlintThemeId;
|
||||
|
||||
typedef struct {
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "flint.h"
|
||||
#include "flint_text.h"
|
||||
#include "ui_icon_types.h"
|
||||
#include <stddef.h>
|
||||
|
||||
typedef enum {
|
||||
UI_ICON_SIZE_TINY,
|
||||
@@ -70,6 +71,33 @@ typedef struct {
|
||||
FlintUITextInputStyle style;
|
||||
} FlintUITextInput;
|
||||
|
||||
typedef int (*FlintUITextInputFilter)(int codepoint, void *user_data);
|
||||
|
||||
typedef struct {
|
||||
char *text;
|
||||
size_t text_size;
|
||||
int *cursor_position;
|
||||
int max_codepoints;
|
||||
FlintUITextInputFilter filter;
|
||||
void *filter_user_data;
|
||||
int *commit_pressed;
|
||||
} FlintUITextEdit;
|
||||
|
||||
typedef struct {
|
||||
Rectangle bounds;
|
||||
char *text;
|
||||
size_t text_size;
|
||||
int *cursor_position;
|
||||
int *focused;
|
||||
int max_codepoints;
|
||||
int font;
|
||||
int focus_id;
|
||||
FlintUITextInputStyle style;
|
||||
FlintUITextInputFilter filter;
|
||||
void *filter_user_data;
|
||||
int *commit_pressed;
|
||||
} FlintUITextField;
|
||||
|
||||
typedef struct {
|
||||
const char *text;
|
||||
Texture2D icon;
|
||||
@@ -131,9 +159,12 @@ typedef struct {
|
||||
int right_clicked;
|
||||
} FlintUIHeader;
|
||||
|
||||
typedef void (*FlintUITextInputPlatformCallback)(int active);
|
||||
|
||||
void ui_init(int width, int height, float dpi);
|
||||
void ui_set_colors(Color text, Color bg, Color surface, Color circle, Color button, Color button_hover, Color icon);
|
||||
void ui_set_frame(Camera2D camera);
|
||||
void flint_ui_set_text_input_platform_callback(FlintUITextInputPlatformCallback callback);
|
||||
void ui_set_cursor_clickable(int *cursor_clickable);
|
||||
void ui_set_cursor_disabled(int *cursor_disabled);
|
||||
void ui_set_icons(Texture2D gear_icon, Texture2D x_icon);
|
||||
@@ -144,12 +175,18 @@ int flint_ui_font(void);
|
||||
int flint_ui_font_small(void);
|
||||
int flint_ui_text_y(const char *text, int box_y, int box_h, int font);
|
||||
void flint_ui_draw_text_centered(const char *text, int center_x, int center_y, int font, Color color);
|
||||
void flint_ui_draw_text_left_in_rect(const char *text, Rectangle rect, int font_size, Color color);
|
||||
void flint_ui_draw_text_input(Rectangle bounds, const char *text, int cursor_position,
|
||||
int focused, int cursor_visible, int font,
|
||||
FlintUITextInputStyle style);
|
||||
int flint_ui_text_edit(FlintUITextEdit edit);
|
||||
void flint_ui_text_input_queue_codepoint(int codepoint);
|
||||
void flint_ui_text_input_queue_backspace(void);
|
||||
void flint_ui_text_input_queue_enter(void);
|
||||
int flint_ui_button(FlintUIButton button);
|
||||
int flint_ui_icon_button(FlintUIIconButton button);
|
||||
int flint_ui_text_input(FlintUITextInput input);
|
||||
int flint_ui_text_field(FlintUITextField field);
|
||||
int flint_ui_paragraph_height(FlintUIParagraph paragraph);
|
||||
void flint_ui_paragraph_draw(FlintUIParagraph paragraph, int x, int *y);
|
||||
void ui_draw_bevel(int x, int y, int w, int h, Color light, Color dark);
|
||||
@@ -186,6 +223,7 @@ int ui_draw_theme_switcher(int x, int y, int w, const char *label,
|
||||
int *theme_id, int *dark_mode);
|
||||
int ui_draw_theme_picker(int x, int y, int w, const char *label,
|
||||
int dark_mode, int *theme_id);
|
||||
int ui_theme_picker_height(int w);
|
||||
typedef struct UITab {
|
||||
const char *label;
|
||||
Texture2D icon;
|
||||
@@ -215,10 +253,10 @@ FlintUIHeader ui_draw_title_header(int height, const char *title,
|
||||
FlintUIPanelFrame ui_draw_modal_frame(int width, int height, const char *title,
|
||||
Texture2D left_icon,
|
||||
Texture2D right_icon);
|
||||
void ui_begin_scissor(int x, int y, int w, int h);
|
||||
void ui_end_scissor(void);
|
||||
int ui_scrollbar_reserved_width(int max_scroll);
|
||||
int ui_scrollbar_content_width(int content_width, int max_scroll);
|
||||
int ui_scrollbar_safe_content_width(int content_x, int content_width,
|
||||
int scrollbar_x, int max_scroll);
|
||||
FlintUIScrollView ui_scroll_container_begin(FlintUIScrollArea area);
|
||||
void ui_scroll_container_end(FlintUIScrollArea area, FlintUIScrollView view);
|
||||
int ui_draw_scrollbar(int x, int y, int viewport_h, int content_h, int *scroll_offset, int max_scroll);
|
||||
|
||||
@@ -19,8 +19,10 @@ typedef enum {
|
||||
UI_ICON_TYPE_TRASH,
|
||||
UI_ICON_TYPE_PENCIL,
|
||||
UI_ICON_TYPE_SAVE,
|
||||
UI_ICON_TYPE_WRENCH,
|
||||
UI_ICON_TYPE_PLUS,
|
||||
UI_ICON_TYPE_STACK,
|
||||
UI_ICON_TYPE_CALENDAR,
|
||||
|
||||
// Social & payment icons
|
||||
UI_ICON_TYPE_DISCORD,
|
||||
@@ -38,10 +40,12 @@ typedef enum {
|
||||
UI_ICON_TYPE_SOUND2,
|
||||
UI_ICON_TYPE_SOUND3,
|
||||
UI_ICON_TYPE_MUTE,
|
||||
UI_ICON_TYPE_MUSIC,
|
||||
|
||||
// Habit & practice icons
|
||||
UI_ICON_TYPE_HABIT,
|
||||
UI_ICON_TYPE_AMEN,
|
||||
UI_ICON_TYPE_WEEKLY,
|
||||
UI_ICON_TYPE_INBE,
|
||||
|
||||
// Meditation & theme icons
|
||||
@@ -88,4 +92,4 @@ typedef enum {
|
||||
UI_ICON_TYPE_COUNT
|
||||
} UIIconType;
|
||||
|
||||
#endif
|
||||
#endif
|
||||
@@ -43,7 +43,7 @@ icon_enum()
|
||||
ident=$(icon_ident "$name")
|
||||
enum=$(icon_enum "$name")
|
||||
size=$(wc -c < "$file" | tr -d ' ')
|
||||
printf ' {FLINT_ICON_TYPE_%s, "%s", flint_icon_%s, %su},\n' "$enum" "$name" "$ident" "$size"
|
||||
printf ' {UI_ICON_TYPE_%s, "%s", flint_icon_%s, %su},\n' "$enum" "$name" "$ident" "$size"
|
||||
count=$((count + 1))
|
||||
done
|
||||
printf '};\n\n'
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
#include "flint_clip.h"
|
||||
|
||||
#define FLINT_CLIP_STACK_MAX 16
|
||||
|
||||
static Rectangle g_flint_clip_stack[FLINT_CLIP_STACK_MAX];
|
||||
static int g_flint_clip_stack_count = 0;
|
||||
|
||||
Rectangle
|
||||
flint_clip_intersection(Rectangle a, Rectangle b)
|
||||
{
|
||||
float x1 = a.x > b.x ? a.x : b.x;
|
||||
float y1 = a.y > b.y ? a.y : b.y;
|
||||
float x2 = a.x + a.width < b.x + b.width ? a.x + a.width : b.x + b.width;
|
||||
float y2 = a.y + a.height < b.y + b.height ? a.y + a.height : b.y + b.height;
|
||||
|
||||
if(x2 < x1)
|
||||
x2 = x1;
|
||||
if(y2 < y1)
|
||||
y2 = y1;
|
||||
|
||||
return (Rectangle){x1, y1, x2 - x1, y2 - y1};
|
||||
}
|
||||
|
||||
Rectangle
|
||||
flint_clip_effective(Rectangle bounds)
|
||||
{
|
||||
if(g_flint_clip_stack_count > 0)
|
||||
bounds = flint_clip_intersection(g_flint_clip_stack[g_flint_clip_stack_count - 1],
|
||||
bounds);
|
||||
return bounds;
|
||||
}
|
||||
|
||||
void
|
||||
flint_clip_begin(int x, int y, int w, int h)
|
||||
{
|
||||
Rectangle bounds = {(float)x, (float)y, (float)w, (float)h};
|
||||
|
||||
if(w < 0)
|
||||
bounds.width = 0;
|
||||
if(h < 0)
|
||||
bounds.height = 0;
|
||||
|
||||
bounds = flint_clip_effective(bounds);
|
||||
if(g_flint_clip_stack_count < FLINT_CLIP_STACK_MAX)
|
||||
g_flint_clip_stack[g_flint_clip_stack_count++] = bounds;
|
||||
|
||||
BeginScissorMode((int)bounds.x, (int)bounds.y,
|
||||
(int)bounds.width, (int)bounds.height);
|
||||
}
|
||||
|
||||
void
|
||||
flint_clip_end(void)
|
||||
{
|
||||
EndScissorMode();
|
||||
if(g_flint_clip_stack_count > 0)
|
||||
g_flint_clip_stack_count--;
|
||||
if(g_flint_clip_stack_count > 0) {
|
||||
Rectangle bounds = g_flint_clip_stack[g_flint_clip_stack_count - 1];
|
||||
BeginScissorMode((int)bounds.x, (int)bounds.y,
|
||||
(int)bounds.width, (int)bounds.height);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
flint_clip_reset(void)
|
||||
{
|
||||
g_flint_clip_stack_count = 0;
|
||||
}
|
||||
@@ -8,6 +8,7 @@
|
||||
#include <time.h>
|
||||
|
||||
#include "flint_scaling.h"
|
||||
#include "flint_clip.h"
|
||||
#include "flint_color.h"
|
||||
#include "flint_theme.h"
|
||||
#include "flint_ui.h"
|
||||
@@ -50,8 +51,11 @@ static int compare_entries(const void *a, const void *b) {
|
||||
return strcmp(ea->name, eb->name);
|
||||
}
|
||||
|
||||
static void join_path(char *dst, size_t dst_size, const char *dir, const char *name);
|
||||
|
||||
static void copy_text(char *dst, size_t dst_size, const char *src) {
|
||||
if(dst_size == 0) return;
|
||||
if(src == NULL) src = "";
|
||||
size_t len = strlen(src);
|
||||
if(len >= dst_size)
|
||||
len = dst_size - 1;
|
||||
@@ -59,6 +63,80 @@ static void copy_text(char *dst, size_t dst_size, const char *src) {
|
||||
dst[len] = '\0';
|
||||
}
|
||||
|
||||
static int ascii_tolower(int c) {
|
||||
if(c >= 'A' && c <= 'Z')
|
||||
return c + ('a' - 'A');
|
||||
return c;
|
||||
}
|
||||
|
||||
static int extension_equal(const char *a, const char *b, size_t n) {
|
||||
for(size_t i = 0; i < n; i++) {
|
||||
if(ascii_tolower((unsigned char)a[i]) != ascii_tolower((unsigned char)b[i]))
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int file_matches_filter(const char *name, const char *filter) {
|
||||
const char *p;
|
||||
size_t name_len;
|
||||
|
||||
if(filter == NULL || filter[0] == '\0')
|
||||
return 1;
|
||||
if(name == NULL)
|
||||
return 0;
|
||||
|
||||
name_len = strlen(name);
|
||||
p = filter;
|
||||
while(*p != '\0') {
|
||||
char ext[32];
|
||||
size_t ext_len = 0;
|
||||
|
||||
while(*p == ' ' || *p == ',')
|
||||
p++;
|
||||
while(*p != '\0' && *p != ',' && ext_len + 1 < sizeof(ext))
|
||||
ext[ext_len++] = *p++;
|
||||
ext[ext_len] = '\0';
|
||||
while(*p != '\0' && *p != ',')
|
||||
p++;
|
||||
|
||||
if(ext_len > 0 && name_len >= ext_len &&
|
||||
extension_equal(name + name_len - ext_len, ext, ext_len))
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int should_show_entry(FlintFileDialogInternal *internal, const char *name, int *is_dir, long *size) {
|
||||
char full_path[PATH_MAX];
|
||||
struct stat st;
|
||||
int entry_is_dir = 0;
|
||||
long entry_size = 0;
|
||||
|
||||
if(internal == NULL || name == NULL)
|
||||
return 0;
|
||||
if(strcmp(name, ".") == 0 || strcmp(name, "..") == 0)
|
||||
return 0;
|
||||
if(!internal->show_hidden_files && name[0] == '.')
|
||||
return 0;
|
||||
|
||||
join_path(full_path, sizeof(full_path), internal->current_dir, name);
|
||||
if(stat(full_path, &st) == 0) {
|
||||
entry_is_dir = S_ISDIR(st.st_mode);
|
||||
entry_size = st.st_size;
|
||||
}
|
||||
|
||||
if(!entry_is_dir && !file_matches_filter(name, internal->extension_filter))
|
||||
return 0;
|
||||
|
||||
if(is_dir != NULL)
|
||||
*is_dir = entry_is_dir;
|
||||
if(size != NULL)
|
||||
*size = entry_size;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void join_path(char *dst, size_t dst_size, const char *dir, const char *name) {
|
||||
if(dst_size == 0) return;
|
||||
const char *separator = strcmp(dir, "/") == 0 ? "" : "/";
|
||||
@@ -97,9 +175,7 @@ static int scan_directory(FlintFileDialogInternal *internal) {
|
||||
int count = 0;
|
||||
|
||||
while((entry = readdir(dir))) {
|
||||
if(strcmp(entry->d_name, ".") == 0) continue;
|
||||
if(strcmp(entry->d_name, "..") == 0) continue;
|
||||
if(!internal->show_hidden_files && entry->d_name[0] == '.') continue;
|
||||
if(!should_show_entry(internal, entry->d_name, NULL, NULL)) continue;
|
||||
count++;
|
||||
}
|
||||
|
||||
@@ -119,31 +195,16 @@ static int scan_directory(FlintFileDialogInternal *internal) {
|
||||
internal->file_count = 0;
|
||||
|
||||
while((entry = readdir(dir))) {
|
||||
if(strcmp(entry->d_name, ".") == 0) continue;
|
||||
if(strcmp(entry->d_name, "..") == 0) continue;
|
||||
if(!internal->show_hidden_files && entry->d_name[0] == '.') continue;
|
||||
int is_dir = 0;
|
||||
long size = 0;
|
||||
if(!should_show_entry(internal, entry->d_name, &is_dir, &size)) continue;
|
||||
|
||||
copy_text(internal->entries[internal->file_count].name,
|
||||
sizeof(internal->entries[internal->file_count].name),
|
||||
entry->d_name);
|
||||
|
||||
char full_path[PATH_MAX];
|
||||
join_path(full_path, sizeof(full_path), internal->current_dir, entry->d_name);
|
||||
if(strlen(full_path) == sizeof(full_path) - 1) {
|
||||
internal->entries[internal->file_count].is_dir = 0;
|
||||
internal->entries[internal->file_count].size = 0;
|
||||
internal->file_count++;
|
||||
continue;
|
||||
}
|
||||
|
||||
struct stat st;
|
||||
if(stat(full_path, &st) == 0) {
|
||||
internal->entries[internal->file_count].is_dir = S_ISDIR(st.st_mode);
|
||||
internal->entries[internal->file_count].size = st.st_size;
|
||||
} else {
|
||||
internal->entries[internal->file_count].is_dir = 0;
|
||||
internal->entries[internal->file_count].size = 0;
|
||||
}
|
||||
internal->entries[internal->file_count].is_dir = is_dir;
|
||||
internal->entries[internal->file_count].size = size;
|
||||
|
||||
internal->file_count++;
|
||||
}
|
||||
@@ -260,7 +321,7 @@ static void render_file_list(FlintFileDialog *dlg, Rectangle dialog_rect) {
|
||||
Color border = flint_darken(dialog_theme_get("background"), 30);
|
||||
DrawRectangleLinesEx(internal->file_list_rect, 1, border);
|
||||
|
||||
BeginScissorMode(list_x, list_y, list_width, list_height);
|
||||
flint_clip_begin(list_x, list_y, list_width, list_height);
|
||||
|
||||
int font = flint_ui_font_small();
|
||||
Color text = dialog_theme_get("text");
|
||||
@@ -298,7 +359,7 @@ static void render_file_list(FlintFileDialog *dlg, Rectangle dialog_rect) {
|
||||
flint_text_draw(display_name, list_x + flint_px(8), item_y + flint_px(4), font, text);
|
||||
}
|
||||
|
||||
EndScissorMode();
|
||||
flint_clip_end();
|
||||
}
|
||||
|
||||
static void render_scrollbar(FlintFileDialog *dlg, Rectangle dialog_rect) {
|
||||
@@ -461,6 +522,7 @@ static void render_buttons(FlintFileDialog *dlg, Rectangle dialog_rect) {
|
||||
|
||||
static void render_file_dialog(FlintFileDialog *dlg, Vector2 screen_size) {
|
||||
FlintFileDialogInternal *internal = (FlintFileDialogInternal *)dlg->_internal;
|
||||
Color bg_color;
|
||||
|
||||
/* Use exact application width and height */
|
||||
internal->dialog_width = (int)screen_size.x;
|
||||
@@ -473,14 +535,10 @@ static void render_file_dialog(FlintFileDialog *dlg, Vector2 screen_size) {
|
||||
screen_size.y
|
||||
};
|
||||
|
||||
DrawRectangle(0, 0, screen_size.x, screen_size.y, (Color){0, 0, 0, 180});
|
||||
|
||||
Color bg_color = dialog_theme_get("background");
|
||||
bg_color = dialog_theme_get("background");
|
||||
bg_color.a = 255;
|
||||
DrawRectangleRec(dialog_rect, bg_color);
|
||||
|
||||
Color border_color = flint_darken(bg_color, 30);
|
||||
DrawRectangleLinesEx(dialog_rect, 2, border_color);
|
||||
|
||||
render_header(dlg, dialog_rect);
|
||||
render_breadcrumb(dlg, dialog_rect);
|
||||
render_file_list(dlg, dialog_rect);
|
||||
@@ -685,42 +743,50 @@ static int
|
||||
run_dialog(FlintFileDialog *dlg)
|
||||
{
|
||||
while(dlg->active && !WindowShouldClose()) {
|
||||
Color bg = dialog_theme_get("background");
|
||||
bg.a = 255;
|
||||
BeginDrawing();
|
||||
ClearBackground(RAYWHITE);
|
||||
|
||||
Vector2 screen_size = {(float)GetScreenWidth(), (float)GetScreenHeight()};
|
||||
render_file_dialog(dlg, screen_size);
|
||||
|
||||
handle_mouse_input(dlg);
|
||||
handle_keyboard_input(dlg);
|
||||
|
||||
ClearBackground(bg);
|
||||
flint_file_dialog_update(dlg);
|
||||
EndDrawing();
|
||||
}
|
||||
return dlg->confirmed;
|
||||
}
|
||||
|
||||
int flint_file_dialog_load(FlintFileDialog *dlg, const char *title) {
|
||||
if(!dlg || !title) return 0;
|
||||
void
|
||||
flint_file_dialog_begin_load(FlintFileDialog *dlg, const char *title)
|
||||
{
|
||||
FlintFileDialogInternal *internal;
|
||||
|
||||
if(!dlg || !title) return;
|
||||
flint_file_dialog_init(dlg);
|
||||
dlg->mode = FLINT_FILE_DIALOG_LOAD;
|
||||
copy_text(dlg->title, sizeof(dlg->title), title);
|
||||
copy_text(dlg->filter, sizeof(dlg->filter), "*.zip");
|
||||
copy_text(dlg->filter, sizeof(dlg->filter), ".db,.zip");
|
||||
dlg->active = 1;
|
||||
dlg->confirmed = 0;
|
||||
|
||||
FlintFileDialogInternal *internal = (FlintFileDialogInternal *)dlg->_internal;
|
||||
internal = (FlintFileDialogInternal *)dlg->_internal;
|
||||
copy_text(internal->extension_filter, sizeof(internal->extension_filter), dlg->filter);
|
||||
scan_directory(internal);
|
||||
internal->filename_input[0] = '\0';
|
||||
internal->selected_file[0] = '\0';
|
||||
internal->hover_index = 0;
|
||||
internal->focus_area = 0;
|
||||
}
|
||||
|
||||
int flint_file_dialog_load(FlintFileDialog *dlg, const char *title) {
|
||||
if(!dlg || !title) return 0;
|
||||
flint_file_dialog_begin_load(dlg, title);
|
||||
return run_dialog(dlg);
|
||||
}
|
||||
|
||||
int flint_file_dialog_save(FlintFileDialog *dlg, const char *title, const char *default_filename) {
|
||||
if(!dlg || !title || !default_filename) return 0;
|
||||
void
|
||||
flint_file_dialog_begin_save(FlintFileDialog *dlg, const char *title, const char *default_filename)
|
||||
{
|
||||
FlintFileDialogInternal *internal;
|
||||
|
||||
if(!dlg || !title || !default_filename) return;
|
||||
flint_file_dialog_init(dlg);
|
||||
dlg->mode = FLINT_FILE_DIALOG_SAVE;
|
||||
copy_text(dlg->title, sizeof(dlg->title), title);
|
||||
@@ -729,14 +795,38 @@ int flint_file_dialog_save(FlintFileDialog *dlg, const char *title, const char *
|
||||
dlg->active = 1;
|
||||
dlg->confirmed = 0;
|
||||
|
||||
FlintFileDialogInternal *internal = (FlintFileDialogInternal *)dlg->_internal;
|
||||
internal = (FlintFileDialogInternal *)dlg->_internal;
|
||||
copy_text(internal->filename_input, sizeof(internal->filename_input), default_filename);
|
||||
copy_text(internal->selected_file, sizeof(internal->selected_file), default_filename);
|
||||
internal->focus_area = 2;
|
||||
}
|
||||
|
||||
int flint_file_dialog_save(FlintFileDialog *dlg, const char *title, const char *default_filename) {
|
||||
if(!dlg || !title || !default_filename) return 0;
|
||||
flint_file_dialog_begin_save(dlg, title, default_filename);
|
||||
return run_dialog(dlg);
|
||||
}
|
||||
|
||||
int
|
||||
flint_file_dialog_update(FlintFileDialog *dlg)
|
||||
{
|
||||
Vector2 screen_size;
|
||||
|
||||
if(dlg == NULL)
|
||||
return 0;
|
||||
if(!dlg->active)
|
||||
return dlg->confirmed ? 1 : 0;
|
||||
|
||||
screen_size = (Vector2){(float)GetScreenWidth(), (float)GetScreenHeight()};
|
||||
render_file_dialog(dlg, screen_size);
|
||||
handle_mouse_input(dlg);
|
||||
handle_keyboard_input(dlg);
|
||||
|
||||
if(dlg->active)
|
||||
return -1;
|
||||
return dlg->confirmed ? 1 : 0;
|
||||
}
|
||||
|
||||
int flint_file_dialog_select_folder(FlintFileDialog *dlg, const char *title) {
|
||||
if(!dlg || !title) return 0;
|
||||
|
||||
|
||||
@@ -3,8 +3,13 @@
|
||||
|
||||
#include "flint_file_dialog.h"
|
||||
#include <dirent.h>
|
||||
#include <limits.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#ifndef PATH_MAX
|
||||
#define PATH_MAX 4096
|
||||
#endif
|
||||
|
||||
#define FILE_DIALOG_ITEM_HEIGHT 28
|
||||
|
||||
typedef struct {
|
||||
@@ -17,6 +22,7 @@ typedef struct {
|
||||
char current_dir[PATH_MAX];
|
||||
char selected_file[256];
|
||||
char filename_input[256];
|
||||
char extension_filter[64];
|
||||
int file_count;
|
||||
DirEntry *entries;
|
||||
int scroll_offset;
|
||||
|
||||
@@ -5,14 +5,14 @@ static const unsigned char flint_icon_amen[] = {
|
||||
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
|
||||
0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x08, 0x06, 0x00, 0x00, 0x00, 0x1f, 0xf3, 0xff,
|
||||
0x61, 0x00, 0x00, 0x00, 0x01, 0x73, 0x52, 0x47, 0x42, 0x00, 0xae, 0xce, 0x1c, 0xe9, 0x00, 0x00,
|
||||
0x00, 0x68, 0x49, 0x44, 0x41, 0x54, 0x38, 0x8d, 0x63, 0x60, 0xc0, 0x01, 0x12, 0xc2, 0x5d, 0xfe,
|
||||
0x23, 0xd3, 0xb8, 0x00, 0x23, 0x3e, 0xcd, 0xc8, 0x60, 0xc1, 0xca, 0x3d, 0x58, 0xd5, 0x32, 0xe1,
|
||||
0x32, 0x79, 0xfe, 0x8a, 0xdd, 0x28, 0x34, 0x2e, 0x80, 0xd3, 0x00, 0x62, 0xc1, 0x20, 0x34, 0x00,
|
||||
0x57, 0xa8, 0xe3, 0x12, 0xc7, 0xea, 0x02, 0xf4, 0x80, 0xc3, 0x17, 0x90, 0x83, 0x30, 0x0c, 0x28,
|
||||
0x32, 0x00, 0x39, 0xa0, 0x12, 0x23, 0x5c, 0x51, 0x68, 0x74, 0x79, 0x18, 0x60, 0xc4, 0x27, 0x89,
|
||||
0x0b, 0x20, 0x27, 0x6b, 0x46, 0x7c, 0x9a, 0x61, 0x0a, 0xf1, 0xe5, 0x0d, 0x46, 0x42, 0x9a, 0xf1,
|
||||
0xb9, 0x70, 0xc1, 0xca, 0x3d, 0x8c, 0x14, 0x07, 0x22, 0x00, 0x0e, 0x27, 0x2d, 0xfb, 0x25, 0x2b,
|
||||
0x9a, 0xe4, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82,
|
||||
0x00, 0x63, 0x49, 0x44, 0x41, 0x54, 0x38, 0x8d, 0xcd, 0x93, 0x41, 0x0a, 0x00, 0x21, 0x0c, 0x03,
|
||||
0xed, 0xbe, 0xb4, 0x79, 0x59, 0xfb, 0xd3, 0xdd, 0x93, 0x50, 0xc5, 0xc4, 0x05, 0x2f, 0xce, 0x25,
|
||||
0x60, 0xdb, 0x50, 0x42, 0x6d, 0x8d, 0x10, 0x11, 0x6f, 0x55, 0x86, 0xa9, 0xe1, 0x0a, 0x80, 0x65,
|
||||
0xef, 0xc3, 0x9c, 0xdd, 0x7d, 0x50, 0x06, 0x35, 0xf8, 0xcb, 0x85, 0x06, 0x2c, 0x75, 0xf6, 0xbe,
|
||||
0xdc, 0x60, 0x0e, 0x4e, 0x05, 0x79, 0x61, 0x06, 0x47, 0x06, 0x35, 0xa8, 0xcc, 0x1c, 0x74, 0xae,
|
||||
0x77, 0x4c, 0x15, 0x19, 0xf5, 0xac, 0x4d, 0x0d, 0xf7, 0x46, 0xf5, 0x37, 0x6c, 0x37, 0xac, 0x36,
|
||||
0x04, 0x60, 0xc7, 0x21, 0x7e, 0xfe, 0x36, 0x31, 0x83, 0x75, 0x56, 0xe8, 0x70, 0x00, 0x00, 0x00,
|
||||
0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82,
|
||||
};
|
||||
|
||||
static const unsigned char flint_icon_backward[] = {
|
||||
@@ -47,6 +47,21 @@ static const unsigned char flint_icon_btc[] = {
|
||||
0x4e, 0x44, 0xae, 0x42, 0x60, 0x82,
|
||||
};
|
||||
|
||||
static const unsigned char flint_icon_calendar[] = {
|
||||
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
|
||||
0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x08, 0x06, 0x00, 0x00, 0x00, 0x1f, 0xf3, 0xff,
|
||||
0x61, 0x00, 0x00, 0x00, 0x01, 0x73, 0x52, 0x47, 0x42, 0x00, 0xae, 0xce, 0x1c, 0xe9, 0x00, 0x00,
|
||||
0x00, 0x75, 0x49, 0x44, 0x41, 0x54, 0x38, 0x8d, 0xc5, 0x93, 0x5d, 0x0a, 0xc0, 0x30, 0x08, 0x83,
|
||||
0xe3, 0xd8, 0x41, 0x73, 0xb3, 0xf6, 0xa6, 0xd9, 0xc3, 0xb0, 0x94, 0x32, 0xfb, 0xb3, 0x0e, 0xf6,
|
||||
0x3d, 0xc5, 0x8a, 0x12, 0xa5, 0x02, 0x0d, 0x92, 0xd4, 0xbe, 0xf5, 0x72, 0x36, 0x2a, 0xea, 0x61,
|
||||
0x66, 0x66, 0x5e, 0x9c, 0x73, 0x06, 0x00, 0x90, 0x2c, 0xba, 0xa5, 0xce, 0x91, 0xbc, 0x9b, 0x48,
|
||||
0x52, 0x54, 0x30, 0x82, 0x24, 0xec, 0xad, 0x7d, 0xe7, 0x04, 0x10, 0x5a, 0x9e, 0x71, 0x70, 0x44,
|
||||
0x09, 0x9f, 0x31, 0xd2, 0xce, 0x63, 0x83, 0x15, 0xb6, 0x97, 0x08, 0x49, 0x4a, 0x29, 0xc9, 0x99,
|
||||
0xd5, 0x1e, 0xff, 0x3f, 0xc2, 0x51, 0x07, 0xb3, 0x9b, 0xaf, 0xf9, 0x66, 0x04, 0x60, 0xfd, 0x33,
|
||||
0x95, 0x5b, 0x00, 0xf6, 0xae, 0xf1, 0x02, 0x90, 0x45, 0x86, 0x77, 0x0c, 0xd9, 0x37, 0xe2, 0x00,
|
||||
0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82,
|
||||
};
|
||||
|
||||
static const unsigned char flint_icon_check[] = {
|
||||
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
|
||||
0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x08, 0x06, 0x00, 0x00, 0x00, 0x1f, 0xf3, 0xff,
|
||||
@@ -152,17 +167,16 @@ static const unsigned char flint_icon_gear[] = {
|
||||
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
|
||||
0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x08, 0x06, 0x00, 0x00, 0x00, 0x1f, 0xf3, 0xff,
|
||||
0x61, 0x00, 0x00, 0x00, 0x01, 0x73, 0x52, 0x47, 0x42, 0x00, 0xae, 0xce, 0x1c, 0xe9, 0x00, 0x00,
|
||||
0x00, 0x98, 0x49, 0x44, 0x41, 0x54, 0x38, 0x8d, 0xa5, 0x93, 0xc1, 0x15, 0x84, 0x20, 0x0c, 0x44,
|
||||
0x93, 0x7d, 0x94, 0x06, 0x35, 0xe0, 0x11, 0x2a, 0x73, 0x8f, 0x5a, 0xc3, 0xda, 0x5b, 0xbc, 0x18,
|
||||
0x18, 0x5d, 0x84, 0xf8, 0x9c, 0x93, 0x7c, 0x46, 0x98, 0x79, 0x00, 0x51, 0x47, 0x29, 0x7a, 0x49,
|
||||
0xd1, 0x4b, 0xcf, 0xe3, 0xd4, 0xa8, 0xe0, 0xbb, 0x6e, 0xac, 0x6c, 0x5e, 0x7e, 0x07, 0x0d, 0x82,
|
||||
0x1c, 0xbd, 0x4e, 0x07, 0x68, 0x3e, 0x8f, 0xf5, 0xfb, 0xcc, 0xf3, 0x14, 0x6a, 0x02, 0x14, 0xfe,
|
||||
0x68, 0xe1, 0x45, 0x29, 0x7a, 0x41, 0x5d, 0xe7, 0x71, 0x0e, 0x6b, 0x7c, 0x5a, 0x8b, 0x31, 0x33,
|
||||
0x5b, 0x58, 0x73, 0xf7, 0x7e, 0xce, 0x9a, 0xa4, 0xa4, 0x18, 0x45, 0x1f, 0x55, 0x69, 0x56, 0x78,
|
||||
0xac, 0x57, 0x15, 0x9e, 0x2c, 0x62, 0x3e, 0x85, 0xbb, 0x63, 0x34, 0x55, 0xb0, 0x4a, 0x53, 0xfc,
|
||||
0x25, 0xc8, 0x53, 0x28, 0xd7, 0xd4, 0xc2, 0x1d, 0x1a, 0x88, 0xea, 0x63, 0x22, 0x0a, 0x82, 0xf7,
|
||||
0x1e, 0xf9, 0x6d, 0x95, 0x56, 0xb5, 0xd1, 0x73, 0xde, 0x01, 0xa9, 0x79, 0xe4, 0x8b, 0x0f, 0x08,
|
||||
0x01, 0xc6, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82,
|
||||
0x00, 0x8a, 0x49, 0x44, 0x41, 0x54, 0x38, 0x8d, 0xa5, 0x93, 0x41, 0x12, 0x80, 0x20, 0x0c, 0x03,
|
||||
0x5b, 0x87, 0x87, 0xc2, 0xcb, 0xd2, 0x9f, 0xd6, 0x53, 0x21, 0x2a, 0x42, 0x1d, 0x73, 0x92, 0x25,
|
||||
0x42, 0x32, 0x80, 0xc8, 0x42, 0x00, 0x1c, 0x80, 0xaf, 0x3c, 0x25, 0x8c, 0x01, 0x5a, 0x6b, 0x1a,
|
||||
0xac, 0xd6, 0x1a, 0xd8, 0x99, 0xb3, 0xb7, 0xc4, 0x80, 0xcd, 0xb7, 0x71, 0x7c, 0x5f, 0xb8, 0x99,
|
||||
0x8d, 0x04, 0x2c, 0xfe, 0x31, 0xc3, 0xbb, 0x00, 0x38, 0xeb, 0x3e, 0xcf, 0x73, 0x5c, 0xe3, 0x98,
|
||||
0x2d, 0xa6, 0xaa, 0x9a, 0x61, 0xd3, 0xdd, 0xd7, 0x39, 0x47, 0x92, 0x9e, 0x62, 0x17, 0x7d, 0x57,
|
||||
0x65, 0x5a, 0xe1, 0xb3, 0x7e, 0x55, 0xf8, 0xb2, 0x48, 0xfa, 0x14, 0xde, 0x8e, 0x31, 0x55, 0x21,
|
||||
0xab, 0x48, 0xf1, 0x48, 0x60, 0x66, 0xfd, 0x9a, 0x66, 0x78, 0x61, 0x83, 0xc8, 0x78, 0x4c, 0x22,
|
||||
0xe2, 0x7c, 0xef, 0x99, 0xbf, 0x56, 0x99, 0x55, 0xdb, 0x3d, 0xe7, 0x13, 0x05, 0x56, 0xee, 0xac,
|
||||
0x6f, 0x1d, 0x71, 0x55, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82,
|
||||
};
|
||||
|
||||
static const unsigned char flint_icon_github[] = {
|
||||
@@ -204,33 +218,19 @@ static const unsigned char flint_icon_globe[] = {
|
||||
0x25, 0xe0, 0x28, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82,
|
||||
};
|
||||
|
||||
static const unsigned char flint_icon_habitmarker[] = {
|
||||
static const unsigned char flint_icon_habit[] = {
|
||||
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
|
||||
0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x08, 0x06, 0x00, 0x00, 0x00, 0x1f, 0xf3, 0xff,
|
||||
0x61, 0x00, 0x00, 0x00, 0x01, 0x73, 0x52, 0x47, 0x42, 0x00, 0xae, 0xce, 0x1c, 0xe9, 0x00, 0x00,
|
||||
0x00, 0x72, 0x49, 0x44, 0x41, 0x54, 0x38, 0x8d, 0x63, 0x60, 0xc0, 0x03, 0x12, 0xc2, 0x5d, 0xfe,
|
||||
0xe3, 0x93, 0xc7, 0x0b, 0x12, 0xc2, 0x5d, 0xfe, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x21, 0x43, 0x98,
|
||||
0xc8, 0xb6, 0x81, 0x18, 0xdb, 0x61, 0x00, 0x9f, 0x2b, 0x28, 0x76, 0x01, 0x23, 0xcc, 0x46, 0x64,
|
||||
0xc1, 0xf9, 0x2b, 0x76, 0x63, 0x28, 0x4c, 0x8c, 0x70, 0x45, 0xe1, 0x2f, 0x58, 0xb9, 0x87, 0x11,
|
||||
0xab, 0x73, 0x61, 0x4e, 0xc6, 0xc7, 0x47, 0xf6, 0x16, 0x75, 0x02, 0x11, 0x9f, 0x2b, 0xf0, 0xd9,
|
||||
0x4e, 0x3d, 0x17, 0x10, 0x72, 0x05, 0xbe, 0x28, 0xc5, 0xeb, 0x02, 0x6c, 0xb1, 0x41, 0xb2, 0x2b,
|
||||
0xf0, 0xd9, 0x4e, 0x92, 0x21, 0x24, 0x65, 0xac, 0x84, 0x70, 0x17, 0x94, 0x58, 0x20, 0x3b, 0x57,
|
||||
0x12, 0xa3, 0x11, 0x00, 0x93, 0x62, 0xed, 0xc4, 0xdc, 0xd0, 0x56, 0x98, 0x00, 0x00, 0x00, 0x00,
|
||||
0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82,
|
||||
};
|
||||
|
||||
static const unsigned char flint_icon_habits[] = {
|
||||
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
|
||||
0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x08, 0x06, 0x00, 0x00, 0x00, 0x1f, 0xf3, 0xff,
|
||||
0x61, 0x00, 0x00, 0x00, 0x01, 0x73, 0x52, 0x47, 0x42, 0x00, 0xae, 0xce, 0x1c, 0xe9, 0x00, 0x00,
|
||||
0x00, 0x69, 0x49, 0x44, 0x41, 0x54, 0x38, 0x8d, 0xa5, 0x92, 0xc1, 0x0d, 0xc0, 0x30, 0x08, 0x03,
|
||||
0xb9, 0xee, 0xbf, 0x33, 0xfd, 0x94, 0x28, 0xb2, 0x20, 0x45, 0xc1, 0xcf, 0x80, 0x0f, 0x13, 0x61,
|
||||
0x26, 0x72, 0x77, 0xd7, 0xb7, 0x53, 0xed, 0xa9, 0x9a, 0xbb, 0xe2, 0x6f, 0xea, 0xd1, 0x0c, 0x98,
|
||||
0x7f, 0x8a, 0xc7, 0xee, 0x0a, 0xcb, 0x77, 0x3b, 0x3d, 0x20, 0xf3, 0x3f, 0x98, 0x24, 0x58, 0x31,
|
||||
0x26, 0xde, 0xf1, 0x0a, 0xd7, 0x80, 0x48, 0x7e, 0x05, 0xd8, 0xd7, 0x4e, 0x01, 0x7a, 0x1b, 0x99,
|
||||
0x19, 0xa0, 0x04, 0x44, 0x51, 0x21, 0x6a, 0x2e, 0x01, 0x19, 0x24, 0x33, 0x9b, 0x6d, 0x77, 0xa0,
|
||||
0x05, 0x9d, 0xaa, 0x3d, 0xcb, 0x97, 0x45, 0xed, 0x0a, 0xe0, 0x05, 0x74, 0xe3, 0x6b, 0xcd, 0xc9,
|
||||
0xdc, 0xbf, 0x7b, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82,
|
||||
0x00, 0x6d, 0x49, 0x44, 0x41, 0x54, 0x38, 0x8d, 0xad, 0x92, 0x51, 0x12, 0x80, 0x20, 0x08, 0x44,
|
||||
0xa5, 0x93, 0xc2, 0xc9, 0xf0, 0xa6, 0xdb, 0x17, 0x8d, 0x4d, 0xba, 0x44, 0xc9, 0x1f, 0x8a, 0xec,
|
||||
0x5b, 0xa1, 0x35, 0x12, 0xee, 0x0e, 0x76, 0x4f, 0xc3, 0xdd, 0x01, 0x00, 0x59, 0x93, 0xe3, 0xb3,
|
||||
0xc2, 0x1b, 0xf5, 0x08, 0x46, 0xf1, 0x9b, 0x40, 0x42, 0x71, 0x3c, 0x54, 0xd5, 0x47, 0x61, 0xef,
|
||||
0xfd, 0x96, 0x9b, 0x99, 0x4c, 0x71, 0x03, 0x99, 0xe5, 0xa3, 0xad, 0x3d, 0x9f, 0xc8, 0x28, 0x98,
|
||||
0xfa, 0x3e, 0x82, 0x8c, 0x82, 0x8d, 0x94, 0x12, 0xcc, 0xa6, 0x51, 0xa6, 0x60, 0xea, 0xa5, 0x26,
|
||||
0xab, 0xc7, 0xb2, 0x6a, 0x12, 0x16, 0x62, 0x81, 0xae, 0xc5, 0xa9, 0x5a, 0xca, 0x6a, 0x4e, 0x4c,
|
||||
0x4f, 0xfa, 0x89, 0x0c, 0x09, 0xd6, 0xc1, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae,
|
||||
0x42, 0x60, 0x82,
|
||||
};
|
||||
|
||||
static const unsigned char flint_icon_home[] = {
|
||||
@@ -398,24 +398,24 @@ static const unsigned char flint_icon_manual[] = {
|
||||
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
|
||||
0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x08, 0x06, 0x00, 0x00, 0x00, 0x73, 0x7a, 0x7a,
|
||||
0xf4, 0x00, 0x00, 0x00, 0x01, 0x73, 0x52, 0x47, 0x42, 0x00, 0xae, 0xce, 0x1c, 0xe9, 0x00, 0x00,
|
||||
0x01, 0x06, 0x49, 0x44, 0x41, 0x54, 0x58, 0x85, 0xd5, 0x57, 0x6d, 0x16, 0xc4, 0x10, 0x0c, 0xc4,
|
||||
0xdb, 0x1b, 0xa9, 0xfb, 0x1f, 0x00, 0x67, 0xb2, 0x7f, 0x36, 0x5e, 0x1a, 0x54, 0xe2, 0xa3, 0xde,
|
||||
0xce, 0xbf, 0xd2, 0x9a, 0x91, 0x4c, 0x43, 0x94, 0x3a, 0x0c, 0x8d, 0x1f, 0x52, 0x4a, 0x69, 0x3b,
|
||||
0xa1, 0xd6, 0x37, 0xce, 0xfc, 0x80, 0xc9, 0xdd, 0x65, 0x95, 0x0f, 0x51, 0xb9, 0xcb, 0x2e, 0x25,
|
||||
0xf7, 0x21, 0x16, 0x22, 0x0c, 0x26, 0x5f, 0x4d, 0x48, 0x01, 0xeb, 0xe3, 0xcd, 0x1a, 0x3a, 0x39,
|
||||
0x0a, 0x1f, 0x62, 0xde, 0x21, 0x47, 0x04, 0xe0, 0x33, 0x42, 0x44, 0x17, 0xc3, 0x63, 0x38, 0x75,
|
||||
0xb5, 0x77, 0x29, 0xc4, 0x02, 0x5a, 0x62, 0x38, 0xe3, 0x35, 0x98, 0xfe, 0x2b, 0x7b, 0x21, 0x8e,
|
||||
0x00, 0xfc, 0x21, 0x74, 0x0c, 0xa3, 0x37, 0x8f, 0x31, 0x1d, 0x81, 0xda, 0xe2, 0x12, 0x43, 0x8b,
|
||||
0x05, 0x70, 0x8c, 0x45, 0xe7, 0x9e, 0x3c, 0x21, 0x12, 0x20, 0x31, 0x17, 0xf7, 0xdb, 0xe3, 0x26,
|
||||
0x14, 0x09, 0x98, 0x29, 0x56, 0xad, 0x6f, 0xc5, 0x11, 0xe0, 0xe6, 0x96, 0xeb, 0x95, 0xe9, 0x14,
|
||||
0xd4, 0x44, 0x48, 0xbc, 0x32, 0x55, 0x8a, 0xb9, 0x84, 0x4f, 0x27, 0xeb, 0x7f, 0x99, 0x90, 0xc2,
|
||||
0x5d, 0xb6, 0x59, 0x88, 0xb8, 0x86, 0x1d, 0x2a, 0xc5, 0xb5, 0x31, 0x48, 0x03, 0x9e, 0xe7, 0x88,
|
||||
0x98, 0x3a, 0x0d, 0x7b, 0xc2, 0x38, 0xd8, 0x72, 0x1c, 0x03, 0xb6, 0x47, 0x60, 0xc5, 0x15, 0x6e,
|
||||
0xc9, 0x6f, 0xc8, 0xc1, 0xb2, 0x1b, 0xd1, 0xea, 0x8b, 0xeb, 0xf1, 0x3a, 0xa0, 0x95, 0x7a, 0xa7,
|
||||
0x21, 0x29, 0x88, 0x7f, 0xbd, 0xc1, 0x2d, 0x05, 0xbb, 0xfb, 0x02, 0x00, 0xf6, 0x51, 0xd5, 0x03,
|
||||
0x33, 0x17, 0x8f, 0x1e, 0xe8, 0x26, 0x8b, 0xd6, 0xec, 0x8d, 0x28, 0xf8, 0x10, 0x73, 0x0a, 0x5e,
|
||||
0x6f, 0x4e, 0x01, 0xb4, 0x49, 0x3d, 0x86, 0x2f, 0x5c, 0x4f, 0x78, 0x28, 0x2c, 0xa8, 0xa9, 0xf7,
|
||||
0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82,
|
||||
0x00, 0xff, 0x49, 0x44, 0x41, 0x54, 0x58, 0x85, 0xd5, 0x57, 0x5b, 0x12, 0xc4, 0x20, 0x08, 0x53,
|
||||
0x67, 0x0f, 0xca, 0xd1, 0xb8, 0xa9, 0xfb, 0xb3, 0x38, 0x14, 0xb1, 0x82, 0xcf, 0xd9, 0xfc, 0x55,
|
||||
0x5b, 0x13, 0x21, 0x45, 0x09, 0xe1, 0x32, 0x22, 0x7f, 0xc8, 0x39, 0xe7, 0xed, 0x84, 0x31, 0x3e,
|
||||
0x38, 0xcb, 0x03, 0x27, 0x47, 0xc4, 0x00, 0x00, 0x01, 0x11, 0x97, 0x92, 0x03, 0x40, 0x25, 0x22,
|
||||
0x71, 0xf2, 0xd5, 0x84, 0x12, 0xb4, 0x3e, 0xdf, 0x6c, 0x92, 0x93, 0xa3, 0x00, 0x80, 0xb2, 0x43,
|
||||
0x8b, 0x08, 0xc2, 0x67, 0x84, 0x48, 0x2e, 0xc6, 0xc7, 0x78, 0xea, 0xb4, 0x77, 0x25, 0xdc, 0x02,
|
||||
0x5a, 0x62, 0x2c, 0xe3, 0x1a, 0x52, 0xff, 0x95, 0xbd, 0x70, 0x47, 0x80, 0xfe, 0x10, 0x39, 0xc6,
|
||||
0xd1, 0x9b, 0xe7, 0x98, 0x8e, 0x80, 0xb6, 0xb8, 0xc7, 0xd0, 0x6e, 0x01, 0x16, 0x63, 0xc9, 0xb9,
|
||||
0x37, 0x4f, 0xb8, 0x04, 0x78, 0xcc, 0x65, 0xfd, 0xf6, 0xba, 0x09, 0x5d, 0x02, 0x66, 0x8a, 0x55,
|
||||
0xeb, 0x5b, 0x77, 0x04, 0xac, 0xb9, 0xb5, 0x7a, 0x65, 0x3a, 0x05, 0x9a, 0x08, 0x8f, 0x57, 0xa6,
|
||||
0x4a, 0xb1, 0x95, 0xf0, 0xed, 0x64, 0xfd, 0x2f, 0x13, 0x4a, 0x20, 0x62, 0xb3, 0x10, 0x59, 0x0d,
|
||||
0x3b, 0x54, 0x8a, 0xb5, 0x31, 0x4a, 0x03, 0x9f, 0xb7, 0x88, 0x98, 0x3a, 0x0d, 0xa5, 0x88, 0x11,
|
||||
0x6c, 0x39, 0x8e, 0x09, 0xdb, 0x23, 0xb0, 0xe2, 0x0a, 0xb7, 0xe4, 0x37, 0xb4, 0x60, 0xd9, 0x8d,
|
||||
0x68, 0xf5, 0xc5, 0xf5, 0x7a, 0x1d, 0x88, 0x21, 0x9c, 0x69, 0x48, 0x2a, 0xe2, 0x5f, 0x6f, 0xf0,
|
||||
0x48, 0xc1, 0xee, 0xbe, 0x80, 0xc0, 0x7d, 0xa4, 0x7a, 0x60, 0xe6, 0xe2, 0xd1, 0x83, 0xdc, 0x64,
|
||||
0xd5, 0x9a, 0x9d, 0x88, 0x02, 0x00, 0x94, 0x14, 0x1c, 0x6f, 0x4e, 0x09, 0xb2, 0x49, 0xbd, 0x86,
|
||||
0x2f, 0x59, 0x2f, 0x82, 0x48, 0xea, 0x72, 0x70, 0x7b, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e,
|
||||
0x44, 0xae, 0x42, 0x60, 0x82,
|
||||
};
|
||||
|
||||
static const unsigned char flint_icon_mars[] = {
|
||||
@@ -478,6 +478,19 @@ static const unsigned char flint_icon_moon[] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82,
|
||||
};
|
||||
|
||||
static const unsigned char flint_icon_music[] = {
|
||||
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
|
||||
0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x08, 0x06, 0x00, 0x00, 0x00, 0x1f, 0xf3, 0xff,
|
||||
0x61, 0x00, 0x00, 0x00, 0x01, 0x73, 0x52, 0x47, 0x42, 0x00, 0xae, 0xce, 0x1c, 0xe9, 0x00, 0x00,
|
||||
0x00, 0x59, 0x49, 0x44, 0x41, 0x54, 0x38, 0x8d, 0xcd, 0x91, 0x31, 0x0e, 0x00, 0x20, 0x08, 0x03,
|
||||
0xc5, 0xf0, 0xff, 0x2f, 0xe3, 0x54, 0x42, 0x8c, 0x0a, 0x88, 0x83, 0x37, 0xf7, 0x10, 0x4b, 0x6b,
|
||||
0x45, 0x28, 0x1a, 0x14, 0x11, 0x51, 0x89, 0x48, 0xbd, 0x1e, 0x11, 0x21, 0x5b, 0x11, 0x70, 0xf6,
|
||||
0x45, 0x77, 0x40, 0x54, 0x3c, 0x6e, 0xb0, 0x12, 0xed, 0x60, 0xcb, 0x87, 0x1d, 0x58, 0xf9, 0x69,
|
||||
0x07, 0x3b, 0xdc, 0x0e, 0xae, 0x36, 0x98, 0xd9, 0x5d, 0x40, 0x07, 0x9c, 0x02, 0x00, 0xdf, 0x9a,
|
||||
0xb3, 0xec, 0x05, 0xbc, 0x2d, 0x96, 0x52, 0xa6, 0xc4, 0x32, 0x03, 0xd0, 0x3e, 0x40, 0x1d, 0x97,
|
||||
0xee, 0x6f, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82,
|
||||
};
|
||||
|
||||
static const unsigned char flint_icon_mute[] = {
|
||||
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
|
||||
0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x08, 0x06, 0x00, 0x00, 0x00, 0x1f, 0xf3, 0xff,
|
||||
@@ -562,32 +575,6 @@ static const unsigned char flint_icon_plus[] = {
|
||||
0x44, 0xae, 0x42, 0x60, 0x82,
|
||||
};
|
||||
|
||||
static const unsigned char flint_icon_practice[] = {
|
||||
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
|
||||
0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x08, 0x06, 0x00, 0x00, 0x00, 0x73, 0x7a, 0x7a,
|
||||
0xf4, 0x00, 0x00, 0x00, 0x01, 0x73, 0x52, 0x47, 0x42, 0x00, 0xae, 0xce, 0x1c, 0xe9, 0x00, 0x00,
|
||||
0x01, 0x27, 0x49, 0x44, 0x41, 0x54, 0x58, 0x85, 0xed, 0x56, 0x4b, 0x16, 0x83, 0x20, 0x0c, 0xd4,
|
||||
0xbe, 0x1e, 0x0d, 0xce, 0x80, 0x4b, 0x3c, 0x99, 0x2e, 0xf5, 0x0c, 0x7a, 0x37, 0xba, 0xf0, 0xa1,
|
||||
0xbc, 0x98, 0x90, 0x10, 0xa1, 0x9b, 0x76, 0x56, 0xfd, 0xc4, 0x64, 0xc8, 0x24, 0x83, 0x5d, 0xf7,
|
||||
0xeb, 0xe8, 0x4b, 0x82, 0xbd, 0x33, 0x21, 0xf7, 0xff, 0xbc, 0xee, 0x45, 0xf9, 0x8a, 0xe1, 0x9d,
|
||||
0x09, 0x14, 0xbc, 0x33, 0x81, 0x23, 0x88, 0xe1, 0x55, 0x8b, 0xdc, 0xb4, 0x6c, 0xb5, 0x52, 0xe1,
|
||||
0xc8, 0x9d, 0x1e, 0x76, 0xa2, 0x79, 0xf1, 0xd8, 0x6e, 0xf8, 0x59, 0x43, 0xa2, 0x9a, 0x04, 0x5a,
|
||||
0xbc, 0x35, 0x0f, 0xa5, 0x7a, 0x3f, 0xd5, 0x5e, 0xdc, 0x81, 0x71, 0xb0, 0x55, 0xe3, 0x8a, 0x08,
|
||||
0xc4, 0xfd, 0x86, 0xc9, 0xa9, 0xef, 0x25, 0x7e, 0xa0, 0x32, 0x22, 0xac, 0xed, 0x9a, 0xe2, 0x6a,
|
||||
0x3c, 0x99, 0x7a, 0x88, 0xe2, 0x2d, 0xa0, 0x8a, 0x69, 0x49, 0x88, 0xdb, 0x95, 0x6b, 0x7f, 0x44,
|
||||
0x33, 0x19, 0xa4, 0x2e, 0xa8, 0xb9, 0x13, 0xaa, 0x18, 0x51, 0xba, 0x0d, 0xb1, 0x43, 0xd5, 0x2c,
|
||||
0x19, 0x1b, 0x38, 0xea, 0xe4, 0x9a, 0x4e, 0x64, 0xb5, 0xf2, 0xce, 0x84, 0x54, 0xf3, 0x71, 0xb0,
|
||||
0xe4, 0x0c, 0xc4, 0x2e, 0xc0, 0x78, 0x0c, 0xe9, 0x8c, 0xa0, 0x56, 0x0c, 0x07, 0x4e, 0xea, 0x6e,
|
||||
0x47, 0x62, 0x7b, 0x92, 0x9e, 0x96, 0xed, 0x46, 0x8c, 0xcd, 0x95, 0xdb, 0x71, 0xee, 0x56, 0x4c,
|
||||
0xe3, 0x30, 0xa9, 0x30, 0x49, 0x6e, 0x12, 0xc0, 0xa0, 0x79, 0xdd, 0x7b, 0x4a, 0x4b, 0xea, 0x54,
|
||||
0xd4, 0x33, 0xd8, 0x7a, 0xb2, 0xfb, 0x0a, 0xe7, 0x20, 0x87, 0x94, 0x88, 0xd4, 0x0b, 0xb2, 0xd7,
|
||||
0xb1, 0xa4, 0x38, 0x3c, 0xfd, 0x15, 0x6f, 0x83, 0x84, 0x84, 0xea, 0x7d, 0x00, 0x16, 0xc6, 0x48,
|
||||
0x1e, 0xbf, 0xf1, 0x24, 0x58, 0x02, 0xe9, 0xea, 0x71, 0x45, 0x9b, 0x81, 0x9a, 0x6a, 0xce, 0x92,
|
||||
0x25, 0xb9, 0x45, 0x12, 0x5c, 0x6d, 0xb4, 0x67, 0xd2, 0x52, 0x8f, 0xa0, 0xa0, 0xba, 0xb5, 0xd2,
|
||||
0xd3, 0x7d, 0xe5, 0x05, 0xe4, 0x8f, 0x96, 0xf8, 0x00, 0xb7, 0x65, 0xd0, 0x7d, 0x38, 0xae, 0x8d,
|
||||
0x1b, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82,
|
||||
};
|
||||
|
||||
static const unsigned char flint_icon_quest[] = {
|
||||
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
|
||||
0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x08, 0x06, 0x00, 0x00, 0x00, 0x73, 0x7a, 0x7a,
|
||||
@@ -1156,6 +1143,20 @@ static const unsigned char flint_icon_wasm4[] = {
|
||||
0xae, 0x42, 0x60, 0x82,
|
||||
};
|
||||
|
||||
static const unsigned char flint_icon_weekly[] = {
|
||||
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
|
||||
0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x08, 0x06, 0x00, 0x00, 0x00, 0x1f, 0xf3, 0xff,
|
||||
0x61, 0x00, 0x00, 0x00, 0x01, 0x73, 0x52, 0x47, 0x42, 0x00, 0xae, 0xce, 0x1c, 0xe9, 0x00, 0x00,
|
||||
0x00, 0x68, 0x49, 0x44, 0x41, 0x54, 0x38, 0x8d, 0xed, 0x93, 0x31, 0x0e, 0xc0, 0x20, 0x0c, 0x03,
|
||||
0x9d, 0x8a, 0x87, 0xfa, 0x69, 0xfc, 0xd4, 0x0c, 0x15, 0x08, 0xa5, 0x04, 0x10, 0xed, 0xd8, 0x9b,
|
||||
0x10, 0x96, 0x63, 0x2f, 0x06, 0x1c, 0x92, 0xe4, 0xff, 0x66, 0x9a, 0xad, 0x4c, 0x33, 0xcc, 0xcc,
|
||||
0xac, 0x9a, 0x73, 0xce, 0x00, 0x00, 0x92, 0xed, 0xed, 0xe9, 0x35, 0x92, 0xf7, 0x11, 0x49, 0x8a,
|
||||
0x0c, 0x2b, 0x48, 0xc2, 0x4e, 0xeb, 0x57, 0x12, 0x80, 0xb0, 0xf2, 0x4e, 0x83, 0x14, 0x09, 0x9e,
|
||||
0x28, 0xe4, 0x3a, 0x8a, 0xee, 0x18, 0x36, 0xe8, 0xd3, 0x46, 0x6d, 0x3e, 0x6d, 0xf0, 0x1f, 0x00,
|
||||
0x1e, 0x5b, 0xd8, 0xa5, 0x6d, 0x01, 0x78, 0xb7, 0xc6, 0x02, 0xb5, 0x62, 0x38, 0x07, 0xfb, 0x8c,
|
||||
0xe6, 0x53, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82,
|
||||
};
|
||||
|
||||
static const unsigned char flint_icon_win[] = {
|
||||
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
|
||||
0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x08, 0x06, 0x00, 0x00, 0x00, 0x1f, 0xf3, 0xff,
|
||||
@@ -1169,6 +1170,22 @@ static const unsigned char flint_icon_win[] = {
|
||||
0x68, 0x1b, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82,
|
||||
};
|
||||
|
||||
static const unsigned char flint_icon_wrench[] = {
|
||||
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
|
||||
0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x08, 0x06, 0x00, 0x00, 0x00, 0x1f, 0xf3, 0xff,
|
||||
0x61, 0x00, 0x00, 0x00, 0x01, 0x73, 0x52, 0x47, 0x42, 0x00, 0xae, 0xce, 0x1c, 0xe9, 0x00, 0x00,
|
||||
0x00, 0x7c, 0x49, 0x44, 0x41, 0x54, 0x38, 0x8d, 0xbd, 0x53, 0x51, 0x0e, 0xc5, 0x20, 0x08, 0xab,
|
||||
0x9e, 0x14, 0x4e, 0x56, 0x6e, 0xca, 0xbe, 0x48, 0x7c, 0x4e, 0x60, 0xc9, 0xb2, 0xd7, 0x2f, 0xc1,
|
||||
0xd2, 0x9a, 0xaa, 0xc0, 0x3f, 0x40, 0xd2, 0x49, 0xfa, 0x77, 0xc3, 0x15, 0xa9, 0xeb, 0x4f, 0x00,
|
||||
0x50, 0xd5, 0x51, 0x91, 0x2b, 0xcc, 0x58, 0x54, 0x22, 0x7b, 0x6f, 0xad, 0x47, 0x46, 0x56, 0xd5,
|
||||
0x41, 0xd2, 0x45, 0x04, 0x66, 0x76, 0x73, 0x0e, 0xc3, 0x23, 0x22, 0x13, 0x77, 0x6f, 0x03, 0x9c,
|
||||
0xd9, 0x46, 0xe6, 0xdc, 0x62, 0x75, 0x7e, 0x7a, 0x8a, 0xe3, 0xf0, 0x5a, 0xb7, 0x22, 0x95, 0x5b,
|
||||
0x27, 0x32, 0xf6, 0xe6, 0x29, 0xdd, 0xb8, 0x0d, 0x00, 0x30, 0xb3, 0x1f, 0x4e, 0x1a, 0xe2, 0x2e,
|
||||
0x1a, 0x81, 0x8a, 0xc8, 0xfd, 0xad, 0x3c, 0xfd, 0x2c, 0xaf, 0x3e, 0x55, 0x86, 0x0b, 0xbd, 0xc8,
|
||||
0xa1, 0xaf, 0xc3, 0x52, 0x3b, 0xae, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42,
|
||||
0x60, 0x82,
|
||||
};
|
||||
|
||||
static const unsigned char flint_icon_x_red[] = {
|
||||
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
|
||||
0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x08, 0x06, 0x00, 0x00, 0x00, 0x1f, 0xf3, 0xff,
|
||||
@@ -1196,9 +1213,10 @@ static const unsigned char flint_icon_x[] = {
|
||||
};
|
||||
|
||||
const FlintIconAsset flint_icon_assets[] = {
|
||||
{UI_ICON_TYPE_AMEN, "amen", flint_icon_amen, 174u},
|
||||
{UI_ICON_TYPE_AMEN, "amen", flint_icon_amen, 169u},
|
||||
{UI_ICON_TYPE_BACKWARD, "backward", flint_icon_backward, 155u},
|
||||
{UI_ICON_TYPE_BTC, "btc", flint_icon_btc, 246u},
|
||||
{UI_ICON_TYPE_CALENDAR, "calendar", flint_icon_calendar, 187u},
|
||||
{UI_ICON_TYPE_CHECK, "check", flint_icon_check, 131u},
|
||||
{UI_ICON_TYPE_DISCORD, "discord", flint_icon_discord, 180u},
|
||||
{UI_ICON_TYPE_DROID, "droid", flint_icon_droid, 170u},
|
||||
@@ -1206,11 +1224,10 @@ const FlintIconAsset flint_icon_assets[] = {
|
||||
{UI_ICON_TYPE_EYE_CLOSED, "eye-closed", flint_icon_eye_closed, 157u},
|
||||
{UI_ICON_TYPE_FDROID, "fdroid", flint_icon_fdroid, 268u},
|
||||
{UI_ICON_TYPE_FORWARD, "forward", flint_icon_forward, 153u},
|
||||
{UI_ICON_TYPE_GEAR, "gear", flint_icon_gear, 222u},
|
||||
{UI_ICON_TYPE_GEAR, "gear", flint_icon_gear, 208u},
|
||||
{UI_ICON_TYPE_GITHUB, "github", flint_icon_github, 332u},
|
||||
{UI_ICON_TYPE_GLOBE, "globe", flint_icon_globe, 192u},
|
||||
{UI_ICON_TYPE_HABIT, "habitmarker", flint_icon_habitmarker, 184u},
|
||||
{UI_ICON_TYPE_HABIT, "habits", flint_icon_habits, 175u},
|
||||
{UI_ICON_TYPE_HABIT, "habit", flint_icon_habit, 179u},
|
||||
{UI_ICON_TYPE_HOME, "home", flint_icon_home, 216u},
|
||||
{UI_ICON_TYPE_INBE, "inbe", flint_icon_inbe, 832u},
|
||||
{UI_ICON_TYPE_ITCH, "itch", flint_icon_itch, 344u},
|
||||
@@ -1218,18 +1235,18 @@ const FlintIconAsset flint_icon_assets[] = {
|
||||
{UI_ICON_TYPE_LIGHTOFF, "lightoff", flint_icon_lightoff, 217u},
|
||||
{UI_ICON_TYPE_LIGHTON, "lighton", flint_icon_lighton, 216u},
|
||||
{UI_ICON_TYPE_LINK, "link", flint_icon_link, 213u},
|
||||
{UI_ICON_TYPE_MANUAL, "manual", flint_icon_manual, 332u},
|
||||
{UI_ICON_TYPE_MANUAL, "manual", flint_icon_manual, 325u},
|
||||
{UI_ICON_TYPE_MARS, "mars", flint_icon_mars, 154u},
|
||||
{UI_ICON_TYPE_MERCURY, "mercury", flint_icon_mercury, 159u},
|
||||
{UI_ICON_TYPE_MONERO, "monero", flint_icon_monero, 173u},
|
||||
{UI_ICON_TYPE_MOON, "moon", flint_icon_moon, 268u},
|
||||
{UI_ICON_TYPE_MUSIC, "music", flint_icon_music, 159u},
|
||||
{UI_ICON_TYPE_MUTE, "mute", flint_icon_mute, 197u},
|
||||
{UI_ICON_TYPE_PAUSE, "pause", flint_icon_pause, 110u},
|
||||
{UI_ICON_TYPE_PENCIL, "pencil", flint_icon_pencil, 172u},
|
||||
{UI_ICON_TYPE_PLAY, "play", flint_icon_play, 151u},
|
||||
{UI_ICON_TYPE_PLAYSTORE, "playstore", flint_icon_playstore, 263u},
|
||||
{UI_ICON_TYPE_PLUS, "plus", flint_icon_plus, 117u},
|
||||
{UI_ICON_TYPE_AMEN, "practice", flint_icon_practice, 365u},
|
||||
{UI_ICON_TYPE_QUEST, "quest", flint_icon_quest, 714u},
|
||||
{UI_ICON_TYPE_RAY, "ray", flint_icon_ray, 152u},
|
||||
{UI_ICON_TYPE_RETURN, "return", flint_icon_return, 165u},
|
||||
@@ -1262,9 +1279,11 @@ const FlintIconAsset flint_icon_assets[] = {
|
||||
{UI_ICON_TYPE_VENUS, "venus", flint_icon_venus, 149u},
|
||||
{UI_ICON_TYPE_WASM, "wasm", flint_icon_wasm, 182u},
|
||||
{UI_ICON_TYPE_WASM4, "wasm4", flint_icon_wasm4, 164u},
|
||||
{UI_ICON_TYPE_WEEKLY, "weekly", flint_icon_weekly, 174u},
|
||||
{UI_ICON_TYPE_WIN, "win", flint_icon_win, 159u},
|
||||
{UI_ICON_TYPE_WRENCH, "wrench", flint_icon_wrench, 194u},
|
||||
{UI_ICON_TYPE_X_RED, "x-red", flint_icon_x_red, 157u},
|
||||
{UI_ICON_TYPE_X, "x", flint_icon_x, 157u},
|
||||
};
|
||||
|
||||
const unsigned int flint_icon_asset_count = 69u;
|
||||
const unsigned int flint_icon_asset_count = 71u;
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "flint_ui.h"
|
||||
#include "raylib.h"
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
extern const FlintIconAsset flint_icon_assets[];
|
||||
@@ -62,3 +63,124 @@ flint_load_icon_texture_by_name(const char *name)
|
||||
return load_icon_asset_texture(flint_icon_asset_by_name(name));
|
||||
}
|
||||
|
||||
void
|
||||
flint_load_all_icons(Texture2D *icons)
|
||||
{
|
||||
if(icons == NULL)
|
||||
return;
|
||||
|
||||
static const char *icon_names[UI_ICON_TYPE_COUNT] = {
|
||||
NULL, // UI_ICON_TYPE_NONE (no icon)
|
||||
|
||||
// Core UI icons
|
||||
"gear.png", // UI_ICON_TYPE_GEAR
|
||||
"x.png", // UI_ICON_TYPE_X
|
||||
"x-red.png", // UI_ICON_TYPE_X_RED
|
||||
"manual.png", // UI_ICON_TYPE_MANUAL
|
||||
"return.png", // UI_ICON_TYPE_RETURN
|
||||
"backward.png", // UI_ICON_TYPE_BACKWARD
|
||||
"forward.png", // UI_ICON_TYPE_FORWARD
|
||||
"play.png", // UI_ICON_TYPE_PLAY
|
||||
"pause.png", // UI_ICON_TYPE_PAUSE
|
||||
"stat.png", // UI_ICON_TYPE_STAT
|
||||
"home.png", // UI_ICON_TYPE_HOME
|
||||
"trash.png", // UI_ICON_TYPE_TRASH
|
||||
"pencil.png", // UI_ICON_TYPE_PENCIL
|
||||
"save.png", // UI_ICON_TYPE_SAVE
|
||||
"wrench.png", // UI_ICON_TYPE_WRENCH
|
||||
"plus.png", // UI_ICON_TYPE_PLUS
|
||||
"stack.png", // UI_ICON_TYPE_STACK
|
||||
"calendar.png", // UI_ICON_TYPE_CALENDAR
|
||||
|
||||
// Social & payment icons
|
||||
"discord.png", // UI_ICON_TYPE_DISCORD
|
||||
"telegram.png", // UI_ICON_TYPE_TELEGRAM
|
||||
"github.png", // UI_ICON_TYPE_GITHUB
|
||||
"globe.png", // UI_ICON_TYPE_GLOBE
|
||||
"stripe.png", // UI_ICON_TYPE_STRIPE
|
||||
"btc.png", // UI_ICON_TYPE_BTC
|
||||
"monero.png", // UI_ICON_TYPE_MONERO
|
||||
|
||||
// Sound icons
|
||||
"sound.png", // UI_ICON_TYPE_SOUND
|
||||
"sound0.png", // UI_ICON_TYPE_SOUND0
|
||||
"sound1.png", // UI_ICON_TYPE_SOUND1
|
||||
"sound2.png", // UI_ICON_TYPE_SOUND2
|
||||
"sound3.png", // UI_ICON_TYPE_SOUND3
|
||||
"mute.png", // UI_ICON_TYPE_MUTE
|
||||
"music.png", // UI_ICON_TYPE_MUSIC
|
||||
|
||||
// Habit & practice icons
|
||||
"habit.png", // UI_ICON_TYPE_HABIT
|
||||
"amen.png", // UI_ICON_TYPE_AMEN
|
||||
"weekly.png", // UI_ICON_TYPE_WEEKLY
|
||||
"inbe.png", // UI_ICON_TYPE_INBE
|
||||
|
||||
// Meditation & theme icons
|
||||
"droid.png", // UI_ICON_TYPE_DROID
|
||||
"fdroid.png", // UI_ICON_TYPE_FDROID
|
||||
"lighton.png", // UI_ICON_TYPE_LIGHTON
|
||||
"lightoff.png", // UI_ICON_TYPE_LIGHTOFF
|
||||
"moon.png", // UI_ICON_TYPE_MOON
|
||||
"sun.png", // UI_ICON_TYPE_SUN
|
||||
"jupiter.png", // UI_ICON_TYPE_JUPITER
|
||||
"mars.png", // UI_ICON_TYPE_MARS
|
||||
"mercury.png", // UI_ICON_TYPE_MERCURY
|
||||
"venus.png", // UI_ICON_TYPE_VENUS
|
||||
"saturn.png", // UI_ICON_TYPE_SATURN
|
||||
|
||||
// Navigation & utility icons
|
||||
"link.png", // UI_ICON_TYPE_LINK
|
||||
"edit.png", // UI_ICON_TYPE_EDIT
|
||||
"eye-closed.png", // UI_ICON_TYPE_EYE_CLOSED
|
||||
"check.png", // UI_ICON_TYPE_CHECK
|
||||
"quest.png", // UI_ICON_TYPE_QUEST
|
||||
"routine.png", // UI_ICON_TYPE_ROUTINE
|
||||
"timeline.png", // UI_ICON_TYPE_TIMELINE
|
||||
"todos.png", // UI_ICON_TYPE_TODOS
|
||||
"tile.png", // UI_ICON_TYPE_TILE
|
||||
"tile2.png", // UI_ICON_TYPE_TILE2
|
||||
"tile3.png", // UI_ICON_TYPE_TILE3
|
||||
"tile4.png", // UI_ICON_TYPE_TILE4
|
||||
"text.png", // UI_ICON_TYPE_TEXT
|
||||
|
||||
// Platform & store icons
|
||||
"itch.png", // UI_ICON_TYPE_ITCH
|
||||
"playstore.png", // UI_ICON_TYPE_PLAYSTORE
|
||||
"tux.png", // UI_ICON_TYPE_TUX
|
||||
"win.png", // UI_ICON_TYPE_WIN
|
||||
"uxn.png", // UI_ICON_TYPE_UXN
|
||||
"wasm.png", // UI_ICON_TYPE_WASM
|
||||
"wasm4.png", // UI_ICON_TYPE_WASM4
|
||||
"ray.png", // UI_ICON_TYPE_RAY
|
||||
"rocket.png", // UI_ICON_TYPE_ROCKET
|
||||
"srht.png", // UI_ICON_TYPE_SRHT
|
||||
"tcl.png", // UI_ICON_TYPE_TCL
|
||||
};
|
||||
|
||||
for(int i = 1; i < UI_ICON_TYPE_COUNT; i++) {
|
||||
if(icon_names[i] != NULL && icons[i].id == 0) {
|
||||
char icon_name[64];
|
||||
char *ext;
|
||||
snprintf(icon_name, sizeof(icon_name), "%s", icon_names[i]);
|
||||
ext = strrchr(icon_name, '.');
|
||||
if(ext != NULL && strcmp(ext, ".png") == 0)
|
||||
*ext = '\0';
|
||||
icons[i] = flint_load_icon_texture_by_name(icon_name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
flint_unload_all_icons(Texture2D *icons)
|
||||
{
|
||||
if(icons == NULL)
|
||||
return;
|
||||
|
||||
for(int i = 0; i < UI_ICON_TYPE_COUNT; i++) {
|
||||
if(icons[i].id != 0) {
|
||||
UnloadTexture(icons[i]);
|
||||
icons[i].id = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -343,7 +343,7 @@ load_file_text_from_paths(const char *relative_path, char **out_text)
|
||||
|
||||
#if defined(FLINT_EMBEDDED_ONLY)
|
||||
return 0;
|
||||
#elif defined(PLATFORM_ANDROID) || defined(__ANDROID__) || defined(ANDROID)
|
||||
#elif INBE_ANDROID_BUILD
|
||||
text = LoadFileText(relative_path);
|
||||
if(text != NULL) {
|
||||
*out_text = text;
|
||||
@@ -403,7 +403,7 @@ load_locale_file_for_code(const char *code, char **out_text)
|
||||
|
||||
#if defined(FLINT_EMBEDDED_ONLY)
|
||||
return 0;
|
||||
#elif defined(PLATFORM_ANDROID) || defined(__ANDROID__) || defined(ANDROID)
|
||||
#elif INBE_ANDROID_BUILD
|
||||
text = LoadFileText(path);
|
||||
if(text != NULL) {
|
||||
*out_text = text;
|
||||
|
||||
@@ -112,7 +112,7 @@ flint_runtime_assets_init(const char *app_id)
|
||||
EM_ASM({
|
||||
var root = UTF8ToString($0);
|
||||
var parts = root.split('/').filter(Boolean);
|
||||
var path = '';
|
||||
var path = "";
|
||||
try {
|
||||
for(var i = 0; i < parts.length; i++) {
|
||||
path += '/' + parts[i];
|
||||
@@ -219,6 +219,22 @@ curl_write_file(void *ptr, size_t size, size_t nmemb, void *stream)
|
||||
return fwrite(ptr, size, nmemb, (FILE *)stream);
|
||||
}
|
||||
|
||||
static int
|
||||
curl_progress(void *clientp, curl_off_t dltotal, curl_off_t dlnow,
|
||||
curl_off_t ultotal, curl_off_t ulnow)
|
||||
{
|
||||
FlintRuntimeAssetDownload *download = (FlintRuntimeAssetDownload *)clientp;
|
||||
(void)ultotal;
|
||||
(void)ulnow;
|
||||
|
||||
if(download == NULL)
|
||||
return 0;
|
||||
|
||||
download->bytes = dlnow > 0 ? (size_t)dlnow : 0;
|
||||
download->total_bytes = dltotal > 0 ? (size_t)dltotal : 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void *
|
||||
curl_thread_main(void *user_data)
|
||||
{
|
||||
@@ -254,12 +270,17 @@ curl_thread_main(void *user_data)
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEDATA, file);
|
||||
curl_easy_setopt(curl, CURLOPT_USERAGENT, "flint-runtime-assets/1");
|
||||
curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1L);
|
||||
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0L);
|
||||
curl_easy_setopt(curl, CURLOPT_XFERINFOFUNCTION, curl_progress);
|
||||
curl_easy_setopt(curl, CURLOPT_XFERINFODATA, download);
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &download->http_status);
|
||||
if(curl_easy_getinfo(curl, CURLINFO_SIZE_DOWNLOAD_T, &downloaded) == CURLE_OK &&
|
||||
downloaded > 0)
|
||||
download->bytes = (size_t)downloaded;
|
||||
if(download->total_bytes == 0 && downloaded > 0)
|
||||
download->total_bytes = (size_t)downloaded;
|
||||
curl_easy_cleanup(curl);
|
||||
fclose(file);
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "flint_text.h"
|
||||
#include "flint_clip.h"
|
||||
#include "flint_scaling.h"
|
||||
|
||||
#include <stdint.h>
|
||||
@@ -8,6 +9,7 @@
|
||||
#include <stddef.h>
|
||||
|
||||
static Font g_flint_text_font = {0};
|
||||
static Font g_flint_text_small_font = {0};
|
||||
|
||||
typedef struct FlintChoppedGlyph {
|
||||
int32_t value;
|
||||
@@ -31,6 +33,20 @@ active_font(void)
|
||||
return GetFontDefault();
|
||||
}
|
||||
|
||||
static Font
|
||||
active_font_for_size(int font_size)
|
||||
{
|
||||
if(font_size <= flint_px(FLINT_TEXT_8) &&
|
||||
g_flint_text_small_font.texture.id != 0 &&
|
||||
g_flint_text_small_font.glyphs != NULL &&
|
||||
g_flint_text_small_font.recs != NULL &&
|
||||
g_flint_text_small_font.glyphCount > 0 &&
|
||||
g_flint_text_small_font.baseSize > 0)
|
||||
return g_flint_text_small_font;
|
||||
|
||||
return active_font();
|
||||
}
|
||||
|
||||
static float
|
||||
font_spacing(Font font, int font_size)
|
||||
{
|
||||
@@ -47,6 +63,12 @@ flint_text_set_font(Font font)
|
||||
g_flint_text_font = font;
|
||||
}
|
||||
|
||||
void
|
||||
flint_text_set_small_font(Font font)
|
||||
{
|
||||
g_flint_text_small_font = font;
|
||||
}
|
||||
|
||||
Font
|
||||
flint_text_font(void)
|
||||
{
|
||||
@@ -209,6 +231,7 @@ int
|
||||
flint_text_size(int preferred_size)
|
||||
{
|
||||
static const int sizes[] = {
|
||||
FLINT_TEXT_8,
|
||||
FLINT_TEXT_12,
|
||||
FLINT_TEXT_14,
|
||||
FLINT_TEXT_16,
|
||||
@@ -217,13 +240,20 @@ flint_text_size(int preferred_size)
|
||||
FLINT_TEXT_24,
|
||||
FLINT_TEXT_32
|
||||
};
|
||||
int best = sizes[0];
|
||||
int best_delta = abs(preferred_size - best);
|
||||
int dpi_sizes[sizeof(sizes) / sizeof(sizes[0])];
|
||||
int best;
|
||||
int best_delta;
|
||||
|
||||
for(size_t i = 0; i < sizeof(sizes) / sizeof(sizes[0]); i++)
|
||||
dpi_sizes[i] = flint_px(sizes[i]);
|
||||
|
||||
best = dpi_sizes[0];
|
||||
best_delta = abs(preferred_size - best);
|
||||
|
||||
for(size_t i = 1; i < sizeof(sizes) / sizeof(sizes[0]); i++) {
|
||||
int delta = abs(preferred_size - sizes[i]);
|
||||
int delta = abs(preferred_size - dpi_sizes[i]);
|
||||
if(delta < best_delta) {
|
||||
best = sizes[i];
|
||||
best = dpi_sizes[i];
|
||||
best_delta = delta;
|
||||
}
|
||||
}
|
||||
@@ -240,7 +270,7 @@ flint_text_dpi_size(int base_size)
|
||||
int
|
||||
flint_text_measure(const char *text, int font_size)
|
||||
{
|
||||
Font font = active_font();
|
||||
Font font = active_font_for_size(font_size);
|
||||
Vector2 size;
|
||||
|
||||
if(text == NULL || font.texture.id == 0)
|
||||
@@ -250,6 +280,51 @@ flint_text_measure(const char *text, int font_size)
|
||||
return (int)size.x;
|
||||
}
|
||||
|
||||
int
|
||||
flint_text_height(const char *text, int font_size)
|
||||
{
|
||||
Font font = active_font_for_size(font_size);
|
||||
float scale;
|
||||
float min_top = 0.0f;
|
||||
float max_bottom = 0.0f;
|
||||
int seen_glyph = 0;
|
||||
|
||||
if(text == NULL || text[0] == '\0' || font.texture.id == 0 || font.baseSize <= 0)
|
||||
return font_size;
|
||||
|
||||
scale = (float)font_size / (float)font.baseSize;
|
||||
for(int i = 0; text[i] != '\0';) {
|
||||
int codepoint_byte_count = 0;
|
||||
int codepoint = GetCodepointNext(&text[i], &codepoint_byte_count);
|
||||
|
||||
if(codepoint == '\n')
|
||||
break;
|
||||
if(codepoint != ' ' && codepoint != '\t') {
|
||||
int index = GetGlyphIndex(font, codepoint);
|
||||
GlyphInfo glyph = font.glyphs[index];
|
||||
Rectangle rec = font.recs[index];
|
||||
float glyph_top = (float)glyph.offsetY * scale - (float)font.glyphPadding * scale;
|
||||
float glyph_bottom = glyph_top + ((float)rec.height + 2.0f * (float)font.glyphPadding) * scale;
|
||||
|
||||
if(!seen_glyph) {
|
||||
min_top = glyph_top;
|
||||
max_bottom = glyph_bottom;
|
||||
seen_glyph = 1;
|
||||
} else {
|
||||
if(glyph_top < min_top)
|
||||
min_top = glyph_top;
|
||||
if(glyph_bottom > max_bottom)
|
||||
max_bottom = glyph_bottom;
|
||||
}
|
||||
}
|
||||
i += codepoint_byte_count;
|
||||
}
|
||||
|
||||
if(!seen_glyph)
|
||||
return font_size;
|
||||
return (int)(max_bottom - min_top + 0.5f);
|
||||
}
|
||||
|
||||
int
|
||||
flint_text_measure_scaled(const char *text, int scale)
|
||||
{
|
||||
@@ -279,7 +354,7 @@ flint_text_measure_scaled(const char *text, int scale)
|
||||
void
|
||||
flint_text_draw(const char *text, int x, int y, int font_size, Color color)
|
||||
{
|
||||
Font font = active_font();
|
||||
Font font = active_font_for_size(font_size);
|
||||
|
||||
if(text == NULL || font.texture.id == 0)
|
||||
return;
|
||||
@@ -340,10 +415,12 @@ flint_text_draw_in_rect(const char *text, Rectangle rect, int font_size, Color c
|
||||
int text_w = flint_text_measure(value, font_size);
|
||||
int x = (int)(rect.x + (rect.width - (float)text_w) * 0.5f);
|
||||
int y = flint_text_y(value, (int)rect.y, (int)rect.height, font_size);
|
||||
int clip_guard = 1;
|
||||
|
||||
BeginScissorMode((int)rect.x, (int)rect.y, (int)rect.width, (int)rect.height);
|
||||
flint_clip_begin((int)rect.x, (int)rect.y - clip_guard,
|
||||
(int)rect.width, (int)rect.height + clip_guard * 2);
|
||||
flint_text_draw(value, x, y, font_size, color);
|
||||
EndScissorMode();
|
||||
flint_clip_end();
|
||||
}
|
||||
|
||||
void
|
||||
@@ -380,7 +457,7 @@ flint_text_y_scaled(const char *text, int box_y, int box_h, int scale)
|
||||
int
|
||||
flint_text_y(const char *text, int box_y, int box_h, int font_size)
|
||||
{
|
||||
Font font = active_font();
|
||||
Font font = active_font_for_size(font_size);
|
||||
float scale;
|
||||
float min_top = 0.0f;
|
||||
float max_bottom = 0.0f;
|
||||
|
||||
@@ -19,7 +19,11 @@ const FlintThemeMeta flint_themes[FLINT_THEME_COUNT] = {
|
||||
[FLINT_THEME_FOREST] = {"Forest", "forest_light", "forest_dark"},
|
||||
[FLINT_THEME_SUNSET] = {"Sunset", "sunset_light", "sunset_dark"},
|
||||
[FLINT_THEME_LAVENDER] = {"Lavender", "lavender_light", "lavender_dark"},
|
||||
[FLINT_THEME_CHERRY] = {"Cherry", "cherry_light", "cherry_dark"}
|
||||
[FLINT_THEME_CHERRY] = {"Cherry", "cherry_light", "cherry_dark"},
|
||||
[FLINT_THEME_DAWN] = {"Dawn", "dawn_light", "dawn_dark"},
|
||||
[FLINT_THEME_SAGE] = {"Sage", "sage_light", "sage_dark"},
|
||||
[FLINT_THEME_INK] = {"Sepia", "ink_light", "ink_dark"},
|
||||
[FLINT_THEME_MONO] = {"Mono", "mono_light", "mono_dark"}
|
||||
};
|
||||
|
||||
static const FlintThemeCatalogColors catalog_light[FLINT_THEME_COUNT] = {
|
||||
@@ -28,7 +32,11 @@ static const FlintThemeCatalogColors catalog_light[FLINT_THEME_COUNT] = {
|
||||
[FLINT_THEME_FOREST] = {{0xE0,0xF0,0xE0,0xFF}, {0xD1,0xE5,0xD1,0xFF}, {0x2A,0x50,0x30,0xFF}, {0x60,0xB0,0x70,0xFF}, {0xA0,0xD0,0xB0,0xFF}, {0x70,0xC0,0x90,0xFF}, {0xE0,0xF0,0xE0,0xFF}, {0x40,0x90,0x50,0xFF}},
|
||||
[FLINT_THEME_SUNSET] = {{0xF8,0xE8,0xD8,0xFF}, {0xEC,0xD8,0xC6,0xFF}, {0x50,0x28,0x14,0xFF}, {0xD0,0x80,0x50,0xFF}, {0xF0,0xC0,0xA0,0xFF}, {0xE0,0x90,0x60,0xFF}, {0xF8,0xE8,0xD8,0xFF}, {0xC0,0x60,0x30,0xFF}},
|
||||
[FLINT_THEME_LAVENDER] = {{0xF0,0xE8,0xF8,0xFF}, {0xE2,0xD7,0xEE,0xFF}, {0x40,0x28,0x60,0xFF}, {0x90,0x70,0xB0,0xFF}, {0xC0,0xA0,0xD0,0xFF}, {0xA0,0x80,0xC0,0xFF}, {0xF0,0xE8,0xF8,0xFF}, {0x70,0x50,0x90,0xFF}},
|
||||
[FLINT_THEME_CHERRY] = {{0xF8,0xD8,0xE0,0xFF}, {0xEC,0xC9,0xD2,0xFF}, {0x60,0x20,0x30,0xFF}, {0xD0,0x60,0x80,0xFF}, {0xF0,0xA0,0xB0,0xFF}, {0xE0,0x70,0x90,0xFF}, {0xF8,0xD8,0xE0,0xFF}, {0xC0,0x40,0x60,0xFF}}
|
||||
[FLINT_THEME_CHERRY] = {{0xF8,0xD8,0xE0,0xFF}, {0xEC,0xC9,0xD2,0xFF}, {0x60,0x20,0x30,0xFF}, {0xD0,0x60,0x80,0xFF}, {0xF0,0xA0,0xB0,0xFF}, {0xE0,0x70,0x90,0xFF}, {0xF8,0xD8,0xE0,0xFF}, {0xC0,0x40,0x60,0xFF}},
|
||||
[FLINT_THEME_DAWN] = {{0xF5,0xE9,0xDF,0xFF}, {0xE7,0xD9,0xD0,0xFF}, {0x39,0x3B,0x4A,0xFF}, {0xE0,0x7A,0x6D,0xFF}, {0x8F,0xCF,0xC6,0xFF}, {0x62,0xB8,0xB0,0xFF}, {0xF5,0xE9,0xDF,0xFF}, {0xC8,0x62,0x5C,0xFF}},
|
||||
[FLINT_THEME_SAGE] = {{0xE8,0xEC,0xDF,0xFF}, {0xD9,0xE0,0xD0,0xFF}, {0x35,0x44,0x38,0xFF}, {0x82,0xA0,0x7D,0xFF}, {0xB6,0xC9,0xA6,0xFF}, {0x94,0xAF,0x84,0xFF}, {0xE8,0xEC,0xDF,0xFF}, {0x5D,0x82,0x68,0xFF}},
|
||||
[FLINT_THEME_INK] = {{0xF3,0xE4,0xC8,0xFF}, {0xE4,0xCF,0xAA,0xFF}, {0x3F,0x2B,0x1C,0xFF}, {0xB8,0x76,0x3F,0xFF}, {0xD8,0xB0,0x72,0xFF}, {0xC7,0x91,0x51,0xFF}, {0xF8,0xEE,0xD6,0xFF}, {0x8F,0x5B,0x2F,0xFF}},
|
||||
[FLINT_THEME_MONO] = {{0xFF,0xFF,0xFF,0xFF}, {0xEF,0xEF,0xEF,0xFF}, {0x00,0x00,0x00,0xFF}, {0x00,0x00,0x00,0xFF}, {0xDD,0xDD,0xDD,0xFF}, {0xC8,0xC8,0xC8,0xFF}, {0xFF,0xFF,0xFF,0xFF}, {0x00,0x00,0x00,0xFF}}
|
||||
};
|
||||
|
||||
static const FlintThemeCatalogColors catalog_dark[FLINT_THEME_COUNT] = {
|
||||
@@ -37,7 +45,11 @@ static const FlintThemeCatalogColors catalog_dark[FLINT_THEME_COUNT] = {
|
||||
[FLINT_THEME_FOREST] = {{0x15,0x30,0x20,0xFF}, {0x20,0x3C,0x2A,0xFF}, {0xB4,0xD0,0xB4,0xFF}, {0x35,0x65,0x45,0xFF}, {0x25,0x45,0x30,0xFF}, {0x30,0x55,0x40,0xFF}, {0xB4,0xD0,0xB4,0xFF}, {0x50,0x80,0x60,0xFF}},
|
||||
[FLINT_THEME_SUNSET] = {{0x30,0x18,0x10,0xFF}, {0x3E,0x24,0x18,0xFF}, {0xE0,0xB0,0x90,0xFF}, {0x80,0x40,0x28,0xFF}, {0x50,0x28,0x18,0xFF}, {0x60,0x35,0x25,0xFF}, {0xE0,0xB0,0x90,0xFF}, {0xC0,0x50,0x30,0xFF}},
|
||||
[FLINT_THEME_LAVENDER] = {{0x20,0x15,0x30,0xFF}, {0x2E,0x20,0x42,0xFF}, {0xC4,0xA8,0xD0,0xFF}, {0x50,0x35,0x70,0xFF}, {0x35,0x20,0x50,0xFF}, {0x45,0x30,0x65,0xFF}, {0xC4,0xA8,0xD0,0xFF}, {0x90,0x60,0xB0,0xFF}},
|
||||
[FLINT_THEME_CHERRY] = {{0x30,0x15,0x20,0xFF}, {0x40,0x20,0x2A,0xFF}, {0xD2,0x98,0xA8,0xFF}, {0x70,0x30,0x45,0xFF}, {0x45,0x20,0x28,0xFF}, {0x55,0x30,0x38,0xFF}, {0xD2,0x98,0xA8,0xFF}, {0xB0,0x40,0x60,0xFF}}
|
||||
[FLINT_THEME_CHERRY] = {{0x30,0x15,0x20,0xFF}, {0x40,0x20,0x2A,0xFF}, {0xD2,0x98,0xA8,0xFF}, {0x70,0x30,0x45,0xFF}, {0x45,0x20,0x28,0xFF}, {0x55,0x30,0x38,0xFF}, {0xD2,0x98,0xA8,0xFF}, {0xB0,0x40,0x60,0xFF}},
|
||||
[FLINT_THEME_DAWN] = {{0x27,0x22,0x2C,0xFF}, {0x35,0x2D,0x38,0xFF}, {0xE9,0xC7,0xB7,0xFF}, {0xB8,0x5F,0x60,0xFF}, {0x3A,0x6B,0x70,0xFF}, {0x4D,0x83,0x85,0xFF}, {0xE9,0xC7,0xB7,0xFF}, {0xD0,0x72,0x67,0xFF}},
|
||||
[FLINT_THEME_SAGE] = {{0x1F,0x2A,0x22,0xFF}, {0x2D,0x3A,0x30,0xFF}, {0xC7,0xD4,0xC0,0xFF}, {0x5F,0x81,0x65,0xFF}, {0x3C,0x54,0x40,0xFF}, {0x4E,0x66,0x50,0xFF}, {0xC7,0xD4,0xC0,0xFF}, {0x8B,0xA0,0x70,0xFF}},
|
||||
[FLINT_THEME_INK] = {{0x25,0x1A,0x12,0xFF}, {0x33,0x24,0x18,0xFF}, {0xF1,0xD8,0xB0,0xFF}, {0xA3,0x65,0x32,0xFF}, {0x5A,0x3C,0x24,0xFF}, {0x72,0x4B,0x2C,0xFF}, {0xF1,0xD8,0xB0,0xFF}, {0xD5,0x91,0x52,0xFF}},
|
||||
[FLINT_THEME_MONO] = {{0x00,0x00,0x00,0xFF}, {0x12,0x12,0x12,0xFF}, {0xFF,0xFF,0xFF,0xFF}, {0xFF,0xFF,0xFF,0xFF}, {0x22,0x22,0x22,0xFF}, {0x3A,0x3A,0x3A,0xFF}, {0xFF,0xFF,0xFF,0xFF}, {0xFF,0xFF,0xFF,0xFF}}
|
||||
};
|
||||
|
||||
FlintThemeId
|
||||
|
||||
@@ -102,17 +102,58 @@ int
|
||||
flint_web_sync_window_size(void)
|
||||
{
|
||||
#if defined(PLATFORM_WEB)
|
||||
static int pending_width = 0;
|
||||
static int pending_height = 0;
|
||||
static int stable_frames = 0;
|
||||
int width;
|
||||
int height;
|
||||
int current_width;
|
||||
int current_height;
|
||||
int delta_w;
|
||||
int delta_h;
|
||||
int storage_syncing;
|
||||
|
||||
storage_syncing = EM_ASM_INT({
|
||||
return Module.__inbeStorageSyncing || Module.__inbeStorageSyncPending ? 1 : 0;
|
||||
});
|
||||
if(storage_syncing)
|
||||
return 0;
|
||||
|
||||
flint_web_viewport_size(GetScreenWidth(), GetScreenHeight(), &width, &height);
|
||||
if(width == GetScreenWidth() && height == GetScreenHeight())
|
||||
current_width = GetScreenWidth();
|
||||
current_height = GetScreenHeight();
|
||||
delta_w = width - current_width;
|
||||
delta_h = height - current_height;
|
||||
if(delta_w < 0)
|
||||
delta_w = -delta_w;
|
||||
if(delta_h < 0)
|
||||
delta_h = -delta_h;
|
||||
|
||||
if(width == current_width && height == current_height) {
|
||||
pending_width = 0;
|
||||
pending_height = 0;
|
||||
stable_frames = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(delta_w <= 1 && delta_h <= 1)
|
||||
return 0;
|
||||
|
||||
if(width != pending_width || height != pending_height) {
|
||||
pending_width = width;
|
||||
pending_height = height;
|
||||
stable_frames = 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
stable_frames++;
|
||||
if(stable_frames < 2 || IsMouseButtonDown(MOUSE_BUTTON_LEFT))
|
||||
return 0;
|
||||
|
||||
#if defined(PLATFORM_WEB)
|
||||
EM_ASM({
|
||||
const frame = document.getElementById("canvas-frame");
|
||||
if(frame) {
|
||||
if(frame && (frame.style.width !== ($0 + "px") || frame.style.height !== ($1 + "px"))) {
|
||||
frame.style.width = $0 + "px";
|
||||
frame.style.height = $1 + "px";
|
||||
}
|
||||
@@ -121,6 +162,9 @@ flint_web_sync_window_size(void)
|
||||
SetWindowSize(width, height);
|
||||
flint_set_view_size(width, height);
|
||||
flint_dpi_update(width, height);
|
||||
pending_width = 0;
|
||||
pending_height = 0;
|
||||
stable_frames = 0;
|
||||
return 1;
|
||||
#else
|
||||
return 0;
|
||||
|
||||
@@ -41,7 +41,7 @@ Meditace
|
||||
Meditace
|
||||
---
|
||||
[meditation_manual_text]
|
||||
Vyberte délku, stiskněte spustit a pohodlně se posaďte. Nechte pozornost spočinout na dechu. Když se mysl zatoulá, jemně se vraťte k dýchání. Zvuk gongu označí začátek a konec sezení.
|
||||
Vyberte hudbu, pokud pomáhá sezení zklidnit, a pohodlně se posaďte. Nechte pozornost spočinout na dechu. Když vás myšlenky odvedou, jasně si toho všimněte a vraťte se bez úsilí. Gong označí začátek i konec.
|
||||
---
|
||||
[meditation_music_settings_title]
|
||||
Meditační hudba
|
||||
@@ -67,6 +67,9 @@ Stáhnout audio znovu
|
||||
[meditation_music_test_button]
|
||||
Vyzkoušet přehrání
|
||||
---
|
||||
[meditation_music_stop_test_button]
|
||||
Zastavit test
|
||||
---
|
||||
[duration_5m]
|
||||
5m
|
||||
---
|
||||
@@ -112,6 +115,12 @@ Zahodit
|
||||
[all_progress_lost_message]
|
||||
Veškerý postup bude ztracen.
|
||||
---
|
||||
[meditation_under_minute_exit_message]
|
||||
Toto se neuloží.
|
||||
---
|
||||
[meditation_save_elapsed_message]
|
||||
Uložit tuto meditaci před ukončením?
|
||||
---
|
||||
[exit_button]
|
||||
Ukončit
|
||||
---
|
||||
@@ -139,30 +148,39 @@ KOLO %d
|
||||
[settings_title]
|
||||
Nastavení
|
||||
---
|
||||
[settings_tab_breathing]
|
||||
[practice_config_title]
|
||||
Cvičení
|
||||
---
|
||||
[settings_section_breathing]
|
||||
Dýchání
|
||||
---
|
||||
[settings_tab_session]
|
||||
[settings_section_session]
|
||||
Sezení
|
||||
---
|
||||
[settings_tab_app]
|
||||
Aplikace
|
||||
---
|
||||
[settings_tab_data_about]
|
||||
Data a informace
|
||||
[settings_tab_theme]
|
||||
Motiv
|
||||
---
|
||||
[settings_tab_sound]
|
||||
[settings_tab_device]
|
||||
Zařízení
|
||||
---
|
||||
[settings_section_sound]
|
||||
Zvuk
|
||||
---
|
||||
[settings_tab_appearance]
|
||||
[settings_section_appearance]
|
||||
Vzhled
|
||||
---
|
||||
[settings_tab_language]
|
||||
[settings_section_language]
|
||||
Jazyk
|
||||
---
|
||||
[settings_tab_data]
|
||||
Data
|
||||
---
|
||||
[settings_section_data]
|
||||
Data
|
||||
---
|
||||
[settings_tab_about]
|
||||
O aplikaci
|
||||
---
|
||||
@@ -185,6 +203,15 @@ Pocatecni rychlost
|
||||
[modify_start_speed_button]
|
||||
Upravit pocatecni rychlost
|
||||
---
|
||||
[breath_animation_label]
|
||||
Breathing animation
|
||||
---
|
||||
[breath_animation_linear]
|
||||
Linear
|
||||
---
|
||||
[breath_animation_in_out]
|
||||
In / Out
|
||||
---
|
||||
[progressive_start_speed_editor_title]
|
||||
Pocatecni rychlost
|
||||
---
|
||||
@@ -234,12 +261,6 @@ Další
|
||||
Brzy...
|
||||
---
|
||||
|
||||
[data_management_label]
|
||||
Správa dat
|
||||
---
|
||||
[data_management_button]
|
||||
Spravovat data
|
||||
---
|
||||
[total_sessions_label]
|
||||
Celkem sezení: %d
|
||||
---
|
||||
@@ -303,14 +324,6 @@ Delete cancelled
|
||||
[deleted_sessions]
|
||||
Deleted %lld sessions
|
||||
---
|
||||
[version_label]
|
||||
Verze %s
|
||||
---
|
||||
[about_description]
|
||||
Inner Breeze je jednoduchá aplikace
|
||||
pro dechovou meditaci, která vám pomůže
|
||||
uvolnit se a najít klid.
|
||||
---
|
||||
[toggle_off]
|
||||
VYP
|
||||
---
|
||||
|
||||
@@ -41,7 +41,7 @@ Meditation
|
||||
Meditation
|
||||
---
|
||||
[meditation_manual_text]
|
||||
Wähle eine Dauer, drücke Start und setze dich bequem hin. Lass deine Aufmerksamkeit auf dem Atem ruhen. Wenn die Gedanken abschweifen, kehre sanft zum Atmen zurück. Ein Gong markiert Anfang und Ende der Sitzung.
|
||||
Wähle Musik, wenn sie die Sitzung ruhiger macht, und setze dich bequem hin. Lass die Aufmerksamkeit auf dem Atem ruhen. Wenn Gedanken dich wegziehen, bemerke es klar und kehre ohne Druck zurück. Ein Gong markiert Anfang und Ende.
|
||||
---
|
||||
[meditation_music_settings_title]
|
||||
Meditationsmusik
|
||||
@@ -67,6 +67,9 @@ Audio erneut herunterladen
|
||||
[meditation_music_test_button]
|
||||
Testwiedergabe
|
||||
---
|
||||
[meditation_music_stop_test_button]
|
||||
Test stoppen
|
||||
---
|
||||
[duration_5m]
|
||||
5m
|
||||
---
|
||||
@@ -112,6 +115,12 @@ Verwerfen
|
||||
[all_progress_lost_message]
|
||||
Alle Fortschritte gehen verloren.
|
||||
---
|
||||
[meditation_under_minute_exit_message]
|
||||
Dies wird nicht gespeichert.
|
||||
---
|
||||
[meditation_save_elapsed_message]
|
||||
Diese Meditation vor dem Beenden speichern?
|
||||
---
|
||||
[exit_button]
|
||||
Beenden
|
||||
---
|
||||
@@ -139,30 +148,39 @@ RUNDE %d
|
||||
[settings_title]
|
||||
Einstellungen
|
||||
---
|
||||
[settings_tab_breathing]
|
||||
[practice_config_title]
|
||||
Praxis
|
||||
---
|
||||
[settings_section_breathing]
|
||||
Atmung
|
||||
---
|
||||
[settings_tab_session]
|
||||
[settings_section_session]
|
||||
Sitzung
|
||||
---
|
||||
[settings_tab_app]
|
||||
App
|
||||
---
|
||||
[settings_tab_data_about]
|
||||
Daten & Info
|
||||
[settings_tab_theme]
|
||||
Design
|
||||
---
|
||||
[settings_tab_sound]
|
||||
[settings_tab_device]
|
||||
Gerät
|
||||
---
|
||||
[settings_section_sound]
|
||||
Ton
|
||||
---
|
||||
[settings_tab_appearance]
|
||||
[settings_section_appearance]
|
||||
Darstellung
|
||||
---
|
||||
[settings_tab_language]
|
||||
[settings_section_language]
|
||||
Sprache
|
||||
---
|
||||
[settings_tab_data]
|
||||
Daten
|
||||
---
|
||||
[settings_section_data]
|
||||
Daten
|
||||
---
|
||||
[settings_tab_about]
|
||||
Über
|
||||
---
|
||||
@@ -185,6 +203,15 @@ Startgeschwindigkeit
|
||||
[modify_start_speed_button]
|
||||
Startgeschwindigkeit andern
|
||||
---
|
||||
[breath_animation_label]
|
||||
Breathing animation
|
||||
---
|
||||
[breath_animation_linear]
|
||||
Linear
|
||||
---
|
||||
[breath_animation_in_out]
|
||||
In / Out
|
||||
---
|
||||
[progressive_start_speed_editor_title]
|
||||
Startgeschwindigkeit
|
||||
---
|
||||
@@ -234,12 +261,6 @@ Weiter
|
||||
Demnächst...
|
||||
---
|
||||
|
||||
[data_management_label]
|
||||
Datenverwaltung
|
||||
---
|
||||
[data_management_button]
|
||||
Daten verwalten
|
||||
---
|
||||
[total_sessions_label]
|
||||
Gesamtsitzungen: %d
|
||||
---
|
||||
@@ -303,14 +324,6 @@ Delete cancelled
|
||||
[deleted_sessions]
|
||||
Deleted %lld sessions
|
||||
---
|
||||
[version_label]
|
||||
Version %s
|
||||
---
|
||||
[about_description]
|
||||
Inner Breeze ist eine einfache Atem-
|
||||
Meditations-App, die Ihnen hilft, sich zu
|
||||
entspannen und Ruhe zu finden.
|
||||
---
|
||||
[toggle_off]
|
||||
AUS
|
||||
---
|
||||
@@ -364,7 +377,7 @@ Folgen Sie einfach 4 Schritten:
|
||||
3. Atmen Sie tief ein und halten Sie.
|
||||
4. Atmen Sie aus und wiederholen Sie.
|
||||
|
||||
Nutzen Sie das Zahnrad-Symbol %i, um Runden, Atemzüge, Geschwindigkeit und Pausen anzupassen.
|
||||
Nutzen Sie das Schraubenschlüssel-Symbol %i, um Runden, Atemzüge, Geschwindigkeit und Pausen anzupassen.
|
||||
---
|
||||
[tutorial_step_breathe]
|
||||
Füllen Sie Ihre Lungen vollständig, dann lassen Sie den Atem herausfließen.
|
||||
|
||||
@@ -41,7 +41,7 @@ Meditation
|
||||
Meditation
|
||||
---
|
||||
[meditation_manual_text]
|
||||
Choose a duration, press play, and sit comfortably. Let your attention rest on the breath. When your mind wanders, return gently to breathing. A gong marks the beginning and end of the session.
|
||||
Choose music if it helps the session feel steady, then sit comfortably. Let attention rest on the breath. When thoughts pull you away, notice that clearly and return without force. A gong marks the beginning and end.
|
||||
---
|
||||
[meditation_music_settings_title]
|
||||
Meditation Music
|
||||
@@ -67,6 +67,12 @@ Redownload audio
|
||||
[meditation_music_test_button]
|
||||
Test audio
|
||||
---
|
||||
[meditation_music_stop_test_button]
|
||||
Stop test
|
||||
---
|
||||
[meditation_music_attribution]
|
||||
Music by Elijah_K.
|
||||
---
|
||||
[duration_5m]
|
||||
5m
|
||||
---
|
||||
@@ -112,6 +118,12 @@ Discard
|
||||
[all_progress_lost_message]
|
||||
All progress will be lost.
|
||||
---
|
||||
[meditation_under_minute_exit_message]
|
||||
This will not be saved.
|
||||
---
|
||||
[meditation_save_elapsed_message]
|
||||
Save this meditation before exit?
|
||||
---
|
||||
[exit_button]
|
||||
Exit
|
||||
---
|
||||
@@ -139,30 +151,39 @@ ROUND %d
|
||||
[settings_title]
|
||||
Settings
|
||||
---
|
||||
[settings_tab_breathing]
|
||||
[practice_config_title]
|
||||
Practice
|
||||
---
|
||||
[settings_section_breathing]
|
||||
Breathing
|
||||
---
|
||||
[settings_tab_session]
|
||||
[settings_section_session]
|
||||
Session
|
||||
---
|
||||
[settings_tab_app]
|
||||
App
|
||||
---
|
||||
[settings_tab_data_about]
|
||||
Data & About
|
||||
[settings_tab_theme]
|
||||
Theme
|
||||
---
|
||||
[settings_tab_sound]
|
||||
[settings_tab_device]
|
||||
Device
|
||||
---
|
||||
[settings_section_sound]
|
||||
Sound
|
||||
---
|
||||
[settings_tab_appearance]
|
||||
[settings_section_appearance]
|
||||
Appearance
|
||||
---
|
||||
[settings_tab_language]
|
||||
[settings_section_language]
|
||||
Language
|
||||
---
|
||||
[settings_tab_data]
|
||||
Data
|
||||
---
|
||||
[settings_section_data]
|
||||
Data
|
||||
---
|
||||
[settings_tab_about]
|
||||
About
|
||||
---
|
||||
@@ -203,6 +224,15 @@ Start speed
|
||||
[modify_start_speed_button]
|
||||
Modify start speed
|
||||
---
|
||||
[breath_animation_label]
|
||||
Breathing animation
|
||||
---
|
||||
[breath_animation_linear]
|
||||
Linear
|
||||
---
|
||||
[breath_animation_in_out]
|
||||
In / Out
|
||||
---
|
||||
[progressive_start_speed_editor_title]
|
||||
Start speed
|
||||
---
|
||||
@@ -252,12 +282,6 @@ Next
|
||||
Coming soon...
|
||||
---
|
||||
|
||||
[data_management_label]
|
||||
Data Management
|
||||
---
|
||||
[data_management_button]
|
||||
Manage data
|
||||
---
|
||||
[total_sessions_label]
|
||||
Total Sessions: %d
|
||||
---
|
||||
@@ -321,14 +345,6 @@ Delete cancelled
|
||||
[deleted_sessions]
|
||||
Deleted %lld sessions
|
||||
---
|
||||
[version_label]
|
||||
Version %s
|
||||
---
|
||||
[about_description]
|
||||
Inner Breeze is a simple breathing
|
||||
meditation app to help you relax
|
||||
and find your calm.
|
||||
---
|
||||
[toggle_off]
|
||||
OFF
|
||||
---
|
||||
@@ -382,7 +398,7 @@ Simply follow 4 steps:
|
||||
3. Inhale deeply and hold.
|
||||
4. Exhale and repeat.
|
||||
|
||||
Use the gear icon %i to adjust rounds, breaths, speed, and pauses.
|
||||
Use the wrench icon %i to adjust rounds, breaths, speed, and pauses.
|
||||
---
|
||||
[tutorial_step_breathe]
|
||||
Fill your lungs fully, then let the breath flow out.
|
||||
|
||||
@@ -41,7 +41,7 @@ Meditación
|
||||
Meditación
|
||||
---
|
||||
[meditation_manual_text]
|
||||
Elige una duración, pulsa reproducir y siéntate cómodamente. Deja que tu atención descanse en la respiración. Cuando la mente se distraiga, vuelve suavemente a respirar. Un gong marca el comienzo y el final de la sesión.
|
||||
Elige música si ayuda a que la sesión se sienta estable y siéntate cómodamente. Deja que la atención descanse en la respiración. Cuando los pensamientos te arrastren, obsérvalo con claridad y vuelve sin forzar. Un gong marca el inicio y el final.
|
||||
---
|
||||
[meditation_music_settings_title]
|
||||
Música de meditación
|
||||
@@ -67,6 +67,9 @@ Descargar audio de nuevo
|
||||
[meditation_music_test_button]
|
||||
Probar reproducción
|
||||
---
|
||||
[meditation_music_stop_test_button]
|
||||
Detener prueba
|
||||
---
|
||||
[duration_5m]
|
||||
5m
|
||||
---
|
||||
@@ -112,6 +115,12 @@ Descartar
|
||||
[all_progress_lost_message]
|
||||
Se perderá todo el progreso.
|
||||
---
|
||||
[meditation_under_minute_exit_message]
|
||||
Esto no se guardará.
|
||||
---
|
||||
[meditation_save_elapsed_message]
|
||||
¿Guardar esta meditación antes de salir?
|
||||
---
|
||||
[exit_button]
|
||||
Salir
|
||||
---
|
||||
@@ -139,30 +148,39 @@ RONDA %d
|
||||
[settings_title]
|
||||
Configuración
|
||||
---
|
||||
[settings_tab_breathing]
|
||||
[practice_config_title]
|
||||
Práctica
|
||||
---
|
||||
[settings_section_breathing]
|
||||
Respiración
|
||||
---
|
||||
[settings_tab_session]
|
||||
[settings_section_session]
|
||||
Sesión
|
||||
---
|
||||
[settings_tab_app]
|
||||
App
|
||||
---
|
||||
[settings_tab_data_about]
|
||||
Datos y Acerca de
|
||||
[settings_tab_theme]
|
||||
Tema
|
||||
---
|
||||
[settings_tab_sound]
|
||||
[settings_tab_device]
|
||||
Dispositivo
|
||||
---
|
||||
[settings_section_sound]
|
||||
Sonido
|
||||
---
|
||||
[settings_tab_appearance]
|
||||
[settings_section_appearance]
|
||||
Apariencia
|
||||
---
|
||||
[settings_tab_language]
|
||||
[settings_section_language]
|
||||
Idioma
|
||||
---
|
||||
[settings_tab_data]
|
||||
Datos
|
||||
---
|
||||
[settings_section_data]
|
||||
Datos
|
||||
---
|
||||
[settings_tab_about]
|
||||
Acerca de
|
||||
---
|
||||
@@ -185,6 +203,15 @@ Velocidad inicial
|
||||
[modify_start_speed_button]
|
||||
Modificar velocidad inicial
|
||||
---
|
||||
[breath_animation_label]
|
||||
Breathing animation
|
||||
---
|
||||
[breath_animation_linear]
|
||||
Linear
|
||||
---
|
||||
[breath_animation_in_out]
|
||||
In / Out
|
||||
---
|
||||
[progressive_start_speed_editor_title]
|
||||
Velocidad inicial
|
||||
---
|
||||
@@ -234,12 +261,6 @@ Más
|
||||
Próximamente...
|
||||
---
|
||||
|
||||
[data_management_label]
|
||||
Gestión de datos
|
||||
---
|
||||
[data_management_button]
|
||||
Gestionar datos
|
||||
---
|
||||
[total_sessions_label]
|
||||
Sesiones totales: %d
|
||||
---
|
||||
@@ -303,14 +324,6 @@ Delete cancelled
|
||||
[deleted_sessions]
|
||||
Deleted %lld sessions
|
||||
---
|
||||
[version_label]
|
||||
Versión %s
|
||||
---
|
||||
[about_description]
|
||||
Inner Breeze es una aplicación simple de
|
||||
meditación de respiración para ayudarle a
|
||||
relajarse y encontrar su calma.
|
||||
---
|
||||
[toggle_off]
|
||||
APAGADO
|
||||
---
|
||||
@@ -364,7 +377,7 @@ Simplemente siga 4 pasos:
|
||||
3. Inhale profundamente y retenga.
|
||||
4. Exhale y repita.
|
||||
|
||||
Use el icono de engranaje %i para ajustar rondas, respiraciones, velocidad y pausas.
|
||||
Use el icono de llave %i para ajustar rondas, respiraciones, velocidad y pausas.
|
||||
---
|
||||
[tutorial_step_breathe]
|
||||
Llene sus pulmones completamente, luego deje que el respiración fluya hacia afuera.
|
||||
|
||||
@@ -41,7 +41,7 @@ Méditation
|
||||
Méditation
|
||||
---
|
||||
[meditation_manual_text]
|
||||
Choisissez une durée, appuyez sur démarrer et asseyez-vous confortablement. Laissez votre attention se poser sur la respiration. Quand l’esprit s’égare, revenez doucement au souffle. Un gong marque le début et la fin de la séance.
|
||||
Choisissez une musique si elle aide la séance à rester stable, puis asseyez-vous confortablement. Laissez l’attention se poser sur le souffle. Quand les pensées vous emportent, voyez-le clairement et revenez sans forcer. Un gong marque le début et la fin.
|
||||
---
|
||||
[meditation_music_settings_title]
|
||||
Musique de méditation
|
||||
@@ -67,6 +67,9 @@ Retélécharger l'audio
|
||||
[meditation_music_test_button]
|
||||
Tester la lecture
|
||||
---
|
||||
[meditation_music_stop_test_button]
|
||||
Arrêter le test
|
||||
---
|
||||
[duration_5m]
|
||||
5m
|
||||
---
|
||||
@@ -112,6 +115,12 @@ Ignorer
|
||||
[all_progress_lost_message]
|
||||
Toute la progression sera perdue.
|
||||
---
|
||||
[meditation_under_minute_exit_message]
|
||||
Ce ne sera pas enregistré.
|
||||
---
|
||||
[meditation_save_elapsed_message]
|
||||
Enregistrer cette méditation avant de quitter ?
|
||||
---
|
||||
[exit_button]
|
||||
Quitter
|
||||
---
|
||||
@@ -139,30 +148,39 @@ CYCLE %d
|
||||
[settings_title]
|
||||
Réglages
|
||||
---
|
||||
[settings_tab_breathing]
|
||||
[practice_config_title]
|
||||
Pratique
|
||||
---
|
||||
[settings_section_breathing]
|
||||
Respiration
|
||||
---
|
||||
[settings_tab_session]
|
||||
[settings_section_session]
|
||||
Séance
|
||||
---
|
||||
[settings_tab_app]
|
||||
App
|
||||
---
|
||||
[settings_tab_data_about]
|
||||
Données et à propos
|
||||
[settings_tab_theme]
|
||||
Thème
|
||||
---
|
||||
[settings_tab_sound]
|
||||
[settings_tab_device]
|
||||
Appareil
|
||||
---
|
||||
[settings_section_sound]
|
||||
Son
|
||||
---
|
||||
[settings_tab_appearance]
|
||||
[settings_section_appearance]
|
||||
Apparence
|
||||
---
|
||||
[settings_tab_language]
|
||||
[settings_section_language]
|
||||
Langue
|
||||
---
|
||||
[settings_tab_data]
|
||||
Données
|
||||
---
|
||||
[settings_section_data]
|
||||
Données
|
||||
---
|
||||
[settings_tab_about]
|
||||
À propos
|
||||
---
|
||||
@@ -185,6 +203,15 @@ Vitesse de depart
|
||||
[modify_start_speed_button]
|
||||
Modifier la vitesse de depart
|
||||
---
|
||||
[breath_animation_label]
|
||||
Breathing animation
|
||||
---
|
||||
[breath_animation_linear]
|
||||
Linear
|
||||
---
|
||||
[breath_animation_in_out]
|
||||
In / Out
|
||||
---
|
||||
[progressive_start_speed_editor_title]
|
||||
Vitesse de depart
|
||||
---
|
||||
@@ -234,12 +261,6 @@ Suivant
|
||||
Bientôt...
|
||||
---
|
||||
|
||||
[data_management_label]
|
||||
Gestion des données
|
||||
---
|
||||
[data_management_button]
|
||||
Gérer les données
|
||||
---
|
||||
[total_sessions_label]
|
||||
Séances totales : %d
|
||||
---
|
||||
@@ -303,14 +324,6 @@ Delete cancelled
|
||||
[deleted_sessions]
|
||||
Deleted %lld sessions
|
||||
---
|
||||
[version_label]
|
||||
Version %s
|
||||
---
|
||||
[about_description]
|
||||
Inner Breeze est une application simple de
|
||||
méditation respiratoire pour vous aider à
|
||||
vous détendre et retrouver votre calme.
|
||||
---
|
||||
[toggle_off]
|
||||
OFF
|
||||
---
|
||||
@@ -364,7 +377,7 @@ Suivez simplement 4 étapes :
|
||||
3. Inspirez profondément et retenez.
|
||||
4. Expirez et répétez.
|
||||
|
||||
Utilisez l'icône d'engrenage %i pour régler les cycles, respirations, vitesse et pauses.
|
||||
Utilisez l'icône de clé %i pour régler les cycles, respirations, vitesse et pauses.
|
||||
---
|
||||
[tutorial_step_breathe]
|
||||
Remplissez complètement vos poumons, puis laissez le souffle sortir.
|
||||
|
||||
@@ -41,7 +41,7 @@ Meditasi
|
||||
Meditasi
|
||||
---
|
||||
[meditation_manual_text]
|
||||
Pilih durasi, tekan mulai, lalu duduk dengan nyaman. Biarkan perhatian beristirahat pada napas. Saat pikiran mengembara, kembali perlahan ke pernapasan. Gong menandai awal dan akhir sesi.
|
||||
Pilih musik jika membantu sesi terasa stabil, lalu duduk dengan nyaman. Biarkan perhatian beristirahat pada napas. Saat pikiran menarikmu pergi, sadari dengan jelas dan kembali tanpa memaksa. Gong menandai awal dan akhir.
|
||||
---
|
||||
[meditation_music_settings_title]
|
||||
Musik meditasi
|
||||
@@ -67,6 +67,9 @@ Unduh ulang audio
|
||||
[meditation_music_test_button]
|
||||
Coba putar
|
||||
---
|
||||
[meditation_music_stop_test_button]
|
||||
Hentikan tes
|
||||
---
|
||||
[duration_5m]
|
||||
5m
|
||||
---
|
||||
@@ -112,6 +115,12 @@ Buang
|
||||
[all_progress_lost_message]
|
||||
Semua kemajuan akan hilang.
|
||||
---
|
||||
[meditation_under_minute_exit_message]
|
||||
Ini tidak akan disimpan.
|
||||
---
|
||||
[meditation_save_elapsed_message]
|
||||
Simpan meditasi ini sebelum keluar?
|
||||
---
|
||||
[exit_button]
|
||||
Keluar
|
||||
---
|
||||
@@ -139,30 +148,39 @@ RONDE %d
|
||||
[settings_title]
|
||||
Pengaturan
|
||||
---
|
||||
[settings_tab_breathing]
|
||||
[practice_config_title]
|
||||
Latihan
|
||||
---
|
||||
[settings_section_breathing]
|
||||
Pernapasan
|
||||
---
|
||||
[settings_tab_session]
|
||||
[settings_section_session]
|
||||
Sesi
|
||||
---
|
||||
[settings_tab_app]
|
||||
Aplikasi
|
||||
---
|
||||
[settings_tab_data_about]
|
||||
Data & Tentang
|
||||
[settings_tab_theme]
|
||||
Tema
|
||||
---
|
||||
[settings_tab_sound]
|
||||
[settings_tab_device]
|
||||
Perangkat
|
||||
---
|
||||
[settings_section_sound]
|
||||
Suara
|
||||
---
|
||||
[settings_tab_appearance]
|
||||
[settings_section_appearance]
|
||||
Tampilan
|
||||
---
|
||||
[settings_tab_language]
|
||||
[settings_section_language]
|
||||
Bahasa
|
||||
---
|
||||
[settings_tab_data]
|
||||
Data
|
||||
---
|
||||
[settings_section_data]
|
||||
Data
|
||||
---
|
||||
[settings_tab_about]
|
||||
Tentang
|
||||
---
|
||||
@@ -185,6 +203,15 @@ Kecepatan awal
|
||||
[modify_start_speed_button]
|
||||
Ubah kecepatan awal
|
||||
---
|
||||
[breath_animation_label]
|
||||
Breathing animation
|
||||
---
|
||||
[breath_animation_linear]
|
||||
Linear
|
||||
---
|
||||
[breath_animation_in_out]
|
||||
In / Out
|
||||
---
|
||||
[progressive_start_speed_editor_title]
|
||||
Kecepatan awal
|
||||
---
|
||||
@@ -234,12 +261,6 @@ Lanjut
|
||||
Segera hadir...
|
||||
---
|
||||
|
||||
[data_management_label]
|
||||
Manajemen Data
|
||||
---
|
||||
[data_management_button]
|
||||
Kelola data
|
||||
---
|
||||
[total_sessions_label]
|
||||
Total Sesi: %d
|
||||
---
|
||||
@@ -303,12 +324,6 @@ Delete cancelled
|
||||
[deleted_sessions]
|
||||
Deleted %lld sessions
|
||||
---
|
||||
[version_label]
|
||||
Versi %s
|
||||
---
|
||||
[about_description]
|
||||
Inner Breeze adalah aplikasi meditasi pernapasan sederhana untuk membantu Anda rileks dan menemukan ketenangan.
|
||||
---
|
||||
[toggle_off]
|
||||
MATI
|
||||
---
|
||||
@@ -362,7 +377,7 @@ Ikuti 4 langkah sederhana:
|
||||
3. Tarik napas dalam dan tahan.
|
||||
4. Buang napas dan ulangi.
|
||||
|
||||
Gunakan ikon roda gigi %i untuk menyesuaikan ronde, nafas, kecepatan, dan jeda.
|
||||
Gunakan ikon kunci pas %i untuk menyesuaikan ronde, nafas, kecepatan, dan jeda.
|
||||
---
|
||||
[tutorial_step_breathe]
|
||||
Isi paru-paru Anda sepenuhnya, lalu biarkan napas keluar.
|
||||
|
||||
@@ -41,7 +41,7 @@ Meditazione
|
||||
Meditazione
|
||||
---
|
||||
[meditation_manual_text]
|
||||
Scegli una durata, premi avvia e siediti comodamente. Lascia che la tua attenzione si riposi sul respiro. Quando la mente vaga, ritorna gentilmente al respiro. Un gong segnala l'inizio e la fine della sessione.
|
||||
Scegli la musica se aiuta la sessione a sentirsi stabile, poi siediti comodamente. Lascia che l'attenzione riposi sul respiro. Quando i pensieri ti portano via, notalo con chiarezza e torna senza forzare. Un gong segna l'inizio e la fine.
|
||||
---
|
||||
[meditation_music_settings_title]
|
||||
Musica Meditazione
|
||||
@@ -67,6 +67,9 @@ Riscarica audio
|
||||
[meditation_music_test_button]
|
||||
Test audio
|
||||
---
|
||||
[meditation_music_stop_test_button]
|
||||
Ferma test
|
||||
---
|
||||
[duration_5m]
|
||||
5 min
|
||||
---
|
||||
@@ -112,6 +115,12 @@ Scarta
|
||||
[all_progress_lost_message]
|
||||
Tutti i progressi andranno persi.
|
||||
---
|
||||
[meditation_under_minute_exit_message]
|
||||
Non verrà salvato.
|
||||
---
|
||||
[meditation_save_elapsed_message]
|
||||
Salvare questa meditazione prima di uscire?
|
||||
---
|
||||
[exit_button]
|
||||
Esci
|
||||
---
|
||||
@@ -139,30 +148,39 @@ ROUND %d
|
||||
[settings_title]
|
||||
Impostazioni
|
||||
---
|
||||
[settings_tab_breathing]
|
||||
[practice_config_title]
|
||||
Pratica
|
||||
---
|
||||
[settings_section_breathing]
|
||||
Respirazione
|
||||
---
|
||||
[settings_tab_session]
|
||||
[settings_section_session]
|
||||
Sessione
|
||||
---
|
||||
[settings_tab_app]
|
||||
App
|
||||
---
|
||||
[settings_tab_data_about]
|
||||
Dati e Info
|
||||
[settings_tab_theme]
|
||||
Tema
|
||||
---
|
||||
[settings_tab_sound]
|
||||
[settings_tab_device]
|
||||
Dispositivo
|
||||
---
|
||||
[settings_section_sound]
|
||||
Suono
|
||||
---
|
||||
[settings_tab_appearance]
|
||||
[settings_section_appearance]
|
||||
Aspetto
|
||||
---
|
||||
[settings_tab_language]
|
||||
[settings_section_language]
|
||||
Lingua
|
||||
---
|
||||
[settings_tab_data]
|
||||
Dati
|
||||
---
|
||||
[settings_section_data]
|
||||
Dati
|
||||
---
|
||||
[settings_tab_about]
|
||||
Info
|
||||
---
|
||||
@@ -202,6 +220,15 @@ Velocità iniziale
|
||||
[modify_start_speed_button]
|
||||
Modifica velocità iniziale
|
||||
---
|
||||
[breath_animation_label]
|
||||
Breathing animation
|
||||
---
|
||||
[breath_animation_linear]
|
||||
Linear
|
||||
---
|
||||
[breath_animation_in_out]
|
||||
In / Out
|
||||
---
|
||||
[progressive_start_speed_editor_title]
|
||||
Velocità iniziale
|
||||
---
|
||||
@@ -250,12 +277,6 @@ Avanti
|
||||
[coming_soon_label]
|
||||
Prossimamente...
|
||||
---
|
||||
[data_management_label]
|
||||
Gestione Dati
|
||||
---
|
||||
[data_management_button]
|
||||
Gestisci dati
|
||||
---
|
||||
[total_sessions_label]
|
||||
Sessioni Totali: %d
|
||||
---
|
||||
@@ -319,14 +340,6 @@ Eliminazione annullata
|
||||
[deleted_sessions]
|
||||
Eliminate %lld sessioni
|
||||
---
|
||||
[version_label]
|
||||
Versione %s
|
||||
---
|
||||
[about_description]
|
||||
Inner Breeze è una semplice app di meditazione
|
||||
respiratoria per aiutarti a rilassarti
|
||||
e trovare la tua calma.
|
||||
---
|
||||
[toggle_off]
|
||||
OFF
|
||||
---
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
瞑想
|
||||
---
|
||||
[meditation_manual_text]
|
||||
時間を選び、開始を押して、楽な姿勢で座ります。注意を呼吸に置きます。心がそれたら、やさしく呼吸へ戻ります。ゴングがセッションの始まりと終わりを知らせます。
|
||||
音楽が集中を支えてくれるなら選び、楽な姿勢で座ります。注意を呼吸に置きます。思考に引かれたら、はっきり気づき、力まず戻ります。ゴングが始まりと終わりを知らせます。
|
||||
---
|
||||
[meditation_music_settings_title]
|
||||
瞑想音楽
|
||||
@@ -67,6 +67,9 @@
|
||||
[meditation_music_test_button]
|
||||
試聴
|
||||
---
|
||||
[meditation_music_stop_test_button]
|
||||
テスト停止
|
||||
---
|
||||
[duration_5m]
|
||||
5分
|
||||
---
|
||||
@@ -112,6 +115,12 @@
|
||||
[all_progress_lost_message]
|
||||
すべての進捗が失われます。
|
||||
---
|
||||
[meditation_under_minute_exit_message]
|
||||
これは保存されません。
|
||||
---
|
||||
[meditation_save_elapsed_message]
|
||||
終了する前にこの瞑想を保存しますか?
|
||||
---
|
||||
[exit_button]
|
||||
終了
|
||||
---
|
||||
@@ -139,30 +148,39 @@
|
||||
[settings_title]
|
||||
設定
|
||||
---
|
||||
[settings_tab_breathing]
|
||||
[practice_config_title]
|
||||
練習
|
||||
---
|
||||
[settings_section_breathing]
|
||||
呼吸
|
||||
---
|
||||
[settings_tab_session]
|
||||
[settings_section_session]
|
||||
セッション
|
||||
---
|
||||
[settings_tab_app]
|
||||
アプリ
|
||||
---
|
||||
[settings_tab_data_about]
|
||||
データと情報
|
||||
[settings_tab_theme]
|
||||
テーマ
|
||||
---
|
||||
[settings_tab_sound]
|
||||
[settings_tab_device]
|
||||
デバイス
|
||||
---
|
||||
[settings_section_sound]
|
||||
サウンド
|
||||
---
|
||||
[settings_tab_appearance]
|
||||
[settings_section_appearance]
|
||||
外観
|
||||
---
|
||||
[settings_tab_language]
|
||||
[settings_section_language]
|
||||
言語
|
||||
---
|
||||
[settings_tab_data]
|
||||
データ
|
||||
---
|
||||
[settings_section_data]
|
||||
データ
|
||||
---
|
||||
[settings_tab_about]
|
||||
情報
|
||||
---
|
||||
@@ -185,6 +203,15 @@
|
||||
[modify_start_speed_button]
|
||||
開始速度を変更
|
||||
---
|
||||
[breath_animation_label]
|
||||
Breathing animation
|
||||
---
|
||||
[breath_animation_linear]
|
||||
Linear
|
||||
---
|
||||
[breath_animation_in_out]
|
||||
In / Out
|
||||
---
|
||||
[progressive_start_speed_editor_title]
|
||||
開始速度
|
||||
---
|
||||
@@ -234,12 +261,6 @@
|
||||
近日公開...
|
||||
---
|
||||
|
||||
[data_management_label]
|
||||
データ管理
|
||||
---
|
||||
[data_management_button]
|
||||
データ管理
|
||||
---
|
||||
[total_sessions_label]
|
||||
総セッション数:%d
|
||||
---
|
||||
@@ -303,14 +324,6 @@ Delete cancelled
|
||||
[deleted_sessions]
|
||||
Deleted %lld sessions
|
||||
---
|
||||
[version_label]
|
||||
バージョン %s
|
||||
---
|
||||
[about_description]
|
||||
Inner Breeze は、気持ちを落ち着かせて
|
||||
リラックスするためのシンプルな
|
||||
呼吸瞑想アプリです。
|
||||
---
|
||||
[toggle_off]
|
||||
OFF
|
||||
---
|
||||
|
||||
@@ -41,7 +41,7 @@ Inner Breeze
|
||||
명상
|
||||
---
|
||||
[meditation_manual_text]
|
||||
시간을 선택하고 시작 버튼을 누른 후 편안하게 앉으세요. 호흡에 집중하세요. 마음이 흩어지면 부드럽게 호흡으로 돌아옵니다. 공 소리가 세션의 시작과 끝을 알립니다.
|
||||
음악이 세션을 안정되게 해 준다면 선택한 뒤 편안하게 앉으세요. 주의를 호흡에 둡니다. 생각에 끌려가면 분명히 알아차리고 힘주지 말고 돌아오세요. 공 소리가 시작과 끝을 알립니다.
|
||||
---
|
||||
[meditation_music_settings_title]
|
||||
명상 음악
|
||||
@@ -67,6 +67,9 @@ Inner Breeze
|
||||
[meditation_music_test_button]
|
||||
오디오 테스트
|
||||
---
|
||||
[meditation_music_stop_test_button]
|
||||
테스트 중지
|
||||
---
|
||||
[duration_5m]
|
||||
5분
|
||||
---
|
||||
@@ -112,6 +115,12 @@ Inner Breeze
|
||||
[all_progress_lost_message]
|
||||
모든 진행 상황이 손실됩니다.
|
||||
---
|
||||
[meditation_under_minute_exit_message]
|
||||
저장되지 않습니다.
|
||||
---
|
||||
[meditation_save_elapsed_message]
|
||||
나가기 전에 이 명상을 저장할까요?
|
||||
---
|
||||
[exit_button]
|
||||
종료
|
||||
---
|
||||
@@ -139,30 +148,39 @@ Inner Breeze
|
||||
[settings_title]
|
||||
설정
|
||||
---
|
||||
[settings_tab_breathing]
|
||||
[practice_config_title]
|
||||
연습
|
||||
---
|
||||
[settings_section_breathing]
|
||||
호흡
|
||||
---
|
||||
[settings_tab_session]
|
||||
[settings_section_session]
|
||||
세션
|
||||
---
|
||||
[settings_tab_app]
|
||||
앱
|
||||
---
|
||||
[settings_tab_data_about]
|
||||
데이터 및 정보
|
||||
[settings_tab_theme]
|
||||
테마
|
||||
---
|
||||
[settings_tab_sound]
|
||||
[settings_tab_device]
|
||||
기기
|
||||
---
|
||||
[settings_section_sound]
|
||||
사운드
|
||||
---
|
||||
[settings_tab_appearance]
|
||||
[settings_section_appearance]
|
||||
외관
|
||||
---
|
||||
[settings_tab_language]
|
||||
[settings_section_language]
|
||||
언어
|
||||
---
|
||||
[settings_tab_data]
|
||||
데이터
|
||||
---
|
||||
[settings_section_data]
|
||||
데이터
|
||||
---
|
||||
[settings_tab_about]
|
||||
정보
|
||||
---
|
||||
@@ -202,6 +220,15 @@ Inner Breeze
|
||||
[modify_start_speed_button]
|
||||
시작 속도 수정
|
||||
---
|
||||
[breath_animation_label]
|
||||
Breathing animation
|
||||
---
|
||||
[breath_animation_linear]
|
||||
Linear
|
||||
---
|
||||
[breath_animation_in_out]
|
||||
In / Out
|
||||
---
|
||||
[progressive_start_speed_editor_title]
|
||||
시작 속도
|
||||
---
|
||||
@@ -250,12 +277,6 @@ Inner Breeze
|
||||
[coming_soon_label]
|
||||
출시 예정
|
||||
---
|
||||
[data_management_label]
|
||||
데이터 관리
|
||||
---
|
||||
[data_management_button]
|
||||
데이터 관리
|
||||
---
|
||||
[total_sessions_label]
|
||||
총 세션: %d
|
||||
---
|
||||
@@ -319,12 +340,6 @@ Inner Breeze
|
||||
[deleted_sessions]
|
||||
%lld개 세션 삭제됨
|
||||
---
|
||||
[version_label]
|
||||
버전 %s
|
||||
---
|
||||
[about_description]
|
||||
Inner Breeze는 편안함과 평온을 찾을 수 있도록 도와주는 간단한 호흡 명상 앱입니다.
|
||||
---
|
||||
[toggle_off]
|
||||
꺼짐
|
||||
---
|
||||
|
||||
@@ -41,7 +41,7 @@ Meditação
|
||||
Meditação
|
||||
---
|
||||
[meditation_manual_text]
|
||||
Escolha uma duração, pressione iniciar e sente-se confortavelmente. Deixe a atenção repousar na respiração. Quando a mente se distrair, volte suavemente à respiração. Um gongo marca o começo e o fim da sessão.
|
||||
Escolha uma música se ela ajudar a sessão a ficar estável e sente-se confortavelmente. Deixe a atenção repousar na respiração. Quando os pensamentos puxarem você, perceba com clareza e volte sem forçar. Um gongo marca o começo e o fim.
|
||||
---
|
||||
[meditation_music_settings_title]
|
||||
Música de meditação
|
||||
@@ -67,6 +67,9 @@ Baixar áudio novamente
|
||||
[meditation_music_test_button]
|
||||
Testar reprodução
|
||||
---
|
||||
[meditation_music_stop_test_button]
|
||||
Parar teste
|
||||
---
|
||||
[duration_5m]
|
||||
5m
|
||||
---
|
||||
@@ -112,6 +115,12 @@ Descartar
|
||||
[all_progress_lost_message]
|
||||
Todo o progresso será perdido.
|
||||
---
|
||||
[meditation_under_minute_exit_message]
|
||||
Isso não será salvo.
|
||||
---
|
||||
[meditation_save_elapsed_message]
|
||||
Salvar esta meditação antes de sair?
|
||||
---
|
||||
[exit_button]
|
||||
Sair
|
||||
---
|
||||
@@ -139,30 +148,39 @@ RODADA %d
|
||||
[settings_title]
|
||||
Configurações
|
||||
---
|
||||
[settings_tab_breathing]
|
||||
[practice_config_title]
|
||||
Prática
|
||||
---
|
||||
[settings_section_breathing]
|
||||
Respiração
|
||||
---
|
||||
[settings_tab_session]
|
||||
[settings_section_session]
|
||||
Sessão
|
||||
---
|
||||
[settings_tab_app]
|
||||
App
|
||||
---
|
||||
[settings_tab_data_about]
|
||||
Dados e sobre
|
||||
[settings_tab_theme]
|
||||
Tema
|
||||
---
|
||||
[settings_tab_sound]
|
||||
[settings_tab_device]
|
||||
Dispositivo
|
||||
---
|
||||
[settings_section_sound]
|
||||
Som
|
||||
---
|
||||
[settings_tab_appearance]
|
||||
[settings_section_appearance]
|
||||
Aparência
|
||||
---
|
||||
[settings_tab_language]
|
||||
[settings_section_language]
|
||||
Idioma
|
||||
---
|
||||
[settings_tab_data]
|
||||
Dados
|
||||
---
|
||||
[settings_section_data]
|
||||
Dados
|
||||
---
|
||||
[settings_tab_about]
|
||||
Sobre
|
||||
---
|
||||
@@ -185,6 +203,15 @@ Velocidade inicial
|
||||
[modify_start_speed_button]
|
||||
Modificar velocidade inicial
|
||||
---
|
||||
[breath_animation_label]
|
||||
Breathing animation
|
||||
---
|
||||
[breath_animation_linear]
|
||||
Linear
|
||||
---
|
||||
[breath_animation_in_out]
|
||||
In / Out
|
||||
---
|
||||
[progressive_start_speed_editor_title]
|
||||
Velocidade inicial
|
||||
---
|
||||
@@ -234,12 +261,6 @@ Mais
|
||||
Em breve...
|
||||
---
|
||||
|
||||
[data_management_label]
|
||||
Gerenciamento de dados
|
||||
---
|
||||
[data_management_button]
|
||||
Gerenciar dados
|
||||
---
|
||||
[total_sessions_label]
|
||||
Sessões totais: %d
|
||||
---
|
||||
@@ -303,14 +324,6 @@ Delete cancelled
|
||||
[deleted_sessions]
|
||||
Deleted %lld sessions
|
||||
---
|
||||
[version_label]
|
||||
Versão %s
|
||||
---
|
||||
[about_description]
|
||||
Inner Breeze é um app simples de
|
||||
meditação respiratória para ajudar você a
|
||||
relaxar e encontrar calma.
|
||||
---
|
||||
[toggle_off]
|
||||
OFF
|
||||
---
|
||||
@@ -364,7 +377,7 @@ Basta seguir 4 passos:
|
||||
3. Inspire profundamente e segure.
|
||||
4. Expire e repita.
|
||||
|
||||
Use o ícone de engrenagem %i para ajustar rodadas, respirações, velocidade e pausas.
|
||||
Use o ícone de chave inglesa %i para ajustar rodadas, respirações, velocidade e pausas.
|
||||
---
|
||||
[tutorial_step_breathe]
|
||||
Encha totalmente os pulmões e deixe o ar sair.
|
||||
|
||||
@@ -41,7 +41,7 @@ Wim Hof 呼吸
|
||||
冥想
|
||||
---
|
||||
[meditation_manual_text]
|
||||
选择时长,点击开始,然后舒适地坐下。把注意力放在呼吸上。当思绪游走时,轻轻回到呼吸。钟声会提示练习的开始和结束。
|
||||
如果音乐能让练习更安稳,就先选择音乐,然后舒适地坐下。把注意力放在呼吸上。被念头带走时,清楚地觉察,再不费力地回来。钟声会提示开始和结束。
|
||||
---
|
||||
[meditation_music_settings_title]
|
||||
冥想音乐
|
||||
@@ -67,6 +67,9 @@ Wim Hof 呼吸
|
||||
[meditation_music_test_button]
|
||||
测试播放
|
||||
---
|
||||
[meditation_music_stop_test_button]
|
||||
停止测试
|
||||
---
|
||||
[duration_5m]
|
||||
5分钟
|
||||
---
|
||||
@@ -112,6 +115,12 @@ Wim Hof 呼吸
|
||||
[all_progress_lost_message]
|
||||
所有进度都会丢失。
|
||||
---
|
||||
[meditation_under_minute_exit_message]
|
||||
这不会保存。
|
||||
---
|
||||
[meditation_save_elapsed_message]
|
||||
退出前保存这次冥想吗?
|
||||
---
|
||||
[exit_button]
|
||||
退出
|
||||
---
|
||||
@@ -139,30 +148,39 @@ Wim Hof 呼吸
|
||||
[settings_title]
|
||||
设置
|
||||
---
|
||||
[settings_tab_breathing]
|
||||
[practice_config_title]
|
||||
练习
|
||||
---
|
||||
[settings_section_breathing]
|
||||
呼吸
|
||||
---
|
||||
[settings_tab_session]
|
||||
[settings_section_session]
|
||||
练习
|
||||
---
|
||||
[settings_tab_app]
|
||||
应用
|
||||
---
|
||||
[settings_tab_data_about]
|
||||
数据与关于
|
||||
[settings_tab_theme]
|
||||
主题
|
||||
---
|
||||
[settings_tab_sound]
|
||||
[settings_tab_device]
|
||||
设备
|
||||
---
|
||||
[settings_section_sound]
|
||||
音效
|
||||
---
|
||||
[settings_tab_appearance]
|
||||
[settings_section_appearance]
|
||||
外观
|
||||
---
|
||||
[settings_tab_language]
|
||||
[settings_section_language]
|
||||
语言
|
||||
---
|
||||
[settings_tab_data]
|
||||
数据
|
||||
---
|
||||
[settings_section_data]
|
||||
数据
|
||||
---
|
||||
[settings_tab_about]
|
||||
关于
|
||||
---
|
||||
@@ -185,6 +203,15 @@ Wim Hof 呼吸
|
||||
[modify_start_speed_button]
|
||||
修改起始速度
|
||||
---
|
||||
[breath_animation_label]
|
||||
Breathing animation
|
||||
---
|
||||
[breath_animation_linear]
|
||||
Linear
|
||||
---
|
||||
[breath_animation_in_out]
|
||||
In / Out
|
||||
---
|
||||
[progressive_start_speed_editor_title]
|
||||
起始速度
|
||||
---
|
||||
@@ -234,12 +261,6 @@ Wim Hof 呼吸
|
||||
即将推出...
|
||||
---
|
||||
|
||||
[data_management_label]
|
||||
数据管理
|
||||
---
|
||||
[data_management_button]
|
||||
管理数据
|
||||
---
|
||||
[total_sessions_label]
|
||||
总练习次数:%d
|
||||
---
|
||||
@@ -303,12 +324,6 @@ Delete cancelled
|
||||
[deleted_sessions]
|
||||
Deleted %lld sessions
|
||||
---
|
||||
[version_label]
|
||||
版本 %s
|
||||
---
|
||||
[about_description]
|
||||
Inner Breeze 是一款简单的呼吸冥想应用,帮助你放松并平静下来。
|
||||
---
|
||||
[toggle_off]
|
||||
关
|
||||
---
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
exec "$APPDIR/usr/bin/inbe" "$@"
|
||||
@@ -0,0 +1,7 @@
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Name=Inner Breeze
|
||||
Exec=inbe
|
||||
Icon=inbe
|
||||
Categories=Utility;
|
||||
Terminal=false
|
||||
|
After Width: | Height: | Size: 1.4 KiB |
@@ -27,8 +27,13 @@ mkdir -p "$ASSETS_DIR"
|
||||
if [ "${INBE_REBUILD_FONTS:-0}" = "1" ]; then
|
||||
echo "Building fonts..."
|
||||
mkdir -p assets/fonts
|
||||
make -C vendor/otfchop otfchop
|
||||
vendor/otfchop/otfchop vendor/otfchop/unifont-17.0.04.otf locales/*.txt assets/fonts/locales
|
||||
OTFCHOP_DIR="${OTFCHOP_DIR:-vendor/otfchop}"
|
||||
if [ ! -x "$OTFCHOP_DIR/otfchop" ]; then
|
||||
OTFCHOP_DIR="vendor/otfchop"
|
||||
make -C "$OTFCHOP_DIR" otfchop
|
||||
fi
|
||||
"$OTFCHOP_DIR/otfchop" --size 16 "$OTFCHOP_DIR/unifont-17.0.04.otf" locales/*.txt assets/fonts/locales
|
||||
"$OTFCHOP_DIR/otfchop" --size 8 "$OTFCHOP_DIR/unifont-17.0.04.otf" locales/*.txt assets/fonts/locales-8
|
||||
else
|
||||
echo "Using versioned fonts..."
|
||||
fi
|
||||
@@ -40,6 +45,8 @@ sh flint/scripts/embed-assets.sh build/inbe_embedded_assets.c \
|
||||
assets/whm/2.jpg \
|
||||
assets/fonts/locales.png \
|
||||
assets/fonts/locales.dat \
|
||||
assets/fonts/locales-8.png \
|
||||
assets/fonts/locales-8.dat \
|
||||
assets/sounds/*.ogg
|
||||
|
||||
echo "Embedded assets generated successfully!"
|
||||
@@ -1,13 +0,0 @@
|
||||
#ifndef INBE_ANDROID_DEVICE_H
|
||||
#define INBE_ANDROID_DEVICE_H
|
||||
|
||||
#include "app.h"
|
||||
|
||||
void android_device_init(void);
|
||||
int android_device_system_dark(void);
|
||||
int android_device_orientation(void);
|
||||
void android_device_set_orientation_mode(int mode);
|
||||
void android_device_native_set_system_dark(int dark);
|
||||
void android_device_native_set_orientation(int orientation);
|
||||
|
||||
#endif
|
||||
@@ -2,15 +2,15 @@
|
||||
#define INBE_APP_H
|
||||
|
||||
#include "raylib.h"
|
||||
#include "inbe.h"
|
||||
#include "breath_engine.h"
|
||||
#include "app_fwd.h"
|
||||
#include "flint_runtime_assets.h"
|
||||
#include "flint/include/ui_icon_types.h"
|
||||
#include "habits/habits.h"
|
||||
#include "ui_icon_types.h"
|
||||
#include "screens/habits_screen.h"
|
||||
|
||||
enum {
|
||||
SETTINGS_SPEED_MIN = 1,
|
||||
SETTINGS_SPEED_MAX = 12,
|
||||
SETTINGS_SPEED_MAX = 8,
|
||||
SETTINGS_BREATHS_MIN = 15,
|
||||
SETTINGS_BREATHS_MAX = 80,
|
||||
SETTINGS_PAUSE_MIN = 0,
|
||||
@@ -39,20 +39,10 @@ enum {
|
||||
};
|
||||
|
||||
enum {
|
||||
SETTINGS_CATEGORY_PRACTICE = 0,
|
||||
SETTINGS_CATEGORY_MEDITATION = 1
|
||||
};
|
||||
|
||||
enum {
|
||||
PRACTICE_SUBTAB_BREATHING = 0,
|
||||
PRACTICE_SUBTAB_SESSION,
|
||||
PRACTICE_SUBTAB_COUNT
|
||||
};
|
||||
|
||||
enum {
|
||||
APP_SETTINGS_TAB_APP = 0,
|
||||
APP_SETTINGS_TAB_DATA_ABOUT,
|
||||
APP_SETTINGS_TAB_COUNT
|
||||
SETTINGS_TAB_DEVICE = 0,
|
||||
SETTINGS_TAB_THEME,
|
||||
SETTINGS_TAB_DATA,
|
||||
SETTINGS_TAB_COUNT
|
||||
};
|
||||
|
||||
enum {
|
||||
@@ -66,10 +56,9 @@ typedef enum {
|
||||
UIModalNone,
|
||||
UIModalConfirmExitSession,
|
||||
UIModalMeditationSetup,
|
||||
UIModalDataManagement,
|
||||
UIModalConfirmDeleteData,
|
||||
UIModalConfirmDeleteHabit,
|
||||
UIModalEditProgressiveStartSpeed,
|
||||
UIModalHabitLinkedDetails,
|
||||
} UIModalType;
|
||||
|
||||
typedef struct {
|
||||
@@ -105,8 +94,6 @@ typedef enum HoldDisplayMode {
|
||||
typedef enum ExerciseType {
|
||||
EXERCISE_WIM_HOF = 0,
|
||||
EXERCISE_MEDITATION = 1,
|
||||
EXERCISE_SUN_SALUTATION = 2,
|
||||
EXERCISE_7_MINUTE_WORKOUT = 3,
|
||||
EXERCISE_COUNT
|
||||
} ExerciseType;
|
||||
|
||||
@@ -134,11 +121,6 @@ typedef enum AppMainTab {
|
||||
APP_MAIN_TAB_PRACTICE = 1,
|
||||
} AppMainTab;
|
||||
|
||||
typedef enum HabitsViewMode {
|
||||
HABITS_VIEW_CALENDAR = 0,
|
||||
HABITS_VIEW_LINKED = 1,
|
||||
} HabitsViewMode;
|
||||
|
||||
struct InbeApp {
|
||||
Inbe inbe;
|
||||
Inbe settings_preview;
|
||||
@@ -153,6 +135,7 @@ struct InbeApp {
|
||||
Texture2D whm_2_image;
|
||||
Texture2D font_shapes_texture;
|
||||
Font locale_font;
|
||||
Font locale_font_8;
|
||||
Sound breath_in_sound;
|
||||
Sound breath_out_sound;
|
||||
Sound bell_sound;
|
||||
@@ -169,10 +152,7 @@ struct InbeApp {
|
||||
int settings_drag_content_y;
|
||||
int settings_dirty;
|
||||
int settings_save_delay_ticks;
|
||||
int settings_category;
|
||||
int settings_sub_tab;
|
||||
int app_settings_tab;
|
||||
int settings_from_exercise_selector;
|
||||
int settings_tab;
|
||||
int device_picker_open;
|
||||
int device_picker_scroll;
|
||||
int fullscreen_enabled;
|
||||
@@ -200,15 +180,8 @@ struct InbeApp {
|
||||
unsigned int lotus_settings_version;
|
||||
#endif
|
||||
InbeHabits habits;
|
||||
int habits_view_mode;
|
||||
int habits_list_scroll;
|
||||
int habits_list_expanded_year;
|
||||
int habits_list_expanded_month;
|
||||
int habits_list_expanded_day;
|
||||
int habits_list_expanded_session;
|
||||
int habit_detail_index;
|
||||
int habit_detail_day;
|
||||
int habit_detail_session_index;
|
||||
char habit_detail_session_path[FS_PATH_MAX];
|
||||
int habit_session_edit_scroll;
|
||||
int habit_session_edit_active;
|
||||
@@ -221,19 +194,18 @@ struct InbeApp {
|
||||
int habit_edit_is_new;
|
||||
int habit_edit_index;
|
||||
int habit_edit_cursor;
|
||||
int habit_edit_focused;
|
||||
char habit_edit_text[INBE_HABIT_NAME_SIZE];
|
||||
Color habit_edit_color;
|
||||
int habit_edit_sync_mode;
|
||||
int habit_edit_sync_topic;
|
||||
int habit_edit_sync_activity;
|
||||
int advanced_session_controls;
|
||||
int hold_display_mode;
|
||||
int exercise_type;
|
||||
int practice_config_tab;
|
||||
int practice_category_tab;
|
||||
int practice_coming_soon_ticks;
|
||||
int practice_tab_enabled[PRACTICE_CATEGORY_COUNT];
|
||||
int practice_tab_theme[PRACTICE_CATEGORY_COUNT];
|
||||
int practice_config_theme_tab;
|
||||
int previous_screen;
|
||||
int session_paused;
|
||||
int backgrounded;
|
||||
int results_saved;
|
||||
@@ -248,6 +220,7 @@ struct InbeApp {
|
||||
int meditation_music_track;
|
||||
int meditation_music_loaded;
|
||||
int meditation_music_playing;
|
||||
int meditation_music_test_playing;
|
||||
int meditation_music_archive_extracted;
|
||||
Music meditation_music;
|
||||
FlintRuntimeAssetDownload meditation_music_download;
|
||||
@@ -260,9 +233,9 @@ struct InbeApp {
|
||||
|
||||
void inbe_app_init(void *app);
|
||||
void inbe_app_update_draw(void *app, Rectangle viewport);
|
||||
void inbe_app_destroy(void *app);
|
||||
void update_session_sounds(InbeApp *app);
|
||||
void app_play_sound(InbeApp *app, Sound sound, float scale);
|
||||
const LotusAppApi *inbe_app_api(void);
|
||||
|
||||
int clampi(int x, int min, int max);
|
||||
int int_from_count(const char src[4]);
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "app_preferences.h"
|
||||
#include "device_preferences.h"
|
||||
#include "theme.h"
|
||||
#include "flint_ui.h"
|
||||
#if defined(LOTUS_BUILD)
|
||||
@@ -13,57 +13,21 @@
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
extern Color c_text, c_bg, c_surface, c_circle, c_button, c_button_hover, c_icon;
|
||||
|
||||
void
|
||||
refresh_theme_colors(int theme_id, int dark_mode)
|
||||
{
|
||||
theme_set_current(theme_id, dark_mode);
|
||||
#if defined(LOTUS_BUILD)
|
||||
(void)theme_id;
|
||||
(void)dark_mode;
|
||||
c_bg = lotus_alias_color("background");
|
||||
c_text = lotus_alias_color("text");
|
||||
c_surface = lotus_alias_color("surface");
|
||||
c_circle = lotus_alias_color("circle");
|
||||
c_button = lotus_alias_color("button");
|
||||
c_button_hover = lotus_alias_color("button_hover");
|
||||
c_icon = lotus_alias_color("icon");
|
||||
ui_set_colors(c_text, c_bg, c_surface, c_circle, c_button, c_button_hover, c_icon);
|
||||
ui_set_colors(theme_get_text(), theme_get_bg(), theme_get_surface(),
|
||||
theme_get_circle(), theme_get_button(), theme_get_button_hover(),
|
||||
theme_get_icon());
|
||||
return;
|
||||
#else
|
||||
Color bg;
|
||||
Color surface;
|
||||
Color text;
|
||||
Color circle;
|
||||
Color button;
|
||||
Color button_hover;
|
||||
Color icon;
|
||||
FlintThemeId theme;
|
||||
bool dark;
|
||||
|
||||
if(theme_id < 0 || theme_id >= FLINT_THEME_COUNT)
|
||||
theme_id = FLINT_THEME_SKY;
|
||||
|
||||
theme = flint_theme_normalize(theme_id);
|
||||
dark = dark_mode != 0;
|
||||
|
||||
flint_theme_catalog_color(theme, dark, "background", &bg);
|
||||
flint_theme_catalog_color(theme, dark, "surface", &surface);
|
||||
flint_theme_catalog_color(theme, dark, "text", &text);
|
||||
flint_theme_catalog_color(theme, dark, "circle", &circle);
|
||||
flint_theme_catalog_color(theme, dark, "button", &button);
|
||||
flint_theme_catalog_color(theme, dark, "button_hover", &button_hover);
|
||||
flint_theme_catalog_color(theme, dark, "icon", &icon);
|
||||
|
||||
c_bg = bg;
|
||||
c_surface = surface;
|
||||
c_text = text;
|
||||
c_circle = circle;
|
||||
c_button = button;
|
||||
c_button_hover = button_hover;
|
||||
c_icon = icon;
|
||||
|
||||
ui_set_colors(text, bg, surface, circle, button, button_hover, icon);
|
||||
ui_set_colors(theme_get_text(), theme_get_bg(), theme_get_surface(),
|
||||
theme_get_circle(), theme_get_button(), theme_get_button_hover(),
|
||||
theme_get_icon());
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "inbe.h"
|
||||
#include "breath_engine.h"
|
||||
#include <stddef.h>
|
||||
|
||||
static int
|
||||
eqcount(const char a[CountSize], const char b[CountSize])
|
||||
@@ -18,12 +19,12 @@ count_value(const char v[CountSize])
|
||||
int
|
||||
inbe_breath_half_ticks_for_speed(int speed)
|
||||
{
|
||||
static const int breath_half_ticks[] = {132, 120, 108, 100, 93, 86, 80, 74, 68, 63, 58, 53};
|
||||
static const int breath_half_ticks[] = {180, 160, 144, 132, 120, 108, 93, 74};
|
||||
|
||||
if(speed < 1)
|
||||
speed = 1;
|
||||
if(speed > 12)
|
||||
speed = 12;
|
||||
if(speed > 8)
|
||||
speed = 8;
|
||||
|
||||
return breath_half_ticks[speed - 1];
|
||||
}
|
||||
@@ -91,6 +92,7 @@ inbeinit(Inbe *l)
|
||||
l->pause_seconds = DefaultPauseSeconds;
|
||||
l->progressive_speed = 1;
|
||||
l->progressive_start_speed = DefaultProgressiveStartSpeed;
|
||||
l->breath_animation = InbeBreathAnimationLinear;
|
||||
#ifdef __ANDROID__
|
||||
l->play_in_background = 1; // Enabled by default on Android
|
||||
#else
|
||||
@@ -149,6 +151,44 @@ effective_breath_half_ticks(const Inbe *l)
|
||||
);
|
||||
}
|
||||
|
||||
static float
|
||||
smoothstepf(float t)
|
||||
{
|
||||
if(t < 0.0f)
|
||||
t = 0.0f;
|
||||
if(t > 1.0f)
|
||||
t = 1.0f;
|
||||
return t * t * (3.0f - 2.0f * t);
|
||||
}
|
||||
|
||||
static int
|
||||
eased_span(int span, int frame, int half_ticks)
|
||||
{
|
||||
float t;
|
||||
|
||||
if(span <= 0 || half_ticks <= 0)
|
||||
return 0;
|
||||
|
||||
t = (float)frame / (float)half_ticks;
|
||||
return (int)((float)span * smoothstepf(t) + 0.5f);
|
||||
}
|
||||
|
||||
static int
|
||||
animated_span(const Inbe *l, int span, int frame, int half_ticks)
|
||||
{
|
||||
if(l != NULL && l->breath_animation == InbeBreathAnimationLinear)
|
||||
return lerp_int(0, span, frame, half_ticks);
|
||||
return eased_span(span, frame, half_ticks);
|
||||
}
|
||||
|
||||
float
|
||||
inbe_draw_radius(const Inbe *l)
|
||||
{
|
||||
if(l == 0)
|
||||
return 0.0f;
|
||||
return (float)l->r;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
starting(Inbe *l)
|
||||
@@ -183,7 +223,7 @@ breathe(Inbe *l)
|
||||
if(l->breath_frame > half_ticks)
|
||||
l->breath_frame = half_ticks;
|
||||
|
||||
eased = (l->breath_frame * span) / half_ticks;
|
||||
eased = animated_span(l, span, l->breath_frame, half_ticks);
|
||||
if(l->dir == 0)
|
||||
l->r = l->rmin + eased;
|
||||
else
|
||||
@@ -220,7 +260,7 @@ next(Inbe *l)
|
||||
if(l->breath_frame > l->breath_half_ticks)
|
||||
l->breath_frame = l->breath_half_ticks;
|
||||
|
||||
eased = (l->breath_frame * span) / l->breath_half_ticks;
|
||||
eased = animated_span(l, span, l->breath_frame, l->breath_half_ticks);
|
||||
l->r = l->rmax - eased;
|
||||
|
||||
if(l->breath_frame >= l->breath_half_ticks) {
|
||||
@@ -250,7 +290,7 @@ recover(Inbe *l)
|
||||
if(l->breath_frame > l->breath_half_ticks)
|
||||
l->breath_frame = l->breath_half_ticks;
|
||||
|
||||
eased = (l->breath_frame * span) / l->breath_half_ticks;
|
||||
eased = animated_span(l, span, l->breath_frame, l->breath_half_ticks);
|
||||
l->r = l->rmin + eased;
|
||||
|
||||
if(l->breath_frame >= l->breath_half_ticks) {
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef INBE_H
|
||||
#define INBE_H
|
||||
#ifndef BREATH_ENGINE_H
|
||||
#define BREATH_ENGINE_H
|
||||
|
||||
#if defined(__PLAN9__) || (!defined(__STDC__) && (defined(__i386__) || defined(__amd64__) || defined(__arm__)))
|
||||
typedef unsigned char uint8_t;
|
||||
@@ -34,14 +34,13 @@ enum {
|
||||
InbeScreenSession,
|
||||
InbeScreenMeditation,
|
||||
InbeScreenResults,
|
||||
InbeScreenSettings,
|
||||
InbeScreenLanguage,
|
||||
InbeScreenManual,
|
||||
InbeScreenHabits,
|
||||
InbeScreenHabitManager,
|
||||
InbeScreenHabitEdit,
|
||||
InbeScreenHabitSessionEdit,
|
||||
InbeScreenSettings,
|
||||
InbeScreenPracticeConfig,
|
||||
InbeScreenLanguage,
|
||||
InbeScreenManual,
|
||||
InbeScreenHabits,
|
||||
InbeScreenHabitEdit,
|
||||
InbeScreenHabitSessionEdit,
|
||||
};
|
||||
|
||||
enum {
|
||||
@@ -52,6 +51,12 @@ enum {
|
||||
InbePhaseNext
|
||||
};
|
||||
|
||||
typedef enum {
|
||||
InbeBreathAnimationLinear = 0,
|
||||
InbeBreathAnimationInOut = 1,
|
||||
InbeBreathAnimationCount
|
||||
} InbeBreathAnimation;
|
||||
|
||||
typedef struct Inbe Inbe;
|
||||
|
||||
struct Inbe {
|
||||
@@ -62,29 +67,31 @@ struct Inbe {
|
||||
int r;
|
||||
int rmin;
|
||||
int rmax;
|
||||
int dir;
|
||||
int speed_level;
|
||||
int breath_frame;
|
||||
int breath_half_ticks;
|
||||
int dir;
|
||||
int speed_level;
|
||||
int breath_frame;
|
||||
int breath_half_ticks;
|
||||
int frame;
|
||||
|
||||
int breathtick;
|
||||
int sectick;
|
||||
int halftick;
|
||||
int max_rounds;
|
||||
int pause_seconds;
|
||||
int play_in_background;
|
||||
int progressive_speed;
|
||||
int progressive_start_speed;
|
||||
int sectick;
|
||||
int halftick;
|
||||
int max_rounds;
|
||||
int pause_seconds;
|
||||
int play_in_background;
|
||||
int progressive_speed;
|
||||
int progressive_start_speed;
|
||||
int breath_animation;
|
||||
|
||||
char count[CountSize];
|
||||
char maxbreaths[CountSize];
|
||||
char maxbreaths[CountSize];
|
||||
|
||||
char results[MaxRounds][CountSize];
|
||||
};
|
||||
|
||||
void inbeinit(Inbe *l);
|
||||
void inbestep(Inbe *l);
|
||||
float inbe_draw_radius(const Inbe *l);
|
||||
void inccount(char v[CountSize]);
|
||||
void cpcount(char dst[CountSize], const char src[CountSize]);
|
||||
int inbe_breath_half_ticks_for_speed(int speed);
|
||||
@@ -1,5 +1,8 @@
|
||||
#include "theme.h"
|
||||
|
||||
static int g_current_theme_id = FLINT_THEME_SKY;
|
||||
static int g_current_dark_mode = 0;
|
||||
|
||||
void theme_reset(void) { flint_theme_reset(); }
|
||||
LotusThemeScope *theme_register_scope(const char *name, const char *path) { return flint_theme_register_scope(name, path); }
|
||||
LotusThemeScope *theme_scope(const char *name) { return flint_theme_scope(name); }
|
||||
@@ -12,3 +15,29 @@ bool theme_save_all(void) { return flint_theme_save_all(); }
|
||||
const char *theme_color_text(Color color, char *buffer, int size) { return flint_theme_color_text(color, buffer, size); }
|
||||
bool theme_parse_color(const char *text, Color *color) { return flint_theme_parse_color(text, color); }
|
||||
void theme_draw_tk_border(Rectangle rec, int borderWidth, bool raised) { flint_theme_draw_tk_border(rec, borderWidth, raised); }
|
||||
|
||||
void theme_set_current(int theme_id, int dark_mode)
|
||||
{
|
||||
if(theme_id >= 0 && theme_id < FLINT_THEME_COUNT)
|
||||
g_current_theme_id = theme_id;
|
||||
else
|
||||
g_current_theme_id = FLINT_THEME_SKY;
|
||||
g_current_dark_mode = dark_mode != 0;
|
||||
}
|
||||
|
||||
static Color theme_get_color(const char *key)
|
||||
{
|
||||
Color color;
|
||||
FlintThemeId theme = flint_theme_normalize(g_current_theme_id);
|
||||
bool dark = g_current_dark_mode != 0;
|
||||
flint_theme_catalog_color(theme, dark, key, &color);
|
||||
return color;
|
||||
}
|
||||
|
||||
Color theme_get_text(void) { return theme_get_color("text"); }
|
||||
Color theme_get_bg(void) { return theme_get_color("background"); }
|
||||
Color theme_get_surface(void) { return theme_get_color("surface"); }
|
||||
Color theme_get_circle(void) { return theme_get_color("circle"); }
|
||||
Color theme_get_button(void) { return theme_get_color("button"); }
|
||||
Color theme_get_button_hover(void) { return theme_get_color("button_hover"); }
|
||||
Color theme_get_icon(void) { return theme_get_color("icon"); }
|
||||
@@ -25,4 +25,14 @@ const char *theme_color_text(Color color, char *buffer, int size);
|
||||
bool theme_parse_color(const char *text, Color *color);
|
||||
void theme_draw_tk_border(Rectangle rec, int borderWidth, bool raised);
|
||||
|
||||
/* Centralized theme color accessors */
|
||||
void theme_set_current(int theme_id, int dark_mode);
|
||||
Color theme_get_text(void);
|
||||
Color theme_get_bg(void);
|
||||
Color theme_get_surface(void);
|
||||
Color theme_get_circle(void);
|
||||
Color theme_get_button(void);
|
||||
Color theme_get_button_hover(void);
|
||||
Color theme_get_icon(void);
|
||||
|
||||
#endif
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#define INBE_VERSION_MAJOR 1
|
||||
#define INBE_VERSION_MINOR 3
|
||||
#define INBE_VERSION_PATCH 0
|
||||
#define INBE_VERSION_STRING "1.3.0"
|
||||
#define INBE_VERSION_PATCH 1
|
||||
#define INBE_VERSION_STRING "1.3.1"
|
||||
|
||||
#endif
|
||||
@@ -1,229 +0,0 @@
|
||||
#include "habits/habits.h"
|
||||
|
||||
#include "data.h"
|
||||
#include "storage.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
|
||||
static void inbe_habits_add_seed(InbeHabits *habits, const char *id, const char *name,
|
||||
Color color, int sync_topic);
|
||||
|
||||
static void
|
||||
copy_text(char *dst, size_t dst_size, const char *src)
|
||||
{
|
||||
if(dst == NULL || dst_size == 0)
|
||||
return;
|
||||
if(src == NULL)
|
||||
src = "";
|
||||
snprintf(dst, dst_size, "%s", src);
|
||||
}
|
||||
|
||||
static int
|
||||
habit_find_day(const InbeHabit *habit, int day_index)
|
||||
{
|
||||
if(habit == NULL)
|
||||
return -1;
|
||||
for(int i = 0; i < habit->day_count; i++) {
|
||||
if(habit->days[i].day_index == day_index)
|
||||
return i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
int
|
||||
inbe_habits_today_index(void)
|
||||
{
|
||||
time_t now = time(NULL);
|
||||
struct tm *tm = localtime(&now);
|
||||
if(tm == NULL)
|
||||
return 0;
|
||||
return (tm->tm_year + 1900) * 10000 + (tm->tm_mon + 1) * 100 + tm->tm_mday;
|
||||
}
|
||||
|
||||
int
|
||||
inbe_habit_completed_day(const InbeHabit *habit, int day_index)
|
||||
{
|
||||
int index = habit_find_day(habit, day_index);
|
||||
return index >= 0 && habit->days[index].completed;
|
||||
}
|
||||
|
||||
int
|
||||
inbe_habit_completed_today(const InbeHabit *habit)
|
||||
{
|
||||
return inbe_habit_completed_day(habit, inbe_habits_today_index());
|
||||
}
|
||||
|
||||
void
|
||||
inbe_habits_save(const InbeHabits *habits)
|
||||
{
|
||||
inbe_storage_habits_save(habits);
|
||||
return;
|
||||
}
|
||||
|
||||
void
|
||||
inbe_habits_add_default(InbeHabits *habits)
|
||||
{
|
||||
int number;
|
||||
char name[INBE_HABIT_NAME_SIZE];
|
||||
|
||||
if(habits == NULL || habits->count >= INBE_HABIT_MAX)
|
||||
return;
|
||||
|
||||
number = habits->count + 1;
|
||||
snprintf(name, sizeof(name), "Habit %d", number);
|
||||
inbe_habits_add_custom(habits, name, (Color){99, 196, 165, 255},
|
||||
INBE_HABIT_SYNC_NONE,
|
||||
INBE_HABIT_TOPIC_MIND, 0);
|
||||
}
|
||||
|
||||
void
|
||||
inbe_habits_add_default_set(InbeHabits *habits)
|
||||
{
|
||||
if(habits == NULL)
|
||||
return;
|
||||
|
||||
memset(habits, 0, sizeof(*habits));
|
||||
inbe_habits_add_seed(habits, "mind", "Mind", (Color){126, 183, 230, 255},
|
||||
INBE_HABIT_TOPIC_MIND);
|
||||
inbe_habits_add_seed(habits, "yoga", "Yoga", (Color){208, 128, 80, 255},
|
||||
INBE_HABIT_TOPIC_YOGA);
|
||||
inbe_habits_add_seed(habits, "fitness", "Fitness", (Color){208, 96, 128, 255},
|
||||
INBE_HABIT_TOPIC_FITNESS);
|
||||
habits->selected = 0;
|
||||
habits->loaded = 1;
|
||||
inbe_habits_save(habits);
|
||||
}
|
||||
|
||||
void
|
||||
inbe_habits_delete(InbeHabits *habits, int index)
|
||||
{
|
||||
if(habits == NULL || index < 0 || index >= habits->count)
|
||||
return;
|
||||
|
||||
for(int i = index; i < habits->count - 1; i++)
|
||||
habits->items[i] = habits->items[i + 1];
|
||||
habits->count--;
|
||||
memset(&habits->items[habits->count], 0, sizeof(habits->items[habits->count]));
|
||||
|
||||
if(habits->selected > index)
|
||||
habits->selected--;
|
||||
else if(habits->selected >= habits->count)
|
||||
habits->selected = habits->count - 1;
|
||||
if(habits->selected < 0 && habits->count > 0)
|
||||
habits->selected = 0;
|
||||
|
||||
inbe_habits_save(habits);
|
||||
}
|
||||
|
||||
int
|
||||
inbe_habits_add_custom(InbeHabits *habits, const char *name, Color color,
|
||||
int sync_mode, int sync_topic, int sync_activity)
|
||||
{
|
||||
InbeHabit *habit;
|
||||
int number;
|
||||
|
||||
if(habits == NULL || habits->count >= INBE_HABIT_MAX)
|
||||
return -1;
|
||||
|
||||
number = habits->count + 1;
|
||||
habit = &habits->items[habits->count];
|
||||
memset(habit, 0, sizeof(*habit));
|
||||
snprintf(habit->id, sizeof(habit->id), "habit-%d", number);
|
||||
copy_text(habit->name, sizeof(habit->name),
|
||||
name != NULL && name[0] != '\0' ? name : "Habit");
|
||||
habit->color = color;
|
||||
habit->color.a = 255;
|
||||
habit->sync_mode = sync_mode;
|
||||
habit->sync_topic = sync_topic;
|
||||
habit->sync_activity = sync_activity;
|
||||
habits->selected = habits->count;
|
||||
habits->count++;
|
||||
inbe_habits_save(habits);
|
||||
return habits->selected;
|
||||
}
|
||||
|
||||
static void
|
||||
inbe_habits_add_seed(InbeHabits *habits, const char *id, const char *name,
|
||||
Color color, int sync_topic)
|
||||
{
|
||||
InbeHabit *habit;
|
||||
|
||||
if(habits == NULL || habits->count >= INBE_HABIT_MAX)
|
||||
return;
|
||||
|
||||
habit = &habits->items[habits->count++];
|
||||
memset(habit, 0, sizeof(*habit));
|
||||
copy_text(habit->id, sizeof(habit->id), id);
|
||||
copy_text(habit->name, sizeof(habit->name), name);
|
||||
habit->color = color;
|
||||
habit->sync_mode = INBE_HABIT_SYNC_TOPIC;
|
||||
habit->sync_topic = sync_topic;
|
||||
habit->sync_activity = 0;
|
||||
}
|
||||
|
||||
void
|
||||
inbe_habits_init(InbeHabits *habits)
|
||||
{
|
||||
if(habits == NULL)
|
||||
return;
|
||||
data_init();
|
||||
if(inbe_storage_habits_load(habits)) {
|
||||
if(habits->selected < 0 || habits->selected >= habits->count)
|
||||
habits->selected = 0;
|
||||
habits->loaded = 1;
|
||||
return;
|
||||
}
|
||||
inbe_habits_add_default_set(habits);
|
||||
}
|
||||
|
||||
void
|
||||
inbe_habit_set_day(InbeHabits *habits, int index, int day_index, int completed)
|
||||
{
|
||||
InbeHabit *habit;
|
||||
int existing_index;
|
||||
|
||||
if(habits == NULL || index < 0 || index >= habits->count || day_index <= 0)
|
||||
return;
|
||||
|
||||
habit = &habits->items[index];
|
||||
existing_index = habit_find_day(habit, day_index);
|
||||
if(existing_index >= 0) {
|
||||
habit->days[existing_index].completed = completed != 0;
|
||||
} else if(completed && habit->day_count < INBE_HABIT_MAX_DAYS) {
|
||||
habit->days[habit->day_count].day_index = day_index;
|
||||
habit->days[habit->day_count].completed = 1;
|
||||
habit->day_count++;
|
||||
}
|
||||
habits->selected = index;
|
||||
inbe_habits_save(habits);
|
||||
}
|
||||
|
||||
void
|
||||
inbe_habit_toggle_day(InbeHabits *habits, int index, int day_index)
|
||||
{
|
||||
InbeHabit *habit;
|
||||
int existing_index;
|
||||
|
||||
if(habits == NULL || index < 0 || index >= habits->count || day_index <= 0)
|
||||
return;
|
||||
|
||||
habit = &habits->items[index];
|
||||
existing_index = habit_find_day(habit, day_index);
|
||||
if(existing_index >= 0) {
|
||||
habit->days[existing_index].completed = !habit->days[existing_index].completed;
|
||||
} else if(habit->day_count < INBE_HABIT_MAX_DAYS) {
|
||||
habit->days[habit->day_count].day_index = day_index;
|
||||
habit->days[habit->day_count].completed = 1;
|
||||
habit->day_count++;
|
||||
}
|
||||
habits->selected = index;
|
||||
inbe_habits_save(habits);
|
||||
}
|
||||
|
||||
void
|
||||
inbe_habit_toggle_today(InbeHabits *habits, int index)
|
||||
{
|
||||
inbe_habit_toggle_day(habits, index, inbe_habits_today_index());
|
||||
}
|
||||
@@ -1,67 +0,0 @@
|
||||
#ifndef INBE_HABITS_H
|
||||
#define INBE_HABITS_H
|
||||
|
||||
#include "raylib.h"
|
||||
#include <stddef.h>
|
||||
|
||||
enum {
|
||||
INBE_HABIT_MAX = 10,
|
||||
INBE_HABIT_ID_SIZE = 32,
|
||||
INBE_HABIT_NAME_SIZE = 40,
|
||||
INBE_HABIT_MAX_DAYS = 366
|
||||
};
|
||||
|
||||
typedef enum InbeHabitSyncMode {
|
||||
INBE_HABIT_SYNC_NONE = 0,
|
||||
INBE_HABIT_SYNC_TOPIC = 1,
|
||||
INBE_HABIT_SYNC_ACTIVITY = 2
|
||||
} InbeHabitSyncMode;
|
||||
|
||||
typedef enum InbeHabitTopic {
|
||||
INBE_HABIT_TOPIC_MIND = 0,
|
||||
INBE_HABIT_TOPIC_YOGA = 1,
|
||||
INBE_HABIT_TOPIC_FITNESS = 2,
|
||||
INBE_HABIT_TOPIC_COUNT = 3
|
||||
} InbeHabitTopic;
|
||||
|
||||
typedef struct InbeHabitDay {
|
||||
int day_index;
|
||||
int completed;
|
||||
} InbeHabitDay;
|
||||
|
||||
typedef struct InbeHabit {
|
||||
char id[INBE_HABIT_ID_SIZE];
|
||||
char name[INBE_HABIT_NAME_SIZE];
|
||||
Color color;
|
||||
int sync_mode;
|
||||
int sync_topic;
|
||||
int sync_activity;
|
||||
InbeHabitDay days[INBE_HABIT_MAX_DAYS];
|
||||
int day_count;
|
||||
} InbeHabit;
|
||||
|
||||
typedef struct InbeHabits {
|
||||
InbeHabit items[INBE_HABIT_MAX];
|
||||
int count;
|
||||
int selected;
|
||||
int scroll;
|
||||
int month_offset;
|
||||
int selector_open;
|
||||
int loaded;
|
||||
} InbeHabits;
|
||||
|
||||
void inbe_habits_init(InbeHabits *habits);
|
||||
void inbe_habits_save(const InbeHabits *habits);
|
||||
int inbe_habits_today_index(void);
|
||||
int inbe_habit_completed_day(const InbeHabit *habit, int day_index);
|
||||
int inbe_habit_completed_today(const InbeHabit *habit);
|
||||
void inbe_habit_set_day(InbeHabits *habits, int index, int day_index, int completed);
|
||||
void inbe_habit_toggle_day(InbeHabits *habits, int index, int day_index);
|
||||
void inbe_habit_toggle_today(InbeHabits *habits, int index);
|
||||
void inbe_habits_add_default(InbeHabits *habits);
|
||||
void inbe_habits_add_default_set(InbeHabits *habits);
|
||||
void inbe_habits_delete(InbeHabits *habits, int index);
|
||||
int inbe_habits_add_custom(InbeHabits *habits, const char *name, Color color,
|
||||
int sync_mode, int sync_topic, int sync_activity);
|
||||
|
||||
#endif
|
||||
@@ -1,11 +1,19 @@
|
||||
#include "raylib.h"
|
||||
#include "app.h"
|
||||
#include "flint_clip.h"
|
||||
#include "flint_dpi.h"
|
||||
#include "flint_web.h"
|
||||
#include <stdarg.h>
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#if defined(PLATFORM_ANDROID) || defined(__ANDROID__) || defined(ANDROID)
|
||||
#define INBE_ANDROID_BUILD 1
|
||||
#else
|
||||
#define INBE_ANDROID_BUILD 0
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(_WIN32) && !defined(__ANDROID__)
|
||||
__declspec(dllimport) int __stdcall MessageBoxA(void *hwnd, const char *text,
|
||||
const char *caption, unsigned int type);
|
||||
@@ -30,7 +38,7 @@ extern struct android_app *GetAndroidApp(void);
|
||||
#endif
|
||||
|
||||
static InbeApp inbe_app;
|
||||
static InbeApp *g_inbe_app_ptr = NULL; // Global pointer for JNI access
|
||||
static InbeApp *g_inbe_app_ptr = NULL;
|
||||
|
||||
#if defined(_WIN32) && !defined(__ANDROID__)
|
||||
static FILE *win_log_file;
|
||||
@@ -162,11 +170,6 @@ InbeApp* get_global_inbe_app(void) {
|
||||
|
||||
void set_global_inbe_app(InbeApp *app);
|
||||
|
||||
#if defined(PLATFORM_ANDROID) || defined(__ANDROID__) || defined(ANDROID)
|
||||
#define INBE_ANDROID_BUILD 1
|
||||
#else
|
||||
#define INBE_ANDROID_BUILD 0
|
||||
#endif
|
||||
|
||||
#if INBE_ANDROID_BUILD
|
||||
static AndroidInsets insets;
|
||||
@@ -219,14 +222,14 @@ frame(void)
|
||||
|
||||
BeginDrawing();
|
||||
ClearBackground(BLACK);
|
||||
BeginScissorMode(content_x, content_y, content_width, content_height);
|
||||
flint_clip_begin(content_x, content_y, content_width, content_height);
|
||||
inbe_app_update_draw(&inbe_app, (Rectangle){
|
||||
(float)content_x,
|
||||
(float)content_y,
|
||||
(float)content_width,
|
||||
(float)content_height
|
||||
});
|
||||
EndScissorMode();
|
||||
flint_clip_end();
|
||||
#else
|
||||
BeginDrawing();
|
||||
ClearBackground(BLACK);
|
||||
@@ -274,22 +277,15 @@ int main(int argc, char **argv) {
|
||||
#endif
|
||||
|
||||
#if INBE_ANDROID_BUILD
|
||||
__android_log_write(ANDROID_LOG_INFO, "INBE_MAIN", "Calling android_insets_init");
|
||||
android_insets_init();
|
||||
__android_log_write(ANDROID_LOG_INFO, "INBE_MAIN", "Calling android_device_init");
|
||||
android_device_init();
|
||||
__android_log_write(ANDROID_LOG_INFO, "INBE_MAIN", "Calling android_wakelock_init");
|
||||
android_wakelock_init();
|
||||
__android_log_write(ANDROID_LOG_INFO, "INBE_MAIN", "Calling android_timer_init");
|
||||
android_timer_init();
|
||||
__android_log_write(ANDROID_LOG_INFO, "INBE_MAIN", "Calling android_runtime_assets_init");
|
||||
android_runtime_assets_init();
|
||||
__android_log_write(ANDROID_LOG_INFO, "INBE_MAIN", "Init calls done");
|
||||
if(!ChangeDirectory("/data/user/0/xyz.waozi.inbe/files"))
|
||||
TraceLog(LOG_WARNING, "INBE: failed to switch to Android files directory");
|
||||
#endif
|
||||
|
||||
|
||||
InitWindow(window_w, window_h, config.title);
|
||||
if(!IsWindowReady()) {
|
||||
TraceLog(LOG_ERROR, "INBE: InitWindow failed");
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "android_device.h"
|
||||
#include "flint_ui.h"
|
||||
|
||||
#if defined(PLATFORM_ANDROID) || defined(__ANDROID__) || defined(ANDROID)
|
||||
#include <android/log.h>
|
||||
@@ -101,13 +102,85 @@ done:
|
||||
(*jvm)->DetachCurrentThread(jvm);
|
||||
}
|
||||
|
||||
void
|
||||
android_device_set_soft_keyboard_visible(int visible)
|
||||
{
|
||||
struct android_app *app = GetAndroidApp();
|
||||
JavaVM *jvm;
|
||||
JNIEnv *env = NULL;
|
||||
jobject activity;
|
||||
jclass activity_class;
|
||||
jmethodID method;
|
||||
int attached = 0;
|
||||
|
||||
if(app == NULL || app->activity == NULL || app->activity->vm == NULL ||
|
||||
app->activity->clazz == NULL)
|
||||
return;
|
||||
|
||||
jvm = app->activity->vm;
|
||||
activity = app->activity->clazz;
|
||||
if((*jvm)->GetEnv(jvm, (void **)&env, JNI_VERSION_1_6) != JNI_OK) {
|
||||
if((*jvm)->AttachCurrentThread(jvm, &env, NULL) != JNI_OK || env == NULL)
|
||||
return;
|
||||
attached = 1;
|
||||
}
|
||||
|
||||
activity_class = (*env)->GetObjectClass(env, activity);
|
||||
if(activity_class == NULL)
|
||||
goto done;
|
||||
|
||||
method = (*env)->GetMethodID(env, activity_class, "setSoftKeyboardVisible", "(Z)V");
|
||||
if(method == NULL) {
|
||||
__android_log_write(ANDROID_LOG_ERROR, "INBE_DEVICE", "setSoftKeyboardVisible not found");
|
||||
goto done;
|
||||
}
|
||||
|
||||
(*env)->CallVoidMethod(env, activity, method, visible ? JNI_TRUE : JNI_FALSE);
|
||||
|
||||
done:
|
||||
if((*env)->ExceptionCheck(env)) {
|
||||
(*env)->ExceptionDescribe(env);
|
||||
(*env)->ExceptionClear(env);
|
||||
}
|
||||
if(attached)
|
||||
(*jvm)->DetachCurrentThread(jvm);
|
||||
}
|
||||
|
||||
void
|
||||
android_device_native_text_input_commit(JNIEnv *env, jobject thiz, jint codepoint)
|
||||
{
|
||||
(void)env;
|
||||
(void)thiz;
|
||||
flint_ui_text_input_queue_codepoint((int)codepoint);
|
||||
}
|
||||
|
||||
void
|
||||
android_device_native_text_input_backspace(JNIEnv *env, jobject thiz)
|
||||
{
|
||||
(void)env;
|
||||
(void)thiz;
|
||||
flint_ui_text_input_queue_backspace();
|
||||
}
|
||||
|
||||
void
|
||||
android_device_native_text_input_enter(JNIEnv *env, jobject thiz)
|
||||
{
|
||||
(void)env;
|
||||
(void)thiz;
|
||||
flint_ui_text_input_queue_enter();
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
void android_device_native_set_system_dark(int dark) { (void)dark; }
|
||||
void android_device_native_set_orientation(int orientation) { (void)orientation; }
|
||||
void android_device_native_text_input_commit(JNIEnv *env, jobject thiz, jint codepoint) { (void)env; (void)thiz; (void)codepoint; }
|
||||
void android_device_native_text_input_backspace(JNIEnv *env, jobject thiz) { (void)env; (void)thiz; }
|
||||
void android_device_native_text_input_enter(JNIEnv *env, jobject thiz) { (void)env; (void)thiz; }
|
||||
void android_device_init(void) {}
|
||||
int android_device_system_dark(void) { return 0; }
|
||||
int android_device_orientation(void) { return APP_DEVICE_ORIENTATION_UNKNOWN; }
|
||||
void android_device_set_orientation_mode(int mode) { (void)mode; }
|
||||
void android_device_set_soft_keyboard_visible(int visible) { (void)visible; }
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,24 @@
|
||||
#ifndef INBE_ANDROID_DEVICE_H
|
||||
#define INBE_ANDROID_DEVICE_H
|
||||
|
||||
#include "app.h"
|
||||
#if defined(PLATFORM_ANDROID) || defined(__ANDROID__) || defined(ANDROID)
|
||||
#include <jni.h>
|
||||
#else
|
||||
typedef void JNIEnv;
|
||||
typedef void *jobject;
|
||||
typedef int jint;
|
||||
#endif
|
||||
|
||||
void android_device_init(void);
|
||||
int android_device_system_dark(void);
|
||||
int android_device_orientation(void);
|
||||
void android_device_set_orientation_mode(int mode);
|
||||
void android_device_set_soft_keyboard_visible(int visible);
|
||||
void android_device_native_set_system_dark(int dark);
|
||||
void android_device_native_set_orientation(int orientation);
|
||||
void android_device_native_text_input_commit(JNIEnv *env, jobject thiz, jint codepoint);
|
||||
void android_device_native_text_input_backspace(JNIEnv *env, jobject thiz);
|
||||
void android_device_native_text_input_enter(JNIEnv *env, jobject thiz);
|
||||
|
||||
#endif
|
||||
@@ -5,7 +5,7 @@
|
||||
#include "android_timer.h"
|
||||
#include "android_wakelock.h"
|
||||
#include "app.h"
|
||||
#include "inbe.h"
|
||||
#include "breath_engine.h"
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
@@ -183,7 +183,11 @@ static const JNINativeMethod g_methods[] = {
|
||||
{"nativeImportSelectedFile", "(Ljava/lang/String;)V", (void*)android_import_native_selected},
|
||||
{"nativeImportCancelled", "()V", (void*)android_import_native_cancelled},
|
||||
{"nativeRuntimeAssetDownloadSucceeded", "(JJI)V", (void*)android_runtime_asset_native_succeeded},
|
||||
{"nativeRuntimeAssetDownloadProgress", "(JJJ)V", (void*)android_runtime_asset_native_progress},
|
||||
{"nativeRuntimeAssetDownloadFailed", "(JILjava/lang/String;)V", (void*)android_runtime_asset_native_failed},
|
||||
{"nativeTextInputCommit", "(I)V", (void*)android_device_native_text_input_commit},
|
||||
{"nativeTextInputBackspace", "()V", (void*)android_device_native_text_input_backspace},
|
||||
{"nativeTextInputEnter", "()V", (void*)android_device_native_text_input_enter},
|
||||
};
|
||||
|
||||
// JNI_OnLoad - Register native methods
|
||||
@@ -121,10 +121,28 @@ android_runtime_asset_native_succeeded(JNIEnv *env, jobject thiz,
|
||||
|
||||
download->http_status = (long)http_status;
|
||||
download->bytes = bytes > 0 ? (size_t)bytes : 0;
|
||||
if(download->total_bytes == 0)
|
||||
download->total_bytes = download->bytes;
|
||||
download->error[0] = '\0';
|
||||
download->status = FLINT_RUNTIME_ASSET_READY;
|
||||
}
|
||||
|
||||
void
|
||||
android_runtime_asset_native_progress(JNIEnv *env, jobject thiz,
|
||||
jlong handle, jlong bytes,
|
||||
jlong total_bytes)
|
||||
{
|
||||
FlintRuntimeAssetDownload *download = (FlintRuntimeAssetDownload *)(intptr_t)handle;
|
||||
(void)env;
|
||||
(void)thiz;
|
||||
|
||||
if(download == NULL)
|
||||
return;
|
||||
|
||||
download->bytes = bytes > 0 ? (size_t)bytes : 0;
|
||||
download->total_bytes = total_bytes > 0 ? (size_t)total_bytes : 0;
|
||||
}
|
||||
|
||||
void
|
||||
android_runtime_asset_native_failed(JNIEnv *env, jobject thiz,
|
||||
jlong handle, jint http_status,
|
||||
@@ -7,6 +7,9 @@ void android_runtime_assets_init(void);
|
||||
void android_runtime_asset_native_succeeded(JNIEnv *env, jobject thiz,
|
||||
jlong handle, jlong bytes,
|
||||
jint http_status);
|
||||
void android_runtime_asset_native_progress(JNIEnv *env, jobject thiz,
|
||||
jlong handle, jlong bytes,
|
||||
jlong total_bytes);
|
||||
void android_runtime_asset_native_failed(JNIEnv *env, jobject thiz,
|
||||
jlong handle, jint http_status,
|
||||
jstring error);
|
||||
@@ -0,0 +1,137 @@
|
||||
#ifndef HABITS_SCREEN_H
|
||||
#define HABITS_SCREEN_H
|
||||
|
||||
#include "raylib.h"
|
||||
#include "breath_engine.h"
|
||||
#include "app_fwd.h"
|
||||
#include <stddef.h>
|
||||
|
||||
/* Forward declaration for enums defined elsewhere */
|
||||
enum {
|
||||
HABIT_SESSION_EDIT_NONE = 0,
|
||||
HABIT_SESSION_EDIT_ROUND = 1
|
||||
};
|
||||
|
||||
/* Habits-specific constants */
|
||||
enum {
|
||||
INBE_HABIT_MAX = 10,
|
||||
INBE_HABIT_ID_SIZE = 32,
|
||||
INBE_HABIT_NAME_SIZE = 40,
|
||||
INBE_HABIT_MAX_DAYS = 366,
|
||||
HABIT_LINKED_ENTRY_MAX = 128,
|
||||
HABIT_LINKED_PATH_SIZE = 80
|
||||
};
|
||||
|
||||
enum {
|
||||
HABIT_VIEW_CALENDAR = 0,
|
||||
HABIT_VIEW_WEEKLY = 1
|
||||
};
|
||||
|
||||
/* Habits-specific enums */
|
||||
typedef enum InbeHabitSyncMode {
|
||||
INBE_HABIT_SYNC_NONE = 0,
|
||||
INBE_HABIT_SYNC_ACTIVITIES = 1
|
||||
} InbeHabitSyncMode;
|
||||
|
||||
/* Data structures */
|
||||
typedef struct InbeHabitDay {
|
||||
int day_index;
|
||||
int completed;
|
||||
} InbeHabitDay;
|
||||
|
||||
typedef struct InbeHabit {
|
||||
char id[INBE_HABIT_ID_SIZE];
|
||||
char name[INBE_HABIT_NAME_SIZE];
|
||||
Color color;
|
||||
int sync_mode;
|
||||
int sync_activity;
|
||||
InbeHabitDay days[INBE_HABIT_MAX_DAYS];
|
||||
int day_count;
|
||||
} InbeHabit;
|
||||
|
||||
typedef struct InbeHabits {
|
||||
InbeHabit items[INBE_HABIT_MAX];
|
||||
int count;
|
||||
int selected;
|
||||
int scroll;
|
||||
int month_offset;
|
||||
int selector_open;
|
||||
int view_mode;
|
||||
int weekly_days;
|
||||
int loaded;
|
||||
} InbeHabits;
|
||||
|
||||
/* Additional structures */
|
||||
typedef struct HabitLinkedEntry {
|
||||
char path[HABIT_LINKED_PATH_SIZE];
|
||||
int year;
|
||||
int month;
|
||||
int day;
|
||||
int hour;
|
||||
int minute;
|
||||
int second;
|
||||
int activity;
|
||||
int rounds[MaxRounds];
|
||||
int round_count;
|
||||
int total_seconds;
|
||||
int best_seconds;
|
||||
} HabitLinkedEntry;
|
||||
|
||||
typedef struct HabitLinkedContext {
|
||||
HabitLinkedEntry entries[HABIT_LINKED_ENTRY_MAX];
|
||||
int count;
|
||||
int day_filter;
|
||||
int sync_mode;
|
||||
int sync_activity;
|
||||
int total_seconds;
|
||||
int best_seconds;
|
||||
} HabitLinkedContext;
|
||||
|
||||
/* External functions */
|
||||
void save_settings(InbeApp *app);
|
||||
|
||||
/* Core habits functions */
|
||||
void inbe_habits_init(InbeHabits *habits);
|
||||
void inbe_habits_save(const InbeHabits *habits);
|
||||
int inbe_habits_clear_days(InbeHabits *habits);
|
||||
int inbe_habits_today_index(void);
|
||||
int inbe_habit_completed_day(const InbeHabit *habit, int day_index);
|
||||
int inbe_habit_completed_today(const InbeHabit *habit);
|
||||
void inbe_habit_set_day(InbeHabits *habits, int index, int day_index, int completed);
|
||||
void inbe_habit_toggle_day(InbeHabits *habits, int index, int day_index);
|
||||
void inbe_habit_toggle_today(InbeHabits *habits, int index);
|
||||
void inbe_habits_add_default(InbeHabits *habits);
|
||||
void inbe_habits_add_default_set(InbeHabits *habits);
|
||||
void inbe_habits_delete(InbeHabits *habits, int index);
|
||||
int inbe_habits_add_custom(InbeHabits *habits, const char *name, Color color,
|
||||
int sync_mode, int sync_activity);
|
||||
int habit_activity_mask_for(int exercise);
|
||||
int habit_matches_activity(const InbeHabit *habit, int exercise_type);
|
||||
|
||||
void sync_habits_for_activity(InbeApp *app, int exercise_type);
|
||||
|
||||
/* Habit edit functions (moved to habits_screen.c) */
|
||||
void habit_edit_begin(InbeApp *app, int index);
|
||||
void habit_edit_begin_new(InbeApp *app);
|
||||
void habit_edit_commit(InbeApp *app);
|
||||
void habit_edit_cancel(InbeApp *app);
|
||||
|
||||
/* UI functions (moved to habits_screen.c) */
|
||||
void draw_habits_screen(InbeApp *app);
|
||||
void draw_habit_edit_screen(InbeApp *app);
|
||||
void draw_habit_session_edit_screen(InbeApp *app);
|
||||
int draw_habit_session_edit_content(InbeApp *app, HabitLinkedContext *ctx, int content_x, int content_w, int y, int draw);
|
||||
int habit_is_linked(const InbeHabit *habit);
|
||||
void habit_session_cancel_edit(InbeApp *app);
|
||||
|
||||
/* Habit session keyboard functions */
|
||||
int habit_session_keyboard_height(InbeApp *app);
|
||||
int habit_session_draw_keyboard(InbeApp *app, const HabitLinkedEntry *entry);
|
||||
int habit_session_keyboard_key(int x, int y, int w, int h, const char *label);
|
||||
void habit_session_delete_before_cursor(InbeApp *app);
|
||||
void habit_session_insert_char(InbeApp *app, char c);
|
||||
int habit_session_commit_edit(InbeApp *app, const HabitLinkedEntry *entry);
|
||||
void habit_session_clamp_cursor(InbeApp *app);
|
||||
int habit_session_parse_seconds(const char *text, int *seconds);
|
||||
|
||||
#endif
|
||||
@@ -1,13 +1,13 @@
|
||||
#include "language_tab.h"
|
||||
#include "language_screen.h"
|
||||
|
||||
#include "app.h"
|
||||
#include "locale.h"
|
||||
#include "theme.h"
|
||||
#include "flint_ui.h"
|
||||
#include "raylib.h"
|
||||
|
||||
extern int view_width;
|
||||
extern int view_height;
|
||||
extern Color c_text, c_bg, c_button;
|
||||
static const char *g_language_options[64];
|
||||
static int g_language_option_count = 0;
|
||||
|
||||
@@ -36,10 +36,10 @@ language_dropdown_button(InbeApp *app, int id, int x, int y, int w, int h, int *
|
||||
build_language_options(g_language_options, 64, &g_language_option_count);
|
||||
if(g_language_option_count <= 0) {
|
||||
int font = flint_ui_font();
|
||||
DrawRectangle(x, y, w, h, c_button);
|
||||
ui_draw_bevel(x, y, w, h, flint_darken(c_bg, 30), flint_lighten(c_bg, 20));
|
||||
DrawRectangle(x, y, w, h, theme_get_button());
|
||||
ui_draw_bevel(x, y, w, h, flint_darken(theme_get_bg(), 30), flint_lighten(theme_get_bg(), 20));
|
||||
flint_text_draw(locale_get("language_label"), x + flint_px(12),
|
||||
flint_ui_text_y(locale_get("language_label"), y, h, font), font, c_text);
|
||||
flint_ui_text_y(locale_get("language_label"), y, h, font), font, theme_get_text());
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ language_dropdown_menu(InbeApp *app, int id)
|
||||
}
|
||||
|
||||
void
|
||||
language_tab_draw(InbeApp *app)
|
||||
language_screen_draw(InbeApp *app)
|
||||
{
|
||||
int title_font = flint_px(24);
|
||||
int label_font = flint_ui_font();
|
||||
@@ -91,8 +91,8 @@ language_tab_draw(InbeApp *app)
|
||||
selection_changed = 1;
|
||||
|
||||
title_w = flint_text_measure(locale_get("language_picker_title"), title_font);
|
||||
flint_text_draw(locale_get("language_picker_title"), view_width / 2 - title_w / 2, flint_px(28), title_font, c_text);
|
||||
flint_text_draw(locale_get("language_label"), dropdown_x, dropdown_y - flint_px(24), label_font, c_text);
|
||||
flint_text_draw(locale_get("language_picker_title"), view_width / 2 - title_w / 2, flint_px(28), title_font, theme_get_text());
|
||||
flint_text_draw(locale_get("language_label"), dropdown_x, dropdown_y - flint_px(24), label_font, theme_get_text());
|
||||
|
||||
if(ui_draw_text_btn(button_x, button_y, locale_get("next_button"), &next_hover)) {
|
||||
app->inbe.screen = InbeScreenStart;
|
||||
@@ -1,10 +1,10 @@
|
||||
#ifndef LANGUAGE_TAB_H
|
||||
#define LANGUAGE_TAB_H
|
||||
|
||||
#include "../inbe.h"
|
||||
#include "../app_fwd.h"
|
||||
#include "breath_engine.h"
|
||||
#include "app_fwd.h"
|
||||
|
||||
void language_tab_draw(InbeApp *app);
|
||||
void language_screen_draw(InbeApp *app);
|
||||
int language_dropdown_button(InbeApp *app, int id, int x, int y, int w, int h, int *selected_index);
|
||||
int language_dropdown_menu(InbeApp *app, int id);
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
#include "manual_tab.h"
|
||||
#include "manual_screen.h"
|
||||
#include "app.h"
|
||||
#include "app_session.h"
|
||||
#include "session.h"
|
||||
#include "locale.h"
|
||||
#include "meditation_music.h"
|
||||
#include "theme.h"
|
||||
#include "flint_clip.h"
|
||||
#include "flint_ui.h"
|
||||
#include "flint_theme_meta.h"
|
||||
#include "raylib.h"
|
||||
@@ -13,8 +15,6 @@
|
||||
extern int view_width;
|
||||
extern int view_height;
|
||||
|
||||
extern Color c_text, c_bg, c_circle, c_button, c_button_hover, c_icon;
|
||||
|
||||
/* Tutorial text content ordered by step */
|
||||
static const char *const TUTORIAL_KEYS[] = {
|
||||
"tutorial_step_intro",
|
||||
@@ -28,6 +28,14 @@ static const char *const TUTORIAL_KEYS[] = {
|
||||
#define TUTORIAL_STEPS_COUNT (sizeof(TUTORIAL_KEYS) / sizeof(TUTORIAL_KEYS[0]))
|
||||
#define TUTORIAL_LINE_SPACING flint_px(8) /* Normal readable line spacing */
|
||||
|
||||
static Color
|
||||
manual_text_color_for_background(Color background)
|
||||
{
|
||||
int luma = background.r * 299 + background.g * 587 + background.b * 114;
|
||||
|
||||
return luma >= 128000 ? BLACK : WHITE;
|
||||
}
|
||||
|
||||
static void
|
||||
draw_tutorial_hold_preview(InbeApp *app, int center_x, int center_y, int radius)
|
||||
{
|
||||
@@ -35,6 +43,7 @@ draw_tutorial_hold_preview(InbeApp *app, int center_x, int center_y, int radius)
|
||||
char text[CountSize];
|
||||
int font = flint_px(16);
|
||||
int thickness = flint_px(5);
|
||||
Color text_color = theme_get_text();
|
||||
|
||||
count_from_int(text, seconds);
|
||||
if(thickness < 3)
|
||||
@@ -46,13 +55,15 @@ draw_tutorial_hold_preview(InbeApp *app, int center_x, int center_y, int radius)
|
||||
DrawRing((Vector2){center_x, center_y},
|
||||
(float)(radius + flint_px(8) - thickness / 2),
|
||||
(float)(radius + flint_px(8) + thickness / 2),
|
||||
-90.0f, -90.0f + sweep, 96, c_text);
|
||||
-90.0f, -90.0f + sweep, 96, theme_get_text());
|
||||
text_color = manual_text_color_for_background(theme_get_bg());
|
||||
} else {
|
||||
DrawCircle(center_x, center_y, radius, c_circle);
|
||||
DrawCircleLines(center_x, center_y, radius, c_text);
|
||||
DrawCircle(center_x, center_y, radius, theme_get_circle());
|
||||
DrawCircleLines(center_x, center_y, radius, theme_get_text());
|
||||
text_color = manual_text_color_for_background(theme_get_circle());
|
||||
}
|
||||
|
||||
flint_ui_draw_text_centered(text, center_x, center_y, font, c_text);
|
||||
flint_ui_draw_text_centered(text, center_x, center_y, font, text_color);
|
||||
}
|
||||
|
||||
static FlintUIParagraph
|
||||
@@ -61,13 +72,13 @@ tutorial_paragraph(InbeApp *app, int step, int content_w, int body_font)
|
||||
int has_icon = step == 1;
|
||||
return (FlintUIParagraph){
|
||||
.text = locale_get(TUTORIAL_KEYS[step]),
|
||||
.icon = has_icon ? app->icons[UI_ICON_TYPE_GEAR] : (Texture2D){0},
|
||||
.icon_type = has_icon ? UI_ICON_TYPE_GEAR : UI_ICON_TYPE_NONE,
|
||||
.icon = has_icon ? app->icons[UI_ICON_TYPE_WRENCH] : (Texture2D){0},
|
||||
.icon_type = has_icon ? UI_ICON_TYPE_WRENCH : UI_ICON_TYPE_NONE,
|
||||
.icon_size = has_icon ? flint_px(14) : 0,
|
||||
.width = content_w,
|
||||
.font = body_font,
|
||||
.line_gap = TUTORIAL_LINE_SPACING,
|
||||
.color = c_text,
|
||||
.color = theme_get_text(),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -84,7 +95,7 @@ draw_tutorial_paragraph(InbeApp *app, int step, int content_x, int *y, int conte
|
||||
}
|
||||
|
||||
void
|
||||
manual_tab_reset_layouts(InbeApp *app)
|
||||
manual_screen_reset_layouts(InbeApp *app)
|
||||
{
|
||||
if(app == NULL)
|
||||
return;
|
||||
@@ -93,7 +104,7 @@ manual_tab_reset_layouts(InbeApp *app)
|
||||
}
|
||||
|
||||
void
|
||||
manual_tab_close_tutorial(InbeApp *app, int mark_seen)
|
||||
manual_screen_close_tutorial(InbeApp *app, int mark_seen)
|
||||
{
|
||||
if(mark_seen)
|
||||
mark_exercise_manual_seen(app, app->exercise_type);
|
||||
@@ -103,7 +114,7 @@ manual_tab_close_tutorial(InbeApp *app, int mark_seen)
|
||||
}
|
||||
|
||||
static void
|
||||
manual_tab_start_exercise(InbeApp *app)
|
||||
manual_screen_start_exercise(InbeApp *app)
|
||||
{
|
||||
mark_exercise_manual_seen(app, app->exercise_type);
|
||||
app->tutorial_step = 0;
|
||||
@@ -135,7 +146,7 @@ meditation_manual_draw(InbeApp *app)
|
||||
int button_y = view_height - flint_px(52);
|
||||
int content_y = title_h + flint_px(20);
|
||||
int content_h = button_y - content_y - flint_px(16);
|
||||
int content_total_h = flint_px(410);
|
||||
int content_total_h = flint_px(520);
|
||||
FlintUIScrollArea scroll_area;
|
||||
FlintUIScrollView scroll_view;
|
||||
FlintUIParagraph paragraph;
|
||||
@@ -148,7 +159,7 @@ meditation_manual_draw(InbeApp *app)
|
||||
flint_centered_column(responsive_max_w, flint_page_side_padding(), &content_x, &content_w);
|
||||
|
||||
if(ui_draw_screen_header(locale_get("meditation_manual_title"), 1))
|
||||
manual_tab_close_tutorial(app, 0);
|
||||
manual_screen_close_tutorial(app, 0);
|
||||
|
||||
if(content_h < flint_px(120))
|
||||
content_h = flint_px(120);
|
||||
@@ -161,7 +172,7 @@ meditation_manual_draw(InbeApp *app)
|
||||
.width = content_w,
|
||||
.font = body_font,
|
||||
.line_gap = TUTORIAL_LINE_SPACING,
|
||||
.color = c_text,
|
||||
.color = theme_get_text(),
|
||||
};
|
||||
|
||||
scroll_area = (FlintUIScrollArea){
|
||||
@@ -173,13 +184,9 @@ meditation_manual_draw(InbeApp *app)
|
||||
};
|
||||
scroll_view = ui_scroll_container_begin(scroll_area);
|
||||
y = scroll_view.content_y;
|
||||
flint_ui_paragraph_draw(paragraph, content_x, &y);
|
||||
y += flint_px(24);
|
||||
|
||||
flint_text_draw(locale_get("meditation_music_section_title"),
|
||||
content_x, y, flint_ui_font(), c_text);
|
||||
y += flint_px(30);
|
||||
meditation_music_draw_guide_settings(app, content_x, content_w, &y);
|
||||
y += flint_px(34);
|
||||
flint_ui_paragraph_draw(paragraph, content_x, &y);
|
||||
ui_scroll_container_end(scroll_area, scroll_view);
|
||||
meditation_music_draw_dropdown_menu(app);
|
||||
|
||||
@@ -193,12 +200,12 @@ meditation_manual_draw(InbeApp *app)
|
||||
if(ui_draw_generic_button(content_x + (content_w - button_w) / 2, button_y,
|
||||
button_w, button_h, locale_get("tutorial_start_button"),
|
||||
UI_BUTTON_STYLE_PRIMARY, 0, &hover))
|
||||
manual_tab_start_exercise(app);
|
||||
manual_screen_start_exercise(app);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
manual_tab_draw(InbeApp *app)
|
||||
manual_screen_draw(InbeApp *app)
|
||||
{
|
||||
int title_h = ui_screen_header_height();
|
||||
int tab_h = flint_px(56);
|
||||
@@ -227,12 +234,12 @@ manual_tab_draw(InbeApp *app)
|
||||
if(step < (int)TUTORIAL_STEPS_COUNT - 1)
|
||||
app->tutorial_step++;
|
||||
else
|
||||
manual_tab_start_exercise(app);
|
||||
manual_screen_start_exercise(app);
|
||||
}
|
||||
if(IsKeyPressed(KEY_LEFT) && step > 0)
|
||||
app->tutorial_step--;
|
||||
if(IsKeyPressed(KEY_ESCAPE))
|
||||
manual_tab_close_tutorial(app, 0);
|
||||
manual_screen_close_tutorial(app, 0);
|
||||
|
||||
step = app->tutorial_step;
|
||||
if(previous_step != step) {
|
||||
@@ -263,7 +270,7 @@ manual_tab_draw(InbeApp *app)
|
||||
|
||||
close_clicked = ui_draw_screen_header(title, 1);
|
||||
if(close_clicked)
|
||||
manual_tab_close_tutorial(app, 0);
|
||||
manual_screen_close_tutorial(app, 0);
|
||||
|
||||
/* Calculate actual content height based on current step and text layouts */
|
||||
/* Don't include padding in this calculation - it's handled separately */
|
||||
@@ -343,7 +350,7 @@ manual_tab_draw(InbeApp *app)
|
||||
content_drag_active = 0;
|
||||
}
|
||||
|
||||
ui_begin_scissor((int)app->camera.offset.x,
|
||||
flint_clip_begin((int)app->camera.offset.x,
|
||||
(int)(app->camera.offset.y + title_h * app->camera.zoom),
|
||||
(int)(view_width * app->camera.zoom),
|
||||
(int)(content_area_h * app->camera.zoom));
|
||||
@@ -364,7 +371,7 @@ manual_tab_draw(InbeApp *app)
|
||||
int toggle_w = flint_px(56);
|
||||
int toggle_h = flint_px(30);
|
||||
flint_text_draw(locale_get("progressive_speed_label"), content_x, y,
|
||||
flint_ui_font(), c_text);
|
||||
flint_ui_font(), theme_get_text());
|
||||
y += flint_px(26);
|
||||
if(ui_draw_toggle_switch(content_x, y, toggle_w, toggle_h,
|
||||
&progressive_speed, locale_get("toggle_off"),
|
||||
@@ -407,7 +414,7 @@ manual_tab_draw(InbeApp *app)
|
||||
} else if(step == 4) {
|
||||
int hold_preview_radius = flint_px(54);
|
||||
int hold_preview_extent = hold_preview_radius + flint_px(8) + flint_px(5);
|
||||
flint_text_draw(locale_get("hold_display_label"), content_x, y, flint_ui_font(), c_text);
|
||||
flint_text_draw(locale_get("hold_display_label"), content_x, y, flint_ui_font(), theme_get_text());
|
||||
y += flint_px(26);
|
||||
draw_hold_display_mode_selector(app, content_x, y, content_w);
|
||||
y += flint_px(36) + flint_px(20) + hold_preview_extent;
|
||||
@@ -420,7 +427,7 @@ manual_tab_draw(InbeApp *app)
|
||||
y += img_h + flint_px(22);
|
||||
draw_tutorial_paragraph(app, 5, content_x, &y, content_w, body_font);
|
||||
}
|
||||
ui_end_scissor();
|
||||
flint_clip_end();
|
||||
|
||||
/* Draw scrollbar if content overflows */
|
||||
if(max_scroll > 0) {
|
||||
@@ -450,12 +457,12 @@ manual_tab_draw(InbeApp *app)
|
||||
|
||||
flint_text_draw(page_label,
|
||||
view_width / 2 - flint_text_measure(page_label, page_font) / 2,
|
||||
footer_y - page_font - counter_gap, page_font, c_text);
|
||||
footer_y - page_font - counter_gap, page_font, theme_get_text());
|
||||
|
||||
if(step == 0) {
|
||||
if(ui_draw_generic_button(content_x, footer_y, button_w, button_h,
|
||||
left_label, UI_BUTTON_STYLE_PRIMARY, 0, &left_hover))
|
||||
manual_tab_start_exercise(app);
|
||||
manual_screen_start_exercise(app);
|
||||
} else {
|
||||
if(ui_draw_generic_button(content_x, footer_y, button_w, button_h,
|
||||
left_label, UI_BUTTON_STYLE_PRIMARY, 0, &left_hover)) {
|
||||
@@ -467,7 +474,7 @@ manual_tab_draw(InbeApp *app)
|
||||
if(ui_draw_generic_button(content_x + button_w + footer_gap, footer_y, button_w, button_h,
|
||||
right_label, UI_BUTTON_STYLE_PRIMARY, 0, &right_hover)) {
|
||||
if(step == (int)TUTORIAL_STEPS_COUNT - 1)
|
||||
manual_tab_start_exercise(app);
|
||||
manual_screen_start_exercise(app);
|
||||
else {
|
||||
app->tutorial_step++;
|
||||
app->manual_scroll = 0;
|
||||
@@ -0,0 +1,11 @@
|
||||
#ifndef MANUAL_TAB_H
|
||||
#define MANUAL_TAB_H
|
||||
|
||||
#include "breath_engine.h"
|
||||
#include "app_fwd.h"
|
||||
|
||||
void manual_screen_draw(InbeApp *app);
|
||||
void manual_screen_close_tutorial(InbeApp *app, int mark_seen);
|
||||
void manual_screen_reset_layouts(InbeApp *app);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,60 @@
|
||||
#include "practice_screen.h"
|
||||
#include "app.h"
|
||||
#include "locale.h"
|
||||
|
||||
void
|
||||
on_practice_tab_click(void *user_data)
|
||||
{
|
||||
InbeApp *app = user_data;
|
||||
extern void app_request_bottom_tab(InbeApp *app, int bottom_tab);
|
||||
enum { APP_BOTTOM_TAB_PRACTICE = 1 };
|
||||
app_request_bottom_tab(app, APP_BOTTOM_TAB_PRACTICE);
|
||||
}
|
||||
|
||||
int
|
||||
practice_activity_count_for_tab(int tab)
|
||||
{
|
||||
(void)tab;
|
||||
return EXERCISE_COUNT;
|
||||
}
|
||||
|
||||
int
|
||||
practice_activity_for_tab(int tab, int index)
|
||||
{
|
||||
(void)tab;
|
||||
if(index < 0)
|
||||
return EXERCISE_WIM_HOF;
|
||||
if(index >= EXERCISE_COUNT)
|
||||
return EXERCISE_COUNT - 1;
|
||||
return index;
|
||||
}
|
||||
|
||||
const char *
|
||||
practice_activity_label(int exercise)
|
||||
{
|
||||
switch(exercise) {
|
||||
case EXERCISE_MEDITATION:
|
||||
return locale_get("exercise_meditation");
|
||||
case EXERCISE_WIM_HOF:
|
||||
default:
|
||||
return locale_get("exercise_wim_hof");
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
practice_activity_index_for_tab(int tab, int exercise)
|
||||
{
|
||||
(void)tab;
|
||||
if(exercise < 0 || exercise >= EXERCISE_COUNT)
|
||||
return EXERCISE_WIM_HOF;
|
||||
return exercise;
|
||||
}
|
||||
|
||||
void
|
||||
practice_clamp_activity_to_tab(InbeApp *app)
|
||||
{
|
||||
if(app == NULL)
|
||||
return;
|
||||
if(app->exercise_type < 0 || app->exercise_type >= EXERCISE_COUNT)
|
||||
app->exercise_type = EXERCISE_WIM_HOF;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
#ifndef PRACTICE_SCREEN_H
|
||||
#define PRACTICE_SCREEN_H
|
||||
|
||||
#include "raylib.h"
|
||||
#include "app_fwd.h"
|
||||
|
||||
#define PRACTICE_CATEGORY_TAB_H 40
|
||||
#define PRACTICE_CATEGORY_TOAST_TICKS 120
|
||||
#define PRACTICE_CONFIG_TAB_LIST (-1)
|
||||
|
||||
int practice_activity_count_for_tab(int tab);
|
||||
int practice_activity_for_tab(int tab, int index);
|
||||
const char *practice_activity_label(int exercise);
|
||||
int practice_activity_index_for_tab(int tab, int exercise);
|
||||
void practice_clamp_activity_to_tab(InbeApp *app);
|
||||
|
||||
void on_practice_tab_click(void *user_data);
|
||||
void app_request_bottom_tab(InbeApp *app, int bottom_tab);
|
||||
|
||||
#endif
|
||||