// 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/gio" "github.com/bnema/puregotk/v4/glib" "github.com/bnema/puregotk/v4/gobject" "github.com/bnema/puregotk/v4/gobject/types" ) // Defines a part of a CSS document. // // Because sections are nested into one another, you can use // [method@CssSection.get_parent] to get the containing region. type CssSection struct { _ structs.HostLayout } var xCssSectionGLibType func() types.GType func CssSectionGLibType() types.GType { return xCssSectionGLibType() } func (x *CssSection) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } var xNewCssSection func(uintptr, *CssLocation, *CssLocation) *CssSection // Creates a new `GtkCssSection` referring to the section // in the given `file` from the `start` location to the // `end` location. func NewCssSection(FileVar gio.File, StartVar *CssLocation, EndVar *CssLocation) *CssSection { cret := xNewCssSection(FileVar.GoPointer(), StartVar, EndVar) return cret } var xNewCssSectionWithBytes func(uintptr, *glib.Bytes, *CssLocation, *CssLocation) *CssSection // Creates a new `GtkCssSection` referring to the section // in the given `file` or the given `bytes` from the `start` location to the // `end` location. func NewCssSectionWithBytes(FileVar gio.File, BytesVar *glib.Bytes, StartVar *CssLocation, EndVar *CssLocation) *CssSection { cret := xNewCssSectionWithBytes(FileVar.GoPointer(), BytesVar, StartVar, EndVar) return cret } var xCssSectionGetBytes func(uintptr) *glib.Bytes // Gets the bytes that @section was parsed from. func (x *CssSection) GetBytes() *glib.Bytes { cret := xCssSectionGetBytes(x.GoPointer()) return cret } var xCssSectionGetEndLocation func(uintptr) *CssLocation // Returns the location in the CSS document where this section ends. func (x *CssSection) GetEndLocation() *CssLocation { cret := xCssSectionGetEndLocation(x.GoPointer()) return cret } var xCssSectionGetFile func(uintptr) uintptr // Gets the file that @section was parsed from. // // If no such file exists, for example because the CSS was loaded via // [method@Gtk.CssProvider.load_from_data], then `NULL` is returned. func (x *CssSection) GetFile() *gio.FileBase { var cls *gio.FileBase cret := xCssSectionGetFile(x.GoPointer()) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &gio.FileBase{} cls.Ptr = cret return cls } var xCssSectionGetParent func(uintptr) *CssSection // Gets the parent section for the given `section`. // // The parent section is the section that contains this `section`. A special // case are sections of type `GTK_CSS_SECTION_DOCUMENT`. Their parent will // either be `NULL` if they are the original CSS document that was loaded by // [method@Gtk.CssProvider.load_from_file] or a section of type // `GTK_CSS_SECTION_IMPORT` if it was loaded with an `@import` rule from // a different file. func (x *CssSection) GetParent() *CssSection { cret := xCssSectionGetParent(x.GoPointer()) return cret } var xCssSectionGetStartLocation func(uintptr) *CssLocation // Returns the location in the CSS document where this section starts. func (x *CssSection) GetStartLocation() *CssLocation { cret := xCssSectionGetStartLocation(x.GoPointer()) return cret } var xCssSectionPrint func(uintptr, *glib.String) // Prints the `section` into `string` in a human-readable form. // // This is a form like `gtk.css:32:1-23` to denote line 32, characters // 1 to 23 in the file `gtk.css`. func (x *CssSection) Print(StringVar *glib.String) { xCssSectionPrint(x.GoPointer(), StringVar) } var xCssSectionRef func(uintptr) *CssSection // Increments the reference count on `section`. func (x *CssSection) Ref() *CssSection { cret := xCssSectionRef(x.GoPointer()) return cret } var xCssSectionToString func(uintptr) string // Prints the section into a human-readable text form using // [method@Gtk.CssSection.print]. func (x *CssSection) ToString() string { cret := xCssSectionToString(x.GoPointer()) return cret } var xCssSectionUnref func(uintptr) // Decrements the reference count on `section`, freeing the // structure if the reference count reaches 0. func (x *CssSection) Unref() { xCssSectionUnref(x.GoPointer()) } 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(&xCssSectionGLibType, libs, "gtk_css_section_get_type") core.PuregoSafeRegister(&xNewCssSection, libs, "gtk_css_section_new") core.PuregoSafeRegister(&xNewCssSectionWithBytes, libs, "gtk_css_section_new_with_bytes") core.PuregoSafeRegister(&xCssSectionGetBytes, libs, "gtk_css_section_get_bytes") core.PuregoSafeRegister(&xCssSectionGetEndLocation, libs, "gtk_css_section_get_end_location") core.PuregoSafeRegister(&xCssSectionGetFile, libs, "gtk_css_section_get_file") core.PuregoSafeRegister(&xCssSectionGetParent, libs, "gtk_css_section_get_parent") core.PuregoSafeRegister(&xCssSectionGetStartLocation, libs, "gtk_css_section_get_start_location") core.PuregoSafeRegister(&xCssSectionPrint, libs, "gtk_css_section_print") core.PuregoSafeRegister(&xCssSectionRef, libs, "gtk_css_section_ref") core.PuregoSafeRegister(&xCssSectionToString, libs, "gtk_css_section_to_string") core.PuregoSafeRegister(&xCssSectionUnref, libs, "gtk_css_section_unref") }