Documentation ¶
Index ¶
- Constants
- func DeviceScaleHint(value float64) configOption
- func EnableImages(enabled bool) configOption
- func EnableJavascript(enabled bool) configOption
- func FontFamilyFixed(fontName string) configOption
- func FontFamilySansSerif(fontName string) configOption
- func FontFamilySerif(fontName string) configOption
- func FontFamilyStandard(fontName string) configOption
- func UseBGRA(enabled bool) configOption
- func UserAgent(agent string) configOption
- func UserStylesheet(css string) configOption
- type App
- type Config
- func (c *Config) Destroy()
- func (c *Config) DeviceScaleHint(value float64)
- func (c *Config) EnableImages(enabled bool)
- func (c *Config) EnableJavascript(enabled bool)
- func (c *Config) FontFamilyFixed(fontName string)
- func (c *Config) FontFamilySansSerif(fontName string)
- func (c *Config) FontFamilySerif(fontName string)
- func (c *Config) FontFamilyStandard(fontName string)
- func (c *Config) UseBGRAForOffscreenRendering(enabled bool)
- func (c *Config) UserAgent(agent string)
- func (c *Config) UserStylesheet(css string)
- type Cursor
- type FunctionCallback
- type JSContext
- func (ctx *JSContext) Boolean(v bool) JSValue
- func (ctx *JSContext) FunctionCallback(name string, cb FunctionCallback) *JSValue
- func (ctx *JSContext) GlobalContext() JSGlobalContext
- func (ctx *JSContext) GlobalObject() *JSObject
- func (ctx *JSContext) JSValue(v interface{}) JSValue
- func (ctx *JSContext) Null() JSValue
- func (ctx *JSContext) Number(v float64) JSValue
- func (ctx *JSContext) String(v string) JSValue
- func (ctx *JSContext) Undefined() JSValue
- type JSGlobalContext
- type JSObject
- func (o *JSObject) Call(this *JSObject, args ...interface{}) *JSValue
- func (o *JSObject) IsFunction() bool
- func (o *JSObject) Property(name string) *JSValue
- func (o *JSObject) PropertyNames() []string
- func (o *JSObject) SetProperty(name string, value *JSValue)
- func (o *JSObject) SetPropertyValue(name string, value interface{})
- type JSType
- type JSValue
- func (v *JSValue) Boolean() bool
- func (v *JSValue) IsArray() bool
- func (v *JSValue) IsBoolean() bool
- func (v *JSValue) IsDate() bool
- func (v *JSValue) IsFunction() bool
- func (v *JSValue) IsNull() bool
- func (v *JSValue) IsNumber() bool
- func (v *JSValue) IsObject() bool
- func (v *JSValue) IsString() bool
- func (v *JSValue) IsUndefined() bool
- func (v *JSValue) Number() float64
- func (v *JSValue) Object() *JSObject
- func (v *JSValue) String() string
- func (v *JSValue) Type() JSType
- type MessageLevel
- type MessageSource
- type Overlay
- type Renderer
- type View
- func (view *View) CanGoBack() bool
- func (view *View) CanGoForward() bool
- func (v *View) Destroy()
- func (view *View) EvaluateScript(script string) *JSValue
- func (view *View) GoBack()
- func (view *View) GoForward()
- func (view *View) GoToHistoryOffset(offset int)
- func (view *View) IsLoading() bool
- func (view *View) JSContext() *JSContext
- func (view *View) LoadHTML(html string)
- func (view *View) LoadURL(url string)
- func (view *View) OnBeginLoading(cb func())
- func (view *View) OnChangeCursor(cb func(Cursor))
- func (view *View) OnChangeTitle(cb func(string))
- func (view *View) OnChangeURL(cb func(string))
- func (view *View) OnConsoleMessage(...)
- func (view *View) OnDOMReady(cb func())
- func (view *View) OnFinishLoading(cb func())
- func (view *View) OnUpdateHistory(cb func())
- func (view *View) Reload()
- func (view *View) Stop()
- func (view *View) Title() string
- func (view *View) URL() string
- func (v *View) WriteToPNG(filename string) bool
- type Window
- func (win *Window) Close()
- func (win *Window) Destroy()
- func (win *Window) Focus()
- func (win *Window) HasFocus() bool
- func (win *Window) Height() uint
- func (win *Window) Hide()
- func (win *Window) IsFullscreen() bool
- func (win *Window) IsHidden() bool
- func (win *Window) NOverlay() int
- func (win *Window) NewOverlay(width, height uint, x, y int) *Overlay
- func (win *Window) OnClose(cb func())
- func (win *Window) OnResize(cb func(width, height uint))
- func (win *Window) Overlay(i int) *Overlay
- func (win *Window) RemoveOverlay(i int)
- func (win *Window) Resize(width, height uint)
- func (win *Window) SetCursor(cursor Cursor)
- func (win *Window) SetTitle(title string)
- func (win *Window) Show()
- func (win *Window) Unfocus()
- func (win *Window) View() *View
- func (win *Window) Width() uint
Constants ¶
const ( JSTypeUndefined = JSType(C.kJSTypeUndefined) JSTypeNull = JSType(C.kJSTypeNull) JSTypeBoolean = JSType(C.kJSTypeBoolean) JSTypeNumber = JSType(C.kJSTypeNumber) JSTypeString = JSType(C.kJSTypeString) JSTypeObject = JSType(C.kJSTypeObject) )
const ( MessageSourceXML = MessageSource(C.kMessageSource_XML) MessageSourceJS = MessageSource(C.kMessageSource_JS) MessageSourceNetwork = MessageSource(C.kMessageSource_Network) MessageSourceConsoleAPI = MessageSource(C.kMessageSource_ConsoleAPI) MessageSourceStorage = MessageSource(C.kMessageSource_Storage) MessageSourceAppCache = MessageSource(C.kMessageSource_AppCache) MessageSourceRendering = MessageSource(C.kMessageSource_Rendering) MessageSourceCSS = MessageSource(C.kMessageSource_CSS) MessageSourceSecurity = MessageSource(C.kMessageSource_Security) MessageSourceContentBlocker = MessageSource(C.kMessageSource_ContentBlocker) MessageSourceOther = MessageSource(C.kMessageSource_Other) )
const ( MessageLevelLog = MessageLevel(C.kMessageLevel_Log) MessageLevelWarning = MessageLevel(C.kMessageLevel_Warning) MessageLevelError = MessageLevel(C.kMessageLevel_Error) MessageLevelDebug = MessageLevel(C.kMessageLevel_Debug) MessageLevelInfo = MessageLevel(C.kMessageLevel_Info) )
const ( CursorPointer = Cursor(C.kCursor_Pointer) CursorCross = Cursor(C.kCursor_Cross) CursorHand = Cursor(C.kCursor_Hand) CursorIBeam = Cursor(C.kCursor_IBeam) CursorWait = Cursor(C.kCursor_Wait) CursorHelp = Cursor(C.kCursor_Help) CursorEastResize = Cursor(C.kCursor_EastResize) CursorNorthResize = Cursor(C.kCursor_NorthResize) CursorNorthEastResize = Cursor(C.kCursor_NorthEastResize) CursorNorthWestResize = Cursor(C.kCursor_NorthWestResize) CursorSouthResize = Cursor(C.kCursor_SouthResize) CursorSouthEastResize = Cursor(C.kCursor_SouthEastResize) CursorSouthWestResize = Cursor(C.kCursor_SouthWestResize) CursorWestResize = Cursor(C.kCursor_WestResize) CursorNorthSouthResize = Cursor(C.kCursor_NorthSouthResize) CursorEastWestResize = Cursor(C.kCursor_EastWestResize) CursorNorthEastSouthWestResiz = Cursor(C.kCursor_NorthEastSouthWestResize) CursorNorthWestSouthEastResize = Cursor(C.kCursor_NorthWestSouthEastResize) CursorColumnResize = Cursor(C.kCursor_ColumnResize) CursorRowResize = Cursor(C.kCursor_RowResize) CursorMiddlePanning = Cursor(C.kCursor_MiddlePanning) CursorEastPanning = Cursor(C.kCursor_EastPanning) CursorNorthPanning = Cursor(C.kCursor_NorthPanning) CursorNorthEastPanning = Cursor(C.kCursor_NorthEastPanning) CursorNorthWestPanning = Cursor(C.kCursor_NorthWestPanning) CursorSouthPanning = Cursor(C.kCursor_SouthPanning) CursorSouthEastPanning = Cursor(C.kCursor_SouthEastPanning) CursorSouthWestPanning = Cursor(C.kCursor_SouthWestPanning) CursorWestPanning = Cursor(C.kCursor_WestPanning) CursorMove = Cursor(C.kCursor_Move) CursorVerticalText = Cursor(C.kCursor_VerticalText) CursorCell = Cursor(C.kCursor_Cell) CursorContextMenu = Cursor(C.kCursor_ContextMenu) CursorAlias = Cursor(C.kCursor_Alias) CursorProgress = Cursor(C.kCursor_Progress) CursorNoDrop = Cursor(C.kCursor_NoDrop) CursorCopy = Cursor(C.kCursor_Copy) CursorNone = Cursor(C.kCursor_None) CursorNotAllowed = Cursor(C.kCursor_NotAllowed) CursorZoomIn = Cursor(C.kCursor_ZoomIn) CursorZoomOut = Cursor(C.kCursor_ZoomOut) CursorGrab = Cursor(C.kCursor_Grab) CursorGrabbing = Cursor(C.kCursor_Grabbing) CursorCustom = Cursor(C.kCursor_Custom) )
Variables ¶
This section is empty.
Functions ¶
func DeviceScaleHint ¶
func DeviceScaleHint(value float64) configOption
func EnableImages ¶
func EnableImages(enabled bool) configOption
func EnableJavascript ¶
func EnableJavascript(enabled bool) configOption
func FontFamilyFixed ¶
func FontFamilyFixed(fontName string) configOption
func FontFamilySansSerif ¶
func FontFamilySansSerif(fontName string) configOption
func FontFamilySerif ¶
func FontFamilySerif(fontName string) configOption
func FontFamilyStandard ¶
func FontFamilyStandard(fontName string) configOption
func UserStylesheet ¶
func UserStylesheet(css string) configOption
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
App is the main application object
func NewApp ¶
func NewApp() *App
NewApp creates the App singleton.
Note: You should only create one of these per application lifetime.
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
func NewConfig ¶
func NewConfig(options ...configOption) *Config
Create config with default values (see <Ultralight/platform/Config.h>).
func (*Config) DeviceScaleHint ¶
Set the amount that the application DPI has been scaled, used for scaling device coordinates to pixels and oversampling raster shapes. (Default = 1.0)
func (*Config) EnableImages ¶
Set whether images should be enabled (Default = True)
func (*Config) EnableJavascript ¶
Set whether JavaScript should be eanbled (Default = True)
func (*Config) FontFamilyFixed ¶
Set default font-family to use for fixed fonts, eg <pre> and <code>. (Default = Courier New)
func (*Config) FontFamilySansSerif ¶
Set default font-family to use for sans-serif fonts. (Default = Arial)
func (*Config) FontFamilySerif ¶
Set default font-family to use for serif fonts. (Default = Times New Roman)
func (*Config) FontFamilyStandard ¶
Set default font-family to use (Default = Times New Roman)
func (*Config) UseBGRAForOffscreenRendering ¶
Set whether we should use BGRA byte order (instead of RGBA) for View bitmaps. (Default = False)
func (*Config) UserAgent ¶
Set user agent string. (See <Ultralight/platform/Config.h> for the default)
func (*Config) UserStylesheet ¶
Set user stylesheet (CSS). (Default = Empty)
type FunctionCallback ¶
type JSContext ¶
type JSContext struct {
// contains filtered or unexported fields
}
JSContext
func (*JSContext) FunctionCallback ¶
func (ctx *JSContext) FunctionCallback(name string, cb FunctionCallback) *JSValue
Convenience method for creating a JavaScript function with a given callback as its implementation.
func (*JSContext) GlobalContext ¶
func (ctx *JSContext) GlobalContext() JSGlobalContext
Gets the global object of a JavaScript execution context.
func (*JSContext) GlobalObject ¶
Gets the global object of a JavaScript execution context.
type JSGlobalContext ¶
type JSGlobalContext struct {
// contains filtered or unexported fields
}
JSGlobalContext
type JSObject ¶
type JSObject struct {
// contains filtered or unexported fields
}
JSObject
func (*JSObject) IsFunction ¶
Tests whether an object can be called as a function.
func (*JSObject) PropertyNames ¶
Gets the names of an object's enumerable properties.
func (*JSObject) SetProperty ¶
Sets a property on an object.
func (*JSObject) SetPropertyValue ¶
type JSValue ¶
type JSValue struct {
// contains filtered or unexported fields
}
JSValue
func (*JSValue) IsFunction ¶
func (*JSValue) IsUndefined ¶
Tests whether a JavaScript value's type is the undefined type.
type MessageLevel ¶
type MessageLevel int
type MessageSource ¶
type MessageSource int
type Overlay ¶
type Overlay struct {
// contains filtered or unexported fields
}
type Renderer ¶
type Renderer struct {
// contains filtered or unexported fields
}
func NewRenderer ¶
Create renderer (create this only once per application lifetime).
type View ¶
type View struct {
// contains filtered or unexported fields
}
View is the window "content"
func (*View) CanGoForward ¶
CanGoForward checks if can navigate forwards in history
func (*View) EvaluateScript ¶
EvaluateScript evaluates a raw string of JavaScript and return result
func (*View) GoToHistoryOffset ¶
GoToHistoryOffset navigates to arbitrary offset in history
func (*View) OnBeginLoading ¶
func (view *View) OnBeginLoading(cb func())
Set callback for when the page begins loading new URL into main frame
func (*View) OnChangeCursor ¶
Set callback for when the mouse cursor changes
func (*View) OnChangeTitle ¶
Set callback for when the page title changes
func (*View) OnChangeURL ¶
Set callback for when the page URL changes
func (*View) OnConsoleMessage ¶
func (view *View) OnConsoleMessage(cb func(source MessageSource, level MessageLevel, message string, line uint, col uint, sourceID string))
Set callback for when a message is added to the console (useful for JavaScript / network errors and debugging)
func (*View) OnDOMReady ¶
func (view *View) OnDOMReady(cb func())
Set callback for when all JavaScript has been parsed and the document is ready. This is the best time to make initial JavaScript calls to your page.
func (*View) OnFinishLoading ¶
func (view *View) OnFinishLoading(cb func())
Set callback for when the page finishes loading new URL into main frame
func (*View) OnUpdateHistory ¶
func (view *View) OnUpdateHistory(cb func())
Set callback for when the history (back/forward state) is modified
func (*View) WriteToPNG ¶
Write bitmap to a PNG on disk.
type Window ¶
type Window struct {
// contains filtered or unexported fields
}
Window is an application window
func (*Window) IsFullscreen ¶
IsFullscreen checks whether or not a window is fullscreen.
func (*Window) NewOverlay ¶
Create a new Overlay.
func (*Window) OnClose ¶
func (win *Window) OnClose(cb func())
OnClose sets a callback to be notified when a window closes.
func (*Window) OnResize ¶
OnResize sets a callback to be notified when a window resizes (parameters are passed back in device coordinates).