Skip to main content

Crate strata_platform

Crate strata_platform 

Source
Expand description

Strata Platform: Unified Native Hardware Abstraction Layer for Android, iOS, macOS, Windows, Linux, and Web.

Provides zero-dependency platform windowing abstractions, client-side decorations (CSD), desktop system tray integrations, and headless mock drivers for deterministic CI testing.

§Examples

use strata_platform::WindowConfig;

let mut config = WindowConfig::default();
config.title = "My Strata App".into();
assert_eq!(config.title, "My Strata App");

Re-exports§

pub use csd::ControlPlacement;
pub use csd::CsdController;
pub use csd::CsdGeometry;
pub use csd::CsdHitZone;
pub use cursor_theme::CursorBitmap;
pub use cursor_theme::CursorTheme;
pub use dialog::open_file;
pub use dialog::open_file_async;
pub use dialog::open_multiple_files;
pub use dialog::open_multiple_files_async;
pub use dialog::pick_folder;
pub use dialog::pick_folder_async;
pub use dialog::save_file;
pub use dialog::save_file_async;
pub use dialog::show_message_box;
pub use dialog::DialogFilter;
pub use dialog::DialogMockResponse;
pub use dialog::MessageBoxButtons;
pub use dialog::MessageBoxResult;
pub use dialog::MessageBoxType;
pub use dialog::OpenFileOptions;
pub use dialog::PickFolderOptions;
pub use dialog::SaveFileOptions;
pub use events::decode_file_uri_to_path;
pub use events::parse_dropped_uri_list_to_paths;
pub use events::KeyCode;
pub use events::Modifiers;
pub use events::MouseButton;
pub use events::PlatformEvent;
pub use events::TouchPhase;
pub use gtk_window::cairo_rounded_rect;
pub use gtk_window::cairo_rounded_rect_radii;
pub use gtk_window::gtk_begin_window_drag;
pub use gtk_window::gtk_close;
pub use gtk_window::gtk_current_modifiers;
pub use gtk_window::gtk_focus_window;
pub use gtk_window::gtk_get_clipboard_text;
pub use gtk_window::gtk_gpu_2d_enabled;
pub use gtk_window::gtk_gpu_surface_is_active;
pub use gtk_window::gtk_is_closing;
pub use gtk_window::gtk_is_maximized;
pub use gtk_window::gtk_minimize;
pub use gtk_window::gtk_present_active_gpu_surface_now;
pub use gtk_window::gtk_primary_refresh_interval;
pub use gtk_window::gtk_reset_ime;
pub use gtk_window::gtk_set_clipboard_text;
pub use gtk_window::gtk_set_cursor;
pub use gtk_window::gtk_set_gpu_2d_enabled;
pub use gtk_window::gtk_set_ime_cursor_location;
pub use gtk_window::gtk_set_ime_surrounding_text;
pub use gtk_window::gtk_toggle_maximize;
pub use gtk_window::gtk_warp_cursor;
pub use gtk_window::init_pango_text_measurement;
pub use gtk_window::launch_gtk_window;
pub use gtk_window::launch_gtk_window_with_config;
pub use gtk_window::launch_gtk_window_with_scheduler;
pub use gtk_window::pango_font_metrics;
pub use gtk_window::pango_measure_styled_text;
pub use gtk_window::pango_measure_styled_text_family;
pub use gtk_window::pango_measure_text;
pub use gtk_window::pango_measure_text_family;
pub use gtk_window::post_platform_event;
pub use gtk_window::render_display_list_to_cairo;
pub use gtk_window::render_to_png;
pub use gtk_window::render_to_png_bytes;
pub use gtk_window::resolved_font_family;
pub use gtk_window::set_cursor_position;
pub use gtk_window::try_present_display_list_gpu;
pub use gtk_window::warp_cursor;
pub use wgpu_surface::render_scene_3d_wgpu_bgra;
pub use wgpu_surface::WgpuSwapchainPresenter;
pub use wgpu_surface::WgpuWindowPresenter;
pub use mcp_cursor::McpCursorState;
pub use dbus::show_desktop_notification;
pub use dbus::DbusClient;
pub use dbus::DbusMessageDecoder;
pub use dbus::DbusMessageEncoder;
pub use menu::AcceleratorModifier;
pub use menu::Menu;
pub use menu::MenuAccelerator;
pub use menu::MenuBar;
pub use menu::MenuItem;
pub use menu::MenuItemRole;
pub use shortcuts::ShortcutCallback;
pub use shortcuts::ShortcutManager;
pub use shortcuts::ShortcutTrigger;
pub use single_instance::decode_args;
pub use single_instance::encode_args;
pub use single_instance::SingleInstanceLock;
pub use single_instance::SingleInstanceStatus;
pub use surface::FramePacer;
pub use surface::PresentMode;
pub use surface::RefreshRate;
pub use surface::SurfaceConfig;
pub use surface::SurfaceHandle;
pub use tray::clear_delivered_notifications;
pub use tray::get_delivered_notifications;
pub use tray::DbusStatusNotifier;
pub use tray::DesktopNotification;
pub use tray::NativeTrayHandle;
pub use tray::TrayEvent;
pub use tray::TrayEventChannel;
pub use tray::TrayEventReceiver;
pub use tray::TrayEventSink;
pub use tray::TrayIcon;
pub use tray::TrayMenu;
pub use tray::TrayMenuItem;
pub use vibrancy::apply_vibrancy;
pub use vibrancy::clear_vibrancy;
pub use vibrancy::VibrancyConfig;
pub use vibrancy::VibrancyEffect;
pub use vibrancy::VibrancyError;
pub use wayland_window::WaylandDecoder;
pub use wayland_window::WaylandEncoder;
pub use wayland_window::WaylandEventLoop;
pub use wayland_window::WaylandWindow;
pub use window::CursorIcon;
pub use window::EventLoop;
pub use window::EventLoopControl;
pub use window::HoverTooltipStyle;
pub use window::LivePlatformWindow;
pub use window::MockEventLoop;
pub use window::MockPlatformWindow;
pub use window::MonitorInfo;
pub use window::NativeSurfaceWindow;
pub use window::PlatformWindow;
pub use window::ThemeMode;
pub use window::WindowAnchor;
pub use window::WindowConfig;
pub use window::WindowDecoration;
pub use window::WindowMode;
pub use window_manager::WindowId;
pub use window_manager::WindowManager;
pub use x11_window::PureX11Client;
pub use x11_window::PureX11Window;
pub use x11_window::X11EventLoop;
pub use x11_window::X11ShmSegment;
pub use x11_window::X11Window;
pub use x11_window::X11WireDecoder;
pub use x11_window::X11WireEncoder;
pub use cairo;
pub use gtk;
pub use pango;

Modules§

csd
Client-Side Decorations (CSD): Titlebar geometry, control buttons, and resize border hit-testing.
cursor_theme
System Cursor Theme and Xcursor parser.
dbus
Pure-Rust D-Bus wire protocol serializer, client, and desktop notification daemon.
dialog
Cross-platform native OS dialogs (file pickers, folder selectors, and message boxes).
events
Platform Event Model: Mouse, Keyboard, Touch, Window State, and File Drag-and-Drop.
gtk_window
High-Fidelity Native GTK3 and Cairo Presentation Backend for Linux.
mcp_cursor
Emulated MCP Cursor State and Animation Engine.
menu
Native application menus, submenus, keyboard accelerators, and menu bar models.
prelude
Platform prelude module.
raw_abi
Zero-dependency raw Native OS ABI protocols and descriptors for Windows, Wayland, and macOS.
shortcuts
Universal cross-platform keyboard shortcut and keybinding manager.
single_instance
Single-Instance Mutex and Inter-Process Communication (IPC) Window Focusing.
surface
Abstract hardware presentation surfaces, swapchain configuration, and frame pacing.
tray
Desktop System Tray abstraction (TrayIcon, TrayMenu, TrayMenuItem).
vibrancy
Operating system window vibrancy, frosted-glass blurs, and backdrop composition.
wayland_window
Pure-Rust Wayland Client Protocol Backend and Hardware Event Loop.
wgpu_surface
Hardware wgpu swapchain surface presenter and offscreen GPU bridge for strata_platform.
window
Window configuration, platform window traits, and mock implementations.
window_manager
Multi-window desktop manager with parent-child modality, focus arbitration, and event multiplexing.
x11_window
Pure-Rust Linux X11 Windowing, Event Loop, and MIT-SHM Shared Memory Presentation.

Structs§

SoftwareSurfacePresenter
Zero-dependency software presentation surface holding a target backing pixel store.
SwapchainCompositor
Orchestrates display list compilation, damage scissoring, and swapchain presentation.

Enums§

PlatformTarget
Target operating system or runtime platform.
PresentError
Potential presentation and swapchain errors.
SwapchainFormat
Color format for pixel data stored in the swapchain surface.

Traits§

SurfacePresenter
Abstract hardware presentation surface capable of receiving rendered frames.

Functions§

render_to_png_bytes_pure
Pure-Rust headless software rasterization and PNG byte export.