Documentation ¶
Index ¶
- Constants
- Variables
- func CEFString(original string) (final *C.cef_string_t)
- func CEFToGoString(source *C.cef_string_t) string
- func ExecuteProcess(appHandle unsafe.Pointer) int
- func FillMainArgs(mainArgs *C.struct__cef_main_args_t, appHandle unsafe.Pointer)
- func FillWindowInfo(windowInfo *C.cef_window_info_t, hwnd unsafe.Pointer)
- func Initialize(settings Settings) int
- func OnUIThread() bool
- func QuitMessageLoop()
- func RegisterV8Callback(name string, callback V8Callback)
- func RunMessageLoop()
- func SetConsoleHandler(handler ConsoleHandlerFunc)
- func Shutdown()
- func WaitForContextInitialized()
- func XlibRegisterHandlers()
- type Browser
- type BrowserSettings
- type CefCursorHandle
- type CefCursorInfo
- type CefCursorType
- type CefPaintElementType
- type CefRect
- type CefScreenInfo
- type ConsoleHandlerFunc
- type DefaultRenderHandler
- func (d *DefaultRenderHandler) GetRootScreenRect(rect *CefRect) int
- func (d *DefaultRenderHandler) GetScreenInfo(info *CefScreenInfo) int
- func (d *DefaultRenderHandler) GetScreenPoint(x, y int, screenX, screenY *int) int
- func (d *DefaultRenderHandler) GetViewRect(rect *CefRect) int
- func (d *DefaultRenderHandler) OnCursorChange(cursor CefCursorHandle, ctype CefCursorType, custom_cursor_info CefCursorInfo)
- func (d *DefaultRenderHandler) OnPaint(paintType CefPaintElementType, dirtyRectsCount int, dirtyRects unsafe.Pointer, ...)
- func (d *DefaultRenderHandler) OnPopupShow(show int)
- func (d *DefaultRenderHandler) OnPopupSize(size *CefRect)
- func (d *DefaultRenderHandler) OnScrollOffsetChanged()
- type LifeSpanHandler
- type RenderHandler
- type Settings
- type V8Callback
- type V8Value
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 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 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 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 CreateBrowser ¶
func CreateBrowser(browserSettings *BrowserSettings, url string, offscreenRendering bool) (browser *Browser)
func (*Browser) ExecuteJavaScript ¶
func (*Browser) GetWindowHandle ¶
func (b *Browser) GetWindowHandle() C.cef_window_handle_t
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 CefScreenInfo ¶
type CefScreenInfo C.cef_screen_info_t
type ConsoleHandlerFunc ¶
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)
Click to show internal directories.
Click to hide internal directories.