v0.2.1 c0399be

gtkflowbox.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/gio"
12	"github.com/bnema/puregotk/v4/glib"
13	"github.com/bnema/puregotk/v4/gobject"
14	"github.com/bnema/puregotk/v4/gobject/types"
15)
16
17// Called for flow boxes that are bound to a `GListModel`.
18//
19// This function is called for each item that gets added to the model.
20type FlowBoxCreateWidgetFunc func(uintptr, uintptr) uintptr
21
22// A function that will be called whenever a child changes
23// or is added.
24//
25// It lets you control if the child should be visible or not.
26type FlowBoxFilterFunc func(uintptr, uintptr) bool
27
28// A function used by gtk_flow_box_selected_foreach().
29//
30// It will be called on every selected child of the @box.
31type FlowBoxForeachFunc func(uintptr, uintptr, uintptr)
32
33// A function to compare two children to determine which
34// should come first.
35type FlowBoxSortFunc func(uintptr, uintptr, uintptr) int
36
37type FlowBoxChildClass struct {
38	_ structs.HostLayout
39
40	ParentClass WidgetClass
41
42	xActivate uintptr
43
44	Padding [8]uintptr
45}
46
47func (x *FlowBoxChildClass) GoPointer() uintptr {
48	return uintptr(unsafe.Pointer(x))
49}
50
51// OverrideActivate sets the "activate" callback function.
52func (x *FlowBoxChildClass) OverrideActivate(cb func(*FlowBoxChild)) {
53	if cb == nil {
54		x.xActivate = 0
55	} else {
56		x.xActivate = purego.NewCallback(func(ChildVarp uintptr) {
57			cb(FlowBoxChildNewFromInternalPtr(ChildVarp))
58		})
59	}
60}
61
62// GetActivate gets the "activate" callback function.
63func (x *FlowBoxChildClass) GetActivate() func(*FlowBoxChild) {
64	if x.xActivate == 0 {
65		return nil
66	}
67	var rawCallback func(ChildVarp uintptr)
68	purego.RegisterFunc(&rawCallback, x.xActivate)
69	return func(ChildVar *FlowBoxChild) {
70		rawCallback(ChildVar.GoPointer())
71	}
72}
73
74// Puts child widgets in a reflowing grid.
75//
76// <picture>
77//
78//	<source srcset="flow-box-dark.png" media="(prefers-color-scheme: dark)">
79//	<img alt="An example GtkFlowBox" src="flow-box.png">
80//
81// </picture>
82//
83// For instance, with the horizontal orientation, the widgets will be
84// arranged from left to right, starting a new row under the previous
85// row when necessary. Reducing the width in this case will require more
86// rows, so a larger height will be requested.
87//
88// Likewise, with the vertical orientation, the widgets will be arranged
89// from top to bottom, starting a new column to the right when necessary.
90// Reducing the height will require more columns, so a larger width will
91// be requested.
92//
93// The size request of a `GtkFlowBox` alone may not be what you expect;
94// if you need to be able to shrink it along both axes and dynamically
95// reflow its children, you may have to wrap it in a `GtkScrolledWindow`
96// to enable that.
97//
98// The children of a `GtkFlowBox` can be dynamically sorted and filtered.
99//
100// Although a `GtkFlowBox` must have only `GtkFlowBoxChild` children, you
101// can add any kind of widget to it via [method@Gtk.FlowBox.insert], and a
102// `GtkFlowBoxChild` widget will automatically be inserted between the box
103// and the widget.
104//
105// Also see [class@Gtk.ListBox].
106//
107// # Shortcuts and Gestures
108//
109// The following signals have default keybindings:
110//
111// - [signal@Gtk.FlowBox::move-cursor]
112// - [signal@Gtk.FlowBox::select-all]
113// - [signal@Gtk.FlowBox::toggle-cursor-child]
114// - [signal@Gtk.FlowBox::unselect-all]
115//
116// # CSS nodes
117//
118// ```
119// flowbox
120// ├── flowboxchild
121// │   ╰── <child>
122// ├── flowboxchild
123// │   ╰── <child>
124// ┊
125// ╰── [rubberband]
126// ```
127//
128// `GtkFlowBox` uses a single CSS node with name flowbox. `GtkFlowBoxChild`
129// uses a single CSS node with name flowboxchild. For rubberband selection,
130// a subnode with name rubberband is used.
131//
132// # Accessibility
133//
134// `GtkFlowBox` uses the [enum@Gtk.AccessibleRole.grid] role, and `GtkFlowBoxChild`
135// uses the [enum@Gtk.AccessibleRole.grid_cell] role.
136type FlowBox struct {
137	Widget
138}
139
140var xFlowBoxGLibType func() types.GType
141
142func FlowBoxGLibType() types.GType {
143	return xFlowBoxGLibType()
144}
145
146func FlowBoxNewFromInternalPtr(ptr uintptr) *FlowBox {
147	cls := &FlowBox{}
148	cls.Ptr = ptr
149	return cls
150}
151
152var xNewFlowBox func() uintptr
153
154// Creates a `GtkFlowBox`.
155func NewFlowBox() *FlowBox {
156	var cls *FlowBox
157
158	cret := xNewFlowBox()
159
160	if cret == 0 {
161		return nil
162	}
163	gobject.IncreaseRef(cret)
164	cls = &FlowBox{}
165	cls.Ptr = cret
166	return cls
167}
168
169var xFlowBoxAppend func(uintptr, uintptr)
170
171// Adds @child to the end of @self.
172//
173// If a sort function is set, the widget will
174// actually be inserted at the calculated position.
175//
176// See also: [method@Gtk.FlowBox.insert].
177func (x *FlowBox) Append(ChildVar *Widget) {
178
179	xFlowBoxAppend(x.GoPointer(), ChildVar.GoPointer())
180
181}
182
183var xFlowBoxBindModel func(uintptr, uintptr, uintptr, uintptr, uintptr)
184
185// Binds @model to @box.
186//
187// If @box was already bound to a model, that previous binding is
188// destroyed.
189//
190// The contents of @box are cleared and then filled with widgets that
191// represent items from @model. @box is updated whenever @model changes.
192// If @model is %NULL, @box is left empty.
193//
194// It is undefined to add or remove widgets directly (for example, with
195// [method@Gtk.FlowBox.insert]) while @box is bound to a model.
196//
197// Note that using a model is incompatible with the filtering and sorting
198// functionality in `GtkFlowBox`. When using a model, filtering and sorting
199// should be implemented by the model.
200func (x *FlowBox) BindModel(ModelVar gio.ListModel, CreateWidgetFuncVar *FlowBoxCreateWidgetFunc, UserDataVar uintptr, UserDataFreeFuncVar *glib.DestroyNotify) {
201
202	var CreateWidgetFuncVarRef uintptr
203	if CreateWidgetFuncVar != nil {
204		CreateWidgetFuncVarPtr := uintptr(unsafe.Pointer(CreateWidgetFuncVar))
205		if cbRefPtr, ok := glib.GetCallback(CreateWidgetFuncVarPtr); ok {
206			CreateWidgetFuncVarRef = cbRefPtr
207		} else {
208			fcb := func(arg0 uintptr, arg1 uintptr) uintptr {
209				cbFn := *CreateWidgetFuncVar
210				return cbFn(arg0, arg1)
211			}
212			CreateWidgetFuncVarRef = purego.NewCallback(fcb)
213			glib.SaveCallbackWithClosure(CreateWidgetFuncVarPtr, CreateWidgetFuncVarRef, CreateWidgetFuncVar)
214		}
215	}
216
217	var UserDataFreeFuncVarRef uintptr
218	if UserDataFreeFuncVar != nil {
219		UserDataFreeFuncVarPtr := uintptr(unsafe.Pointer(UserDataFreeFuncVar))
220		if cbRefPtr, ok := glib.GetCallback(UserDataFreeFuncVarPtr); ok {
221			UserDataFreeFuncVarRef = cbRefPtr
222		} else {
223			fcb := func(arg0 uintptr) {
224				cbFn := *UserDataFreeFuncVar
225				cbFn(arg0)
226			}
227			UserDataFreeFuncVarRef = purego.NewCallback(fcb)
228			glib.SaveCallbackWithClosure(UserDataFreeFuncVarPtr, UserDataFreeFuncVarRef, UserDataFreeFuncVar)
229		}
230	}
231
232	xFlowBoxBindModel(x.GoPointer(), ModelVar.GoPointer(), CreateWidgetFuncVarRef, UserDataVar, UserDataFreeFuncVarRef)
233
234}
235
236var xFlowBoxGetActivateOnSingleClick func(uintptr) bool
237
238// Returns whether children activate on single clicks.
239func (x *FlowBox) GetActivateOnSingleClick() bool {
240
241	cret := xFlowBoxGetActivateOnSingleClick(x.GoPointer())
242	return cret
243}
244
245var xFlowBoxGetChildAtIndex func(uintptr, int) uintptr
246
247// Gets the nth child in the @box.
248func (x *FlowBox) GetChildAtIndex(IdxVar int) *FlowBoxChild {
249	var cls *FlowBoxChild
250
251	cret := xFlowBoxGetChildAtIndex(x.GoPointer(), IdxVar)
252
253	if cret == 0 {
254		return nil
255	}
256	gobject.IncreaseRef(cret)
257	cls = &FlowBoxChild{}
258	cls.Ptr = cret
259	return cls
260}
261
262var xFlowBoxGetChildAtPos func(uintptr, int, int) uintptr
263
264// Gets the child in the (@x, @y) position.
265//
266// Both @x and @y are assumed to be relative to the origin of @box.
267func (x *FlowBox) GetChildAtPos(XVar int, YVar int) *FlowBoxChild {
268	var cls *FlowBoxChild
269
270	cret := xFlowBoxGetChildAtPos(x.GoPointer(), XVar, YVar)
271
272	if cret == 0 {
273		return nil
274	}
275	gobject.IncreaseRef(cret)
276	cls = &FlowBoxChild{}
277	cls.Ptr = cret
278	return cls
279}
280
281var xFlowBoxGetColumnSpacing func(uintptr) uint
282
283// Gets the horizontal spacing.
284func (x *FlowBox) GetColumnSpacing() uint {
285
286	cret := xFlowBoxGetColumnSpacing(x.GoPointer())
287	return cret
288}
289
290var xFlowBoxGetHomogeneous func(uintptr) bool
291
292// Returns whether the box is homogeneous.
293func (x *FlowBox) GetHomogeneous() bool {
294
295	cret := xFlowBoxGetHomogeneous(x.GoPointer())
296	return cret
297}
298
299var xFlowBoxGetMaxChildrenPerLine func(uintptr) uint
300
301// Gets the maximum number of children per line.
302func (x *FlowBox) GetMaxChildrenPerLine() uint {
303
304	cret := xFlowBoxGetMaxChildrenPerLine(x.GoPointer())
305	return cret
306}
307
308var xFlowBoxGetMinChildrenPerLine func(uintptr) uint
309
310// Gets the minimum number of children per line.
311func (x *FlowBox) GetMinChildrenPerLine() uint {
312
313	cret := xFlowBoxGetMinChildrenPerLine(x.GoPointer())
314	return cret
315}
316
317var xFlowBoxGetRowSpacing func(uintptr) uint
318
319// Gets the vertical spacing.
320func (x *FlowBox) GetRowSpacing() uint {
321
322	cret := xFlowBoxGetRowSpacing(x.GoPointer())
323	return cret
324}
325
326var xFlowBoxGetSelectedChildren func(uintptr) *glib.List
327
328// Creates a list of all selected children.
329func (x *FlowBox) GetSelectedChildren() *glib.List {
330
331	cret := xFlowBoxGetSelectedChildren(x.GoPointer())
332	return cret
333}
334
335var xFlowBoxGetSelectionMode func(uintptr) SelectionMode
336
337// Gets the selection mode of @box.
338func (x *FlowBox) GetSelectionMode() SelectionMode {
339
340	cret := xFlowBoxGetSelectionMode(x.GoPointer())
341	return cret
342}
343
344var xFlowBoxInsert func(uintptr, uintptr, int)
345
346// Inserts the @widget into @box at @position.
347//
348// If a sort function is set, the widget will actually be inserted
349// at the calculated position.
350//
351// If @position is -1, or larger than the total number of children
352// in the @box, then the @widget will be appended to the end.
353func (x *FlowBox) Insert(WidgetVar *Widget, PositionVar int) {
354
355	xFlowBoxInsert(x.GoPointer(), WidgetVar.GoPointer(), PositionVar)
356
357}
358
359var xFlowBoxInvalidateFilter func(uintptr)
360
361// Updates the filtering for all children.
362//
363// Call this function when the result of the filter
364// function on the @box is changed due to an external
365// factor. For instance, this would be used if the
366// filter function just looked for a specific search
367// term, and the entry with the string has changed.
368func (x *FlowBox) InvalidateFilter() {
369
370	xFlowBoxInvalidateFilter(x.GoPointer())
371
372}
373
374var xFlowBoxInvalidateSort func(uintptr)
375
376// Updates the sorting for all children.
377//
378// Call this when the result of the sort function on
379// @box is changed due to an external factor.
380func (x *FlowBox) InvalidateSort() {
381
382	xFlowBoxInvalidateSort(x.GoPointer())
383
384}
385
386var xFlowBoxPrepend func(uintptr, uintptr)
387
388// Adds @child to the start of @self.
389//
390// If a sort function is set, the widget will
391// actually be inserted at the calculated position.
392//
393// See also: [method@Gtk.FlowBox.insert].
394func (x *FlowBox) Prepend(ChildVar *Widget) {
395
396	xFlowBoxPrepend(x.GoPointer(), ChildVar.GoPointer())
397
398}
399
400var xFlowBoxRemove func(uintptr, uintptr)
401
402// Removes a child from @box.
403func (x *FlowBox) Remove(WidgetVar *Widget) {
404
405	xFlowBoxRemove(x.GoPointer(), WidgetVar.GoPointer())
406
407}
408
409var xFlowBoxRemoveAll func(uintptr)
410
411// Removes all children from @box.
412//
413// This function does nothing if @box is backed by a model.
414func (x *FlowBox) RemoveAll() {
415
416	xFlowBoxRemoveAll(x.GoPointer())
417
418}
419
420var xFlowBoxSelectAll func(uintptr)
421
422// Select all children of @box, if the selection
423// mode allows it.
424func (x *FlowBox) SelectAll() {
425
426	xFlowBoxSelectAll(x.GoPointer())
427
428}
429
430var xFlowBoxSelectChild func(uintptr, uintptr)
431
432// Selects a single child of @box, if the selection
433// mode allows it.
434func (x *FlowBox) SelectChild(ChildVar *FlowBoxChild) {
435
436	xFlowBoxSelectChild(x.GoPointer(), ChildVar.GoPointer())
437
438}
439
440var xFlowBoxSelectedForeach func(uintptr, uintptr, uintptr)
441
442// Calls a function for each selected child.
443//
444// Note that the selection cannot be modified from within
445// this function.
446func (x *FlowBox) SelectedForeach(FuncVar *FlowBoxForeachFunc, DataVar uintptr) {
447
448	var FuncVarRef uintptr
449	if FuncVar != nil {
450		FuncVarPtr := uintptr(unsafe.Pointer(FuncVar))
451		if cbRefPtr, ok := glib.GetCallback(FuncVarPtr); ok {
452			FuncVarRef = cbRefPtr
453		} else {
454			fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) {
455				cbFn := *FuncVar
456				cbFn(arg0, arg1, arg2)
457			}
458			FuncVarRef = purego.NewCallback(fcb)
459			glib.SaveCallbackWithClosure(FuncVarPtr, FuncVarRef, FuncVar)
460		}
461	}
462
463	xFlowBoxSelectedForeach(x.GoPointer(), FuncVarRef, DataVar)
464
465}
466
467var xFlowBoxSetActivateOnSingleClick func(uintptr, bool)
468
469// If @single is %TRUE, children will be activated when you click
470// on them, otherwise you need to double-click.
471func (x *FlowBox) SetActivateOnSingleClick(SingleVar bool) {
472
473	xFlowBoxSetActivateOnSingleClick(x.GoPointer(), SingleVar)
474
475}
476
477var xFlowBoxSetColumnSpacing func(uintptr, uint)
478
479// Sets the horizontal space to add between children.
480func (x *FlowBox) SetColumnSpacing(SpacingVar uint) {
481
482	xFlowBoxSetColumnSpacing(x.GoPointer(), SpacingVar)
483
484}
485
486var xFlowBoxSetFilterFunc func(uintptr, uintptr, uintptr, uintptr)
487
488// By setting a filter function on the @box one can decide dynamically
489// which of the children to show.
490//
491// For instance, to implement a search function that only shows the
492// children matching the search terms.
493//
494// The @filter_func will be called for each child after the call, and
495// it will continue to be called each time a child changes (via
496// [method@Gtk.FlowBoxChild.changed]) or when
497// [method@Gtk.FlowBox.invalidate_filter] is called.
498//
499// Note that using a filter function is incompatible with using a model
500// (see [method@Gtk.FlowBox.bind_model]).
501func (x *FlowBox) SetFilterFunc(FilterFuncVar *FlowBoxFilterFunc, UserDataVar uintptr, DestroyVar *glib.DestroyNotify) {
502
503	var FilterFuncVarRef uintptr
504	if FilterFuncVar != nil {
505		FilterFuncVarPtr := uintptr(unsafe.Pointer(FilterFuncVar))
506		if cbRefPtr, ok := glib.GetCallback(FilterFuncVarPtr); ok {
507			FilterFuncVarRef = cbRefPtr
508		} else {
509			fcb := func(arg0 uintptr, arg1 uintptr) bool {
510				cbFn := *FilterFuncVar
511				return cbFn(arg0, arg1)
512			}
513			FilterFuncVarRef = purego.NewCallback(fcb)
514			glib.SaveCallbackWithClosure(FilterFuncVarPtr, FilterFuncVarRef, FilterFuncVar)
515		}
516	}
517
518	var DestroyVarRef uintptr
519	if DestroyVar != nil {
520		DestroyVarPtr := uintptr(unsafe.Pointer(DestroyVar))
521		if cbRefPtr, ok := glib.GetCallback(DestroyVarPtr); ok {
522			DestroyVarRef = cbRefPtr
523		} else {
524			fcb := func(arg0 uintptr) {
525				cbFn := *DestroyVar
526				cbFn(arg0)
527			}
528			DestroyVarRef = purego.NewCallback(fcb)
529			glib.SaveCallbackWithClosure(DestroyVarPtr, DestroyVarRef, DestroyVar)
530		}
531	}
532
533	xFlowBoxSetFilterFunc(x.GoPointer(), FilterFuncVarRef, UserDataVar, DestroyVarRef)
534
535}
536
537var xFlowBoxSetHadjustment func(uintptr, uintptr)
538
539// Hooks up an adjustment to focus handling in @box.
540//
541// The adjustment is also used for autoscrolling during
542// rubberband selection. See [method@Gtk.ScrolledWindow.get_hadjustment]
543// for a typical way of obtaining the adjustment, and
544// [method@Gtk.FlowBox.set_vadjustment] for setting the vertical
545// adjustment.
546//
547// The adjustments have to be in pixel units and in the same
548// coordinate system as the allocation for immediate children
549// of the box.
550func (x *FlowBox) SetHadjustment(AdjustmentVar *Adjustment) {
551
552	xFlowBoxSetHadjustment(x.GoPointer(), AdjustmentVar.GoPointer())
553
554}
555
556var xFlowBoxSetHomogeneous func(uintptr, bool)
557
558// Sets whether or not all children of @box are given
559// equal space in the box.
560func (x *FlowBox) SetHomogeneous(HomogeneousVar bool) {
561
562	xFlowBoxSetHomogeneous(x.GoPointer(), HomogeneousVar)
563
564}
565
566var xFlowBoxSetMaxChildrenPerLine func(uintptr, uint)
567
568// Sets the maximum number of children to request and
569// allocate space for in @box’s orientation.
570//
571// Setting the maximum number of children per line
572// limits the overall natural size request to be no more
573// than @n_children children long in the given orientation.
574func (x *FlowBox) SetMaxChildrenPerLine(NChildrenVar uint) {
575
576	xFlowBoxSetMaxChildrenPerLine(x.GoPointer(), NChildrenVar)
577
578}
579
580var xFlowBoxSetMinChildrenPerLine func(uintptr, uint)
581
582// Sets the minimum number of children to line up
583// in @box’s orientation before flowing.
584func (x *FlowBox) SetMinChildrenPerLine(NChildrenVar uint) {
585
586	xFlowBoxSetMinChildrenPerLine(x.GoPointer(), NChildrenVar)
587
588}
589
590var xFlowBoxSetRowSpacing func(uintptr, uint)
591
592// Sets the vertical space to add between children.
593func (x *FlowBox) SetRowSpacing(SpacingVar uint) {
594
595	xFlowBoxSetRowSpacing(x.GoPointer(), SpacingVar)
596
597}
598
599var xFlowBoxSetSelectionMode func(uintptr, SelectionMode)
600
601// Sets how selection works in @box.
602func (x *FlowBox) SetSelectionMode(ModeVar SelectionMode) {
603
604	xFlowBoxSetSelectionMode(x.GoPointer(), ModeVar)
605
606}
607
608var xFlowBoxSetSortFunc func(uintptr, uintptr, uintptr, uintptr)
609
610// By setting a sort function on the @box, one can dynamically
611// reorder the children of the box, based on the contents of
612// the children.
613//
614// The @sort_func will be called for each child after the call,
615// and will continue to be called each time a child changes (via
616// [method@Gtk.FlowBoxChild.changed]) and when
617// [method@Gtk.FlowBox.invalidate_sort] is called.
618//
619// Note that using a sort function is incompatible with using a model
620// (see [method@Gtk.FlowBox.bind_model]).
621func (x *FlowBox) SetSortFunc(SortFuncVar *FlowBoxSortFunc, UserDataVar uintptr, DestroyVar *glib.DestroyNotify) {
622
623	var SortFuncVarRef uintptr
624	if SortFuncVar != nil {
625		SortFuncVarPtr := uintptr(unsafe.Pointer(SortFuncVar))
626		if cbRefPtr, ok := glib.GetCallback(SortFuncVarPtr); ok {
627			SortFuncVarRef = cbRefPtr
628		} else {
629			fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) int {
630				cbFn := *SortFuncVar
631				return cbFn(arg0, arg1, arg2)
632			}
633			SortFuncVarRef = purego.NewCallback(fcb)
634			glib.SaveCallbackWithClosure(SortFuncVarPtr, SortFuncVarRef, SortFuncVar)
635		}
636	}
637
638	var DestroyVarRef uintptr
639	if DestroyVar != nil {
640		DestroyVarPtr := uintptr(unsafe.Pointer(DestroyVar))
641		if cbRefPtr, ok := glib.GetCallback(DestroyVarPtr); ok {
642			DestroyVarRef = cbRefPtr
643		} else {
644			fcb := func(arg0 uintptr) {
645				cbFn := *DestroyVar
646				cbFn(arg0)
647			}
648			DestroyVarRef = purego.NewCallback(fcb)
649			glib.SaveCallbackWithClosure(DestroyVarPtr, DestroyVarRef, DestroyVar)
650		}
651	}
652
653	xFlowBoxSetSortFunc(x.GoPointer(), SortFuncVarRef, UserDataVar, DestroyVarRef)
654
655}
656
657var xFlowBoxSetVadjustment func(uintptr, uintptr)
658
659// Hooks up an adjustment to focus handling in @box.
660//
661// The adjustment is also used for autoscrolling during
662// rubberband selection. See [method@Gtk.ScrolledWindow.get_vadjustment]
663// for a typical way of obtaining the adjustment, and
664// [method@Gtk.FlowBox.set_hadjustment] for setting the horizontal
665// adjustment.
666//
667// The adjustments have to be in pixel units and in the same
668// coordinate system as the allocation for immediate children
669// of the box.
670func (x *FlowBox) SetVadjustment(AdjustmentVar *Adjustment) {
671
672	xFlowBoxSetVadjustment(x.GoPointer(), AdjustmentVar.GoPointer())
673
674}
675
676var xFlowBoxUnselectAll func(uintptr)
677
678// Unselect all children of @box, if the selection
679// mode allows it.
680func (x *FlowBox) UnselectAll() {
681
682	xFlowBoxUnselectAll(x.GoPointer())
683
684}
685
686var xFlowBoxUnselectChild func(uintptr, uintptr)
687
688// Unselects a single child of @box, if the selection
689// mode allows it.
690func (x *FlowBox) UnselectChild(ChildVar *FlowBoxChild) {
691
692	xFlowBoxUnselectChild(x.GoPointer(), ChildVar.GoPointer())
693
694}
695
696func (c *FlowBox) GoPointer() uintptr {
697	if c == nil {
698		return 0
699	}
700	return c.Ptr
701}
702
703func (c *FlowBox) SetGoPointer(ptr uintptr) {
704	c.Ptr = ptr
705}
706
707// SetPropertyAcceptUnpairedRelease sets the "accept-unpaired-release" property.
708// Whether to accept unpaired release events.
709func (x *FlowBox) SetPropertyAcceptUnpairedRelease(value bool) {
710	var v gobject.Value
711	v.Init(gobject.TypeBooleanVal)
712	v.SetBoolean(value)
713	x.SetProperty("accept-unpaired-release", &v)
714}
715
716// GetPropertyAcceptUnpairedRelease gets the "accept-unpaired-release" property.
717// Whether to accept unpaired release events.
718func (x *FlowBox) GetPropertyAcceptUnpairedRelease() bool {
719	var v gobject.Value
720	x.GetProperty("accept-unpaired-release", &v)
721	return v.GetBoolean()
722}
723
724// SetPropertyActivateOnSingleClick sets the "activate-on-single-click" property.
725// Determines whether children can be activated with a single
726// click, or require a double-click.
727func (x *FlowBox) SetPropertyActivateOnSingleClick(value bool) {
728	var v gobject.Value
729	v.Init(gobject.TypeBooleanVal)
730	v.SetBoolean(value)
731	x.SetProperty("activate-on-single-click", &v)
732}
733
734// GetPropertyActivateOnSingleClick gets the "activate-on-single-click" property.
735// Determines whether children can be activated with a single
736// click, or require a double-click.
737func (x *FlowBox) GetPropertyActivateOnSingleClick() bool {
738	var v gobject.Value
739	x.GetProperty("activate-on-single-click", &v)
740	return v.GetBoolean()
741}
742
743// SetPropertyColumnSpacing sets the "column-spacing" property.
744// The amount of horizontal space between two children.
745func (x *FlowBox) SetPropertyColumnSpacing(value uint) {
746	var v gobject.Value
747	v.Init(gobject.TypeUintVal)
748	v.SetUint(value)
749	x.SetProperty("column-spacing", &v)
750}
751
752// GetPropertyColumnSpacing gets the "column-spacing" property.
753// The amount of horizontal space between two children.
754func (x *FlowBox) GetPropertyColumnSpacing() uint {
755	var v gobject.Value
756	x.GetProperty("column-spacing", &v)
757	return v.GetUint()
758}
759
760// SetPropertyHomogeneous sets the "homogeneous" property.
761// Determines whether all children should be allocated the
762// same size.
763func (x *FlowBox) SetPropertyHomogeneous(value bool) {
764	var v gobject.Value
765	v.Init(gobject.TypeBooleanVal)
766	v.SetBoolean(value)
767	x.SetProperty("homogeneous", &v)
768}
769
770// GetPropertyHomogeneous gets the "homogeneous" property.
771// Determines whether all children should be allocated the
772// same size.
773func (x *FlowBox) GetPropertyHomogeneous() bool {
774	var v gobject.Value
775	x.GetProperty("homogeneous", &v)
776	return v.GetBoolean()
777}
778
779// SetPropertyMaxChildrenPerLine sets the "max-children-per-line" property.
780// The maximum amount of children to request space for consecutively
781// in the given orientation.
782func (x *FlowBox) SetPropertyMaxChildrenPerLine(value uint) {
783	var v gobject.Value
784	v.Init(gobject.TypeUintVal)
785	v.SetUint(value)
786	x.SetProperty("max-children-per-line", &v)
787}
788
789// GetPropertyMaxChildrenPerLine gets the "max-children-per-line" property.
790// The maximum amount of children to request space for consecutively
791// in the given orientation.
792func (x *FlowBox) GetPropertyMaxChildrenPerLine() uint {
793	var v gobject.Value
794	x.GetProperty("max-children-per-line", &v)
795	return v.GetUint()
796}
797
798// SetPropertyMinChildrenPerLine sets the "min-children-per-line" property.
799// The minimum number of children to allocate consecutively
800// in the given orientation.
801//
802// Setting the minimum children per line ensures
803// that a reasonably small height will be requested
804// for the overall minimum width of the box.
805func (x *FlowBox) SetPropertyMinChildrenPerLine(value uint) {
806	var v gobject.Value
807	v.Init(gobject.TypeUintVal)
808	v.SetUint(value)
809	x.SetProperty("min-children-per-line", &v)
810}
811
812// GetPropertyMinChildrenPerLine gets the "min-children-per-line" property.
813// The minimum number of children to allocate consecutively
814// in the given orientation.
815//
816// Setting the minimum children per line ensures
817// that a reasonably small height will be requested
818// for the overall minimum width of the box.
819func (x *FlowBox) GetPropertyMinChildrenPerLine() uint {
820	var v gobject.Value
821	x.GetProperty("min-children-per-line", &v)
822	return v.GetUint()
823}
824
825// SetPropertyRowSpacing sets the "row-spacing" property.
826// The amount of vertical space between two children.
827func (x *FlowBox) SetPropertyRowSpacing(value uint) {
828	var v gobject.Value
829	v.Init(gobject.TypeUintVal)
830	v.SetUint(value)
831	x.SetProperty("row-spacing", &v)
832}
833
834// GetPropertyRowSpacing gets the "row-spacing" property.
835// The amount of vertical space between two children.
836func (x *FlowBox) GetPropertyRowSpacing() uint {
837	var v gobject.Value
838	x.GetProperty("row-spacing", &v)
839	return v.GetUint()
840}
841
842// Emitted when the user activates the @box.
843//
844// This is a [keybinding signal](class.SignalAction.html).
845func (x *FlowBox) ConnectActivateCursorChild(cb *func(FlowBox)) uint {
846	cbPtr := uintptr(unsafe.Pointer(cb))
847	if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
848		handlerID := gobject.SignalConnect(x.GoPointer(), "activate-cursor-child", cbRefPtr)
849		glib.SaveHandlerMapping(handlerID, cbPtr)
850		return handlerID
851	}
852
853	fcb := func(clsPtr uintptr) {
854		fa := FlowBox{}
855		fa.Ptr = clsPtr
856		cbFn := *cb
857
858		cbFn(fa)
859
860	}
861	cbRefPtr := purego.NewCallback(fcb)
862	glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
863	handlerID := gobject.SignalConnect(x.GoPointer(), "activate-cursor-child", cbRefPtr)
864	glib.SaveHandlerMapping(handlerID, cbPtr)
865	return handlerID
866}
867
868// Emitted when a child has been activated by the user.
869func (x *FlowBox) ConnectChildActivated(cb *func(FlowBox, uintptr)) uint {
870	cbPtr := uintptr(unsafe.Pointer(cb))
871	if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
872		handlerID := gobject.SignalConnect(x.GoPointer(), "child-activated", cbRefPtr)
873		glib.SaveHandlerMapping(handlerID, cbPtr)
874		return handlerID
875	}
876
877	fcb := func(clsPtr uintptr, ChildVarp uintptr) {
878		fa := FlowBox{}
879		fa.Ptr = clsPtr
880		cbFn := *cb
881
882		cbFn(fa, ChildVarp)
883
884	}
885	cbRefPtr := purego.NewCallback(fcb)
886	glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
887	handlerID := gobject.SignalConnect(x.GoPointer(), "child-activated", cbRefPtr)
888	glib.SaveHandlerMapping(handlerID, cbPtr)
889	return handlerID
890}
891
892// Emitted when the user initiates a cursor movement.
893//
894// This is a [keybinding signal](class.SignalAction.html).
895// Applications should not connect to it, but may emit it with
896// g_signal_emit_by_name() if they need to control the cursor
897// programmatically.
898//
899// The default bindings for this signal come in two variants,
900// the variant with the Shift modifier extends the selection,
901// the variant without the Shift modifier does not.
902// There are too many key combinations to list them all here.
903//
904//   - <kbd>←</kbd>, <kbd>→</kbd>, <kbd>↑</kbd>, <kbd>↓</kbd>
905//     move by individual children
906//   - <kbd>Home</kbd>, <kbd>End</kbd> move to the ends of the box
907//   - <kbd>PgUp</kbd>, <kbd>PgDn</kbd> move vertically by pages
908func (x *FlowBox) ConnectMoveCursor(cb *func(FlowBox, MovementStep, int, bool, bool) bool) uint {
909	cbPtr := uintptr(unsafe.Pointer(cb))
910	if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
911		handlerID := gobject.SignalConnect(x.GoPointer(), "move-cursor", cbRefPtr)
912		glib.SaveHandlerMapping(handlerID, cbPtr)
913		return handlerID
914	}
915
916	fcb := func(clsPtr uintptr, StepVarp MovementStep, CountVarp int, ExtendVarp bool, ModifyVarp bool) bool {
917		fa := FlowBox{}
918		fa.Ptr = clsPtr
919		cbFn := *cb
920
921		return cbFn(fa, StepVarp, CountVarp, ExtendVarp, ModifyVarp)
922
923	}
924	cbRefPtr := purego.NewCallback(fcb)
925	glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
926	handlerID := gobject.SignalConnect(x.GoPointer(), "move-cursor", cbRefPtr)
927	glib.SaveHandlerMapping(handlerID, cbPtr)
928	return handlerID
929}
930
931// Emitted to select all children of the box,
932// if the selection mode permits it.
933//
934// This is a [keybinding signal](class.SignalAction.html).
935//
936// The default bindings for this signal is <kbd>Ctrl</kbd>-<kbd>a</kbd>.
937func (x *FlowBox) ConnectSelectAll(cb *func(FlowBox)) uint {
938	cbPtr := uintptr(unsafe.Pointer(cb))
939	if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
940		handlerID := gobject.SignalConnect(x.GoPointer(), "select-all", cbRefPtr)
941		glib.SaveHandlerMapping(handlerID, cbPtr)
942		return handlerID
943	}
944
945	fcb := func(clsPtr uintptr) {
946		fa := FlowBox{}
947		fa.Ptr = clsPtr
948		cbFn := *cb
949
950		cbFn(fa)
951
952	}
953	cbRefPtr := purego.NewCallback(fcb)
954	glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
955	handlerID := gobject.SignalConnect(x.GoPointer(), "select-all", cbRefPtr)
956	glib.SaveHandlerMapping(handlerID, cbPtr)
957	return handlerID
958}
959
960// Emitted when the set of selected children changes.
961//
962// Use [method@Gtk.FlowBox.selected_foreach] or
963// [method@Gtk.FlowBox.get_selected_children] to obtain the
964// selected children.
965func (x *FlowBox) ConnectSelectedChildrenChanged(cb *func(FlowBox)) uint {
966	cbPtr := uintptr(unsafe.Pointer(cb))
967	if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
968		handlerID := gobject.SignalConnect(x.GoPointer(), "selected-children-changed", cbRefPtr)
969		glib.SaveHandlerMapping(handlerID, cbPtr)
970		return handlerID
971	}
972
973	fcb := func(clsPtr uintptr) {
974		fa := FlowBox{}
975		fa.Ptr = clsPtr
976		cbFn := *cb
977
978		cbFn(fa)
979
980	}
981	cbRefPtr := purego.NewCallback(fcb)
982	glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
983	handlerID := gobject.SignalConnect(x.GoPointer(), "selected-children-changed", cbRefPtr)
984	glib.SaveHandlerMapping(handlerID, cbPtr)
985	return handlerID
986}
987
988// Emitted to toggle the selection of the child that has the focus.
989//
990// This is a [keybinding signal](class.SignalAction.html).
991//
992// The default binding for this signal is <kbd>Ctrl</kbd>-<kbd>Space</kbd>.
993func (x *FlowBox) ConnectToggleCursorChild(cb *func(FlowBox)) uint {
994	cbPtr := uintptr(unsafe.Pointer(cb))
995	if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
996		handlerID := gobject.SignalConnect(x.GoPointer(), "toggle-cursor-child", cbRefPtr)
997		glib.SaveHandlerMapping(handlerID, cbPtr)
998		return handlerID
999	}
1000
1001	fcb := func(clsPtr uintptr) {
1002		fa := FlowBox{}
1003		fa.Ptr = clsPtr
1004		cbFn := *cb
1005
1006		cbFn(fa)
1007
1008	}
1009	cbRefPtr := purego.NewCallback(fcb)
1010	glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1011	handlerID := gobject.SignalConnect(x.GoPointer(), "toggle-cursor-child", cbRefPtr)
1012	glib.SaveHandlerMapping(handlerID, cbPtr)
1013	return handlerID
1014}
1015
1016// Emitted to unselect all children of the box,
1017// if the selection mode permits it.
1018//
1019// This is a [keybinding signal](class.SignalAction.html).
1020//
1021// The default bindings for this signal is <kbd>Ctrl</kbd>-<kbd>Shift</kbd>-<kbd>a</kbd>.
1022func (x *FlowBox) ConnectUnselectAll(cb *func(FlowBox)) uint {
1023	cbPtr := uintptr(unsafe.Pointer(cb))
1024	if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1025		handlerID := gobject.SignalConnect(x.GoPointer(), "unselect-all", cbRefPtr)
1026		glib.SaveHandlerMapping(handlerID, cbPtr)
1027		return handlerID
1028	}
1029
1030	fcb := func(clsPtr uintptr) {
1031		fa := FlowBox{}
1032		fa.Ptr = clsPtr
1033		cbFn := *cb
1034
1035		cbFn(fa)
1036
1037	}
1038	cbRefPtr := purego.NewCallback(fcb)
1039	glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1040	handlerID := gobject.SignalConnect(x.GoPointer(), "unselect-all", cbRefPtr)
1041	glib.SaveHandlerMapping(handlerID, cbPtr)
1042	return handlerID
1043}
1044
1045// Requests the user's screen reader to announce the given message.
1046//
1047// This kind of notification is useful for messages that
1048// either have only a visual representation or that are not
1049// exposed visually at all, e.g. a notification about a
1050// successful operation.
1051//
1052// Also, by using this API, you can ensure that the message
1053// does not interrupts the user's current screen reader output.
1054func (x *FlowBox) Announce(MessageVar string, PriorityVar AccessibleAnnouncementPriority) {
1055
1056	XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar)
1057
1058}
1059
1060// Retrieves the accessible parent for an accessible object.
1061//
1062// This function returns `NULL` for top level widgets.
1063func (x *FlowBox) GetAccessibleParent() *AccessibleBase {
1064	var cls *AccessibleBase
1065
1066	cret := XGtkAccessibleGetAccessibleParent(x.GoPointer())
1067
1068	if cret == 0 {
1069		return nil
1070	}
1071	cls = &AccessibleBase{}
1072	cls.Ptr = cret
1073	return cls
1074}
1075
1076// Retrieves the accessible role of an accessible object.
1077func (x *FlowBox) GetAccessibleRole() AccessibleRole {
1078
1079	cret := XGtkAccessibleGetAccessibleRole(x.GoPointer())
1080	return cret
1081}
1082
1083// Retrieves the implementation for the given accessible object.
1084func (x *FlowBox) GetAtContext() *ATContext {
1085	var cls *ATContext
1086
1087	cret := XGtkAccessibleGetAtContext(x.GoPointer())
1088
1089	if cret == 0 {
1090		return nil
1091	}
1092	cls = &ATContext{}
1093	cls.Ptr = cret
1094	return cls
1095}
1096
1097// Queries the coordinates and dimensions of this accessible
1098//
1099// This functionality can be overridden by `GtkAccessible`
1100// implementations, e.g. to get the bounds from an ignored
1101// child widget.
1102func (x *FlowBox) GetBounds(XVar *int, YVar *int, WidthVar *int, HeightVar *int) bool {
1103
1104	cret := XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar)
1105	return cret
1106}
1107
1108// Retrieves the first accessible child of an accessible object.
1109func (x *FlowBox) GetFirstAccessibleChild() *AccessibleBase {
1110	var cls *AccessibleBase
1111
1112	cret := XGtkAccessibleGetFirstAccessibleChild(x.GoPointer())
1113
1114	if cret == 0 {
1115		return nil
1116	}
1117	cls = &AccessibleBase{}
1118	cls.Ptr = cret
1119	return cls
1120}
1121
1122// Retrieves the next accessible sibling of an accessible object
1123func (x *FlowBox) GetNextAccessibleSibling() *AccessibleBase {
1124	var cls *AccessibleBase
1125
1126	cret := XGtkAccessibleGetNextAccessibleSibling(x.GoPointer())
1127
1128	if cret == 0 {
1129		return nil
1130	}
1131	cls = &AccessibleBase{}
1132	cls.Ptr = cret
1133	return cls
1134}
1135
1136// Queries a platform state, such as focus.
1137//
1138// This functionality can be overridden by `GtkAccessible`
1139// implementations, e.g. to get platform state from an ignored
1140// child widget, as is the case for `GtkText` wrappers.
1141func (x *FlowBox) GetPlatformState(StateVar AccessiblePlatformState) bool {
1142
1143	cret := XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar)
1144	return cret
1145}
1146
1147// Resets the accessible property to its default value.
1148func (x *FlowBox) ResetProperty(PropertyVar AccessibleProperty) {
1149
1150	XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar)
1151
1152}
1153
1154// Resets the accessible relation to its default value.
1155func (x *FlowBox) ResetRelation(RelationVar AccessibleRelation) {
1156
1157	XGtkAccessibleResetRelation(x.GoPointer(), RelationVar)
1158
1159}
1160
1161// Resets the accessible state to its default value.
1162func (x *FlowBox) ResetState(StateVar AccessibleState) {
1163
1164	XGtkAccessibleResetState(x.GoPointer(), StateVar)
1165
1166}
1167
1168// Sets the parent and sibling of an accessible object.
1169//
1170// This function is meant to be used by accessible implementations that are
1171// not part of the widget hierarchy, and but act as a logical bridge between
1172// widgets. For instance, if a widget creates an object that holds metadata
1173// for each child, and you want that object to implement the `GtkAccessible`
1174// interface, you will use this function to ensure that the parent of each
1175// child widget is the metadata object, and the parent of each metadata
1176// object is the container widget.
1177func (x *FlowBox) SetAccessibleParent(ParentVar Accessible, NextSiblingVar Accessible) {
1178
1179	XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer())
1180
1181}
1182
1183// Updates the next accessible sibling.
1184//
1185// That might be useful when a new child of a custom accessible
1186// is created, and it needs to be linked to a previous child.
1187func (x *FlowBox) UpdateNextAccessibleSibling(NewSiblingVar Accessible) {
1188
1189	XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer())
1190
1191}
1192
1193// Informs ATs that the platform state has changed.
1194//
1195// This function should be used by `GtkAccessible` implementations that
1196// have a platform state but are not widgets. Widgets handle platform
1197// states automatically.
1198func (x *FlowBox) UpdatePlatformState(StateVar AccessiblePlatformState) {
1199
1200	XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar)
1201
1202}
1203
1204// Updates a list of accessible properties.
1205//
1206// See the [enum@Gtk.AccessibleProperty] documentation for the
1207// value types of accessible properties.
1208//
1209// This function should be called by `GtkWidget` types whenever
1210// an accessible property change must be communicated to assistive
1211// technologies.
1212//
1213// Example:
1214// ```c
1215// value = gtk_adjustment_get_value (adjustment);
1216// gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button),
1217//
1218//	GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value,
1219//	-1);
1220//
1221// ```
1222func (x *FlowBox) UpdateProperty(FirstPropertyVar AccessibleProperty, varArgs ...interface{}) {
1223
1224	XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...)
1225
1226}
1227
1228// Updates an array of accessible properties.
1229//
1230// This function should be called by `GtkWidget` types whenever an accessible
1231// property change must be communicated to assistive technologies.
1232//
1233// This function is meant to be used by language bindings.
1234func (x *FlowBox) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []AccessibleProperty, ValuesVar []gobject.Value) {
1235
1236	XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar)
1237
1238}
1239
1240// Updates a list of accessible relations.
1241//
1242// This function should be called by `GtkWidget` types whenever an accessible
1243// relation change must be communicated to assistive technologies.
1244//
1245// If the [enum@Gtk.AccessibleRelation] requires a list of references,
1246// you should pass each reference individually, followed by `NULL`, e.g.
1247//
1248// ```c
1249// gtk_accessible_update_relation (accessible,
1250//
1251//	GTK_ACCESSIBLE_RELATION_CONTROLS,
1252//	  ref1, NULL,
1253//	GTK_ACCESSIBLE_RELATION_LABELLED_BY,
1254//	  ref1, ref2, ref3, NULL,
1255//	-1);
1256//
1257// ```
1258func (x *FlowBox) UpdateRelation(FirstRelationVar AccessibleRelation, varArgs ...interface{}) {
1259
1260	XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...)
1261
1262}
1263
1264// Updates an array of accessible relations.
1265//
1266// This function should be called by `GtkWidget` types whenever an accessible
1267// relation change must be communicated to assistive technologies.
1268//
1269// This function is meant to be used by language bindings.
1270func (x *FlowBox) UpdateRelationValue(NRelationsVar int, RelationsVar []AccessibleRelation, ValuesVar []gobject.Value) {
1271
1272	XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar)
1273
1274}
1275
1276// Updates a list of accessible states.
1277//
1278// See the [enum@Gtk.AccessibleState] documentation for the
1279// value types of accessible states.
1280//
1281// This function should be called by `GtkWidget` types whenever
1282// an accessible state change must be communicated to assistive
1283// technologies.
1284//
1285// Example:
1286//
1287// ```c
1288// value = GTK_ACCESSIBLE_TRISTATE_MIXED;
1289// gtk_accessible_update_state (GTK_ACCESSIBLE (check_button),
1290//
1291//	GTK_ACCESSIBLE_STATE_CHECKED, value,
1292//	-1);
1293//
1294// ```
1295func (x *FlowBox) UpdateState(FirstStateVar AccessibleState, varArgs ...interface{}) {
1296
1297	XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...)
1298
1299}
1300
1301// Updates an array of accessible states.
1302//
1303// This function should be called by `GtkWidget` types whenever an accessible
1304// state change must be communicated to assistive technologies.
1305//
1306// This function is meant to be used by language bindings.
1307func (x *FlowBox) UpdateStateValue(NStatesVar int, StatesVar []AccessibleState, ValuesVar []gobject.Value) {
1308
1309	XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar)
1310
1311}
1312
1313// Gets the ID of the @buildable object.
1314//
1315// `GtkBuilder` sets the name based on the ID attribute
1316// of the `<object>` tag used to construct the @buildable.
1317func (x *FlowBox) GetBuildableId() string {
1318
1319	cret := XGtkBuildableGetBuildableId(x.GoPointer())
1320	return cret
1321}
1322
1323// Retrieves the orientation of the @orientable.
1324func (x *FlowBox) GetOrientation() Orientation {
1325
1326	cret := XGtkOrientableGetOrientation(x.GoPointer())
1327	return cret
1328}
1329
1330// Sets the orientation of the @orientable.
1331func (x *FlowBox) SetOrientation(OrientationVar Orientation) {
1332
1333	XGtkOrientableSetOrientation(x.GoPointer(), OrientationVar)
1334
1335}
1336
1337// The kind of widget that can be added to a `GtkFlowBox`.
1338//
1339// [class@Gtk.FlowBox] will automatically wrap its children in a `GtkFlowBoxChild`
1340// when necessary.
1341type FlowBoxChild struct {
1342	Widget
1343}
1344
1345var xFlowBoxChildGLibType func() types.GType
1346
1347func FlowBoxChildGLibType() types.GType {
1348	return xFlowBoxChildGLibType()
1349}
1350
1351func FlowBoxChildNewFromInternalPtr(ptr uintptr) *FlowBoxChild {
1352	cls := &FlowBoxChild{}
1353	cls.Ptr = ptr
1354	return cls
1355}
1356
1357var xNewFlowBoxChild func() uintptr
1358
1359// Creates a new `GtkFlowBoxChild`.
1360//
1361// This should only be used as a child of a `GtkFlowBox`.
1362func NewFlowBoxChild() *FlowBoxChild {
1363	var cls *FlowBoxChild
1364
1365	cret := xNewFlowBoxChild()
1366
1367	if cret == 0 {
1368		return nil
1369	}
1370	gobject.IncreaseRef(cret)
1371	cls = &FlowBoxChild{}
1372	cls.Ptr = cret
1373	return cls
1374}
1375
1376var xFlowBoxChildChanged func(uintptr)
1377
1378// Marks @child as changed, causing any state that depends on this
1379// to be updated.
1380//
1381// This affects sorting and filtering.
1382//
1383// Note that calls to this method must be in sync with the data
1384// used for the sorting and filtering functions. For instance, if
1385// the list is mirroring some external data set, and *two* children
1386// changed in the external data set when you call
1387// gtk_flow_box_child_changed() on the first child, the sort function
1388// must only read the new data for the first of the two changed
1389// children, otherwise the resorting of the children will be wrong.
1390//
1391// This generally means that if you don’t fully control the data
1392// model, you have to duplicate the data that affects the sorting
1393// and filtering functions into the widgets themselves.
1394//
1395// Another alternative is to call [method@Gtk.FlowBox.invalidate_sort]
1396// on any model change, but that is more expensive.
1397func (x *FlowBoxChild) Changed() {
1398
1399	xFlowBoxChildChanged(x.GoPointer())
1400
1401}
1402
1403var xFlowBoxChildGetChild func(uintptr) uintptr
1404
1405// Gets the child widget of @self.
1406func (x *FlowBoxChild) GetChild() *Widget {
1407	var cls *Widget
1408
1409	cret := xFlowBoxChildGetChild(x.GoPointer())
1410
1411	if cret == 0 {
1412		return nil
1413	}
1414	gobject.IncreaseRef(cret)
1415	cls = &Widget{}
1416	cls.Ptr = cret
1417	return cls
1418}
1419
1420var xFlowBoxChildGetIndex func(uintptr) int
1421
1422// Gets the current index of the @child in its `GtkFlowBox` container.
1423func (x *FlowBoxChild) GetIndex() int {
1424
1425	cret := xFlowBoxChildGetIndex(x.GoPointer())
1426	return cret
1427}
1428
1429var xFlowBoxChildIsSelected func(uintptr) bool
1430
1431// Returns whether the @child is currently selected in its
1432// `GtkFlowBox` container.
1433func (x *FlowBoxChild) IsSelected() bool {
1434
1435	cret := xFlowBoxChildIsSelected(x.GoPointer())
1436	return cret
1437}
1438
1439var xFlowBoxChildSetChild func(uintptr, uintptr)
1440
1441// Sets the child widget of @self.
1442func (x *FlowBoxChild) SetChild(ChildVar *Widget) {
1443
1444	xFlowBoxChildSetChild(x.GoPointer(), ChildVar.GoPointer())
1445
1446}
1447
1448func (c *FlowBoxChild) GoPointer() uintptr {
1449	if c == nil {
1450		return 0
1451	}
1452	return c.Ptr
1453}
1454
1455func (c *FlowBoxChild) SetGoPointer(ptr uintptr) {
1456	c.Ptr = ptr
1457}
1458
1459// Emitted when the user activates a child widget in a `GtkFlowBox`.
1460//
1461// This can happen either by clicking or double-clicking,
1462// or via a keybinding.
1463//
1464// This is a [keybinding signal](class.SignalAction.html),
1465// but it can be used by applications for their own purposes.
1466//
1467// The default bindings are <kbd>Space</kbd> and <kbd>Enter</kbd>.
1468func (x *FlowBoxChild) ConnectActivate(cb *func(FlowBoxChild)) uint {
1469	cbPtr := uintptr(unsafe.Pointer(cb))
1470	if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1471		handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
1472		glib.SaveHandlerMapping(handlerID, cbPtr)
1473		return handlerID
1474	}
1475
1476	fcb := func(clsPtr uintptr) {
1477		fa := FlowBoxChild{}
1478		fa.Ptr = clsPtr
1479		cbFn := *cb
1480
1481		cbFn(fa)
1482
1483	}
1484	cbRefPtr := purego.NewCallback(fcb)
1485	glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1486	handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
1487	glib.SaveHandlerMapping(handlerID, cbPtr)
1488	return handlerID
1489}
1490
1491// Requests the user's screen reader to announce the given message.
1492//
1493// This kind of notification is useful for messages that
1494// either have only a visual representation or that are not
1495// exposed visually at all, e.g. a notification about a
1496// successful operation.
1497//
1498// Also, by using this API, you can ensure that the message
1499// does not interrupts the user's current screen reader output.
1500func (x *FlowBoxChild) Announce(MessageVar string, PriorityVar AccessibleAnnouncementPriority) {
1501
1502	XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar)
1503
1504}
1505
1506// Retrieves the accessible parent for an accessible object.
1507//
1508// This function returns `NULL` for top level widgets.
1509func (x *FlowBoxChild) GetAccessibleParent() *AccessibleBase {
1510	var cls *AccessibleBase
1511
1512	cret := XGtkAccessibleGetAccessibleParent(x.GoPointer())
1513
1514	if cret == 0 {
1515		return nil
1516	}
1517	cls = &AccessibleBase{}
1518	cls.Ptr = cret
1519	return cls
1520}
1521
1522// Retrieves the accessible role of an accessible object.
1523func (x *FlowBoxChild) GetAccessibleRole() AccessibleRole {
1524
1525	cret := XGtkAccessibleGetAccessibleRole(x.GoPointer())
1526	return cret
1527}
1528
1529// Retrieves the implementation for the given accessible object.
1530func (x *FlowBoxChild) GetAtContext() *ATContext {
1531	var cls *ATContext
1532
1533	cret := XGtkAccessibleGetAtContext(x.GoPointer())
1534
1535	if cret == 0 {
1536		return nil
1537	}
1538	cls = &ATContext{}
1539	cls.Ptr = cret
1540	return cls
1541}
1542
1543// Queries the coordinates and dimensions of this accessible
1544//
1545// This functionality can be overridden by `GtkAccessible`
1546// implementations, e.g. to get the bounds from an ignored
1547// child widget.
1548func (x *FlowBoxChild) GetBounds(XVar *int, YVar *int, WidthVar *int, HeightVar *int) bool {
1549
1550	cret := XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar)
1551	return cret
1552}
1553
1554// Retrieves the first accessible child of an accessible object.
1555func (x *FlowBoxChild) GetFirstAccessibleChild() *AccessibleBase {
1556	var cls *AccessibleBase
1557
1558	cret := XGtkAccessibleGetFirstAccessibleChild(x.GoPointer())
1559
1560	if cret == 0 {
1561		return nil
1562	}
1563	cls = &AccessibleBase{}
1564	cls.Ptr = cret
1565	return cls
1566}
1567
1568// Retrieves the next accessible sibling of an accessible object
1569func (x *FlowBoxChild) GetNextAccessibleSibling() *AccessibleBase {
1570	var cls *AccessibleBase
1571
1572	cret := XGtkAccessibleGetNextAccessibleSibling(x.GoPointer())
1573
1574	if cret == 0 {
1575		return nil
1576	}
1577	cls = &AccessibleBase{}
1578	cls.Ptr = cret
1579	return cls
1580}
1581
1582// Queries a platform state, such as focus.
1583//
1584// This functionality can be overridden by `GtkAccessible`
1585// implementations, e.g. to get platform state from an ignored
1586// child widget, as is the case for `GtkText` wrappers.
1587func (x *FlowBoxChild) GetPlatformState(StateVar AccessiblePlatformState) bool {
1588
1589	cret := XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar)
1590	return cret
1591}
1592
1593// Resets the accessible property to its default value.
1594func (x *FlowBoxChild) ResetProperty(PropertyVar AccessibleProperty) {
1595
1596	XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar)
1597
1598}
1599
1600// Resets the accessible relation to its default value.
1601func (x *FlowBoxChild) ResetRelation(RelationVar AccessibleRelation) {
1602
1603	XGtkAccessibleResetRelation(x.GoPointer(), RelationVar)
1604
1605}
1606
1607// Resets the accessible state to its default value.
1608func (x *FlowBoxChild) ResetState(StateVar AccessibleState) {
1609
1610	XGtkAccessibleResetState(x.GoPointer(), StateVar)
1611
1612}
1613
1614// Sets the parent and sibling of an accessible object.
1615//
1616// This function is meant to be used by accessible implementations that are
1617// not part of the widget hierarchy, and but act as a logical bridge between
1618// widgets. For instance, if a widget creates an object that holds metadata
1619// for each child, and you want that object to implement the `GtkAccessible`
1620// interface, you will use this function to ensure that the parent of each
1621// child widget is the metadata object, and the parent of each metadata
1622// object is the container widget.
1623func (x *FlowBoxChild) SetAccessibleParent(ParentVar Accessible, NextSiblingVar Accessible) {
1624
1625	XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer())
1626
1627}
1628
1629// Updates the next accessible sibling.
1630//
1631// That might be useful when a new child of a custom accessible
1632// is created, and it needs to be linked to a previous child.
1633func (x *FlowBoxChild) UpdateNextAccessibleSibling(NewSiblingVar Accessible) {
1634
1635	XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer())
1636
1637}
1638
1639// Informs ATs that the platform state has changed.
1640//
1641// This function should be used by `GtkAccessible` implementations that
1642// have a platform state but are not widgets. Widgets handle platform
1643// states automatically.
1644func (x *FlowBoxChild) UpdatePlatformState(StateVar AccessiblePlatformState) {
1645
1646	XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar)
1647
1648}
1649
1650// Updates a list of accessible properties.
1651//
1652// See the [enum@Gtk.AccessibleProperty] documentation for the
1653// value types of accessible properties.
1654//
1655// This function should be called by `GtkWidget` types whenever
1656// an accessible property change must be communicated to assistive
1657// technologies.
1658//
1659// Example:
1660// ```c
1661// value = gtk_adjustment_get_value (adjustment);
1662// gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button),
1663//
1664//	GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value,
1665//	-1);
1666//
1667// ```
1668func (x *FlowBoxChild) UpdateProperty(FirstPropertyVar AccessibleProperty, varArgs ...interface{}) {
1669
1670	XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...)
1671
1672}
1673
1674// Updates an array of accessible properties.
1675//
1676// This function should be called by `GtkWidget` types whenever an accessible
1677// property change must be communicated to assistive technologies.
1678//
1679// This function is meant to be used by language bindings.
1680func (x *FlowBoxChild) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []AccessibleProperty, ValuesVar []gobject.Value) {
1681
1682	XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar)
1683
1684}
1685
1686// Updates a list of accessible relations.
1687//
1688// This function should be called by `GtkWidget` types whenever an accessible
1689// relation change must be communicated to assistive technologies.
1690//
1691// If the [enum@Gtk.AccessibleRelation] requires a list of references,
1692// you should pass each reference individually, followed by `NULL`, e.g.
1693//
1694// ```c
1695// gtk_accessible_update_relation (accessible,
1696//
1697//	GTK_ACCESSIBLE_RELATION_CONTROLS,
1698//	  ref1, NULL,
1699//	GTK_ACCESSIBLE_RELATION_LABELLED_BY,
1700//	  ref1, ref2, ref3, NULL,
1701//	-1);
1702//
1703// ```
1704func (x *FlowBoxChild) UpdateRelation(FirstRelationVar AccessibleRelation, varArgs ...interface{}) {
1705
1706	XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...)
1707
1708}
1709
1710// Updates an array of accessible relations.
1711//
1712// This function should be called by `GtkWidget` types whenever an accessible
1713// relation change must be communicated to assistive technologies.
1714//
1715// This function is meant to be used by language bindings.
1716func (x *FlowBoxChild) UpdateRelationValue(NRelationsVar int, RelationsVar []AccessibleRelation, ValuesVar []gobject.Value) {
1717
1718	XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar)
1719
1720}
1721
1722// Updates a list of accessible states.
1723//
1724// See the [enum@Gtk.AccessibleState] documentation for the
1725// value types of accessible states.
1726//
1727// This function should be called by `GtkWidget` types whenever
1728// an accessible state change must be communicated to assistive
1729// technologies.
1730//
1731// Example:
1732//
1733// ```c
1734// value = GTK_ACCESSIBLE_TRISTATE_MIXED;
1735// gtk_accessible_update_state (GTK_ACCESSIBLE (check_button),
1736//
1737//	GTK_ACCESSIBLE_STATE_CHECKED, value,
1738//	-1);
1739//
1740// ```
1741func (x *FlowBoxChild) UpdateState(FirstStateVar AccessibleState, varArgs ...interface{}) {
1742
1743	XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...)
1744
1745}
1746
1747// Updates an array of accessible states.
1748//
1749// This function should be called by `GtkWidget` types whenever an accessible
1750// state change must be communicated to assistive technologies.
1751//
1752// This function is meant to be used by language bindings.
1753func (x *FlowBoxChild) UpdateStateValue(NStatesVar int, StatesVar []AccessibleState, ValuesVar []gobject.Value) {
1754
1755	XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar)
1756
1757}
1758
1759// Gets the ID of the @buildable object.
1760//
1761// `GtkBuilder` sets the name based on the ID attribute
1762// of the `<object>` tag used to construct the @buildable.
1763func (x *FlowBoxChild) GetBuildableId() string {
1764
1765	cret := XGtkBuildableGetBuildableId(x.GoPointer())
1766	return cret
1767}
1768
1769func init() {
1770	core.SetPackageName("GTK", "gtk4")
1771	core.SetSharedLibraries("GTK", []string{"libgtk-4.so.1"})
1772	var libs []uintptr
1773	for _, libPath := range core.GetPaths("GTK") {
1774		lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
1775		if err != nil {
1776			panic(err)
1777		}
1778		libs = append(libs, lib)
1779	}
1780
1781	core.PuregoSafeRegister(&xFlowBoxGLibType, libs, "gtk_flow_box_get_type")
1782
1783	core.PuregoSafeRegister(&xNewFlowBox, libs, "gtk_flow_box_new")
1784
1785	core.PuregoSafeRegister(&xFlowBoxAppend, libs, "gtk_flow_box_append")
1786	core.PuregoSafeRegister(&xFlowBoxBindModel, libs, "gtk_flow_box_bind_model")
1787	core.PuregoSafeRegister(&xFlowBoxGetActivateOnSingleClick, libs, "gtk_flow_box_get_activate_on_single_click")
1788	core.PuregoSafeRegister(&xFlowBoxGetChildAtIndex, libs, "gtk_flow_box_get_child_at_index")
1789	core.PuregoSafeRegister(&xFlowBoxGetChildAtPos, libs, "gtk_flow_box_get_child_at_pos")
1790	core.PuregoSafeRegister(&xFlowBoxGetColumnSpacing, libs, "gtk_flow_box_get_column_spacing")
1791	core.PuregoSafeRegister(&xFlowBoxGetHomogeneous, libs, "gtk_flow_box_get_homogeneous")
1792	core.PuregoSafeRegister(&xFlowBoxGetMaxChildrenPerLine, libs, "gtk_flow_box_get_max_children_per_line")
1793	core.PuregoSafeRegister(&xFlowBoxGetMinChildrenPerLine, libs, "gtk_flow_box_get_min_children_per_line")
1794	core.PuregoSafeRegister(&xFlowBoxGetRowSpacing, libs, "gtk_flow_box_get_row_spacing")
1795	core.PuregoSafeRegister(&xFlowBoxGetSelectedChildren, libs, "gtk_flow_box_get_selected_children")
1796	core.PuregoSafeRegister(&xFlowBoxGetSelectionMode, libs, "gtk_flow_box_get_selection_mode")
1797	core.PuregoSafeRegister(&xFlowBoxInsert, libs, "gtk_flow_box_insert")
1798	core.PuregoSafeRegister(&xFlowBoxInvalidateFilter, libs, "gtk_flow_box_invalidate_filter")
1799	core.PuregoSafeRegister(&xFlowBoxInvalidateSort, libs, "gtk_flow_box_invalidate_sort")
1800	core.PuregoSafeRegister(&xFlowBoxPrepend, libs, "gtk_flow_box_prepend")
1801	core.PuregoSafeRegister(&xFlowBoxRemove, libs, "gtk_flow_box_remove")
1802	core.PuregoSafeRegister(&xFlowBoxRemoveAll, libs, "gtk_flow_box_remove_all")
1803	core.PuregoSafeRegister(&xFlowBoxSelectAll, libs, "gtk_flow_box_select_all")
1804	core.PuregoSafeRegister(&xFlowBoxSelectChild, libs, "gtk_flow_box_select_child")
1805	core.PuregoSafeRegister(&xFlowBoxSelectedForeach, libs, "gtk_flow_box_selected_foreach")
1806	core.PuregoSafeRegister(&xFlowBoxSetActivateOnSingleClick, libs, "gtk_flow_box_set_activate_on_single_click")
1807	core.PuregoSafeRegister(&xFlowBoxSetColumnSpacing, libs, "gtk_flow_box_set_column_spacing")
1808	core.PuregoSafeRegister(&xFlowBoxSetFilterFunc, libs, "gtk_flow_box_set_filter_func")
1809	core.PuregoSafeRegister(&xFlowBoxSetHadjustment, libs, "gtk_flow_box_set_hadjustment")
1810	core.PuregoSafeRegister(&xFlowBoxSetHomogeneous, libs, "gtk_flow_box_set_homogeneous")
1811	core.PuregoSafeRegister(&xFlowBoxSetMaxChildrenPerLine, libs, "gtk_flow_box_set_max_children_per_line")
1812	core.PuregoSafeRegister(&xFlowBoxSetMinChildrenPerLine, libs, "gtk_flow_box_set_min_children_per_line")
1813	core.PuregoSafeRegister(&xFlowBoxSetRowSpacing, libs, "gtk_flow_box_set_row_spacing")
1814	core.PuregoSafeRegister(&xFlowBoxSetSelectionMode, libs, "gtk_flow_box_set_selection_mode")
1815	core.PuregoSafeRegister(&xFlowBoxSetSortFunc, libs, "gtk_flow_box_set_sort_func")
1816	core.PuregoSafeRegister(&xFlowBoxSetVadjustment, libs, "gtk_flow_box_set_vadjustment")
1817	core.PuregoSafeRegister(&xFlowBoxUnselectAll, libs, "gtk_flow_box_unselect_all")
1818	core.PuregoSafeRegister(&xFlowBoxUnselectChild, libs, "gtk_flow_box_unselect_child")
1819
1820	core.PuregoSafeRegister(&xFlowBoxChildGLibType, libs, "gtk_flow_box_child_get_type")
1821
1822	core.PuregoSafeRegister(&xNewFlowBoxChild, libs, "gtk_flow_box_child_new")
1823
1824	core.PuregoSafeRegister(&xFlowBoxChildChanged, libs, "gtk_flow_box_child_changed")
1825	core.PuregoSafeRegister(&xFlowBoxChildGetChild, libs, "gtk_flow_box_child_get_child")
1826	core.PuregoSafeRegister(&xFlowBoxChildGetIndex, libs, "gtk_flow_box_child_get_index")
1827	core.PuregoSafeRegister(&xFlowBoxChildIsSelected, libs, "gtk_flow_box_child_is_selected")
1828	core.PuregoSafeRegister(&xFlowBoxChildSetChild, libs, "gtk_flow_box_child_set_child")
1829
1830}

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