1// Package gtk was automatically generated by github.com/bnema/puregotk DO NOT EDIT
2package gtk
3
4import (
5 "fmt"
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// The `GtkAppChooserButton` lets the user select an application.
18//
19// <picture>
20//
21// <source srcset="appchooserbutton-dark.png" media="(prefers-color-scheme: dark)">
22// <img alt="An example GtkAppChooserButton" src="appchooserbutton.png">
23//
24// </picture>
25//
26// Initially, a `GtkAppChooserButton` selects the first application
27// in its list, which will either be the most-recently used application
28// or, if [property@Gtk.AppChooserButton:show-default-item] is %TRUE, the
29// default application.
30//
31// The list of applications shown in a `GtkAppChooserButton` includes
32// the recommended applications for the given content type. When
33// [property@Gtk.AppChooserButton:show-default-item] is set, the default
34// application is also included. To let the user chooser other applications,
35// you can set the [property@Gtk.AppChooserButton:show-dialog-item] property,
36// which allows to open a full [class@Gtk.AppChooserDialog].
37//
38// It is possible to add custom items to the list, using
39// [method@Gtk.AppChooserButton.append_custom_item]. These items cause
40// the [signal@Gtk.AppChooserButton::custom-item-activated] signal to be
41// emitted when they are selected.
42//
43// To track changes in the selected application, use the
44// [signal@Gtk.AppChooserButton::changed] signal.
45//
46// ## CSS nodes
47//
48// `GtkAppChooserButton` has a single CSS node with the name “appchooserbutton”.
49type AppChooserButton struct {
50 Widget
51}
52
53var xAppChooserButtonGLibType func() types.GType
54
55func AppChooserButtonGLibType() types.GType {
56 return xAppChooserButtonGLibType()
57}
58
59func AppChooserButtonNewFromInternalPtr(ptr uintptr) *AppChooserButton {
60 cls := &AppChooserButton{}
61 cls.Ptr = ptr
62 return cls
63}
64
65var xNewAppChooserButton func(string) uintptr
66
67// Creates a new `GtkAppChooserButton` for applications
68// that can handle content of the given type.
69func NewAppChooserButton(ContentTypeVar string) *AppChooserButton {
70 var cls *AppChooserButton
71
72 cret := xNewAppChooserButton(ContentTypeVar)
73
74 if cret == 0 {
75 return nil
76 }
77 gobject.IncreaseRef(cret)
78 cls = &AppChooserButton{}
79 cls.Ptr = cret
80 return cls
81}
82
83var xAppChooserButtonAppendCustomItem func(uintptr, string, string, uintptr)
84
85// Appends a custom item to the list of applications that is shown
86// in the popup.
87//
88// The item name must be unique per-widget. Clients can use the
89// provided name as a detail for the
90// [signal@Gtk.AppChooserButton::custom-item-activated] signal, to add a
91// callback for the activation of a particular custom item in the list.
92//
93// See also [method@Gtk.AppChooserButton.append_separator].
94func (x *AppChooserButton) AppendCustomItem(NameVar string, LabelVar string, IconVar gio.Icon) {
95
96 xAppChooserButtonAppendCustomItem(x.GoPointer(), NameVar, LabelVar, IconVar.GoPointer())
97
98}
99
100var xAppChooserButtonAppendSeparator func(uintptr)
101
102// Appends a separator to the list of applications that is shown
103// in the popup.
104func (x *AppChooserButton) AppendSeparator() {
105
106 xAppChooserButtonAppendSeparator(x.GoPointer())
107
108}
109
110var xAppChooserButtonGetHeading func(uintptr) string
111
112// Returns the text to display at the top of the dialog.
113func (x *AppChooserButton) GetHeading() string {
114
115 cret := xAppChooserButtonGetHeading(x.GoPointer())
116 return cret
117}
118
119var xAppChooserButtonGetModal func(uintptr) bool
120
121// Gets whether the dialog is modal.
122func (x *AppChooserButton) GetModal() bool {
123
124 cret := xAppChooserButtonGetModal(x.GoPointer())
125 return cret
126}
127
128var xAppChooserButtonGetShowDefaultItem func(uintptr) bool
129
130// Returns whether the dropdown menu should show the default
131// application at the top.
132func (x *AppChooserButton) GetShowDefaultItem() bool {
133
134 cret := xAppChooserButtonGetShowDefaultItem(x.GoPointer())
135 return cret
136}
137
138var xAppChooserButtonGetShowDialogItem func(uintptr) bool
139
140// Returns whether the dropdown menu shows an item
141// for a `GtkAppChooserDialog`.
142func (x *AppChooserButton) GetShowDialogItem() bool {
143
144 cret := xAppChooserButtonGetShowDialogItem(x.GoPointer())
145 return cret
146}
147
148var xAppChooserButtonSetActiveCustomItem func(uintptr, string)
149
150// Selects a custom item.
151//
152// See [method@Gtk.AppChooserButton.append_custom_item].
153//
154// Use [method@Gtk.AppChooser.refresh] to bring the selection
155// to its initial state.
156func (x *AppChooserButton) SetActiveCustomItem(NameVar string) {
157
158 xAppChooserButtonSetActiveCustomItem(x.GoPointer(), NameVar)
159
160}
161
162var xAppChooserButtonSetHeading func(uintptr, string)
163
164// Sets the text to display at the top of the dialog.
165//
166// If the heading is not set, the dialog displays a default text.
167func (x *AppChooserButton) SetHeading(HeadingVar string) {
168
169 xAppChooserButtonSetHeading(x.GoPointer(), HeadingVar)
170
171}
172
173var xAppChooserButtonSetModal func(uintptr, bool)
174
175// Sets whether the dialog should be modal.
176func (x *AppChooserButton) SetModal(ModalVar bool) {
177
178 xAppChooserButtonSetModal(x.GoPointer(), ModalVar)
179
180}
181
182var xAppChooserButtonSetShowDefaultItem func(uintptr, bool)
183
184// Sets whether the dropdown menu of this button should show the
185// default application for the given content type at top.
186func (x *AppChooserButton) SetShowDefaultItem(SettingVar bool) {
187
188 xAppChooserButtonSetShowDefaultItem(x.GoPointer(), SettingVar)
189
190}
191
192var xAppChooserButtonSetShowDialogItem func(uintptr, bool)
193
194// Sets whether the dropdown menu of this button should show an
195// entry to trigger a `GtkAppChooserDialog`.
196func (x *AppChooserButton) SetShowDialogItem(SettingVar bool) {
197
198 xAppChooserButtonSetShowDialogItem(x.GoPointer(), SettingVar)
199
200}
201
202func (c *AppChooserButton) GoPointer() uintptr {
203 if c == nil {
204 return 0
205 }
206 return c.Ptr
207}
208
209func (c *AppChooserButton) SetGoPointer(ptr uintptr) {
210 c.Ptr = ptr
211}
212
213// SetPropertyHeading sets the "heading" property.
214// The text to show at the top of the dialog that can be
215// opened from the button.
216//
217// The string may contain Pango markup.
218func (x *AppChooserButton) SetPropertyHeading(value string) {
219 var v gobject.Value
220 v.Init(gobject.TypeStringVal)
221 v.SetString(&value)
222 x.SetProperty("heading", &v)
223}
224
225// GetPropertyHeading gets the "heading" property.
226// The text to show at the top of the dialog that can be
227// opened from the button.
228//
229// The string may contain Pango markup.
230func (x *AppChooserButton) GetPropertyHeading() string {
231 var v gobject.Value
232 x.GetProperty("heading", &v)
233 return v.GetString()
234}
235
236// SetPropertyModal sets the "modal" property.
237// Whether the app chooser dialog should be modal.
238func (x *AppChooserButton) SetPropertyModal(value bool) {
239 var v gobject.Value
240 v.Init(gobject.TypeBooleanVal)
241 v.SetBoolean(value)
242 x.SetProperty("modal", &v)
243}
244
245// GetPropertyModal gets the "modal" property.
246// Whether the app chooser dialog should be modal.
247func (x *AppChooserButton) GetPropertyModal() bool {
248 var v gobject.Value
249 x.GetProperty("modal", &v)
250 return v.GetBoolean()
251}
252
253// SetPropertyShowDefaultItem sets the "show-default-item" property.
254// Determines whether the dropdown menu shows the default application
255// on top for the provided content type.
256func (x *AppChooserButton) SetPropertyShowDefaultItem(value bool) {
257 var v gobject.Value
258 v.Init(gobject.TypeBooleanVal)
259 v.SetBoolean(value)
260 x.SetProperty("show-default-item", &v)
261}
262
263// GetPropertyShowDefaultItem gets the "show-default-item" property.
264// Determines whether the dropdown menu shows the default application
265// on top for the provided content type.
266func (x *AppChooserButton) GetPropertyShowDefaultItem() bool {
267 var v gobject.Value
268 x.GetProperty("show-default-item", &v)
269 return v.GetBoolean()
270}
271
272// SetPropertyShowDialogItem sets the "show-dialog-item" property.
273// Determines whether the dropdown menu shows an item to open
274// a `GtkAppChooserDialog`.
275func (x *AppChooserButton) SetPropertyShowDialogItem(value bool) {
276 var v gobject.Value
277 v.Init(gobject.TypeBooleanVal)
278 v.SetBoolean(value)
279 x.SetProperty("show-dialog-item", &v)
280}
281
282// GetPropertyShowDialogItem gets the "show-dialog-item" property.
283// Determines whether the dropdown menu shows an item to open
284// a `GtkAppChooserDialog`.
285func (x *AppChooserButton) GetPropertyShowDialogItem() bool {
286 var v gobject.Value
287 x.GetProperty("show-dialog-item", &v)
288 return v.GetBoolean()
289}
290
291// Emitted to when the button is activated.
292//
293// The `::activate` signal on `GtkAppChooserButton` is an action signal and
294// emitting it causes the button to pop up its dialog.
295func (x *AppChooserButton) ConnectActivate(cb *func(AppChooserButton)) uint {
296 cbPtr := uintptr(unsafe.Pointer(cb))
297 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
298 handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
299 glib.SaveHandlerMapping(handlerID, cbPtr)
300 return handlerID
301 }
302
303 fcb := func(clsPtr uintptr) {
304 fa := AppChooserButton{}
305 fa.Ptr = clsPtr
306 cbFn := *cb
307
308 cbFn(fa)
309
310 }
311 cbRefPtr := purego.NewCallback(fcb)
312 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
313 handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
314 glib.SaveHandlerMapping(handlerID, cbPtr)
315 return handlerID
316}
317
318// Emitted when the active application changes.
319func (x *AppChooserButton) ConnectChanged(cb *func(AppChooserButton)) uint {
320 cbPtr := uintptr(unsafe.Pointer(cb))
321 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
322 handlerID := gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)
323 glib.SaveHandlerMapping(handlerID, cbPtr)
324 return handlerID
325 }
326
327 fcb := func(clsPtr uintptr) {
328 fa := AppChooserButton{}
329 fa.Ptr = clsPtr
330 cbFn := *cb
331
332 cbFn(fa)
333
334 }
335 cbRefPtr := purego.NewCallback(fcb)
336 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
337 handlerID := gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)
338 glib.SaveHandlerMapping(handlerID, cbPtr)
339 return handlerID
340}
341
342// Emitted when a custom item is activated.
343//
344// Use [method@Gtk.AppChooserButton.append_custom_item],
345// to add custom items.
346func (x *AppChooserButton) ConnectCustomItemActivated(cb *func(AppChooserButton, string)) uint {
347 cbPtr := uintptr(unsafe.Pointer(cb))
348 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
349 handlerID := gobject.SignalConnect(x.GoPointer(), "custom-item-activated", cbRefPtr)
350 glib.SaveHandlerMapping(handlerID, cbPtr)
351 return handlerID
352 }
353
354 fcb := func(clsPtr uintptr, ItemNameVarp uintptr) {
355 fa := AppChooserButton{}
356 fa.Ptr = clsPtr
357 cbFn := *cb
358
359 cbFn(fa, core.GoString(ItemNameVarp))
360
361 }
362 cbRefPtr := purego.NewCallback(fcb)
363 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
364 handlerID := gobject.SignalConnect(x.GoPointer(), "custom-item-activated", cbRefPtr)
365 glib.SaveHandlerMapping(handlerID, cbPtr)
366 return handlerID
367}
368
369// ConnectCustomItemActivatedWithDetail connects to the "custom-item-activated" signal with a detail string.
370// The detail is appended as "custom-item-activated::<detail>".
371func (x *AppChooserButton) ConnectCustomItemActivatedWithDetail(detail string, cb *func(AppChooserButton, string)) uint {
372 cbPtr := uintptr(unsafe.Pointer(cb))
373 signalName := fmt.Sprintf("custom-item-activated::%s", detail)
374 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
375 handlerID := gobject.SignalConnect(x.GoPointer(), signalName, cbRefPtr)
376 glib.SaveHandlerMapping(handlerID, cbPtr)
377 return handlerID
378 }
379
380 fcb := func(clsPtr uintptr, ItemNameVarp uintptr) {
381 fa := AppChooserButton{}
382 fa.Ptr = clsPtr
383 cbFn := *cb
384
385 cbFn(fa, core.GoString(ItemNameVarp))
386
387 }
388 cbRefPtr := purego.NewCallback(fcb)
389 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
390 handlerID := gobject.SignalConnect(x.GoPointer(), signalName, cbRefPtr)
391 glib.SaveHandlerMapping(handlerID, cbPtr)
392 return handlerID
393}
394
395// Requests the user's screen reader to announce the given message.
396//
397// This kind of notification is useful for messages that
398// either have only a visual representation or that are not
399// exposed visually at all, e.g. a notification about a
400// successful operation.
401//
402// Also, by using this API, you can ensure that the message
403// does not interrupts the user's current screen reader output.
404func (x *AppChooserButton) Announce(MessageVar string, PriorityVar AccessibleAnnouncementPriority) {
405
406 XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar)
407
408}
409
410// Retrieves the accessible parent for an accessible object.
411//
412// This function returns `NULL` for top level widgets.
413func (x *AppChooserButton) GetAccessibleParent() *AccessibleBase {
414 var cls *AccessibleBase
415
416 cret := XGtkAccessibleGetAccessibleParent(x.GoPointer())
417
418 if cret == 0 {
419 return nil
420 }
421 cls = &AccessibleBase{}
422 cls.Ptr = cret
423 return cls
424}
425
426// Retrieves the accessible role of an accessible object.
427func (x *AppChooserButton) GetAccessibleRole() AccessibleRole {
428
429 cret := XGtkAccessibleGetAccessibleRole(x.GoPointer())
430 return cret
431}
432
433// Retrieves the implementation for the given accessible object.
434func (x *AppChooserButton) GetAtContext() *ATContext {
435 var cls *ATContext
436
437 cret := XGtkAccessibleGetAtContext(x.GoPointer())
438
439 if cret == 0 {
440 return nil
441 }
442 cls = &ATContext{}
443 cls.Ptr = cret
444 return cls
445}
446
447// Queries the coordinates and dimensions of this accessible
448//
449// This functionality can be overridden by `GtkAccessible`
450// implementations, e.g. to get the bounds from an ignored
451// child widget.
452func (x *AppChooserButton) GetBounds(XVar *int, YVar *int, WidthVar *int, HeightVar *int) bool {
453
454 cret := XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar)
455 return cret
456}
457
458// Retrieves the first accessible child of an accessible object.
459func (x *AppChooserButton) GetFirstAccessibleChild() *AccessibleBase {
460 var cls *AccessibleBase
461
462 cret := XGtkAccessibleGetFirstAccessibleChild(x.GoPointer())
463
464 if cret == 0 {
465 return nil
466 }
467 cls = &AccessibleBase{}
468 cls.Ptr = cret
469 return cls
470}
471
472// Retrieves the next accessible sibling of an accessible object
473func (x *AppChooserButton) GetNextAccessibleSibling() *AccessibleBase {
474 var cls *AccessibleBase
475
476 cret := XGtkAccessibleGetNextAccessibleSibling(x.GoPointer())
477
478 if cret == 0 {
479 return nil
480 }
481 cls = &AccessibleBase{}
482 cls.Ptr = cret
483 return cls
484}
485
486// Queries a platform state, such as focus.
487//
488// This functionality can be overridden by `GtkAccessible`
489// implementations, e.g. to get platform state from an ignored
490// child widget, as is the case for `GtkText` wrappers.
491func (x *AppChooserButton) GetPlatformState(StateVar AccessiblePlatformState) bool {
492
493 cret := XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar)
494 return cret
495}
496
497// Resets the accessible property to its default value.
498func (x *AppChooserButton) ResetProperty(PropertyVar AccessibleProperty) {
499
500 XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar)
501
502}
503
504// Resets the accessible relation to its default value.
505func (x *AppChooserButton) ResetRelation(RelationVar AccessibleRelation) {
506
507 XGtkAccessibleResetRelation(x.GoPointer(), RelationVar)
508
509}
510
511// Resets the accessible state to its default value.
512func (x *AppChooserButton) ResetState(StateVar AccessibleState) {
513
514 XGtkAccessibleResetState(x.GoPointer(), StateVar)
515
516}
517
518// Sets the parent and sibling of an accessible object.
519//
520// This function is meant to be used by accessible implementations that are
521// not part of the widget hierarchy, and but act as a logical bridge between
522// widgets. For instance, if a widget creates an object that holds metadata
523// for each child, and you want that object to implement the `GtkAccessible`
524// interface, you will use this function to ensure that the parent of each
525// child widget is the metadata object, and the parent of each metadata
526// object is the container widget.
527func (x *AppChooserButton) SetAccessibleParent(ParentVar Accessible, NextSiblingVar Accessible) {
528
529 XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer())
530
531}
532
533// Updates the next accessible sibling.
534//
535// That might be useful when a new child of a custom accessible
536// is created, and it needs to be linked to a previous child.
537func (x *AppChooserButton) UpdateNextAccessibleSibling(NewSiblingVar Accessible) {
538
539 XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer())
540
541}
542
543// Informs ATs that the platform state has changed.
544//
545// This function should be used by `GtkAccessible` implementations that
546// have a platform state but are not widgets. Widgets handle platform
547// states automatically.
548func (x *AppChooserButton) UpdatePlatformState(StateVar AccessiblePlatformState) {
549
550 XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar)
551
552}
553
554// Updates a list of accessible properties.
555//
556// See the [enum@Gtk.AccessibleProperty] documentation for the
557// value types of accessible properties.
558//
559// This function should be called by `GtkWidget` types whenever
560// an accessible property change must be communicated to assistive
561// technologies.
562//
563// Example:
564// ```c
565// value = gtk_adjustment_get_value (adjustment);
566// gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button),
567//
568// GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value,
569// -1);
570//
571// ```
572func (x *AppChooserButton) UpdateProperty(FirstPropertyVar AccessibleProperty, varArgs ...interface{}) {
573
574 XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...)
575
576}
577
578// Updates an array of accessible properties.
579//
580// This function should be called by `GtkWidget` types whenever an accessible
581// property change must be communicated to assistive technologies.
582//
583// This function is meant to be used by language bindings.
584func (x *AppChooserButton) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []AccessibleProperty, ValuesVar []gobject.Value) {
585
586 XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar)
587
588}
589
590// Updates a list of accessible relations.
591//
592// This function should be called by `GtkWidget` types whenever an accessible
593// relation change must be communicated to assistive technologies.
594//
595// If the [enum@Gtk.AccessibleRelation] requires a list of references,
596// you should pass each reference individually, followed by `NULL`, e.g.
597//
598// ```c
599// gtk_accessible_update_relation (accessible,
600//
601// GTK_ACCESSIBLE_RELATION_CONTROLS,
602// ref1, NULL,
603// GTK_ACCESSIBLE_RELATION_LABELLED_BY,
604// ref1, ref2, ref3, NULL,
605// -1);
606//
607// ```
608func (x *AppChooserButton) UpdateRelation(FirstRelationVar AccessibleRelation, varArgs ...interface{}) {
609
610 XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...)
611
612}
613
614// Updates an array of accessible relations.
615//
616// This function should be called by `GtkWidget` types whenever an accessible
617// relation change must be communicated to assistive technologies.
618//
619// This function is meant to be used by language bindings.
620func (x *AppChooserButton) UpdateRelationValue(NRelationsVar int, RelationsVar []AccessibleRelation, ValuesVar []gobject.Value) {
621
622 XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar)
623
624}
625
626// Updates a list of accessible states.
627//
628// See the [enum@Gtk.AccessibleState] documentation for the
629// value types of accessible states.
630//
631// This function should be called by `GtkWidget` types whenever
632// an accessible state change must be communicated to assistive
633// technologies.
634//
635// Example:
636//
637// ```c
638// value = GTK_ACCESSIBLE_TRISTATE_MIXED;
639// gtk_accessible_update_state (GTK_ACCESSIBLE (check_button),
640//
641// GTK_ACCESSIBLE_STATE_CHECKED, value,
642// -1);
643//
644// ```
645func (x *AppChooserButton) UpdateState(FirstStateVar AccessibleState, varArgs ...interface{}) {
646
647 XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...)
648
649}
650
651// Updates an array of accessible states.
652//
653// This function should be called by `GtkWidget` types whenever an accessible
654// state change must be communicated to assistive technologies.
655//
656// This function is meant to be used by language bindings.
657func (x *AppChooserButton) UpdateStateValue(NStatesVar int, StatesVar []AccessibleState, ValuesVar []gobject.Value) {
658
659 XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar)
660
661}
662
663// Returns the currently selected application.
664func (x *AppChooserButton) GetAppInfo() *gio.AppInfoBase {
665 var cls *gio.AppInfoBase
666
667 cret := XGtkAppChooserGetAppInfo(x.GoPointer())
668
669 if cret == 0 {
670 return nil
671 }
672 cls = &gio.AppInfoBase{}
673 cls.Ptr = cret
674 return cls
675}
676
677// Returns the content type for which the `GtkAppChooser`
678// shows applications.
679func (x *AppChooserButton) GetContentType() string {
680
681 cret := XGtkAppChooserGetContentType(x.GoPointer())
682 return cret
683}
684
685// Reloads the list of applications.
686func (x *AppChooserButton) Refresh() {
687
688 XGtkAppChooserRefresh(x.GoPointer())
689
690}
691
692// Gets the ID of the @buildable object.
693//
694// `GtkBuilder` sets the name based on the ID attribute
695// of the `<object>` tag used to construct the @buildable.
696func (x *AppChooserButton) GetBuildableId() string {
697
698 cret := XGtkBuildableGetBuildableId(x.GoPointer())
699 return cret
700}
701
702func init() {
703 core.SetPackageName("GTK", "gtk4")
704 core.SetSharedLibraries("GTK", []string{"libgtk-4.so.1"})
705 var libs []uintptr
706 for _, libPath := range core.GetPaths("GTK") {
707 lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
708 if err != nil {
709 panic(err)
710 }
711 libs = append(libs, lib)
712 }
713
714 core.PuregoSafeRegister(&xAppChooserButtonGLibType, libs, "gtk_app_chooser_button_get_type")
715
716 core.PuregoSafeRegister(&xNewAppChooserButton, libs, "gtk_app_chooser_button_new")
717
718 core.PuregoSafeRegister(&xAppChooserButtonAppendCustomItem, libs, "gtk_app_chooser_button_append_custom_item")
719 core.PuregoSafeRegister(&xAppChooserButtonAppendSeparator, libs, "gtk_app_chooser_button_append_separator")
720 core.PuregoSafeRegister(&xAppChooserButtonGetHeading, libs, "gtk_app_chooser_button_get_heading")
721 core.PuregoSafeRegister(&xAppChooserButtonGetModal, libs, "gtk_app_chooser_button_get_modal")
722 core.PuregoSafeRegister(&xAppChooserButtonGetShowDefaultItem, libs, "gtk_app_chooser_button_get_show_default_item")
723 core.PuregoSafeRegister(&xAppChooserButtonGetShowDialogItem, libs, "gtk_app_chooser_button_get_show_dialog_item")
724 core.PuregoSafeRegister(&xAppChooserButtonSetActiveCustomItem, libs, "gtk_app_chooser_button_set_active_custom_item")
725 core.PuregoSafeRegister(&xAppChooserButtonSetHeading, libs, "gtk_app_chooser_button_set_heading")
726 core.PuregoSafeRegister(&xAppChooserButtonSetModal, libs, "gtk_app_chooser_button_set_modal")
727 core.PuregoSafeRegister(&xAppChooserButtonSetShowDefaultItem, libs, "gtk_app_chooser_button_set_show_default_item")
728 core.PuregoSafeRegister(&xAppChooserButtonSetShowDialogItem, libs, "gtk_app_chooser_button_set_show_dialog_item")
729
730}