bridge

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2021 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExportFunc

func ExportFunc(fn interface{}) *rpc_FuncExport

func Invoke

func Invoke(ptr string) error

func Release

func Release(p *rpc.Peer, v interface{}) error

func Run

func Run()

func SetHandle

func SetHandle(v interface{}, h string)

func Sync

func Sync(p *rpc.Peer, v interface{}) error

func Walk

func Walk(v interface{}, visitor func(v reflect.Value, parent reflect.Value, path []string) error) error

Types

type Color

type Color struct {
	R float64
	G float64
	B float64
	A float64
}

func (*Color) NSColor

func (c *Color) NSColor() cocoa.NSColor

type Handle

type Handle string

func NewHandle

func NewHandle(type_ string) Handle

func (Handle) ID

func (h Handle) ID() string

func (Handle) Init

func (h Handle) Init() (reflect.Value, error)

func (Handle) String

func (h Handle) String() string

func (Handle) Type

func (h Handle) Type() string

type Host

type Host struct {
	Cmd  *exec.Cmd
	Pipe io.ReadWriteCloser
}

func NewHost

func NewHost(stderr io.Writer) (*Host, error)

func (*Host) Run

func (h *Host) Run() error
type Menu struct {
	Icon    string
	Title   string
	Tooltip string
	Items   []MenuItem
	// contains filtered or unexported fields
}
func (m *Menu) Apply(old, new reflect.Value, target objc.Object) (objc.Object, error)
func (r *Menu) Handle() Handle
type MenuItem struct {
	Title     string
	Icon      string
	Tooltip   string
	Separator bool
	Enabled   bool
	Checked   bool
	OnClick   *rpc_FuncExport
}
func (i *MenuItem) NSMenuItem() cocoa.NSMenuItem

type Point

type Point struct {
	X float64
	Y float64
}

func (*Point) NSPoint

func (p *Point) NSPoint() core.NSPoint

type Resource

type Resource interface {
	Handle() Handle
	Apply(old, new reflect.Value, target objc.Object) (objc.Object, error)
}

type Size

type Size struct {
	W float64
	H float64
}

func (*Size) NSSize

func (s *Size) NSSize() core.NSSize

type State

type State struct {
	Menus       []*Menu
	StatusItems []*StatusItem
	Windows     []*Window

	sync.Mutex
	// contains filtered or unexported fields
}

func NewState

func NewState() *State

func (*State) Apply

func (s *State) Apply(h string, patch interface{}, call *rpc.Call) (handle Handle, err error)

func (*State) Lookup

func (s *State) Lookup(handle Handle) (found reflect.Value, err error)

func (*State) Reconcile

func (s *State) Reconcile() error

func (*State) Release

func (s *State) Release(h string) (err error)

type StatusItem

type StatusItem struct {
	Icon string
	Text string
	Menu *Menu
	// contains filtered or unexported fields
}

func (*StatusItem) Apply

func (s *StatusItem) Apply(old, new reflect.Value, target objc.Object) (objc.Object, error)

func (*StatusItem) Handle

func (r *StatusItem) Handle() Handle

type Window

type Window struct {
	Title        string
	Position     Point
	Size         Size
	Closable     bool
	Minimizable  bool
	Resizable    bool
	Background   *Color
	Borderless   bool
	CornerRadius float64
	AlwaysOnTop  bool
	IgnoreMouse  bool
	Center       bool
	URL          string
	Image        string
	// contains filtered or unexported fields
}

func (*Window) Apply

func (w *Window) Apply(old, new reflect.Value, target objc.Object) (objc.Object, error)

func (*Window) Handle

func (r *Window) Handle() Handle

Jump to

Keyboard shortcuts

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