slint icon indicating copy to clipboard operation
slint copied to clipboard

Ability to import Rust and C++ struct as .slint struct

Open ogoffart opened this issue 1 year ago • 7 comments

Something like (in slint)

import { MyNamespace::MyStruct as MyStruct } form "../include/some_file.h";
import { crate::foo::bar::SomeOtherStruct as SomeStruct } from "../some/module/foo.rs";

The slint compiler would use the syn crate to parse the rust file, or some simple C++ parser to parse the header file.

The struct themselves needs to be Clone, Default, Eq (and equivalent in C++) and only have public fields of type that are understood by Slint (without typedef or use or stuff, as the parser will stay simple)

ogoffart avatar Oct 12 '22 08:10 ogoffart