How jiyahan/gpui-mobile works
GPUI Mobile is a Rust mobile platform layer and component library for running GPUI applications natively on iOS and Android, with an experimental minimal OHOS host. The primary workflow is an application selecting the current platform, receiving native input and lifecycle events, and rendering a GPUI scene through the mobile window and GPU stack. Separate branches provide reusable design-system components and feature-gated mobile-operation packages. Platform wiring is documented and partly sampled; package implementations beyond the camera, video, and maps excerpts are represented at their documented module boundary.
Main entry points: packages/mod.rs Package APIs · android/mod.rs Android Host · components/mod.rs Design Components · window.rs iOS Window
Components 22
Platform Hosts
- Public API
src/lib.rs - iOS Host
src/ios/mod.rs - Android Host
src/android/mod.rs - OHOS Host
src/ohos/mod.rs
Input And Rendering
- iOS Window
src/ios/window.rs - Android Window
src/android/window.rs - Android JNI
src/android/jni.rs - Platform Dispatch
src/android/dispatcher.rs - Frame Scheduling
src/frame_demand.rs - GPU And Text
- Platform Views
src/platform_view.rs
UI Components
- Design Components
src/components/mod.rs - Glass Components
src/components/glass/mod.rs - Material Components
src/components/material/mod.rs - Shared Components
src/components/shared/mod.rs
Mobile Capabilities
- Package APIs
src/packages/mod.rs - Camera
src/packages/camera/mod.rs - Video Player
src/packages/video_player/mod.rs - Embedded Maps
src/packages/maps/mod.rs - Native APIs
Other components
- GPUI App
- Mobile OS
Connections 30
- GPUI App → Public API: selects platform
- Public API → iOS Host: dispatches to
- Public API → Android Host: dispatches to
- GPUI App → OHOS Host: registers host
- iOS Host → iOS Window: creates windows
- Android Host → Android Window: creates windows
- Android Host → Platform Dispatch: provides dispatcher
- Android Host → Android JNI: uses JNI
- Mobile OS → Android JNI: delivers events
- Mobile OS → iOS Window: provides events
- Android Window → Frame Scheduling: requests frames
- iOS Window → Frame Scheduling: requests frames
- Android Window → GPU And Text: renders via
- iOS Window → GPU And Text: renders via
- OHOS Host → GPU And Text: renders via
- GPUI App → Design Components: composes UI
- Design Components → Glass Components: offers
- Design Components → Material Components: offers
- Design Components → Shared Components: offers
- GPUI App → Package APIs: calls capabilities
- Package APIs → Camera: exposes
- Package APIs → Video Player: exposes
- Package APIs → Embedded Maps: exposes
- Camera → Platform Views: creates preview
- Video Player → Platform Views: embeds surface
- Embedded Maps → Platform Views: embeds map
- Camera → Native APIs: controls camera
- Video Player → Native APIs: controls playback
- Embedded Maps → Native APIs: uses map SDK
- Package APIs → Native APIs: invokes platform APIs