Skip to main content

cbf_chrome/ffi/
mod.rs

1//! FFI bridge adapters between Rust-side models and `cbf-chrome-sys` C ABI types.
2//!
3//! This module handles low-level IPC event decoding and conversion utilities
4//! that remain internal to the crate boundary.
5
6mod client;
7mod event;
8mod map;
9mod utils;
10
11pub(crate) use client::IpcEventWaitHandle;
12pub use client::{EventWaitResult, IpcClient};
13pub use event::IpcEvent;
14
15/// Convert native NSEvent input to CBF input events on macOS.
16#[cfg(target_os = "macos")]
17pub use map::{
18    convert_nsevent_to_chrome_key_event, convert_nsevent_to_chrome_mouse_event,
19    convert_nsevent_to_chrome_mouse_wheel_event, convert_nsevent_to_key_event,
20    convert_nsevent_to_mouse_event, convert_nsevent_to_mouse_wheel_event,
21    convert_nspasteboard_to_drag_data,
22};
23
24/// Errors that can occur in the IPC bridge layer.
25#[derive(Debug, Clone, PartialEq, Eq)]
26pub enum Error {
27    /// Failed to connect to the IPC channel.
28    ConnectionFailed,
29    /// Input data was invalid for the FFI layer.
30    InvalidInput,
31    /// An IPC event could not be parsed.
32    InvalidEvent,
33}