// Package gtk was automatically generated by github.com/bnema/puregotk DO NOT EDIT package gtk import ( "github.com/ebitengine/purego" "github.com/bnema/puregotk/pkg/core" "github.com/bnema/puregotk/v4/gdk" "github.com/bnema/puregotk/v4/gio" "github.com/bnema/puregotk/v4/gobject" "github.com/bnema/puregotk/v4/gobject/types" "github.com/bnema/puregotk/v4/gsk" ) // `GtkAppChooserDialog` shows a `GtkAppChooserWidget` inside a `GtkDialog`. // // <picture> // // <source srcset="appchooserdialog-dark.png" media="(prefers-color-scheme: dark)"> // <img alt="An example GtkAppChooserDialog" src="appchooserdialog.png"> // // </picture> // // Note that `GtkAppChooserDialog` does not have any interesting methods // of its own. Instead, you should get the embedded `GtkAppChooserWidget` // using [method@Gtk.AppChooserDialog.get_widget] and call its methods if // the generic [iface@Gtk.AppChooser] interface is not sufficient for // your needs. // // To set the heading that is shown above the `GtkAppChooserWidget`, // use [method@Gtk.AppChooserDialog.set_heading]. // // ## CSS nodes // // `GtkAppChooserDialog` has a single CSS node with the name `window` and style // class `.appchooser`. type AppChooserDialog struct { Dialog } var xAppChooserDialogGLibType func() types.GType func AppChooserDialogGLibType() types.GType { return xAppChooserDialogGLibType() } func AppChooserDialogNewFromInternalPtr(ptr uintptr) *AppChooserDialog { cls := &AppChooserDialog{} cls.Ptr = ptr return cls } var xNewAppChooserDialog func(uintptr, DialogFlags, uintptr) uintptr // Creates a new `GtkAppChooserDialog` for the provided `GFile`. // // The dialog will show applications that can open the file. func NewAppChooserDialog(ParentVar *Window, FlagsVar DialogFlags, FileVar gio.File) *AppChooserDialog { var cls *AppChooserDialog cret := xNewAppChooserDialog(ParentVar.GoPointer(), FlagsVar, FileVar.GoPointer()) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &AppChooserDialog{} cls.Ptr = cret return cls } var xNewAppChooserDialogForContentType func(uintptr, DialogFlags, string) uintptr // Creates a new `GtkAppChooserDialog` for the provided content type. // // The dialog will show applications that can open the content type. func NewAppChooserDialogForContentType(ParentVar *Window, FlagsVar DialogFlags, ContentTypeVar string) *AppChooserDialog { var cls *AppChooserDialog cret := xNewAppChooserDialogForContentType(ParentVar.GoPointer(), FlagsVar, ContentTypeVar) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &AppChooserDialog{} cls.Ptr = cret return cls } var xAppChooserDialogGetHeading func(uintptr) string // Returns the text to display at the top of the dialog. func (x *AppChooserDialog) GetHeading() string { cret := xAppChooserDialogGetHeading(x.GoPointer()) return cret } var xAppChooserDialogGetWidget func(uintptr) uintptr // Returns the `GtkAppChooserWidget` of this dialog. func (x *AppChooserDialog) GetWidget() *Widget { var cls *Widget cret := xAppChooserDialogGetWidget(x.GoPointer()) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &Widget{} cls.Ptr = cret return cls } var xAppChooserDialogSetHeading func(uintptr, string) // Sets the text to display at the top of the dialog. // // If the heading is not set, the dialog displays a default text. func (x *AppChooserDialog) SetHeading(HeadingVar string) { xAppChooserDialogSetHeading(x.GoPointer(), HeadingVar) } func (c *AppChooserDialog) GoPointer() uintptr { if c == nil { return 0 } return c.Ptr } func (c *AppChooserDialog) SetGoPointer(ptr uintptr) { c.Ptr = ptr } // SetPropertyHeading sets the "heading" property. // The text to show at the top of the dialog. // // The string may contain Pango markup. func (x *AppChooserDialog) SetPropertyHeading(value string) { var v gobject.Value v.Init(gobject.TypeStringVal) v.SetString(&value) x.SetProperty("heading", &v) } // GetPropertyHeading gets the "heading" property. // The text to show at the top of the dialog. // // The string may contain Pango markup. func (x *AppChooserDialog) GetPropertyHeading() string { var v gobject.Value x.GetProperty("heading", &v) return v.GetString() } // Requests the user's screen reader to announce the given message. // // This kind of notification is useful for messages that // either have only a visual representation or that are not // exposed visually at all, e.g. a notification about a // successful operation. // // Also, by using this API, you can ensure that the message // does not interrupts the user's current screen reader output. func (x *AppChooserDialog) Announce(MessageVar string, PriorityVar AccessibleAnnouncementPriority) { XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) } // Retrieves the accessible parent for an accessible object. // // This function returns `NULL` for top level widgets. func (x *AppChooserDialog) GetAccessibleParent() *AccessibleBase { var cls *AccessibleBase cret := XGtkAccessibleGetAccessibleParent(x.GoPointer()) if cret == 0 { return nil } cls = &AccessibleBase{} cls.Ptr = cret return cls } // Retrieves the accessible role of an accessible object. func (x *AppChooserDialog) GetAccessibleRole() AccessibleRole { cret := XGtkAccessibleGetAccessibleRole(x.GoPointer()) return cret } // Retrieves the implementation for the given accessible object. func (x *AppChooserDialog) GetAtContext() *ATContext { var cls *ATContext cret := XGtkAccessibleGetAtContext(x.GoPointer()) if cret == 0 { return nil } cls = &ATContext{} cls.Ptr = cret return cls } // Queries the coordinates and dimensions of this accessible // // This functionality can be overridden by `GtkAccessible` // implementations, e.g. to get the bounds from an ignored // child widget. func (x *AppChooserDialog) GetBounds(XVar *int, YVar *int, WidthVar *int, HeightVar *int) bool { cret := XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) return cret } // Retrieves the first accessible child of an accessible object. func (x *AppChooserDialog) GetFirstAccessibleChild() *AccessibleBase { var cls *AccessibleBase cret := XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) if cret == 0 { return nil } cls = &AccessibleBase{} cls.Ptr = cret return cls } // Retrieves the next accessible sibling of an accessible object func (x *AppChooserDialog) GetNextAccessibleSibling() *AccessibleBase { var cls *AccessibleBase cret := XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) if cret == 0 { return nil } cls = &AccessibleBase{} cls.Ptr = cret return cls } // Queries a platform state, such as focus. // // This functionality can be overridden by `GtkAccessible` // implementations, e.g. to get platform state from an ignored // child widget, as is the case for `GtkText` wrappers. func (x *AppChooserDialog) GetPlatformState(StateVar AccessiblePlatformState) bool { cret := XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) return cret } // Resets the accessible property to its default value. func (x *AppChooserDialog) ResetProperty(PropertyVar AccessibleProperty) { XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) } // Resets the accessible relation to its default value. func (x *AppChooserDialog) ResetRelation(RelationVar AccessibleRelation) { XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) } // Resets the accessible state to its default value. func (x *AppChooserDialog) ResetState(StateVar AccessibleState) { XGtkAccessibleResetState(x.GoPointer(), StateVar) } // Sets the parent and sibling of an accessible object. // // This function is meant to be used by accessible implementations that are // not part of the widget hierarchy, and but act as a logical bridge between // widgets. For instance, if a widget creates an object that holds metadata // for each child, and you want that object to implement the `GtkAccessible` // interface, you will use this function to ensure that the parent of each // child widget is the metadata object, and the parent of each metadata // object is the container widget. func (x *AppChooserDialog) SetAccessibleParent(ParentVar Accessible, NextSiblingVar Accessible) { XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) } // Updates the next accessible sibling. // // That might be useful when a new child of a custom accessible // is created, and it needs to be linked to a previous child. func (x *AppChooserDialog) UpdateNextAccessibleSibling(NewSiblingVar Accessible) { XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) } // Informs ATs that the platform state has changed. // // This function should be used by `GtkAccessible` implementations that // have a platform state but are not widgets. Widgets handle platform // states automatically. func (x *AppChooserDialog) UpdatePlatformState(StateVar AccessiblePlatformState) { XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) } // Updates a list of accessible properties. // // See the [enum@Gtk.AccessibleProperty] documentation for the // value types of accessible properties. // // This function should be called by `GtkWidget` types whenever // an accessible property change must be communicated to assistive // technologies. // // Example: // ```c // value = gtk_adjustment_get_value (adjustment); // gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button), // // GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value, // -1); // // ``` func (x *AppChooserDialog) UpdateProperty(FirstPropertyVar AccessibleProperty, varArgs ...interface{}) { XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...) } // Updates an array of accessible properties. // // This function should be called by `GtkWidget` types whenever an accessible // property change must be communicated to assistive technologies. // // This function is meant to be used by language bindings. func (x *AppChooserDialog) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []AccessibleProperty, ValuesVar []gobject.Value) { XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar) } // Updates a list of accessible relations. // // This function should be called by `GtkWidget` types whenever an accessible // relation change must be communicated to assistive technologies. // // If the [enum@Gtk.AccessibleRelation] requires a list of references, // you should pass each reference individually, followed by `NULL`, e.g. // // ```c // gtk_accessible_update_relation (accessible, // // GTK_ACCESSIBLE_RELATION_CONTROLS, // ref1, NULL, // GTK_ACCESSIBLE_RELATION_LABELLED_BY, // ref1, ref2, ref3, NULL, // -1); // // ``` func (x *AppChooserDialog) UpdateRelation(FirstRelationVar AccessibleRelation, varArgs ...interface{}) { XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...) } // Updates an array of accessible relations. // // This function should be called by `GtkWidget` types whenever an accessible // relation change must be communicated to assistive technologies. // // This function is meant to be used by language bindings. func (x *AppChooserDialog) UpdateRelationValue(NRelationsVar int, RelationsVar []AccessibleRelation, ValuesVar []gobject.Value) { XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar) } // Updates a list of accessible states. // // See the [enum@Gtk.AccessibleState] documentation for the // value types of accessible states. // // This function should be called by `GtkWidget` types whenever // an accessible state change must be communicated to assistive // technologies. // // Example: // // ```c // value = GTK_ACCESSIBLE_TRISTATE_MIXED; // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), // // GTK_ACCESSIBLE_STATE_CHECKED, value, // -1); // // ``` func (x *AppChooserDialog) UpdateState(FirstStateVar AccessibleState, varArgs ...interface{}) { XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...) } // Updates an array of accessible states. // // This function should be called by `GtkWidget` types whenever an accessible // state change must be communicated to assistive technologies. // // This function is meant to be used by language bindings. func (x *AppChooserDialog) UpdateStateValue(NStatesVar int, StatesVar []AccessibleState, ValuesVar []gobject.Value) { XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar) } // Returns the currently selected application. func (x *AppChooserDialog) GetAppInfo() *gio.AppInfoBase { var cls *gio.AppInfoBase cret := XGtkAppChooserGetAppInfo(x.GoPointer()) if cret == 0 { return nil } cls = &gio.AppInfoBase{} cls.Ptr = cret return cls } // Returns the content type for which the `GtkAppChooser` // shows applications. func (x *AppChooserDialog) GetContentType() string { cret := XGtkAppChooserGetContentType(x.GoPointer()) return cret } // Reloads the list of applications. func (x *AppChooserDialog) Refresh() { XGtkAppChooserRefresh(x.GoPointer()) } // Gets the ID of the @buildable object. // // `GtkBuilder` sets the name based on the ID attribute // of the `<object>` tag used to construct the @buildable. func (x *AppChooserDialog) GetBuildableId() string { cret := XGtkBuildableGetBuildableId(x.GoPointer()) return cret } // Returns the renderer that is used for this `GtkNative`. func (x *AppChooserDialog) GetRenderer() *gsk.Renderer { var cls *gsk.Renderer cret := XGtkNativeGetRenderer(x.GoPointer()) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &gsk.Renderer{} cls.Ptr = cret return cls } // Returns the surface of this `GtkNative`. func (x *AppChooserDialog) GetSurface() *gdk.Surface { var cls *gdk.Surface cret := XGtkNativeGetSurface(x.GoPointer()) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &gdk.Surface{} cls.Ptr = cret return cls } // Retrieves the surface transform of @self. // // This is the translation from @self's surface coordinates into // @self's widget coordinates. func (x *AppChooserDialog) GetSurfaceTransform(XVar *float64, YVar *float64) { XGtkNativeGetSurfaceTransform(x.GoPointer(), XVar, YVar) } // Realizes a `GtkNative`. // // This should only be used by subclasses. func (x *AppChooserDialog) Realize() { XGtkNativeRealize(x.GoPointer()) } // Unrealizes a `GtkNative`. // // This should only be used by subclasses. func (x *AppChooserDialog) Unrealize() { XGtkNativeUnrealize(x.GoPointer()) } // Returns the display that this `GtkRoot` is on. func (x *AppChooserDialog) GetDisplay() *gdk.Display { var cls *gdk.Display cret := XGtkRootGetDisplay(x.GoPointer()) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &gdk.Display{} cls.Ptr = cret return cls } // Retrieves the current focused widget within the root. // // Note that this is the widget that would have the focus // if the root is active; if the root is not focused then // `gtk_widget_has_focus (widget)` will be %FALSE for the // widget. func (x *AppChooserDialog) GetFocus() *Widget { var cls *Widget cret := XGtkRootGetFocus(x.GoPointer()) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &Widget{} cls.Ptr = cret return cls } // If @focus is not the current focus widget, and is focusable, sets // it as the focus widget for the root. // // If @focus is %NULL, unsets the focus widget for the root. // // To set the focus to a particular widget in the root, it is usually // more convenient to use [method@Gtk.Widget.grab_focus] instead of // this function. func (x *AppChooserDialog) SetFocus(FocusVar *Widget) { XGtkRootSetFocus(x.GoPointer(), FocusVar.GoPointer()) } func init() { core.SetPackageName("GTK", "gtk4") core.SetSharedLibraries("GTK", []string{"libgtk-4.so.1"}) var libs []uintptr for _, libPath := range core.GetPaths("GTK") { lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) if err != nil { panic(err) } libs = append(libs, lib) } core.PuregoSafeRegister(&xAppChooserDialogGLibType, libs, "gtk_app_chooser_dialog_get_type") core.PuregoSafeRegister(&xNewAppChooserDialog, libs, "gtk_app_chooser_dialog_new") core.PuregoSafeRegister(&xNewAppChooserDialogForContentType, libs, "gtk_app_chooser_dialog_new_for_content_type") core.PuregoSafeRegister(&xAppChooserDialogGetHeading, libs, "gtk_app_chooser_dialog_get_heading") core.PuregoSafeRegister(&xAppChooserDialogGetWidget, libs, "gtk_app_chooser_dialog_get_widget") core.PuregoSafeRegister(&xAppChooserDialogSetHeading, libs, "gtk_app_chooser_dialog_set_heading") }