Compare commits

...
42 Commits
Author SHA1 Message Date
waozi f7eec1888c Retry transient Emscripten zlib port downloads 2026-09-21 12:02:40 -03:00
waozi 8e38e2a6f4 Keep release appcast tool with Inbe 2026-09-21 11:46:14 -03:00
waozi 3575ba97f0 Exclude unused terminal clipboard protocol from Inbe builds 2026-09-21 11:23:33 -03:00
waozi 4479ef83e2 Keep session origin on habit day marks only 2026-09-21 10:55:11 -03:00
waozi 0e17c333d5 Keep new style tokens and Habits styling in generated arrays 2026-09-21 10:38:07 -03:00
waozi f4e3522523 Migrate app colors onto StyleTokenColor
Replace every legacy theme getter outside the style bridge with
StyleTokenColor reads against the tokens app_style.kry already registers:
GetThemeBackground->canvas, Text->text, MutedText->muted, Surface->surface,
SurfaceAlt->panel, Button->accent, ButtonHover->accent-hover,
ButtonText->accent-ink, Border->border, Circle->accent, plus new Link and Icon
tokens added to the bridge table (45->47). GetTheme* calls now live only in
app_style.kry (the bridge), the theme settings screen's catalog listing
(GetThemeLabel), one GetThemeMetrics, and GetThemeReadableText (a pure
contrast function, not palette state).

make native, no-vendor-edits, clean-text-api-check, and button-api-check
pass; an xvfb screenshot smoke shows the full palette rendering (292 sampled
colors, not black). lists-ui-test fails identically at HEAD before this
change (pre-existing). Visual parity review of the mapped tokens is still
pending.
2026-09-21 10:37:36 -03:00
waozi bfd8d552d2 Update navigation test stub for style tokens 2026-09-21 10:37:01 -03:00
waozi e3cbeda015 Distinguish linked session progress in Habits 2026-09-21 10:35:31 -03:00
waozi 1c242eac02 Bump Kryon for the StyleTokenColor getter 2026-09-21 10:26:26 -03:00
waozi 3220a032df Show synchronized Lists and items on the account screen 2026-09-21 10:11:28 -03:00
waozi 7b6a7aa9db Translate sync server label in every locale 2026-09-21 10:04:05 -03:00
waozi c36d80a247 Bump Kryon for the native-window props declarations 2026-09-21 10:03:29 -03:00
waozi eedcbdc38e Fix Android icon asset generation with current Kryon 2026-09-21 10:00:32 -03:00
waozi d1307b06f4 Release 2.0.4 with complete account and Lists sync 2026-09-21 09:59:08 -03:00
waozi 61f6e2ca41 Bump Kryon for the app host props declarations 2026-09-21 09:57:01 -03:00
waozi 43d9fabfbc Bump Kryon for the key props declaration 2026-09-21 03:45:48 -03:00
waozi 48ef3929fc Bump Kryon for the icon props declarations 2026-09-21 03:40:23 -03:00
waozi 02774c652c Bump Kryon for the style-pack props declarations 2026-09-21 03:30:23 -03:00
waozi 8c692e51e5 Bump Kryon for the locale props declarations 2026-09-21 03:16:51 -03:00
waozi 00faaf7e93 Bump Kryon for the node host props declarations 2026-09-21 03:06:42 -03:00
waozi ac8400e57c Bump Kryon for the text-layout props declarations 2026-09-21 03:02:00 -03:00
waozi 6eedd34bb0 Bump Kryon for the orphaned ui_inspect cleanup 2026-09-21 02:56:51 -03:00
waozi 00603e09bb Bump Kryon for the app-shell props declarations 2026-09-21 02:49:57 -03:00
waozi 9c3cf327b2 Bump Kryon for the tree props declarations 2026-09-21 02:42:13 -03:00
waozi ebcb99e944 Bump Kryon for the interface props declarations and unified focus symbols
Take the interface host declared in runtime/core_props.kry and follow the
KryonSetFocus/KryonGetFocus rename in the elist screen and its test. The Go
API keeps its SetFocus spelling. make native passes against 790159020.
2026-09-21 02:29:03 -03:00
waozi ca763d9183 Bump Kryon for the controls props declarations 2026-09-21 02:15:54 -03:00
waozi c89f5e9b09 Bump Kryon for the frame host props declarations 2026-09-21 02:07:44 -03:00
waozi 1d373214f2 Bump Kryon for the capability and text-backend props declarations 2026-09-21 01:52:00 -03:00
waozi ca6747894a Bump Kryon for the instance-state props declaration 2026-09-21 01:42:25 -03:00
waozi 7337178a2b Bump Kryon for the text and profile props declarations 2026-09-21 01:35:20 -03:00
waozi c238bc5bd3 Bump Kryon for the scaling, clip, and layout props declarations 2026-09-21 01:25:20 -03:00
waozi 197fc01897 Bump Kryon for the page host props declarations 2026-09-21 01:18:05 -03:00
waozi 68622fbab8 Bump Kryon for node-registry and inspector props declarations 2026-09-21 01:09:18 -03:00
waozi 49f929c3f4 Bump Kryon for props-header host declarations
Take the reorder, swipe, toast, transition, nav, and scrollbar hosts declared
in their tracked props headers, which deletes the six handwritten shim headers.
Inbe's SwipeGesture record now imports ui_swipe_props.generated.h directly.
make native passes against cf152103; the vendor tree stays clean.
2026-09-21 00:56:11 -03:00
waozi 61f016831d Bump Kryon for the shim header cleanup 2026-09-21 00:29:57 -03:00
waozi 90fbe0f049 Clarify sync account actions and empty-state wording
Rename the sync account onboarding buttons and status so the two
actions are unambiguous:

- "Create Account" -> "Create New Account"
- "Import .key File" -> "Import Account Key"
- "Create an account before connecting" -> "No account connected yet"
- "Create account or import key" -> "Create a new account or import an existing key"

Updated across all 12 locales with real translations, no English
placeholders.
2026-09-21 00:23:29 -03:00
waozi 9b25bd887d Bump Kryon for shared runtime color math
Move the LightenColor/DarkenColor host shim onto Kryon's shared runtime and take
the k2c re-entrant runtime-parsing fix. Inbe's DarkenColor/LightenColor callers
resolve through kryon.h as before. make native passes; vendor stays clean.
2026-09-21 00:23:05 -03:00
waozi 6764286c22 Bump Kryon for bounded file dialog portal deadline
Pulls kryon master 60b59a9 ("file_dialog: bound portal deadline and
fall back to external helpers") which prevents the xdg-desktop-portal
file chooser from blocking the main thread forever.  When the portal
window cannot be associated with the parent the call returns after 15 s
and falls through to the installed external helper (zenity / kdialog /
yad).
2026-09-21 00:06:58 -03:00
waozi 8cbb34a62c Log sync key import traces at warning level
Keep the temporary sync_import_key_trace scene's diagnostics visible in the app
log while the key import path is traced.
2026-09-20 23:58:30 -03:00
waozi 33082cebf4 Record the committed Kryon pointer and gate results 2026-09-20 23:57:53 -03:00
waozi 64c1b6b7db Migrate Inbe's UI onto the .kry Kryon runtime
Author the remaining app UI, platform hosts, and storage helpers in .kry,
generate Kryon's src/ui modules and headers in the Inbe build, and follow the
migrated Kryon surface (generated props ABI and Button ImageProps). Move the
Plan 9 app loop and music fallback, Android lifecycle/share titles, desktop
tray, screenshots, and style tokens to their .kry owners, and delete the C
owners they replace.

Stop background execution whenever no visible indicator is present: the
desktop tray, Chrome worker, and Android foreground service now confirm their
indicator before continuing. Report gates: make native, no-vendor-edits,
clean-text-api-check, button-api-check, version-test, proof-test, and
sync-recovery-test pass.

vendor/kryon moves to 8f1a8608.
2026-09-20 23:56:13 -03:00
waozi 7e84a69098 Release 2.0.3 with custom sync server support in web builds 2026-09-20 20:09:07 -03:00
159 changed files with 2970 additions and 1674 deletions

No files matched your search

+3 -1
View File
@@ -101,7 +101,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: kryonlabs/daochi
ref: 51902c57c537724cf4c083227f5da6c50e24ba39
ref: 902230435fba6f64f5067afab551410456fb57d0
path: .test-server
submodules: recursive
@@ -159,6 +159,7 @@ jobs:
echo "EM_CONFIG=$HOME/emsdk/.emscripten" >> "$GITHUB_ENV"
echo "INBE_NODE_BIN=$(dirname "$(command -v node)")" >> "$GITHUB_ENV"
echo "$HOME/emsdk/upstream/emscripten" >> "$GITHUB_PATH"
bash scripts/ensure-emscripten-zlib.sh "$HOME/emsdk/upstream/emscripten/embuilder"
- name: Build Chrome Extension ZIP
run: |
@@ -225,6 +226,7 @@ jobs:
echo "EM_CONFIG=$HOME/emsdk/.emscripten" >> "$GITHUB_ENV"
echo "INBE_NODE_BIN=$(dirname "$(command -v node)")" >> "$GITHUB_ENV"
echo "$HOME/emsdk/upstream/emscripten" >> "$GITHUB_PATH"
bash scripts/ensure-emscripten-zlib.sh "$HOME/emsdk/upstream/emscripten/embuilder"
- name: Build Firefox Add-on ZIP
run: |
+4 -7
View File
@@ -114,6 +114,7 @@ jobs:
echo "EM_CONFIG=$HOME/emsdk/.emscripten" >> "$GITHUB_ENV"
echo "INBE_NODE_BIN=$(dirname "$(command -v node)")" >> "$GITHUB_ENV"
echo "$HOME/emsdk/upstream/emscripten" >> "$GITHUB_PATH"
bash scripts/ensure-emscripten-zlib.sh "$HOME/emsdk/upstream/emscripten/embuilder"
- name: Build Web ZIP
run: |
@@ -175,6 +176,7 @@ jobs:
echo "EM_CONFIG=$HOME/emsdk/.emscripten" >> "$GITHUB_ENV"
echo "INBE_NODE_BIN=$(dirname "$(command -v node)")" >> "$GITHUB_ENV"
echo "$HOME/emsdk/upstream/emscripten" >> "$GITHUB_PATH"
bash scripts/ensure-emscripten-zlib.sh "$HOME/emsdk/upstream/emscripten/embuilder"
- name: Build Chrome Extension ZIP
run: |
@@ -236,6 +238,7 @@ jobs:
echo "EM_CONFIG=$HOME/emsdk/.emscripten" >> "$GITHUB_ENV"
echo "INBE_NODE_BIN=$(dirname "$(command -v node)")" >> "$GITHUB_ENV"
echo "$HOME/emsdk/upstream/emscripten" >> "$GITHUB_PATH"
bash scripts/ensure-emscripten-zlib.sh "$HOME/emsdk/upstream/emscripten/embuilder"
- name: Build Firefox Add-on ZIP
run: |
@@ -846,12 +849,6 @@ jobs:
with:
fetch-depth: 0
- name: Checkout Kryon Appcast Tool
run: |
set -euo pipefail
git submodule update --init --depth 1 vendor/kryon
test -f vendor/kryon/scripts/make_appcast.py
- name: Download Release Artifacts
uses: actions/download-artifact@v4
with:
@@ -954,7 +951,7 @@ jobs:
echo "no release artifacts found for the appcast"
exit 1
fi
python3 vendor/kryon/scripts/make_appcast.py \
python3 scripts/make_appcast.py \
--version "$VERSION" \
--base-url "$BASE" \
--notes-url "https://github.com/waozixyz/inbe/releases/tag/$TAG" \
+20 -1
View File
@@ -1,4 +1,23 @@
# Changelog
## [2.0.4] - 2026-09-21
### Changed
- The account screen shows the connected alias, automatic sync progress, and counts for habits, history days, sessions, friends, lists, and list items.
- Habits show a distinct mark for days completed through a practice session.
- Importing an account key offers Merge or Replace before changing local data, with clear details about each choice.
- Profile offers Connect Account, and the sync screen offers Import .key when no account is connected.
### Fixed
- Restoring an existing account now retrieves its username, friends, habits, history, and sessions from the complete account data.
- Lists and their items now sync across devices, including completed items and changes made on another device.
- Sync status shows the current upload or restore step instead of staying on a generic syncing message.
- Connecting an account starts automatic sync without leaving a stale status message behind.
## [2.0.3] - 2026-09-20
### Fixed
- Web and browser builds can connect to compatible custom sync servers when you choose one.
- Browser extensions no longer request access to the Inner Breeze website.
- Chrome break reminders now follow the app's settings and Rest Now action.
## [2.0.2] - 2026-09-20
### Fixed
- Habit editor section headings and reminder details now align with their rows.
@@ -88,7 +107,7 @@
## [1.9.16] - 2026-08-29
### Changed
- Sync now speaks Ksync protocol v5 compatibility mode while keeping existing secure synced data usable.
- Sync remains compatible with existing secure account keys and synced data.
### Fixed
- Fixed web sync key import stability in Firefox.
+35 -18
View File
@@ -211,10 +211,15 @@ KRYON_RUNTIME_KRY := $(sort $(wildcard $(KRYON_DIR)/runtime/*.kry))
KRYON_RUNTIME_C := $(patsubst $(KRYON_DIR)/%.kry,$(KRYON_GENERATED_SRC_DIR)/%.c,$(KRYON_RUNTIME_KRY))
KRYON_RUNTIME_H := $(KRYON_RUNTIME_C:.c=.h)
KRYON_RUNTIME_STAMP := $(KRYON_GENERATED_SRC_DIR)/runtime/.fresh
# Inbe does not host a terminal paste stream, so it has no clipboard protocol callbacks.
KRYON_UI_KRY := $(filter-out $(KRYON_DIR)/src/ui/clipboard_protocol.kry,$(sort $(wildcard $(KRYON_DIR)/src/ui/*.kry)))
KRYON_UI_C := $(patsubst $(KRYON_DIR)/src/ui/%.kry,$(KRYON_GENERATED_SRC_DIR)/ui/%.c,$(KRYON_UI_KRY))
KRYON_UI_H := $(KRYON_UI_C:.c=.h)
KRYON_UI_STAMP := $(KRYON_GENERATED_SRC_DIR)/ui/.fresh
KRYON_ICON_ASSETS_C := $(KRYON_GENERATED_SRC_DIR)/ui/ui_icon_assets.c
KRYON_ICON_NAMES_C := $(KRYON_GENERATED_SRC_DIR)/ui/ui_icon_names.c
KRYON_ICON_TYPES_H := $(KRYON_GENERATED_INCLUDE_DIR)/ui_icon_types.h
KRYON_SRCS := $(filter-out $(KRYON_DIR)/src/ui/ui_icon_assets.c $(KRYON_DIR)/src/ui/ui_icon_names.c,$(shell find $(KRYON_DIR)/src -type f -name '*.c' | LC_ALL=C sort)) $(KRYON_ICON_ASSETS_C) $(KRYON_ICON_NAMES_C) $(KRYON_RUNTIME_C)
KRYON_SRCS := $(filter-out $(KRYON_DIR)/src/ui/ui_icon_assets.c $(KRYON_DIR)/src/ui/ui_icon_names.c,$(shell find $(KRYON_DIR)/src -type f -name '*.c' | LC_ALL=C sort)) $(KRYON_ICON_ASSETS_C) $(KRYON_ICON_NAMES_C) $(KRYON_RUNTIME_C) $(KRYON_UI_C)
KRYON_SYNC_ICONS := $(KRYON_DIR)/scripts/sync-icons.sh
WEB_SHARED_ICON_SHEETS := platforms language tiles
KRYON_LIBDRAW_SRCS := $(filter $(KRYON_DIR)/src/backend/libdraw_%.c,$(KRYON_SRCS))
@@ -229,7 +234,7 @@ KRYON_WEB_SRCS := $(KRYON_SRCS)
KRYON_WEB_SRCS := $(filter-out $(KRYON_DIR)/src/backend/dom_%.c,$(KRYON_WEB_SRCS))
KRYON_WINDOWS_SRCS := $(filter-out $(KRYON_DIR)/src/file_dialog/file_dialog.c,$(KRYON_SRCS))
KRYON_CLICK_SRCS := $(filter-out $(KRYON_DIR)/src/file_dialog/file_dialog.c,$(KRYON_SRCS))
KRYON_INCLUDE := -I$(KRYON_GENERATED_INCLUDE_DIR) -I$(KRYON_GENERATED_SRC_DIR) -I$(KRYON_DIR)/include -I$(KRYON_DIR)/vendor/monocypher/src -I$(KRYON_DIR)/vendor/monocypher/src/optional
KRYON_INCLUDE := -I$(KRYON_GENERATED_INCLUDE_DIR) -I$(KRYON_GENERATED_SRC_DIR) -I$(KRYON_DIR)/include -I$(KRYON_DIR)/src/ui -I$(KRYON_DIR)/src/platform -I$(KRYON_DIR)/src/backend -I$(KRYON_GENERATED_SRC_DIR)/runtime -I$(KRYON_DIR)/vendor/utf8proc -DUTF8PROC_STATIC -I$(KRYON_DIR)/vendor/monocypher/src -I$(KRYON_DIR)/vendor/monocypher/src/optional
KRYON_SYNC_ACCOUNT_C := $(KRYON_DIR)/src/sync/sync_account.c
KRYON_SYNC_CRYPTO_C := $(KRYON_DIR)/src/sync/sync_crypto.c $(KRYON_DIR)/src/sync/monocypher.c $(KRYON_DIR)/src/sync/monocypher_ed25519.c
KRYON_SYNC_C := $(KRYON_DIR)/src/sync/sync.c
@@ -591,6 +596,17 @@ $(KRYON_RUNTIME_STAMP): Makefile $(K2C) $(KRYON_RUNTIME_KRY)
$(KRYON_RUNTIME_C) $(KRYON_RUNTIME_H): $(KRYON_RUNTIME_STAMP)
@test -f $@
# Kryon's .kry-backed UI modules generate the public ui/*.h headers that the
# retained handwritten src/ui/*.c host services include, plus the generated
# implementations for the migrated widgets. Mirror kryon's own --root src pass.
$(KRYON_UI_STAMP): Makefile $(K2C) $(KRYON_UI_KRY) $(KRYON_RUNTIME_STAMP)
mkdir -p $(dir $@)
$(K2C) --no-main --root $(abspath $(KRYON_DIR)/src) -o $(abspath $(KRYON_GENERATED_SRC_DIR)) $(abspath $(KRYON_UI_KRY))
touch $@
$(KRYON_UI_C) $(KRYON_UI_H): $(KRYON_UI_STAMP)
@test -f $@
$(KRY_GEN_STAMP): Makefile $(K2C) $(KRY_SRCS) $(SYNC_RETRY_HEADER) $(STORAGE_LAYOUT_HEADER) $(KRYON_RUNTIME_STAMP) | build-laws
rm -rf $(KRY_GEN_DIR)
mkdir -p $(KRY_GEN_DIR)
@@ -812,11 +828,11 @@ embedded-image-assets-check: $(EMBEDDED_ASSETS_C)
.PHONY: habits-cards-ui-test
habits-cards-ui-test: $(TARGET)
xvfb-run -a bash tests/habits_cards_ui_test.sh "$(abspath $(TARGET))"
bash tests/habits_cards_ui_test.sh "$(abspath $(TARGET))"
.PHONY: lists-ui-test
lists-ui-test: $(TARGET)
xvfb-run -a bash tests/lists_ui_test.sh "$(abspath $(TARGET))"
bash tests/lists_ui_test.sh "$(abspath $(TARGET))"
.PHONY: storage-literals-check
storage-literals-check:
@@ -878,7 +894,7 @@ $(STORAGE_PATHS_TEST): tests/storage_paths_test.c $(STORAGE_CORE_SRCS) $(KRY_GEN
$(CC) -Wall -Wextra -std=c99 -D_DEFAULT_SOURCE -D_GNU_SOURCE -ffunction-sections -fdata-sections \
-Isrc -Isrc/app -Isrc/core -Isrc/screens -Isrc/screens/settings -Isrc/practices -Isrc/practices/whm -Isrc/practices/meditation -Isrc/storage -Isrc/platform/android -Isrc/third_party $(KRYON_INCLUDE) -I$(KRY_GEN_DIR) -I$(KRY_GEN_DIR)/src $(SQLITE_INCLUDE) \
-o $@ \
tests/storage_paths_test.c $(STORAGE_CORE_SRCS) $(KRYON_DIR)/src/kry_std/kry_archive.c $(KRYON_DIR)/src/ui/ui_inspect.c $(KRY_GEN_DIR)/src/storage/storage_sessions.c $(KRY_GEN_DIR)/src/storage/storage_elist.c $(KRY_GEN_DIR)/src/storage/sync_review.c $(KRY_GEN_DIR)/src/storage/db.c $(KRY_GEN_DIR)/src/storage/import.c $(KRY_GEN_DIR)/src/storage/data.c $(KRY_GEN_DIR)/src/habits/habit_model.c $(KRY_GEN_DIR)/src/habits/habit_sessions.c $(SQLITE_SRC) \
tests/storage_paths_test.c $(STORAGE_CORE_SRCS) $(KRYON_DIR)/src/kry_std/kry_archive.c $(KRY_GEN_DIR)/src/storage/storage_sessions.c $(KRY_GEN_DIR)/src/storage/storage_elist.c $(KRY_GEN_DIR)/src/storage/sync_review.c $(KRY_GEN_DIR)/src/storage/db.c $(KRY_GEN_DIR)/src/storage/import.c $(KRY_GEN_DIR)/src/storage/data.c $(KRY_GEN_DIR)/src/habits/habit_model.c $(KRY_GEN_DIR)/src/habits/habit_sessions.c $(SQLITE_SRC) \
-Wl,--gc-sections $(NATIVE_SYSTEM_LDLIBS)
$(LOCALE_KEYS_TEST): tests/locale_keys_test.c $(LOCALE_FILES) | $(TEST_BIN_DIR)
@@ -932,12 +948,13 @@ $(FONT_GLYPH_COVERAGE_TEST): tests/font_glyph_coverage_test.c $(FONT_FILES) $(LO
-o $@ \
tests/font_glyph_coverage_test.c
$(APP_BOTTOM_NAV_TEST): tests/app_bottom_nav_test.c src/app/app_nav.h src/app/app.h $(KRY_GEN_DIR)/src/app/app_nav.c $(KRY_GEN_DIR)/src/app/customize_nav.c $(KRY_GEN_DIR)/src/widgets/bottom_nav.c $(KRYON_DIR)/include/ui_tree.h $(KRYON_DIR)/src/core/app_shell.c $(KRYON_DIR)/include/app_shell.h | $(TEST_BIN_DIR)
$(APP_BOTTOM_NAV_TEST): tests/app_bottom_nav_test.c src/app/app_nav.h src/app/app.kry $(KRY_GEN_DIR)/src/app/app.h $(KRY_GEN_DIR)/src/app/app_nav.c $(KRY_GEN_DIR)/src/app/customize_nav.c $(KRY_GEN_DIR)/src/widgets/bottom_nav.c $(KRYON_DIR)/include/ui_tree_props.generated.h $(KRYON_GENERATED_SRC_DIR)/ui/app_shell_layout.c $(KRYON_GENERATED_SRC_DIR)/ui/app_shell_route.c $(KRYON_DIR)/include/ui_app_shell_props.generated.h $(SQLITE_AMALGAMATION_H) | $(TEST_BIN_DIR)
$(CC) -Wall -Wextra -std=c99 -D_DEFAULT_SOURCE \
-Isrc -Isrc/app -Isrc/core -Isrc/screens -Isrc/screens/settings -Isrc/storage -Isrc/platform/android $(KRYON_INCLUDE) -I$(KRY_GEN_DIR) -I$(KRY_GEN_DIR)/src $(SQLITE_INCLUDE) \
-o $@ \
tests/app_bottom_nav_test.c $(KRY_GEN_DIR)/src/app/metrics.c \
$(KRYON_DIR)/src/core/app_shell.c \
$(KRYON_GENERATED_SRC_DIR)/ui/app_shell_layout.c \
$(KRYON_GENERATED_SRC_DIR)/ui/app_shell_route.c \
$(KRY_GEN_DIR)/src/app/customize_nav.c \
$(KRY_GEN_DIR)/src/widgets/bottom_nav.c
@@ -946,31 +963,31 @@ test: elist-screen-test
elist-screen-test: $(TEST_BIN_DIR)/elist_screen_test
$<
$(TEST_BIN_DIR)/elist_screen_test: tests/elist_screen_test.c $(KRY_GEN_DIR)/src/screens/elist_screen.c src/app/app.h | $(TEST_BIN_DIR)
$(TEST_BIN_DIR)/elist_screen_test: tests/elist_screen_test.c $(KRY_GEN_DIR)/src/screens/elist_screen.c src/app/app.kry $(KRY_GEN_DIR)/src/app/app.h | $(TEST_BIN_DIR)
$(CC) -Wall -Wextra -std=c99 -D_DEFAULT_SOURCE -ffunction-sections -fdata-sections \
-Isrc -Isrc/app -Isrc/core -Isrc/screens -Isrc/screens/settings -Isrc/storage -Isrc/platform/android $(KRYON_INCLUDE) -I$(KRY_GEN_DIR) -I$(KRY_GEN_DIR)/src $(SQLITE_INCLUDE) \
-Wl,--gc-sections -o $@ tests/elist_screen_test.c $(KRY_GEN_DIR)/src/app/metrics.c
$(TEST_BIN_DIR)/habit_form_test: tests/habit_form_test.c $(KRY_GEN_DIR)/src/screens/habits/edit.c src/app/app.h | $(TEST_BIN_DIR)
$(TEST_BIN_DIR)/habit_form_test: tests/habit_form_test.c $(KRY_GEN_DIR)/src/screens/habits/edit.c src/app/app.kry $(KRY_GEN_DIR)/src/app/app.h $(SQLITE_AMALGAMATION_H) | $(TEST_BIN_DIR)
$(CC) -Wall -Wextra -std=c99 -D_DEFAULT_SOURCE -ffunction-sections -fdata-sections \
-Isrc -Isrc/app -Isrc/core -Isrc/screens -Isrc/screens/settings -Isrc/storage -Isrc/platform/android $(KRYON_INCLUDE) -I$(KRY_GEN_DIR) -I$(KRY_GEN_DIR)/src \
-Isrc -Isrc/app -Isrc/core -Isrc/screens -Isrc/screens/settings -Isrc/storage -Isrc/platform/android $(KRYON_INCLUDE) -I$(KRY_GEN_DIR) -I$(KRY_GEN_DIR)/src $(SQLITE_INCLUDE) \
-Wl,--gc-sections -o $@ tests/habit_form_test.c $(KRY_GEN_DIR)/src/app/metrics.c $(KRY_GEN_DIR)/src/screens/habits/edit.c
$(TEST_BIN_DIR)/practice_carousel_test: tests/practice_carousel_test.c $(KRY_GEN_DIR)/src/screens/practice_screen.c src/app/app.h | $(TEST_BIN_DIR)
$(TEST_BIN_DIR)/practice_carousel_test: tests/practice_carousel_test.c $(KRY_GEN_DIR)/src/screens/practice_screen.c src/app/app.kry $(KRY_GEN_DIR)/src/app/app.h | $(TEST_BIN_DIR)
$(CC) -Wall -Wextra -std=c99 -D_DEFAULT_SOURCE -ffunction-sections -fdata-sections \
$(APP_INCLUDE) $(SQLITE_INCLUDE) \
-Wl,--gc-sections -o $@ tests/practice_carousel_test.c
$(HABIT_MODEL_TEST): tests/habit_model_test.c $(KRY_GEN_DIR)/src/habits/habit_model.c src/screens/habits_screen.h src/screens/habits/habits.h | $(TEST_BIN_DIR)
$(HABIT_MODEL_TEST): tests/habit_model_test.c $(KRY_GEN_DIR)/src/habits/habit_model.c src/screens/habits_screen.h src/screens/habits/habits.h $(SQLITE_AMALGAMATION_H) | $(TEST_BIN_DIR)
$(CC) -Wall -Wextra -std=c99 -D_DEFAULT_SOURCE \
-Isrc -Isrc/app -Isrc/core -Isrc/screens -Isrc/screens/settings -Isrc/storage -Isrc/platform/android $(KRYON_INCLUDE) -I$(KRY_GEN_DIR) -I$(KRY_GEN_DIR)/src \
-Isrc -Isrc/app -Isrc/core -Isrc/screens -Isrc/screens/settings -Isrc/storage -Isrc/platform/android $(KRYON_INCLUDE) -I$(KRY_GEN_DIR) -I$(KRY_GEN_DIR)/src $(SQLITE_INCLUDE) \
-o $@ \
tests/habit_model_test.c \
$(KRY_GEN_DIR)/src/habits/habit_model.c
$(HABIT_SESSIONS_TEST): tests/habit_sessions_test.c $(KRY_GEN_DIR)/src/habits/habit_sessions.c $(KRY_GEN_DIR)/src/habits/habit_model.c src/screens/habits_screen.h src/screens/habits/habits.h | $(TEST_BIN_DIR)
$(HABIT_SESSIONS_TEST): tests/habit_sessions_test.c $(KRY_GEN_DIR)/src/habits/habit_sessions.c $(KRY_GEN_DIR)/src/habits/habit_model.c src/screens/habits_screen.h src/screens/habits/habits.h $(SQLITE_AMALGAMATION_H) | $(TEST_BIN_DIR)
$(CC) -Wall -Wextra -std=c99 -D_DEFAULT_SOURCE \
-Isrc -Isrc/app -Isrc/core -Isrc/screens -Isrc/screens/settings -Isrc/storage -Isrc/platform/android $(KRYON_INCLUDE) -I$(KRY_GEN_DIR) -I$(KRY_GEN_DIR)/src \
-Isrc -Isrc/app -Isrc/core -Isrc/screens -Isrc/screens/settings -Isrc/storage -Isrc/platform/android $(KRYON_INCLUDE) -I$(KRY_GEN_DIR) -I$(KRY_GEN_DIR)/src $(SQLITE_INCLUDE) \
-o $@ \
tests/habit_sessions_test.c \
$(KRY_GEN_DIR)/src/habits/habit_sessions.c \
@@ -983,7 +1000,7 @@ $(BREATH_TIMING_TEST): tests/breath_timing_test.c $(KRY_GEN_DIR)/src/core/breath
tests/breath_timing_test.c \
$(KRY_GEN_DIR)/src/core/breath_engine.c
$(TEST_BIN_DIR)/session_results_test: tests/session_results_test.c $(KRY_GEN_DIR)/src/practices/session_results.c $(KRY_GEN_DIR)/src/practices/meditation/meditation_session.c src/app/app.h | $(TEST_BIN_DIR)
$(TEST_BIN_DIR)/session_results_test: tests/session_results_test.c $(KRY_GEN_DIR)/src/practices/session_results.c $(KRY_GEN_DIR)/src/practices/meditation/meditation_session.c src/app/app.kry $(KRY_GEN_DIR)/src/app/app.h | $(TEST_BIN_DIR)
$(CC) -Wall -Wextra -std=c99 -D_DEFAULT_SOURCE -ffunction-sections -fdata-sections \
-Isrc -Isrc/app -Isrc/core -Isrc/screens -Isrc/screens/settings -Isrc/storage -Isrc/platform/android -Isrc/third_party $(KRYON_INCLUDE) $(SQLITE_INCLUDE) -I$(KRY_GEN_DIR) -I$(KRY_GEN_DIR)/src \
-o $@ tests/session_results_test.c $(KRY_GEN_DIR)/src/practices/session_results.c $(KRY_GEN_DIR)/src/practices/meditation/meditation_session.c -Wl,--gc-sections
@@ -1004,7 +1021,7 @@ $(ACTIVITY_MONITOR_TEST): tests/activity_monitor_test.c $(KRYON_DIR)/src/platfor
$(KRYON_DIR)/src/platform/kry_activity_monitor.c \
$(if $(filter linux,$(NATIVE_PLATFORM)),-ldl,)
$(FRAME_PACING_TEST): tests/frame_pacing_test.c $(KRY_GEN_DIR)/src/app/app_frame_pacing.c src/app/app_frame_pacing.kry src/app/app.h | $(TEST_BIN_DIR)
$(FRAME_PACING_TEST): tests/frame_pacing_test.c $(KRY_GEN_DIR)/src/app/app_frame_pacing.c src/app/app_frame_pacing.kry src/app/app.kry $(KRY_GEN_DIR)/src/app/app.h | $(TEST_BIN_DIR)
$(CC) $(CFLAGS) $(CPPFLAGS) \
-Isrc -Isrc/app -Isrc/core -Isrc/screens -Isrc/screens/settings -Isrc/storage -Isrc/platform/android $(KRYON_INCLUDE) -I$(KRY_GEN_DIR) -I$(KRY_GEN_DIR)/src $(SQLITE_INCLUDE) \
-Wl,--gc-sections -o $@ tests/frame_pacing_test.c $(KRY_GEN_DIR)/src/app/app_frame_pacing.c
@@ -1020,7 +1037,7 @@ FORCE:
$(EMBEDDED_ASSETS_C): Makefile $(EMBEDDED_ASSET_FILES) $(KRYON_DIR)/scripts/embed-assets.sh | $(BUILD_OBJ_DIR)
sh $(KRYON_DIR)/scripts/embed-assets.sh $@ $(EMBEDDED_ASSET_FILES)
$(KRYON_ICON_ASSETS_C) $(KRYON_ICON_NAMES_C) $(KRYON_ICON_TYPES_H): $(KRYON_ICON_FILES) $(KRYON_DIR)/scripts/embed-icon-sheets.py $(KRYON_DIR)/include/ui_icons.h | $(BUILD_OBJ_DIR)
$(KRYON_ICON_ASSETS_C) $(KRYON_ICON_NAMES_C) $(KRYON_ICON_TYPES_H): $(KRYON_ICON_FILES) $(KRYON_DIR)/scripts/embed-icon-sheets.py | $(BUILD_OBJ_DIR)
cd $(KRYON_DIR) && python3 scripts/embed-icon-sheets.py "$(KRYON_ICON_DIR)" \
"$(abspath $(KRYON_ICON_ASSETS_C))" \
--types-output "$(abspath $(KRYON_ICON_TYPES_H))" \
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -5,7 +5,7 @@ Text.muted {
foreground: muted;
}
Text.selected-navigation {
foreground: accent-ink;
foreground: text;
}
Text.circle-ink {
foreground: #171022;
+45 -3
View File
@@ -1,6 +1,35 @@
# Inbe source ownership
Product behavior is maintained in `.kry`: application setup and rendering,
## Remaining migration work (2026-09-20)
This section records the committed migration state, not a shipped or fully
verified one. Kryon `master` is clean at `6f141648` with the UI `.kry` moves and
the round records committed; Inbe `vendor/kryon` is pinned to the migration
commit `8f1a8608` and Inbe's migration is committed as `64c1b6b`. Inbe's
`make native` and contract gates pass at that revision; screenshots and
Android/Plan 9/web checks have not run. Kryon's source-level and Button evidence
checklist is in
[the upstream UI migration plan](../../kryon/plan/UI_MIGRATION_REMAINING.md).
| Area | Current state | What closes it |
|---|---|---|
| App UI contract | `src/app/app.h` still has handwritten declarations for screen, widget, route, audio, and presentation functions implemented in `.kry`. `app_fwd.h`, `app_internal.h`, `app_nav.h`, screen/practice headers, and platform headers also need declaration-by-declaration review. | Move UI records and callable contracts into `.kry`, consume k2c-generated headers, and delete redundant handwritten UI declarations without introducing compatibility headers. Keep genuine OS/FFI contracts only. Build all maintained callers after removal. |
| Native C boundary | `src/platform/main_host.c`, `src/app/app_web_bridge.c`, `src/platform/android/{android_device.c,android_insets.c,android_share.c}`, Plan 9 entry/SQLite/import adapters, and `src/storage/storage_json_builder.c` remain. | Audit every branch for UI, lifecycle, theme, and data policy. Move any remaining product decision to `.kry`; document the OS/JNI/JS/SQLite/C-varargs effect left in C. Preserve the checked JSON builder failure contract. |
| Platform UI moves | Screenshot scenes/capture, startup and icon selection, Android lifecycle/share title, Plan 9 app loop and music fallback, and style tokens now have `.kry` owners. | Generate and build the changed sources on each supported path; check screenshot parity, icon installation, Android pause/resume/share, Plan 9 startup/music fallback, and style persistence. The Plan 9 `entry.c` must remain a process adapter only. |
| KSS ownership | `assets/styles/inbe.kss` supplies product presentation and `src/app/app_style.kry` supplies style behavior, but the current generated boundary and all live theme callers have not been reverified. | Review each hardcoded presentation choice and theme getter use, migrate reusable style choices upstream where necessary, then verify light/dark style switching and no-style fallback without changing the accepted appearance. |
| UI test ownership | UI shell checks exist; `tests/app_bottom_nav_test.c`, `frame_pacing_test.c`, `font_locale_test.c`, `screenshot_scene_test.sh`, and other C/UI fixtures still need ownership review. | Move UI behavior/assertions into `.kry` tests where the language can express them, leaving shell/C only for narrow host setup or process checks. Ensure the test graph compiles the generated modules; record exact results. |
| Background notification policy | Desktop tray, Chrome worker, and Android indicator/session code carry committed edits for the rule that no background activity continues without a visible indicator. | Verify close/minimize/reopen, indicator loss, permission denial, Android foreground service and Chrome worker behavior on their actual targets. Confirm no timer or notification survives an absent indicator; record platform evidence. |
| Vendor and delivery | Kryon is committed on upstream `master` and Inbe's clean `vendor/kryon` gitlink is `8f1a8608`; the parent commit `64c1b6b` is clean. | Done: pointer moved by commit and no vendor source edits. Keep the pointer moving only to clean upstream commits. |
Verification requires separate user approval for each test and each Bend law.
After approval, Inbe's `make build-laws` is mandatory for native, web, and
Windows builds; `make clean-text-api-check button-api-check` covers the UI API
guards. Native checks need omega's SDL pkg-config path, and display/input
checks must run on a private Xvfb/Xephyr display with inherited display
variables scrubbed. Record Android, Plan 9, web, and Windows separately;
unavailable toolchains or devices stay unverified.
Most product behavior is maintained in `.kry`: application setup and rendering,
practice and habit rules, account/sync orchestration, database policy, audio
selection, desktop tray menus, screenshot scenes, and browser actions.
`app/app_types.kry` owns the application records and enums. C declarations are
@@ -27,8 +56,21 @@ startup calls the same `.kry` application setup on each platform.
## Native boundary
The remaining C handles platform integration: window setup/frame submission,
Android JNI and insets, browser JavaScript interop, and Plan 9 system adapters.
The frame loop, startup choices, screenshot scenes, native Android session
state transitions and debug practice decisions, and Plan 9 window loop are
authored in `.kry`.
The remaining C handles OS window calls, Android JNI conversion and synchronized
event handoff, browser JavaScript interop, and Plan 9 process entry and system
adapters. Plan 9's music playback, status, and unavailable control behavior are authored in
`platform/plan9/meditation_music.kry`; the Plan 9 C music stub has been removed.
The desktop icon asset is selected in `platform/app_host.kry`; the native host
only decodes and installs it.
These latest moves still require native, Android, and Plan 9 verification.
Android Java still owns notification permission, indicator observation, and
foreground-service effects. The session pause/resume and background-timer
decision is in `platform/android/android_lifecycle.kry`.
Android share-sheet titles are selected by `.kry` callers; the JNI adapter
receives the title with the data it shares.
`storage_json_builder.c` contains only the C varargs bridge; buffer growth,
escaping, failure state, and timestamp serialization live in `storage/json.kry`.
The checked JSON builder is retained because the current Kryon JSON emitter
+2 -2
View File
@@ -53,8 +53,8 @@ android {
applicationId "xyz.waozi.inbe"
minSdk 21
targetSdk 36
versionCode 126
versionName "2.0.2"
versionCode 128
versionName "2.0.4"
manifestPlaceholders = [
inbeAppLabel: "Inner Breeze",
inbeUsesCleartextTraffic: "false"
+40 -2
View File
@@ -57,7 +57,15 @@ list(REMOVE_ITEM KRYON_SOURCES "${KRYON_DIR}/src/ui/ui_icon_names.c")
list(FILTER KRYON_SOURCES EXCLUDE REGEX "${KRYON_DIR}/src/backend/.*")
list(FILTER KRYON_SOURCES EXCLUDE REGEX "${KRYON_DIR}/src/platform/plan9/.*")
list(APPEND KRYON_SOURCES
"${KRYON_DIR}/src/backend/kry_backend.c"
"${KRYON_DIR}/src/backend/kry_backend_draw.c"
"${KRYON_DIR}/src/backend/kry_dpi.c"
"${KRYON_DIR}/src/backend/kry_event_wait.c"
"${KRYON_DIR}/src/backend/kry_icon_atlas.c"
"${KRYON_DIR}/src/backend/kry_layer_texture.c"
"${KRYON_DIR}/src/backend/kry_style_build_mode.c"
"${KRYON_DIR}/src/backend/kry_ui_platform.c"
"${KRYON_DIR}/src/backend/kry_unicode.c"
"${KRYON_DIR}/src/backend/kry_image.c"
"${KRYON_DIR}/src/backend/kry_image_decode.c"
"${KRYON_DIR}/src/backend/kry_input.c"
@@ -166,6 +174,29 @@ add_custom_command(
)
add_custom_target(kryon_runtime_generated DEPENDS ${KRYON_RUNTIME_GENERATED_C})
list(APPEND KRYON_SOURCES ${KRYON_RUNTIME_GENERATED_C})
# Kryon's .kry-backed UI modules generate the public ui/*.h headers that the
# retained handwritten src/ui/*.c host services include, plus the generated
# implementations for the migrated widgets. Mirrors the root Makefile's
# KRYON_UI pass (k2c --no-main --root kryon/src), which runs after the
# runtime pass.
set(KRYON_UI_GEN_DIR "${CMAKE_BINARY_DIR}/kryon/generated-ui")
file(GLOB KRYON_UI_MODULE_FILES CONFIGURE_DEPENDS
"${KRYON_DIR}/src/ui/*.kry")
set(KRYON_UI_GENERATED_C)
foreach(kryon_module_file ${KRYON_UI_MODULE_FILES})
file(RELATIVE_PATH kryon_module "${KRYON_DIR}/src" "${kryon_module_file}")
string(REGEX REPLACE "\\.kry$" ".c" kryon_module_c "${kryon_module}")
list(APPEND KRYON_UI_GENERATED_C "${KRYON_UI_GEN_DIR}/${kryon_module_c}")
endforeach()
add_custom_command(
OUTPUT ${KRYON_UI_GENERATED_C}
COMMAND "${KRYON_K2C}" --no-main --root "${KRYON_DIR}/src" -o "${KRYON_UI_GEN_DIR}" ${KRYON_UI_MODULE_FILES}
DEPENDS "${KRYON_K2C}" ${KRYON_UI_MODULE_FILES} ${KRYON_RUNTIME_GENERATED_C}
WORKING_DIRECTORY "${KRYON_DIR}"
VERBATIM
)
add_custom_target(kryon_ui_generated DEPENDS ${KRYON_UI_GENERATED_C})
list(APPEND KRYON_SOURCES ${KRYON_UI_GENERATED_C})
add_custom_target(app_kry_generated DEPENDS
${APP_KRY_GENERATED_SOURCES}
${APP_KRY_GENERATED_HEADERS}
@@ -307,7 +338,7 @@ add_library(main SHARED
"${NATIVE_APP_GLUE_DIR}/android_native_app_glue.c"
)
add_dependencies(main app_kry_generated kryon_raylib_generated
kryon_runtime_generated app_build_laws)
kryon_runtime_generated kryon_ui_generated app_build_laws)
file(GLOB_RECURSE KRYON_ICON_FILES CONFIGURE_DEPENDS "${KRYON_DIR}/icons/*.png" "${KRYON_DIR}/icons/*.json")
add_custom_command(
@@ -317,7 +348,7 @@ add_custom_command(
"${KRYON_ICON_ASSETS_C}"
--types-output "${KRYON_ICON_TYPES_H}"
--names-output "${KRYON_ICON_NAMES_C}"
DEPENDS "${KRYON_DIR}/scripts/embed-icon-sheets.py" "${KRYON_DIR}/include/ui_icons.h" ${KRYON_ICON_FILES}
DEPENDS "${KRYON_DIR}/scripts/embed-icon-sheets.py" ${KRYON_ICON_FILES}
WORKING_DIRECTORY "${KRYON_DIR}"
VERBATIM)
add_custom_target(kryon_icon_assets_generated DEPENDS "${KRYON_ICON_ASSETS_C}" "${KRYON_ICON_NAMES_C}" "${KRYON_ICON_TYPES_H}")
@@ -328,6 +359,10 @@ target_include_directories(main PRIVATE
"${KRYON_ICON_GENERATED_INCLUDE_DIR}"
"${KRYON_DIR}/include"
"${KRYON_DIR}/src"
"${KRYON_DIR}/src/ui"
"${KRYON_DIR}/src/platform"
"${KRYON_DIR}/src/backend"
"${KRYON_DIR}/vendor/utf8proc"
"${KRYON_DIR}/vendor/monocypher/src"
"${KRYON_DIR}/vendor/monocypher/src/optional"
"${SRC_DIR}"
@@ -345,6 +380,8 @@ target_include_directories(main PRIVATE
"${APP_KRY_GEN_DIR}"
"${APP_KRY_GEN_DIR}/src"
"${KRYON_RUNTIME_GEN_DIR}"
"${KRYON_RUNTIME_GEN_DIR}/runtime"
"${KRYON_UI_GEN_DIR}"
"${NATIVE_APP_GLUE_DIR}"
"${SQLITE_BUILD_DIR}"
)
@@ -354,6 +391,7 @@ target_compile_definitions(main PRIVATE
ANDROID_BUILD=1
_DEFAULT_SOURCE
_GNU_SOURCE
UTF8PROC_STATIC
_FILE_OFFSET_BITS=64
MG_TLS=MG_TLS_BUILTIN
MG_ENABLE_EPOLL=0
@@ -68,7 +68,6 @@ public class MainActivity extends NativeActivity {
private boolean activityPaused = false;
private boolean windowFocused = true;
private boolean backgroundExecutionActive = false;
private boolean autoPausedForLifecycle = false;
private boolean notificationPermissionRequestInFlight = false;
private int lastDeleteRepeatCount = -1;
private int pendingImportKind = 0;
@@ -78,6 +77,14 @@ public class MainActivity extends NativeActivity {
private boolean pendingDebugDonationReminder = false;
private int pendingDebugDonationReminderRetries = 0;
private final Handler mainHandler = new Handler(Looper.getMainLooper());
private final Runnable checkSessionIndicator = new Runnable() {
@Override
public void run() {
if (backgroundExecutionActive) {
syncLifecycleState("indicator check");
}
}
};
private native void nativeSetInsets(int left, int top, int right, int bottom, int imeBottom,
int cutoutLeft, int cutoutTop, int cutoutRight, int cutoutBottom);
@@ -85,10 +92,7 @@ public class MainActivity extends NativeActivity {
private native void nativeSetSystemDark(int dark);
private native void nativeSetOrientation(int orientation);
private native void nativeWakeLockReady();
private native void nativeSetBackgroundActive(boolean active);
private native int nativeGetPlayInBackground();
private native int nativePauseSession();
private native void nativeResumeSession();
private native int nativeSyncLifecycleState(boolean paused, boolean indicatorVisible);
private native void nativeImportSelectedFile(int kind, String path);
private native void nativeImportCancelled(int kind);
private native void nativeRuntimeAssetDownloadSucceeded(long handle, long bytes, int httpStatus);
@@ -683,8 +687,12 @@ public class MainActivity extends NativeActivity {
}
public void acquireWakeLock() {
Log.d(TAG, "Starting session foreground service");
requestNotificationPermissionIfNeeded();
if (!SessionForegroundService.canShowIndicator(this)) {
Log.w(TAG, "Session indicator unavailable; background service not started");
return;
}
Log.d(TAG, "Starting session foreground service");
Intent intent = new Intent(this, SessionForegroundService.class);
intent.setAction(SessionForegroundService.ACTION_START);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
@@ -696,9 +704,7 @@ public class MainActivity extends NativeActivity {
public void releaseWakeLock() {
Log.d(TAG, "Stopping session foreground service");
Intent intent = new Intent(this, SessionForegroundService.class);
intent.setAction(SessionForegroundService.ACTION_STOP);
startService(intent);
stopService(new Intent(this, SessionForegroundService.class));
}
public void updateSessionNotification(final String statusText) {
@@ -984,34 +990,27 @@ public class MainActivity extends NativeActivity {
}
private void syncLifecycleState(String reason) {
int playInBackground = nativeGetPlayInBackground();
boolean shouldRunInBackground = playInBackground != 0 && activityPaused;
boolean indicatorVisible = SessionForegroundService.hasVisibleIndicator(this);
backgroundExecutionActive = nativeSyncLifecycleState(activityPaused, indicatorVisible) != 0;
Log.d(TAG, reason + ": play_in_background=" + playInBackground
+ " activityPaused=" + activityPaused
Log.d(TAG, reason + ": activityPaused=" + activityPaused
+ " indicatorVisible=" + indicatorVisible
+ " windowFocused=" + windowFocused
+ " backgroundActive=" + backgroundExecutionActive);
if (backgroundExecutionActive != shouldRunInBackground) {
nativeSetBackgroundActive(shouldRunInBackground);
backgroundExecutionActive = shouldRunInBackground;
if (activityPaused && !backgroundExecutionActive) {
stopService(new Intent(this, SessionForegroundService.class));
}
if (playInBackground == 0) {
if (activityPaused && !autoPausedForLifecycle) {
autoPausedForLifecycle = nativePauseSession() != 0;
} else if (!activityPaused && autoPausedForLifecycle) {
nativeResumeSession();
autoPausedForLifecycle = false;
}
} else if (autoPausedForLifecycle) {
nativeResumeSession();
autoPausedForLifecycle = false;
mainHandler.removeCallbacks(checkSessionIndicator);
if (backgroundExecutionActive) {
mainHandler.postDelayed(checkSessionIndicator, 2000);
}
}
@Override
protected void onPause() {
NotificationPresence.setActivityVisible(false);
super.onPause();
activityPaused = true;
syncLifecycleState("onPause");
@@ -1020,6 +1019,7 @@ public class MainActivity extends NativeActivity {
@Override
protected void onResume() {
super.onResume();
NotificationPresence.setActivityVisible(true);
activityPaused = false;
configureSystemBars();
nativeInvalidateGraphicsResources();
@@ -1060,6 +1060,8 @@ public class MainActivity extends NativeActivity {
@Override
protected void onDestroy() {
NotificationPresence.setActivityVisible(false);
mainHandler.removeCallbacks(checkSessionIndicator);
super.onDestroy();
Log.d(TAG, "onDestroy called - releasing wake lock");
allowScreenOff();
@@ -0,0 +1,19 @@
package xyz.waozi.inbe;
import android.content.Context;
/** Process-local presence. A push delivery in a new process starts as absent. */
final class NotificationPresence {
private static volatile boolean activityVisible;
private NotificationPresence() {
}
static void setActivityVisible(boolean visible) {
activityVisible = visible;
}
static boolean canPostPush(Context context) {
return activityVisible || SessionForegroundService.hasVisibleIndicator(context);
}
}
@@ -25,6 +25,10 @@ public class PushServiceImpl extends PushService {
@Override
public void onMessage(PushMessage message, String instance) {
if (!NotificationPresence.canPostPush(this)) {
Log.d(TAG, "Ignoring push without a visible app or session indicator");
return;
}
String text = new String(message.getContent());
String title = "Inner Breeze";
String body = text;
@@ -85,6 +89,9 @@ public class PushServiceImpl extends PushService {
.setContentText(body)
.setAutoCancel(true)
.setContentIntent(pi);
if (!NotificationPresence.canPostPush(this)) {
return;
}
nm.notify(NOTIFICATION_ID, b.build());
}
}
@@ -11,6 +11,7 @@ import android.content.pm.ServiceInfo;
import android.os.Build;
import android.os.IBinder;
import android.os.PowerManager;
import android.service.notification.StatusBarNotification;
import android.util.Log;
public class SessionForegroundService extends Service {
@@ -20,16 +21,16 @@ public class SessionForegroundService extends Service {
private static final String CHANNEL_ID = "active_session";
private static final int NOTIFICATION_ID = 3001;
private static String currentStatusText = "";
private static SessionForegroundService activeService = null;
private static volatile SessionForegroundService activeService = null;
private PowerManager.WakeLock wakeLock = null;
private boolean foregroundActive = false;
private volatile boolean foregroundActive = false;
@Override
public void onCreate() {
super.onCreate();
activeService = this;
ensureNotificationChannel();
ensureNotificationChannel(this);
}
@Override
@@ -60,6 +61,11 @@ public class SessionForegroundService extends Service {
}
private void startSession() {
if (!canShowIndicator(this)) {
Log.w(TAG, "Session indicator unavailable; refusing background service");
stopSelf();
return;
}
currentStatusText = "";
Notification notification = buildNotification();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
@@ -102,6 +108,56 @@ public class SessionForegroundService extends Service {
}
}
static boolean hasVisibleIndicator(Context context) {
SessionForegroundService service = activeService;
if (service == null || !service.foregroundActive) {
return false;
}
NotificationManager manager = notificationManagerWithVisibleChannel(context);
if (manager == null) {
return false;
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
try {
for (StatusBarNotification notification : manager.getActiveNotifications()) {
if (notification.getId() == NOTIFICATION_ID) {
return true;
}
}
} catch (RuntimeException error) {
Log.w(TAG, "Could not confirm session indicator", error);
}
return false;
}
// Older Android releases cannot confirm that the posted indicator is
// visible, so they cannot authorize background session execution.
return false;
}
static boolean canShowIndicator(Context context) {
ensureNotificationChannel(context);
return notificationManagerWithVisibleChannel(context) != null;
}
private static NotificationManager notificationManagerWithVisibleChannel(Context context) {
NotificationManager manager =
(NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);
if (manager == null) {
return null;
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N && !manager.areNotificationsEnabled()) {
return null;
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
NotificationChannel channel = manager.getNotificationChannel(CHANNEL_ID);
if (channel == null || channel.getImportance() == NotificationManager.IMPORTANCE_NONE) {
return null;
}
}
return manager;
}
private void stopForegroundCompat() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
stopForeground(STOP_FOREGROUND_REMOVE);
@@ -179,20 +235,20 @@ public class SessionForegroundService extends Service {
return builder.build();
}
private void ensureNotificationChannel() {
private static void ensureNotificationChannel(Context context) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
return;
}
NotificationManager manager =
(NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);
(NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);
if (manager == null) {
return;
}
NotificationChannel channel = new NotificationChannel(
CHANNEL_ID,
getApplicationInfo().loadLabel(getPackageManager()),
context.getApplicationInfo().loadLabel(context.getPackageManager()),
NotificationManager.IMPORTANCE_LOW
);
manager.createNotificationChannel(channel);
@@ -0,0 +1,4 @@
Fixed
---
- Web and browser builds can connect to compatible custom sync servers when you choose one.
- Browser extensions no longer request access to the Inner Breeze website.
@@ -0,0 +1,12 @@
Changed
---
- The account screen shows the connected alias, automatic sync progress, and counts for habits, history days, sessions, friends, lists, and list items.
- Habits show a distinct mark for days completed through a practice session.
- Importing an account key offers Merge or Replace before changing local data, with clear details about each choice.
- Profile offers Connect Account, and the sync screen offers Import .key when no account is connected.
Fixed
---
- Restoring an existing account now retrieves its username, friends, habits, history, and sessions from the complete account data.
- Lists and their items now sync across devices, including completed items and changes made on another device.
- Sync status shows the current upload or restore step instead of staying on a generic syncing message.
- Connecting an account starts automatic sync without leaving a stale status message behind.
@@ -1,3 +1,3 @@
Changed
---
- Move shared Ksync sync protocol code into Flint and simplify Inbe sync client wiring.
- Improve the shared sync protocol and simplify Inbe sync client wiring.
+59 -15
View File
@@ -620,7 +620,7 @@ Ukončit
Účet
---
[sync_create_account_button]
Vytvořit účet
Vytvořit nový účet
---
[sync_account_created]
Účet vytvořen
@@ -628,6 +628,9 @@ Vytvořit účet
[sync_account_create_failed]
Účet se nepodařilo vytvořit
---
[sync_connect_account_button]
Připojit účet
---
[sync_import_key_button]
Importovat soubor .key
---
@@ -652,12 +655,6 @@ Veřejné ID zkopírováno
[sync_backup_key_button]
Zálohovat klíč
---
[sync_remote_label]
Vzdálený server
---
[sync_connect_button]
Připojit
---
[sync_server_url_invalid]
Použijte https:// nebo loopback jako localhost:8080
---
@@ -680,7 +677,7 @@ Keeping local data
Sync review failed
---
[sync_no_account]
Před připojením vytvořte účet
Zatím není připojen žádný účet
---
[sync_backup_warning]
Uložte tento soukromý klíč někam, kde jej máte pod kontrolou. Kdokoli s ním může převzít tento účet.
@@ -719,13 +716,16 @@ Odhlásit se
Odhlášeno. Místní data zůstávají na tomto zařízení.
---
[sync_account_switch_title]
Vymazat místní data?
Zvolte způsob připojení
---
[sync_account_switch_message]
Toto zařízení obsahuje data z jiného synchronizačního účtu. Před použitím tohoto účtu vymažte místní data.
V tomto zařízení byla nalezena místní data. Nahrazení je smaže a obnoví tento účet. Sloučení je zachová a zkombinuje obě sady dat.
---
[sync_account_switch_merge_button]
Sloučit a připojit
---
[sync_account_switch_clear_button]
Vymazat a použít účet
Nahradit a připojit
---
[sync_account_switch_cancelled]
Změna účtu zrušena
@@ -1863,8 +1863,11 @@ Synchronizace tohoto profilu je připravena.
[profile_account_sync_title]
Účet a synchronizace
---
[profile_account_connected_body]
Správa připojeného účtu a automatické synchronizace
---
[profile_account_sync_body]
Vytvořit účet nebo importovat klíč
Vytvořte nový účet nebo importujte existující soubor .key
---
[profile_data_management_title]
Data
@@ -1892,9 +1895,6 @@ Synchronizace…
[sync_retry_waiting]
Připojení selhalo. Automaticky se opakuje.
---
[sync_retry_button]
Zkusit znovu
---
[app_icon_label]
Ikona aplikace
@@ -1920,3 +1920,47 @@ Skrýt dokončené
[guide_title]
Rychlý průvodce
---
---
[sync_connected_as]
Připojeno jako %s
---
[sync_everything_up_to_date]
Vše je aktuální
---
[sync_step_account_connected]
Účet připojen
---
[sync_step_data_restored]
Data obnovena
---
[sync_step_automatic_on]
Automatická synchronizace zapnuta
---
[sync_history_days_label]
Dny historie
---
[sync_now_button]
Synchronizovat nyní
---
[sync_progress_uploading]
Odesílání %lld místních položek…
---
[sync_progress_securing]
Zabezpečování položek: %lld z %lld…
---
[sync_progress_restoring]
Obnovování dat účtu…
---
[sync_progress_friends]
Obnovování přátel…
---
[sync_remote_label]
Synchronizační server
---
---
[sync_lists_label]
Seznamy
---
[sync_list_items_label]
Položky
---
+59 -15
View File
@@ -620,7 +620,7 @@ Beenden
Konto
---
[sync_create_account_button]
Konto erstellen
Neues Konto erstellen
---
[sync_account_created]
Konto erstellt
@@ -628,6 +628,9 @@ Konto erstellt
[sync_account_create_failed]
Konto konnte nicht erstellt werden
---
[sync_connect_account_button]
Konto verbinden
---
[sync_import_key_button]
.key-Datei importieren
---
@@ -652,12 +655,6 @@ ID kopieren
[sync_backup_key_button]
Schlüssel sichern
---
[sync_remote_label]
Server
---
[sync_connect_button]
Verbinden
---
[sync_server_url_invalid]
Nutze https:// oder Loopback wie localhost:8080
---
@@ -680,7 +677,7 @@ Keeping local data
Sync review failed
---
[sync_no_account]
Erstelle ein Konto, bevor du dich verbindest
Noch kein Konto verbunden
---
[sync_backup_warning]
Speichere diesen privaten Schlüssel an einem Ort, den du kontrollierst. Jeder mit diesem Schlüssel kann dieses Konto übernehmen.
@@ -719,13 +716,16 @@ Abmelden
Abgemeldet. Lokale Daten bleiben auf diesem Gerät.
---
[sync_account_switch_title]
Lokale Daten löschen?
Verbindungsmethode wählen
---
[sync_account_switch_message]
Dieses Gerät enthält Daten eines anderen Sync-Kontos. Lösche lokale Daten, bevor du dieses Konto verwendest.
Auf diesem Gerät wurden lokale Daten gefunden. Ersetzen löscht sie und stellt dieses Konto wieder her. Zusammenführen behält sie und kombiniert beide Datensätze.
---
[sync_account_switch_merge_button]
Zusammenführen und verbinden
---
[sync_account_switch_clear_button]
Löschen und Konto verwenden
Ersetzen und verbinden
---
[sync_account_switch_cancelled]
Kontowechsel abgebrochen
@@ -1863,8 +1863,11 @@ Die Synchronisierung für dieses Profil ist bereit.
[profile_account_sync_title]
Konto und Synchronisierung
---
[profile_account_connected_body]
Verbundenes Konto und automatische Synchronisierung verwalten
---
[profile_account_sync_body]
Konto erstellen oder Schlüssel importieren
Neues Konto erstellen oder eine vorhandene .key-Datei importieren
---
[profile_data_management_title]
Daten
@@ -1892,9 +1895,6 @@ Synchronisierung läuft…
[sync_retry_waiting]
Verbindung fehlgeschlagen. Automatischer neuer Versuch.
---
[sync_retry_button]
Erneut versuchen
---
[app_icon_label]
App-Symbol
@@ -1920,3 +1920,47 @@ Erledigte ausblenden
[guide_title]
Kurzanleitung
---
---
[sync_connected_as]
Verbunden als %s
---
[sync_everything_up_to_date]
Alles ist auf dem neuesten Stand
---
[sync_step_account_connected]
Konto verbunden
---
[sync_step_data_restored]
Daten wiederhergestellt
---
[sync_step_automatic_on]
Automatische Synchronisierung aktiv
---
[sync_history_days_label]
Verlaufstage
---
[sync_now_button]
Jetzt synchronisieren
---
[sync_progress_uploading]
Lokale Elemente werden gesendet: %lld…
---
[sync_progress_securing]
Elemente werden geschützt: %lld von %lld…
---
[sync_progress_restoring]
Kontodaten werden wiederhergestellt…
---
[sync_progress_friends]
Freunde werden wiederhergestellt…
---
[sync_remote_label]
Synchronisierungsserver
---
---
[sync_lists_label]
Listen
---
[sync_list_items_label]
Einträge
---
+61 -17
View File
@@ -32,13 +32,16 @@ Sessions
Create an account to sync and protect your progress.
---
[profile_sync_ready_body]
Sync is ready for this profile.
Syncing automatically.
---
[profile_account_sync_title]
Account & sync
---
[profile_account_connected_body]
Manage your connected account and automatic sync
---
[profile_account_sync_body]
Create account or import key
Create a new account or import an existing .key file
---
[profile_data_management_title]
Data
@@ -860,7 +863,7 @@ Break Settings...
Account
---
[sync_create_account_button]
Create Account
Create New Account
---
[sync_account_created]
Account created
@@ -868,8 +871,11 @@ Account created
[sync_account_create_failed]
Could not create account
---
[sync_connect_account_button]
Connect Account
---
[sync_import_key_button]
Import .key File
Import .key
---
[sync_import_key_dialog_title]
Import Account Key
@@ -928,12 +934,6 @@ Alias unavailable or remote failed
[sync_backup_key_button]
Backup Key
---
[sync_remote_label]
Remote
---
[sync_connect_button]
Connect
---
[sync_server_url_invalid]
Use https:// or loopback like localhost:8080
---
@@ -956,7 +956,7 @@ Keeping local data
Sync review failed
---
[sync_no_account]
Create an account before connecting
No account connected yet
---
[sync_backup_warning]
Save this private key somewhere you control. Anyone with it can claim this account.
@@ -995,13 +995,16 @@ Log out
Logged out. Local data stays on this device.
---
[sync_account_switch_title]
Clear local data?
Choose how to connect
---
[sync_account_switch_message]
This device has data from another sync account. Clear local data before using this account.
Local data was found on this device. Replace deletes it and restores this account. Merge keeps it and combines both sets of data.
---
[sync_account_switch_merge_button]
Merge and Connect
---
[sync_account_switch_clear_button]
Clear and Use Account
Replace and Connect
---
[sync_account_switch_cancelled]
Account switch cancelled
@@ -1891,9 +1894,6 @@ Syncing…
[sync_retry_waiting]
Connection failed. Retrying automatically.
---
[sync_retry_button]
Retry
---
[app_icon_label]
App icon
@@ -1919,3 +1919,47 @@ Hide completed
[guide_title]
Quick guide
---
---
[sync_connected_as]
Connected as %s
---
[sync_everything_up_to_date]
Everything is up to date
---
[sync_step_account_connected]
Account connected
---
[sync_step_data_restored]
Data restored
---
[sync_step_automatic_on]
Automatic sync on
---
[sync_history_days_label]
History days
---
[sync_now_button]
Sync now
---
[sync_progress_uploading]
Uploading %lld local items…
---
[sync_progress_securing]
Securing %lld of %lld items…
---
[sync_progress_restoring]
Restoring account data…
---
[sync_progress_friends]
Restoring friends…
---
[sync_remote_label]
Sync server
---
---
[sync_lists_label]
Lists
---
[sync_list_items_label]
Items
---
+61 -17
View File
@@ -317,7 +317,19 @@ Omitir
Aceptar
---
[retry_button]
Reintentar
Sincronizar ahora
---
[sync_progress_uploading]
Enviando %lld elementos locales…
---
[sync_progress_securing]
Protegiendo %lld de %lld elementos…
---
[sync_progress_restoring]
Restaurando los datos de la cuenta…
---
[sync_progress_friends]
Restaurando amigos…
---
[audio_import_music_button]
Importar música
@@ -620,7 +632,7 @@ Salir
Cuenta
---
[sync_create_account_button]
Crear cuenta
Crear nueva cuenta
---
[sync_account_created]
Cuenta creada
@@ -628,6 +640,9 @@ Cuenta creada
[sync_account_create_failed]
No se pudo crear la cuenta
---
[sync_connect_account_button]
Conectar cuenta
---
[sync_import_key_button]
Importar archivo .key
---
@@ -652,12 +667,6 @@ ID público copiado
[sync_backup_key_button]
Respaldar clave
---
[sync_remote_label]
Remoto
---
[sync_connect_button]
Conectar
---
[sync_server_url_invalid]
Usa https:// o loopback como localhost:8080
---
@@ -680,7 +689,7 @@ Keeping local data
Sync review failed
---
[sync_no_account]
Crea una cuenta antes de conectar
Aún no hay ninguna cuenta conectada
---
[sync_backup_warning]
Guarda esta clave privada en un lugar que controles. Cualquiera con ella puede reclamar esta cuenta.
@@ -719,13 +728,16 @@ Cerrar sesión
Sesión cerrada. Los datos locales permanecen en este dispositivo.
---
[sync_account_switch_title]
¿Borrar datos locales?
Elige cómo conectar
---
[sync_account_switch_message]
Este dispositivo tiene datos de otra cuenta de sincronización. Borra los datos locales antes de usar esta cuenta.
Se encontraron datos locales en este dispositivo. Reemplazar los elimina y restaura esta cuenta. Combinar los conserva y une ambos conjuntos de datos.
---
[sync_account_switch_merge_button]
Combinar y conectar
---
[sync_account_switch_clear_button]
Borrar y usar cuenta
Reemplazar y conectar
---
[sync_account_switch_cancelled]
Cambio de cuenta cancelado
@@ -1858,13 +1870,16 @@ Sesiones
Crea una cuenta para sincronizar y proteger tu progreso.
---
[profile_sync_ready_body]
La sincronización está lista para este perfil.
Sincronizando automáticamente.
---
[profile_account_sync_title]
Cuenta y sincronización
---
[profile_account_connected_body]
Gestiona tu cuenta conectada y la sincronización automática
---
[profile_account_sync_body]
Crear cuenta o importar clave
Crea una cuenta nueva o importa un archivo .key existente
---
[profile_data_management_title]
Datos
@@ -1892,9 +1907,6 @@ Sincronizando…
[sync_retry_waiting]
Error de conexión. Se reintentará automáticamente.
---
[sync_retry_button]
Reintentar
---
[app_icon_label]
Icono de la aplicación
@@ -1920,3 +1932,35 @@ Ocultar completados
[guide_title]
Guía rápida
---
---
[sync_connected_as]
Conectado como %s
---
[sync_everything_up_to_date]
Todo está actualizado
---
[sync_step_account_connected]
Cuenta conectada
---
[sync_step_data_restored]
Datos restaurados
---
[sync_step_automatic_on]
Sincronización automática activada
---
[sync_history_days_label]
Días del historial
---
[sync_now_button]
Sincronizar ahora
---
[sync_remote_label]
Servidor de sincronización
---
---
[sync_lists_label]
Listas
---
[sync_list_items_label]
Elementos
---
+61 -17
View File
@@ -317,7 +317,7 @@ Ignorer
OK
---
[retry_button]
Réessayer
Synchroniser
---
[audio_import_music_button]
Importer de la musique
@@ -620,7 +620,7 @@ Quitter
Compte
---
[sync_create_account_button]
Créer un compte
Créer un nouveau compte
---
[sync_account_created]
Compte créé
@@ -628,6 +628,9 @@ Compte créé
[sync_account_create_failed]
Impossible de créer le compte
---
[sync_connect_account_button]
Connecter un compte
---
[sync_import_key_button]
Importer un fichier .key
---
@@ -688,12 +691,6 @@ Alias indisponible ou échec distant
[sync_backup_key_button]
Sauvegarder la clé
---
[sync_remote_label]
Distant
---
[sync_connect_button]
Connecter
---
[sync_server_url_invalid]
Utilisez https:// ou une boucle locale comme localhost:8080
---
@@ -716,7 +713,7 @@ Keeping local data
Sync review failed
---
[sync_no_account]
Créez un compte avant de vous connecter
Aucun compte connecté pour l'instant
---
[sync_backup_warning]
Enregistrez cette clé privée dans un endroit que vous contrôlez. Toute personne qui la possède peut revendiquer ce compte.
@@ -755,13 +752,16 @@ Se déconnecter
Déconnecté. Les données locales restent sur cet appareil.
---
[sync_account_switch_title]
Effacer les données locales ?
Choisir le mode de connexion
---
[sync_account_switch_message]
Cet appareil contient des données d’un autre compte de synchronisation. Effacez les données locales avant d’utiliser ce compte.
Des données locales ont été trouvées sur cet appareil. Remplacer les supprime et restaure ce compte. Fusionner les conserve et combine les deux ensembles de données.
---
[sync_account_switch_merge_button]
Fusionner et connecter
---
[sync_account_switch_clear_button]
Effacer et utiliser le compte
Remplacer et connecter
---
[sync_account_switch_cancelled]
Changement de compte annulé
@@ -1858,13 +1858,16 @@ Séances
Créez un compte pour synchroniser et protéger votre progression.
---
[profile_sync_ready_body]
La synchronisation est prête pour ce profil.
Synchronisation automatique.
---
[profile_account_sync_title]
Compte et synchronisation
---
[profile_account_connected_body]
Gérez votre compte connecté et la synchronisation automatique
---
[profile_account_sync_body]
Créer un compte ou importer une clé
Créez un compte ou importez un fichier .key existant
---
[profile_data_management_title]
Données
@@ -1892,9 +1895,6 @@ Synchronisation…
[sync_retry_waiting]
Échec de connexion. Nouvelle tentative automatique.
---
[sync_retry_button]
Réessayer
---
[app_icon_label]
Icône de l’application
@@ -1920,3 +1920,47 @@ Masquer les éléments terminés
[guide_title]
Guide rapide
---
---
[sync_connected_as]
Connecté en tant que %s
---
[sync_everything_up_to_date]
Tout est à jour
---
[sync_step_account_connected]
Compte connecté
---
[sync_step_data_restored]
Données restaurées
---
[sync_step_automatic_on]
Synchronisation automatique activée
---
[sync_history_days_label]
Jours d’historique
---
[sync_now_button]
Synchroniser maintenant
---
[sync_progress_uploading]
Envoi de %lld éléments locaux…
---
[sync_progress_securing]
Sécurisation de %lld éléments sur %lld…
---
[sync_progress_restoring]
Restauration des données du compte…
---
[sync_progress_friends]
Restauration des amis…
---
[sync_remote_label]
Serveur de synchronisation
---
---
[sync_lists_label]
Listes
---
[sync_list_items_label]
Éléments
---
+61 -17
View File
@@ -317,7 +317,19 @@ Lewati
OK
---
[retry_button]
Coba lagi
Sinkronkan sekarang
---
[sync_progress_uploading]
Mengirim %lld item lokal…
---
[sync_progress_securing]
Mengamankan %lld dari %lld item…
---
[sync_progress_restoring]
Memulihkan data akun…
---
[sync_progress_friends]
Memulihkan teman…
---
[audio_import_music_button]
Impor musik
@@ -620,7 +632,7 @@ Keluar
Akun
---
[sync_create_account_button]
Buat akun
Buat akun baru
---
[sync_account_created]
Akun dibuat
@@ -628,6 +640,9 @@ Akun dibuat
[sync_account_create_failed]
Tidak dapat membuat akun
---
[sync_connect_account_button]
Hubungkan akun
---
[sync_import_key_button]
Impor file .key
---
@@ -652,12 +667,6 @@ ID publik disalin
[sync_backup_key_button]
Cadangkan kunci
---
[sync_remote_label]
Jarak jauh
---
[sync_connect_button]
Hubungkan
---
[sync_server_url_invalid]
Gunakan https:// atau loopback seperti localhost:8080
---
@@ -680,7 +689,7 @@ Keeping local data
Sync review failed
---
[sync_no_account]
Buat akun sebelum menghubungkan
Belum ada akun yang terhubung
---
[sync_backup_warning]
Simpan kunci pribadi ini di tempat yang Anda kendalikan. Siapa pun yang memilikinya dapat mengambil akun ini.
@@ -719,13 +728,16 @@ Keluar
Sudah keluar. Data lokal tetap ada di perangkat ini.
---
[sync_account_switch_title]
Hapus data lokal?
Pilih cara menghubungkan
---
[sync_account_switch_message]
Perangkat ini memiliki data dari akun sinkronisasi lain. Hapus data lokal sebelum memakai akun ini.
Data lokal ditemukan di perangkat ini. Ganti akan menghapusnya dan memulihkan akun ini. Gabungkan akan menyimpannya dan menggabungkan kedua kumpulan data.
---
[sync_account_switch_merge_button]
Gabungkan dan hubungkan
---
[sync_account_switch_clear_button]
Hapus dan pakai akun
Ganti dan hubungkan
---
[sync_account_switch_cancelled]
Pergantian akun dibatalkan
@@ -1858,13 +1870,16 @@ Sesi
Buat akun untuk menyinkronkan dan melindungi kemajuan Anda.
---
[profile_sync_ready_body]
Sinkronisasi siap untuk profil ini.
Menyinkronkan otomatis.
---
[profile_account_sync_title]
Akun dan sinkronisasi
---
[profile_account_connected_body]
Kelola akun terhubung dan sinkronisasi otomatis
---
[profile_account_sync_body]
Buat akun atau impor kunci
Buat akun baru atau impor file .key yang sudah ada
---
[profile_data_management_title]
Data
@@ -1892,9 +1907,6 @@ Menyinkronkan…
[sync_retry_waiting]
Koneksi gagal. Mencoba lagi secara otomatis.
---
[sync_retry_button]
Coba lagi
---
[app_icon_label]
Ikon aplikasi
@@ -1920,3 +1932,35 @@ Sembunyikan yang selesai
[guide_title]
Panduan singkat
---
---
[sync_connected_as]
Terhubung sebagai %s
---
[sync_everything_up_to_date]
Semuanya sudah terbaru
---
[sync_step_account_connected]
Akun terhubung
---
[sync_step_data_restored]
Data dipulihkan
---
[sync_step_automatic_on]
Sinkronisasi otomatis aktif
---
[sync_history_days_label]
Hari riwayat
---
[sync_now_button]
Sinkronkan sekarang
---
[sync_remote_label]
Server sinkronisasi
---
---
[sync_lists_label]
Daftar
---
[sync_list_items_label]
Item
---
+61 -17
View File
@@ -1,5 +1,5 @@
[results_write_failed]
Impossibile salvare le modifiche. Riprova.
Impossibile salvare le modifiche. Sincronizza.
---
[app_title]
Inner Breeze
@@ -620,7 +620,7 @@ Esci
Profilo
---
[sync_create_account_button]
Crea account
Crea nuovo account
---
[sync_account_created]
Account creato
@@ -628,6 +628,9 @@ Account creato
[sync_account_create_failed]
Impossibile creare l’account
---
[sync_connect_account_button]
Connetti account
---
[sync_import_key_button]
Importa file .key
---
@@ -652,12 +655,6 @@ ID pubblico copiato
[sync_backup_key_button]
Backup chiave
---
[sync_remote_label]
Remoto
---
[sync_connect_button]
Connetti
---
[sync_server_url_invalid]
Usa https:// o loopback come localhost:8080
---
@@ -680,7 +677,7 @@ Keeping local data
Sync review failed
---
[sync_no_account]
Crea un account prima di connetterti
Nessun account ancora connesso
---
[sync_backup_warning]
Salva questa chiave privata in un luogo che controlli. Chiunque la possieda può rivendicare questo account.
@@ -719,13 +716,16 @@ Esci
Disconnesso. I dati locali restano su questo dispositivo.
---
[sync_account_switch_title]
Cancellare i dati locali?
Scegli come connetterti
---
[sync_account_switch_message]
Questo dispositivo contiene dati di un altro account di sincronizzazione. Cancella i dati locali prima di usare questo account.
Sono stati trovati dati locali su questo dispositivo. Sostituisci li elimina e ripristina questo account. Unisci li conserva e combina entrambi i gruppi di dati.
---
[sync_account_switch_merge_button]
Unisci e connetti
---
[sync_account_switch_clear_button]
Cancella e usa account
Sostituisci e connetti
---
[sync_account_switch_cancelled]
Cambio account annullato
@@ -1858,13 +1858,16 @@ Sessioni
Crea un account per sincronizzare e proteggere i tuoi progressi.
---
[profile_sync_ready_body]
La sincronizzazione è pronta per questo profilo.
Sincronizzazione automatica.
---
[profile_account_sync_title]
Account e sincronizzazione
---
[profile_account_connected_body]
Gestisci l’account connesso e la sincronizzazione automatica
---
[profile_account_sync_body]
Crea account o importa chiave
Crea un nuovo account o importa un file .key esistente
---
[profile_data_management_title]
Dati
@@ -1892,9 +1895,6 @@ Sincronizzazione…
[sync_retry_waiting]
Connessione non riuscita. Nuovo tentativo automatico.
---
[sync_retry_button]
Riprova
---
[app_icon_label]
Icona dell’app
@@ -1920,3 +1920,47 @@ Nascondi completati
[guide_title]
Guida rapida
---
---
[sync_connected_as]
Connesso come %s
---
[sync_everything_up_to_date]
Tutto è aggiornato
---
[sync_step_account_connected]
Account connesso
---
[sync_step_data_restored]
Dati ripristinati
---
[sync_step_automatic_on]
Sincronizzazione automatica attiva
---
[sync_history_days_label]
Giorni nella cronologia
---
[sync_now_button]
Sincronizza ora
---
[sync_progress_uploading]
Invio di %lld elementi locali…
---
[sync_progress_securing]
Protezione di %lld elementi su %lld…
---
[sync_progress_restoring]
Ripristino dei dati dell'account…
---
[sync_progress_friends]
Ripristino degli amici…
---
[sync_remote_label]
Server di sincronizzazione
---
---
[sync_lists_label]
Liste
---
[sync_list_items_label]
Elementi
---
+60 -16
View File
@@ -317,7 +317,7 @@ Finish
OK
---
[retry_button]
再試行
同期する
---
[audio_import_music_button]
音楽をインポート
@@ -622,7 +622,7 @@ Inner Breezeを実行したままにしますか?
アカウント
---
[sync_create_account_button]
アカウントを作成
新しいアカウントを作成
---
[sync_account_created]
アカウントを作成しました
@@ -630,6 +630,9 @@ Inner Breezeを実行したままにしますか?
[sync_account_create_failed]
アカウントを作成できませんでした
---
[sync_connect_account_button]
アカウントに接続
---
[sync_import_key_button]
.keyファイルをインポート
---
@@ -654,12 +657,6 @@ IDをコピー
[sync_backup_key_button]
キーをバックアップ
---
[sync_remote_label]
リモート
---
[sync_connect_button]
接続
---
[sync_server_url_invalid]
https:// または localhost:8080 のようなループバックを使用してください
---
@@ -682,7 +679,7 @@ Keeping local data
Sync review failed
---
[sync_no_account]
接続する前にアカウントを作成してください
まだアカウントが接続されていません
---
[sync_backup_warning]
この秘密キーは自分で管理できる場所に保存してください。これを持つ人は誰でもこのアカウントを取得できます。
@@ -721,13 +718,16 @@ Sync review failed
ログアウトしました。ローカルデータはこの端末に残ります。
---
[sync_account_switch_title]
ローカルデータをクリアしますか?
接続方法を選択
---
[sync_account_switch_message]
この端末には別の同期アカウントのデータがあります。このアカウントを使う前にローカルデータをクリアしてください。
この端末にローカルデータがあります。置き換えると削除してこのアカウントを復元します。統合すると保持したまま両方のデータをまとめます。
---
[sync_account_switch_merge_button]
統合して接続
---
[sync_account_switch_clear_button]
クリアしてアカウントを使用
置き換えて接続
---
[sync_account_switch_cancelled]
アカウントの切り替えをキャンセルしました
@@ -1865,8 +1865,11 @@ Dismiss forever
[profile_account_sync_title]
アカウントと同期
---
[profile_account_connected_body]
接続済みアカウントと自動同期を管理
---
[profile_account_sync_body]
アカウントを作成または鍵をインポート
新しいアカウントを作成するか、既存の.keyファイルをインポートしてください
---
[profile_data_management_title]
データ
@@ -1894,9 +1897,6 @@ Dismiss forever
[sync_retry_waiting]
接続に失敗しました。自動的に再試行します。
---
[sync_retry_button]
再試行
---
[app_icon_label]
アプリアイコン
@@ -1922,3 +1922,47 @@ Dismiss forever
[guide_title]
クイックガイド
---
---
[sync_connected_as]
%s として接続中
---
[sync_everything_up_to_date]
すべて最新です
---
[sync_step_account_connected]
アカウント接続済み
---
[sync_step_data_restored]
データ復元済み
---
[sync_step_automatic_on]
自動同期オン
---
[sync_history_days_label]
履歴の日数
---
[sync_now_button]
今すぐ同期
---
[sync_progress_uploading]
ローカル項目を %lld 件送信中…
---
[sync_progress_securing]
%lld / %lld 件を保護中…
---
[sync_progress_restoring]
アカウントデータを復元中…
---
[sync_progress_friends]
友達を復元中…
---
[sync_remote_label]
同期サーバー
---
---
[sync_lists_label]
リスト
---
[sync_list_items_label]
項目
---
+60 -16
View File
@@ -620,7 +620,7 @@ Inner Breeze를 계속 실행할까요?
계정
---
[sync_create_account_button]
계정 만들기
새 계정 만들기
---
[sync_account_created]
계정 생성됨
@@ -628,6 +628,9 @@ Inner Breeze를 계속 실행할까요?
[sync_account_create_failed]
계정을 만들 수 없음
---
[sync_connect_account_button]
계정 연결
---
[sync_import_key_button]
.key 파일 가져오기
---
@@ -652,12 +655,6 @@ ID 복사
[sync_backup_key_button]
키 백업
---
[sync_remote_label]
원격
---
[sync_connect_button]
연결
---
[sync_server_url_invalid]
https:// 또는 localhost:8080 같은 루프백을 사용하세요
---
@@ -680,7 +677,7 @@ Keeping local data
Sync review failed
---
[sync_no_account]
연결하기 전에 계정을 만드세요
아직 연결된 계정이 없습니다
---
[sync_backup_warning]
이 개인 키를 직접 관리하는 곳에 저장하세요. 이 키를 가진 사람은 누구나 이 계정을 가져갈 수 있습니다.
@@ -719,13 +716,16 @@ Sync review failed
로그아웃되었습니다. 로컬 데이터는 이 기기에 남아 있습니다.
---
[sync_account_switch_title]
로컬 데이터를 지울까요?
연결 방법 선택
---
[sync_account_switch_message]
이 기기에 다른 동기화 계정의 데이터가 있습니다. 이 계정을 사용하기 전에 로컬 데이터를 지우세요.
이 기기에서 로컬 데이터를 찾았습니다. 바꾸기는 로컬 데이터를 삭제하고 이 계정을 복원합니다. 병합은 로컬 데이터를 유지하고 두 데이터 세트를 합칩니다.
---
[sync_account_switch_merge_button]
병합하고 연결
---
[sync_account_switch_clear_button]
지우고 계정 사용
바꾸고 연결
---
[sync_account_switch_cancelled]
계정 전환이 취소되었습니다
@@ -1858,13 +1858,16 @@ Dismiss forever
계정을 만들어 진행 상황을 동기화하고 보호하세요.
---
[profile_sync_ready_body]
이 프로필의 동기화가 준비되었습니다.
자동으로 동기화 중입니다.
---
[profile_account_sync_title]
계정 및 동기화
---
[profile_account_connected_body]
연결된 계정과 자동 동기화 관리
---
[profile_account_sync_body]
계정 만들기 또는 키 가져오기
새 계정을 만들거나 기존 .key 파일을 가져오세요
---
[profile_data_management_title]
데이터
@@ -1892,9 +1895,6 @@ Dismiss forever
[sync_retry_waiting]
연결에 실패했습니다. 자동으로 다시 시도합니다.
---
[sync_retry_button]
다시 시도
---
[app_icon_label]
앱 아이콘
@@ -1920,3 +1920,47 @@ Dismiss forever
[guide_title]
빠른 안내
---
---
[sync_connected_as]
%s(으)로 연결됨
---
[sync_everything_up_to_date]
모든 항목이 최신 상태입니다
---
[sync_step_account_connected]
계정 연결됨
---
[sync_step_data_restored]
데이터 복원됨
---
[sync_step_automatic_on]
자동 동기화 켜짐
---
[sync_history_days_label]
기록 일수
---
[sync_now_button]
지금 동기화
---
[sync_progress_uploading]
로컬 항목 %lld개 전송 중…
---
[sync_progress_securing]
항목 %lld/%lld개 보호 중…
---
[sync_progress_restoring]
계정 데이터 복원 중…
---
[sync_progress_friends]
친구 복원 중…
---
[sync_remote_label]
동기화 서버
---
---
[sync_lists_label]
목록
---
[sync_list_items_label]
항목
---
+61 -17
View File
@@ -317,7 +317,19 @@ Pular
OK
---
[retry_button]
Tentar novamente
Sincronizar agora
---
[sync_progress_uploading]
Enviando %lld itens locais…
---
[sync_progress_securing]
Protegendo %lld de %lld itens…
---
[sync_progress_restoring]
Restaurando os dados da conta…
---
[sync_progress_friends]
Restaurando amigos…
---
[audio_import_music_button]
Importar música
@@ -620,7 +632,7 @@ Sair
Conta
---
[sync_create_account_button]
Criar conta
Criar nova conta
---
[sync_account_created]
Conta criada
@@ -628,6 +640,9 @@ Conta criada
[sync_account_create_failed]
Não foi possível criar a conta
---
[sync_connect_account_button]
Conectar conta
---
[sync_import_key_button]
Importar arquivo .key
---
@@ -652,12 +667,6 @@ ID público copiado
[sync_backup_key_button]
Fazer backup da chave
---
[sync_remote_label]
Remoto
---
[sync_connect_button]
Conectar
---
[sync_server_url_invalid]
Use https:// ou loopback como localhost:8080
---
@@ -680,7 +689,7 @@ Keeping local data
Sync review failed
---
[sync_no_account]
Crie uma conta antes de conectar
Nenhuma conta conectada ainda
---
[sync_backup_warning]
Salve esta chave privada em um local que você controla. Qualquer pessoa com ela pode reivindicar esta conta.
@@ -719,13 +728,16 @@ Sair
Sessão encerrada. Os dados locais permanecem neste dispositivo.
---
[sync_account_switch_title]
Limpar dados locais?
Escolha como conectar
---
[sync_account_switch_message]
Este dispositivo tem dados de outra conta de sincronização. Limpe os dados locais antes de usar esta conta.
Foram encontrados dados locais neste dispositivo. Substituir os exclui e restaura esta conta. Mesclar os mantém e combina os dois conjuntos de dados.
---
[sync_account_switch_merge_button]
Mesclar e conectar
---
[sync_account_switch_clear_button]
Limpar e usar conta
Substituir e conectar
---
[sync_account_switch_cancelled]
Troca de conta cancelada
@@ -1858,13 +1870,16 @@ Sessões
Crie uma conta para sincronizar e proteger seu progresso.
---
[profile_sync_ready_body]
A sincronização está pronta para este perfil.
Sincronizando automaticamente.
---
[profile_account_sync_title]
Conta e sincronização
---
[profile_account_connected_body]
Gerencie sua conta conectada e a sincronização automática
---
[profile_account_sync_body]
Criar conta ou importar chave
Crie uma nova conta ou importe um arquivo .key existente
---
[profile_data_management_title]
Dados
@@ -1892,9 +1907,6 @@ Sincronizando…
[sync_retry_waiting]
Falha na conexão. Tentando novamente automaticamente.
---
[sync_retry_button]
Tentar novamente
---
[app_icon_label]
Ícone do aplicativo
@@ -1920,3 +1932,35 @@ Ocultar concluídos
[guide_title]
Guia rápido
---
---
[sync_connected_as]
Conectado como %s
---
[sync_everything_up_to_date]
Tudo está atualizado
---
[sync_step_account_connected]
Conta conectada
---
[sync_step_data_restored]
Dados restaurados
---
[sync_step_automatic_on]
Sincronização automática ativada
---
[sync_history_days_label]
Dias no histórico
---
[sync_now_button]
Sincronizar agora
---
[sync_remote_label]
Servidor de sincronização
---
---
[sync_lists_label]
Listas
---
[sync_list_items_label]
Itens
---
+61 -17
View File
@@ -320,7 +320,7 @@ Finish
OK
---
[retry_button]
Повторить
Синхронизировать
---
[audio_import_music_button]
Импортировать музыку
@@ -620,7 +620,7 @@ Trocador
Аккаунт
---
[sync_create_account_button]
Создать аккаунт
Создать новый аккаунт
---
[sync_account_created]
Аккаунт создан
@@ -628,8 +628,11 @@ Trocador
[sync_account_create_failed]
Не удалось создать аккаунт
---
[sync_connect_account_button]
Подключить аккаунт
---
[sync_import_key_button]
Импорт .key файла
Импортировать файл .key
---
[sync_import_key_dialog_title]
Импорт ключа аккаунта
@@ -652,12 +655,6 @@ Trocador
[sync_backup_key_button]
Резервная копия ключа
---
[sync_remote_label]
Сервер
---
[sync_connect_button]
Подключить
---
[sync_server_url_invalid]
Используйте https:// или loopback, например localhost:8080
---
@@ -680,7 +677,7 @@ Keeping local data
Sync review failed
---
[sync_no_account]
Создайте аккаунт перед подключением
Аккаунт ещё не подключён
---
[sync_backup_warning]
Сохраните этот приватный ключ там, где только вы им управляете. Любой, у кого он есть, сможет получить доступ к аккаунту.
@@ -719,13 +716,16 @@ Sync review failed
Выполнен выход. Локальные данные остаются на этом устройстве.
---
[sync_account_switch_title]
Очистить локальные данные?
Выберите способ подключения
---
[sync_account_switch_message]
На этом устройстве есть данные другого аккаунта синхронизации. Очистите локальные данные перед использованием этого аккаунта.
На этом устройстве найдены локальные данные. Замена удалит их и восстановит этот аккаунт. Объединение сохранит их и совместит оба набора данных.
---
[sync_account_switch_merge_button]
Объединить и подключить
---
[sync_account_switch_clear_button]
Очистить и использовать аккаунт
Заменить и подключить
---
[sync_account_switch_cancelled]
Смена аккаунта отменена
@@ -1863,8 +1863,11 @@ Dismiss forever
[profile_account_sync_title]
Учётная запись и синхронизация
---
[profile_account_connected_body]
Управляйте подключённым аккаунтом и автоматической синхронизацией
---
[profile_account_sync_body]
Создать учётную запись или импортировать ключ
Создайте новый аккаунт или импортируйте существующий файл .key
---
[profile_data_management_title]
Данные
@@ -1892,9 +1895,6 @@ Dismiss forever
[sync_retry_waiting]
Ошибка подключения. Повторная попытка выполняется автоматически.
---
[sync_retry_button]
Повторить
---
[app_icon_label]
Значок приложения
@@ -1920,3 +1920,47 @@ Dismiss forever
[guide_title]
Краткое руководство
---
---
[sync_connected_as]
Подключено как %s
---
[sync_everything_up_to_date]
Все данные актуальны
---
[sync_step_account_connected]
Аккаунт подключён
---
[sync_step_data_restored]
Данные восстановлены
---
[sync_step_automatic_on]
Автосинхронизация включена
---
[sync_history_days_label]
Дней в истории
---
[sync_now_button]
Синхронизировать сейчас
---
[sync_progress_uploading]
Отправка локальных элементов: %lld…
---
[sync_progress_securing]
Защита элементов: %lld из %lld…
---
[sync_progress_restoring]
Восстановление данных аккаунта…
---
[sync_progress_friends]
Восстановление друзей…
---
[sync_remote_label]
Сервер синхронизации
---
---
[sync_lists_label]
Списки
---
[sync_list_items_label]
Элементы
---
+60 -16
View File
@@ -1,5 +1,5 @@
[results_write_failed]
无法保存更改,请重试。
无法保存更改,请立即同步。
---
[app_title]
内息清风
@@ -620,7 +620,7 @@ Trocador
账户
---
[sync_create_account_button]
创建账户
创建新账户
---
[sync_account_created]
账户已创建
@@ -628,6 +628,9 @@ Trocador
[sync_account_create_failed]
无法创建账户
---
[sync_connect_account_button]
连接账户
---
[sync_import_key_button]
导入 .key 文件
---
@@ -652,12 +655,6 @@ Trocador
[sync_backup_key_button]
备份密钥
---
[sync_remote_label]
远程
---
[sync_connect_button]
连接
---
[sync_server_url_invalid]
请使用 https:// 或 localhost:8080 这样的回环地址
---
@@ -680,7 +677,7 @@ Keeping local data
Sync review failed
---
[sync_no_account]
连接前请先创建账户
尚未连接任何账户
---
[sync_backup_warning]
请将此私钥保存到你可控制的位置。任何拥有它的人都可以认领此账户。
@@ -719,13 +716,16 @@ Sync review failed
已退出登录。本地数据仍保留在此设备上。
---
[sync_account_switch_title]
清除本地数据?
选择连接方式
---
[sync_account_switch_message]
此设备包含另一个同步账户的数据。使用此账户前请先清除本地数据。
此设备上有本地数据。替换会删除本地数据并恢复此账户;合并会保留本地数据并合并两组数据。
---
[sync_account_switch_merge_button]
合并并连接
---
[sync_account_switch_clear_button]
清除并使用账户
替换并连接
---
[sync_account_switch_cancelled]
已取消切换账户
@@ -1863,8 +1863,11 @@ Dismiss forever
[profile_account_sync_title]
账户与同步
---
[profile_account_connected_body]
管理已连接的账户和自动同步
---
[profile_account_sync_body]
创建账户或导入密钥
创建新账户或导入现有的 .key 文件
---
[profile_data_management_title]
数据
@@ -1892,9 +1895,6 @@ Dismiss forever
[sync_retry_waiting]
连接失败,将自动重试。
---
[sync_retry_button]
重试
---
[app_icon_label]
应用图标
@@ -1920,3 +1920,47 @@ Dismiss forever
[guide_title]
快速指南
---
---
[sync_connected_as]
已连接为 %s
---
[sync_everything_up_to_date]
所有内容均为最新
---
[sync_step_account_connected]
账户已连接
---
[sync_step_data_restored]
数据已恢复
---
[sync_step_automatic_on]
自动同步已开启
---
[sync_history_days_label]
历史天数
---
[sync_now_button]
立即同步
---
[sync_progress_uploading]
正在发送 %lld 个本地项目…
---
[sync_progress_securing]
正在保护 %lld/%lld 个项目…
---
[sync_progress_restoring]
正在恢复账户数据…
---
[sync_progress_friends]
正在恢复好友…
---
[sync_remote_label]
同步服务器
---
---
[sync_lists_label]
清单
---
[sync_list_items_label]
项目
---
+1 -2
View File
@@ -13,10 +13,9 @@ ROOT=/sys/src/inbe
list=$ROOT/build/plan9/generated-c-files.txt
gensrc=`{cat $list | grep -v -e 'storage/import.c' -e 'meditation/meditation_music.c' -e '/src/main.c' -e '/platform/app_host.c'}
appsrc=src/platform/plan9/main.c \
appsrc=src/platform/plan9/entry.c \
src/platform/plan9/sqlite3_stub.c \
src/platform/plan9/storage_import_stub.c \
src/platform/plan9/meditation_music_stub.c \
src/app/app_web_bridge.c \
src/storage/storage_json_builder.c
hostsrc=build/plan9/app_embedded_assets.c
+2 -3
View File
@@ -12,11 +12,10 @@
"storage"
],
"host_permissions": [
"https://api.waozi.xyz/*",
"https://inbe.waozi.xyz/*"
"https://api.waozi.xyz/*"
],
"content_security_policy": {
"extension_pages": "script-src 'self' 'wasm-unsafe-eval'; connect-src 'self' https://api.waozi.xyz wss://api.waozi.xyz https://inbe.waozi.xyz; object-src 'self'"
"extension_pages": "script-src 'self' 'wasm-unsafe-eval'; connect-src 'self' https: wss: http: ws:; object-src 'self'"
},
"icons": {
"16": "icons/icon-16.png",
+55 -2
View File
@@ -8,6 +8,7 @@ const TICK_ALARM = "inbe-break-tick";
const STORAGE_CONFIG = "inbeBreakConfig";
const STORAGE_STATE = "inbeBreakState";
const MAX_ELAPSED_S = 300;
const visiblePages = new Set();
const practiceUrls = {
whm: `${appUrl}?inbe_launch=start-practice&practice=whm`,
@@ -134,6 +135,7 @@ function notificationIdFor(type) {
}
async function showBreakNotification(type, state, config, forced) {
if (!forced && visiblePages.size === 0) return;
const timer = config.timers[type];
const timerState = state.timers[type];
const buttons = [];
@@ -152,6 +154,7 @@ async function showBreakNotification(type, state, config, forced) {
timerState.notificationId = id;
timerState.buttonActions = buttonActions;
await storageSet({ [STORAGE_STATE]: state });
if (!forced && visiblePages.size === 0) return;
await chrome.notifications.create(id, {
type: "basic",
iconUrl: "icons/icon-128.png",
@@ -161,17 +164,39 @@ async function showBreakNotification(type, state, config, forced) {
requireInteraction: true,
buttons,
});
if (!forced && visiblePages.size === 0)
await chrome.notifications.clear(id);
}
async function scheduleBreakAlarm(config) {
if (!config.enabled) {
if (!config.enabled || visiblePages.size === 0) {
await chrome.alarms.clear(TICK_ALARM);
await chrome.action.setBadgeText({ text: "" });
for (const type of BREAK_TYPES)
await chrome.notifications.clear(notificationIdFor(type));
return;
}
await chrome.alarms.create(TICK_ALARM, { periodInMinutes: 1 });
if (visiblePages.size === 0) {
await chrome.alarms.clear(TICK_ALARM);
return;
}
await chrome.action.setBadgeText({ text: "BR" });
await chrome.action.setBadgeBackgroundColor({ color: "#2c7388" });
if (visiblePages.size === 0)
await chrome.action.setBadgeText({ text: "" });
}
async function stopAutomaticBreaks() {
if (visiblePages.size !== 0) return;
await storageSet({
[STORAGE_STATE]: {
lastTickMs: 0,
timers: BREAK_TYPES.map(() => defaultTimerState()),
},
});
const data = await storageGet([STORAGE_CONFIG]);
await scheduleBreakAlarm(normalizeConfig(data[STORAGE_CONFIG]));
}
async function saveConfig(config) {
@@ -219,6 +244,10 @@ async function tickBreaks(nowMs = Date.now()) {
const config = normalizeConfig(data[STORAGE_CONFIG]);
const state = normalizeState(data[STORAGE_STATE]);
if (visiblePages.size === 0) {
await stopAutomaticBreaks();
return state;
}
if (!config.enabled) {
await scheduleBreakAlarm(config);
return state;
@@ -228,6 +257,10 @@ async function tickBreaks(nowMs = Date.now()) {
? clampInt((nowMs - state.lastTickMs) / 1000, 60, 1, MAX_ELAPSED_S)
: 60;
const idleState = await chrome.idle.queryState(Math.max(60, Math.ceil(elapsedS)));
if (visiblePages.size === 0) {
await stopAutomaticBreaks();
return state;
}
const active = idleState === "active";
state.lastTickMs = nowMs;
@@ -235,7 +268,13 @@ async function tickBreaks(nowMs = Date.now()) {
if (stepTimer(config.timers[type], state.timers[type], elapsedS, active, nowMs))
await showBreakNotification(type, state, config, false);
}
if (visiblePages.size === 0) {
await stopAutomaticBreaks();
return state;
}
await storageSet({ [STORAGE_STATE]: state });
if (visiblePages.size === 0)
await stopAutomaticBreaks();
return state;
}
@@ -247,9 +286,9 @@ async function requestBreakNow(type) {
if (!config.enabled)
config.enabled = true;
await showBreakNotification(safeType, state, config, true);
await storageSet({ [STORAGE_CONFIG]: config, [STORAGE_STATE]: state });
await scheduleBreakAlarm(config);
await showBreakNotification(safeType, state, config, true);
}
async function applyNotificationAction(notificationId, buttonIndex) {
@@ -307,6 +346,20 @@ chrome.runtime.onStartup.addListener(async () => {
await scheduleBreakAlarm(normalizeConfig(data[STORAGE_CONFIG]));
});
chrome.runtime.onConnect.addListener((port) => {
if (port.name !== "inbe-visible-page") return;
visiblePages.add(port);
storageGet([STORAGE_CONFIG]).then((data) =>
scheduleBreakAlarm(normalizeConfig(data[STORAGE_CONFIG]))
).catch((error) => console.error("Inner Breeze break activation failed:", error));
port.onDisconnect.addListener(() => {
visiblePages.delete(port);
if (visiblePages.size === 0)
stopAutomaticBreaks().catch((error) =>
console.error("Inner Breeze break stop failed:", error));
});
});
chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
if (!message || typeof message.type !== "string")
return false;
+1 -1
View File
@@ -1,5 +1,5 @@
Package: inbe.waozi
Version: 2.0.2
Version: 2.0.4
Architecture: arm64
Maintainer: Waozi <[email protected]>
Click-Version: 0.4
+1 -1
View File
@@ -28,7 +28,7 @@
<binary>inbe</binary>
</provides>
<releases>
<release version="2.0.2" date="2026-09-20"/>
<release version="2.0.4" date="2026-09-21"/>
</releases>
<content_rating type="oars-1.1"/>
</component>
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "inbe",
"title": "Inner Breeze",
"version": "2.0.2",
"version": "2.0.4",
"architecture": "arm64",
"framework": "ubuntu-sdk-20.04",
"description": "Syncable breathing, meditation, and habit practice app.",
+3 -4
View File
@@ -2,17 +2,16 @@
"manifest_version": 3,
"name": "Inner Breeze",
"short_name": "Inbe",
"version": "2.0.2",
"version": "2.0.4",
"description": "Breathing, meditation, habit tracking, and encrypted sync.",
"permissions": [
"contextMenus"
],
"host_permissions": [
"https://api.waozi.xyz/*",
"https://inbe.waozi.xyz/*"
"https://api.waozi.xyz/*"
],
"content_security_policy": {
"extension_pages": "script-src 'self' 'wasm-unsafe-eval'; connect-src 'self' https://api.waozi.xyz wss://api.waozi.xyz https://inbe.waozi.xyz; object-src 'self'"
"extension_pages": "script-src 'self' 'wasm-unsafe-eval'; connect-src 'self' https: wss: http: ws:; object-src 'self'"
},
"icons": {
"16": "icons/icon-16.png",
+1 -1
View File
@@ -22,7 +22,7 @@
<binary>inbe</binary>
</provides>
<releases>
<release version="2.0.2" date="2026-09-20"/>
<release version="2.0.4" date="2026-09-21"/>
</releases>
<content_rating type="oars-1.1"/>
</component>
+1 -1
View File
@@ -22,7 +22,7 @@
<binary>inbe</binary>
</provides>
<releases>
<release version="2.0.2" date="2026-09-20"/>
<release version="2.0.4" date="2026-09-21"/>
</releases>
<content_rating type="oars-1.1"/>
</component>
+1 -1
View File
@@ -6,7 +6,7 @@ description: |
meditation, and habit tracking with visual and audio cues, meditation
timers, habit counters, session history, and optional sync.
version: '2.0.2'
version: '2.0.4'
license: BSD-3-Clause
base: core22
confinement: strict
+33 -3
View File
@@ -26,6 +26,7 @@ const chrome = {
},
onInstalled: event("runtime.onInstalled"),
onStartup: event("runtime.onStartup"),
onConnect: event("runtime.onConnect"),
onMessage: event("runtime.onMessage"),
},
storage: {
@@ -127,8 +128,20 @@ assert.ok(tabs.some((tab) => tab.url === "chrome-extension://inbe/index.html"));
await api.requestBreakNow(1);
assert.equal(storage.inbeBreakConfig.enabled, true);
assert.ok(notifications.some((entry) => entry.id === "inbe-break-1"));
assert.equal(chrome.action.badgeText, "BR");
assert.ok(notifications.some((entry) => entry.id === "inbe-break-1" && entry.options));
assert.equal(chrome.action.badgeText, "", "manual break does not start a hidden alarm");
let disconnectVisiblePage;
events["runtime.onConnect"][0]({
name: "inbe-visible-page",
onDisconnect: {
addListener(listener) {
disconnectVisiblePage = listener;
},
},
});
await new Promise((resolve) => setImmediate(resolve));
assert.equal(chrome.action.badgeText, "BR", "visible page enables automatic breaks");
storage.inbeBreakConfig = api.normalizeConfig({
enabled: true,
@@ -141,11 +154,28 @@ storage.inbeBreakConfig = api.normalizeConfig({
storage.inbeBreakState = api.normalizeState({ lastTickMs: 1000 });
idleState = "active";
await api.tickBreaks(61000);
assert.ok(notifications.some((entry) => entry.id === "inbe-break-0" && entry.options.buttons.length === 2));
assert.ok(notifications.some((entry) =>
entry.id === "inbe-break-0" && entry.options && entry.options.buttons.length === 2));
await api.applyNotificationAction("inbe-break-0", 0);
assert.ok(storage.inbeBreakState.timers[0].snoozeUntilMs > Date.now(), "postpone stores snooze deadline");
disconnectVisiblePage();
await new Promise((resolve) => setImmediate(resolve));
assert.equal(chrome.action.badgeText, "", "closing the page stops the indicator");
assert.ok(alarms.some((entry) => entry.name === "inbe-break-tick" && entry.clear));
const notificationCount = notifications.filter((entry) => entry.options).length;
await api.tickBreaks(122000);
assert.equal(notifications.filter((entry) => entry.options).length, notificationCount,
"closed page cannot receive automatic reminders");
assert.equal(storage.inbeBreakState.lastTickMs, 0, "closed page resets the timer");
events["runtime.onConnect"][0]({
name: "inbe-visible-page",
onDisconnect: { addListener() {} },
});
await new Promise((resolve) => setImmediate(resolve));
storage.inbeBreakState = api.normalizeState({
lastTickMs: 1000,
timers: [{ activeS: 80, idleS: 0 }],
+15
View File
@@ -3,6 +3,7 @@
import assert from "node:assert/strict";
import { spawn } from "node:child_process";
import { accessSync, constants, existsSync, mkdtempSync, readFileSync, rmSync } from "node:fs";
import { createServer } from "node:http";
import { tmpdir } from "node:os";
import { join, resolve } from "node:path";
@@ -193,6 +194,15 @@ async function main() {
assert.ok(existsSync(join(extensionRoot, "index.html")), "missing built extension page");
const chromium = resolveChromium();
const syncServer = createServer((request, response) => {
response.writeHead(200, {
"Access-Control-Allow-Origin": "*",
"Content-Type": "text/plain",
});
response.end(request.url === "/sync-probe" ? "custom sync server reachable" : "unexpected path");
});
await new Promise((resolveReady) => syncServer.listen(0, "127.0.0.1", resolveReady));
const syncServerPort = syncServer.address().port;
const stderrLines = [];
const args = [
"--headless=new",
@@ -261,6 +271,10 @@ async function main() {
const readyState = await waitForPageReady(cdp, page);
assert.ok(readyState.href.includes("chrome-extension://"));
const customServerResponse = await evaluate(cdp, page,
`fetch('http://127.0.0.1:${syncServerPort}/sync-probe').then((response) => response.text())`, true);
assert.equal(customServerResponse, "custom sync server reachable");
const pageExports = JSON.parse(await evaluate(cdp, page, `(() => {
Module._app_web_test_enable_extension_breaks(60);
return JSON.stringify({
@@ -297,6 +311,7 @@ async function main() {
if (cdp) cdp.close();
chrome.kill("SIGTERM");
await delay(250);
await new Promise((resolveClosed) => syncServer.close(resolveClosed));
rmSync(userDataDir, { recursive: true, force: true });
}
}
+14
View File
@@ -0,0 +1,14 @@
#!/usr/bin/env bash
set -euo pipefail
embuilder=${1:-embuilder}
for attempt in 1 2 3; do
if "$embuilder" build zlib; then
exit 0
fi
if [ "$attempt" -eq 3 ]; then
echo "Emscripten zlib port could not be fetched after 3 attempts" >&2
exit 1
fi
sleep $((attempt * 10))
done
+5 -2
View File
@@ -238,8 +238,11 @@ EOF
fi
set +e
INBE_DATA_ROOT="$data_root" xvfb-run -a -s "-screen 0 ${width}x${height}x24" \
"$BIN" \
env -u DISPLAY -u WAYLAND_DISPLAY -u SESSION_MANAGER \
-u DBUS_SESSION_BUS_ADDRESS INBE_DATA_ROOT="$data_root" \
xvfb-run -a -s "-screen 0 ${width}x${height}x24" \
env -u WAYLAND_DISPLAY -u SESSION_MANAGER -u DBUS_SESSION_BUS_ADDRESS \
SDL_VIDEODRIVER=x11 "$BIN" \
--screenshot "$output" \
--screenshot-scene "$scene" \
--screenshot-width "$width" \
+104
View File
@@ -0,0 +1,104 @@
#!/usr/bin/env python3
"""Generate the Inbe appcast for a release.
The release workflow publishes appcast.json next to its artifacts:
scripts/make_appcast.py \
--version "$VERSION" \
--base-url "https://github.com/OWNER/APP/releases/download/v$VERSION" \
--notes-url "https://github.com/OWNER/APP/releases/tag/v$VERSION" \
--changelog CHANGELOG.md \
--out build/release/appcast.json \
--channel appimage=build/release/linux/app-linux-x86_64.AppImage \
--channel windows=build/release/windows/app-windows.zip
Each --channel becomes {url, sha256, size} in the document; the URL is
base-url/ plus the file's basename. Notes are the version's CHANGELOG.md
section, collapsed to one line and capped at 400 chars. Channels with a
missing file are skipped, an error when the flag is --channel-required.
"""
import argparse
import datetime
import hashlib
import json
import os
import re
import sys
def changelog_notes(path, version, limit=400):
try:
text = open(path, encoding="utf-8").read()
except OSError:
return ""
match = re.search(
r"^## \[" + re.escape(version) + r"\].*?\n(.*?)(?=^## \[|\Z)",
text, re.S | re.M)
if match is None:
return ""
return " ".join(match.group(1).split())[:limit]
def channel_entry(base_url, rel_path):
with open(rel_path, "rb") as f:
data = f.read()
return {
"url": base_url.rstrip("/") + "/" + os.path.basename(rel_path),
"sha256": hashlib.sha256(data).hexdigest(),
"size": len(data),
}
def main():
parser = argparse.ArgumentParser(description=__doc__.splitlines()[0])
parser.add_argument("--version", required=True)
parser.add_argument("--base-url", required=True,
help="release download URL prefix")
parser.add_argument("--notes-url", default="",
help="release page URL (defaults to base-url's tag)")
parser.add_argument("--changelog", default="CHANGELOG.md")
parser.add_argument("--out", required=True)
parser.add_argument("--channel", action="append", default=[],
metavar="NAME=PATH", dest="channels",
help="release artifact for a channel (repeatable)")
parser.add_argument("--channel-required", action="store_true",
help="fail when a named channel has no artifact")
args = parser.parse_args()
channels = {}
for item in args.channels:
name, _, path = item.partition("=")
if not name or not path:
parser.error("--channel wants NAME=PATH, got %r" % item)
if not os.path.isfile(path):
if args.channel_required:
sys.exit("missing artifact for channel %s: %s" % (name, path))
print("skipping channel %s (no artifact)" % name)
continue
channels[name] = channel_entry(args.base_url, path)
if not channels:
sys.exit("no channel artifacts found")
notes_url = args.notes_url
if not notes_url:
# derive ".../releases/download/vX" -> ".../releases/tag/vX"
head, sep, tail = args.base_url.rstrip("/").partition("/download/")
notes_url = head + "/tag/" + tail if sep else head
appcast = {
"version": args.version,
"date": datetime.date.today().isoformat(),
"notes": changelog_notes(args.changelog, args.version),
"notes_url": notes_url,
"channels": channels,
}
with open(args.out, "w", encoding="utf-8") as f:
json.dump(appcast, f, indent=2)
f.write("\n")
print("wrote %s" % args.out)
print(json.dumps(appcast, indent=2))
if __name__ == "__main__":
main()
+43 -41
View File
@@ -7,9 +7,9 @@
#
# Covered cases (the "closing windows in different inbe modes" matrix):
# 1. startup main window maps on a fresh profile
# 2. close-keep close action = keep running -> window hides, app lives
# 3. close-ask close action = ask -> prompt modal -> Quit -> app exits
# 4. close-ask-keep close action = ask -> prompt -> Keep running -> hidden
# 2. close-keep no tray icon -> close exits, even with Keep running set
# 3. close-ask no tray icon -> close exits without a hidden process
# 4. startup-hidden no tray icon -> app stays visible; minimize exits
#
# Requirements: xvfb-run/Xvfb, xfwm4, xdotool, xwininfo (x11-utils), sqlite3.
# The user's session and data are never touched. Break HUD dragging needs a
@@ -32,8 +32,9 @@ for tool in xvfb-run Xvfb xfwm4 xdotool xwininfo sqlite3; do
done
if [ -z "${INBE_DESKTOP_WINDOW_TEST_XVFB:-}" ]; then
exec xvfb-run -a -s "-screen 0 $GEOMETRY" \
env INBE_DESKTOP_WINDOW_TEST_XVFB=1 "$0" "$@"
exec env -u DISPLAY -u WAYLAND_DISPLAY -u SESSION_MANAGER \
-u DBUS_SESSION_BUS_ADDRESS xvfb-run -a -s "-screen 0 $GEOMETRY" \
env -u WAYLAND_DISPLAY INBE_DESKTOP_WINDOW_TEST_XVFB=1 "$0" "$@"
fi
DISPLAY_TEST=${DISPLAY:?xvfb-run did not set DISPLAY}
@@ -55,8 +56,16 @@ say() { printf '%s\n' "$*"; }
ok() { PASS=$((PASS + 1)); say "PASS: $1"; }
bad() { FAIL=$((FAIL + 1)); say "FAIL: $1"; }
XD() { DISPLAY="$DISPLAY_TEST" xdotool "$@" 2>/dev/null; }
XW() { DISPLAY="$DISPLAY_TEST" xwininfo "$@" 2>/dev/null; }
XD() { env -u WAYLAND_DISPLAY DISPLAY="$DISPLAY_TEST" xdotool "$@" 2>/dev/null; }
XW() { env -u WAYLAND_DISPLAY DISPLAY="$DISPLAY_TEST" xwininfo "$@" 2>/dev/null; }
capture_visual() { # $1 = capture name
[ -n "${INBE_VISUAL_OUTPUT_DIR:-}" ] || return 0
mkdir -p "$INBE_VISUAL_OUTPUT_DIR"
env -u WAYLAND_DISPLAY DISPLAY="$DISPLAY_TEST" \
xwd -root -silent -out "$WORK/$1.xwd"
convert "$WORK/$1.xwd" "$INBE_VISUAL_OUTPUT_DIR/$1.png"
}
# Main (client) window id: named, wider than 500px.
main_window() {
@@ -81,7 +90,7 @@ close_button() {
launch_app() { # $1 = root dir, $2 = log name
[ -n "$APP_PID" ] && { kill "$APP_PID" 2>/dev/null; sleep 1; }
rm -f "$WORK/$2"
DISPLAY="$DISPLAY_TEST" APP_DATA_ROOT="$1" INBE_NO_TRAY=1 \
env -u WAYLAND_DISPLAY DISPLAY="$DISPLAY_TEST" APP_DATA_ROOT="$1" APP_NO_TRAY=1 \
setsid "$BIN" >"$WORK/$2" 2>&1 &
APP_PID=$!
sleep 8
@@ -98,7 +107,7 @@ set_setting() { # $1 = root, $2 = key, $3 = value
}
# --- environment -----------------------------------------------------------
DISPLAY="$DISPLAY_TEST" setsid xfwm4 >/dev/null 2>&1 &
env -u WAYLAND_DISPLAY DISPLAY="$DISPLAY_TEST" setsid xfwm4 >/dev/null 2>&1 &
WM_PID=$!
sleep 1.5
@@ -120,27 +129,28 @@ launch_app "$ROOT1" log-keep
MW=$(main_window)
if [ -n "$MW" ] && XW -id "$MW" | grep -q IsViewable; then
ok "startup: main window maps"
capture_visual "01-window-visible"
else
bad "startup: main window does not map"
fi
# --- 2. close = keep running -> hidden but alive ---------------------------
# --- 2. close = keep running, but no indicator -> exits --------------------
if CB=$(close_button); then
XD mousemove ${CB% *} ${CB#* }
XD click 1
sleep 2.5
MW=$(main_window)
if kill -0 "$APP_PID" 2>/dev/null && \
XW -id "$MW" | grep -q IsUnMapped; then
ok "close-keep: window hidden, app alive"
if ! kill -0 "$APP_PID" 2>/dev/null; then
ok "close-keep: no indicator, so app exits"
capture_visual "02-after-close"
APP_PID=""
else
bad "close-keep: expected hidden window with live process"
bad "close-keep: app stayed alive without an indicator"
fi
else
bad "close-keep: no WM frame found"
fi
# --- 3. close = ask -> prompt -> Quit -> exits -----------------------------
# --- 3. close = ask, but no indicator -> exits ------------------------------
ROOT2="$WORK/r-ask"
fresh_root "$ROOT2"; cp "$WORK/template.db" "$ROOT2/inbe.db"
mkdir -p "$ROOT2/runtime-assets"
@@ -149,49 +159,41 @@ launch_app "$ROOT2" log-ask
if CB=$(close_button); then
XD mousemove ${CB% *} ${CB#* }
XD click 1
sleep 2
# The prompt is proven behaviorally: the right-hand button only quits
# when the close prompt is up and accepting clicks.
XD mousemove 715 482
XD mousedown 1; sleep 0.15; XD mouseup 1
sleep 2.5
if kill -0 "$APP_PID" 2>/dev/null; then
bad "close-ask: prompt Quit did not exit the app"
bad "close-ask: app stayed alive without an indicator"
else
ok "close-ask: prompt appears and Quit exits the app"
ok "close-ask: no indicator, so app exits"
APP_PID=""
fi
else
bad "close-ask: no WM frame found"
fi
# --- 4. close = ask -> prompt -> Keep running ------------------------------
ROOT3="$WORK/r-ask2"
# --- 4. startup hidden without a tray -> visible, then minimize exits -----
ROOT3="$WORK/r-start-hidden"
fresh_root "$ROOT3"; cp "$WORK/template.db" "$ROOT3/inbe.db"
mkdir -p "$ROOT3/runtime-assets"
set_setting "$ROOT3" desktop_close_action 0 # ASK
launch_app "$ROOT3" log-ask2
if CB=$(close_button); then
XD mousemove ${CB% *} ${CB#* }
XD click 1
sleep 2
# Left-hand prompt button is Keep running.
XD mousemove 520 482
XD mousedown 1; sleep 0.15; XD mouseup 1
set_setting "$ROOT3" desktop_startup_mode 1 # STARTUP_HIDDEN
launch_app "$ROOT3" log-start-hidden
MW=$(main_window)
if [ -n "$MW" ] && XW -id "$MW" | grep -q IsViewable; then
ok "startup-hidden: no indicator, so window stays visible"
capture_visual "03-start-hidden-without-indicator"
XD windowminimize "$MW"
sleep 2.5
MW=$(main_window)
if kill -0 "$APP_PID" 2>/dev/null && \
XW -id "$MW" | grep -q IsUnMapped; then
ok "close-ask-keep: Keep running hides window, app alive"
if ! kill -0 "$APP_PID" 2>/dev/null; then
ok "minimize: no indicator, so app exits"
APP_PID=""
else
bad "close-ask-keep: expected hidden window with live process"
bad "minimize: app stayed alive without an indicator"
fi
else
bad "close-ask-keep: no WM frame found"
bad "startup-hidden: window did not remain visible"
fi
# Break HUD dragging used to live here, but this harness deliberately runs with
# INBE_NO_TRAY=1 so close-window behavior can be tested without a desktop tray.
# APP_NO_TRAY=1 so close-window behavior can be tested without a desktop tray.
# HUD behavior requires a separate tray-ready harness.
say ""
+1 -1
View File
@@ -96,7 +96,7 @@ write_web_app_csp_html() {
src=$1
dst=$2
cache_version=$(date +%s)
csp="default-src 'self' data: blob:; connect-src 'self' https://api.waozi.xyz wss://api.waozi.xyz https://inbe.waozi.xyz; script-src 'self' 'unsafe-eval' 'unsafe-inline' https://telegram.org; style-src 'self' 'unsafe-inline'; worker-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob:; frame-src https:; img-src data: https:; media-src https:; object-src 'none'"
csp="default-src 'self' data: blob:; connect-src 'self' https: wss: http: ws:; script-src 'self' 'unsafe-eval' 'unsafe-inline' https://telegram.org; style-src 'self' 'unsafe-inline'; worker-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob:; frame-src https:; img-src data: https:; media-src https:; object-src 'none'"
meta="<meta http-equiv=\"Content-Security-Policy\" content=\"$csp\">"
awk -v meta="$meta" -v version="$cache_version" '
+1 -1
View File
@@ -108,7 +108,7 @@
<p class="policy-kicker">05 · Browser extensions</p>
<h2>Permissions with a narrow purpose.</h2>
<p>The browser extension uses browser storage for settings and reminder state. Depending on the browser build, it may use alarms, context menus, notifications, and the browser's active-or-idle status to schedule local reminders and quick actions.</p>
<p>Inner Breeze does not read your browsing history, page contents, form data, keystrokes, or mouse position. Host access to <code>inbe.waozi.xyz</code> and <code>api.waozi.xyz</code> supports app resources and optional online features.</p>
<p>Inner Breeze does not read your browsing history, page contents, form data, keystrokes, or mouse position. The browser extension requests host access to <code>api.waozi.xyz</code> for optional sync with the default server. You can leave sync off or choose a compatible server. A custom server must allow requests from the browser extension.</p>
<p>Consistent with the Chrome Web Store Limited Use requirements, extension data is used only to provide or improve user-facing Inner Breeze features. It is not used for advertising, creditworthiness, or unrelated purposes.</p>
</section>
-140
View File
@@ -1,140 +0,0 @@
#ifndef APP_APP_H
#define APP_APP_H
#include "kryon.h"
#include "ui_swipe.h"
#include "platform.h"
#include "core/breath_engine.h"
#include "breaks/break_engine.h"
#include "app_fwd.h"
#include "runtime_assets.h"
#include "screens/habits_screen.h"
#include "src/screens/elist_types.h"
#include "screens/settings/settings_types.h"
#include "storage/sync_account.h"
#include "app/app_types.h"
#include "app/metrics.h"
/* Shared UI viewport extents, updated by the app frame loop. */
extern int view_width;
extern int view_height;
int app_locale_dropdown(int id, int x, int y, int w, int h,
int *selected_index);
UIPanelFrame AppModalFrame(int width, int height, const char *title,
int left_icon_type, int right_icon_type);
UIGuideResult AppGuideOverlay(GuideOverlayProps guide);
ProfileImagePickerResult AppProfileImagePickerModal(ProfileImagePickerProps modal);
int AppIconSliderPopup(IconSliderPopupProps popup);
IconRowResult AppBottomIconRow(IconRowRequest row);
void AppReorderHandle(int x, int y, int w, int h, int active);
void AppReorderPlaceholder(Rectangle bounds);
extern AppConfig config;
int app_register_style_pack_variant(const char *source, const char *label,
ThemeColors colors, int style_index);
int app_draw_close_title_bar(InnerBreeze*app, const char *title, int height);
int app_scaffold_close_title(const char *title, int height, void *user_data);
int app_draw_close_dropdown_title_bar(InnerBreeze*app, TitleBarDropdown dropdown,
int height);
void app_set_host_api(InnerBreeze*app, HostApi host);
void app_init(void *app);
void app_update_draw(void *app, Rectangle viewport);
void app_destroy(void *app);
InnerBreeze*get_global_app(void);
void set_global_app(InnerBreeze*app);
void app_switch_screen(InnerBreeze*app, int screen);
AppRoute app_current_route(const InnerBreeze*app);
void app_request_route(InnerBreeze*app, AppRoute route);
void app_switch_route(InnerBreeze*app, AppRoute route);
void app_leave_practice_config(InnerBreeze*app);
int app_content_top_reserved(const InnerBreeze*app);
int app_toolbar_height(void);
int app_auto_sync(InnerBreeze*app);
void app_request_social_refresh(InnerBreeze*app);
int app_social_refresh_loading(void);
int app_sync_loading(void);
void app_request_friend_send(InnerBreeze*app, const char *target);
void app_request_friend_accept(InnerBreeze*app, const char *request_id);
void app_request_friend_decline(InnerBreeze*app, const char *request_id);
void app_request_friend_remove(InnerBreeze*app, const char *friend_user_id);
int app_should_use_tab_bar(const InnerBreeze*app);
void app_play_breath_cue(InnerBreeze*app, int dir);
void app_play_bell_cue(InnerBreeze*app, float scale);
void app_play_sound(InnerBreeze*app, Sound sound, float scale);
void app_audio_ensure_ready(InnerBreeze*app);
int app_audio_reinitialize(InnerBreeze*app);
float app_audio_output_level(InnerBreeze*app);
int app_bell_cue_playing(InnerBreeze*app);
void app_audio_library_load(InnerBreeze*app);
void app_audio_library_save(const InnerBreeze*app);
void app_audio_reload_cue_sounds(InnerBreeze*app);
int app_audio_import_custom_sound_ex(InnerBreeze*app, int cue, const char *path, int *error_code);
int app_audio_import_custom_music_ex(InnerBreeze*app, const char *path, int *error_code);
int app_audio_import_custom_sound(InnerBreeze*app, int cue, const char *path);
int app_audio_import_custom_music(InnerBreeze*app, const char *path);
int app_audio_remove_custom_sound(InnerBreeze*app, int index);
int app_audio_remove_custom_music(InnerBreeze*app, int index);
int app_audio_music_count(const InnerBreeze*app);
const char *app_audio_music_label(const InnerBreeze*app, int index);
int app_audio_music_path(const InnerBreeze*app, int index, char *out, size_t out_size);
int app_audio_sound_file_valid(const char *path);
int app_audio_music_file_valid(const char *path);
const char *app_audio_cue_default_asset(int cue);
int app_audio_cue_path(InnerBreeze*app, int cue, char *out, size_t out_size);
void app_audio_music_sanitize_selection(InnerBreeze*app);
void app_unload_texture(Texture2D texture);
const char *app_donation_url(void);
const char *app_bitcoin_donation_address(void);
const char *app_monero_donation_address(void);
const char *app_bitcoin_wallet_url(void);
const char *app_monero_wallet_url(void);
const char *app_bitcoin_trocador_url(void);
const char *app_monero_trocador_url(void);
const char *app_bitcoin_donation_url(void);
const char *app_monero_donation_url(void);
void app_open_modal(InnerBreeze*app, UIModalType type);
void app_close_modal(InnerBreeze*app);
void app_block_current_click(InnerBreeze*app);
void app_request_desktop_close(InnerBreeze*app);
void app_request_desktop_quit(InnerBreeze*app);
AppClosePromptResult app_consume_close_prompt_result(InnerBreeze*app);
SessionExitModalResult app_draw_session_exit_modal(int can_save,
const char *save_message,
const char *discard_message);
int clampi(int x, int min, int max);
int int_from_count(const char src[4]);
void count_from_int(char dst[4], int value);
void app_reload_after_import(InnerBreeze*app, int reload_settings);
void update_preview_bounds(BreathSession *breathing, int content_w, int max_h);
void refresh_theme_colors(int theme_id, int dark_mode);
void refresh_locale_dependent_text(InnerBreeze*app);
void apply_system_language_selection(InnerBreeze*app, int save_now);
void apply_language_selection(InnerBreeze*app, int language_index, int save_now);
void app_accept_language_selection(InnerBreeze*app);
int exercise_manual_seen(InnerBreeze*app, int exercise_type);
void mark_exercise_manual_seen(InnerBreeze*app, int exercise_type);
void sync_habits_for_activity(InnerBreeze*app, int exercise_type);
void draw_breath_preview(BreathSession *breathing, int center_x, int center_y);
void app_prepare_session_results(InnerBreeze*app, int activity, int primary_value,
int secondary_value, const char *detail,
const int *round_values, int round_count,
const char *saved_path);
#include "app_nav.h"
#include "app/app_settings.h"
int app_sync_failure_needs_action(int result);
double app_sync_retry_delay(int attempt);
void app_sync_record_result(int result);
const char *app_sync_status_key(void);
#endif
+26
View File
@@ -0,0 +1,26 @@
#module "app"
# The public app surface is composed from the generated headers owned by the
# modules that implement it. Keeping the umbrella in Kry prevents declarations
# from drifting away from their implementations.
#import "app/app_types.h"
#import "app/application.h"
#import "app/app_chrome.h"
#import "app/app_donation.h"
#import "app/app_lifecycle.h"
#import "app/app_modal_state.h"
#import "app/app_nav.h"
#import "app/app_route_state.h"
#import "app/app_settings.h"
#import "app/app_style.h"
#import "app/app_sync.h"
#import "app/audio.h"
#import "app/device_preferences.h"
#import "app/locale_dropdown.h"
#import "app/metrics.h"
#import "app/music_library.h"
#import "app/profile_image_picker.h"
#import "app/sync_retry.h"
#import "app/widgets.h"
#import "practices/session_results.h"
#import "practices/whm/whm_session.h"
+3 -3
View File
@@ -1,6 +1,6 @@
#module "app.chrome"
#import "app.h"
#import "app/app.h"
app_draw_close_title_bar :: (app: InnerBreeze*, title: const char*,
height: int) -> int #export {
@@ -47,9 +47,9 @@ app_draw_close_dropdown_title_bar :: (app: InnerBreeze*,
if close_y < 0 { close_y = 0 }
if dropdown_y < 0 { dropdown_y = 0 }
if dropdown_w < 1 { dropdown_w = 1 }
DrawRectangle(0, 0, view_width, height, GetThemeBackground())
DrawRectangle(0, 0, view_width, height, StyleTokenColor("canvas"))
DrawLine(0, height - 1, view_width, height - 1,
DarkenColor(GetThemeButton(), 18))
DarkenColor(StyleTokenColor("accent"), 18))
Dropdown((DropdownProps){.id = dropdown.id,
.bounds = {dropdown_x, dropdown_y, dropdown_w, dropdown_h},
.options = dropdown.options, .option_count = dropdown.option_count,
+1 -1
View File
@@ -1,6 +1,6 @@
#module "app.donation_reminder"
#import "app.h"
#import "app/app.h"
#import "storage.h" #private
save_reminder :: (app: InnerBreeze*) #private {
+1 -1
View File
@@ -1,6 +1,6 @@
#module "app.frame_pacing"
#import "app.h"
#import "app/app.h"
#import "practices/practice_registry.h" #private
static last_mouse_ready: int = 0
+1 -1
View File
@@ -1,6 +1,6 @@
#module "app.lifecycle"
#import "app.h"
#import "app/app.h"
#import "app/app_route_url.h" #private
#import "practices/whm/whm_session.h" #private
#import <stdlib.h> #private
+1 -1
View File
@@ -1,6 +1,6 @@
#module "app.modal_state"
#import "app.h"
#import "app/app.h"
app_block_current_click :: (app: InnerBreeze*) #export {
if app != nil { app->blocked_input_frame = app->breathing.frame }
+4 -4
View File
@@ -1,7 +1,7 @@
#import "app.h"
#import "app/app.h"
#import "app_nav.h"
#import "app_shell.h" #private
#import "ui_app_shell_props.generated.h" #private
#import "storage.h" #private
#import "sync_account.h" #private
#import "screens/settings/settings_screen.h" #private
@@ -940,14 +940,14 @@ app_draw_customize_nav_page :: (app: InnerBreeze*) -> int {
dropdown_w = Scale(48)
}
DrawRectangle(content_x, overlay_y, content_w, row_h,
LightenColor(GetThemeBackground(), 8))
LightenColor(StyleTokenColor("canvas"), 8))
AppReorderHandle(content_x, overlay_y, handle_w, row_h, 1)
Dropdown((DropdownProps){.id = 740 + i,
.bounds = {dropdown_x, dropdown_y, dropdown_w, button_h},
.options = options, .option_count = option_count,
.selected_index = &selected[i]})
Icon(0, trash_x + Scale(8), dropdown_y + Scale(6),
Scale(20), ICON_TRASH, GetThemeIcon())
Scale(20), ICON_TRASH, StyleTokenColor("icon"))
}
y += row_h * draw_count
+1 -1
View File
@@ -2,7 +2,7 @@
WEB :: #defined(PLATFORM_WEB)
#import "app.h"
#import "app/app.h"
#import "screens/profile_social"
hb :: #import "screens/habits_screen"
#import "kryon.h" #private
+1 -1
View File
@@ -1,6 +1,6 @@
#module "app.persistence"
#import "app.h"
#import "app/app.h"
#import "screens/habits_screen.h" #private
app_flush_deferred_settings :: (app: InnerBreeze*) #export {
+1 -1
View File
@@ -1,6 +1,6 @@
#module "app.route_state"
#import "app.h"
#import "app/app.h"
#import "screens/profile_social.h" #private
#import <stdlib.h> #private
+1 -1
View File
@@ -1,6 +1,6 @@
#module "app.route_url"
#import "app.h"
#import "app/app.h"
#import "app/app_route_state.h" #private
#import <stdio.h> #private
#import <string.h> #private
+1 -1
View File
@@ -1,4 +1,4 @@
#import "app.h"
#import "app/app.h"
#import "app_nav.h" #private
#import "app/device_preferences.h" #private
+72 -4
View File
@@ -1,5 +1,5 @@
#module "app.style"
#import "app.h"
#import "app/app.h"
#import <stdio.h>
#import <stdlib.h>
#import <string.h>
@@ -32,6 +32,72 @@ style_pack_label :: (index: int) -> const char* #export {
}
}
style_token_color :: (color: Color) -> u32 #private {
return (u32)ColorToInt(color)
}
lightfield_token_color :: (style_index: int, color: Color,
alpha: float) -> u32 #private {
if style_index == 3 {
return style_token_color(Fade(color, alpha))
}
return style_token_color(color)
}
register_style_pack_variant :: (source: const char*, label: const char*,
colors: ThemeColors, style_index: int) -> int #private {
tokens: [47] StyleColorToken = {
{"canvas", style_token_color(colors.background)},
{"text", style_token_color(colors.text)},
{"muted", style_token_color(colors.text_muted)},
{"surface", lightfield_token_color(style_index, colors.surface, 0.87f)},
{"surface-end", lightfield_token_color(style_index, colors.surface_raised, 0.93f)},
{"card", lightfield_token_color(style_index, colors.surface_raised, 0.87f)},
{"card-end", lightfield_token_color(style_index, colors.surface, 0.93f)},
{"panel", style_token_color(colors.surface_raised)},
{"panel-hover", style_token_color(colors.surface)},
{"panel-pressed", style_token_color(colors.surface_sunken)},
{"button", lightfield_token_color(style_index, colors.surface_raised, 0.87f)},
{"button-end", lightfield_token_color(style_index, colors.surface, 0.93f)},
{"button-hover", lightfield_token_color(style_index, colors.surface, 0.93f)},
{"button-hover-end", lightfield_token_color(style_index, colors.surface_raised, 0.93f)},
{"button-pressed", lightfield_token_color(style_index, colors.surface_sunken, 0.93f)},
{"button-pressed-end", lightfield_token_color(style_index, colors.surface, 0.93f)},
{"button-disabled", style_token_color(colors.surface)},
{"dropdown-end", lightfield_token_color(style_index, colors.surface_raised, 0.93f)},
{"border", style_token_color(colors.border)},
{"border-soft", style_token_color(colors.divider)},
{"border-hover", style_token_color(colors.border_strong)},
{"border-hover-strong", style_token_color(colors.border_strong)},
{"border-disabled", style_token_color(colors.divider)},
{"card-border", style_token_color(colors.border)},
{"outline-border", style_token_color(colors.border_strong)},
{"focus", style_token_color(colors.focus)},
{"accent", style_token_color(colors.accent)},
{"accent-end", style_token_color(colors.accent_pressed)},
{"accent-hover", style_token_color(colors.accent_hover)},
{"accent-hover-end", style_token_color(colors.accent)},
{"accent-border", style_token_color(colors.accent_pressed)},
{"accent-ink", style_token_color(colors.on_accent)},
{"danger", style_token_color(colors.danger)},
{"danger-hover", style_token_color(colors.danger)},
{"danger-ink", style_token_color(colors.on_danger)},
{"danger-border", style_token_color(colors.danger)},
{"row", lightfield_token_color(style_index, colors.surface, 0.67f)},
{"thumb-ink", style_token_color(colors.on_accent)},
{"divider", style_token_color(colors.divider)},
{"track", style_token_color(colors.surface_sunken)},
{"track-hover", style_token_color(colors.surface_raised)},
{"field", style_token_color(colors.surface_sunken)},
{"field-border", style_token_color(colors.border)},
{"scroll-thumb", style_token_color(colors.text_muted)},
{"scroll-border", style_token_color(colors.border_strong)},
{"link", style_token_color(colors.link)},
{"icon", style_token_color(colors.icon)},
}
return RegisterStylePackVariant("inbe", source, label, tokens, 47)
}
static applied_style: int = -1
static applied_colors: ThemeColors
@@ -62,7 +128,9 @@ app_apply_style :: (app: InnerBreeze*) #export {
.accent_pressed = MixThemeColor(GetThemeButton(), GetThemeText(), 0.12f),
.on_accent = GetThemeButtonText(),
.danger = scheme.error,
.on_danger = GetThemeReadableText(scheme.error)
.on_danger = GetThemeReadableText(scheme.error),
.link = GetThemeLink(),
.icon = GetThemeIcon()
}
if applied_style == app->style_index &&
memcmp(&applied_colors, &colors, sizeof(ThemeColors)) == 0 &&
@@ -92,8 +160,8 @@ app_apply_style :: (app: InnerBreeze*) #export {
}
free(overrides)
}
if app_register_style_pack_variant(source, style_pack_label(app->style_index),
colors, app->style_index) {
if register_style_pack_variant(source, style_pack_label(app->style_index),
colors, app->style_index) {
SetActiveStylePack("inbe")
applied_style = app->style_index
applied_colors = colors
-65
View File
@@ -1,65 +0,0 @@
#include "app.h"
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
static uint32_t inbe_color_to_int(Color color) {
return (uint32_t)ColorToInt(color);
}
static Color inbe_lightfield_color(int style_index, Color color, float alpha) {
return style_index == 3 ? Fade(color, alpha) : color;
}
int app_register_style_pack_variant(const char *source, const char *label,
ThemeColors colors, int style_index) {
StyleColorToken tokens[] = {
{"canvas", inbe_color_to_int(colors.background)},
{"text", inbe_color_to_int(colors.text)},
{"muted", inbe_color_to_int(colors.text_muted)},
{"surface", inbe_color_to_int(inbe_lightfield_color(style_index, colors.surface, 0.87f))},
{"surface-end", inbe_color_to_int(inbe_lightfield_color(style_index, colors.surface_raised, 0.93f))},
{"card", inbe_color_to_int(inbe_lightfield_color(style_index, colors.surface_raised, 0.87f))},
{"card-end", inbe_color_to_int(inbe_lightfield_color(style_index, colors.surface, 0.93f))},
{"panel", inbe_color_to_int(colors.surface_raised)},
{"panel-hover", inbe_color_to_int(colors.surface)},
{"panel-pressed", inbe_color_to_int(colors.surface_sunken)},
{"button", inbe_color_to_int(inbe_lightfield_color(style_index, colors.surface_raised, 0.87f))},
{"button-end", inbe_color_to_int(inbe_lightfield_color(style_index, colors.surface, 0.93f))},
{"button-hover", inbe_color_to_int(inbe_lightfield_color(style_index, colors.surface, 0.93f))},
{"button-hover-end", inbe_color_to_int(inbe_lightfield_color(style_index, colors.surface_raised, 0.93f))},
{"button-pressed", inbe_color_to_int(inbe_lightfield_color(style_index, colors.surface_sunken, 0.93f))},
{"button-pressed-end", inbe_color_to_int(inbe_lightfield_color(style_index, colors.surface, 0.93f))},
{"button-disabled", inbe_color_to_int(colors.surface)},
{"dropdown-end", inbe_color_to_int(inbe_lightfield_color(style_index, colors.surface_raised, 0.93f))},
{"border", inbe_color_to_int(colors.border)},
{"border-soft", inbe_color_to_int(colors.divider)},
{"border-hover", inbe_color_to_int(colors.border_strong)},
{"border-hover-strong", inbe_color_to_int(colors.border_strong)},
{"border-disabled", inbe_color_to_int(colors.divider)},
{"card-border", inbe_color_to_int(colors.border)},
{"outline-border", inbe_color_to_int(colors.border_strong)},
{"focus", inbe_color_to_int(colors.focus)},
{"accent", inbe_color_to_int(colors.accent)},
{"accent-end", inbe_color_to_int(colors.accent_pressed)},
{"accent-hover", inbe_color_to_int(colors.accent_hover)},
{"accent-hover-end", inbe_color_to_int(colors.accent)},
{"accent-border", inbe_color_to_int(colors.accent_pressed)},
{"accent-ink", inbe_color_to_int(colors.on_accent)},
{"danger", inbe_color_to_int(colors.danger)},
{"danger-hover", inbe_color_to_int(colors.danger)},
{"danger-ink", inbe_color_to_int(colors.on_danger)},
{"danger-border", inbe_color_to_int(colors.danger)},
{"row", inbe_color_to_int(inbe_lightfield_color(style_index, colors.surface, 0.67f))},
{"thumb-ink", inbe_color_to_int(colors.on_accent)},
{"divider", inbe_color_to_int(colors.divider)},
{"track", inbe_color_to_int(colors.surface_sunken)},
{"track-hover", inbe_color_to_int(colors.surface_raised)},
{"field", inbe_color_to_int(colors.surface_sunken)},
{"field-border", inbe_color_to_int(colors.border)},
{"scroll-thumb", inbe_color_to_int(colors.text_muted)},
{"scroll-border", inbe_color_to_int(colors.border_strong)},
};
return RegisterStylePackVariant("inbe", source, label, tokens,
(int)(sizeof(tokens) / sizeof(tokens[0])));
}
+34 -2
View File
@@ -1,4 +1,4 @@
#import "app.h"
#import "app/app.h"
#import "app/app_notifications.h" #private
#import "platform.h" #private
@@ -157,6 +157,38 @@ app_sync_status_key :: () -> const char* {
return "sync_status_ready"
}
app_sync_progress_text :: (out: char*, out_size: size_t) {
status: StorageSyncStatus
if out == nil || out_size == 0 {
return
}
out[0] = '\0'
if app_sync_loading() {
if storage_sync_status(&status) {
if status.secure_migration_pending &&
status.secure_migration_total > 0 {
FormatLocaleText(out, out_size, "sync_progress_securing",
status.secure_migration_done,
status.secure_migration_total)
return
}
if status.queued_changes > 0 {
FormatLocaleText(out, out_size, "sync_progress_uploading",
status.queued_changes)
return
}
}
snprintf(out, out_size, "%s", GetLocaleText("sync_progress_restoring"))
return
}
if app_social_refresh_loading() {
snprintf(out, out_size, "%s", GetLocaleText("sync_progress_friends"))
return
}
snprintf(out, out_size, "%s", GetLocaleText(app_sync_status_key()))
}
app_clear_disconnected_sync_work :: () #private {
#if !WEB {
sync_lock()
@@ -1099,7 +1131,7 @@ app_auto_sync :: (app: InnerBreeze*) -> int {
if g_sync.dirty_sync_at <= 0.0 || due < g_sync.dirty_sync_at {
g_sync.dirty_sync_at = due
}
TraceLog(LOG_INFO, "SYNC: queued local changes")
TraceLog(LOG_INFO, "SYNC: automatic sync scheduled")
return 1
}
+1 -1
View File
@@ -1,5 +1,5 @@
#import "kryon.h"
#import "ui_swipe.h"
#import "ui_swipe_props.generated.h"
#import "platform.h"
#import "core/breath_engine.h"
#import "breaks/break_engine.h"
+24 -14
View File
@@ -6,11 +6,11 @@
NOMINMAX :: 1
}
#import "app.h"
#import "app/app.h"
#import "src/screens/elist_screen.h"
#import "app_internal.h"
#import "app_runtime.h"
#import "ui_app_host_props.generated.h"
#import "app/app_sync.h"
#import "app/app_route_state.h"
#import "app/app_route_url.h"
@@ -107,11 +107,19 @@ app_request_desktop_close :: (app: InnerBreeze*) #export {
app->request_quit = 1
return
}
#if #defined(DESKTOP_TRAY_ENABLED) {
if !desktop_tray_ready() {
app->request_quit = 1
return
}
}
if app->desktop_close_action == CLOSE_KEEP_RUNNING {
#if #defined(DESKTOP_TRAY_ENABLED) {
desktop_tray_keep_running()
if !desktop_tray_keep_running() {
app->request_quit = 1
}
} #else {
MinimizeWindow()
app->request_quit = 1
}
return
}
@@ -500,8 +508,10 @@ app_draw_blank_home_easteregg :: (app: InnerBreeze*) #private {
((float)available_h - logo_size) / 2, logo_size, logo_size}
if Button((ButtonProps){
.bounds = bounds,
.image_asset_path = "assets/easteregg/waozi.png",
.image_bounds = bounds, .image_fit = ImageFitContain,
.image = (ImageProps){
.asset_path = "assets/easteregg/waozi.png",
.bounds = bounds, .fit = ImageFitContain
},
.tone = ButtonToneNeutral, .emphasis = ButtonEmphasisGhost
}) {
OpenURI("https://waozi.xyz")
@@ -855,11 +865,11 @@ app_draw_donation_coin_section :: (label: const char*, address: const char*, wal
card_h = app_donation_coin_section_height(address, w)
DrawRectangleRounded((Rectangle){(float)x, (float)card_y, (float)w,
(float)card_h}, 0.08f, 8,
DarkenColor(GetThemeBackground(), 5))
DarkenColor(StyleTokenColor("canvas"), 5))
DrawRectangleRoundedLinesEx((Rectangle){(float)x, (float)card_y,
(float)w, (float)card_h}, 0.08f, 8,
(float)Scale(1),
DarkenColor(GetThemeBackground(), 26))
DarkenColor(StyleTokenColor("canvas"), 26))
*y = card_y + pad
Text((TextProps){
.bounds = {(float)content_x, (float)*y, 0, 0},
@@ -871,11 +881,11 @@ app_draw_donation_coin_section :: (label: const char*, address: const char*, wal
unused focus_id
DrawRectangleRounded((Rectangle){(float)content_x, (float)*y,
(float)content_w, (float)box_h},
0.06f, 8, GetThemeButton())
0.06f, 8, StyleTokenColor("accent"))
DrawRectangleRoundedLinesEx((Rectangle){(float)content_x, (float)*y,
(float)content_w, (float)box_h},
0.06f, 8, (float)Scale(1),
DarkenColor(GetThemeBackground(), 28))
DarkenColor(StyleTokenColor("canvas"), 28))
address_y = *y + (box_h - AppTextLineHeight(address_font)) / 2
Text((TextProps){
.bounds = {(float)(content_x + Scale(10)), (float)address_y,
@@ -1098,7 +1108,7 @@ draw_about_donation_modal :: (app: InnerBreeze*) #private {
(track_h - thumb_h) * app_donation_modal_scroll /
max_scroll,
Scale(3), thumb_h,
Fade(GetThemeText(), 0.28f))
Fade(StyleTokenColor("text"), 0.28f))
}
if Button((ButtonProps){
.bounds = {(float)(frame.x + (frame.w - button_w) / 2), (float)(frame.y + frame.h - button_h - Scale(16)), (float)(button_w), (float)(button_h)},
@@ -1695,7 +1705,7 @@ app_update_draw :: (vapp: void*, viewport: Rectangle) #export {
app_device_preferences_update(app)
update_check_poll()
app_refresh_theme(app)
DrawRectangleRec(viewport, GetThemeBackground())
DrawRectangleRec(viewport, StyleTokenColor("canvas"))
content_w = full_width - rail_width
if content_w < 1 {
content_w = 1
@@ -1727,7 +1737,7 @@ app_update_draw :: (vapp: void*, viewport: Rectangle) #export {
app->camera.offset.y = IsInspectActive() ? 0.0f : viewport.y + top_height
SetFrameCamera(app->camera)
if IsInspectActive() {
DrawRectangle(0, 0, view_width, view_height, GetThemeBackground())
DrawRectangle(0, 0, view_width, view_height, StyleTokenColor("canvas"))
profile_update_start = app_profile_now()
updateapp(app)
app_profile_record_update(profile_update_start)
@@ -1735,7 +1745,7 @@ app_update_draw :: (vapp: void*, viewport: Rectangle) #export {
} else {
BeginClip((int)viewport.x, (int)viewport.y, full_width, full_height)
BeginMode2D(app->camera)
DrawRectangle(0, 0, view_width, view_height, GetThemeBackground())
DrawRectangle(0, 0, view_width, view_height, StyleTokenColor("canvas"))
profile_update_start = app_profile_now()
updateapp(app)
Overlays()
+1 -1
View File
@@ -1,4 +1,4 @@
#import "app.h"
#import "app/app.h"
#import "app_internal.h"
#import "practices/meditation/meditation_practice.h"
#import <stdio.h>
+1 -1
View File
@@ -1,4 +1,4 @@
#import "app.h"
#import "app/app.h"
#import "app_nav.h"
route customize_nav {
+1 -1
View File
@@ -1,5 +1,5 @@
#import "app/app_style.h"
#import "app.h"
#import "app/app.h"
#import "platform.h"
ANDROID :: ANDROID_BUILD
+2 -2
View File
@@ -3,8 +3,8 @@ FontFallback :: struct {
path: const char*
}
#import "app.h"
#import "locale.h"
#import "app/app.h"
#import "ui_locale_props.generated.h"
#import "app_internal.h"
#import "app_font_assets.h"
#import <stdlib.h>
+1 -1
View File
@@ -1,4 +1,4 @@
#import "app.h"
#import "app/app.h"
app_locale_dropdown :: (id: int, x: int, y: int, w: int, h: int,
selected_index: int*) -> int {
+1 -1
View File
@@ -1,4 +1,4 @@
#import "app.h"
#import "app/app.h"
#import "audio_library.h"
#import "data.h"
#import "practices/meditation/meditation_practice.h"
+1 -1
View File
@@ -1,4 +1,4 @@
#import "app.h"
#import "app/app.h"
AppProfileImagePickerModal :: (modal: ProfileImagePickerProps) -> ProfileImagePickerResult {
result := (ProfileImagePickerResult){0}
+60 -2
View File
@@ -1,9 +1,11 @@
#import "app.h"
#import "app/app.h"
#import "storage.h"
#import "sync_account.h"
#import "sync_client.h"
#import "practices/practice_registry.h"
#import "app/device_preferences.h"
#import "screens/settings/settings_data_ui.h"
#import "screens/settings/settings_sync_account_impl.h"
#import <stdio.h>
#import <stdlib.h>
#import <string.h>
@@ -19,8 +21,34 @@ ScreenshotRequest :: struct {
output: [512] char
}
static screenshot_request: ScreenshotRequest
current_screenshot_request :: () -> ScreenshotRequest* #export {
return &screenshot_request
}
SCREENSHOT_THEME_CURRENT :: (-1)
screenshot_warmup_frames :: (request: const ScreenshotRequest*) -> int #export {
if request != nil && strcmp(request->scene, "tutorial_whm_step2") == 0 {
return 150
}
return 4
}
screenshot_after_warmup :: (app: InnerBreeze*,
request: const ScreenshotRequest*) #export {
if app == nil || request == nil {
return
}
if strcmp(request->scene, "tutorial_whm_step2") == 0 {
app->tutorial_step = 2
} else if strcmp(request->scene, "tutorial_whm_step0") == 0 ||
strcmp(request->scene, "tutorial_meditation") == 0 {
app->tutorial_step = 0
}
}
parse_int_arg :: (text: const char*, fallback: int) -> int #private {
end: char* = nil
value: long
@@ -222,7 +250,12 @@ setup_screenshot_scene :: (app: InnerBreeze*, request: const ScreenshotRequest*)
app->tutorial_step = 0
app->habits_guide_seen = 1
app->tutorial_seen = 1
screenshot_seed_habits(app)
# Sync screenshots must show only data already present in their isolated
# storage root. Seeding defaults here can turn a visual check into an
# upload as soon as an account is connected.
if strncmp(request->scene, "sync_", 5) != 0 {
screenshot_seed_habits(app)
}
screenshot_apply_theme(app, request->theme_id, request->dark_mode)
if strcmp(request->scene, "lists") == 0 || strcmp(request->scene, "lists_completed") == 0 {
list_id: [37] char = {0}
@@ -428,6 +461,31 @@ setup_screenshot_scene :: (app: InnerBreeze*, request: const ScreenshotRequest*)
app->profile_view = PROFILE_VIEW_MAIN
app->profile_tab = storage_sync_enabled() ? PROFILE_TAB_SYNC : PROFILE_TAB_DATA
app->breathing.screen = ScreenProfile
} else if strcmp(request->scene, "sync_connected") == 0 {
account: SyncAccount = {0}
payload: char* = nil
if sync_account_generate(&account) {
sync_account_save(&account, SYNC_ACCOUNT_LOCAL_DATA_ASK)
}
storage_set_setting_text("sync_account_alias", "waozi")
storage_set_setting_text("sync_server_url", "https://api.waozi.xyz")
storage_set_sync_enabled(1)
screenshot_seed_habits(app)
storage_set_social_cache_json(
"friends.list",
"{\"friends\":[{\"id\":\"friend-1\"},{\"id\":\"friend-2\"}]}")
for int sync_pass = 0; sync_pass < 4; sync_pass++ {
payload = storage_build_sync_payload_json(account.public_id,
account.public_key_hex)
storage_free_sync_payload_json(payload)
storage_apply_sync_response_json(
"{\"server_version\":1,\"changes\":{\"habits\":[],"
"\"habit_days\":[],\"sessions\":[]}}")
}
app_sync_record_result(SYNC_OK)
app->profile_view = PROFILE_VIEW_MAIN
app->profile_tab = PROFILE_TAB_SYNC
app->breathing.screen = ScreenProfile
} else if strcmp(request->scene, "configure_account") == 0 ||
strcmp(request->scene, "profile_sync_account") == 0 {
app->profile_view = PROFILE_VIEW_MAIN
+1 -1
View File
@@ -1,5 +1,5 @@
#import "app_update_check.h"
#import "app.h"
#import "app/app.h"
#import "kry_archive.h"
#import "storage.h"
#import "version.h"
+1 -1
View File
@@ -2,7 +2,7 @@
web_extension_host_js :: () -> int #extern
web_extension_break_now_js :: (break_type: int) #extern
}
#import "app.h"
#import "app/app.h"
#import "app/widgets.h"
#import "app_internal.h"
#import "data.h"
+9 -9
View File
@@ -1,4 +1,4 @@
#import "app.h"
#import "app/app.h"
#import "runtime/modal.h"
#import "runtime/guide.h"
#import "runtime/paragraph.h"
@@ -129,14 +129,14 @@ AppGuideOverlay :: (guide: GuideOverlayProps) -> UIGuideResult #export {
Box(scrim.bottom, scrim_color, BLANK)
Box(scrim.left, scrim_color, BLANK)
Box(scrim.right, scrim_color, BLANK)
Box(anchor, BLANK, GetThemeText())
Box(anchor, BLANK, StyleTokenColor("text"))
arrow := GuideArrowFor(tip, anchor, metrics)
Line((int)arrow.line_start.x, (int)arrow.line_start.y,
(int)arrow.line_end.x, (int)arrow.line_end.y, GetThemeText())
(int)arrow.line_end.x, (int)arrow.line_end.y, StyleTokenColor("text"))
Line((int)arrow.tip0.x, (int)arrow.tip0.y,
(int)arrow.tip1.x, (int)arrow.tip1.y, GetThemeText())
(int)arrow.tip1.x, (int)arrow.tip1.y, StyleTokenColor("text"))
Line((int)arrow.tip0.x, (int)arrow.tip0.y,
(int)arrow.tip2.x, (int)arrow.tip2.y, GetThemeText())
(int)arrow.tip2.x, (int)arrow.tip2.y, StyleTokenColor("text"))
widget_panel(tip, panel)
title := GetLocaleText("guide_title")
title_width := tip.width - (float)(metrics.pad * 2 + metrics.close_size + metrics.nav_gap)
@@ -248,7 +248,7 @@ AppReorderHandle :: (x: int, y: int, w: int, h: int, active: int) #export {
return
}
MarkClickable()
color := active ? GetThemeText() : GetThemeMutedText()
color := active ? StyleTokenColor("text") : StyleTokenColor("muted")
r := Scale(2)
if r < 2 {
r = 2
@@ -273,11 +273,11 @@ AppReorderPlaceholder :: (bounds: Rectangle) #export {
if paint.use_slot {
Surface(paint.slot_bounds, (Style){
.fields = StyleBackground | StyleBorder | StyleRadius | StyleBorderWidth,
.background = Fade(GetThemeButtonHover(), paint.fill_alpha),
.border = GetThemeButtonHover(), .radius = paint.radius,
.background = Fade(StyleTokenColor("accent-hover"), paint.fill_alpha),
.border = StyleTokenColor("accent-hover"), .radius = paint.radius,
.border_width = paint.stroke_width
})
} else {
Box(paint.line_bounds, GetThemeButtonHover(), BLANK)
Box(paint.line_bounds, StyleTokenColor("accent-hover"), BLANK)
}
}
+7 -7
View File
@@ -1,4 +1,4 @@
#import "app.h"
#import "app/app.h"
#import "kry_activity_monitor.h" #private
#import "platform/app_desktop_tray.h" #private
#import "storage/break_stats.h" #private
@@ -208,7 +208,7 @@ app_breaks_window_update :: (app: InnerBreeze*) {
NATIVE_WINDOW_STICKY
app->break_window = OpenNativeWindow("Inner Breeze", 0, 0,
win_w, win_h, flags,
DarkenColor(GetThemeBackground(), 8),
DarkenColor(StyleTokenColor("canvas"), 8),
scale)
if app->break_window == nil {
last_window_fail_frame = app->breathing.frame
@@ -607,7 +607,7 @@ app_breaks_hud_update :: (app: InnerBreeze*) {
app->break_hud = nil
}
if app->break_hud == nil {
track := DarkenColor(GetThemeBackground(), 18)
track := DarkenColor(StyleTokenColor("canvas"), 18)
flags := NATIVE_WINDOW_BORDERLESS + NATIVE_WINDOW_ALWAYS_ON_TOP +
NATIVE_WINDOW_SKIP_TASKBAR + NATIVE_WINDOW_STICKY
hud_x := Scale(8)
@@ -663,8 +663,8 @@ app_breaks_hud_update :: (app: InnerBreeze*) {
}
app_breaks_hud_draw :: (app: InnerBreeze*, hud_w: int, hud_h: int, row_h: int, pad: int) {
track := DarkenColor(GetThemeBackground(), 18)
border: Color = DarkenColor(GetThemeText(), 62)
track := DarkenColor(StyleTokenColor("canvas"), 18)
border: Color = DarkenColor(StyleTokenColor("text"), 62)
fill := (Color){74, 178, 102, 255}
overdue := (Color){222, 140, 44, 255}
idle_col := (Color){240, 200, 60, 255}
@@ -721,7 +721,7 @@ app_breaks_hud_draw :: (app: InnerBreeze*, hud_w: int, hud_h: int, row_h: int, p
if fraction > bar_w - 2 {
fraction = bar_w - 2
}
Box((Rectangle){(float)(bar_x), (float)(row_y + row_h - Scale(4)), (float)(bar_w), (float)(Scale(3))}, DarkenColor(GetThemeBackground(), 30), DarkenColor(GetThemeBackground(), 30))
Box((Rectangle){(float)(bar_x), (float)(row_y + row_h - Scale(4)), (float)(bar_w), (float)(Scale(3))}, DarkenColor(StyleTokenColor("canvas"), 30), DarkenColor(StyleTokenColor("canvas"), 30))
if fraction > 0 {
Box((Rectangle){(float)(bar_x + 1), (float)(row_y + row_h - Scale(4)), (float)(fraction), (float)(Scale(3))}, fill, fill)
}
@@ -744,7 +744,7 @@ app_breaks_hud_draw :: (app: InnerBreeze*, hud_w: int, hud_h: int, row_h: int, p
if fraction > bar_w - 2 {
fraction = bar_w - 2
}
Box((Rectangle){(float)(bar_x), (float)(row_y + row_h - Scale(4)), (float)(bar_w), (float)(Scale(3))}, DarkenColor(GetThemeBackground(), 30), DarkenColor(GetThemeBackground(), 30))
Box((Rectangle){(float)(bar_x), (float)(row_y + row_h - Scale(4)), (float)(bar_w), (float)(Scale(3))}, DarkenColor(StyleTokenColor("canvas"), 30), DarkenColor(StyleTokenColor("canvas"), 30))
if fraction > 0 {
Box((Rectangle){(float)(bar_x + 1), (float)(row_y + row_h - Scale(4)), (float)(fraction), (float)(Scale(3))}, next == 0 ? overdue : fill, next == 0 ? overdue : fill)
}
+2 -2
View File
@@ -3,7 +3,7 @@
#define APP_VERSION_MAJOR 2
#define APP_VERSION_MINOR 0
#define APP_VERSION_PATCH 2
#define APP_VERSION_STRING "2.0.2"
#define APP_VERSION_PATCH 4
#define APP_VERSION_STRING "2.0.4"
#endif
+1 -1
View File
@@ -1,4 +1,4 @@
#import "app.h"
#import "app/app.h"
#import "screens/habits_screen.h"
#import "screens/habits/habits.h"
#import "data.h"
+1 -1
View File
@@ -1,4 +1,4 @@
#import "app.h"
#import "app/app.h"
#import "screens/habits_screen.h"
#import "screens/habits/habits.h"
#import "data.h"
+16 -3
View File
@@ -1,5 +1,5 @@
#import "kryon.h"
#import "app.h"
#import "app/app.h"
host :: #import "platform/app_host"
tray :: #import "platform/tray"
@@ -52,7 +52,12 @@ run_screenshot_if_requested :: () -> int {
TraceLog(LOG_INFO, "APP: quit requested by shutdown signal")
quit = 1
}
if tray_action != tray.DESKTOP_TRAY_ACTION_NONE {
if (IsWindowHidden() || IsWindowMinimized()) &&
!tray.desktop_tray_ready() {
TraceLog(LOG_INFO, "APP: tray indicator unavailable; stopping background execution")
quit = 1
}
if !quit && tray_action != tray.DESKTOP_TRAY_ACTION_NONE {
tray.desktop_tray_apply_action(&app, tray_action, &quit)
}
if close_requested != 0 && !app.close_prompt_open {
@@ -67,7 +72,9 @@ run_screenshot_if_requested :: () -> int {
close_result = app_consume_close_prompt_result(&app)
if close_result == AppClosePromptKeepRunning {
tray.desktop_tray_keep_running()
if !tray.desktop_tray_keep_running() {
quit = 1
}
} else if close_result == AppClosePromptQuit {
TraceLog(LOG_INFO, "APP: quit requested by close prompt")
quit = 1
@@ -97,6 +104,12 @@ run_screenshot_if_requested :: () -> int {
quit := 0
while !host.ShutdownRequested() && !quit {
#if #defined(PLATFORM_DESKTOP) {
if IsWindowHidden() || IsWindowMinimized() {
TraceLog(LOG_INFO, "APP: no tray indicator; stopping background execution")
break
}
}
host.DrawFrame(&app)
if WindowShouldClose() || StealCoreWindowClose() ||
host.ShutdownRequested() || app.request_quit {
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef APP_ANDROID_DEVICE_H
#define APP_ANDROID_DEVICE_H
#include "app.h"
#include "app/app.h"
#if ANDROID_BUILD
#include <jni.h>
#else
+1 -1
View File
@@ -3,7 +3,7 @@
ANDROID :: ANDROID_BUILD
#if ANDROID {
#import "app.h"
#import "app/app.h"
#import "platform/android/android_jni"
#import "data.h"
#import "storage.h"
+20 -120
View File
@@ -2,21 +2,12 @@
#include "android_import.h"
#include "android_device.h"
#include "android_runtime_assets.h"
#include "android_timer.h"
#include "android_wakelock.h"
#include "app.h"
#include "core/breath_engine.h"
#include <stdio.h>
#include "platform/android/android_lifecycle.h"
#include "kryon.h"
#include "breaks/app_breaks.h"
#include "practices/practice_registry.h"
#include <pthread.h>
#include <jni.h>
#include <android/log.h>
extern InnerBreeze* get_global_app(void);
extern void app_request_graphics_reload(InnerBreeze*app);
#define LOG_TAG "APP_INSETS"
@@ -26,9 +17,6 @@ extern void app_request_graphics_reload(InnerBreeze*app);
extern void android_wakelock_set_activity(JNIEnv *env, jobject activity);
extern void android_wakelock_set_jvm(JavaVM *vm);
extern void android_timer_activate(void);
extern void android_timer_deactivate(void);
static void android_wakelock_set_activity_impl(JNIEnv *env, jobject thiz) {
android_wakelock_set_activity(env, thiz);
}
@@ -63,67 +51,12 @@ static void nativeSetDeviceDensity(JNIEnv *env, jobject thiz, jfloat density)
SetDeviceDensity(density);
}
static jint nativeGetPlayInBackground(JNIEnv *env, jobject thiz)
static jint nativeSyncLifecycleState(JNIEnv *env, jobject thiz,
jboolean paused, jboolean indicator_visible)
{
void *app = get_global_app();
if(app == NULL)
return 0;
return get_play_in_background(&((InnerBreeze*)app)->breathing);
}
static void nativeSetBackgroundActive(JNIEnv *env, jobject thiz, jboolean active)
{
(void)env;
(void)thiz;
InnerBreeze *app = (InnerBreeze*)get_global_app();
if (active) {
if (app != NULL) {
app->backgrounded = 1;
}
android_timer_activate();
} else {
android_timer_deactivate();
if (app != NULL) {
app->backgrounded = 0;
}
}
}
static jint nativePauseSession(JNIEnv *env, jobject thiz)
{
(void)env;
(void)thiz;
InnerBreeze*app = get_global_app();
if (app == NULL) {
__android_log_write(ANDROID_LOG_ERROR, "APP_JNI", "nativePauseSession: app is NULL!");
return 0;
}
if (app->session_paused)
return 0;
app->session_paused = 1;
app->backgrounded = 1;
return 1;
}
static void nativeResumeSession(JNIEnv *env, jobject thiz)
{
(void)env;
(void)thiz;
InnerBreeze*app = get_global_app();
if (app == NULL) {
__android_log_write(ANDROID_LOG_ERROR, "APP_JNI", "nativeResumeSession: app is NULL!");
return;
}
if (!app->session_paused)
return;
app->session_paused = 0;
app->backgrounded = 0;
(void)env;
(void)thiz;
return android_sync_lifecycle(paused != 0, indicator_visible != 0);
}
static void nativeInvalidateGraphicsResources(JNIEnv *env, jobject thiz)
@@ -131,9 +64,7 @@ static void nativeInvalidateGraphicsResources(JNIEnv *env, jobject thiz)
(void)env;
(void)thiz;
InnerBreeze*app = get_global_app();
if(app != NULL)
app_request_graphics_reload(app);
android_invalidate_graphics_resources();
}
/* Widget / quick-settings tile / launcher shortcut entry point. Runs on
@@ -142,19 +73,16 @@ static void nativeInvalidateGraphicsResources(JNIEnv *env, jobject thiz)
* by the practice (same semantics as the desktop break-window chips). */
static jboolean nativeStartPractice(JNIEnv *env, jobject thiz, jint practice_id)
{
InnerBreeze*app = get_global_app();
int selected_practice;
(void)env;
(void)thiz;
if(app == NULL)
return JNI_FALSE;
pthread_mutex_lock(&insets_mutex);
pending_practice_start = practice_id >= 0
? practice_clamp_id(practice_id)
: practice_clamp_id(app->exercise_type);
selected_practice = android_practice_to_start(practice_id);
if(selected_practice >= 0)
pending_practice_start = selected_practice;
pthread_mutex_unlock(&insets_mutex);
return JNI_TRUE;
return selected_practice >= 0 ? JNI_TRUE : JNI_FALSE;
}
int android_take_pending_practice_start(void)
@@ -183,58 +111,32 @@ static jboolean
nativeDebugImportMusicForPractice(JNIEnv *env, jobject thiz, jstring path,
jint practice_id)
{
InnerBreeze*app = get_global_app();
const char *native_path;
int error_code = AUDIO_IMPORT_ERROR_UNKNOWN;
int track;
int imported;
(void)thiz;
if(app == NULL || path == NULL)
if(path == NULL)
return JNI_FALSE;
native_path = (*env)->GetStringUTFChars(env, path, NULL);
if(native_path == NULL)
return JNI_FALSE;
app_audio_ensure_ready(app);
if(!app_audio_import_custom_music_ex(app, native_path, &error_code)) {
TraceLog(LOG_ERROR, "ANDROID_DEBUG_MUSIC: import failed error=%d path=%s",
error_code, native_path);
(*env)->ReleaseStringUTFChars(env, path, native_path);
return JNI_FALSE;
}
imported = android_debug_import_music_for_practice(native_path, practice_id);
(*env)->ReleaseStringUTFChars(env, path, native_path);
practice_id = practice_clamp_id(practice_id);
track = AUDIO_BUILTIN_MUSIC_COUNT + app->audio_custom_music_count - 1;
app->meditation.music_practice_tracks[practice_id] = track;
app->meditation.music_track = track;
app_audio_music_sanitize_selection(app);
app->sound_volume = 0;
app->music_volume = 100;
save_settings(app);
TraceLog(LOG_INFO,
"ANDROID_DEBUG_MUSIC: imported and selected track=%d practice=%d path=%s",
track, (int)practice_id, app->audio_custom_music[track - AUDIO_BUILTIN_MUSIC_COUNT].path);
return JNI_TRUE;
return imported ? JNI_TRUE : JNI_FALSE;
}
static jboolean nativeDebugStartMusicDownload(JNIEnv *env, jobject thiz)
{
InnerBreeze*app = get_global_app();
(void)env;
(void)thiz;
if(app == NULL)
return JNI_FALSE;
meditation_music_start_download(app);
return JNI_TRUE;
return android_debug_start_music_download() ? JNI_TRUE : JNI_FALSE;
}
static jboolean nativeDebugOpenDonationReminder(JNIEnv *env, jobject thiz)
{
InnerBreeze*app = get_global_app();
(void)env;
(void)thiz;
if(app == NULL)
if(!android_can_open_donation_reminder())
return JNI_FALSE;
pthread_mutex_lock(&insets_mutex);
pending_donation_reminder = 1;
@@ -246,10 +148,7 @@ static const JNINativeMethod g_methods[] = {
{"nativeSetInsets", "(IIIIIIIII)V", (void*)nativeSetInsets},
{"nativeSetDeviceDensity", "(F)V", (void*)nativeSetDeviceDensity},
{"nativeWakeLockReady", "()V", (void*)android_wakelock_set_activity_impl},
{"nativeSetBackgroundActive", "(Z)V", (void*)nativeSetBackgroundActive},
{"nativeGetPlayInBackground", "()I", (void*)nativeGetPlayInBackground},
{"nativePauseSession", "()I", (void*)nativePauseSession},
{"nativeResumeSession", "()V", (void*)nativeResumeSession},
{"nativeSyncLifecycleState", "(ZZ)I", (void*)nativeSyncLifecycleState},
{"nativeSetSystemDark", "(I)V", (void*)android_device_native_set_system_dark},
{"nativeSetOrientation", "(I)V", (void*)android_device_native_set_orientation},
{"nativeImportSelectedFile", "(ILjava/lang/String;)V", (void*)android_import_native_selected},
@@ -296,6 +195,7 @@ JNIEXPORT jint JNI_OnLoad(JavaVM *vm, void *reserved)
}
void android_insets_init(void) {
android_lifecycle_reset();
pthread_mutex_lock(&insets_mutex);
pending_practice_start = -1;
pending_donation_reminder = 0;
+154
View File
@@ -0,0 +1,154 @@
#module "platform.android.lifecycle"
#if ANDROID_BUILD {
#import "app/app.h"
#import "platform/android/android_timer.h"
#import "practices/practice_registry.h"
#import "practices/meditation/meditation_practice.h"
static background_execution_active: int
static auto_paused_for_lifecycle: int
android_lifecycle_reset :: () #export {
background_execution_active = 0
auto_paused_for_lifecycle = 0
}
android_play_in_background :: () -> int #private {
app := get_global_app()
if app == nil {
return 0
}
return get_play_in_background(&app->breathing)
}
android_set_background_active :: (active: int) #private {
app := get_global_app()
if active != 0 {
if app != nil {
app->backgrounded = 1
}
android_timer_activate()
} else {
android_timer_deactivate()
if app != nil {
app->backgrounded = 0
}
}
}
android_pause_session :: () -> int #private {
app := get_global_app()
if app == nil {
TraceLog(LOG_ERROR, "APP_JNI: nativePauseSession: app is nil")
return 0
}
if app->session_paused {
return 0
}
app->session_paused = 1
app->backgrounded = 1
return 1
}
android_resume_session :: () #private {
app := get_global_app()
if app == nil {
TraceLog(LOG_ERROR, "APP_JNI: nativeResumeSession: app is nil")
return
}
if !app->session_paused {
return
}
app->session_paused = 0
app->backgrounded = 0
}
android_sync_lifecycle :: (activity_paused: int,
indicator_visible: int) -> int #export {
run_in_background := 0
if android_play_in_background() != 0 &&
activity_paused != 0 && indicator_visible != 0 {
run_in_background = 1
}
pause_for_lifecycle := activity_paused != 0 && run_in_background == 0
if background_execution_active != run_in_background {
android_set_background_active(run_in_background)
background_execution_active = run_in_background
}
if pause_for_lifecycle && !auto_paused_for_lifecycle {
auto_paused_for_lifecycle = android_pause_session()
} else if !pause_for_lifecycle && auto_paused_for_lifecycle {
android_resume_session()
auto_paused_for_lifecycle = 0
}
return background_execution_active
}
android_invalidate_graphics_resources :: () #export {
app := get_global_app()
if app != nil {
app_request_graphics_reload(app)
}
}
android_practice_to_start :: (practice_id: int) -> int #export {
app := get_global_app()
if app == nil {
return -1
}
if practice_id < 0 {
practice_id = app->exercise_type
}
return practice_clamp_id(practice_id)
}
android_debug_import_music_for_practice :: (path: const char*,
practice_id: int) -> int #export {
app := get_global_app()
if app == nil || path == nil {
return 0
}
error_code := AUDIO_IMPORT_ERROR_UNKNOWN
app_audio_ensure_ready(app)
if !app_audio_import_custom_music_ex(app, path, &error_code) {
TraceLog(LOG_ERROR,
"ANDROID_DEBUG_MUSIC: import failed error=%d path=%s",
error_code, path)
return 0
}
practice_id = practice_clamp_id(practice_id)
track := AUDIO_BUILTIN_MUSIC_COUNT + app->audio_custom_music_count - 1
app->meditation.music_practice_tracks[practice_id] = track
app->meditation.music_track = track
app_audio_music_sanitize_selection(app)
app->sound_volume = 0
app->music_volume = 100
save_settings(app)
TraceLog(LOG_INFO,
"ANDROID_DEBUG_MUSIC: imported and selected track=%d practice=%d path=%s",
track, practice_id,
app->audio_custom_music[track - AUDIO_BUILTIN_MUSIC_COUNT].path)
return 1
}
android_debug_start_music_download :: () -> int #export {
app := get_global_app()
if app == nil {
return 0
}
meditation_music_start_download(app)
return 1
}
android_can_open_donation_reminder :: () -> int #export {
if get_global_app() == nil {
return 0
}
return 1
}
}
+1 -1
View File
@@ -3,7 +3,7 @@
ANDROID :: ANDROID_BUILD
#if ANDROID {
#import "app.h"
#import "app/app.h"
#import "platform/android/android_jni"
#import "kryon.h" #private
#import <android/log.h>
+8 -6
View File
@@ -53,7 +53,7 @@ android_share_helper_class(JNIEnv *env, jobject activity)
int
android_share_bytes(const unsigned char *data, size_t data_size, const char *filename,
const char *mime_type)
const char *mime_type, const char *title)
{
struct android_app *app = GetAndroidApp();
ANativeActivity *native_activity;
@@ -91,7 +91,7 @@ android_share_bytes(const unsigned char *data, size_t data_size, const char *fil
(*env)->SetByteArrayRegion(env, jarr, 0, data_size, (const jbyte *)data);
jname = (*env)->NewStringUTF(env, filename);
jmime = (*env)->NewStringUTF(env, mime_type != NULL ? mime_type : "application/octet-stream");
jtitle = (*env)->NewStringUTF(env, GetLocaleText("share_sheet_title"));
jtitle = (*env)->NewStringUTF(env, title != NULL ? title : "");
(*env)->CallStaticVoidMethod(env, share_helper_class, method, native_activity->clazz,
jarr, jname, jmime, jtitle);
@@ -103,7 +103,7 @@ android_share_bytes(const unsigned char *data, size_t data_size, const char *fil
return 1;
}
int android_share_export(const char *filename)
int android_share_export(const char *filename, const char *title)
{
struct android_app *app;
char export_path[FS_PATH_MAX];
@@ -233,7 +233,7 @@ int android_share_export(const char *filename)
(*env)->SetByteArrayRegion(env, jarr, 0, zip_size, (jbyte*)zip_data);
jstring jname = (*env)->NewStringUTF(env, filename);
jstring jtitle = (*env)->NewStringUTF(env, GetLocaleText("share_sheet_title"));
jstring jtitle = (*env)->NewStringUTF(env, title != NULL ? title : "");
(*env)->CallStaticVoidMethod(env, share_helper_class, method, native_activity->clazz, jarr, jname, jtitle);
(*env)->DeleteLocalRef(env, jarr);
@@ -248,16 +248,18 @@ int android_share_export(const char *filename)
}
#else
int android_share_export(const char *filename) {
int android_share_export(const char *filename, const char *title) {
(void)filename;
(void)title;
return 0;
}
int android_share_bytes(const unsigned char *data, size_t data_size, const char *filename,
const char *mime_type) {
const char *mime_type, const char *title) {
(void)data;
(void)data_size;
(void)filename;
(void)mime_type;
(void)title;
return 0;
}
#endif
+2 -2
View File
@@ -5,8 +5,8 @@
/* Export data using Android share sheet
* Returns: 1 on success (share sheet shown), 0 on failure */
int android_share_export(const char *filename);
int android_share_export(const char *filename, const char *title);
int android_share_bytes(const unsigned char *data, size_t data_size, const char *filename,
const char *mime_type);
const char *mime_type, const char *title);
#endif
+1 -1
View File
@@ -2,7 +2,7 @@ ANDROID :: ANDROID_BUILD
#if ANDROID {
#import "platform/android/android_timer.h"
#import "app.h" #private
#import "app/app.h" #private
#import "practices/practice_registry.h" #private
#import "kryon.h" #private
#import <time.h>
+211 -16
View File
@@ -1,24 +1,92 @@
#module "platform.app_host"
#import "app.h"
#import "app/app.h"
#import "app/screenshots.h"
#import "breaks/app_breaks.h"
#import "desktop.h"
#import "platform/app_desktop_tray.h"
#import <stdio.h>
#import <stdlib.h>
#import <string.h>
#if ANDROID_BUILD {
#import "platform/android/android_insets.h"
}
WindowSize :: struct {
width: int
height: int
}
native_prepare :: (argc: int, argv: char**) #extern #private
native_window_size :: (window_width: int*, window_height: int*) #extern #private
native_configure_window :: () #extern #private
#if !ANDROID_BUILD && !#defined(PLATFORM_WEB) {
DesktopIdentity :: () -> DesktopAppInfo #export {
override_root := getenv("APP_DATA_ROOT")
if override_root != nil && override_root[0] != '\0' {
return (DesktopAppInfo){
.app_id = "xyz.waozi.inbe.debug",
.name = "inbe-debug",
.display_name = "Inner Breeze (Debug)",
.summary = "Syncable breathing, meditation, and habit practice app.",
.icon_name = "xyz.waozi.inbe.debug",
.wm_class = "xyz.waozi.inbe.debug",
.single_instance = 0
}
}
return (DesktopAppInfo){
.app_id = "xyz.waozi.inbe",
.name = "inbe",
.display_name = "Inner Breeze",
.summary = "Syncable breathing, meditation, and habit practice app.",
.icon_name = "xyz.waozi.inbe",
.wm_class = "xyz.waozi.inbe",
.single_instance = 0
}
}
}
native_limit_allocators :: () #extern #private
native_screenshot_data_root :: () #extern #private
native_install_trace_log_filter :: () #extern #private
native_init_desktop_identity :: () #extern #private
native_window_environment :: () #extern #private
native_before_window :: () #extern #private
native_after_window :: () -> int #extern #private
native_screenshot_active :: () -> int #extern #private
native_run_screenshot :: (app: InnerBreeze*) -> int #extern #private
native_after_window :: (icon_path: const char*) -> int #extern #private
native_platform_shutdown :: () #extern #private
native_update_apply_at_exit :: () -> int #extern #private
app_frame :: (app: InnerBreeze*) #extern #private
native_frame_diagnostics :: () #extern #private
#if #defined(_WIN32) && !ANDROID_BUILD {
WindowsStartupErrorMessage :: (detail: const char*,
output: char*, capacity: size_t) #export {
if output == nil || capacity == 0 {
return
}
actual_detail := detail
if actual_detail == nil || actual_detail[0] == '\0' {
actual_detail = "No detailed startup error was reported."
}
hint: const char* = ""
if strstr(actual_detail, "OpenGL") != nil ||
strstr(actual_detail, "WGL") != nil ||
strstr(actual_detail, "GLFW") != nil {
hint = "\nThis is usually a graphics driver or virtual GPU problem. "
"Update the GPU driver, enable VM 3D acceleration, or install the VM guest graphics driver.\n"
}
snprintf(output, capacity,
"Inner Breeze could not create a window.\n\n%s%s\nA full log was written to inbe.log next to the executable.",
actual_detail, hint)
}
}
#if ANDROID_BUILD {
native_android_frame_viewport :: (viewport: AndroidViewport*) -> int #extern #private
}
#if !ANDROID_BUILD && !#defined(PLATFORM_WEB) {
native_screenshot_arm_readback :: () #extern #private
kry_write_png_file :: (path: const char*, rgba: const u8*,
width: int, height: int) -> int #extern #private
}
#if #defined(PLATFORM_WEB) {
native_start_web_loop :: (app: InnerBreeze*) #extern #private
@@ -28,22 +96,72 @@ app_frame :: (app: InnerBreeze*) #extern #private
}
Prepare :: (argc: int, argv: char**) {
native_prepare(argc, argv)
native_limit_allocators()
screenshot := current_screenshot_request()
parse_screenshot_args(argc, argv, screenshot)
if screenshot->active {
native_screenshot_data_root()
}
native_install_trace_log_filter()
if getenv("APP_NO_SINGLE_INSTANCE") != nil || screenshot->active {
SetSingleInstance(0)
}
if !screenshot->active {
# A separate data root identifies a debug desktop profile.
#if !ANDROID_BUILD && !#defined(PLATFORM_WEB) {
override_root := getenv("APP_DATA_ROOT")
if override_root != nil && override_root[0] != '\0' {
identity := DesktopIdentity()
snprintf(config.title, sizeof(config.title), "%s",
identity.display_name)
config.title_custom = 1
}
}
native_init_desktop_identity()
} else {
SetTraceLogLevel(LOG_WARNING)
config.width = screenshot->width
config.height = screenshot->height
}
}
InitialWindowSize :: () -> WindowSize {
size := (WindowSize){0}
native_window_size(&size.width, &size.height)
size := (WindowSize){config.width, config.height}
#if ANDROID_BUILD {
size.width = 0
size.height = 0
}
#if #defined(PLATFORM_WEB) {
GetWebViewportSize(config.width, config.height,
&size.width, &size.height)
config.width = size.width
config.height = size.height
}
return size
}
ConfigureWindow :: () {
native_configure_window()
native_window_environment()
#if #defined(PLATFORM_WEB) {
SetConfigFlags(GetWebWindowFlags())
} #else {
#if !ANDROID_BUILD {
SetConfigFlags(FLAG_WINDOW_RESIZABLE | FLAG_WINDOW_ALWAYS_RUN)
}
}
native_before_window()
}
FinishWindowSetup :: () -> int {
return native_after_window()
if !native_after_window("assets/app/icon.png") {
return 0
}
#if !ANDROID_BUILD && !#defined(PLATFORM_WEB) {
# ESC belongs to Inbe's screen and close-prompt handling.
SetExitKey(0)
}
InitDPI()
return 1
}
FinishAppSetup :: (app: InnerBreeze*, argc: int, argv: char**) {
@@ -54,12 +172,89 @@ DrawFrame :: (app: InnerBreeze*) {
app_frame(app)
}
app_frame :: (app: InnerBreeze*) #export {
#if #defined(PLATFORM_WEB) {
SyncWebWindowSize()
}
native_frame_diagnostics()
width := GetScreenWidth()
height := GetScreenHeight()
#if !ANDROID_BUILD && !#defined(PLATFORM_WEB) {
render_width := GetRenderWidth()
render_height := GetRenderHeight()
if render_width > width {
width = render_width
}
if render_height > height {
height = render_height
}
}
#if ANDROID_BUILD {
viewport: AndroidViewport
if !native_android_frame_viewport(&viewport) {
return
}
GetAndroidSurfaceSize(&width, &height)
BeginDrawing()
ClearBackground((Color){0, 0, 0, 255})
BeginClip(viewport.x, viewport.y, viewport.width, viewport.height)
app_update_draw(app, (Rectangle){(float)viewport.x, (float)viewport.y,
(float)viewport.width, (float)viewport.height})
EndClip()
} #else {
BeginDrawing()
ClearBackground(StyleTokenColor("canvas"))
app_update_draw(app, (Rectangle){0, 0, (float)width, (float)height})
}
EndDrawing()
app_breaks_hud_update(app)
app_breaks_window_update(app)
}
ScreenshotRequested :: () -> int {
return native_screenshot_active()
return current_screenshot_request()->active
}
CaptureScreenshot :: (app: InnerBreeze*) -> int {
return native_run_screenshot(app)
#if #defined(PLATFORM_WEB) || ANDROID_BUILD {
unused app
return 0
} #else {
request := current_screenshot_request()
if request == nil || !request->active {
return 0
}
# The renderer reads pixels before swap when screenshot mode arms it.
native_screenshot_arm_readback()
setup_screenshot_scene(app, request)
warmup_frames := screenshot_warmup_frames(request)
for int frame = 0; frame < warmup_frames; frame++ {
app_frame(app)
}
screenshot_after_warmup(app, request)
# External capture on GL stacks where the direct readback is blank.
if getenv("APP_SHOT_WINDOW") != nil {
while 1 {
app_frame(app)
}
}
capture: Image = LoadImageFromScreen()
if capture.data == nil {
TraceLog(LOG_ERROR, "APP: screenshot readback failed")
return -1
}
saved := kry_write_png_file(request->output,
(const u8*)capture.data,
capture.width, capture.height) == 0
UnloadImage(capture)
return saved ? 1 : -1
}
}
ShouldStartHidden :: (app: InnerBreeze*) -> int {
@@ -119,7 +314,7 @@ native_should_start_hidden :: (app: InnerBreeze*) -> int #export {
#if #defined(DESKTOP_TRAY_ENABLED) {
return app != nil &&
app->desktop_startup_mode == STARTUP_HIDDEN &&
!native_screenshot_active() &&
!ScreenshotRequested() &&
desktop_tray_ready()
} #else {
unused app
+69 -268
View File
@@ -2,8 +2,8 @@
#if !defined(PLATFORM_WEB) && !defined(_WIN32) && !ANDROID_BUILD && defined(NATIVE_WINDOW_HAVE_SDL)
#include <SDL2/SDL.h>
#endif
#include "app.h"
#include "breaks/app_breaks.h"
#include "app/app.h"
#include "platform/app_host.h"
#include "desktop.h"
#include "storage.h"
#include "sync_account.h"
@@ -19,14 +19,6 @@
#include <string.h>
#include <time.h>
#if !defined(PLATFORM_WEB) && !ANDROID_BUILD
/* From kryon's screenshot backend (src/backend/kry_screenshot.c): the PNG
* writer that works on this GL stack, where raylib's ExportImage does not
* honor the passed image. */
int kry_write_png_file(const char *path, const unsigned char *rgba,
int w, int h);
#endif
#if defined(__GLIBC__)
#include <malloc.h>
#endif
@@ -77,42 +69,19 @@ extern struct android_app *GetAndroidApp(void);
#endif
#if !defined(PLATFORM_WEB) && !ANDROID_BUILD
static const char *DESKTOP_APP_ID = "xyz.waozi.inbe";
static const char *DESKTOP_APP_NAME = "inbe";
static const char *DESKTOP_DISPLAY_NAME = "Inner Breeze";
static const char *DEBUG_DESKTOP_APP_ID = "xyz.waozi.inbe.debug";
static const char *DEBUG_DESKTOP_APP_NAME = "inbe-debug";
static const char *DEBUG_DESKTOP_DISPLAY_NAME = "Inner Breeze (Debug)";
static const char *DESKTOP_SUMMARY =
"Syncable breathing, meditation, and habit practice app.";
static void
init_desktop_identity(void)
{
const char *override_root = getenv("APP_DATA_ROOT");
int debug_profile = override_root != NULL && override_root[0] != '\0';
const char *app_id = debug_profile ? DEBUG_DESKTOP_APP_ID : DESKTOP_APP_ID;
const char *app_name = debug_profile ? DEBUG_DESKTOP_APP_NAME : DESKTOP_APP_NAME;
const char *display_name = debug_profile ? DEBUG_DESKTOP_DISPLAY_NAME : DESKTOP_DISPLAY_NAME;
DesktopAppInfo info = {
app_id,
app_name,
display_name,
DESKTOP_SUMMARY,
app_id,
app_id,
0
};
DesktopAppInfo info = DesktopIdentity();
InitDesktopApp(&info);
#if defined(_WIN32)
_putenv(debug_profile ? "SDL_APP_NAME=Inner Breeze (Debug)" :
"SDL_APP_NAME=Inner Breeze");
_putenv_s("SDL_APP_NAME", info.display_name);
#else
setenv("SDL_APP_NAME", display_name, 1);
setenv("SDL_VIDEO_X11_WMCLASS", app_id, 1);
setenv("SDL_VIDEO_WAYLAND_WMCLASS", app_id, 1);
setenv("SDL_VIDEO_WAYLAND_APP_ID", app_id, 1);
setenv("SDL_APP_NAME", info.display_name, 1);
setenv("SDL_VIDEO_X11_WMCLASS", info.app_id, 1);
setenv("SDL_VIDEO_WAYLAND_WMCLASS", info.app_id, 1);
setenv("SDL_VIDEO_WAYLAND_APP_ID", info.app_id, 1);
#endif
}
#else
@@ -123,19 +92,29 @@ init_desktop_identity(void)
#endif
static void
set_desktop_window_icon(void)
set_desktop_window_icon(const char *path)
{
(void)path;
#if !ANDROID_BUILD && !defined(PLATFORM_WEB)
#if defined(_WIN32)
{
HWND window=(HWND)GetWindowHandle(); HMODULE instance=GetModuleHandleW(NULL);
LPCWSTR resource=(LPCWSTR)(uintptr_t)APP_ICON_RESOURCE;
HICON large=(HICON)LoadImageW(instance,resource,APP_IMAGE_ICON,GetSystemMetrics(SM_CXICON),GetSystemMetrics(SM_CYICON),0);
HICON small=(HICON)LoadImageW(instance,resource,APP_IMAGE_ICON,GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),0);
if(window){if(large)SendMessageW(window,APP_WM_SETICON,ICON_BIG,(LPARAM)large);if(small)SendMessageW(window,APP_WM_SETICON,ICON_SMALL,(LPARAM)small);}
HWND window = (HWND)GetWindowHandle();
HMODULE instance = GetModuleHandleW(NULL);
LPCWSTR resource = (LPCWSTR)(uintptr_t)APP_ICON_RESOURCE;
HICON large = (HICON)LoadImageW(instance, resource, APP_IMAGE_ICON,
GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON), 0);
HICON small = (HICON)LoadImageW(instance, resource, APP_IMAGE_ICON,
GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0);
if(window) {
if(large)
SendMessageW(window, APP_WM_SETICON, ICON_BIG, (LPARAM)large);
if(small)
SendMessageW(window, APP_WM_SETICON, ICON_SMALL, (LPARAM)small);
}
}
#endif
const char *path = "assets/app/icon.png";
if(path == NULL || path[0] == '\0')
return;
const EmbeddedAsset *asset = GetEmbeddedAsset(path);
Image icon;
@@ -234,35 +213,11 @@ handle_shutdown_signal(int signum)
}
#endif
#include "app/screenshots.h"
static ScreenshotRequest g_screenshot;
#if defined(_WIN32) && !ANDROID_BUILD
static FILE *win_log_file;
static char win_recent_errors[WIN_ERROR_LOG_CAP];
static int win_recent_errors_len;
static int
windows_text_contains(const char *text, const char *needle)
{
if(text == NULL || needle == NULL || needle[0] == '\0')
return 0;
for(const char *p = text; *p != '\0'; p++) {
const char *a = p;
const char *b = needle;
while(*a != '\0' && *b != '\0' && *a == *b) {
a++;
b++;
}
if(*b == '\0')
return 1;
}
return 0;
}
static void
windows_remember_error(const char *level, const char *message)
{
@@ -320,24 +275,7 @@ static void
windows_show_startup_error(void)
{
char dialog[3072];
const char *detail = win_recent_errors[0] != '\0' ?
win_recent_errors :
"No detailed startup error was reported.";
const char *hint = "";
if(windows_text_contains(detail, "OpenGL") ||
windows_text_contains(detail, "WGL") ||
windows_text_contains(detail, "GLFW")) {
hint = "\nThis is usually a graphics driver or virtual GPU problem. "
"Update the GPU driver, enable VM 3D acceleration, or install the VM guest graphics driver.\n";
}
snprintf(dialog,
sizeof(dialog),
"Inner Breeze could not create a window.\n\n%s%s\nA full log was written to inbe.log next to the executable.",
detail,
hint);
WindowsStartupErrorMessage(win_recent_errors, dialog, sizeof(dialog));
MessageBoxA(NULL, dialog, "Inner Breeze", MB_OK | MB_ICONERROR);
}
@@ -388,25 +326,9 @@ android_log_viewport_if_changed(int width, int height, AndroidViewport viewport)
}
#endif
static void
draw_full_frame(InnerBreeze*app, int width, int height)
{
BeginDrawing();
ClearBackground(GetThemeBackground());
app_update_draw(app, (Rectangle){
0,
0,
(float)width,
(float)height
});
}
void
app_frame(InnerBreeze*app)
native_frame_diagnostics(void)
{
#if defined(PLATFORM_WEB)
SyncWebWindowSize();
#endif
#if !defined(PLATFORM_WEB) && !ANDROID_BUILD
/* Memory snapshots at two steady-state points when diagnostics are on. */
static int mem_debug_frame_count = 0;
@@ -417,47 +339,21 @@ app_frame(InnerBreeze*app)
}
mem_debug_frame_count++;
#endif
int width = GetScreenWidth();
int height = GetScreenHeight();
#if !ANDROID_BUILD && !defined(PLATFORM_WEB)
int render_width = GetRenderWidth();
int render_height = GetRenderHeight();
if(render_width > width)
width = render_width;
if(render_height > height)
height = render_height;
#endif
}
#if ANDROID_BUILD
AndroidViewport viewport;
if(!SyncAndroidViewport(&viewport)) {
return;
}
int
native_android_frame_viewport(AndroidViewport *viewport)
{
int width;
int height;
if(!SyncAndroidViewport(viewport))
return 0;
GetAndroidSurfaceSize(&width, &height);
android_log_viewport_if_changed(width, height, viewport);
BeginDrawing();
ClearBackground(BLACK);
BeginClip(viewport.x, viewport.y, viewport.width, viewport.height);
app_update_draw(app, (Rectangle){
(float)viewport.x,
(float)viewport.y,
(float)viewport.width,
(float)viewport.height
});
EndClip();
#elif defined(PLATFORM_WEB)
draw_full_frame(app, width, height);
#else
draw_full_frame(app, width, height);
#endif
EndDrawing();
app_breaks_hud_update(app);
app_breaks_window_update(app);
android_log_viewport_if_changed(width, height, *viewport);
return 1;
}
#endif
#if defined(PLATFORM_WEB)
static void
@@ -468,128 +364,60 @@ web_frame(void)
}
#endif
#if defined(PLATFORM_WEB) || ANDROID_BUILD
static int
run_screenshot_mode(InnerBreeze*app, const ScreenshotRequest *request)
#if !defined(PLATFORM_WEB) && !ANDROID_BUILD
void
native_screenshot_arm_readback(void)
{
(void)app;
(void)request;
return 0;
}
#else
static int
run_screenshot_mode(InnerBreeze*app, const ScreenshotRequest *request)
{
Image capture;
int warmup_frames = 4;
int saved;
if(request == NULL || !request->active)
return 0;
/* LoadImageFromScreen only returns a frame while kryon's EndDrawing is
* armed for the pre-swap readback; screenshot mode arms it itself so no
* wrapper script has to. */
#if defined(_WIN32)
_putenv("KRYON_SHOT_ARM=1");
#else
setenv("KRYON_SHOT_ARM", "1", 1);
#endif
setup_screenshot_scene(app, request);
if(strcmp(request->scene, "tutorial_whm_step2") == 0)
warmup_frames = 150;
for(int i = 0; i < warmup_frames; i++)
app_frame(app);
if(strcmp(request->scene, "tutorial_whm_step2") == 0) {
app->tutorial_step = 2;
} else if(strcmp(request->scene, "tutorial_whm_step0") == 0) {
app->tutorial_step = 0;
} else if(strcmp(request->scene, "tutorial_meditation") == 0) {
app->tutorial_step = 0;
}
if(getenv("APP_SHOT_WINDOW") != NULL) {
/* Fallback for GL stacks where LoadImageFromScreen reads blank:
* hold the warmed-up scene on screen for external capture. */
for(;;)
app_frame(app);
}
capture = LoadImageFromScreen();
if(capture.data == NULL)
return 1;
/* raylib's ExportImage does not honor the passed image on this GL
* stack; kryon's own writer is the working path. */
saved = kry_write_png_file(request->output, capture.data,
capture.width, capture.height) == 0;
UnloadImage(capture);
return saved ? 1 : -1;
}
#endif
void
native_prepare(int argc, char **argv)
native_limit_allocators(void)
{
char screenshot_data_root[256] = {0};
#if defined(__GLIBC__)
/* Cap glibc's per-thread malloc arenas. The app runs ~19 threads (audio,
* tray, sync, SDL) and the default arena ceiling (8 per core) lets each
* grow its own heap, inflating idle RSS. Four arenas are plenty here. */
mallopt(M_ARENA_MAX, 4);
#endif
parse_screenshot_args(argc, argv, &g_screenshot);
if(g_screenshot.active) {
#if defined(_WIN32)
snprintf(screenshot_data_root, sizeof(screenshot_data_root),
"build/screenshot-data-%ld", (long)_getpid());
_putenv_s("APP_DATA_ROOT", screenshot_data_root);
#elif !defined(PLATFORM_WEB) && !ANDROID_BUILD
snprintf(screenshot_data_root, sizeof(screenshot_data_root),
"/tmp/inbe-screenshot-%ld", (long)getpid());
setenv("APP_DATA_ROOT", screenshot_data_root, 1);
#endif
}
install_trace_log_filter();
if(getenv("APP_NO_SINGLE_INSTANCE") != NULL || g_screenshot.active)
SetSingleInstance(0);
if(!g_screenshot.active) {
#if !defined(PLATFORM_WEB) && !ANDROID_BUILD
const char *override_root = getenv("APP_DATA_ROOT");
if(override_root != NULL && override_root[0] != '\0') {
snprintf(config.title, sizeof(config.title), "%s",
DEBUG_DESKTOP_DISPLAY_NAME);
config.title_custom = 1;
}
#endif
init_desktop_identity();
}
if(g_screenshot.active) {
SetTraceLogLevel(LOG_WARNING);
config.width = g_screenshot.width;
config.height = g_screenshot.height;
}
}
void
native_window_size(int *window_w, int *window_h)
native_screenshot_data_root(void)
{
int w = ANDROID_BUILD ? 0 : config.width;
int h = ANDROID_BUILD ? 0 : config.height;
#if defined(PLATFORM_WEB)
GetWebViewportSize(config.width, config.height, &w, &h);
config.width = w;
config.height = h;
#if defined(_WIN32) || (!defined(PLATFORM_WEB) && !ANDROID_BUILD)
char screenshot_data_root[256] = {0};
#endif
#if defined(_WIN32)
snprintf(screenshot_data_root, sizeof(screenshot_data_root),
"build/screenshot-data-%ld", (long)_getpid());
_putenv_s("APP_DATA_ROOT", screenshot_data_root);
#elif !defined(PLATFORM_WEB) && !ANDROID_BUILD
snprintf(screenshot_data_root, sizeof(screenshot_data_root),
"/tmp/inbe-screenshot-%ld", (long)getpid());
setenv("APP_DATA_ROOT", screenshot_data_root, 1);
#endif
if(window_w != NULL)
*window_w = w;
if(window_h != NULL)
*window_h = h;
}
void
native_configure_window(void)
native_install_trace_log_filter(void)
{
install_trace_log_filter();
}
void
native_init_desktop_identity(void)
{
init_desktop_identity();
}
void
native_window_environment(void)
{
#if ANDROID_BUILD
__android_log_write(ANDROID_LOG_INFO, "APP_MAIN", "=== MAIN START ===");
@@ -613,12 +441,6 @@ native_configure_window(void)
#endif
#endif
#if defined(PLATFORM_WEB)
SetConfigFlags(GetWebWindowFlags());
#elif !ANDROID_BUILD
SetConfigFlags(FLAG_WINDOW_RESIZABLE | FLAG_WINDOW_ALWAYS_RUN);
#endif
#if defined(_WIN32) && !ANDROID_BUILD
windows_install_logger();
TraceLog(LOG_INFO, "APP: Windows startup");
@@ -639,7 +461,7 @@ native_before_window(void)
}
int
native_after_window(void)
native_after_window(const char *icon_path)
{
if(!IsWindowReady()) {
TraceLog(LOG_ERROR, "APP: InitWindow failed");
@@ -656,14 +478,7 @@ native_after_window(void)
SDL_SetWindowGrab(SDL_GetWindowFromID(1), SDL_FALSE);
#endif
set_desktop_window_icon();
#if !defined(PLATFORM_WEB) && !ANDROID_BUILD
/* Disable raylib's built-in ESC-to-exit. We surface close requests through
* our own "keep running / quit?" prompt (see app_request_desktop_close),
* and ESC is already handled by individual screens via IsKeyPressed. */
SetExitKey(0);
#endif
InitDPI();
set_desktop_window_icon(icon_path);
return 1;
}
@@ -691,20 +506,6 @@ native_shutdown_requested(void)
}
#endif
int
native_screenshot_active(void)
{
return g_screenshot.active;
}
int
native_run_screenshot(InnerBreeze*app)
{
return run_screenshot_mode(app, &g_screenshot);
}
void
native_platform_shutdown(void)
{
+40
View File
@@ -0,0 +1,40 @@
#module "platform.plan9.app"
#import "kryon.h"
#import "app/app.h"
#if #defined(KRYON_PLATFORM_PLAN9) {
CreateApp :: (project_path: const char*) -> void* #extern
DestroyApp :: (app: void*) #extern
Plan9Run :: () -> const char* #export {
InitWindow(900, 720, "Inner Breeze")
if !IsWindowReady() {
return "window"
}
SetExitKey(0)
InitDPI()
SetTargetFPS(60)
app: InnerBreeze* = (InnerBreeze*)CreateApp("/sys/src/breathing")
if app == nil {
CloseWindow()
return "app"
}
while !WindowShouldClose() {
viewport := (Rectangle){0, 0,
(float)GetScreenWidth(),
(float)GetScreenHeight()}
BeginDrawing()
ClearBackground(StyleTokenColor("canvas"))
app_update_draw(app, viewport)
EndDrawing()
}
DestroyApp(app)
CloseWindow()
return nil
}
}
+9
View File
@@ -0,0 +1,9 @@
#include "kryon.h"
const char *Plan9Run(void);
void
main(void)
{
exits((char *)Plan9Run());
}
-42
View File
@@ -1,42 +0,0 @@
#include "kryon.h"
void *CreateApp(const char *project_path);
void DestroyApp(void *app);
void app_update_draw(void *app, Rectangle viewport);
void
main(void)
{
void *app;
Rectangle viewport;
InitWindow(900, 720, "Inner Breeze");
if(!IsWindowReady())
exits("window");
SetExitKey(0);
InitDPI();
SetTargetFPS(60);
app = CreateApp("/sys/src/breathing");
if(app == 0) {
CloseWindow();
exits("app");
}
while(!WindowShouldClose()) {
viewport.x = 0.0f;
viewport.y = 0.0f;
viewport.width = (float)GetScreenWidth();
viewport.height = (float)GetScreenHeight();
BeginDrawing();
ClearBackground(GetThemeBackground());
app_update_draw(app, viewport);
EndDrawing();
}
DestroyApp(app);
CloseWindow();
exits(nil);
}
+227
View File
@@ -0,0 +1,227 @@
#module "platform.plan9.meditation_music"
#import "app/app.h"
#import "practices/meditation/meditation_music.h"
#import "runtime_assets.h"
#import "storage.h"
#import <stdio.h>
#if #defined(KRYON_PLATFORM_PLAN9) {
plan9_music_set_status :: (app: InnerBreeze*,
message: const char*) #private {
if app == nil {
return
}
snprintf(app->meditation.music_status,
sizeof(app->meditation.music_status),
"%s", message != nil ? message : "")
}
plan9_music_track_available :: (app: InnerBreeze*,
track: int) -> int #private {
path: [FS_PATH_MAX] char
return app_audio_music_path(app, track, path, sizeof(path)) != 0 &&
app_audio_music_file_valid(path) != 0 ? 1 : 0
}
plan9_music_load_track :: (app: InnerBreeze*,
track: int) -> int #private {
path: [FS_PATH_MAX] char
if app == nil {
return 0
}
app_audio_ensure_ready(app)
if !app->audio_ready {
TraceLog(LOG_ERROR,
"AUDIO: Cannot load meditation music because audio device is not ready")
plan9_music_set_status(app,
GetLocaleText("meditation_music_device_not_ready"))
return 0
}
if track < 0 || track >= app_audio_music_count(app) {
track = 0
}
meditation_music_unload(app)
if !app_audio_music_path(app, track, path, sizeof(path)) ||
!app_audio_music_file_valid(path) {
plan9_music_set_status(app,
GetLocaleText("meditation_music_track_not_installed"))
return 0
}
app->meditation.music = LoadMusicStream(path)
if !IsMusicValid(app->meditation.music) {
TraceLog(LOG_ERROR, "AUDIO: Could not load meditation track: %s", path)
plan9_music_set_status(app,
GetLocaleText("meditation_music_track_load_failed"))
app->meditation.music_loaded = 0
return 0
}
app->meditation.music_loaded = 1
app->meditation.music_track = track
app->meditation.music_fade_out_ticks = 0
app->meditation.music_fade_out_total_ticks = 0
SetMusicVolume(app->meditation.music, (float)app->music_volume / 100.0f)
TraceLog(LOG_INFO, "AUDIO: Loaded meditation track: %s", path)
return 1
}
meditation_music_format_download_status :: (out: char*, out_size: size_t,
download: const RuntimeAssetDownload*) #export {
unused download
if out != nil && out_size > 0 {
out[0] = '\0'
}
}
meditation_music_draw_download_progress :: (app: InnerBreeze*,
x: int, y: int, w: int) #export {
unused app
unused x
unused y
unused w
}
meditation_music_available :: (app: InnerBreeze*) -> int #export {
if app == nil {
return 0
}
for int index = 0; index < MEDITATION_MUSIC_TRACK_COUNT; index++ {
if !plan9_music_track_available(app, index) {
return 0
}
}
return 1
}
meditation_music_selected_label :: (app: InnerBreeze*) -> const char* #export {
if app == nil {
return ""
}
track: int = app->meditation.music_track
if track < 0 || track >= app_audio_music_count(app) {
track = 0
}
return app_audio_music_label(app, track)
}
meditation_music_init :: (app: InnerBreeze*) #export {
if app == nil {
return
}
app_audio_music_sanitize_selection(app)
if app->meditation.music_status[0] == '\0' {
if meditation_music_available(app) {
plan9_music_set_status(app,
GetLocaleText("meditation_music_installed"))
} else {
plan9_music_set_status(app,
GetLocaleText("meditation_music_not_installed"))
}
}
}
meditation_music_unload :: (app: InnerBreeze*) #export {
if app == nil {
return
}
if app->meditation.music_loaded {
StopMusicStream(app->meditation.music)
UnloadMusicStream(app->meditation.music)
app->meditation.music_loaded = 0
}
app->meditation.music_playing = 0
app->meditation.music_test_playing = 0
app->meditation.music_fade_out_ticks = 0
app->meditation.music_fade_out_total_ticks = 0
}
meditation_music_stop :: (app: InnerBreeze*) #export {
if app == nil {
return
}
if app->meditation.music_loaded {
StopMusicStream(app->meditation.music)
}
app->meditation.music_playing = 0
app->meditation.music_test_playing = 0
app->meditation.music_fade_out_ticks = 0
app->meditation.music_fade_out_total_ticks = 0
}
meditation_music_fade_out :: (app: InnerBreeze*) #export {
if app == nil || !app->meditation.music_loaded ||
!app->meditation.music_playing ||
app->meditation.music_fade_out_ticks > 0 {
return
}
app->meditation.music_fade_out_ticks = 180
app->meditation.music_fade_out_total_ticks = 180
}
meditation_music_start_session :: (app: InnerBreeze*) #export {
if app == nil {
return
}
app_audio_music_sanitize_selection(app)
practice: int = app->exercise_type
if practice < 0 || practice >= EXERCISE_COUNT {
practice = EXERCISE_MEDITATION
}
track: int = app->meditation.music_practice_tracks[practice]
if track == AUDIO_MUSIC_NONE {
return
}
if !plan9_music_load_track(app, track) {
return
}
PlayMusicStream(app->meditation.music)
app->meditation.music_playing = 1
app->meditation.music_test_playing = 0
}
meditation_music_update :: (app: InnerBreeze*) #export {
if app == nil || !app->meditation.music_loaded {
return
}
volume: float = (float)app->music_volume / 100.0f
if app->meditation.music_fade_out_ticks > 0 &&
app->meditation.music_fade_out_total_ticks > 0 {
volume *= (float)app->meditation.music_fade_out_ticks /
(float)app->meditation.music_fade_out_total_ticks
app->meditation.music_fade_out_ticks--
if app->meditation.music_fade_out_ticks <= 0 {
meditation_music_stop(app)
return
}
}
SetMusicVolume(app->meditation.music, volume)
UpdateMusicStream(app->meditation.music)
}
meditation_music_start_download :: (app: InnerBreeze*) #export {
unused app
}
meditation_music_draw_practice_settings :: (app: InnerBreeze*,
practice: int, content_x: int, content_w: int, y: int*,
show_installed_download: int, show_status: int) #export {
unused app
unused practice
unused content_x
unused content_w
unused y
unused show_installed_download
unused show_status
}
meditation_music_measure_practice_settings :: (app: InnerBreeze*,
practice: int, content_w: int, show_installed_download: int,
show_status: int) -> int #export {
unused app
unused practice
unused content_w
unused show_installed_download
unused show_status
return 0
}
}
-240
View File
@@ -1,240 +0,0 @@
#include "src/practices/meditation/meditation_music.h"
static void
set_status(InnerBreeze*app, const char *message)
{
if(app == 0)
return;
snprintf(app->meditation.music_status,
sizeof(app->meditation.music_status),
"%s", message != 0 ? message : "");
}
static int
track_available(InnerBreeze*app, int track)
{
char path[FS_PATH_MAX];
return app_audio_music_path(app, track, path, sizeof(path)) &&
app_audio_music_file_valid(path);
}
static int
load_track(InnerBreeze*app, int track)
{
char path[FS_PATH_MAX];
if(app == 0)
return 0;
app_audio_ensure_ready(app);
if(!app->audio_ready) {
TraceLog(LOG_ERROR,
"AUDIO: Cannot load meditation music because audio device is not ready");
set_status(app, GetLocaleText("meditation_music_device_not_ready"));
return 0;
}
if(track < 0 || track >= app_audio_music_count(app))
track = 0;
meditation_music_unload(app);
if(!app_audio_music_path(app, track, path, sizeof(path)) ||
!app_audio_music_file_valid(path)) {
set_status(app, GetLocaleText("meditation_music_track_not_installed"));
return 0;
}
app->meditation.music = LoadMusicStream(path);
if(!IsMusicValid(app->meditation.music)) {
TraceLog(LOG_ERROR, "AUDIO: Could not load meditation track: %s", path);
set_status(app, GetLocaleText("meditation_music_track_load_failed"));
app->meditation.music_loaded = 0;
return 0;
}
app->meditation.music_loaded = 1;
app->meditation.music_track = track;
app->meditation.music_fade_out_ticks = 0;
app->meditation.music_fade_out_total_ticks = 0;
SetMusicVolume(app->meditation.music, (float)app->music_volume / 100.0f);
TraceLog(LOG_INFO, "AUDIO: Loaded meditation track: %s", path);
return 1;
}
void
meditation_music_format_download_status(char *out, size_t out_size,
const RuntimeAssetDownload *download)
{
(void)download;
if(out != 0 && out_size > 0)
out[0] = '\0';
}
void
meditation_music_draw_download_progress(InnerBreeze*app, int x, int y, int w)
{
(void)app;
(void)x;
(void)y;
(void)w;
}
int
meditation_music_available(InnerBreeze*app)
{
int i;
if(app == 0)
return 0;
for(i = 0; i < MEDITATION_MUSIC_TRACK_COUNT; i++) {
if(!track_available(app, i))
return 0;
}
return 1;
}
const char *
meditation_music_selected_label(InnerBreeze*app)
{
int track;
if(app == 0)
return "";
track = app->meditation.music_track;
if(track < 0 || track >= app_audio_music_count(app))
track = 0;
return app_audio_music_label(app, track);
}
void
meditation_music_init(InnerBreeze*app)
{
if(app == 0)
return;
app_audio_music_sanitize_selection(app);
if(app->meditation.music_status[0] == '\0') {
if(meditation_music_available(app))
set_status(app, GetLocaleText("meditation_music_installed"));
else
set_status(app, GetLocaleText("meditation_music_not_installed"));
}
}
void
meditation_music_unload(InnerBreeze*app)
{
if(app == 0)
return;
if(app->meditation.music_loaded) {
StopMusicStream(app->meditation.music);
UnloadMusicStream(app->meditation.music);
app->meditation.music_loaded = 0;
}
app->meditation.music_playing = 0;
app->meditation.music_test_playing = 0;
app->meditation.music_fade_out_ticks = 0;
app->meditation.music_fade_out_total_ticks = 0;
}
void
meditation_music_stop(InnerBreeze*app)
{
if(app == 0)
return;
if(app->meditation.music_loaded)
StopMusicStream(app->meditation.music);
app->meditation.music_playing = 0;
app->meditation.music_test_playing = 0;
app->meditation.music_fade_out_ticks = 0;
app->meditation.music_fade_out_total_ticks = 0;
}
void
meditation_music_fade_out(InnerBreeze*app)
{
int fade_ticks;
fade_ticks = 180;
if(app == 0 || !app->meditation.music_loaded ||
!app->meditation.music_playing)
return;
if(app->meditation.music_fade_out_ticks > 0)
return;
app->meditation.music_fade_out_ticks = fade_ticks;
app->meditation.music_fade_out_total_ticks = fade_ticks;
}
void
meditation_music_start_session(InnerBreeze*app)
{
int practice;
int track;
if(app == 0)
return;
app_audio_music_sanitize_selection(app);
practice = app->exercise_type;
if(practice < 0 || practice >= EXERCISE_COUNT)
practice = EXERCISE_MEDITATION;
track = app->meditation.music_practice_tracks[practice];
if(track == AUDIO_MUSIC_NONE)
return;
if(!load_track(app, track))
return;
PlayMusicStream(app->meditation.music);
app->meditation.music_playing = 1;
app->meditation.music_test_playing = 0;
}
void
meditation_music_update(InnerBreeze*app)
{
float volume;
if(app == 0 || !app->meditation.music_loaded)
return;
volume = (float)app->music_volume / 100.0f;
if(app->meditation.music_fade_out_ticks > 0 &&
app->meditation.music_fade_out_total_ticks > 0) {
volume *= (float)app->meditation.music_fade_out_ticks /
(float)app->meditation.music_fade_out_total_ticks;
app->meditation.music_fade_out_ticks--;
if(app->meditation.music_fade_out_ticks <= 0) {
meditation_music_stop(app);
return;
}
}
SetMusicVolume(app->meditation.music, volume);
UpdateMusicStream(app->meditation.music);
}
void meditation_music_start_download(InnerBreeze*app) { (void)app; }
void
meditation_music_draw_practice_settings(InnerBreeze*app, int practice,
int content_x, int content_w, int *y,
int show_installed_download,
int show_status)
{
(void)app;
(void)practice;
(void)content_x;
(void)content_w;
(void)y;
(void)show_installed_download;
(void)show_status;
}
int
meditation_music_measure_practice_settings(InnerBreeze*app, int practice,
int content_w,
int show_installed_download,
int show_status)
{
(void)app;
(void)practice;
(void)content_w;
(void)show_installed_download;
(void)show_status;
return 0;
}
+14 -11
View File
@@ -1,5 +1,5 @@
#module "platform.tray"
#import "app.h"
#import "app/app.h"
DesktopTrayAction :: enum {
DESKTOP_TRAY_ACTION_NONE = 0
@@ -34,7 +34,7 @@ DesktopTrayAction :: enum {
#import "kryon.h"
#if #defined(DESKTOP_TRAY_ENABLED) {
#import "app.h"
#import "app/app.h"
#import "breaks/app_breaks.h"
#import "habits_screen.h"
#import "practices/patterns/patterns_practice.h"
@@ -470,7 +470,7 @@ DesktopTrayAction :: enum {
item_count: int
# APP_NO_TRAY = 1 skips the tray entirely. With the lazy-GTK tray build
# this also keeps libgtk-3 and its dependency chain out of the process;
# closing the window then quits or minimizes instead of hiding.
# closing or minimizing the window then quits instead of hiding.
if getenv("APP_NO_TRAY") != nil {
return 0
}
@@ -503,24 +503,27 @@ DesktopTrayAction :: enum {
return (DesktopTrayAction)PollDesktopTrayAction()
}
desktop_tray_ready :: () -> int #export {
return TrayReady
return TrayReady && IsDesktopTrayVisible()
}
RestoreTrayWindow :: () #private {
ClearWindowState(FLAG_WINDOW_HIDDEN)
RestoreWindow()
}
HideTrayWindow :: () #private {
if !desktop_tray_ready() {
return
}
# The window vanishing with the process still running is the single
# most confusing failure mode this app has; always say why it hid.
TraceLog(LOG_INFO, "APP: hiding main window (tray action)")
SetWindowState(FLAG_WINDOW_HIDDEN)
}
desktop_tray_keep_running :: () #export {
if TrayReady {
SetWindowState(FLAG_WINDOW_HIDDEN)
} else {
MinimizeWindow()
desktop_tray_keep_running :: () -> int #export {
if !desktop_tray_ready() {
return 0
}
HideTrayWindow()
return 1
}
StartTrayPractice :: (app: InnerBreeze*, practice_id: int) #private {
practice: const PracticeDefinition*
@@ -703,7 +706,7 @@ DesktopTrayAction :: enum {
desktop_tray_update_status :: (app: InnerBreeze*) #export {
unused app
}
desktop_tray_keep_running :: () #export {
MinimizeWindow()
desktop_tray_keep_running :: () -> int #export {
return 0
}
}
@@ -1,4 +1,4 @@
#import "app.h"
#import "app/app.h"
#import "practices/meditation/meditation_music.h"
#import "practices/meditation/meditation_practice.h"
#import "screens/practice_screen.h"
Loaded 100 of 159 files, more files were not shown because too many files have changed in this diff. Show more