Description of the requested feature
Register custom widgets using gtk4-rs via the plugin API.
Regarding FFI Concern
Although a plain widget (like gtk4::Box) cannot pass across FFI safely, the underlying GtkWidget can as its #[repr(C)]. The plain widget can be converted into a raw C pointer and passed to ewwii, which it can then reconstruct.
This method preserves the properties and controllers attached to the widget. Which is ideal.
Proposed configuration syntax
A custom widget can be used like this:
Custom {
name = "widget-name"
# ... props
}
There is no clean way to register the widgets as MyProgress { .. } because ewwii uses a fixed list of widgets (WidgetNode). This pattern works because Custom can be just another widget in WidgetNode. If this is verbose for the developer writing the widget support plugin, they can use inject_nbcl to make a new component that wraps the custom widget.
Additional context
The custom widgets can also be required a specific structure that is similar to the EwwiiWidget trait system used currently in ewwii as of right now.
Description of the requested feature
Register custom widgets using gtk4-rs via the plugin API.
Regarding FFI Concern
Although a plain widget (like
gtk4::Box) cannot pass across FFI safely, the underlyingGtkWidgetcan as its#[repr(C)]. The plain widget can be converted into a raw C pointer and passed to ewwii, which it can then reconstruct.This method preserves the properties and controllers attached to the widget. Which is ideal.
Proposed configuration syntax
A custom widget can be used like this:
There is no clean way to register the widgets as
MyProgress { .. }because ewwii uses a fixed list of widgets (WidgetNode). This pattern works because Custom can be just another widget in WidgetNode. If this is verbose for the developer writing the widget support plugin, they can useinject_nbclto make a new component that wraps the custom widget.Additional context
The custom widgets can also be required a specific structure that is similar to the
EwwiiWidgettrait system used currently in ewwii as of right now.