// Package adw was automatically generated by github.com/bnema/puregotk DO NOT EDIT package adw import ( "structs" "unsafe" "github.com/ebitengine/purego" "github.com/bnema/puregotk/pkg/core" "github.com/bnema/puregotk/v4/gobject" "github.com/bnema/puregotk/v4/gobject/types" "github.com/bnema/puregotk/v4/gtk" ) type MultiLayoutViewClass struct { _ structs.HostLayout ParentClass gtk.WidgetClass } func (x *MultiLayoutViewClass) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } // A widget for switching between different layouts. // // `AdwMultiLayoutView` contains layouts and children. Each child has // an ID, each layout has slots inside it, each slot also has an ID. When // switching layouts, children are inserted into slots with matching IDs. The // [property@Gtk.Widget:visible] property of each slot is updated to match // that of the inserted child. // // This can be useful for rearranging children when it's difficult to do so // otherwise, for example to move a child from a sidebar to a bottom bar. // // The currently used layout can be switched using the // [property@MultiLayoutView:layout] or [property@MultiLayoutView:layout-name] // properties. For example, it can be done via a [class@Adw.Breakpoint] setter // to change layouts depending on the window size. // // ## AdwMultiLayoutView as GtkBuildable // // The `AdwMultiLayoutView` implementation of the [iface@Gtk.Buildable] // interface supports adding layouts via `<child>` element with the `type` // attribute omitted. // // It also supports setting children via `<child type="ID">`. // // Example of an `AdwMultiLayoutView` UI definition that can display a secondary // child as either a sidebar or a bottom sheet. // // ```xml // <object class="AdwMultiLayoutView"> // // <child> // <object class="AdwLayout"> // <property name="name">sidebar</property> // <property name="content"> // <object class="AdwOverlaySplitView"> // <property name="sidebar"> // <object class="AdwLayoutSlot"> // <property name="id">secondary</property> // </object> // </property> // <property name="content"> // <object class="AdwLayoutSlot"> // <property name="id">primary</property> // </object> // </property> // </object> // </property> // </object> // </child> // <child> // <object class="AdwLayout"> // <property name="name">bottom-sheet</property> // <property name="content"> // <object class="AdwBottomSheet"> // <property name="open">True</property> // <property name="content"> // <object class="AdwLayoutSlot"> // <property name="id">primary</property> // </object> // </property> // <property name="sheet"> // <object class="AdwLayoutSlot"> // <property name="id">secondary</property> // </object> // </property> // </object> // </property> // </object> // </child> // <child type="primary"> // <!-- ... --> // </child> // <child type="secondary"> // <!-- ... --> // </child> // // </object> // ``` // // ## CSS nodes // // `AdwMultiLayoutView` has a single CSS node with name `multi-layout-view`. type MultiLayoutView struct { gtk.Widget } var xMultiLayoutViewGLibType func() types.GType func MultiLayoutViewGLibType() types.GType { return xMultiLayoutViewGLibType() } func MultiLayoutViewNewFromInternalPtr(ptr uintptr) *MultiLayoutView { cls := &MultiLayoutView{} cls.Ptr = ptr return cls } var xNewMultiLayoutView func() uintptr // Creates a new `AdwMultiLayoutView`. func NewMultiLayoutView() *MultiLayoutView { var cls *MultiLayoutView cret := xNewMultiLayoutView() if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &MultiLayoutView{} cls.Ptr = cret return cls } var xMultiLayoutViewAddLayout func(uintptr, uintptr) // Adds @layout to @self. func (x *MultiLayoutView) AddLayout(LayoutVar *Layout) { xMultiLayoutViewAddLayout(x.GoPointer(), LayoutVar.GoPointer()) } var xMultiLayoutViewGetChild func(uintptr, string) uintptr // Gets the child for @id to @self. func (x *MultiLayoutView) GetChild(IdVar string) *gtk.Widget { var cls *gtk.Widget cret := xMultiLayoutViewGetChild(x.GoPointer(), IdVar) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = >k.Widget{} cls.Ptr = cret return cls } var xMultiLayoutViewGetLayout func(uintptr) uintptr // Gets the currently used layout of @self. func (x *MultiLayoutView) GetLayout() *Layout { var cls *Layout cret := xMultiLayoutViewGetLayout(x.GoPointer()) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &Layout{} cls.Ptr = cret return cls } var xMultiLayoutViewGetLayoutByName func(uintptr, string) uintptr // Gets layout with the name @name from @self, or `NULL` if it doesn't exist. // // See [property@Layout:name]. func (x *MultiLayoutView) GetLayoutByName(NameVar string) *Layout { var cls *Layout cret := xMultiLayoutViewGetLayoutByName(x.GoPointer(), NameVar) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &Layout{} cls.Ptr = cret return cls } var xMultiLayoutViewGetLayoutName func(uintptr) string // Returns the name of the currently used layout of @self. func (x *MultiLayoutView) GetLayoutName() string { cret := xMultiLayoutViewGetLayoutName(x.GoPointer()) return cret } var xMultiLayoutViewRemoveLayout func(uintptr, uintptr) // Removes @layout from @self. func (x *MultiLayoutView) RemoveLayout(LayoutVar *Layout) { xMultiLayoutViewRemoveLayout(x.GoPointer(), LayoutVar.GoPointer()) } var xMultiLayoutViewSetChild func(uintptr, string, uintptr) // Sets @child as the child for @id in @self. // // When changing layouts, it will be inserted into the slot with @id. func (x *MultiLayoutView) SetChild(IdVar string, ChildVar *gtk.Widget) { xMultiLayoutViewSetChild(x.GoPointer(), IdVar, ChildVar.GoPointer()) } var xMultiLayoutViewSetLayout func(uintptr, uintptr) // Makes @layout the current layout of @self. func (x *MultiLayoutView) SetLayout(LayoutVar *Layout) { xMultiLayoutViewSetLayout(x.GoPointer(), LayoutVar.GoPointer()) } var xMultiLayoutViewSetLayoutName func(uintptr, string) // Makes the layout with @name the current layout of @self. // // See [property@Layout:name]. func (x *MultiLayoutView) SetLayoutName(NameVar string) { xMultiLayoutViewSetLayoutName(x.GoPointer(), NameVar) } func (c *MultiLayoutView) GoPointer() uintptr { if c == nil { return 0 } return c.Ptr } func (c *MultiLayoutView) SetGoPointer(ptr uintptr) { c.Ptr = ptr } // SetPropertyLayoutName sets the "layout-name" property. // The name of the currently used layout. // // See [property@Layout:name]. func (x *MultiLayoutView) SetPropertyLayoutName(value string) { var v gobject.Value v.Init(gobject.TypeStringVal) v.SetString(&value) x.SetProperty("layout-name", &v) } // GetPropertyLayoutName gets the "layout-name" property. // The name of the currently used layout. // // See [property@Layout:name]. func (x *MultiLayoutView) GetPropertyLayoutName() string { var v gobject.Value x.GetProperty("layout-name", &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 *MultiLayoutView) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) { gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) } // Retrieves the accessible parent for an accessible object. // // This function returns `NULL` for top level widgets. func (x *MultiLayoutView) GetAccessibleParent() *gtk.AccessibleBase { var cls *gtk.AccessibleBase cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer()) if cret == 0 { return nil } cls = >k.AccessibleBase{} cls.Ptr = cret return cls } // Retrieves the accessible role of an accessible object. func (x *MultiLayoutView) GetAccessibleRole() gtk.AccessibleRole { cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) return cret } // Retrieves the implementation for the given accessible object. func (x *MultiLayoutView) GetAtContext() *gtk.ATContext { var cls *gtk.ATContext cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer()) if cret == 0 { return nil } cls = >k.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 *MultiLayoutView) GetBounds(XVar *int, YVar *int, WidthVar *int, HeightVar *int) bool { cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) return cret } // Retrieves the first accessible child of an accessible object. func (x *MultiLayoutView) GetFirstAccessibleChild() *gtk.AccessibleBase { var cls *gtk.AccessibleBase cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) if cret == 0 { return nil } cls = >k.AccessibleBase{} cls.Ptr = cret return cls } // Retrieves the next accessible sibling of an accessible object func (x *MultiLayoutView) GetNextAccessibleSibling() *gtk.AccessibleBase { var cls *gtk.AccessibleBase cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) if cret == 0 { return nil } cls = >k.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 *MultiLayoutView) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) return cret } // Resets the accessible property to its default value. func (x *MultiLayoutView) ResetProperty(PropertyVar gtk.AccessibleProperty) { gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) } // Resets the accessible relation to its default value. func (x *MultiLayoutView) ResetRelation(RelationVar gtk.AccessibleRelation) { gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) } // Resets the accessible state to its default value. func (x *MultiLayoutView) ResetState(StateVar gtk.AccessibleState) { gtk.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 *MultiLayoutView) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) { gtk.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 *MultiLayoutView) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) { gtk.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 *MultiLayoutView) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) { gtk.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 *MultiLayoutView) UpdateProperty(FirstPropertyVar gtk.AccessibleProperty, varArgs ...interface{}) { gtk.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 *MultiLayoutView) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []gtk.AccessibleProperty, ValuesVar []gobject.Value) { gtk.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 *MultiLayoutView) UpdateRelation(FirstRelationVar gtk.AccessibleRelation, varArgs ...interface{}) { gtk.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 *MultiLayoutView) UpdateRelationValue(NRelationsVar int, RelationsVar []gtk.AccessibleRelation, ValuesVar []gobject.Value) { gtk.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 *MultiLayoutView) UpdateState(FirstStateVar gtk.AccessibleState, varArgs ...interface{}) { gtk.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 *MultiLayoutView) UpdateStateValue(NStatesVar int, StatesVar []gtk.AccessibleState, ValuesVar []gobject.Value) { gtk.XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar) } // 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 *MultiLayoutView) GetBuildableId() string { cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) return cret } func init() { core.SetPackageName("ADW", "libadwaita-1") core.SetSharedLibraries("ADW", []string{"libadwaita-1.so.0"}) var libs []uintptr for _, libPath := range core.GetPaths("ADW") { lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) if err != nil { panic(err) } libs = append(libs, lib) } core.PuregoSafeRegister(&xMultiLayoutViewGLibType, libs, "adw_multi_layout_view_get_type") core.PuregoSafeRegister(&xNewMultiLayoutView, libs, "adw_multi_layout_view_new") core.PuregoSafeRegister(&xMultiLayoutViewAddLayout, libs, "adw_multi_layout_view_add_layout") core.PuregoSafeRegister(&xMultiLayoutViewGetChild, libs, "adw_multi_layout_view_get_child") core.PuregoSafeRegister(&xMultiLayoutViewGetLayout, libs, "adw_multi_layout_view_get_layout") core.PuregoSafeRegister(&xMultiLayoutViewGetLayoutByName, libs, "adw_multi_layout_view_get_layout_by_name") core.PuregoSafeRegister(&xMultiLayoutViewGetLayoutName, libs, "adw_multi_layout_view_get_layout_name") core.PuregoSafeRegister(&xMultiLayoutViewRemoveLayout, libs, "adw_multi_layout_view_remove_layout") core.PuregoSafeRegister(&xMultiLayoutViewSetChild, libs, "adw_multi_layout_view_set_child") core.PuregoSafeRegister(&xMultiLayoutViewSetLayout, libs, "adw_multi_layout_view_set_layout") core.PuregoSafeRegister(&xMultiLayoutViewSetLayoutName, libs, "adw_multi_layout_view_set_layout_name") }