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 ListHeaderClass struct {
16 _ structs.HostLayout
17}
18
19func (x *ListHeaderClass) GoPointer() uintptr {
20 return uintptr(unsafe.Pointer(x))
21}
22
23// Used by list widgets to represent the headers they display.
24//
25// `GtkListHeader` objects are managed just like [class@Gtk.ListItem]
26// objects via their factory, but provide a different set of properties suitable
27// for managing the header instead of individual items.
28type ListHeader struct {
29 gobject.Object
30}
31
32var xListHeaderGLibType func() types.GType
33
34func ListHeaderGLibType() types.GType {
35 return xListHeaderGLibType()
36}
37
38func ListHeaderNewFromInternalPtr(ptr uintptr) *ListHeader {
39 cls := &ListHeader{}
40 cls.Ptr = ptr
41 return cls
42}
43
44var xListHeaderGetChild func(uintptr) uintptr
45
46// Gets the child previously set via gtk_list_header_set_child() or
47// %NULL if none was set.
48func (x *ListHeader) GetChild() *Widget {
49 var cls *Widget
50
51 cret := xListHeaderGetChild(x.GoPointer())
52
53 if cret == 0 {
54 return nil
55 }
56 gobject.IncreaseRef(cret)
57 cls = &Widget{}
58 cls.Ptr = cret
59 return cls
60}
61
62var xListHeaderGetEnd func(uintptr) uint
63
64// Gets the end position in the model of the section that @self is
65// currently the header for.
66//
67// If @self is unbound, %GTK_INVALID_LIST_POSITION is returned.
68func (x *ListHeader) GetEnd() uint {
69
70 cret := xListHeaderGetEnd(x.GoPointer())
71 return cret
72}
73
74var xListHeaderGetItem func(uintptr) uintptr
75
76// Gets the model item at the start of the section.
77// This is the item that occupies the list model at position
78// [property@Gtk.ListHeader:start].
79//
80// If @self is unbound, this function returns %NULL.
81func (x *ListHeader) GetItem() *gobject.Object {
82 var cls *gobject.Object
83
84 cret := xListHeaderGetItem(x.GoPointer())
85
86 if cret == 0 {
87 return nil
88 }
89 gobject.IncreaseRef(cret)
90 cls = &gobject.Object{}
91 cls.Ptr = cret
92 return cls
93}
94
95var xListHeaderGetNItems func(uintptr) uint
96
97// Gets the the number of items in the section.
98//
99// If @self is unbound, 0 is returned.
100func (x *ListHeader) GetNItems() uint {
101
102 cret := xListHeaderGetNItems(x.GoPointer())
103 return cret
104}
105
106var xListHeaderGetStart func(uintptr) uint
107
108// Gets the start position in the model of the section that @self is
109// currently the header for.
110//
111// If @self is unbound, %GTK_INVALID_LIST_POSITION is returned.
112func (x *ListHeader) GetStart() uint {
113
114 cret := xListHeaderGetStart(x.GoPointer())
115 return cret
116}
117
118var xListHeaderSetChild func(uintptr, uintptr)
119
120// Sets the child to be used for this listitem.
121//
122// This function is typically called by applications when
123// setting up a header so that the widget can be reused when
124// binding it multiple times.
125func (x *ListHeader) SetChild(ChildVar *Widget) {
126
127 xListHeaderSetChild(x.GoPointer(), ChildVar.GoPointer())
128
129}
130
131func (c *ListHeader) GoPointer() uintptr {
132 if c == nil {
133 return 0
134 }
135 return c.Ptr
136}
137
138func (c *ListHeader) SetGoPointer(ptr uintptr) {
139 c.Ptr = ptr
140}
141
142// GetPropertyEnd gets the "end" property.
143// The first position no longer part of this section.
144func (x *ListHeader) GetPropertyEnd() uint {
145 var v gobject.Value
146 x.GetProperty("end", &v)
147 return v.GetUint()
148}
149
150// GetPropertyNItems gets the "n-items" property.
151// Number of items in this section.
152func (x *ListHeader) GetPropertyNItems() uint {
153 var v gobject.Value
154 x.GetProperty("n-items", &v)
155 return v.GetUint()
156}
157
158// GetPropertyStart gets the "start" property.
159// First position of items in this section.
160func (x *ListHeader) GetPropertyStart() uint {
161 var v gobject.Value
162 x.GetProperty("start", &v)
163 return v.GetUint()
164}
165
166func init() {
167 core.SetPackageName("GTK", "gtk4")
168 core.SetSharedLibraries("GTK", []string{"libgtk-4.so.1"})
169 var libs []uintptr
170 for _, libPath := range core.GetPaths("GTK") {
171 lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
172 if err != nil {
173 panic(err)
174 }
175 libs = append(libs, lib)
176 }
177
178 core.PuregoSafeRegister(&xListHeaderGLibType, libs, "gtk_list_header_get_type")
179
180 core.PuregoSafeRegister(&xListHeaderGetChild, libs, "gtk_list_header_get_child")
181 core.PuregoSafeRegister(&xListHeaderGetEnd, libs, "gtk_list_header_get_end")
182 core.PuregoSafeRegister(&xListHeaderGetItem, libs, "gtk_list_header_get_item")
183 core.PuregoSafeRegister(&xListHeaderGetNItems, libs, "gtk_list_header_get_n_items")
184 core.PuregoSafeRegister(&xListHeaderGetStart, libs, "gtk_list_header_get_start")
185 core.PuregoSafeRegister(&xListHeaderSetChild, libs, "gtk_list_header_set_child")
186
187}