fix broken links
This commit is contained in:
@@ -22,7 +22,7 @@ The central component for defining layout rules. It encapsulates all the propert
|
||||
* `px: u16`, `py: u16`: **Padding** - internal space between the element's border and its content/children. This increases the overall size of the element.
|
||||
* `mx: i32`, `my: i32`: **Margin** - an offset applied *after* the element's position is calculated. This creates space *around* the element relative to its parent's edges. Can be negative for overlap.
|
||||
|
||||
(See [Reference: Style API - Transform](./../reference/style_api.md#transform-component) for full details)
|
||||
(See [Reference: Style API - Transform](.//docs/reference/style_api.md#transform-component) for full details)
|
||||
|
||||
### `Position` Enum
|
||||
|
||||
@@ -32,7 +32,7 @@ Determines the `x` or `y` coordinate.
|
||||
* `Center`: Centers the element within the parent's available space on that axis.
|
||||
* `End`: Aligns the element to the right or bottom edge of the parent.
|
||||
|
||||
(See [Reference: Style API - Position](./../reference/style_api.md#position-enum) for full details)
|
||||
(See [Reference: Style API - Position](.//docs/reference/style_api.md#position-enum) for full details)
|
||||
|
||||
### `Dimension` Enum
|
||||
|
||||
@@ -42,13 +42,13 @@ Determines the `width` or `height`.
|
||||
* `Content`: Sizes itself to fit its content (text) or children. This is dynamic.
|
||||
* `Const(u16)`: Fixed size in terminal cells.
|
||||
|
||||
(See [Reference: Style API - Dimension](./../reference/style_api.md#dimension-enum) for full details)
|
||||
(See [Reference: Style API - Dimension](.//docs/reference/style_api.md#dimension-enum) for full details)
|
||||
|
||||
### `RawTransform` Struct
|
||||
|
||||
This is the internal, resolved representation of a `Transform`. After all calculations, a `Transform`'s declarative rules are converted into a `RawTransform` with concrete `u16` values for `x`, `y`, `width`, `height`, `px`, `py`. This `RawTransform` is then used by the `RenderScope` for actual drawing.
|
||||
|
||||
(See [Reference: Style API - RawTransform](./../reference/style_api.md#rawtransform-struct) for full details)
|
||||
(See [Reference: Style API - RawTransform](.//docs/reference/style_api.md#rawtransform-struct) for full details)
|
||||
|
||||
## Layout Calculation Flow (Simplified)
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ OSUI automates this process. When a `State<T>` value is modified, any `DynWidget
|
||||
* `**my_state.get() = new_value` (or `my_state.get().deref_mut().field = new_value`): Mutates the value directly through a `MutexGuard`. The `DerefMut` implementation automatically marks the state as changed by setting `inner.changed = inner.dependencies`.
|
||||
* **Dependency Tracking**: Implements the `DependencyHandler` trait, allowing `DynWidget`s to register themselves.
|
||||
|
||||
(See [Reference: State API](../reference/state_api.md) for more details)
|
||||
(See [Reference: State API](/docs/reference/state_api.md) for more details)
|
||||
|
||||
### 2. `DependencyHandler` Trait
|
||||
|
||||
@@ -40,7 +40,7 @@ A trait that `State<T>` (and potentially other future reactive types) implements
|
||||
* `add()`: Called when a `DynWidget` first registers itself as a listener to this dependency. It increments an internal counter of listeners.
|
||||
* `check()`: Called by `DynWidget` during its `auto_refresh` cycle. It decrements the `changed` counter and returns `true` if there are still pending changes to be processed by a listener. This ensures each listener processes a change only once per update cycle.
|
||||
|
||||
(See [Reference: State API - DependencyHandler Trait](../reference/state_api.md#dependencyhandler-trait) for more details)
|
||||
(See [Reference: State API - DependencyHandler Trait](/docs/reference/state_api.md#dependencyhandler-trait) for more details)
|
||||
|
||||
### 3. `DynWidget`: The Reactive Widget Wrapper
|
||||
|
||||
@@ -54,7 +54,7 @@ A trait that `State<T>` (and potentially other future reactive types) implements
|
||||
* `refresh()`: Forces the widget to rebuild immediately by re-executing its creation closure.
|
||||
* `auto_refresh()`: The core of reactivity. It iterates through all registered `DependencyHandler`s. If `handler.check()` returns `true` for any of them, it calls `refresh()` to rebuild the widget.
|
||||
|
||||
(See [Reference: Widget API - DynWidget Struct](../reference/widget_api.md#dynwidget-struct) for more details)
|
||||
(See [Reference: Widget API - DynWidget Struct](/docs/reference/widget_api.md#dynwidget-struct) for more details)
|
||||
|
||||
## How Reactive Updates Work in Practice
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ The orchestrator. It holds the list of top-level `Widget`s, manages extensions,
|
||||
* Iterates through top-level widgets, initiating their rendering.
|
||||
* Calls `Extension::on_close` and restores terminal state on shutdown.
|
||||
|
||||
(See [Reference: Screen API](../reference/screen_api.md) for more details)
|
||||
(See [Reference: Screen API](/docs/reference/screen_api.md) for more details)
|
||||
|
||||
### 2. `Widget` (`Arc<Widget>`)
|
||||
|
||||
@@ -39,7 +39,7 @@ The container for an `Element` and its `Component`s. It's the unit passed around
|
||||
* `DynWidget`: Its `Element` can be re-instantiated (rebuilt) if its dependencies change. This rebuild happens *before* its `render` method is called in a subsequent frame.
|
||||
* Provides access to its `Element` (`get_elem()`) and `Component`s (`get()`, `set_component()`).
|
||||
|
||||
(See [Reference: Widget API](../reference/widget_api.md) for more details)
|
||||
(See [Reference: Widget API](/docs/reference/widget_api.md) for more details)
|
||||
|
||||
### 3. `Element` (`Box<dyn Element>`)
|
||||
|
||||
@@ -67,7 +67,7 @@ The drawing context for a single element. It's a mutable structure that holds:
|
||||
* `clear()`: Resets the scope for the next element.
|
||||
* `set_parent_size()`: Crucial for container elements to establish the bounding box for their children.
|
||||
|
||||
(See [Reference: RenderScope API](../reference/render_scope_api.md) for more details)
|
||||
(See [Reference: RenderScope API](/docs/reference/render_scope_api.md) for more details)
|
||||
|
||||
### 5. `Transform` and `Style` Components
|
||||
|
||||
@@ -76,7 +76,7 @@ These components, attached to a `Widget`, provide the declarative rules for layo
|
||||
* `Transform`: Contains `Position` and `Dimension` rules, plus `margin` and `padding`. These are resolved into `RawTransform` by `RenderScope`.
|
||||
* `Style`: Contains `Background` and `foreground` color. Applied to `RenderScope`.
|
||||
|
||||
(See [Reference: Style API](../reference/style_api.md) for more details)
|
||||
(See [Reference: Style API](/docs/reference/style_api.md) for more details)
|
||||
|
||||
### 6. `Extension`s
|
||||
|
||||
@@ -84,7 +84,7 @@ Extensions are hooks into the pipeline.
|
||||
|
||||
* `Extension::render_widget(scope, widget)`: Called for each top-level widget *before* its `Element::render`. Allows extensions to inspect or modify the `RenderScope` or widget before rendering.
|
||||
|
||||
(See [Reference: Extensions API](../reference/extensions_api.md) for more details)
|
||||
(See [Reference: Extensions API](/docs/reference/extensions_api.md) for more details)
|
||||
|
||||
## Flow Diagram (Conceptual)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user