cef

package
v0.0.0-...-c39bc26 Latest Latest
Warning

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

Go to latest
Published: May 13, 2015 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LOGSEVERITY_DEFAULT = C.LOGSEVERITY_DEFAULT
	LOGSEVERITY_VERBOSE = C.LOGSEVERITY_VERBOSE
	LOGSEVERITY_INFO    = C.LOGSEVERITY_INFO
	LOGSEVERITY_WARNING = C.LOGSEVERITY_WARNING
	LOGSEVERITY_ERROR   = C.LOGSEVERITY_ERROR
	LOGSEVERITY_DISABLE = C.LOGSEVERITY_DISABLE
)

Variables

View Source
var V8Callbacks map[string]V8Callback

Functions

func CEFString

func CEFString(original string) (final *C.cef_string_t)

func CEFToGoString

func CEFToGoString(source *C.cef_string_t) string

func ExecuteProcess

func ExecuteProcess(appHandle unsafe.Pointer) int

func FillMainArgs

func FillMainArgs(mainArgs *C.struct__cef_main_args_t, appHandle unsafe.Pointer)

func FillWindowInfo

func FillWindowInfo(windowInfo *C.cef_window_info_t, hwnd unsafe.Pointer)

func Initialize

func Initialize(settings Settings) int

func OnUIThread

func OnUIThread() bool

func QuitMessageLoop

func QuitMessageLoop()

func RegisterV8Callback

func RegisterV8Callback(name string, callback V8Callback)

func RunMessageLoop

func RunMessageLoop()

func SetConsoleHandler

func SetConsoleHandler(handler ConsoleHandlerFunc)

func Shutdown

func Shutdown()

func WaitForContextInitialized

func WaitForContextInitialized()

func XlibRegisterHandlers

func XlibRegisterHandlers()

Types

type Browser

type Browser struct {
	Id int

	RenderHandler RenderHandler
	// contains filtered or unexported fields
}

func BrowserById

func BrowserById(id int) (browser *Browser, ok bool)

func CreateBrowser

func CreateBrowser(browserSettings *BrowserSettings, url string, offscreenRendering bool) (browser *Browser)

func (*Browser) Close

func (b *Browser) Close()

func (*Browser) ExecuteJavaScript

func (b *Browser) ExecuteJavaScript(code, url string, startLine int)

func (*Browser) GetURL

func (b *Browser) GetURL() string

func (*Browser) GetWindowHandle

func (b *Browser) GetWindowHandle() C.cef_window_handle_t

func (*Browser) LoadURL

func (b *Browser) LoadURL(url string)

func (*Browser) TriggerPaint

func (b *Browser) TriggerPaint()

type BrowserSettings

type BrowserSettings struct {
	///
	// Controls whether file URLs will have access to all URLs. Also configurable
	// using the "allow-universal-access-from-files" command-line switch.
	///
	UniversalAccessFromFileUrls bool

	///
	// Controls whether file URLs will have access to other file URLs. Also
	// configurable using the "allow-access-from-files" command-line switch.
	///
	FileAccessFromFileUrls bool

	///
	// Controls whether web security restrictions (same-origin policy) will be
	// enforced. Disabling this setting is not recommend as it will allow risky
	// security behavior such as cross-site scripting (XSS). Also configurable
	// using the "disable-web-security" command-line switch.
	///
	WebSecurity bool
	///
	// Controls whether WebGL can be used. Note that WebGL requires hardware
	// support and may not work on all systems even when enabled. Also
	// configurable using the "disable-webgl" command-line switch.
	///
	Webgl bool
}

func (*BrowserSettings) ToCStruct

func (b *BrowserSettings) ToCStruct() (cefBrowserSettings *C.struct__cef_browser_settings_t)

type CefCursorHandle

type CefCursorHandle C.cef_cursor_handle_t

type CefCursorInfo

type CefCursorInfo C.cef_cursor_info_t

type CefCursorType

type CefCursorType C.cef_cursor_type_t

type CefPaintElementType

type CefPaintElementType C.cef_paint_element_type_t

type CefRect

type CefRect C.cef_rect_t

func (*CefRect) SetDimensions

func (r *CefRect) SetDimensions(x, y, width, height int)

type CefScreenInfo

type CefScreenInfo C.cef_screen_info_t

type ConsoleHandlerFunc

type ConsoleHandlerFunc func(message, source string, line int)

Set up the js console handlers

var DefaultConsoleHandler ConsoleHandlerFunc = ConsoleHandlerFunc(func(message, source string, line int) {
	log.Info("[console:%s %d] %s", source, line, message)
})

type DefaultRenderHandler

type DefaultRenderHandler struct {
	Browser *Browser
}

func (*DefaultRenderHandler) GetRootScreenRect

func (d *DefaultRenderHandler) GetRootScreenRect(rect *CefRect) int

func (*DefaultRenderHandler) GetScreenInfo

func (d *DefaultRenderHandler) GetScreenInfo(info *CefScreenInfo) int

func (*DefaultRenderHandler) GetScreenPoint

func (d *DefaultRenderHandler) GetScreenPoint(x, y int, screenX, screenY *int) int

func (*DefaultRenderHandler) GetViewRect

func (d *DefaultRenderHandler) GetViewRect(rect *CefRect) int

func (*DefaultRenderHandler) OnCursorChange

func (d *DefaultRenderHandler) OnCursorChange(cursor CefCursorHandle, ctype CefCursorType, custom_cursor_info CefCursorInfo)

func (*DefaultRenderHandler) OnPaint

func (d *DefaultRenderHandler) OnPaint(paintType CefPaintElementType, dirtyRectsCount int, dirtyRects unsafe.Pointer, buffer unsafe.Pointer, width, height int)

func (*DefaultRenderHandler) OnPopupShow

func (d *DefaultRenderHandler) OnPopupShow(show int)

func (*DefaultRenderHandler) OnPopupSize

func (d *DefaultRenderHandler) OnPopupSize(size *CefRect)

func (*DefaultRenderHandler) OnScrollOffsetChanged

func (d *DefaultRenderHandler) OnScrollOffsetChanged()

type LifeSpanHandler

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

func (*LifeSpanHandler) OnAfterCreated

func (l *LifeSpanHandler) OnAfterCreated(browser *Browser)

func (*LifeSpanHandler) RegisterAndWaitForBrowser

func (l *LifeSpanHandler) RegisterAndWaitForBrowser() (browser *Browser, err error)

type RenderHandler

type RenderHandler interface {
	GetRootScreenRect(*CefRect) int
	GetViewRect(*CefRect) int
	GetScreenPoint(int, int, *int, *int) int
	GetScreenInfo(*CefScreenInfo) int
	OnPopupShow(int)
	OnPopupSize(*CefRect)
	OnPaint(CefPaintElementType, int, unsafe.Pointer, unsafe.Pointer, int, int)
	OnCursorChange(CefCursorHandle, CefCursorType, CefCursorInfo)
	OnScrollOffsetChanged()
}

type Settings

type Settings struct {
	SingleProcess       int
	CachePath           string
	LogSeverity         int
	LogFile             string
	ResourcesDirPath    string
	LocalesDirPath      string
	JavaScriptFlags     string
	RemoteDebuggingPort int
}

func (*Settings) ToCStruct

func (settings *Settings) ToCStruct() (cefSettings *C.struct__cef_settings_t)

type V8Callback

type V8Callback func([]*V8Value)

type V8Value

type V8Value C.cef_v8value_t

func (*V8Value) ToBool

func (v *V8Value) ToBool() bool

func (*V8Value) ToFloat32

func (v *V8Value) ToFloat32() float32

func (*V8Value) ToInt32

func (v *V8Value) ToInt32() int32

func (*V8Value) ToString

func (v *V8Value) ToString() string

Jump to

Keyboard shortcuts

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