v0.2.1 c0399be

gtksymbolicpaintable.go RawHistoryFolder

1// Package gtk was automatically generated by github.com/bnema/puregotk DO NOT EDIT
2package gtk
3
4import (
5	"structs"
6	"unsafe"
7
8	"github.com/ebitengine/purego"
9
10	"github.com/bnema/puregotk/pkg/core"
11	"github.com/bnema/puregotk/v4/gdk"
12	"github.com/bnema/puregotk/v4/gobject/types"
13)
14
15// The list of virtual functions for the `GtkSymbolicPaintable` interface.
16// No function must be implemented, default implementations exist for each one.
17type SymbolicPaintableInterface struct {
18	_ structs.HostLayout
19
20	GIface uintptr
21
22	xSnapshotSymbolic uintptr
23}
24
25func (x *SymbolicPaintableInterface) GoPointer() uintptr {
26	return uintptr(unsafe.Pointer(x))
27}
28
29// OverrideSnapshotSymbolic sets the "snapshot_symbolic" callback function.
30// Snapshot the paintable using the given colors.
31//
32//	See `GtkSymbolicPaintable::snapshot_symbolic()` for details.
33//	If this function is not implemented, [vfunc@Gdk.Paintable.snapshot]
34//	will be called.
35func (x *SymbolicPaintableInterface) OverrideSnapshotSymbolic(cb func(SymbolicPaintable, *gdk.Snapshot, float64, float64, []gdk.RGBA, uint)) {
36	if cb == nil {
37		x.xSnapshotSymbolic = 0
38	} else {
39		x.xSnapshotSymbolic = purego.NewCallback(func(PaintableVarp uintptr, SnapshotVarp uintptr, WidthVarp float64, HeightVarp float64, ColorsVarp []gdk.RGBA, NColorsVarp uint) {
40			cb(&SymbolicPaintableBase{Ptr: PaintableVarp}, gdk.SnapshotNewFromInternalPtr(SnapshotVarp), WidthVarp, HeightVarp, ColorsVarp, NColorsVarp)
41		})
42	}
43}
44
45// GetSnapshotSymbolic gets the "snapshot_symbolic" callback function.
46// Snapshot the paintable using the given colors.
47//
48//	See `GtkSymbolicPaintable::snapshot_symbolic()` for details.
49//	If this function is not implemented, [vfunc@Gdk.Paintable.snapshot]
50//	will be called.
51func (x *SymbolicPaintableInterface) GetSnapshotSymbolic() func(SymbolicPaintable, *gdk.Snapshot, float64, float64, []gdk.RGBA, uint) {
52	if x.xSnapshotSymbolic == 0 {
53		return nil
54	}
55	var rawCallback func(PaintableVarp uintptr, SnapshotVarp uintptr, WidthVarp float64, HeightVarp float64, ColorsVarp []gdk.RGBA, NColorsVarp uint)
56	purego.RegisterFunc(&rawCallback, x.xSnapshotSymbolic)
57	return func(PaintableVar SymbolicPaintable, SnapshotVar *gdk.Snapshot, WidthVar float64, HeightVar float64, ColorsVar []gdk.RGBA, NColorsVar uint) {
58		rawCallback(PaintableVar.GoPointer(), SnapshotVar.GoPointer(), WidthVar, HeightVar, ColorsVar, NColorsVar)
59	}
60}
61
62// An interface that supports symbolic colors in paintables.
63//
64// `GdkPaintable`s implementing the interface will have the
65// [vfunc@Gtk.SymbolicPaintable.snapshot_symbolic] function called and
66// have the colors for drawing symbolic icons passed. At least 4 colors are guaranteed
67// to be passed every time.
68//
69// These 4 colors are the foreground color, and the colors to use for errors, warnings
70// and success information in that order.
71//
72// More colors may be added in the future.
73type SymbolicPaintable interface {
74	GoPointer() uintptr
75	SetGoPointer(uintptr)
76	SnapshotSymbolic(SnapshotVar *gdk.Snapshot, WidthVar float64, HeightVar float64, ColorsVar []gdk.RGBA, NColorsVar uint)
77}
78
79var xSymbolicPaintableGLibType func() types.GType
80
81func SymbolicPaintableGLibType() types.GType {
82	return xSymbolicPaintableGLibType()
83}
84
85type SymbolicPaintableBase struct {
86	Ptr uintptr
87}
88
89func (x *SymbolicPaintableBase) GoPointer() uintptr {
90	if x == nil {
91		return 0
92	}
93	return x.Ptr
94}
95
96func (x *SymbolicPaintableBase) SetGoPointer(ptr uintptr) {
97	x.Ptr = ptr
98}
99
100// Snapshots the paintable with the given colors.
101//
102// If less than 4 colors are provided, GTK will pad the array with default
103// colors.
104func (x *SymbolicPaintableBase) SnapshotSymbolic(SnapshotVar *gdk.Snapshot, WidthVar float64, HeightVar float64, ColorsVar []gdk.RGBA, NColorsVar uint) {
105
106	XGtkSymbolicPaintableSnapshotSymbolic(x.GoPointer(), SnapshotVar.GoPointer(), WidthVar, HeightVar, ColorsVar, NColorsVar)
107
108}
109
110var XGtkSymbolicPaintableSnapshotSymbolic func(uintptr, uintptr, float64, float64, []gdk.RGBA, uint)
111
112func init() {
113	core.SetPackageName("GTK", "gtk4")
114	core.SetSharedLibraries("GTK", []string{"libgtk-4.so.1"})
115	var libs []uintptr
116	for _, libPath := range core.GetPaths("GTK") {
117		lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
118		if err != nil {
119			panic(err)
120		}
121		libs = append(libs, lib)
122	}
123
124	core.PuregoSafeRegister(&xSymbolicPaintableGLibType, libs, "gtk_symbolic_paintable_get_type")
125
126	core.PuregoSafeRegister(&XGtkSymbolicPaintableSnapshotSymbolic, libs, "gtk_symbolic_paintable_snapshot_symbolic")
127
128}

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