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/glib"
12 "github.com/bnema/puregotk/v4/gobject"
13 "github.com/bnema/puregotk/v4/gobject/types"
14)
15
16type GridViewClass struct {
17 _ structs.HostLayout
18}
19
20func (x *GridViewClass) GoPointer() uintptr {
21 return uintptr(unsafe.Pointer(x))
22}
23
24// Presents a large dynamic grid of items.
25//
26// `GtkGridView` uses its factory to generate one child widget for each
27// visible item and shows them in a grid. The orientation of the grid view
28// determines if the grid reflows vertically or horizontally.
29//
30// `GtkGridView` allows the user to select items according to the selection
31// characteristics of the model. For models that allow multiple selected items,
32// it is possible to turn on _rubberband selection_, using
33// [property@Gtk.GridView:enable-rubberband].
34//
35// To learn more about the list widget framework, see the
36// [overview](section-list-widget.html).
37//
38// # Actions
39//
40// `GtkGridView` defines a set of built-in actions:
41//
42// - `list.activate-item` activates the item at given position by emitting the
43// the [signal@Gtk.GridView::activate] signal.
44//
45// # CSS nodes
46//
47// ```
48// gridview
49// ├── child[.activatable]
50// │
51// ├── child[.activatable]
52// │
53// ┊
54// ╰── [rubberband]
55// ```
56//
57// `GtkGridView` uses a single CSS node with name `gridview`. Each child uses
58// a single CSS node with name `child`. If the [property@Gtk.ListItem:activatable]
59// property is set, the corresponding row will have the `.activatable` style
60// class. For rubberband selection, a subnode with name `rubberband` is used.
61//
62// # Accessibility
63//
64// `GtkGridView` uses the [enum@Gtk.AccessibleRole.grid] role, and the items
65// use the [enum@Gtk.AccessibleRole.grid_cell] role.
66type GridView struct {
67 ListBase
68}
69
70var xGridViewGLibType func() types.GType
71
72func GridViewGLibType() types.GType {
73 return xGridViewGLibType()
74}
75
76func GridViewNewFromInternalPtr(ptr uintptr) *GridView {
77 cls := &GridView{}
78 cls.Ptr = ptr
79 return cls
80}
81
82var xNewGridView func(uintptr, uintptr) uintptr
83
84// Creates a new `GtkGridView` that uses the given @factory for
85// mapping items to widgets.
86//
87// The function takes ownership of the
88// arguments, so you can write code like
89// ```c
90// grid_view = gtk_grid_view_new (create_model (),
91//
92// gtk_builder_list_item_factory_new_from_resource ("/resource.ui"));
93//
94// ```
95func NewGridView(ModelVar SelectionModel, FactoryVar *ListItemFactory) *GridView {
96 var cls *GridView
97
98 cret := xNewGridView(ModelVar.GoPointer(), FactoryVar.GoPointer())
99
100 if cret == 0 {
101 return nil
102 }
103 gobject.IncreaseRef(cret)
104 cls = &GridView{}
105 cls.Ptr = cret
106 return cls
107}
108
109var xGridViewGetEnableRubberband func(uintptr) bool
110
111// Returns whether rows can be selected by dragging with the mouse.
112func (x *GridView) GetEnableRubberband() bool {
113
114 cret := xGridViewGetEnableRubberband(x.GoPointer())
115 return cret
116}
117
118var xGridViewGetFactory func(uintptr) uintptr
119
120// Gets the factory that's currently used to populate list items.
121func (x *GridView) GetFactory() *ListItemFactory {
122 var cls *ListItemFactory
123
124 cret := xGridViewGetFactory(x.GoPointer())
125
126 if cret == 0 {
127 return nil
128 }
129 gobject.IncreaseRef(cret)
130 cls = &ListItemFactory{}
131 cls.Ptr = cret
132 return cls
133}
134
135var xGridViewGetMaxColumns func(uintptr) uint
136
137// Gets the maximum number of columns that the grid will use.
138func (x *GridView) GetMaxColumns() uint {
139
140 cret := xGridViewGetMaxColumns(x.GoPointer())
141 return cret
142}
143
144var xGridViewGetMinColumns func(uintptr) uint
145
146// Gets the minimum number of columns that the grid will use.
147func (x *GridView) GetMinColumns() uint {
148
149 cret := xGridViewGetMinColumns(x.GoPointer())
150 return cret
151}
152
153var xGridViewGetModel func(uintptr) uintptr
154
155// Gets the model that's currently used to read the items displayed.
156func (x *GridView) GetModel() *SelectionModelBase {
157 var cls *SelectionModelBase
158
159 cret := xGridViewGetModel(x.GoPointer())
160
161 if cret == 0 {
162 return nil
163 }
164 gobject.IncreaseRef(cret)
165 cls = &SelectionModelBase{}
166 cls.Ptr = cret
167 return cls
168}
169
170var xGridViewGetSingleClickActivate func(uintptr) bool
171
172// Returns whether items will be activated on single click and
173// selected on hover.
174func (x *GridView) GetSingleClickActivate() bool {
175
176 cret := xGridViewGetSingleClickActivate(x.GoPointer())
177 return cret
178}
179
180var xGridViewGetTabBehavior func(uintptr) ListTabBehavior
181
182// Gets the behavior set for the <kbd>Tab</kbd> key.
183func (x *GridView) GetTabBehavior() ListTabBehavior {
184
185 cret := xGridViewGetTabBehavior(x.GoPointer())
186 return cret
187}
188
189var xGridViewScrollTo func(uintptr, uint, ListScrollFlags, *ScrollInfo)
190
191// Scrolls to the item at the given position and performs the actions
192// specified in @flags.
193//
194// This function works no matter if the gridview is shown or focused.
195// If it isn't, then the changes will take effect once that happens.
196func (x *GridView) ScrollTo(PosVar uint, FlagsVar ListScrollFlags, ScrollVar *ScrollInfo) {
197
198 xGridViewScrollTo(x.GoPointer(), PosVar, FlagsVar, ScrollVar)
199
200}
201
202var xGridViewSetEnableRubberband func(uintptr, bool)
203
204// Sets whether selections can be changed by dragging with the mouse.
205func (x *GridView) SetEnableRubberband(EnableRubberbandVar bool) {
206
207 xGridViewSetEnableRubberband(x.GoPointer(), EnableRubberbandVar)
208
209}
210
211var xGridViewSetFactory func(uintptr, uintptr)
212
213// Sets the `GtkListItemFactory` to use for populating list items.
214func (x *GridView) SetFactory(FactoryVar *ListItemFactory) {
215
216 xGridViewSetFactory(x.GoPointer(), FactoryVar.GoPointer())
217
218}
219
220var xGridViewSetMaxColumns func(uintptr, uint)
221
222// Sets the maximum number of columns to use.
223//
224// This number must be at least 1.
225//
226// If @max_columns is smaller than the minimum set via
227// [method@Gtk.GridView.set_min_columns], that value is used instead.
228func (x *GridView) SetMaxColumns(MaxColumnsVar uint) {
229
230 xGridViewSetMaxColumns(x.GoPointer(), MaxColumnsVar)
231
232}
233
234var xGridViewSetMinColumns func(uintptr, uint)
235
236// Sets the minimum number of columns to use.
237//
238// This number must be at least 1.
239//
240// If @min_columns is smaller than the minimum set via
241// [method@Gtk.GridView.set_max_columns], that value is ignored.
242func (x *GridView) SetMinColumns(MinColumnsVar uint) {
243
244 xGridViewSetMinColumns(x.GoPointer(), MinColumnsVar)
245
246}
247
248var xGridViewSetModel func(uintptr, uintptr)
249
250// Sets the model to use.
251//
252// This must be a [iface@Gtk.SelectionModel].
253func (x *GridView) SetModel(ModelVar SelectionModel) {
254
255 xGridViewSetModel(x.GoPointer(), ModelVar.GoPointer())
256
257}
258
259var xGridViewSetSingleClickActivate func(uintptr, bool)
260
261// Sets whether items should be activated on single click and
262// selected on hover.
263func (x *GridView) SetSingleClickActivate(SingleClickActivateVar bool) {
264
265 xGridViewSetSingleClickActivate(x.GoPointer(), SingleClickActivateVar)
266
267}
268
269var xGridViewSetTabBehavior func(uintptr, ListTabBehavior)
270
271// Sets the behavior of the <kbd>Tab</kbd> and <kbd>Shift</kbd>+<kbd>Tab</kbd> keys.
272func (x *GridView) SetTabBehavior(TabBehaviorVar ListTabBehavior) {
273
274 xGridViewSetTabBehavior(x.GoPointer(), TabBehaviorVar)
275
276}
277
278func (c *GridView) GoPointer() uintptr {
279 if c == nil {
280 return 0
281 }
282 return c.Ptr
283}
284
285func (c *GridView) SetGoPointer(ptr uintptr) {
286 c.Ptr = ptr
287}
288
289// SetPropertyEnableRubberband sets the "enable-rubberband" property.
290// Allow rubberband selection.
291func (x *GridView) SetPropertyEnableRubberband(value bool) {
292 var v gobject.Value
293 v.Init(gobject.TypeBooleanVal)
294 v.SetBoolean(value)
295 x.SetProperty("enable-rubberband", &v)
296}
297
298// GetPropertyEnableRubberband gets the "enable-rubberband" property.
299// Allow rubberband selection.
300func (x *GridView) GetPropertyEnableRubberband() bool {
301 var v gobject.Value
302 x.GetProperty("enable-rubberband", &v)
303 return v.GetBoolean()
304}
305
306// SetPropertyMaxColumns sets the "max-columns" property.
307// Maximum number of columns per row.
308//
309// If this number is smaller than [property@Gtk.GridView:min-columns],
310// that value is used instead.
311func (x *GridView) SetPropertyMaxColumns(value uint) {
312 var v gobject.Value
313 v.Init(gobject.TypeUintVal)
314 v.SetUint(value)
315 x.SetProperty("max-columns", &v)
316}
317
318// GetPropertyMaxColumns gets the "max-columns" property.
319// Maximum number of columns per row.
320//
321// If this number is smaller than [property@Gtk.GridView:min-columns],
322// that value is used instead.
323func (x *GridView) GetPropertyMaxColumns() uint {
324 var v gobject.Value
325 x.GetProperty("max-columns", &v)
326 return v.GetUint()
327}
328
329// SetPropertyMinColumns sets the "min-columns" property.
330// Minimum number of columns per row.
331func (x *GridView) SetPropertyMinColumns(value uint) {
332 var v gobject.Value
333 v.Init(gobject.TypeUintVal)
334 v.SetUint(value)
335 x.SetProperty("min-columns", &v)
336}
337
338// GetPropertyMinColumns gets the "min-columns" property.
339// Minimum number of columns per row.
340func (x *GridView) GetPropertyMinColumns() uint {
341 var v gobject.Value
342 x.GetProperty("min-columns", &v)
343 return v.GetUint()
344}
345
346// SetPropertySingleClickActivate sets the "single-click-activate" property.
347// Activate rows on single click and select them on hover.
348func (x *GridView) SetPropertySingleClickActivate(value bool) {
349 var v gobject.Value
350 v.Init(gobject.TypeBooleanVal)
351 v.SetBoolean(value)
352 x.SetProperty("single-click-activate", &v)
353}
354
355// GetPropertySingleClickActivate gets the "single-click-activate" property.
356// Activate rows on single click and select them on hover.
357func (x *GridView) GetPropertySingleClickActivate() bool {
358 var v gobject.Value
359 x.GetProperty("single-click-activate", &v)
360 return v.GetBoolean()
361}
362
363// Emitted when a cell has been activated by the user,
364// usually via activating the GtkGridView|list.activate-item action.
365//
366// This allows for a convenient way to handle activation in a gridview.
367// See [property@Gtk.ListItem:activatable] for details on how to use
368// this signal.
369func (x *GridView) ConnectActivate(cb *func(GridView, uint)) uint {
370 cbPtr := uintptr(unsafe.Pointer(cb))
371 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
372 handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
373 glib.SaveHandlerMapping(handlerID, cbPtr)
374 return handlerID
375 }
376
377 fcb := func(clsPtr uintptr, PositionVarp uint) {
378 fa := GridView{}
379 fa.Ptr = clsPtr
380 cbFn := *cb
381
382 cbFn(fa, PositionVarp)
383
384 }
385 cbRefPtr := purego.NewCallback(fcb)
386 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
387 handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
388 glib.SaveHandlerMapping(handlerID, cbPtr)
389 return handlerID
390}
391
392// Requests the user's screen reader to announce the given message.
393//
394// This kind of notification is useful for messages that
395// either have only a visual representation or that are not
396// exposed visually at all, e.g. a notification about a
397// successful operation.
398//
399// Also, by using this API, you can ensure that the message
400// does not interrupts the user's current screen reader output.
401func (x *GridView) Announce(MessageVar string, PriorityVar AccessibleAnnouncementPriority) {
402
403 XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar)
404
405}
406
407// Retrieves the accessible parent for an accessible object.
408//
409// This function returns `NULL` for top level widgets.
410func (x *GridView) GetAccessibleParent() *AccessibleBase {
411 var cls *AccessibleBase
412
413 cret := XGtkAccessibleGetAccessibleParent(x.GoPointer())
414
415 if cret == 0 {
416 return nil
417 }
418 cls = &AccessibleBase{}
419 cls.Ptr = cret
420 return cls
421}
422
423// Retrieves the accessible role of an accessible object.
424func (x *GridView) GetAccessibleRole() AccessibleRole {
425
426 cret := XGtkAccessibleGetAccessibleRole(x.GoPointer())
427 return cret
428}
429
430// Retrieves the implementation for the given accessible object.
431func (x *GridView) GetAtContext() *ATContext {
432 var cls *ATContext
433
434 cret := XGtkAccessibleGetAtContext(x.GoPointer())
435
436 if cret == 0 {
437 return nil
438 }
439 cls = &ATContext{}
440 cls.Ptr = cret
441 return cls
442}
443
444// Queries the coordinates and dimensions of this accessible
445//
446// This functionality can be overridden by `GtkAccessible`
447// implementations, e.g. to get the bounds from an ignored
448// child widget.
449func (x *GridView) GetBounds(XVar *int, YVar *int, WidthVar *int, HeightVar *int) bool {
450
451 cret := XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar)
452 return cret
453}
454
455// Retrieves the first accessible child of an accessible object.
456func (x *GridView) GetFirstAccessibleChild() *AccessibleBase {
457 var cls *AccessibleBase
458
459 cret := XGtkAccessibleGetFirstAccessibleChild(x.GoPointer())
460
461 if cret == 0 {
462 return nil
463 }
464 cls = &AccessibleBase{}
465 cls.Ptr = cret
466 return cls
467}
468
469// Retrieves the next accessible sibling of an accessible object
470func (x *GridView) GetNextAccessibleSibling() *AccessibleBase {
471 var cls *AccessibleBase
472
473 cret := XGtkAccessibleGetNextAccessibleSibling(x.GoPointer())
474
475 if cret == 0 {
476 return nil
477 }
478 cls = &AccessibleBase{}
479 cls.Ptr = cret
480 return cls
481}
482
483// Queries a platform state, such as focus.
484//
485// This functionality can be overridden by `GtkAccessible`
486// implementations, e.g. to get platform state from an ignored
487// child widget, as is the case for `GtkText` wrappers.
488func (x *GridView) GetPlatformState(StateVar AccessiblePlatformState) bool {
489
490 cret := XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar)
491 return cret
492}
493
494// Resets the accessible property to its default value.
495func (x *GridView) ResetProperty(PropertyVar AccessibleProperty) {
496
497 XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar)
498
499}
500
501// Resets the accessible relation to its default value.
502func (x *GridView) ResetRelation(RelationVar AccessibleRelation) {
503
504 XGtkAccessibleResetRelation(x.GoPointer(), RelationVar)
505
506}
507
508// Resets the accessible state to its default value.
509func (x *GridView) ResetState(StateVar AccessibleState) {
510
511 XGtkAccessibleResetState(x.GoPointer(), StateVar)
512
513}
514
515// Sets the parent and sibling of an accessible object.
516//
517// This function is meant to be used by accessible implementations that are
518// not part of the widget hierarchy, and but act as a logical bridge between
519// widgets. For instance, if a widget creates an object that holds metadata
520// for each child, and you want that object to implement the `GtkAccessible`
521// interface, you will use this function to ensure that the parent of each
522// child widget is the metadata object, and the parent of each metadata
523// object is the container widget.
524func (x *GridView) SetAccessibleParent(ParentVar Accessible, NextSiblingVar Accessible) {
525
526 XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer())
527
528}
529
530// Updates the next accessible sibling.
531//
532// That might be useful when a new child of a custom accessible
533// is created, and it needs to be linked to a previous child.
534func (x *GridView) UpdateNextAccessibleSibling(NewSiblingVar Accessible) {
535
536 XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer())
537
538}
539
540// Informs ATs that the platform state has changed.
541//
542// This function should be used by `GtkAccessible` implementations that
543// have a platform state but are not widgets. Widgets handle platform
544// states automatically.
545func (x *GridView) UpdatePlatformState(StateVar AccessiblePlatformState) {
546
547 XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar)
548
549}
550
551// Updates a list of accessible properties.
552//
553// See the [enum@Gtk.AccessibleProperty] documentation for the
554// value types of accessible properties.
555//
556// This function should be called by `GtkWidget` types whenever
557// an accessible property change must be communicated to assistive
558// technologies.
559//
560// Example:
561// ```c
562// value = gtk_adjustment_get_value (adjustment);
563// gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button),
564//
565// GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value,
566// -1);
567//
568// ```
569func (x *GridView) UpdateProperty(FirstPropertyVar AccessibleProperty, varArgs ...interface{}) {
570
571 XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...)
572
573}
574
575// Updates an array of accessible properties.
576//
577// This function should be called by `GtkWidget` types whenever an accessible
578// property change must be communicated to assistive technologies.
579//
580// This function is meant to be used by language bindings.
581func (x *GridView) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []AccessibleProperty, ValuesVar []gobject.Value) {
582
583 XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar)
584
585}
586
587// Updates a list of accessible relations.
588//
589// This function should be called by `GtkWidget` types whenever an accessible
590// relation change must be communicated to assistive technologies.
591//
592// If the [enum@Gtk.AccessibleRelation] requires a list of references,
593// you should pass each reference individually, followed by `NULL`, e.g.
594//
595// ```c
596// gtk_accessible_update_relation (accessible,
597//
598// GTK_ACCESSIBLE_RELATION_CONTROLS,
599// ref1, NULL,
600// GTK_ACCESSIBLE_RELATION_LABELLED_BY,
601// ref1, ref2, ref3, NULL,
602// -1);
603//
604// ```
605func (x *GridView) UpdateRelation(FirstRelationVar AccessibleRelation, varArgs ...interface{}) {
606
607 XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...)
608
609}
610
611// Updates an array of accessible relations.
612//
613// This function should be called by `GtkWidget` types whenever an accessible
614// relation change must be communicated to assistive technologies.
615//
616// This function is meant to be used by language bindings.
617func (x *GridView) UpdateRelationValue(NRelationsVar int, RelationsVar []AccessibleRelation, ValuesVar []gobject.Value) {
618
619 XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar)
620
621}
622
623// Updates a list of accessible states.
624//
625// See the [enum@Gtk.AccessibleState] documentation for the
626// value types of accessible states.
627//
628// This function should be called by `GtkWidget` types whenever
629// an accessible state change must be communicated to assistive
630// technologies.
631//
632// Example:
633//
634// ```c
635// value = GTK_ACCESSIBLE_TRISTATE_MIXED;
636// gtk_accessible_update_state (GTK_ACCESSIBLE (check_button),
637//
638// GTK_ACCESSIBLE_STATE_CHECKED, value,
639// -1);
640//
641// ```
642func (x *GridView) UpdateState(FirstStateVar AccessibleState, varArgs ...interface{}) {
643
644 XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...)
645
646}
647
648// Updates an array of accessible states.
649//
650// This function should be called by `GtkWidget` types whenever an accessible
651// state change must be communicated to assistive technologies.
652//
653// This function is meant to be used by language bindings.
654func (x *GridView) UpdateStateValue(NStatesVar int, StatesVar []AccessibleState, ValuesVar []gobject.Value) {
655
656 XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar)
657
658}
659
660// Gets the ID of the @buildable object.
661//
662// `GtkBuilder` sets the name based on the ID attribute
663// of the `<object>` tag used to construct the @buildable.
664func (x *GridView) GetBuildableId() string {
665
666 cret := XGtkBuildableGetBuildableId(x.GoPointer())
667 return cret
668}
669
670// Retrieves the orientation of the @orientable.
671func (x *GridView) GetOrientation() Orientation {
672
673 cret := XGtkOrientableGetOrientation(x.GoPointer())
674 return cret
675}
676
677// Sets the orientation of the @orientable.
678func (x *GridView) SetOrientation(OrientationVar Orientation) {
679
680 XGtkOrientableSetOrientation(x.GoPointer(), OrientationVar)
681
682}
683
684// Returns the size of a non-scrolling border around the
685// outside of the scrollable.
686//
687// An example for this would be treeview headers. GTK can use
688// this information to display overlaid graphics, like the
689// overshoot indication, at the right position.
690func (x *GridView) GetBorder(BorderVar *Border) bool {
691
692 cret := XGtkScrollableGetBorder(x.GoPointer(), BorderVar)
693 return cret
694}
695
696// Retrieves the `GtkAdjustment` used for horizontal scrolling.
697func (x *GridView) GetHadjustment() *Adjustment {
698 var cls *Adjustment
699
700 cret := XGtkScrollableGetHadjustment(x.GoPointer())
701
702 if cret == 0 {
703 return nil
704 }
705 gobject.IncreaseRef(cret)
706 cls = &Adjustment{}
707 cls.Ptr = cret
708 return cls
709}
710
711// Gets the horizontal `GtkScrollablePolicy`.
712func (x *GridView) GetHscrollPolicy() ScrollablePolicy {
713
714 cret := XGtkScrollableGetHscrollPolicy(x.GoPointer())
715 return cret
716}
717
718// Retrieves the `GtkAdjustment` used for vertical scrolling.
719func (x *GridView) GetVadjustment() *Adjustment {
720 var cls *Adjustment
721
722 cret := XGtkScrollableGetVadjustment(x.GoPointer())
723
724 if cret == 0 {
725 return nil
726 }
727 gobject.IncreaseRef(cret)
728 cls = &Adjustment{}
729 cls.Ptr = cret
730 return cls
731}
732
733// Gets the vertical `GtkScrollablePolicy`.
734func (x *GridView) GetVscrollPolicy() ScrollablePolicy {
735
736 cret := XGtkScrollableGetVscrollPolicy(x.GoPointer())
737 return cret
738}
739
740// Sets the horizontal adjustment of the `GtkScrollable`.
741func (x *GridView) SetHadjustment(HadjustmentVar *Adjustment) {
742
743 XGtkScrollableSetHadjustment(x.GoPointer(), HadjustmentVar.GoPointer())
744
745}
746
747// Sets the `GtkScrollablePolicy`.
748//
749// The policy determines whether horizontal scrolling should start
750// below the minimum width or below the natural width.
751func (x *GridView) SetHscrollPolicy(PolicyVar ScrollablePolicy) {
752
753 XGtkScrollableSetHscrollPolicy(x.GoPointer(), PolicyVar)
754
755}
756
757// Sets the vertical adjustment of the `GtkScrollable`.
758func (x *GridView) SetVadjustment(VadjustmentVar *Adjustment) {
759
760 XGtkScrollableSetVadjustment(x.GoPointer(), VadjustmentVar.GoPointer())
761
762}
763
764// Sets the `GtkScrollablePolicy`.
765//
766// The policy determines whether vertical scrolling should start
767// below the minimum height or below the natural height.
768func (x *GridView) SetVscrollPolicy(PolicyVar ScrollablePolicy) {
769
770 XGtkScrollableSetVscrollPolicy(x.GoPointer(), PolicyVar)
771
772}
773
774func init() {
775 core.SetPackageName("GTK", "gtk4")
776 core.SetSharedLibraries("GTK", []string{"libgtk-4.so.1"})
777 var libs []uintptr
778 for _, libPath := range core.GetPaths("GTK") {
779 lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
780 if err != nil {
781 panic(err)
782 }
783 libs = append(libs, lib)
784 }
785
786 core.PuregoSafeRegister(&xGridViewGLibType, libs, "gtk_grid_view_get_type")
787
788 core.PuregoSafeRegister(&xNewGridView, libs, "gtk_grid_view_new")
789
790 core.PuregoSafeRegister(&xGridViewGetEnableRubberband, libs, "gtk_grid_view_get_enable_rubberband")
791 core.PuregoSafeRegister(&xGridViewGetFactory, libs, "gtk_grid_view_get_factory")
792 core.PuregoSafeRegister(&xGridViewGetMaxColumns, libs, "gtk_grid_view_get_max_columns")
793 core.PuregoSafeRegister(&xGridViewGetMinColumns, libs, "gtk_grid_view_get_min_columns")
794 core.PuregoSafeRegister(&xGridViewGetModel, libs, "gtk_grid_view_get_model")
795 core.PuregoSafeRegister(&xGridViewGetSingleClickActivate, libs, "gtk_grid_view_get_single_click_activate")
796 core.PuregoSafeRegister(&xGridViewGetTabBehavior, libs, "gtk_grid_view_get_tab_behavior")
797 core.PuregoSafeRegister(&xGridViewScrollTo, libs, "gtk_grid_view_scroll_to")
798 core.PuregoSafeRegister(&xGridViewSetEnableRubberband, libs, "gtk_grid_view_set_enable_rubberband")
799 core.PuregoSafeRegister(&xGridViewSetFactory, libs, "gtk_grid_view_set_factory")
800 core.PuregoSafeRegister(&xGridViewSetMaxColumns, libs, "gtk_grid_view_set_max_columns")
801 core.PuregoSafeRegister(&xGridViewSetMinColumns, libs, "gtk_grid_view_set_min_columns")
802 core.PuregoSafeRegister(&xGridViewSetModel, libs, "gtk_grid_view_set_model")
803 core.PuregoSafeRegister(&xGridViewSetSingleClickActivate, libs, "gtk_grid_view_set_single_click_activate")
804 core.PuregoSafeRegister(&xGridViewSetTabBehavior, libs, "gtk_grid_view_set_tab_behavior")
805
806}