v0.2.1 c0399be

gdkvulkancontext.go RawHistoryFolder

1// Package gdk was automatically generated by github.com/bnema/puregotk DO NOT EDIT
2package gdk
3
4import (
5	"unsafe"
6
7	"github.com/ebitengine/purego"
8
9	"github.com/bnema/puregotk/pkg/core"
10	"github.com/bnema/puregotk/v4/glib"
11	"github.com/bnema/puregotk/v4/gobject"
12	"github.com/bnema/puregotk/v4/gobject/types"
13)
14
15var xVulkanErrorQuark func() glib.Quark
16
17// Registers an error quark for [class@Gdk.VulkanContext] errors.
18func VulkanErrorQuark() glib.Quark {
19
20	cret := xVulkanErrorQuark()
21	return cret
22}
23
24// Represents the platform-specific Vulkan draw context.
25//
26// `GdkVulkanContext`s are created for a surface using
27// [method@Gdk.Surface.create_vulkan_context], and the context will match
28// the characteristics of the surface.
29//
30// Support for `GdkVulkanContext` is platform-specific and context creation
31// can fail, returning %NULL context.
32type VulkanContext struct {
33	DrawContext
34}
35
36var xVulkanContextGLibType func() types.GType
37
38func VulkanContextGLibType() types.GType {
39	return xVulkanContextGLibType()
40}
41
42func VulkanContextNewFromInternalPtr(ptr uintptr) *VulkanContext {
43	cls := &VulkanContext{}
44	cls.Ptr = ptr
45	return cls
46}
47
48func (c *VulkanContext) GoPointer() uintptr {
49	if c == nil {
50		return 0
51	}
52	return c.Ptr
53}
54
55func (c *VulkanContext) SetGoPointer(ptr uintptr) {
56	c.Ptr = ptr
57}
58
59// Emitted when the images managed by this context have changed.
60//
61// Usually this means that the swapchain had to be recreated,
62// for example in response to a change of the surface size.
63func (x *VulkanContext) ConnectImagesUpdated(cb *func(VulkanContext)) uint {
64	cbPtr := uintptr(unsafe.Pointer(cb))
65	if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
66		handlerID := gobject.SignalConnect(x.GoPointer(), "images-updated", cbRefPtr)
67		glib.SaveHandlerMapping(handlerID, cbPtr)
68		return handlerID
69	}
70
71	fcb := func(clsPtr uintptr) {
72		fa := VulkanContext{}
73		fa.Ptr = clsPtr
74		cbFn := *cb
75
76		cbFn(fa)
77
78	}
79	cbRefPtr := purego.NewCallback(fcb)
80	glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
81	handlerID := gobject.SignalConnect(x.GoPointer(), "images-updated", cbRefPtr)
82	glib.SaveHandlerMapping(handlerID, cbPtr)
83	return handlerID
84}
85
86func init() {
87	core.SetPackageName("GDK", "gtk4")
88	core.SetSharedLibraries("GDK", []string{"libgtk-4.so.1"})
89	var libs []uintptr
90	for _, libPath := range core.GetPaths("GDK") {
91		lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
92		if err != nil {
93			panic(err)
94		}
95		libs = append(libs, lib)
96	}
97
98	core.PuregoSafeRegister(&xVulkanErrorQuark, libs, "gdk_vulkan_error_quark")
99
100	core.PuregoSafeRegister(&xVulkanContextGLibType, libs, "gdk_vulkan_context_get_type")
101
102}

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 102

↑↓ moveenter openesc close