canvas

package
v0.1.21 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2026 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package canvas provides helpers for the plugin canvas stream protocol.

Index

Constants

View Source
const (
	PanelThemeLight = plugin.PanelThemeLight
	PanelThemeDark  = plugin.PanelThemeDark
)
View Source
const (
	PointerDown   = "pointerdown"
	PointerMove   = "pointermove"
	PointerUp     = "pointerup"
	PointerCancel = "pointercancel"
)

Variables

View Source
var ErrInvalidInput = plugin.ErrInvalidInput

Functions

func WriteFrame

func WriteFrame(w io.Writer, frame Frame) error

Types

type Announce

type Announce struct {
	Text string       `json:"text,omitempty"`
	Mode AnnounceMode `json:"mode,omitempty"`
}

func (Announce) MarshalJSON

func (c Announce) MarshalJSON() ([]byte, error)

type AnnounceMode

type AnnounceMode string
const (
	AnnouncePolite    AnnounceMode = "polite"
	AnnounceAssertive AnnounceMode = "assertive"
)

type Arc

type Arc struct {
	Paint
	X                float64 `json:"x,omitempty"`
	Y                float64 `json:"y,omitempty"`
	Radius           float64 `json:"radius,omitempty"`
	StartAngle       float64 `json:"startAngle,omitempty"`
	EndAngle         float64 `json:"endAngle,omitempty"`
	CounterClockwise bool    `json:"counterclockwise,omitempty"`
}

func (Arc) MarshalJSON

func (c Arc) MarshalJSON() ([]byte, error)

type BezierCurve

type BezierCurve struct {
	Paint
	X0   float64 `json:"x0,omitempty"`
	Y0   float64 `json:"y0,omitempty"`
	CP1X float64 `json:"cp1x,omitempty"`
	CP1Y float64 `json:"cp1y,omitempty"`
	CP2X float64 `json:"cp2x,omitempty"`
	CP2Y float64 `json:"cp2y,omitempty"`
	X    float64 `json:"x,omitempty"`
	Y    float64 `json:"y,omitempty"`
}

func (BezierCurve) MarshalJSON

func (c BezierCurve) MarshalJSON() ([]byte, error)

type Circle

type Circle struct {
	Paint
	X      float64 `json:"x,omitempty"`
	Y      float64 `json:"y,omitempty"`
	Radius float64 `json:"radius,omitempty"`
}

func (Circle) MarshalJSON

func (c Circle) MarshalJSON() ([]byte, error)

type Clear

type Clear struct {
	Color  string  `json:"color,omitempty"`
	X      float64 `json:"x,omitempty"`
	Y      float64 `json:"y,omitempty"`
	Width  float64 `json:"width,omitempty"`
	Height float64 `json:"height,omitempty"`
}

func (Clear) MarshalJSON

func (c Clear) MarshalJSON() ([]byte, error)

type Clip

type Clip struct {
	Shape    RegionShape `json:"shape,omitempty"`
	D        string      `json:"d,omitempty"`
	X        float64     `json:"x,omitempty"`
	Y        float64     `json:"y,omitempty"`
	Width    float64     `json:"width,omitempty"`
	Height   float64     `json:"height,omitempty"`
	Radius   float64     `json:"radius,omitempty"`
	Radii    *Radii      `json:"radii,omitempty"`
	Points   []Point     `json:"points,omitempty"`
	FillRule FillRule    `json:"fillRule,omitempty"`
}

func (Clip) MarshalJSON

func (c Clip) MarshalJSON() ([]byte, error)

type Command

type Command interface {
	// contains filtered or unexported methods
}

type CommandType

type CommandType string
const (
	CommandClear          CommandType = "clear"
	CommandSet            CommandType = "set"
	CommandRegions        CommandType = "regions"
	CommandSave           CommandType = "save"
	CommandRestore        CommandType = "restore"
	CommandResetTransform CommandType = "resetTransform"
	CommandTranslate      CommandType = "translate"
	CommandScale          CommandType = "scale"
	CommandRotate         CommandType = "rotate"
	CommandTransform      CommandType = "transform"
	CommandStyle          CommandType = "style"
	CommandResetStyle     CommandType = "resetStyle"
	CommandLineDash       CommandType = "lineDash"
	CommandShadow         CommandType = "shadow"
	CommandGradient       CommandType = "gradient"
	CommandPattern        CommandType = "pattern"
	CommandClip           CommandType = "clip"
	CommandRect           CommandType = "rect"
	CommandLine           CommandType = "line"
	CommandPolyline       CommandType = "polyline"
	CommandPolygon        CommandType = "polygon"
	CommandArc            CommandType = "arc"
	CommandQuadraticCurve CommandType = "quadraticCurve"
	CommandBezierCurve    CommandType = "bezierCurve"
	CommandCircle         CommandType = "circle"
	CommandEllipse        CommandType = "ellipse"
	CommandPath           CommandType = "path"
	CommandText           CommandType = "text"
	CommandFillText       CommandType = "fillText"
	CommandStrokeText     CommandType = "strokeText"
	CommandTextBox        CommandType = "textBox"
	CommandMeasureText    CommandType = "measureText"
	CommandImage          CommandType = "image"
	CommandImageData      CommandType = "imageData"
	CommandSnapshot       CommandType = "snapshot"
	CommandCursor         CommandType = "cursor"
	CommandFocusRegion    CommandType = "focusRegion"
	CommandAnnounce       CommandType = "announce"
)

type CompositeOperation

type CompositeOperation string
const (
	CompositeSourceOver      CompositeOperation = "source-over"
	CompositeSourceIn        CompositeOperation = "source-in"
	CompositeSourceOut       CompositeOperation = "source-out"
	CompositeSourceAtop      CompositeOperation = "source-atop"
	CompositeDestinationOver CompositeOperation = "destination-over"
	CompositeDestinationIn   CompositeOperation = "destination-in"
	CompositeDestinationOut  CompositeOperation = "destination-out"
	CompositeDestinationAtop CompositeOperation = "destination-atop"
	CompositeLighter         CompositeOperation = "lighter"
	CompositeCopy            CompositeOperation = "copy"
	CompositeXOR             CompositeOperation = "xor"
	CompositeMultiply        CompositeOperation = "multiply"
	CompositeScreen          CompositeOperation = "screen"
	CompositeOverlay         CompositeOperation = "overlay"
	CompositeDarken          CompositeOperation = "darken"
	CompositeLighten         CompositeOperation = "lighten"
	CompositeColorDodge      CompositeOperation = "color-dodge"
	CompositeColorBurn       CompositeOperation = "color-burn"
	CompositeHardLight       CompositeOperation = "hard-light"
	CompositeSoftLight       CompositeOperation = "soft-light"
	CompositeDifference      CompositeOperation = "difference"
	CompositeExclusion       CompositeOperation = "exclusion"
	CompositeHue             CompositeOperation = "hue"
	CompositeSaturation      CompositeOperation = "saturation"
	CompositeColor           CompositeOperation = "color"
	CompositeLuminosity      CompositeOperation = "luminosity"
)

type Cursor

type Cursor struct {
	Value string `json:"value,omitempty"`
}

func (Cursor) MarshalJSON

func (c Cursor) MarshalJSON() ([]byte, error)

type Ellipse

type Ellipse struct {
	Paint
	X        float64 `json:"x,omitempty"`
	Y        float64 `json:"y,omitempty"`
	RadiusX  float64 `json:"radiusX,omitempty"`
	RadiusY  float64 `json:"radiusY,omitempty"`
	Rotation float64 `json:"rotation,omitempty"`
}

func (Ellipse) MarshalJSON

func (c Ellipse) MarshalJSON() ([]byte, error)

type Event

type Event interface {
	EventType() EventType
	// contains filtered or unexported methods
}

func DecodeEvent

func DecodeEvent(r io.Reader) (Event, error)

func ParseEvent

func ParseEvent(data []byte) (Event, error)

type EventType

type EventType string
const (
	EventReady    EventType = "ready"
	EventResize   EventType = "resize"
	EventPointer  EventType = "pointer"
	EventWheel    EventType = "wheel"
	EventKey      EventType = "key"
	EventMetrics  EventType = "textMetrics"
	EventSnapshot EventType = "snapshot"
)

type FillRule

type FillRule string
const (
	FillRuleNonZero FillRule = "nonzero"
	FillRuleEvenOdd FillRule = "evenodd"
)

type FillText

type FillText struct {
	Paint
	X        float64  `json:"x,omitempty"`
	Y        float64  `json:"y,omitempty"`
	Text     string   `json:"text,omitempty"`
	MaxWidth *float64 `json:"maxWidth,omitempty"`
}

func (FillText) MarshalJSON

func (c FillText) MarshalJSON() ([]byte, error)

type FocusRegion

type FocusRegion struct {
	ID string `json:"id,omitempty"`
}

func (FocusRegion) MarshalJSON

func (c FocusRegion) MarshalJSON() ([]byte, error)

type Frame

type Frame struct {
	Commands []Command `json:"commands,omitempty"`
	Regions  []Region  `json:"regions,omitempty"`
}

type Gradient

type Gradient struct {
	ID         string         `json:"id"`
	Kind       GradientKind   `json:"kind"`
	X0         float64        `json:"x0,omitempty"`
	Y0         float64        `json:"y0,omitempty"`
	X1         float64        `json:"x1,omitempty"`
	Y1         float64        `json:"y1,omitempty"`
	R0         float64        `json:"r0,omitempty"`
	R1         float64        `json:"r1,omitempty"`
	X          float64        `json:"x,omitempty"`
	Y          float64        `json:"y,omitempty"`
	StartAngle float64        `json:"startAngle,omitempty"`
	Stops      []GradientStop `json:"stops,omitempty"`
}

func (Gradient) MarshalJSON

func (c Gradient) MarshalJSON() ([]byte, error)

type GradientKind

type GradientKind string
const (
	GradientLinear GradientKind = "linear"
	GradientRadial GradientKind = "radial"
	GradientConic  GradientKind = "conic"
)

type GradientStop

type GradientStop struct {
	Offset float64 `json:"offset"`
	Color  string  `json:"color"`
}

type Image

type Image struct {
	Paint
	Src          string  `json:"src,omitempty"`
	X            float64 `json:"x,omitempty"`
	Y            float64 `json:"y,omitempty"`
	Width        float64 `json:"width,omitempty"`
	Height       float64 `json:"height,omitempty"`
	SourceX      float64 `json:"sourceX,omitempty"`
	SourceY      float64 `json:"sourceY,omitempty"`
	SourceWidth  float64 `json:"sourceWidth,omitempty"`
	SourceHeight float64 `json:"sourceHeight,omitempty"`
	Smoothing    *bool   `json:"smoothing,omitempty"`
}

func (Image) MarshalJSON

func (c Image) MarshalJSON() ([]byte, error)

type ImageData

type ImageData struct {
	X      float64 `json:"x,omitempty"`
	Y      float64 `json:"y,omitempty"`
	Width  int     `json:"width,omitempty"`
	Height int     `json:"height,omitempty"`
	Data   []int   `json:"data,omitempty"`
}

func (ImageData) MarshalJSON

func (c ImageData) MarshalJSON() ([]byte, error)

type KeyEvent

type KeyEvent struct {
	Type      EventType     `json:"type"`
	Event     string        `json:"event"`
	Key       string        `json:"key"`
	Code      string        `json:"code"`
	Repeat    bool          `json:"repeat,omitempty"`
	Modifiers ModifierState `json:"modifiers,omitempty"`
}

func (KeyEvent) EventType

func (KeyEvent) EventType() EventType

type Line

type Line struct {
	Paint
	X1 float64 `json:"x1,omitempty"`
	Y1 float64 `json:"y1,omitempty"`
	X2 float64 `json:"x2,omitempty"`
	Y2 float64 `json:"y2,omitempty"`
}

func (Line) MarshalJSON

func (c Line) MarshalJSON() ([]byte, error)

type LineCap

type LineCap string
const (
	LineCapButt   LineCap = "butt"
	LineCapRound  LineCap = "round"
	LineCapSquare LineCap = "square"
)

type LineDash

type LineDash struct {
	Segments []float64 `json:"segments,omitempty"`
	Offset   float64   `json:"offset,omitempty"`
}

func (LineDash) MarshalJSON

func (c LineDash) MarshalJSON() ([]byte, error)

type LineJoin

type LineJoin string
const (
	LineJoinBevel LineJoin = "bevel"
	LineJoinRound LineJoin = "round"
	LineJoinMiter LineJoin = "miter"
)

type MeasureText

type MeasureText struct {
	RequestID string `json:"requestId,omitempty"`
	Text      string `json:"text,omitempty"`
	Font      string `json:"font,omitempty"`
}

func (MeasureText) MarshalJSON

func (c MeasureText) MarshalJSON() ([]byte, error)

type ModifierState

type ModifierState struct {
	Alt   bool `json:"alt,omitempty"`
	Ctrl  bool `json:"ctrl,omitempty"`
	Meta  bool `json:"meta,omitempty"`
	Shift bool `json:"shift,omitempty"`
}

type Paint

type Paint struct {
	Fill         string             `json:"fill,omitempty"`
	Stroke       string             `json:"stroke,omitempty"`
	LineWidth    float64            `json:"lineWidth,omitempty"`
	Font         string             `json:"font,omitempty"`
	Alpha        *float64           `json:"alpha,omitempty"`
	Composite    CompositeOperation `json:"composite,omitempty"`
	LineCap      LineCap            `json:"lineCap,omitempty"`
	LineJoin     LineJoin           `json:"lineJoin,omitempty"`
	TextAlign    TextAlign          `json:"textAlign,omitempty"`
	TextBaseline TextBaseline       `json:"textBaseline,omitempty"`
	FillID       string             `json:"fillId,omitempty"`
	StrokeID     string             `json:"strokeId,omitempty"`
	Filter       string             `json:"filter,omitempty"`
	Direction    string             `json:"direction,omitempty"`
	MiterLimit   *float64           `json:"miterLimit,omitempty"`

	NoFill   bool `json:"-"`
	NoStroke bool `json:"-"`
}

type PanelTheme

type PanelTheme = plugin.PanelTheme

type Path

type Path struct {
	Paint
	D        string   `json:"d,omitempty"`
	FillRule FillRule `json:"fillRule,omitempty"`
}

func (Path) MarshalJSON

func (c Path) MarshalJSON() ([]byte, error)

type Pattern

type Pattern struct {
	ID         string `json:"id"`
	Src        string `json:"src"`
	Repetition string `json:"repetition,omitempty"`
}

func (Pattern) MarshalJSON

func (c Pattern) MarshalJSON() ([]byte, error)

type Point

type Point struct {
	X float64 `json:"x"`
	Y float64 `json:"y"`
}

type PointerEvent

type PointerEvent struct {
	Type        EventType     `json:"type"`
	Event       string        `json:"event"`
	X           float64       `json:"x"`
	Y           float64       `json:"y"`
	Button      int           `json:"button,omitempty"`
	Buttons     int           `json:"buttons,omitempty"`
	PointerID   int           `json:"pointerId,omitempty"`
	PointerType string        `json:"pointerType,omitempty"`
	RegionID    string        `json:"regionId,omitempty"`
	Modifiers   ModifierState `json:"modifiers,omitempty"`
}

func (PointerEvent) EventType

func (PointerEvent) EventType() EventType

type Polygon

type Polygon struct {
	Paint
	Points []Point `json:"points,omitempty"`
}

func (Polygon) MarshalJSON

func (c Polygon) MarshalJSON() ([]byte, error)

type Polyline

type Polyline struct {
	Paint
	Points []Point `json:"points,omitempty"`
}

func (Polyline) MarshalJSON

func (c Polyline) MarshalJSON() ([]byte, error)

type QuadraticCurve

type QuadraticCurve struct {
	Paint
	X0  float64 `json:"x0,omitempty"`
	Y0  float64 `json:"y0,omitempty"`
	CPX float64 `json:"cpx,omitempty"`
	CPY float64 `json:"cpy,omitempty"`
	X   float64 `json:"x,omitempty"`
	Y   float64 `json:"y,omitempty"`
}

func (QuadraticCurve) MarshalJSON

func (c QuadraticCurve) MarshalJSON() ([]byte, error)

type Radii

type Radii struct {
	TopLeft     float64 `json:"topLeft,omitempty"`
	TopRight    float64 `json:"topRight,omitempty"`
	BottomRight float64 `json:"bottomRight,omitempty"`
	BottomLeft  float64 `json:"bottomLeft,omitempty"`
}

type RawCommand

type RawCommand struct {
	Type   CommandType    `json:"type"`
	Fields map[string]any `json:"-"`
}

func (RawCommand) MarshalJSON

func (c RawCommand) MarshalJSON() ([]byte, error)

type ReadyEvent

type ReadyEvent struct {
	Type           EventType  `json:"type"`
	Width          float64    `json:"width"`
	Height         float64    `json:"height"`
	ViewportWidth  float64    `json:"viewportWidth,omitempty"`
	ViewportHeight float64    `json:"viewportHeight,omitempty"`
	Scale          float64    `json:"scale,omitempty"`
	DPR            float64    `json:"dpr"`
	Theme          PanelTheme `json:"theme,omitempty"`
}

func (ReadyEvent) EventType

func (ReadyEvent) EventType() EventType

type Rect

type Rect struct {
	Paint
	X      float64 `json:"x,omitempty"`
	Y      float64 `json:"y,omitempty"`
	Width  float64 `json:"width,omitempty"`
	Height float64 `json:"height,omitempty"`
	Radius float64 `json:"radius,omitempty"`
	Radii  *Radii  `json:"radii,omitempty"`
}

func (Rect) MarshalJSON

func (c Rect) MarshalJSON() ([]byte, error)

type Region

type Region struct {
	ID             string      `json:"id"`
	Shape          RegionShape `json:"shape,omitempty"`
	X              float64     `json:"x"`
	Y              float64     `json:"y"`
	Width          float64     `json:"width,omitempty"`
	Height         float64     `json:"height,omitempty"`
	Radius         float64     `json:"radius,omitempty"`
	Radii          *Radii      `json:"radii,omitempty"`
	Points         []Point     `json:"points,omitempty"`
	D              string      `json:"d,omitempty"`
	Cursor         string      `json:"cursor,omitempty"`
	Label          string      `json:"label,omitempty"`
	CapturePointer bool        `json:"capturePointer,omitempty"`
}

func CircleRegion

func CircleRegion(id string, x, y, radius float64, opts ...RegionOption) Region

func PathRegion

func PathRegion(id, d string, opts ...RegionOption) Region

func PolygonRegion

func PolygonRegion(id string, points []Point, opts ...RegionOption) Region

func RectRegion

func RectRegion(id string, x, y, width, height float64, opts ...RegionOption) Region

type RegionOption

type RegionOption func(*Region)

func WithCapturePointer

func WithCapturePointer() RegionOption

func WithCursor

func WithCursor(cursor string) RegionOption

func WithLabel

func WithLabel(label string) RegionOption

func WithRadii

func WithRadii(radii Radii) RegionOption

func WithRadius

func WithRadius(radius float64) RegionOption

type RegionShape

type RegionShape string
const (
	RegionRect    RegionShape = "rect"
	RegionCircle  RegionShape = "circle"
	RegionPolygon RegionShape = "polygon"
	RegionPath    RegionShape = "path"
)

type Regions

type Regions struct {
	Items []Region `json:"items,omitempty"`
}

func (Regions) MarshalJSON

func (c Regions) MarshalJSON() ([]byte, error)

type ResetStyle

type ResetStyle struct{}

func (ResetStyle) MarshalJSON

func (c ResetStyle) MarshalJSON() ([]byte, error)

type ResetTransform

type ResetTransform struct{}

func (ResetTransform) MarshalJSON

func (c ResetTransform) MarshalJSON() ([]byte, error)

type ResizeEvent

type ResizeEvent struct {
	Type           EventType  `json:"type"`
	Width          float64    `json:"width"`
	Height         float64    `json:"height"`
	ViewportWidth  float64    `json:"viewportWidth,omitempty"`
	ViewportHeight float64    `json:"viewportHeight,omitempty"`
	Scale          float64    `json:"scale,omitempty"`
	DPR            float64    `json:"dpr"`
	Theme          PanelTheme `json:"theme,omitempty"`
}

func (ResizeEvent) EventType

func (ResizeEvent) EventType() EventType

type Restore

type Restore struct{}

func (Restore) MarshalJSON

func (c Restore) MarshalJSON() ([]byte, error)

type Rotate

type Rotate struct {
	Angle float64 `json:"angle,omitempty"`
}

func (Rotate) MarshalJSON

func (c Rotate) MarshalJSON() ([]byte, error)

type Save

type Save struct{}

func (Save) MarshalJSON

func (c Save) MarshalJSON() ([]byte, error)

type Scale

type Scale struct {
	X float64 `json:"x,omitempty"`
	Y float64 `json:"y,omitempty"`
}

func (Scale) MarshalJSON

func (c Scale) MarshalJSON() ([]byte, error)

type Set

type Set struct {
	Background string   `json:"background,omitempty"`
	Cursor     string   `json:"cursor,omitempty"`
	Regions    []Region `json:"regions,omitempty"`
}

func (Set) MarshalJSON

func (c Set) MarshalJSON() ([]byte, error)

type Shadow

type Shadow struct {
	Color   string  `json:"color,omitempty"`
	Blur    float64 `json:"blur,omitempty"`
	OffsetX float64 `json:"offsetX,omitempty"`
	OffsetY float64 `json:"offsetY,omitempty"`
}

func (Shadow) MarshalJSON

func (c Shadow) MarshalJSON() ([]byte, error)

type Snapshot

type Snapshot struct {
	RequestID     string  `json:"requestId,omitempty"`
	MIME          string  `json:"mime,omitempty"`
	Quality       float64 `json:"quality,omitempty"`
	MinIntervalMs int     `json:"minIntervalMs,omitempty"`
}

func (Snapshot) MarshalJSON

func (c Snapshot) MarshalJSON() ([]byte, error)

type SnapshotEvent

type SnapshotEvent struct {
	Type      EventType `json:"type"`
	RequestID string    `json:"requestId,omitempty"`
	MIME      string    `json:"mime,omitempty"`
	DataURL   string    `json:"dataUrl,omitempty"`
	Width     float64   `json:"width,omitempty"`
	Height    float64   `json:"height,omitempty"`
}

func (SnapshotEvent) EventType

func (SnapshotEvent) EventType() EventType

type StrokeText

type StrokeText struct {
	Paint
	X        float64  `json:"x,omitempty"`
	Y        float64  `json:"y,omitempty"`
	Text     string   `json:"text,omitempty"`
	MaxWidth *float64 `json:"maxWidth,omitempty"`
}

func (StrokeText) MarshalJSON

func (c StrokeText) MarshalJSON() ([]byte, error)

type Style

type Style struct {
	Paint
}

func (Style) MarshalJSON

func (c Style) MarshalJSON() ([]byte, error)

type Text

type Text struct {
	Paint
	X        float64  `json:"x,omitempty"`
	Y        float64  `json:"y,omitempty"`
	Text     string   `json:"text,omitempty"`
	MaxWidth *float64 `json:"maxWidth,omitempty"`
}

func (Text) MarshalJSON

func (c Text) MarshalJSON() ([]byte, error)

type TextAlign

type TextAlign string
const (
	TextAlignStart  TextAlign = "start"
	TextAlignEnd    TextAlign = "end"
	TextAlignLeft   TextAlign = "left"
	TextAlignRight  TextAlign = "right"
	TextAlignCenter TextAlign = "center"
)

type TextBaseline

type TextBaseline string
const (
	TextBaselineTop         TextBaseline = "top"
	TextBaselineHanging     TextBaseline = "hanging"
	TextBaselineMiddle      TextBaseline = "middle"
	TextBaselineAlphabetic  TextBaseline = "alphabetic"
	TextBaselineIdeographic TextBaseline = "ideographic"
	TextBaselineBottom      TextBaseline = "bottom"
)

type TextBox

type TextBox struct {
	Paint
	X             float64           `json:"x,omitempty"`
	Y             float64           `json:"y,omitempty"`
	Width         float64           `json:"width,omitempty"`
	Height        float64           `json:"height,omitempty"`
	LineHeight    float64           `json:"lineHeight,omitempty"`
	Padding       float64           `json:"padding,omitempty"`
	MaxLines      int               `json:"maxLines,omitempty"`
	Ellipsis      string            `json:"ellipsis,omitempty"`
	VerticalAlign TextVerticalAlign `json:"verticalAlign,omitempty"`
	Background    string            `json:"background,omitempty"`
	BackgroundID  string            `json:"backgroundId,omitempty"`
	Radius        float64           `json:"radius,omitempty"`
	Radii         *Radii            `json:"radii,omitempty"`
	Text          string            `json:"text,omitempty"`
}

func (TextBox) MarshalJSON

func (c TextBox) MarshalJSON() ([]byte, error)

type TextMetricsEvent

type TextMetricsEvent struct {
	Type                     EventType `json:"type"`
	RequestID                string    `json:"requestId,omitempty"`
	Text                     string    `json:"text,omitempty"`
	Width                    float64   `json:"width"`
	ActualBoundingBoxLeft    float64   `json:"actualBoundingBoxLeft,omitempty"`
	ActualBoundingBoxRight   float64   `json:"actualBoundingBoxRight,omitempty"`
	ActualBoundingBoxAscent  float64   `json:"actualBoundingBoxAscent,omitempty"`
	ActualBoundingBoxDescent float64   `json:"actualBoundingBoxDescent,omitempty"`
	FontBoundingBoxAscent    float64   `json:"fontBoundingBoxAscent,omitempty"`
	FontBoundingBoxDescent   float64   `json:"fontBoundingBoxDescent,omitempty"`
	EmHeightAscent           float64   `json:"emHeightAscent,omitempty"`
	EmHeightDescent          float64   `json:"emHeightDescent,omitempty"`
	HangingBaseline          float64   `json:"hangingBaseline,omitempty"`
	AlphabeticBaseline       float64   `json:"alphabeticBaseline,omitempty"`
	IdeographicBaseline      float64   `json:"ideographicBaseline,omitempty"`
}

func (TextMetricsEvent) EventType

func (TextMetricsEvent) EventType() EventType

type TextVerticalAlign

type TextVerticalAlign string
const (
	TextVerticalAlignTop    TextVerticalAlign = "top"
	TextVerticalAlignMiddle TextVerticalAlign = "middle"
	TextVerticalAlignBottom TextVerticalAlign = "bottom"
)

type Transform

type Transform struct {
	A float64 `json:"a"`
	B float64 `json:"b"`
	C float64 `json:"c"`
	D float64 `json:"d"`
	E float64 `json:"e"`
	F float64 `json:"f"`
}

func (Transform) MarshalJSON

func (c Transform) MarshalJSON() ([]byte, error)

type Translate

type Translate struct {
	X float64 `json:"x,omitempty"`
	Y float64 `json:"y,omitempty"`
}

func (Translate) MarshalJSON

func (c Translate) MarshalJSON() ([]byte, error)

type WheelEvent

type WheelEvent struct {
	Type      EventType     `json:"type"`
	X         float64       `json:"x"`
	Y         float64       `json:"y"`
	DeltaX    float64       `json:"deltaX"`
	DeltaY    float64       `json:"deltaY"`
	DeltaMode int           `json:"deltaMode,omitempty"`
	Modifiers ModifierState `json:"modifiers,omitempty"`
}

func (WheelEvent) EventType

func (WheelEvent) EventType() EventType

Jump to

Keyboard shortcuts

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