gtklayoutchild.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/gobject"
12 "github.com/bnema/puregotk/v4/gobject/types"
13)
14
15type LayoutChildClass struct {
16 _ structs.HostLayout
17
18 ParentClass gobject.ObjectClass
19}
20
21func (x *LayoutChildClass) GoPointer() uintptr {
22 return uintptr(unsafe.Pointer(x))
23}
24
25// The base class for objects that are meant to hold layout properties.
26//
27// If a `GtkLayoutManager` has per-child properties, like their packing type,
28// or the horizontal and vertical span, or the icon name, then the layout
29// manager should use a `GtkLayoutChild` implementation to store those properties.
30//
31// A `GtkLayoutChild` instance is only ever valid while a widget is part
32// of a layout.
33type LayoutChild struct {
34 gobject.Object
35}
36
37var xLayoutChildGLibType func() types.GType
38
39func LayoutChildGLibType() types.GType {
40 return xLayoutChildGLibType()
41}
42
43func LayoutChildNewFromInternalPtr(ptr uintptr) *LayoutChild {
44 cls := &LayoutChild{}
45 cls.Ptr = ptr
46 return cls
47}
48
49var xLayoutChildGetChildWidget func(uintptr) uintptr
50
51// Retrieves the `GtkWidget` associated to the given @layout_child.
52func (x *LayoutChild) GetChildWidget() *Widget {
53 var cls *Widget
54
55 cret := xLayoutChildGetChildWidget(x.GoPointer())
56
57 if cret == 0 {
58 return nil
59 }
60 gobject.IncreaseRef(cret)
61 cls = &Widget{}
62 cls.Ptr = cret
63 return cls
64}
65
66var xLayoutChildGetLayoutManager func(uintptr) uintptr
67
68// Retrieves the `GtkLayoutManager` instance that created the
69// given @layout_child.
70func (x *LayoutChild) GetLayoutManager() *LayoutManager {
71 var cls *LayoutManager
72
73 cret := xLayoutChildGetLayoutManager(x.GoPointer())
74
75 if cret == 0 {
76 return nil
77 }
78 gobject.IncreaseRef(cret)
79 cls = &LayoutManager{}
80 cls.Ptr = cret
81 return cls
82}
83
84func (c *LayoutChild) GoPointer() uintptr {
85 if c == nil {
86 return 0
87 }
88 return c.Ptr
89}
90
91func (c *LayoutChild) SetGoPointer(ptr uintptr) {
92 c.Ptr = ptr
93}
94
95func init() {
96 core.SetPackageName("GTK", "gtk4")
97 core.SetSharedLibraries("GTK", []string{"libgtk-4.so.1"})
98 var libs []uintptr
99 for _, libPath := range core.GetPaths("GTK") {
100 lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
101 if err != nil {
102 panic(err)
103 }
104 libs = append(libs, lib)
105 }
106
107 core.PuregoSafeRegister(&xLayoutChildGLibType, libs, "gtk_layout_child_get_type")
108
109 core.PuregoSafeRegister(&xLayoutChildGetChildWidget, libs, "gtk_layout_child_get_child_widget")
110 core.PuregoSafeRegister(&xLayoutChildGetLayoutManager, libs, "gtk_layout_child_get_layout_manager")
111
112}