// 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 BreakpointBinClass struct { _ structs.HostLayout ParentClass gtk.WidgetClass Padding [4]uintptr } func (x *BreakpointBinClass) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } // A widget that changes layout based on available size. // // <picture> // // <source srcset="breakpoint-bin-dark.png" media="(prefers-color-scheme: dark)"> // <img src="breakpoint-bin.png" alt="breakpoint-bin"> // // </picture> // // `AdwBreakpointBin` provides a way to use breakpoints without [class@Window], // [class@ApplicationWindow] or [class@Dialog]. It can be useful for limiting // breakpoints to a single page and similar purposes. Most applications // shouldn't need it. // // `AdwBreakpointBin` is similar to [class@Bin]. It has one child, set via the // [property@BreakpointBin:child] property. // // When `AdwBreakpointBin` is resized, its child widget can rearrange its layout // at specific thresholds. // // The thresholds and layout changes are defined via [class@Breakpoint] objects. // They can be added using [method@BreakpointBin.add_breakpoint]. // // Each breakpoint has a condition, specifying the bin's size and/or aspect // ratio, and setters that automatically set object properties when that // happens. The [signal@Breakpoint::apply] and [signal@Breakpoint::unapply] can // be used instead for more complex scenarios. // // Breakpoints are only allowed to modify widgets inside the `AdwBreakpointBin`, // but not on the `AdwBreakpointBin` itself or any other widgets. // // If multiple breakpoints can be used for the current size, the last one is // always picked. The current breakpoint can be tracked using the // [property@BreakpointBin:current-breakpoint] property. // // If none of the breakpoints can be used, that property will be set to `NULL`, // and the original property values will be used instead. // // ## Minimum Size // // Adding a breakpoint to `AdwBreakpointBin` will result in it having no minimum // size. The [property@Gtk.Widget:width-request] and // [property@Gtk.Widget:height-request] properties must always be set when using // breakpoints, indicating the smallest size you want to support. // // The minimum size and breakpoint conditions must be carefully selected so that // the child widget completely fits. If it doesn't, it will overflow and a // warning message will be printed. // // When choosing minimum size, consider translations and text scale factor // changes. Make sure to leave enough space for text labels, and enable // ellipsizing or wrapping if they might not fit. // // For [class@Gtk.Label] this can be done via [property@Gtk.Label:ellipsize], or // via [property@Gtk.Label:wrap] together with [property@Gtk.Label:wrap-mode]. // // For buttons, use [property@Gtk.Button:can-shrink], // [property@Gtk.MenuButton:can-shrink], [property@Adw.SplitButton:can-shrink], // or [property@Adw.ButtonContent:can-shrink]. // // ## Example // // ```c // GtkWidget *bin, *child; // AdwBreakpoint *breakpoint; // // bin = adw_breakpoint_bin_new (); // gtk_widget_set_size_request (bin, 150, 150); // // child = gtk_label_new ("Wide"); // gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_END); // gtk_widget_add_css_class (child, "title-1"); // adw_breakpoint_bin_set_child (ADW_BREAKPOINT_BIN (bin), child); // // breakpoint = adw_breakpoint_new (adw_breakpoint_condition_parse ("max-width: 200px")); // adw_breakpoint_add_setters (breakpoint, // // G_OBJECT (child), "label", "Narrow", // NULL); // // adw_breakpoint_bin_add_breakpoint (ADW_BREAKPOINT_BIN (bin), breakpoint); // ``` // // The bin has a single label inside it, displaying "Wide". When the bin's width // is smaller than or equal to 200px, it changes to "Narrow". // // ## `AdwBreakpointBin` as `GtkBuildable` // // `AdwBreakpointBin` allows adding `AdwBreakpoint` objects as children. // // Example of an `AdwBreakpointBin` UI definition: // // ```xml // <object class="AdwBreakpointBin"> // // <property name="width-request">150</property> // <property name="height-request">150</property> // <property name="child"> // <object class="GtkLabel" id="child"> // <property name="label">Wide</property> // <property name="ellipsize">end</property> // <style> // <class name="title-1"/> // </style> // </object> // </property> // <child> // <object class="AdwBreakpoint"> // <condition>max-width: 200px</condition> // <setter object="child" property="label">Narrow</setter> // </object> // </child> // // </object> // ``` // // See [class@Breakpoint] documentation for details. type BreakpointBin struct { gtk.Widget } var xBreakpointBinGLibType func() types.GType func BreakpointBinGLibType() types.GType { return xBreakpointBinGLibType() } func BreakpointBinNewFromInternalPtr(ptr uintptr) *BreakpointBin { cls := &BreakpointBin{} cls.Ptr = ptr return cls } var xNewBreakpointBin func() uintptr // Creates a new `AdwBreakpointBin`. func NewBreakpointBin() *BreakpointBin { var cls *BreakpointBin cret := xNewBreakpointBin() if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &BreakpointBin{} cls.Ptr = cret return cls } var xBreakpointBinAddBreakpoint func(uintptr, uintptr) // Adds @breakpoint to @self. func (x *BreakpointBin) AddBreakpoint(BreakpointVar *Breakpoint) { xBreakpointBinAddBreakpoint(x.GoPointer(), BreakpointVar.GoPointer()) } var xBreakpointBinGetChild func(uintptr) uintptr // Gets the child widget of @self. func (x *BreakpointBin) GetChild() *gtk.Widget { var cls *gtk.Widget cret := xBreakpointBinGetChild(x.GoPointer()) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = >k.Widget{} cls.Ptr = cret return cls } var xBreakpointBinGetCurrentBreakpoint func(uintptr) uintptr // Gets the current breakpoint. func (x *BreakpointBin) GetCurrentBreakpoint() *Breakpoint { var cls *Breakpoint cret := xBreakpointBinGetCurrentBreakpoint(x.GoPointer()) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &Breakpoint{} cls.Ptr = cret return cls } var xBreakpointBinRemoveBreakpoint func(uintptr, uintptr) // Removes @breakpoint from @self. func (x *BreakpointBin) RemoveBreakpoint(BreakpointVar *Breakpoint) { xBreakpointBinRemoveBreakpoint(x.GoPointer(), BreakpointVar.GoPointer()) } var xBreakpointBinSetChild func(uintptr, uintptr) // Sets the child widget of @self. func (x *BreakpointBin) SetChild(ChildVar *gtk.Widget) { xBreakpointBinSetChild(x.GoPointer(), ChildVar.GoPointer()) } func (c *BreakpointBin) GoPointer() uintptr { if c == nil { return 0 } return c.Ptr } func (c *BreakpointBin) SetGoPointer(ptr uintptr) { c.Ptr = ptr } // 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 *BreakpointBin) 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 *BreakpointBin) 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 *BreakpointBin) GetAccessibleRole() gtk.AccessibleRole { cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) return cret } // Retrieves the implementation for the given accessible object. func (x *BreakpointBin) 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 *BreakpointBin) 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 *BreakpointBin) 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 *BreakpointBin) 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 *BreakpointBin) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) return cret } // Resets the accessible property to its default value. func (x *BreakpointBin) ResetProperty(PropertyVar gtk.AccessibleProperty) { gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) } // Resets the accessible relation to its default value. func (x *BreakpointBin) ResetRelation(RelationVar gtk.AccessibleRelation) { gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) } // Resets the accessible state to its default value. func (x *BreakpointBin) 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 *BreakpointBin) 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 *BreakpointBin) 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 *BreakpointBin) 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 *BreakpointBin) 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 *BreakpointBin) 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 *BreakpointBin) 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 *BreakpointBin) 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 *BreakpointBin) 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 *BreakpointBin) 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 *BreakpointBin) 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(&xBreakpointBinGLibType, libs, "adw_breakpoint_bin_get_type") core.PuregoSafeRegister(&xNewBreakpointBin, libs, "adw_breakpoint_bin_new") core.PuregoSafeRegister(&xBreakpointBinAddBreakpoint, libs, "adw_breakpoint_bin_add_breakpoint") core.PuregoSafeRegister(&xBreakpointBinGetChild, libs, "adw_breakpoint_bin_get_child") core.PuregoSafeRegister(&xBreakpointBinGetCurrentBreakpoint, libs, "adw_breakpoint_bin_get_current_breakpoint") core.PuregoSafeRegister(&xBreakpointBinRemoveBreakpoint, libs, "adw_breakpoint_bin_remove_breakpoint") core.PuregoSafeRegister(&xBreakpointBinSetChild, libs, "adw_breakpoint_bin_set_child") }