// 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" "github.com/bnema/puregotk/v4/gsk" ) type FixedClass struct { _ structs.HostLayout ParentClass WidgetClass Padding [8]uintptr } func (x *FixedClass) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } // Places its child widgets at fixed positions and with fixed sizes. // // `GtkFixed` performs no automatic layout management. // // For most applications, you should not use this container! It keeps // you from having to learn about the other GTK containers, but it // results in broken applications. With `GtkFixed`, the following // things will result in truncated text, overlapping widgets, and // other display bugs: // // - Themes, which may change widget sizes. // // - Fonts other than the one you used to write the app will of course // change the size of widgets containing text; keep in mind that // users may use a larger font because of difficulty reading the // default, or they may be using a different OS that provides different fonts. // // - Translation of text into other languages changes its size. Also, // display of non-English text will use a different font in many // cases. // // In addition, `GtkFixed` does not pay attention to text direction and // thus may produce unwanted results if your app is run under right-to-left // languages such as Hebrew or Arabic. That is: normally GTK will order // containers appropriately for the text direction, e.g. to put labels to // the right of the thing they label when using an RTL language, but it can’t // do that with `GtkFixed`. So if you need to reorder widgets depending on // the text direction, you would need to manually detect it and adjust child // positions accordingly. // // Finally, fixed positioning makes it kind of annoying to add/remove // UI elements, since you have to reposition all the other elements. This // is a long-term maintenance problem for your application. // // If you know none of these things are an issue for your application, // and prefer the simplicity of `GtkFixed`, by all means use the // widget. But you should be aware of the tradeoffs. type Fixed struct { Widget } var xFixedGLibType func() types.GType func FixedGLibType() types.GType { return xFixedGLibType() } func FixedNewFromInternalPtr(ptr uintptr) *Fixed { cls := &Fixed{} cls.Ptr = ptr return cls } var xNewFixed func() uintptr // Creates a new `GtkFixed`. func NewFixed() *Fixed { var cls *Fixed cret := xNewFixed() if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &Fixed{} cls.Ptr = cret return cls } var xFixedGetChildPosition func(uintptr, uintptr, *float64, *float64) // Retrieves the translation transformation of the // given child `GtkWidget` in the `GtkFixed`. // // See also: [method@Gtk.Fixed.get_child_transform]. func (x *Fixed) GetChildPosition(WidgetVar *Widget, XVar *float64, YVar *float64) { xFixedGetChildPosition(x.GoPointer(), WidgetVar.GoPointer(), XVar, YVar) } var xFixedGetChildTransform func(uintptr, uintptr) *gsk.Transform // Retrieves the transformation for @widget set using // gtk_fixed_set_child_transform(). func (x *Fixed) GetChildTransform(WidgetVar *Widget) *gsk.Transform { cret := xFixedGetChildTransform(x.GoPointer(), WidgetVar.GoPointer()) return cret } var xFixedMove func(uintptr, uintptr, float64, float64) // Sets a translation transformation to the given @x and @y // coordinates to the child @widget of the `GtkFixed`. func (x *Fixed) Move(WidgetVar *Widget, XVar float64, YVar float64) { xFixedMove(x.GoPointer(), WidgetVar.GoPointer(), XVar, YVar) } var xFixedPut func(uintptr, uintptr, float64, float64) // Adds a widget to a `GtkFixed` at the given position. func (x *Fixed) Put(WidgetVar *Widget, XVar float64, YVar float64) { xFixedPut(x.GoPointer(), WidgetVar.GoPointer(), XVar, YVar) } var xFixedRemove func(uintptr, uintptr) // Removes a child from @fixed. func (x *Fixed) Remove(WidgetVar *Widget) { xFixedRemove(x.GoPointer(), WidgetVar.GoPointer()) } var xFixedSetChildTransform func(uintptr, uintptr, *gsk.Transform) // Sets the transformation for @widget. // // This is a convenience function that retrieves the // [class@Gtk.FixedLayoutChild] instance associated to // @widget and calls [method@Gtk.FixedLayoutChild.set_transform]. func (x *Fixed) SetChildTransform(WidgetVar *Widget, TransformVar *gsk.Transform) { xFixedSetChildTransform(x.GoPointer(), WidgetVar.GoPointer(), TransformVar) } func (c *Fixed) GoPointer() uintptr { if c == nil { return 0 } return c.Ptr } func (c *Fixed) 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 *Fixed) 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 *Fixed) 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 *Fixed) GetAccessibleRole() AccessibleRole { cret := XGtkAccessibleGetAccessibleRole(x.GoPointer()) return cret } // Retrieves the implementation for the given accessible object. func (x *Fixed) 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 *Fixed) 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 *Fixed) 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 *Fixed) 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 *Fixed) GetPlatformState(StateVar AccessiblePlatformState) bool { cret := XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) return cret } // Resets the accessible property to its default value. func (x *Fixed) ResetProperty(PropertyVar AccessibleProperty) { XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) } // Resets the accessible relation to its default value. func (x *Fixed) ResetRelation(RelationVar AccessibleRelation) { XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) } // Resets the accessible state to its default value. func (x *Fixed) 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 *Fixed) 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 *Fixed) 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 *Fixed) 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 *Fixed) 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 *Fixed) 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 *Fixed) 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 *Fixed) 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 *Fixed) 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 *Fixed) 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 *Fixed) 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(&xFixedGLibType, libs, "gtk_fixed_get_type") core.PuregoSafeRegister(&xNewFixed, libs, "gtk_fixed_new") core.PuregoSafeRegister(&xFixedGetChildPosition, libs, "gtk_fixed_get_child_position") core.PuregoSafeRegister(&xFixedGetChildTransform, libs, "gtk_fixed_get_child_transform") core.PuregoSafeRegister(&xFixedMove, libs, "gtk_fixed_move") core.PuregoSafeRegister(&xFixedPut, libs, "gtk_fixed_put") core.PuregoSafeRegister(&xFixedRemove, libs, "gtk_fixed_remove") core.PuregoSafeRegister(&xFixedSetChildTransform, libs, "gtk_fixed_set_child_transform") }