-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCargo.toml
More file actions
85 lines (74 loc) · 3.39 KB
/
Copy pathCargo.toml
File metadata and controls
85 lines (74 loc) · 3.39 KB
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
79
80
81
82
83
84
85
[package]
name = "ratatui_ffi"
version = "0.2.6"
edition = "2021"
license = "MIT OR Apache-2.0"
description = "C ABI bindings for Ratatui (Rust TUI) to consume from C/C#/etc."
repository = "https://github.com/holo-q/ratatui-ffi"
homepage = "https://github.com/holo-q/ratatui-ffi"
readme = "README.md"
keywords = ["tui", "terminal", "ffi", "c", "bindings"]
categories = ["api-bindings", "command-line-interface", "gui"]
[lib]
crate-type = ["cdylib"]
[[bin]]
name = "ffi_introspect"
path = "tools/ffi_introspect.rs"
[[bin]]
name = "gen_header"
path = "tools/gen_header.rs"
[features]
default = ["scrollbar" ]
# Compile-time safety checks (bounds, batch sizes, etc.).
# Disabled by default; enable for QA/dev to catch invalid inputs crossing the FFI.
ffi_safety = []
# Enable experimental Scrollbar support (requires newer Ratatui API). Off by default for crates.io compatibility.
scrollbar = []
[dependencies]
ratatui = "0.30"
crossterm = "0.27"
bitflags = "2"
anstyle = "1"
anstream = "0.6"
indicatif = { version = "0.17", default-features = false, features = ["improved_unicode"] }
[package.metadata.docs.rs]
# Build docs with all features so optional APIs are visible.
all-features = true
# Enable `docsrs` cfg so `#[cfg_attr(docsrs, ...)]` works and feature badges render.
rustdoc-args = ["--cfg", "docsrs"]
[profile.dev]
panic = "unwind"
[profile.release]
panic = "unwind"
[package.metadata.ffi_introspect]
# Where to emit generated FFI Rust code (symbols/palettes, etc.)
emit_rs = "src/ffi/generated.rs"
# Root path for referencing consts in the target crate (defaults to package name)
const_root = "ratatui"
# Name prefix for generated getter functions (defaults to first segment of package name)
fn_prefix = "ratatui"
# How to obtain target sources generically
# If git_tag is omitted, it is derived from Cargo.lock using dep_name.
git_url = "https://github.com/ratatui-org/ratatui.git"
dep_name = "ratatui"
# Emission filters (generic, no hardcoding required)
# The tool will generate &str getters for public consts whose module path starts with any of these prefixes.
symbol_namespaces = ["symbols::"]
# "module:file" entries; semicolon-separated string is also allowed for simpler parsers.
set_modules = "symbols::line:symbols/line.rs;symbols::border:symbols/border.rs;symbols::block:symbols.rs;symbols::bar:symbols.rs;symbols::scrollbar:symbols.rs"
dto_enum_u32 = ["Alignment", "BorderType"]
dto_renames = "layout::Rect=FfiRect"
const_modules = "symbols::half_block:symbols.rs;symbols::shade:symbols.rs;symbols::braille:symbols.rs"
# Macro names used by the generator (override to integrate with other projects)
macros.struct_str = "crate::ratatui_define_ffi_str_struct!"
macros.struct_u32 = "crate::ratatui_define_ffi_u32_struct!"
macros.const_str_getter = "crate::ratatui_const_str_getter!"
macros.const_char_getter = "crate::ratatui_const_char_getter!"
macros.const_u16_getter = "crate::ratatui_const_u16_getter!"
macros.const_struct_getter = "crate::ratatui_const_struct_getter!"
macros.const_color_u32_getter = "crate::ratatui_const_color_u32_getter!"
macros.const_palette_u32_getter = "crate::ratatui_const_palette_u32_getter!"
widgets_emit_rs = "src/ffi/generated_widgets.rs"
enums_emit_rs = "src/ffi/generated_enums.rs"
enums_emit = ["Alignment", "BorderType", "LegendPosition", "RenderDirection", "ListDirection", "Direction", "Flex", "GraphType", "Position", "Marker"]
enums_renames = "Alignment=FfiAlign;Position=FfiPosition;Marker=FfiMarker"