Documentation
¶
Overview ¶
Package wka can be used to create native windows that each embed a single WebKit browser. This allows Go applications to present a GUI to users. Static or generated HTML, CSS, javascript, and images are served locally to the web browser. Additionally, users can make use of the JavaScriptCore-go package to have HTML events call back into Go.
Index ¶
- func Main()
- func QuitMain()
- type NetworkRequest
- type NetworkResponse
- type VersionInformation
- type WebFrame
- type WebNavigationAction
- type WebPolicyDecision
- type WebResource
- type WebView
- func (n *WebView) ExecuteScript(script string)
- func (n *WebView) GetEncoding() string
- func (n *WebView) GetMainFrame() *WebFrame
- func (n *WebView) GetTitle() string
- func (n *WebView) GetUri() string
- func (n *WebView) LoadHtml(content string, base_uri string)
- func (n *WebView) LoadUri(uri string)
- func (n *WebView) StopLoading()
- type Window
- func (window *Window) Alert(message string)
- func (w *Window) Encoding() string
- func (window *Window) GetTitle() string
- func (window *Window) LoadHtml(content string, base_uri string)
- func (window *Window) LoadUri(uri string)
- func (window *Window) SetTitle(title string)
- func (window *Window) WebView() *WebView
- type WindowEvents
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type NetworkRequest ¶
type NetworkRequest struct {
// contains filtered or unexported fields
}
See WebKit API documentation.
func NewNetworkRequest ¶
func NewNetworkRequest(uri string) *NetworkRequest
func (*NetworkRequest) GetUri ¶
func (n *NetworkRequest) GetUri() string
func (*NetworkRequest) SetUri ¶
func (n *NetworkRequest) SetUri(uri string)
type NetworkResponse ¶
type NetworkResponse struct {
// contains filtered or unexported fields
}
See WebKit API documentation.
func (*NetworkResponse) GetMessage ¶
func (n *NetworkResponse) GetMessage() unsafe.Pointer
func (*NetworkResponse) GetUri ¶
func (n *NetworkResponse) GetUri() string
func (*NetworkResponse) SetUri ¶
func (n *NetworkResponse) SetUri(uri string)
type VersionInformation ¶
type VersionInformation struct {
Major, Minor, Micro uint
}
A VersionInformation contains standard data for marking the version of a library.
func Version ¶
func Version() VersionInformation
Version returns the version information for the WebKit library being used.
type WebFrame ¶
type WebFrame struct {
// contains filtered or unexported fields
}
See WebKit API documentation.
func (*WebFrame) GetGlobalContext ¶
func (*WebFrame) GetWebView ¶
type WebNavigationAction ¶
type WebNavigationAction struct {
// contains filtered or unexported fields
}
See WebKit API documentation.
func (*WebNavigationAction) GetButton ¶
func (n *WebNavigationAction) GetButton() int
func (*WebNavigationAction) GetOriginalUri ¶
func (n *WebNavigationAction) GetOriginalUri() string
type WebPolicyDecision ¶
type WebPolicyDecision struct {
// contains filtered or unexported fields
}
See WebKit API documentation.
func (*WebPolicyDecision) Download ¶
func (n *WebPolicyDecision) Download()
func (*WebPolicyDecision) Ignore ¶
func (n *WebPolicyDecision) Ignore()
func (*WebPolicyDecision) Use ¶
func (n *WebPolicyDecision) Use()
type WebResource ¶
type WebResource struct {
// contains filtered or unexported fields
}
See WebKit API documentation.
func NewWebResource ¶
func (*WebResource) GetEncoding ¶
func (n *WebResource) GetEncoding() string
func (*WebResource) GetFrameName ¶
func (n *WebResource) GetFrameName() string
func (*WebResource) GetMimeType ¶
func (n *WebResource) GetMimeType() string
func (*WebResource) GetUri ¶
func (n *WebResource) GetUri() string
type WebView ¶
type WebView struct {
// contains filtered or unexported fields
}
See WebKit API documentation.
func (*WebView) ExecuteScript ¶
func (*WebView) GetEncoding ¶
func (*WebView) GetMainFrame ¶
func (*WebView) StopLoading ¶
func (n *WebView) StopLoading()
type Window ¶
type Window struct {
// contains filtered or unexported fields
}
A Window represents a top-level window using the system's native API. The window contains a single control, which is a WebKit browser.
func NewWindow ¶
func NewWindow(title string, events WindowEvents) *Window
NewWindow creates a new top-level window. The two parameters are: title, which specifies the window's title; and events, which contains an interface for callbacks.
func NewWindowWithSize ¶
func NewWindowWithSize(title string, width int, height int, events WindowEvents) *Window
NewWindowWithSize creates a new top-level window. It is similar to NewWindow, except that the caller can also specify a starting size (not necessarily respected) for the window.
func (*Window) LoadUri ¶
LoadUri will set the web browser's content to the resourced located at the specified URI.
type WindowEvents ¶
type WindowEvents interface { // OnClosed is called after destroying a top-level window. The // action can be cancelled by return false. OnClosed() // OnClose is called just before destroying a top-level window. The // action can be cancelled by return false. OnClose() bool // TitleChanged is called when a new document is loaded, and the // document's title is known. TitleChanged(newtitle string) // DocumentLoadFinished is called when the current document has finished loading. DocumentLoadFinished(view *WebView, frame *WebFrame) // loading a new document. NavigationPolicyDecisionRequested(view *WebView, frame *WebFrame, request *NetworkRequest, action *WebNavigationAction, decision *WebPolicyDecision) bool Redo(view *WebView) // ResourceRequestStarting is called before as the browser starts loading // a new document. ResourceRequestStarting(view *WebView, frame *WebFrame, resource *WebResource, request *NetworkRequest, response *NetworkResponse) StatusBarTextChanged(view *WebView, text string) Undo(view *WebView) // WindowObjectCleared is called as the unloads a document. WindowObjectCleared(view *WebView, frame *WebFrame, context *js.Context, window_object *js.Object) }
A WindowEvents interface can be used to receive callback from a top-level window.
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
Package resourecache implements a cache of files on-disk that contain data from in-memory.
|
Package resourecache implements a cache of files on-disk that contain data from in-memory. |