@@ -19,6 +19,18 @@ Dasselbe gilt für den Browser: `fs-web-engine` ist der Trait, `fs-web-engine-se
1919
2020---
2121
22+ ## Implementierungs-Status
23+
24+ | Repo | Status |
25+ | ---| ---|
26+ | ` fs-render ` | ✅ G2.1 — alle Traits implementiert, 19 Tests grün |
27+ | ` fs-gui-engine-iced ` | ✅ G2.2 — IcedEngine/IcedWindow/IcedWidget/IcedTheme, 16 Tests grün |
28+ | ` fs-gui-engine-bevy ` | G2.3 — geplant |
29+ | ` fs-web-engine ` | G2.5 — geplant |
30+ | ` fs-web-engine-servo ` | G2.6 — geplant |
31+
32+ ---
33+
2234## GUI-Schichtmodell
2335
2436```
@@ -33,7 +45,7 @@ Dasselbe gilt für den Browser: `fs-web-engine` ist der Trait, `fs-web-engine-se
3345├──────────────────┬──────────────────────────────┤
3446│ fs-gui-engine- │ fs-gui-engine-bevy │
3547│ iced │ │
36- │ (libcosmic -Basis)│ (Bevy ECS, 3D-fähig) │
48+ │ (iced 0.13 -Basis)│ (Bevy ECS, 3D-fähig) │
3749└──────────────────┴──────────────────────────────┘
3850```
3951
@@ -61,7 +73,7 @@ Dasselbe gilt für den Browser: `fs-web-engine` ist der Trait, `fs-web-engine-se
6173| Repo | Lizenz | Rolle |
6274| ---| ---| ---|
6375| ` fs-render ` | MIT | GUI-Abstraktions-Traits |
64- | ` fs-gui-engine-iced ` | MIT | iced-Engine; libcosmic als Basis (Apache-2.0/MIT dual) |
76+ | ` fs-gui-engine-iced ` | MIT | iced-Engine; libcosmic-Ausbau geplant (Apache-2.0/MIT dual) |
6577| ` fs-gui-engine-bevy ` | MIT | Bevy-Engine (Apache-2.0/MIT dual) |
6678| ` fs-web-engine ` | MIT | Browser-Engine-Abstraktions-Traits |
6779| ` fs-web-engine-servo ` | MIT | Servo-Implementierung (Servo: MPL-2.0) |
@@ -73,32 +85,71 @@ Dasselbe gilt für den Browser: `fs-web-engine` ist der Trait, `fs-web-engine-se
7385### Kern-Traits
7486
7587``` rust
76- /// Die Engine selbst — Lifecycle, Rendering-Loop
77- pub trait RenderEngine {
78- fn run (& self , app : Box <dyn FsApp >) -> Result <()>;
79- fn capabilities (& self ) -> EngineCapabilities ;
88+ /// Die Engine selbst — Lifecycle, Window-Erstellung, Event-Dispatch
89+ pub trait RenderEngine : Send + Sync + 'static {
90+ type Window : FsWindow ;
91+ type Widget : FsWidget ;
92+ type Theme : FsTheme ;
93+
94+ fn name (& self ) -> & str ;
95+ fn version (& self ) -> & str ;
96+ fn create_window (& self , config : WindowConfig ) -> Self :: Window ;
97+ fn apply_theme (& self , theme : & Self :: Theme );
98+ fn dispatch_event (& self , event : FsEvent );
99+ fn shutdown (& self );
80100}
81101
82- /// Jedes UI-Element
83- pub trait FsWidget {
84- fn render (& self , ctx : & RenderContext ) -> WidgetTree ;
102+ /// Jedes UI-Element — Engines wrappen ihre nativen Widgets in diesem Trait
103+ pub trait FsWidget : Send + Sync {
104+ fn widget_id (& self ) -> & str ;
105+ fn is_enabled (& self ) -> bool ;
106+ fn set_enabled (& mut self , enabled : bool );
85107}
86108
87109/// Jedes Fenster / App-Hauptfenster
88- pub trait FsWindow {
110+ pub trait FsWindow : Send + Sync {
89111 fn title (& self ) -> & str ;
90- fn on_minimize (& mut self );
91- fn on_restore (& mut self );
92- fn on_close (& mut self ) -> CloseAction ;
93- fn layout (& self ) -> WindowLayout ;
112+ fn is_visible (& self ) -> bool ;
113+ fn show (& mut self );
114+ fn hide (& mut self );
115+ fn minimize (& mut self );
116+ fn restore (& mut self );
117+ fn close (& mut self );
118+ fn set_title (& mut self , title : String );
119+ fn on_event (& mut self , event : FsEvent );
120+ }
121+
122+ /// Theme-Schnittstelle — engine-neutral
123+ pub trait FsTheme : Send + Sync + Clone + Default {
124+ fn name (& self ) -> & str ;
125+ fn primary_color (& self ) -> Color ;
126+ fn background_color (& self ) -> Color ;
127+ fn text_color (& self ) -> Color ;
128+ fn accent_color (& self ) -> Color ;
129+ fn border_radius (& self ) -> f32 ;
130+ fn font_size_base (& self ) -> f32 ;
94131}
132+ ```
95133
96- /// Theme-Schnittstelle
97- pub trait FsTheme {
98- fn colors (& self ) -> & ColorPalette ;
99- fn fonts (& self ) -> & FontSet ;
100- fn spacing (& self ) -> & SpacingScale ;
101- fn animation_set (& self ) -> & AnimationSet ;
134+ ### Widget-Deskriptoren
135+
136+ ` fs-render ` definiert auch konkrete Deskriptoren die Engine-unabhängig beschreiben
137+ welche Widgets existieren sollen:
138+
139+ ``` rust
140+ pub struct ButtonWidget { pub id , label , enabled , action }
141+ pub struct TextInputWidget { pub id , placeholder , value , enabled }
142+ pub struct ListWidget { pub id , items , selected_index }
143+ ```
144+
145+ ### FsEvent
146+
147+ ``` rust
148+ pub enum FsEvent {
149+ Key (KeyEvent ), // Taste + Modifier-Flags
150+ Mouse (MouseEvent ), // Click, Move, Scroll
151+ Window (WindowEvent ), // Resized, Focused, Minimized, CloseRequested, ...
152+ Custom (CustomEvent ), // Action, TextChanged, SelectionChanged
102153}
103154```
104155
@@ -108,37 +159,58 @@ Animationen sind keine hartkodierten Werte — sie sind **Store-Pakete**:
108159
109160``` rust
110161pub struct AnimationSet {
111- pub name : String ,
112- pub window_open : Animation ,
113- pub window_close : Animation ,
114- pub tab_switch : Animation ,
115- pub app_launch : Animation ,
116- // ...
162+ pub id : String ,
163+ pub definitions : Vec <AnimationDefinition >,
117164}
118165
119- pub struct Animation {
120- pub kind : AnimationKind , // SlideLeft, SlideRight, Fade, Scale, Custom(WasmModule)
166+ pub struct AnimationDefinition {
167+ pub name : String ,
168+ pub animation_type : AnimationType , // SlideLeft, Fade, Scale, Custom(String), ...
121169 pub duration_ms : u32 ,
122- pub easing : EasingFn ,
170+ pub easing : EasingFunction ,
123171}
124172```
125173
126- ` Custom(WasmModule ) ` erlaubt WASM-basierte User-Animationen via ` fs-plugin-sdk ` .
174+ ` AnimationType:: Custom(name )` erlaubt WASM-basierte User-Animationen via ` fs-plugin-sdk ` .
127175AnimationSets werden wie Icon-Sets als Pakete im Store veröffentlicht und installiert.
128176
177+ ### RenderCtx
178+
179+ ``` rust
180+ pub struct RenderCtx {
181+ pub locale : String , // z.B. "de", "en"
182+ pub animation : AnimationConfig ,
183+ }
184+ ```
185+
129186---
130187
131- ## fs-gui-engine-iced
188+ ## fs-gui-engine-iced ✅
132189
133- Implementiert alle ` fs-render ` -Traits auf Basis von ** iced** + ** libcosmic ** (System76) .
190+ Implementiert alle ` fs-render ` -Traits auf Basis von ** iced 0.13 ** .
134191
135- ** libcosmic** liefert:
136- - Fertige Widgets (Buttons, Listen, Dialoge, Tabs, Sideboard-Elemente)
137- - Theming-System (CSS-Variablen-ähnlich)
138- - Fensterverhalten (Titelleiste, Resize, Snap)
139- - Dark/Light-Mode-Unterstützung
192+ ** Aktuelle Implementierung:**
193+
194+ | Struct | Trait |
195+ | ---| ---|
196+ | ` IcedEngine ` | ` RenderEngine ` |
197+ | ` IcedWindow ` | ` FsWindow ` — Descriptor + Event-Queue |
198+ | ` IcedWidget ` | ` FsWidget ` — ID + enabled-State |
199+ | ` IcedTheme ` | ` FsTheme ` — wraps ` iced::Theme ` , FS Default = Dark + Cyan |
140200
141- ** Lizenz:** libcosmic ist Apache-2.0/MIT dual — problemlos nutzbar.
201+ ** IcedWindow — Event-Queue-Pattern:**
202+
203+ Da iced ein funktionales Elm-Modell hat, speichert ` IcedWindow ` pending Events
204+ in einer Queue. Die iced-Application liest diese Queue im ` update() ` -Loop:
205+
206+ ``` rust
207+ let events = window . drain_events (); // gibt Vec<FsEvent> zurück und leert Queue
208+ ```
209+
210+ ** libcosmic-Ausbau (geplant für G2.8):**
211+
212+ Die vollständige libcosmic-Integration (Pop!_ OS COSMIC Design System, System-Palette,
213+ Portal-Integration) kommt wenn ` fs-desktop ` in Phase G2.8 auf diese Engine umgestellt wird.
142214
143215** Standard-Engine** für fs-desktop. Gut für:
144216- Klassische UI (Formulare, Listen, Dialoge)
@@ -147,7 +219,7 @@ Implementiert alle `fs-render`-Traits auf Basis von **iced** + **libcosmic** (Sy
147219
148220---
149221
150- ## fs-gui-engine-bevy
222+ ## fs-gui-engine-bevy (geplant — G2.3)
151223
152224Implementiert alle ` fs-render ` -Traits auf Basis von ** Bevy** (ECS-Game-Engine).
153225
@@ -162,9 +234,9 @@ Die Apps brauchen keine Änderung — nur der Engine-Feature-Flag ändert sich.
162234
163235---
164236
165- ## fs-web-engine — Browser-Abstraktion
237+ ## fs-web-engine — Browser-Abstraktion (geplant — G2.5)
166238
167- ### Kern-Traits
239+ ### Kern-Traits (geplant)
168240
169241``` rust
170242pub trait WebEngine {
@@ -189,7 +261,7 @@ Das passt ins bestehende Plugin-System und ist auf allen Plattformen portierbar.
189261
190262---
191263
192- ## fs-web-engine-servo
264+ ## fs-web-engine-servo (geplant — G2.6)
193265
194266** Servo** ist ein Browser-Engine in Rust (Mozilla-Projekt, jetzt eigenständig).
195267
@@ -214,7 +286,7 @@ Das passt ins bestehende Plugin-System und ist auf allen Plattformen portierbar.
214286``` toml
215287# fs-desktop/Cargo.toml
216288[features ]
217- default = [" engine-iced" ]
289+ default = [" engine-iced" ]
218290engine-iced = [" dep:fs-gui-engine-iced" ]
219291engine-bevy = [" dep:fs-gui-engine-bevy" ]
220292```
@@ -229,7 +301,7 @@ Engine-Auswahl über Settings → aus dem installierten AnimationSet und Engine-
229301
230302| Platform | GUI-Engine | Status |
231303| ---| ---| ---|
232- | Linux | iced (libcosmic) | ✅ primär |
304+ | Linux | iced | ✅ primär |
233305| macOS | iced | ✅ |
234306| Windows | iced | ✅ |
235307| Linux 3D | Bevy | Geplant |
0 commit comments