Documentation
¶
Index ¶
- func BindJsFunc(fn JsFnBinding)
- type ConsoleCallback
- type ConsoleEvArgs
- type DocumentReadyCallback
- type DocumentReadyEvArgs
- type EventDispatcher
- func (_this *EventDispatcher) Add(name string, fn interface{})
- func (_this *EventDispatcher) AddEx(fn interface{}) string
- func (_this *EventDispatcher) Clear()
- func (_this *EventDispatcher) Fire(key string, sender interface{}, param ...interface{})
- func (_this *EventDispatcher) Init(key string) *EventDispatcher
- func (_this *EventDispatcher) IsEmtpy() bool
- func (_this *EventDispatcher) Remove(name string) interface{}
- type FileLoader
- type FrameContext
- type GoFn
- type GoFnContext
- type JsFnBinding
- type JsFunc
- type JsReadyCallback
- type JsReadyEvArgs
- type LoadFailEvArgs
- type LoadResource
- type Miniblink
- type MiniblinkBrowser
- func (_this *MiniblinkBrowser) CallJsFunc(name string, param ...interface{}) interface{}
- func (_this *MiniblinkBrowser) GetMiniblinkHandle() uintptr
- func (_this *MiniblinkBrowser) Init() *MiniblinkBrowser
- func (_this *MiniblinkBrowser) JsFunc(name string, fn GoFn, state interface{})
- func (_this *MiniblinkBrowser) JsFuncEx(name string, fn interface{})
- func (_this *MiniblinkBrowser) LoadHtmlWithBaseUrl(html, baseUrl string)
- func (_this *MiniblinkBrowser) LoadUri(uri string)
- func (_this *MiniblinkBrowser) MouseEnable(b bool)
- func (_this *MiniblinkBrowser) MouseIsEnable() bool
- func (_this *MiniblinkBrowser) SetBmpPaintMode(b bool)
- func (_this *MiniblinkBrowser) SetLocalStorageFullPath(path string)
- func (_this *MiniblinkBrowser) SetProxy(info ProxyInfo)
- func (_this *MiniblinkBrowser) SetUserAgent(userAgent string)
- func (_this *MiniblinkBrowser) ShowDevTools(path string)
- func (_this *MiniblinkBrowser) ToBitmap() *image.RGBA
- type MiniblinkForm
- type PaintUpdatedCallback
- type PaintUpdatedEvArgs
- type ProxyInfo
- type ProxyType
- type RequestBeforeCallback
- type RequestBeforeEvArgs
- type ResponseCallback
- type ResponseEvArgs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ConsoleEvArgs ¶
type DocumentReadyCallback ¶
type DocumentReadyCallback func(args DocumentReadyEvArgs)
DocumentReadyCallback 文档就绪回调函数类型
type DocumentReadyEvArgs ¶
type DocumentReadyEvArgs interface {
FrameContext
}
type EventDispatcher ¶
type EventDispatcher struct {
// contains filtered or unexported fields
}
EventDispatcher 事件分发器,用于管理和触发事件
func (*EventDispatcher) Add ¶
func (_this *EventDispatcher) Add(name string, fn interface{})
添加事件处理器
func (*EventDispatcher) AddEx ¶
func (_this *EventDispatcher) AddEx(fn interface{}) string
添加事件处理器并返回自动生成的名称
func (*EventDispatcher) Fire ¶
func (_this *EventDispatcher) Fire(key string, sender interface{}, param ...interface{})
触发事件并调用所有注册的处理器
func (*EventDispatcher) Init ¶
func (_this *EventDispatcher) Init(key string) *EventDispatcher
初始化事件分发器
func (*EventDispatcher) Remove ¶
func (_this *EventDispatcher) Remove(name string) interface{}
移除指定名称的事件处理器
type FileLoader ¶
type FileLoader struct {
// contains filtered or unexported fields
}
FileLoader 文件资源加载器实现
type FrameContext ¶
type GoFn ¶
type GoFn func(context GoFnContext) interface{}
type GoFnContext ¶
GoFnContext Go 函数调用上下文
type JsFnBinding ¶
type JsFnBinding struct {
Name string
Fn GoFn
State interface{}
// contains filtered or unexported fields
}
JsFnBinding JavaScript 函数绑定信息
func (*JsFnBinding) Call ¶
func (_this *JsFnBinding) Call(mb Miniblink, param []interface{}) interface{}
调用绑定的 JavaScript 函数
type JsReadyCallback ¶
type JsReadyCallback func(args JsReadyEvArgs)
JsReadyCallback JavaScript 就绪回调函数类型
type JsReadyEvArgs ¶
type JsReadyEvArgs interface {
FrameContext
}
type LoadFailEvArgs ¶
type LoadFailEvArgs interface {
RequestBefore() RequestBeforeEvArgs
}
type Miniblink ¶
type Miniblink interface {
SetBmpPaintMode(b bool)
SetProxy(info ProxyInfo)
MouseIsEnable() bool
MouseEnable(b bool)
ToBitmap() *image.RGBA
CallJsFunc(name string, param []interface{}) interface{}
JsFunc(name string, fn GoFn, state interface{})
RunJs(script string) interface{}
SetOnConsole(callback ConsoleCallback)
SetOnJsReady(callback JsReadyCallback)
SetOnRequestBefore(callback RequestBeforeCallback)
SetOnDocumentReady(callback DocumentReadyCallback)
SetOnPaintUpdated(callback PaintUpdatedCallback)
LoadUri(uri string)
LoadHtmlWithBaseUrl(html, baseUrl string)
GetHandle() wkeHandle
ShowDevTools(path string)
SetLocalStorageFullPath(path string)
SetUserAgent(userAgent string)
}
Miniblink Miniblink 浏览器接口
type MiniblinkBrowser ¶
type MiniblinkBrowser struct {
cs.Control
EvRequestBefore map[string]func(sender *MiniblinkBrowser, e RequestBeforeEvArgs)
OnRequestBefore func(e RequestBeforeEvArgs)
EvJsReady map[string]func(sender *MiniblinkBrowser, e JsReadyEvArgs)
OnJsReady func(e JsReadyEvArgs)
EvConsole map[string]func(sender *MiniblinkBrowser, e ConsoleEvArgs)
OnConsole func(e ConsoleEvArgs)
EvDocumentReady map[string]func(sender *MiniblinkBrowser, e DocumentReadyEvArgs)
OnDocumentReady func(e DocumentReadyEvArgs)
EvPaintUpdated map[string]func(sender *MiniblinkBrowser, e PaintUpdatedEvArgs)
OnPaintUpdated func(e PaintUpdatedEvArgs)
ResourceLoader []LoadResource
// contains filtered or unexported fields
}
MiniblinkBrowser 浏览器控件,封装了 Miniblink 核心功能
func (*MiniblinkBrowser) CallJsFunc ¶
func (_this *MiniblinkBrowser) CallJsFunc(name string, param ...interface{}) interface{}
调用 JavaScript 函数并返回结果
func (*MiniblinkBrowser) GetMiniblinkHandle ¶
func (_this *MiniblinkBrowser) GetMiniblinkHandle() uintptr
获取底层的 miniblink 句柄
func (*MiniblinkBrowser) JsFunc ¶
func (_this *MiniblinkBrowser) JsFunc(name string, fn GoFn, state interface{})
绑定 Go 函数为 JavaScript 全局函数
func (*MiniblinkBrowser) JsFuncEx ¶
func (_this *MiniblinkBrowser) JsFuncEx(name string, fn interface{})
使用反射绑定任意 Go 函数为 JavaScript 全局函数
func (*MiniblinkBrowser) LoadHtmlWithBaseUrl ¶
func (_this *MiniblinkBrowser) LoadHtmlWithBaseUrl(html, baseUrl string)
加载 HTML 内容并指定基础 URL
func (*MiniblinkBrowser) MouseIsEnable ¶
func (_this *MiniblinkBrowser) MouseIsEnable() bool
检查鼠标事件是否启用
func (*MiniblinkBrowser) SetBmpPaintMode ¶
func (_this *MiniblinkBrowser) SetBmpPaintMode(b bool)
设置是否使用位图绘制模式
func (*MiniblinkBrowser) SetLocalStorageFullPath ¶
func (_this *MiniblinkBrowser) SetLocalStorageFullPath(path string)
设置本地存储的完整路径
func (*MiniblinkBrowser) SetUserAgent ¶
func (_this *MiniblinkBrowser) SetUserAgent(userAgent string)
设置 HTTP 请求的 User-Agent 字符串
func (*MiniblinkBrowser) ShowDevTools ¶
func (_this *MiniblinkBrowser) ShowDevTools(path string)
显示开发者工具
func (*MiniblinkBrowser) ToBitmap ¶
func (_this *MiniblinkBrowser) ToBitmap() *image.RGBA
将 webview 内容转换为位图
type MiniblinkForm ¶
type MiniblinkForm struct {
cs.Form
View *MiniblinkBrowser
// contains filtered or unexported fields
}
MiniblinkForm 包含 Miniblink 浏览器的窗体
func (*MiniblinkForm) InitEx ¶
func (_this *MiniblinkForm) InitEx(param br.FormParam) *MiniblinkForm
使用指定参数初始化窗体
func (*MiniblinkForm) SetSizeAndPosition ¶
func (_this *MiniblinkForm) SetSizeAndPosition(width, height, position int)
SetSizeAndPosition 根据数字小键盘布局设置窗口大小和位置 position: 1-9 对应数字小键盘布局 7 8 9 左上 上中 右上 4 5 6 左中 中间 右中 1 2 3 左下 下中 右下 设置窗体大小和位置
type PaintUpdatedCallback ¶
type PaintUpdatedCallback func(args PaintUpdatedEvArgs)
PaintUpdatedCallback 绘制更新回调函数类型
type PaintUpdatedEvArgs ¶
type RequestBeforeCallback ¶
type RequestBeforeCallback func(args RequestBeforeEvArgs)
RequestBeforeCallback 请求前回调函数类型
type RequestBeforeEvArgs ¶
type RequestBeforeEvArgs interface {
Url() string
Method() string
SetData([]byte)
Data() []byte
SetCancel(b bool)
ResetUrl(url string)
SetHeader(name, value string)
/**
内容最终呈现时触发
args:intf, ResponseEvArgs
*/
EvResponse() *EventDispatcher
/**
加载失败时触发
args:intf, LoadFailEvArgs
*/
EvLoadFail() *EventDispatcher
/**
请求流程全部完成时触发
args:intf, RequestBeforeEvArgs
*/
EvFinish() *EventDispatcher
}