-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnative_window_buffer.go
More file actions
46 lines (37 loc) · 1.48 KB
/
native_window_buffer.go
File metadata and controls
46 lines (37 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Code generated by idiomgen. DO NOT EDIT.
package window
import (
"unsafe"
capi "github.com/AndroidGoLab/ndk/capi/nativewindow"
)
// NativeWindow_Buffer wraps the NDK ANativeWindow_Buffer handle.
type NativeWindow_Buffer struct {
ptr *capi.ANativeWindow_Buffer
}
// cptr returns the underlying C pointer, or nil if h is nil.
// This allows passing optional (nullable) handle parameters to capi functions.
func (h *NativeWindow_Buffer) cptr() *capi.ANativeWindow_Buffer {
if h == nil {
return nil
}
return h.ptr
}
// NewNativeWindow_BufferFromPointer wraps a raw ANativeWindow_Buffer pointer.
func NewNativeWindow_BufferFromPointer(ptr unsafe.Pointer) *NativeWindow_Buffer {
return &NativeWindow_Buffer{ptr: (*capi.ANativeWindow_Buffer)(ptr)}
}
// Pointer returns the underlying pointer as unsafe.Pointer.
func (h *NativeWindow_Buffer) Pointer() unsafe.Pointer {
return unsafe.Pointer(h.ptr)
}
// UintPtr returns the underlying pointer as a uintptr.
// This is useful for interop with gomobile bind, golang.org/x/mobile,
// gioui.org, and other packages that represent native handles as uintptr.
func (h *NativeWindow_Buffer) UintPtr() uintptr {
return uintptr(unsafe.Pointer(h.ptr))
}
// NewNativeWindow_BufferFromUintPtr wraps a uintptr as a NativeWindow_Buffer.
// The caller must ensure ptr points to a valid ANativeWindow_Buffer.
func NewNativeWindow_BufferFromUintPtr(ptr uintptr) *NativeWindow_Buffer {
return &NativeWindow_Buffer{ptr: (*capi.ANativeWindow_Buffer)(unsafe.Pointer(ptr))}
}