fix: String retry + suspend ByteArray support + unsupported features docs#3
Open
kdroidFilter wants to merge 10 commits intomainfrom
Open
fix: String retry + suspend ByteArray support + unsupported features docs#3kdroidFilter wants to merge 10 commits intomainfrom
kdroidFilter wants to merge 10 commits intomainfrom
Conversation
Replace hardcoded 8192 buffer limit in reinterpret() calls with Long.MAX_VALUE, matching the swift-java approach. This prevents potential crashes or corrupted reads when native strings exceed 8KB.
…tion args Integrate a retry mechanism for reading string output buffers when initial capacity is exceeded. Refactor to remove unused buffer args and use a consistent pattern for parsing nullable and non-nullable string outputs.
Introduce support for serializing and deserializing byte arrays in FFM bridges. Added mechanisms to handle StableRef for byte arrays, including Java and native implementations with custom method handles. Updated infrastructure for BYTE_ARRAY KneType.
- Add readByteArrayRef helper on native side (StableRef pattern) - Add BYTE_ARRAY case to suspend result encode/decode - Add readByteArrayFromRef with retry on FFM side - Add 3 suspend ByteArray functions to Calculator example - Add 7 tests: basic, nullable, large (>8KB), concurrent - Update README with comprehensive unsupported features table
…ntations - Introduced `captureScreen` suspend function for cross-platform screen capture support. - Added macOS implementation using `CGWindowListCreateImage` for native screenshot handling. - Provided stub implementations for other platforms (Linux, Windows). - Integrated screen capture feature into the system info UI with `rememberCoroutineScope`. - Updated dependencies to include `kotlinx-coroutines-swing`.
- Implemented `captureScreen` for Linux using D-Bus Portal API with GLib bindings. - Integrated GIO native interop for GLib/Portal communication. - Updated build configuration to include `gio.def` for native interop. - Updated dependencies to include required libraries (`libpipewire-0.3-dev`). - Enhanced system info UI to reflect Linux screenshot capabilities.
…ents - Fully replace C interop implementation with Kotlin code using GLib bindings. - Refactor `captureScreen` to leverage stable references and coroutine-based flow. - Adjust GIO interop to include updated header filters for GLib and GObject. - Improve compatibility and maintainability by removing legacy C code.
… using GLib - Migrated system tray logic to `TrayManager` class leveraging GLib bindings. - Removed C-based interop code and systray functions from `systray.def`. - Updated `SystemDesktop` to use `TrayManager` for system tray operations. - Improved maintainability by fully transitioning to Kotlin-native code.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
1. String buffer retry (JetBrains-style)
reinterpret(8192)with dynamic retry-on-truncation patternappendStringReadWithRetryhelper to DRY logic across codegen sites2. Suspend ByteArray support (NEW)
readByteArrayRefhelper (mirrors STRING pattern)readByteArrayFromRefmethod + MethodHandle on JVM side (with retry)suspend fun(): ByteArray,suspend fun(): ByteArray?, large arrays >8KB3. Comprehensive "What's NOT supported" documentation (NEW)
Testing
Files Changed
Test Plan