eventlink

package
v0.1.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 12, 2024 License: MIT Imports: 9 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppWithFrame

func AppWithFrame(app Control, framer Framer) *appFrame

AppWithFrame combines an AppFrame with a specified Framer

func AppWithLink(app AppFramer, linker Linker) *linkApp

AppWithLink combines an AppFrame with the specified Linker

func MainApp

func MainApp(a *impress.Application) *mainApp

MainApp creates root AppFramer from impress.Application

Types

type Actor

type Actor interface {
	Action(ctx context.Context, app App)
	Wait()
}

Actor is an interface for linking a child controller

type App

type App interface {
	Linker
	AppFramer
}

App is an interface for accessing application methods, a parent event channel, and a parent frame

type AppFramer

type AppFramer interface {
	Control
	Framer
}

AppFramer is an interface for accessing application methods and the parent frame

type Control

type Control interface {
	Sync()
	Cancel()
}

Control is an interface for accessing application methods

type EventLink struct {
	// contains filtered or unexported fields
}

EventLink is the event channel for the child window controller

func New

func New() *EventLink

New creates an empty EventLink

func (*EventLink) Actor

func (c *EventLink) Actor() (Actor, bool)

Actor returns child controller and child context status

func (*EventLink) Cancel

func (c *EventLink) Cancel()

Cancel cancels the child context

func (*EventLink) Chan

func (c *EventLink) Chan() <-chan event.Eventer

Chan returns a channel for putting events to child window controller

func (*EventLink) Close

func (c *EventLink) Close()

Close cancels the child context and waits for the child goroutines

func (c *EventLink) Link(parentCtx context.Context, appFramer AppFramer, child Actor)

Link launches the child controller

func (*EventLink) Put

func (c *EventLink) Put(ctx context.Context, ev event.Eventer)

Put puts the event into the child channel if context is not canceled

func (*EventLink) PutInnerPt

func (c *EventLink) PutInnerPt(ctx context.Context, e event.Eventer)

PutInnerPt puts an event into a child event channel. Mouse event coordinates are shifted to match the child frame rectangle

type Framer

type Framer interface {
	NewWindow(rect image.Rectangle, background color.Color) *impress.Window
	NewRectFrame(rect image.Rectangle) *rectframe.RectFrame
	Rect() image.Rectangle
	InnerRect() image.Rectangle
}

Framer is an interface for accessing the parent frame

type Linker

type Linker interface {
	Chan() <-chan event.Eventer
	Put(ctx context.Context, ev event.Eventer)
	Link(ctx context.Context, appFramer AppFramer, actor Actor)
}

Linker is an interface for accessing parent EventLink methods

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL