driver

package
v2.5.3-rc4 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2024 License: BSD-3-Clause Imports: 0 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunNative

func RunNative(fn func(any) error) error

RunNative provides a way to execute code within the platform-specific runtime context for various runtimes. This is mostly useful for Android where the JVM provides functionality that is not accessible directly in CGo. The call for most platforms will just execute passing an `UnknownContext` and returning any error reported.

Since: 2.3

Types

type AndroidContext

type AndroidContext struct {
	VM, Env, Ctx uintptr
}

AndroidContext is passed to the RunNative callback when it is executed on an Android device. The VM, Env and Ctx pointers are required to make various calls into JVM methods.

Since: 2.3

type AndroidWindowContext added in v2.5.0

type AndroidWindowContext struct {
	AndroidContext
	NativeWindow uintptr
}

AndroidWindowContext is passed to the NativeWindow.RunNative callback when it is executed on an Android device. The NativeWindow field is of type `*C.ANativeWindow`. The VM, Env and Ctx pointers are required to make various calls into JVM methods.

Since: 2.5

type MacWindowContext added in v2.5.0

type MacWindowContext struct {
	// NSWindow is the window handle for the native window.
	NSWindow uintptr
}

MacWindowContext is passed to the NativeWindow.RunNative callback when it is executed on a macOS device.

Since: 2.5

type NativeWindow added in v2.5.0

type NativeWindow interface {
	// RunNative  provides a way to execute code within the platform-specific runtime context for a window.
	// The context types are defined in the `driver` package and the specific context passed will differ by platform.
	RunNative(func(context any))
}

NativeWindow is an extension interface for `fyne.Window` that gives access to platform-native features of application windows.

Since: 2.5

type UnknownContext

type UnknownContext struct{}

UnknownContext is passed to the RunNative callback when it is executed on devices or windows without special native context.

Since: 2.3

type WaylandWindowContext added in v2.5.0

type WaylandWindowContext struct {
	// WaylandSurface is the handle to the native Wayland surface.
	WaylandSurface uintptr
}

WaylandWindowContext is passed to the NativeWindow.RunNative callback when it is executed on a device with the Wayland windowing system.

Since: 2.5

type WindowsWindowContext added in v2.5.0

type WindowsWindowContext struct {
	// HWND is the window handle for the native window.
	HWND uintptr
}

WindowsWindowContext is passed to the NativeWindow.RunNative callback when it is executed on a Microsoft Windows device.

Since: 2.5

type X11WindowContext added in v2.5.0

type X11WindowContext struct {
	// WindowHandle is the window handle for the native X11 window.
	WindowHandle uintptr
}

X11WindowContext is passed to the NativeWindow.RunNative callback when it is executed on a device with the X11 windowing system.

Since: 2.5

Directories

Path Synopsis
Package desktop provides desktop specific driver functionality.
Package desktop provides desktop specific driver functionality.
Package mobile provides mobile specific driver functionality.
Package mobile provides mobile specific driver functionality.

Jump to

Keyboard shortcuts

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