wka

package module
v0.0.0-...-4baaad8 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2012 License: BSD-3-Clause Imports: 4 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func Main

func Main()

Main starts the application's event loop. This function will not return until all windows have been destroyed, or QuitMain has been called.

func QuitMain

func QuitMain()

QuitMain will force all windows to be destroyed.

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 (n *WebFrame) GetGlobalContext() *js.Context

func (*WebFrame) GetName

func (n *WebFrame) GetName() string

func (*WebFrame) GetParent

func (n *WebFrame) GetParent() *WebFrame

func (*WebFrame) GetTitle

func (n *WebFrame) GetTitle() string

func (*WebFrame) GetUri

func (n *WebFrame) GetUri() string

func (*WebFrame) GetWebView

func (n *WebFrame) GetWebView() *WebView

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 NewWebResource(data []byte, uri string, mime_type string, encoding string, frame_name string) *WebResource

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 (n *WebView) ExecuteScript(script string)

func (*WebView) GetEncoding

func (n *WebView) GetEncoding() string

func (*WebView) GetMainFrame

func (n *WebView) GetMainFrame() *WebFrame

func (*WebView) GetTitle

func (n *WebView) GetTitle() string

func (*WebView) GetUri

func (n *WebView) GetUri() string

func (*WebView) LoadHtml

func (n *WebView) LoadHtml(content string, base_uri string)

func (*WebView) LoadUri

func (n *WebView) LoadUri(uri string)

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) Alert

func (window *Window) Alert(message string)

Alert will display a simple dialog with a message.

func (*Window) Encoding

func (w *Window) Encoding() string

func (*Window) GetTitle

func (window *Window) GetTitle() string

GetTitle returns the top-level window's title (or caption).

func (*Window) LoadHtml

func (window *Window) LoadHtml(content string, base_uri string)

LoadHtml will set the web browser's content to the specified string.

func (*Window) LoadUri

func (window *Window) LoadUri(uri string)

LoadUri will set the web browser's content to the resourced located at the specified URI.

func (*Window) SetTitle

func (window *Window) SetTitle(title string)

SetTitle modifies the top-level window's title (or caption).

func (*Window) WebView

func (window *Window) WebView() *WebView

WebView returns a pointer to the embedded web browser. The web browser can be queried or modified by accessing the WebView APIs.

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)
	// NavigationPolicyDecisionRequested is called before the browser starts
	// 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.

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.

Jump to

Keyboard shortcuts

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