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/pango"
10)
11
12var xPangoLayoutGetClipRegion func(uintptr, int, int, int, int) *cairo.Region
13
14// Obtains a clip region which contains the areas where the given ranges
15// of text would be drawn.
16//
17// @x_origin and @y_origin are the top left point to center the layout.
18// @index_ranges should contain ranges of bytes in the layout’s text.
19//
20// Note that the regions returned correspond to logical extents of the text
21// ranges, not ink extents. So the drawn layout may in fact touch areas out of
22// the clip region. The clip region is mainly useful for highlightling parts
23// of text, such as when text is selected.
24func PangoLayoutGetClipRegion(LayoutVar *pango.Layout, XOriginVar int, YOriginVar int, IndexRangesVar int, NRangesVar int) *cairo.Region {
25
26 cret := xPangoLayoutGetClipRegion(LayoutVar.GoPointer(), XOriginVar, YOriginVar, IndexRangesVar, NRangesVar)
27 return cret
28}
29
30var xPangoLayoutLineGetClipRegion func(*pango.LayoutLine, int, int, []int, int) *cairo.Region
31
32// Obtains a clip region which contains the areas where the given
33// ranges of text would be drawn.
34//
35// @x_origin and @y_origin are the top left position of the layout.
36// @index_ranges should contain ranges of bytes in the layout’s text.
37// The clip region will include space to the left or right of the line
38// (to the layout bounding box) if you have indexes above or below the
39// indexes contained inside the line. This is to draw the selection all
40// the way to the side of the layout. However, the clip region is in line
41// coordinates, not layout coordinates.
42//
43// Note that the regions returned correspond to logical extents of the text
44// ranges, not ink extents. So the drawn line may in fact touch areas out of
45// the clip region. The clip region is mainly useful for highlightling parts
46// of text, such as when text is selected.
47func PangoLayoutLineGetClipRegion(LineVar *pango.LayoutLine, XOriginVar int, YOriginVar int, IndexRangesVar []int, NRangesVar int) *cairo.Region {
48
49 cret := xPangoLayoutLineGetClipRegion(LineVar, XOriginVar, YOriginVar, IndexRangesVar, NRangesVar)
50 return cret
51}
52
53func init() {
54 core.SetPackageName("GDK", "gtk4")
55 core.SetSharedLibraries("GDK", []string{"libgtk-4.so.1"})
56 var libs []uintptr
57 for _, libPath := range core.GetPaths("GDK") {
58 lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
59 if err != nil {
60 panic(err)
61 }
62 libs = append(libs, lib)
63 }
64
65 core.PuregoSafeRegister(&xPangoLayoutGetClipRegion, libs, "gdk_pango_layout_get_clip_region")
66 core.PuregoSafeRegister(&xPangoLayoutLineGetClipRegion, libs, "gdk_pango_layout_line_get_clip_region")
67
68}