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 GridLayoutChildClass struct {
16 _ structs.HostLayout
17
18 ParentClass LayoutChildClass
19}
20
21func (x *GridLayoutChildClass) GoPointer() uintptr {
22 return uintptr(unsafe.Pointer(x))
23}
24
25type GridLayoutClass struct {
26 _ structs.HostLayout
27
28 ParentClass LayoutManagerClass
29}
30
31func (x *GridLayoutClass) GoPointer() uintptr {
32 return uintptr(unsafe.Pointer(x))
33}
34
35// Arranges child widgets in rows and columns.
36//
37// Children have an "attach point" defined by the horizontal and vertical
38// index of the cell they occupy; children can span multiple rows or columns.
39// The layout properties for setting the attach points and spans are set
40// using the [class@Gtk.GridLayoutChild] associated to each child widget.
41//
42// The behaviour of `GtkGridLayout` when several children occupy the same
43// grid cell is undefined.
44//
45// `GtkGridLayout` can be used like a `GtkBoxLayout` if all children are
46// attached to the same row or column; however, if you only ever need a
47// single row or column, you should consider using `GtkBoxLayout`.
48type GridLayout struct {
49 LayoutManager
50}
51
52var xGridLayoutGLibType func() types.GType
53
54func GridLayoutGLibType() types.GType {
55 return xGridLayoutGLibType()
56}
57
58func GridLayoutNewFromInternalPtr(ptr uintptr) *GridLayout {
59 cls := &GridLayout{}
60 cls.Ptr = ptr
61 return cls
62}
63
64var xNewGridLayout func() uintptr
65
66// Creates a new `GtkGridLayout`.
67func NewGridLayout() *GridLayout {
68 var cls *GridLayout
69
70 cret := xNewGridLayout()
71
72 if cret == 0 {
73 return nil
74 }
75 cls = &GridLayout{}
76 cls.Ptr = cret
77 return cls
78}
79
80var xGridLayoutGetBaselineRow func(uintptr) int
81
82// Retrieves the row set with gtk_grid_layout_set_baseline_row().
83func (x *GridLayout) GetBaselineRow() int {
84
85 cret := xGridLayoutGetBaselineRow(x.GoPointer())
86 return cret
87}
88
89var xGridLayoutGetColumnHomogeneous func(uintptr) bool
90
91// Checks whether all columns of @grid should have the same width.
92func (x *GridLayout) GetColumnHomogeneous() bool {
93
94 cret := xGridLayoutGetColumnHomogeneous(x.GoPointer())
95 return cret
96}
97
98var xGridLayoutGetColumnSpacing func(uintptr) uint
99
100// Retrieves the spacing set with gtk_grid_layout_set_column_spacing().
101func (x *GridLayout) GetColumnSpacing() uint {
102
103 cret := xGridLayoutGetColumnSpacing(x.GoPointer())
104 return cret
105}
106
107var xGridLayoutGetRowBaselinePosition func(uintptr, int) BaselinePosition
108
109// Returns the baseline position of @row.
110//
111// If no value has been set with
112// [method@Gtk.GridLayout.set_row_baseline_position],
113// the default value of %GTK_BASELINE_POSITION_CENTER
114// is returned.
115func (x *GridLayout) GetRowBaselinePosition(RowVar int) BaselinePosition {
116
117 cret := xGridLayoutGetRowBaselinePosition(x.GoPointer(), RowVar)
118 return cret
119}
120
121var xGridLayoutGetRowHomogeneous func(uintptr) bool
122
123// Checks whether all rows of @grid should have the same height.
124func (x *GridLayout) GetRowHomogeneous() bool {
125
126 cret := xGridLayoutGetRowHomogeneous(x.GoPointer())
127 return cret
128}
129
130var xGridLayoutGetRowSpacing func(uintptr) uint
131
132// Retrieves the spacing set with gtk_grid_layout_set_row_spacing().
133func (x *GridLayout) GetRowSpacing() uint {
134
135 cret := xGridLayoutGetRowSpacing(x.GoPointer())
136 return cret
137}
138
139var xGridLayoutSetBaselineRow func(uintptr, int)
140
141// Sets which row defines the global baseline for the entire grid.
142//
143// Each row in the grid can have its own local baseline, but only
144// one of those is global, meaning it will be the baseline in the
145// parent of the @grid.
146func (x *GridLayout) SetBaselineRow(RowVar int) {
147
148 xGridLayoutSetBaselineRow(x.GoPointer(), RowVar)
149
150}
151
152var xGridLayoutSetColumnHomogeneous func(uintptr, bool)
153
154// Sets whether all columns of @grid should have the same width.
155func (x *GridLayout) SetColumnHomogeneous(HomogeneousVar bool) {
156
157 xGridLayoutSetColumnHomogeneous(x.GoPointer(), HomogeneousVar)
158
159}
160
161var xGridLayoutSetColumnSpacing func(uintptr, uint)
162
163// Sets the amount of space to insert between consecutive columns.
164func (x *GridLayout) SetColumnSpacing(SpacingVar uint) {
165
166 xGridLayoutSetColumnSpacing(x.GoPointer(), SpacingVar)
167
168}
169
170var xGridLayoutSetRowBaselinePosition func(uintptr, int, BaselinePosition)
171
172// Sets how the baseline should be positioned on @row of the
173// grid, in case that row is assigned more space than is requested.
174func (x *GridLayout) SetRowBaselinePosition(RowVar int, PosVar BaselinePosition) {
175
176 xGridLayoutSetRowBaselinePosition(x.GoPointer(), RowVar, PosVar)
177
178}
179
180var xGridLayoutSetRowHomogeneous func(uintptr, bool)
181
182// Sets whether all rows of @grid should have the same height.
183func (x *GridLayout) SetRowHomogeneous(HomogeneousVar bool) {
184
185 xGridLayoutSetRowHomogeneous(x.GoPointer(), HomogeneousVar)
186
187}
188
189var xGridLayoutSetRowSpacing func(uintptr, uint)
190
191// Sets the amount of space to insert between consecutive rows.
192func (x *GridLayout) SetRowSpacing(SpacingVar uint) {
193
194 xGridLayoutSetRowSpacing(x.GoPointer(), SpacingVar)
195
196}
197
198func (c *GridLayout) GoPointer() uintptr {
199 if c == nil {
200 return 0
201 }
202 return c.Ptr
203}
204
205func (c *GridLayout) SetGoPointer(ptr uintptr) {
206 c.Ptr = ptr
207}
208
209// SetPropertyBaselineRow sets the "baseline-row" property.
210// The row to align to the baseline, when `GtkWidget:valign` is set
211// to %GTK_ALIGN_BASELINE.
212func (x *GridLayout) SetPropertyBaselineRow(value int) {
213 var v gobject.Value
214 v.Init(gobject.TypeIntVal)
215 v.SetInt(value)
216 x.SetProperty("baseline-row", &v)
217}
218
219// GetPropertyBaselineRow gets the "baseline-row" property.
220// The row to align to the baseline, when `GtkWidget:valign` is set
221// to %GTK_ALIGN_BASELINE.
222func (x *GridLayout) GetPropertyBaselineRow() int {
223 var v gobject.Value
224 x.GetProperty("baseline-row", &v)
225 return v.GetInt()
226}
227
228// SetPropertyColumnHomogeneous sets the "column-homogeneous" property.
229// Whether all the columns in the grid have the same width.
230func (x *GridLayout) SetPropertyColumnHomogeneous(value bool) {
231 var v gobject.Value
232 v.Init(gobject.TypeBooleanVal)
233 v.SetBoolean(value)
234 x.SetProperty("column-homogeneous", &v)
235}
236
237// GetPropertyColumnHomogeneous gets the "column-homogeneous" property.
238// Whether all the columns in the grid have the same width.
239func (x *GridLayout) GetPropertyColumnHomogeneous() bool {
240 var v gobject.Value
241 x.GetProperty("column-homogeneous", &v)
242 return v.GetBoolean()
243}
244
245// SetPropertyColumnSpacing sets the "column-spacing" property.
246// The amount of space between to consecutive columns.
247func (x *GridLayout) SetPropertyColumnSpacing(value int) {
248 var v gobject.Value
249 v.Init(gobject.TypeIntVal)
250 v.SetInt(value)
251 x.SetProperty("column-spacing", &v)
252}
253
254// GetPropertyColumnSpacing gets the "column-spacing" property.
255// The amount of space between to consecutive columns.
256func (x *GridLayout) GetPropertyColumnSpacing() int {
257 var v gobject.Value
258 x.GetProperty("column-spacing", &v)
259 return v.GetInt()
260}
261
262// SetPropertyRowHomogeneous sets the "row-homogeneous" property.
263// Whether all the rows in the grid have the same height.
264func (x *GridLayout) SetPropertyRowHomogeneous(value bool) {
265 var v gobject.Value
266 v.Init(gobject.TypeBooleanVal)
267 v.SetBoolean(value)
268 x.SetProperty("row-homogeneous", &v)
269}
270
271// GetPropertyRowHomogeneous gets the "row-homogeneous" property.
272// Whether all the rows in the grid have the same height.
273func (x *GridLayout) GetPropertyRowHomogeneous() bool {
274 var v gobject.Value
275 x.GetProperty("row-homogeneous", &v)
276 return v.GetBoolean()
277}
278
279// SetPropertyRowSpacing sets the "row-spacing" property.
280// The amount of space between to consecutive rows.
281func (x *GridLayout) SetPropertyRowSpacing(value int) {
282 var v gobject.Value
283 v.Init(gobject.TypeIntVal)
284 v.SetInt(value)
285 x.SetProperty("row-spacing", &v)
286}
287
288// GetPropertyRowSpacing gets the "row-spacing" property.
289// The amount of space between to consecutive rows.
290func (x *GridLayout) GetPropertyRowSpacing() int {
291 var v gobject.Value
292 x.GetProperty("row-spacing", &v)
293 return v.GetInt()
294}
295
296// `GtkLayoutChild` subclass for children in a `GtkGridLayout`.
297type GridLayoutChild struct {
298 LayoutChild
299}
300
301var xGridLayoutChildGLibType func() types.GType
302
303func GridLayoutChildGLibType() types.GType {
304 return xGridLayoutChildGLibType()
305}
306
307func GridLayoutChildNewFromInternalPtr(ptr uintptr) *GridLayoutChild {
308 cls := &GridLayoutChild{}
309 cls.Ptr = ptr
310 return cls
311}
312
313var xGridLayoutChildGetColumn func(uintptr) int
314
315// Retrieves the column number to which @child attaches its left side.
316func (x *GridLayoutChild) GetColumn() int {
317
318 cret := xGridLayoutChildGetColumn(x.GoPointer())
319 return cret
320}
321
322var xGridLayoutChildGetColumnSpan func(uintptr) int
323
324// Retrieves the number of columns that @child spans to.
325func (x *GridLayoutChild) GetColumnSpan() int {
326
327 cret := xGridLayoutChildGetColumnSpan(x.GoPointer())
328 return cret
329}
330
331var xGridLayoutChildGetRow func(uintptr) int
332
333// Retrieves the row number to which @child attaches its top side.
334func (x *GridLayoutChild) GetRow() int {
335
336 cret := xGridLayoutChildGetRow(x.GoPointer())
337 return cret
338}
339
340var xGridLayoutChildGetRowSpan func(uintptr) int
341
342// Retrieves the number of rows that @child spans to.
343func (x *GridLayoutChild) GetRowSpan() int {
344
345 cret := xGridLayoutChildGetRowSpan(x.GoPointer())
346 return cret
347}
348
349var xGridLayoutChildSetColumn func(uintptr, int)
350
351// Sets the column number to attach the left side of @child.
352func (x *GridLayoutChild) SetColumn(ColumnVar int) {
353
354 xGridLayoutChildSetColumn(x.GoPointer(), ColumnVar)
355
356}
357
358var xGridLayoutChildSetColumnSpan func(uintptr, int)
359
360// Sets the number of columns @child spans to.
361func (x *GridLayoutChild) SetColumnSpan(SpanVar int) {
362
363 xGridLayoutChildSetColumnSpan(x.GoPointer(), SpanVar)
364
365}
366
367var xGridLayoutChildSetRow func(uintptr, int)
368
369// Sets the row to place @child in.
370func (x *GridLayoutChild) SetRow(RowVar int) {
371
372 xGridLayoutChildSetRow(x.GoPointer(), RowVar)
373
374}
375
376var xGridLayoutChildSetRowSpan func(uintptr, int)
377
378// Sets the number of rows @child spans to.
379func (x *GridLayoutChild) SetRowSpan(SpanVar int) {
380
381 xGridLayoutChildSetRowSpan(x.GoPointer(), SpanVar)
382
383}
384
385func (c *GridLayoutChild) GoPointer() uintptr {
386 if c == nil {
387 return 0
388 }
389 return c.Ptr
390}
391
392func (c *GridLayoutChild) SetGoPointer(ptr uintptr) {
393 c.Ptr = ptr
394}
395
396// SetPropertyColumn sets the "column" property.
397// The column to place the child in.
398func (x *GridLayoutChild) SetPropertyColumn(value int) {
399 var v gobject.Value
400 v.Init(gobject.TypeIntVal)
401 v.SetInt(value)
402 x.SetProperty("column", &v)
403}
404
405// GetPropertyColumn gets the "column" property.
406// The column to place the child in.
407func (x *GridLayoutChild) GetPropertyColumn() int {
408 var v gobject.Value
409 x.GetProperty("column", &v)
410 return v.GetInt()
411}
412
413// SetPropertyColumnSpan sets the "column-span" property.
414// The number of columns the child spans to.
415func (x *GridLayoutChild) SetPropertyColumnSpan(value int) {
416 var v gobject.Value
417 v.Init(gobject.TypeIntVal)
418 v.SetInt(value)
419 x.SetProperty("column-span", &v)
420}
421
422// GetPropertyColumnSpan gets the "column-span" property.
423// The number of columns the child spans to.
424func (x *GridLayoutChild) GetPropertyColumnSpan() int {
425 var v gobject.Value
426 x.GetProperty("column-span", &v)
427 return v.GetInt()
428}
429
430// SetPropertyRow sets the "row" property.
431// The row to place the child in.
432func (x *GridLayoutChild) SetPropertyRow(value int) {
433 var v gobject.Value
434 v.Init(gobject.TypeIntVal)
435 v.SetInt(value)
436 x.SetProperty("row", &v)
437}
438
439// GetPropertyRow gets the "row" property.
440// The row to place the child in.
441func (x *GridLayoutChild) GetPropertyRow() int {
442 var v gobject.Value
443 x.GetProperty("row", &v)
444 return v.GetInt()
445}
446
447// SetPropertyRowSpan sets the "row-span" property.
448// The number of rows the child spans to.
449func (x *GridLayoutChild) SetPropertyRowSpan(value int) {
450 var v gobject.Value
451 v.Init(gobject.TypeIntVal)
452 v.SetInt(value)
453 x.SetProperty("row-span", &v)
454}
455
456// GetPropertyRowSpan gets the "row-span" property.
457// The number of rows the child spans to.
458func (x *GridLayoutChild) GetPropertyRowSpan() int {
459 var v gobject.Value
460 x.GetProperty("row-span", &v)
461 return v.GetInt()
462}
463
464func init() {
465 core.SetPackageName("GTK", "gtk4")
466 core.SetSharedLibraries("GTK", []string{"libgtk-4.so.1"})
467 var libs []uintptr
468 for _, libPath := range core.GetPaths("GTK") {
469 lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
470 if err != nil {
471 panic(err)
472 }
473 libs = append(libs, lib)
474 }
475
476 core.PuregoSafeRegister(&xGridLayoutGLibType, libs, "gtk_grid_layout_get_type")
477
478 core.PuregoSafeRegister(&xNewGridLayout, libs, "gtk_grid_layout_new")
479
480 core.PuregoSafeRegister(&xGridLayoutGetBaselineRow, libs, "gtk_grid_layout_get_baseline_row")
481 core.PuregoSafeRegister(&xGridLayoutGetColumnHomogeneous, libs, "gtk_grid_layout_get_column_homogeneous")
482 core.PuregoSafeRegister(&xGridLayoutGetColumnSpacing, libs, "gtk_grid_layout_get_column_spacing")
483 core.PuregoSafeRegister(&xGridLayoutGetRowBaselinePosition, libs, "gtk_grid_layout_get_row_baseline_position")
484 core.PuregoSafeRegister(&xGridLayoutGetRowHomogeneous, libs, "gtk_grid_layout_get_row_homogeneous")
485 core.PuregoSafeRegister(&xGridLayoutGetRowSpacing, libs, "gtk_grid_layout_get_row_spacing")
486 core.PuregoSafeRegister(&xGridLayoutSetBaselineRow, libs, "gtk_grid_layout_set_baseline_row")
487 core.PuregoSafeRegister(&xGridLayoutSetColumnHomogeneous, libs, "gtk_grid_layout_set_column_homogeneous")
488 core.PuregoSafeRegister(&xGridLayoutSetColumnSpacing, libs, "gtk_grid_layout_set_column_spacing")
489 core.PuregoSafeRegister(&xGridLayoutSetRowBaselinePosition, libs, "gtk_grid_layout_set_row_baseline_position")
490 core.PuregoSafeRegister(&xGridLayoutSetRowHomogeneous, libs, "gtk_grid_layout_set_row_homogeneous")
491 core.PuregoSafeRegister(&xGridLayoutSetRowSpacing, libs, "gtk_grid_layout_set_row_spacing")
492
493 core.PuregoSafeRegister(&xGridLayoutChildGLibType, libs, "gtk_grid_layout_child_get_type")
494
495 core.PuregoSafeRegister(&xGridLayoutChildGetColumn, libs, "gtk_grid_layout_child_get_column")
496 core.PuregoSafeRegister(&xGridLayoutChildGetColumnSpan, libs, "gtk_grid_layout_child_get_column_span")
497 core.PuregoSafeRegister(&xGridLayoutChildGetRow, libs, "gtk_grid_layout_child_get_row")
498 core.PuregoSafeRegister(&xGridLayoutChildGetRowSpan, libs, "gtk_grid_layout_child_get_row_span")
499 core.PuregoSafeRegister(&xGridLayoutChildSetColumn, libs, "gtk_grid_layout_child_set_column")
500 core.PuregoSafeRegister(&xGridLayoutChildSetColumnSpan, libs, "gtk_grid_layout_child_set_column_span")
501 core.PuregoSafeRegister(&xGridLayoutChildSetRow, libs, "gtk_grid_layout_child_set_row")
502 core.PuregoSafeRegister(&xGridLayoutChildSetRowSpan, libs, "gtk_grid_layout_child_set_row_span")
503
504}