v0.2.2 9100209

gdkcairo.go RawHistoryFolder

1// Package gdk was automatically generated by github.com/bnema/puregotk DO NOT EDIT
2package gdk
3
4import (
5	"github.com/ebitengine/purego"
6
7	"github.com/bnema/puregotk/pkg/core"
8	"github.com/bnema/puregotk/v4/cairo"
9	"github.com/bnema/puregotk/v4/gdkpixbuf"
10)
11
12var xCairoDrawFromGl func(*cairo.Context, uintptr, int, int, int, int, int, int, int)
13
14// Draws GL content onto a cairo context.
15//
16// It takes a render buffer ID (@source_type == GL_RENDERBUFFER) or a texture
17// id (@source_type == GL_TEXTURE) and draws it onto @cr with an OVER operation,
18// respecting the current clip. The top left corner of the rectangle specified
19// by @x, @y, @width and @height will be drawn at the current (0,0) position of
20// the `cairo_t`.
21//
22// This will work for *all* `cairo_t`, as long as @surface is realized, but the
23// fallback implementation that reads back the pixels from the buffer may be
24// used in the general case. In the case of direct drawing to a surface with
25// no special effects applied to @cr it will however use a more efficient
26// approach.
27//
28// For GL_RENDERBUFFER the code will always fall back to software for buffers
29// with alpha components, so make sure you use GL_TEXTURE if using alpha.
30//
31// Calling this may change the current GL context.
32func CairoDrawFromGl(CrVar *cairo.Context, SurfaceVar *Surface, SourceVar int, SourceTypeVar int, BufferScaleVar int, XVar int, YVar int, WidthVar int, HeightVar int) {
33
34	xCairoDrawFromGl(CrVar, SurfaceVar.GoPointer(), SourceVar, SourceTypeVar, BufferScaleVar, XVar, YVar, WidthVar, HeightVar)
35
36}
37
38var xCairoRectangle func(*cairo.Context, *Rectangle)
39
40// Adds the given rectangle to the current path of @cr.
41func CairoRectangle(CrVar *cairo.Context, RectangleVar *Rectangle) {
42
43	xCairoRectangle(CrVar, RectangleVar)
44
45}
46
47var xCairoRegion func(*cairo.Context, *cairo.Region)
48
49// Adds the given region to the current path of @cr.
50func CairoRegion(CrVar *cairo.Context, RegionVar *cairo.Region) {
51
52	xCairoRegion(CrVar, RegionVar)
53
54}
55
56var xCairoRegionCreateFromSurface func(*cairo.Surface) *cairo.Region
57
58// Creates region that covers the area where the given
59// @surface is more than 50% opaque.
60//
61// This function takes into account device offsets that might be
62// set with cairo_surface_set_device_offset().
63func CairoRegionCreateFromSurface(SurfaceVar *cairo.Surface) *cairo.Region {
64
65	cret := xCairoRegionCreateFromSurface(SurfaceVar)
66	return cret
67}
68
69var xCairoSetSourcePixbuf func(*cairo.Context, uintptr, float64, float64)
70
71// Sets the given pixbuf as the source pattern for @cr.
72//
73// The pattern has an extend mode of %CAIRO_EXTEND_NONE and is aligned
74// so that the origin of @pixbuf is @pixbuf_x, @pixbuf_y.
75func CairoSetSourcePixbuf(CrVar *cairo.Context, PixbufVar *gdkpixbuf.Pixbuf, PixbufXVar float64, PixbufYVar float64) {
76
77	xCairoSetSourcePixbuf(CrVar, PixbufVar.GoPointer(), PixbufXVar, PixbufYVar)
78
79}
80
81var xCairoSetSourceRgba func(*cairo.Context, *RGBA)
82
83// Sets the specified `GdkRGBA` as the source color of @cr.
84func CairoSetSourceRgba(CrVar *cairo.Context, RgbaVar *RGBA) {
85
86	xCairoSetSourceRgba(CrVar, RgbaVar)
87
88}
89
90func init() {
91	core.SetPackageName("GDK", "gtk4")
92	core.SetSharedLibraries("GDK", []string{"libgtk-4.so.1"})
93	var libs []uintptr
94	for _, libPath := range core.GetPaths("GDK") {
95		lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
96		if err != nil {
97			panic(err)
98		}
99		libs = append(libs, lib)
100	}
101
102	core.PuregoSafeRegister(&xCairoDrawFromGl, libs, "gdk_cairo_draw_from_gl")
103	core.PuregoSafeRegister(&xCairoRectangle, libs, "gdk_cairo_rectangle")
104	core.PuregoSafeRegister(&xCairoRegion, libs, "gdk_cairo_region")
105	core.PuregoSafeRegister(&xCairoRegionCreateFromSurface, libs, "gdk_cairo_region_create_from_surface")
106	core.PuregoSafeRegister(&xCairoSetSourcePixbuf, libs, "gdk_cairo_set_source_pixbuf")
107	core.PuregoSafeRegister(&xCairoSetSourceRgba, libs, "gdk_cairo_set_source_rgba")
108
109}

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