# yuiHostSurfaceStateV1

A yui host surface state v1 record carrying schema, schemaVersion, width, height, generation, and related state.

Last updated: 2026-09-09

Package: frontend.yui | Status: source-declared

Tags: cpu, frontend, frontend.yui, method, source-example, thing, yeho, yui

Turn YUI models into a working frontend and its rendering/input adapters.

```yh
external thing yuiHostSurfaceStateV1
```

- text schema: Stores schema as text.
- int schemaVersion: Stores schema version as int.
- int width: Stores width as int.
- int height: Stores height as int.
- int generation: Stores generation as int.
- int presentCount: Stores present count as int.
- int lastCommandCount: Stores last command count as int.
- bool retainedInitialized: Stores retained initialized as bool.
- text retainedSurfaceId: Stores retained surface id as text.
- text state: Stores state as text.
- text diagnostic: Stores diagnostic as text.
- yuiHostSurfaceStateV1(int width, int height): Yui host surface state v1.
- Ready() returns bool: Ready.
- Failed(text diagnostic): Failed.
- Opened(): Opened.
- SetDiagnostic(text diagnostic): Set diagnostic.
- Lost(text diagnostic): Lost.
- BeginRecovery(): Begin recovery.
- Resized(int width, int height): Resized.
- Presented(int commandCount, bool retained, text surfaceId): Presented.
- Closed(): Closed.

## Use yuiHostSurfaceStateV1

A complete small caller. Values are illustrative; check the returned result and package requirements before connecting live resources.

Verification: type checked

```yh
using frontend.yui

// Turn YUI models into a working frontend and its rendering/input adapters.
yuiHostSurfaceStateV1 sample = yuiHostSurfaceStateV1(1, 1)
Console.Log(Text.From(sample.schema))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.frontend_yui__yuihostsurfacestatev1"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"

[[dependencies]]
package = "frontend.yui"
version = "0.2.0"
path = "../../../yeho/packages/frontend/yui"

[[dependencies]]
package = "graphics.canvas"
version = "0.1.0"
path = "../../../yeho/packages/graphics/canvas"

[[dependencies]]
package = "graphics.image"
version = "0.1.0"
path = "../../../yeho/packages/graphics/image"

[[dependencies]]
package = "graphics.image.processing"
version = "0.1.0"
path = "../../../yeho/packages/graphics/image/processing"

[[dependencies]]
package = "graphics.text"
version = "0.1.0"
path = "../../../yeho/packages/graphics/text"

[[dependencies]]
package = "host.ui_services"
version = "0.1.0"
path = "../../../yeho/packages/host/ui_services"

[[dependencies]]
package = "input.text"
version = "0.1.0"
path = "../../../yeho/packages/input/text"

[[dependencies]]
package = "ui"
version = "0.2.0"
path = "../../../yeho/packages/ui"

```

Extract the example archive beside the yeho and dolphin checkouts. This example requires those source dependencies and a current developer compiler.

```sh
./yeho/build/dolphin-metal/yehoc ./api-examples/frontend.yui--yuiHostSurfaceStateV1/usage --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## yuiHostSurfaceStateV1.Ready

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using frontend.yui

// Ready.
yuiHostSurfaceStateV1 instance = yuiHostSurfaceStateV1(1, 1)
bool result = instance.Ready()
Console.Log(Text.From(result))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.frontend_yui__yuihostsurfacestatev1"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"

[[dependencies]]
package = "frontend.yui"
version = "0.2.0"
path = "../../../yeho/packages/frontend/yui"

[[dependencies]]
package = "graphics.canvas"
version = "0.1.0"
path = "../../../yeho/packages/graphics/canvas"

[[dependencies]]
package = "graphics.image"
version = "0.1.0"
path = "../../../yeho/packages/graphics/image"

[[dependencies]]
package = "graphics.image.processing"
version = "0.1.0"
path = "../../../yeho/packages/graphics/image/processing"

[[dependencies]]
package = "graphics.text"
version = "0.1.0"
path = "../../../yeho/packages/graphics/text"

[[dependencies]]
package = "host.ui_services"
version = "0.1.0"
path = "../../../yeho/packages/host/ui_services"

[[dependencies]]
package = "input.text"
version = "0.1.0"
path = "../../../yeho/packages/input/text"

[[dependencies]]
package = "ui"
version = "0.2.0"
path = "../../../yeho/packages/ui"

```

Extract the example archive beside the yeho and dolphin checkouts. This example requires those source dependencies and a current developer compiler.

```sh
./yeho/build/dolphin-metal/yehoc ./api-examples/frontend.yui--yuiHostSurfaceStateV1/method-Ready-12 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## yuiHostSurfaceStateV1.Failed

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using frontend.yui

// Failed.
yuiHostSurfaceStateV1 instance = yuiHostSurfaceStateV1(1, 1)
text argument_diagnostic = "argument diagnostic"
instance.Failed(argument_diagnostic)
Console.Log("Failed completed")

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.frontend_yui__yuihostsurfacestatev1"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"

[[dependencies]]
package = "frontend.yui"
version = "0.2.0"
path = "../../../yeho/packages/frontend/yui"

[[dependencies]]
package = "graphics.canvas"
version = "0.1.0"
path = "../../../yeho/packages/graphics/canvas"

[[dependencies]]
package = "graphics.image"
version = "0.1.0"
path = "../../../yeho/packages/graphics/image"

[[dependencies]]
package = "graphics.image.processing"
version = "0.1.0"
path = "../../../yeho/packages/graphics/image/processing"

[[dependencies]]
package = "graphics.text"
version = "0.1.0"
path = "../../../yeho/packages/graphics/text"

[[dependencies]]
package = "host.ui_services"
version = "0.1.0"
path = "../../../yeho/packages/host/ui_services"

[[dependencies]]
package = "input.text"
version = "0.1.0"
path = "../../../yeho/packages/input/text"

[[dependencies]]
package = "ui"
version = "0.2.0"
path = "../../../yeho/packages/ui"

```

Extract the example archive beside the yeho and dolphin checkouts. This example requires those source dependencies and a current developer compiler.

```sh
./yeho/build/dolphin-metal/yehoc ./api-examples/frontend.yui--yuiHostSurfaceStateV1/method-Failed-13 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## yuiHostSurfaceStateV1.Opened

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using frontend.yui

// Opened.
yuiHostSurfaceStateV1 instance = yuiHostSurfaceStateV1(1, 1)
instance.Opened()
Console.Log("Opened completed")

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.frontend_yui__yuihostsurfacestatev1"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"

[[dependencies]]
package = "frontend.yui"
version = "0.2.0"
path = "../../../yeho/packages/frontend/yui"

[[dependencies]]
package = "graphics.canvas"
version = "0.1.0"
path = "../../../yeho/packages/graphics/canvas"

[[dependencies]]
package = "graphics.image"
version = "0.1.0"
path = "../../../yeho/packages/graphics/image"

[[dependencies]]
package = "graphics.image.processing"
version = "0.1.0"
path = "../../../yeho/packages/graphics/image/processing"

[[dependencies]]
package = "graphics.text"
version = "0.1.0"
path = "../../../yeho/packages/graphics/text"

[[dependencies]]
package = "host.ui_services"
version = "0.1.0"
path = "../../../yeho/packages/host/ui_services"

[[dependencies]]
package = "input.text"
version = "0.1.0"
path = "../../../yeho/packages/input/text"

[[dependencies]]
package = "ui"
version = "0.2.0"
path = "../../../yeho/packages/ui"

```

Extract the example archive beside the yeho and dolphin checkouts. This example requires those source dependencies and a current developer compiler.

```sh
./yeho/build/dolphin-metal/yehoc ./api-examples/frontend.yui--yuiHostSurfaceStateV1/method-Opened-14 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## yuiHostSurfaceStateV1.SetDiagnostic

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using frontend.yui

// Set diagnostic.
yuiHostSurfaceStateV1 instance = yuiHostSurfaceStateV1(1, 1)
text argument_diagnostic = "argument diagnostic"
instance.SetDiagnostic(argument_diagnostic)
Console.Log("SetDiagnostic completed")

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.frontend_yui__yuihostsurfacestatev1"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"

[[dependencies]]
package = "frontend.yui"
version = "0.2.0"
path = "../../../yeho/packages/frontend/yui"

[[dependencies]]
package = "graphics.canvas"
version = "0.1.0"
path = "../../../yeho/packages/graphics/canvas"

[[dependencies]]
package = "graphics.image"
version = "0.1.0"
path = "../../../yeho/packages/graphics/image"

[[dependencies]]
package = "graphics.image.processing"
version = "0.1.0"
path = "../../../yeho/packages/graphics/image/processing"

[[dependencies]]
package = "graphics.text"
version = "0.1.0"
path = "../../../yeho/packages/graphics/text"

[[dependencies]]
package = "host.ui_services"
version = "0.1.0"
path = "../../../yeho/packages/host/ui_services"

[[dependencies]]
package = "input.text"
version = "0.1.0"
path = "../../../yeho/packages/input/text"

[[dependencies]]
package = "ui"
version = "0.2.0"
path = "../../../yeho/packages/ui"

```

Extract the example archive beside the yeho and dolphin checkouts. This example requires those source dependencies and a current developer compiler.

```sh
./yeho/build/dolphin-metal/yehoc ./api-examples/frontend.yui--yuiHostSurfaceStateV1/method-SetDiagnostic-15 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## yuiHostSurfaceStateV1.Lost

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using frontend.yui

// Lost.
yuiHostSurfaceStateV1 instance = yuiHostSurfaceStateV1(1, 1)
text argument_diagnostic = "argument diagnostic"
instance.Lost(argument_diagnostic)
Console.Log("Lost completed")

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.frontend_yui__yuihostsurfacestatev1"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"

[[dependencies]]
package = "frontend.yui"
version = "0.2.0"
path = "../../../yeho/packages/frontend/yui"

[[dependencies]]
package = "graphics.canvas"
version = "0.1.0"
path = "../../../yeho/packages/graphics/canvas"

[[dependencies]]
package = "graphics.image"
version = "0.1.0"
path = "../../../yeho/packages/graphics/image"

[[dependencies]]
package = "graphics.image.processing"
version = "0.1.0"
path = "../../../yeho/packages/graphics/image/processing"

[[dependencies]]
package = "graphics.text"
version = "0.1.0"
path = "../../../yeho/packages/graphics/text"

[[dependencies]]
package = "host.ui_services"
version = "0.1.0"
path = "../../../yeho/packages/host/ui_services"

[[dependencies]]
package = "input.text"
version = "0.1.0"
path = "../../../yeho/packages/input/text"

[[dependencies]]
package = "ui"
version = "0.2.0"
path = "../../../yeho/packages/ui"

```

Extract the example archive beside the yeho and dolphin checkouts. This example requires those source dependencies and a current developer compiler.

```sh
./yeho/build/dolphin-metal/yehoc ./api-examples/frontend.yui--yuiHostSurfaceStateV1/method-Lost-16 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## yuiHostSurfaceStateV1.BeginRecovery

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using frontend.yui

// Begin recovery.
yuiHostSurfaceStateV1 instance = yuiHostSurfaceStateV1(1, 1)
instance.BeginRecovery()
Console.Log("BeginRecovery completed")

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.frontend_yui__yuihostsurfacestatev1"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"

[[dependencies]]
package = "frontend.yui"
version = "0.2.0"
path = "../../../yeho/packages/frontend/yui"

[[dependencies]]
package = "graphics.canvas"
version = "0.1.0"
path = "../../../yeho/packages/graphics/canvas"

[[dependencies]]
package = "graphics.image"
version = "0.1.0"
path = "../../../yeho/packages/graphics/image"

[[dependencies]]
package = "graphics.image.processing"
version = "0.1.0"
path = "../../../yeho/packages/graphics/image/processing"

[[dependencies]]
package = "graphics.text"
version = "0.1.0"
path = "../../../yeho/packages/graphics/text"

[[dependencies]]
package = "host.ui_services"
version = "0.1.0"
path = "../../../yeho/packages/host/ui_services"

[[dependencies]]
package = "input.text"
version = "0.1.0"
path = "../../../yeho/packages/input/text"

[[dependencies]]
package = "ui"
version = "0.2.0"
path = "../../../yeho/packages/ui"

```

Extract the example archive beside the yeho and dolphin checkouts. This example requires those source dependencies and a current developer compiler.

```sh
./yeho/build/dolphin-metal/yehoc ./api-examples/frontend.yui--yuiHostSurfaceStateV1/method-BeginRecovery-17 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## yuiHostSurfaceStateV1.Resized

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using frontend.yui

// Resized.
yuiHostSurfaceStateV1 instance = yuiHostSurfaceStateV1(1, 1)
int argument_width = 1
int argument_height = 1
instance.Resized(argument_width, argument_height)
Console.Log("Resized completed")

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.frontend_yui__yuihostsurfacestatev1"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"

[[dependencies]]
package = "frontend.yui"
version = "0.2.0"
path = "../../../yeho/packages/frontend/yui"

[[dependencies]]
package = "graphics.canvas"
version = "0.1.0"
path = "../../../yeho/packages/graphics/canvas"

[[dependencies]]
package = "graphics.image"
version = "0.1.0"
path = "../../../yeho/packages/graphics/image"

[[dependencies]]
package = "graphics.image.processing"
version = "0.1.0"
path = "../../../yeho/packages/graphics/image/processing"

[[dependencies]]
package = "graphics.text"
version = "0.1.0"
path = "../../../yeho/packages/graphics/text"

[[dependencies]]
package = "host.ui_services"
version = "0.1.0"
path = "../../../yeho/packages/host/ui_services"

[[dependencies]]
package = "input.text"
version = "0.1.0"
path = "../../../yeho/packages/input/text"

[[dependencies]]
package = "ui"
version = "0.2.0"
path = "../../../yeho/packages/ui"

```

Extract the example archive beside the yeho and dolphin checkouts. This example requires those source dependencies and a current developer compiler.

```sh
./yeho/build/dolphin-metal/yehoc ./api-examples/frontend.yui--yuiHostSurfaceStateV1/method-Resized-18 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## yuiHostSurfaceStateV1.Presented

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using frontend.yui

// Presented.
yuiHostSurfaceStateV1 instance = yuiHostSurfaceStateV1(1, 1)
int argument_commandCount = 1
bool argument_retained = true
text argument_surfaceId = "argument surface Id"
instance.Presented(argument_commandCount, argument_retained, argument_surfaceId)
Console.Log("Presented completed")

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.frontend_yui__yuihostsurfacestatev1"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"

[[dependencies]]
package = "frontend.yui"
version = "0.2.0"
path = "../../../yeho/packages/frontend/yui"

[[dependencies]]
package = "graphics.canvas"
version = "0.1.0"
path = "../../../yeho/packages/graphics/canvas"

[[dependencies]]
package = "graphics.image"
version = "0.1.0"
path = "../../../yeho/packages/graphics/image"

[[dependencies]]
package = "graphics.image.processing"
version = "0.1.0"
path = "../../../yeho/packages/graphics/image/processing"

[[dependencies]]
package = "graphics.text"
version = "0.1.0"
path = "../../../yeho/packages/graphics/text"

[[dependencies]]
package = "host.ui_services"
version = "0.1.0"
path = "../../../yeho/packages/host/ui_services"

[[dependencies]]
package = "input.text"
version = "0.1.0"
path = "../../../yeho/packages/input/text"

[[dependencies]]
package = "ui"
version = "0.2.0"
path = "../../../yeho/packages/ui"

```

Extract the example archive beside the yeho and dolphin checkouts. This example requires those source dependencies and a current developer compiler.

```sh
./yeho/build/dolphin-metal/yehoc ./api-examples/frontend.yui--yuiHostSurfaceStateV1/method-Presented-19 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## yuiHostSurfaceStateV1.Closed

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using frontend.yui

// Closed.
yuiHostSurfaceStateV1 instance = yuiHostSurfaceStateV1(1, 1)
instance.Closed()
Console.Log("Closed completed")

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.frontend_yui__yuihostsurfacestatev1"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"

[[dependencies]]
package = "frontend.yui"
version = "0.2.0"
path = "../../../yeho/packages/frontend/yui"

[[dependencies]]
package = "graphics.canvas"
version = "0.1.0"
path = "../../../yeho/packages/graphics/canvas"

[[dependencies]]
package = "graphics.image"
version = "0.1.0"
path = "../../../yeho/packages/graphics/image"

[[dependencies]]
package = "graphics.image.processing"
version = "0.1.0"
path = "../../../yeho/packages/graphics/image/processing"

[[dependencies]]
package = "graphics.text"
version = "0.1.0"
path = "../../../yeho/packages/graphics/text"

[[dependencies]]
package = "host.ui_services"
version = "0.1.0"
path = "../../../yeho/packages/host/ui_services"

[[dependencies]]
package = "input.text"
version = "0.1.0"
path = "../../../yeho/packages/input/text"

[[dependencies]]
package = "ui"
version = "0.2.0"
path = "../../../yeho/packages/ui"

```

Extract the example archive beside the yeho and dolphin checkouts. This example requires those source dependencies and a current developer compiler.

```sh
./yeho/build/dolphin-metal/yehoc ./api-examples/frontend.yui--yuiHostSurfaceStateV1/method-Closed-20 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


Package presence and a declaration do not establish support on every host. Host services need their platform and lifecycle setup.

Source: yeho/packages/frontend/yui/host-surface-surface.yh

AI training permission: https://demonhunterlabs.com/ai-use
