1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
//! Other programs and web pages inside an intuiTUIve app.
//!
//! - [`terminal`] runs any program in a pane of the app: a shell, `htop`,
//! an editor, a terminal browser. Keys, the mouse, pastes and resizes go
//! to the program; its screen is followed by rs-rich-record's VT
//! emulator (vt100, with rich's character widths) and drawn in the pane,
//! with scrollback; its exit is a signal and a callback.
//! - [`web_view`] shows a web page in a pane, with an address bar, and
//! back, forward, reload, the address and the loading state as signals.
//!
//! Each sits on a trait, as intuiTUIve's terminals sit on `Backend`: what
//! runs behind it can be swapped for another implementation, including one
//! the app writes itself.
//!
//! - [`PtyHost`] starts a program and carries its bytes and size.
//! [`LocalPty`] runs one on this machine (a PTY on Unix, ConPTY on
//! Windows); [`ReplayHost`] plays bytes back, for tests. An SSH session
//! is a third, passed to [`terminal_with`].
//! - [`WebEngine`] opens pages, takes input and hands back frames, of
//! cells or of pixels. [`ProgramEngine`] (the default) runs a terminal
//! browser (Carbonyl, Browsh, Chawan, w3m) in a pane; `ChromeEngine`
//! (feature `chrome`) drives a headless Chrome or Chromium the user
//! installed, over the DevTools protocol; `BrowshEngine` (feature
//! `browsh`) reads pages as text from Browsh's HTTP server. Pixel frames
//! are drawn as coloured half blocks.
//!
//! No browser ships with this crate, and none is downloaded: each is a
//! program the user chooses and installs.
//!
//! ```no_run
//! # extern crate rich_intuituive as intuituive;
//! use intuituive::prelude::*;
//! use rich_embed::{terminal, web_view_with, ProgramEngine};
//!
//! fn main() -> std::io::Result<()> {
//! App::new(|| {
//! let page = web_view_with(ProgramEngine::new("w3m"), "https://example.com");
//! row([
//! terminal("bash").on_exit(|_, cx| cx.quit()).node().panel("shell"),
//! page.node().panel("web"),
//! ])
//! })
//! .run()
//! }
//! ```
//!
//! The panes need a running app: like [`signal`](rich_intuituive::signal),
//! [`terminal`] and [`web_view`] are called inside `App::new`'s closure or
//! a node's.
// A builder method that returns `Self` is `#[must_use]`: dropping its
// result drops the value (CONTRIBUTING.md, "API conventions").
pub use BrowshEngine;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;