frontend

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitRegistry

func InitRegistry(l *lua.State)

InitRegistry creates a new CallbackRegistry for the given Lua state.

func Open

func Open(l *lua.State)

Open registers the frontend module for require() in the Lua state.

Types

type CallbackRegistry

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

CallbackRegistry manages named, ordered callbacks per event.

func GetRegistry

func GetRegistry() *CallbackRegistry

GetRegistry returns the package-level callback registry.

func (*CallbackRegistry) Add

func (cr *CallbackRegistry) Add(event, name string, position callbackPosition)

Add inserts a callback. position is "back" (default), "front", or a relative spec.

func (*CallbackRegistry) Fire

func (cr *CallbackRegistry) Fire(event string, setupArgs func(*lua.State) int) error

Fire calls all registered Lua callbacks for an event. setupArgs is called to push arguments onto the Lua stack and returns the arg count.

func (*CallbackRegistry) InstallPageInit

func (cr *CallbackRegistry) InstallPageInit()

InstallPageInit registers a Go-level PageInitCallback on the CSSBuilder that fires all registered Lua "page_init" callbacks.

func (*CallbackRegistry) InstallPostElement

func (cr *CallbackRegistry) InstallPostElement()

InstallPostElement registers a Go-level ElementCallback on the CSSBuilder that fires all registered Lua "post_element" callbacks.

func (*CallbackRegistry) InstallPreShipout

func (cr *CallbackRegistry) InstallPreShipout(feDoc *fe.Document)

InstallPreShipout registers a Go-level PreShipout callback on the document that fires all registered Lua "pre_shipout" callbacks.

func (*CallbackRegistry) List

func (cr *CallbackRegistry) List(event string) []string

List returns the callback names in execution order for the given event.

func (*CallbackRegistry) Remove

func (cr *CallbackRegistry) Remove(event, name string)

Remove removes a named callback from an event.

func (*CallbackRegistry) SetCSSBuilder

func (cr *CallbackRegistry) SetCSSBuilder(cb *htmlbag.CSSBuilder)

SetCSSBuilder stores the CSSBuilder reference so that callbacks can access page dimensions and CSS information.

type Color

type Color struct {
	Value *color.Color
}

Color wraps the boxesandglue color.Color type

type ColorProfile

type ColorProfile struct {
	Value *document.ColorProfile
}

ColorProfile wraps the document.ColorProfile type

type Document

type Document struct {
	Value *frontend.Document
}

Document wraps the boxesandglue frontend.Document type

type ElementInfo

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

ElementInfo wraps an htmlbag.ElementEvent to expose element information to Lua callbacks.

type Face

type Face struct {
	Value *pdf.Face
}

Face wraps the baseline-pdf Face type

type FontFamily

type FontFamily struct {
	Value *frontend.FontFamily
	// contains filtered or unexported fields
}

FontFamily wraps the boxesandglue frontend.FontFamily type

type FontSource

type FontSource struct {
	Value *frontend.FontSource
}

FontSource wraps the boxesandglue frontend.FontSource type

type ImageNode

type ImageNode struct {
	Value *node.Image
}

ImageNode wraps the node.Image type

type Imagefile

type Imagefile struct {
	Value *pdf.Imagefile
}

Imagefile wraps the baseline-pdf Imagefile type

type Language

type Language struct {
	Value *lang.Lang
}

Language wraps the boxesandglue lang.Lang type

type Page

type Page struct {
	Value *document.Page
}

Page wraps the boxesandglue document.Page type

type PageInfo

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

PageInfo wraps an htmlbag.CSSBuilder to expose page layout and CSS information to Lua callbacks.

type SVGDocument

type SVGDocument struct {
	Value *svgreader.Document
}

SVGDocument wraps a parsed svgreader.Document for Lua.

type SVGNode

type SVGNode struct {
	Value *node.Rule
}

SVGNode wraps a node.Rule containing rendered SVG content. The Value field is discovered by extractNodeViaReflection, so SVGNode works automatically with node.vpack() and page:output_at().

type StructureElement

type StructureElement struct {
	Value *document.StructureElement
}

StructureElement wraps a document.StructureElement for Lua access.

type Table

type Table struct {
	Value *frontend.Table
}

Table wraps the boxesandglue frontend.Table type

type TableCell

type TableCell struct {
	Value *frontend.TableCell
}

TableCell wraps the boxesandglue frontend.TableCell type

type TableRow

type TableRow struct {
	Value *frontend.TableRow
}

TableRow wraps the boxesandglue frontend.TableRow type

type Text

type Text struct {
	Value *frontend.Text
}

Text wraps the boxesandglue frontend.Text type

type TextSettings

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

TextSettings provides access to Text.Settings

type VList

type VList struct {
	Value *node.VList
}

VList wraps the boxesandglue node.VList type

Jump to

Keyboard shortcuts

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