browser

package
v0.0.0-...-cb083ed Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2024 License: BSD-3-Clause Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnterKey = 10

	UserAgent = "mycel"
)
View Source
const (
	InitialLayout = iota
	ClickRelayout
)

Variables

View Source
var (
	ExperimentalJsInsecure bool
	EnableNoScriptTag      bool
)
View Source
var (
	Style = style.Map{}
)

Functions

func NewImage

func NewImage(n *nodes.Node) duit.UI

func PrintTree

func PrintTree(ui duit.UI)

func TraverseTree

func TraverseTree(ui duit.UI, f func(ui duit.UI))

Types

type Browser

type Browser struct {
	history.History

	Website *Website

	Download func(res chan *string)
	LocCh    chan string
	StatusCh chan string
	// contains filtered or unexported fields
}

func NewBrowser

func NewBrowser(_dui *duit.DUI, initUrl string) (b *Browser)

func (*Browser) Back

func (b *Browser) Back() (e duit.Event)

func (*Browser) Cancel

func (b *Browser) Cancel()

func (*Browser) Ctx

func (b *Browser) Ctx() context.Context

func (*Browser) Get

func (b *Browser) Get(uri *url.URL) (buf []byte, contentType mycel.ContentType, err error)

func (*Browser) LinkedUrl

func (b *Browser) LinkedUrl(addr string) (a *url.URL, err error)

func (*Browser) LoadUrl

func (b *Browser) LoadUrl(url *url.URL) (e duit.Event)

LoadUrl after from location field,

func (*Browser) Loading

func (b *Browser) Loading() bool

func (*Browser) Origin

func (b *Browser) Origin() *url.URL

func (*Browser) PostForm

func (b *Browser) PostForm(uri *url.URL, data url.Values) (buf []byte, contentType mycel.ContentType, err error)

func (*Browser) SetAndLoadUrl

func (b *Browser) SetAndLoadUrl(u *url.URL) func() duit.Event

type CodeView

type CodeView struct {
	duit.UI
}

func NewCodeView

func NewCodeView(s string, n style.Map) (cv *CodeView)

func (*CodeView) Mouse

func (cv *CodeView) Mouse(dui *duit.DUI, self *duit.Kid, m draw.Mouse, origM draw.Mouse, orig image.Point) (r duit.Result)

type Element

type Element struct {
	duit.UI

	IsLink  bool
	Click   func() duit.Event
	Changed func(*Element)
	// contains filtered or unexported fields
}

func Arrange

func Arrange(n *nodes.Node, elements ...*Element) *Element

func InnerNodesToBox

func InnerNodesToBox(r int, b *Browser, n *nodes.Node) *Element

func NewElement

func NewElement(ui duit.UI, n *nodes.Node) *Element

func NewInputField

func NewInputField(n *nodes.Node) *Element

func NewSelect

func NewSelect(n *nodes.Node) *Element

func NewSubmitButton

func NewSubmitButton(b *Browser, n *nodes.Node) *Element

func NewText

func NewText(content []string, n *nodes.Node) (el []*Element)

func NewTextArea

func NewTextArea(n *nodes.Node) *Element

func NodeToBox

func NodeToBox(r int, b *Browser, n *nodes.Node) (el *Element)

func (*Element) Display

func (el *Element) Display() duitx.Display

func (*Element) Draw

func (el *Element) Draw(dui *duit.DUI, self *duit.Kid, img *draw.Image, orig image.Point, m draw.Mouse, force bool)

func (*Element) FirstFocus

func (el *Element) FirstFocus(dui *duit.DUI, self *duit.Kid) *image.Point

func (*Element) FlexDir

func (el *Element) FlexDir() duitx.Dir

func (*Element) Key

func (el *Element) Key(dui *duit.DUI, self *duit.Kid, k rune, m draw.Mouse, orig image.Point) (r duit.Result)

func (*Element) Layout

func (el *Element) Layout(dui *duit.DUI, self *duit.Kid, sizeAvail image.Point, force bool)

func (*Element) Mark

func (el *Element) Mark(self *duit.Kid, o duit.UI, forLayout bool) (marked bool)

func (*Element) Mouse

func (el *Element) Mouse(dui *duit.DUI, self *duit.Kid, m draw.Mouse, origM draw.Mouse, orig image.Point) (r duit.Result)

func (*Element) Rect

func (el *Element) Rect() (r image.Rectangle)

type Image

type Image struct {
	*duit.Image
	// contains filtered or unexported fields
}

type Label

type Label struct {
	*duitx.Label
	// contains filtered or unexported fields
}

func NewLabel

func NewLabel(t string, n *nodes.Node) *Label

func (*Label) Draw

func (ui *Label) Draw(dui *duit.DUI, self *duit.Kid, img *draw.Image, orig image.Point, m draw.Mouse, force bool)

type Table

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

func NewTable

func NewTable(n *nodes.Node) (t *Table)

func (*Table) Element

func (t *Table) Element(r int, b *Browser, n *nodes.Node) *Element

type TableRow

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

func NewTableRow

func NewTableRow(n *nodes.Node) (tr *TableRow)

type Website

type Website struct {
	duit.UI
	mycel.ContentType
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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