fl2rust
WORK IN PROGRESS
Usage
A fluid (fltk ui designer) file to Rust transpiler.
To run on the command-line, install using cargo-install:
$ cargo install fl2rust
Then run:
$ fl2rust <fl file>.fl > <output file>.rs
To automate through cargo, you can use fl2rust as a library by adding it to your build-dependencies:
# Cargo.toml
[]
= "0.13"
[]
= "0.2"
// build.rs
# src/myuifile.fl -> generated via fluid
# data file for the Fltk User Interface Designer (fluid)
version 1.0400
header_name {.h}
code_name {.cxx}
class UserInterface {open
} {
Function {make_window()} {open
} {
Fl_Window {} {open selected
xywh {138 161 440 355} type Double visible
} {
Fl_Button but {
label {Click me}
xywh {175 230 95 45}
}
}
}
}
// src/myuifile.rs
include!;
// src/main.rs
use *;
Known limitations
- Adding arbitrary code or declaring global/member variables is unsupported.
- Only constructor methods are supported.
- fl2rust doesn't check the generated Rust code for correctness.
- Supports fltk-rs >= 0.13.