// Package gio was automatically generated by github.com/bnema/puregotk DO NOT EDIT package gio 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" "github.com/bnema/puregotk/v4/gobject/types" ) type EmblemClass struct { _ structs.HostLayout } func (x *EmblemClass) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } // `GEmblem` is an implementation of [iface@Gio.Icon] that supports // having an emblem, which is an icon with additional properties. // It can than be added to a [class@Gio.EmblemedIcon]. // // Currently, only metainformation about the emblem's origin is // supported. More may be added in the future. type Emblem struct { gobject.Object } var xEmblemGLibType func() types.GType func EmblemGLibType() types.GType { return xEmblemGLibType() } func EmblemNewFromInternalPtr(ptr uintptr) *Emblem { cls := &Emblem{} cls.Ptr = ptr return cls } var xNewEmblem func(uintptr) uintptr // Creates a new emblem for @icon. func NewEmblem(IconVar Icon) *Emblem { var cls *Emblem cret := xNewEmblem(IconVar.GoPointer()) if cret == 0 { return nil } cls = &Emblem{} cls.Ptr = cret return cls } var xNewEmblemWithOrigin func(uintptr, EmblemOrigin) uintptr // Creates a new emblem for @icon. func NewEmblemWithOrigin(IconVar Icon, OriginVar EmblemOrigin) *Emblem { var cls *Emblem cret := xNewEmblemWithOrigin(IconVar.GoPointer(), OriginVar) if cret == 0 { return nil } cls = &Emblem{} cls.Ptr = cret return cls } var xEmblemGetIcon func(uintptr) uintptr // Gives back the icon from @emblem. func (x *Emblem) GetIcon() *IconBase { var cls *IconBase cret := xEmblemGetIcon(x.GoPointer()) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &IconBase{} cls.Ptr = cret return cls } var xEmblemGetOrigin func(uintptr) EmblemOrigin // Gets the origin of the emblem. func (x *Emblem) GetOrigin() EmblemOrigin { cret := xEmblemGetOrigin(x.GoPointer()) return cret } func (c *Emblem) GoPointer() uintptr { if c == nil { return 0 } return c.Ptr } func (c *Emblem) SetGoPointer(ptr uintptr) { c.Ptr = ptr } // Checks if two icons are equal. func (x *Emblem) Equal(Icon2Var Icon) bool { cret := XGIconEqual(x.GoPointer(), Icon2Var.GoPointer()) return cret } // Gets a hash for an icon. func (x *Emblem) Hash() uint { cret := XGIconHash(x.GoPointer()) return cret } // Serializes a #GIcon into a #GVariant. An equivalent #GIcon can be retrieved // back by calling g_icon_deserialize() on the returned value. // As serialization will avoid using raw icon data when possible, it only // makes sense to transfer the #GVariant between processes on the same machine, // (as opposed to over the network), and within the same file system namespace. func (x *Emblem) Serialize() *glib.Variant { cret := XGIconSerialize(x.GoPointer()) return cret } // Generates a textual representation of @icon that can be used for // serialization such as when passing @icon to a different process or // saving it to persistent storage. Use g_icon_new_for_string() to // get @icon back from the returned string. // // The encoding of the returned string is proprietary to #GIcon except // in the following two cases // // - If @icon is a #GFileIcon, the returned string is a native path // (such as `/path/to/my icon.png`) without escaping // if the #GFile for @icon is a native file. If the file is not // native, the returned string is the result of g_file_get_uri() // (such as `sftp://path/to/my%20icon.png`). // // - If @icon is a #GThemedIcon with exactly one name and no fallbacks, // the encoding is simply the name (such as `network-server`). func (x *Emblem) ToString() string { cret := XGIconToString(x.GoPointer()) return cret } func init() { core.SetPackageName("GIO", "gio-2.0") core.SetSharedLibraries("GIO", []string{"libgio-2.0.so.0"}) var libs []uintptr for _, libPath := range core.GetPaths("GIO") { lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) if err != nil { panic(err) } libs = append(libs, lib) } core.PuregoSafeRegister(&xEmblemGLibType, libs, "g_emblem_get_type") core.PuregoSafeRegister(&xNewEmblem, libs, "g_emblem_new") core.PuregoSafeRegister(&xNewEmblemWithOrigin, libs, "g_emblem_new_with_origin") core.PuregoSafeRegister(&xEmblemGetIcon, libs, "g_emblem_get_icon") core.PuregoSafeRegister(&xEmblemGetOrigin, libs, "g_emblem_get_origin") }