Documentation
¶
Index ¶
- type Actor
- type App
- type AppFramer
- type Control
- type EventLink
- func (c *EventLink) Actor() (Actor, bool)
- func (c *EventLink) Cancel()
- func (c *EventLink) Chan() <-chan event.Eventer
- func (c *EventLink) Close()
- func (c *EventLink) Link(parentCtx context.Context, appFramer AppFramer, child Actor)
- func (c *EventLink) Put(ctx context.Context, ev event.Eventer)
- func (c *EventLink) PutInnerPt(ctx context.Context, e event.Eventer)
- type Framer
- type Linker
- type RootApp
- func (app *RootApp) Application() *impress.Application
- func (app *RootApp) Cancel()
- func (app *RootApp) Close()
- func (app *RootApp) InnerRect() image.Rectangle
- func (app *RootApp) NewRectFrame(rect image.Rectangle) *rectframe.RectFrame
- func (app *RootApp) NewWindow(rect image.Rectangle, background color.Color) *impress.Window
- func (app *RootApp) Rect() image.Rectangle
- func (app *RootApp) Run(parentCtx context.Context, child Actor)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Actor ¶
type Actor interface { // Action performs the main action for the child controller using the provided context and app. Action(ctx context.Context, app App) // Wait waits for the child controller's action to complete. Wait() }
Actor is an interface for linking and managing a child controller.
type App ¶
App is an interface that combines Linker and AppFramer interfaces, providing methods for accessing application methods, a parent event channel, and a parent frame.
func AppWithLink ¶
AppWithLink combines an AppFrame with the specified Linker
type AppFramer ¶
AppFramer is an interface that combines Control and Framer interfaces, providing methods for accessing application methods and the parent frame.
func AppWithFrame ¶
AppWithFrame combines an AppFrame with a specified Framer
type Control ¶
type Control interface { // Application returns the current application instance. Application() *impress.Application // Cancel cancels a child controller context. Cancel() }
Control is an interface that provides methods for accessing application-level methods.
type EventLink ¶
type EventLink struct {
// contains filtered or unexported fields
}
EventLink represents a channel for managing events between the parent and child controllers.
func (*EventLink) Actor ¶
Actor returns the current child controller and a boolean indicating if the child context is still active.
func (*EventLink) Cancel ¶
func (c *EventLink) Cancel()
Cancel cancels the current child context, if one exists.
func (*EventLink) Chan ¶
Chan returns a channel for receiving events intended for the child window controller.
func (*EventLink) Close ¶
func (c *EventLink) Close()
Close cancels the child context and waits for all child goroutines to complete.
func (*EventLink) Link ¶
Link launches the child window controller. Previous child controller context will be cancelled, if one exists.
type Framer ¶
type Framer interface { // NewWindow creates a new window with the specified rectangle and background color. NewWindow(rect image.Rectangle, background color.Color) *impress.Window // NewRectFrame creates a new rectangular frame with the specified rectangle. NewRectFrame(rect image.Rectangle) *rectframe.RectFrame // Rect returns the rectangle representing the frame boundaries. Rect() image.Rectangle // InnerRect returns the inner rectangle of the frame. InnerRect() image.Rectangle }
Framer is an interface that provides methods for accessing and manipulating the parent frame.
type Linker ¶
type Linker interface { // Chan returns a channel for receiving events from the parent event link. Chan() <-chan event.Eventer // Put sends an event to the child event link if the context is not canceled. Put(ctx context.Context, ev event.Eventer) // Link links the parent event link with a new child controller. Link(ctx context.Context, appFramer AppFramer, actor Actor) }
Linker is an interface that provides methods for interacting with parent EventLink methods.
type RootApp ¶ added in v0.1.10
type RootApp struct {
// contains filtered or unexported fields
}
RootApp is wrapper to impress.Application to implement AppFramer interface
func MainApp ¶
func MainApp(a *impress.Application) *RootApp
MainApp creates RootApp from impress.Application
func (*RootApp) Application ¶ added in v0.1.10
func (app *RootApp) Application() *impress.Application
Application returns impress.Application
func (*RootApp) Cancel ¶ added in v0.1.10
func (app *RootApp) Cancel()
Cancel cancels child context.Context
func (*RootApp) Close ¶ added in v0.1.10
func (app *RootApp) Close()
Close closes MainApp resources include impress.Application
func (*RootApp) NewRectFrame ¶ added in v0.1.10
NewRectFrame creates child frame