// Package gtk was automatically generated by github.com/bnema/puregotk DO NOT EDIT package gtk 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" ) type WindowControlsClass struct { _ structs.HostLayout ParentClass WidgetClass } func (x *WindowControlsClass) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } // Shows window frame controls. // // Typical window frame controls are minimize, maximize and close buttons, // and the window icon. // // <picture> // // <source srcset="windowcontrols-dark.png" media="(prefers-color-scheme: dark)"> // <img alt="An example GtkWindowControls" src="windowcontrols.png"> // // </picture> // // `GtkWindowControls` only displays start or end side of the controls (see // [property@Gtk.WindowControls:side]), so it's intended to be always used // in pair with another `GtkWindowControls` for the opposite side, for example: // // ```xml // <object class="GtkBox"> // // <child> // <object class="GtkWindowControls"> // <property name="side">start</property> // </object> // </child> // // ... // // <child> // <object class="GtkWindowControls"> // <property name="side">end</property> // </object> // </child> // // </object> // ``` // // # CSS nodes // // ``` // windowcontrols // ├── [image.icon] // ├── [button.minimize] // ├── [button.maximize] // ╰── [button.close] // ``` // // A `GtkWindowControls`' CSS node is called windowcontrols. It contains // subnodes corresponding to each title button. Which of the title buttons // exist and where they are placed exactly depends on the desktop environment // and [property@Gtk.WindowControls:decoration-layout] value. // // When [property@Gtk.WindowControls:empty] is true, it gets the .empty // style class. // // # Accessibility // // `GtkWindowControls` uses the [enum@Gtk.AccessibleRole.group] role. type WindowControls struct { Widget } var xWindowControlsGLibType func() types.GType func WindowControlsGLibType() types.GType { return xWindowControlsGLibType() } func WindowControlsNewFromInternalPtr(ptr uintptr) *WindowControls { cls := &WindowControls{} cls.Ptr = ptr return cls } var xNewWindowControls func(PackType) uintptr // Creates a new `GtkWindowControls`. func NewWindowControls(SideVar PackType) *WindowControls { var cls *WindowControls cret := xNewWindowControls(SideVar) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &WindowControls{} cls.Ptr = cret return cls } var xWindowControlsGetDecorationLayout func(uintptr) string // Gets the decoration layout of this window controls widget func (x *WindowControls) GetDecorationLayout() string { cret := xWindowControlsGetDecorationLayout(x.GoPointer()) return cret } var xWindowControlsGetEmpty func(uintptr) bool // Gets whether the widget has any window buttons. func (x *WindowControls) GetEmpty() bool { cret := xWindowControlsGetEmpty(x.GoPointer()) return cret } var xWindowControlsGetSide func(uintptr) PackType // Gets the side to which this window controls widget belongs. func (x *WindowControls) GetSide() PackType { cret := xWindowControlsGetSide(x.GoPointer()) return cret } var xWindowControlsGetUseNativeControls func(uintptr) bool // Returns whether platform native window controls are shown. func (x *WindowControls) GetUseNativeControls() bool { cret := xWindowControlsGetUseNativeControls(x.GoPointer()) return cret } var xWindowControlsSetDecorationLayout func(uintptr, uintptr) // Sets the decoration layout for the title buttons. // // This overrides the [property@Gtk.Settings:gtk-decoration-layout] // setting. // // The format of the string is button names, separated by commas. // A colon separates the buttons that should appear on the left // from those on the right. Recognized button names are minimize, // maximize, close and icon (the window icon). // // For example, “icon:minimize,maximize,close” specifies a icon // on the left, and minimize, maximize and close buttons on the right. // // If [property@Gtk.WindowControls:side] value is [enum@Gtk.PackType.start], // @self will display the part before the colon, otherwise after that. func (x *WindowControls) SetDecorationLayout(LayoutVar *string) { LayoutVarPtr := core.GStrdupNullable(LayoutVar) defer core.GFreeNullable(LayoutVarPtr) xWindowControlsSetDecorationLayout(x.GoPointer(), LayoutVarPtr) } var xWindowControlsSetSide func(uintptr, PackType) // Determines which part of decoration layout // the window controls widget uses. // // See [property@Gtk.WindowControls:decoration-layout]. func (x *WindowControls) SetSide(SideVar PackType) { xWindowControlsSetSide(x.GoPointer(), SideVar) } var xWindowControlsSetUseNativeControls func(uintptr, bool) // Sets whether platform native window controls are used. // // This option shows the "stoplight" buttons on macOS. // For Linux, this option has no effect. // // See also [Using GTK on Apple macOS](osx.html?native-window-controls). func (x *WindowControls) SetUseNativeControls(SettingVar bool) { xWindowControlsSetUseNativeControls(x.GoPointer(), SettingVar) } func (c *WindowControls) GoPointer() uintptr { if c == nil { return 0 } return c.Ptr } func (c *WindowControls) SetGoPointer(ptr uintptr) { c.Ptr = ptr } // SetPropertyDecorationLayout sets the "decoration-layout" property. // The decoration layout for window buttons. // // If this property is not set, the // [property@Gtk.Settings:gtk-decoration-layout] setting is used. func (x *WindowControls) SetPropertyDecorationLayout(value string) { var v gobject.Value v.Init(gobject.TypeStringVal) v.SetString(&value) x.SetProperty("decoration-layout", &v) } // GetPropertyDecorationLayout gets the "decoration-layout" property. // The decoration layout for window buttons. // // If this property is not set, the // [property@Gtk.Settings:gtk-decoration-layout] setting is used. func (x *WindowControls) GetPropertyDecorationLayout() string { var v gobject.Value x.GetProperty("decoration-layout", &v) return v.GetString() } // GetPropertyEmpty gets the "empty" property. // Whether the widget has any window buttons. func (x *WindowControls) GetPropertyEmpty() bool { var v gobject.Value x.GetProperty("empty", &v) return v.GetBoolean() } // SetPropertyUseNativeControls sets the "use-native-controls" property. // Whether to show platform native close/minimize/maximize buttons. // // For macOS, the [property@Gtk.HeaderBar:decoration-layout] property // controls the use of native window controls. // // On other platforms, this option has no effect. // // See also [Using GTK on Apple macOS](osx.html?native-window-controls). func (x *WindowControls) SetPropertyUseNativeControls(value bool) { var v gobject.Value v.Init(gobject.TypeBooleanVal) v.SetBoolean(value) x.SetProperty("use-native-controls", &v) } // GetPropertyUseNativeControls gets the "use-native-controls" property. // Whether to show platform native close/minimize/maximize buttons. // // For macOS, the [property@Gtk.HeaderBar:decoration-layout] property // controls the use of native window controls. // // On other platforms, this option has no effect. // // See also [Using GTK on Apple macOS](osx.html?native-window-controls). func (x *WindowControls) GetPropertyUseNativeControls() bool { var v gobject.Value x.GetProperty("use-native-controls", &v) return v.GetBoolean() } // 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 *WindowControls) 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 *WindowControls) 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 *WindowControls) GetAccessibleRole() AccessibleRole { cret := XGtkAccessibleGetAccessibleRole(x.GoPointer()) return cret } // Retrieves the implementation for the given accessible object. func (x *WindowControls) 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 *WindowControls) 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 *WindowControls) 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 *WindowControls) 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 *WindowControls) GetPlatformState(StateVar AccessiblePlatformState) bool { cret := XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) return cret } // Resets the accessible property to its default value. func (x *WindowControls) ResetProperty(PropertyVar AccessibleProperty) { XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) } // Resets the accessible relation to its default value. func (x *WindowControls) ResetRelation(RelationVar AccessibleRelation) { XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) } // Resets the accessible state to its default value. func (x *WindowControls) 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 *WindowControls) 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 *WindowControls) 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 *WindowControls) 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 *WindowControls) 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 *WindowControls) 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 *WindowControls) 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 *WindowControls) 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 *WindowControls) 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 *WindowControls) UpdateStateValue(NStatesVar int, StatesVar []AccessibleState, ValuesVar []gobject.Value) { 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 *WindowControls) GetBuildableId() string { cret := XGtkBuildableGetBuildableId(x.GoPointer()) return cret } 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(&xWindowControlsGLibType, libs, "gtk_window_controls_get_type") core.PuregoSafeRegister(&xNewWindowControls, libs, "gtk_window_controls_new") core.PuregoSafeRegister(&xWindowControlsGetDecorationLayout, libs, "gtk_window_controls_get_decoration_layout") core.PuregoSafeRegister(&xWindowControlsGetEmpty, libs, "gtk_window_controls_get_empty") core.PuregoSafeRegister(&xWindowControlsGetSide, libs, "gtk_window_controls_get_side") core.PuregoSafeRegister(&xWindowControlsGetUseNativeControls, libs, "gtk_window_controls_get_use_native_controls") core.PuregoSafeRegister(&xWindowControlsSetDecorationLayout, libs, "gtk_window_controls_set_decoration_layout") core.PuregoSafeRegister(&xWindowControlsSetSide, libs, "gtk_window_controls_set_side") core.PuregoSafeRegister(&xWindowControlsSetUseNativeControls, libs, "gtk_window_controls_set_use_native_controls") }