target

package
v2.4.2 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IBrowserWindow added in v2.3.6

type IBrowserWindow interface {
	LookForMainWindow() (window IWindow) //select a new window, This window is the first one created and not closed
}

IBrowserWindow

BrowserWindow for IPC

type IProcessMessage added in v2.3.6

type IProcessMessage interface {
	EmitRender(messageId int32, eventName string, target ITarget, data ...interface{}) bool
	SendProcessMessageForJSONBytes(messageName string, targetProcess consts.CefProcessId, data []byte)
}

IProcessMessage Send IPC Chromium

type ITarget

type ITarget interface {
	BrowserId() int32 // Browser Window ID
	ChannelId() int64 // IPC channelID, frameId or GO IPC channelID
	TargetType() Type // Target type default 0: Trigger JS event
	Window() IWindow  // Send IPC Chromium
}

ITarget

ipc.NewTarget() *Target

func NewTarget

func NewTarget(targetChromium IWindow, browserId int32, channelId int64, targetType ...Type) ITarget

NewTarget Create a new Emit target

targetChromium: current window chromium, Use the main window chromium when nil
browserId: browser window ID
channelId: IPC channelID, frameId or GO IPC channelID
targetType: Optional parameter, target type default 0
  Type: TgJs:JS Event, TgGoSub:GO Sub Event, TgGoMain:GO Main Event

func NewTargetMain added in v2.3.1

func NewTargetMain() ITarget

NewTargetMain Create a new Emit target Main Process

targetType: TgGoMain

type IWindow added in v2.3.6

type IWindow interface {
	Target(targetType ...Type) ITarget // return IPC target
	IsClosing() bool                   // Whether the window is closed
	ProcessMessage() IProcessMessage   // process message, chromium
}

IWindow for IPC

type Target

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

Target Go IPC

receiving target of the event

func (*Target) BrowserId

func (m *Target) BrowserId() int32

BrowserId

return BrowserId

func (*Target) ChannelId

func (m *Target) ChannelId() int64

ChannelId

return ChannelId

func (*Target) TargetType

func (m *Target) TargetType() Type

TargetType

target type
0: Trigger JS event
1: Trigger Go Event

func (*Target) Window added in v2.3.6

func (m *Target) Window() IWindow

Window

return chromium ProcessMessage

type Type

type Type int8

Type

0: Trigger the JS event of the specified target process
1: Trigger TgGoSub events for the specified target sub process
2: Trigger TgGoMain events for the specified target main process
const (
	TgJs     Type = iota //JS Event
	TgGoSub              //GO Event sub
	TgGoMain             //GO Event main
)

Jump to

Keyboard shortcuts

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