pub struct BuffrHost {
pub last_cursor_shape: CursorShape,
/* private fields */
}Expand description
Host adapter consumed by hjkl_engine::Editor once edit-mode is
active.
Fields§
§last_cursor_shape: CursorShapeLast cursor shape requested by the engine. Drained by the host renderer per frame.
Implementations§
Source§impl BuffrHost
impl BuffrHost
pub fn new() -> Self
Sourcepub fn set_viewport_size(&mut self, width: u16, height: u16)
pub fn set_viewport_size(&mut self, width: u16, height: u16)
Publish the current canvas size into the viewport. Called from
the host’s resize event handler (winit WindowEvent::Resized
in apps/buffr). width / height are in cells, not
pixels — buffr will divide pixel dimensions by font metrics
before calling this once edit-mode rendering lands.
Currently unwired: buffr’s main loop drives CEF + softbuffer chrome and doesn’t yet route resizes into edit-mode. When the edit-mode overlay is plumbed, hook this in.
Sourcepub fn set_clipboard_cache(&mut self, text: Option<String>)
pub fn set_clipboard_cache(&mut self, text: Option<String>)
Update the cached clipboard. Host calls this on focus events or when an OSC52 read reply arrives.
Sourcepub fn drain_clipboard_outbox(&mut self) -> Vec<String>
pub fn drain_clipboard_outbox(&mut self) -> Vec<String>
Drain pending clipboard writes. Host’s tick loop calls this and dispatches each to the platform clipboard backend.
Sourcepub fn drain_intents(&mut self) -> Vec<BuffrEditIntent>
pub fn drain_intents(&mut self) -> Vec<BuffrEditIntent>
Drain queued intents. Host calls this once per render frame.
Trait Implementations§
Source§impl Host for BuffrHost
impl Host for BuffrHost
Source§type Intent = BuffrEditIntent
type Intent = BuffrEditIntent
Source§fn write_clipboard(&mut self, text: String)
fn write_clipboard(&mut self, text: String)
wl-copy,
pbcopy, …).Source§fn read_clipboard(&mut self) -> Option<String>
fn read_clipboard(&mut self) -> Option<String>
Source§fn now(&self) -> Duration
fn now(&self) -> Duration
timeoutlen) resolution
reads this; engine never reads Instant::now() directly so
macro replay stays deterministic.Source§fn prompt_search(&mut self) -> Option<String>
fn prompt_search(&mut self) -> Option<String>
None aborts the search.Source§fn emit_cursor_shape(&mut self, shape: CursorShape)
fn emit_cursor_shape(&mut self, shape: CursorShape)
Source§fn emit_intent(&mut self, intent: Self::Intent)
fn emit_intent(&mut self, intent: Self::Intent)
Source§fn viewport(&self) -> &Viewport
fn viewport(&self) -> &Viewport
width/height/
text_width/wrap per render frame; the engine reads/writes
top_row / top_col to scroll. 0.0.34 (Patch C-δ.1) moved
this off hjkl_buffer::Buffer onto Host.Source§fn viewport_mut(&mut self) -> &mut Viewport
fn viewport_mut(&mut self) -> &mut Viewport
top_row.Source§fn should_cancel(&self) -> bool
fn should_cancel(&self) -> bool
false.Source§fn display_line_for(&self, pos: Pos) -> u32
fn display_line_for(&self, pos: Pos) -> u32
gj/gk. Hosts
without wrapping may use the default identity impl.Auto Trait Implementations§
impl Freeze for BuffrHost
impl RefUnwindSafe for BuffrHost
impl Send for BuffrHost
impl Sync for BuffrHost
impl Unpin for BuffrHost
impl UnsafeUnpin for BuffrHost
impl UnwindSafe for BuffrHost
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more