// 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/glib" "github.com/bnema/puregotk/v4/gobject/types" "github.com/bnema/puregotk/v4/graphene" ) // The interface vtable for accessible objects containing text. type AccessibleTextInterface struct { _ structs.HostLayout GIface uintptr xGetContents uintptr xGetContentsAt uintptr xGetCaretPosition uintptr xGetSelection uintptr xGetAttributes uintptr xGetDefaultAttributes uintptr xGetExtents uintptr xGetOffset uintptr } func (x *AccessibleTextInterface) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } // OverrideGetContents sets the "get_contents" callback function. func (x *AccessibleTextInterface) OverrideGetContents(cb func(AccessibleText, uint, uint) *glib.Bytes) { if cb == nil { x.xGetContents = 0 } else { x.xGetContents = purego.NewCallback(func(SelfVarp uintptr, StartVarp uint, EndVarp uint) *glib.Bytes { return cb(&AccessibleTextBase{Ptr: SelfVarp}, StartVarp, EndVarp) }) } } // GetGetContents gets the "get_contents" callback function. func (x *AccessibleTextInterface) GetGetContents() func(AccessibleText, uint, uint) *glib.Bytes { if x.xGetContents == 0 { return nil } var rawCallback func(SelfVarp uintptr, StartVarp uint, EndVarp uint) *glib.Bytes purego.RegisterFunc(&rawCallback, x.xGetContents) return func(SelfVar AccessibleText, StartVar uint, EndVar uint) *glib.Bytes { return rawCallback(SelfVar.GoPointer(), StartVar, EndVar) } } // OverrideGetContentsAt sets the "get_contents_at" callback function. func (x *AccessibleTextInterface) OverrideGetContentsAt(cb func(AccessibleText, uint, AccessibleTextGranularity, *uint, *uint) *glib.Bytes) { if cb == nil { x.xGetContentsAt = 0 } else { x.xGetContentsAt = purego.NewCallback(func(SelfVarp uintptr, OffsetVarp uint, GranularityVarp AccessibleTextGranularity, StartVarp *uint, EndVarp *uint) *glib.Bytes { return cb(&AccessibleTextBase{Ptr: SelfVarp}, OffsetVarp, GranularityVarp, StartVarp, EndVarp) }) } } // GetGetContentsAt gets the "get_contents_at" callback function. func (x *AccessibleTextInterface) GetGetContentsAt() func(AccessibleText, uint, AccessibleTextGranularity, *uint, *uint) *glib.Bytes { if x.xGetContentsAt == 0 { return nil } var rawCallback func(SelfVarp uintptr, OffsetVarp uint, GranularityVarp AccessibleTextGranularity, StartVarp *uint, EndVarp *uint) *glib.Bytes purego.RegisterFunc(&rawCallback, x.xGetContentsAt) return func(SelfVar AccessibleText, OffsetVar uint, GranularityVar AccessibleTextGranularity, StartVar *uint, EndVar *uint) *glib.Bytes { return rawCallback(SelfVar.GoPointer(), OffsetVar, GranularityVar, StartVar, EndVar) } } // OverrideGetCaretPosition sets the "get_caret_position" callback function. func (x *AccessibleTextInterface) OverrideGetCaretPosition(cb func(AccessibleText) uint) { if cb == nil { x.xGetCaretPosition = 0 } else { x.xGetCaretPosition = purego.NewCallback(func(SelfVarp uintptr) uint { return cb(&AccessibleTextBase{Ptr: SelfVarp}) }) } } // GetGetCaretPosition gets the "get_caret_position" callback function. func (x *AccessibleTextInterface) GetGetCaretPosition() func(AccessibleText) uint { if x.xGetCaretPosition == 0 { return nil } var rawCallback func(SelfVarp uintptr) uint purego.RegisterFunc(&rawCallback, x.xGetCaretPosition) return func(SelfVar AccessibleText) uint { return rawCallback(SelfVar.GoPointer()) } } // OverrideGetSelection sets the "get_selection" callback function. func (x *AccessibleTextInterface) OverrideGetSelection(cb func(AccessibleText, *uint, *uintptr) bool) { if cb == nil { x.xGetSelection = 0 } else { x.xGetSelection = purego.NewCallback(func(SelfVarp uintptr, NRangesVarp *uint, RangesVarp *uintptr) bool { return cb(&AccessibleTextBase{Ptr: SelfVarp}, NRangesVarp, RangesVarp) }) } } // GetGetSelection gets the "get_selection" callback function. func (x *AccessibleTextInterface) GetGetSelection() func(AccessibleText, *uint, *uintptr) bool { if x.xGetSelection == 0 { return nil } var rawCallback func(SelfVarp uintptr, NRangesVarp *uint, RangesVarp *uintptr) bool purego.RegisterFunc(&rawCallback, x.xGetSelection) return func(SelfVar AccessibleText, NRangesVar *uint, RangesVar *uintptr) bool { return rawCallback(SelfVar.GoPointer(), NRangesVar, RangesVar) } } // OverrideGetAttributes sets the "get_attributes" callback function. func (x *AccessibleTextInterface) OverrideGetAttributes(cb func(AccessibleText, uint, *uint, *uintptr, *[]string, *[]string) bool) { if cb == nil { x.xGetAttributes = 0 } else { x.xGetAttributes = purego.NewCallback(func(SelfVarp uintptr, OffsetVarp uint, NRangesVarp *uint, RangesVarp *uintptr, AttributeNamesVarp *[]string, AttributeValuesVarp *[]string) bool { return cb(&AccessibleTextBase{Ptr: SelfVarp}, OffsetVarp, NRangesVarp, RangesVarp, AttributeNamesVarp, AttributeValuesVarp) }) } } // GetGetAttributes gets the "get_attributes" callback function. func (x *AccessibleTextInterface) GetGetAttributes() func(AccessibleText, uint, *uint, *uintptr, *[]string, *[]string) bool { if x.xGetAttributes == 0 { return nil } var rawCallback func(SelfVarp uintptr, OffsetVarp uint, NRangesVarp *uint, RangesVarp *uintptr, AttributeNamesVarp *[]string, AttributeValuesVarp *[]string) bool purego.RegisterFunc(&rawCallback, x.xGetAttributes) return func(SelfVar AccessibleText, OffsetVar uint, NRangesVar *uint, RangesVar *uintptr, AttributeNamesVar *[]string, AttributeValuesVar *[]string) bool { return rawCallback(SelfVar.GoPointer(), OffsetVar, NRangesVar, RangesVar, AttributeNamesVar, AttributeValuesVar) } } // OverrideGetDefaultAttributes sets the "get_default_attributes" callback function. func (x *AccessibleTextInterface) OverrideGetDefaultAttributes(cb func(AccessibleText, *[]string, *[]string)) { if cb == nil { x.xGetDefaultAttributes = 0 } else { x.xGetDefaultAttributes = purego.NewCallback(func(SelfVarp uintptr, AttributeNamesVarp *[]string, AttributeValuesVarp *[]string) { cb(&AccessibleTextBase{Ptr: SelfVarp}, AttributeNamesVarp, AttributeValuesVarp) }) } } // GetGetDefaultAttributes gets the "get_default_attributes" callback function. func (x *AccessibleTextInterface) GetGetDefaultAttributes() func(AccessibleText, *[]string, *[]string) { if x.xGetDefaultAttributes == 0 { return nil } var rawCallback func(SelfVarp uintptr, AttributeNamesVarp *[]string, AttributeValuesVarp *[]string) purego.RegisterFunc(&rawCallback, x.xGetDefaultAttributes) return func(SelfVar AccessibleText, AttributeNamesVar *[]string, AttributeValuesVar *[]string) { rawCallback(SelfVar.GoPointer(), AttributeNamesVar, AttributeValuesVar) } } // OverrideGetExtents sets the "get_extents" callback function. func (x *AccessibleTextInterface) OverrideGetExtents(cb func(AccessibleText, uint, uint, *graphene.Rect) bool) { if cb == nil { x.xGetExtents = 0 } else { x.xGetExtents = purego.NewCallback(func(SelfVarp uintptr, StartVarp uint, EndVarp uint, ExtentsVarp *graphene.Rect) bool { return cb(&AccessibleTextBase{Ptr: SelfVarp}, StartVarp, EndVarp, ExtentsVarp) }) } } // GetGetExtents gets the "get_extents" callback function. func (x *AccessibleTextInterface) GetGetExtents() func(AccessibleText, uint, uint, *graphene.Rect) bool { if x.xGetExtents == 0 { return nil } var rawCallback func(SelfVarp uintptr, StartVarp uint, EndVarp uint, ExtentsVarp *graphene.Rect) bool purego.RegisterFunc(&rawCallback, x.xGetExtents) return func(SelfVar AccessibleText, StartVar uint, EndVar uint, ExtentsVar *graphene.Rect) bool { return rawCallback(SelfVar.GoPointer(), StartVar, EndVar, ExtentsVar) } } // OverrideGetOffset sets the "get_offset" callback function. func (x *AccessibleTextInterface) OverrideGetOffset(cb func(AccessibleText, *graphene.Point, *uint) bool) { if cb == nil { x.xGetOffset = 0 } else { x.xGetOffset = purego.NewCallback(func(SelfVarp uintptr, PointVarp *graphene.Point, OffsetVarp *uint) bool { return cb(&AccessibleTextBase{Ptr: SelfVarp}, PointVarp, OffsetVarp) }) } } // GetGetOffset gets the "get_offset" callback function. func (x *AccessibleTextInterface) GetGetOffset() func(AccessibleText, *graphene.Point, *uint) bool { if x.xGetOffset == 0 { return nil } var rawCallback func(SelfVarp uintptr, PointVarp *graphene.Point, OffsetVarp *uint) bool purego.RegisterFunc(&rawCallback, x.xGetOffset) return func(SelfVar AccessibleText, PointVar *graphene.Point, OffsetVar *uint) bool { return rawCallback(SelfVar.GoPointer(), PointVar, OffsetVar) } } // A range inside the text of an accessible object. type AccessibleTextRange struct { _ structs.HostLayout Start uint Length uint } func (x *AccessibleTextRange) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } // An interface for accessible objects containing formatted text. // // The `GtkAccessibleText` interfaces is meant to be implemented by accessible // objects that have text formatted with attributes, or non-trivial text contents. // // You should use the [enum@Gtk.AccessibleProperty.LABEL] or the // [enum@Gtk.AccessibleProperty.DESCRIPTION] properties for accessible // objects containing simple, unformatted text. type AccessibleText interface { GoPointer() uintptr SetGoPointer(uintptr) UpdateCaretPosition() UpdateContents(ChangeVar AccessibleTextContentChange, StartVar uint, EndVar uint) UpdateSelectionBound() } var xAccessibleTextGLibType func() types.GType func AccessibleTextGLibType() types.GType { return xAccessibleTextGLibType() } type AccessibleTextBase struct { Ptr uintptr } func (x *AccessibleTextBase) GoPointer() uintptr { if x == nil { return 0 } return x.Ptr } func (x *AccessibleTextBase) SetGoPointer(ptr uintptr) { x.Ptr = ptr } // Updates the position of the caret. // // Implementations of the `GtkAccessibleText` interface should call this // function every time the caret has moved, in order to notify assistive // technologies. func (x *AccessibleTextBase) UpdateCaretPosition() { XGtkAccessibleTextUpdateCaretPosition(x.GoPointer()) } // Notifies assistive technologies of a change in contents. // // Implementations of the `GtkAccessibleText` interface should call this // function every time their contents change as the result of an operation, // like an insertion or a removal. // // Note: If the change is a deletion, this function must be called *before* // removing the contents, if it is an insertion, it must be called *after* // inserting the new contents. func (x *AccessibleTextBase) UpdateContents(ChangeVar AccessibleTextContentChange, StartVar uint, EndVar uint) { XGtkAccessibleTextUpdateContents(x.GoPointer(), ChangeVar, StartVar, EndVar) } // Updates the boundary of the selection. // // Implementations of the `GtkAccessibleText` interface should call this // function every time the selection has moved, in order to notify assistive // technologies. func (x *AccessibleTextBase) UpdateSelectionBound() { XGtkAccessibleTextUpdateSelectionBound(x.GoPointer()) } var XGtkAccessibleTextUpdateCaretPosition func(uintptr) var XGtkAccessibleTextUpdateContents func(uintptr, AccessibleTextContentChange, uint, uint) var XGtkAccessibleTextUpdateSelectionBound func(uintptr) const ( // An attribute for the background color, expressed as an RGB value // encoded in a string using the format: `{r8},{g8},{b8}`. ACCESSIBLE_ATTRIBUTE_BACKGROUND string = "bg-color" // An attribute for the font family name. ACCESSIBLE_ATTRIBUTE_FAMILY string = "family-name" // An attribute for the foreground color, expressed as an RGB value // encoded in a string using the format: `{r8},{g8},{b8}`. ACCESSIBLE_ATTRIBUTE_FOREGROUND string = "fg-color" // An attribute for the overline style. // // Possible values are: // // - [const@Gtk.ACCESSIBLE_ATTRIBUTE_OVERLINE_NONE] // - [const@Gtk.ACCESSIBLE_ATTRIBUTE_OVERLINE_SINGLE] ACCESSIBLE_ATTRIBUTE_OVERLINE string = "overline" // The "none" overline value for [const@Gtk.ACCESSIBLE_ATTRIBUTE_OVERLINE]. ACCESSIBLE_ATTRIBUTE_OVERLINE_NONE string = "none" // The "single" overline value for [const@Gtk.ACCESSIBLE_ATTRIBUTE_OVERLINE]. ACCESSIBLE_ATTRIBUTE_OVERLINE_SINGLE string = "single" // An attribute for the font size, expressed in points. ACCESSIBLE_ATTRIBUTE_SIZE string = "size" // An attribute for the font stretch type. // // Possible values are: // // - [const@Gtk.ACCESSIBLE_ATTRIBUTE_STRETCH_ULTRA_CONDENSED] // - [const@Gtk.ACCESSIBLE_ATTRIBUTE_STRETCH_EXTRA_CONDENSED] // - [const@Gtk.ACCESSIBLE_ATTRIBUTE_STRETCH_CONDENSED] // - [const@Gtk.ACCESSIBLE_ATTRIBUTE_STRETCH_SEMI_CONDENSED] ACCESSIBLE_ATTRIBUTE_STRETCH string = "stretch" // The "condensed" stretch value for [const@Gtk.ACCESSIBLE_ATTRIBUTE_STRETCH]. ACCESSIBLE_ATTRIBUTE_STRETCH_CONDENSED string = "condensed" // The "expanded" stretch value for [const@Gtk.ACCESSIBLE_ATTRIBUTE_STRETCH]. ACCESSIBLE_ATTRIBUTE_STRETCH_EXPANDED string = "expanded" // The "extra condensed" stretch value for [const@Gtk.ACCESSIBLE_ATTRIBUTE_STRETCH]. ACCESSIBLE_ATTRIBUTE_STRETCH_EXTRA_CONDENSED string = "extra_condensed" // The "extra expanded" stretch value for [const@Gtk.ACCESSIBLE_ATTRIBUTE_STRETCH]. ACCESSIBLE_ATTRIBUTE_STRETCH_EXTRA_EXPANDED string = "extra_expanded" // The "normal" stretch value for [const@Gtk.ACCESSIBLE_ATTRIBUTE_STRETCH]. ACCESSIBLE_ATTRIBUTE_STRETCH_NORMAL string = "normal" // The "semi condensed" stretch value for [const@Gtk.ACCESSIBLE_ATTRIBUTE_STRETCH]. ACCESSIBLE_ATTRIBUTE_STRETCH_SEMI_CONDENSED string = "semi_condensed" // The "semi expanded" stretch value for [const@Gtk.ACCESSIBLE_ATTRIBUTE_STRETCH]. ACCESSIBLE_ATTRIBUTE_STRETCH_SEMI_EXPANDED string = "semi_expanded" // The "ultra condensed" stretch value for [const@Gtk.ACCESSIBLE_ATTRIBUTE_STRETCH]. ACCESSIBLE_ATTRIBUTE_STRETCH_ULTRA_CONDENSED string = "ultra_condensed" // The "ultra expanded" stretch value for [const@Gtk.ACCESSIBLE_ATTRIBUTE_STRETCH]. ACCESSIBLE_ATTRIBUTE_STRETCH_ULTRA_EXPANDED string = "ultra_expanded" // An attribute for strikethrough text. // // Possible values are `true` or `false`. ACCESSIBLE_ATTRIBUTE_STRIKETHROUGH string = "strikethrough" // An attribute for the font style. // // Possible values are: // // - [const@Gtk.ACCESSIBLE_ATTRIBUTE_STYLE_NORMAL] // - [const@Gtk.ACCESSIBLE_ATTRIBUTE_STYLE_OBLIQUE] // - [const@Gtk.ACCESSIBLE_ATTRIBUTE_STYLE_ITALIC] ACCESSIBLE_ATTRIBUTE_STYLE string = "style" // The "italic" style value for [const@Gtk.ACCESSIBLE_ATTRIBUTE_STYLE]. ACCESSIBLE_ATTRIBUTE_STYLE_ITALIC string = "italic" // The "normal" style value for [const@Gtk.ACCESSIBLE_ATTRIBUTE_STYLE]. ACCESSIBLE_ATTRIBUTE_STYLE_NORMAL string = "normal" // The "oblique" style value for [const@Gtk.ACCESSIBLE_ATTRIBUTE_STYLE]. ACCESSIBLE_ATTRIBUTE_STYLE_OBLIQUE string = "oblique" // An attribute for the underline style. // // Possible values are: // // - [const@Gtk.ACCESSIBLE_ATTRIBUTE_UNDERLINE_NONE] // - [const@Gtk.ACCESSIBLE_ATTRIBUTE_UNDERLINE_SINGLE] // - [const@Gtk.ACCESSIBLE_ATTRIBUTE_UNDERLINE_DOUBLE] // - [const@Gtk.ACCESSIBLE_ATTRIBUTE_UNDERLINE_ERROR] ACCESSIBLE_ATTRIBUTE_UNDERLINE string = "underline" // The "double" underline value for [const@Gtk.ACCESSIBLE_ATTRIBUTE_UNDERLINE]. ACCESSIBLE_ATTRIBUTE_UNDERLINE_DOUBLE string = "double" // The "error" underline value for [const@Gtk.ACCESSIBLE_ATTRIBUTE_UNDERLINE]. ACCESSIBLE_ATTRIBUTE_UNDERLINE_ERROR string = "error" // The "none" underline value for [const@Gtk.ACCESSIBLE_ATTRIBUTE_UNDERLINE]. ACCESSIBLE_ATTRIBUTE_UNDERLINE_NONE string = "none" // The "single" underline value for [const@Gtk.ACCESSIBLE_ATTRIBUTE_UNDERLINE]. ACCESSIBLE_ATTRIBUTE_UNDERLINE_SINGLE string = "single" // An attribute for the font variant. // // Possible values are: // // - [const@Gtk.ACCESSIBLE_ATTRIBUTE_VARIANT_SMALL_CAPS] // - [const@Gtk.ACCESSIBLE_ATTRIBUTE_VARIANT_ALL_SMALL_CAPS] // - [const@Gtk.ACCESSIBLE_ATTRIBUTE_VARIANT_PETITE_CAPS] // - [const@Gtk.ACCESSIBLE_ATTRIBUTE_VARIANT_ALL_PETITE_CAPS] // - [const@Gtk.ACCESSIBLE_ATTRIBUTE_VARIANT_UNICASE] // - [const@Gtk.ACCESSIBLE_ATTRIBUTE_VARIANT_TITLE_CAPS] ACCESSIBLE_ATTRIBUTE_VARIANT string = "variant" // The "all petite caps" variant value for [const@Gtk.ACCESSIBLE_ATTRIBUTE_VARIANT]. ACCESSIBLE_ATTRIBUTE_VARIANT_ALL_PETITE_CAPS string = "all-petite-caps" // The "all small caps" variant value for [const@Gtk.ACCESSIBLE_ATTRIBUTE_VARIANT]. ACCESSIBLE_ATTRIBUTE_VARIANT_ALL_SMALL_CAPS string = "all-small-caps" // The "petite caps" variant value for [const@Gtk.ACCESSIBLE_ATTRIBUTE_VARIANT]. ACCESSIBLE_ATTRIBUTE_VARIANT_PETITE_CAPS string = "petite-caps" // The "small caps" variant value for [const@Gtk.ACCESSIBLE_ATTRIBUTE_VARIANT]. ACCESSIBLE_ATTRIBUTE_VARIANT_SMALL_CAPS string = "small-caps" // The "title caps" variant value for [const@Gtk.ACCESSIBLE_ATTRIBUTE_VARIANT]. ACCESSIBLE_ATTRIBUTE_VARIANT_TITLE_CAPS string = "title-caps" // The "unicase" variant value for [const@Gtk.ACCESSIBLE_ATTRIBUTE_VARIANT]. ACCESSIBLE_ATTRIBUTE_VARIANT_UNICASE string = "unicase" // An attribute for the font weight. ACCESSIBLE_ATTRIBUTE_WEIGHT string = "weight" ) // The type of contents change operation. type AccessibleTextContentChange int var xAccessibleTextContentChangeGLibType func() types.GType func AccessibleTextContentChangeGLibType() types.GType { return xAccessibleTextContentChangeGLibType() } const ( // contents change as the result of // an insert operation AccessibleTextContentChangeInsertValue AccessibleTextContentChange = 0 // contents change as the result of // a remove operation AccessibleTextContentChangeRemoveValue AccessibleTextContentChange = 1 ) // The granularity for queries about the text contents of a [iface@Gtk.AccessibleText] // implementation. type AccessibleTextGranularity int var xAccessibleTextGranularityGLibType func() types.GType func AccessibleTextGranularityGLibType() types.GType { return xAccessibleTextGranularityGLibType() } const ( // Use the boundary between // characters (including non-printing characters) AccessibleTextGranularityCharacterValue AccessibleTextGranularity = 0 // Use the boundary between words, // starting from the beginning of the current word and ending at the // beginning of the next word AccessibleTextGranularityWordValue AccessibleTextGranularity = 1 // Use the boundary between // sentences, starting from the beginning of the current sentence and // ending at the beginning of the next sentence AccessibleTextGranularitySentenceValue AccessibleTextGranularity = 2 // Use the boundary between lines, // starting from the beginning of the current line and ending at the // beginning of the next line AccessibleTextGranularityLineValue AccessibleTextGranularity = 3 // Use the boundary between // paragraphs, starting from the beginning of the current paragraph and // ending at the beginning of the next paragraph AccessibleTextGranularityParagraphValue AccessibleTextGranularity = 4 ) 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(&xAccessibleTextContentChangeGLibType, libs, "gtk_accessible_text_content_change_get_type") core.PuregoSafeRegister(&xAccessibleTextGranularityGLibType, libs, "gtk_accessible_text_granularity_get_type") core.PuregoSafeRegister(&xAccessibleTextGLibType, libs, "gtk_accessible_text_get_type") core.PuregoSafeRegister(&XGtkAccessibleTextUpdateCaretPosition, libs, "gtk_accessible_text_update_caret_position") core.PuregoSafeRegister(&XGtkAccessibleTextUpdateContents, libs, "gtk_accessible_text_update_contents") core.PuregoSafeRegister(&XGtkAccessibleTextUpdateSelectionBound, libs, "gtk_accessible_text_update_selection_bound") }