// 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/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" "github.com/bnema/puregotk/v4/gtk" ) type WindowClass struct { _ structs.HostLayout ParentClass gtk.WindowClass Padding [4]uintptr } func (x *WindowClass) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } // A freeform window. // // <picture> // // <source srcset="window-dark.png" media="(prefers-color-scheme: dark)"> // <img src="window.png" alt="window"> // // </picture> // // The `AdwWindow` widget is a subclass of [class@Gtk.Window] which has no // titlebar area. Instead, [class@ToolbarView] can be used together with // [class@HeaderBar] or [class@Gtk.HeaderBar] as follows: // // ```xml // <object class="AdwWindow"> // // <property name="content"> // <object class="AdwToolbarView"> // <child type="top"> // <object class="AdwHeaderBar"/> // </child> // <property name="content"> // <!-- ... --> // </property> // </object> // </property> // // </object> // ``` // // Using [property@Gtk.Window:titlebar] or [property@Gtk.Window:child] // is not supported and will result in a crash. Use [property@Window:content] // instead. // // ## Dialogs // // `AdwWindow` can contain [class@Dialog]. Use [method@Dialog.present] with the // window or a widget within a window to show a dialog. // // ## Breakpoints // // `AdwWindow` can be used with [class@Breakpoint] the same way as // [class@BreakpointBin]. Refer to that widget's documentation for details. // // Example: // // ```xml // <object class="AdwWindow"> // // <property name="content"> // <object class="AdwToolbarView"> // <child type="top"> // <object class="AdwHeaderBar"/> // </child> // <property name="content"> // <!-- ... --> // </property> // <child type="bottom"> // <object class="GtkActionBar" id="bottom_bar"> // <property name="revealed">True</property> // <property name="visible">False</property> // </object> // </child> // </object> // </property> // <child> // <object class="AdwBreakpoint"> // <condition>max-width: 500px</condition> // <setter object="bottom_bar" property="visible">True</setter> // </object> // </child> // // </object> // ``` // // When breakpoints are used, the minimum size must be larger than the smallest // UI state. `AdwWindow` defaults to the minimum size of 360×200 px. If that's // too small, set the [property@Gtk.Widget:width-request] and // [property@Gtk.Widget:height-request] properties manually. // // ## Adaptive Preview // // `AdwWindow` has a debug tool called adaptive preview. It can be opened from // GTK Inspector or by pressing <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>M</kbd>, // and controlled via the [property@Window:adaptive-preview] property. type Window struct { gtk.Window } var xWindowGLibType func() types.GType func WindowGLibType() types.GType { return xWindowGLibType() } func WindowNewFromInternalPtr(ptr uintptr) *Window { cls := &Window{} cls.Ptr = ptr return cls } var xNewWindow func() uintptr // Creates a new `AdwWindow`. func NewWindow() *Window { var cls *Window cret := xNewWindow() if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &Window{} cls.Ptr = cret return cls } var xWindowAddBreakpoint func(uintptr, uintptr) // Adds @breakpoint to @self. func (x *Window) AddBreakpoint(BreakpointVar *Breakpoint) { xWindowAddBreakpoint(x.GoPointer(), BreakpointVar.GoPointer()) } var xWindowGetAdaptivePreview func(uintptr) bool // Gets whether adaptive preview for @self is currently open. func (x *Window) GetAdaptivePreview() bool { cret := xWindowGetAdaptivePreview(x.GoPointer()) return cret } var xWindowGetContent func(uintptr) uintptr // Gets the content widget of @self. // // This method should always be used instead of [method@Gtk.Window.get_child]. func (x *Window) GetContent() *gtk.Widget { var cls *gtk.Widget cret := xWindowGetContent(x.GoPointer()) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = >k.Widget{} cls.Ptr = cret return cls } var xWindowGetCurrentBreakpoint func(uintptr) uintptr // Gets the current breakpoint. func (x *Window) GetCurrentBreakpoint() *Breakpoint { var cls *Breakpoint cret := xWindowGetCurrentBreakpoint(x.GoPointer()) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &Breakpoint{} cls.Ptr = cret return cls } var xWindowGetDialogs func(uintptr) uintptr // Returns a [iface@Gio.ListModel] that contains the open dialogs of @self. // // This can be used to keep an up-to-date view. func (x *Window) GetDialogs() *gio.ListModelBase { var cls *gio.ListModelBase cret := xWindowGetDialogs(x.GoPointer()) if cret == 0 { return nil } cls = &gio.ListModelBase{} cls.Ptr = cret return cls } var xWindowGetVisibleDialog func(uintptr) uintptr // Returns the currently visible dialog in @self, if there's one. func (x *Window) GetVisibleDialog() *Dialog { var cls *Dialog cret := xWindowGetVisibleDialog(x.GoPointer()) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &Dialog{} cls.Ptr = cret return cls } var xWindowSetAdaptivePreview func(uintptr, bool) // Sets whether adaptive preview for @self is currently open. // // Adaptive preview is a debugging tool used for testing the window // contents at specific screen sizes, simulating mobile environment. // // Adaptive preview can always be accessed from inspector. This function // allows applications to open it manually. // // Most applications should not use this function. func (x *Window) SetAdaptivePreview(AdaptivePreviewVar bool) { xWindowSetAdaptivePreview(x.GoPointer(), AdaptivePreviewVar) } var xWindowSetContent func(uintptr, uintptr) // Sets the content widget of @self. // // This method should always be used instead of [method@Gtk.Window.set_child]. func (x *Window) SetContent(ContentVar *gtk.Widget) { xWindowSetContent(x.GoPointer(), ContentVar.GoPointer()) } func (c *Window) GoPointer() uintptr { if c == nil { return 0 } return c.Ptr } func (c *Window) SetGoPointer(ptr uintptr) { c.Ptr = ptr } // SetPropertyAdaptivePreview sets the "adaptive-preview" property. // Whether adaptive preview is currently open. // // Adaptive preview is a debugging tool used for testing the window // contents at specific screen sizes, simulating mobile environment. // // Adaptive preview can always be accessed from inspector. This function // allows applications to open it manually. // // Most applications should not use this property. func (x *Window) SetPropertyAdaptivePreview(value bool) { var v gobject.Value v.Init(gobject.TypeBooleanVal) v.SetBoolean(value) x.SetProperty("adaptive-preview", &v) } // GetPropertyAdaptivePreview gets the "adaptive-preview" property. // Whether adaptive preview is currently open. // // Adaptive preview is a debugging tool used for testing the window // contents at specific screen sizes, simulating mobile environment. // // Adaptive preview can always be accessed from inspector. This function // allows applications to open it manually. // // Most applications should not use this property. func (x *Window) GetPropertyAdaptivePreview() bool { var v gobject.Value x.GetProperty("adaptive-preview", &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 *Window) 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 *Window) 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 *Window) GetAccessibleRole() gtk.AccessibleRole { cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) return cret } // Retrieves the implementation for the given accessible object. func (x *Window) 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 *Window) 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 *Window) 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 *Window) 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 *Window) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) return cret } // Resets the accessible property to its default value. func (x *Window) ResetProperty(PropertyVar gtk.AccessibleProperty) { gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) } // Resets the accessible relation to its default value. func (x *Window) ResetRelation(RelationVar gtk.AccessibleRelation) { gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) } // Resets the accessible state to its default value. func (x *Window) 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 *Window) 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 *Window) 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 *Window) 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 *Window) 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 *Window) 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 *Window) 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 *Window) 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 *Window) 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 *Window) 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 *Window) GetBuildableId() string { cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) return cret } // Returns the renderer that is used for this `GtkNative`. func (x *Window) GetRenderer() *gsk.Renderer { var cls *gsk.Renderer cret := gtk.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 *Window) GetSurface() *gdk.Surface { var cls *gdk.Surface cret := gtk.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 *Window) GetSurfaceTransform(XVar *float64, YVar *float64) { gtk.XGtkNativeGetSurfaceTransform(x.GoPointer(), XVar, YVar) } // Realizes a `GtkNative`. // // This should only be used by subclasses. func (x *Window) Realize() { gtk.XGtkNativeRealize(x.GoPointer()) } // Unrealizes a `GtkNative`. // // This should only be used by subclasses. func (x *Window) Unrealize() { gtk.XGtkNativeUnrealize(x.GoPointer()) } // Returns the display that this `GtkRoot` is on. func (x *Window) GetDisplay() *gdk.Display { var cls *gdk.Display cret := gtk.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 *Window) GetFocus() *gtk.Widget { var cls *gtk.Widget cret := gtk.XGtkRootGetFocus(x.GoPointer()) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = >k.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 *Window) SetFocus(FocusVar *gtk.Widget) { gtk.XGtkRootSetFocus(x.GoPointer(), FocusVar.GoPointer()) } 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(&xWindowGLibType, libs, "adw_window_get_type") core.PuregoSafeRegister(&xNewWindow, libs, "adw_window_new") core.PuregoSafeRegister(&xWindowAddBreakpoint, libs, "adw_window_add_breakpoint") core.PuregoSafeRegister(&xWindowGetAdaptivePreview, libs, "adw_window_get_adaptive_preview") core.PuregoSafeRegister(&xWindowGetContent, libs, "adw_window_get_content") core.PuregoSafeRegister(&xWindowGetCurrentBreakpoint, libs, "adw_window_get_current_breakpoint") core.PuregoSafeRegister(&xWindowGetDialogs, libs, "adw_window_get_dialogs") core.PuregoSafeRegister(&xWindowGetVisibleDialog, libs, "adw_window_get_visible_dialog") core.PuregoSafeRegister(&xWindowSetAdaptivePreview, libs, "adw_window_set_adaptive_preview") core.PuregoSafeRegister(&xWindowSetContent, libs, "adw_window_set_content") }